diff --git a/package-lock.json b/package-lock.json index a4bafc0..aeaa764 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "etherspot", - "version": "1.42.7", + "version": "1.42.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "etherspot", - "version": "1.42.7", + "version": "1.42.8", "license": "MIT", "dependencies": { "@apollo/client": "3.4.0", diff --git a/package.json b/package.json index aa16be7..76e8d33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "etherspot", - "version": "1.42.7", + "version": "1.42.8", "description": "Etherspot SDK", "keywords": [ "ether", diff --git a/src/sdk/dto/advance-routes-lifi.dto.ts b/src/sdk/dto/advance-routes-lifi.dto.ts index 455d863..656944e 100644 --- a/src/sdk/dto/advance-routes-lifi.dto.ts +++ b/src/sdk/dto/advance-routes-lifi.dto.ts @@ -34,4 +34,8 @@ export class GetAdvanceRoutesLiFiDto { @IsOptional() @IsBoolean() allowSwitchChain?: boolean; + + @IsOptional() + @IsBoolean() + showZeroUsd?: boolean; } \ No newline at end of file diff --git a/src/sdk/dto/get-exchange-cross-chain-quote.dto.ts b/src/sdk/dto/get-exchange-cross-chain-quote.dto.ts index 38ea913..c9a7a13 100644 --- a/src/sdk/dto/get-exchange-cross-chain-quote.dto.ts +++ b/src/sdk/dto/get-exchange-cross-chain-quote.dto.ts @@ -1,6 +1,6 @@ import { BigNumber } from 'ethers'; import { Type } from 'class-transformer'; -import { IsInt, IsOptional, IsPositive } from 'class-validator'; +import { IsBoolean, IsInt, IsOptional, IsPositive } from 'class-validator'; import { IsAddress, IsBigNumberish } from './validators'; import { CrossChainServiceProvider, LiFiBridge } from '..'; @@ -37,4 +37,8 @@ export class GetExchangeCrossChainQuoteDto { @IsOptional() lifiBridges?: LiFiBridge[]; + + @IsOptional() + @IsBoolean() + showZeroUsd?: boolean; } diff --git a/src/sdk/dto/get-exchange-offers.dto.ts b/src/sdk/dto/get-exchange-offers.dto.ts index be3a6ea..540a9dc 100644 --- a/src/sdk/dto/get-exchange-offers.dto.ts +++ b/src/sdk/dto/get-exchange-offers.dto.ts @@ -1,4 +1,4 @@ -import { IsOptional } from 'class-validator'; +import { IsBoolean, IsOptional } from 'class-validator'; import { BigNumberish } from 'ethers'; import { IsAddress, IsBigNumberish } from './validators'; @@ -25,4 +25,8 @@ export class GetExchangeOffersDto { @IsAddress() fromAddress?: string; + @IsOptional() + @IsBoolean() + showZeroUsd?: boolean; + } diff --git a/src/sdk/exchange/exchange.service.ts b/src/sdk/exchange/exchange.service.ts index 5935322..abfc579 100644 --- a/src/sdk/exchange/exchange.service.ts +++ b/src/sdk/exchange/exchange.service.ts @@ -74,6 +74,7 @@ export class ExchangeService extends Service { lifiBridges?: LiFiBridge[], toAddress?: string, fromAddress?: string, + showZeroUsd?: boolean, ): Promise { const { apiService, accountService } = this.services; @@ -94,6 +95,7 @@ export class ExchangeService extends Service { $lifiBridges: [LiFiBridge!] $toAddress: String $fromAddress: String + $showZeroUsd: Boolean ) { result: getCrossChainQuotes( account: $account @@ -106,6 +108,7 @@ export class ExchangeService extends Service { lifiBridges: $lifiBridges toAddress: $toAddress fromAddress: $fromAddress + showZeroUsd: $showZeroUsd ) { items { provider @@ -174,6 +177,7 @@ export class ExchangeService extends Service { lifiBridges, toAddress, fromAddress, + showZeroUsd, }, models: { result: BridgingQuotes, @@ -193,6 +197,7 @@ export class ExchangeService extends Service { toAddress?: string, allowSwitchChain?: boolean, fromAddress?: string, + showZeroUsd?: boolean, ): Promise { const { apiService, accountService } = this.services; @@ -214,6 +219,7 @@ export class ExchangeService extends Service { $toAddress: String $allowSwitchChain: Boolean $fromAddress: String + $showZeroUsd: Boolean ) { result: getAdvanceRoutesLiFi( account: $account @@ -225,6 +231,7 @@ export class ExchangeService extends Service { toAddress: $toAddress allowSwitchChain: $allowSwitchChain fromAddress: $fromAddress + showZeroUsd: $showZeroUsd ) { data } @@ -241,6 +248,7 @@ export class ExchangeService extends Service { toAddress, allowSwitchChain, fromAddress, + showZeroUsd, }, }, ); @@ -346,6 +354,7 @@ export class ExchangeService extends Service { fromChainId: number, toAddress?: string, fromAddress?: string, + showZeroUsd?: boolean, ): Promise { const { apiService, accountService } = this.services; @@ -365,6 +374,7 @@ export class ExchangeService extends Service { $fromAmount: BigNumber! $toAddress: String $fromAddress: String + $showZeroUsd: Boolean ) { result: exchangeOffers( chainId: $fromChainId @@ -374,6 +384,7 @@ export class ExchangeService extends Service { fromAmount: $fromAmount toAddress: $toAddress fromAddress: $fromAddress + showZeroUsd: $showZeroUsd ) { items { provider @@ -397,6 +408,7 @@ export class ExchangeService extends Service { fromAmount, toAddress, fromAddress, + showZeroUsd, }, models: { result: ExchangeOffers, diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index a2b8985..0d36dca 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -1351,7 +1351,7 @@ export class Sdk { * @return Promise */ async getExchangeOffers(dto: GetExchangeOffersDto): Promise { - const { fromTokenAddress, toTokenAddress, fromAmount, fromChainId, toAddress, fromAddress } = await validateDto(dto, GetExchangeOffersDto, { + const { fromTokenAddress, toTokenAddress, fromAmount, fromChainId, toAddress, fromAddress, showZeroUsd } = await validateDto(dto, GetExchangeOffersDto, { addressKeys: ['fromTokenAddress', 'toTokenAddress'], }); @@ -1370,6 +1370,7 @@ export class Sdk { chainId, toAddress, fromAddress, + showZeroUsd, ); } @@ -1407,6 +1408,7 @@ export class Sdk { lifiBridges, toAddress, fromAddress, + showZeroUsd, } = await validateDto(dto, GetExchangeCrossChainQuoteDto, { addressKeys: ['fromTokenAddress', 'toTokenAddress'], }); @@ -1428,6 +1430,7 @@ export class Sdk { lifiBridges, toAddress, fromAddress, + showZeroUsd, ); } @@ -1441,6 +1444,7 @@ export class Sdk { toAddress, allowSwitchChain, fromAddress, + showZeroUsd, } = await validateDto(dto, GetAdvanceRoutesLiFiDto, { addressKeys: ['fromTokenAddress', 'toTokenAddress'], }); @@ -1457,6 +1461,7 @@ export class Sdk { toAddress, allowSwitchChain, fromAddress, + showZeroUsd, ); return data;