@lifi/data-types 2.2.1 → 2.3.0-alpha.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.
@@ -1,6 +1,7 @@
1
- import { Chain, ChainKey, EVMChain, SolanaChain } from '@lifi/types';
1
+ import { Chain, ChainKey, EVMChain, SolanaChain, UTXOChain } from '@lifi/types';
2
2
  export declare const supportedEVMChains: EVMChain[];
3
3
  export declare const supportedSolanaChains: SolanaChain[];
4
- export declare const supportedChains: EVMChain[];
4
+ export declare const supportedUXTOChains: UTXOChain[];
5
+ export declare const supportedChains: UTXOChain[];
5
6
  export declare const getChainByKey: (chainKey: ChainKey) => Chain;
6
7
  export declare const getChainById: (chainId: number) => Chain;
@@ -111,9 +111,9 @@ export const supportedEVMChains = [
111
111
  decimals: 18,
112
112
  },
113
113
  rpcUrls: [
114
- 'https://rpc.gnosischain.com/',
114
+ 'https://rpc.gnosis.gateway.fm',
115
+ 'https://rpc.gnosischain.com',
115
116
  'https://rpc.ankr.com/gnosis',
116
- 'https://xdai-rpc.gateway.pokt.network',
117
117
  ],
118
118
  },
119
119
  },
@@ -1196,10 +1196,107 @@ export const supportedSolanaChains = [
1196
1196
  },
1197
1197
  },
1198
1198
  ];
1199
+ export const supportedUXTOChains = [
1200
+ {
1201
+ key: ChainKey.BTC,
1202
+ chainType: ChainType.UTXO,
1203
+ name: 'Bitcoin',
1204
+ coin: CoinKey.BTC,
1205
+ id: ChainId.BTC,
1206
+ mainnet: true,
1207
+ logoURI: 'https://assets.coingecko.com/coins/images/1/standard/bitcoin.png',
1208
+ // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/bitcoin.svg',
1209
+ faucetUrls: [],
1210
+ metamask: {
1211
+ chainId: ChainId.BTC.toString(),
1212
+ blockExplorerUrls: [
1213
+ 'https://blockchair.com/bitcoin',
1214
+ 'https://bitcoinexplorer.org/',
1215
+ ],
1216
+ chainName: 'Bitcoin',
1217
+ nativeCurrency: {
1218
+ name: 'BTC',
1219
+ symbol: 'BTC',
1220
+ decimals: 8,
1221
+ },
1222
+ rpcUrls: ['https://node-router.thorswap.net/bitcoin'],
1223
+ },
1224
+ },
1225
+ {
1226
+ key: ChainKey.BCH,
1227
+ chainType: ChainType.UTXO,
1228
+ name: 'Bitcoin Cash',
1229
+ coin: CoinKey.BCH,
1230
+ id: ChainId.BCH,
1231
+ mainnet: true,
1232
+ logoURI: 'https://assets.coingecko.com/coins/images/780/standard/bitcoin-cash-circle.png',
1233
+ // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/bitcoincash.svg',
1234
+ faucetUrls: [],
1235
+ metamask: {
1236
+ chainId: ChainId.BCH.toString(),
1237
+ blockExplorerUrls: ['https://www.blockchair.com/bitcoin-cash'],
1238
+ chainName: 'Bitcoin Cash',
1239
+ nativeCurrency: {
1240
+ name: 'BCH',
1241
+ symbol: 'BCH',
1242
+ decimals: 8,
1243
+ },
1244
+ rpcUrls: ['https://node-router.thorswap.net/bitcoin-cash'],
1245
+ },
1246
+ },
1247
+ {
1248
+ key: ChainKey.LTC,
1249
+ chainType: ChainType.UTXO,
1250
+ name: 'Litecoin',
1251
+ coin: CoinKey.LTC,
1252
+ id: ChainId.LTC,
1253
+ mainnet: true,
1254
+ logoURI: 'https://assets.coingecko.com/coins/images/2/standard/litecoin.png',
1255
+ // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/litecoin.svg',
1256
+ faucetUrls: [],
1257
+ metamask: {
1258
+ chainId: ChainId.LTC.toString(),
1259
+ blockExplorerUrls: ['https://blockchair.com/litecoin'],
1260
+ chainName: 'Litecoin',
1261
+ nativeCurrency: {
1262
+ name: 'LTC',
1263
+ symbol: 'LTC',
1264
+ decimals: 8,
1265
+ },
1266
+ rpcUrls: ['https://node-router.thorswap.net/litecoin'],
1267
+ },
1268
+ },
1269
+ {
1270
+ key: ChainKey.DGE,
1271
+ chainType: ChainType.UTXO,
1272
+ name: 'Dogecoin',
1273
+ coin: CoinKey.DOGE,
1274
+ id: ChainId.DGE,
1275
+ mainnet: true,
1276
+ logoURI: 'https://assets.coingecko.com/coins/images/5/standard/dogecoin.png',
1277
+ // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/dogecoin.svg',
1278
+ faucetUrls: [],
1279
+ metamask: {
1280
+ chainId: ChainId.DGE.toString(),
1281
+ blockExplorerUrls: ['https://blockchair.com/dogecoin'],
1282
+ chainName: 'Dogecoin',
1283
+ nativeCurrency: {
1284
+ name: 'DODGE',
1285
+ symbol: 'DOGE',
1286
+ decimals: 8,
1287
+ },
1288
+ rpcUrls: ['https://node-router.thorswap.net/dogecoin'],
1289
+ },
1290
+ },
1291
+ ];
1199
1292
  // This assignment is required to avoid breaking
