From 2cb4afb4f7e55f26c9345d20e3c9a257efc5e09c Mon Sep 17 00:00:00 2001 From: Nur Fikri Date: Wed, 19 Jun 2024 07:03:57 +0700 Subject: [PATCH 1/3] fix: add only_testnets AssetRequestJSON --- packages/core/src/types/unified.ts | 101 +++++++++++++++-------------- 1 file changed, 51 insertions(+), 50 deletions(-) diff --git a/packages/core/src/types/unified.ts b/packages/core/src/types/unified.ts index f1a9014..dae03d9 100644 --- a/packages/core/src/types/unified.ts +++ b/packages/core/src/types/unified.ts @@ -46,6 +46,7 @@ export type AssetsRequestJSON = { include_cw20_assets?: boolean; include_evm_assets?: boolean; include_svm_assets?: boolean; + only_testnets?: boolean; }; export type AssetsRequest = { @@ -233,71 +234,71 @@ export type EstimatedFeeJSON = { export type OperationJSON = | { - transfer: TransferJSON; - tx_index: number; - amount_in: string; - amount_out: string; - } + transfer: TransferJSON; + tx_index: number; + amount_in: string; + amount_out: string; + } | { - bank_send: BankSendJSON; - tx_index: number; - amount_in: string; - amount_out: string; - } + bank_send: BankSendJSON; + tx_index: number; + amount_in: string; + amount_out: string; + } | { swap: SwapJSON; tx_index: number; amount_in: string; amount_out: string } | { - axelar_transfer: AxelarTransferJSON; - tx_index: number; - amount_in: string; - amount_out: string; - } + axelar_transfer: AxelarTransferJSON; + tx_index: number; + amount_in: string; + amount_out: string; + } | { - cctp_transfer: CCTPTransferJSON; - tx_index: number; - amount_in: string; - amount_out: string; - } + cctp_transfer: CCTPTransferJSON; + tx_index: number; + amount_in: string; + amount_out: string; + } | { - hyperlane_transfer: HyperlaneTransferJSON; - tx_index: number; - amount_in: string; - amount_out: string; - } + hyperlane_transfer: HyperlaneTransferJSON; + tx_index: number; + amount_in: string; + amount_out: string; + } | { - evm_swap: EvmSwapJSON; - tx_index: number; - amount_in: string; - amount_out: string; - }; + evm_swap: EvmSwapJSON; + tx_index: number; + amount_in: string; + amount_out: string; + }; export type Operation = | { transfer: Transfer; txIndex: number; amountIn: string; amountOut: string } | { bankSend: BankSend; txIndex: number; amountIn: string; amountOut: string } | { swap: Swap; txIndex: number; amountIn: string; amountOut: string } | { - axelarTransfer: AxelarTransfer; - txIndex: number; - amountIn: string; - amountOut: string; - } + axelarTransfer: AxelarTransfer; + txIndex: number; + amountIn: string; + amountOut: string; + } | { - cctpTransfer: CCTPTransfer; - txIndex: number; - amountIn: string; - amountOut: string; - } + cctpTransfer: CCTPTransfer; + txIndex: number; + amountIn: string; + amountOut: string; + } | { - hyperlaneTransfer: HyperlaneTransfer; - txIndex: number; - amountIn: string; - amountOut: string; - } + hyperlaneTransfer: HyperlaneTransfer; + txIndex: number; + amountIn: string; + amountOut: string; + } | { - evmSwap: EvmSwap; - txIndex: number; - amountIn: string; - amountOut: string; - }; + evmSwap: EvmSwap; + txIndex: number; + amountIn: string; + amountOut: string; + }; export type RouteResponseJSON = { source_asset_denom: string; From 53044c92b5917c8418bf144414d33649dc1007fb Mon Sep 17 00:00:00 2001 From: Nur Fikri Date: Wed, 19 Jun 2024 07:06:44 +0700 Subject: [PATCH 2/3] fix: add only testnets --- packages/core/src/types/converters.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/types/converters.ts b/packages/core/src/types/converters.ts index 6c7f70d..e96a787 100644 --- a/packages/core/src/types/converters.ts +++ b/packages/core/src/types/converters.ts @@ -278,6 +278,7 @@ export function assetsRequestToJSON( include_cw20_assets: assetsRequest.includeCW20Assets, include_evm_assets: assetsRequest.includeEvmAssets, include_svm_assets: assetsRequest.includeSvmAssets, + only_testnets: assetsRequest.onlyTestnets, }; } @@ -950,7 +951,7 @@ export function operationToJSON(operation: Operation): OperationJSON { } if ("swap" in operation) { - return { + return { swap: swapToJSON(operation.swap), tx_index: operation.txIndex, amount_in: operation.amountIn, From 3c47bf1364b0e669694c0729d7012fd5ceac013b Mon Sep 17 00:00:00 2001 From: Nur Fikri Date: Wed, 19 Jun 2024 07:07:25 +0700 Subject: [PATCH 3/3] chore: changeset --- .changeset/hot-laws-act.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/hot-laws-act.md diff --git a/.changeset/hot-laws-act.md b/.changeset/hot-laws-act.md new file mode 100644 index 0000000..a0f10a7 --- /dev/null +++ b/.changeset/hot-laws-act.md @@ -0,0 +1,5 @@ +--- +"@skip-router/core": patch +--- + +fix: onlyTestnets not working in assets