Add KIN markets (#57)

This commit is contained in:
Nathaniel Parke 2021-01-08 11:47:21 -08:00 committed by GitHub
parent c6d0da0fc6
commit cbc20ab3a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -9,7 +9,7 @@
"@project-serum/associated-token": "0.1.0",
"@project-serum/awesome-serum": "1.0.1",
"@project-serum/pool": "^0.2.0",
"@project-serum/serum": "^0.13.16",
"@project-serum/serum": "^0.13.18",
"@project-serum/sol-wallet-adapter": "^0.1.1",
"@solana/web3.js": "0.86.1",
"@testing-library/jest-dom": "^4.2.4",

View File

@ -39,8 +39,10 @@ export function roundToDecimal(
}
export function getDecimalCount(value): number {
if (!isNaN(value) && Math.floor(value) !== value)
if (!isNaN(value) && Math.floor(value) !== value && value.toString().includes('.'))
return value.toString().split('.')[1].length || 0;
if (!isNaN(value) && Math.floor(value) !== value && value.toString().includes('e'))
return parseInt(value.toString().split(('e-'))[1] || "0");
return 0;
}

View File

@ -1582,10 +1582,10 @@
bn.js "^5.1.2"
buffer-layout "^1.2.0"
"@project-serum/serum@^0.13.16":
version "0.13.16"
resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.16.tgz#bdaffc346a42842e33672772c44b9a7497ed0a97"
integrity sha512-F0cMpW+B8+nUldMkgwYgGZjPP7JztF8QWVlBpcqStW8dHbq1QLgUjhiakEwUhAH9VxqJYECLDLVqXGcvkq2pIQ==
"@project-serum/serum@^0.13.18":
version "0.13.18"
resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.18.tgz#66adf2cf00d54612b71ec7cff211658060a8d660"
integrity sha512-DpTMuidbLSMt9TQSIRhusLyt5TcGXaiTBH7IsowZQrexa4gXgKmSrpuSc7JLUs9V7t7ILta8KX5YHTFQuWJEZQ==
dependencies:
"@solana/web3.js" "0.86.1"
bn.js "^5.1.2"