From 039045e958e46fcb2c394637de300e6c6b904d9a Mon Sep 17 00:00:00 2001 From: shrpne Date: Fri, 15 Apr 2022 18:33:28 +0300 Subject: [PATCH] update sdk to fix how axios adapters options is applied --- api/gate.js | 2 +- assets/debounce-promise.js | 9 ++++++--- package-lock.json | 17 ++++++++--------- package.json | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/api/gate.js b/api/gate.js index 02e538d1..4fb8e895 100644 --- a/api/gate.js +++ b/api/gate.js @@ -99,7 +99,7 @@ export function estimateCoinBuy(params, axiosOptions) { //@TODO use same `getCommissionPrice` in `estimateTxCommission` (update sdk) const estimateCommissionCache = new Cache({maxAge: 30 * 1000}); -export const estimateTxCommission = (params, options, axiosOptions) => EstimateTxCommission(minterApi)(params, {loose: true, ...options}, {...axiosOptions, cache: estimateCommissionCache}); +export const estimateTxCommission = (params, options, axiosOptions) => EstimateTxCommission(minterApi)(params, {loose: true, ...options}, {...axiosOptions, cache: estimateCommissionCache}, {cache: estimateCommissionCache}); const coinCache = new Cache({maxAge: 1 * 60 * 1000}); export const replaceCoinSymbol = ReplaceCoinSymbol(minterApi); diff --git a/assets/debounce-promise.js b/assets/debounce-promise.js index a63b7152..efc37477 100644 --- a/assets/debounce-promise.js +++ b/assets/debounce-promise.js @@ -69,7 +69,10 @@ function defer() { return deferred; } -function CancelError(message = 'Canceled') { - Error.call(this, message); - this.isCanceled = true; +class CancelError extends Error { + constructor(message = 'Canceled') { + super(message); + this.name = 'CancelError'; + this.isCanceled = true; + } } diff --git a/package-lock.json b/package-lock.json index dfb48837..85f9e7fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "minter-console-web", - "version": "0.12.0", + "version": "0.12.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -16840,9 +16840,9 @@ } }, "minter-js-sdk": { - "version": "0.42.1", - "resolved": "https://registry.npmjs.org/minter-js-sdk/-/minter-js-sdk-0.42.1.tgz", - "integrity": "sha512-en9ukd6bM5/D0vKjnTEYdFX+VRymUd0gyJPR/qmNHuw3nk/cn1sx2upymOXjbcvm70e0LWhKOwNjBEifZdL8eQ==", + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/minter-js-sdk/-/minter-js-sdk-0.43.0.tgz", + "integrity": "sha512-rQ6/8Fn9Vye8cUtEco9AMp/5+2eOhcGjQ5kd9hXJtLSnGbF8ioim3fLb+tjzxub8957JQ5QpiqQJzWgV5e9cOQ==", "requires": { "@babel/runtime": "^7.17.8", "axios": "^0.26.1", @@ -18074,14 +18074,13 @@ }, "dependencies": { "asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "requires": { "bn.js": "^4.0.0", "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" + "minimalistic-assert": "^1.0.0" } } } diff --git a/package.json b/package.json index 67f7e992..4c9540fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minter-console-web", - "version": "0.12.1", + "version": "0.12.2", "description": "Minter Console Website", "author": "shrpne ", "private": true, @@ -62,7 +62,7 @@ "lodash-es": "^4.17.21", "minter-coin-block-list": "0.0.10", "minter-footer-links": "^3.1.0", - "minter-js-sdk": "^0.42.1", + "minter-js-sdk": "^0.43.0", "minterjs-tx": "^12.0.0", "minterjs-util": "^0.23.0", "minterjs-wallet": "^6.1.1",