@gmx-io/sdk 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +98 -20
  2. package/build/scripts/prebuild/index.d.ts +1 -0
  3. package/build/scripts/prebuild/index.js +7 -0
  4. package/build/scripts/prebuild/prebuildMarketConfigKeys.d.ts +1 -0
  5. package/build/scripts/prebuild/prebuildMarketConfigKeys.js +18 -0
  6. package/build/scripts/prebuild/prebuildMarketValuesKeys.d.ts +1 -0
  7. package/build/scripts/prebuild/prebuildMarketValuesKeys.js +18 -0
  8. package/build/src/configs/markets.d.ts +1 -2
  9. package/build/src/index.d.ts +2 -0
  10. package/build/src/index.js +7 -4
  11. package/build/src/modules/accounts/accounts.spec.js +1 -1
  12. package/build/src/modules/base.d.ts +3 -4
  13. package/build/src/modules/base.js +1 -1
  14. package/build/src/modules/markets/index.d.ts +4 -19
  15. package/build/src/modules/markets/index.js +72 -76
  16. package/build/src/modules/markets/markets.spec.js +14 -9
  17. package/build/src/modules/markets/query-builders.d.ts +2 -2
  18. package/build/src/modules/markets/query-builders.js +2 -0
  19. package/build/src/modules/markets/types.d.ts +0 -2
  20. package/build/src/modules/oracle.d.ts +2 -9
  21. package/build/src/modules/orders/orders.d.ts +2 -1
  22. package/build/src/modules/orders/orders.js +2 -2
  23. package/build/src/modules/orders/orders.spec.js +1 -1
  24. package/build/src/modules/orders/transactions/createIncreaseOrderTxn.js +0 -1
  25. package/build/src/modules/orders/transactions/createSwapOrderTxn.d.ts +1 -1
  26. package/build/src/modules/orders/transactions/createSwapOrderTxn.js +13 -31
  27. package/build/src/modules/positions/positions.spec.js +1 -1
  28. package/build/src/modules/tokens/tokens.d.ts +6 -13
  29. package/build/src/modules/tokens/tokens.js +8 -3
  30. package/build/src/modules/tokens/tokens.spec.js +16 -9
  31. package/build/src/modules/trades/trades.js +0 -3
  32. package/build/src/modules/trades/trades.spec.js +1 -1
  33. package/build/src/types/markets.d.ts +7 -0
  34. package/build/src/types/sdk.d.ts +12 -20
  35. package/build/src/utils/contracts.d.ts +15 -0
  36. package/build/src/utils/contracts.js +87 -0
  37. package/build/src/utils/marketKeysAndConfigs.d.ts +3 -3
  38. package/build/src/utils/marketKeysAndConfigs.js +2 -2
  39. package/build/src/utils/markets.d.ts +1 -1
  40. package/build/src/utils/markets.js +2 -2
  41. package/build/src/utils/multicall.js +2 -0
  42. package/build/src/utils/simulateExecuteOrder.js +11 -7
  43. package/build/src/utils/testUtil.d.ts +575 -0
  44. package/build/src/utils/{test.js → testUtil.js} +4 -7
  45. package/build/tsconfig.tsbuildinfo +1 -1
  46. package/package.json +75 -91
  47. package/build/src/utils/test.d.ts +0 -2
