@instadapp/interop-x 0.0.0-dev.f0a6281 → 0.0.0-dev.fabee70
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/dist/package.json +2 -2
- package/dist/src/abi/interopBridgeToken.json +9 -21
- package/dist/src/abi/interopXGateway.json +11 -11
- package/dist/src/config/index.js +1 -10
- package/dist/src/constants/addresses.js +1 -1
- package/dist/src/constants/itokens.js +1 -1
- package/dist/src/index.js +5 -28
- package/dist/src/net/protocol/dial/{TransactionStatusDialProtocol.js → SignatureDialProtocol.1.js} +0 -0
- package/dist/src/net/protocol/index.js +2 -2
- package/dist/src/tasks/AutoUpdateTask.js +7 -20
- package/dist/src/tasks/BaseTask.js +0 -4
- package/dist/src/tasks/InteropBridge/SyncWithdrawEvents.js +5 -7
- package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +1 -13
- package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +2 -2
- package/dist/src/typechain/factories/InteropBridgeToken__factory.js +11 -23
- package/dist/src/typechain/factories/InteropXGateway__factory.js +14 -14
- package/dist/src/utils/index.js +6 -6
- package/package.json +2 -2
- package/src/abi/interopBridgeToken.json +9 -21
- package/src/abi/interopXGateway.json +11 -11
- package/src/config/index.ts +1 -9
- package/src/constants/addresses.ts +1 -1
- package/src/constants/itokens.ts +1 -1
- package/src/index.ts +9 -41
- package/src/net/protocol/dial/{TransactionStatusDialProtocol.ts → SignatureDialProtocol.1.ts} +0 -0
- package/src/net/protocol/index.ts +1 -1
- package/src/tasks/AutoUpdateTask.ts +15 -24
- package/src/tasks/BaseTask.ts +0 -5
- package/src/tasks/InteropBridge/SyncWithdrawEvents.ts +5 -7
- package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +4 -17
- package/src/tasks/InteropXGateway/SyncDepositEvents.ts +2 -2
- package/src/typechain/InteropBridgeToken.ts +17 -23
- package/src/typechain/InteropXGateway.ts +13 -13
- package/src/typechain/factories/InteropBridgeToken__factory.ts +11 -23
- package/src/typechain/factories/InteropXGateway__factory.ts +14 -14
- package/src/utils/index.ts +6 -6
@@ -61,17 +61,11 @@ const _abi = [
|
|
61
61
|
name: "amount",
|
62
62
|
type: "uint256",
|
63
63
|
},
|
64
|
-
{
|
65
|
-
indexed: false,
|
66
|
-
internalType: "uint32",
|
67
|
-
name: "sourceChainId",
|
68
|
-
type: "uint32",
|
69
|
-
},
|
70
64
|
{
|
71
65
|
indexed: true,
|
72
|
-
internalType: "
|
73
|
-
name: "
|
74
|
-
type: "
|
66
|
+
internalType: "uint256",
|
67
|
+
name: "chainId",
|
68
|
+
type: "uint256",
|
75
69
|
},
|
76
70
|
],
|
77
71
|
name: "Burn",
|
@@ -94,20 +88,14 @@ const _abi = [
|
|
94
88
|
},
|
95
89
|
{
|
96
90
|
indexed: true,
|
97
|
-
internalType: "
|
98
|
-
name: "
|
99
|
-
type: "
|
100
|
-
},
|
101
|
-
{
|
102
|
-
indexed: false,
|
103
|
-
internalType: "uint32",
|
104
|
-
name: "targetChainId",
|
105
|
-
type: "uint32",
|
91
|
+
internalType: "uint256",
|
92
|
+
name: "chainId",
|
93
|
+
type: "uint256",
|
106
94
|
},
|
107
95
|
{
|
108
96
|
indexed: true,
|
109
97
|
internalType: "bytes32",
|
110
|
-
name: "
|
98
|
+
name: "transactionHash",
|
111
99
|
type: "bytes32",
|
112
100
|
},
|
113
101
|
],
|
@@ -238,9 +226,9 @@ const _abi = [
|
|
238
226
|
type: "uint256",
|
239
227
|
},
|
240
228
|
{
|
241
|
-
internalType: "
|
229
|
+
internalType: "uint256",
|
242
230
|
name: "chainId",
|
243
|
-
type: "
|
231
|
+
type: "uint256",
|
244
232
|
},
|
245
233
|
],
|
246
234
|
name: "burn",
|
@@ -322,9 +310,9 @@ const _abi = [
|
|
322
310
|
type: "uint256",
|
323
311
|
},
|
324
312
|
{
|
325
|
-
internalType: "
|
313
|
+
internalType: "uint256",
|
326
314
|
name: "chainId",
|
327
|
-
type: "
|
315
|
+
type: "uint256",
|
328
316
|
},
|
329
317
|
{
|
330
318
|
internalType: "bytes32",
|
@@ -50,15 +50,15 @@ const _abi = [
|
|
50
50
|
},
|
51
51
|
{
|
52
52
|
indexed: false,
|
53
|
-
internalType: "
|
53
|
+
internalType: "uint256",
|
54
54
|
name: "sourceChainId",
|
55
|
-
type: "
|
55
|
+
type: "uint256",
|
56
56
|
},
|
57
57
|
{
|
58
58
|
indexed: true,
|
59
|
-
internalType: "
|
59
|
+
internalType: "uint256",
|
60
60
|
name: "targetChainId",
|
61
|
-
type: "
|
61
|
+
type: "uint256",
|
62
62
|
},
|
63
63
|
],
|
64
64
|
name: "LogGatewayDeposit",
|
@@ -87,15 +87,15 @@ const _abi = [
|
|
87
87
|
},
|
88
88
|
{
|
89
89
|
indexed: true,
|
90
|
-
internalType: "
|
90
|
+
internalType: "uint256",
|
91
91
|
name: "sourceChainId",
|
92
|
-
type: "
|
92
|
+
type: "uint256",
|
93
93
|
},
|
94
94
|
{
|
95
95
|
indexed: false,
|
96
|
-
internalType: "
|
96
|
+
internalType: "uint256",
|
97
97
|
name: "targetChainId",
|
98
|
-
type: "
|
98
|
+
type: "uint256",
|
99
99
|
},
|
100
100
|
{
|
101
101
|
indexed: true,
|
@@ -152,9 +152,9 @@ const _abi = [
|
|
152
152
|
type: "uint256",
|
153
153
|
},
|
154
154
|
{
|
155
|
-
internalType: "
|
155
|
+
internalType: "uint256",
|
156
156
|
name: "chainId_",
|
157
|
-
type: "
|
157
|
+
type: "uint256",
|
158
158
|
},
|
159
159
|
],
|
160
160
|
name: "deposit",
|
@@ -180,9 +180,9 @@ const _abi = [
|
|
180
180
|
type: "uint256",
|
181
181
|
},
|
182
182
|
{
|
183
|
-
internalType: "
|
183
|
+
internalType: "uint256",
|
184
184
|
name: "chainId_",
|
185
|
-
type: "
|
185
|
+
type: "uint256",
|
186
186
|
},
|
187
187
|
],
|
188
188
|
name: "depositFor",
|
@@ -228,9 +228,9 @@ const _abi = [
|
|
228
228
|
type: "address",
|
229
229
|
},
|
230
230
|
{
|
231
|
-
internalType: "
|
231
|
+
internalType: "uint256",
|
232
232
|
name: "chainId_",
|
233
|
-
type: "
|
233
|
+
type: "uint256",
|
234
234
|
},
|
235
235
|
{
|
236
236
|
internalType: "bytes32",
|
package/src/utils/index.ts
CHANGED
@@ -222,30 +222,30 @@ export const buildWithdrawDataForTransaction = async (transaction: Transaction,
|
|
222
222
|
throw Error('Cannot build data for transaction without submitEvent');
|
223
223
|
}
|
224
224
|
|
225
|
-
const { to, amount,
|
225
|
+
const { to, amount, chainId, itoken: itokenAddress } = transaction.submitEvent;
|
226
226
|
|
227
|
-
const itoken = itokens[sourceChainId].find(token => token.address.toLowerCase() === itokenAddress.toLowerCase());
|
227
|
+
const itoken = itokens[transaction.sourceChainId].find(token => token.address.toLowerCase() === itokenAddress.toLowerCase());
|
228
228
|
|
229
229
|
if (!itoken) {
|
230
230
|
throw Error('Cannot build data for transaction without itoken');
|
231
231
|
}
|
232
232
|
|
233
|
-
const token = tokens[
|
233
|
+
const token = tokens[chainId].find(t => t.symbol.toLowerCase() === itoken.symbol.toLowerCase());
|
234
234
|
|
235
235
|
if (!token) {
|
236
236
|
throw Error('Cannot build data for transaction without token');
|
237
237
|
}
|
238
238
|
|
239
|
-
const targetChainProvider = new ethers.providers.JsonRpcProvider(getRpcProviderUrl(targetChainId as ChainId));
|
239
|
+
const targetChainProvider = new ethers.providers.JsonRpcProvider(getRpcProviderUrl(transaction.targetChainId as ChainId));
|
240
240
|
const targetWallet = new ethers.Wallet(config.privateKey, targetChainProvider);
|
241
|
-
const gatewayAddress = addresses[
|
241
|
+
const gatewayAddress = addresses[chainId].interopXGateway;
|
242
242
|
const interopBridgeContract = getContract<InteropXGateway>(gatewayAddress, abi.interopXGateway, targetWallet);
|
243
243
|
|
244
244
|
const { data } = await interopBridgeContract.populateTransaction.systemWithdraw(
|
245
245
|
ethers.BigNumber.from(amount.toString()),
|
246
246
|
to,
|
247
247
|
token.address,
|
248
|
-
ethers.BigNumber.from(sourceChainId.toString()),
|
248
|
+
ethers.BigNumber.from(transaction.sourceChainId.toString()),
|
249
249
|
transaction.submitTransactionHash,
|
250
250
|
);
|
251
251
|
|