1200
1293
  // changes with the new non EVM support types release
1201
1294
  // This will be removed in the future
1202
- export const supportedChains = [...supportedEVMChains, ...supportedSolanaChains];
1295
+ export const supportedChains = [
1296
+ ...supportedEVMChains,
1297
+ ...supportedSolanaChains,
1298
+ ...supportedUXTOChains,
1299
+ ];
1203
1300
  export const getChainByKey = (chainKey) => {
1204
1301
  const chain = supportedChains.find((c) => c.key === chainKey);
1205
1302
  if (!chain) {
@@ -1,4 +1,4 @@
1
- import { BigNumber } from 'ethers';
1
+ import { BigNumber } from '@ethersproject/bignumber';
2
2
  export const prefixChainId = (chainId) => {
3
3
  return '0x' + BigNumber.from(chainId)._hex.split('0x')[1].replace(/\b0+/g, '');
4
4
  };
@@ -1,6 +1,7 @@
1
- import { Chain, ChainKey, EVMChain, SolanaChain } from '@lifi/types';
1
+ import { Chain, ChainKey, EVMChain, SolanaChain, UTXOChain } from '@lifi/types';
2
2
  export declare const supportedEVMChains: EVMChain[];
3
3
  export declare const supportedSolanaChains: SolanaChain[];
4
- export declare const supportedChains: EVMChain[];
4
+ export declare const supportedUXTOChains: UTXOChain[];
5
+ export declare const supportedChains: UTXOChain[];
5
6
  export declare const getChainByKey: (chainKey: ChainKey) => Chain;
6
7
  export declare const getChainById: (chainId: number) => Chain;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getChainById = exports.getChainByKey = exports.supportedChains = exports.supportedSolanaChains = exports.supportedEVMChains = void 0;
3
+ exports.getChainById = exports.getChainByKey = exports.supportedChains = exports.supportedUXTOChains = exports.supportedSolanaChains = exports.supportedEVMChains = void 0;
4
4
  const types_1 = require("@lifi/types");
5
5
  const multicall_1 = require("../multicall");
6
6
  const utils_1 = require("./utils");
@@ -114,9 +114,9 @@ exports.supportedEVMChains = [
114
114
  decimals: 18,
115
115
  },
116
116
  rpcUrls: [
117
- 'https://rpc.gnosischain.com/',
117
+ 'https://rpc.gnosis.gateway.fm',
118
+ 'https://rpc.gnosischain.com',
118
119
  'https://rpc.ankr.com/gnosis',
119
- 'https://xdai-rpc.gateway.pokt.network',
120
120
  ],
121
121
  },
122
122
  },
