feat: add getParsedConfirmedTransaction API

This commit is contained in:
Justin Starry
2020-08-06 19:16:01 +08:00
committed by Justin Starry
parent 5a63c9d535
commit b36e60738e
7 changed files with 414 additions and 133 deletions

View File

@ -169,6 +169,39 @@ declare module '@solana/web3.js' {
meta: ConfirmedTransactionMeta | null,
};
declare export type ParsedMessageAccount = {
pubkey: PublicKey,
signer: boolean,
writable: boolean,
};
declare export type ParsedInstruction = {|
programId: PublicKey,
program: string,
parsed: string,
|};
declare export type PartiallyDecodedInstruction = {|
programId: PublicKey,
accounts: Array<PublicKey>,
data: string,
|};
declare export type ParsedTransaction = {
signatures: Array<string>,
message: {
accountKeys: ParsedMessageAccount[],
instructions: (ParsedInstruction | PartiallyDecodedInstruction)[],
recentBlockhash: string,
},
};
declare export type ParsedConfirmedTransaction = {
slot: number,
transaction: ParsedTransaction,
meta: ConfirmedTransactionMeta | null,
};
declare export type KeyedAccountInfo = {
accountId: PublicKey,
accountInfo: AccountInfo,
@ -309,6 +342,9 @@ declare module '@solana/web3.js' {
getConfirmedTransaction(
signature: TransactionSignature,
): Promise<ConfirmedTransaction | null>;
getParsedConfirmedTransaction(
signature: TransactionSignature,
): Promise<ParsedConfirmedTransaction | null>;
getConfirmedSignaturesForAddress(
address: PublicKey,
startSlot: number,