feat: support blockTime on getConfirmedSignaturesForAddress2 (#14573)

* feat: support blockTime on getConfirmedSignaturesForAddress2

* feat: support getConfirmedTransaction blockTime

* fix: add ConfirmedBlock typings

* fix: modify property description

* fix: fix formatting in type files
This commit is contained in:
Josh 2021-01-15 20:28:28 -08:00 committed by GitHub
parent 66b54b852d
commit 4d12cf61cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 1 deletions

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

@ -110,6 +110,7 @@ declare module '@solana/web3.js' {
slot: number;
err: TransactionError | null;
memo: string | null;
blockTime?: number | null;
};
export type BlockhashAndFeeCalculator = {
@ -189,6 +190,12 @@ declare module '@solana/web3.js' {
transaction: Transaction;
meta: ConfirmedTransactionMeta | null;
}>;
rewards: Array<{
pubkey: string;
lamports: number;
postBalance: number | null;
rewardType: string | null;
}>;
};
export type PerfSample = {
@ -202,6 +209,7 @@ declare module '@solana/web3.js' {
slot: number;
transaction: Transaction;
meta: ConfirmedTransactionMeta | null;
blockTime?: number | null;
};
export type ParsedMessageAccount = {

View File

@ -125,6 +125,7 @@ declare module '@solana/web3.js' {
slot: number,
err: TransactionError | null,
memo: string | null,
blockTime?: number | null,
};
declare export type BlockhashAndFeeCalculator = {
@ -204,6 +205,12 @@ declare module '@solana/web3.js' {
transaction: Transaction,
meta: ConfirmedTransactionMeta | null,
}>,
rewards: Array<{
pubkey: string,
lamports: number,
postBalance: number | null,
rewardType: string | null,
}>,
};
declare export type PerfSample = {
@ -217,6 +224,7 @@ declare module '@solana/web3.js' {
slot: number,
transaction: Transaction,
meta: ConfirmedTransactionMeta | null,
blockTime?: number | null,
};
declare export type ParsedAccountData = {

View File

@ -438,11 +438,13 @@ type ConfirmedTransactionMeta = {
* @property {number} slot The slot during which the transaction was processed
* @property {Transaction} transaction The details of the transaction
* @property {ConfirmedTransactionMeta|null} meta Metadata produced from the transaction
* @property {number|null|undefined} blockTime The unix timestamp of when the transaction was processed
*/
type ConfirmedTransaction = {
slot: number,
transaction: Transaction,
meta: ConfirmedTransactionMeta | null,
blockTime?: number | null,
};
/**
@ -520,11 +522,13 @@ type ParsedTransaction = {
* @property {number} slot The slot during which the transaction was processed
* @property {ParsedTransaction} transaction The details of the transaction
* @property {ConfirmedTransactionMeta|null} meta Metadata produced from the transaction
* @property {number|null|undefined} blockTime The unix timestamp of when the transaction was processed
*/
type ParsedConfirmedTransaction = {
slot: number,
transaction: ParsedTransaction,
meta: ParsedConfirmedTransactionMeta | null,
blockTime?: number | null,
};
/**
@ -930,11 +934,12 @@ const GetConfirmedSignaturesForAddressRpcResult = jsonRpcResult(
const GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(
struct.array([
struct({
struct.pick({
signature: 'string',
slot: 'number',
err: TransactionErrorResult,
memo: struct.union(['null', 'string']),
blockTime: struct.union(['undefined', 'null', 'number']),
}),
]),
);
@ -1332,6 +1337,7 @@ const GetConfirmedTransactionRpcResult = jsonRpcResult(
slot: 'number',
transaction: ConfirmedTransactionResult,
meta: ConfirmedTransactionMetaResult,
blockTime: struct.union(['number', 'null', 'undefined']),
}),
]),
);
@ -1346,6 +1352,7 @@ const GetParsedConfirmedTransactionRpcResult = jsonRpcResult(
slot: 'number',
transaction: ParsedConfirmedTransactionResult,
meta: ParsedConfirmedTransactionMetaResult,
blockTime: struct.union(['number', 'null', 'undefined']),
}),
]),
);
@ -1595,12 +1602,14 @@ export type SignatureStatus = {
* @property {number} slot when the transaction was processed
* @property {TransactionError | null} err error, if any
* @property {string | null} memo memo associated with the transaction, if any
* @property {number | null | undefined} blockTime The unix timestamp of when the transaction was processed
*/
export type ConfirmedSignatureInfo = {
signature: string,
slot: number,
err: TransactionError | null,
memo: string | null,
blockTime?: number | null,
};
/**