@wormhole-foundation/sdk-evm-ntt 5.0.2 → 6.0.0-beta.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/dist/cjs/nttWithExecutor.d.ts +3 -5
- package/dist/cjs/nttWithExecutor.d.ts.map +1 -1
- package/dist/cjs/nttWithExecutor.js +90 -128
- package/dist/cjs/nttWithExecutor.js.map +1 -1
- package/dist/esm/nttWithExecutor.d.ts +3 -5
- package/dist/esm/nttWithExecutor.d.ts.map +1 -1
- package/dist/esm/nttWithExecutor.js +89 -127
- package/dist/esm/nttWithExecutor.js.map +1 -1
- package/package.json +6 -6
|
@@ -4,6 +4,7 @@ import { Ntt, NttWithExecutor } from "@wormhole-foundation/sdk-definitions-ntt";
|
|
|
4
4
|
import { type EvmPlatformType, type EvmChains } from "@wormhole-foundation/sdk-evm";
|
|
5
5
|
import { Provider } from "ethers";
|
|
6
6
|
import { EvmNtt } from "./ntt.js";
|
|
7
|
+
export declare const nttWithExecutorAbi: string[];
|
|
7
8
|
export declare class EvmNttWithExecutor<N extends Network, C extends EvmChains> implements NttWithExecutor<N, C> {
|
|
8
9
|
readonly network: N;
|
|
9
10
|
readonly chain: C;
|
|
@@ -13,22 +14,19 @@ export declare class EvmNttWithExecutor<N extends Network, C extends EvmChains>
|
|
|
13
14
|
};
|
|
14
15
|
readonly chainId: bigint;
|
|
15
16
|
readonly executorAddress: string;
|
|
16
|
-
readonly supportsTransferETH: boolean;
|
|
17
17
|
constructor(network: N, chain: C, provider: Provider, contracts: Contracts & {
|
|
18
18
|
ntt?: Ntt.Contracts;
|
|
19
19
|
});
|
|
20
20
|
static fromRpc<N extends Network>(provider: Provider, config: ChainsConfig<N, EvmPlatformType>): Promise<EvmNttWithExecutor<N, EvmChains>>;
|
|
21
21
|
transfer(sender: AccountAddress<C>, destination: ChainAddress, amount: bigint, quote: NttWithExecutor.Quote, ntt: EvmNtt<N, C>, wrapNative?: boolean): AsyncGenerator<UnsignedTransaction<N, C>>;
|
|
22
|
+
private approveIfNeeded;
|
|
22
23
|
estimateMsgValueAndGasLimit(recipient: ChainAddress | undefined): Promise<{
|
|
23
24
|
msgValue: bigint;
|
|
24
25
|
gasLimit: bigint;
|
|
25
26
|
}>;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
|
-
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination
|
|
29
|
-
* @param network - The network (e.g., 'Mainnet', 'Testnet')
|
|
30
|
-
* @param chain - The EVM chain (e.g., 'Arbitrum', 'ArbitrumSepolia')
|
|
31
|
-
* @returns true if an executor address exists for this network/chain combination
|
|
29
|
+
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination.
|
|
32
30
|
*/
|
|
33
31
|
export declare function hasExecutorDeployed(network: Network, chain: EvmChains): boolean;
|
|
34
32
|
//# sourceMappingURL=nttWithExecutor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nttWithExecutor.d.ts","sourceRoot":"","sources":["../../src/nttWithExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,SAAS,EACT,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAa,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"nttWithExecutor.d.ts","sourceRoot":"","sources":["../../src/nttWithExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,+BAA+B,CAAC;AACvC,OA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MAAM,EAAE,MAAM,EACd,KAAK,EAAE,eAAe,CAAC,KAAK,EAC5B,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACjB,UAAU,GAAE,OAAe,GAC1B,cAAc,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YA+D7B,eAAe;IAyBxB,2BAA2B,CAC/B,SAAS,EAAE,YAAY,GAAG,SAAS,GAClC,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAInD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,GACf,OAAO,CAET"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EvmNttWithExecutor = void 0;
|
|
3
|
+
exports.EvmNttWithExecutor = exports.nttWithExecutorAbi = void 0;
|
|
4
4
|
exports.hasExecutorDeployed = hasExecutorDeployed;
|
|
5
5
|
const sdk_base_1 = require("@wormhole-foundation/sdk-base");
|
|
6
6
|
const sdk_definitions_ntt_1 = require("@wormhole-foundation/sdk-definitions-ntt");
|
|
@@ -8,54 +8,48 @@ const sdk_evm_1 = require("@wormhole-foundation/sdk-evm");
|
|
|
8
8
|
const ethers_1 = require("ethers");
|
|
9
9
|
const nttManagerWithExecutorAddresses = {
|
|
10
10
|
Mainnet: {
|
|
11
|
-
Arbitrum: "
|
|
12
|
-
Avalanche: "
|
|
13
|
-
Base: "
|
|
14
|
-
Berachain: "
|
|
15
|
-
Bsc: "
|
|
16
|
-
Celo: "
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
ZeroGravity: "0xe175A8b838f3CdB2e1AAf4Ff74c05cF2F3AEA9a8",
|
|
11
|
+
Arbitrum: "0x5029a23E0EE11f6c9120EAb7eB48a94a49907EC4",
|
|
12
|
+
Avalanche: "0xf1Aa9693265E0Ba892C4a7AE77591424eEEd5cE9",
|
|
13
|
+
Base: "0x27db1967D469D89318B7119Ced5609f327095de4",
|
|
14
|
+
Berachain: "0x7424E82D27dD80ca47eab5e739C4D5A2D220f64f",
|
|
15
|
+
Bsc: "0x83f5c7b03BBbE20FE2e39312b957D86dc7C3Dee2",
|
|
16
|
+
Celo: "0xb466bA8798a5B516b43cbE6AA7bBb9532bB1708D",
|
|
17
|
+
CreditCoin: "0xcA43AE520E308C6Fb444EB723406febF7c310Da3",
|
|
18
|
+
Ethereum: "0xC079bFA54F348199bA51B2717595fE24e96f1542",
|
|
19
|
+
HyperEVM: "0xBc275e094e031e990b060134AbbDa00132f9A163",
|
|
20
|
+
Ink: "0x9e9980848FcbC11F9e84b5b6f5b88887966F5DAe",
|
|
21
|
+
Linea: "0x6FE9625F59107a4D49a9b5bC10a701dD0Bb396C0",
|
|
22
|
+
MegaETH: "0x7215f45Ea622E0350DF410D2e780BfD03bDc8a4D",
|
|
23
|
+
Mezo: "0x50F11Fe8B0D2B6f18a12291FeD345914D7Ec69d3",
|
|
24
|
+
Moca: "0x494726C75053F63CA906Aee00d6f910afE761B35",
|
|
25
|
+
Monad: "0xcc9FE3526F527bB0A14242A92818e132f3c12059",
|
|
26
|
+
Moonbeam: "0x40bBdD737f2Ca6316777F0B24ac94aaDE1ad1e4b",
|
|
27
|
+
Optimism: "0xC25396Ce2F6FBE6996374a5527c636C71AD5a757",
|
|
28
|
+
Plume: "0x00F39D8897e32B129435499F406b2fD76e37B51E",
|
|
29
|
+
Polygon: "0x9d165221c3c68868D15B154c5Aa66C32e044Eb4b",
|
|
30
|
+
Seievm: "0x70b85A416146A2dc3c760Ad30102F4280471C2b1",
|
|
31
|
+
Sonic: "0x98D1A98Cc398Ef6F5F84D134C1370480AaabA546",
|
|
32
|
+
Unichain: "0x2ceB44DE347641804856E2c468E703e06C5A8A33",
|
|
33
|
+
Worldchain: "0xDdBBa9509B9587516a0736D218B193a0DCf2B3e4",
|
|
34
|
+
XRPLEVM: "0xeddc0228C8719E7220eF4D8D95503258285BD482",
|
|
35
|
+
ZeroGravity: "0x4E62C24F9c18D3053B8E84A73a2ec7A40b74AF8a",
|
|
37
36
|
},
|
|
38
37
|
Testnet: {
|
|
39
|
-
ArbitrumSepolia: "
|
|
40
|
-
Avalanche: "
|
|
41
|
-
BaseSepolia: "
|
|
42
|
-
Bsc: "
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Plume: "
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
XRPLEVM: "0xcDD9d7C759b29680f7a516d0058de8293b2AC7b1",
|
|
55
|
-
Mezo: "0x484b5593BbB90383f94FB299470F09427cf6cfE2",
|
|
56
|
-
Moca: "0x47f26bF9253Eb398fBAf825D7565FE975D839a71",
|
|
57
|
-
ZeroGravity: "0xA8CA118f4C8d44Ab651Dad52B5E1a212e5d5c55b",
|
|
58
|
-
Nexus: "0x5C2768b4aF4483ffeB2B8de8D8b14829C0F19c9E",
|
|
38
|
+
ArbitrumSepolia: "0xD69CF144C31aE8C12b5C7c3D52411F32C824C9a3",
|
|
39
|
+
Avalanche: "0x8196EBa42b2947f519002B8aDa53b1880F580c69",
|
|
40
|
+
BaseSepolia: "0x9fBC8aA6B2f626D13005De92B3f0e4541919f721",
|
|
41
|
+
Bsc: "0x2c9F87bE2eb0caEB8AfFE6F7ae1f046E5D40Ff2a",
|
|
42
|
+
Ink: "0x86B93560FeAbc95a0067a498d8afe1219f3ED0D7",
|
|
43
|
+
Linea: "0x5d98Ded0E46d0aEAB37EA4fEe45A38dc5ccee673",
|
|
44
|
+
Mezo: "0x117F5F5E8d29ED6254c6098457Cea28E3Ee7cDdA",
|
|
45
|
+
Monad: "0x8BcA0315627DA3D2e5FA349a6A1ad2FAde36BCe5",
|
|
46
|
+
OptimismSepolia: "0xA8b1d0520D556b4Ea115562D35077cAA2f13C6D6",
|
|
47
|
+
Plume: "0x6D87C7d416dFf428117b560A981d788E39707195",
|
|
48
|
+
Seievm: "0xdb66Dc163A03220661ca33B492c72a6a15B3a8cf",
|
|
49
|
+
Sepolia: "0xc2386453598811D88613331D52e2Ca4B2AEe16E4",
|
|
50
|
+
Unichain: "0xc41853C70bf70a2FFeE3ddd8f38D2b774Fe3E264",
|
|
51
|
+
XRPLEVM: "0x0fbDaE31440f5549e2F08193b5B034F2F9768304",
|
|
52
|
+
ZeroGravity: "0x69BeC29e71711B30F58585C0bb1622e7b47e3707",
|
|
59
53
|
},
|
|
60
54
|
};
|
|
61
55
|
// Gas limits must be high enough to cover the worst-case scenario for each chain
|
|
@@ -67,19 +61,17 @@ const gasLimitOverrides = {
|
|
|
67
61
|
CreditCoin: 1500000n,
|
|
68
62
|
Monad: 1000000n,
|
|
69
63
|
MegaETH: 1000000n,
|
|
64
|
+
Seievm: 1000000n,
|
|
70
65
|
},
|
|
71
66
|
Testnet: {
|
|
72
67
|
ArbitrumSepolia: 800000n,
|
|
68
|
+
Seievm: 1000000n,
|
|
73
69
|
},
|
|
74
70
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
Mainnet: {
|
|
80
|
-
Monad: true,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
71
|
+
exports.nttWithExecutorAbi = [
|
|
72
|
+
"function transfer(address nttManager, uint256 amount, uint16 recipientChain, bytes32 recipientAddress, bytes32 refundAddress, bytes encodedInstructions, (uint256 value, address refundAddress, bytes signedQuote, bytes instructions) executorArgs, (uint256 transferTokenFee, uint256 nativeTokenFee, address payee) feeArgs) external payable returns (uint64 msgId)",
|
|
73
|
+
"function transferETH(address nttManager, uint256 amount, uint16 recipientChain, bytes32 recipientAddress, bytes32 refundAddress, bytes encodedInstructions, (uint256 value, address refundAddress, bytes signedQuote, bytes instructions) executorArgs, (uint256 transferTokenFee, uint256 nativeTokenFee, address payee) feeArgs) external payable returns (uint64 msgId)",
|
|
74
|
+
];
|
|
83
75
|
class EvmNttWithExecutor {
|
|
84
76
|
network;
|
|
85
77
|
chain;
|
|
@@ -87,7 +79,6 @@ class EvmNttWithExecutor {
|
|
|
87
79
|
contracts;
|
|
88
80
|
chainId;
|
|
89
81
|
executorAddress;
|
|
90
|
-
supportsTransferETH;
|
|
91
82
|
constructor(network, chain, provider, contracts) {
|
|
92
83
|
this.network = network;
|
|
93
84
|
this.chain = chain;
|
|
@@ -98,8 +89,6 @@ class EvmNttWithExecutor {
|
|
|
98
89
|
if (!executorAddress)
|
|
99
90
|
throw new Error(`Executor address not found for chain ${this.chain}`);
|
|
100
91
|
this.executorAddress = executorAddress;
|
|
101
|
-
this.supportsTransferETH =
|
|
102
|
-
supportsTransferETH[this.network]?.[this.chain] ?? false;
|
|
103
92
|
}
|
|
104
93
|
static async fromRpc(provider, config) {
|
|
105
94
|
const [network, chain] = await sdk_evm_1.EvmPlatform.chainFromRpc(provider);
|
|
@@ -110,81 +99,57 @@ class EvmNttWithExecutor {
|
|
|
110
99
|
}
|
|
111
100
|
async *transfer(sender, destination, amount, quote, ntt, wrapNative = false) {
|
|
112
101
|
const senderAddress = new sdk_evm_1.EvmAddress(sender).toString();
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
102
|
+
const deliveryPrice = await ntt.quoteDeliveryPrice(destination.chain, {
|
|
103
|
+
queue: false,
|
|
104
|
+
automatic: false,
|
|
105
|
+
});
|
|
106
|
+
// Fee is deducted from the transfer amount.
|
|
107
|
+
// Approval covers remainingAmount + transferTokenFee = the full user amount.
|
|
108
|
+
const totalAmount = quote.remainingAmount + quote.transferTokenFee;
|
|
109
|
+
const iface = new ethers_1.Interface(exports.nttWithExecutorAbi);
|
|
110
|
+
const commonArgs = [
|
|
111
|
+
ntt.managerAddress,
|
|
112
|
+
quote.remainingAmount,
|
|
113
|
+
(0, sdk_base_1.toChainId)(destination.chain),
|
|
114
|
+
destination.address.toUniversalAddress().toUint8Array(),
|
|
115
|
+
sender.toUniversalAddress().toUint8Array(),
|
|
116
|
+
sdk_definitions_ntt_1.Ntt.encodeTransceiverInstructions(ntt.encodeOptions({ queue: false, automatic: false })),
|
|
117
|
+
{
|
|
118
|
+
value: quote.estimatedCost,
|
|
119
|
+
refundAddress: senderAddress,
|
|
120
|
+
signedQuote: quote.signedQuote,
|
|
121
|
+
instructions: quote.relayInstructions,
|
|
122
|
+
},
|
|
126
123
|
];
|
|
127
|
-
const iface = new ethers_1.Interface(abi);
|
|
128
|
-
const nttManager = ntt.managerAddress;
|
|
129
|
-
const recipientChain = (0, sdk_base_1.toChainId)(destination.chain);
|
|
130
|
-
const recipientAddress = destination.address
|
|
131
|
-
.toUniversalAddress()
|
|
132
|
-
.toUint8Array();
|
|
133
|
-
const refundAddress = sender.toUniversalAddress().toUint8Array();
|
|
134
|
-
const encodedInstructions = sdk_definitions_ntt_1.Ntt.encodeTransceiverInstructions(ntt.encodeOptions({ queue: false, automatic: false }));
|
|
135
|
-
const executorArgs = {
|
|
136
|
-
value: quote.estimatedCost,
|
|
137
|
-
refundAddress: senderAddress,
|
|
138
|
-
signedQuote: quote.signedQuote,
|
|
139
|
-
instructions: quote.relayInstructions,
|
|
140
|
-
};
|
|
141
124
|
const feeArgs = {
|
|
142
|
-
|
|
125
|
+
transferTokenFee: quote.transferTokenFee,
|
|
126
|
+
nativeTokenFee: quote.nativeTokenFee,
|
|
143
127
|
payee: quote.referrer.address.toString(),
|
|
144
128
|
};
|
|
145
129
|
let data;
|
|
146
130
|
let msgValue;
|
|
147
|
-
if (
|
|
148
|
-
data = iface.encodeFunctionData("transferETH", [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
encodedInstructions,
|
|
155
|
-
executorArgs,
|
|
156
|
-
feeArgs,
|
|
157
|
-
]);
|
|
158
|
-
msgValue = quote.estimatedCost + deliveryPrice + amount;
|
|
131
|
+
if (wrapNative) {
|
|
132
|
+
data = iface.encodeFunctionData("transferETH", [...commonArgs, feeArgs]);
|
|
133
|
+
msgValue =
|
|
134
|
+
quote.estimatedCost +
|
|
135
|
+
deliveryPrice +
|
|
136
|
+
quote.nativeTokenFee +
|
|
137
|
+
totalAmount;
|
|
159
138
|
}
|
|
160
139
|
else {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
refundAddress,
|
|
174
|
-
encodedInstructions,
|
|
175
|
-
executorArgs,
|
|
176
|
-
feeArgs,
|
|
177
|
-
]);
|
|
178
|
-
msgValue = quote.estimatedCost + deliveryPrice;
|
|
140
|
+
yield* this.approveIfNeeded(senderAddress, this.executorAddress, totalAmount, ntt);
|
|
141
|
+
data = iface.encodeFunctionData("transfer", [...commonArgs, feeArgs]);
|
|
142
|
+
msgValue = quote.estimatedCost + deliveryPrice + quote.nativeTokenFee;
|
|
143
|
+
}
|
|
144
|
+
yield ntt.createUnsignedTx({ to: this.executorAddress, data, value: msgValue }, wrapNative ? "NttWithExecutor.transferETH" : "NttWithExecutor.transfer");
|
|
145
|
+
}
|
|
146
|
+
async *approveIfNeeded(senderAddress, contractAddress, requiredAmount, ntt) {
|
|
147
|
+
const tokenContract = sdk_evm_1.EvmPlatform.getTokenImplementation(this.provider, ntt.tokenAddress);
|
|
148
|
+
const allowance = await tokenContract.allowance(senderAddress, contractAddress);
|
|
149
|
+
if (allowance < requiredAmount) {
|
|
150
|
+
const txReq = await tokenContract.approve.populateTransaction(contractAddress, requiredAmount);
|
|
151
|
+
yield ntt.createUnsignedTx(txReq, "Ntt.Approve");
|
|
179
152
|
}
|
|
180
|
-
const txReq = {
|
|
181
|
-
to: this.executorAddress,
|
|
182
|
-
data,
|
|
183
|
-
value: msgValue,
|
|
184
|
-
};
|
|
185
|
-
yield ntt.createUnsignedTx(txReq, useTransferETH
|
|
186
|
-
? "NttWithExecutor.transferETH"
|
|
187
|
-
: "NttWithExecutor.transfer");
|
|
188
153
|
}
|
|
189
154
|
async estimateMsgValueAndGasLimit(recipient) {
|
|
190
155
|
const gasLimit = gasLimitOverrides[this.network]?.[this.chain] ?? 500000n;
|
|
@@ -193,10 +158,7 @@ class EvmNttWithExecutor {
|
|
|
193
158
|
}
|
|
194
159
|
exports.EvmNttWithExecutor = EvmNttWithExecutor;
|
|
195
160
|
/**
|
|
196
|
-
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination
|
|
197
|
-
* @param network - The network (e.g., 'Mainnet', 'Testnet')
|
|
198
|
-
* @param chain - The EVM chain (e.g., 'Arbitrum', 'ArbitrumSepolia')
|
|
199
|
-
* @returns true if an executor address exists for this network/chain combination
|
|
161
|
+
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination.
|
|
200
162
|
*/
|
|
201
163
|
function hasExecutorDeployed(network, chain) {
|
|
202
164
|
return nttManagerWithExecutorAddresses[network]?.[chain] !== undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nttWithExecutor.js","sourceRoot":"","sources":["../../src/nttWithExecutor.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"nttWithExecutor.js","sourceRoot":"","sources":["../../src/nttWithExecutor.ts"],"names":[],"mappings":";;;AAkPA,kDAKC;AAvPD,4DAIuC;AAQvC,kFAAgF;AAChF,0DAKsC;AACtC,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AAG,cAAc,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,mBAAmB,CAC3D,eAAe,EACf,cAAc,CACf,CAAC;YACF,MAAM,GAAG,CAAC,gBAAgB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAED,KAAK,CAAC,2BAA2B,CAC/B,SAAmC;QAEnC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,OAAQ,CAAC;QAC3E,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;IACpC,CAAC;CACF;AA9ID,gDA8IC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,OAAgB,EAChB,KAAgB;IAEhB,OAAO,+BAA+B,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;AACzE,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { Ntt, NttWithExecutor } from "@wormhole-foundation/sdk-definitions-ntt";
|
|
|
4
4
|
import { type EvmPlatformType, type EvmChains } from "@wormhole-foundation/sdk-evm";
|
|
5
5
|
import { Provider } from "ethers";
|
|
6
6
|
import { EvmNtt } from "./ntt.js";
|
|
7
|
+
export declare const nttWithExecutorAbi: string[];
|
|
7
8
|
export declare class EvmNttWithExecutor<N extends Network, C extends EvmChains> implements NttWithExecutor<N, C> {
|
|
8
9
|
readonly network: N;
|
|
9
10
|
readonly chain: C;
|
|
@@ -13,22 +14,19 @@ export declare class EvmNttWithExecutor<N extends Network, C extends EvmChains>
|
|
|
13
14
|
};
|
|
14
15
|
readonly chainId: bigint;
|
|
15
16
|
readonly executorAddress: string;
|
|
16
|
-
readonly supportsTransferETH: boolean;
|
|
17
17
|
constructor(network: N, chain: C, provider: Provider, contracts: Contracts & {
|
|
18
18
|
ntt?: Ntt.Contracts;
|
|
19
19
|
});
|
|
20
20
|
static fromRpc<N extends Network>(provider: Provider, config: ChainsConfig<N, EvmPlatformType>): Promise<EvmNttWithExecutor<N, EvmChains>>;
|
|
21
21
|
transfer(sender: AccountAddress<C>, destination: ChainAddress, amount: bigint, quote: NttWithExecutor.Quote, ntt: EvmNtt<N, C>, wrapNative?: boolean): AsyncGenerator<UnsignedTransaction<N, C>>;
|
|
22
|
+
private approveIfNeeded;
|
|
22
23
|
estimateMsgValueAndGasLimit(recipient: ChainAddress | undefined): Promise<{
|
|
23
24
|
msgValue: bigint;
|
|
24
25
|
gasLimit: bigint;
|
|
25
26
|
}>;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
|
-
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination
|
|
29
|
-
* @param network - The network (e.g., 'Mainnet', 'Testnet')
|
|
30
|
-
* @param chain - The EVM chain (e.g., 'Arbitrum', 'ArbitrumSepolia')
|
|
31
|
-
* @returns true if an executor address exists for this network/chain combination
|
|
29
|
+
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination.
|
|
32
30
|
*/
|
|
33
31
|
export declare function hasExecutorDeployed(network: Network, chain: EvmChains): boolean;
|
|
34
32
|
//# sourceMappingURL=nttWithExecutor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nttWithExecutor.d.ts","sourceRoot":"","sources":["../../src/nttWithExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,SAAS,EACT,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAa,MAAM,QAAQ,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,QAAQ,EAClB,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,eAAe,CAAC,GACvC,OAAO,CAAC,kBAAkB,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAcrC,QAAQ,CACb,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,EACzB,WAAW,EAAE,YAAY,EACzB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,eAAe,CAAC,KAAK,EAC5B,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACjB,UAAU,GAAE,OAAe,GAC1B,cAAc,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YA+D7B,eAAe;IAyBxB,2BAA2B,CAC/B,SAAS,EAAE,YAAY,GAAG,SAAS,GAClC,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAInD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,GACf,OAAO,CAET"}
|
|
@@ -4,54 +4,48 @@ import { EvmPlatform, EvmAddress, } from "@wormhole-foundation/sdk-evm";
|
|
|
4
4
|
import { Interface } from "ethers";
|
|
5
5
|
const nttManagerWithExecutorAddresses = {
|
|
6
6
|
Mainnet: {
|
|
7
|
-
Arbitrum: "
|
|
8
|
-
Avalanche: "
|
|
9
|
-
Base: "
|
|
10
|
-
Berachain: "
|
|
11
|
-
Bsc: "
|
|
12
|
-
Celo: "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
ZeroGravity: "0xe175A8b838f3CdB2e1AAf4Ff74c05cF2F3AEA9a8",
|
|
7
|
+
Arbitrum: "0x5029a23E0EE11f6c9120EAb7eB48a94a49907EC4",
|
|
8
|
+
Avalanche: "0xf1Aa9693265E0Ba892C4a7AE77591424eEEd5cE9",
|
|
9
|
+
Base: "0x27db1967D469D89318B7119Ced5609f327095de4",
|
|
10
|
+
Berachain: "0x7424E82D27dD80ca47eab5e739C4D5A2D220f64f",
|
|
11
|
+
Bsc: "0x83f5c7b03BBbE20FE2e39312b957D86dc7C3Dee2",
|
|
12
|
+
Celo: "0xb466bA8798a5B516b43cbE6AA7bBb9532bB1708D",
|
|
13
|
+
CreditCoin: "0xcA43AE520E308C6Fb444EB723406febF7c310Da3",
|
|
14
|
+
Ethereum: "0xC079bFA54F348199bA51B2717595fE24e96f1542",
|
|
15
|
+
HyperEVM: "0xBc275e094e031e990b060134AbbDa00132f9A163",
|
|
16
|
+
Ink: "0x9e9980848FcbC11F9e84b5b6f5b88887966F5DAe",
|
|
17
|
+
Linea: "0x6FE9625F59107a4D49a9b5bC10a701dD0Bb396C0",
|
|
18
|
+
MegaETH: "0x7215f45Ea622E0350DF410D2e780BfD03bDc8a4D",
|
|
19
|
+
Mezo: "0x50F11Fe8B0D2B6f18a12291FeD345914D7Ec69d3",
|
|
20
|
+
Moca: "0x494726C75053F63CA906Aee00d6f910afE761B35",
|
|
21
|
+
Monad: "0xcc9FE3526F527bB0A14242A92818e132f3c12059",
|
|
22
|
+
Moonbeam: "0x40bBdD737f2Ca6316777F0B24ac94aaDE1ad1e4b",
|
|
23
|
+
Optimism: "0xC25396Ce2F6FBE6996374a5527c636C71AD5a757",
|
|
24
|
+
Plume: "0x00F39D8897e32B129435499F406b2fD76e37B51E",
|
|
25
|
+
Polygon: "0x9d165221c3c68868D15B154c5Aa66C32e044Eb4b",
|
|
26
|
+
Seievm: "0x70b85A416146A2dc3c760Ad30102F4280471C2b1",
|
|
27
|
+
Sonic: "0x98D1A98Cc398Ef6F5F84D134C1370480AaabA546",
|
|
28
|
+
Unichain: "0x2ceB44DE347641804856E2c468E703e06C5A8A33",
|
|
29
|
+
Worldchain: "0xDdBBa9509B9587516a0736D218B193a0DCf2B3e4",
|
|
30
|
+
XRPLEVM: "0xeddc0228C8719E7220eF4D8D95503258285BD482",
|
|
31
|
+
ZeroGravity: "0x4E62C24F9c18D3053B8E84A73a2ec7A40b74AF8a",
|
|
33
32
|
},
|
|
34
33
|
Testnet: {
|
|
35
|
-
ArbitrumSepolia: "
|
|
36
|
-
Avalanche: "
|
|
37
|
-
BaseSepolia: "
|
|
38
|
-
Bsc: "
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Plume: "
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
XRPLEVM: "0xcDD9d7C759b29680f7a516d0058de8293b2AC7b1",
|
|
51
|
-
Mezo: "0x484b5593BbB90383f94FB299470F09427cf6cfE2",
|
|
52
|
-
Moca: "0x47f26bF9253Eb398fBAf825D7565FE975D839a71",
|
|
53
|
-
ZeroGravity: "0xA8CA118f4C8d44Ab651Dad52B5E1a212e5d5c55b",
|
|
54
|
-
Nexus: "0x5C2768b4aF4483ffeB2B8de8D8b14829C0F19c9E",
|
|
34
|
+
ArbitrumSepolia: "0xD69CF144C31aE8C12b5C7c3D52411F32C824C9a3",
|
|
35
|
+
Avalanche: "0x8196EBa42b2947f519002B8aDa53b1880F580c69",
|
|
36
|
+
BaseSepolia: "0x9fBC8aA6B2f626D13005De92B3f0e4541919f721",
|
|
37
|
+
Bsc: "0x2c9F87bE2eb0caEB8AfFE6F7ae1f046E5D40Ff2a",
|
|
38
|
+
Ink: "0x86B93560FeAbc95a0067a498d8afe1219f3ED0D7",
|
|
39
|
+
Linea: "0x5d98Ded0E46d0aEAB37EA4fEe45A38dc5ccee673",
|
|
40
|
+
Mezo: "0x117F5F5E8d29ED6254c6098457Cea28E3Ee7cDdA",
|
|
41
|
+
Monad: "0x8BcA0315627DA3D2e5FA349a6A1ad2FAde36BCe5",
|
|
42
|
+
OptimismSepolia: "0xA8b1d0520D556b4Ea115562D35077cAA2f13C6D6",
|
|
43
|
+
Plume: "0x6D87C7d416dFf428117b560A981d788E39707195",
|
|
44
|
+
Seievm: "0xdb66Dc163A03220661ca33B492c72a6a15B3a8cf",
|
|
45
|
+
Sepolia: "0xc2386453598811D88613331D52e2Ca4B2AEe16E4",
|
|
46
|
+
Unichain: "0xc41853C70bf70a2FFeE3ddd8f38D2b774Fe3E264",
|
|
47
|
+
XRPLEVM: "0x0fbDaE31440f5549e2F08193b5B034F2F9768304",
|
|
48
|
+
ZeroGravity: "0x69BeC29e71711B30F58585C0bb1622e7b47e3707",
|
|
55
49
|
},
|
|
56
50
|
};
|
|
57
51
|
// Gas limits must be high enough to cover the worst-case scenario for each chain
|
|
@@ -63,19 +57,17 @@ const gasLimitOverrides = {
|
|
|
63
57
|
CreditCoin: 1500000n,
|
|
64
58
|
Monad: 1000000n,
|
|
65
59
|
MegaETH: 1000000n,
|
|
60
|
+
Seievm: 1000000n,
|
|
66
61
|
},
|
|
67
62
|
Testnet: {
|
|
68
63
|
ArbitrumSepolia: 800000n,
|
|
64
|
+
Seievm: 1000000n,
|
|
69
65
|
},
|
|
70
66
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Mainnet: {
|
|
76
|
-
Monad: true,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
67
|
+
export const nttWithExecutorAbi = [
|
|
68
|
+
"function transfer(address nttManager, uint256 amount, uint16 recipientChain, bytes32 recipientAddress, bytes32 refundAddress, bytes encodedInstructions, (uint256 value, address refundAddress, bytes signedQuote, bytes instructions) executorArgs, (uint256 transferTokenFee, uint256 nativeTokenFee, address payee) feeArgs) external payable returns (uint64 msgId)",
|
|
69
|
+
"function transferETH(address nttManager, uint256 amount, uint16 recipientChain, bytes32 recipientAddress, bytes32 refundAddress, bytes encodedInstructions, (uint256 value, address refundAddress, bytes signedQuote, bytes instructions) executorArgs, (uint256 transferTokenFee, uint256 nativeTokenFee, address payee) feeArgs) external payable returns (uint64 msgId)",
|
|
70
|
+
];
|
|
79
71
|
export class EvmNttWithExecutor {
|
|
80
72
|
network;
|
|
81
73
|
chain;
|
|
@@ -83,7 +75,6 @@ export class EvmNttWithExecutor {
|
|
|
83
75
|
contracts;
|
|
84
76
|
chainId;
|
|
85
77
|
executorAddress;
|
|
86
|
-
supportsTransferETH;
|
|
87
78
|
constructor(network, chain, provider, contracts) {
|
|
88
79
|
this.network = network;
|
|
89
80
|
this.chain = chain;
|
|
@@ -94,8 +85,6 @@ export class EvmNttWithExecutor {
|
|
|
94
85
|
if (!executorAddress)
|
|
95
86
|
throw new Error(`Executor address not found for chain ${this.chain}`);
|
|
96
87
|
this.executorAddress = executorAddress;
|
|
97
|
-
this.supportsTransferETH =
|
|
98
|
-
supportsTransferETH[this.network]?.[this.chain] ?? false;
|
|
99
88
|
}
|
|
100
89
|
static async fromRpc(provider, config) {
|
|
101
90
|
const [network, chain] = await EvmPlatform.chainFromRpc(provider);
|
|
@@ -106,81 +95,57 @@ export class EvmNttWithExecutor {
|
|
|
106
95
|
}
|
|
107
96
|
async *transfer(sender, destination, amount, quote, ntt, wrapNative = false) {
|
|
108
97
|
const senderAddress = new EvmAddress(sender).toString();
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
98
|
+
const deliveryPrice = await ntt.quoteDeliveryPrice(destination.chain, {
|
|
99
|
+
queue: false,
|
|
100
|
+
automatic: false,
|
|
101
|
+
});
|
|
102
|
+
// Fee is deducted from the transfer amount.
|
|
103
|
+
// Approval covers remainingAmount + transferTokenFee = the full user amount.
|
|
104
|
+
const totalAmount = quote.remainingAmount + quote.transferTokenFee;
|
|
105
|
+
const iface = new Interface(nttWithExecutorAbi);
|
|
106
|
+
const commonArgs = [
|
|
107
|
+
ntt.managerAddress,
|
|
108
|
+
quote.remainingAmount,
|
|
109
|
+
toChainId(destination.chain),
|
|
110
|
+
destination.address.toUniversalAddress().toUint8Array(),
|
|
111
|
+
sender.toUniversalAddress().toUint8Array(),
|
|
112
|
+
Ntt.encodeTransceiverInstructions(ntt.encodeOptions({ queue: false, automatic: false })),
|
|
113
|
+
{
|
|
114
|
+
value: quote.estimatedCost,
|
|
115
|
+
refundAddress: senderAddress,
|
|
116
|
+
signedQuote: quote.signedQuote,
|
|
117
|
+
instructions: quote.relayInstructions,
|
|
118
|
+
},
|
|
122
119
|
];
|
|
123
|
-
const iface = new Interface(abi);
|
|
124
|
-
const nttManager = ntt.managerAddress;
|
|
125
|
-
const recipientChain = toChainId(destination.chain);
|
|
126
|
-
const recipientAddress = destination.address
|
|
127
|
-
.toUniversalAddress()
|
|
128
|
-
.toUint8Array();
|
|
129
|
-
const refundAddress = sender.toUniversalAddress().toUint8Array();
|
|
130
|
-
const encodedInstructions = Ntt.encodeTransceiverInstructions(ntt.encodeOptions({ queue: false, automatic: false }));
|
|
131
|
-
const executorArgs = {
|
|
132
|
-
value: quote.estimatedCost,
|
|
133
|
-
refundAddress: senderAddress,
|
|
134
|
-
signedQuote: quote.signedQuote,
|
|
135
|
-
instructions: quote.relayInstructions,
|
|
136
|
-
};
|
|
137
120
|
const feeArgs = {
|
|
138
|
-
|
|
121
|
+
transferTokenFee: quote.transferTokenFee,
|
|
122
|
+
nativeTokenFee: quote.nativeTokenFee,
|
|
139
123
|
payee: quote.referrer.address.toString(),
|
|
140
124
|
};
|
|
141
125
|
let data;
|
|
142
126
|
let msgValue;
|
|
143
|
-
if (
|
|
144
|
-
data = iface.encodeFunctionData("transferETH", [
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
encodedInstructions,
|
|
151
|
-
executorArgs,
|
|
152
|
-
feeArgs,
|
|
153
|
-
]);
|
|
154
|
-
msgValue = quote.estimatedCost + deliveryPrice + amount;
|
|
127
|
+
if (wrapNative) {
|
|
128
|
+
data = iface.encodeFunctionData("transferETH", [...commonArgs, feeArgs]);
|
|
129
|
+
msgValue =
|
|
130
|
+
quote.estimatedCost +
|
|
131
|
+
deliveryPrice +
|
|
132
|
+
quote.nativeTokenFee +
|
|
133
|
+
totalAmount;
|
|
155
134
|
}
|
|
156
135
|
else {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
refundAddress,
|
|
170
|
-
encodedInstructions,
|
|
171
|
-
executorArgs,
|
|
172
|
-
feeArgs,
|
|
173
|
-
]);
|
|
174
|
-
msgValue = quote.estimatedCost + deliveryPrice;
|
|
136
|
+
yield* this.approveIfNeeded(senderAddress, this.executorAddress, totalAmount, ntt);
|
|
137
|
+
data = iface.encodeFunctionData("transfer", [...commonArgs, feeArgs]);
|
|
138
|
+
msgValue = quote.estimatedCost + deliveryPrice + quote.nativeTokenFee;
|
|
139
|
+
}
|
|
140
|
+
yield ntt.createUnsignedTx({ to: this.executorAddress, data, value: msgValue }, wrapNative ? "NttWithExecutor.transferETH" : "NttWithExecutor.transfer");
|
|
141
|
+
}
|
|
142
|
+
async *approveIfNeeded(senderAddress, contractAddress, requiredAmount, ntt) {
|
|
143
|
+
const tokenContract = EvmPlatform.getTokenImplementation(this.provider, ntt.tokenAddress);
|
|
144
|
+
const allowance = await tokenContract.allowance(senderAddress, contractAddress);
|
|
145
|
+
if (allowance < requiredAmount) {
|
|
146
|
+
const txReq = await tokenContract.approve.populateTransaction(contractAddress, requiredAmount);
|
|
147
|
+
yield ntt.createUnsignedTx(txReq, "Ntt.Approve");
|
|
175
148
|
}
|
|
176
|
-
const txReq = {
|
|
177
|
-
to: this.executorAddress,
|
|
178
|
-
data,
|
|
179
|
-
value: msgValue,
|
|
180
|
-
};
|
|
181
|
-
yield ntt.createUnsignedTx(txReq, useTransferETH
|
|
182
|
-
? "NttWithExecutor.transferETH"
|
|
183
|
-
: "NttWithExecutor.transfer");
|
|
184
149
|
}
|
|
185
150
|
async estimateMsgValueAndGasLimit(recipient) {
|
|
186
151
|
const gasLimit = gasLimitOverrides[this.network]?.[this.chain] ?? 500000n;
|
|
@@ -188,10 +153,7 @@ export class EvmNttWithExecutor {
|
|
|
188
153
|
}
|
|
189
154
|
}
|
|
190
155
|
/**
|
|
191
|
-
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination
|
|
192
|
-
* @param network - The network (e.g., 'Mainnet', 'Testnet')
|
|
193
|
-
* @param chain - The EVM chain (e.g., 'Arbitrum', 'ArbitrumSepolia')
|
|
194
|
-
* @returns true if an executor address exists for this network/chain combination
|
|
156
|
+
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination.
|
|
195
157
|
*/
|
|
196
158
|
export function hasExecutorDeployed(network, chain) {
|
|
197
159
|
return nttManagerWithExecutorAddresses[network]?.[chain] !== undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nttWithExecutor.js","sourceRoot":"","sources":["../../src/nttWithExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,SAAS,GAEV,MAAM,+BAA+B,CAAC;AAQvC,OAAO,EAAE,GAAG,EAAmB,MAAM,0CAA0C,CAAC;AAChF,OAAO,EACL,WAAW,EAGX,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAY,SAAS,EAAE,MAAM,QAAQ,CAAC;AAG7C,MAAM,+BAA+B,GAEjC;IACF,OAAO,EAAE;QACP,QAAQ,EAAE,4CAA4C;QACtD,SAAS,EAAE,4CAA4C;QACvD,IAAI,EAAE,4CAA4C;QAClD,SAAS,EAAE,4CAA4C;QACvD,GAAG,EAAE,4CAA4C;QACjD,IA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": "git",
|
|
6
6
|
"url": "git+https://github.com/wormhole-foundation/native-token-transfers.git"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"prettier": "prettier --write ./src ./__tests__"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@wormhole-foundation/sdk-definitions-ntt": "
|
|
49
|
+
"@wormhole-foundation/sdk-definitions-ntt": "6.0.0-beta.1",
|
|
50
50
|
"ethers": "^6.5.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@wormhole-foundation/sdk-base": "^4.
|
|
72
|
-
"@wormhole-foundation/sdk-definitions": "^4.
|
|
73
|
-
"@wormhole-foundation/sdk-evm": "^4.
|
|
74
|
-
"@wormhole-foundation/sdk-evm-core": "^4.
|
|
71
|
+
"@wormhole-foundation/sdk-base": "^4.20.0",
|
|
72
|
+
"@wormhole-foundation/sdk-definitions": "^4.20.0",
|
|
73
|
+
"@wormhole-foundation/sdk-evm": "^4.20.0",
|
|
74
|
+
"@wormhole-foundation/sdk-evm-core": "^4.20.0"
|
|
75
75
|
}
|
|
76
76
|
}
|