fix: handle confirmationStatus field in TransactionStatus (#14583)

This commit is contained in:
Tyera Eulberg 2021-01-15 07:40:47 -07:00 committed by GitHub
parent 0fd21018d6
commit 299b3eb99d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

6
web3.js/module.d.ts vendored
View File

@ -93,10 +93,16 @@ declare module '@solana/web3.js' {
searchTransactionHistory: boolean;
};
export type TransactionConfirmationStatus =
| 'processed'
| 'confirmed'
| 'finalized';
export type SignatureStatus = {
slot: number;
err: TransactionError | null;
confirmations: number | null;
confirmationStatus: TransactionConfirmationStatus | null;
};
export type ConfirmedSignatureInfo = {

View File

@ -108,10 +108,16 @@ declare module '@solana/web3.js' {
searchTransactionHistory: boolean,
};
declare export type TransactionConfirmationStatus =
| 'processed'
| 'confirmed'
| 'finalized';
declare export type SignatureStatus = {
slot: number,
err: TransactionError | null,
confirmations: number | null,
confirmationStatus: TransactionConfirmationStatus | null,
};
declare export type ConfirmedSignatureInfo = {

View File

@ -1090,6 +1090,7 @@ const GetSignatureStatusesRpcResult = jsonRpcResultAndContext(
slot: 'number',
confirmations: struct.union(['number', 'null']),
err: TransactionErrorResult,
confirmationStatus: 'string?',
}),
]),
]),
@ -1577,11 +1578,13 @@ export type TransactionError = {};
* @property {number} slot when the transaction was processed
* @property {number | null} confirmations the number of blocks that have been confirmed and voted on in the fork containing `slot` (TODO)
* @property {TransactionError | null} err error, if any
* @property {string | null} confirmationStatus the transaction's cluster confirmation status, if data available. Possible non-null responses: `processed`, `confirmed`, `finalized`
*/
export type SignatureStatus = {
slot: number,
confirmations: number | null,
err: TransactionError | null,
confirmationStatus: string | null,
};
/**