@lifi/types 9.0.0-alpha.8 → 9.0.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.
Files changed (66) hide show
  1. package/dist/api.d.ts +35 -59
  2. package/dist/apiErrors.d.ts +9 -0
  3. package/dist/base.d.ts +231 -0
  4. package/dist/{chains/base.js → base.js} +65 -0
  5. package/dist/bridges.d.ts +21 -15
  6. package/dist/bridges.js +167 -1
  7. package/dist/chains/Chain.d.ts +2 -3
  8. package/dist/chains/Chain.js +2 -1
  9. package/dist/chains/EVMChain.d.ts +1 -0
  10. package/dist/chains/EVMChain.js +4 -1
  11. package/dist/chains/chain.utils.d.ts +4 -0
  12. package/dist/chains/chain.utils.js +21 -0
  13. package/dist/chains/index.d.ts +2 -1
  14. package/dist/chains/index.js +2 -1
  15. package/dist/chains/supported.chains.d.ts +5 -0
  16. package/dist/chains/supported.chains.js +1208 -0
  17. package/dist/cjs/api.d.ts +35 -59
  18. package/dist/cjs/apiErrors.d.ts +9 -0
  19. package/dist/cjs/base.d.ts +231 -0
  20. package/dist/cjs/{chains/base.js → base.js} +68 -3
  21. package/dist/cjs/bridges.d.ts +21 -15
  22. package/dist/cjs/bridges.js +168 -0
  23. package/dist/cjs/chains/Chain.d.ts +2 -3
  24. package/dist/cjs/chains/Chain.js +3 -2
  25. package/dist/cjs/chains/EVMChain.d.ts +1 -0
  26. package/dist/cjs/chains/EVMChain.js +6 -0
  27. package/dist/cjs/chains/chain.utils.d.ts +4 -0
  28. package/dist/cjs/chains/chain.utils.js +26 -0
  29. package/dist/cjs/chains/index.d.ts +2 -1
  30. package/dist/cjs/chains/index.js +2 -1
  31. package/dist/cjs/chains/supported.chains.d.ts +5 -0
  32. package/dist/cjs/chains/supported.chains.js +1211 -0
  33. package/dist/cjs/coins.d.ts +9 -0
  34. package/dist/cjs/coins.js +1892 -0
  35. package/dist/cjs/exchanges.d.ts +32 -6
  36. package/dist/cjs/exchanges.js +1102 -0
  37. package/dist/cjs/index.d.ts +6 -3
  38. package/dist/cjs/index.js +6 -3
  39. package/dist/cjs/multicall.d.ts +3 -0
  40. package/dist/cjs/multicall.js +80 -0
  41. package/dist/cjs/step.d.ts +8 -10
  42. package/dist/coins.d.ts +9 -0
  43. package/dist/coins.js +1885 -0
  44. package/dist/exchanges.d.ts +32 -6
  45. package/dist/exchanges.js +1100 -1
  46. package/dist/index.d.ts +6 -3
  47. package/dist/index.js +6 -3
  48. package/dist/multicall.d.ts +3 -0
  49. package/dist/multicall.js +77 -0
  50. package/dist/step.d.ts +8 -10
  51. package/package.json +32 -22
  52. package/CHANGELOG.md +0 -1291
  53. package/dist/chains/base.d.ts +0 -122
  54. package/dist/cjs/chains/base.d.ts +0 -122
  55. package/dist/cjs/tokens/base.d.ts +0 -58
  56. package/dist/cjs/tokens/base.js +0 -66
  57. package/dist/cjs/tokens/index.d.ts +0 -2
  58. package/dist/cjs/tokens/index.js +0 -18
  59. package/dist/cjs/tokens/token.d.ts +0 -29
  60. package/dist/tokens/base.d.ts +0 -58
  61. package/dist/tokens/base.js +0 -63
  62. package/dist/tokens/index.d.ts +0 -2
  63. package/dist/tokens/index.js +0 -2
  64. package/dist/tokens/token.d.ts +0 -29
  65. /package/dist/{tokens/token.js → apiErrors.js} +0 -0
  66. /package/dist/cjs/{tokens/token.js → apiErrors.js} +0 -0
