File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export const makeRpcCaller =
8
8
const res = ( await transport ( {
9
9
payload : {
10
10
jsonrpc : "2.0" ,
11
- id : "helius-custom " ,
11
+ id : "helius-sdk " ,
12
12
method,
13
13
params,
14
14
} ,
Original file line number Diff line number Diff line change @@ -103,8 +103,23 @@ export const createHelius = ({
103
103
104
104
const solanaApi = createSolanaRpcApi ( DEFAULT_RPC_CONFIG ) ;
105
105
const transport = createDefaultRpcTransport ( { url } ) ;
106
+ const customTransport = async < TResponse > (
107
+ request : Parameters < typeof transport > [ 0 ]
108
+ ) : Promise < TResponse > => {
109
+ const payload = {
110
+ ...( request . payload as Record < string , unknown > ) ,
111
+ id : "helius-sdk" ,
112
+ } ;
113
+
114
+ const modifiedRequest = {
115
+ ...request ,
116
+ payload,
117
+ } ;
118
+
119
+ return transport ( modifiedRequest ) as Promise < TResponse > ;
120
+ } ;
106
121
107
- const baseRpc = createRpc ( { api : solanaApi , transport } ) ;
122
+ const baseRpc = createRpc ( { api : solanaApi , transport : customTransport } ) ;
108
123
const raw : ResolvedHeliusRpcApi = wrapAutoSend ( baseRpc ) ;
109
124
110
125
const wsUrl = new URL ( url ) ;
You can’t perform that action at this time.
0 commit comments