Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/five-phones-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solana/rpc-api": patch
---

Expanded the type of several RPC inputs to accept readonly arrays of values
2 changes: 1 addition & 1 deletion packages/rpc-api/src/getBlockCommitment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type GetBlockCommitmentApiResponse = Readonly<{
* An array that represents the amount of cluster stake, denominated in {@link Lamports}, that
* has voted on the block at each depth from `0` to `MAX_LOCKOUT_HISTORY`.
*/
commitment: Lamports[] | null;
commitment: readonly Lamports[] | null;
/** The total active stake, in {@link Lamports}, of the current epoch. */
totalStake: Lamports;
}>;
Expand Down
5 changes: 4 additions & 1 deletion packages/rpc-api/src/getInflationReward.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@ export type GetInflationRewardApi = {
*
* @see https://solana.com/docs/rpc/http/getinflationreward
*/
getInflationReward(addresses: Address[], config?: GetInflationRewardApiConfig): GetInflationRewardApiResponse;
getInflationReward(
addresses: readonly Address[],
config?: GetInflationRewardApiConfig,
): GetInflationRewardApiResponse;
};
10 changes: 5 additions & 5 deletions packages/rpc-api/src/getMultipleAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export type GetMultipleAccountsApi = {
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
*/
getMultipleAccounts(
addresses: Address[],
addresses: readonly Address[],
config: GetMultipleAccountsApiCommonConfig &
GetMultipleAccountsApiSliceableCommonConfig &
Readonly<{
Expand All @@ -89,7 +89,7 @@ export type GetMultipleAccountsApi = {
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
*/
getMultipleAccounts(
addresses: Address[],
addresses: readonly Address[],
config: GetMultipleAccountsApiCommonConfig &
GetMultipleAccountsApiSliceableCommonConfig &
Readonly<{
Expand All @@ -112,7 +112,7 @@ export type GetMultipleAccountsApi = {
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
*/
getMultipleAccounts(
addresses: Address[],
addresses: readonly Address[],
config: GetMultipleAccountsApiCommonConfig &
Readonly<{
encoding: 'jsonParsed';
Expand All @@ -131,7 +131,7 @@ export type GetMultipleAccountsApi = {
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
*/
getMultipleAccounts(
addresses: Address[],
addresses: readonly Address[],
config: GetMultipleAccountsApiCommonConfig &
GetMultipleAccountsApiSliceableCommonConfig &
Readonly<{
Expand All @@ -150,7 +150,7 @@ export type GetMultipleAccountsApi = {
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
*/
getMultipleAccounts(
addresses: Address[],
addresses: readonly Address[],
config?: GetMultipleAccountsApiCommonConfig,
): SolanaRpcResponse<(GetMultipleAccountsApiResponseBase & (AccountInfoWithBase64EncodedData | null))[]>;
};
2 changes: 1 addition & 1 deletion packages/rpc-api/src/getProgramAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type GetProgramAccountsApiCommonConfig = Readonly<{
*
* @defaultValue When omitted, no filters are applied.
*/
filters?: (GetProgramAccountsDatasizeFilter | GetProgramAccountsMemcmpFilter)[];
filters?: readonly (GetProgramAccountsDatasizeFilter | GetProgramAccountsMemcmpFilter)[];
/**
* Prevents accessing stale data by enforcing that the RPC node has processed transactions up to
* this slot
Expand Down
2 changes: 1 addition & 1 deletion packages/rpc-api/src/getRecentPrioritizationFees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export type GetRecentPrioritizationFeesApi = {
*
* @see https://solana.com/docs/rpc/http/getrecentprioritizationfees
*/
getRecentPrioritizationFees(addresses?: Address[]): GetRecentPrioritizationFeesApiResponse;
getRecentPrioritizationFees(addresses?: readonly Address[]): GetRecentPrioritizationFeesApiResponse;
};
2 changes: 1 addition & 1 deletion packages/rpc-api/src/getSignatureStatuses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export type GetSignatureStatusesApi = {
* An array of transaction signatures to confirm, as base-58 encoded strings (up to a
* maximum of 256)
*/
signatures: Signature[],
signatures: readonly Signature[],
config?: Readonly<{
/**
* Determines whether the search for a transaction with a given signature will consider
Expand Down
6 changes: 3 additions & 3 deletions packages/rpc-api/src/simulateTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type SigVerifyAndReplaceRecentBlockhashConfig<TReplaceBlockhash extends boolean
type AccountsConfigWithBase64EncodingZstdCompression = Readonly<{
accounts: {
/** An `array` of accounts to return */
addresses: Address[];
addresses: readonly Address[];
/** Encoding for returned Account data */
encoding: 'base64+zstd';
};
Expand All @@ -73,7 +73,7 @@ type AccountsConfigWithBase64EncodingZstdCompression = Readonly<{
type AccountsConfigWithJsonParsedEncoding = Readonly<{
accounts: {
/** An `array` of accounts to return */
addresses: Address[];
addresses: readonly Address[];
/** Encoding for returned Account data */
encoding: 'jsonParsed';
};
Expand All @@ -82,7 +82,7 @@ type AccountsConfigWithJsonParsedEncoding = Readonly<{
type AccountsConfigWithBase64Encoding = Readonly<{
accounts: {
/** An `array` of accounts to return */
addresses: Address[];
addresses: readonly Address[];
// Optional because this is the default encoding
/** Encoding for returned Account data */
encoding?: 'base64';
Expand Down
Loading