@@ -1199,10 +1199,107 @@ exports.supportedSolanaChains = [
1199
1199
  },
1200
1200
  },
1201
1201
  ];
1202
+ exports.supportedUXTOChains = [
1203
+ {
1204
+ key: types_1.ChainKey.BTC,
1205
+ chainType: types_1.ChainType.UTXO,
1206
+ name: 'Bitcoin',
1207
+ coin: types_1.CoinKey.BTC,
1208
+ id: types_1.ChainId.BTC,
1209
+ mainnet: true,
1210
+ logoURI: 'https://assets.coingecko.com/coins/images/1/standard/bitcoin.png',
1211
+ // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/bitcoin.svg',
1212
+ faucetUrls: [],
1213
+ metamask: {
1214
+ chainId: types_1.ChainId.BTC.toString(),
1215
+ blockExplorerUrls: [
1216
+ 'https://blockchair.com/bitcoin',
1217
+ 'https://bitcoinexplorer.org/',
1218
+ ],
1219
+ chainName: 'Bitcoin',
1220
+ nativeCurrency: {
1221
+ name: 'BTC',
1222
+ symbol: 'BTC',
1223
+ decimals: 8,
1224
+ },
1225
+ rpcUrls: ['https://node-router.thorswap.net/bitcoin'],
1226
+ },
1227
+ },
1228
+ {
1229
+ key: types_1.ChainKey.BCH,
1230
+ chainType: types_1.ChainType.UTXO,
1231
+ name: 'Bitcoin Cash',
1232
+ coin: types_1.CoinKey.BCH,
1233
+ id: types_1.ChainId.BCH,
1234
+ mainnet: true,
1235
+ logoURI: 'https://assets.coingecko.com/coins/images/780/standard/bitcoin-cash-circle.png',
1236
+ // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/bitcoincash.svg',
1237
+ faucetUrls: [],
1238
+ metamask: {
1239
+ chainId: types_1.ChainId.BCH.toString(),
1240
+ blockExplorerUrls: ['https://www.blockchair.com/bitcoin-cash'],
1241
+ chainName: 'Bitcoin Cash',
1242
+ nativeCurrency: {
1243
+ name: 'BCH',
1244
+ symbol: 'BCH',
1245
+ decimals: 8,
1246
+ },
1247
+ rpcUrls: ['https://node-router.thorswap.net/bitcoin-cash'],
1248
+ },
1249
+ },
1250
+ {
1251
+ key: types_1.ChainKey.LTC,
1252
+ chainType: types_1.ChainType.UTXO,
1253
+ name: 'Litecoin',
1254
+ coin: types_1.CoinKey.LTC,
1255
+ id: types_1.ChainId.LTC,
1256
+ mainnet: true,
1257
+ logoURI: 'https://assets.coingecko.com/coins/images/2/standard/litecoin.png',
1258
+ // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/litecoin.svg',
1259
+ faucetUrls: [],
1260
+ metamask: {
1261
+ chainId: types_1.ChainId.LTC.toString(),
1262
+ blockExplorerUrls: ['https://blockchair.com/litecoin'],
1263
+ chainName: 'Litecoin',
1264
+ nativeCurrency: {
1265
+ name: 'LTC',
1266
+ symbol: 'LTC',
1267
+ decimals: 8,
1268
+ },
1269
+ rpcUrls: ['https://node-router.thorswap.net/litecoin'],
1270
+ },
1271
+ },
1272
+ {
1273
+ key: types_1.ChainKey.DGE,
1274
+ chainType: types_1.ChainType.UTXO,
1275
+ name: 'Dogecoin',
1276
+ coin: types_1.CoinKey.DOGE,
1277
+ id: types_1.ChainId.DGE,
1278
+ mainnet: true,
1279
+ logoURI: 'https://assets.coingecko.com/coins/images/5/standard/dogecoin.png',
1280
+ // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/dogecoin.svg',
1281
+ faucetUrls: [],
1282
+ metamask: {
1283
+ chainId: types_1.ChainId.DGE.toString(),
1284
+ blockExplorerUrls: ['https://blockchair.com/dogecoin'],
1285
+ chainName: 'Dogecoin',
1286
+ nativeCurrency: {
1287
+ name: 'DODGE',
1288
+ symbol: 'DOGE',
1289
+ decimals: 8,
1290
+ },
1291
+ rpcUrls: ['https://node-router.thorswap.net/dogecoin'],
1292
+ },
1293
+ },
1294
+ ];
1202
1295
  // This assignment is required to avoid breaking
