@exodus/ethereum-lib 4.2.7 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-lib",
3
- "version": "4.2.7",
3
+ "version": "4.4.0",
4
4
  "description": "Ethereum Library",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  "lint:fix": "yarn lint --fix"
20
20
  },
21
21
  "dependencies": {
22
- "@exodus/asset-lib": "^3.7.1",
22
+ "@exodus/asset-lib": "^4.1.0",
23
23
  "@exodus/aurora-meta": "^1.0.3",
24
24
  "@exodus/avalanchec-meta": "^1.0.4",
25
25
  "@exodus/basemainnet-meta": "^1.0.6",
@@ -34,8 +34,9 @@
34
34
  "@exodus/ethereumgoerli-meta": "^1.0.3",
35
35
  "@exodus/ethereumholesky-meta": "^1.0.1",
36
36
  "@exodus/ethereumjs-common": "^2.4.0-exodus.6",
37
- "@exodus/ethereumjs-tx": "^3.3.0-exodus.6",
38
- "@exodus/ethereumjs-util": "^7.1.0-exodus.6",
37
+ "@exodus/ethereumjs-tx": "^3.3.0-exodus.7",
38
+ "@exodus/ethereumjs-util": "^7.1.0-exodus.7",
39
+ "@exodus/ethereumsepolia-meta": "^1.0.1",
39
40
  "@exodus/fantommainnet-meta": "^1.0.5",
40
41
  "@exodus/flare-meta": "^1.0.4",
41
42
  "@exodus/harmonymainnet-meta": "^1.0.0",
@@ -53,8 +54,10 @@
53
54
  "reselect": "~3.0.1"
54
55
  },
55
56
  "devDependencies": {
56
- "@exodus/assets": "9.1.0",
57
- "@exodus/assets-base": "^8.1.14"
57
+ "@exodus/assets": "^9.1.1",
58
+ "@exodus/bitcoin-meta": "^1.0.2",
59
+ "@exodus/bnbmainnet-meta": "^1.0.0",
60
+ "@exodus/elliptic": "^6.5.4-precomputed"
58
61
  },
59
- "gitHead": "fc74398662718e696baca062122c3e6908672504"
62
+ "gitHead": "952a85ff2ce573b294d53fb411b9858088d15229"
60
63
  }
package/src/abi/index.js CHANGED
@@ -19,7 +19,7 @@ import ensRegistry from './ens-registry'
19
19
  import ensResolver from './ens-resolver'
20
20
  import optimismGasOracle from './optimism-gas-oracle'
21
21
 
