Skip to content

Commit 2c7098f

Browse files
authored
Document the getSignaturesForAddress() of the RPC API (#271)
1 parent cc737c2 commit 2c7098f

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

packages/rpc-api/src/getSignaturesForAddress.ts

+37-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ type GetSignaturesForAddressApiResponse = readonly GetSignaturesForAddressTransa
2222
type AllowedCommitmentForGetSignaturesForAddress = Exclude<Commitment, 'processed'>;
2323

2424
type GetSignaturesForAddressConfig = Readonly<{
25-
/** start searching backwards from this transaction signature. If not provided the search starts from the top of the highest max confirmed block. */
25+
/**
26+
* Start the search from before, but excluding, this signature.
27+
*
28+
* @defaultValue When omitted, the search starts from the top of the latest confirmed block.
29+
*/
2630
before?: Signature;
2731
/**
2832
* Fetch the signatures as of the highest slot that has reached this level of commitment.
@@ -33,21 +37,49 @@ type GetSignaturesForAddressConfig = Readonly<{
3337
* default commitment applied by the server is `"finalized"`.
3438
*/
3539
commitment?: AllowedCommitmentForGetSignaturesForAddress;
36-
/** maximum transaction signatures to return (between 1 and 1,000). Default: 1000 */
40+
/**
41+
* Maximum transaction signatures to return (between 1 and 1,000).
42+
*
43+
* @defaultValue 1000
44+
*/
3745
limit?: number;
3846
/**
3947
* Prevents accessing stale data by enforcing that the RPC node has processed transactions up to
4048
* this slot
4149
*/
4250
minContextSlot?: Slot;
43-
/** search until this transaction signature, if found before limit reached */
51+
/**
52+
* Search, back in time, until this transaction signature.
53+
*
54+
* @defaultValue When omitted, search will proceed until the limit (if supplied) or until 1,000
55+
* signatures have been found.
56+
*/
4457
until?: Signature;
4558
}>;
4659

4760
export type GetSignaturesForAddressApi = {
4861
/**
49-
* Returns signatures for confirmed transactions that include the given address in their accountKeys list.
50-
* Returns signatures backwards in time from the provided signature or most recent confirmed block
62+
* Returns signatures for confirmed transactions that load the given address.
63+
*
64+
* {@label before-signature}
65+
* @returns Signatures in reverse chronological order starting from before, but excluding, the
66+
* signature supplied.
67+
* @see https://solana.com/docs/rpc/http/getsignaturesforaddress
68+
*/
69+
getSignaturesForAddress(
70+
address: Address,
71+
config?: GetSignaturesForAddressConfig &
72+
Readonly<{
73+
before: Signature;
74+
}>,
75+
): GetSignaturesForAddressApiResponse;
76+
/**
77+
* Returns signatures for confirmed transactions that load the given address.
78+
*
79+
* {@label all}
80+
* @returns Signatures in reverse chronological order starting from the most recent confirmed
81+
* block.
82+
* @see https://solana.com/docs/rpc/http/getsignaturesforaddress
5183
*/
5284
getSignaturesForAddress(
5385
address: Address,

0 commit comments

Comments
 (0)