You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/rpc-api/src/getTransaction.ts
+131-32
Original file line number
Diff line number
Diff line change
@@ -24,25 +24,37 @@ type ReturnData = {
24
24
};
25
25
26
26
typeTransactionMetaBase=Readonly<{
27
-
/** The number of compute units consumed by the transaction */
27
+
/** Number of compute units consumed by the transaction */
28
28
computeUnitsConsumed?: bigint;
29
-
/** If the transaction failed, this property will contain the error */
29
+
/** Error if transaction failed, `null` if transaction succeeded. */
30
30
err: TransactionError|null;
31
31
/** The fee this transaction was charged, in {@link Lamports} */
32
32
fee: Lamports;
33
-
/** An array of string log messages or `null` if log message recording was disabled when this transaction was processed */
33
+
/**
34
+
* String log messages or `null` if log message recording was not enabled during this
35
+
* transaction
36
+
*/
34
37
logMessages: readonlystring[]|null;
35
-
/** An array of account balances, in {@link Lamports}, after the transaction was processed */
38
+
/** Account balances after the transaction was processed */
36
39
postBalances: readonlyLamports[];
37
-
/** List of token balances from after the transaction was processed or omitted if token balance recording was disabled when this transaction was processed */
40
+
/**
41
+
* List of token balances from after the transaction was processed or omitted if token balance
42
+
* recording was not yet enabled during this transaction
43
+
*/
38
44
postTokenBalances?: readonlyTokenBalance[];
39
-
/** An array of account balances, in {@link Lamports}, before the transaction was processed */
45
+
/** Account balances from before the transaction was processed */
40
46
preBalances: readonlyLamports[];
41
-
/** List of token balances from before the transaction was processed or omitted if token balance recording was disabled when this transaction was processed */
47
+
/**
48
+
* List of token balances from before the transaction was processed or omitted if token balance
49
+
* recording was not yet enabled during this transaction
50
+
*/
42
51
preTokenBalances?: readonlyTokenBalance[];
43
52
/** The most-recent return data generated by an instruction in the transaction */
44
53
returnData?: ReturnData;
45
-
/** Transaction-level rewards; currently only `"Rent"`, but other types may be added in the future */
54
+
/**
55
+
* Transaction-level rewards; currently only `"Rent"`, but other types may be added in the
56
+
* future
57
+
*/
46
58
rewards: readonlyReward[]|null;
47
59
/** @deprecated */
48
60
status: TransactionStatus;
@@ -51,65 +63,147 @@ type TransactionMetaBase = Readonly<{
51
63
typeAddressTableLookup=Readonly<{
52
64
/** The address of the address lookup table account. */
53
65
accountKey: Address;
54
-
/** The list of indices used to load addresses of readonly accounts from the lookup table. */
66
+
/** Indices of accounts in a lookup table to load as read-only. */
55
67
readableIndexes: readonlynumber[];
56
-
/** The list of indices used to load addresses of writable accounts from the lookup table. */
68
+
/** Indices of accounts in a lookup table to load as writable. */
57
69
writableIndexes: readonlynumber[];
58
70
}>;
59
71
60
72
typeTransactionBase=Readonly<{
61
73
message: {
74
+
/**
75
+
* For transactions whose lifetime is specified by a recent blockhash, this is that
76
+
* blockhash, and for transactions whose lifetime is specified by a durable nonce, this is
77
+
* the nonce value.
78
+
*/
62
79
recentBlockhash: Blockhash;
63
80
};
81
+
/**
82
+
* An ordered list of signatures belonging to the accounts required to sign this transaction.
83
+
*
84
+
* Each signature is an Ed25519 signature of the transaction message using the private key
85
+
* associated with the account required to sign the transaction.
86
+
*/
64
87
signatures: readonlyBase58EncodedBytes[];
65
88
}>;
66
89
67
-
typeTransactionInstruction=Readonly<{
68
-
accounts: readonlynumber[];
90
+
typeInstructionWithStackHeight=Readonly<{
91
+
/**
92
+
* A number indicating the height at which this instruction was called with respect to the
93
+
* bottom of the call stack denoted by `1` or `null`.
94
+
*
95
+
* For instance, an instruction explicitly declared in the transaction message will have a `1`
96
+
* or `null` height, the first instruction that it calls using a cross-program invocation (CPI)
97
+
* will have a height of 2, an instruction called by that instruction using a CPI will have a
98
+
* depth of 3, and so on.
99
+
*/
100
+
stackHeight: number;// FIXME(https://github.com/anza-xyz/agave/issues/5732) Should be `1` instead of `null` at base of stack
101
+
}>;
102
+
103
+
typeInstructionWithData=Readonly<{
104
+
/** The input to the invoked program */
69
105
data: Base58EncodedBytes;
70
-
programIdIndex: number;
71
-
stackHeight?: number;
72
106
}>;
73
107
108
+
typeTransactionInstruction=InstructionWithData&
109
+
Partial<InstructionWithStackHeight>&
110
+
Readonly<{
111
+
/**
112
+
* An ordered list of indices that indicate which accounts in the transaction message's
113
+
* accounts list are loaded by this instruction.
114
+
*/
115
+
accounts: readonlynumber[];
116
+
/**
117
+
* The index of the address in the transaction message's accounts list associated with the
118
+
* program to invoke.
119
+
*/
120
+
programIdIndex: number;
121
+
}>;
122
+
74
123
typeTransactionJson=Readonly<{
75
124
message: {
125
+
/** An ordered list of addresses belonging to the accounts loaded by this transaction */
76
126
accountKeys: readonlyAddress[];
77
127
header: {
128
+
/**
129
+
* The number of read-only accounts in the static accounts list that must sign this
130
+
* transaction.
131
+
*
132
+
* Subtracting this number from `numRequiredSignatures` yields the index of the first
133
+
* read-only signer account in the static accounts list.
134
+
*/
78
135
numReadonlySignedAccounts: number;
136
+
/**
137
+
* The number of accounts in the static accounts list that are neither writable nor
138
+
* signers.
139
+
*
140
+
* Adding this number to `numRequiredSignatures` yields the index of the first read-only
141
+
* non-signer account in the static accounts list.
142
+
*/
79
143
numReadonlyUnsignedAccounts: number;
144
+
/**
145
+
* The number of accounts in the static accounts list that must sign this transaction.
146
+
*
147
+
* Subtracting `numReadonlySignedAccounts` from this number yields the number of
148
+
* writable signer accounts in the static accounts list. Writable signer accounts always
149
+
* begin at index zero in the static accounts list.
150
+
*
151
+
* This number itself is the index of the first non-signer account in the static
0 commit comments