@katanaperps/katana-perps-sdk 2.1.0-alpha.3 → 2.1.0-beta.10

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 (67) hide show
  1. package/dist/abis/{ExchangeLocalDepositAdapter_v1.json → EarningsEscrow_v2.json} +95 -74
  2. package/dist/abis/ExchangeLayerZeroAdapter_v1.json +5 -0
  3. package/dist/abis/KatanaPerpsStargateForwarder_v1.json +1 -1
  4. package/dist/bridge/config.d.ts +3 -2
  5. package/dist/bridge/config.d.ts.map +1 -1
  6. package/dist/bridge/config.js +4 -3
  7. package/dist/bridge/deposit.d.ts +2 -9
  8. package/dist/bridge/deposit.d.ts.map +1 -1
  9. package/dist/bridge/deposit.js +4 -60
  10. package/dist/bridge/utils.d.ts +3 -3
  11. package/dist/bridge/utils.d.ts.map +1 -1
  12. package/dist/bridge/utils.js +6 -17
  13. package/dist/client/rest/authenticated.d.ts +9 -17
  14. package/dist/client/rest/authenticated.d.ts.map +1 -1
  15. package/dist/client/rest/authenticated.js +30 -19
  16. package/dist/client/webSocket/transform.d.ts.map +1 -1
  17. package/dist/client/webSocket/transform.js +1 -0
  18. package/dist/typechain-types/{ExchangeLoopbackAdapter_v1.d.ts → EarningsEscrow_v2.d.ts} +82 -82
  19. package/dist/typechain-types/EarningsEscrow_v2.d.ts.map +1 -0
  20. package/dist/typechain-types/ExchangeLayerZeroAdapter_v1.d.ts +5 -2
  21. package/dist/typechain-types/ExchangeLayerZeroAdapter_v1.d.ts.map +1 -1
  22. package/dist/typechain-types/FixedIncomeVaultProviderStateAggregator_v1.d.ts +16 -16
  23. package/dist/typechain-types/FixedIncomeVaultProviderStateAggregator_v1.d.ts.map +1 -1
  24. package/dist/typechain-types/FixedIncomeVaultProvider_v1.d.ts +100 -78
  25. package/dist/typechain-types/FixedIncomeVaultProvider_v1.d.ts.map +1 -1
  26. package/dist/typechain-types/KatanaPerpsStargateForwarder_v1.d.ts +2 -2
  27. package/dist/typechain-types/KatanaPerpsStargateForwarder_v1.d.ts.map +1 -1
  28. package/dist/typechain-types/factories/{ExchangeLocalDepositAdapter_v1__factory.d.ts → EarningsEscrow_v2__factory.d.ts} +85 -72
  29. package/dist/typechain-types/factories/EarningsEscrow_v2__factory.d.ts.map +1 -0
  30. package/dist/typechain-types/factories/{ExchangeLocalDepositAdapter_v1__factory.js → EarningsEscrow_v2__factory.js} +98 -77
  31. package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v1__factory.d.ts +4 -0
  32. package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v1__factory.d.ts.map +1 -1
  33. package/dist/typechain-types/factories/ExchangeLayerZeroAdapter_v1__factory.js +5 -0
  34. package/dist/typechain-types/factories/FixedIncomeVaultProviderStateAggregator_v1__factory.d.ts +16 -16
  35. package/dist/typechain-types/factories/FixedIncomeVaultProviderStateAggregator_v1__factory.js +21 -21
  36. package/dist/typechain-types/factories/FixedIncomeVaultProvider_v1__factory.d.ts +113 -90
  37. package/dist/typechain-types/factories/FixedIncomeVaultProvider_v1__factory.d.ts.map +1 -1
  38. package/dist/typechain-types/factories/FixedIncomeVaultProvider_v1__factory.js +136 -106
  39. package/dist/typechain-types/factories/KatanaPerpsStargateForwarder_v1__factory.d.ts +1 -1
  40. package/dist/typechain-types/factories/KatanaPerpsStargateForwarder_v1__factory.js +1 -1
  41. package/dist/typechain-types/factories/index.d.ts +1 -4
  42. package/dist/typechain-types/factories/index.d.ts.map +1 -1
  43. package/dist/typechain-types/factories/index.js +3 -9
  44. package/dist/typechain-types/index.d.ts +2 -8
  45. package/dist/typechain-types/index.d.ts.map +1 -1
  46. package/dist/typechain-types/index.js +3 -9
  47. package/dist/types/rest/endpoints/GetExchange.d.ts +0 -44
  48. package/dist/types/rest/endpoints/GetExchange.d.ts.map +1 -1
  49. package/dist/types/rest/endpoints/GetFills.d.ts +6 -0
  50. package/dist/types/rest/endpoints/GetFills.d.ts.map +1 -1
  51. package/dist/types/rest/endpoints/internal.d.ts +235 -8
  52. package/dist/types/rest/endpoints/internal.d.ts.map +1 -1
  53. package/dist/types/webSocket/response/ordersFill.d.ts +4 -0
  54. package/dist/types/webSocket/response/ordersFill.d.ts.map +1 -1
  55. package/package.json +1 -1
  56. package/dist/abis/ExchangeLoopbackAdapter_v1.json +0 -300
  57. package/dist/abis/FixedIncomeVaultProviderStateAggregator_v1.json +0 -229
  58. package/dist/abis/FixedIncomeVaultProvider_v1.json +0 -2655
  59. package/dist/typechain-types/ExchangeLocalDepositAdapter_v1.d.ts +0 -210
  60. package/dist/typechain-types/ExchangeLocalDepositAdapter_v1.d.ts.map +0 -1
  61. package/dist/typechain-types/ExchangeLoopbackAdapter_v1.d.ts.map +0 -1
  62. package/dist/typechain-types/ExchangeLoopbackAdapter_v1.js +0 -2
  63. package/dist/typechain-types/factories/ExchangeLocalDepositAdapter_v1__factory.d.ts.map +0 -1
  64. package/dist/typechain-types/factories/ExchangeLoopbackAdapter_v1__factory.d.ts +0 -241
  65. package/dist/typechain-types/factories/ExchangeLoopbackAdapter_v1__factory.d.ts.map +0 -1
  66. package/dist/typechain-types/factories/ExchangeLoopbackAdapter_v1__factory.js +0 -317
  67. /package/dist/typechain-types/{ExchangeLocalDepositAdapter_v1.js → EarningsEscrow_v2.js} +0 -0