1203
1296
  // changes with the new non EVM support types release
1204
1297
  // This will be removed in the future
1205
- exports.supportedChains = [...exports.supportedEVMChains, ...exports.supportedSolanaChains];
1298
+ exports.supportedChains = [
1299
+ ...exports.supportedEVMChains,
1300
+ ...exports.supportedSolanaChains,
1301
+ ...exports.supportedUXTOChains,
1302
+ ];
1206
1303
  const getChainByKey = (chainKey) => {
1207
1304
  const chain = exports.supportedChains.find((c) => c.key === chainKey);
1208
1305
  if (!chain) {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prefixChainId = void 0;
4
- const ethers_1 = require("ethers");
4
+ const bignumber_1 = require("@ethersproject/bignumber");
5
5
  const prefixChainId = (chainId) => {
6
- return '0x' + ethers_1.BigNumber.from(chainId)._hex.split('0x')[1].replace(/\b0+/g, '');
6
+ return '0x' + bignumber_1.BigNumber.from(chainId)._hex.split('0x')[1].replace(/\b0+/g, '');
7
7
  };
8
8
  exports.prefixChainId = prefixChainId;
@@ -1543,6 +1543,62 @@ exports.basicCoins = [
1543
1543
  },
1544
1544
  },
1545
1545
  },
1546
+ // > Bitcoin
1547
+ {
1548
+ key: types_1.CoinKey.BTC,
1549
+ name: types_1.CoinKey.BTC,
1550
+ logoURI: 'https://assets.coingecko.com/coins/images/1/standard/bitcoin.png',
1551
+ verified: true,
1552
+ chains: {
1553
+ [types_1.ChainId.BTC]: {
1554
+ address: 'bitcoin',
1555
+ decimals: 8,
1556
+ name: 'Bitcoin',
1557
+ },
1558
+ },
1559
+ },
1560
+ // > Bitcoin Cash
1561
+ {
1562
+ key: types_1.CoinKey.BCH,
1563
+ name: types_1.CoinKey.BCH,
1564
+ logoURI: 'https://assets.coingecko.com/coins/images/780/standard/bitcoin-cash-circle.png',
1565
+ verified: true,
1566
+ chains: {
1567
+ [types_1.ChainId.BCH]: {
1568
+ address: 'bitcoin-cash',
1569
+ decimals: 8,
1570
+ name: 'Bitcoin Cash',
1571
+ },
1572
+ },
1573
+ },
1574
+ // > Bitcoin
1575
+ {
1576
+ key: types_1.CoinKey.LTC,
1577
+ name: types_1.CoinKey.LTC,
1578
+ logoURI: 'https://assets.coingecko.com/coins/images/2/standard/litecoin.png',
1579
+ verified: true,
1580
+ chains: {
1581
+ [types_1.ChainId.LTC]: {
1582
+ address: 'litecoin',
1583
+ decimals: 8,
1584
+ name: 'Litecoin',
1585
+ },
1586
+ },
1587
+ },
1588
+ // > Doge
1589
+ {
1590
+ key: types_1.CoinKey.DOGE,
1591
+ name: types_1.CoinKey.DOGE,
1592
+ logoURI: 'https://assets.coingecko.com/coins/images/5/standard/dogecoin.png',
1593
+ verified: true,
1594
+ chains: {
1595
+ [types_1.ChainId.DGE]: {
1596
+ address: 'dogecoin',
1597
+ decimals: 8,
1598
+ name: 'Dogecoin',
1599
+ },
1600
+ },
1601
+ },
1546
1602
  ];
