@gmx-io/sdk 1.1.2 → 1.2.1
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.
- package/build/cjs/src/abis/ClaimHandler.json +439 -0
- package/build/cjs/src/abis/StBTC.json +1225 -0
- package/build/cjs/src/abis/SyntheticsReader.json +480 -19
- package/build/cjs/src/abis/index.js +4 -0
- package/build/cjs/src/configs/__tests__/markets.spec.js +1 -1
- package/build/cjs/src/configs/__tests__/tokens.spec.js +2 -1
- package/build/cjs/src/configs/batch.js +12 -0
- package/build/cjs/src/configs/chains.js +57 -6
- package/build/cjs/src/configs/contracts.js +66 -68
- package/build/cjs/src/configs/dataStore.js +14 -3
- package/build/cjs/src/configs/express.js +4 -2
- package/build/cjs/src/configs/markets.js +72 -0
- package/build/cjs/src/configs/oracleKeeper.js +19 -34
- package/build/cjs/src/configs/tokens.js +185 -1
- package/build/cjs/src/index.js +3 -3
- package/build/cjs/src/modules/orders/helpers.js +21 -13
- package/build/cjs/src/modules/orders/helpers.spec.js +1 -1
- package/build/cjs/src/modules/orders/orders.js +3 -3
- package/build/cjs/src/modules/positions/positions.js +9 -0
- package/build/cjs/src/modules/utils/utils.js +3 -3
- package/build/cjs/src/prebuilt/hashedKinkModelMarketRatesKeys.json +82 -0
- package/build/cjs/src/prebuilt/hashedMarketConfigKeys.json +512 -0
- package/build/cjs/src/prebuilt/hashedMarketValuesKeys.json +152 -0
- package/build/cjs/src/types/subsquid.js +193 -1
- package/build/cjs/src/types/swapStrategy.js +2 -0
- package/build/cjs/src/types/trade.js +1 -0
- package/build/cjs/src/utils/__tests__/numbers.spec.js +17 -9
- package/build/cjs/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +2 -0
- package/build/cjs/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.js +2 -0
- package/build/cjs/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +4 -0
- package/build/cjs/src/utils/__tests__/orderTransactions/swapOrders.spec.js +1 -0
- package/build/cjs/src/utils/__tests__/prices.spec.js +3 -2
- package/build/cjs/src/utils/__tests__/uiFeeReceiver.spec.js +19 -0
- package/build/cjs/src/utils/errors/transactionsErrors.js +9 -2
- package/build/cjs/src/utils/fees/executionFee.js +9 -1
- package/build/cjs/src/utils/numbers.js +52 -34
- package/build/cjs/src/utils/orderTransactions.js +3 -1
- package/build/cjs/src/utils/orders.js +8 -2
- package/build/cjs/src/utils/prices.js +1 -1
- package/build/cjs/src/utils/swap/botanixStaking.js +90 -0
- package/build/cjs/src/utils/swap/buildSwapStrategy.js +224 -0
- package/build/cjs/src/utils/swap/externalSwapPath.js +41 -0
- package/build/cjs/src/utils/swap/externalSwapQuoteByPath.js +27 -0
- package/build/cjs/src/utils/swap/swapValues.js +288 -9
- package/build/cjs/src/utils/tokens.js +10 -1
- package/build/cjs/src/utils/trade/amounts.js +89 -41
- package/build/cjs/src/utils/trade/trade.js +2 -2
- package/build/cjs/src/utils/twap/uiFeeReceiver.js +26 -6
- package/build/esm/src/abis/ClaimHandler.json +439 -0
- package/build/esm/src/abis/StBTC.json +1225 -0
- package/build/esm/src/abis/SyntheticsReader.json +480 -19
- package/build/esm/src/abis/index.js +4 -0
- package/build/esm/src/configs/__tests__/markets.spec.js +1 -1
- package/build/esm/src/configs/__tests__/tokens.spec.js +3 -2
- package/build/esm/src/configs/batch.js +13 -1
- package/build/esm/src/configs/chains.js +56 -5
- package/build/esm/src/configs/contracts.js +67 -69
- package/build/esm/src/configs/dataStore.js +9 -0
- package/build/esm/src/configs/express.js +5 -3
- package/build/esm/src/configs/markets.js +73 -1
- package/build/esm/src/configs/oracleKeeper.js +18 -29
- package/build/esm/src/configs/tokens.js +186 -2
- package/build/esm/src/index.js +3 -3
- package/build/esm/src/modules/orders/helpers.js +21 -13
- package/build/esm/src/modules/orders/helpers.spec.js +1 -1
- package/build/esm/src/modules/orders/orders.js +3 -3
- package/build/esm/src/modules/positions/positions.js +9 -0
- package/build/esm/src/modules/utils/utils.js +3 -3
- package/build/esm/src/prebuilt/hashedKinkModelMarketRatesKeys.json +82 -0
- package/build/esm/src/prebuilt/hashedMarketConfigKeys.json +512 -0
- package/build/esm/src/prebuilt/hashedMarketValuesKeys.json +152 -0
- package/build/esm/src/types/subsquid.js +192 -0
- package/build/esm/src/types/swapStrategy.js +1 -0
- package/build/esm/src/types/trade.js +1 -0
- package/build/esm/src/utils/__tests__/numbers.spec.js +18 -10
- package/build/esm/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +2 -0
- package/build/esm/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.js +2 -0
- package/build/esm/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +4 -0
- package/build/esm/src/utils/__tests__/orderTransactions/swapOrders.spec.js +1 -0
- package/build/esm/src/utils/__tests__/prices.spec.js +3 -2
- package/build/esm/src/utils/__tests__/uiFeeReceiver.spec.js +20 -1
- package/build/esm/src/utils/errors/transactionsErrors.js +9 -2
- package/build/esm/src/utils/fees/executionFee.js +11 -3
- package/build/esm/src/utils/numbers.js +50 -31
- package/build/esm/src/utils/orderTransactions.js +3 -1
- package/build/esm/src/utils/orders.js +8 -2
- package/build/esm/src/utils/prices.js +1 -1
- package/build/esm/src/utils/swap/botanixStaking.js +83 -0
- package/build/esm/src/utils/swap/buildSwapStrategy.js +219 -0
- package/build/esm/src/utils/swap/externalSwapPath.js +37 -0
- package/build/esm/src/utils/swap/externalSwapQuoteByPath.js +23 -0
- package/build/esm/src/utils/swap/swapValues.js +287 -8
- package/build/esm/src/utils/tokens.js +7 -0
- package/build/esm/src/utils/trade/amounts.js +89 -41
- package/build/esm/src/utils/trade/trade.js +2 -2
- package/build/esm/src/utils/twap/uiFeeReceiver.js +24 -5
- package/build/types/src/abis/index.d.ts +1 -1
- package/build/types/src/configs/batch.d.ts +2 -1
- package/build/types/src/configs/chains.d.ts +20 -37
- package/build/types/src/configs/contracts.d.ts +62 -63
- package/build/types/src/configs/dataStore.d.ts +5 -0
- package/build/types/src/configs/express.d.ts +1 -0
- package/build/types/src/configs/markets.d.ts +2 -1
- package/build/types/src/configs/oracleKeeper.d.ts +2 -3
- package/build/types/src/configs/tokens.d.ts +1 -0
- package/build/types/src/index.d.ts +1 -1
- package/build/types/src/modules/base.d.ts +1 -1
- package/build/types/src/modules/orders/helpers.d.ts +10 -2
- package/build/types/src/modules/orders/orders.d.ts +10 -1
- package/build/types/src/types/orders.d.ts +1 -1
- package/build/types/src/types/sdk.d.ts +2 -1
- package/build/types/src/types/subsquid.d.ts +691 -0
- package/build/types/src/types/swapStrategy.d.ts +33 -0
- package/build/types/src/types/tokens.d.ts +6 -0
- package/build/types/src/types/trade.d.ts +19 -4
- package/build/types/src/utils/multicall.d.ts +1 -1
- package/build/types/src/utils/numbers.d.ts +8 -3
- package/build/types/src/utils/orderTransactions.d.ts +2 -3
- package/build/types/src/utils/prices.d.ts +1 -1
- package/build/types/src/utils/swap/botanixStaking.d.ts +11 -0
- package/build/types/src/utils/swap/buildSwapStrategy.d.ts +22 -0
- package/build/types/src/utils/swap/externalSwapPath.d.ts +13 -0
- package/build/types/src/utils/swap/externalSwapQuoteByPath.d.ts +6 -0
- package/build/types/src/utils/swap/swapValues.d.ts +10 -3
- package/build/types/src/utils/tokens.d.ts +2 -0
- package/build/types/src/utils/trade/amounts.d.ts +5 -2
- package/build/types/src/utils/twap/uiFeeReceiver.d.ts +13 -0
- package/package.json +1 -1
|
@@ -2,52 +2,35 @@ import { Chain } from "viem/chains";
|
|
|
2
2
|
export declare const AVALANCHE = 43114;
|
|
3
3
|
export declare const AVALANCHE_FUJI = 43113;
|
|
4
4
|
export declare const ARBITRUM = 42161;
|
|
5
|
-
export declare const BSС_MAINNET = 56;
|
|
6
|
-
export declare const BSС_TESTNET = 97;
|
|
7
5
|
export declare const ETH_MAINNET = 1;
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
43113: string;
|
|
16
|
-
};
|
|
17
|
-
export declare const HIGH_EXECUTION_FEES_MAP: Record<number, number>;
|
|
6
|
+
export declare const BOTANIX = 3637;
|
|
7
|
+
export declare const SUPPORTED_CHAIN_IDS: UiSupportedChain[];
|
|
8
|
+
export declare const SUPPORTED_CHAIN_IDS_DEV: UiSupportedChain[];
|
|
9
|
+
export type UiContractsChain = typeof ARBITRUM | typeof AVALANCHE | typeof AVALANCHE_FUJI | typeof BOTANIX;
|
|
10
|
+
export type UiSupportedChain = UiContractsChain;
|
|
11
|
+
export declare const CHAIN_NAMES_MAP: Record<UiContractsChain, string>;
|
|
12
|
+
export declare const HIGH_EXECUTION_FEES_MAP: Record<UiContractsChain, number>;
|
|
18
13
|
export declare const MAX_FEE_PER_GAS_MAP: Record<number, bigint>;
|
|
19
14
|
export declare const GAS_PRICE_PREMIUM_MAP: Record<number, bigint>;
|
|
20
|
-
export declare const MAX_PRIORITY_FEE_PER_GAS_MAP: Record<
|
|
21
|
-
export declare const EXCESSIVE_EXECUTION_FEES_MAP: Record<
|
|
15
|
+
export declare const MAX_PRIORITY_FEE_PER_GAS_MAP: Record<UiSupportedChain, bigint | undefined>;
|
|
16
|
+
export declare const EXCESSIVE_EXECUTION_FEES_MAP: Record<UiSupportedChain, number>;
|
|
17
|
+
export declare const MIN_EXECUTION_FEE_USD: Record<UiSupportedChain, bigint | undefined>;
|
|
22
18
|
export declare const GAS_PRICE_BUFFER_MAP: Record<number, bigint>;
|
|
19
|
+
export declare const botanix: Chain;
|
|
23
20
|
export declare function getChainName(chainId: number): any;
|
|
24
21
|
export declare const getViemChain: (chainId: number) => Chain;
|
|
25
|
-
export declare function getHighExecutionFee(chainId: number):
|
|
26
|
-
export declare function getExcessiveExecutionFee(chainId: number):
|
|
22
|
+
export declare function getHighExecutionFee(chainId: number): any;
|
|
23
|
+
export declare function getExcessiveExecutionFee(chainId: number): any;
|
|
27
24
|
export declare function isSupportedChain(chainId: number, dev?: boolean): boolean;
|
|
28
25
|
export declare const EXECUTION_FEE_CONFIG_V2: {
|
|
29
|
-
[chainId
|
|
26
|
+
[chainId in UiSupportedChain]: {
|
|
30
27
|
shouldUseMaxPriorityFeePerGas: boolean;
|
|
31
28
|
defaultBufferBps?: number;
|
|
32
29
|
};
|
|
33
30
|
};
|
|
34
|
-
export declare const GAS_LIMITS_STATIC_CONFIG: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
43114: {
|
|
42
|
-
createOrderGasLimit: bigint;
|
|
43
|
-
updateOrderGasLimit: bigint;
|
|
44
|
-
cancelOrderGasLimit: bigint;
|
|
45
|
-
tokenPermitGasLimit: bigint;
|
|
46
|
-
};
|
|
47
|
-
43113: {
|
|
48
|
-
createOrderGasLimit: bigint;
|
|
49
|
-
updateOrderGasLimit: bigint;
|
|
50
|
-
cancelOrderGasLimit: bigint;
|
|
51
|
-
tokenPermitGasLimit: bigint;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
31
|
+
export declare const GAS_LIMITS_STATIC_CONFIG: Record<UiSupportedChain, {
|
|
32
|
+
createOrderGasLimit: bigint;
|
|
33
|
+
updateOrderGasLimit: bigint;
|
|
34
|
+
cancelOrderGasLimit: bigint;
|
|
35
|
+
tokenPermitGasLimit: bigint;
|
|
36
|
+
}>;
|
|
@@ -1,68 +1,5 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
2
|
export declare const CONTRACTS: {
|
|
3
|
-
56: {
|
|
4
|
-
Treasury: string;
|
|
5
|
-
BUSD: string;
|
|
6
|
-
GMT: string;
|
|
7
|
-
Vault: string;
|
|
8
|
-
Router: string;
|
|
9
|
-
Reader: string;
|
|
10
|
-
AmmFactory: string;
|
|
11
|
-
AmmFactoryV2: string;
|
|
12
|
-
OrderBook: string;
|
|
13
|
-
OrderBookReader: string;
|
|
14
|
-
GmxMigrator: string;
|
|
15
|
-
USDG: string;
|
|
16
|
-
NATIVE_TOKEN: string;
|
|
17
|
-
XGMT: string;
|
|
18
|
-
GMT_USDG_PAIR: string;
|
|
19
|
-
XGMT_USDG_PAIR: string;
|
|
20
|
-
GMT_USDG_FARM: string;
|
|
21
|
-
XGMT_USDG_FARM: string;
|
|
22
|
-
USDG_YIELD_TRACKER: string;
|
|
23
|
-
XGMT_YIELD_TRACKER: string;
|
|
24
|
-
GMT_USDG_FARM_TRACKER_XGMT: string;
|
|
25
|
-
GMT_USDG_FARM_TRACKER_NATIVE: string;
|
|
26
|
-
XGMT_USDG_FARM_TRACKER_XGMT: string;
|
|
27
|
-
XGMT_USDG_FARM_TRACKER_NATIVE: string;
|
|
28
|
-
AUTO: string;
|
|
29
|
-
AUTO_USDG_PAIR: string;
|
|
30
|
-
AUTO_USDG_FARM: string;
|
|
31
|
-
AUTO_USDG_FARM_TRACKER_XGMT: string;
|
|
32
|
-
AUTO_USDG_FARM_TRACKER_NATIVE: string;
|
|
33
|
-
GMT_GMX_IOU: string;
|
|
34
|
-
XGMT_GMX_IOU: string;
|
|
35
|
-
GMT_USDG_GMX_IOU: string;
|
|
36
|
-
XGMT_USDG_GMX_IOU: string;
|
|
37
|
-
};
|
|
38
|
-
97: {
|
|
39
|
-
Vault: string;
|
|
40
|
-
Router: string;
|
|
41
|
-
Reader: string;
|
|
42
|
-
AmmFactory: string;
|
|
43
|
-
AmmFactoryV2: string;
|
|
44
|
-
OrderBook: string;
|
|
45
|
-
OrderBookReader: string;
|
|
46
|
-
GmxMigrator: string;
|
|
47
|
-
USDG: string;
|
|
48
|
-
GMT: string;
|
|
49
|
-
NATIVE_TOKEN: string;
|
|
50
|
-
XGMT: string;
|
|
51
|
-
GMT_USDG_PAIR: string;
|
|
52
|
-
XGMT_USDG_PAIR: string;
|
|
53
|
-
GMT_USDG_FARM: string;
|
|
54
|
-
XGMT_USDG_FARM: string;
|
|
55
|
-
USDG_YIELD_TRACKER: string;
|
|
56
|
-
XGMT_YIELD_TRACKER: string;
|
|
57
|
-
GMT_USDG_FARM_TRACKER_XGMT: string;
|
|
58
|
-
GMT_USDG_FARM_TRACKER_NATIVE: string;
|
|
59
|
-
XGMT_USDG_FARM_TRACKER_XGMT: string;
|
|
60
|
-
XGMT_USDG_FARM_TRACKER_NATIVE: string;
|
|
61
|
-
GMT_GMX_IOU: string;
|
|
62
|
-
XGMT_GMX_IOU: string;
|
|
63
|
-
GMT_USDG_GMX_IOU: string;
|
|
64
|
-
XGMT_USDG_GMX_IOU: string;
|
|
65
|
-
};
|
|
66
3
|
42161: {
|
|
67
4
|
Vault: string;
|
|
68
5
|
Router: string;
|
|
@@ -120,6 +57,7 @@ export declare const CONTRACTS: {
|
|
|
120
57
|
ChainlinkPriceFeedProvider: string;
|
|
121
58
|
Multicall: string;
|
|
122
59
|
ArbitrumNodeInterface: string;
|
|
60
|
+
ClaimHandler: string;
|
|
123
61
|
};
|
|
124
62
|
43114: {
|
|
125
63
|
Vault: string;
|
|
@@ -178,6 +116,67 @@ export declare const CONTRACTS: {
|
|
|
178
116
|
ChainlinkPriceFeedProvider: string;
|
|
179
117
|
Multicall: string;
|
|
180
118
|
ArbitrumNodeInterface: "0x0000000000000000000000000000000000000000";
|
|
119
|
+
ClaimHandler: string;
|
|
120
|
+
};
|
|
121
|
+
3637: {
|
|
122
|
+
DataStore: string;
|
|
123
|
+
EventEmitter: string;
|
|
124
|
+
SubaccountRouter: string;
|
|
125
|
+
ExchangeRouter: string;
|
|
126
|
+
DepositVault: string;
|
|
127
|
+
WithdrawalVault: string;
|
|
128
|
+
OrderVault: string;
|
|
129
|
+
ShiftVault: string;
|
|
130
|
+
SyntheticsReader: string;
|
|
131
|
+
SyntheticsRouter: string;
|
|
132
|
+
GlvReader: string;
|
|
133
|
+
GlvRouter: string;
|
|
134
|
+
GlvVault: string;
|
|
135
|
+
GelatoRelayRouter: string;
|
|
136
|
+
SubaccountGelatoRelayRouter: string;
|
|
137
|
+
ExternalHandler: string;
|
|
138
|
+
OpenOceanRouter: "0x0000000000000000000000000000000000000000";
|
|
139
|
+
ChainlinkPriceFeedProvider: string;
|
|
140
|
+
Multicall: string;
|
|
141
|
+
Timelock: string;
|
|
142
|
+
ArbitrumNodeInterface: "0x0000000000000000000000000000000000000000";
|
|
143
|
+
Vault: "0x0000000000000000000000000000000000000000";
|
|
144
|
+
Reader: "0x0000000000000000000000000000000000000000";
|
|
145
|
+
PositionRouter: "0x0000000000000000000000000000000000000000";
|
|
146
|
+
ReferralStorage: "0x0000000000000000000000000000000000000000";
|
|
147
|
+
ReferralReader: "0x0000000000000000000000000000000000000000";
|
|
148
|
+
VaultReader: "0x0000000000000000000000000000000000000000";
|
|
149
|
+
GlpManager: "0x0000000000000000000000000000000000000000";
|
|
150
|
+
RewardRouter: "0x0000000000000000000000000000000000000000";
|
|
151
|
+
RewardReader: "0x0000000000000000000000000000000000000000";
|
|
152
|
+
GlpRewardRouter: "0x0000000000000000000000000000000000000000";
|
|
153
|
+
StakedGmxTracker: "0x0000000000000000000000000000000000000000";
|
|
154
|
+
FeeGmxTracker: "0x0000000000000000000000000000000000000000";
|
|
155
|
+
GLP: "0x0000000000000000000000000000000000000000";
|
|
156
|
+
GMX: "0x0000000000000000000000000000000000000000";
|
|
157
|
+
ES_GMX: "0x0000000000000000000000000000000000000000";
|
|
158
|
+
BN_GMX: "0x0000000000000000000000000000000000000000";
|
|
159
|
+
USDG: "0x0000000000000000000000000000000000000000";
|
|
160
|
+
BonusGmxTracker: "0x0000000000000000000000000000000000000000";
|
|
161
|
+
StakedGlpTracker: "0x0000000000000000000000000000000000000000";
|
|
162
|
+
FeeGlpTracker: "0x0000000000000000000000000000000000000000";
|
|
163
|
+
ExtendedGmxTracker: "0x0000000000000000000000000000000000000000";
|
|
164
|
+
StakedGmxDistributor: "0x0000000000000000000000000000000000000000";
|
|
165
|
+
StakedGlpDistributor: "0x0000000000000000000000000000000000000000";
|
|
166
|
+
GmxVester: "0x0000000000000000000000000000000000000000";
|
|
167
|
+
GlpVester: "0x0000000000000000000000000000000000000000";
|
|
168
|
+
AffiliateVester: "0x0000000000000000000000000000000000000000";
|
|
169
|
+
Router: "0x0000000000000000000000000000000000000000";
|
|
170
|
+
GovToken: "0x0000000000000000000000000000000000000000";
|
|
171
|
+
ES_GMX_IOU: "0x0000000000000000000000000000000000000000";
|
|
172
|
+
OrderBook: "0x0000000000000000000000000000000000000000";
|
|
173
|
+
OrderExecutor: "0x0000000000000000000000000000000000000000";
|
|
174
|
+
OrderBookReader: "0x0000000000000000000000000000000000000000";
|
|
175
|
+
PositionManager: "0x0000000000000000000000000000000000000000";
|
|
176
|
+
UniswapGmxEthPool: "0x0000000000000000000000000000000000000000";
|
|
177
|
+
NATIVE_TOKEN: string;
|
|
178
|
+
StBTC: string;
|
|
179
|
+
PBTC: string;
|
|
181
180
|
};
|
|
182
181
|
43113: {
|
|
183
182
|
Vault: "0x0000000000000000000000000000000000000000";
|
|
@@ -92,7 +92,10 @@ export declare const SUBACCOUNT_EXPIRES_AT: string;
|
|
|
92
92
|
export declare const PRICE_FEED_KEY: string;
|
|
93
93
|
export declare const GASLESS_FEATURE_DISABLED_KEY: string;
|
|
94
94
|
export declare const GELATO_RELAY_FEE_MULTIPLIER_FACTOR_KEY: string;
|
|
95
|
+
export declare const REQUEST_EXPIRATION_TIME_KEY: string;
|
|
95
96
|
export declare const GMX_SIMULATION_ORIGIN: string;
|
|
97
|
+
export declare const CLAIM_TERMS_KEY: string;
|
|
98
|
+
export declare const GENERAL_CLAIM_FEATURE_DISABLED: string;
|
|
96
99
|
export declare function subaccountExpiresAtKey(account: string, subaccount: string, actionType: string): string;
|
|
97
100
|
export declare function glvShiftLastExecutedAtKey(glvAddress: string): string;
|
|
98
101
|
export declare function glvShiftMinIntervalKey(glvAddress: string): string;
|
|
@@ -160,3 +163,5 @@ export declare function subaccountActionCountKey(account: string, subaccount: st
|
|
|
160
163
|
export declare function subaccountAutoTopUpAmountKey(account: string, subaccount: string): string;
|
|
161
164
|
export declare function priceFeedKey(token: string): string;
|
|
162
165
|
export declare function gaslessFeatureDisabledKey(module: string): string;
|
|
166
|
+
export declare function claimTermsKey(distributionId: bigint): string;
|
|
167
|
+
export declare function claimsDisabledKey(distributionId: bigint): string;
|
|
@@ -7,6 +7,7 @@ export declare const DEFAULT_PERMIT_DEADLINE_DURATION: number;
|
|
|
7
7
|
export declare const DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION: number;
|
|
8
8
|
export declare const MIN_GELATO_USD_BALANCE_FOR_SPONSORED_CALL: bigint;
|
|
9
9
|
export declare const MIN_RELAYER_FEE_USD: bigint;
|
|
10
|
+
export declare const EXPRESS_EXTRA_EXECUTION_FEE_BUFFER_BPS = 1000;
|
|
10
11
|
export declare function getGasPaymentTokens(chainId: number): string[];
|
|
11
12
|
export declare function getDefaultGasPaymentToken(chainId: number): string;
|
|
12
13
|
export declare function getRelayerFeeToken(chainId: number): Token;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UiContractsChain } from "./chains";
|
|
1
2
|
export declare const SWAP_GRAPH_MAX_MARKETS_PER_TOKEN = 5;
|
|
2
3
|
export type MarketConfig = {
|
|
3
4
|
marketTokenAddress: string;
|
|
@@ -5,4 +6,4 @@ export type MarketConfig = {
|
|
|
5
6
|
longTokenAddress: string;
|
|
6
7
|
shortTokenAddress: string;
|
|
7
8
|
};
|
|
8
|
-
export declare const MARKETS: Record<
|
|
9
|
+
export declare const MARKETS: Record<UiContractsChain, Record<string, MarketConfig>>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export declare function getOracleKeeperUrl(chainId: number
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function getOracleKeeperRandomIndex(chainId: number, bannedIndexes?: number[]): number;
|
|
1
|
+
export declare function getOracleKeeperUrl(chainId: number): any;
|
|
2
|
+
export declare function getOracleKeeperFallbackUrls(chainId: number): any;
|
|
@@ -26,7 +26,7 @@ export declare class GmxSdk {
|
|
|
26
26
|
setAccount(account: Address): void;
|
|
27
27
|
executeMulticall<T = any>(request: MulticallRequestConfig<any>): Promise<T>;
|
|
28
28
|
callContract(address: Address, abi: Abi, method: string, params: any[], opts?: CallContractOpts): Promise<`0x${string}`>;
|
|
29
|
-
get chainId():
|
|
29
|
+
get chainId(): import("./configs/chains").UiContractsChain;
|
|
30
30
|
get chain(): import("viem").Chain;
|
|
31
31
|
get account(): `0x${string}`;
|
|
32
32
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { GasLimitsConfig } from "../../types/fees";
|
|
2
2
|
import { MarketsInfoData } from "../../types/markets";
|
|
3
3
|
import { TokensData } from "../../types/tokens";
|
|
4
|
-
import { SwapAmounts } from "../../types/trade";
|
|
5
4
|
import type { GmxSdk } from "../..";
|
|
6
5
|
/** Base Optional params for helpers, allows to avoid calling markets, tokens and uiFeeFactor methods if they are already passed */
|
|
7
6
|
interface BaseOptionalParams {
|
|
@@ -46,5 +45,14 @@ export type SwapParams = ({
|
|
|
46
45
|
/** If presented, then it's limit swap order */
|
|
47
46
|
triggerPrice?: bigint;
|
|
48
47
|
} & BaseOptionalParams;
|
|
49
|
-
export declare function swap(sdk: GmxSdk, params: SwapParams): Promise<void |
|
|
48
|
+
export declare function swap(sdk: GmxSdk, params: SwapParams): Promise<void | {
|
|
49
|
+
amountIn: bigint;
|
|
50
|
+
usdIn: bigint;
|
|
51
|
+
amountOut: bigint;
|
|
52
|
+
usdOut: bigint;
|
|
53
|
+
swapPathStats: undefined;
|
|
54
|
+
priceIn: bigint;
|
|
55
|
+
priceOut: bigint;
|
|
56
|
+
minOutputAmount: bigint;
|
|
57
|
+
}>;
|
|
50
58
|
export {};
|
|
@@ -64,5 +64,14 @@ export declare class Orders extends Module {
|
|
|
64
64
|
createWrapOrUnwrapOrder(p: WrapOrUnwrapParams): Promise<`0x${string}`>;
|
|
65
65
|
long(params: PositionIncreaseParams): Promise<void>;
|
|
66
66
|
short(params: PositionIncreaseParams): Promise<void>;
|
|
67
|
-
swap(params: SwapParams): Promise<void |
|
|
67
|
+
swap(params: SwapParams): Promise<void | {
|
|
68
|
+
amountIn: bigint;
|
|
69
|
+
usdIn: bigint;
|
|
70
|
+
amountOut: bigint;
|
|
71
|
+
usdOut: bigint;
|
|
72
|
+
swapPathStats: undefined;
|
|
73
|
+
priceIn: bigint;
|
|
74
|
+
priceOut: bigint;
|
|
75
|
+
minOutputAmount: bigint;
|
|
76
|
+
}>;
|
|
68
77
|
}
|
|
@@ -70,7 +70,7 @@ export type PositionOrderInfo = Order & {
|
|
|
70
70
|
targetCollateralToken: TokenData;
|
|
71
71
|
acceptablePrice: bigint;
|
|
72
72
|
triggerPrice: bigint;
|
|
73
|
-
triggerThresholdType: TriggerThresholdType;
|
|
73
|
+
triggerThresholdType: TriggerThresholdType | undefined;
|
|
74
74
|
};
|
|
75
75
|
export type TwapOrderInfo<T extends PositionOrderInfo | SwapOrderInfo = PositionOrderInfo | SwapOrderInfo> = Omit<T, "isTwap"> & {
|
|
76
76
|
isSwap: T extends SwapOrderInfo ? true : false;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { PublicClient, WalletClient } from "viem";
|
|
2
|
+
import { UiContractsChain } from "../configs/chains";
|
|
2
3
|
import type { MarketSdkConfig } from "./markets";
|
|
3
4
|
import type { Token } from "./tokens";
|
|
4
5
|
export interface GmxSdkConfig {
|
|
5
6
|
/** Chain ID */
|
|
6
|
-
chainId:
|
|
7
|
+
chainId: UiContractsChain;
|
|
7
8
|
/** Account's address */
|
|
8
9
|
account?: string;
|
|
9
10
|
/** GMX Oracle URL */
|