@@ -5,11 +5,6 @@
5
5
  "internalType": "address",
6
6
  "name": "exchange_",
7
7
  "type": "address"
8
- },
9
- {
10
- "internalType": "address",
11
- "name": "exchangeManagedAccountDepositAdapter_",
12
- "type": "address"
13
8
  }
14
9
  ],
15
10
  "stateMutability": "nonpayable",
@@ -37,13 +32,29 @@
37
32
  "name": "OwnableUnauthorizedAccount",
38
33
  "type": "error"
39
34
  },
35
+ {
36
+ "inputs": [],
37
+ "name": "ReentrancyGuardReentrantCall",
38
+ "type": "error"
39
+ },
40
+ {
41
+ "inputs": [
42
+ {
43
+ "internalType": "address",
44
+ "name": "token",
45
+ "type": "address"
46
+ }
47
+ ],
48
+ "name": "SafeERC20FailedOperation",
49
+ "type": "error"
50
+ },
40
51
  {
41
52
  "anonymous": false,
42
53
  "inputs": [
43
54
  {
44
- "indexed": false,
55
+ "indexed": true,
45
56
  "internalType": "address",
46
- "name": "depositorWallet",
57
+ "name": "wallet",
47
58
  "type": "address"
48
59
  },
49
60
  {
@@ -54,27 +65,21 @@
54
65
  },
55
66
  {
56
67
  "indexed": false,
57
- "internalType": "bytes",
58
- "name": "errorData",
59
- "type": "bytes"
68
+ "internalType": "uint256",
69
+ "name": "newTotalOwedQuantity",
70
+ "type": "uint256"
60
71
  }
61
72
  ],
62
- "name": "ComposeFailed",
73
+ "name": "AssetsDistributed",
63
74
  "type": "event"
64
75
  },
65
76
  {
66
77
  "anonymous": false,
67
78
  "inputs": [
68
- {
69
- "indexed": false,
70
- "internalType": "uint32",
71
- "name": "sourceEndpointId",
72
- "type": "uint32"
73
- },
74
79
  {
75
80
  "indexed": false,
76
81
  "internalType": "address",
77
- "name": "destinationWallet",
82
+ "name": "ownerWallet",
78
83
  "type": "address"
79
84
  },
80
85
  {
@@ -82,9 +87,15 @@
82
87
  "internalType": "uint256",
83
88
  "name": "quantity",
84
89
  "type": "uint256"
90
+ },
91
+ {
92
+ "indexed": false,
93
+ "internalType": "uint256",
94
+ "name": "newEscrowBalance",
95
+ "type": "uint256"
85
96
  }
86
97
  ],
87
- "name": "ComposeSucceeded",
98
+ "name": "EscrowWithdrawn",
88
99
  "type": "event"
89
100
  },
90
101
  {
@@ -126,59 +137,60 @@
126
137
  "type": "event"
127
138
  },
128
139
  {
129
- "anonymous": false,
140
+ "inputs": [],
141
+ "name": "acceptOwnership",
142
+ "outputs": [],
143
+ "stateMutability": "nonpayable",
144
+ "type": "function"
145
+ },
146
+ {
130
147
  "inputs": [
131
148
  {
132
- "indexed": false,
133
- "internalType": "address",
134
- "name": "depositorWallet",
135
- "type": "address"
136
- },
137
- {
138
- "indexed": false,
139
- "internalType": "uint256",
140
- "name": "quantity",
141
- "type": "uint256"
142
- },
143
- {
144
- "indexed": false,
145
- "internalType": "bytes",
146
- "name": "payload",
147
- "type": "bytes"
149
+ "internalType": "address[]",
150
+ "name": "wallets",
151
+ "type": "address[]"
148
152
  },
149
153
  {
150
- "indexed": false,
151
- "internalType": "bytes",
152
- "name": "errorData",
153
- "type": "bytes"
154
+ "internalType": "uint256[]",
155
+ "name": "newOwedQuantities",
156
+ "type": "uint256[]"
154
157
  }
155
158
  ],
156
- "name": "WithdrawQuoteAssetFailed",
157
- "type": "event"
159
+ "name": "bulkAssignOwedQuantities",
160
+ "outputs": [],
161
+ "stateMutability": "nonpayable",
162
+ "type": "function"
158
163
  },
