From c4c785250dae362a4e89f878b84a6c15d0d23ee2 Mon Sep 17 00:00:00 2001 From: "Bernard \"BeroBurny\" Stojanovic" Date: Fri, 18 Oct 2024 18:05:27 +0700 Subject: [PATCH] status --- packages/sdk/src/helpers/getBridgeHistory.ts | 8 ++++++++ packages/sdk/src/helpers/sygmaTypes.ts | 10 +++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/sdk/src/helpers/getBridgeHistory.ts b/packages/sdk/src/helpers/getBridgeHistory.ts index d69bf98..bbfb765 100644 --- a/packages/sdk/src/helpers/getBridgeHistory.ts +++ b/packages/sdk/src/helpers/getBridgeHistory.ts @@ -10,6 +10,13 @@ interface History { destinationName: string; amount: string; tokenSymbol: string; + status: Status; +} + +export enum Status { + pending = "pending", + executed = "executed", + failed = "failed", } export async function experimental_getBridgeHistory( @@ -68,5 +75,6 @@ function handleSygmaResponseEntry(entry: SygmaTransfer): History { destinationName: entry.toDomain.name, amount: entry.amount, tokenSymbol: entry.fee.tokenSymbol, + status: entry.status, }; } diff --git a/packages/sdk/src/helpers/sygmaTypes.ts b/packages/sdk/src/helpers/sygmaTypes.ts index 3a97fc3..ce026f7 100644 --- a/packages/sdk/src/helpers/sygmaTypes.ts +++ b/packages/sdk/src/helpers/sygmaTypes.ts @@ -1,3 +1,5 @@ +import {Status} from "./getBridgeHistory"; + export interface SygmaTransfer { id: string; depositNonce: number; @@ -10,7 +12,7 @@ export interface SygmaTransfer { destination: string; amount: string; timestamp?: string; - status: TransferStatus; + status: Status; deposit?: Deposit; execution?: Execution; fee: Fee; @@ -19,12 +21,6 @@ export interface SygmaTransfer { accountId: string; } -export enum TransferStatus { - pending = "pending", - executed = "executed", - failed = "failed", -} - export interface Resource { id: string; type: string;