@m0-foundation/ntt-sdk-route 0.1.0 → 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 CHANGED
@@ -1,5 +1,4 @@
1
- import { Network, Chain, ChainContext, TokenId, Signer, ChainAddress, AccountAddress } from '@wormhole-foundation/sdk-connect';
2
- import * as routes from '@wormhole-foundation/sdk-connect/routes';
1
+ import { Network, routes, Chain, ChainContext, TokenId, Signer, ChainAddress, AccountAddress } from '@wormhole-foundation/sdk-connect';
3
2
  import { EvmChains, EvmUnsignedTransaction } from '@wormhole-foundation/sdk-evm';
4
3
  import { SolanaChains, SolanaUnsignedTransaction } from '@wormhole-foundation/sdk-solana';
5
4
  import { NttRoute } from '@wormhole-foundation/sdk-route-ntt';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { Network, Chain, ChainContext, TokenId, Signer, ChainAddress, AccountAddress } from '@wormhole-foundation/sdk-connect';
2
- import * as routes from '@wormhole-foundation/sdk-connect/routes';
1
+ import { Network, routes, Chain, ChainContext, TokenId, Signer, ChainAddress, AccountAddress } from '@wormhole-foundation/sdk-connect';
3
2
  import { EvmChains, EvmUnsignedTransaction } from '@wormhole-foundation/sdk-evm';
4
3
  import { SolanaChains, SolanaUnsignedTransaction } from '@wormhole-foundation/sdk-solana';
5
4
  import { NttRoute } from '@wormhole-foundation/sdk-route-ntt';
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var sdkConnect = require('@wormhole-foundation/sdk-connect');
4
- var routes = require('@wormhole-foundation/sdk-connect/routes');
5
4
  var sdkDefinitionsNtt = require('@wormhole-foundation/sdk-definitions-ntt');
6
5
  var sdkEvmNtt = require('@wormhole-foundation/sdk-evm-ntt');
7
6
  var sdkSolanaNtt = require('@wormhole-foundation/sdk-solana-ntt');
@@ -16,31 +15,16 @@ var BN = require('bn.js');
16
15
 
17
16
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
18
17
 
19
- function _interopNamespace(e) {
20
- if (e && e.__esModule) return e;
21
- var n = Object.create(null);
22
- if (e) {
23
- Object.keys(e).forEach(function (k) {
24
- if (k !== 'default') {
25
- var d = Object.getOwnPropertyDescriptor(e, k);
26
- Object.defineProperty(n, k, d.get ? d : {
27
- enumerable: true,
28
- get: function () { return e[k]; }
29
- });
30
- }
31
- });
32
- }
33
- n.default = e;
34
- return Object.freeze(n);
35
- }
36
-
37
- var routes__namespace = /*#__PURE__*/_interopNamespace(routes);
38
18
  var BN__default = /*#__PURE__*/_interopDefault(BN);
39
19
 
40
20
  // src/m0AutomaticRoute.ts
