Skip to content

Commit 6959219

Browse files
authored
Merge pull request #120 from nash-io/ts/polygon-update
Ts/polygon update
2 parents 8e5aa0e + fb12ec6 commit 6959219

File tree

5 files changed

+61
-13
lines changed

5 files changed

+61
-13
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
<a name="6.4.1"></a>
6+
## [6.4.1](https://github.com/nash-io/api-client-typescript/compare/v6.3.30...v6.4.1) (2022-12-19)
7+
8+
9+
10+
<a name="6.3.30"></a>
11+
## [6.3.30](https://github.com/nash-io/api-client-typescript/compare/v6.3.28...v6.3.30) (2022-12-14)
12+
13+
14+
515
<a name="6.3.28"></a>
616
## [6.3.28](https://github.com/nash-io/api-client-typescript/compare/v6.3.26...v6.3.28) (2022-12-08)
717

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@neon-exchange/api-client-typescript",
3-
"version": "6.3.28",
3+
"version": "6.4.1",
44
"description": "Official TypeScript client for interacting with the Nash exchange",
55
"main": "build/main/index.js",
66
"typings": "build/main/index.d.ts",
@@ -61,7 +61,7 @@
6161
"dependencies": {
6262
"@absinthe/socket": "0.2.1",
6363
"@neon-exchange/nash-perf": "1.0.4",
64-
"@neon-exchange/nash-protocol": "4.9.5",
64+
"@neon-exchange/nash-protocol": "4.9.7",
6565
"@types/isomorphic-fetch": "0.0.35",
6666
"@types/node": "13.9.8",
6767
"@types/request": "2.48.1",

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
}

src/client/environments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface EnvironmentConfig {
1313
neoScan?: string
1414
neoNetworkSettings?: typeof NEO_NETWORK[Networks.MainNet]
1515
ethNetworkSettings?: typeof ETH_NETWORK[Networks.MainNet]
16-
polygonNetworkSettings?: typeof ETH_NETWORK[Networks.MainNet]
16+
polygonNetworkSettings?: typeof POLYGON_NETWORK[Networks.MainNet]
1717
btcNetworkSettings?: typeof BTC_NETWORK[Networks.MainNet]
1818
isLocal: boolean
1919
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,10 @@
738738
node-fetch "2.6.0"
739739
semver "7.3.2"
740740

741-
"@neon-exchange/nash-protocol@4.9.5":
742-
version "4.9.5"
743-
resolved "https://registry.yarnpkg.com/@neon-exchange/nash-protocol/-/nash-protocol-4.9.5.tgz#910c6a9bb3ea17a559081cbb3d9ed62899ecab90"
744-
integrity sha512-Sxn077lSMYzwz2fLiwV2gxtnEFxd1aSB83wHLqINqdCNA8qlQDh8R7ciNU5sdMr7tN4RsGnH+gMp0lz5lNu6Dg==
741+
"@neon-exchange/nash-protocol@4.9.7":
742+
version "4.9.7"
743+
resolved "https://registry.yarnpkg.com/@neon-exchange/nash-protocol/-/nash-protocol-4.9.7.tgz#41dddf25618d394291313a1f1a13dcfc42e5014a"
744+
integrity sha512-pEq3rKk8qgclkZmFnRBedSI2mLaEm68kUUVmyH/3SJZOMrnof6xySlV1pBr91ooPq0TP8aKC9CjCt2j28dpC8g==
745745
dependencies:
746746
bchaddrjs "^0.5.2"
747747
bignumber.js "8.1.1"

0 commit comments

Comments
 (0)