-
Notifications
You must be signed in to change notification settings - Fork 261
Expand file tree
/
Copy pathtrackedTransaction.ts
More file actions
35 lines (32 loc) · 1.22 KB
/
trackedTransaction.ts
File metadata and controls
35 lines (32 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import {ethers} from 'ethers';
import {TransactionTitle} from './transactionTitle';
export type TransactionStatus = 'Pending' | 'Succeeded' | 'Failed' | 'Replaced' | 'Unknown';
// "Redux" stuff needs to be serializable. Blockchain transaction object is unserializable.
export interface TrackedTransaction {
id: string;
chainId: number;
hash: string;
/**
* The address this transaction is from.
*/
signerAddress: string;
/**
* Milliseconds since epoch when started tracking the transaction.
*/
timestampMs: number;
status: TransactionStatus;
transactionResponse?: string;
transactionReceipt?: string;
ethersErrorCode?: ethers.errors;
ethersErrorMessage?: string;
title: TransactionTitle;
extraData: Record<string, unknown>;
/**
* `true` when Subgraph polling was successful, i.e. Subgraph has indexed the transaction. Will be `undefined` if the polling was unsuccessful or we don't know whether it's in sync or not.
*/
isSubgraphInSync?: true;
/**
* The block number where transaction succeeded. Useful for creating polling mechanisms outside of the SDK. For example, another Subgraph API slize.
*/
blockTransactionSucceededIn?: number;
}