Skip to content

Commit

Permalink
add error message field to GoFastTransferInfo (#606)
Browse files Browse the repository at this point in the history
Co-authored-by: Nur Fikri <codingki@gmail.com>
  • Loading branch information
thal0x and codingki authored Dec 23, 2024
1 parent 40a9229 commit fa9b9c9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-ravens-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@skip-go/client': patch
---

add error message field on GoFastTransferInfo
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Below are detailed explanations of the different fields and their purposes:
* `state`: Indicates the current status of the transfer. Possible values are:
* `GO_FAST_TRANSFER_UNKNOWN`: An unknown error has occurred.
* `GO_FAST_TRANSFER_SENT`: The user's intent has been successfully submitted on the source chain.
* `GO_FAST_POST_ACTION_FAILED`: The transfer failed after the initial intent submission.
* `GO_FAST_POST_ACTION_FAILED`: The transfer's post-intent action failed. For example a swap on the destination chain failed due to slippage.
* `GO_FAST_TRANSFER_TIMEOUT`: The transfer did not complete within the expected time frame.
* `GO_FAST_TRANSFER_FILLED`: The transfer was successfully fulfilled on the destination chain.
* `GO_FAST_TRANSFER_REFUNDED`: The user's assets have been refunded on the source chain.
Expand All @@ -189,6 +189,7 @@ Below are detailed explanations of the different fields and their purposes:
* `order_filled_tx`: The transaction where the solver called fulfill on the destination chain.
* `order_refunded_tx`: The transaction where the user received a refund on the source chain, if applicable.
* `order_timeout_tx`: The transaction indicating a timeout occurred in the transfer process.
* `error_message`: A message describing the error that occurred during the transfer, if applicable.


When tracking a Go Fast transfer, you can use the `GoFastTransferInfo` to monitor the progress and status of your asset transfer between chains. For instance, if the state is `GO_FAST_TRANSFER_FILLED`, you know that the transfer was successful and your assets should be available on the destination chain. If the state is `GO_FAST_TRANSFER_TIMEOUT`, you can check the `orderTimeoutTx` for details on the timeout event.
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/types/converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,7 @@ export function goFastTransferInfoFromJSON(
toChainID: value.to_chain_id,
state: value.state,
txs: value.txs && goFastTransferTransactionsFromJSON(value.txs),
errorMessage: value.error_message,
};
}

Expand All @@ -2025,6 +2026,7 @@ export function goFastTransferInfoToJson(
to_chain_id: value.toChainID,
state: value.state,
txs: value.txs && goFastTransferTransactionsToJSON(value.txs),
error_message: value.errorMessage,
};
}

Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/types/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,15 @@ export type GoFastTransferInfoJSON = {
to_chain_id: string;
state: GoFastTransferState;
txs: GoFastTransferTransactionsJSON;
error_message: string | null;
};

export type GoFastTransferInfo = {
fromChainID: string;
toChainID: string;
state: GoFastTransferState;
txs: GoFastTransferTransactions;
errorMessage: string | null;
};

export type StargateTransferState =
Expand Down
2 changes: 1 addition & 1 deletion vendor/noble-cctp
Submodule noble-cctp updated 298 files

0 comments on commit fa9b9c9

Please sign in to comment.