@wormhole-foundation/sdk-evm-ntt 5.0.2-beta.0 → 6.0.0-beta.0
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 +73 -106
- 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 +72 -105
- 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;AAC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,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"}
|
|
@@ -1,11 +1,12 @@
|
|
|
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");
|
|
7
7
|
const sdk_evm_1 = require("@wormhole-foundation/sdk-evm");
|
|
8
8
|
const ethers_1 = require("ethers");
|
|
9
|
+
// TODO: update with correct v2 contract addresses
|
|
9
10
|
const nttManagerWithExecutorAddresses = {
|
|
10
11
|
Mainnet: {
|
|
11
12
|
Arbitrum: "0x0Af42A597b0C201D4dcf450DcD0c06d55ddC1C77",
|
|
@@ -14,48 +15,46 @@ const nttManagerWithExecutorAddresses = {
|
|
|
14
15
|
Berachain: "0x0a2AF374Cc9CCCbB0Acc4E34B20b9d02a0f08c30",
|
|
15
16
|
Bsc: "0x39B57Dd9908F8be02CfeE283b67eA1303Bc29fe1",
|
|
16
17
|
Celo: "0x3d69869fcB9e1CD1F4020b637fb8256030BAc8fC",
|
|
18
|
+
CreditCoin: "0x5454b995719626256C96fb57454b044ffb3Da2F9",
|
|
17
19
|
Ethereum: "0xD2D9c936165a85F27a5a7e07aFb974D022B89463",
|
|
18
20
|
HyperEVM: "0x431017B1718b86898C7590fFcCC380DEf0456393",
|
|
19
21
|
Ink: "0x420370DC2ECC4D44b47514B7859fd11809BbeFF5",
|
|
20
22
|
Linea: "0xEAa5AddB5b8939Eb73F7faF46e193EefECaF13E9",
|
|
23
|
+
MegaETH: "0x3EFEc0c7Ee79135330DD03e995872f84b1AD49b6",
|
|
21
24
|
Mezo: "0x484b5593BbB90383f94FB299470F09427cf6cfE2",
|
|
25
|
+
Moca: "0xE612837749a0690BA2BCe490D6eFb5F8Fc347df3",
|
|
26
|
+
Monad: "0xc3F3dDa544815a440633176c7598f5B97500793e",
|
|
22
27
|
Moonbeam: "0x1365593C8bae71a55e48E105a2Bb76d5928c7DE3",
|
|
23
28
|
Optimism: "0x85C0129bE5226C9F0Cf4e419D2fefc1c3FCa25cF",
|
|
24
29
|
Plume: "0x6Eb53371f646788De6B4D0225a4Ed1d9267188AD",
|
|
25
30
|
Polygon: "0x6762157b73941e36cEd0AEf54614DdE545d0F990",
|
|
26
|
-
|
|
31
|
+
Seievm: "0x3F2D6441C7a59Dfe80f8e14142F9E28F6D440445",
|
|
27
32
|
Sonic: "0xaCa00703bb87F31D6F9fCcc963548b48FA46DfeB",
|
|
28
33
|
Unichain: "0x607723D6353Dae3ef62B7B277Cfabd0F4bc6CB4C",
|
|
29
34
|
Worldchain: "0x66b1644400D51e104272337226De3EF1A820eC79",
|
|
30
35
|
XRPLEVM: "0x6bBd1ff3bB303F88835A714EE3241bF45DE26d29",
|
|
31
|
-
Seievm: "0x3F2D6441C7a59Dfe80f8e14142F9E28F6D440445",
|
|
32
|
-
CreditCoin: "0x5454b995719626256C96fb57454b044ffb3Da2F9",
|
|
33
|
-
Monad: "0xc3F3dDa544815a440633176c7598f5B97500793e",
|
|
34
|
-
Moca: "0xE612837749a0690BA2BCe490D6eFb5F8Fc347df3",
|
|
35
|
-
MegaETH: "0x3EFEc0c7Ee79135330DD03e995872f84b1AD49b6",
|
|
36
36
|
ZeroGravity: "0xe175A8b838f3CdB2e1AAf4Ff74c05cF2F3AEA9a8",
|
|
37
37
|
},
|
|
38
38
|
Testnet: {
|
|
39
|
-
ArbitrumSepolia: "
|
|
40
|
-
Avalanche: "
|
|
41
|
-
BaseSepolia: "
|
|
42
|
-
Bsc: "
|
|
43
|
-
OptimismSepolia: "0xaDB1C56D363FF5A75260c3bd27dd7C1fC8421EF5",
|
|
44
|
-
Sepolia: "0x54DD7080aE169DD923fE56d0C4f814a0a17B8f41",
|
|
45
|
-
Ink: "0xF420BFFf922D11c2bBF587C9dF71b83651fAf8Bc",
|
|
46
|
-
Seievm: "0x3F2D6441C7a59Dfe80f8e14142F9E28F6D440445",
|
|
47
|
-
Converge: "0x3d8c26b67BDf630FBB44F09266aFA735F1129197",
|
|
48
|
-
Plume: "0x6Eb53371f646788De6B4D0225a4Ed1d9267188AD",
|
|
49
|
-
PolygonSepolia: "0x2982B9566E912458fE711FB1Fd78158264596937",
|
|
50
|
-
Monad: "0x93FE94Ad887a1B04DBFf1f736bfcD1698D4cfF66",
|
|
51
|
-
Linea: "0xaA469cb84C91D5a63bf4B370dE35f0831F2CE4FF",
|
|
39
|
+
ArbitrumSepolia: "0xD69CF144C31aE8C12b5C7c3D52411F32C824C9a3",
|
|
40
|
+
Avalanche: "0x8196EBa42b2947f519002B8aDa53b1880F580c69",
|
|
41
|
+
BaseSepolia: "0x9fBC8aA6B2f626D13005De92B3f0e4541919f721",
|
|
42
|
+
Bsc: "0x2c9F87bE2eb0caEB8AfFE6F7ae1f046E5D40Ff2a",
|
|
52
43
|
Celo: "0x3d69869fcB9e1CD1F4020b637fb8256030BAc8fC",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
Converge: "0x3d8c26b67BDf630FBB44F09266aFA735F1129197",
|
|
45
|
+
Ink: "0x86B93560FeAbc95a0067a498d8afe1219f3ED0D7",
|
|
46
|
+
Linea: "0x5d98Ded0E46d0aEAB37EA4fEe45A38dc5ccee673",
|
|
47
|
+
Mezo: "0x117F5F5E8d29ED6254c6098457Cea28E3Ee7cDdA",
|
|
56
48
|
Moca: "0x47f26bF9253Eb398fBAf825D7565FE975D839a71",
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
Monad: "0x8BcA0315627DA3D2e5FA349a6A1ad2FAde36BCe5",
|
|
50
|
+
OptimismSepolia: "0xA8b1d0520D556b4Ea115562D35077cAA2f13C6D6",
|
|
51
|
+
Plume: "0x6D87C7d416dFf428117b560A981d788E39707195",
|
|
52
|
+
PolygonSepolia: "0x2982B9566E912458fE711FB1Fd78158264596937", // TODO: still v0.0.1, needs redeployment
|
|
53
|
+
Seievm: "0xdb66Dc163A03220661ca33B492c72a6a15B3a8cf",
|
|
54
|
+
Sepolia: "0xc2386453598811D88613331D52e2Ca4B2AEe16E4",
|
|
55
|
+
Unichain: "0xc41853C70bf70a2FFeE3ddd8f38D2b774Fe3E264",
|
|
56
|
+
XRPLEVM: "0x0fbDaE31440f5549e2F08193b5B034F2F9768304",
|
|
57
|
+
ZeroGravity: "0x69BeC29e71711B30F58585C0bb1622e7b47e3707",
|
|
59
58
|
},
|
|
60
59
|
};
|
|
61
60
|
// Gas limits must be high enough to cover the worst-case scenario for each chain
|
|
@@ -67,19 +66,17 @@ const gasLimitOverrides = {
|
|
|
67
66
|
CreditCoin: 1500000n,
|
|
68
67
|
Monad: 1000000n,
|
|
69
68
|
MegaETH: 1000000n,
|
|
69
|
+
Seievm: 1000000n,
|
|
70
70
|
},
|
|
71
71
|
Testnet: {
|
|
72
72
|
ArbitrumSepolia: 800000n,
|
|
73
|
+
Seievm: 1000000n,
|
|
73
74
|
},
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
Mainnet: {
|
|
80
|
-
Monad: true,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
76
|
+
exports.nttWithExecutorAbi = [
|
|
77
|
+
"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)",
|
|
78
|
+
"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)",
|
|
79
|
+
];
|
|
83
80
|
class EvmNttWithExecutor {
|
|
84
81
|
network;
|
|
85
82
|
chain;
|
|
@@ -87,7 +84,6 @@ class EvmNttWithExecutor {
|
|
|
87
84
|
contracts;
|
|
88
85
|
chainId;
|
|
89
86
|
executorAddress;
|
|
90
|
-
supportsTransferETH;
|
|
91
87
|
constructor(network, chain, provider, contracts) {
|
|
92
88
|
this.network = network;
|
|
93
89
|
this.chain = chain;
|
|
@@ -98,8 +94,6 @@ class EvmNttWithExecutor {
|
|
|
98
94
|
if (!executorAddress)
|
|
99
95
|
throw new Error(`Executor address not found for chain ${this.chain}`);
|
|
100
96
|
this.executorAddress = executorAddress;
|
|
101
|
-
this.supportsTransferETH =
|
|
102
|
-
supportsTransferETH[this.network]?.[this.chain] ?? false;
|
|
103
97
|
}
|
|
104
98
|
static async fromRpc(provider, config) {
|
|
105
99
|
const [network, chain] = await sdk_evm_1.EvmPlatform.chainFromRpc(provider);
|
|
@@ -110,81 +104,57 @@ class EvmNttWithExecutor {
|
|
|
110
104
|
}
|
|
111
105
|
async *transfer(sender, destination, amount, quote, ntt, wrapNative = false) {
|
|
112
106
|
const senderAddress = new sdk_evm_1.EvmAddress(sender).toString();
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
107
|
+
const deliveryPrice = await ntt.quoteDeliveryPrice(destination.chain, {
|
|
108
|
+
queue: false,
|
|
109
|
+
automatic: false,
|
|
110
|
+
});
|
|
111
|
+
// Fee is deducted from the transfer amount.
|
|
112
|
+
// Approval covers remainingAmount + transferTokenFee = the full user amount.
|
|
113
|
+
const totalAmount = quote.remainingAmount + quote.transferTokenFee;
|
|
114
|
+
const iface = new ethers_1.Interface(exports.nttWithExecutorAbi);
|
|
115
|
+
const commonArgs = [
|
|
116
|
+
ntt.managerAddress,
|
|
117
|
+
quote.remainingAmount,
|
|
118
|
+
(0, sdk_base_1.toChainId)(destination.chain),
|
|
119
|
+
destination.address.toUniversalAddress().toUint8Array(),
|
|
120
|
+
sender.toUniversalAddress().toUint8Array(),
|
|
121
|
+
sdk_definitions_ntt_1.Ntt.encodeTransceiverInstructions(ntt.encodeOptions({ queue: false, automatic: false })),
|
|
122
|
+
{
|
|
123
|
+
value: quote.estimatedCost,
|
|
124
|
+
refundAddress: senderAddress,
|
|
125
|
+
signedQuote: quote.signedQuote,
|
|
126
|
+
instructions: quote.relayInstructions,
|
|
127
|
+
},
|
|
126
128
|
];
|
|
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
129
|
const feeArgs = {
|
|
142
|
-
|
|
130
|
+
transferTokenFee: quote.transferTokenFee,
|
|
131
|
+
nativeTokenFee: quote.nativeTokenFee,
|
|
143
132
|
payee: quote.referrer.address.toString(),
|
|
144
133
|
};
|
|
145
134
|
let data;
|
|
146
135
|
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;
|
|
136
|
+
if (wrapNative) {
|
|
137
|
+
data = iface.encodeFunctionData("transferETH", [...commonArgs, feeArgs]);
|
|
138
|
+
msgValue =
|
|
139
|
+
quote.estimatedCost +
|
|
140
|
+
deliveryPrice +
|
|
141
|
+
quote.nativeTokenFee +
|
|
142
|
+
totalAmount;
|
|
159
143
|
}
|
|
160
144
|
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;
|
|
145
|
+
yield* this.approveIfNeeded(senderAddress, this.executorAddress, totalAmount, ntt);
|
|
146
|
+
data = iface.encodeFunctionData("transfer", [...commonArgs, feeArgs]);
|
|
147
|
+
msgValue = quote.estimatedCost + deliveryPrice + quote.nativeTokenFee;
|
|
148
|
+
}
|
|
149
|
+
yield ntt.createUnsignedTx({ to: this.executorAddress, data, value: msgValue }, wrapNative ? "NttWithExecutor.transferETH" : "NttWithExecutor.transfer");
|
|
150
|
+
}
|
|
151
|
+
async *approveIfNeeded(senderAddress, contractAddress, requiredAmount, ntt) {
|
|
152
|
+
const tokenContract = sdk_evm_1.EvmPlatform.getTokenImplementation(this.provider, ntt.tokenAddress);
|
|
153
|
+
const allowance = await tokenContract.allowance(senderAddress, contractAddress);
|
|
154
|
+
if (allowance < requiredAmount) {
|
|
155
|
+
const txReq = await tokenContract.approve.populateTransaction(contractAddress, requiredAmount);
|
|
156
|
+
yield ntt.createUnsignedTx(txReq, "Ntt.Approve");
|
|
179
157
|
}
|
|
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
158
|
}
|
|
189
159
|
async estimateMsgValueAndGasLimit(recipient) {
|
|
190
160
|
const gasLimit = gasLimitOverrides[this.network]?.[this.chain] ?? 500000n;
|
|
@@ -193,10 +163,7 @@ class EvmNttWithExecutor {
|
|
|
193
163
|
}
|
|
194
164
|
exports.EvmNttWithExecutor = EvmNttWithExecutor;
|
|
195
165
|
/**
|
|
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
|
|
166
|
+
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination.
|
|
200
167
|
*/
|
|
201
168
|
function hasExecutorDeployed(network, chain) {
|
|
202
169
|
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":";;;AAuPA,kDAKC;AA5PD,4DAIuC;AAQvC,kFAAgF;AAChF,0DAKsC;AACtC,mCAA6C;AAG7C,kDAAkD;AAClD,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,IAAI,EAAE,4CAA4C;QAClD,UAAU,EAAE,4CAA4C;QACxD,QAAQ,EAAE,4CAA4C;QACtD,QAAQ,EAAE,4CAA4C;QACtD,GAAG,EAAE,4CAA4C;QACjD,KAAK,EAAE,4CAA4C;QACnD,OAAO,EAAE,4CAA4C;QACrD,IAAI,EAAE,4CAA4C;QAClD,IAAI,EAAE,4CAA4C;QAClD,KAAK,EAAE,4CAA4C;QACnD,QAAQ,EAAE,4CAA4C;QACtD,QAAQ,EAAE,4CAA4C;QACtD,KAAK,EAAE,4CAA4C;QACnD,OAAO,EAAE,4CAA4C;QACrD,MAAM,EAAE,4CAA4C;QACpD,KAAK,EAAE,4CAA4C;QACnD,QAAQ,EAAE,4CAA4C;QACtD,UAAU,EAAE,4CAA4C;QACxD,OAAO,EAAE,4CAA4C;QACrD,WAAW,EAAE,4CAA4C;KAC1D;IACD,OAAO,EAAE;QACP,eAAe,EAAE,4CAA4C;QAC7D,SAAS,EAAE,4CAA4C;QACvD,WAAW,EAAE,4CAA4C;QACzD,GAAG,EAAE,4CAA4C;QACjD,IAAI,EAAE,4CAA4C;QAClD,QAAQ,EAAE,4CAA4C;QACtD,GAAG,EAAE,4CAA4C;QACjD,KAAK,EAAE,4CAA4C;QACnD,I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AE,EACnD,UAAU,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,0BAA0B,CACxE,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,eAAe,CAC5B,aAAqB,EACrB,eAAuB,EACvB,cAAsB,EACtB,GAAiB;QAEjB,MAAM,aAAa,GAAG,qBAAW,CAAC,sBAAsB,CACtD,IAAI,CAAC,QAAQ,EACb,GAAG,CAAC,YAAY,CACjB,CAAC;QAEF,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,SAAS,CAC7C,aAAa,EACb,eAAe,CAChB,CAAC;QAEF,IAAI,SAAS,GAAG,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":["../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,CAAC,SAAS,EAAE,SAAS,GAAG;QAAE,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,CAAA;KAAE;IAPzD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;gBAGtB,OAAO,EAAE,CAAC,EACV,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,GAAG;QAAE,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,CAAA;KAAE;WAc5C,OAAO,CAAC,CAAC,SAAS,OAAO,EACpC,QAAQ,EAAE,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"}
|
|
@@ -2,6 +2,7 @@ import { nativeChainIds, toChainId, } from "@wormhole-foundation/sdk-base";
|
|
|
2
2
|
import { Ntt } from "@wormhole-foundation/sdk-definitions-ntt";
|
|
3
3
|
import { EvmPlatform, EvmAddress, } from "@wormhole-foundation/sdk-evm";
|
|
4
4
|
import { Interface } from "ethers";
|
|
5
|
+
// TODO: update with correct v2 contract addresses
|
|
5
6
|
const nttManagerWithExecutorAddresses = {
|
|
6
7
|
Mainnet: {
|
|
7
8
|
Arbitrum: "0x0Af42A597b0C201D4dcf450DcD0c06d55ddC1C77",
|
|
@@ -10,48 +11,46 @@ const nttManagerWithExecutorAddresses = {
|
|
|
10
11
|
Berachain: "0x0a2AF374Cc9CCCbB0Acc4E34B20b9d02a0f08c30",
|
|
11
12
|
Bsc: "0x39B57Dd9908F8be02CfeE283b67eA1303Bc29fe1",
|
|
12
13
|
Celo: "0x3d69869fcB9e1CD1F4020b637fb8256030BAc8fC",
|
|
14
|
+
CreditCoin: "0x5454b995719626256C96fb57454b044ffb3Da2F9",
|
|
13
15
|
Ethereum: "0xD2D9c936165a85F27a5a7e07aFb974D022B89463",
|
|
14
16
|
HyperEVM: "0x431017B1718b86898C7590fFcCC380DEf0456393",
|
|
15
17
|
Ink: "0x420370DC2ECC4D44b47514B7859fd11809BbeFF5",
|
|
16
18
|
Linea: "0xEAa5AddB5b8939Eb73F7faF46e193EefECaF13E9",
|
|
19
|
+
MegaETH: "0x3EFEc0c7Ee79135330DD03e995872f84b1AD49b6",
|
|
17
20
|
Mezo: "0x484b5593BbB90383f94FB299470F09427cf6cfE2",
|
|
21
|
+
Moca: "0xE612837749a0690BA2BCe490D6eFb5F8Fc347df3",
|
|
22
|
+
Monad: "0xc3F3dDa544815a440633176c7598f5B97500793e",
|
|
18
23
|
Moonbeam: "0x1365593C8bae71a55e48E105a2Bb76d5928c7DE3",
|
|
19
24
|
Optimism: "0x85C0129bE5226C9F0Cf4e419D2fefc1c3FCa25cF",
|
|
20
25
|
Plume: "0x6Eb53371f646788De6B4D0225a4Ed1d9267188AD",
|
|
21
26
|
Polygon: "0x6762157b73941e36cEd0AEf54614DdE545d0F990",
|
|
22
|
-
|
|
27
|
+
Seievm: "0x3F2D6441C7a59Dfe80f8e14142F9E28F6D440445",
|
|
23
28
|
Sonic: "0xaCa00703bb87F31D6F9fCcc963548b48FA46DfeB",
|
|
24
29
|
Unichain: "0x607723D6353Dae3ef62B7B277Cfabd0F4bc6CB4C",
|
|
25
30
|
Worldchain: "0x66b1644400D51e104272337226De3EF1A820eC79",
|
|
26
31
|
XRPLEVM: "0x6bBd1ff3bB303F88835A714EE3241bF45DE26d29",
|
|
27
|
-
Seievm: "0x3F2D6441C7a59Dfe80f8e14142F9E28F6D440445",
|
|
28
|
-
CreditCoin: "0x5454b995719626256C96fb57454b044ffb3Da2F9",
|
|
29
|
-
Monad: "0xc3F3dDa544815a440633176c7598f5B97500793e",
|
|
30
|
-
Moca: "0xE612837749a0690BA2BCe490D6eFb5F8Fc347df3",
|
|
31
|
-
MegaETH: "0x3EFEc0c7Ee79135330DD03e995872f84b1AD49b6",
|
|
32
32
|
ZeroGravity: "0xe175A8b838f3CdB2e1AAf4Ff74c05cF2F3AEA9a8",
|
|
33
33
|
},
|
|
34
34
|
Testnet: {
|
|
35
|
-
ArbitrumSepolia: "
|
|
36
|
-
Avalanche: "
|
|
37
|
-
BaseSepolia: "
|
|
38
|
-
Bsc: "
|
|
39
|
-
OptimismSepolia: "0xaDB1C56D363FF5A75260c3bd27dd7C1fC8421EF5",
|
|
40
|
-
Sepolia: "0x54DD7080aE169DD923fE56d0C4f814a0a17B8f41",
|
|
41
|
-
Ink: "0xF420BFFf922D11c2bBF587C9dF71b83651fAf8Bc",
|
|
42
|
-
Seievm: "0x3F2D6441C7a59Dfe80f8e14142F9E28F6D440445",
|
|
43
|
-
Converge: "0x3d8c26b67BDf630FBB44F09266aFA735F1129197",
|
|
44
|
-
Plume: "0x6Eb53371f646788De6B4D0225a4Ed1d9267188AD",
|
|
45
|
-
PolygonSepolia: "0x2982B9566E912458fE711FB1Fd78158264596937",
|
|
46
|
-
Monad: "0x93FE94Ad887a1B04DBFf1f736bfcD1698D4cfF66",
|
|
47
|
-
Linea: "0xaA469cb84C91D5a63bf4B370dE35f0831F2CE4FF",
|
|
35
|
+
ArbitrumSepolia: "0xD69CF144C31aE8C12b5C7c3D52411F32C824C9a3",
|
|
36
|
+
Avalanche: "0x8196EBa42b2947f519002B8aDa53b1880F580c69",
|
|
37
|
+
BaseSepolia: "0x9fBC8aA6B2f626D13005De92B3f0e4541919f721",
|
|
38
|
+
Bsc: "0x2c9F87bE2eb0caEB8AfFE6F7ae1f046E5D40Ff2a",
|
|
48
39
|
Celo: "0x3d69869fcB9e1CD1F4020b637fb8256030BAc8fC",
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
Converge: "0x3d8c26b67BDf630FBB44F09266aFA735F1129197",
|
|
41
|
+
Ink: "0x86B93560FeAbc95a0067a498d8afe1219f3ED0D7",
|
|
42
|
+
Linea: "0x5d98Ded0E46d0aEAB37EA4fEe45A38dc5ccee673",
|
|
43
|
+
Mezo: "0x117F5F5E8d29ED6254c6098457Cea28E3Ee7cDdA",
|
|
52
44
|
Moca: "0x47f26bF9253Eb398fBAf825D7565FE975D839a71",
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
Monad: "0x8BcA0315627DA3D2e5FA349a6A1ad2FAde36BCe5",
|
|
46
|
+
OptimismSepolia: "0xA8b1d0520D556b4Ea115562D35077cAA2f13C6D6",
|
|
47
|
+
Plume: "0x6D87C7d416dFf428117b560A981d788E39707195",
|
|
48
|
+
PolygonSepolia: "0x2982B9566E912458fE711FB1Fd78158264596937", // TODO: still v0.0.1, needs redeployment
|
|
49
|
+
Seievm: "0xdb66Dc163A03220661ca33B492c72a6a15B3a8cf",
|
|
50
|
+
Sepolia: "0xc2386453598811D88613331D52e2Ca4B2AEe16E4",
|
|
51
|
+
Unichain: "0xc41853C70bf70a2FFeE3ddd8f38D2b774Fe3E264",
|
|
52
|
+
XRPLEVM: "0x0fbDaE31440f5549e2F08193b5B034F2F9768304",
|
|
53
|
+
ZeroGravity: "0x69BeC29e71711B30F58585C0bb1622e7b47e3707",
|
|
55
54
|
},
|
|
56
55
|
};
|
|
57
56
|
// Gas limits must be high enough to cover the worst-case scenario for each chain
|
|
@@ -63,19 +62,17 @@ const gasLimitOverrides = {
|
|
|
63
62
|
CreditCoin: 1500000n,
|
|
64
63
|
Monad: 1000000n,
|
|
65
64
|
MegaETH: 1000000n,
|
|
65
|
+
Seievm: 1000000n,
|
|
66
66
|
},
|
|
67
67
|
Testnet: {
|
|
68
68
|
ArbitrumSepolia: 800000n,
|
|
69
|
+
Seievm: 1000000n,
|
|
69
70
|
},
|
|
70
71
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Mainnet: {
|
|
76
|
-
Monad: true,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
72
|
+
export const nttWithExecutorAbi = [
|
|
73
|
+
"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)",
|
|
74
|
+
"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)",
|
|
75
|
+
];
|
|
79
76
|
export class EvmNttWithExecutor {
|
|
80
77
|
network;
|
|
81
78
|
chain;
|
|
@@ -83,7 +80,6 @@ export class EvmNttWithExecutor {
|
|
|
83
80
|
contracts;
|
|
84
81
|
chainId;
|
|
85
82
|
executorAddress;
|
|
86
|
-
supportsTransferETH;
|
|
87
83
|
constructor(network, chain, provider, contracts) {
|
|
88
84
|
this.network = network;
|
|
89
85
|
this.chain = chain;
|
|
@@ -94,8 +90,6 @@ export class EvmNttWithExecutor {
|
|
|
94
90
|
if (!executorAddress)
|
|
95
91
|
throw new Error(`Executor address not found for chain ${this.chain}`);
|
|
96
92
|
this.executorAddress = executorAddress;
|
|
97
|
-
this.supportsTransferETH =
|
|
98
|
-
supportsTransferETH[this.network]?.[this.chain] ?? false;
|
|
99
93
|
}
|
|
100
94
|
static async fromRpc(provider, config) {
|
|
101
95
|
const [network, chain] = await EvmPlatform.chainFromRpc(provider);
|
|
@@ -106,81 +100,57 @@ export class EvmNttWithExecutor {
|
|
|
106
100
|
}
|
|
107
101
|
async *transfer(sender, destination, amount, quote, ntt, wrapNative = false) {
|
|
108
102
|
const senderAddress = new EvmAddress(sender).toString();
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
103
|
+
const deliveryPrice = await ntt.quoteDeliveryPrice(destination.chain, {
|
|
104
|
+
queue: false,
|
|
105
|
+
automatic: false,
|
|
106
|
+
});
|
|
107
|
+
// Fee is deducted from the transfer amount.
|
|
108
|
+
// Approval covers remainingAmount + transferTokenFee = the full user amount.
|
|
109
|
+
const totalAmount = quote.remainingAmount + quote.transferTokenFee;
|
|
110
|
+
const iface = new Interface(nttWithExecutorAbi);
|
|
111
|
+
const commonArgs = [
|
|
112
|
+
ntt.managerAddress,
|
|
113
|
+
quote.remainingAmount,
|
|
114
|
+
toChainId(destination.chain),
|
|
115
|
+
destination.address.toUniversalAddress().toUint8Array(),
|
|
116
|
+
sender.toUniversalAddress().toUint8Array(),
|
|
117
|
+
Ntt.encodeTransceiverInstructions(ntt.encodeOptions({ queue: false, automatic: false })),
|
|
118
|
+
{
|
|
119
|
+
value: quote.estimatedCost,
|
|
120
|
+
refundAddress: senderAddress,
|
|
121
|
+
signedQuote: quote.signedQuote,
|
|
122
|
+
instructions: quote.relayInstructions,
|
|
123
|
+
},
|
|
122
124
|
];
|
|
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
125
|
const feeArgs = {
|
|
138
|
-
|
|
126
|
+
transferTokenFee: quote.transferTokenFee,
|
|
127
|
+
nativeTokenFee: quote.nativeTokenFee,
|
|
139
128
|
payee: quote.referrer.address.toString(),
|
|
140
129
|
};
|
|
141
130
|
let data;
|
|
142
131
|
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;
|
|
132
|
+
if (wrapNative) {
|
|
133
|
+
data = iface.encodeFunctionData("transferETH", [...commonArgs, feeArgs]);
|
|
134
|
+
msgValue =
|
|
135
|
+
quote.estimatedCost +
|
|
136
|
+
deliveryPrice +
|
|
137
|
+
quote.nativeTokenFee +
|
|
138
|
+
totalAmount;
|
|
155
139
|
}
|
|
156
140
|
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;
|
|
141
|
+
yield* this.approveIfNeeded(senderAddress, this.executorAddress, totalAmount, ntt);
|
|
142
|
+
data = iface.encodeFunctionData("transfer", [...commonArgs, feeArgs]);
|
|
143
|
+
msgValue = quote.estimatedCost + deliveryPrice + quote.nativeTokenFee;
|
|
144
|
+
}
|
|
145
|
+
yield ntt.createUnsignedTx({ to: this.executorAddress, data, value: msgValue }, wrapNative ? "NttWithExecutor.transferETH" : "NttWithExecutor.transfer");
|
|
146
|
+
}
|
|
147
|
+
async *approveIfNeeded(senderAddress, contractAddress, requiredAmount, ntt) {
|
|
148
|
+
const tokenContract = EvmPlatform.getTokenImplementation(this.provider, ntt.tokenAddress);
|
|
149
|
+
const allowance = await tokenContract.allowance(senderAddress, contractAddress);
|
|
150
|
+
if (allowance < requiredAmount) {
|
|
151
|
+
const txReq = await tokenContract.approve.populateTransaction(contractAddress, requiredAmount);
|
|
152
|
+
yield ntt.createUnsignedTx(txReq, "Ntt.Approve");
|
|
175
153
|
}
|
|
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
154
|
}
|
|
185
155
|
async estimateMsgValueAndGasLimit(recipient) {
|
|
186
156
|
const gasLimit = gasLimitOverrides[this.network]?.[this.chain] ?? 500000n;
|
|
@@ -188,10 +158,7 @@ export class EvmNttWithExecutor {
|
|
|
188
158
|
}
|
|
189
159
|
}
|
|
190
160
|
/**
|
|
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
|
|
161
|
+
* Check if an executor (NttWithExecutor) is deployed for a given network and chain combination.
|
|
195
162
|
*/
|
|
196
163
|
export function hasExecutorDeployed(network, chain) {
|
|
197
164
|
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,IAAI,EAAE,4CAA4C;QAClD,QAAQ,EAAE,4CAA4C;QACtD,QAAQ,EAAE,4CAA4C;QACtD,GAAG,EAAE,4CAA4C;QACjD,KAAK,EAAE,4CAA4C;QACnD,
|
|
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,kDAAkD;AAClD,MAAM,+BAA+B,G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M,SAAS,GAAG,MAAM,aAAa,CAAC,SAAS,CAC7C,aAAa,EACb,eAAe,CAChB,CAAC;QAEF,IAAI,SAAS,GAAG,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;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAAgB,EAChB,KAAgB;IAEhB,OAAO,+BAA+B,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;AACzE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wormhole-foundation/sdk-evm-ntt",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "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.0",
|
|
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.19.0",
|
|
72
|
+
"@wormhole-foundation/sdk-definitions": "^4.19.0",
|
|
73
|
+
"@wormhole-foundation/sdk-evm": "^4.19.0",
|
|
74
|
+
"@wormhole-foundation/sdk-evm-core": "^4.19.0"
|
|
75
75
|
}
|
|
76
76
|
}
|