1547
1603
  exports.defaultCoins = exports.basicCoins.map((coin) => {
1548
1604
  var _a, _b, _c;
@@ -1540,6 +1540,62 @@ export const basicCoins = [
1540
1540
  },
1541
1541
  },
1542
1542
  },
1543
+ // > Bitcoin
1544
+ {
1545
+ key: CoinKey.BTC,
1546
+ name: CoinKey.BTC,
1547
+ logoURI: 'https://assets.coingecko.com/coins/images/1/standard/bitcoin.png',
1548
+ verified: true,
1549
+ chains: {
1550
+ [ChainId.BTC]: {
1551
+ address: 'bitcoin',
1552
+ decimals: 8,
1553
+ name: 'Bitcoin',
1554
+ },
1555
+ },
1556
+ },
1557
+ // > Bitcoin Cash
1558
+ {
1559
+ key: CoinKey.BCH,
1560
+ name: CoinKey.BCH,
1561
+ logoURI: 'https://assets.coingecko.com/coins/images/780/standard/bitcoin-cash-circle.png',
1562
+ verified: true,
1563
+ chains: {
1564
+ [ChainId.BCH]: {
1565
+ address: 'bitcoin-cash',
1566
+ decimals: 8,
1567
+ name: 'Bitcoin Cash',
1568
+ },
1569
+ },
1570
+ },
1571
+ // > Bitcoin
1572
+ {
1573
+ key: CoinKey.LTC,
1574
+ name: CoinKey.LTC,
1575
+ logoURI: 'https://assets.coingecko.com/coins/images/2/standard/litecoin.png',
1576
+ verified: true,
1577
+ chains: {
1578
+ [ChainId.LTC]: {
1579
+ address: 'litecoin',
1580
+ decimals: 8,
1581
+ name: 'Litecoin',
1582
+ },
1583
+ },
1584
+ },
1585
+ // > Doge
1586
+ {
1587
+ key: CoinKey.DOGE,
1588
+ name: CoinKey.DOGE,
1589
+ logoURI: 'https://assets.coingecko.com/coins/images/5/standard/dogecoin.png',
1590
+ verified: true,
1591
+ chains: {
1592
+ [ChainId.DGE]: {
1593
+ address: 'dogecoin',
1594
+ decimals: 8,
1595
+ name: 'Dogecoin',
1596
+ },
1597
+ },
1598
+ },
1543
1599
  ];
1544
1600
  export const defaultCoins = basicCoins.map((coin) => {
1545
1601
  var _a, _b, _c;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/data-types",
3
- "version": "2.2.1",
3
+ "version": "2.3.0-alpha.1",
4
4
  "description": "Data types for the LI.FI stack",
5
5
  "keywords": [
6
6
  "sdk",
@@ -63,7 +63,8 @@
63
63
  ]
64
64
  },
65
65
  "dependencies": {
66
- "@lifi/types": "^9.0.1"
66
+ "@ethersproject/bignumber": "^5.7.0",
67
+ "@lifi/types": "11.0.0-alpha.0"
67
68
  },
68
69
  "devDependencies": {
69
70
  "@commitlint/cli": "^17.7.1",