Skip to content

Commit

Permalink
fix: rename fees to gasLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
skeremidchiev committed Mar 30, 2022
1 parent e09834a commit c22deb6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions src/assets/erc20/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ import terraTokens from './terra-tokens.json'

import { TESTNET_CONTRACT_ADDRESSES, TESTNET_TOKENS } from '../testnet'
import { Asset, ChainId, AssetType, AssetMap } from '../../types'
import { sendFees } from '../sendFees'
import { sendGasLimits } from '../sendGasLimits'

const rskTokensData = mapValues(rskTokens, (tokenData) => ({
...tokenData,
chain: ChainId.Rootstock,
sendFee: sendFees.ERC20_EVM
sendGasLimit: sendGasLimits.ERC20_EVM
}))

const ethereumTokensData = mapValues(ethereumTokens, (tokenData) => ({
...tokenData,
chain: ChainId.Ethereum,
sendFee: sendFees.ERC20_EVM
sendGasLimit: sendGasLimits.ERC20_EVM
}))

const polygonTokensData = mapValues(polygonTokens, (tokenData) => ({
...tokenData,
chain: ChainId.Polygon,
sendFee: sendFees.ERC20_EVM
sendGasLimit: sendGasLimits.ERC20_EVM
}))

const avalancheTokensData = mapValues(avalancheTokens, (tokenData) => ({
...tokenData,
chain: ChainId.Avalanche,
sendFee: sendFees.ERC20_EVM
sendGasLimit: sendGasLimits.ERC20_EVM
}))

const terraTokensData = mapValues(terraTokens, (tokenData) => ({
...tokenData,
chain: ChainId.Terra,
sendFee: sendFees.TERRA
sendGasLimit: sendGasLimits.TERRA
}))

const erc20Assets: AssetMap = mapValues(
Expand Down
28 changes: 14 additions & 14 deletions src/assets/native.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TESTNET_NATIVE } from './testnet'
import { AssetMap, ChainId } from '../types'
import { sendFees } from '../assets/sendFees'
import { sendGasLimits } from '../assets/sendGasLimits'

const nativeAssets: AssetMap = {
BTC: {
Expand All @@ -11,7 +11,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'bitcoin',
color: '#f7931a',
decimals: 8,
sendFee: sendFees.BTC
sendGasLimit: sendGasLimits.BTC
},
BCH: {
name: 'Bitcoin Cash',
Expand All @@ -21,7 +21,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'bitcoin-cash',
color: '#a1db5e',
decimals: 8,
sendFee: sendFees.BTC // TODO: is this correct?
sendGasLimit: sendGasLimits.BTC // TODO: is this correct?
},
ETH: {
name: 'Ether',
Expand All @@ -31,7 +31,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'ethereum',
color: '#627eea',
decimals: 18,
sendFee: sendFees.NATIVE_EVM
sendGasLimit: sendGasLimits.NATIVE_EVM
},
RBTC: {
name: 'Rootstock BTC',
Expand All @@ -41,7 +41,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'rootstock',
color: '#006e3c',
decimals: 18,
sendFee: sendFees.NATIVE_EVM
sendGasLimit: sendGasLimits.NATIVE_EVM
},
BNB: {
name: 'Binance Coin',
Expand All @@ -51,7 +51,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'binancecoin',
color: '#f9a825',
decimals: 18,
sendFee: sendFees.NATIVE_EVM
sendGasLimit: sendGasLimits.NATIVE_EVM
},
NEAR: {
name: 'Near',
Expand All @@ -61,7 +61,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'near',
color: '#000000',
decimals: 24,
sendFee: sendFees.NEAR
sendGasLimit: sendGasLimits.NEAR
},
SOL: {
name: 'Solana',
Expand All @@ -71,7 +71,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'solana',
color: '#008080',
decimals: 9,
sendFee: sendFees.SOL
sendGasLimit: sendGasLimits.SOL
},
MATIC: {
name: 'Matic',
Expand All @@ -81,7 +81,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'matic-network',
color: '#8247E5',
decimals: 18,
sendFee: sendFees.NATIVE_EVM
sendGasLimit: sendGasLimits.NATIVE_EVM
},
ARBETH: {
name: 'Arbitrum ETH',
Expand All @@ -92,7 +92,7 @@ const nativeAssets: AssetMap = {
color: '#28A0EF',
decimals: 18,
matchingAsset: 'ETH',
sendFee: sendFees.ARBETH
sendGasLimit: sendGasLimits.ARBETH
},
FUSE: {
name: 'Fuse Network',
Expand All @@ -102,7 +102,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'fuse-network-token',
color: '#46e8b6',
decimals: 18,
sendFee: sendFees.NATIVE_EVM
sendGasLimit: sendGasLimits.NATIVE_EVM
},
LUNA: {
name: 'Luna',
Expand All @@ -112,7 +112,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'terra-luna',
color: '#008080',
decimals: 6,
sendFee: sendFees.TERRA
sendGasLimit: sendGasLimits.TERRA
},
UST: {
name: 'TerraUSD',
Expand All @@ -123,7 +123,7 @@ const nativeAssets: AssetMap = {
color: '#0083ff',
coinGeckoId: 'terrausd',
feeAsset: 'UST',
sendFee: sendFees.TERRA
sendGasLimit: sendGasLimits.TERRA
},
AVAX: {
name: 'Avalanche',
Expand All @@ -133,7 +133,7 @@ const nativeAssets: AssetMap = {
coinGeckoId: 'avalanche-2',
color: '#E84141',
decimals: 18,
sendFee: sendFees.NATIVE_EVM
sendGasLimit: sendGasLimits.NATIVE_EVM
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/assets/sendFees.ts → src/assets/sendGasLimits.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sendFees = {
const sendGasLimits = {
BTC: 290,
NATIVE_EVM: 21000, // EVM -> ETH, RBTC, MATIC, BNB, AVAX, FUSE
ERC20_EVM: 90000, // EVM -> ETH, RBTC, MATIC, BNB, AVAX, FUSE
Expand All @@ -8,4 +8,4 @@ const sendFees = {
SOL: 1000000
}

export { sendFees }
export { sendGasLimits }
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface Asset {
contractAddress?: string // ERC20 only
matchingAsset?: string
feeAsset?: string
sendFee: number
sendGasLimit: number
}

export type AssetMap = Record<string, Asset>

0 comments on commit c22deb6

Please sign in to comment.