diff --git a/sdk/package-lock.json b/sdk/package-lock.json index b6e01d3b..990cb940 100644 --- a/sdk/package-lock.json +++ b/sdk/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gobob/bob-sdk", - "version": "2.2.3", + "version": "2.2.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gobob/bob-sdk", - "version": "2.2.3", + "version": "2.2.4", "dependencies": { "@scure/base": "^1.1.7", "@scure/btc-signer": "^1.3.2", diff --git a/sdk/package.json b/sdk/package.json index bf623b3b..77623bdc 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@gobob/bob-sdk", - "version": "2.2.3", + "version": "2.2.4", "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { diff --git a/sdk/src/gateway/client.ts b/sdk/src/gateway/client.ts index b22963d2..910b5e2d 100644 --- a/sdk/src/gateway/client.ts +++ b/sdk/src/gateway/client.ts @@ -132,7 +132,7 @@ export class GatewayApiClient { const quote: GatewayQuote = await response.json(); return { ...quote, - fee: Math.max(0, quote.fee - (params.gasRefill || 0)), + fee: quote.fee + (params.gasRefill || 0), }; } diff --git a/sdk/test/gateway.test.ts b/sdk/test/gateway.test.ts index c0711fce..d969e1ed 100644 --- a/sdk/test/gateway.test.ts +++ b/sdk/test/gateway.test.ts @@ -34,7 +34,7 @@ describe("Gateway Tests", () => { nock(`${MAINNET_GATEWAY_BASE_URL}`) .get(`/quote/${SYMBOL_LOOKUP[ChainId.BOB]["tbtc"].address}?satoshis=1000`) - .times(6) + .times(5) .reply(200, mockQuote); assert.deepEqual(await gatewaySDK.getQuote({ @@ -67,14 +67,7 @@ describe("Gateway Tests", () => { toUserAddress: ZeroAddress, amount: 1000, gasRefill: 5, - }), { ...mockQuote, fee: 5 }); - assert.deepEqual(await gatewaySDK.getQuote({ - toChain: "BOB", - toToken: "tBTC", - toUserAddress: ZeroAddress, - amount: 1000, - gasRefill: 1000, - }), { ...mockQuote, fee: 0 }); + }), { ...mockQuote, fee: 15 }); // get the total available without amount nock(`${MAINNET_GATEWAY_BASE_URL}`)