@swapper-finance/sdk
Version:
JavaScript SDK form Swapper
57 lines (52 loc) • 1.27 kB
text/typescript
type TransferType = "CROSS_CHAIN" | "SINGLE_CHAIN";
export type TransactionHistory = {
history: HistoryTransaction[];
};
export type HistoryTransaction = {
transferId: string;
transferType: TransferType;
walletAddress: string;
messageId: string;
// ExecutorRunFailed
failed: boolean;
// MessageSent
source: {
blockchainId: string;
transactionHash: string;
blockTime: Date;
tokenAmount: string;
tokenAddress: string;
transferredTokenAddress: string;
transferredTokenAmount: string;
valueForInstantCcipRecieve: string;
tokenOutAddress: string;
estimatedAmountOut: string;
targetBlockchainId: string;
} | null;
// MessageReceived
target: {
blockchainId: string;
transactionHash: string;
blockTime: Date;
tokenAmount: string;
tokenAddress: string;
} | null;
};
export type TransactionStatus =
| "IN_PROGRESS"
| "SUCCESS"
| "FAIL"
| "NOT_FOUND";
export type Transaction = {
messageId?: string;
hash: string;
timestamp: number;
sourceChainId: string;
targetChainId: string;
amountWei: string;
tokenAddress: string;
tokenOutAddress: string | undefined;
tokenOutAmount: string | undefined;
estimatedDeliveryTimestamp: number;
status: TransactionStatus;
};