159
164
  {
160
- "inputs": [],
161
- "name": "acceptOwnership",
165
+ "inputs": [
166
+ {
167
+ "internalType": "address",
168
+ "name": "walletAddress",
169
+ "type": "address"
170
+ }
171
+ ],
172
+ "name": "distribute",
162
173
  "outputs": [],
163
174
  "stateMutability": "nonpayable",
164
175
  "type": "function"
165
176
  },
166
177
  {
167
178
  "inputs": [
179
+ {
180
+ "internalType": "address",
181
+ "name": "",
182
+ "type": "address"
183
+ }
184
+ ],
185
+ "name": "distributedQuantityByWallet",
186
+ "outputs": [
168
187
  {
169
188
  "internalType": "uint256",
170
- "name": "quoteAssetQuantityInAssetUnits",
189
+ "name": "",
171
190
  "type": "uint256"
172
- },
173
- {
174
- "internalType": "bytes",
175
- "name": "payload",
176
- "type": "bytes"
177
191
  }
178
192
  ],
179
- "name": "deposit",
180
- "outputs": [],
181
- "stateMutability": "nonpayable",
193
+ "stateMutability": "view",
182
194
  "type": "function"
183
195
  },
184
196
  {
@@ -196,25 +208,31 @@
196
208
  },
197
209
  {
198
210
  "inputs": [],
199
- "name": "exchangeManagedAccountDepositAdapter",
211
+ "name": "isDistributeEnabled",
200
212
  "outputs": [
201
213
  {
202
- "internalType": "contract IExchangeManagedAccountDepositAdapter",
214
+ "internalType": "bool",
203
215
  "name": "",
204
- "type": "address"
216
+ "type": "bool"
205
217
  }
206
218
  ],
207
219
  "stateMutability": "view",
208
220
  "type": "function"
209
221
  },
210
222
  {
211
- "inputs": [],
212
- "name": "isDepositEnabled",
223
+ "inputs": [
224
+ {
225
+ "internalType": "address",
226
+ "name": "",
227
+ "type": "address"
228
+ }
229
+ ],
230
+ "name": "owedQuantityByWallet",
213
231
  "outputs": [
214
232
  {
215
- "internalType": "bool",
233
+ "internalType": "uint256",
216
234
  "name": "",
217
- "type": "bool"
235
+ "type": "uint256"
218
236
  }
219
237
  ],
220
238
  "stateMutability": "view",
@@ -274,11 +292,24 @@
274
292
  "type": "bool"
275
293
  }
276
294
  ],
277
- "name": "setDepositEnabled",
295
+ "name": "setDistributeEnabled",
278
296
  "outputs": [],
279
297
  "stateMutability": "nonpayable",
280
298
  "type": "function"
281
299
  },
300
+ {
301
+ "inputs": [],
302
+ "name": "totalOwedQuantity",
303
+ "outputs": [
304
+ {
305
+ "internalType": "uint256",
306
+ "name": "",
307
+ "type": "uint256"
308
+ }
309
+ ],
310
+ "stateMutability": "view",
311
+ "type": "function"
312
+ },
282
313
  {
283
314
  "inputs": [
284
315
  {
@@ -294,25 +325,15 @@
294
325
  },
295
326
  {
296
327
  "inputs": [
297
- {
298
- "internalType": "address",
299
- "name": "",
300
- "type": "address"
301
- },
302
328
  {
303
329
  "internalType": "uint256",
304
- "name": "",
330
+ "name": "quantity",
305
331
  "type": "uint256"
306
- },
307
- {
308
- "internalType": "bytes",
309
- "name": "",
310
- "type": "bytes"
311
332
  }
312
333
  ],
313
- "name": "withdrawQuoteAsset",
334
+ "name": "withdrawEscrow",
314
335
  "outputs": [],
315
- "stateMutability": "pure",
336
+ "stateMutability": "nonpayable",
316
337
  "type": "function"
317
338
  }
318
339
  ]
@@ -577,6 +577,11 @@
577
577
  "internalType": "uint64",
578
578
  "name": "minimumDepositToManagedAccountQuantityInAssetUnits_",
579
579
  "type": "uint64"
580
+ },
581
+ {
582
+ "internalType": "uint64",
583
+ "name": "minimumWithdrawQuantityMultiplier_",
584
+ "type": "uint64"
580
585
  }
581
586
  ],
582
587
  "name": "setComposeParameters",