22
- export default {
22
+ const index = {
23
23
  ant,
24
24
  cdai,
25
25
  dai,
@@ -41,3 +41,5 @@ export default {
41
41
  ensResolver,
42
42
  optimismGasOracle,
43
43
  }
44
+
45
+ export default index
@@ -6,18 +6,21 @@ function parseBalance({ asset, balance }) {
6
6
  if (isNumberUnit(balance)) {
7
7
  if (balance.unitType.equals(currency)) {
8
8
  return balance
9
- } else {
10
- throw new Error(
11
- `Balance '${balance.toDefaultString()}' is not of currency ${currency.toString()}`
12
- )
13
9
  }
10
+
11
+ throw new Error(
12
+ `Balance '${balance.toDefaultString()}' is not of currency ${currency.toString()}`
13
+ )
14
14
  }
15
+
15
16
  if (isString(balance)) {
16
17
  return currency.parse(balance)
17
18
  }
19
+
18
20
  if (isNumber(balance)) {
19
21
  return currency.defaultUnit(balance)
20
22
  }
23
+
21
24
  throw new Error(`Cannot parse balance '${balance}' of currency ${currency}`)
22
25
  }
23
26
 
package/src/constants.js CHANGED
@@ -20,11 +20,17 @@ const CHAIN_DATA = {
20
20
  tokenType: 'ETHEREUM_GOERLI_ERC20',
21
21
  },
22
22
  ethereumholesky: {
23
- chainId: 17000,
23
+ chainId: 17_000,
24
24
  serverUrl: 'https://geth-holesky-testnet-d.a.exodus.io/wallet/v1/',
25
25
  confirmationsNumber: 30,
26
26
  tokenType: 'ETHEREUM_HOLESKY_ERC20',
27
27
  },
28
+ ethereumsepolia: {
29
+ chainId: 11_155_111,
30
+ serverUrl: 'https://geth-sepolia-testnet-d.a.exodus.io/wallet/v1/',
31
+ confirmationsNumber: 30,
32
+ tokenType: 'ETHEREUM_SEPOLIA_ERC20',
33
+ },
28
34
  bsc: {
29
35
  chainId: 56,
30
36
  serverUrl: 'https://bsc-clarity.a.exodus.io/',
@@ -39,7 +45,7 @@ const CHAIN_DATA = {
39
45
  tokenType: 'MATIC_ERC20',
40
46
  },
41
47
  avalanchec: {
42
- chainId: 43114,
48
+ chainId: 43_114,
43
49
  serverUrl: 'https://avax-c.a.exodus.io/wallet/v1/',
44
50
  confirmationsNumber: 30,
45
51
  tokenType: 'AVAX_ERC20',
@@ -51,20 +57,20 @@ const CHAIN_DATA = {
51
57
  tokenType: 'FTM_ERC20',
52
58
  },
53
59
  harmonymainnet: {
54
- chainId: 1666600000,
60
+ chainId: 1_666_600_000,
55
61
  serverUrl: 'https://harmony.a.exodus.io/wallet/v1/',
56
62
  confirmationsNumber: 6,
57
63
  // tokenType: // we do not support tokens yet
58
64
  },
59
65
  ethereumarbnova: {
60
- chainId: 42170,
66
+ chainId: 42_170,
61
67
  serverUrl: 'https://arbitrum-nova-clarity.a.exodus.io',
62
68
  confirmationsNumber: 3,
63
69
  monitorType: 'clarity',
64
70
  tokenType: 'ETHEREUM_ARBONE_ERC20',
65
71
  },
66
72
  ethereumarbone: {
67
- chainId: 42161,
73
+ chainId: 42_161,
68
74
  serverUrl: 'https://arbitrum-one-clarity.a.exodus.io',
69
75
  confirmationsNumber: 3,
70
76
  monitorType: 'clarity',
@@ -93,7 +99,7 @@ const CHAIN_DATA = {
93
99
  tokenType: 'FLR_ERC20',
94
100
  },
95
101
  aurora: {
96
- chainId: 1313161554,
102
+ chainId: 1_313_161_554,
97
103
  serverUrl: 'https://aurora.a.exodus.io',
98
104
  confirmationsNumber: 3,
99
105
  monitorType: 'no-history',
package/src/encode.js CHANGED
@@ -18,8 +18,7 @@ export function validate(address, { baseAssetName } = {}) {
18
18
  }
19
19
 
20
20
  export function hasChecksum(address) {
21
- if (/^0x[0-9A-F]{40}$/.test(address) || /^0x[0-9a-f]{40}$/.test(address)) return false
22
- return true
21
+ return !(/^0x[\dA-F]{40}$/.test(address) || /^0x[\da-f]{40}$/.test(address))
23
22
  }
24
23
 
25
24
  export function encodePrivate(privKey) {
@@ -40,10 +39,7 @@ export function encodePublic(compressedPubKey, { baseAssetName } = {}) {
40
39
  }
41
40
 
42
41
  export function isValidPrivate(privateKey) {
43
- if (privateKey.length !== 32 || !etherUtil.isValidPrivate(privateKey)) {
44
- return false
45
- }
46
- return true
42
+ return !(privateKey.length !== 32 || !etherUtil.isValidPrivate(privateKey))
47
43
  }
48
44
 
49
45
  export function encodePublicFromPrivate(privateKey, { baseAssetName } = {}) {
@@ -0,0 +1,20 @@
1
+ import { FeeData } from '@exodus/asset-lib'
2
+ import { asset } from '@exodus/ethereumsepolia-meta'
3
+
4
+ export default new FeeData({
5
+ config: {
6
+ gasPrice: '75 Gwei',
7
+ baseFeePerGas: '50 Gwei',
8
+ max: '250 Gwei',
9
+ min: '1 Gwei',
10
+ fuelThreshold: '0.025 SETH',
11
+ swapFee: '0.05 SETH',
12
+ gasPriceEconomicalRate: 0.7,
13
+ gasPriceMinimumRate: 0.5,
14
+ enableFeeDelegation: false,
15
+ tipGasPrice: '2 Gwei',
16
+ eip1559Enabled: true,
17
+ },
18
+ mainKey: 'gasPrice',
19
+ currency: asset.currency,
20
+ })
@@ -4,6 +4,7 @@ export { default as ethereumarbone } from './ethereumarbone'
4
4
  export { default as ethereumclassic } from './ethereumclassic'
5
5
  export { default as ethereumgoerli } from './ethereumgoerli'
6
6
  export { default as ethereumholesky } from './ethereumholesky'
7
+ export { default as ethereumsepolia } from './ethereumsepolia'
7
8
  export { default as bsc } from './bsc'
8
9
  export { default as matic } from './polygon'
9
10
  export { default as avalanchec } from './avalanchec'
@@ -18,7 +18,7 @@ export default class EthereumLikeFeeMonitor extends FeeMonitor {
18
18
  let gasPrice = parseInt(await this.getGasPrice(), 16)
19
19
 
20
20
  if (!Number.isFinite(gasPrice)) {
21
- throw new Error(`Invalid gas price: ${gasPrice}`)
21
+ throw new TypeError(`Invalid gas price: ${gasPrice}`)
22
22
  }
23
23
 
24
24
  if (gasPrice < this.minGasPrice) {
package/src/index.js CHANGED
@@ -1,9 +1,3 @@
1
- import createContract from './create-contract'
2
- import ABI from './abi'
3
- import * as feeData from './fee-data'
4
-
5
- export { createContract, ABI, feeData }
6
-
7
1
  export * from './balances'
8
2
  export * from './encode'
9
3
  export * from './unsigned-tx'
@@ -13,3 +7,7 @@ export * from './fee-monitor'
13
7
  export * from './selectors'
14
8
  export { default as createGetKeyIdentifier } from './key-identifier'
15
9
  export { default as createEthereumLikeAccountState } from './account-state'
10
+
11
+ export { default as createContract } from './create-contract'
12
+ export * as feeData from './fee-data'
13
+ export { default as ABI } from './abi'
@@ -3,44 +3,41 @@ import { createGetKeyIdentifier, unhardenDerivationIndex } from '@exodus/key-uti
3
3
 
4
4
  const HARDWARE_WALLETS = new Set(['ledger', 'trezor'])
5
5
 
6
- const createEthereumGetKeyIdentifier = ({
7
- bip44,
8
- assetName,
9
- keyType = 'secp256k1',
10
- allowMetaMaskCompat = false,
11
- } = {}) => (partialParams = {}) => {
12
- const params = {
13
- purpose: 44,
14
- chainIndex: 0,
15
- accountIndex: 0,
16
- addressIndex: 0,
17
- ...partialParams,
18
- }
6
+ const createEthereumGetKeyIdentifier =
7
+ ({ bip44, assetName, keyType = 'secp256k1', allowMetaMaskCompat = false } = {}) =>
8
+ (partialParams = {}) => {
9
+ const params = {
10
+ purpose: 44,
11
+ chainIndex: 0,
12
+ accountIndex: 0,
13
+ addressIndex: 0,
14
+ ...partialParams,
15
+ }
16
+
17
+ const { accountIndex, addressIndex, compatibilityMode } = params
18
+ const isHardwareWallet = HARDWARE_WALLETS.has(compatibilityMode)
19
+ const unhardenedBip44 = unhardenDerivationIndex(bip44)
20
+ const isMetaMask = allowMetaMaskCompat && compatibilityMode === 'metamask'
19
21
 
20
- const { accountIndex, addressIndex, compatibilityMode } = params
21
- const isHardwareWallet = HARDWARE_WALLETS.has(compatibilityMode)
22
- const unhardenedBip44 = unhardenDerivationIndex(bip44)
23
- const isMetaMask = allowMetaMaskCompat && compatibilityMode === 'metamask'
22
+ if (isMetaMask) {
23
+ assert(addressIndex === 0, 'MetaMask compatibility does not support setting an addressIndex')
24
+ return {
25
+ assetName,
26
+ derivationAlgorithm: 'BIP32',
27
+ derivationPath: `m/44'/${unhardenedBip44}'/0'/0/${accountIndex}`,
28
+ keyType,
29
+ }
30
+ }
24
31
 
25
- if (isMetaMask) {
26
- assert(addressIndex === 0, 'MetaMask compatibility does not support setting an addressIndex')
27
- return {
32
+ return createGetKeyIdentifier({
33
+ bip44,
28
34
  assetName,
29
- derivationAlgorithm: 'BIP32',
30
- derivationPath: `m/44'/${unhardenedBip44}'/0'/0/${accountIndex}`,
31
35
  keyType,
32
- }
36
+ validationRules: {
37
+ allowMultipleAddresses: true,
38
+ allowXPUB: isHardwareWallet,
39
+ },
40
+ })(params)
33
41
  }
34
42
 
35
- return createGetKeyIdentifier({
36
- bip44,
37
- assetName,
38
- keyType,
39
- validationRules: {
40
- allowMultipleAddresses: true,
41
- allowXPUB: isHardwareWallet,
42
- },
43
- })(params)
44
- }
45
-
46
43
  export default createEthereumGetKeyIdentifier
@@ -51,6 +51,7 @@ function isQueuedPendingTx(tx, baseAssetName, activeWalletAccount, getTxLog) {
51
51
  if (isQueuedPendingTx.minIndex >= 0 && txAtMinIndex && txAtMinIndex.pending) {
52
52
  return tx.data && tx.data.nonce > txAtMinIndex.data.nonce
53
53
  }
54
+
54
55
  let minPendingNonce = Number.MAX_SAFE_INTEGER
55
56
  for (let index = 0; index < txLog.size; index++) {
56
57
  const _tx = txLog.getAt(index)
@@ -128,9 +129,11 @@ export const canAccelerateTx = ({
128
129
  if (isQueuedPendingTx(tx, baseAssetName, activeWalletAccount, getTxLog))
129
130
  return wrapResponseToObject({ errorMessage: 'there is a stuck TX with lower nonce' })
130
131
 
131
- const { gasPrice: currentGasPrice, gasPriceEconomicalRate, eip1559Enabled } = getFeeData(
132
- assetName
133
- )
132
+ const {
133
+ gasPrice: currentGasPrice,
134
+ gasPriceEconomicalRate,
135
+ eip1559Enabled,
136
+ } = getFeeData(assetName)
134
137
 
135
138
  if (calculateTxGasPrice(tx).gte(currentGasPrice.mul(gasPriceEconomicalRate)))
136
139
  return wrapResponseToObject({ errorMessage: 'the used gas price is still high enough' })
@@ -149,7 +152,7 @@ export const canAccelerateTx = ({
149
152
  return wrapResponseToObject({ bumpType: BumpType.RBF })
150
153
  }
151
154
 
152
- export default (
155
+ const getCanAccelerateTxFactory = (
153
156
  getFeeDataSelector,
154
157
  getFeeSelector,
155
158
  activeWalletAccountSelector,
@@ -180,17 +183,20 @@ export default (
180
183
  getTxLog,
181
184
  getIsExchangeTx,
182
185
  assets
183
- ) => (tx) =>
184
- canAccelerateTx({
185
- tx,
186
- assets,
187
- getFeeData,
188
- getFee,
189
- activeWalletAccount,
190
- getPersonalNoteByTxId,
191
- getIsRbfEnabled,
192
- getIsEnoughBalanceToAccelerate,
193
- getTxLog,
194
- getIsExchangeTx,
195
- })
186
+ ) =>
187
+ (tx) =>
188
+ canAccelerateTx({
189
+ tx,
190
+ assets,
191
+ getFeeData,
192
+ getFee,
193
+ activeWalletAccount,
194
+ getPersonalNoteByTxId,
195
+ getIsRbfEnabled,
196
+ getIsEnoughBalanceToAccelerate,
197
+ getTxLog,
198
+ getIsExchangeTx,
199
+ })
196
200
  )
201
+
202
+ export default getCanAccelerateTxFactory
@@ -4,21 +4,23 @@ export const isEnoughBalanceToAccelerate = (totalBalance, unconfirmedBalance, ex
4
4
  return totalBalance.sub(unconfirmedBalance).gte(extraEthNeeded)
5
5
  }
6
6
 
7
- export default (getWalletAccountBalancesSelector, getUnconfirmedEthereumBalanceSelector) =>
7
+ const getIsEnoughBalanceToAccelerateFactory = (
8
+ getWalletAccountBalancesSelector,
9
+ getUnconfirmedEthereumBalanceSelector
10
+ ) =>
8
11
  createSelector(
9
12
  getWalletAccountBalancesSelector,
10
13
  getUnconfirmedEthereumBalanceSelector,
11
- (getWalletAccountBalances, getUnconfirmedEthereumBalance) => (
12
- walletAccount,
13
- assetName,
14
- extraEthNeeded
15
- ) => {
16
- const totalBalance = getWalletAccountBalances(walletAccount)[assetName]
17
- const unconfirmedBalance = getUnconfirmedEthereumBalance({
18
- asset: assetName,
19
- walletAccount,
20
- })
14
+ (getWalletAccountBalances, getUnconfirmedEthereumBalance) =>
15
+ (walletAccount, assetName, extraEthNeeded) => {
16
+ const totalBalance = getWalletAccountBalances(walletAccount)[assetName]
17
+ const unconfirmedBalance = getUnconfirmedEthereumBalance({
18
+ asset: assetName,
19
+ walletAccount,
20
+ })
21
21
 
22
- return isEnoughBalanceToAccelerate(totalBalance, unconfirmedBalance, extraEthNeeded)
23
- }
22
+ return isEnoughBalanceToAccelerate(totalBalance, unconfirmedBalance, extraEthNeeded)
23
+ }
24
24
  )
25
+
26
+ export default getIsEnoughBalanceToAccelerateFactory
@@ -31,8 +31,8 @@ export default function createEthereumJsTx(unsignedTx) {
31
31
  ),
32
32
  }
33
33
  )
34
- } else {
35
- // Legacy tx
36
- return Transaction.fromTxData(txData, { common: Common.custom({ chainId }) })
37
34
  }
35
+
36
+ // Legacy tx
37
+ return Transaction.fromTxData(txData, { common: Common.custom({ chainId }) })
38
38
  }
@@ -1,6 +1,6 @@
1
1
  export { default as createUnsignedTx } from './create-unsigned-tx'
2
2
  export { default as parseUnsignedTx } from './parse-unsigned-tx'
3
- export { default as signUnsignedTx } from './sign-unsigned-tx'
3
+ export { default as signUnsignedTx, signUnsignedTxWithSigner } from './sign-unsigned-tx'
4
4
  export { default as createAndSignTx } from './create-and-sign-tx'
5
5
  export { default as createEthereumJsTx } from './create-ethereumjs-tx'
6
6
  export { signHardwareFactory } from './sign-hardware'
@@ -1,25 +1,23 @@
1
1
  import assert from 'minimalistic-assert'
2
2
  import createEthereumJsTx from './create-ethereumjs-tx'
3
3
 
4
- export const signHardwareFactory = ({ baseAssetName }) => async ({
5
- unsignedTx,
6
- hardwareDevice,
7
- accountIndex,
8
- }) => {
9
- const tx = createEthereumJsTx(unsignedTx)
4
+ export const signHardwareFactory =
5
+ ({ baseAssetName }) =>
6
+ async ({ unsignedTx, hardwareDevice, accountIndex }) => {
7
+ const tx = createEthereumJsTx(unsignedTx)
10
8
 
11
- const signedTx = await signWithHardwareWallet({
12
- baseAssetName,
13
- tx,
14
- hardwareDevice,
15
- accountIndex,
16
- })
9
+ const signedTx = await signWithHardwareWallet({
10
+ baseAssetName,
11
+ tx,
12
+ hardwareDevice,
13
+ accountIndex,
14
+ })
17
15
 
18
- // serialize and get txId
19
- const rawTx = signedTx.serialize()
20
- const txId = signedTx.hash().toString('hex')
21
- return { rawTx, txId }
22
- }
16
+ // serialize and get txId
17
+ const rawTx = signedTx.serialize()
18
+ const txId = signedTx.hash().toString('hex')
19
+ return { rawTx, txId }
20
+ }
23
21
 
24
22
  async function signWithHardwareWallet({ baseAssetName, tx, hardwareDevice, accountIndex }) {
25
23
  const rlpEncodedTx = tx.serialize()
@@ -41,13 +39,10 @@ async function signWithHardwareWallet({ baseAssetName, tx, hardwareDevice, accou
41
39
  } else if (tx.common.chainId !== undefined) {
42
40
  // _processSignature for legacy transactions expects 27 or 28.
43
41
  // hardware wallets on the other hand already precomputed the final v (chainId * 2 + 35 + parity).
44
- const diff = tx.common
45
- .chainIdBN()
46
- .muln(2)
47
- .addn(8)
48
- .toNumber()
42
+ const diff = tx.common.chainIdBN().muln(2).addn(8).toNumber()
49
43
  v -= diff
50
44
  }
45
+
51
46
  assert([27, 28].includes(v), `unexpected v-value, expected 27 or 28 but got ${v} `)
52
47
  const r = signature.slice(V_SIZE, V_SIZE + 32)
53
48
  const s = signature.slice(V_SIZE + 32, V_SIZE + 32 + 32)
@@ -1,12 +1,32 @@
1
1
  import createEthereumJsTx from './create-ethereumjs-tx'
2
2
 
3
+ function prepareRawTx(signedTx) {
4
+ // serialize and get txId
5
+ const rawTx = signedTx.serialize()
6
+ const txId = signedTx.hash().toString('hex')
7
+ return { rawTx, txId }
8
+ }
9
+
10
+ export async function signUnsignedTxWithSigner(unsignedTx, signer) {
11
+ const tx = createEthereumJsTx(unsignedTx)
12
+
13
+ const ethSigner = async (data) => {
14
+ const sig = await signer({ data, ecOptions: { canonical: true }, enc: 'raw' })
15
+ const signature = new Uint8Array(64)
16
+ signature.set(sig.r.toArrayLike(Uint8Array, 'be', 32), 0)
17
+ signature.set(sig.s.toArrayLike(Uint8Array, 'be', 32), 32)
18
+ return { signature, recid: sig.recoveryParam }
19
+ }
20
+
21
+ const signedTx = await tx.signWithSigner(ethSigner)
22
+
23
+ return prepareRawTx(signedTx)
24
+ }
25
+
3
26
  export default function signUnsignedTx(unsignedTx, privateKey) {
4
27
  const tx = createEthereumJsTx(unsignedTx)
5
28
 
6
29
  const signedTx = tx.sign(privateKey)
7
30
 
8
- // serialize and get txId
9
- const rawTx = signedTx.serialize()
10
- const txId = signedTx.hash().toString('hex')
11
- return { rawTx, txId }
31
+ return prepareRawTx(signedTx)
12
32
  }
@@ -2,14 +2,9 @@ const defaultMultiplier = 1.1
2
2
 
3
3
  // if a wallet has 0 ETH the deposit needed should be more than the fee needed by <multiplier>
4
4
  // if a wallet has <N> ETH, the deposit needed should be the fee * <multiplier> - <N>
5
- export default function({ fee, balance, multiplier = defaultMultiplier }) {
5
+ export default function ({ fee, balance, multiplier = defaultMultiplier }) {
6
6
  if (typeof multiplier !== 'number' || multiplier < 1) multiplier = defaultMultiplier
7
7
  if (balance.gt(fee)) return balance.unitType.ZERO
8
8
 
9
- return fee
10
- .mul(multiplier)
11
- .toDefault()
12
- .sub(balance)
13
- .toFixed(4, 'ceil')
14
- .toString()
9
+ return fee.mul(multiplier).sub(balance).toDefault().toFixed(4, 'ceil').toString()
15
10
  }
@@ -16,6 +16,7 @@ const base16 = baseX('0123456789abcdef')
16
16
  export const isEthereumToken = (asset) => asset.assetType === 'ETHEREUM_ERC20'
17
17
  export const isEthereumGoerliToken = (asset) => asset.assetType === 'ETHEREUM_GOERLI_ERC20'
18
18
  export const isEthereumHoleskyToken = (asset) => asset.assetType === 'ETHEREUM_HOLESKY_ERC20'
19
+ export const isEthereumSepoliaToken = (asset) => asset.assetType === 'ETHEREUM_SEPOLIA_ERC20'
19
20
  export const isBscToken = (asset) => asset.assetType === 'BSC_BEP20'
20
21
  export const isPolygonToken = (asset) => asset.assetType === 'MATIC_ERC20'
21
22
  export const isAvalancheToken = (asset) => asset.assetType === 'AVAX_ERC20'
@@ -35,6 +36,7 @@ export const isEthereumLikeToken = (asset) => ETHEREUM_LIKE_TOKEN_TYPES.includes
35
36
  export const isEthereumLikeTokenByName = (assetName) => {
36
37
  throw new Error('Please use isEthereumLikeToken() instead')
37
38
  }
39
+
38
40
  export const isToken = isEthereumLikeToken
39
41
 
40
42
  // All ethereum-like assets (native coins)
@@ -68,7 +70,7 @@ export function currency2buffer(value) {
68
70
 
69
71
  export function normalizeTxId(txId) {
70
72
  if (txId.startsWith('0x')) return txId
71
- else return '0x' + txId
73
+ return '0x' + txId
72
74
  }
73
75
 
74
76
  // @deprecated
package/LICENSE.md DELETED
File without changes