@@ -0,0 +1,575 @@
1
+ import { GmxSdk } from "../index";
2
+ export declare const arbitrumSdkConfig: {
3
+ chainId: number;
4
+ account: string;
5
+ oracleUrl: string;
6
+ rpcUrl: string;
7
+ walletClient: import("viem").Client<import("viem").HttpTransport, import("viem").Chain, undefined, import("viem").TestRpcSchema<"hardhat">, {
8
+ addChain: (args: import("viem").AddChainParameters) => Promise<void>;
9
+ deployContract: <const abi extends readonly unknown[] | import("viem").Abi, chainOverride extends import("viem").Chain | undefined>(args: import("viem").DeployContractParameters<abi, import("viem").Chain, undefined, chainOverride>) => Promise<`0x${string}`>;
10
+ getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
11
+ getChainId: () => Promise<number>;
12
+ getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
13
+ prepareTransactionRequest: <TParameterType extends import("viem").PrepareTransactionRequestParameterType, TChainOverride extends import("viem").Chain | undefined = undefined, TAccountOverride extends `0x${string}` | import("viem").Account | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<import("viem").Chain, undefined, TChainOverride, TAccountOverride, TParameterType>) => Promise<import("viem").PrepareTransactionRequestReturnType<import("viem").Chain, undefined, TChainOverride, TAccountOverride, TParameterType>>;
14
+ requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
15
+ requestPermissions: (args: {
16
+ [x: string]: Record<string, any>;
17
+ eth_accounts: Record<string, any>;
18
+ }) => Promise<import("viem").RequestPermissionsReturnType>;
19
+ sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<`0x${string}`>;
20
+ sendTransaction: <TChainOverride_1 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<import("viem").Chain, undefined, TChainOverride_1>) => Promise<`0x${string}`>;
21
+ signMessage: (args: import("viem").SignMessageParameters<undefined>) => Promise<`0x${string}`>;
22
+ signTransaction: <TChainOverride_2 extends import("viem").Chain | undefined>(args: import("viem").SignTransactionParameters<import("viem").Chain, undefined, TChainOverride_2>) => Promise<`0x${string}`>;
23
+ signTypedData: <const TTypedData extends {
24
+ [x: string]: readonly import("viem").TypedDataParameter[];
25
+ [x: `string[${string}]`]: undefined;
26
+ [x: `function[${string}]`]: undefined;
27
+ [x: `address[${string}]`]: undefined;
28
+ [x: `uint8[${string}]`]: undefined;
29
+ [x: `uint256[${string}]`]: undefined;
30
+ [x: `bytes32[${string}]`]: undefined;
31
+ [x: `bool[${string}]`]: undefined;
32
+ [x: `uint32[${string}]`]: undefined;
33
+ [x: `uint224[${string}]`]: undefined;
34
+ [x: `uint48[${string}]`]: undefined;
35
+ [x: `bytes1[${string}]`]: undefined;
36
+ [x: `bytes[${string}]`]: undefined;
37
+ [x: `bytes5[${string}]`]: undefined;
38
+ [x: `bytes10[${string}]`]: undefined;
39
+ [x: `bytes18[${string}]`]: undefined;
40
+ [x: `bytes4[${string}]`]: undefined;
41
+ [x: `bytes31[${string}]`]: undefined;
42
+ [x: `bytes30[${string}]`]: undefined;
43
+ [x: `bytes29[${string}]`]: undefined;
44
+ [x: `bytes28[${string}]`]: undefined;
45
+ [x: `bytes27[${string}]`]: undefined;
46
+ [x: `bytes26[${string}]`]: undefined;
47
+ [x: `bytes25[${string}]`]: undefined;
48
+ [x: `bytes24[${string}]`]: undefined;
49
+ [x: `bytes23[${string}]`]: undefined;
50
+ [x: `bytes22[${string}]`]: undefined;
51
+ [x: `bytes21[${string}]`]: undefined;
52
+ [x: `bytes20[${string}]`]: undefined;
53
+ [x: `bytes19[${string}]`]: undefined;
54
+ [x: `bytes2[${string}]`]: undefined;
55
+ [x: `bytes17[${string}]`]: undefined;
56
+ [x: `bytes16[${string}]`]: undefined;
57
+ [x: `bytes15[${string}]`]: undefined;
58
+ [x: `bytes14[${string}]`]: undefined;
59
+ [x: `bytes13[${string}]`]: undefined;
60
+ [x: `bytes12[${string}]`]: undefined;
61
+ [x: `bytes11[${string}]`]: undefined;
62
+ [x: `bytes9[${string}]`]: undefined;
63
+ [x: `bytes8[${string}]`]: undefined;
64
+ [x: `bytes7[${string}]`]: undefined;
65
+ [x: `bytes6[${string}]`]: undefined;
66
+ [x: `bytes3[${string}]`]: undefined;
67
+ [x: `int[${string}]`]: undefined;
68
+ [x: `int40[${string}]`]: undefined;
69
+ [x: `int32[${string}]`]: undefined;
70
+ [x: `int24[${string}]`]: undefined;
71
+ [x: `int16[${string}]`]: undefined;
72
+ [x: `int8[${string}]`]: undefined;
73
+ [x: `int48[${string}]`]: undefined;
74
+ [x: `int56[${string}]`]: undefined;
75
+ [x: `int64[${string}]`]: undefined;
76
+ [x: `int72[${string}]`]: undefined;
77
+ [x: `int80[${string}]`]: undefined;
78
+ [x: `int88[${string}]`]: undefined;
79
+ [x: `int96[${string}]`]: undefined;
80
+ [x: `int104[${string}]`]: undefined;
81
+ [x: `int112[${string}]`]: undefined;
82
+ [x: `int120[${string}]`]: undefined;
83
+ [x: `int128[${string}]`]: undefined;
84
+ [x: `int136[${string}]`]: undefined;
85
+ [x: `int144[${string}]`]: undefined;
86
+ [x: `int152[${string}]`]: undefined;
87
+ [x: `int160[${string}]`]: undefined;
88
+ [x: `int168[${string}]`]: undefined;
89
+ [x: `int176[${string}]`]: undefined;
90
+ [x: `int184[${string}]`]: undefined;
91
+ [x: `int192[${string}]`]: undefined;
92
+ [x: `int200[${string}]`]: undefined;
93
+ [x: `int208[${string}]`]: undefined;
94
+ [x: `int216[${string}]`]: undefined;
95
+ [x: `int224[${string}]`]: undefined;
96
+ [x: `int232[${string}]`]: undefined;
97
+ [x: `int240[${string}]`]: undefined;
98
+ [x: `int248[${string}]`]: undefined;
99
+ [x: `int256[${string}]`]: undefined;
100
+ [x: `uint[${string}]`]: undefined;
101
+ [x: `uint40[${string}]`]: undefined;
102
+ [x: `uint24[${string}]`]: undefined;
103
+ [x: `uint16[${string}]`]: undefined;
104
+ [x: `uint56[${string}]`]: undefined;
105
+ [x: `uint64[${string}]`]: undefined;
106
+ [x: `uint72[${string}]`]: undefined;
107
+ [x: `uint80[${string}]`]: undefined;
108
+ [x: `uint88[${string}]`]: undefined;
109
+ [x: `uint96[${string}]`]: undefined;
110
+ [x: `uint104[${string}]`]: undefined;
111
+ [x: `uint112[${string}]`]: undefined;
112
+ [x: `uint120[${string}]`]: undefined;
113
+ [x: `uint128[${string}]`]: undefined;
114
+ [x: `uint136[${string}]`]: undefined;
115
+ [x: `uint144[${string}]`]: undefined;
116
+ [x: `uint152[${string}]`]: undefined;
117
+ [x: `uint160[${string}]`]: undefined;
118
+ [x: `uint168[${string}]`]: undefined;
119
+ [x: `uint176[${string}]`]: undefined;
120
+ [x: `uint184[${string}]`]: undefined;
121
+ [x: `uint192[${string}]`]: undefined;
122
+ [x: `uint200[${string}]`]: undefined;
123
+ [x: `uint208[${string}]`]: undefined;
124
+ [x: `uint216[${string}]`]: undefined;
125
+ [x: `uint232[${string}]`]: undefined;
126
+ [x: `uint240[${string}]`]: undefined;
127
+ [x: `uint248[${string}]`]: undefined;
128
+ string?: undefined;
129
+ address?: undefined;
130
+ uint8?: undefined;
131
+ uint256?: undefined;
132
+ bytes32?: undefined;
133
+ bool?: undefined;
134
+ uint32?: undefined;
135
+ uint224?: undefined;
136
+ uint48?: undefined;
137
+ bytes1?: undefined;
138
+ bytes?: undefined;
139
+ bytes5?: undefined;
140
+ bytes10?: undefined;
141
+ bytes18?: undefined;
142
+ bytes4?: undefined;
143
+ bytes31?: undefined;
144
+ bytes30?: undefined;
145
+ bytes29?: undefined;
146
+ bytes28?: undefined;
147
+ bytes27?: undefined;
148
+ bytes26?: undefined;
149
+ bytes25?: undefined;
150
+ bytes24?: undefined;
151
+ bytes23?: undefined;
152
+ bytes22?: undefined;
153
+ bytes21?: undefined;
154
+ bytes20?: undefined;
155
+ bytes19?: undefined;
156
+ bytes2?: undefined;
157
+ bytes17?: undefined;
158
+ bytes16?: undefined;
159
+ bytes15?: undefined;
160
+ bytes14?: undefined;
161
+ bytes13?: undefined;
162
+ bytes12?: undefined;
163
+ bytes11?: undefined;
164
+ bytes9?: undefined;
165
+ bytes8?: undefined;
166
+ bytes7?: undefined;
167
+ bytes6?: undefined;
168
+ bytes3?: undefined;
169
+ int40?: undefined;
170
+ int32?: undefined;
171
+ int24?: undefined;
172
+ int16?: undefined;
173
+ int8?: undefined;
174
+ int48?: undefined;
175
+ int56?: undefined;
176
+ int64?: undefined;
177
+ int72?: undefined;
178
+ int80?: undefined;
179
+ int88?: undefined;
180
+ int96?: undefined;
181
+ int104?: undefined;
182
+ int112?: undefined;
183
+ int120?: undefined;
184
+ int128?: undefined;
185
+ int136?: undefined;
186
+ int144?: undefined;
187
+ int152?: undefined;
188
+ int160?: undefined;
189
+ int168?: undefined;
190
+ int176?: undefined;
191
+ int184?: undefined;
192
+ int192?: undefined;
193
+ int200?: undefined;
194
+ int208?: undefined;
195
+ int216?: undefined;
196
+ int224?: undefined;
197
+ int232?: undefined;
198
+ int240?: undefined;
199
+ int248?: undefined;
200
+ int256?: undefined;
201
+ uint40?: undefined;
202
+ uint24?: undefined;
203
+ uint16?: undefined;
204
+ uint56?: undefined;
205
+ uint64?: undefined;
206
+ uint72?: undefined;
207
+ uint80?: undefined;
208
+ uint88?: undefined;
209
+ uint96?: undefined;
210
+ uint104?: undefined;
211
+ uint112?: undefined;
212
+ uint120?: undefined;
213
+ uint128?: undefined;
214
+ uint136?: undefined;
215
+ uint144?: undefined;
216
+ uint152?: undefined;
217
+ uint160?: undefined;
218
+ uint168?: undefined;
219
+ uint176?: undefined;
220
+ uint184?: undefined;
221
+ uint192?: undefined;
222
+ uint200?: undefined;
223
+ uint208?: undefined;
224
+ uint216?: undefined;
225
+ uint232?: undefined;
226
+ uint240?: undefined;
227
+ uint248?: undefined;
228
+ } | {
229
+ [key: string]: unknown;
230
+ }, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, undefined>) => Promise<`0x${string}`>;
231
+ switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
232
+ watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
233
+ writeContract: <const abi_1 extends readonly unknown[] | import("viem").Abi, functionName extends import("viem").ContractFunctionName<abi_1, "nonpayable" | "payable">, args extends import("viem").ContractFunctionArgs<abi_1, "nonpayable" | "payable", functionName>, TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem").WriteContractParameters<abi_1, functionName, args, import("viem").Chain, undefined, TChainOverride_3>) => Promise<`0x${string}`>;
234
+ } & {
235
+ call: (parameters: import("viem").CallParameters<import("viem").Chain>) => Promise<import("viem").CallReturnType>;
236
+ createBlockFilter: () => Promise<{
237
+ id: `0x${string}`;
238
+ request: import("viem").EIP1193RequestFn<readonly [{
239
+ Method: "eth_getFilterChanges";
240
+ Parameters: [filterId: `0x${string}`];
241
+ ReturnType: `0x${string}`[] | import("viem").RpcLog[];
242
+ }, {
243
+ Method: "eth_getFilterLogs";
244
+ Parameters: [filterId: `0x${string}`];
245
+ ReturnType: import("viem").RpcLog[];
246
+ }, {
247
+ Method: "eth_uninstallFilter";
248
+ Parameters: [filterId: `0x${string}`];
249
+ ReturnType: boolean;
250
+ }]>;
251
+ type: "block";
252
+ }>;
253
+ createContractEventFilter: <const TAbi extends readonly unknown[] | import("viem").Abi, TEventName extends import("viem").ContractEventName<TAbi> | undefined, TArgs extends import("viem/_types/types/contract").MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends bigint | import("viem").BlockTag | undefined = undefined, TToBlock extends bigint | import("viem").BlockTag | undefined = undefined>(args: import("viem").CreateContractEventFilterParameters<TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>) => Promise<import("viem").CreateContractEventFilterReturnType<TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>>;
254
+ createEventFilter: <const TAbiEvent extends import("abitype").AbiEvent | undefined = undefined, const TAbiEvents extends readonly unknown[] | readonly import("abitype").AbiEvent[] | undefined = TAbiEvent extends import("abitype").AbiEvent ? [TAbiEvent] : undefined, TStrict_1 extends boolean | undefined = undefined, TFromBlock_1 extends bigint | import("viem").BlockTag | undefined = undefined, TToBlock_1 extends bigint | import("viem").BlockTag | undefined = undefined, _EventName extends string | undefined = import("viem/_types/types/contract").MaybeAbiEventName<TAbiEvent>, _Args extends import("viem/_types/types/contract").MaybeExtractEventArgsFromAbi<TAbiEvents, _EventName> | undefined = undefined>(args?: import("viem").CreateEventFilterParameters<TAbiEvent, TAbiEvents, TStrict_1, TFromBlock_1, TToBlock_1, _EventName, _Args> | undefined) => Promise<import("viem").Filter<"event", TAbiEvents, _EventName, _Args, TStrict_1, TFromBlock_1, TToBlock_1> extends infer T ? { [K in keyof T]: import("viem").Filter<"event", TAbiEvents, _EventName, _Args, TStrict_1, TFromBlock_1, TToBlock_1>[K]; } : never>;
255
+ createPendingTransactionFilter: () => Promise<{
256
+ id: `0x${string}`;
257
+ request: import("viem").EIP1193RequestFn<readonly [{
258
+ Method: "eth_getFilterChanges";
259
+ Parameters: [filterId: `0x${string}`];
260
+ ReturnType: `0x${string}`[] | import("viem").RpcLog[];
261
+ }, {
262
+ Method: "eth_getFilterLogs";
263
+ Parameters: [filterId: `0x${string}`];
264
+ ReturnType: import("viem").RpcLog[];
265
+ }, {
266
+ Method: "eth_uninstallFilter";
267
+ Parameters: [filterId: `0x${string}`];
268
+ ReturnType: boolean;
269
+ }]>;
270
+ type: "transaction";
271
+ }>;
272
+ estimateContractGas: <TChain extends import("viem").Chain | undefined, const abi_2 extends readonly unknown[] | import("viem").Abi, functionName_1 extends import("viem").ContractFunctionName<abi_2, "nonpayable" | "payable">, args_1 extends import("viem").ContractFunctionArgs<abi_2, "nonpayable" | "payable", functionName_1>>(args: import("viem").EstimateContractGasParameters<abi_2, functionName_1, args_1, TChain>) => Promise<bigint>;
273
+ estimateGas: (args: import("viem").EstimateGasParameters<import("viem").Chain>) => Promise<bigint>;
274
+ getBalance: (args: import("viem").GetBalanceParameters) => Promise<bigint>;
275
+ getBlock: <TIncludeTransactions extends boolean = false, TBlockTag extends import("viem").BlockTag = "latest">(args?: import("viem").GetBlockParameters<TIncludeTransactions, TBlockTag> | undefined) => Promise<{
276
+ number: TBlockTag extends "pending" ? null : bigint;
277
+ nonce: TBlockTag extends "pending" ? null : `0x${string}`;
278
+ hash: TBlockTag extends "pending" ? null : `0x${string}`;
279
+ timestamp: bigint;
280
+ logsBloom: TBlockTag extends "pending" ? null : `0x${string}`;
281
+ baseFeePerGas: bigint | null;
282
+ blobGasUsed: bigint;
283
+ difficulty: bigint;
284
+ excessBlobGas: bigint;
285
+ extraData: `0x${string}`;
286
+ gasLimit: bigint;
287
+ gasUsed: bigint;
288
+ miner: `0x${string}`;
289
+ mixHash: `0x${string}`;
290
+ parentHash: `0x${string}`;
291
+ receiptsRoot: `0x${string}`;
292
+ sealFields: `0x${string}`[];
293
+ sha3Uncles: `0x${string}`;
294
+ size: bigint;
295
+ stateRoot: `0x${string}`;
296
+ totalDifficulty: bigint | null;
297
+ transactionsRoot: `0x${string}`;
298
+ uncles: `0x${string}`[];
299
+ withdrawals?: import("viem").Withdrawal[] | undefined;
300
+ withdrawalsRoot?: `0x${string}` | undefined;
301
+ transactions: TIncludeTransactions extends true ? ({
302
+ value: bigint;
303
+ from: `0x${string}`;
304
+ to: `0x${string}` | null;
305
+ nonce: number;
306
+ v: bigint;
307
+ r: `0x${string}`;
308
+ s: `0x${string}`;
309
+ chainId?: number | undefined;
310
+ type: "legacy";
311
+ gasPrice: bigint;
312
+ maxFeePerBlobGas?: undefined;
313
+ maxFeePerGas?: undefined;
314
+ maxPriorityFeePerGas?: undefined;
315
+ gas: bigint;
316
+ accessList?: undefined;
317
+ hash: `0x${string}`;
318
+ yParity?: undefined;
319
+ input: `0x${string}`;
320
+ typeHex: `0x${string}` | null;
321
+ blobVersionedHashes?: undefined;
322
+ blockNumber: (TBlockTag extends "pending" ? true : false) extends infer T_1 ? T_1 extends (TBlockTag extends "pending" ? true : false) ? T_1 extends true ? null : bigint : never : never;
323
+ blockHash: (TBlockTag extends "pending" ? true : false) extends infer T_2 ? T_2 extends (TBlockTag extends "pending" ? true : false) ? T_2 extends true ? null : `0x${string}` : never : never;
324
+ transactionIndex: (TBlockTag extends "pending" ? true : false) extends infer T_3 ? T_3 extends (TBlockTag extends "pending" ? true : false) ? T_3 extends true ? null : number : never : never;
325
+ } | {
326
+ value: bigint;
327
+ from: `0x${string}`;
328
+ to: `0x${string}` | null;
329
+ nonce: number;
330
+ v: bigint;
331
+ r: `0x${string}`;
332
+ s: `0x${string}`;
333
+ chainId: number;
334
+ type: "eip2930";
335
+ gasPrice: bigint;
336
+ maxFeePerBlobGas?: undefined;
337
+ maxFeePerGas?: undefined;
338
+ maxPriorityFeePerGas?: undefined;
339
+ gas: bigint;
340
+ accessList: import("viem").AccessList;
341
+ hash: `0x${string}`;
342
+ yParity: number;
343
+ input: `0x${string}`;
344
+ typeHex: `0x${string}` | null;
345
+ blobVersionedHashes?: undefined;
346
+ blockNumber: (TBlockTag extends "pending" ? true : false) extends infer T_4 ? T_4 extends (TBlockTag extends "pending" ? true : false) ? T_4 extends true ? null : bigint : never : never;
347
+ blockHash: (TBlockTag extends "pending" ? true : false) extends infer T_5 ? T_5 extends (TBlockTag extends "pending" ? true : false) ? T_5 extends true ? null : `0x${string}` : never : never;
348
+ transactionIndex: (TBlockTag extends "pending" ? true : false) extends infer T_6 ? T_6 extends (TBlockTag extends "pending" ? true : false) ? T_6 extends true ? null : number : never : never;
349
+ } | {
350
+ value: bigint;
351
+ from: `0x${string}`;
352
+ to: `0x${string}` | null;
353
+ nonce: number;
354
+ v: bigint;
355
+ r: `0x${string}`;
356
+ s: `0x${string}`;
357
+ chainId: number;
358
+ type: "eip1559";
359
+ gasPrice?: undefined;
360
+ maxFeePerBlobGas?: undefined;
361
+ maxFeePerGas: bigint;
362
+ maxPriorityFeePerGas: bigint;
363
+ gas: bigint;
364
+ accessList: import("viem").AccessList;
365
+ hash: `0x${string}`;
366
+ yParity: number;
367
+ input: `0x${string}`;
368
+ typeHex: `0x${string}` | null;
369
+ blobVersionedHashes?: undefined;
370
+ blockNumber: (TBlockTag extends "pending" ? true : false) extends infer T_7 ? T_7 extends (TBlockTag extends "pending" ? true : false) ? T_7 extends true ? null : bigint : never : never;
371
+ blockHash: (TBlockTag extends "pending" ? true : false) extends infer T_8 ? T_8 extends (TBlockTag extends "pending" ? true : false) ? T_8 extends true ? null : `0x${string}` : never : never;
372
+ transactionIndex: (TBlockTag extends "pending" ? true : false) extends infer T_9 ? T_9 extends (TBlockTag extends "pending" ? true : false) ? T_9 extends true ? null : number : never : never;
373
+ } | {
374
+ value: bigint;
375
+ from: `0x${string}`;
376
+ to: `0x${string}` | null;
377
+ nonce: number;
378
+ v: bigint;
379
+ r: `0x${string}`;
380
+ s: `0x${string}`;
381
+ chainId: number;
382
+ type: "eip4844";
383
+ gasPrice?: undefined;
384
+ maxFeePerBlobGas: bigint;
385
+ maxFeePerGas: bigint;
386
+ maxPriorityFeePerGas: bigint;
387
+ gas: bigint;
388
+ accessList: import("viem").AccessList;
389
+ hash: `0x${string}`;
390
+ yParity: number;
391
+ input: `0x${string}`;
392
+ typeHex: `0x${string}` | null;
393
+ blobVersionedHashes: `0x${string}`[];
394
+ blockNumber: (TBlockTag extends "pending" ? true : false) extends infer T_10 ? T_10 extends (TBlockTag extends "pending" ? true : false) ? T_10 extends true ? null : bigint : never : never;
395
+ blockHash: (TBlockTag extends "pending" ? true : false) extends infer T_11 ? T_11 extends (TBlockTag extends "pending" ? true : false) ? T_11 extends true ? null : `0x${string}` : never : never;
396
+ transactionIndex: (TBlockTag extends "pending" ? true : false) extends infer T_12 ? T_12 extends (TBlockTag extends "pending" ? true : false) ? T_12 extends true ? null : number : never : never;
397
+ })[] : `0x${string}`[];
398
+ }>;
399
+ getBlockNumber: (args?: import("viem").GetBlockNumberParameters | undefined) => Promise<bigint>;
400
+ getBlockTransactionCount: (args?: import("viem").GetBlockTransactionCountParameters | undefined) => Promise<number>;
401
+ getBytecode: (args: import("viem").GetBytecodeParameters) => Promise<import("viem").GetBytecodeReturnType>;
402
+ getChainId: () => Promise<number>;
403
+ getContractEvents: <const abi_3 extends readonly unknown[] | import("viem").Abi, eventName extends import("viem").ContractEventName<abi_3> | undefined = undefined, strict extends boolean | undefined = undefined, fromBlock extends bigint | import("viem").BlockTag | undefined = undefined, toBlock extends bigint | import("viem").BlockTag | undefined = undefined>(args: import("viem").GetContractEventsParameters<abi_3, eventName, strict, fromBlock, toBlock>) => Promise<import("viem").GetContractEventsReturnType<abi_3, eventName, strict, fromBlock, toBlock>>;
404
+ getEnsAddress: (args: {
405
+ blockNumber?: bigint | undefined;
406
+ blockTag?: import("viem").BlockTag | undefined;
407
+ coinType?: number | undefined;
408
+ gatewayUrls?: string[] | undefined;
409
+ name: string;
410
+ strict?: boolean | undefined;
411
+ universalResolverAddress?: `0x${string}` | undefined;
412
+ }) => Promise<import("viem").GetEnsAddressReturnType>;
413
+ getEnsAvatar: (args: {
414
+ name: string;
415
+ blockNumber?: bigint | undefined;
416
+ blockTag?: import("viem").BlockTag | undefined;
417
+ gatewayUrls?: string[] | undefined;
418
+ strict?: boolean | undefined;
419
+ universalResolverAddress?: `0x${string}` | undefined;
420
+ assetGatewayUrls?: import("viem").AssetGatewayUrls | undefined;
421
+ }) => Promise<import("viem/_types/actions/ens/getEnsAvatar").GetEnsAvatarReturnType>;
422
+ getEnsName: (args: {
423
+ blockNumber?: bigint | undefined;
424
+ blockTag?: import("viem").BlockTag | undefined;
425
+ address: `0x${string}`;
426
+ gatewayUrls?: string[] | undefined;
427
+ strict?: boolean | undefined;
428
+ universalResolverAddress?: `0x${string}` | undefined;
429
+ }) => Promise<import("viem").GetEnsNameReturnType>;
430
+ getEnsResolver: (args: {
431
+ blockNumber?: bigint | undefined;
432
+ blockTag?: import("viem").BlockTag | undefined;
433
+ name: string;
434
+ universalResolverAddress?: `0x${string}` | undefined;
435
+ }) => Promise<`0x${string}`>;
436
+ getEnsText: (args: {
437
+ blockNumber?: bigint | undefined;
438
+ blockTag?: import("viem").BlockTag | undefined;
439
+ name: string;
440
+ gatewayUrls?: string[] | undefined;
441
+ key: string;
442
+ strict?: boolean | undefined;
443
+ universalResolverAddress?: `0x${string}` | undefined;
444
+ }) => Promise<import("viem/_types/actions/ens/getEnsText").GetEnsTextReturnType>;
445
+ getFeeHistory: (args: import("viem").GetFeeHistoryParameters) => Promise<import("viem").GetFeeHistoryReturnType>;
446
+ estimateFeesPerGas: <TChainOverride_4 extends import("viem").Chain | undefined = undefined, TType extends import("viem").FeeValuesType = "eip1559">(args?: import("viem").EstimateFeesPerGasParameters<import("viem").Chain, TChainOverride_4, TType> | undefined) => Promise<import("viem").EstimateFeesPerGasReturnType>;
447
+ getFilterChanges: <TFilterType extends import("viem/_types/types/filter").FilterType, const TAbi_1 extends readonly unknown[] | import("viem").Abi | undefined, TEventName_1 extends string | undefined, TStrict_2 extends boolean | undefined = undefined, TFromBlock_2 extends bigint | import("viem").BlockTag | undefined = undefined, TToBlock_2 extends bigint | import("viem").BlockTag | undefined = undefined>(args: import("viem").GetFilterChangesParameters<TFilterType, TAbi_1, TEventName_1, TStrict_2, TFromBlock_2, TToBlock_2>) => Promise<import("viem").GetFilterChangesReturnType<TFilterType, TAbi_1, TEventName_1, TStrict_2, TFromBlock_2, TToBlock_2>>;
448
+ getFilterLogs: <const TAbi_2 extends readonly unknown[] | import("viem").Abi | undefined, TEventName_2 extends string | undefined, TStrict_3 extends boolean | undefined = undefined, TFromBlock_3 extends bigint | import("viem").BlockTag | undefined = undefined, TToBlock_3 extends bigint | import("viem").BlockTag | undefined = undefined>(args: import("viem").GetFilterLogsParameters<TAbi_2, TEventName_2, TStrict_3, TFromBlock_3, TToBlock_3>) => Promise<import("viem").GetFilterLogsReturnType<TAbi_2, TEventName_2, TStrict_3, TFromBlock_3, TToBlock_3>>;
449
+ getGasPrice: () => Promise<bigint>;
450
+ getLogs: <const TAbiEvent_1 extends import("abitype").AbiEvent | undefined = undefined, const TAbiEvents_1 extends readonly unknown[] | readonly import("abitype").AbiEvent[] | undefined = TAbiEvent_1 extends import("abitype").AbiEvent ? [TAbiEvent_1] : undefined, TStrict_4 extends boolean | undefined = undefined, TFromBlock_4 extends bigint | import("viem").BlockTag | undefined = undefined, TToBlock_4 extends bigint | import("viem").BlockTag | undefined = undefined>(args?: import("viem").GetLogsParameters<TAbiEvent_1, TAbiEvents_1, TStrict_4, TFromBlock_4, TToBlock_4> | undefined) => Promise<import("viem").GetLogsReturnType<TAbiEvent_1, TAbiEvents_1, TStrict_4, TFromBlock_4, TToBlock_4>>;
451
+ getProof: (args: import("viem").GetProofParameters) => Promise<import("viem").GetProofReturnType>;
452
+ estimateMaxPriorityFeePerGas: <TChainOverride_5 extends import("viem").Chain | undefined = undefined>(args?: {
453
+ chain?: TChainOverride_5 | null | undefined;
454
+ } | undefined) => Promise<bigint>;
455
+ getStorageAt: (args: import("viem").GetStorageAtParameters) => Promise<import("viem").GetStorageAtReturnType>;
456
+ getTransaction: <TBlockTag_1 extends import("viem").BlockTag = "latest">(args: import("viem").GetTransactionParameters<TBlockTag_1>) => Promise<{
457
+ value: bigint;
458
+ from: `0x${string}`;
459
+ to: `0x${string}` | null;
460
+ nonce: number;
461
+ v: bigint;
462
+ r: `0x${string}`;
463
+ s: `0x${string}`;
464
+ chainId?: number | undefined;
465
+ type: "legacy";
466
+ gasPrice: bigint;
467
+ maxFeePerBlobGas?: undefined;
468
+ maxFeePerGas?: undefined;
469
+ maxPriorityFeePerGas?: undefined;
470
+ gas: bigint;
471
+ accessList?: undefined;
472
+ hash: `0x${string}`;
473
+ yParity?: undefined;
474
+ input: `0x${string}`;
475
+ typeHex: `0x${string}` | null;
476
+ blobVersionedHashes?: undefined;
477
+ blockNumber: (TBlockTag_1 extends "pending" ? true : false) extends infer T_13 ? T_13 extends (TBlockTag_1 extends "pending" ? true : false) ? T_13 extends true ? null : bigint : never : never;
478
+ blockHash: (TBlockTag_1 extends "pending" ? true : false) extends infer T_14 ? T_14 extends (TBlockTag_1 extends "pending" ? true : false) ? T_14 extends true ? null : `0x${string}` : never : never;
479
+ transactionIndex: (TBlockTag_1 extends "pending" ? true : false) extends infer T_15 ? T_15 extends (TBlockTag_1 extends "pending" ? true : false) ? T_15 extends true ? null : number : never : never;
480
+ } | {
481
+ value: bigint;
482
+ from: `0x${string}`;
483
+ to: `0x${string}` | null;
484
+ nonce: number;
485
+ v: bigint;
486
+ r: `0x${string}`;
487
+ s: `0x${string}`;
488
+ chainId: number;
489
+ type: "eip2930";
490
+ gasPrice: bigint;
491
+ maxFeePerBlobGas?: undefined;
492
+ maxFeePerGas?: undefined;
493
+ maxPriorityFeePerGas?: undefined;
494
+ gas: bigint;
495
+ accessList: import("viem").AccessList;
496
+ hash: `0x${string}`;
497
+ yParity: number;
498
+ input: `0x${string}`;
499
+ typeHex: `0x${string}` | null;
500
+ blobVersionedHashes?: undefined;
501
+ blockNumber: (TBlockTag_1 extends "pending" ? true : false) extends infer T_16 ? T_16 extends (TBlockTag_1 extends "pending" ? true : false) ? T_16 extends true ? null : bigint : never : never;
502
+ blockHash: (TBlockTag_1 extends "pending" ? true : false) extends infer T_17 ? T_17 extends (TBlockTag_1 extends "pending" ? true : false) ? T_17 extends true ? null : `0x${string}` : never : never;
503
+ transactionIndex: (TBlockTag_1 extends "pending" ? true : false) extends infer T_18 ? T_18 extends (TBlockTag_1 extends "pending" ? true : false) ? T_18 extends true ? null : number : never : never;
504
+ } | {
505
+ value: bigint;
506
+ from: `0x${string}`;
507
+ to: `0x${string}` | null;
508
+ nonce: number;
509
+ v: bigint;
510
+ r: `0x${string}`;
511
+ s: `0x${string}`;
512
+ chainId: number;
513
+ type: "eip1559";
514
+ gasPrice?: undefined;
515
+ maxFeePerBlobGas?: undefined;
516
+ maxFeePerGas: bigint;
517
+ maxPriorityFeePerGas: bigint;
518
+ gas: bigint;
519
+ accessList: import("viem").AccessList;
520
+ hash: `0x${string}`;
521
+ yParity: number;
522
+ input: `0x${string}`;
523
+ typeHex: `0x${string}` | null;
524
+ blobVersionedHashes?: undefined;
525
+ blockNumber: (TBlockTag_1 extends "pending" ? true : false) extends infer T_19 ? T_19 extends (TBlockTag_1 extends "pending" ? true : false) ? T_19 extends true ? null : bigint : never : never;
526
+ blockHash: (TBlockTag_1 extends "pending" ? true : false) extends infer T_20 ? T_20 extends (TBlockTag_1 extends "pending" ? true : false) ? T_20 extends true ? null : `0x${string}` : never : never;
527
+ transactionIndex: (TBlockTag_1 extends "pending" ? true : false) extends infer T_21 ? T_21 extends (TBlockTag_1 extends "pending" ? true : false) ? T_21 extends true ? null : number : never : never;
528
+ } | {
529
+ value: bigint;
530
+ from: `0x${string}`;
531
+ to: `0x${string}` | null;
532
+ nonce: number;
533
+ v: bigint;
534
+ r: `0x${string}`;
535
+ s: `0x${string}`;
536
+ chainId: number;
537
+ type: "eip4844";
538
+ gasPrice?: undefined;
539
+ maxFeePerBlobGas: bigint;
540
+ maxFeePerGas: bigint;
541
+ maxPriorityFeePerGas: bigint;
542
+ gas: bigint;
543
+ accessList: import("viem").AccessList;
544
+ hash: `0x${string}`;
545
+ yParity: number;
546
+ input: `0x${string}`;
547
+ typeHex: `0x${string}` | null;
548
+ blobVersionedHashes: `0x${string}`[];
549
+ blockNumber: (TBlockTag_1 extends "pending" ? true : false) extends infer T_22 ? T_22 extends (TBlockTag_1 extends "pending" ? true : false) ? T_22 extends true ? null : bigint : never : never;
550
+ blockHash: (TBlockTag_1 extends "pending" ? true : false) extends infer T_23 ? T_23 extends (TBlockTag_1 extends "pending" ? true : false) ? T_23 extends true ? null : `0x${string}` : never : never;
551
+ transactionIndex: (TBlockTag_1 extends "pending" ? true : false) extends infer T_24 ? T_24 extends (TBlockTag_1 extends "pending" ? true : false) ? T_24 extends true ? null : number : never : never;
552
+ }>;
553
+ getTransactionConfirmations: (args: import("viem").GetTransactionConfirmationsParameters<import("viem").Chain>) => Promise<bigint>;
554
+ getTransactionCount: (args: import("viem").GetTransactionCountParameters) => Promise<number>;
555
+ getTransactionReceipt: (args: import("viem").GetTransactionReceiptParameters) => Promise<import("viem").TransactionReceipt>;
556
+ multicall: <const contracts extends readonly unknown[], allowFailure extends boolean = true>(args: import("viem").MulticallParameters<contracts, allowFailure>) => Promise<import("viem").MulticallReturnType<contracts, allowFailure>>;
557
+ prepareTransactionRequest: <TParameterType_1 extends import("viem").PrepareTransactionRequestParameterType, TChainOverride_6 extends import("viem").Chain | undefined = undefined, TAccountOverride_1 extends `0x${string}` | import("viem").Account | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<import("viem").Chain, undefined, TChainOverride_6, TAccountOverride_1, TParameterType_1>) => Promise<import("viem").PrepareTransactionRequestReturnType<import("viem").Chain, undefined, TChainOverride_6, TAccountOverride_1, TParameterType_1>>;
558
+ readContract: <const abi_4 extends readonly unknown[] | import("viem").Abi, functionName_2 extends import("viem").ContractFunctionName<abi_4, "view" | "pure">, args_2 extends import("viem").ContractFunctionArgs<abi_4, "view" | "pure", functionName_2>>(args: import("viem").ReadContractParameters<abi_4, functionName_2, args_2>) => Promise<import("viem").ReadContractReturnType<abi_4, functionName_2, args_2>>;
559
+ sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<`0x${string}`>;
560
+ simulateContract: <const abi_5 extends readonly unknown[] | import("viem").Abi, functionName_3 extends import("viem").ContractFunctionName<abi_5, "nonpayable" | "payable">, args_3 extends import("viem").ContractFunctionArgs<abi_5, "nonpayable" | "payable", functionName_3>, chainOverride_1 extends import("viem").Chain | undefined, accountOverride extends `0x${string}` | import("viem").Account | undefined = undefined>(args: import("viem").SimulateContractParameters<abi_5, functionName_3, args_3, import("viem").Chain, chainOverride_1, accountOverride>) => Promise<import("viem").SimulateContractReturnType<abi_5, functionName_3, args_3, import("viem").Chain, undefined, chainOverride_1, accountOverride>>;
561
+ verifyMessage: (args: import("viem/_types/actions/public/verifyMessage").VerifyMessageParameters) => Promise<boolean>;
562
+ verifyTypedData: (args: import("viem/_types/actions/public/verifyTypedData").VerifyTypedDataParameters) => Promise<boolean>;
563
+ uninstallFilter: (args: import("viem").UninstallFilterParameters) => Promise<boolean>;
564
+ waitForTransactionReceipt: (args: import("viem").WaitForTransactionReceiptParameters<import("viem").Chain>) => Promise<import("viem").TransactionReceipt>;
565
+ watchBlockNumber: (args: import("viem").WatchBlockNumberParameters) => import("viem").WatchBlockNumberReturnType;
566
+ watchBlocks: <TIncludeTransactions_1 extends boolean = false, TBlockTag_2 extends import("viem").BlockTag = "latest">(args: import("viem").WatchBlocksParameters<import("viem").HttpTransport, import("viem").Chain, TIncludeTransactions_1, TBlockTag_2>) => import("viem").WatchBlocksReturnType;
567
+ watchContractEvent: <const TAbi_3 extends readonly unknown[] | import("viem").Abi, TEventName_3 extends import("viem").ContractEventName<TAbi_3>, TStrict_5 extends boolean | undefined = undefined>(args: import("viem").WatchContractEventParameters<TAbi_3, TEventName_3, TStrict_5, import("viem").HttpTransport>) => import("viem").WatchContractEventReturnType;
568
+ watchEvent: <const TAbiEvent_2 extends import("abitype").AbiEvent | undefined = undefined, const TAbiEvents_2 extends readonly unknown[] | readonly import("abitype").AbiEvent[] | undefined = TAbiEvent_2 extends import("abitype").AbiEvent ? [TAbiEvent_2] : undefined, TStrict_6 extends boolean | undefined = undefined>(args: import("viem").WatchEventParameters<TAbiEvent_2, TAbiEvents_2, TStrict_6, import("viem").HttpTransport>) => import("viem").WatchEventReturnType;
569
+ watchPendingTransactions: (args: import("viem").WatchPendingTransactionsParameters<import("viem").HttpTransport>) => import("viem").WatchPendingTransactionsReturnType;
570
+ } & import("viem").TestActions>;
571
+ subgraph: {
572
+ subsquid: string;
573
+ };
574
+ };
575
+ export declare const arbitrumSdk: GmxSdk;
@@ -8,17 +8,14 @@ const client = createTestClient({
8
8
  })