41
21
  function getExecutorConfig(network = "Mainnet") {
42
22
  const svmChains = ["Solana"];
43
- 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
+ );
44
28
  return {
45
29
  ntt: {
46
30
  tokens: {
@@ -59,7 +43,7 @@ function getExecutorConfig(network = "Mainnet") {
59
43
  })),
60
44
  ...evmChains.map((chain) => ({
61
45
  chain,
62
- token: "0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b",
46
+ token: evmMToken,
63
47
  manager: "0xaCffEC28C4eEe21C889a4e6C0704c540Ed9D4fDd",
64
48
  transceiver: [
65
49
  {
@@ -80,11 +64,7 @@ function getExecutorConfig(network = "Mainnet") {
80
64
  gasLimit: 450000n
81
65
  }
82
66
  },
83
- Ethereum: {
84
- ["0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b"]: {
85
- gasLimit: 600000n
86
- }
87
- }
67
+ ...evmOverrides
88
68
  }
89
69
  }
90
70
  };
@@ -8210,6 +8190,7 @@ function getM0ChainId(chain, network) {
8210
8190
  Plume: 98866,
8211
8191
  Polygon: 137,
8212
8192
  Sei: 1329,
8193
+ Moca: 2288,
8213
8194
  // Testnets
8214
8195
  ArbitrumSepolia: 421614,
8215
8196
  BaseSepolia: 84532,
@@ -8568,7 +8549,7 @@ function m0AutomaticRoute() {
8568
8549
  ensureM0Registered();
8569
8550
  return M0AutomaticRoute;
8570
8551
  }
8571
- var _M0AutomaticRoute = class _M0AutomaticRoute extends routes__namespace.AutomaticRoute {
8552
+ var _M0AutomaticRoute = class _M0AutomaticRoute extends sdkConnect.routes.AutomaticRoute {
8572
8553
  static supportedNetworks() {
8573
8554
  return ["Mainnet", "Testnet"];
8574
8555
  }
@@ -8578,7 +8559,7 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes__namespace.Automa
8578
8559
  static supportedChains(network) {
8579
8560
  switch (network) {
8580
8561
  case "Mainnet":
8581
- return ["Ethereum", "Arbitrum", "Base", "Solana"];
8562
+ return ["Ethereum", "Arbitrum", "Base", "Moca", "Solana"];
8582
8563
  case "Testnet":
8583
8564
  return [
8584
8565
  "Sepolia",
@@ -8595,6 +8576,7 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes__namespace.Automa
8595
8576
  case "Ethereum":
8596
8577
  case "Arbitrum":
8597
8578
  case "Base":
8579
+ case "Moca":
8598
8580
  case "Sepolia":
8599
8581
  case "ArbitrumSepolia":
8600
8582
  case "BaseSepolia":
@@ -8904,7 +8886,7 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes__namespace.Automa
8904
8886
  return "mzerojk9tg56ebsrEAhfkyc9VgKjTW2zDqp6C5mhjzH";
8905
8887
  return "0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b";
8906
8888
  };
8907
- const transferRequest = await routes__namespace.RouteTransferRequest.create(this.wh, {
8889
+ const transferRequest = await sdkConnect.routes.RouteTransferRequest.create(this.wh, {
8908
8890
  source: sdkConnect.Wormhole.tokenId(sourceChain, resolveM(sourceChain)),
8909
8891
  destination: sdkConnect.Wormhole.tokenId(
8910
8892
  destinationChain,
package/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
- import { chainToPlatform, amount, finality, Wormhole, canonicalAddress, signSendWait, TransferState, isSourceInitiated, isSourceFinalized, isAttested, isRedeemed, toNative, chainToChainId, sha256 } from '@wormhole-foundation/sdk-connect';
2
- import * as routes from '@wormhole-foundation/sdk-connect/routes';
1
+ import { routes, chainToPlatform, amount, finality, Wormhole, canonicalAddress, signSendWait, TransferState, isSourceInitiated, isSourceFinalized, isAttested, isRedeemed, toNative, chainToChainId, sha256 } from '@wormhole-foundation/sdk-connect';
3
2
  import { Ntt, register } from '@wormhole-foundation/sdk-definitions-ntt';
4
3
  import { register as register$1 } from '@wormhole-foundation/sdk-evm-ntt';
5
4
  import { register as register$2 } from '@wormhole-foundation/sdk-solana-ntt';
@@ -15,7 +14,11 @@ import BN from 'bn.js';
15
14
  // src/m0AutomaticRoute.ts
16
15
  function getExecutorConfig(network = "Mainnet") {
17
16
  const svmChains = ["Solana"];
18
- 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
+ );
19
22
  return {
20
23
  ntt: {
21
24
  tokens: {
@@ -34,7 +37,7 @@ function getExecutorConfig(network = "Mainnet") {
34
37
  })),
35
38
  ...evmChains.map((chain) => ({
36
39
  chain,
37
- token: "0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b",
40
+ token: evmMToken,
38
41
  manager: "0xaCffEC28C4eEe21C889a4e6C0704c540Ed9D4fDd",
39
42
  transceiver: [
40
43
  {
@@ -55,11 +58,7 @@ function getExecutorConfig(network = "Mainnet") {
55
58
  gasLimit: 450000n
56
59
  }
57
60
  },
58
- Ethereum: {
59
- ["0x866A2BF4E572CbcF37D5071A7a58503Bfb36be1b"]: {
60
- gasLimit: 600000n
61
- }
62
- }
61
+ ...evmOverrides
63
62
  }
64
63
  }
65
64
  };
@@ -8185,6 +8184,7 @@ function getM0ChainId(chain, network) {
8185
8184
  Plume: 98866,
8186
8185
  Polygon: 137,
8187
8186
  Sei: 1329,
8187
+ Moca: 2288,
8188
8188
  // Testnets
8189
8189
  ArbitrumSepolia: 421614,
8190
8190
  BaseSepolia: 84532,
@@ -8553,7 +8553,7 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes.AutomaticRoute {
8553
8553
  static supportedChains(network) {
8554
8554
  switch (network) {
8555
8555
  case "Mainnet":
8556
- return ["Ethereum", "Arbitrum", "Base", "Solana"];
8556
+ return ["Ethereum", "Arbitrum", "Base", "Moca", "Solana"];
8557
8557
  case "Testnet":
8558
8558
  return [
8559
8559
  "Sepolia",
@@ -8570,6 +8570,7 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes.AutomaticRoute {
8570
8570
  case "Ethereum":
8571
8571
  case "Arbitrum":
8572
8572
  case "Base":
8573
+ case "Moca":
8573
8574
  case "Sepolia":
8574
8575
  case "ArbitrumSepolia":
8575
8576
  case "BaseSepolia":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m0-foundation/ntt-sdk-route",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",