diff --git a/index.js b/index.js deleted file mode 100644 index 39b76eb6c..000000000 --- a/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// eslint-disable-next-line no-global-assign -require = require('esm')(module) -module.exports = require('./lib/index.js') diff --git a/package.json b/package.json index 87a191a85..129ea486d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "/android/src/", "/CHANGELOG.md", "/edge-currency-accountbased.podspec", - "/index.js", "/ios/", "/lib/", "/LICENSE", @@ -40,7 +39,7 @@ "make-checkpoints": "node -r sucrase/register scripts/makeCheckpoints.ts", "node": "sucrase -d ./lib -q -t imports,typescript ./src", "precommit": "lint-staged && npm-run-all types test", - "prepare": "husky install && npm-run-all clean node types webpack", + "prepare": "husky install && patch-package && npm-run-all clean node types webpack", "start": "webpack serve", "test": "nyc mocha 'test/**/*.test.ts'", "types": "tsc", @@ -135,6 +134,7 @@ "npm-run-all": "^4.1.5", "nyc": "^15.0.1", "os-browserify": "^0.3.0", + "patch-package": "^6.5.1", "path-browserify": "^1.0.1", "prettier": "^2.2.0", "process": "^0.11.10", diff --git a/patches/@tronscan+client+0.2.81.patch b/patches/@tronscan+client+0.2.81.patch new file mode 100644 index 000000000..c49d2b5e3 --- /dev/null +++ b/patches/@tronscan+client+0.2.81.patch @@ -0,0 +1,31 @@ +diff --git a/node_modules/@tronscan/client/src/utils/tronWeb.js b/node_modules/@tronscan/client/src/utils/tronWeb.js +index 6b1bc38..3f48a11 100644 +--- a/node_modules/@tronscan/client/src/utils/tronWeb.js ++++ b/node_modules/@tronscan/client/src/utils/tronWeb.js +@@ -25,7 +25,7 @@ const { + const fromHexString = hexString => + new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16))); + +-export function transactionJsonToProtoBuf(transaction) { ++function transactionJsonToProtoBuf(transaction) { + const rawData = transaction["raw_data"]; + const contractJson = rawData.contract[0]; + const transactionObj = contractJsonToProtobuf(contractJson); +@@ -52,7 +52,7 @@ export function transactionJsonToProtoBuf(transaction) { + return transactionObj; + } + +-export function contractJsonToProtobuf(contract) { ++function contractJsonToProtobuf(contract) { + const value = contract.parameter.value; + switch (contract.type) { + +@@ -365,3 +365,8 @@ export function contractJsonToProtobuf(contract) { + + } + } ++ ++module.exports = { ++ transactionJsonToProtoBuf, ++ contractJsonToProtobuf ++}; diff --git a/src/binance/bnbInfo.ts b/src/binance/bnbInfo.ts index 7dd83af8c..ac6611cb3 100644 --- a/src/binance/bnbInfo.ts +++ b/src/binance/bnbInfo.ts @@ -41,7 +41,7 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'B' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const binance = makeOuterPlugin<{}, BinanceTools>({ diff --git a/src/common/innerPlugin.ts b/src/common/innerPlugin.ts index 806394c1a..27053b186 100644 --- a/src/common/innerPlugin.ts +++ b/src/common/innerPlugin.ts @@ -5,7 +5,6 @@ import { EdgeCurrencyInfo, EdgeCurrencyPlugin, EdgeCurrencyTools, - EdgeMetaToken, EdgeOtherMethods, EdgeTokenMap, EdgeWalletInfo @@ -16,6 +15,7 @@ import { * so we can share the same instance between sibling networks. */ export interface PluginEnvironment extends EdgeCorePluginOptions { + builtinTokens: EdgeTokenMap currencyInfo: EdgeCurrencyInfo networkInfo: NetworkInfo } @@ -40,6 +40,7 @@ export interface InnerPlugin { * so we don't have to load any crypto libraries. */ export interface OuterPlugin { + builtinTokens?: EdgeTokenMap currencyInfo: EdgeCurrencyInfo networkInfo: NetworkInfo @@ -54,8 +55,13 @@ export function makeOuterPlugin( template: OuterPlugin ): EdgeCorePluginFactory { return (env: EdgeCorePluginOptions): EdgeCurrencyPlugin => { - const { currencyInfo, networkInfo, otherMethodNames = [] } = template - const innerEnv = { ...env, currencyInfo, networkInfo } + const { + builtinTokens = {}, + currencyInfo, + networkInfo, + otherMethodNames = [] + } = template + const innerEnv = { ...env, builtinTokens, currencyInfo, networkInfo } // Logic to load the inner plugin: let pluginPromise: Promise> | undefined @@ -75,8 +81,6 @@ export function makeOuterPlugin( return { plugin, tools } } - const builtinTokens = upgradeMetaTokens(currencyInfo.metaTokens) - async function getBuiltinTokens(): Promise { return builtinTokens } @@ -131,22 +135,3 @@ export function makeOtherMethods( return out } - -function upgradeMetaTokens(metaTokens: EdgeMetaToken[]): EdgeTokenMap { - const out: EdgeTokenMap = {} - for (const metaToken of metaTokens) { - const { contractAddress } = metaToken - if (contractAddress == null) continue - out[contractToTokenId(contractAddress)] = { - currencyCode: metaToken.currencyCode, - denominations: metaToken.denominations, - displayName: metaToken.currencyName, - networkLocation: { contractAddress: metaToken.contractAddress } - } - } - return out -} - -export function contractToTokenId(contractAddress: string): string { - return contractAddress.toLowerCase().replace(/^0x/, '') -} diff --git a/src/common/tokenHelpers.ts b/src/common/tokenHelpers.ts new file mode 100644 index 000000000..f420ae816 --- /dev/null +++ b/src/common/tokenHelpers.ts @@ -0,0 +1,33 @@ +import { asMaybe, asObject, asString } from 'cleaners' +import { EdgeMetaToken, EdgeTokenMap } from 'edge-core-js' + +/** + * The `networkLocation` field is untyped, + * but many currency plugins will put a contract address in there. + */ +export const asMaybeContractLocation = asMaybe( + asObject({ + contractAddress: asString + }) +) + +/** + * Downgrades EdgeToken objects to the legacy EdgeMetaToken format. + */ +export function makeMetaTokens(tokens: EdgeTokenMap): EdgeMetaToken[] { + const out: EdgeMetaToken[] = [] + for (const tokenId of Object.keys(tokens)) { + const { currencyCode, displayName, denominations, networkLocation } = + tokens[tokenId] + + const cleanLocation = asMaybeContractLocation(networkLocation) + if (cleanLocation == null) continue + out.push({ + currencyCode, + currencyName: displayName, + denominations, + contractAddress: cleanLocation.contractAddress + }) + } + return out +} diff --git a/src/eos/eosInfos.ts b/src/eos/eosInfos.ts new file mode 100644 index 000000000..2d5868e88 --- /dev/null +++ b/src/eos/eosInfos.ts @@ -0,0 +1,9 @@ +import { eos } from './info/eosInfo' +import { telos } from './info/telosInfo' +import { wax } from './info/waxInfo' + +export const eosPlugins = { + eos, + telos, + wax +} diff --git a/src/eos/eosPlugin.ts b/src/eos/eosPlugin.ts index cd16256a2..6498ef7ea 100644 --- a/src/eos/eosPlugin.ts +++ b/src/eos/eosPlugin.ts @@ -13,6 +13,7 @@ import EosApi from 'eosjs-api' import ecc from 'eosjs-ecc' import { PluginEnvironment } from '../common/innerPlugin' +import { asMaybeContractLocation } from '../common/tokenHelpers' import { encodeUriCommon, parseUriCommon } from '../common/uriHelpers' import { asyncWaterfall, getDenomInfo, getFetchCors } from '../common/utils' import { @@ -143,11 +144,11 @@ export class EosTools implements EdgeCurrencyTools { } async getTokenId(token: EdgeToken): Promise { - const contractAddress = token?.networkLocation?.contractAddress - if (contractAddress == null || !checkAddress(contractAddress)) { + const cleanLocation = asMaybeContractLocation(token.networkLocation) + if (cleanLocation == null || !checkAddress(cleanLocation.contractAddress)) { throw new Error('ErrorInvalidContractAddress') } - return contractAddress.toLowerCase() + return cleanLocation.contractAddress.toLowerCase() } // change to fetch call in the future diff --git a/src/eos/index.ts b/src/eos/index.ts deleted file mode 100644 index 3b03fc725..000000000 --- a/src/eos/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { eos } from './eosInfo' -import { telos } from './telosInfo' -import { wax } from './waxInfo' - -export const eosPlugins = { - eos, - telos, - wax -} diff --git a/src/eos/eosInfo.ts b/src/eos/info/eosInfo.ts similarity index 87% rename from src/eos/eosInfo.ts rename to src/eos/info/eosInfo.ts index 70edf53cf..6cb1814fa 100644 --- a/src/eos/eosInfo.ts +++ b/src/eos/info/eosInfo.ts @@ -1,8 +1,8 @@ import { EdgeCurrencyInfo } from 'edge-core-js/types' -import { makeOuterPlugin } from '../common/innerPlugin' -import type { EosTools } from './eosPlugin' -import { EosNetworkInfo, eosOtherMethodNames } from './eosTypes' +import { makeOuterPlugin } from '../../common/innerPlugin' +import type { EosTools } from '../eosPlugin' +import { EosNetworkInfo, eosOtherMethodNames } from '../eosTypes' // ----EOSIO MAIN NET---- export const eosNetworkInfo: EosNetworkInfo = { @@ -50,7 +50,7 @@ export const eosCurrencyInfo: EdgeCurrencyInfo = { transactionExplorer: 'https://bloks.io/transaction/%s', denominations, - metaTokens: [] + metaTokens: [] // Deprecated } export const eos = makeOuterPlugin({ @@ -61,7 +61,7 @@ export const eos = makeOuterPlugin({ async getInnerPlugin() { return await import( /* webpackChunkName: "eos" */ - './eosPlugin' + '../eosPlugin' ) } }) diff --git a/src/eos/telosInfo.ts b/src/eos/info/telosInfo.ts similarity index 83% rename from src/eos/telosInfo.ts rename to src/eos/info/telosInfo.ts index 79bf5480f..91f44e23a 100644 --- a/src/eos/telosInfo.ts +++ b/src/eos/info/telosInfo.ts @@ -1,8 +1,8 @@ import { EdgeCurrencyInfo } from 'edge-core-js/types' -import { makeOuterPlugin } from '../common/innerPlugin' -import type { EosTools } from './eosPlugin' -import { EosNetworkInfo, eosOtherMethodNames } from './eosTypes' +import { makeOuterPlugin } from '../../common/innerPlugin' +import type { EosTools } from '../eosPlugin' +import { EosNetworkInfo, eosOtherMethodNames } from '../eosTypes' // ----TELOS MAIN NET---- export const telosNetworkInfo: EosNetworkInfo = { @@ -42,7 +42,7 @@ export const telosCurrencyInfo: EdgeCurrencyInfo = { transactionExplorer: 'https://telos.bloks.io/transaction/%s', denominations, - metaTokens: [] + metaTokens: [] // Deprecated } export const telos = makeOuterPlugin({ @@ -51,6 +51,6 @@ export const telos = makeOuterPlugin({ otherMethodNames: eosOtherMethodNames, async getInnerPlugin() { - return await import('./eosPlugin') + return await import('../eosPlugin') } }) diff --git a/src/eos/waxInfo.ts b/src/eos/info/waxInfo.ts similarity index 84% rename from src/eos/waxInfo.ts rename to src/eos/info/waxInfo.ts index 47cde4bd7..9593d5d4f 100644 --- a/src/eos/waxInfo.ts +++ b/src/eos/info/waxInfo.ts @@ -1,8 +1,8 @@ import { EdgeCurrencyInfo } from 'edge-core-js/types' -import { makeOuterPlugin } from '../common/innerPlugin' -import type { EosTools } from './eosPlugin' -import { EosNetworkInfo, eosOtherMethodNames } from './eosTypes' +import { makeOuterPlugin } from '../../common/innerPlugin' +import type { EosTools } from '../eosPlugin' +import { EosNetworkInfo, eosOtherMethodNames } from '../eosTypes' // ----WAX MAIN NET---- export const waxNetworkInfo: EosNetworkInfo = { @@ -43,7 +43,7 @@ export const waxCurrencyInfo: EdgeCurrencyInfo = { transactionExplorer: 'https://wax.bloks.io/transaction/%s', denominations, - metaTokens: [] + metaTokens: [] // Deprecated } export const wax = makeOuterPlugin({ @@ -52,6 +52,6 @@ export const wax = makeOuterPlugin({ otherMethodNames: eosOtherMethodNames, async getInnerPlugin() { - return await import('./eosPlugin') + return await import('../eosPlugin') } }) diff --git a/src/ethereum/ethPlugin.ts b/src/ethereum/ethPlugin.ts index 7dd26efbe..1027380e7 100644 --- a/src/ethereum/ethPlugin.ts +++ b/src/ethereum/ethPlugin.ts @@ -15,7 +15,8 @@ import { import EthereumUtil from 'ethereumjs-util' import hdKey from 'ethereumjs-wallet/hdkey' -import { contractToTokenId, PluginEnvironment } from '../common/innerPlugin' +import { PluginEnvironment } from '../common/innerPlugin' +import { asMaybeContractLocation } from '../common/tokenHelpers' import { encodeUriCommon, parseUriCommon } from '../common/uriHelpers' import { biggyScience, getDenomInfo } from '../common/utils' import { ethPlugins } from './ethInfos' @@ -351,15 +352,15 @@ export class EthereumTools implements EdgeCurrencyTools { } async getTokenId(token: EdgeToken): Promise { - const contractAddress = token?.networkLocation?.contractAddress + const cleanLocation = asMaybeContractLocation(token.networkLocation) if ( - contractAddress == null || + cleanLocation == null || // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - !EthereumUtil.isValidAddress(contractAddress) + !EthereumUtil.isValidAddress(cleanLocation.contractAddress) ) { throw new Error('ErrorInvalidContractAddress') } - return contractToTokenId(contractAddress) + return cleanLocation.contractAddress.toLowerCase().replace(/^0x/, '') } } diff --git a/src/ethereum/info/avaxInfo.ts b/src/ethereum/info/avaxInfo.ts index 9aa7ef513..dd0bf07b9 100644 --- a/src/ethereum/info/avaxInfo.ts +++ b/src/ethereum/info/avaxInfo.ts @@ -1,8 +1,140 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = { + '60781c2586d68229fde47564546784ab3faca982': { + currencyCode: 'PNG', + displayName: 'Pangolin', + denominations: [{ name: 'PNG', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x60781C2586D68229fde47564546784ab3fACA982' + } + }, + e896cdeaac9615145c0ca09c8cd5c25bced6384c: { + currencyCode: 'PEFI', + displayName: 'Penguin Finance', + denominations: [{ name: 'PEFI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xe896CDeaAC9615145c0cA09C8Cd5C25bced6384c' + } + }, + d1c3f94de7e5b45fa4edbba472491a9f4b166fc4: { + currencyCode: 'XAVA', + displayName: 'Avalaunch', + denominations: [{ name: 'XAVA', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xd1c3f94DE7e5B45fa4eDBBA472491a9f4B166FC4' + } + }, + d6070ae98b8069de6b494332d1a1a81b6179d960: { + currencyCode: 'BIFI', + displayName: 'Beefy Finance', + denominations: [{ name: 'BIFI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xd6070ae98b8069de6B494332d1A1a81B6179D960' + } + }, + '264c1383ea520f73dd837f915ef3a732e204a493': { + currencyCode: 'BNB', + displayName: 'Binance', + denominations: [{ name: 'BNB', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x264c1383EA520f73dd837F915ef3a732e204a493' + } + }, + '59414b3089ce2af0010e7523dea7e2b35d776ec7': { + currencyCode: 'YAK', + displayName: 'Yield Yak', + denominations: [{ name: 'YAK', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x59414b3089ce2AF0010e7523Dea7E2b35d776ec7' + } + }, + '6e84a6216ea6dacc71ee8e6b0a5b7322eebc0fdd': { + currencyCode: 'JOE', + displayName: 'Joe Token', + denominations: [{ name: 'JOE', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x6e84a6216eA6dACC71eE8E6b0a5B7322EEbC0fDd' + } + }, + '214db107654ff987ad859f34125307783fc8e387': { + currencyCode: 'FXS', + displayName: 'Frax Share', + denominations: [{ name: 'FXS', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x214DB107654fF987AD859F34125307783fC8e387' + } + }, + '19860ccb0a68fd4213ab9d8266f7bbf05a8dde98': { + currencyCode: 'BUSD.e', + displayName: 'Binance USD', + denominations: [{ name: 'BUSD.e', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x19860CCB0A68fd4213aB9D8266F7bBf05A8dDe98' + } + }, + d586e7f844cea2f87f50152665bcbc2c279d8d70: { + currencyCode: 'DAI.e', + displayName: 'Dai Stablecoin', + denominations: [{ name: 'DAI.e', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70' + } + }, + '5947bb275c521040051d82396192181b413227a3': { + currencyCode: 'LINK.e', + displayName: 'ChainLink Token', + denominations: [{ name: 'LINK.e', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x5947BB275c521040051D82396192181b413227A3' + } + }, + '8ebaf22b6f053dffeaf46f4dd9efa95d89ba8580': { + currencyCode: 'UNI.e', + displayName: 'Uniswap', + denominations: [{ name: 'UNI.e', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x8eBAf22B6F053dFFeaf46f4Dd9eFA95D89ba8580' + } + }, + b97ef9ef8734c71904d8002f8b6bc66dd9c48a6e: { + currencyCode: 'USDC', + displayName: 'USD Coin', + denominations: [{ name: 'USDC', multiplier: '1000000' }], + networkLocation: { + contractAddress: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E' + } + }, + a7d7079b0fead91f3e65f86e8915cb59c1a4c664: { + currencyCode: 'USDC.e', + displayName: 'USD Coin', + denominations: [{ name: 'USDC.e', multiplier: '1000000' }], + networkLocation: { + contractAddress: '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664' + } + }, + c7198437980c041c805a1edcba50c1ce5db95118: { + currencyCode: 'USDT.e', + displayName: 'Tether USD', + denominations: [{ name: 'USDT.e', multiplier: '1000000' }], + networkLocation: { + contractAddress: '0xc7198437980c041c805A1EDcbA50c1Ce5db95118' + } + }, + '50b7545627a5162f82a992c33b87adc75187b218': { + currencyCode: 'WBTC.e', + displayName: 'Wrapped BTC', + denominations: [{ name: 'WBTC.e', multiplier: '100000000' }], + networkLocation: { + contractAddress: '0x50b7545627a5162F82A992c33b87aDc75187B218' + } + } +} // Fees are in Wei const defaultNetworkFees: EthereumFees = { @@ -85,187 +217,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'AVAX' } ], - metaTokens: [ - { - currencyCode: 'PNG', - currencyName: 'Pangolin', - denominations: [ - { - name: 'PNG', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x60781C2586D68229fde47564546784ab3fACA982' - }, - { - currencyCode: 'PEFI', - currencyName: 'Penguin Finance', - denominations: [ - { - name: 'PEFI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xe896CDeaAC9615145c0cA09C8Cd5C25bced6384c' - }, - { - currencyCode: 'XAVA', - currencyName: 'Avalaunch', - denominations: [ - { - name: 'XAVA', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xd1c3f94DE7e5B45fa4eDBBA472491a9f4B166FC4' - }, - { - currencyCode: 'BIFI', - currencyName: 'Beefy Finance', - denominations: [ - { - name: 'BIFI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xd6070ae98b8069de6B494332d1A1a81B6179D960' - }, - { - currencyCode: 'BNB', - currencyName: 'Binance', - denominations: [ - { - name: 'BNB', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x264c1383EA520f73dd837F915ef3a732e204a493' - }, - { - currencyCode: 'YAK', - currencyName: 'Yield Yak', - denominations: [ - { - name: 'YAK', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x59414b3089ce2AF0010e7523Dea7E2b35d776ec7' - }, - { - currencyCode: 'JOE', - currencyName: 'Joe Token', - denominations: [ - { - name: 'JOE', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x6e84a6216eA6dACC71eE8E6b0a5B7322EEbC0fDd' - }, - { - currencyCode: 'FXS', - currencyName: 'Frax Share', - denominations: [ - { - name: 'FXS', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x214DB107654fF987AD859F34125307783fC8e387' - }, - { - currencyCode: 'BUSD.e', - currencyName: 'Binance USD', - denominations: [ - { - name: 'BUSD.e', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x19860CCB0A68fd4213aB9D8266F7bBf05A8dDe98' - }, - { - currencyCode: 'DAI.e', - currencyName: 'Dai Stablecoin', - denominations: [ - { - name: 'DAI.e', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70' - }, - { - currencyCode: 'LINK.e', - currencyName: 'ChainLink Token', - denominations: [ - { - name: 'LINK.e', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x5947BB275c521040051D82396192181b413227A3' - }, - { - currencyCode: 'UNI.e', - currencyName: 'Uniswap', - denominations: [ - { - name: 'UNI.e', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x8eBAf22B6F053dFFeaf46f4Dd9eFA95D89ba8580' - }, - { - currencyCode: 'USDC', - currencyName: 'USD Coin', - denominations: [ - { - name: 'USDC', - multiplier: '1000000' - } - ], - contractAddress: '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E' - }, - { - currencyCode: 'USDC.e', - currencyName: 'USD Coin', - denominations: [ - { - name: 'USDC.e', - multiplier: '1000000' - } - ], - contractAddress: '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664' - }, - { - currencyCode: 'USDT.e', - currencyName: 'Tether USD', - denominations: [ - { - name: 'USDT.e', - multiplier: '1000000' - } - ], - contractAddress: '0xc7198437980c041c805A1EDcbA50c1Ce5db95118' - }, - { - currencyCode: 'WBTC.e', - currencyName: 'Wrapped BTC', - denominations: [ - { - name: 'WBTC.e', - multiplier: '100000000' - } - ], - contractAddress: '0x50b7545627a5162F82A992c33b87aDc75187B218' - } - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const avalanche = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/bscInfo.ts b/src/ethereum/info/bscInfo.ts index db2fb33ae..439de37f7 100644 --- a/src/ethereum/info/bscInfo.ts +++ b/src/ethereum/info/bscInfo.ts @@ -1,8 +1,11 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = {} const defaultNetworkFees: EthereumFees = { default: { @@ -82,12 +85,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'BNB' } ], - metaTokens: [ - // Array of objects describing the supported metatokens - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const binancesmartchain = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/celoInfo.ts b/src/ethereum/info/celoInfo.ts index 6cf3dbc84..fdddabe7c 100644 --- a/src/ethereum/info/celoInfo.ts +++ b/src/ethereum/info/celoInfo.ts @@ -1,8 +1,28 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = { + '765de816845861e75a25fca122bb6898b8b1282a': { + currencyCode: 'CUSD', + displayName: 'Celo Dollar', + denominations: [{ name: 'CUSD', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x765DE816845861e75A25fCA122bb6898B8B1282a' + } + }, + d8763cba276a3738e6de85b4b3bf5fded6d6ca73: { + currencyCode: 'CEUR', + displayName: 'Celo Euro', + denominations: [{ name: 'CEUR', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73' + } + } +} // Fees are in Wei const defaultNetworkFees: EthereumFees = { @@ -87,33 +107,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'CELO' } ], - metaTokens: [ - { - currencyCode: 'CUSD', - currencyName: 'Celo Dollar', - denominations: [ - { - name: 'CUSD', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x765DE816845861e75A25fCA122bb6898B8B1282a' - }, - { - currencyCode: 'CEUR', - currencyName: 'Celo Euro', - denominations: [ - { - name: 'CEUR', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73' - } - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const celo = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/etcInfo.ts b/src/ethereum/info/etcInfo.ts index 4e56f653f..0670bf616 100644 --- a/src/ethereum/info/etcInfo.ts +++ b/src/ethereum/info/etcInfo.ts @@ -1,8 +1,11 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = {} const defaultNetworkFees: EthereumFees = { default: { @@ -111,12 +114,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'mΞ' } ], - metaTokens: [ - // Array of objects describing the supported metatokens - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const ethereumclassic = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/ethDevInfo.ts b/src/ethereum/info/ethDevInfo.ts index aa2b76682..1192e308e 100644 --- a/src/ethereum/info/ethDevInfo.ts +++ b/src/ethereum/info/ethDevInfo.ts @@ -1,8 +1,36 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = { + ff795577d9ac8bd7d90ee22b6c1703490b6512fd: { + currencyCode: 'DAI', + displayName: 'Dai Stablecoin', + denominations: [{ name: 'DAI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xff795577d9ac8bd7d90ee22b6c1703490b6512fd' + } + }, + d0a1e359811322d97991e03f863a0c30c2cf029c: { + currencyCode: 'WETH', + displayName: 'Wrapped ETH', + denominations: [{ name: 'WETH', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xd0a1e359811322d97991e03f863a0c30c2cf029c' + } + }, + d1b98b6607330172f1d991521145a22bce793277: { + currencyCode: 'WBTC', + displayName: 'Wrapped Bitcoin', + denominations: [{ name: 'WBTC', multiplier: '100000000' }], + networkLocation: { + contractAddress: '0xD1B98B6607330172f1D991521145A22BCe793277' + } + } +} const defaultNetworkFees: EthereumFees = { default: { @@ -128,44 +156,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'mΞ' } ], - metaTokens: [ - { - currencyCode: 'DAI', - currencyName: 'Dai Stablecoin', - denominations: [ - { - name: 'DAI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xff795577d9ac8bd7d90ee22b6c1703490b6512fd' - }, - { - currencyCode: 'WETH', - currencyName: 'Wrapped ETH', - denominations: [ - { - name: 'WETH', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xd0a1e359811322d97991e03f863a0c30c2cf029c' - }, - { - currencyCode: 'WBTC', - currencyName: 'Wrapped Bitcoin', - denominations: [ - { - name: 'WBTC', - multiplier: '100000000' - } - ], - contractAddress: '0xD1B98B6607330172f1D991521145A22BCe793277' - } - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const ethDev = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/ethInfo.ts b/src/ethereum/info/ethInfo.ts index ce0b47eed..7cbbabfd2 100644 --- a/src/ethereum/info/ethInfo.ts +++ b/src/ethereum/info/ethInfo.ts @@ -1,761 +1,969 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' -const defaultNetworkFees: EthereumFees = { - default: { - baseFeeMultiplier: { - lowFee: '1', - standardFeeLow: '1.25', - standardFeeHigh: '1.5', - highFee: '1.75' - }, - gasLimit: { - regularTransaction: '21000', - tokenTransaction: '300000', - minGasLimit: '21000' - }, - gasPrice: { - lowFee: '1000000001', - standardFeeLow: '40000000001', - standardFeeHigh: '300000000001', - standardFeeLowAmount: '100000000000000000', - standardFeeHighAmount: '10000000000000000000', - highFee: '40000000001', - minGasPrice: '1000000000' - }, - minPriorityFee: '2000000000' - }, - '1983987abc9837fbabc0982347ad828': { - baseFeeMultiplier: undefined, - // @ts-expect-error - gasLimit: { - regularTransaction: '21002', - tokenTransaction: '37124' - }, - // @ts-expect-error - gasPrice: { - lowFee: '1000000002', - standardFeeLow: '40000000002', - standardFeeHigh: '300000000002', - standardFeeLowAmount: '200000000000000000', - standardFeeHighAmount: '20000000000000000000', - highFee: '40000000002' - }, - minPriorityFee: undefined - }, - '2983987abc9837fbabc0982347ad828': { - baseFeeMultiplier: undefined, - // @ts-expect-error - gasLimit: { - regularTransaction: '21002', - tokenTransaction: '37124' - }, - gasPrice: undefined, - minPriorityFee: undefined - } -} - -const otherSettings: EthereumSettings = { - rpcServers: [ - 'https://eth-mainnet.alchemyapi.io', - 'https://mainnet.infura.io/v3', - 'https://cloudflare-eth.com' - ], - - evmScanApiServers: [ - 'https://api.etherscan.io' - // 'https://blockscout.com/eth/mainnet' // not reliable enough... - ], - blockcypherApiServers: ['https://api.blockcypher.com'], - blockbookServers: [ - 'https://ethbook.guarda.co', - 'https://eth1.trezor.io', - 'https://eth2.trezor.io' - ], - uriNetworks: ['ethereum', 'ether'], - ercTokenStandard: 'ERC20', - chainParams: { - chainId: 1, - name: 'Ethereum Mainnet' - }, - supportsEIP1559: true, - hdPathCoinType: 60, - checkUnconfirmedTransactions: true, - iosAllowedTokens: { - REP: true, - WINGS: true, - HUR: true, - IND: true, - USDT: true - }, - blockchairApiServers: ['https://api.blockchair.com'], - alethioApiServers: ['https://api.aleth.io/v1'], - alethioCurrencies: { - // object or null - native: 'ether', - token: 'token' - }, - amberdataRpcServers: ['https://rpc.web3api.io'], - amberdataApiServers: ['https://web3api.io/api/v2'], - amberDataBlockchainId: '1c9c969065fcd1cf', // ETH mainnet - pluginMnemonicKeyName: 'ethereumMnemonic', - pluginRegularKeyName: 'ethereumKey', - ethGasStationUrl: 'https://www.ethgasstation.info/json/ethgasAPI.json', - defaultNetworkFees -} - -const defaultSettings: any = { - customFeeSettings: ['gasLimit', 'gasPrice'], - otherSettings -} - -export const currencyInfo: EdgeCurrencyInfo = { - // Basic currency information: - currencyCode: 'ETH', - displayName: 'Ethereum', - pluginId: 'ethereum', - walletType: 'wallet:ethereum', - memoType: 'hex', - - canReplaceByFee: true, - defaultSettings, - - addressExplorer: 'https://etherscan.io/address/%s', - transactionExplorer: 'https://etherscan.io/tx/%s', - - denominations: [ - // An array of Objects of the possible denominations for this currency - { - name: 'ETH', - multiplier: '1000000000000000000', - symbol: 'Ξ' - }, - { - name: 'mETH', - multiplier: '1000000000000000', - symbol: 'mΞ' - } - ], - metaTokens: [ - { - currencyCode: '1INCH', - currencyName: '1inch', - denominations: [{ name: '1INCH', multiplier: '1000000000000000000' }], +const builtinTokens: EdgeTokenMap = { + '111111111117dc0aa78b770fa6a738034120c302': { + currencyCode: '1INCH', + displayName: '1inch', + denominations: [{ name: '1INCH', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x111111111117dc0aa78b770fa6a738034120c302' - }, - { - currencyCode: 'AAVE', - currencyName: 'Aave', - denominations: [{ name: 'AAVE', multiplier: '1000000000000000000' }], + } + }, + '7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9': { + currencyCode: 'AAVE', + displayName: 'Aave', + denominations: [{ name: 'AAVE', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9' - }, - { - currencyCode: 'ABAT', - currencyName: 'Aave Interest Bearing BAT', - denominations: [{ name: 'ABAT', multiplier: '1000000000000000000' }], + } + }, + '05ec93c0365baaeabf7aeffb0972ea7ecdd39cf1': { + currencyCode: 'ABAT', + displayName: 'Aave Interest Bearing BAT', + denominations: [{ name: 'ABAT', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x05ec93c0365baaeabf7aeffb0972ea7ecdd39cf1' - }, - { - currencyCode: 'ADAI', - currencyName: 'Aave Interest Bearing Dai', - denominations: [{ name: 'ADAI', multiplier: '1000000000000000000' }], + } + }, + '028171bca77440897b824ca71d1c56cac55b68a3': { + currencyCode: 'ADAI', + displayName: 'Aave Interest Bearing Dai', + denominations: [{ name: 'ADAI', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x028171bCA77440897B824Ca71D1c56caC55b68A3' - }, - { - currencyCode: 'AKNC', - currencyName: 'Aave Interest Bearing KNC', - denominations: [{ name: 'AKNC', multiplier: '1000000000000000000' }], + } + }, + '39c6b3e42d6a679d7d776778fe880bc9487c2eda': { + currencyCode: 'AKNC', + displayName: 'Aave Interest Bearing KNC', + denominations: [{ name: 'AKNC', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x39c6b3e42d6a679d7d776778fe880bc9487c2eda' - }, - { - currencyCode: 'ALINK', - currencyName: 'Aave Interest Bearing LINK', - denominations: [{ name: 'ALINK', multiplier: '1000000000000000000' }], + } + }, + a06bc25b5805d5f8d82847d191cb4af5a3e873e0: { + currencyCode: 'ALINK', + displayName: 'Aave Interest Bearing LINK', + denominations: [{ name: 'ALINK', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xa06bc25b5805d5f8d82847d191cb4af5a3e873e0' - }, - { - currencyCode: 'AMANA', - currencyName: 'Aave Interest Bearing MANA', - denominations: [{ name: 'AMANA', multiplier: '1000000000000000000' }], + } + }, + a685a61171bb30d4072b338c80cb7b2c865c873e: { + currencyCode: 'AMANA', + displayName: 'Aave Interest Bearing MANA', + denominations: [{ name: 'AMANA', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xa685a61171bb30d4072b338c80cb7b2c865c873e' - }, - { - currencyCode: 'AMKR', - currencyName: 'Aave Interest Bearing MKR', - denominations: [{ name: 'AMKR', multiplier: '1000000000000000000' }], + } + }, + c713e5e149d5d0715dcd1c156a020976e7e56b88: { + currencyCode: 'AMKR', + displayName: 'Aave Interest Bearing MKR', + denominations: [{ name: 'AMKR', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xc713e5e149d5d0715dcd1c156a020976e7e56b88' - }, - { - currencyCode: 'AMPL', - currencyName: 'Ampleforth', - denominations: [{ name: 'AMPL', multiplier: '1000000000' }], + } + }, + d46ba6d942050d489dbd938a2c909a5d5039a161: { + currencyCode: 'AMPL', + displayName: 'Ampleforth', + denominations: [{ name: 'AMPL', multiplier: '1000000000' }], + networkLocation: { contractAddress: '0xd46ba6d942050d489dbd938a2c909a5d5039a161' - }, - { - currencyCode: 'ANT', - currencyName: 'Aragon', - denominations: [{ name: 'ANT', multiplier: '1000000000000000000' }], + } + }, + a117000000f279d81a1d3cc75430faa017fa5a2e: { + currencyCode: 'ANT', + displayName: 'Aragon', + denominations: [{ name: 'ANT', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xa117000000f279D81A1D3cc75430fAA017FA5A2e' - }, - { - currencyCode: 'ANTV1', - currencyName: 'Aragon', - denominations: [{ name: 'ANTV1', multiplier: '1000000000000000000' }], + } + }, + '960b236a07cf122663c4303350609a66a7b288c0': { + currencyCode: 'ANTV1', + displayName: 'Aragon', + denominations: [{ name: 'ANTV1', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x960b236A07cf122663c4303350609A66A7B288C0' - }, - { - currencyCode: 'AREN', - currencyName: 'Aave Interest Bearing REN', - denominations: [{ name: 'AREN', multiplier: '1000000000000000000' }], + } + }, + cc12abe4ff81c9378d670de1b57f8e0dd228d77a: { + currencyCode: 'AREN', + displayName: 'Aave Interest Bearing REN', + denominations: [{ name: 'AREN', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xcc12abe4ff81c9378d670de1b57f8e0dd228d77a' - }, - { - currencyCode: 'ASNX', - currencyName: 'Aave Interest Bearing SNX', - denominations: [{ name: 'ASNX', multiplier: '1000000000000000000' }], + } + }, + '35f6b052c598d933d69a4eec4d04c73a191fe6c2': { + currencyCode: 'ASNX', + displayName: 'Aave Interest Bearing SNX', + denominations: [{ name: 'ASNX', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x35f6b052c598d933d69a4eec4d04c73a191fe6c2' - }, - { - currencyCode: 'ASUSD', - currencyName: 'Aave Interest Bearing SUSD', - denominations: [{ name: 'ASUSD', multiplier: '1000000000000000000' }], + } + }, + '6c5024cd4f8a59110119c56f8933403a539555eb': { + currencyCode: 'ASUSD', + displayName: 'Aave Interest Bearing SUSD', + denominations: [{ name: 'ASUSD', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x6c5024cd4f8a59110119c56f8933403a539555eb' - }, - { - currencyCode: 'AUNI', - currencyName: 'Aave Interest Bearing UNI', - denominations: [{ name: 'AUNI', multiplier: '1000000000000000000' }], + } + }, + b9d7cb55f463405cdfbe4e90a6d2df01c2b92bf1: { + currencyCode: 'AUNI', + displayName: 'Aave Interest Bearing UNI', + denominations: [{ name: 'AUNI', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xb9d7cb55f463405cdfbe4e90a6d2df01c2b92bf1' - }, - { - currencyCode: 'AUSDC', - currencyName: 'Aave Interest Bearing USDC', - denominations: [{ name: 'AUSDC', multiplier: '1000000' }], + } + }, + bcca60bb61934080951369a648fb03df4f96263c: { + currencyCode: 'AUSDC', + displayName: 'Aave Interest Bearing USDC', + denominations: [{ name: 'AUSDC', multiplier: '1000000' }], + networkLocation: { contractAddress: '0xbcca60bb61934080951369a648fb03df4f96263c' - }, - { - currencyCode: 'AUSDT', - currencyName: 'Aave Interest Bearing USDT', - denominations: [{ name: 'AUSDT', multiplier: '1000000' }], + } + }, + '3ed3b47dd13ec9a98b44e6204a523e766b225811': { + currencyCode: 'AUSDT', + displayName: 'Aave Interest Bearing USDT', + denominations: [{ name: 'AUSDT', multiplier: '1000000' }], + networkLocation: { contractAddress: '0x3ed3b47dd13ec9a98b44e6204a523e766b225811' - }, - { - currencyCode: 'AWBTC', - currencyName: 'Aave Interest Bearing Wrapped BTC', - denominations: [{ name: 'AWBTC', multiplier: '100000000' }], + } + }, + '9ff58f4ffb29fa2266ab25e75e2a8b3503311656': { + currencyCode: 'AWBTC', + displayName: 'Aave Interest Bearing Wrapped BTC', + denominations: [{ name: 'AWBTC', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x9ff58f4ffb29fa2266ab25e75e2a8b3503311656' - }, - { - currencyCode: 'AWETH', - currencyName: 'Aave Interest Bearing Wrapped ETH', - denominations: [{ name: 'AWETH', multiplier: '1000000000000000000' }], + } + }, + '030ba81f1c18d280636f32af80b9aad02cf0854e': { + currencyCode: 'AWETH', + displayName: 'Aave Interest Bearing Wrapped ETH', + denominations: [{ name: 'AWETH', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x030ba81f1c18d280636f32af80b9aad02cf0854e' - }, - { - currencyCode: 'AYFI', - currencyName: 'Aave Interest Bearing YFI', - denominations: [{ name: 'AYFI', multiplier: '1000000000000000000' }], + } + }, + '5165d24277cd063f5ac44efd447b27025e888f37': { + currencyCode: 'AYFI', + displayName: 'Aave Interest Bearing YFI', + denominations: [{ name: 'AYFI', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x5165d24277cd063f5ac44efd447b27025e888f37' - }, - { - currencyCode: 'AZRX', - currencyName: 'Aave Interest Bearing ZRX', - denominations: [{ name: 'AZRX', multiplier: '1000000000000000000' }], + } + }, + df7ff54aacacbff42dfe29dd6144a69b629f8c9e: { + currencyCode: 'AZRX', + displayName: 'Aave Interest Bearing ZRX', + denominations: [{ name: 'AZRX', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xdf7ff54aacacbff42dfe29dd6144a69b629f8c9e' - }, - { - currencyCode: 'BADGER', - currencyName: 'Badger', - denominations: [{ name: 'BADGER', multiplier: '1000000000000000000' }], + } + }, + '3472a5a71965499acd81997a54bba8d852c6e53d': { + currencyCode: 'BADGER', + displayName: 'Badger', + denominations: [{ name: 'BADGER', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x3472A5A71965499acd81997a54BBA8D852C6E53d' - }, - { - currencyCode: 'BAL', - currencyName: 'Balancer', - denominations: [{ name: 'BAL', multiplier: '1000000000000000000' }], + } + }, + ba100000625a3754423978a60c9317c58a424e3d: { + currencyCode: 'BAL', + displayName: 'Balancer', + denominations: [{ name: 'BAL', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xba100000625a3754423978a60c9317c58a424e3d' - }, - { - currencyCode: 'BAND', - currencyName: 'BAND', - denominations: [{ name: 'BAND', multiplier: '1000000000000000000' }], + } + }, + ba11d00c5f74255f56a5e366f4f77f5a186d7f55: { + currencyCode: 'BAND', + displayName: 'BAND', + denominations: [{ name: 'BAND', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xba11d00c5f74255f56a5e366f4f77f5a186d7f55' - }, - { - currencyCode: 'BAT', - currencyName: 'Basic Attention Token', - denominations: [{ name: 'BAT', multiplier: '1000000000000000000' }], + } + }, + '0d8775f648430679a709e98d2b0cb6250d2887ef': { + currencyCode: 'BAT', + displayName: 'Basic Attention Token', + denominations: [{ name: 'BAT', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x0D8775F648430679A709E98d2b0Cb6250d2887EF' - }, - { - currencyCode: 'BNB', - currencyName: 'Binance', - denominations: [{ name: 'BNB', multiplier: '1000000000000000000' }], + } + }, + b8c77482e45f1f44de1745f52c74426c631bdd52: { + currencyCode: 'BNB', + displayName: 'Binance', + denominations: [{ name: 'BNB', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' - }, - { - currencyCode: 'BNT', - currencyName: 'Bancor', - denominations: [{ name: 'BNT', multiplier: '1000000000000000000' }], + } + }, + '1f573d6fb3f13d689ff844b4ce37794d79a7ff1c': { + currencyCode: 'BNT', + displayName: 'Bancor', + denominations: [{ name: 'BNT', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C' - }, - { - currencyCode: 'BRZ', - currencyName: 'BRZ Token', - denominations: [{ name: 'BRZ', multiplier: '10000' }], + } + }, + '420412e765bfa6d85aaac94b4f7b708c89be2e2b': { + currencyCode: 'BRZ', + displayName: 'BRZ Token', + denominations: [{ name: 'BRZ', multiplier: '10000' }], + networkLocation: { contractAddress: '0x420412E765BFa6d85aaaC94b4f7b708C89be2e2B' - }, - { - currencyCode: 'CBAT', - currencyName: 'Compound BAT', - denominations: [{ name: 'CBAT', multiplier: '100000000' }], + } + }, + '6c8c6b02e7b2be14d4fa6022dfd6d75921d90e4e': { + currencyCode: 'CBAT', + displayName: 'Compound BAT', + denominations: [{ name: 'CBAT', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x6c8c6b02e7b2be14d4fa6022dfd6d75921d90e4e' - }, - { - currencyCode: 'CDAI', - currencyName: 'Compound DAI', - denominations: [{ name: 'CDAI', multiplier: '100000000' }], + } + }, + '5d3a536e4d6dbd6114cc1ead35777bab948e3643': { + currencyCode: 'CDAI', + displayName: 'Compound DAI', + denominations: [{ name: 'CDAI', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643' - }, - { - currencyCode: 'CETH', - currencyName: 'Compound ETH', - denominations: [{ name: 'CETH', multiplier: '100000000' }], + } + }, + '4ddc2d193948926d02f9b1fe9e1daa0718270ed5': { + currencyCode: 'CETH', + displayName: 'Compound ETH', + denominations: [{ name: 'CETH', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5' - }, - { - currencyCode: 'COMBO', - currencyName: 'COMBO', - denominations: [{ name: 'COMBO', multiplier: '1000000000000000000' }], + } + }, + ffffffff2ba8f66d4e51811c5190992176930278: { + currencyCode: 'COMBO', + displayName: 'COMBO', + denominations: [{ name: 'COMBO', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xffffffff2ba8f66d4e51811c5190992176930278' - }, - { - currencyCode: 'COMP', - currencyName: 'Compound', - denominations: [{ name: 'COMP', multiplier: '1000000000000000000' }], + } + }, + c00e94cb662c3520282e6f5717214004a7f26888: { + currencyCode: 'COMP', + displayName: 'Compound', + denominations: [{ name: 'COMP', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xc00e94cb662c3520282e6f5717214004a7f26888' - }, - { - currencyCode: 'CREAM', - currencyName: 'Cream', - denominations: [{ name: 'CREAM', multiplier: '1000000000000000000' }], + } + }, + '2ba592f78db6436527729929aaf6c908497cb200': { + currencyCode: 'CREAM', + displayName: 'Cream', + denominations: [{ name: 'CREAM', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x2ba592F78dB6436527729929AAf6c908497cB200' - }, - { - currencyCode: 'CREP', - currencyName: 'Compound Augur', - denominations: [{ name: 'CREP', multiplier: '100000000' }], + } + }, + '158079ee67fce2f58472a96584a73c7ab9ac95c1': { + currencyCode: 'CREP', + displayName: 'Compound Augur', + denominations: [{ name: 'CREP', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x158079ee67fce2f58472a96584a73c7ab9ac95c1' - }, - { - currencyCode: 'CRV', - currencyName: 'Curve DAO Token', - denominations: [{ name: 'CRV', multiplier: '1000000000000000000' }], + } + }, + d533a949740bb3306d119cc777fa900ba034cd52: { + currencyCode: 'CRV', + displayName: 'Curve DAO Token', + denominations: [{ name: 'CRV', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xD533a949740bb3306d119CC777fa900bA034cd52' - }, - { - currencyCode: 'CSAI', - currencyName: 'Compound SAI', - denominations: [{ name: 'CSAI', multiplier: '100000000' }], + } + }, + f5dce57282a584d2746faf1593d3121fcac444dc: { + currencyCode: 'CSAI', + displayName: 'Compound SAI', + denominations: [{ name: 'CSAI', multiplier: '100000000' }], + networkLocation: { contractAddress: '0xf5dce57282a584d2746faf1593d3121fcac444dc' - }, - { - currencyCode: 'CUSDC', - currencyName: 'Compound USDC', - denominations: [{ name: 'CUSDC', multiplier: '100000000' }], + } + }, + '39aa39c021dfbae8fac545936693ac917d5e7563': { + currencyCode: 'CUSDC', + displayName: 'Compound USDC', + denominations: [{ name: 'CUSDC', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x39aa39c021dfbae8fac545936693ac917d5e7563' - }, - { - currencyCode: 'CVP', - currencyName: 'Concentrated Voting Power', - denominations: [{ name: 'CVP', multiplier: '1000000000000000000' }], + } + }, + '38e4adb44ef08f22f5b5b76a8f0c2d0dcbe7dca1': { + currencyCode: 'CVP', + displayName: 'Concentrated Voting Power', + denominations: [{ name: 'CVP', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x38e4adb44ef08f22f5b5b76a8f0c2d0dcbe7dca1' - }, - { - currencyCode: 'CWBTC', - currencyName: 'Compound WBTC', - denominations: [{ name: 'CWBTC', multiplier: '100000000' }], + } + }, + c11b1268c1a384e55c48c2391d8d480264a3a7f4: { + currencyCode: 'CWBTC', + displayName: 'Compound WBTC', + denominations: [{ name: 'CWBTC', multiplier: '100000000' }], + networkLocation: { contractAddress: '0xc11b1268c1a384e55c48c2391d8d480264a3a7f4' - }, - { - currencyCode: 'CZRX', - currencyName: 'Compound ZRX', - denominations: [{ name: 'CZRX', multiplier: '100000000' }], + } + }, + b3319f5d18bc0d84dd1b4825dcde5d5f7266d407: { + currencyCode: 'CZRX', + displayName: 'Compound ZRX', + denominations: [{ name: 'CZRX', multiplier: '100000000' }], + networkLocation: { contractAddress: '0xb3319f5d18bc0d84dd1b4825dcde5d5f7266d407' - }, - { - currencyCode: 'DAI', - currencyName: 'Dai Stablecoin', - denominations: [{ name: 'DAI', multiplier: '1000000000000000000' }], + } + }, + '6b175474e89094c44da98b954eedeac495271d0f': { + currencyCode: 'DAI', + displayName: 'Dai Stablecoin', + denominations: [{ name: 'DAI', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x6B175474E89094C44Da98b954EedeAC495271d0F' - }, - { - currencyCode: 'DOUGH', - currencyName: 'PieDAO', - denominations: [{ name: 'DOUGH', multiplier: '1000000000000000000' }], + } + }, + ad32a8e6220741182940c5abf610bde99e737b2d: { + currencyCode: 'DOUGH', + displayName: 'PieDAO', + denominations: [{ name: 'DOUGH', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xad32a8e6220741182940c5abf610bde99e737b2d' - }, - { - currencyCode: 'DPI', - currencyName: 'DefiPulse Index', - denominations: [{ name: 'DPI', multiplier: '1000000000000000000' }], + } + }, + '1494ca1f11d487c2bbe4543e90080aeba4ba3c2b': { + currencyCode: 'DPI', + displayName: 'DefiPulse Index', + denominations: [{ name: 'DPI', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x1494ca1f11d487c2bbe4543e90080aeba4ba3c2b' - }, - { - currencyCode: 'ETHBNT', - currencyName: 'BNT Smart Token Relay', - denominations: [{ name: 'ETHBNT', multiplier: '1000000000000000000' }], + } + }, + b1cd6e4153b2a390cf00a6556b0fc1458c4a5533: { + currencyCode: 'ETHBNT', + displayName: 'BNT Smart Token Relay', + denominations: [{ name: 'ETHBNT', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xb1CD6e4153B2a390Cf00A6556b0fC1458C4A5533' - }, - { - currencyCode: 'FTM', - currencyName: 'Fantom', - denominations: [{ name: 'FTM', multiplier: '1000000000000000000' }], + } + }, + '4e15361fd6b4bb609fa63c81a2be19d873717870': { + currencyCode: 'FTM', + displayName: 'Fantom', + denominations: [{ name: 'FTM', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x4e15361fd6b4bb609fa63c81a2be19d873717870' - }, - { - currencyCode: 'FUN', - currencyName: 'FunFair', - denominations: [{ name: 'FUN', multiplier: '100000000' }], + } + }, + '419d0d8bdd9af5e606ae2232ed285aff190e711b': { + currencyCode: 'FUN', + displayName: 'FunFair', + denominations: [{ name: 'FUN', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x419D0d8BdD9aF5e606Ae2232ed285Aff190E711b' - }, - { - currencyCode: 'GLM', - currencyName: 'Golem', - denominations: [{ name: 'GLM', multiplier: '1000000000000000000' }], + } + }, + '7dd9c5cba05e151c895fde1cf355c9a1d5da6429': { + currencyCode: 'GLM', + displayName: 'Golem', + denominations: [{ name: 'GLM', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x7DD9c5Cba05E151C895FDe1CF355C9A1D5DA6429' - }, - { - currencyCode: 'GNO', - currencyName: 'Gnosis', - denominations: [{ name: 'GNO', multiplier: '1000000000000000000' }], + } + }, + '6810e776880c02933d47db1b9fc05908e5386b96': { + currencyCode: 'GNO', + displayName: 'Gnosis', + denominations: [{ name: 'GNO', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x6810e776880C02933D47DB1b9fc05908e5386b96' - }, - { - currencyCode: 'GNT', - currencyName: 'Golem (old)', - denominations: [{ name: 'GNT', multiplier: '1000000000000000000' }], + } + }, + a74476443119a942de498590fe1f2454d7d4ac0d: { + currencyCode: 'GNT', + displayName: 'Golem (old)', + denominations: [{ name: 'GNT', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xa74476443119A942dE498590Fe1f2454d7D4aC0d' - }, - { - currencyCode: 'GUSD', - currencyName: 'Gemini Dollar', - denominations: [{ name: 'GUSD', multiplier: '100' }], + } + }, + '056fd409e1d7a124bd7017459dfea2f387b6d5cd': { + currencyCode: 'GUSD', + displayName: 'Gemini Dollar', + denominations: [{ name: 'GUSD', multiplier: '100' }], + networkLocation: { contractAddress: '0x056fd409e1d7a124bd7017459dfea2f387b6d5cd' - }, - { - currencyCode: 'HERC', - currencyName: 'Hercules', - denominations: [{ name: 'HERC', multiplier: '1000000000000000000' }], + } + }, + '2e91e3e54c5788e9fdd6a181497fdcea1de1bcc1': { + currencyCode: 'HERC', + displayName: 'Hercules', + denominations: [{ name: 'HERC', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x2e91E3e54C5788e9FdD6A181497FDcEa1De1bcc1' - }, - { - currencyCode: 'HUR', - currencyName: 'Hurify', - denominations: [{ name: 'HUR', multiplier: '1000000000000000000' }], + } + }, + cdb7ecfd3403eef3882c65b761ef9b5054890a47: { + currencyCode: 'HUR', + displayName: 'Hurify', + denominations: [{ name: 'HUR', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xCDB7eCFd3403Eef3882c65B761ef9B5054890a47' - }, - { - currencyCode: 'IDLE', - currencyName: 'Idle Finance', - denominations: [{ name: 'IDLE', multiplier: '1000000000000000000' }], + } + }, + '875773784af8135ea0ef43b5a374aad105c5d39e': { + currencyCode: 'IDLE', + displayName: 'Idle Finance', + denominations: [{ name: 'IDLE', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x875773784Af8135eA0ef43b5a374AaD105c5D39e' - }, - { - currencyCode: 'IND', - currencyName: 'Indorse', - denominations: [{ name: 'IND', multiplier: '1000000000000000000' }], + } + }, + f8e386eda857484f5a12e4b5daa9984e06e73705: { + currencyCode: 'IND', + displayName: 'Indorse', + denominations: [{ name: 'IND', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xf8e386EDa857484f5a12e4B5DAa9984E06E73705' - }, - { - currencyCode: 'INDEX', - currencyName: 'INDEX COOP', - denominations: [{ name: 'INDEX', multiplier: '1000000000000000000' }], + } + }, + '0954906da0bf32d5479e25f46056d22f08464cab': { + currencyCode: 'INDEX', + displayName: 'INDEX COOP', + denominations: [{ name: 'INDEX', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x0954906da0Bf32d5479e25f46056d22f08464cab' - }, - { - currencyCode: 'KIN', - currencyName: 'Kin', - denominations: [{ name: 'KIN', multiplier: '1000000000000000000' }], + } + }, + '818fc6c2ec5986bc6e2cbf00939d90556ab12ce5': { + currencyCode: 'KIN', + displayName: 'Kin', + denominations: [{ name: 'KIN', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x818Fc6C2Ec5986bc6E2CBf00939d90556aB12ce5' - }, - { - currencyCode: 'KNCV1', - currencyName: 'Kyber Network', - denominations: [{ name: 'KNCV1', multiplier: '1000000000000000000' }], + } + }, + dd974d5c2e2928dea5f71b9825b8b646686bd200: { + currencyCode: 'KNCV1', + displayName: 'Kyber Network', + denominations: [{ name: 'KNCV1', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xdd974D5C2e2928deA5F71b9825b8b646686BD200' - }, - { - currencyCode: 'KNC', - currencyName: 'Kyber Network', - denominations: [{ name: 'KNC', multiplier: '1000000000000000000' }], + } + }, + defa4e8a7bcba345f687a2f1456f5edd9ce97202: { + currencyCode: 'KNC', + displayName: 'Kyber Network', + denominations: [{ name: 'KNC', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xdeFA4e8a7bcBA345F687a2f1456F5Edd9CE97202' - }, - { - currencyCode: 'LINK', - currencyName: 'Chainlink', - denominations: [{ name: 'LINK', multiplier: '1000000000000000000' }], + } + }, + '514910771af9ca656af840dff83e8264ecf986ca': { + currencyCode: 'LINK', + displayName: 'Chainlink', + denominations: [{ name: 'LINK', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x514910771af9ca656af840dff83e8264ecf986ca' - }, - { - currencyCode: 'MANA', - currencyName: 'Decentraland', - denominations: [{ name: 'MANA', multiplier: '1000000000000000000' }], + } + }, + '0f5d2fb29fb7d3cfee444a200298f468908cc942': { + currencyCode: 'MANA', + displayName: 'Decentraland', + denominations: [{ name: 'MANA', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x0F5D2fB29fb7d3CFeE444a200298f468908cC942' - }, - { - currencyCode: 'MATIC', - currencyName: 'Polygon', - denominations: [{ name: 'MATIC', multiplier: '1000000000000000000' }], + } + }, + '7d1afa7b718fb893db30a3abc0cfc608aacfebb0': { + currencyCode: 'MATIC', + displayName: 'Polygon', + denominations: [{ name: 'MATIC', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0' - }, - { - currencyCode: 'MET', - currencyName: 'Metronome', - denominations: [{ name: 'MET', multiplier: '1000000000000000000' }], + } + }, + a3d58c4e56fedcae3a7c43a725aee9a71f0ece4e: { + currencyCode: 'MET', + displayName: 'Metronome', + denominations: [{ name: 'MET', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xa3d58c4e56fedcae3a7c43a725aee9a71f0ece4e' - }, - { - currencyCode: 'MKR', - currencyName: 'Maker', - denominations: [{ name: 'MKR', multiplier: '1000000000000000000' }], + } + }, + '9f8f72aa9304c8b593d555f12ef6589cc3a579a2': { + currencyCode: 'MKR', + displayName: 'Maker', + denominations: [{ name: 'MKR', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2' - }, - { - currencyCode: 'NEXO', - currencyName: 'Nexo', - denominations: [{ name: 'NEXO', multiplier: '1000000000000000000' }], + } + }, + b62132e35a6c13ee1ee0f84dc5d40bad8d815206: { + currencyCode: 'NEXO', + displayName: 'Nexo', + denominations: [{ name: 'NEXO', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xb62132e35a6c13ee1ee0f84dc5d40bad8d815206' - }, - { - currencyCode: 'NMR', - currencyName: 'Numeraire', - denominations: [{ name: 'NMR', multiplier: '1000000000000000000' }], + } + }, + '1776e1f26f98b1a5df9cd347953a26dd3cb46671': { + currencyCode: 'NMR', + displayName: 'Numeraire', + denominations: [{ name: 'NMR', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671' - }, - { - currencyCode: 'NOW', - currencyName: 'NOW Token', - denominations: [{ name: 'NOW', multiplier: '100000000' }], + } + }, + e9a95d175a5f4c9369f3b74222402eb1b837693b: { + currencyCode: 'NOW', + displayName: 'NOW Token', + denominations: [{ name: 'NOW', multiplier: '100000000' }], + networkLocation: { contractAddress: '0xe9a95d175a5f4c9369f3b74222402eb1b837693b' - }, - { - currencyCode: 'NXM', - currencyName: 'Nexus Mutual', - denominations: [{ name: 'NXM', multiplier: '1000000000000000000' }], + } + }, + d7c49cee7e9188cca6ad8ff264c1da2e69d4cf3b: { + currencyCode: 'NXM', + displayName: 'Nexus Mutual', + denominations: [{ name: 'NXM', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xd7c49cee7e9188cca6ad8ff264c1da2e69d4cf3b' - }, - { - currencyCode: 'OCEAN', - currencyName: 'OCEAN', - denominations: [{ name: 'OCEAN', multiplier: '1000000000000000000' }], + } + }, + '967da4048cd07ab37855c090aaf366e4ce1b9f48': { + currencyCode: 'OCEAN', + displayName: 'OCEAN', + denominations: [{ name: 'OCEAN', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x967da4048cD07aB37855c090aAF366e4ce1b9F48' - }, - { - currencyCode: 'OGN', - currencyName: 'Origin', - denominations: [{ name: 'OGN', multiplier: '1000000000000000000' }], + } + }, + '8207c1ffc5b6804f6024322ccf34f29c3541ae26': { + currencyCode: 'OGN', + displayName: 'Origin', + denominations: [{ name: 'OGN', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x8207c1ffc5b6804f6024322ccf34f29c3541ae26' - }, - { - currencyCode: 'OMG', - currencyName: 'OmiseGO', - denominations: [{ name: 'OMG', multiplier: '1000000000000000000' }], + } + }, + d26114cd6ee289accf82350c8d8487fedb8a0c07: { + currencyCode: 'OMG', + displayName: 'OmiseGO', + denominations: [{ name: 'OMG', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xd26114cd6EE289AccF82350c8d8487fedB8A0C07' - }, - { - currencyCode: 'OXT', - currencyName: 'Orchid', - denominations: [{ name: 'OXT', multiplier: '1000000000000000000' }], + } + }, + '4575f41308ec1483f3d399aa9a2826d74da13deb': { + currencyCode: 'OXT', + displayName: 'Orchid', + denominations: [{ name: 'OXT', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x4575f41308EC1483f3d399aa9a2826d74Da13Deb' - }, - { - currencyCode: 'PICKLE', - currencyName: 'PickleToken', - denominations: [{ name: 'PICKLE', multiplier: '1000000000000000000' }], + } + }, + '429881672b9ae42b8eba0e26cd9c73711b891ca5': { + currencyCode: 'PICKLE', + displayName: 'PickleToken', + denominations: [{ name: 'PICKLE', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x429881672B9AE42b8EbA0E26cD9C73711b891Ca5' - }, - { - currencyCode: 'POLY', - currencyName: 'Polymath Network', - denominations: [{ name: 'POLY', multiplier: '1000000000000000000' }], + } + }, + '9992ec3cf6a55b00978cddf2b27bc6882d88d1ec': { + currencyCode: 'POLY', + displayName: 'Polymath Network', + denominations: [{ name: 'POLY', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x9992eC3cF6A55b00978cdDF2b27BC6882d88D1eC' - }, - { - currencyCode: 'REN', - currencyName: 'Ren', - denominations: [{ name: 'REN', multiplier: '1000000000000000000' }], + } + }, + '408e41876cccdc0f92210600ef50372656052a38': { + currencyCode: 'REN', + displayName: 'Ren', + denominations: [{ name: 'REN', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x408e41876cccdc0f92210600ef50372656052a38' - }, - { - currencyCode: 'RENBCH', - currencyName: 'Ren BCH', - denominations: [{ name: 'RENBCH', multiplier: '100000000' }], + } + }, + '459086f2376525bdceba5bdda135e4e9d3fef5bf': { + currencyCode: 'RENBCH', + displayName: 'Ren BCH', + denominations: [{ name: 'RENBCH', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x459086f2376525bdceba5bdda135e4e9d3fef5bf' - }, - { - currencyCode: 'RENBTC', - currencyName: 'Ren BTC', - denominations: [{ name: 'RENBTC', multiplier: '100000000' }], + } + }, + eb4c2781e4eba804ce9a9803c67d0893436bb27d: { + currencyCode: 'RENBTC', + displayName: 'Ren BTC', + denominations: [{ name: 'RENBTC', multiplier: '100000000' }], + networkLocation: { contractAddress: '0xeb4c2781e4eba804ce9a9803c67d0893436bb27d' - }, - { - currencyCode: 'RENZEC', - currencyName: 'Ren ZEC', - denominations: [{ name: 'RENZEC', multiplier: '100000000' }], + } + }, + '1c5db575e2ff833e46a2e9864c22f4b22e0b37c2': { + currencyCode: 'RENZEC', + displayName: 'Ren ZEC', + denominations: [{ name: 'RENZEC', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x1c5db575e2ff833e46a2e9864c22f4b22e0b37c2' - }, - { - currencyCode: 'REP', - currencyName: 'Augur', - denominations: [{ name: 'REP', multiplier: '1000000000000000000' }], + } + }, + '1985365e9f78359a9b6ad760e32412f4a445e862': { + currencyCode: 'REP', + displayName: 'Augur', + denominations: [{ name: 'REP', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x1985365e9f78359a9B6AD760e32412f4a445E862' - }, - { - currencyCode: 'REPV2', - currencyName: 'Augur v2', - denominations: [{ name: 'REPV2', multiplier: '1000000000000000000' }], + } + }, + '221657776846890989a759ba2973e427dff5c9bb': { + currencyCode: 'REPV2', + displayName: 'Augur v2', + denominations: [{ name: 'REPV2', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x221657776846890989a759BA2973e427DfF5C9bB' - }, - { - currencyCode: 'ROOK', - currencyName: 'Keeper DAO', - denominations: [{ name: 'ROOK', multiplier: '1000000000000000000' }], + } + }, + fa5047c9c78b8877af97bdcb85db743fd7313d4a: { + currencyCode: 'ROOK', + displayName: 'Keeper DAO', + denominations: [{ name: 'ROOK', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xfA5047c9c78B8877af97BDcb85Db743fD7313d4a' - }, - { - currencyCode: 'SAI', - currencyName: 'Sai Stablecoin', - denominations: [{ name: 'SAI', multiplier: '1000000000000000000' }], + } + }, + '89d24a6b4ccb1b6faa2625fe562bdd9a23260359': { + currencyCode: 'SAI', + displayName: 'Sai Stablecoin', + denominations: [{ name: 'SAI', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359' - }, - { - currencyCode: 'SALT', - currencyName: 'SALT', - denominations: [{ name: 'SALT', multiplier: '100000000' }], + } + }, + '4156d3342d5c385a87d264f90653733592000581': { + currencyCode: 'SALT', + displayName: 'SALT', + denominations: [{ name: 'SALT', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x4156D3342D5c385a87D264F90653733592000581' - }, - { - currencyCode: 'SBTC', - currencyName: 'Synthetix BTC', - denominations: [{ name: 'SBTC', multiplier: '1000000000000000000' }], + } + }, + fe18be6b3bd88a2d2a7f928d00292e7a9963cfc6: { + currencyCode: 'SBTC', + displayName: 'Synthetix BTC', + denominations: [{ name: 'SBTC', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xfE18be6b3Bd88A2D2A7f928d00292E7a9963CfC6' - }, - { - currencyCode: 'SNX', - currencyName: 'Synthetix Network', - denominations: [{ name: 'SNX', multiplier: '1000000000000000000' }], + } + }, + c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f: { + currencyCode: 'SNX', + displayName: 'Synthetix Network', + denominations: [{ name: 'SNX', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f' - }, - { - currencyCode: 'STORJ', - currencyName: 'Storj', - denominations: [{ name: 'STORJ', multiplier: '100000000' }], + } + }, + b64ef51c888972c908cfacf59b47c1afbc0ab8ac: { + currencyCode: 'STORJ', + displayName: 'Storj', + denominations: [{ name: 'STORJ', multiplier: '100000000' }], + networkLocation: { contractAddress: '0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC' - }, - { - currencyCode: 'SUSD', - currencyName: 'Synthetix USD', - denominations: [{ name: 'SUSD', multiplier: '1000000000000000000' }], + } + }, + '57ab1ec28d129707052df4df418d58a2d46d5f51': { + currencyCode: 'SUSD', + displayName: 'Synthetix USD', + denominations: [{ name: 'SUSD', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x57Ab1ec28D129707052df4dF418D58a2D46d5f51' - }, - { - currencyCode: 'SUSHI', - currencyName: 'Sushi Token', - denominations: [{ name: 'SUSHI', multiplier: '1000000000000000000' }], + } + }, + '6b3595068778dd592e39a122f4f5a5cf09c90fe2': { + currencyCode: 'SUSHI', + displayName: 'Sushi Token', + denominations: [{ name: 'SUSHI', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x6b3595068778dd592e39a122f4f5a5cf09c90fe2' - }, - { - currencyCode: 'TBTC', - currencyName: 'tBTC', - denominations: [{ name: 'TBTC', multiplier: '1000000000000000000' }], + } + }, + '8daebade922df735c38c80c7ebd708af50815faa': { + currencyCode: 'TBTC', + displayName: 'tBTC', + denominations: [{ name: 'TBTC', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x8dAEBADE922dF735c38C80C7eBD708Af50815fAa' - }, - { - currencyCode: 'TUSD', - currencyName: 'TrueUSD', - denominations: [{ name: 'TUSD', multiplier: '1000000000000000000' }], + } + }, + '0000000000085d4780b73119b644ae5ecd22b376': { + currencyCode: 'TUSD', + displayName: 'TrueUSD', + denominations: [{ name: 'TUSD', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x0000000000085d4780B73119b644AE5ecd22b376' - }, - { - currencyCode: 'UMA', - currencyName: 'UMA', - denominations: [{ name: 'UMA', multiplier: '1000000000000000000' }], + } + }, + '04fa0d235c4abf4bcf4787af4cf447de572ef828': { + currencyCode: 'UMA', + displayName: 'UMA', + denominations: [{ name: 'UMA', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x04Fa0d235C4abf4BcF4787aF4CF447DE572eF828' - }, - { - currencyCode: 'UNI', - currencyName: 'Uniswap', - denominations: [{ name: 'UNI', multiplier: '1000000000000000000' }], + } + }, + '1f9840a85d5af5bf1d1762f925bdaddc4201f984': { + currencyCode: 'UNI', + displayName: 'Uniswap', + denominations: [{ name: 'UNI', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984' - }, - { - currencyCode: 'USDC', - currencyName: 'USD Coin', - denominations: [{ name: 'USDC', multiplier: '1000000' }], + } + }, + a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48: { + currencyCode: 'USDC', + displayName: 'USD Coin', + denominations: [{ name: 'USDC', multiplier: '1000000' }], + networkLocation: { contractAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' - }, - { - currencyCode: 'USDP', - currencyName: 'Pax Dollar', - denominations: [{ name: 'USDP', multiplier: '1000000000000000000' }], + } + }, + '8e870d67f660d95d5be530380d0ec0bd388289e1': { + currencyCode: 'USDP', + displayName: 'Pax Dollar', + denominations: [{ name: 'USDP', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x8e870d67f660d95d5be530380d0ec0bd388289e1' - }, - { - currencyCode: 'USDS', - currencyName: 'StableUSD', - denominations: [{ name: 'USDS', multiplier: '1000000' }], + } + }, + a4bdb11dc0a2bec88d24a3aa1e6bb17201112ebe: { + currencyCode: 'USDS', + displayName: 'StableUSD', + denominations: [{ name: 'USDS', multiplier: '1000000' }], + networkLocation: { contractAddress: '0xA4Bdb11dc0a2bEC88d24A3aa1E6Bb17201112eBe' - }, - { - currencyCode: 'USDT', - currencyName: 'Tether', - denominations: [{ name: 'USDT', multiplier: '1000000' }], + } + }, + dac17f958d2ee523a2206206994597c13d831ec7: { + currencyCode: 'USDT', + displayName: 'Tether', + denominations: [{ name: 'USDT', multiplier: '1000000' }], + networkLocation: { contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7' - }, - { - currencyCode: 'WBTC', - currencyName: 'Wrapped Bitcoin', - denominations: [{ name: 'WBTC', multiplier: '100000000' }], + } + }, + '2260fac5e5542a773aa44fbcfedf7c193bc2c599': { + currencyCode: 'WBTC', + displayName: 'Wrapped Bitcoin', + denominations: [{ name: 'WBTC', multiplier: '100000000' }], + networkLocation: { contractAddress: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599' - }, - { - currencyCode: 'WETH', - currencyName: 'Wrapped ETH', - denominations: [{ name: 'WETH', multiplier: '1000000000000000000' }], + } + }, + c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2: { + currencyCode: 'WETH', + displayName: 'Wrapped ETH', + denominations: [{ name: 'WETH', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' - }, - { - currencyCode: 'WINGS', - currencyName: 'Wings', - denominations: [{ name: 'WINGS', multiplier: '1000000000000000000' }], + } + }, + '667088b212ce3d06a1b553a7221e1fd19000d9af': { + currencyCode: 'WINGS', + displayName: 'Wings', + denominations: [{ name: 'WINGS', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0x667088b212ce3d06a1b553a7221E1fD19000d9aF' - }, - { - currencyCode: 'YETI', - currencyName: 'Yearn Ecosystem Token Index', - denominations: [{ name: 'YETI', multiplier: '1000000000000000000' }], + } + }, + b4bebd34f6daafd808f73de0d10235a92fbb6c3d: { + currencyCode: 'YETI', + displayName: 'Yearn Ecosystem Token Index', + denominations: [{ name: 'YETI', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: '0xb4bebd34f6daafd808f73de0d10235a92fbb6c3d' + } + }, + '0bc529c00c6401aef6d220be8c6ea1667f6ad93e': { + currencyCode: 'YFI', + displayName: 'Yearn Finance', + denominations: [{ name: 'YFI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e' + } + }, + e41d2489571d322189246dafa5ebde1f4699f498: { + currencyCode: 'ZRX', + displayName: '0x', + denominations: [{ name: 'ZRX', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xE41d2489571d322189246DaFA5ebDe1F4699F498' + } + } +} + +const defaultNetworkFees: EthereumFees = { + default: { + baseFeeMultiplier: { + lowFee: '1', + standardFeeLow: '1.25', + standardFeeHigh: '1.5', + highFee: '1.75' + }, + gasLimit: { + regularTransaction: '21000', + tokenTransaction: '300000', + minGasLimit: '21000' + }, + gasPrice: { + lowFee: '1000000001', + standardFeeLow: '40000000001', + standardFeeHigh: '300000000001', + standardFeeLowAmount: '100000000000000000', + standardFeeHighAmount: '10000000000000000000', + highFee: '40000000001', + minGasPrice: '1000000000' + }, + minPriorityFee: '2000000000' + }, + '1983987abc9837fbabc0982347ad828': { + baseFeeMultiplier: undefined, + // @ts-expect-error + gasLimit: { + regularTransaction: '21002', + tokenTransaction: '37124' + }, + // @ts-expect-error + gasPrice: { + lowFee: '1000000002', + standardFeeLow: '40000000002', + standardFeeHigh: '300000000002', + standardFeeLowAmount: '200000000000000000', + standardFeeHighAmount: '20000000000000000000', + highFee: '40000000002' + }, + minPriorityFee: undefined + }, + '2983987abc9837fbabc0982347ad828': { + baseFeeMultiplier: undefined, + // @ts-expect-error + gasLimit: { + regularTransaction: '21002', + tokenTransaction: '37124' }, + gasPrice: undefined, + minPriorityFee: undefined + } +} + +const otherSettings: EthereumSettings = { + rpcServers: [ + 'https://eth-mainnet.alchemyapi.io', + 'https://mainnet.infura.io/v3', + 'https://cloudflare-eth.com' + ], + + evmScanApiServers: [ + 'https://api.etherscan.io' + // 'https://blockscout.com/eth/mainnet' // not reliable enough... + ], + blockcypherApiServers: ['https://api.blockcypher.com'], + blockbookServers: [ + 'https://ethbook.guarda.co', + 'https://eth1.trezor.io', + 'https://eth2.trezor.io' + ], + uriNetworks: ['ethereum', 'ether'], + ercTokenStandard: 'ERC20', + chainParams: { + chainId: 1, + name: 'Ethereum Mainnet' + }, + supportsEIP1559: true, + hdPathCoinType: 60, + checkUnconfirmedTransactions: true, + iosAllowedTokens: { + REP: true, + WINGS: true, + HUR: true, + IND: true, + USDT: true + }, + blockchairApiServers: ['https://api.blockchair.com'], + alethioApiServers: ['https://api.aleth.io/v1'], + alethioCurrencies: { + // object or null + native: 'ether', + token: 'token' + }, + amberdataRpcServers: ['https://rpc.web3api.io'], + amberdataApiServers: ['https://web3api.io/api/v2'], + amberDataBlockchainId: '1c9c969065fcd1cf', // ETH mainnet + pluginMnemonicKeyName: 'ethereumMnemonic', + pluginRegularKeyName: 'ethereumKey', + ethGasStationUrl: 'https://www.ethgasstation.info/json/ethgasAPI.json', + defaultNetworkFees +} + +const defaultSettings: any = { + customFeeSettings: ['gasLimit', 'gasPrice'], + otherSettings +} + +export const currencyInfo: EdgeCurrencyInfo = { + // Basic currency information: + currencyCode: 'ETH', + displayName: 'Ethereum', + pluginId: 'ethereum', + walletType: 'wallet:ethereum', + memoType: 'hex', + + canReplaceByFee: true, + defaultSettings, + + addressExplorer: 'https://etherscan.io/address/%s', + transactionExplorer: 'https://etherscan.io/tx/%s', + + denominations: [ + // An array of Objects of the possible denominations for this currency { - currencyCode: 'YFI', - currencyName: 'Yearn Finance', - denominations: [{ name: 'YFI', multiplier: '1000000000000000000' }], - contractAddress: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e' + name: 'ETH', + multiplier: '1000000000000000000', + symbol: 'Ξ' }, { - currencyCode: 'ZRX', - currencyName: '0x', - denominations: [{ name: 'ZRX', multiplier: '1000000000000000000' }], - contractAddress: '0xE41d2489571d322189246DaFA5ebDe1F4699F498' + name: 'mETH', + multiplier: '1000000000000000', + symbol: 'mΞ' } - ] + ], + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const ethereum = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/ethwInfo.ts b/src/ethereum/info/ethwInfo.ts index dfc8c140c..4f44a94f0 100644 --- a/src/ethereum/info/ethwInfo.ts +++ b/src/ethereum/info/ethwInfo.ts @@ -1,8 +1,11 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = {} const defaultNetworkFees: EthereumFees = { default: { @@ -92,12 +95,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'mΞ' } ], - metaTokens: [ - // Array of objects describing the supported metatokens - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const ethereumpow = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/ftmInfo.ts b/src/ethereum/info/ftmInfo.ts index 399d1c346..df3a6680a 100644 --- a/src/ethereum/info/ftmInfo.ts +++ b/src/ethereum/info/ftmInfo.ts @@ -1,8 +1,212 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = { + '511d35c52a3c244e7b8bd92c0c297755fbd89212': { + currencyCode: 'AVAX', + displayName: 'Avalanche', + denominations: [{ name: 'AVAX', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x511d35c52a3c244e7b8bd92c0c297755fbd89212' + } + }, + d67de0e0a0fd7b15dc8348bb9be742f3c5850454: { + currencyCode: 'BNB', + displayName: 'Binance', + denominations: [{ name: 'BNB', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xd67de0e0a0fd7b15dc8348bb9be742f3c5850454' + } + }, + '841fad6eae12c286d1fd18d1d525dffa75c7effe': { + currencyCode: 'BOO', + displayName: 'SpookyToken', + denominations: [{ name: 'BOO', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x841fad6eae12c286d1fd18d1d525dffa75c7effe' + } + }, + '321162cd933e2be498cd2267a90534a804051b11': { + currencyCode: 'BTC', + displayName: 'Bitcoin', + denominations: [{ name: 'BTC', multiplier: '100000000' }], + networkLocation: { + contractAddress: '0x321162cd933e2be498cd2267a90534a804051b11' + } + }, + '1e4f97b9f9f913c46f1632781732927b9019c68b': { + currencyCode: 'CRV', + displayName: 'Curve', + denominations: [{ name: 'CRV', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x1e4f97b9f9f913c46f1632781732927b9019c68b' + } + }, + '8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e': { + currencyCode: 'DAI', + displayName: 'DAI Stablecoin', + denominations: [{ name: 'DAI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e' + } + }, + '74b23882a30290451a17c44f4f05243b6b58c76d': { + currencyCode: 'ETH', + displayName: 'Ethereum', + denominations: [{ name: 'ETH', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x74b23882a30290451a17c44f4f05243b6b58c76d' + } + }, + e1146b9ac456fcbb60644c36fd3f868a9072fc6e: { + currencyCode: 'FBTC', + displayName: 'Frapped Bitcoin', + denominations: [{ name: 'FBTC', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xe1146b9ac456fcbb60644c36fd3f868a9072fc6e' + } + }, + '658b0c7613e890ee50b8c4bc6a3f41ef411208ad': { + currencyCode: 'FETH', + displayName: 'Frapped Ethereum', + denominations: [{ name: 'FETH', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x658b0c7613e890ee50b8c4bc6a3f41ef411208ad' + } + }, + ad84341756bf337f5a0164515b1f6f993d194e1f: { + currencyCode: 'FUSD', + displayName: 'Fantom USD', + denominations: [{ name: 'FUSD', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xad84341756bf337f5a0164515b1f6f993d194e1f' + } + }, + '049d68029688eabf473097a2fc38ef61633a3c7a': { + currencyCode: 'FUSDT', + displayName: 'Frapped Tether', + denominations: [{ name: 'FUSDT', multiplier: '1000000' }], + networkLocation: { + contractAddress: '0x049d68029688eabf473097a2fc38ef61633a3c7a' + } + }, + '5f0456f728e2d59028b4f5b8ad8c604100724c6a': { + currencyCode: 'L3USD', + displayName: 'L3USD', + denominations: [{ name: 'L3USD', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x5f0456f728e2d59028b4f5b8ad8c604100724c6a' + } + }, + bf60e7414ef09026733c1e7de72e7393888c64da: { + currencyCode: 'LIF3', + displayName: 'LIF3', + denominations: [{ name: 'LIF3', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xbf60e7414ef09026733c1e7de72e7393888c64da' + } + }, + b3654dc3d10ea7645f8319668e8f54d2574fbdc8: { + currencyCode: 'LINK', + displayName: 'Chainlink', + denominations: [{ name: 'LINK', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xb3654dc3d10ea7645f8319668e8f54d2574fbdc8' + } + }, + cbe0ca46399af916784cadf5bcc3aed2052d6c45: { + currencyCode: 'LSHARE', + displayName: 'LIF3 LSHARE', + denominations: [{ name: 'LSHARE', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xcbe0ca46399af916784cadf5bcc3aed2052d6c45' + } + }, + fb98b335551a418cd0737375a2ea0ded62ea213b: { + currencyCode: 'MAI', + displayName: 'miMATIC', + denominations: [{ name: 'MAI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xfB98B335551a418cD0737375a2ea0ded62Ea213b' + } + }, + '82f0b8b456c1a451378467398982d4834b6829c1': { + currencyCode: 'MIM', + displayName: 'Magic Internet Money', + denominations: [{ name: 'MIM', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x82f0b8b456c1a451378467398982d4834b6829c1' + } + }, + '24248cd1747348bdc971a5395f4b3cd7fee94ea0': { + currencyCode: 'TBOND', + displayName: 'Tomb Bonds', + denominations: [{ name: 'TBOND', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x24248CD1747348bDC971a5395f4b3cd7feE94ea0' + } + }, + '6c021ae822bea943b2e66552bde1d2696a53fbb7': { + currencyCode: 'TOMB', + displayName: 'Tomb', + denominations: [{ name: 'TOMB', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x6c021Ae822BEa943b2E66552bDe1D2696a53fbB7' + } + }, + c60d7067dfbc6f2caf30523a064f416a5af52963: { + currencyCode: 'TREEB', + displayName: 'Retreeb', + denominations: [{ name: 'TREEB', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xc60d7067dfbc6f2caf30523a064f416a5af52963' + } + }, + '4cdf39285d7ca8eb3f090fda0c069ba5f4145b37': { + currencyCode: 'TSHARE', + displayName: 'Tomb Shares', + denominations: [{ name: 'TSHARE', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x4cdf39285d7ca8eb3f090fda0c069ba5f4145b37' + } + }, + '04068da6c83afcfa0e13ba15a6696662335d5b75': { + currencyCode: 'USDC', + displayName: 'USD Coin', + denominations: [{ name: 'USDC', multiplier: '1000000' }], + networkLocation: { + contractAddress: '0x04068da6c83afcfa0e13ba15a6696662335d5b75' + } + }, + '21be370d5312f44cb42ce377bc9b8a0cef1a4c83': { + currencyCode: 'WFTM', + displayName: 'Wrapped Fantom', + denominations: [{ name: 'WFTM', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83' + } + }, + a48d959ae2e88f1daa7d5f611e01908106de7598: { + currencyCode: 'xBOO', + displayName: 'Boo MirrorWorld', + denominations: [{ name: 'xBOO', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xa48d959AE2E88f1dAA7D5F611E01908106dE7598' + } + }, + '09e145a1d53c0045f41aeef25d8ff982ae74dd56': { + currencyCode: 'ZOO', + displayName: 'Zookeeper', + denominations: [{ name: 'ZOO', multiplier: '1' }], + networkLocation: { + contractAddress: '0x09e145a1d53c0045f41aeef25d8ff982ae74dd56' + } + } +} const defaultNetworkFees: EthereumFees = { default: { @@ -83,282 +287,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'F' } ], - metaTokens: [ - // Array of objects describing the supported metatokens - { - currencyCode: 'AVAX', - currencyName: 'Avalanche', - denominations: [ - { - name: 'AVAX', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x511d35c52a3c244e7b8bd92c0c297755fbd89212' - }, - { - currencyCode: 'BNB', - currencyName: 'Binance', - denominations: [ - { - name: 'BNB', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xd67de0e0a0fd7b15dc8348bb9be742f3c5850454' - }, - { - currencyCode: 'BOO', - currencyName: 'SpookyToken', - denominations: [ - { - name: 'BOO', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x841fad6eae12c286d1fd18d1d525dffa75c7effe' - }, - { - currencyCode: 'BTC', - currencyName: 'Bitcoin', - denominations: [ - { - name: 'BTC', - multiplier: '100000000' - } - ], - contractAddress: '0x321162cd933e2be498cd2267a90534a804051b11' - }, - { - currencyCode: 'CRV', - currencyName: 'Curve', - denominations: [ - { - name: 'CRV', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x1e4f97b9f9f913c46f1632781732927b9019c68b' - }, - { - currencyCode: 'DAI', - currencyName: 'DAI Stablecoin', - denominations: [ - { - name: 'DAI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e' - }, - { - currencyCode: 'ETH', - currencyName: 'Ethereum', - denominations: [ - { - name: 'ETH', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x74b23882a30290451a17c44f4f05243b6b58c76d' - }, - { - currencyCode: 'FBTC', - currencyName: 'Frapped Bitcoin', - denominations: [ - { - name: 'FBTC', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xe1146b9ac456fcbb60644c36fd3f868a9072fc6e' - }, - { - currencyCode: 'FETH', - currencyName: 'Frapped Ethereum', - denominations: [ - { - name: 'FETH', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x658b0c7613e890ee50b8c4bc6a3f41ef411208ad' - }, - { - currencyCode: 'FUSD', - currencyName: 'Fantom USD', - denominations: [ - { - name: 'FUSD', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xad84341756bf337f5a0164515b1f6f993d194e1f' - }, - { - currencyCode: 'FUSDT', - currencyName: 'Frapped Tether', - denominations: [ - { - name: 'FUSDT', - multiplier: '1000000' - } - ], - contractAddress: '0x049d68029688eabf473097a2fc38ef61633a3c7a' - }, - { - currencyCode: 'L3USD', - currencyName: 'L3USD', - denominations: [{ name: 'L3USD', multiplier: '1000000000000000000' }], - contractAddress: '0x5f0456f728e2d59028b4f5b8ad8c604100724c6a' - }, - { - currencyCode: 'LIF3', - currencyName: 'LIF3', - denominations: [ - { - name: 'LIF3', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xbf60e7414ef09026733c1e7de72e7393888c64da' - }, - { - currencyCode: 'LINK', - currencyName: 'Chainlink', - denominations: [ - { - name: 'LINK', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xb3654dc3d10ea7645f8319668e8f54d2574fbdc8' - }, - { - currencyCode: 'LSHARE', - currencyName: 'LIF3 LSHARE', - denominations: [ - { - name: 'LSHARE', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xcbe0ca46399af916784cadf5bcc3aed2052d6c45' - }, - { - currencyCode: 'MAI', - currencyName: 'miMATIC', - denominations: [ - { - name: 'MAI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xfB98B335551a418cD0737375a2ea0ded62Ea213b' - }, - { - currencyCode: 'MIM', - currencyName: 'Magic Internet Money', - denominations: [ - { - name: 'MIM', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x82f0b8b456c1a451378467398982d4834b6829c1' - }, - { - currencyCode: 'TBOND', - currencyName: 'Tomb Bonds', - denominations: [ - { - name: 'TBOND', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x24248CD1747348bDC971a5395f4b3cd7feE94ea0' - }, - { - currencyCode: 'TOMB', - currencyName: 'Tomb', - denominations: [ - { - name: 'TOMB', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x6c021Ae822BEa943b2E66552bDe1D2696a53fbB7' - }, - { - currencyCode: 'TREEB', - currencyName: 'Retreeb', - denominations: [ - { - name: 'TREEB', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xc60d7067dfbc6f2caf30523a064f416a5af52963' - }, - { - currencyCode: 'TSHARE', - currencyName: 'Tomb Shares', - denominations: [ - { - name: 'TSHARE', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x4cdf39285d7ca8eb3f090fda0c069ba5f4145b37' - }, - { - currencyCode: 'USDC', - currencyName: 'USD Coin', - denominations: [ - { - name: 'USDC', - multiplier: '1000000' - } - ], - contractAddress: '0x04068da6c83afcfa0e13ba15a6696662335d5b75' - }, - { - currencyCode: 'WFTM', - currencyName: 'Wrapped Fantom', - denominations: [ - { - name: 'WFTM', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83' - }, - { - currencyCode: 'xBOO', - currencyName: 'Boo MirrorWorld', - denominations: [ - { - name: 'xBOO', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xa48d959AE2E88f1dAA7D5F611E01908106dE7598' - }, - { - currencyCode: 'ZOO', - currencyName: 'Zookeeper', - denominations: [ - { - name: 'ZOO', - multiplier: '1' - } - ], - contractAddress: '0x09e145a1d53c0045f41aeef25d8ff982ae74dd56' - } - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const fantom = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/goerliInfo.ts b/src/ethereum/info/goerliInfo.ts index 870fbd9b5..55d4e527f 100644 --- a/src/ethereum/info/goerliInfo.ts +++ b/src/ethereum/info/goerliInfo.ts @@ -1,8 +1,11 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = {} const defaultNetworkFees: EthereumFees = { default: { @@ -131,10 +134,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'mG' } ], - metaTokens: [] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const goerli = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/kovanInfo.ts b/src/ethereum/info/kovanInfo.ts index 4551302c1..f8dc51998 100644 --- a/src/ethereum/info/kovanInfo.ts +++ b/src/ethereum/info/kovanInfo.ts @@ -1,8 +1,157 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = { + b597cd8d3217ea6477232f9217fa70837ff667af: { + currencyCode: 'AAVE', + displayName: 'Aave', + denominations: [{ name: 'AAVE', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xb597cd8d3217ea6477232f9217fa70837ff667af' + } + }, + '3e0437898a5667a4769b1ca5a34aab1ae7e81377': { + currencyCode: 'AMPL', + displayName: 'Ampleforth', + denominations: [{ name: 'AMPL', multiplier: '1000000000' }], + networkLocation: { + contractAddress: '0x3e0437898a5667a4769b1ca5a34aab1ae7e81377' + } + }, + '4c6e1efc12fdfd568186b7baec0a43fffb4bcccf': { + currencyCode: 'BUSD', + displayName: 'Binance USD', + denominations: [{ name: 'BUSD', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x4c6e1efc12fdfd568186b7baec0a43fffb4bcccf' + } + }, + c64f90cd7b564d3ab580eb20a102a8238e218be2: { + currencyCode: 'ENJ', + displayName: 'Enjin Coin', + denominations: [{ name: 'ENJ', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xc64f90cd7b564d3ab580eb20a102a8238e218be2' + } + }, + '99b267b9d96616f906d53c26decf3c5672401282': { + currencyCode: 'sUSD', + displayName: 'Synth sUSD', + denominations: [{ name: 'sUSD', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x99b267b9d96616f906d53c26decf3c5672401282' + } + }, + ad5ce863ae3e4e9394ab43d4ba0d80f419f61789: { + currencyCode: 'LINK', + displayName: 'ChainLink', + denominations: [{ name: 'LINK', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xAD5ce863aE3E4E9394Ab43d4ba0D80f419F61789' + } + }, + '738dc6380157429e957d223e6333dc385c85fec7': { + currencyCode: 'MANA', + displayName: 'Decentraland', + denominations: [{ name: 'MANA', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x738dc6380157429e957d223e6333dc385c85fec7' + } + }, + '016750ac630f711882812f24dba6c95b9d35856d': { + currencyCode: 'TUSD', + displayName: 'TrueUSD', + denominations: [{ name: 'TUSD', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x016750ac630f711882812f24dba6c95b9d35856d' + } + }, + '7fdb81b0b8a010dd4ffc57c3fecbf145ba8bd947': { + currencyCode: 'SNX', + displayName: 'Synthetix', + denominations: [{ name: 'SNX', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x7fdb81b0b8a010dd4ffc57c3fecbf145ba8bd947' + } + }, + '5eebf65a6746eed38042353ba84c8e37ed58ac6f': { + currencyCode: 'REN', + displayName: 'Republic Token', + denominations: [{ name: 'REN', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x5eebf65a6746eed38042353ba84c8e37ed58ac6f' + } + }, + '61e4cae3da7fd189e52a4879c7b8067d7c2cc0fa': { + currencyCode: 'MKR', + displayName: 'Maker', + denominations: [{ name: 'MKR', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x61e4cae3da7fd189e52a4879c7b8067d7c2cc0fa' + } + }, + b7c325266ec274feb1354021d27fa3e3379d840d: { + currencyCode: 'YFI', + displayName: 'yearn.finance', + denominations: [{ name: 'YFI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xb7c325266ec274feb1354021d27fa3e3379d840d' + } + }, + d0d76886cf8d952ca26177eb7cfdf83bad08c00c: { + currencyCode: 'ZRX', + displayName: 'ZRX', + denominations: [{ name: 'ZRX', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xd0d76886cf8d952ca26177eb7cfdf83bad08c00c' + } + }, + + ff795577d9ac8bd7d90ee22b6c1703490b6512fd: { + currencyCode: 'DAI', + displayName: 'Dai Stablecoin', + denominations: [{ name: 'DAI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xff795577d9ac8bd7d90ee22b6c1703490b6512fd' + } + }, + e22da380ee6b445bb8273c81944adeb6e8450422: { + currencyCode: 'USDC', + displayName: 'USD Coin', + denominations: [{ name: 'USDC', multiplier: '1000000' }], + networkLocation: { + contractAddress: '0xe22da380ee6b445bb8273c81944adeb6e8450422' + } + }, + '13512979ade267ab5100878e2e0f485b568328a4': { + currencyCode: 'USDT', + displayName: 'Tether', + denominations: [{ name: 'USDT', multiplier: '1000000' }], + networkLocation: { + contractAddress: '0x13512979ade267ab5100878e2e0f485b568328a4' + } + }, + d0a1e359811322d97991e03f863a0c30c2cf029c: { + currencyCode: 'WETH', + displayName: 'Wrapped ETH', + denominations: [{ name: 'WETH', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xd0a1e359811322d97991e03f863a0c30c2cf029c' + } + }, + d1b98b6607330172f1d991521145a22bce793277: { + currencyCode: 'WBTC', + displayName: 'Wrapped Bitcoin', + denominations: [{ name: 'WBTC', multiplier: '100000000' }], + networkLocation: { + contractAddress: '0xD1B98B6607330172f1D991521145A22BCe793277' + } + } +} const defaultNetworkFees: EthereumFees = { default: { @@ -132,210 +281,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'mK' } ], - metaTokens: [ - { - currencyCode: 'AAVE', - currencyName: 'Aave', - denominations: [ - { - name: 'AAVE', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xb597cd8d3217ea6477232f9217fa70837ff667af' - }, - { - currencyCode: 'AMPL', - currencyName: 'Ampleforth', - denominations: [ - { - name: 'AMPL', - multiplier: '1000000000' - } - ], - contractAddress: '0x3e0437898a5667a4769b1ca5a34aab1ae7e81377' - }, - { - currencyCode: 'BUSD', - currencyName: 'Binance USD', - denominations: [ - { - name: 'BUSD', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x4c6e1efc12fdfd568186b7baec0a43fffb4bcccf' - }, - { - currencyCode: 'ENJ', - currencyName: 'Enjin Coin', - denominations: [ - { - name: 'ENJ', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xc64f90cd7b564d3ab580eb20a102a8238e218be2' - }, - { - currencyCode: 'sUSD', - currencyName: 'Synth sUSD', - denominations: [ - { - name: 'sUSD', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x99b267b9d96616f906d53c26decf3c5672401282' - }, - { - currencyCode: 'LINK', - currencyName: 'ChainLink', - denominations: [ - { - name: 'LINK', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xAD5ce863aE3E4E9394Ab43d4ba0D80f419F61789' - }, - { - currencyCode: 'MANA', - currencyName: 'Decentraland', - denominations: [ - { - name: 'MANA', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x738dc6380157429e957d223e6333dc385c85fec7' - }, - { - currencyCode: 'TUSD', - currencyName: 'TrueUSD', - denominations: [ - { - name: 'TUSD', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x016750ac630f711882812f24dba6c95b9d35856d' - }, - { - currencyCode: 'SNX', - currencyName: 'Synthetix', - denominations: [ - { - name: 'SNX', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x7fdb81b0b8a010dd4ffc57c3fecbf145ba8bd947' - }, - { - currencyCode: 'REN', - currencyName: 'Republic Token', - denominations: [ - { - name: 'REN', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x5eebf65a6746eed38042353ba84c8e37ed58ac6f' - }, - { - currencyCode: 'MKR', - currencyName: 'Maker', - denominations: [ - { - name: 'MKR', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x61e4cae3da7fd189e52a4879c7b8067d7c2cc0fa' - }, - { - currencyCode: 'YFI', - currencyName: 'yearn.finance', - denominations: [ - { - name: 'YFI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xb7c325266ec274feb1354021d27fa3e3379d840d' - }, - { - currencyCode: 'ZRX', - currencyName: 'ZRX', - denominations: [ - { - name: 'ZRX', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xd0d76886cf8d952ca26177eb7cfdf83bad08c00c' - }, - - { - currencyCode: 'DAI', - currencyName: 'Dai Stablecoin', - denominations: [ - { - name: 'DAI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xff795577d9ac8bd7d90ee22b6c1703490b6512fd' - }, - { - currencyCode: 'USDC', - currencyName: 'USD Coin', - denominations: [ - { - name: 'USDC', - multiplier: '1000000' - } - ], - contractAddress: '0xe22da380ee6b445bb8273c81944adeb6e8450422' - }, - { - currencyCode: 'USDT', - currencyName: 'Tether', - denominations: [ - { - name: 'USDT', - multiplier: '1000000' - } - ], - contractAddress: '0x13512979ade267ab5100878e2e0f485b568328a4' - }, - { - currencyCode: 'WETH', - currencyName: 'Wrapped ETH', - denominations: [ - { - name: 'WETH', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xd0a1e359811322d97991e03f863a0c30c2cf029c' - }, - { - currencyCode: 'WBTC', - currencyName: 'Wrapped Bitcoin', - denominations: [ - { - name: 'WBTC', - multiplier: '100000000' - } - ], - contractAddress: '0xD1B98B6607330172f1D991521145A22BCe793277' - } - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const kovan = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/maticInfo.ts b/src/ethereum/info/maticInfo.ts index 836848b37..8b6a2f92d 100644 --- a/src/ethereum/info/maticInfo.ts +++ b/src/ethereum/info/maticInfo.ts @@ -1,8 +1,132 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = { + '2791bca1f2de4661ed88a30c99a7a9449aa84174': { + currencyCode: 'USDC', + displayName: 'USD Coin', + denominations: [{ name: 'USDC', multiplier: '1000000' }], + networkLocation: { + contractAddress: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174' + } + }, + '8f3cf7ad23cd3cadbd9735aff958023239c6a063': { + currencyCode: 'DAI', + displayName: 'Dai Stablecoin', + denominations: [{ name: 'DAI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063' + } + }, + c2132d05d31c914a87c6611c10748aeb04b58e8f: { + currencyCode: 'USDT', + displayName: 'Tether', + denominations: [{ name: 'USDT', multiplier: '1000000' }], + networkLocation: { + contractAddress: '0xc2132d05d31c914a87c6611c10748aeb04b58e8f' + } + }, + d6df932a45c0f255f85145f286ea0b292b21c90b: { + currencyCode: 'AAVE', + displayName: 'Aave', + denominations: [{ name: 'AAVE', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xd6df932a45c0f255f85145f286ea0b292b21c90b' + } + }, + '1bfd67037b42cf73acf2047067bd4f2c47d9bfd6': { + currencyCode: 'WBTC', + displayName: 'Wrapped Bitcoin', + denominations: [{ name: 'WBTC', multiplier: '100000000' }], + networkLocation: { + contractAddress: '0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6' + } + }, + da537104d6a5edd53c6fbba9a898708e465260b6: { + currencyCode: 'YFI', + displayName: 'Yearn Finance', + denominations: [{ name: 'YFI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xda537104d6a5edd53c6fbba9a898708e465260b6' + } + }, + '7ceb23fd6bc0add59e62ac25578270cff1b9f619': { + currencyCode: 'WETH', + displayName: 'Wrapped ETH', + denominations: [{ name: 'WETH', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619' + } + }, + '9c9e5fd8bbc25984b178fdce6117defa39d2db39': { + currencyCode: 'BUSD', + displayName: 'Binance USD', + denominations: [{ name: 'BUSD', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x9c9e5fd8bbc25984b178fdce6117defa39d2db39' + } + }, + b33eaad8d922b1083446dc23f610c2567fb5180f: { + currencyCode: 'UNI', + displayName: 'Uniswap', + denominations: [{ name: 'UNI', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xb33eaad8d922b1083446dc23f610c2567fb5180f' + } + }, + c9c1c1c20b3658f8787cc2fd702267791f224ce1: { + currencyCode: 'FTM', + displayName: 'Fantom', + denominations: [{ name: 'FTM', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xc9c1c1c20b3658f8787cc2fd702267791f224ce1' + } + }, + '6f7c932e7684666c9fd1d44527765433e01ff61d': { + currencyCode: 'MKR', + displayName: 'Maker', + denominations: [{ name: 'MKR', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x6f7C932e7684666C9fd1d44527765433e01fF61d' + } + }, + '2e1ad108ff1d8c782fcbbb89aad783ac49586756': { + currencyCode: 'TUSD', + displayName: 'TrueUSD', + denominations: [{ name: 'TUSD', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x2e1ad108ff1d8c782fcbbb89aad783ac49586756' + } + }, + '3ba4c387f786bfee076a58914f5bd38d668b42c3': { + currencyCode: 'BNB', + displayName: 'Binance', + denominations: [{ name: 'BNB', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x3BA4c387f786bFEE076A58914F5Bd38d668B42c3' + } + }, + a1c57f48f0deb89f569dfbe6e2b7f46d33606fd4: { + currencyCode: 'MANA', + displayName: 'Decentraland', + denominations: [{ name: 'MANA', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0xa1c57f48f0deb89f569dfbe6e2b7f46d33606fd4' + } + }, + '53e0bca35ec356bd5dddfebbd1fc0fd03fabad39': { + currencyCode: 'LINK', + displayName: 'Chainlink', + denominations: [{ name: 'LINK', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39' + } + } +} // Fees are in Wei const defaultNetworkFees: EthereumFees = { @@ -91,176 +215,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'mMATIC' } ], - metaTokens: [ - { - currencyCode: 'USDC', - currencyName: 'USD Coin', - denominations: [ - { - name: 'USDC', - multiplier: '1000000' - } - ], - contractAddress: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174' - }, - { - currencyCode: 'DAI', - currencyName: 'Dai Stablecoin', - denominations: [ - { - name: 'DAI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063' - }, - { - currencyCode: 'USDT', - currencyName: 'Tether', - denominations: [ - { - name: 'USDT', - multiplier: '1000000' - } - ], - contractAddress: '0xc2132d05d31c914a87c6611c10748aeb04b58e8f' - }, - { - currencyCode: 'AAVE', - currencyName: 'Aave', - denominations: [ - { - name: 'AAVE', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xd6df932a45c0f255f85145f286ea0b292b21c90b' - }, - { - currencyCode: 'WBTC', - currencyName: 'Wrapped Bitcoin', - denominations: [ - { - name: 'WBTC', - multiplier: '100000000' - } - ], - contractAddress: '0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6' - }, - { - currencyCode: 'YFI', - currencyName: 'Yearn Finance', - denominations: [ - { - name: 'YFI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xda537104d6a5edd53c6fbba9a898708e465260b6' - }, - { - currencyCode: 'WETH', - currencyName: 'Wrapped ETH', - denominations: [ - { - name: 'WETH', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619' - }, - { - currencyCode: 'BUSD', - currencyName: 'Binance USD', - denominations: [ - { - name: 'BUSD', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x9c9e5fd8bbc25984b178fdce6117defa39d2db39' - }, - { - currencyCode: 'UNI', - currencyName: 'Uniswap', - denominations: [ - { - name: 'UNI', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xb33eaad8d922b1083446dc23f610c2567fb5180f' - }, - { - currencyCode: 'FTM', - currencyName: 'Fantom', - denominations: [ - { - name: 'FTM', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xc9c1c1c20b3658f8787cc2fd702267791f224ce1' - }, - { - currencyCode: 'MKR', - currencyName: 'Maker', - denominations: [ - { - name: 'MKR', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x6f7C932e7684666C9fd1d44527765433e01fF61d' - }, - { - currencyCode: 'TUSD', - currencyName: 'TrueUSD', - denominations: [ - { - name: 'TUSD', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x2e1ad108ff1d8c782fcbbb89aad783ac49586756' - }, - { - currencyCode: 'BNB', - currencyName: 'Binance', - denominations: [ - { - name: 'BNB', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x3BA4c387f786bFEE076A58914F5Bd38d668B42c3' - }, - { - currencyCode: 'MANA', - currencyName: 'Decentraland', - denominations: [ - { - name: 'MANA', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0xa1c57f48f0deb89f569dfbe6e2b7f46d33606fd4' - }, - { - currencyCode: 'LINK', - currencyName: 'Chainlink', - denominations: [ - { - name: 'LINK', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39' - } - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const polygon = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/rinkebyInfo.ts b/src/ethereum/info/rinkebyInfo.ts index c68356c1e..795a9e579 100644 --- a/src/ethereum/info/rinkebyInfo.ts +++ b/src/ethereum/info/rinkebyInfo.ts @@ -1,8 +1,11 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = {} const defaultNetworkFees: EthereumFees = { default: { @@ -131,10 +134,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'mΞ' } ], - metaTokens: [] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const rinkeby = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/ropstenInfo.ts b/src/ethereum/info/ropstenInfo.ts index d486d61a7..0bb04940d 100644 --- a/src/ethereum/info/ropstenInfo.ts +++ b/src/ethereum/info/ropstenInfo.ts @@ -1,8 +1,11 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = {} const defaultNetworkFees: EthereumFees = { default: { @@ -134,10 +137,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'mR' } ], - metaTokens: [] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const ropsten = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/ethereum/info/rskInfo.ts b/src/ethereum/info/rskInfo.ts index 9d7691372..ab86026b3 100644 --- a/src/ethereum/info/rskInfo.ts +++ b/src/ethereum/info/rskInfo.ts @@ -1,8 +1,20 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../../common/innerPlugin' +import { makeMetaTokens } from '../../common/tokenHelpers' import type { EthereumTools } from '../ethPlugin' -import { EthereumFees, EthereumSettings } from '../ethTypes' +import type { EthereumFees, EthereumSettings } from '../ethTypes' + +const builtinTokens: EdgeTokenMap = { + '2acc95758f8b5f583470ba265eb685a8f45fc9d5': { + currencyCode: 'RIF', + displayName: 'RIF Token', + denominations: [{ name: 'RIF', multiplier: '1000000000000000000' }], + networkLocation: { + contractAddress: '0x2acc95758f8b5f583470ba265eb685a8f45fc9d5' + } + } +} const defaultNetworkFees: EthereumFees = { default: { @@ -78,23 +90,11 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'RBTC' } ], - metaTokens: [ - // Array of objects describing the supported metatokens - { - currencyCode: 'RIF', - currencyName: 'RIF Token', - denominations: [ - { - name: 'RIF', - multiplier: '1000000000000000000' - } - ], - contractAddress: '0x2acc95758f8b5f583470ba265eb685a8f45fc9d5' - } - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const rsk = makeOuterPlugin<{}, EthereumTools>({ + builtinTokens, currencyInfo, networkInfo: {}, diff --git a/src/fio/fioInfo.ts b/src/fio/fioInfo.ts index c83e36fde..ec6ea4787 100644 --- a/src/fio/fioInfo.ts +++ b/src/fio/fioInfo.ts @@ -73,7 +73,7 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'ᵮ' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const fio = makeOuterPlugin<{}, FioTools>({ diff --git a/src/hedera/hederaInfo.ts b/src/hedera/hederaInfo.ts index 30e1f4ca0..5546ecd2d 100644 --- a/src/hedera/hederaInfo.ts +++ b/src/hedera/hederaInfo.ts @@ -45,7 +45,7 @@ const currencyInfo: EdgeCurrencyInfo = { symbol: 'tℏ' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const hedera = makeOuterPlugin<{}, HederaTools>({ diff --git a/src/hedera/hederaTestnetInfo.ts b/src/hedera/hederaTestnetInfo.ts index 0a3eb0726..07fd09085 100644 --- a/src/hedera/hederaTestnetInfo.ts +++ b/src/hedera/hederaTestnetInfo.ts @@ -42,7 +42,7 @@ const currencyInfo: EdgeCurrencyInfo = { symbol: 'tℏ' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const hederatestnet = makeOuterPlugin<{}, HederaTools>({ diff --git a/src/index.ts b/src/index.ts index b2eff7a7e..95c51a2cf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import 'regenerator-runtime/runtime' import { binance } from './binance/bnbInfo' -import { eosPlugins } from './eos/index' +import { eosPlugins } from './eos/eosInfos' import { ethPlugins } from './ethereum/ethInfos' import { fio } from './fio/fioInfo' import { hedera } from './hedera/hederaInfo' diff --git a/src/polkadot/polkadotInfo.ts b/src/polkadot/polkadotInfo.ts index 626b16d5a..51313ff7e 100644 --- a/src/polkadot/polkadotInfo.ts +++ b/src/polkadot/polkadotInfo.ts @@ -38,7 +38,7 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: '' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const polkadot = makeOuterPlugin<{}, PolkadotTools>({ diff --git a/src/solana/solanaInfo.ts b/src/solana/solanaInfo.ts index 7919ef0ee..2c575b8c8 100644 --- a/src/solana/solanaInfo.ts +++ b/src/solana/solanaInfo.ts @@ -40,7 +40,7 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: '◎' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const solana = makeOuterPlugin<{}, SolanaTools>({ diff --git a/src/stellar/stellarInfo.ts b/src/stellar/stellarInfo.ts index 1587b4c7a..0311b56e6 100644 --- a/src/stellar/stellarInfo.ts +++ b/src/stellar/stellarInfo.ts @@ -34,7 +34,7 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: '*' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const stellar = makeOuterPlugin<{}, StellarTools>({ diff --git a/src/tezos/tezosInfo.ts b/src/tezos/tezosInfo.ts index 9f5b76977..affa6c319 100644 --- a/src/tezos/tezosInfo.ts +++ b/src/tezos/tezosInfo.ts @@ -58,7 +58,7 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 't' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const tezos = makeOuterPlugin<{}, TezosTools>({ diff --git a/src/tron/tronInfo.ts b/src/tron/tronInfo.ts index 3d9b05af7..8a7b75e79 100644 --- a/src/tron/tronInfo.ts +++ b/src/tron/tronInfo.ts @@ -1,8 +1,88 @@ -import { EdgeCurrencyInfo } from 'edge-core-js/types' +import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types' import { makeOuterPlugin } from '../common/innerPlugin' +import { makeMetaTokens } from '../common/tokenHelpers' import type { TronTools } from './tronPlugin' -import { TronNetworkInfo } from './tronTypes' +import type { TronNetworkInfo } from './tronTypes' + +const builtinTokens: EdgeTokenMap = { + TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn: { + currencyCode: 'USDD', + displayName: 'Decentralized USD', + denominations: [{ name: 'USDD', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: 'TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn' } + }, + + TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t: { + currencyCode: 'USDT', + displayName: 'Tether', + denominations: [{ name: 'USDT', multiplier: '1000000' }], + networkLocation: { contractAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t' } + }, + + TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8: { + currencyCode: 'USDC', + displayName: 'USD Coin', + denominations: [{ name: 'USDC', multiplier: '1000000' }], + networkLocation: { contractAddress: 'TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8' } + }, + + TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR: { + currencyCode: 'WTRX', + displayName: 'Wrapped TRX', + denominations: [{ name: 'WTRX', multiplier: '1000000' }], + networkLocation: { contractAddress: 'TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR' } + }, + + TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4: { + currencyCode: 'TUSD', + displayName: 'TrueUSD', + denominations: [{ name: 'TUSD', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: 'TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4' } + }, + + TAFjULxiVgT4qWk6UZwjqwZXTSaGaqnVp4: { + currencyCode: 'BTT', + displayName: 'BitTorrent', + denominations: [{ name: 'BTT', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: 'TAFjULxiVgT4qWk6UZwjqwZXTSaGaqnVp4' } + }, + + TCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9: { + currencyCode: 'JST', + displayName: 'JUST', + denominations: [{ name: 'JST', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: 'TCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9' } + }, + + TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7: { + currencyCode: 'WIN', + displayName: 'WINkLink', + denominations: [{ name: 'WIN', multiplier: '1000000' }], + networkLocation: { contractAddress: 'TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7' } + }, + + TFczxzPhnThNSqr5by8tvxsdCFRRz6cPNq: { + currencyCode: 'NFT', + displayName: 'APENFT', + denominations: [{ name: 'NFT', multiplier: '1000000' }], + networkLocation: { contractAddress: 'TFczxzPhnThNSqr5by8tvxsdCFRRz6cPNq' } + }, + + TSSMHYeV2uE9qYH95DqyoCuNCzEL1NvU3S: { + currencyCode: 'SUN', + displayName: 'SUN', + denominations: [{ name: 'SUN', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: 'TSSMHYeV2uE9qYH95DqyoCuNCzEL1NvU3S' } + }, + + TMwFHYXLJaRUPeW6421aqXL4ZEzPRFGkGT: { + currencyCode: 'USDJ', + displayName: 'JUST Stablecoin', + denominations: [{ name: 'USDJ', multiplier: '1000000000000000000' }], + networkLocation: { contractAddress: 'TMwFHYXLJaRUPeW6421aqXL4ZEzPRFGkGT' } + } +} export const networkInfo: TronNetworkInfo = { tronApiServers: ['https://api.trongrid.io'], @@ -51,85 +131,11 @@ export const currencyInfo: EdgeCurrencyInfo = { } ], - metaTokens: [ - { - currencyCode: 'USDD', - currencyName: 'Decentralized USD', - denominations: [{ name: 'USDD', multiplier: '1000000000000000000' }], - contractAddress: 'TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn' - }, - { - currencyCode: 'USDT', - currencyName: 'Tether', - denominations: [{ name: 'USDT', multiplier: '1000000' }], - contractAddress: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t' - }, - { - currencyCode: 'USDC', - currencyName: 'USD Coin', - denominations: [{ name: 'USDC', multiplier: '1000000' }], - contractAddress: 'TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8' - }, - - { - currencyCode: 'WTRX', - currencyName: 'Wrapped TRX', - denominations: [{ name: 'WTRX', multiplier: '1000000' }], - contractAddress: 'TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR' - }, - - { - currencyCode: 'TUSD', - currencyName: 'TrueUSD', - denominations: [{ name: 'TUSD', multiplier: '1000000000000000000' }], - contractAddress: 'TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4' - }, - - { - currencyCode: 'BTT', - currencyName: 'BitTorrent', - denominations: [{ name: 'BTT', multiplier: '1000000000000000000' }], - contractAddress: 'TAFjULxiVgT4qWk6UZwjqwZXTSaGaqnVp4' - }, - - { - currencyCode: 'JST', - currencyName: 'JUST', - denominations: [{ name: 'JST', multiplier: '1000000000000000000' }], - contractAddress: 'TCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9' - }, - - { - currencyCode: 'WIN', - currencyName: 'WINkLink', - denominations: [{ name: 'WIN', multiplier: '1000000' }], - contractAddress: 'TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7' - }, - - { - currencyCode: 'NFT', - currencyName: 'APENFT', - denominations: [{ name: 'NFT', multiplier: '1000000' }], - contractAddress: 'TFczxzPhnThNSqr5by8tvxsdCFRRz6cPNq' - }, - - { - currencyCode: 'SUN', - currencyName: 'SUN', - denominations: [{ name: 'SUN', multiplier: '1000000000000000000' }], - contractAddress: 'TSSMHYeV2uE9qYH95DqyoCuNCzEL1NvU3S' - }, - - { - currencyCode: 'USDJ', - currencyName: 'JUST Stablecoin', - denominations: [{ name: 'USDJ', multiplier: '1000000000000000000' }], - contractAddress: 'TMwFHYXLJaRUPeW6421aqXL4ZEzPRFGkGT' - } - ] + metaTokens: makeMetaTokens(builtinTokens) // Deprecated } export const tron = makeOuterPlugin({ + builtinTokens, currencyInfo, networkInfo, diff --git a/src/tron/tronPlugin.ts b/src/tron/tronPlugin.ts index 0b0f4518f..db580faad 100644 --- a/src/tron/tronPlugin.ts +++ b/src/tron/tronPlugin.ts @@ -16,6 +16,7 @@ import EthereumUtil from 'ethereumjs-util' import hdKey from 'ethereumjs-wallet/hdkey' import { PluginEnvironment } from '../common/innerPlugin' +import { asMaybeContractLocation } from '../common/tokenHelpers' import { encodeUriCommon, parseUriCommon } from '../common/uriHelpers' import { getDenomInfo } from '../common/utils' import { asTronKeys, TronKeys, TronNetworkInfo } from './tronTypes' @@ -141,12 +142,14 @@ export class TronTools implements EdgeCurrencyTools { } async getTokenId(token: EdgeToken): Promise { - const contractAddress: string | undefined = - token?.networkLocation?.contractAddress - if (contractAddress == null || !isAddressValid(contractAddress)) { + const cleanLocation = asMaybeContractLocation(token.networkLocation) + if ( + cleanLocation == null || + !isAddressValid(cleanLocation.contractAddress) + ) { throw new Error('ErrorInvalidContractAddress') } - return contractAddress + return cleanLocation.contractAddress } } diff --git a/src/xrp/xrpInfo.ts b/src/xrp/xrpInfo.ts index ca6876cfb..7df8e2abf 100644 --- a/src/xrp/xrpInfo.ts +++ b/src/xrp/xrpInfo.ts @@ -33,7 +33,7 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'X' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const ripple = makeOuterPlugin({ diff --git a/src/zcash/arrrInfo.ts b/src/zcash/arrrInfo.ts index e77b6c872..0fee40032 100644 --- a/src/zcash/arrrInfo.ts +++ b/src/zcash/arrrInfo.ts @@ -39,7 +39,7 @@ const currencyInfo: EdgeCurrencyInfo = { symbol: 'P' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const piratechain = makeOuterPlugin({ diff --git a/src/zcash/zecInfo.ts b/src/zcash/zecInfo.ts index 839c75ca2..4c6cdef6d 100644 --- a/src/zcash/zecInfo.ts +++ b/src/zcash/zecInfo.ts @@ -38,7 +38,7 @@ export const currencyInfo: EdgeCurrencyInfo = { symbol: 'Z' } ], - metaTokens: [] + metaTokens: [] // Deprecated } export const zcash = makeOuterPlugin({ diff --git a/test/builtinTokens.test.ts b/test/builtinTokens.test.ts new file mode 100644 index 000000000..954eebb12 --- /dev/null +++ b/test/builtinTokens.test.ts @@ -0,0 +1,47 @@ +import { expect } from 'chai' +import { EdgeCorePluginOptions, makeFakeIo } from 'edge-core-js' +import { describe, it } from 'mocha' + +import plugins from '../src/index' +import { fakeLog } from './fake/fakeLog' + +const fakeIo = makeFakeIo() +const fakePluginOptions: EdgeCorePluginOptions = { + initOptions: {}, + io: fakeIo, + log: fakeLog, + nativeIo: { + 'edge-currency-accountbased': { + piratechain: {}, + zcash: {} + } + }, + pluginDisklet: fakeIo.disklet +} + +const pluginIds = Object.keys(plugins) as Array + +describe('builtinTokens', function () { + for (const pluginId of pluginIds) { + const plugin = plugins[pluginId](fakePluginOptions) + + it(`${pluginId} has the right tokenId's`, async function () { + const builtinTokens = + plugin.getBuiltinTokens == null ? {} : await plugin.getBuiltinTokens() + const actual = Object.keys(builtinTokens) + + expect(plugin.currencyInfo.metaTokens.length).equals(actual.length) + + const tools = await plugin.makeCurrencyTools() + const expected = await Promise.all( + actual.map(async actualId => + tools.getTokenId == null + ? '' + : await tools.getTokenId(builtinTokens[actualId]) + ) + ) + + expect(actual).deep.equals(expected) + }) + } +}) diff --git a/yarn.lock b/yarn.lock index 4df1a8ac2..8898b7e04 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1857,6 +1857,11 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + JSONStream@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -2114,6 +2119,11 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -3106,7 +3116,7 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3154,6 +3164,11 @@ chrome-trace-event@^1.0.2: resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -4778,6 +4793,13 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-yarn-workspace-root@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" + integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== + dependencies: + micromatch "^4.0.2" + first-match@~0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/first-match/-/first-match-0.0.1.tgz#a60ec642700f0f437234ebb7ec3f382476e542fd" @@ -4857,6 +4879,16 @@ fromentries@^1.2.0: resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== +fs-extra@^9.0.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-monkey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3" @@ -5059,7 +5091,7 @@ google-protobuf@^3.12.4, google-protobuf@^3.5.0: resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.21.2.tgz#4580a2bea8bbb291ee579d1fefb14d6fa3070ea4" integrity sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA== -graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -5417,6 +5449,13 @@ is-callable@^1.1.4, is-callable@^1.2.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + is-core-module@^2.4.0, is-core-module@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" @@ -5590,7 +5629,7 @@ is-windows@^1.0.2: resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -is-wsl@^2.2.0: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== @@ -5837,6 +5876,15 @@ json5@^2.1.2, json5@^2.2.0, json5@^2.2.1: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" @@ -5871,6 +5919,13 @@ kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" @@ -6180,10 +6235,10 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q== -minimist@^1.2.0, minimist@^1.2.5: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== +minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== mkdirp@0.5.1: version "0.5.1" @@ -6563,6 +6618,14 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" +open@^7.4.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + open@^8.0.9: version "8.4.0" resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" @@ -6589,6 +6652,11 @@ os-browserify@^0.3.0: resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -6725,6 +6793,26 @@ parseurl@~1.3.2, parseurl@~1.3.3: resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== +patch-package@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.5.1.tgz#3e5d00c16997e6160291fee06a521c42ac99b621" + integrity sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + chalk "^4.1.2" + cross-spawn "^6.0.5" + find-yarn-workspace-root "^2.0.0" + fs-extra "^9.0.0" + is-ci "^2.0.0" + klaw-sync "^6.0.0" + minimist "^1.2.6" + open "^7.4.2" + rimraf "^2.6.3" + semver "^5.6.0" + slash "^2.0.0" + tmp "^0.0.33" + yaml "^1.10.2" + path-browserify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" @@ -7280,6 +7368,13 @@ rfc4648@^1.1.0, rfc4648@^1.3.0, rfc4648@^1.4.0, rfc4648@^1.5.0: resolved "https://registry.yarnpkg.com/rfc4648/-/rfc4648-1.5.1.tgz#b0b16756e33d9de8c0c7833e94b28e627ec372a4" integrity sha512-60e/YWs2/D3MV1ErdjhJHcmlgnyLUiG4X/14dgsfm9/zmCWLN16xI6YqJYSCd/OANM7bUNzJqPY5B8/02S9Ibw== +rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" @@ -7470,7 +7565,7 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -7633,6 +7728,11 @@ signed-varint@^2.0.1: dependencies: varint "~5.0.0" +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -8134,6 +8234,13 @@ tiny-secp256k1@^1.1.3: elliptic "^6.4.0" nan "^2.13.2" +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" @@ -8295,6 +8402,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -8798,7 +8910,7 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.0: +yaml@^1.10.0, yaml@^1.10.2: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==