9
9
  .extend(publicActions)
10
10
  .extend(walletActions);
11
- export const arbitrumSdk = new GmxSdk({
11
+ export const arbitrumSdkConfig = {
12
12
  chainId: ARBITRUM,
13
13
  account: "0x9f7198eb1b9Ccc0Eb7A07eD228d8FbC12963ea33",
14
14
  oracleUrl: "https://arbitrum-api.gmxinfra.io",
15
15
  rpcUrl: "https://arb1.arbitrum.io/rpc",
16
16
  walletClient: client,
17
17
  subgraph: {
18
- stats: "https://subgraph.satsuma-prod.com/3b2ced13c8d9/gmx/gmx-arbitrum-stats/api",
19
- referrals: "https://subgraph.satsuma-prod.com/3b2ced13c8d9/gmx/gmx-arbitrum-referrals/api",
20
- nissohVault: "https://api.thegraph.com/subgraphs/name/nissoh/gmx-vault",
21
- syntheticsStats: "https://subgraph.satsuma-prod.com/3b2ced13c8d9/gmx/synthetics-arbitrum-stats/api",
22
- subsquid: "https://gmx.squids.live/gmx-synthetics-arbitrum/v/v20/graphql",
18
+ subsquid: "https://gmx.squids.live/gmx-synthetics-arbitrum:live/api/graphql",
23
19
  },
24
- });
20
+ };
21
+ export const arbitrumSdk = new GmxSdk(arbitrumSdkConfig);