Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

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.

<a name="6.4.1"></a>
## [6.4.1](https://github.com/nash-io/api-client-typescript/compare/v6.3.30...v6.4.1) (2022-12-19)



<a name="6.3.30"></a>
## [6.3.30](https://github.com/nash-io/api-client-typescript/compare/v6.3.28...v6.3.30) (2022-12-14)



<a name="6.3.28"></a>
## [6.3.28](https://github.com/nash-io/api-client-typescript/compare/v6.3.26...v6.3.28) (2022-12-08)

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neon-exchange/api-client-typescript",
"version": "6.3.28",
"version": "6.4.1",
"description": "Official TypeScript client for interacting with the Nash exchange",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down Expand Up @@ -61,7 +61,7 @@
"dependencies": {
"@absinthe/socket": "0.2.1",
"@neon-exchange/nash-perf": "1.0.4",
"@neon-exchange/nash-protocol": "4.9.5",
"@neon-exchange/nash-protocol": "4.9.7",
"@types/isomorphic-fetch": "0.0.35",
"@types/node": "13.9.8",
"@types/request": "2.48.1",
Expand Down
50 changes: 44 additions & 6 deletions src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,40 @@ export const BIG_NUMBER_FORMAT = {

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

const TRADABLE_ASSETS = {
btc: ['btc'],
neo: [
'nos',
'lx',
'ava',
'phx',
'neo',
'guard',
'gas',
'nnn',
'nex',
'tmn',
'efx'
],
eth: [
'usdc',
'eth',
'link',
'zrx',
'bat',
'gunthy',
'ant',
'trac',
'qnt',
'usdt',
'rlc',
'noia',
'mco',
'efx'
],
polygon: ['matic', 'weth', 'wbtc', 'derc20']
}

export const UNLIMITED_APPROVAL = Number.MAX_SAFE_INTEGER

export class Client {
Expand Down Expand Up @@ -3210,12 +3244,16 @@ export class Client {
const assets: Asset[] = await this.listAssets()
for (const a of assets) {
if (TRADABLE_CHAINS.includes(a.blockchain.toString().toLowerCase())) {
assetList[a.symbol] = {
hash: a.hash,
precision: 8,
symbol: a.symbol,
blockchainPrecision: a.blockchainPrecision,
blockchain: a.blockchain
const tradeableOnChain =
TRADABLE_ASSETS[a.blockchain.toString().toLowerCase()]
if (tradeableOnChain.includes(a.symbol)) {
assetList[a.symbol] = {
hash: a.hash,
precision: 8,
symbol: a.symbol,
blockchainPrecision: a.blockchainPrecision,
blockchain: a.blockchain
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface EnvironmentConfig {
neoScan?: string
neoNetworkSettings?: typeof NEO_NETWORK[Networks.MainNet]
ethNetworkSettings?: typeof ETH_NETWORK[Networks.MainNet]
polygonNetworkSettings?: typeof ETH_NETWORK[Networks.MainNet]
polygonNetworkSettings?: typeof POLYGON_NETWORK[Networks.MainNet]
btcNetworkSettings?: typeof BTC_NETWORK[Networks.MainNet]
isLocal: boolean
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,10 @@
node-fetch "2.6.0"
semver "7.3.2"

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