@shapeshiftoss/swapper 20.5.0 → 20.6.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/.tsbuildinfo +1 -1
- package/dist/cjs/swappers/KyberSwapper/utils/constants.d.ts +1 -0
- package/dist/cjs/swappers/KyberSwapper/utils/constants.js +1 -0
- package/dist/cjs/swappers/RelaySwapper/constant.js +1 -0
- package/dist/cjs/swappers/RelaySwapper/utils/relayTokenToAssetId.js +5 -0
- package/dist/cjs/swappers/ThorchainSwapper/generated/generatedThorLongtailTokens.json +1 -0
- package/dist/cjs/swappers/ZrxSwapper/types.d.ts +1 -1
- package/dist/cjs/swappers/ZrxSwapper/types.js +1 -0
- package/dist/cjs/swappers/ZrxSwapper/utils/constants.js +1 -0
- package/dist/cjs/swappers/ZrxSwapper/utils/helpers.d.ts +1 -1
- package/dist/cjs/swappers/ZrxSwapper/utils/helpers.js +5 -0
- package/dist/cjs/utils/helpers.js +1 -0
- package/dist/cjs/utils/helpers.test.js +1 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/swappers/KyberSwapper/utils/constants.d.ts +1 -0
- package/dist/esm/swappers/KyberSwapper/utils/constants.js +1 -0
- package/dist/esm/swappers/RelaySwapper/constant.js +2 -1
- package/dist/esm/swappers/RelaySwapper/utils/relayTokenToAssetId.js +5 -0
- package/dist/esm/swappers/ThorchainSwapper/generated/generatedThorLongtailTokens.json +1 -0
- package/dist/esm/swappers/ZrxSwapper/types.d.ts +1 -1
- package/dist/esm/swappers/ZrxSwapper/types.js +1 -0
- package/dist/esm/swappers/ZrxSwapper/utils/constants.js +1 -0
- package/dist/esm/swappers/ZrxSwapper/utils/helpers.d.ts +1 -1
- package/dist/esm/swappers/ZrxSwapper/utils/helpers.js +5 -0
- package/dist/esm/utils/helpers.js +2 -1
- package/dist/esm/utils/helpers.test.js +1 -0
- package/package.json +7 -7
|
@@ -15,6 +15,7 @@ export declare const KYBER_CHAINS: {
|
|
|
15
15
|
readonly "eip155:999": "hyperevm";
|
|
16
16
|
readonly "eip155:4326": "megaeth";
|
|
17
17
|
readonly "eip155:9745": "plasma";
|
|
18
|
+
readonly "eip155:99901": "elysium";
|
|
18
19
|
};
|
|
19
20
|
export type KyberSupportedChainId = keyof typeof KYBER_CHAINS;
|
|
20
21
|
export declare const KYBER_ROUTER_ADDRESS: Address;
|
|
@@ -18,6 +18,7 @@ exports.KYBER_CHAINS = {
|
|
|
18
18
|
[types_1.KnownChainIds.HyperEvmMainnet]: 'hyperevm',
|
|
19
19
|
[types_1.KnownChainIds.MegaEthMainnet]: 'megaeth',
|
|
20
20
|
[types_1.KnownChainIds.PlasmaMainnet]: 'plasma',
|
|
21
|
+
[types_1.KnownChainIds.ElysiumMainnet]: 'elysium',
|
|
21
22
|
};
|
|
22
23
|
// MetaAggregationRouterV2, same address on every chain: https://docs.kyberswap.com/developer-guide/aggregator-api/contracts
|
|
23
24
|
exports.KYBER_ROUTER_ADDRESS = '0x6131B5fae19EA4f9D964eAc0408E4408b66337b5';
|
|
@@ -51,6 +51,7 @@ exports.chainIdToRelayChainId = {
|
|
|
51
51
|
[caip_1.seiChainId]: chains_1.sei.id,
|
|
52
52
|
[caip_1.abstractChainId]: chains_1.abstract.id,
|
|
53
53
|
[caip_1.robinhoodChainId]: chains_1.robinhood.id,
|
|
54
|
+
[caip_1.elysiumChainId]: 99901,
|
|
54
55
|
};
|
|
55
56
|
var RelayStatusMessage;
|
|
56
57
|
(function (RelayStatusMessage) {
|
|
@@ -237,6 +237,11 @@ const relayTokenToAssetId = (relayToken) => {
|
|
|
237
237
|
assetReference: caip_1.ASSET_REFERENCE.Robinhood,
|
|
238
238
|
assetNamespace: caip_1.ASSET_NAMESPACE.slip44,
|
|
239
239
|
};
|
|
240
|
+
case caip_1.CHAIN_REFERENCE.ElysiumMainnet:
|
|
241
|
+
return {
|
|
242
|
+
assetReference: caip_1.ASSET_REFERENCE.Elysium,
|
|
243
|
+
assetNamespace: caip_1.ASSET_NAMESPACE.slip44,
|
|
244
|
+
};
|
|
240
245
|
default:
|
|
241
246
|
throw Error(`chainId '${relayToken.chainId}' not supported`);
|
|
242
247
|
}
|
|
@@ -1018,6 +1018,7 @@
|
|
|
1018
1018
|
"eip155:1/erc20:0xcbb8f1bda10b9696c57e13bc128fe674769dcec0",
|
|
1019
1019
|
"eip155:1/erc20:0x72dfb2e44f59c5ad2bafe84314e5b99a7cd5075e",
|
|
1020
1020
|
"eip155:1/erc20:0xce682c89c63d2850cb2ca898e44d6c7c30d897a6",
|
|
1021
|
+
"eip155:1/erc20:0x68749665ff8d2d112fa859aa293f07a622782f38",
|
|
1021
1022
|
"eip155:43114/erc20:0xc891eb4cbdeff6e073e859e987815ed1505c2acd",
|
|
1022
1023
|
"eip155:43114/erc20:0xd24c2ad096400b6fbcd2ad8b24e7acbc21a1da64",
|
|
1023
1024
|
"eip155:43114/erc20:0x47c3118ad183712acd42648e9e522e13690f29a0",
|
|
@@ -4,7 +4,7 @@ import type { Address } from 'viem';
|
|
|
4
4
|
import type { GetEvmTradeQuoteInput, GetEvmTradeRateInput } from '../../types';
|
|
5
5
|
export type ZrxTradeQuoteInput = GetEvmTradeQuoteInput;
|
|
6
6
|
export type ZrxTradeRateInput = GetEvmTradeRateInput;
|
|
7
|
-
export declare const zrxSupportedChainIds: readonly [KnownChainIds.EthereumMainnet, KnownChainIds.AvalancheMainnet, KnownChainIds.OptimismMainnet, KnownChainIds.BnbSmartChainMainnet, KnownChainIds.PolygonMainnet, KnownChainIds.ArbitrumMainnet, KnownChainIds.BaseMainnet, KnownChainIds.RobinhoodMainnet];
|
|
7
|
+
export declare const zrxSupportedChainIds: readonly [KnownChainIds.EthereumMainnet, KnownChainIds.AvalancheMainnet, KnownChainIds.OptimismMainnet, KnownChainIds.BnbSmartChainMainnet, KnownChainIds.PolygonMainnet, KnownChainIds.ArbitrumMainnet, KnownChainIds.BaseMainnet, KnownChainIds.RobinhoodMainnet, KnownChainIds.ElysiumMainnet];
|
|
8
8
|
export type ZrxSupportedChainId = (typeof zrxSupportedChainIds)[number];
|
|
9
9
|
type ZrxFee = {
|
|
10
10
|
amount: string;
|
|
@@ -22,6 +22,7 @@ exports.ZRX_SUPPORTED_CHAINIDS = Object.freeze([
|
|
|
22
22
|
types_1.KnownChainIds.ArbitrumMainnet,
|
|
23
23
|
types_1.KnownChainIds.BaseMainnet,
|
|
24
24
|
types_1.KnownChainIds.RobinhoodMainnet,
|
|
25
|
+
types_1.KnownChainIds.ElysiumMainnet,
|
|
25
26
|
]);
|
|
26
27
|
// https://0x.org/docs/developer-resources/faqs-and-troubleshooting
|
|
27
28
|
exports.ZRX_NATIVE_ASSET_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
|
|
@@ -6,7 +6,7 @@ import type { SwapErrorRight } from '../../../types';
|
|
|
6
6
|
import type { ZrxFees, ZrxPriceResponse } from '../types';
|
|
7
7
|
export declare const assetIdToZrxToken: (assetId: AssetId) => string;
|
|
8
8
|
export declare const zrxTokenToAssetId: (token: string, chainId: ChainId) => AssetId;
|
|
9
|
-
export declare const isSupportedChainId: (chainId: ChainId) => chainId is KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.BaseMainnet | KnownChainIds.RobinhoodMainnet;
|
|
9
|
+
export declare const isSupportedChainId: (chainId: ChainId) => chainId is KnownChainIds.EthereumMainnet | KnownChainIds.AvalancheMainnet | KnownChainIds.OptimismMainnet | KnownChainIds.BnbSmartChainMainnet | KnownChainIds.PolygonMainnet | KnownChainIds.ArbitrumMainnet | KnownChainIds.BaseMainnet | KnownChainIds.RobinhoodMainnet | KnownChainIds.ElysiumMainnet;
|
|
10
10
|
export declare const isWrappedNativeSell: (route: ZrxPriceResponse['route']) => boolean;
|
|
11
11
|
export declare const assertValidTrade: ({ buyAsset, sellAsset, }: {
|
|
12
12
|
buyAsset: Asset;
|
|
@@ -65,6 +65,11 @@ const zrxTokenToAssetId = (token, chainId) => {
|
|
|
65
65
|
assetReference: caip_1.ASSET_REFERENCE.Robinhood,
|
|
66
66
|
assetNamespace: caip_1.ASSET_NAMESPACE.slip44,
|
|
67
67
|
};
|
|
68
|
+
case types_1.KnownChainIds.ElysiumMainnet:
|
|
69
|
+
return {
|
|
70
|
+
assetReference: caip_1.ASSET_REFERENCE.Elysium,
|
|
71
|
+
assetNamespace: caip_1.ASSET_NAMESPACE.slip44,
|
|
72
|
+
};
|
|
68
73
|
default:
|
|
69
74
|
throw Error(`chainId '${chainId}' not supported`);
|
|
70
75
|
}
|
|
@@ -45,6 +45,7 @@ const DAO_TREASURY_BY_CHAIN_ID = {
|
|
|
45
45
|
[types_1.KnownChainIds.PlasmaMainnet]: utils_1.DAO_TREASURY_PLASMA,
|
|
46
46
|
[types_1.KnownChainIds.MegaEthMainnet]: utils_1.DAO_TREASURY_MEGAETH,
|
|
47
47
|
[types_1.KnownChainIds.UnichainMainnet]: utils_1.DAO_TREASURY_UNICHAIN,
|
|
48
|
+
[types_1.KnownChainIds.ElysiumMainnet]: utils_1.DAO_TREASURY_ELYSIUM,
|
|
48
49
|
};
|
|
49
50
|
const getTreasuryAddressFromChainId = (chainId) => {
|
|
50
51
|
const maybeTreasuryChainId = (0, utils_1.isTreasuryChainId)(chainId) ? chainId : undefined;
|
|
@@ -26,6 +26,7 @@ const helpers_1 = require("./helpers");
|
|
|
26
26
|
[types_1.KnownChainIds.PlasmaMainnet]: '0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC',
|
|
27
27
|
[types_1.KnownChainIds.MegaEthMainnet]: '0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC',
|
|
28
28
|
[types_1.KnownChainIds.UnichainMainnet]: '0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC',
|
|
29
|
+
[types_1.KnownChainIds.ElysiumMainnet]: '0xF5AA59151bE6515C4Ca68A0282CF68B3eA4846fC',
|
|
29
30
|
[types_1.KnownChainIds.BitcoinMainnet]: 'bc1q9xrjfet2a05r3jvsxx66rru7pysevk5dvqasdw9eeea3rfqlk33qr4hghh',
|
|
30
31
|
[types_1.KnownChainIds.SolanaMainnet]: 'FxXyPB5RH4uHLPPJR5H89zGwZp19juBetmRwrxfsLj2j',
|
|
31
32
|
[types_1.KnownChainIds.StarknetMainnet]: '0x07ac2252f2da7cbf085e7a5ddc1318243aa818607cdd430dd2e17dd5d487606a',
|