@@ -542,7 +542,7 @@
542
542
  "inputs": [
543
543
  {
544
544
  "internalType": "address payable",
545
- "name": "destinationContractOrWallet",
545
+ "name": "destinationWallet",
546
546
  "type": "address"
547
547
  },
548
548
  {
@@ -109,9 +109,10 @@ export declare const BridgeConfig: {
109
109
  readonly testnet: {
110
110
  readonly "katana.katana": {
111
111
  readonly target: "katana.katana";
112
+ readonly isSupported: true;
112
113
  readonly evmChainId: 737373;
113
- readonly layerZeroEndpointId: 40448;
114
- readonly layerzeroOFTAddress: "0x3aCAAf60502791D199a5a5F0B173D78229eBFe32";
114
+ readonly layerZeroEndpointId: -1;
115
+ readonly layerzeroOFTAddress: "0x0000000000000000000000000000000000000000";
115
116
  readonly tokenDecimals: 6;
116
117
  readonly usdcAddress: "0xc2a4C310F2512A17Ac0047cf871aCAed3E62bB4B";
117
118
  };
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/bridge/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,kBAAkB,oOAA8B,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuKf,CAAC;AAEX,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B7C,CAAC;AAEF;;;;;;;GAOG;AAEH,wBAAgB,mBAAmB,CAEjC,KAAK,EAAE,GAAG,GACT,KAAK,IAAI,YAAY,CAEvB"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/bridge/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,kBAAkB,oOAA8B,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwKf,CAAC;AAEX,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B7C,CAAC;AAEF;;;;;;;GAOG;AAEH,wBAAgB,mBAAmB,CAEjC,KAAK,EAAE,GAAG,GACT,KAAK,IAAI,YAAY,CAEvB"}
@@ -145,11 +145,12 @@ exports.BridgeConfig = {
145
145
  testnet: {
146
146
  [request_1.BridgeTarget.KATANA_KATANA]: {
147
147
  target: request_1.BridgeTarget.KATANA_KATANA,
148
+ isSupported: true,
148
149
  evmChainId: 737373,
149
- // https://stargateprotocol.gitbook.io/stargate/v/v2-developer-docs/technical-reference/testnet-contracts#bokuto-testnet
150
- layerZeroEndpointId: 40448,
150
+ // No LZ connection yet on Bokuto testnet
151
+ layerZeroEndpointId: -1,
151
152
  // No OFT currently supported on Bokuto testnet
152
- layerzeroOFTAddress: '0x3aCAAf60502791D199a5a5F0B173D78229eBFe32',
153
+ layerzeroOFTAddress: '0x0000000000000000000000000000000000000000',
153
154
  tokenDecimals: 6,
154
155
  // vbUSDC
155
156
  usdcAddress: '0xc2a4C310F2512A17Ac0047cf871aCAed3E62bB4B',
@@ -22,8 +22,7 @@ export type DepositToWalletBridgePayloadParameters = {
22
22
  };
23
23
  export type DepositBaseParameters = {
24
24
  exchangeLayerZeroAdapterAddress?: string;
25
- exchangeLocalDepositAdapterAddress?: string;
26
- minimumForwardQuantityMultiplierInPips?: bigint;
25
+ minimumForwardQuantityMultiplierInPips: bigint;
27
26
  quantityInAssetUnits: bigint;
28
27
  sourceBridgeTarget: BridgeTarget;
29
28
  stargateBridgeForwarderContractAddress?: string;
@@ -112,13 +111,7 @@ export declare function depositViaForwarder(parameters: AddManagedAccountParamet
112
111
  }, sourceSigner: ethers.Signer, sandbox: boolean, extraRequestParams?: Pick<TransactionRequest, 'nonce'>,
113
112
  /** Let software wallet show estimate to the user. Even on expected TX failure. */
114
113
  ignoreEstimateError?: boolean): Promise<string>;
115
- /**
116
- * Deposit funds locally on Katana
117
- */
118
- export declare function depositLocally(parameters: AddManagedAccountParameters | DepositToManagedAccountParameters | DepositToWalletParameters, signer: ethers.Signer, sandbox: boolean, extraRequestParams?: Pick<TransactionRequest, 'nonce'>,
119
- /** Let software wallet show estimate to the user. Even on expected TX failure. */
120
- ignoreEstimateError?: boolean): Promise<string>;
121
- export declare function encodeDepositBridgeAdapterPayload(sourceConfig: ReturnType<typeof getBridgeTargetConfig>, parameters: Pick<AddManagedAccountParameters, 'bridgePayloadType' | 'fixedIncomeVaultProviderAddress' | 'managerWallet' | 'addManagedAccountPayload'> | Pick<DepositToManagedAccountParameters, 'bridgePayloadType' | 'depositorWallet' | 'fixedIncomeVaultProviderAddress' | 'managerWallet'> | Pick<DepositToWalletParameters, 'bridgePayloadType' | 'depositorWallet'>): EncodedDepositBridgeAdapterPayload;
114
+ export declare function encodeDepositBridgeAdapterPayload(sourceConfig: ReturnType<typeof getBridgeTargetConfig>, parameters: AddManagedAccountParameters | DepositToManagedAccountParameters | DepositToWalletParameters): EncodedDepositBridgeAdapterPayload;
122
115
  export declare function encodeFixedIncomeVaultConfigurationFields(configurationFields: FixedIncomeVaultConfigurationFields): string;
123
116
  /**
124
117
  * Estimate native gas fee needed to deposit USDC cross-chain into the Exchange
@@ -1 +1 @@
1
- {"version":3,"file":"deposit.d.ts","sourceRoot":"","sources":["../../src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T,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC;CAC9B,EACD,YAAY,EAAE,MAAM,CAAC,MAAM,EAC3B,OAAO,EAAE,OAAO,EAChB,kBAAkB,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC;AACtD,kFAAkF;AAClF,mBAAmB,CAAC,EAAE,OAAO,GAC5B,OAAO,CAAC,MAAM,CAAC,CAuEjB;AAED,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,EACtD,UAAU,EACN,2BAA2B,GAC3B,iCAAiC,GACjC,yBAAyB,GAC5B,kCAAkC,CAuDpC;AAED,wBAAgB,yCAAyC,CACvD,mBAAmB,EAAE,mCAAmC,UAkBzD;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EACN,2BAA2B,GAC3B,iCAAiC,GACjC,yBAAyB,EAC7B,SAAS,EAAE;IAGT,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC;CAC9B,EACD,OAAO,EAAE,OAAO,GACf,OAAO,CAAC;IACT,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B,EAAE,MAAM,CAAC;CACvC,CAAC,CAMD;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EACN,2BAA2B,GAC3B,iCAAiC,GACjC,yBAAyB,UAqB9B"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDestinationWallet = exports.estimateDepositFees = exports.encodeFixedIncomeVaultConfigurationFields = exports.encodeDepositBridgeAdapterPayload = exports.depositLocally = exports.depositViaForwarder = exports.depositViaVaultComposerSync = exports.depositViaBridge = exports.decodeDepositBridgeAdapterPayload = exports.decodeDepositBridgeAdapterPayloadType = exports.depositBridgeAdapterPayloadLengths = exports.fixedIncomeVaultConfigurationFieldsLength = exports.DepositBridgeAdapterPayloadType = void 0;
3
+ exports.getDestinationWallet = exports.estimateDepositFees = exports.encodeFixedIncomeVaultConfigurationFields = exports.encodeDepositBridgeAdapterPayload = exports.depositViaForwarder = exports.depositViaVaultComposerSync = exports.depositViaBridge = exports.decodeDepositBridgeAdapterPayload = exports.decodeDepositBridgeAdapterPayloadType = exports.depositBridgeAdapterPayloadLengths = exports.fixedIncomeVaultConfigurationFieldsLength = exports.DepositBridgeAdapterPayloadType = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
6
6
  const ethers_1 = require("ethers");
@@ -120,10 +120,9 @@ ignoreEstimateError) {
120
120
  }
121
121
  const response = await vaultComposerSync.depositAndSend.send(parameters.quantityInAssetUnits, sendParam, sourceWallet, // Refund address - extra gas (if any) is returned to this address
122
122
  {
123
- ...extraRequestParams,
124
123
  from: sourceWallet,
125
124
  gasLimit,
126
- value: gasFee, // Native gas to pay for the cross chain message fee
125
+ value: gasFee,
127
126
  });
128
127
  return response.hash;
129
128
  }
@@ -146,7 +145,8 @@ ignoreEstimateError) {
146
145
  const estimatedGasLimit = await oft.send.estimateGas(sendParam, { nativeFee: gasFee, lzTokenFee: 0 }, sourceWallet, // Refund address - extra gas (if any) is returned to this address
147
146
  {
148
147
  ...extraRequestParams,
149
- from: sourceWallet, // Native gas to pay for the cross chain message fee
148
+ from: sourceWallet,
149
+ // Native gas to pay for the cross chain message fee
150
150
  value: gasFee,
151
151
  });
152
152
  // Add 20% buffer for safety
@@ -175,7 +175,6 @@ ignoreEstimateError) {
175
175
  }
176
176
  const response = await oft.send(sendParam, { nativeFee: gasFee, lzTokenFee: 0 }, sourceWallet, // Refund address - extra gas (if any) is returned to this address
177
177
  {
178
- ...extraRequestParams,
179
178
  from: sourceWallet,
180
179
  gasLimit,
181
180
  value: gasFee,
@@ -183,55 +182,6 @@ ignoreEstimateError) {
183
182
  return response.hash;
184
183
  }
185
184
  exports.depositViaForwarder = depositViaForwarder;
186
- /**
187
- * Deposit funds locally on Katana
188
- */
189
- async function depositLocally(parameters, signer, sandbox, extraRequestParams,
190
- /** Let software wallet show estimate to the user. Even on expected TX failure. */
191
- ignoreEstimateError) {
192
- const sourceConfig = (0, utils_1.getBridgeTargetConfig)(request_1.BridgeTarget.KATANA_KATANA, sandbox);
193
- const exchangeLocalDepositAdapterAddress = await (0, utils_1.loadExchangeLocalDepositAddressFromApiIfNeeded)(parameters.exchangeLocalDepositAdapterAddress);
194
- let gasLimit = config_1.BridgeConfig.settings.depositSourceChainGasLimit;
195
- const localDepositAdapter = index_1.ExchangeLocalDepositAdapter_v1__factory.connect(exchangeLocalDepositAdapterAddress, signer);
196
- const wallet = await signer.getAddress();
197
- try {
198
- // Estimate gas
199
- const estimatedGasLimit = await localDepositAdapter.deposit.estimateGas(parameters.quantityInAssetUnits, encodeDepositBridgeAdapterPayload(sourceConfig, parameters), {
200
- ...extraRequestParams,
201
- from: wallet,
202
- });
203
- // Add 20% buffer for safety
204
- gasLimit = Number(new bignumber_js_1.default(estimatedGasLimit.toString())
205
- .times(new bignumber_js_1.default(1.2))
206
- .toFixed(0));
207
- }
208
- catch (error) {
209
- // ethers.js will perform the estimation at the block gas limit, which is much higher than the
210
- // gas actually needed by the tx. If the wallet does not have the funds to cover the tx at this
211
- // high gas limit then the RPC will throw an INSUFFICIENT_FUNDS error; however the wallet may
212
- // still have enough funds to successfully bridge at the actual gas limit. In this case simply
213
- // fall through and use the configured default gas limit. The wallet software in use should
214
- // still show if that limit is insufficient, which is only an issue for blockchains with
215
- // variable gas costs such as Arbitrum One
216
- if (error?.code === 'INSUFFICIENT_FUNDS') {
217
- console.log('[depositViaForwarder] Insufficient funds - continue with default gas');
218
- }
219
- else if (ignoreEstimateError) {
220
- // TODO: In latest contract it throws 'CALL_EXCEPTION' instead of 'INSUFFICIENT_FUNDS'
221
- console.log('[depositViaForwarder] Estimate failed - continue with default gas', error);
222
- }
223
- else {
224
- throw error;
225
- }
226
- }
227
- const response = await localDepositAdapter.deposit(parameters.quantityInAssetUnits, encodeDepositBridgeAdapterPayload(sourceConfig, parameters), {
228
- ...extraRequestParams,
229
- gasLimit,
230
- from: wallet,
231
- });
232
- return response.hash;
233
- }
234
- exports.depositLocally = depositLocally;
235
185
  function encodeDepositBridgeAdapterPayload(sourceConfig, parameters) {
236
186
  if (parameters.bridgePayloadType ===
237
187
  DepositBridgeAdapterPayloadType.addManagedAccount) {
@@ -345,9 +295,6 @@ async function estimateDepositViaForwarderFees(parameters, providers, sandbox) {
345
295
  };
346
296
  }
347
297
  async function getDepositFromEthereumSendParamAndSourceConfig(parameters, sandbox) {
348
- if (!parameters.minimumForwardQuantityMultiplierInPips) {
349
- throw new Error('minimumForwardQuantityMultiplierInPips is required for deposit via forwarder');
350
- }
351
298
  const { sourceConfig, destinationConfig } = getSourceAndDestinationConfigs(request_1.BridgeTarget.STARGATE_ETHEREUM, request_1.BridgeTarget.KATANA_KATANA, sandbox);
352
299
  const exchangeLayerZeroAdapterAddress = await (0, utils_1.loadExchangeLayerZeroAddressFromApiIfNeeded)(parameters.exchangeLayerZeroAdapterAddress);
353
300
  const { Options } = await import('@layerzerolabs/lz-v2-utilities');
@@ -372,9 +319,6 @@ async function getDepositFromEthereumSendParamAndSourceConfig(parameters, sandbo
372
319
  };
373
320
  }
374
321
  async function getDepositViaForwarderSendParamAndSourceConfig(parameters, providers, sandbox) {
375
- if (!parameters.minimumForwardQuantityMultiplierInPips) {
376
- throw new Error('minimumForwardQuantityMultiplierInPips is required for deposit via forwarder');
377
- }
378
322
  const { sourceConfig, destinationConfig: ethereumConfig } = getSourceAndDestinationConfigs(parameters.sourceBridgeTarget, request_1.BridgeTarget.STARGATE_ETHEREUM, sandbox);
379
323
  const { gasFee: ethereumGasFee } = await estimateDepositFromEthereumFees(parameters, providers, sandbox);
380
324
  // Add 20% buffer for safety
@@ -16,9 +16,10 @@ export declare function isBridgeTestnetLayerZeroEndpointId(layerZeroEndpointId:
16
16
  */
17
17
  export declare function getBridgeTargetConfig<T extends BridgeTarget, S extends true | false>(bridgeTarget: T, sandbox: S): {
18
18
  readonly target: "katana.katana";
19
+ readonly isSupported: true;
19
20
  readonly evmChainId: 737373;
20
- readonly layerZeroEndpointId: 40448;
21
- readonly layerzeroOFTAddress: "0x3aCAAf60502791D199a5a5F0B173D78229eBFe32";
21
+ readonly layerZeroEndpointId: -1;
22
+ readonly layerzeroOFTAddress: "0x0000000000000000000000000000000000000000";
22
23
  readonly tokenDecimals: 6;
23
24
  readonly usdcAddress: "0xc2a4C310F2512A17Ac0047cf871aCAed3E62bB4B";
24
25
  } | {
@@ -129,6 +130,5 @@ export declare function getBridgeTargetConfig<T extends BridgeTarget, S extends
129
130
  }[T];
130
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;
131
132
  export declare function loadExchangeLayerZeroAddressFromApiIfNeeded(exchangeLayerZeroAdapterAddress?: string): Promise<string>;
132
- export declare function loadExchangeLocalDepositAddressFromApiIfNeeded(exchangeLocalDepositAdapterAddress?: string): Promise<string>;
133
133
  export declare function loadStargateBridgeForwarderContractAddressFromApiIfNeeded(stargateBridgeForwarderContractAddress?: string): Promise<string>;
134
134
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bridge/utils.ts"],"names":[],"mappings":"AAMA,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,EA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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"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadStargateBridgeForwarderContractAddressFromApiIfNeeded = exports.loadExchangeLocalDepositAddressFromApiIfNeeded = exports.loadExchangeLayerZeroAddressFromApiIfNeeded = exports.bridgeTargetForLayerZeroEndpointId = exports.getBridgeTargetConfig = exports.isBridgeTestnetLayerZeroEndpointId = exports.BridgeTestnetLayerZeroEndpointIds = exports.isBridgeMainnetLayerZeroEndpointId = exports.BridgeMainnetLayerZeroEndpointIds = void 0;
3
+ exports.loadStargateBridgeForwarderContractAddressFromApiIfNeeded = exports.loadExchangeLayerZeroAddressFromApiIfNeeded = exports.bridgeTargetForLayerZeroEndpointId = exports.getBridgeTargetConfig = exports.isBridgeTestnetLayerZeroEndpointId = exports.BridgeTestnetLayerZeroEndpointIds = exports.isBridgeMainnetLayerZeroEndpointId = exports.BridgeMainnetLayerZeroEndpointIds = void 0;
4
+ const ethers_1 = require("ethers");
4
5
  const config_1 = require("#bridge/config");
5
- const public_1 = require("#client/rest/public");
6
6
  exports.BridgeMainnetLayerZeroEndpointIds = Object.values(config_1.BridgeConfigByLayerZeroEndpointId.mainnet).map((value) => {
7
7
  return value.layerZeroEndpointId;
8
8
  });
@@ -52,26 +52,15 @@ async function loadExchangeLayerZeroAddressFromApiIfNeeded(exchangeLayerZeroAdap
52
52
  if (exchangeLayerZeroAdapterAddress) {
53
53
  return exchangeLayerZeroAdapterAddress;
54
54
  }
55
- const [exchangeResponse] = await (0, public_1.loadExchangeResponseFromApiIfNeeded)();
56
- return exchangeResponse.bridgeAdapters
57
- .stargateBridgeAdapterV1KatanaContractAddress;
55
+ // No bridge adapters currently supported
56
+ return ethers_1.ethers.ZeroAddress;
58
57
  }
59
58
  exports.loadExchangeLayerZeroAddressFromApiIfNeeded = loadExchangeLayerZeroAddressFromApiIfNeeded;
60
- async function loadExchangeLocalDepositAddressFromApiIfNeeded(exchangeLocalDepositAdapterAddress) {
61
- if (exchangeLocalDepositAdapterAddress) {
62
- return exchangeLocalDepositAdapterAddress;
63
- }
64
- const [exchangeResponse] = await (0, public_1.loadExchangeResponseFromApiIfNeeded)();
65
- return exchangeResponse.bridgeAdapters
66
- .localDepositAdapterV1KatanaContractAddress;
67
- }
68
- exports.loadExchangeLocalDepositAddressFromApiIfNeeded = loadExchangeLocalDepositAddressFromApiIfNeeded;
69
59
  async function loadStargateBridgeForwarderContractAddressFromApiIfNeeded(stargateBridgeForwarderContractAddress) {
70
60
  if (stargateBridgeForwarderContractAddress) {
71
61
  return stargateBridgeForwarderContractAddress;
72
62
  }
73
- const [exchangeResponse] = await (0, public_1.loadExchangeResponseFromApiIfNeeded)();
74
- return exchangeResponse.bridgeAdapters
75
- .stargateBridgeForwarderV1EthereumContractAddress;
63
+ // No bridge adapters currently supported
64
+ return ethers_1.ethers.ZeroAddress;
76
65
  }
77
66
  exports.loadStargateBridgeForwarderContractAddressFromApiIfNeeded = loadStargateBridgeForwarderContractAddressFromApiIfNeeded;
@@ -84,9 +84,9 @@ export interface RestAuthenticatedClientOptions {
84
84
  */
85
85
  chainId?: number;
86
86
  /**
87
- * Optionally provide the `stargateBridgeAdapterV1KatanaContractAddress` as returned by the public clients
87
+ * Optionally provide the `bridgeAdapterContractAddress` as returned by the public clients
88
88
  * {@link RestPublicClient.getExchange getExchange} response's
89
- * {@link katanaperps.KatanaPerpsExchange.bridgeAdapters.stargateBridgeAdapterV1KatanaContractAddress stargateBridgeAdapterV1KatanaContractAddress}
89
+ * {@link katanaperps.KatanaPerpsExchange.bridgeAdapterContractAddress bridgeAdapterContractAddress}
90
90
  * property.
91
91
  *
92
92
  * - If not provided, this will be fetched and cached automatically from the public client before
@@ -95,18 +95,6 @@ export interface RestAuthenticatedClientOptions {
95
95
  * @internal
96
96
  */
97
97
  bridgeAdapterContractAddress?: string;
98
- /**
99
- * Optionally provide the `localDepositAdapterV1KatanaContractAddress` as returned by the public clients
100
- * {@link RestPublicClient.getExchange getExchange} response's
101
- * {@link katanaperps.KatanaPerpsExchange.bridgeAdapters.localDepositAdapterV1KatanaContractAddress localDepositAdapterV1KatanaContractAddress}
102
- * property.
103
- *
104
- * - If not provided, this will be fetched and cached automatically from the public client before
105
- * making the first request which requires it.
106
- *
107
- * @internal
108
- */
109
- localDepositAdapterContractAddress?: string;
110
98
  /**
111
99
  * - Changing this value will likely result in a broken client, internal use only.
112
100
  *
@@ -228,7 +216,6 @@ export declare class RestAuthenticatedClient {
228
216
  exchangeContractAddress?: string | undefined;
229
217
  chainId?: number | undefined;
230
218
  bridgeAdapterContractAddress?: string | undefined;
231
- localDepositAdapterContractAddress?: string | undefined;
232
219
  }>;
233
220
  /**
234
221
  * The {@link RestAuthenticatedClient} is used to make authenticated requests to the Katana Perps API. It includes
@@ -1166,6 +1153,12 @@ export declare class RestAuthenticatedClient {
1166
1153
  */
1167
1154
  readonly cancelConditionalTakeProfitOrders: (params: katanaPerps.RestRequestCancelOrders, signer?: katanaPerps.SignTypedData | undefined) => Promise<katanaPerps.RestResponseCancelOrders>;
1168
1155
  readonly getFundingPayments: (params: katanaPerps.RestRequestGetFundingPayments) => Promise<katanaPerps.Paginated<katanaPerps.RestResponseGetFundingPayments>>;
1156
+ readonly getTakerCompetitionV3List: (params?: katanaPerps.RestRequestGetTakerCompetitionV3List) => Promise<katanaPerps.RestResponseGetTakerCompetitionV3List>;
1157
+ readonly getTakerCompetitionV3ByName: ({ name, ...params }: katanaPerps.RestRequestGetTakerCompetitionV3ByName) => Promise<katanaPerps.RestResponseGetTakerCompetitionV3ByName>;
1158
+ readonly registerTakerCompetitionV3: (params: katanaPerps.RestRequestRegisterTakerCompetitionV3) => Promise<katanaPerps.RestResponseRegisterTakerCompetitionV3>;
1159
+ readonly setTakerCompetitionV3DisplayName: (params: katanaPerps.RestRequestSetTakerCompetitionV3DisplayName) => Promise<katanaPerps.RestResponseSetTakerCompetitionV3DisplayName>;
1160
+ readonly getTakerCompetitionV3Payout: (params: katanaPerps.RestRequestGetTakerCompetitionV3Payout) => Promise<katanaPerps.RestResponseGetTakerCompetitionV3Payout>;
1161
+ readonly authorizeTakerCompetitionV3Payout: (params: katanaPerps.RestRequestAuthorizeTakerCompetitionV3Payout) => Promise<katanaPerps.RestResponseAuthorizeTakerCompetitionV3Payout>;
1169
1162
  readonly getXChallenge: (params: katanaPerps.RestRequestGetVaultXConnectionChallenge) => Promise<katanaPerps.RestResponseGetVaultXConnectionChallenge>;
1170
1163
  readonly placeConditionalTpSlOrder: <T extends "stopLossMarket" | "takeProfitMarket">(takeProfitOrStopLossOrder: katanaPerps.RestRequestOrder & {
1171
1164
  type: T;
@@ -1215,7 +1208,7 @@ export declare class RestAuthenticatedClient {
1215
1208
  }) | undefined;
1216
1209
  }>;
1217
1210
  readonly setVaultDetails: (params: katanaPerps.RestRequestSetVaultDetails, signer?: undefined | katanaPerps.SignTypedData) => Promise<katanaPerps.RestResponseSetVaultDetails>;
1218
- readonly removeVaultXConnection: (params: katanaPerps.RestRequestRemoveVaultXConnection) => Promise<void>;
1211
+ readonly removeVaultXConnection: (params: katanaPerps.RestRequestRemoveVaultXConnection, signer?: undefined | katanaPerps.SignTypedData) => Promise<void>;
1219
1212
  readonly setVaultXConnection: (params: katanaPerps.RestRequestSetVaultXConnection, signer?: undefined | katanaPerps.SignTypedData) => Promise<void>;
1220
1213
  readonly withdrawFromManagedAccountByQuantity: ($params: katanaPerps.RestRequestWithdrawFundsFromManagedAccountByQuantitySDK | katanaPerps.RestRequestWithdrawFundsFromManagedAccountByQuantity, signer?: undefined | katanaPerps.SignTypedData) => Promise<katanaPerps.KatanaPerpsWithdrawalFromManagedAccount>;
1221
1214
  readonly withdrawFromManagedAccountByShares: ($params: katanaPerps.RestRequestWithdrawFundsFromManagedAccountBySharesSDK | katanaPerps.RestRequestWithdrawFundsFromManagedAccountByShares, signer?: undefined | katanaPerps.SignTypedData) => Promise<katanaPerps.KatanaPerpsWithdrawalFromManagedAccount>;
@@ -1224,7 +1217,6 @@ export declare class RestAuthenticatedClient {
1224
1217
  chainId: number;
1225
1218
  exchangeContractAddress: string;
1226
1219
  bridgeAdapterContractAddress: string;
1227
- localDepositAdapterContractAddress: string;
1228
1220
  }>;
1229
1221
  /**
1230
1222
  * - Internal Use and may change or break without notice