Skip to content

Commit

Permalink
Merge pull request #237 from skip-mev/fix/add-only_testnets-AssetRequ…
Browse files Browse the repository at this point in the history
…estJSON

fix: add only_testnets AssetRequestJSON
  • Loading branch information
codingki authored Jun 19, 2024
2 parents bd45294 + 3c47bf1 commit 388216b
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-laws-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@skip-router/core": patch
---

fix: onlyTestnets not working in assets
3 changes: 2 additions & 1 deletion packages/core/src/types/converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}

Expand Down Expand Up @@ -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,
Expand Down
101 changes: 51 additions & 50 deletions packages/core/src/types/unified.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 388216b

Please sign in to comment.