Skip to content

Commit 4b324c1

Browse files
committed
specify which chain an asset is traded on
1 parent 554a335 commit 4b324c1

File tree

1 file changed

+44
-6
lines changed

1 file changed

+44
-6
lines changed

src/client/client.ts

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,40 @@ export const BIG_NUMBER_FORMAT = {
279279

280280
const TRADABLE_CHAINS = ['btc', 'eth', 'neo', 'polygon']
281281

282+
const TRADABLE_ASSETS = {
283+
btc: ['btc'],
284+
neo: [
285+
'nos',
286+
'lx',
287+
'ava',
288+
'phx',
289+
'neo',
290+
'guard',
291+
'gas',
292+
'nnn',
293+
'nex',
294+
'tmn',
295+
'efx'
296+
],
297+
eth: [
298+
'usdc',
299+
'eth',
300+
'link',
301+
'zrx',
302+
'bat',
303+
'gunthy',
304+
'ant',
305+
'trac',
306+
'qnt',
307+
'usdt',
308+
'rlc',
309+
'noia',
310+
'mco',
311+
'efx'
312+
],
313+
polygon: ['matic', 'weth', 'wbtc', 'derc20']
314+
}
315+
282316
export const UNLIMITED_APPROVAL = Number.MAX_SAFE_INTEGER
283317

284318
export class Client {
@@ -3210,12 +3244,16 @@ export class Client {
32103244
const assets: Asset[] = await this.listAssets()
32113245
for (const a of assets) {
32123246
if (TRADABLE_CHAINS.includes(a.blockchain.toString().toLowerCase())) {
3213-
assetList[a.symbol] = {
3214-
hash: a.hash,
3215-
precision: 8,
3216-
symbol: a.symbol,
3217-
blockchainPrecision: a.blockchainPrecision,
3218-
blockchain: a.blockchain
3247+
const tradeableOnChain =
3248+
TRADABLE_ASSETS[a.blockchain.toString().toLowerCase()]
3249+
if (tradeableOnChain.includes(a.symbol)) {
3250+
assetList[a.symbol] = {
3251+
hash: a.hash,
3252+
precision: 8,
3253+
symbol: a.symbol,
3254+
blockchainPrecision: a.blockchainPrecision,
3255+
blockchain: a.blockchain
3256+
}
32193257
}
32203258
}
32213259
}

0 commit comments

Comments
 (0)