Skip to content

Commit

Permalink
add SmartRelayFeeQuote type
Browse files Browse the repository at this point in the history
  • Loading branch information
dhfang committed Aug 21, 2024
1 parent b26ed5e commit 80e7090
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/client/src/types/converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ import {
SwapExactCoinInJSON,
SwapExactCoinOut,
SwapExactCoinOutJSON,
SmartRelayFeeQuote,
SmartRelayFeeQuoteJSON,
SmartSwapExactCoinIn,
SmartSwapExactCoinInJSON,
SwapJSON,
Expand Down Expand Up @@ -1520,6 +1522,28 @@ export function bankSendToJSON(value: BankSend): BankSendJSON {
};
}

export function smartRelayFeeQuoteFromJSON(value: SmartRelayFeeQuoteJSON): SmartRelayFeeQuote {
return {
feeAmount: value.fee_amount,
feeAddress: value.fee_address,
paymentContractAddress: value.payment_contract_address,
relayerAddress: value.relayer_address,
expiration: value.expiration,
token: value.token,
}
}

export function smartRelayFeeQuoteToJSON(value: SmartRelayFeeQuote): SmartRelayFeeQuoteJSON {
return {
fee_amount: value.feeAmount,
fee_address: value.feeAddress,
payment_contract_address: value.paymentContractAddress,
relayer_address: value.relayerAddress,
expiration: value.expiration,
token: value.token,
}
}

export function cctpTransferFromJSON(value: CCTPTransferJSON): CCTPTransfer {
return {
fromChainID: value.from_chain_id,
Expand All @@ -1529,6 +1553,7 @@ export function cctpTransferFromJSON(value: CCTPTransferJSON): CCTPTransfer {
denomIn: value.denom_in,
denomOut: value.denom_out,
smartRelay: value.smart_relay,
smartRelayFeeQuote: smartRelayFeeQuoteFromJSON(value.smart_relay_fee_quote),
};
}

Expand All @@ -1541,6 +1566,7 @@ export function cctpTransferToJSON(value: CCTPTransfer): CCTPTransferJSON {
denom_in: value.denomIn,
denom_out: value.denomOut,
smart_relay: value.smartRelay,
smart_relay_fee_quote: smartRelayFeeQuoteToJSON(value.smartRelayFeeQuote),
};
}

Expand Down
20 changes: 20 additions & 0 deletions packages/client/src/types/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export type CCTPTransferJSON = {
denom_in: string;
denom_out: string;
smart_relay: boolean;
smart_relay_fee_quote: SmartRelayFeeQuoteJSON;
};

export type CCTPTransfer = {
Expand All @@ -221,6 +222,7 @@ export type CCTPTransfer = {
denomIn: string;
denomOut: string;
smartRelay: boolean;
smartRelayFeeQuote: SmartRelayFeeQuote;
};

export type HyperlaneTransferJSON = {
Expand Down Expand Up @@ -269,6 +271,24 @@ export type OPInitTransfer = {
smartRelay: boolean;
};

export type SmartRelayFeeQuoteJSON = {
fee_amount: string;
fee_address?: string;
payment_contract_address?: string;
relayer_address: string;
expiration: Date;
token: string;
}

export type SmartRelayFeeQuote = {
feeAmount: string;
feeAddress?: string;
paymentContractAddress?: string;
relayerAddress: string;
expiration: Date;
token: string;
}

export type SwapVenueJSON = {
name: string;
chain_id: string;
Expand Down

0 comments on commit 80e7090

Please sign in to comment.