From e0ce2e3b0dd1fe3748f430bf6bcb95d1a5567e9f Mon Sep 17 00:00:00 2001 From: nnoln Date: Wed, 4 Sep 2024 16:22:20 -0300 Subject: [PATCH] add status api types --- package.json | 2 +- src/status/index.ts | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e7349e3..640ae0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@0xsquid/squid-types", - "version": "0.1.102", + "version": "0.1.103", "description": "JS and TS types relating to 0xsquid related projects.", "main": "dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/status/index.ts b/src/status/index.ts index b5b75df..c32f853 100644 --- a/src/status/index.ts +++ b/src/status/index.ts @@ -23,10 +23,16 @@ type TransactionStatus = { callEventLog: Array; chainData?: ChainData; transactionUrl?: string; + destinationAddress?: string; +}; + +export type YupError = { + path: string; + message: string; }; export type ApiBasicResponse = { - error?: string | TypeError[] | GMPError; + error?: string | TypeError[] | YupError[] | GMPError; errorType?: string; }; @@ -55,7 +61,7 @@ export type StatusResponse = ApiBasicResponse & { export type RouteStatus = { chainId: string | number; txHash: string; - status: string; + status: RouteActionStatus; action: AxelarRouteAction; }; @@ -70,8 +76,21 @@ export enum AxelarRouteAction { APPROVED = "approved", } +export enum RouteActionStatus { + SUCCESS = "success", + FAILURE = "failure", + NOT_FOUND = "not_found", + UNKNOWN = "unknown", + AWAITING = "awaiting", +} + export enum CCTPStatus { ERROR = "error", COMPLETE = "complete", PENDING = "pending", } + +export enum SendTokenStatus { + ASSET_SENT = "asset_sent", + EXECUTED = "executed", +}