package/dist/bridges.js CHANGED
@@ -1 +1,167 @@
1
- export {};
1
+ /**
2
+ * @deprecated
3
+ * These values are now obtainable from the LI.FI API
4
+ */
5
+ export var BridgeTool;
6
+ (function (BridgeTool) {
7
+ BridgeTool["connext"] = "connext";
8
+ BridgeTool["hop"] = "hop";
9
+ BridgeTool["multichain"] = "multichain";
10
+ BridgeTool["cbridge"] = "cbridge";
11
+ BridgeTool["hyphen"] = "hyphen";
12
+ BridgeTool["polygon"] = "polygon";
13
+ BridgeTool["arbitrum"] = "arbitrum";
14
+ BridgeTool["avalanche"] = "avalanche";
15
+ BridgeTool["optimism"] = "optimism";
16
+ BridgeTool["across"] = "across";
17
+ BridgeTool["portal"] = "portal";
18
+ BridgeTool["stargate"] = "stargate";
19
+ })(BridgeTool || (BridgeTool = {}));
20
+ /**
21
+ * @deprecated
22
+ * These values are now obtainable from the LI.FI API
23
+ */
24
+ export const supportedBridges = [
25
+ {
26
+ key: BridgeTool.connext,
27
+ name: 'Connext',
28
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/connext.png',
29
+ bridgeUrl: 'https://xpollinate.io/',
30
+ discordUrl: 'https://chat.connext.network/',
31
+ supportUrl: 'https://www.notion.so/connext/Connext-NXTP-Support-19a357ebabdd4e888cfcd138fe3e4644',
32
+ docsUrl: 'https://docs.connext.network/',
33
+ explorerUrl: 'https://connextscan.io/',
34
+ analyticsUrl: 'https://connextscan.io/',
35
+ },
36
+ {
37
+ key: BridgeTool.hop,
38
+ name: 'Hop',
39
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/hop.png',
40
+ bridgeUrl: 'https://app.hop.exchange/',
41
+ discordUrl: 'https://discord.gg/PwCF88emV4',
42
+ supportUrl: 'https://help.hop.exchange/hc/en-us',
43
+ docsUrl: 'https://docs.hop.exchange/',
44
+ explorerUrl: 'https://explorer.hop.exchange/mainnet/',
45
+ analyticsUrl: 'https://explorer.hop.exchange/mainnet/',
46
+ },
47
+ {
48
+ key: BridgeTool.multichain,
49
+ name: 'Multichain',
50
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/anyswap.png',
51
+ bridgeUrl: 'https://app.multichain.org/',
52
+ // discordUrl: '',
53
+ supportUrl: 'https://multichain.zendesk.com/hc/en-us',
54
+ docsUrl: 'https://docs.multichain.org/',
55
+ explorerUrl: 'https://anyswap.net/',
56
+ },
57
+ {
58
+ key: BridgeTool.cbridge,
59
+ name: 'cBridge',
60
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/cbridge.png',
61
+ bridgeUrl: 'https://cbridge.celer.network/',
62
+ discordUrl: 'https://discord.com/invite/uGx4fjQ',
63
+ supportUrl: 'https://form.typeform.com/to/Q4LMjUaK',
64
+ docsUrl: 'https://cbridge-docs.celer.network/',
65
+ // explorerUrl: '',
66
+ analyticsUrl: 'https://cbridge-analytics.celer.network/',
67
+ },
68
+ {
69
+ key: BridgeTool.hyphen,
70
+ name: 'Hyphen',
71
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/hyphen.png',
72
+ bridgeUrl: 'https://hyphen.biconomy.io/',
73
+ discordUrl: 'https://discord.com/invite/HKHxgyEExQ',
74
+ supportUrl: 'https://discord.com/invite/HKHxgyEExQ',
75
+ docsUrl: 'https://docs.biconomy.io/products/hyphen-instant-cross-chain-transfers',
76
+ // explorerUrl: '',
77
+ analyticsUrl: 'https://hyphen-info.biconomy.io/',
78
+ },
79
+ {
80
+ key: BridgeTool.polygon,
81
+ name: 'Polygon Bridge (PoS)',
82
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/polygon.png',
83
+ bridgeUrl: 'https://wallet.polygon.technology/bridge',
84
+ // discordUrl: '',
85
+ supportUrl: 'https://forum.matic.network/',
86
+ docsUrl: 'https://docs.polygon.technology/docs/develop/ethereum-polygon/pos/getting-started',
87
+ // explorerUrl: '',
88
+ // analyticsUrl: '',
89
+ },
90
+ {
91
+ key: BridgeTool.arbitrum,
92
+ name: 'Arbitrum Bridge',
93
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/arbitrum.png',
94
+ bridgeUrl: 'https://bridge.arbitrum.io/',
95
+ discordUrl: 'https://discord.gg/ZpZuw7p',
96
+ supportUrl: 'https://discord.gg/ZpZuw7p',
97
+ docsUrl: 'https://developer.offchainlabs.com/docs/bridging_assets',
98
+ // explorerUrl: '',
99
+ },
100
+ {
101
+ key: BridgeTool.avalanche,
102
+ name: 'AVAX Bridge',
103
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/avalanche.png',
104
+ bridgeUrl: 'https://bridge.avax.network/',
105
+ discordUrl: 'https://chat.avalabs.org/',
106
+ supportUrl: 'https://docs.avax.network/learn/avalanche-bridge-faq/',
107
+ docsUrl: 'https://docs.avax.network/learn/avalanche-bridge-faq/',
108
+ // explorerUrl: '',
109
+ // analyticsUrl: '',
110
+ },
111
+ {
112
+ key: BridgeTool.optimism,
113
+ name: 'Optimism Gateway',
114
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/optimism.png',
115
+ bridgeUrl: 'https://gateway.optimism.io/',
116
+ discordUrl: 'https://discord.com/invite/jrnFEvq',
117
+ supportUrl: 'https://discord.com/invite/jrnFEvq',
118
+ docsUrl: 'https://community.optimism.io/docs/developers/bridge/basics/',
119
+ // explorerUrl: '',
120
+ // analyticsUrl: '',
121
+ },
122
+ {
123
+ key: BridgeTool.across,
124
+ name: 'Across',
125
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/acrossv2.png',
126
+ bridgeUrl: 'https://across.to/',
127
+ discordUrl: 'https://discord.gg/t4SZySkn',
128
+ supportUrl: 'https://discord.gg/t4SZySkn',
129
+ docsUrl: 'https://docs.across.to/',
130
+ },
131
+ {
132
+ key: BridgeTool.portal,
133
+ name: 'Wormhole Portal',
134
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/wormhole_portal.png',
135
+ bridgeUrl: 'https://portalbridge.com/',
136
+ discordUrl: 'https://discord.com/invite/wormholecrypto',
137
+ supportUrl: 'https://discord.com/invite/wormholecrypto',
138
+ docsUrl: 'https://docs.wormholenetwork.com/wormhole/',
139
+ },
140
+ {
141
+ key: BridgeTool.stargate,
142
+ name: 'Stargate',
143
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/5685c638772f533edad80fcb210b4bb89e30a50f/src/assets/icons/bridges/stargate.png',
144
+ bridgeUrl: 'https://stargate.finance/',
145
+ discordUrl: 'https://discord.com/invite/TyjeQ45',
146
+ supportUrl: 'https://discord.com/invite/TyjeQ45',
147
+ docsUrl: 'https://stargateprotocol.gitbook.io/stargate/',
148
+ },
149
+ // {
150
+ // key: BridgeTool.,
151
+ // name: '',
152
+ // logoURI:
153
+ // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/.png',
154
+ // bridgeUrl: '',
155
+ // discordUrl: '',
156
+ // supportUrl: '',
157
+ // docsUrl: '',
158
+ // explorerUrl: '',
159
+ // analyticsUrl: '',
160
+ // },
161
+ // for cronos chain, we should confirm if these bridges are available to integrate
162
+ // https://bridge.evodefi.com/
163
+ // https://app.relaychain.com/#/
164
+ // for metis network, we should confirm these bridges as well
165
+ // https://bridge.metis.io/home
166
+ // https://apps.standard.tech/bridge
167
+ ];
@@ -1,8 +1,7 @@
1
- import { CoinKey } from '../tokens/base';
2
- import { ChainKey } from './base';
1
+ import { ChainKey, CoinKey } from '../base';
3
2
  export declare enum ChainType {
4
3
  EVM = "EVM",
5
- Solana = "SOLANA"
4
+ SVM = "SVM"
6
5
  }
