@m0-foundation/ntt-sdk-route 0.0.2 → 0.0.4
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.js +4 -0
- package/dist/index.mjs +5 -1
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -47,6 +47,10 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends sdkConnect.routes.Automa
|
|
|
47
47
|
];
|
|
48
48
|
}
|
|
49
49
|
static async supportedDestinationTokens(token, fromChain, toChain) {
|
|
50
|
+
const sourceTokens = await this.supportedSourceTokens(fromChain);
|
|
51
|
+
if (!sourceTokens.some((t) => sdkConnect.isSameToken(t, token))) {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
50
54
|
const { token: mToken, wrappedMToken } = this.getContracts(toChain.chain);
|
|
51
55
|
return [
|
|
52
56
|
sdkConnect.Wormhole.tokenId(toChain.chain, mToken),
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { routes, Wormhole, amount, finality, chainToPlatform, canonicalAddress, signSendWait, TransferState, universalAddress, toChainId, toUniversal, isSourceInitiated, isSourceFinalized, isAttested, isRedeemed } from '@wormhole-foundation/sdk-connect';
|
|
1
|
+
import { routes, Wormhole, isSameToken, amount, finality, chainToPlatform, canonicalAddress, signSendWait, TransferState, universalAddress, toChainId, toUniversal, isSourceInitiated, isSourceFinalized, isAttested, isRedeemed } from '@wormhole-foundation/sdk-connect';
|
|
2
2
|
import { Ntt } from '@wormhole-foundation/sdk-definitions-ntt';
|
|
3
3
|
import { EvmAddress, EvmPlatform, addFrom, EvmUnsignedTransaction, addChainId } from '@wormhole-foundation/sdk-evm';
|
|
4
4
|
import { NttRoute } from '@wormhole-foundation/sdk-route-ntt';
|
|
@@ -45,6 +45,10 @@ var _M0AutomaticRoute = class _M0AutomaticRoute extends routes.AutomaticRoute {
|
|
|
45
45
|
];
|
|
46
46
|
}
|
|
47
47
|
static async supportedDestinationTokens(token, fromChain, toChain) {
|
|
48
|
+
const sourceTokens = await this.supportedSourceTokens(fromChain);
|
|
49
|
+
if (!sourceTokens.some((t) => isSameToken(t, token))) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
48
52
|
const { token: mToken, wrappedMToken } = this.getContracts(toChain.chain);
|
|
49
53
|
return [
|
|
50
54
|
Wormhole.tokenId(toChain.chain, mToken),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m0-foundation/ntt-sdk-route",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
},
|
|
10
10
|
"./package.json": "./package.json"
|
|
11
11
|
},
|
|
12
|
+
"license": "Apache-2.0",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/m0-foundation/ntt-sdk-route.git"
|
|
16
|
+
},
|
|
12
17
|
"main": "./dist/index.js",
|
|
13
18
|
"module": "./dist/index.mjs",
|
|
14
19
|
"types": "./dist/index.d.ts",
|