diff --git a/src/fixtures.ts b/src/fixtures.ts index 560c098..40d2aae 100644 --- a/src/fixtures.ts +++ b/src/fixtures.ts @@ -39,6 +39,8 @@ export const aPrice = (): Price => ({ chainId: constants.StarknetChainId.SN_GOERLI, sourceName: 'AMM1', priceRatioUsd: 0, + gasFees: BigInt(0), + gasFeesInUsd: 0, }); export const aQuote = (): Quote => ({ diff --git a/src/services.spec.ts b/src/services.spec.ts index ffc1c99..1453afd 100644 --- a/src/services.spec.ts +++ b/src/services.spec.ts @@ -42,6 +42,7 @@ describe('Avnu services', () => { ...aPrice(), sellAmount: toBeHex(parseUnits('1', 18)), buyAmount: toBeHex(parseUnits('2', 18)), + gasFees: '0x0', }, ]; const queryParams = { ...aPriceRequest(), sellAmount: '0x0de0b6b3a7640000' }; @@ -64,6 +65,7 @@ describe('Avnu services', () => { ...aPrice(), sellAmount: toBeHex(parseUnits('1', 18)), buyAmount: toBeHex(parseUnits('2', 18)), + gasFees: '0x0', }, ]; const queryParams = { ...aPriceRequest(), sellAmount: '0x0de0b6b3a7640000' }; diff --git a/src/services.ts b/src/services.ts index 557b7e7..ba92342 100644 --- a/src/services.ts +++ b/src/services.ts @@ -63,7 +63,12 @@ const fetchPrices = (request: PriceRequest, options?: AvnuOptions): Promise parseResponse(response, options?.avnuPublicKey)) .then((prices) => - prices.map((price) => ({ ...price, sellAmount: BigInt(price.sellAmount), buyAmount: BigInt(price.buyAmount) })), + prices.map((price) => ({ + ...price, + sellAmount: BigInt(price.sellAmount), + buyAmount: BigInt(price.buyAmount), + gasFees: BigInt(price.gasFees), + })), ); }; diff --git a/src/types.ts b/src/types.ts index 375c9a4..459cf9f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -74,6 +74,8 @@ export interface Price { chainId: string; sourceName: string; priceRatioUsd: number; + gasFees: bigint; + gasFeesInUsd: number; } export interface Quote {