7
6
  export interface _Chain {
8
7
  key: ChainKey;
@@ -1,5 +1,6 @@
1
1
  export var ChainType;
2
2
  (function (ChainType) {
3
3
  ChainType["EVM"] = "EVM";
4
- ChainType["Solana"] = "SOLANA";
4
+ // Solana virtual machine
5
+ ChainType["SVM"] = "SVM";
5
6
  })(ChainType || (ChainType = {}));
@@ -15,4 +15,5 @@ export interface AddEthereumChainParameter {
15
15
  };
16
16
  rpcUrls: string[];
17
17
  }
18
+ export declare const prefixChainId: (chainId: number) => string;
18
19
  export type Chain = EVMChain;
@@ -1 +1,4 @@
1
- export {};
1
+ import { BigNumber } from 'ethers';
2
+ export const prefixChainId = (chainId) => {
3
+ return '0x' + BigNumber.from(chainId)._hex.split('0x')[1].replace(/\b0+/g, '');
4
+ };
@@ -0,0 +1,4 @@
1
+ import { ChainKey } from '../base';
2
+ import { Chain } from './EVMChain';
3
+ export declare const getChainByKey: (chainKey: ChainKey) => Chain;
4
+ export declare const getChainById: (chainId: number) => Chain;
@@ -0,0 +1,21 @@
1
+ import { supportedEVMChains, supportedSolanaChains } from './supported.chains';
2
+ const supportedChains = [
3
+ // This will be added in the future
4
+ // ...supportedSolanaChains,
5
+ ...supportedEVMChains,
6
+ ...supportedSolanaChains,
7
+ ];
8
+ export const getChainByKey = (chainKey) => {
9
+ const chain = supportedChains.find((c) => c.key === chainKey);
10
+ if (!chain) {
11
+ throw new Error('Invalid chainKey');
12
+ }
13
+ return chain;
14
+ };
15
+ export const getChainById = (chainId) => {
16
+ const chain = supportedChains.find((c) => c.id === chainId);
17
+ if (!chain) {
18
+ throw new Error('Invalid chainId');
19
+ }
20
+ return chain;
21
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './Chain';
2
+ export * from './chain.utils';
2
3
  export * from './EVMChain';
3
4
  export * from './SolanaChain';
4
- export * from './base';
5
+ export * from './supported.chains';
@@ -1,4 +1,5 @@
1
1
  export * from './Chain';
2
+ export * from './chain.utils';
2
3
  export * from './EVMChain';
3
4
  export * from './SolanaChain';
4
- export * from './base';
5
+ export * from './supported.chains';
@@ -0,0 +1,5 @@
1
+ import { EVMChain } from './EVMChain';
2
+ import { SolanaChain } from './SolanaChain';
3
+ export declare const supportedEVMChains: EVMChain[];
4
+ export declare const supportedSolanaChains: SolanaChain[];
5
+ export declare const supportedChains: EVMChain[];