Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

feat: add getParsedConfirmedTransaction API #11412

Merged
merged 1 commit into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions web3.js/module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,39 @@ declare module '@solana/web3.js' {
meta: ConfirmedTransactionMeta | null;
};

export type ParsedMessageAccount = {
pubkey: PublicKey;
signer: boolean;
writable: boolean;
};

export type ParsedInstruction = {
programId: PublicKey;
program: string;
parsed: string;
};

export type PartiallyDecodedInstruction = {
programId: PublicKey;
accounts: Array<PublicKey>;
data: string;
};

export type ParsedTransaction = {
signatures: Array<string>;
message: {
accountKeys: ParsedMessageAccount[];
instructions: (ParsedInstruction | PartiallyDecodedInstruction)[];
recentBlockhash: string;
};
};

export type ParsedConfirmedTransaction = {
slot: number;
transaction: ParsedTransaction;
meta: ConfirmedTransactionMeta | null;
};

export type KeyedAccountInfo = {
accountId: PublicKey;
accountInfo: AccountInfo;
Expand Down Expand Up @@ -288,6 +321,9 @@ declare module '@solana/web3.js' {
getConfirmedTransaction(
signature: TransactionSignature,
): Promise<ConfirmedTransaction | null>;
getParsedConfirmedTransaction(
signature: TransactionSignature,
): Promise<ParsedConfirmedTransaction | null>;
getConfirmedSignaturesForAddress(
address: PublicKey,
startSlot: number,
Expand Down
36 changes: 36 additions & 0 deletions web3.js/module.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,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,
Expand Down Expand Up @@ -304,6 +337,9 @@ declare module '@solana/web3.js' {
getConfirmedTransaction(
signature: TransactionSignature,
): Promise<ConfirmedTransaction | null>;
getParsedConfirmedTransaction(
signature: TransactionSignature,
): Promise<ParsedConfirmedTransaction | null>;
getConfirmedSignaturesForAddress(
address: PublicKey,
startSlot: number,
Expand Down
37 changes: 7 additions & 30 deletions web3.js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web3.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"@babel/preset-flow": "^7.0.0",
"@commitlint/config-conventional": "^9.0.1",
"@commitlint/travis-cli": "^9.0.1",
"@solana/spl-token": "^0.0.4",
"@solana/spl-token": "^0.0.5",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"acorn": "^7.0.0",
Expand Down
Loading