@katanaperps/katana-perps-sdk 1.0.0 → 1.0.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/README.md +1 -1
- package/dist/abis/ExchangeLayerZeroAdapter_v1.json +728 -0
- package/dist/abis/IVaultComposerSync.json +537 -0
- package/dist/abis/KatanaPerpsStargateForwarder_v1.json +563 -0
- package/dist/bridge/config.d.ts +46 -57
- package/dist/bridge/config.d.ts.map +1 -1
- package/dist/bridge/config.js +39 -48
- package/dist/bridge/deposit.d.ts +23 -3
- package/dist/bridge/deposit.d.ts.map +1 -1
- package/dist/bridge/deposit.js +114 -42
- package/dist/bridge/utils.d.ts +26 -32
- package/dist/bridge/utils.d.ts.map +1 -1
- package/dist/bridge/withdraw.d.ts +1 -1
- package/dist/bridge/withdraw.d.ts.map +1 -1
- package/dist/bridge/withdraw.js +13 -32
- package/dist/client/rest/authenticated.d.ts +1 -0
- package/dist/client/rest/authenticated.d.ts.map +1 -1
- package/dist/client/rest/authenticated.js +24 -13
- package/dist/client/rest/public.d.ts +23 -0
- package/dist/client/rest/public.d.ts.map +1 -1
- package/dist/client/rest/public.js +25 -0
- package/dist/typechain-types/{ExchangeLayerZeroAdapter_v3.d.ts → ExchangeLayerZeroAdapter_v1.d.ts} +32 -37
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v1.d.ts.map +1 -0
- package/dist/typechain-types/IVaultComposerSync.d.ts +247 -0
- package/dist/typechain-types/IVaultComposerSync.d.ts.map +1 -0
- package/dist/typechain-types/{KumaStargateForwarder_v2.d.ts → KatanaPerpsStargateForwarder_v1.d.ts} +38 -14
- package/dist/typechain-types/KatanaPerpsStargateForwarder_v1.d.ts.map +1 -0
- package/dist/typechain-types/factories/{ExchangeLayerZeroAdapter_v3__factory.d.ts → ExchangeLayerZeroAdapter_v1__factory.d.ts} +62 -36
- package/dist/typechain-types/factories/{ExchangeLayerZeroAdapter_v3__factory.d.ts.map → ExchangeLayerZeroAdapter_v1__factory.d.ts.map} +1 -1
- package/dist/typechain-types/factories/{ExchangeLayerZeroAdapter_v3__factory.js → ExchangeLayerZeroAdapter_v1__factory.js} +77 -42
- package/dist/typechain-types/factories/IVaultComposerSync__factory.d.ts +422 -0
- package/dist/typechain-types/factories/IVaultComposerSync__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/IVaultComposerSync__factory.js +554 -0
- package/dist/typechain-types/factories/{KumaStargateForwarder_v2__factory.d.ts → KatanaPerpsStargateForwarder_v1__factory.d.ts} +103 -31
- package/dist/typechain-types/factories/KatanaPerpsStargateForwarder_v1__factory.d.ts.map +1 -0
- package/dist/typechain-types/factories/{KumaStargateForwarder_v2__factory.js → KatanaPerpsStargateForwarder_v1__factory.js} +125 -31
- package/dist/typechain-types/factories/index.d.ts +3 -0
- package/dist/typechain-types/factories/index.d.ts.map +1 -1
- package/dist/typechain-types/factories/index.js +7 -1
- package/dist/typechain-types/index.d.ts +6 -0
- package/dist/typechain-types/index.d.ts.map +1 -1
- package/dist/typechain-types/index.js +7 -1
- package/dist/types/enums/request.d.ts +2 -4
- package/dist/types/enums/request.d.ts.map +1 -1
- package/dist/types/enums/request.js +1 -2
- package/dist/types/rest/endpoints/GetExchange.d.ts +10 -0
- package/dist/types/rest/endpoints/GetExchange.d.ts.map +1 -1
- package/dist/types/rest/endpoints/GetFundingRateSamples.d.ts +40 -0
- package/dist/types/rest/endpoints/GetFundingRateSamples.d.ts.map +1 -0
- package/dist/types/rest/endpoints/GetGasFees.d.ts +2 -0
- package/dist/types/rest/endpoints/GetGasFees.d.ts.map +1 -1
- package/dist/types/rest/endpoints/index.d.ts +1 -0
- package/dist/types/rest/endpoints/index.d.ts.map +1 -1
- package/dist/types/rest/endpoints/index.js +1 -0
- package/package.json +1 -1
- package/dist/typechain-types/ExchangeLayerZeroAdapter.d.ts +0 -253
- package/dist/typechain-types/ExchangeLayerZeroAdapter.d.ts.map +0 -1
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v2.d.ts +0 -338
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v2.d.ts.map +0 -1
- package/dist/typechain-types/ExchangeLayerZeroAdapter_v3.d.ts.map +0 -1
- package/dist/typechain-types/Exchange_v2.d.ts +0 -2148
- package/dist/typechain-types/Exchange_v2.d.ts.map +0 -1
- package/dist/typechain-types/KumaStargateForwarder_v1.d.ts +0 -252
- package/dist/typechain-types/KumaStargateForwarder_v1.d.ts.map +0 -1
- package/dist/typechain-types/KumaStargateForwarder_v1.js +0 -2
- package/dist/typechain-types/KumaStargateForwarder_v2.d.ts.map +0 -1
- package/dist/typechain-types/KumaStargateForwarder_v2.js +0 -2
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter__factory.d.ts +0 -359
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter__factory.d.ts.map +0 -1
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter__factory.js +0 -471
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v2__factory.d.ts +0 -419
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v2__factory.d.ts.map +0 -1
- package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v2__factory.js +0 -545
- package/dist/typechain-types/factories/Exchange_v2__factory.d.ts +0 -2832
- package/dist/typechain-types/factories/Exchange_v2__factory.d.ts.map +0 -1
- package/dist/typechain-types/factories/Exchange_v2__factory.js +0 -3636
- package/dist/typechain-types/factories/KumaStargateForwarder_v1__factory.d.ts +0 -354
- package/dist/typechain-types/factories/KumaStargateForwarder_v1__factory.d.ts.map +0 -1
- package/dist/typechain-types/factories/KumaStargateForwarder_v1__factory.js +0 -464
- package/dist/typechain-types/factories/KumaStargateForwarder_v2__factory.d.ts.map +0 -1
- /package/dist/typechain-types/{ExchangeLayerZeroAdapter.js → ExchangeLayerZeroAdapter_v1.js} +0 -0
- /package/dist/typechain-types/{ExchangeLayerZeroAdapter_v2.js → IVaultComposerSync.js} +0 -0
- /package/dist/typechain-types/{ExchangeLayerZeroAdapter_v3.js → KatanaPerpsStargateForwarder_v1.js} +0 -0
- /package/dist/{typechain-types/Exchange_v2.js → types/rest/endpoints/GetFundingRateSamples.js} +0 -0
package/dist/bridge/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BridgeTarget } from '#types/enums/request';
|
|
2
|
-
export declare const BridgeMainnetLayerZeroEndpointIds: (
|
|
2
|
+
export declare const BridgeMainnetLayerZeroEndpointIds: (30110 | 30211 | 30106 | 30184 | 30362 | 30101 | 30111 | 30235 | 30214 | 30290)[];
|
|
3
3
|
export type BridgeLayerZeroEndpointIdsMainnet = (typeof BridgeMainnetLayerZeroEndpointIds)[number];
|
|
4
4
|
export declare function isBridgeMainnetLayerZeroEndpointId(layerZeroEndpointId: number): layerZeroEndpointId is BridgeLayerZeroEndpointIdsMainnet;
|
|
5
|
-
export declare const BridgeTestnetLayerZeroEndpointIds: (
|
|
5
|
+
export declare const BridgeTestnetLayerZeroEndpointIds: (30101 | 40231)[];
|
|
6
6
|
export type BridgeLayerZeroEndpointIdsTestnet = (typeof BridgeTestnetLayerZeroEndpointIds)[number];
|
|
7
7
|
export declare function isBridgeTestnetLayerZeroEndpointId(layerZeroEndpointId: number): layerZeroEndpointId is BridgeLayerZeroEndpointIdsTestnet;
|
|
8
8
|
/**
|
|
@@ -17,18 +17,11 @@ export declare function isBridgeTestnetLayerZeroEndpointId(layerZeroEndpointId:
|
|
|
17
17
|
export declare function getBridgeTargetConfig<T extends BridgeTarget, S extends true | false>(bridgeTarget: T, sandbox: S): {
|
|
18
18
|
readonly target: "katana.katana";
|
|
19
19
|
readonly isSupported: true;
|
|
20
|
-
readonly evmChainId:
|
|
21
|
-
readonly layerZeroEndpointId:
|
|
22
|
-
readonly layerzeroOFTAddress: "
|
|
20
|
+
readonly evmChainId: 737373;
|
|
21
|
+
readonly layerZeroEndpointId: -1;
|
|
22
|
+
readonly layerzeroOFTAddress: "0x0000000000000000000000000000000000000000";
|
|
23
23
|
readonly tokenDecimals: 6;
|
|
24
|
-
readonly usdcAddress: "
|
|
25
|
-
} | {
|
|
26
|
-
readonly target: "stargate.berachain";
|
|
27
|
-
readonly evmChainId: 11155111;
|
|
28
|
-
readonly layerZeroEndpointId: 40161;
|
|
29
|
-
readonly layerzeroOFTAddress: "0x21F1caDDBED3Cd50e6B30644459BFB80c367076c";
|
|
30
|
-
readonly tokenDecimals: 6;
|
|
31
|
-
readonly usdcAddress: "0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590";
|
|
24
|
+
readonly usdcAddress: "0xc2a4C310F2512A17Ac0047cf871aCAed3E62bB4B";
|
|
32
25
|
} | {
|
|
33
26
|
readonly target: "stargate.arbitrum";
|
|
34
27
|
readonly evmChainId: 421614;
|
|
@@ -36,22 +29,22 @@ export declare function getBridgeTargetConfig<T extends BridgeTarget, S extends
|
|
|
36
29
|
readonly layerzeroOFTAddress: "0x543BdA7c6cA4384FE90B1F5929bb851F52888983";
|
|
37
30
|
readonly tokenDecimals: 6;
|
|
38
31
|
readonly usdcAddress: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773";
|
|
32
|
+
} | {
|
|
33
|
+
readonly target: "stargate.ethereum";
|
|
34
|
+
readonly evmChainId: 11155111;
|
|
35
|
+
readonly layerZeroEndpointId: 40161;
|
|
36
|
+
readonly layerzeroOFTAddress: "0x0000000000000000000000000000000000000000";
|
|
37
|
+
readonly layerZeroVaultComposerSync: "0x0000000000000000000000000000000000000000";
|
|
38
|
+
readonly tokenDecimals: 6;
|
|
39
|
+
readonly usdcAddress: "0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590";
|
|
39
40
|
} | {
|
|
40
41
|
readonly "katana.katana": {
|
|
41
42
|
readonly target: "katana.katana";
|
|
42
43
|
readonly evmChainId: 747474;
|
|
43
44
|
readonly layerZeroEndpointId: 30375;
|
|
44
|
-
readonly layerzeroOFTAddress: "
|
|
45
|
+
readonly layerzeroOFTAddress: "0x807275727Dd3E640c5F2b5DE7d1eC72B4Dd293C0";
|
|
45
46
|
readonly tokenDecimals: 6;
|
|
46
|
-
readonly usdcAddress: "
|
|
47
|
-
};
|
|
48
|
-
readonly "stargate.berachain": {
|
|
49
|
-
readonly target: "stargate.berachain";
|
|
50
|
-
readonly evmChainId: 80094;
|
|
51
|
-
readonly layerZeroEndpointId: 30362;
|
|
52
|
-
readonly layerzeroOFTAddress: "0xAF54BE5B6eEc24d6BFACf1cce4eaF680A8239398";
|
|
53
|
-
readonly tokenDecimals: 6;
|
|
54
|
-
readonly usdcAddress: "0x549943e04f40284185054145c6E4e9568C1D3241";
|
|
47
|
+
readonly usdcAddress: "0x203A662b0BD271A6ed5a60EdFbd04bFce608FD36";
|
|
55
48
|
};
|
|
56
49
|
readonly "stargate.arbitrum": {
|
|
57
50
|
readonly target: "stargate.arbitrum";
|
|
@@ -85,19 +78,20 @@ export declare function getBridgeTargetConfig<T extends BridgeTarget, S extends
|
|
|
85
78
|
readonly tokenDecimals: 6;
|
|
86
79
|
readonly usdcAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
87
80
|
};
|
|
88
|
-
readonly "stargate.
|
|
89
|
-
readonly target: "stargate.
|
|
90
|
-
readonly evmChainId:
|
|
91
|
-
readonly layerZeroEndpointId:
|
|
92
|
-
readonly layerzeroOFTAddress: "
|
|
93
|
-
readonly tokenDecimals:
|
|
94
|
-
readonly usdcAddress: "
|
|
81
|
+
readonly "stargate.berachain": {
|
|
82
|
+
readonly target: "stargate.berachain";
|
|
83
|
+
readonly evmChainId: 80094;
|
|
84
|
+
readonly layerZeroEndpointId: 30362;
|
|
85
|
+
readonly layerzeroOFTAddress: "0xAF54BE5B6eEc24d6BFACf1cce4eaF680A8239398";
|
|
86
|
+
readonly tokenDecimals: 6;
|
|
87
|
+
readonly usdcAddress: "0x549943e04f40284185054145c6E4e9568C1D3241";
|
|
95
88
|
};
|
|
96
89
|
readonly "stargate.ethereum": {
|
|
97
90
|
readonly target: "stargate.ethereum";
|
|
98
91
|
readonly evmChainId: 1;
|
|
99
92
|
readonly layerZeroEndpointId: 30101;
|
|
100
|
-
readonly layerzeroOFTAddress: "
|
|
93
|
+
readonly layerzeroOFTAddress: "0xb5bADA33542a05395d504a25885e02503A957Bb3";
|
|
94
|
+
readonly layerZeroVaultComposerSyncAddress: "0x75B4cA53d62cd4274ACBce30487A74de87f0D661";
|
|
101
95
|
readonly tokenDecimals: 6;
|
|
102
96
|
readonly usdcAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
103
97
|
};
|
|
@@ -134,7 +128,7 @@ export declare function getBridgeTargetConfig<T extends BridgeTarget, S extends
|
|
|
134
128
|
readonly usdcAddress: "0x19e26B0638bf63aa9fa4d14c6baF8D52eBE86C5C";
|
|
135
129
|
};
|
|
136
130
|
}[T];
|
|
137
|
-
export declare function bridgeTargetForLayerZeroEndpointId(layerZeroEndpointId: number, sandbox: boolean): "stargate.
|
|
131
|
+
export declare function bridgeTargetForLayerZeroEndpointId(layerZeroEndpointId: number, sandbox: boolean): "stargate.arbitrum" | "stargate.aurora" | "stargate.avalanche" | "stargate.base" | "stargate.berachain" | "stargate.ethereum" | "stargate.optimism" | "stargate.rari" | "stargate.scroll" | "stargate.taiko" | null;
|
|
138
132
|
export declare function loadExchangeLayerZeroAddressFromApiIfNeeded(exchangeLayerZeroAdapterAddress?: string): Promise<string>;
|
|
139
133
|
export declare function loadStargateBridgeForwarderContractAddressFromApiIfNeeded(stargateBridgeForwarderContractAddress?: string): Promise<string>;
|
|
140
134
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bridge/utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,eAAO,MAAM,iCAAiC,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bridge/utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,eAAO,MAAM,iCAAiC,mFAI5C,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAC3C,CAAC,OAAO,iCAAiC,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,wBAAgB,kCAAkC,CAChD,mBAAmB,EAAE,MAAM,GAC1B,mBAAmB,IAAI,iCAAiC,CAI1D;AAED,eAAO,MAAM,iCAAiC,mBAI5C,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAC3C,CAAC,OAAO,iCAAiC,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,wBAAgB,kCAAkC,CAChD,mBAAmB,EAAE,MAAM,GAC1B,mBAAmB,IAAI,iCAAiC,CAI1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS,YAAY,EACtB,CAAC,SAAS,IAAI,GAAG,KAAK,EACtB,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAY5B;AAED,wBAAgB,kCAAkC,CAChD,mBAAmB,EAAE,MAAM,EAC3B,OAAO,EAAE,OAAO,uNAYjB;AAED,wBAAsB,2CAA2C,CAC/D,+BAA+B,CAAC,EAAE,MAAM,GACvC,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,wBAAsB,yDAAyD,CAC7E,sCAAsC,CAAC,EAAE,MAAM,GAC9C,OAAO,CAAC,MAAM,CAAC,CAOjB"}
|
|
@@ -32,7 +32,7 @@ export declare function estimateBridgeWithdrawQuantity(parameters: {
|
|
|
32
32
|
payload: string;
|
|
33
33
|
quantityInDecimal: string;
|
|
34
34
|
}, providers: {
|
|
35
|
-
|
|
35
|
+
ethereum: ethers.Provider;
|
|
36
36
|
katana: ethers.Provider;
|
|
37
37
|
}, sandbox: boolean): Promise<{
|
|
38
38
|
estimatedWithdrawQuantityInDecimal: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../src/bridge/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../src/bridge/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMhC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOpD;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAAG,MAAM,CAAC;AAE3D,eAAO,MAAM,oCAAoC,IAAI,CAAC;AAEtD;;GAEG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,qCAAqC,GAC7C,qCAAqC,CAOvC;AAED;;GAEG;AACH,wBAAgB,oCAAoC,CAAC,EACnD,mBAAmB,GACpB,EAAE,qCAAqC,GAAG,qCAAqC,CAK/E;AAED;;GAEG;AACH,wBAAgB,0CAA0C,CACxD,YAAY,EAAE,YAAY,EAC1B,OAAO,UAAQ,GACd,qCAAqC,CAMvC;AAED;;GAEG;AACH,wBAAsB,8BAA8B,CAClD,UAAU,EAAE;IACV,+BAA+B,EAAE,MAAM,CAAC;IACxC,wBAAwB,EAAE,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,EAED,SAAS,EAAE;IACT,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC;CACzB,EACD,OAAO,EAAE,OAAO,GACf,OAAO,CAAC;IACT,kCAAkC,EAAE,MAAM,CAAC;IAC3C,gCAAgC,EAAE,MAAM,CAAC;IACzC,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC,CAiED"}
|
package/dist/bridge/withdraw.js
CHANGED
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.estimateBridgeWithdrawQuantity = exports.getEncodedWithdrawalPayloadForBridgeTarget = exports.encodeWithdrawalBridgeAdapterPayload = exports.decodeWithdrawalBridgeAdapterPayload = exports.withdrawalBridgeAdapterPayloadLength = void 0;
|
|
4
4
|
const ethers_1 = require("ethers");
|
|
5
5
|
const _pipmath_1 = require("#pipmath");
|
|
6
|
-
const
|
|
6
|
+
const ExchangeLayerZeroAdapter_v1__factory_1 = require("#typechain-types/factories/ExchangeLayerZeroAdapter_v1__factory");
|
|
7
|
+
const KatanaPerpsStargateForwarder_v1__factory_1 = require("#typechain-types/factories/KatanaPerpsStargateForwarder_v1__factory");
|
|
7
8
|
const request_1 = require("#types/enums/request");
|
|
8
|
-
const config_1 = require("./config");
|
|
9
9
|
const utils_1 = require("./utils");
|
|
10
10
|
exports.withdrawalBridgeAdapterPayloadLength = 4; // uint32(4)
|
|
11
11
|
/**
|
|
@@ -39,42 +39,23 @@ exports.getEncodedWithdrawalPayloadForBridgeTarget = getEncodedWithdrawalPayload
|
|
|
39
39
|
*/
|
|
40
40
|
async function estimateBridgeWithdrawQuantity(parameters, providers, sandbox) {
|
|
41
41
|
const { layerZeroEndpointId: targetEndpointId } = decodeWithdrawalBridgeAdapterPayload(parameters.payload);
|
|
42
|
-
const exchangeBridgeAdapter =
|
|
42
|
+
const exchangeBridgeAdapter = ExchangeLayerZeroAdapter_v1__factory_1.ExchangeLayerZeroAdapter_v1__factory.connect(parameters.exchangeLayerZeroAdapterAddress, providers.katana);
|
|
43
43
|
const [estimatedWithdrawQuantityInAssetUnits, minimumWithdrawQuantityInAssetUnits, poolDecimals,] = await exchangeBridgeAdapter.estimateWithdrawQuantityInAssetUnits(
|
|
44
|
-
// Funds must always be withdrawn to
|
|
45
|
-
(
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
// Funds must always be withdrawn to Ethereum first regardless of final target
|
|
45
|
+
(0, _pipmath_1.decimalToPip)(parameters.quantityInDecimal));
|
|
46
|
+
let estimatedWithdrawQuantityInDecimal = (0, _pipmath_1.assetUnitsToDecimal)(estimatedWithdrawQuantityInAssetUnits, Number(poolDecimals));
|
|
47
|
+
let minimumWithdrawQuantityInDecimal = (0, _pipmath_1.assetUnitsToDecimal)(minimumWithdrawQuantityInAssetUnits, Number(poolDecimals));
|
|
48
48
|
const target = (0, utils_1.bridgeTargetForLayerZeroEndpointId)(targetEndpointId, sandbox);
|
|
49
49
|
if (!target || !(0, utils_1.getBridgeTargetConfig)(target, sandbox)) {
|
|
50
50
|
throw new Error(`Unsupported Layerzero Endpoint ID ${targetEndpointId}`);
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const [
|
|
61
|
-
estimatedForwardedQuantityInAssetUnits,
|
|
62
|
-
minimumForwardedQuantityInAssetUnits,
|
|
63
|
-
forwardedPoolDecimals,
|
|
64
|
-
] = await stargateForwarder.loadEstimatedForwardedQuantityInAssetUnits(
|
|
65
|
-
targetEndpointId,
|
|
66
|
-
decimalToPip(estimatedWithdrawQuantityInDecimal),
|
|
67
|
-
);
|
|
68
|
-
estimatedWithdrawQuantityInDecimal = assetUnitsToDecimal(
|
|
69
|
-
estimatedForwardedQuantityInAssetUnits,
|
|
70
|
-
Number(forwardedPoolDecimals),
|
|
71
|
-
);
|
|
72
|
-
minimumWithdrawQuantityInDecimal = assetUnitsToDecimal(
|
|
73
|
-
minimumForwardedQuantityInAssetUnits,
|
|
74
|
-
Number(forwardedPoolDecimals),
|
|
75
|
-
);
|
|
52
|
+
// If the final target is not Ethereum, a bridge tx is needed via the forwarder
|
|
53
|
+
if (target !== request_1.BridgeTarget.STARGATE_ETHEREUM) {
|
|
54
|
+
const stargateForwarder = KatanaPerpsStargateForwarder_v1__factory_1.KatanaPerpsStargateForwarder_v1__factory.connect(parameters.stargateForwarderAddress, providers.ethereum);
|
|
55
|
+
const [estimatedForwardedQuantityInAssetUnits, minimumForwardedQuantityInAssetUnits, forwardedPoolDecimals,] = await stargateForwarder.loadEstimatedForwardedQuantityInAssetUnits(targetEndpointId, (0, _pipmath_1.decimalToPip)(estimatedWithdrawQuantityInDecimal));
|
|
56
|
+
estimatedWithdrawQuantityInDecimal = (0, _pipmath_1.assetUnitsToDecimal)(estimatedForwardedQuantityInAssetUnits, Number(forwardedPoolDecimals));
|
|
57
|
+
minimumWithdrawQuantityInDecimal = (0, _pipmath_1.assetUnitsToDecimal)(minimumForwardedQuantityInAssetUnits, Number(forwardedPoolDecimals));
|
|
76
58
|
}
|
|
77
|
-
*/
|
|
78
59
|
const willSucceed = BigInt(estimatedWithdrawQuantityInAssetUnits) >=
|
|
79
60
|
BigInt(minimumWithdrawQuantityInAssetUnits);
|
|
80
61
|
return {
|
|
@@ -1145,6 +1145,7 @@ export declare class RestAuthenticatedClient {
|
|
|
1145
1145
|
protected getContractAndChainId(): Promise<{
|
|
1146
1146
|
chainId: number;
|
|
1147
1147
|
exchangeContractAddress: string;
|
|
1148
|
+
bridgeAdapterContractAddress: string;
|
|
1148
1149
|
}>;
|
|
1149
1150
|
/**
|
|
1150
1151
|
* - Internal Use and may change or break without notice
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticated.d.ts","sourceRoot":"","sources":["../../../src/client/rest/authenticated.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,OAAO,EAIL,eAAe,EAEhB,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"authenticated.d.ts","sourceRoot":"","sources":["../../../src/client/rest/authenticated.ts"],"names":[],"m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B;IAWR;;;;;OAKG;cACa,GAAG,CAAC,CAAC,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,MAAW,EACjB,WAAW,GAAE,IAAI,CACf,OAAO,CAAC,kBAAkB,CAAC,EAC3B,QAAQ,GAAG,KAAK,GAAG,MAAM,CACrB;IAWR;;;;;OAKG;cACa,KAAK,CAAC,CAAC,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,MAAW,EACjB,WAAW,GAAE,IAAI,CACf,OAAO,CAAC,kBAAkB,CAAC,EAC3B,QAAQ,GAAG,KAAK,GAAG,MAAM,CACrB;IAWR;;;;;OAKG;IAEH,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,GAAG,EACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACjC,CACI;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE,GACjB;QACE,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC;QAC7D,IAAI,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;KAClC,CACJ,EACH,yBAAyB,UAAoC;CAwBhE"}
|
|
@@ -11,7 +11,9 @@ const ethers_1 = require("ethers");
|
|
|
11
11
|
const _constants_1 = require("#constants");
|
|
12
12
|
const _signatures_1 = require("#signatures");
|
|
13
13
|
const _utils_1 = require("#utils");
|
|
14
|
+
const withdraw_1 = require("#bridge/withdraw");
|
|
14
15
|
const public_1 = require("#client/rest/public");
|
|
16
|
+
const request_1 = require("#types/enums/request");
|
|
15
17
|
/**
|
|
16
18
|
* The {@link RestAuthenticatedClient} is used to make authenticated requests to the Katana Perps API. It includes
|
|
17
19
|
* methods that make requests on behalf of a specific wallet such as creating and cancelling orders.
|
|
@@ -836,13 +838,13 @@ class RestAuthenticatedClient {
|
|
|
836
838
|
*/
|
|
837
839
|
async withdraw($params, signer = this.#signer) {
|
|
838
840
|
ensureSigner(signer);
|
|
839
|
-
const { chainId, exchangeContractAddress } = await this.getContractAndChainId();
|
|
841
|
+
const { chainId, exchangeContractAddress, bridgeAdapterContractAddress } = await this.getContractAndChainId();
|
|
840
842
|
let params;
|
|
841
843
|
if ($params.bridgeTarget) {
|
|
842
844
|
const { bridgeTarget, ...rest } = $params;
|
|
843
845
|
params = {
|
|
844
846
|
...rest,
|
|
845
|
-
...getWithdrawalRequestBridgeAdapterParametersForTarget(),
|
|
847
|
+
...getWithdrawalRequestBridgeAdapterParametersForTarget(bridgeTarget, bridgeAdapterContractAddress, this.#config.sandbox),
|
|
846
848
|
};
|
|
847
849
|
}
|
|
848
850
|
else {
|
|
@@ -1138,13 +1140,13 @@ class RestAuthenticatedClient {
|
|
|
1138
1140
|
},
|
|
1139
1141
|
withdrawFromManagedAccountByQuantity: async ($params, signer = this.#signer) => {
|
|
1140
1142
|
ensureSigner(signer);
|
|
1141
|
-
const { chainId, exchangeContractAddress } = await this.getContractAndChainId();
|
|
1143
|
+
const { chainId, exchangeContractAddress, bridgeAdapterContractAddress } = await this.getContractAndChainId();
|
|
1142
1144
|
let params;
|
|
1143
1145
|
if ($params.bridgeTarget) {
|
|
1144
1146
|
const { bridgeTarget, ...rest } = $params;
|
|
1145
1147
|
params = {
|
|
1146
1148
|
...rest,
|
|
1147
|
-
...getWithdrawalRequestBridgeAdapterParametersForTarget(),
|
|
1149
|
+
...getWithdrawalRequestBridgeAdapterParametersForTarget(bridgeTarget, bridgeAdapterContractAddress, this.#config.sandbox),
|
|
1148
1150
|
};
|
|
1149
1151
|
}
|
|
1150
1152
|
else {
|
|
@@ -1157,13 +1159,13 @@ class RestAuthenticatedClient {
|
|
|
1157
1159
|
},
|
|
1158
1160
|
withdrawFromManagedAccountByShares: async ($params, signer = this.#signer) => {
|
|
1159
1161
|
ensureSigner(signer);
|
|
1160
|
-
const { chainId, exchangeContractAddress } = await this.getContractAndChainId();
|
|
1162
|
+
const { chainId, exchangeContractAddress, bridgeAdapterContractAddress } = await this.getContractAndChainId();
|
|
1161
1163
|
let params;
|
|
1162
1164
|
if ($params.bridgeTarget) {
|
|
1163
1165
|
const { bridgeTarget, ...rest } = $params;
|
|
1164
1166
|
params = {
|
|
1165
1167
|
...rest,
|
|
1166
|
-
...getWithdrawalRequestBridgeAdapterParametersForTarget(),
|
|
1168
|
+
...getWithdrawalRequestBridgeAdapterParametersForTarget(bridgeTarget, bridgeAdapterContractAddress, this.#config.sandbox),
|
|
1167
1169
|
};
|
|
1168
1170
|
}
|
|
1169
1171
|
else {
|
|
@@ -1177,8 +1179,8 @@ class RestAuthenticatedClient {
|
|
|
1177
1179
|
});
|
|
1178
1180
|
// Internal methods exposed for advanced usage
|
|
1179
1181
|
async getContractAndChainId() {
|
|
1180
|
-
let { chainId, exchangeContractAddress } = this.#config;
|
|
1181
|
-
if (!chainId || !exchangeContractAddress) {
|
|
1182
|
+
let { chainId, exchangeContractAddress, bridgeAdapterContractAddress } = this.#config;
|
|
1183
|
+
if (!chainId || !exchangeContractAddress || !bridgeAdapterContractAddress) {
|
|
1182
1184
|
if (!this.#exchange) {
|
|
1183
1185
|
this.#exchange = await this.public.getExchange();
|
|
1184
1186
|
}
|
|
@@ -1189,13 +1191,18 @@ class RestAuthenticatedClient {
|
|
|
1189
1191
|
this.#exchange.exchangeContractAddress;
|
|
1190
1192
|
exchangeContractAddress ??= this.#config.exchangeContractAddress;
|
|
1191
1193
|
}
|
|
1194
|
+
this.#config.bridgeAdapterContractAddress ??=
|
|
1195
|
+
this.#exchange.bridgeAdapters.stargateBridgeAdapterV1KatanaContractAddress;
|
|
1196
|
+
bridgeAdapterContractAddress ??=
|
|
1197
|
+
this.#config.bridgeAdapterContractAddress;
|
|
1192
1198
|
}
|
|
1193
|
-
if (!chainId || !exchangeContractAddress) {
|
|
1194
|
-
throw new Error(`Could not determine chainId (${typeof chainId}) or exchangeContractAddress (${typeof exchangeContractAddress})`);
|
|
1199
|
+
if (!chainId || !exchangeContractAddress || !bridgeAdapterContractAddress) {
|
|
1200
|
+
throw new Error(`Could not determine chainId (${typeof chainId}) or exchangeContractAddress (${typeof exchangeContractAddress}) or bridgeAdapterContractAddress (${typeof bridgeAdapterContractAddress})`);
|
|
1195
1201
|
}
|
|
1196
1202
|
return {
|
|
1197
1203
|
chainId,
|
|
1198
1204
|
exchangeContractAddress,
|
|
1205
|
+
bridgeAdapterContractAddress,
|
|
1199
1206
|
};
|
|
1200
1207
|
}
|
|
1201
1208
|
/**
|
|
@@ -1303,9 +1310,13 @@ function ensureSigner(signer) {
|
|
|
1303
1310
|
/**
|
|
1304
1311
|
* @internal
|
|
1305
1312
|
*/
|
|
1306
|
-
function getWithdrawalRequestBridgeAdapterParametersForTarget() {
|
|
1313
|
+
function getWithdrawalRequestBridgeAdapterParametersForTarget(bridgeTarget, bridgeAdapterContractAddress, sandbox) {
|
|
1307
1314
|
return {
|
|
1308
|
-
bridgeAdapterAddress:
|
|
1309
|
-
|
|
1315
|
+
bridgeAdapterAddress: bridgeTarget === request_1.BridgeTarget.KATANA_KATANA ?
|
|
1316
|
+
ethers_1.ethers.ZeroAddress
|
|
1317
|
+
: bridgeAdapterContractAddress,
|
|
1318
|
+
bridgeAdapterPayload: bridgeTarget === request_1.BridgeTarget.KATANA_KATANA ?
|
|
1319
|
+
'0x'
|
|
1320
|
+
: (0, withdraw_1.getEncodedWithdrawalPayloadForBridgeTarget)(bridgeTarget, sandbox),
|
|
1310
1321
|
};
|
|
1311
1322
|
}
|
|
@@ -415,6 +415,29 @@ export declare class RestPublicClient {
|
|
|
415
415
|
* @category Exchange Data
|
|
416
416
|
*/
|
|
417
417
|
getFundingRates(params: katanaPerps.RestRequestGetFundingRates): Promise<katanaPerps.RestResponseGetFundingRates>;
|
|
418
|
+
/**
|
|
419
|
+
* Get Funding Rate Samples
|
|
420
|
+
*
|
|
421
|
+
* ---
|
|
422
|
+
* **Endpoint Parameters**
|
|
423
|
+
*
|
|
424
|
+
* > - **HTTP Request**: `GET /v1/fundingRateSamples`
|
|
425
|
+
* > - **Endpoint Security:** [Public](https://api-docs-v1-perps.katana.network/#endpointSecurityPublic)
|
|
426
|
+
* > - **API Key Scope:** [None](https://api-docs-v1-perps.katana.network/#api-keys)
|
|
427
|
+
* > - **Pagination:**
|
|
428
|
+
* > {@link katanaperps.RestRequestPaginationWithFromId.start start},
|
|
429
|
+
* > {@link katanaperps.RestRequestPaginationWithFromId.end end},
|
|
430
|
+
* > {@link katanaperps.RestRequestPaginationWithFromId.limit limit}
|
|
431
|
+
* ---
|
|
432
|
+
*
|
|
433
|
+
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1-perps.katana.network/classes/RestPublicClient.html#getFundingRateSamples)
|
|
434
|
+
* @see request {@link katanaperps.RestRequestGetFundingRateSamples RestRequestGetFundingRateSamples}
|
|
435
|
+
* @see response {@link katanaperps.RestResponseGetFundingRateSamples RestResponseGetFundingRateSamples}
|
|
436
|
+
* @see type {@link katanaperps.KatanaPerpsFundingRateSample KatanaPerpsFundingRateSample}
|
|
437
|
+
*
|
|
438
|
+
* @category Exchange Data
|
|
439
|
+
*/
|
|
440
|
+
getFundingRateSamples(params: katanaPerps.RestRequestGetFundingRateSamples): Promise<katanaPerps.RestResponseGetFundingRateSamples>;
|
|
418
441
|
/**
|
|
419
442
|
* - All requests within the internal symbol are undocumented internal methods which may change or be removed without notice.
|
|
420
443
|
* - API handling of the parameters used within these methods is likely to change without notice without changes to the SDK to match.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/client/rest/public.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,eAAe,EAIhB,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,KAAK,WAAW,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EACV,aA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E,WAAW,CAAC,0BAA0B;IAO3E;;;;;;;;;;;;;;;;;;;;;OAqBG;IACU,qBAAqB,CAChC,MAAM,EAAE,WAAW,CAAC,gCAAgC;IAQtD;;;;;;;OAOG;IACH,SAAgB,CAAC,eAAe,CAAC;;OAIrB;cAII,GAAG,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,eAAe,GAAG,EAAE,EAC5D,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,CAAC,GAAG,SAAS,EACtB,WAAW,GAAE,IAAI,CACf,OAAO,CAAC,kBAAkB,CAAC,EAC3B,QAAQ,GAAG,KAAK,GAAG,QAAQ,CACvB;IAaR,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,GAAG,EACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE;IAezD,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;CAG/B;AAOD,wBAAsB,mCAAmC,CACvD,IAAI,CAAC,EAAE,uBAAuB,qFAkB/B"}
|
|
@@ -446,6 +446,31 @@ class RestPublicClient {
|
|
|
446
446
|
async getFundingRates(params) {
|
|
447
447
|
return this.get('/fundingRates', params);
|
|
448
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* Get Funding Rate Samples
|
|
451
|
+
*
|
|
452
|
+
* ---
|
|
453
|
+
* **Endpoint Parameters**
|
|
454
|
+
*
|
|
455
|
+
* > - **HTTP Request**: `GET /v1/fundingRateSamples`
|
|
456
|
+
* > - **Endpoint Security:** [Public](https://api-docs-v1-perps.katana.network/#endpointSecurityPublic)
|
|
457
|
+
* > - **API Key Scope:** [None](https://api-docs-v1-perps.katana.network/#api-keys)
|
|
458
|
+
* > - **Pagination:**
|
|
459
|
+
* > {@link katanaperps.RestRequestPaginationWithFromId.start start},
|
|
460
|
+
* > {@link katanaperps.RestRequestPaginationWithFromId.end end},
|
|
461
|
+
* > {@link katanaperps.RestRequestPaginationWithFromId.limit limit}
|
|
462
|
+
* ---
|
|
463
|
+
*
|
|
464
|
+
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1-perps.katana.network/classes/RestPublicClient.html#getFundingRateSamples)
|
|
465
|
+
* @see request {@link katanaperps.RestRequestGetFundingRateSamples RestRequestGetFundingRateSamples}
|
|
466
|
+
* @see response {@link katanaperps.RestResponseGetFundingRateSamples RestResponseGetFundingRateSamples}
|
|
467
|
+
* @see type {@link katanaperps.KatanaPerpsFundingRateSample KatanaPerpsFundingRateSample}
|
|
468
|
+
*
|
|
469
|
+
* @category Exchange Data
|
|
470
|
+
*/
|
|
471
|
+
async getFundingRateSamples(params) {
|
|
472
|
+
return this.get('/fundingRateSamples', params);
|
|
473
|
+
}
|
|
449
474
|
/**
|
|
450
475
|
* - All requests within the internal symbol are undocumented internal methods which may change or be removed without notice.
|
|
451
476
|
* - API handling of the parameters used within these methods is likely to change without notice without changes to the SDK to match.
|
package/dist/typechain-types/{ExchangeLayerZeroAdapter_v3.d.ts → ExchangeLayerZeroAdapter_v1.d.ts}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from 'ethers';
|
|
2
2
|
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from './common';
|
|
3
|
-
export interface
|
|
4
|
-
getFunction(nameOrSignature: 'MAX_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER' | 'MIN_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER' | '
|
|
3
|
+
export interface ExchangeLayerZeroAdapter_v1Interface extends Interface {
|
|
4
|
+
getFunction(nameOrSignature: 'MAX_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER' | 'MIN_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER' | 'acceptOwnership' | 'addManagedAccountDepositFeeQuantityInAssetUnits' | 'addManagedAccountManagerWalletNativeDropQuantity' | 'depositToManagedAccountFeeQuantityInAssetUnits' | 'estimateWithdrawQuantityInAssetUnits' | 'ethereumComposeGasLimit' | 'ethereumEndpointId' | 'exchange' | 'isDepositEnabled' | 'isWithdrawEnabled' | 'loadEthereumWithdrawalGasFeeInAssetUnits' | 'lzCompose' | 'lzEndpoint' | 'minimumAddManagedAccountDepositQuantityInAssetUnits' | 'minimumDepositToManagedAccountQuantityInAssetUnits' | 'minimumWithdrawQuantityMultiplier' | 'oft' | 'owner' | 'pendingOwner' | 'quoteAsset' | 'renounceOwnership' | 'setComposeParameters' | 'setDepositEnabled' | 'setEthereumComposeGasLimit' | 'setMinimumWithdrawQuantityMultiplier' | 'setStargateForwarder' | 'setWithdrawEnabled' | 'stargateForwarder' | 'transferOwnership' | 'withdrawNativeAsset' | 'withdrawQuoteAsset'): FunctionFragment;
|
|
5
5
|
getEvent(nameOrSignatureOrTopic: 'ComposeFailed' | 'ComposeSucceeded' | 'OwnershipTransferStarted' | 'OwnershipTransferred' | 'WithdrawQuoteAssetFailed'): EventFragment;
|
|
6
6
|
encodeFunctionData(functionFragment: 'MAX_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER', values?: undefined): string;
|
|
7
7
|
encodeFunctionData(functionFragment: 'MIN_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER', values?: undefined): string;
|
|
8
|
-
encodeFunctionData(functionFragment: 'PIP_PRICE_MULTIPLIER', values?: undefined): string;
|
|
9
8
|
encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string;
|
|
10
9
|
encodeFunctionData(functionFragment: 'addManagedAccountDepositFeeQuantityInAssetUnits', values?: undefined): string;
|
|
11
10
|
encodeFunctionData(functionFragment: 'addManagedAccountManagerWalletNativeDropQuantity', values?: undefined): string;
|
|
12
|
-
encodeFunctionData(functionFragment: 'berachainEndpointId', values?: undefined): string;
|
|
13
11
|
encodeFunctionData(functionFragment: 'depositToManagedAccountFeeQuantityInAssetUnits', values?: undefined): string;
|
|
14
|
-
encodeFunctionData(functionFragment: 'estimateWithdrawQuantityInAssetUnits', values: [BigNumberish
|
|
12
|
+
encodeFunctionData(functionFragment: 'estimateWithdrawQuantityInAssetUnits', values: [BigNumberish]): string;
|
|
13
|
+
encodeFunctionData(functionFragment: 'ethereumComposeGasLimit', values?: undefined): string;
|
|
14
|
+
encodeFunctionData(functionFragment: 'ethereumEndpointId', values?: undefined): string;
|
|
15
15
|
encodeFunctionData(functionFragment: 'exchange', values?: undefined): string;
|
|
16
16
|
encodeFunctionData(functionFragment: 'isDepositEnabled', values?: undefined): string;
|
|
17
17
|
encodeFunctionData(functionFragment: 'isWithdrawEnabled', values?: undefined): string;
|
|
18
|
-
encodeFunctionData(functionFragment: '
|
|
18
|
+
encodeFunctionData(functionFragment: 'loadEthereumWithdrawalGasFeeInAssetUnits', values?: undefined): string;
|
|
19
19
|
encodeFunctionData(functionFragment: 'lzCompose', values: [AddressLike, BytesLike, BytesLike, AddressLike, BytesLike]): string;
|
|
20
20
|
encodeFunctionData(functionFragment: 'lzEndpoint', values?: undefined): string;
|
|
21
21
|
encodeFunctionData(functionFragment: 'minimumAddManagedAccountDepositQuantityInAssetUnits', values?: undefined): string;
|
|
@@ -35,6 +35,7 @@ export interface ExchangeLayerZeroAdapter_v3Interface extends Interface {
|
|
|
35
35
|
BigNumberish
|
|
36
36
|
]): string;
|
|
37
37
|
encodeFunctionData(functionFragment: 'setDepositEnabled', values: [boolean]): string;
|
|
38
|
+
encodeFunctionData(functionFragment: 'setEthereumComposeGasLimit', values: [BigNumberish]): string;
|
|
38
39
|
encodeFunctionData(functionFragment: 'setMinimumWithdrawQuantityMultiplier', values: [BigNumberish]): string;
|
|
39
40
|
encodeFunctionData(functionFragment: 'setStargateForwarder', values: [AddressLike]): string;
|
|
40
41
|
encodeFunctionData(functionFragment: 'setWithdrawEnabled', values: [boolean]): string;
|
|
@@ -44,17 +45,17 @@ export interface ExchangeLayerZeroAdapter_v3Interface extends Interface {
|
|
|
44
45
|
encodeFunctionData(functionFragment: 'withdrawQuoteAsset', values: [AddressLike, BigNumberish, BytesLike]): string;
|
|
45
46
|
decodeFunctionResult(functionFragment: 'MAX_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER', data: BytesLike): Result;
|
|
46
47
|
decodeFunctionResult(functionFragment: 'MIN_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER', data: BytesLike): Result;
|
|
47
|
-
decodeFunctionResult(functionFragment: 'PIP_PRICE_MULTIPLIER', data: BytesLike): Result;
|
|
48
48
|
decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result;
|
|
49
49
|
decodeFunctionResult(functionFragment: 'addManagedAccountDepositFeeQuantityInAssetUnits', data: BytesLike): Result;
|
|
50
50
|
decodeFunctionResult(functionFragment: 'addManagedAccountManagerWalletNativeDropQuantity', data: BytesLike): Result;
|
|
51
|
-
decodeFunctionResult(functionFragment: 'berachainEndpointId', data: BytesLike): Result;
|
|
52
51
|
decodeFunctionResult(functionFragment: 'depositToManagedAccountFeeQuantityInAssetUnits', data: BytesLike): Result;
|
|
53
52
|
decodeFunctionResult(functionFragment: 'estimateWithdrawQuantityInAssetUnits', data: BytesLike): Result;
|
|
53
|
+
decodeFunctionResult(functionFragment: 'ethereumComposeGasLimit', data: BytesLike): Result;
|
|
54
|
+
decodeFunctionResult(functionFragment: 'ethereumEndpointId', data: BytesLike): Result;
|
|
54
55
|
decodeFunctionResult(functionFragment: 'exchange', data: BytesLike): Result;
|
|
55
56
|
decodeFunctionResult(functionFragment: 'isDepositEnabled', data: BytesLike): Result;
|
|
56
57
|
decodeFunctionResult(functionFragment: 'isWithdrawEnabled', data: BytesLike): Result;
|
|
57
|
-
decodeFunctionResult(functionFragment: '
|
|
58
|
+
decodeFunctionResult(functionFragment: 'loadEthereumWithdrawalGasFeeInAssetUnits', data: BytesLike): Result;
|
|
58
59
|
decodeFunctionResult(functionFragment: 'lzCompose', data: BytesLike): Result;
|
|
59
60
|
decodeFunctionResult(functionFragment: 'lzEndpoint', data: BytesLike): Result;
|
|
60
61
|
decodeFunctionResult(functionFragment: 'minimumAddManagedAccountDepositQuantityInAssetUnits', data: BytesLike): Result;
|
|
@@ -67,6 +68,7 @@ export interface ExchangeLayerZeroAdapter_v3Interface extends Interface {
|
|
|
67
68
|
decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result;
|
|
68
69
|
decodeFunctionResult(functionFragment: 'setComposeParameters', data: BytesLike): Result;
|
|
69
70
|
decodeFunctionResult(functionFragment: 'setDepositEnabled', data: BytesLike): Result;
|
|
71
|
+
decodeFunctionResult(functionFragment: 'setEthereumComposeGasLimit', data: BytesLike): Result;
|
|
70
72
|
decodeFunctionResult(functionFragment: 'setMinimumWithdrawQuantityMultiplier', data: BytesLike): Result;
|
|
71
73
|
decodeFunctionResult(functionFragment: 'setStargateForwarder', data: BytesLike): Result;
|
|
72
74
|
decodeFunctionResult(functionFragment: 'setWithdrawEnabled', data: BytesLike): Result;
|
|
@@ -165,10 +167,10 @@ export declare namespace WithdrawQuoteAssetFailedEvent {
|
|
|
165
167
|
type Log = TypedEventLog<Event>;
|
|
166
168
|
type LogDescription = TypedLogDescription<Event>;
|
|
167
169
|
}
|
|
168
|
-
export interface
|
|
169
|
-
connect(runner?: ContractRunner | null):
|
|
170
|
+
export interface ExchangeLayerZeroAdapter_v1 extends BaseContract {
|
|
171
|
+
connect(runner?: ContractRunner | null): ExchangeLayerZeroAdapter_v1;
|
|
170
172
|
waitForDeployment(): Promise<this>;
|
|
171
|
-
interface:
|
|
173
|
+
interface: ExchangeLayerZeroAdapter_v1Interface;
|
|
172
174
|
queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
173
175
|
queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
174
176
|
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
@@ -186,7 +188,6 @@ export interface ExchangeLayerZeroAdapter_v3 extends BaseContract {
|
|
|
186
188
|
], [
|
|
187
189
|
bigint
|
|
188
190
|
], 'view'>;
|
|
189
|
-
PIP_PRICE_MULTIPLIER: TypedContractMethod<[], [bigint], 'view'>;
|
|
190
191
|
acceptOwnership: TypedContractMethod<[], [void], 'nonpayable'>;
|
|
191
192
|
addManagedAccountDepositFeeQuantityInAssetUnits: TypedContractMethod<[
|
|
192
193
|
], [
|
|
@@ -196,13 +197,11 @@ export interface ExchangeLayerZeroAdapter_v3 extends BaseContract {
|
|
|
196
197
|
], [
|
|
197
198
|
bigint
|
|
198
199
|
], 'view'>;
|
|
199
|
-
berachainEndpointId: TypedContractMethod<[], [bigint], 'view'>;
|
|
200
200
|
depositToManagedAccountFeeQuantityInAssetUnits: TypedContractMethod<[
|
|
201
201
|
], [
|
|
202
202
|
bigint
|
|
203
203
|
], 'view'>;
|
|
204
204
|
estimateWithdrawQuantityInAssetUnits: TypedContractMethod<[
|
|
205
|
-
destinationEndpointId: BigNumberish,
|
|
206
205
|
quantity: BigNumberish
|
|
207
206
|
], [
|
|
208
207
|
[
|
|
@@ -215,18 +214,14 @@ export interface ExchangeLayerZeroAdapter_v3 extends BaseContract {
|
|
|
215
214
|
poolDecimals: bigint;
|
|
216
215
|
}
|
|
217
216
|
], 'view'>;
|
|
217
|
+
ethereumComposeGasLimit: TypedContractMethod<[], [bigint], 'view'>;
|
|
218
|
+
ethereumEndpointId: TypedContractMethod<[], [bigint], 'view'>;
|
|
218
219
|
exchange: TypedContractMethod<[], [string], 'view'>;
|
|
219
220
|
isDepositEnabled: TypedContractMethod<[], [boolean], 'view'>;
|
|
220
221
|
isWithdrawEnabled: TypedContractMethod<[], [boolean], 'view'>;
|
|
221
|
-
|
|
222
|
+
loadEthereumWithdrawalGasFeeInAssetUnits: TypedContractMethod<[
|
|
222
223
|
], [
|
|
223
|
-
|
|
224
|
-
bigint,
|
|
225
|
-
bigint
|
|
226
|
-
] & {
|
|
227
|
-
gasFeeWithoutForwardInAssetUnits: bigint;
|
|
228
|
-
gasFeeWithForwardInAssetUnits: bigint;
|
|
229
|
-
}
|
|
224
|
+
bigint
|
|
230
225
|
], 'view'>;
|
|
231
226
|
lzCompose: TypedContractMethod<[
|
|
232
227
|
_from: AddressLike,
|
|
@@ -267,6 +262,11 @@ export interface ExchangeLayerZeroAdapter_v3 extends BaseContract {
|
|
|
267
262
|
], [
|
|
268
263
|
void
|
|
269
264
|
], 'nonpayable'>;
|
|
265
|
+
setEthereumComposeGasLimit: TypedContractMethod<[
|
|
266
|
+
newEthereumComposeGasLimit: BigNumberish
|
|
267
|
+
], [
|
|
268
|
+
void
|
|
269
|
+
], 'nonpayable'>;
|
|
270
270
|
setMinimumWithdrawQuantityMultiplier: TypedContractMethod<[
|
|
271
271
|
newMinimumWithdrawQuantityMultiplier: BigNumberish
|
|
272
272
|
], [
|
|
@@ -304,14 +304,11 @@ export interface ExchangeLayerZeroAdapter_v3 extends BaseContract {
|
|
|
304
304
|
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
305
305
|
getFunction(nameOrSignature: 'MAX_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER'): TypedContractMethod<[], [bigint], 'view'>;
|
|
306
306
|
getFunction(nameOrSignature: 'MIN_MINIMUM_WITHDRAW_QUANTITY_MULTIPLIER'): TypedContractMethod<[], [bigint], 'view'>;
|
|
307
|
-
getFunction(nameOrSignature: 'PIP_PRICE_MULTIPLIER'): TypedContractMethod<[], [bigint], 'view'>;
|
|
308
307
|
getFunction(nameOrSignature: 'acceptOwnership'): TypedContractMethod<[], [void], 'nonpayable'>;
|
|
309
308
|
getFunction(nameOrSignature: 'addManagedAccountDepositFeeQuantityInAssetUnits'): TypedContractMethod<[], [bigint], 'view'>;
|
|
310
309
|
getFunction(nameOrSignature: 'addManagedAccountManagerWalletNativeDropQuantity'): TypedContractMethod<[], [bigint], 'view'>;
|
|
311
|
-
getFunction(nameOrSignature: 'berachainEndpointId'): TypedContractMethod<[], [bigint], 'view'>;
|
|
312
310
|
getFunction(nameOrSignature: 'depositToManagedAccountFeeQuantityInAssetUnits'): TypedContractMethod<[], [bigint], 'view'>;
|
|
313
311
|
getFunction(nameOrSignature: 'estimateWithdrawQuantityInAssetUnits'): TypedContractMethod<[
|
|
314
|
-
destinationEndpointId: BigNumberish,
|
|
315
312
|
quantity: BigNumberish
|
|
316
313
|
], [
|
|
317
314
|
[
|
|
@@ -324,19 +321,12 @@ export interface ExchangeLayerZeroAdapter_v3 extends BaseContract {
|
|
|
324
321
|
poolDecimals: bigint;
|
|
325
322
|
}
|
|
326
323
|
], 'view'>;
|
|
324
|
+
getFunction(nameOrSignature: 'ethereumComposeGasLimit'): TypedContractMethod<[], [bigint], 'view'>;
|
|
325
|
+
getFunction(nameOrSignature: 'ethereumEndpointId'): TypedContractMethod<[], [bigint], 'view'>;
|
|
327
326
|
getFunction(nameOrSignature: 'exchange'): TypedContractMethod<[], [string], 'view'>;
|
|
328
327
|
getFunction(nameOrSignature: 'isDepositEnabled'): TypedContractMethod<[], [boolean], 'view'>;
|
|
329
328
|
getFunction(nameOrSignature: 'isWithdrawEnabled'): TypedContractMethod<[], [boolean], 'view'>;
|
|
330
|
-
getFunction(nameOrSignature: '
|
|
331
|
-
], [
|
|
332
|
-
[
|
|
333
|
-
bigint,
|
|
334
|
-
bigint
|
|
335
|
-
] & {
|
|
336
|
-
gasFeeWithoutForwardInAssetUnits: bigint;
|
|
337
|
-
gasFeeWithForwardInAssetUnits: bigint;
|
|
338
|
-
}
|
|
339
|
-
], 'view'>;
|
|
329
|
+
getFunction(nameOrSignature: 'loadEthereumWithdrawalGasFeeInAssetUnits'): TypedContractMethod<[], [bigint], 'view'>;
|
|
340
330
|
getFunction(nameOrSignature: 'lzCompose'): TypedContractMethod<[
|
|
341
331
|
_from: AddressLike,
|
|
342
332
|
arg1: BytesLike,
|
|
@@ -366,6 +356,11 @@ export interface ExchangeLayerZeroAdapter_v3 extends BaseContract {
|
|
|
366
356
|
void
|
|
367
357
|
], 'nonpayable'>;
|
|
368
358
|
getFunction(nameOrSignature: 'setDepositEnabled'): TypedContractMethod<[isEnabled: boolean], [void], 'nonpayable'>;
|
|
359
|
+
getFunction(nameOrSignature: 'setEthereumComposeGasLimit'): TypedContractMethod<[
|
|
360
|
+
newEthereumComposeGasLimit: BigNumberish
|
|
361
|
+
], [
|
|
362
|
+
void
|
|
363
|
+
], 'nonpayable'>;
|
|
369
364
|
getFunction(nameOrSignature: 'setMinimumWithdrawQuantityMultiplier'): TypedContractMethod<[
|
|
370
365
|
newMinimumWithdrawQuantityMultiplier: BigNumberish
|
|
371
366
|
], [
|
|
@@ -410,4 +405,4 @@ export interface ExchangeLayerZeroAdapter_v3 extends BaseContract {
|
|
|
410
405
|
WithdrawQuoteAssetFailed: TypedContractEvent<WithdrawQuoteAssetFailedEvent.InputTuple, WithdrawQuoteAssetFailedEvent.OutputTuple, WithdrawQuoteAssetFailedEvent.OutputObject>;
|
|
411
406
|
};
|
|
412
407
|
}
|
|
413
|
-
//# sourceMappingURL=
|
|
408
|
+
//# sourceMappingURL=ExchangeLayerZeroAdapter_v1.d.ts.map
|