@m0-foundation/ntt-sdk-route 0.0.30 → 0.1.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/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +23 -11
- package/dist/index.mjs +23 -12
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -12,6 +12,17 @@ type Vp = NttRoute.ValidatedParams;
|
|
|
12
12
|
type QR = routes.QuoteResult<Op, Vp>;
|
|
13
13
|
type Q = routes.Quote<Op, Vp>;
|
|
14
14
|
type R = NttRoute.AutomaticTransferReceipt;
|
|
15
|
+
/**
|
|
16
|
+
* Factory for M0AutomaticRoute. Calling this is the supported way to obtain
|
|
17
|
+
* the route constructor — it ensures NTT protocol implementations are
|
|
18
|
+
* registered with the Wormhole SDK before any route construction. Idempotent.
|
|
19
|
+
*
|
|
20
|
+
* Add the result to your Wormhole Connect routes config:
|
|
21
|
+
*
|
|
22
|
+
* import { m0AutomaticRoute } from "@m0-foundation/ntt-sdk-route";
|
|
23
|
+
* const config = { routes: [m0AutomaticRoute(), ...] };
|
|
24
|
+
*/
|
|
25
|
+
declare function m0AutomaticRoute(): routes.RouteConstructor;
|
|
15
26
|
declare class M0AutomaticRoute<N extends Network> extends routes.AutomaticRoute<N, Op, Vp, R> implements routes.StaticRouteMethods<typeof M0AutomaticRoute> {
|
|
16
27
|
static NATIVE_GAS_DROPOFF_SUPPORTED: boolean;
|
|
17
28
|
static EXECUTOR_ENTRYPOINT: string;
|
|
@@ -71,4 +82,4 @@ declare class SvmRouter {
|
|
|
71
82
|
static bytes32toHex(bytes: number[]): string;
|
|
72
83
|
}
|
|
73
84
|
|
|
74
|
-
export { M0AutomaticRoute, SvmRouter as SolanaRouter };
|
|
85
|
+
export { M0AutomaticRoute, SvmRouter as SolanaRouter, m0AutomaticRoute };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,17 @@ type Vp = NttRoute.ValidatedParams;
|
|
|
12
12
|
type QR = routes.QuoteResult<Op, Vp>;
|
|
13
13
|
type Q = routes.Quote<Op, Vp>;
|
|
14
14
|
type R = NttRoute.AutomaticTransferReceipt;
|
|
15
|
+
/**
|
|
16
|
+
* Factory for M0AutomaticRoute. Calling this is the supported way to obtain
|
|
17
|
+
* the route constructor — it ensures NTT protocol implementations are
|
|
18
|
+
* registered with the Wormhole SDK before any route construction. Idempotent.
|
|
19
|
+
*
|
|
20
|
+
* Add the result to your Wormhole Connect routes config:
|
|
21
|
+
*
|
|
22
|
+
* import { m0AutomaticRoute } from "@m0-foundation/ntt-sdk-route";
|
|
23
|
+
* const config = { routes: [m0AutomaticRoute(), ...] };
|
|
24
|
+
*/
|
|
25
|
+
declare function m0AutomaticRoute(): routes.RouteConstructor;
|
|
15
26
|
declare class M0AutomaticRoute<N extends Network> extends routes.AutomaticRoute<N, Op, Vp, R> implements routes.StaticRouteMethods<typeof M0AutomaticRoute> {
|
|
16
27
|
static NATIVE_GAS_DROPOFF_SUPPORTED: boolean;
|
|
17
28
|
static EXECUTOR_ENTRYPOINT: string;
|
|
@@ -71,4 +82,4 @@ declare class SvmRouter {
|
|
|
71
82
|
static bytes32toHex(bytes: number[]): string;
|
|
72
83
|
}
|
|
73
84
|
|
|
74
|
-
export { M0AutomaticRoute, SvmRouter as SolanaRouter };
|
|
85
|
+
export { M0AutomaticRoute, SvmRouter as SolanaRouter, m0AutomaticRoute };
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,11 @@ var BN__default = /*#__PURE__*/_interopDefault(BN);
|
|
|
20
20
|
// src/m0AutomaticRoute.ts
|
|
21
21
|
function getExecutorConfig(network = "Mainnet") {
|
|
22
22
|
const svmChains = ["Solana"];
|
|
23
|
-
const evmChains = network === "Mainnet" ? ["Ethereum", "Arbitrum", "Base"] : ["Sepolia", "ArbitrumSepolia", "BaseSepolia"];
|
|
23
|
+
const evmChains = network === "Mainnet" ? ["Ethereum", "Arbitrum", "Base", "Moca"] : ["Sepolia", "ArbitrumSepolia", "BaseSepolia"];
|
|
24
|
+
const evmMToken = "0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b";
|
|
25
|
+
const evmOverrides = Object.fromEntries(
|
|
26
|
+
evmChains.map((chain) => [chain, { [evmMToken]: { gasLimit: 600000n } }])
|
|
27
|
+
);
|
|
24
28
|
return {
|
|
25
29
|
ntt: {
|
|
26
30
|
tokens: {
|
|
@@ -39,7 +43,7 @@ function getExecutorConfig(network = "Mainnet") {
|
|
|
39
43
|
})),
|
|
40
44
|
...evmChains.map((chain) => ({
|
|
41
45
|
chain,
|
|
42
|
-
token:
|
|
46
|
+
token: evmMToken,
|
|
43
47
|
manager: "0xaCffEC28C4eEe21C889a4e6C0704c540Ed9D4fDd",
|
|
44
48
|
transceiver: [
|
|
45
49
|
{
|
|
@@ -60,11 +64,7 @@ function getExecutorConfig(network = "Mainnet") {
|
|
|
60
64
|
gasLimit: 450000n
|
|
61
65
|
}
|
|
62
66
|
},
|
|
63
|
-
|
|
64
|
-
["0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b"]: {
|
|
65
|
-
gasLimit: 600000n
|
|
66
|
-
}
|
|
67
|
-
}
|
|
67
|
+
...evmOverrides
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
};
|
|
@@ -8190,6 +8190,7 @@ function getM0ChainId(chain, network) {
|
|
|
8190
8190
|
Plume: 98866,
|
|
8191
8191
|
Polygon: 137,
|
|
8192
8192
|
Sei: 1329,
|
|
8193
|
+
Moca: 2288,
|
|
8193
8194
|
// Testnets
|
|
8194
8195
|
ArbitrumSepolia: 421614,
|
|
8195
8196
|
BaseSepolia: 84532,
|
|
@@ -8536,6 +8537,18 @@ _EvmRouter.PORTAL_ADDRESS = "0xD925C84b55E4e44a53749fF5F2a5A13F63D128fd";
|
|
|
8536
8537
|
var EvmRouter = _EvmRouter;
|
|
8537
8538
|
|
|
8538
8539
|
// src/m0AutomaticRoute.ts
|
|
8540
|
+
var registered = false;
|
|
8541
|
+
function ensureM0Registered() {
|
|
8542
|
+
if (registered) return;
|
|
8543
|
+
registered = true;
|
|
8544
|
+
sdkDefinitionsNtt.register();
|
|
8545
|
+
sdkEvmNtt.register();
|
|
8546
|
+
sdkSolanaNtt.register();
|
|
8547
|
+
}
|
|
8548
|
+
function m0AutomaticRoute() {
|
|
8549
|
+
ensureM0Registered();
|
|
8550
|
+
return M0AutomaticRoute;
|
|
8551
|
+
}
|
|
8539
8552
|
var _M0AutomaticRoute = class _M0AutomaticRoute extends sdkConnect.routes.AutomaticRoute {
|
|
8540
8553
|
static supportedNetworks() {
|
|
8541
8554
|
return ["Mainnet", "Testnet"];
|
|
@@ -8546,7 +8559,7 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends sdkConnect.routes.Automa
|
|
|
8546
8559
|
static supportedChains(network) {
|
|
8547
8560
|
switch (network) {
|
|
8548
8561
|
case "Mainnet":
|
|
8549
|
-
return ["Ethereum", "Arbitrum", "Base", "Solana"];
|
|
8562
|
+
return ["Ethereum", "Arbitrum", "Base", "Moca", "Solana"];
|
|
8550
8563
|
case "Testnet":
|
|
8551
8564
|
return [
|
|
8552
8565
|
"Sepolia",
|
|
@@ -8563,6 +8576,7 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends sdkConnect.routes.Automa
|
|
|
8563
8576
|
case "Ethereum":
|
|
8564
8577
|
case "Arbitrum":
|
|
8565
8578
|
case "Base":
|
|
8579
|
+
case "Moca":
|
|
8566
8580
|
case "Sepolia":
|
|
8567
8581
|
case "ArbitrumSepolia":
|
|
8568
8582
|
case "BaseSepolia":
|
|
@@ -8891,9 +8905,6 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends sdkConnect.routes.Automa
|
|
|
8891
8905
|
);
|
|
8892
8906
|
}
|
|
8893
8907
|
};
|
|
8894
|
-
sdkDefinitionsNtt.register();
|
|
8895
|
-
sdkEvmNtt.register();
|
|
8896
|
-
sdkSolanaNtt.register();
|
|
8897
8908
|
_M0AutomaticRoute.NATIVE_GAS_DROPOFF_SUPPORTED = false;
|
|
8898
8909
|
_M0AutomaticRoute.EXECUTOR_ENTRYPOINT = "0x22f04a6cd935bfa3b4d000a4e3d4079adb148198";
|
|
8899
8910
|
_M0AutomaticRoute.meta = { name: "M0AutomaticRoute", provider: "M0" };
|
|
@@ -8901,3 +8912,4 @@ var M0AutomaticRoute = _M0AutomaticRoute;
|
|
|
8901
8912
|
|
|
8902
8913
|
exports.M0AutomaticRoute = M0AutomaticRoute;
|
|
8903
8914
|
exports.SolanaRouter = SvmRouter;
|
|
8915
|
+
exports.m0AutomaticRoute = m0AutomaticRoute;
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,11 @@ import BN from 'bn.js';
|
|
|
14
14
|
// src/m0AutomaticRoute.ts
|
|
15
15
|
function getExecutorConfig(network = "Mainnet") {
|
|
16
16
|
const svmChains = ["Solana"];
|
|
17
|
-
const evmChains = network === "Mainnet" ? ["Ethereum", "Arbitrum", "Base"] : ["Sepolia", "ArbitrumSepolia", "BaseSepolia"];
|
|
17
|
+
const evmChains = network === "Mainnet" ? ["Ethereum", "Arbitrum", "Base", "Moca"] : ["Sepolia", "ArbitrumSepolia", "BaseSepolia"];
|
|
18
|
+
const evmMToken = "0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b";
|
|
19
|
+
const evmOverrides = Object.fromEntries(
|
|
20
|
+
evmChains.map((chain) => [chain, { [evmMToken]: { gasLimit: 600000n } }])
|
|
21
|
+
);
|
|
18
22
|
return {
|
|
19
23
|
ntt: {
|
|
20
24
|
tokens: {
|
|
@@ -33,7 +37,7 @@ function getExecutorConfig(network = "Mainnet") {
|
|
|
33
37
|
})),
|
|
34
38
|
...evmChains.map((chain) => ({
|
|
35
39
|
chain,
|
|
36
|
-
token:
|
|
40
|
+
token: evmMToken,
|
|
37
41
|
manager: "0xaCffEC28C4eEe21C889a4e6C0704c540Ed9D4fDd",
|
|
38
42
|
transceiver: [
|
|
39
43
|
{
|
|
@@ -54,11 +58,7 @@ function getExecutorConfig(network = "Mainnet") {
|
|
|
54
58
|
gasLimit: 450000n
|
|
55
59
|
}
|
|
56
60
|
},
|
|
57
|
-
|
|
58
|
-
["0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b"]: {
|
|
59
|
-
gasLimit: 600000n
|
|
60
|
-
}
|
|
61
|
-
}
|
|
61
|
+
...evmOverrides
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
};
|
|
@@ -8184,6 +8184,7 @@ function getM0ChainId(chain, network) {
|
|
|
8184
8184
|
Plume: 98866,
|
|
8185
8185
|
Polygon: 137,
|
|
8186
8186
|
Sei: 1329,
|
|
8187
|
+
Moca: 2288,
|
|
8187
8188
|
// Testnets
|
|
8188
8189
|
ArbitrumSepolia: 421614,
|
|
8189
8190
|
BaseSepolia: 84532,
|
|
@@ -8530,6 +8531,18 @@ _EvmRouter.PORTAL_ADDRESS = "0xD925C84b55E4e44a53749fF5F2a5A13F63D128fd";
|
|
|
8530
8531
|
var EvmRouter = _EvmRouter;
|
|
8531
8532
|
|
|
8532
8533
|
// src/m0AutomaticRoute.ts
|
|
8534
|
+
var registered = false;
|
|
8535
|
+
function ensureM0Registered() {
|
|
8536
|
+
if (registered) return;
|
|
8537
|
+
registered = true;
|
|
8538
|
+
register();
|
|
8539
|
+
register$1();
|
|
8540
|
+
register$2();
|
|
8541
|
+
}
|
|
8542
|
+
function m0AutomaticRoute() {
|
|
8543
|
+
ensureM0Registered();
|
|
8544
|
+
return M0AutomaticRoute;
|
|
8545
|
+
}
|
|
8533
8546
|
var _M0AutomaticRoute = class _M0AutomaticRoute extends routes.AutomaticRoute {
|
|
8534
8547
|
static supportedNetworks() {
|
|
8535
8548
|
return ["Mainnet", "Testnet"];
|
|
@@ -8540,7 +8553,7 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes.AutomaticRoute {
|
|
|
8540
8553
|
static supportedChains(network) {
|
|
8541
8554
|
switch (network) {
|
|
8542
8555
|
case "Mainnet":
|
|
8543
|
-
return ["Ethereum", "Arbitrum", "Base", "Solana"];
|
|
8556
|
+
return ["Ethereum", "Arbitrum", "Base", "Moca", "Solana"];
|
|
8544
8557
|
case "Testnet":
|
|
8545
8558
|
return [
|
|
8546
8559
|
"Sepolia",
|
|
@@ -8557,6 +8570,7 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes.AutomaticRoute {
|
|
|
8557
8570
|
case "Ethereum":
|
|
8558
8571
|
case "Arbitrum":
|
|
8559
8572
|
case "Base":
|
|
8573
|
+
case "Moca":
|
|
8560
8574
|
case "Sepolia":
|
|
8561
8575
|
case "ArbitrumSepolia":
|
|
8562
8576
|
case "BaseSepolia":
|
|
@@ -8885,12 +8899,9 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes.AutomaticRoute {
|
|
|
8885
8899
|
);
|
|
8886
8900
|
}
|
|
8887
8901
|
};
|
|
8888
|
-
register();
|
|
8889
|
-
register$1();
|
|
8890
|
-
register$2();
|
|
8891
8902
|
_M0AutomaticRoute.NATIVE_GAS_DROPOFF_SUPPORTED = false;
|
|
8892
8903
|
_M0AutomaticRoute.EXECUTOR_ENTRYPOINT = "0x22f04a6cd935bfa3b4d000a4e3d4079adb148198";
|
|
8893
8904
|
_M0AutomaticRoute.meta = { name: "M0AutomaticRoute", provider: "M0" };
|
|
8894
8905
|
var M0AutomaticRoute = _M0AutomaticRoute;
|
|
8895
8906
|
|
|
8896
|
-
export { M0AutomaticRoute, SvmRouter as SolanaRouter };
|
|
8907
|
+
export { M0AutomaticRoute, SvmRouter as SolanaRouter, m0AutomaticRoute };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m0-foundation/ntt-sdk-route",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"@noble/hashes": "^1.8.0",
|
|
37
37
|
"@solana/spl-token": "^0.4.14",
|
|
38
38
|
"@solana/web3.js": "^1.95.8",
|
|
39
|
-
"@wormhole-foundation/sdk": "4.
|
|
40
|
-
"@wormhole-foundation/sdk-connect": "4.
|
|
41
|
-
"@wormhole-foundation/sdk-definitions-ntt": "
|
|
42
|
-
"@wormhole-foundation/sdk-evm": "4.
|
|
43
|
-
"@wormhole-foundation/sdk-evm-ntt": "
|
|
44
|
-
"@wormhole-foundation/sdk-route-ntt": "
|
|
45
|
-
"@wormhole-foundation/sdk-solana": "4.
|
|
46
|
-
"@wormhole-foundation/sdk-solana-ntt": "
|
|
39
|
+
"@wormhole-foundation/sdk": "4.18.0",
|
|
40
|
+
"@wormhole-foundation/sdk-connect": "4.18.0",
|
|
41
|
+
"@wormhole-foundation/sdk-definitions-ntt": "5.0.2",
|
|
42
|
+
"@wormhole-foundation/sdk-evm": "4.18.0",
|
|
43
|
+
"@wormhole-foundation/sdk-evm-ntt": "5.0.2",
|
|
44
|
+
"@wormhole-foundation/sdk-route-ntt": "5.0.2",
|
|
45
|
+
"@wormhole-foundation/sdk-solana": "4.18.0",
|
|
46
|
+
"@wormhole-foundation/sdk-solana-ntt": "5.0.2",
|
|
47
47
|
"bn.js": "^5.2.2",
|
|
48
48
|
"ethers": "^6.16.0"
|
|
49
49
|
},
|