@solana/web3.js 1.93.2 → 1.93.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -2266,7 +2266,7 @@ type TokenBalance = {
2266
2266
  /**
2267
2267
  * Metadata for a parsed confirmed transaction on the ledger
2268
2268
  *
2269
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
2269
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionMeta} instead.
2270
2270
  */
2271
2271
  type ParsedConfirmedTransactionMeta = ParsedTransactionMeta;
2272
2272
  /**
@@ -2371,7 +2371,7 @@ type VersionedTransactionResponse = {
2371
2371
  /**
2372
2372
  * A confirmed transaction on the ledger
2373
2373
  *
2374
- * @deprecated Deprecated since Solana v1.8.0.
2374
+ * @deprecated Deprecated since RPC v1.8.0.
2375
2375
  */
2376
2376
  type ConfirmedTransaction = {
2377
2377
  /** The slot during which the transaction was processed */
@@ -2454,7 +2454,7 @@ type ParsedTransaction = {
2454
2454
  /**
2455
2455
  * A parsed and confirmed transaction on the ledger
2456
2456
  *
2457
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
2457
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
2458
2458
  */
2459
2459
  type ParsedConfirmedTransaction = ParsedTransactionWithMeta;
2460
2460
  /**
@@ -2628,7 +2628,7 @@ type VersionedNoneModeBlockResponse = Omit<VersionedBlockResponse, 'transactions
2628
2628
  /**
2629
2629
  * A confirmed block on the ledger
2630
2630
  *
2631
- * @deprecated Deprecated since Solana v1.8.0.
2631
+ * @deprecated Deprecated since RPC v1.8.0.
2632
2632
  */
2633
2633
  type ConfirmedBlock = {
2634
2634
  /** Blockhash of this block */
@@ -2965,6 +2965,37 @@ type GetNonceAndContextConfig = {
2965
2965
  /** The minimum slot that the request can be evaluated at */
2966
2966
  minContextSlot?: number;
2967
2967
  };
2968
+ type AccountSubscriptionConfig = Readonly<{
2969
+ /** Optional commitment level */
2970
+ commitment?: Commitment;
2971
+ /**
2972
+ * Encoding format for Account data
2973
+ * - `base58` is slow.
2974
+ * - `jsonParsed` encoding attempts to use program-specific state parsers to return more
2975
+ * human-readable and explicit account state data
2976
+ * - If `jsonParsed` is requested but a parser cannot be found, the field falls back to `base64`
2977
+ * encoding, detectable when the `data` field is type `string`.
2978
+ */
2979
+ encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
2980
+ }>;
2981
+ type ProgramAccountSubscriptionConfig = Readonly<{
2982
+ /** Optional commitment level */
2983
+ commitment?: Commitment;
2984
+ /**
2985
+ * Encoding format for Account data
2986
+ * - `base58` is slow.
2987
+ * - `jsonParsed` encoding attempts to use program-specific state parsers to return more
2988
+ * human-readable and explicit account state data
2989
+ * - If `jsonParsed` is requested but a parser cannot be found, the field falls back to `base64`
2990
+ * encoding, detectable when the `data` field is type `string`.
2991
+ */
2992
+ encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
2993
+ /**
2994
+ * Filter results using various filter objects
2995
+ * The resultant account must meet ALL filter criteria to be included in the returned results
2996
+ */
2997
+ filters?: GetProgramAccountsFilter[];
2998
+ }>;
2968
2999
  /**
2969
3000
  * Information describing an account
2970
3001
  */
@@ -3243,6 +3274,8 @@ declare class Connection {
3243
3274
  getMultipleAccountsInfo(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<(AccountInfo<Buffer> | null)[]>;
3244
3275
  /**
3245
3276
  * Returns epoch activation information for a stake account that has been delegated
3277
+ *
3278
+ * @deprecated Deprecated since RPC v1.18; will be removed in a future version.
3246
3279
  */
3247
3280
  getStakeActivation(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetStakeActivationConfig, epoch?: number): Promise<StakeActivationData>;
3248
3281
  /**
@@ -3309,7 +3342,7 @@ declare class Connection {
3309
3342
  /**
3310
3343
  * Fetch the current total currency supply of the cluster in lamports
3311
3344
  *
3312
- * @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.
3345
+ * @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead.
3313
3346
  */
3314
3347
  getTotalSupply(commitment?: Commitment): Promise<number>;
3315
3348
  /**
@@ -3346,7 +3379,7 @@ declare class Connection {
3346
3379
  * Fetch a recent blockhash from the cluster, return with context
3347
3380
  * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
3348
3381
  *
3349
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
3382
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
3350
3383
  */
3351
3384
  getRecentBlockhashAndContext(commitment?: Commitment): Promise<RpcResponseAndContext<{
3352
3385
  blockhash: Blockhash;
@@ -3360,7 +3393,7 @@ declare class Connection {
3360
3393
  /**
3361
3394
  * Fetch the fee calculator for a recent blockhash from the cluster, return with context
3362
3395
  *
3363
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.
3396
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead.
3364
3397
  */
3365
3398
  getFeeCalculatorForBlockhash(blockhash: Blockhash, commitment?: Commitment): Promise<RpcResponseAndContext<FeeCalculator | null>>;
3366
3399
  /**
@@ -3375,7 +3408,7 @@ declare class Connection {
3375
3408
  * Fetch a recent blockhash from the cluster
3376
3409
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
3377
3410
  *
3378
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
3411
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead.
3379
3412
  */
3380
3413
  getRecentBlockhash(commitment?: Commitment): Promise<{
3381
3414
  blockhash: Blockhash;
@@ -3485,7 +3518,7 @@ declare class Connection {
3485
3518
  * Fetch a list of Transactions and transaction statuses from the cluster
3486
3519
  * for a confirmed block.
3487
3520
  *
3488
- * @deprecated Deprecated since v1.13.0. Please use {@link getBlock} instead.
3521
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead.
3489
3522
  */
3490
3523
  getConfirmedBlock(slot: number, commitment?: Finality): Promise<ConfirmedBlock>;
3491
3524
  /**
@@ -3499,32 +3532,32 @@ declare class Connection {
3499
3532
  /**
3500
3533
  * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
3501
3534
  *
3502
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.
3535
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead.
3503
3536
  */
3504
3537
  getConfirmedBlockSignatures(slot: number, commitment?: Finality): Promise<BlockSignatures>;
3505
3538
  /**
3506
3539
  * Fetch a transaction details for a confirmed transaction
3507
3540
  *
3508
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.
3541
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead.
3509
3542
  */
3510
3543
  getConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ConfirmedTransaction | null>;
3511
3544
  /**
3512
3545
  * Fetch parsed transaction details for a confirmed transaction
3513
3546
  *
3514
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.
3547
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead.
3515
3548
  */
3516
3549
  getParsedConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ParsedConfirmedTransaction | null>;
3517
3550
  /**
3518
3551
  * Fetch parsed transaction details for a batch of confirmed transactions
3519
3552
  *
3520
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.
3553
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead.
3521
3554
  */
3522
3555
  getParsedConfirmedTransactions(signatures: TransactionSignature[], commitment?: Finality): Promise<(ParsedConfirmedTransaction | null)[]>;
3523
3556
  /**
3524
3557
  * Fetch a list of all the confirmed signatures for transactions involving an address
3525
3558
  * within a specified slot range. Max range allowed is 10,000 slots.
3526
3559
  *
3527
- * @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
3560
+ * @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
3528
3561
  *
3529
3562
  * @param address queried address
3530
3563
  * @param startSlot start slot, inclusive
@@ -3535,9 +3568,7 @@ declare class Connection {
3535
3568
  * Returns confirmed signatures for transactions involving an
3536
3569
  * address backwards in time from the provided signature or most recent confirmed block
3537
3570
  *
3538
- *
3539
- * @param address queried address
3540
- * @param options
3571
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead.
3541
3572
  */
3542
3573
  getConfirmedSignaturesForAddress2(address: PublicKey, options?: ConfirmedSignaturesForAddress2Options, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
3543
3574
  /**
@@ -3614,9 +3645,11 @@ declare class Connection {
3614
3645
  *
3615
3646
  * @param publicKey Public key of the account to monitor
3616
3647
  * @param callback Function to invoke whenever the account is changed
3617
- * @param commitment Specify the commitment level account changes must reach before notification
3648
+ * @param config
3618
3649
  * @return subscription id
3619
3650
  */
3651
+ onAccountChange(publicKey: PublicKey, callback: AccountChangeCallback, config?: AccountSubscriptionConfig): ClientSubscriptionId;
3652
+ /** @deprecated Instead, pass in an {@link AccountSubscriptionConfig} */
3620
3653
  onAccountChange(publicKey: PublicKey, callback: AccountChangeCallback, commitment?: Commitment): ClientSubscriptionId;
3621
3654
  /**
3622
3655
  * Deregister an account notification callback
@@ -3630,10 +3663,11 @@ declare class Connection {
3630
3663
  *
3631
3664
  * @param programId Public key of the program to monitor
3632
3665
  * @param callback Function to invoke whenever the account is changed
3633
- * @param commitment Specify the commitment level account changes must reach before notification
3634
- * @param filters The program account filters to pass into the RPC method
3666
+ * @param config
3635
3667
  * @return subscription id
3636
3668
  */
3669
+ onProgramAccountChange(programId: PublicKey, callback: ProgramAccountChangeCallback, config?: ProgramAccountSubscriptionConfig): ClientSubscriptionId;
3670
+ /** @deprecated Instead, pass in a {@link ProgramAccountSubscriptionConfig} */
3637
3671
  onProgramAccountChange(programId: PublicKey, callback: ProgramAccountChangeCallback, commitment?: Commitment, filters?: GetProgramAccountsFilter[]): ClientSubscriptionId;
3638
3672
  /**
3639
3673
  * Deregister an account notification callback
@@ -3973,4 +4007,4 @@ declare function sendAndConfirmTransaction(connection: Connection, transaction:
3973
4007
  */
3974
4008
  declare const LAMPORTS_PER_SOL = 1000000000;
3975
4009
 
3976
- export { Account, type AccountBalancePair, type AccountChangeCallback, type AccountInfo, type AccountKeysFromLookups, type AccountMeta, type AccountsModeBlockResponse, AddressLookupTableAccount, type AddressLookupTableAccountArgs, AddressLookupTableInstruction, AddressLookupTableProgram, type AddressLookupTableState, type AdvanceNonceParams, type AllocateParams, type AllocateWithSeedParams, type AssignParams, type AssignWithSeedParams, type AuthorizeNonceParams, type AuthorizeStakeParams, type AuthorizeVoteParams, type AuthorizeVoteWithSeedParams, type AuthorizeWithSeedStakeParams, Authorized, type AuthorizedVoter, BPF_LOADER_DEPRECATED_PROGRAM_ID, BPF_LOADER_PROGRAM_ID, type BaseTransactionConfirmationStrategy, type BlockProduction, type BlockResponse, type BlockSignatures, type BlockTimestamp, type Blockhash, type BlockhashWithExpiryBlockHeight, type BlockheightBasedTransactionConfirmationStrategy, BpfLoader, type CloseLookupTableParams, type Cluster, type Commitment, type CompileLegacyArgs, type CompileV0Args, type CompiledInnerInstruction, type CompiledInstruction, ComputeBudgetInstruction, type ComputeBudgetInstructionType, ComputeBudgetProgram, type ConfirmOptions, type ConfirmedBlock, type ConfirmedSignatureInfo, type ConfirmedSignaturesForAddress2Options, type ConfirmedTransaction, type ConfirmedTransactionMeta, Connection, type ConnectionConfig, type ContactInfo, type Context, type CreateAccountParams, type CreateAccountWithSeedParams, type CreateEd25519InstructionWithPrivateKeyParams, type CreateEd25519InstructionWithPublicKeyParams, type CreateLookupTableParams, type CreateNonceAccountParams, type CreateNonceAccountWithSeedParams, type CreateSecp256k1InstructionWithEthAddressParams, type CreateSecp256k1InstructionWithPrivateKeyParams, type CreateSecp256k1InstructionWithPublicKeyParams, type CreateStakeAccountParams, type CreateStakeAccountWithSeedParams, type CreateVoteAccountParams, type DataSizeFilter, type DataSlice, type DeactivateLookupTableParams, type DeactivateStakeParams, type DecodedTransferInstruction, type DecodedTransferWithSeedInstruction, type DecompileArgs, type DelegateStakeParams, type DurableNonce, type DurableNonceTransactionConfirmationStrategy, type Ed25519Keypair, Ed25519Program, Enum, type EpochCredits, type EpochInfo, EpochSchedule, type ExtendLookupTableParams, type FeeCalculator, type FetchFn, type FetchMiddleware, type Finality, type FreezeLookupTableParams, type GetAccountInfoConfig, type GetAccountKeysArgs, type GetBalanceConfig, type GetBlockConfig, type GetBlockHeightConfig, type GetBlockProductionConfig, type GetEpochInfoConfig, type GetInflationRewardConfig, type GetLargestAccountsConfig, type GetLatestBlockhashConfig, type GetMultipleAccountsConfig, type GetNonceAndContextConfig, type GetNonceConfig, type GetParsedProgramAccountsConfig, type GetProgramAccountsConfig, type GetProgramAccountsFilter, type GetProgramAccountsResponse, type GetRecentPrioritizationFeesConfig, type GetSlotConfig, type GetSlotLeaderConfig, type GetStakeActivationConfig, type GetStakeMinimumDelegationConfig, type GetSupplyConfig, type GetTokenAccountsByOwnerConfig, type GetTransactionConfig, type GetTransactionCountConfig, type GetVersionedBlockConfig, type GetVersionedTransactionConfig, type HttpHeaders, type InflationGovernor, type InflationRate, type InflationReward, type Info, type InitializeAccountParams, type InitializeNonceParams, type InitializeStakeParams, type IsBlockhashValidConfig, type KeyedAccountInfo, Keypair, LAMPORTS_PER_SOL, type LargestAccountsFilter, type LeaderSchedule, type LoadedAddresses, Loader, type Lockout, Lockup, type Logs, type LogsCallback, type LogsFilter, type LookupTableInstructionType, MAX_SEED_LENGTH, type MemcmpFilter, type MergeStakeParams, Message, MessageAccountKeys, type MessageAddressTableLookup, type MessageArgs, type MessageCompiledInstruction, type MessageHeader, MessageV0, type MessageV0Args, NONCE_ACCOUNT_LENGTH, NonceAccount, type NonceInformation, type NoneModeBlockResponse, PACKET_DATA_SIZE, PUBLIC_KEY_LENGTH, type ParsedAccountData, type ParsedAccountsModeBlockResponse, type ParsedAddressTableLookup, type ParsedBlockResponse, type ParsedConfirmedTransaction, type ParsedConfirmedTransactionMeta, type ParsedInnerInstruction, type ParsedInstruction, type ParsedMessage, type ParsedMessageAccount, type ParsedNoneModeBlockResponse, type ParsedTransaction, type ParsedTransactionMeta, type ParsedTransactionWithMeta, type PartiallyDecodedInstruction, type PerfSample, type PriorVoter, type ProgramAccountChangeCallback, PublicKey, type PublicKeyData, type PublicKeyInitData, type RecentPrioritizationFees, type RequestHeapFrameParams, type RequestUnitsParams, type RootChangeCallback, type RpcResponseAndContext, SIGNATURE_LENGTH_IN_BYTES, SOLANA_SCHEMA, STAKE_CONFIG_ID, SYSVAR_CLOCK_PUBKEY, SYSVAR_EPOCH_SCHEDULE_PUBKEY, SYSVAR_INSTRUCTIONS_PUBKEY, SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY, SYSVAR_REWARDS_PUBKEY, SYSVAR_SLOT_HASHES_PUBKEY, SYSVAR_SLOT_HISTORY_PUBKEY, SYSVAR_STAKE_HISTORY_PUBKEY, Secp256k1Program, type SendOptions, SendTransactionError, type SerializeConfig, type SetComputeUnitLimitParams, type SetComputeUnitPriceParams, type SignaturePubkeyPair, type SignatureReceivedNotification, type SignatureResult, type SignatureResultCallback, type SignatureStatus, type SignatureStatusConfig, type SignatureStatusNotification, type SignatureSubscriptionCallback, type SignatureSubscriptionOptions, type SignaturesForAddressOptions, type Signer, type SimulateTransactionConfig, type SimulatedTransactionAccountInfo, type SimulatedTransactionResponse, type SlotChangeCallback, type SlotInfo, type SlotUpdate, type SlotUpdateCallback, SolanaJSONRPCError, SolanaJSONRPCErrorCode, type SolanaJSONRPCErrorCodeEnum, type SplitStakeParams, type SplitStakeWithSeedParams, type StakeActivationData, StakeAuthorizationLayout, type StakeAuthorizationType, StakeInstruction, type StakeInstructionType, StakeProgram, Struct, type Supply, SystemInstruction, type SystemInstructionType, SystemProgram, type TokenAccountBalancePair, type TokenAccountsFilter, type TokenAmount, type TokenBalance, Transaction, type TransactionBlockhashCtor, type TransactionConfirmationStatus, type TransactionConfirmationStrategy, type TransactionCtorFields, type TransactionCtorFields_DEPRECATED, type TransactionError, TransactionExpiredBlockheightExceededError, TransactionExpiredNonceInvalidError, TransactionExpiredTimeoutError, TransactionInstruction, type TransactionInstructionCtorFields, TransactionMessage, type TransactionMessageArgs, type TransactionNonceCtor, type TransactionResponse, type TransactionReturnData, type TransactionReturnDataEncoding, type TransactionSignature, TransactionStatus, type TransactionVersion, type TransferParams, type TransferWithSeedParams, type UpdateValidatorIdentityParams, VALIDATOR_INFO_KEY, VERSION_PREFIX_MASK, VOTE_PROGRAM_ID, ValidatorInfo, type Version, type VersionedAccountsModeBlockResponse, type VersionedBlockResponse, VersionedMessage, type VersionedNoneModeBlockResponse, VersionedTransaction, type VersionedTransactionResponse, VoteAccount, type VoteAccountInfo, type VoteAccountStatus, VoteAuthorizationLayout, type VoteAuthorizationType, VoteInit, VoteInstruction, type VoteInstructionType, VoteProgram, type WithdrawFromVoteAccountParams, type WithdrawNonceParams, type WithdrawStakeParams, clusterApiUrl, sendAndConfirmRawTransaction, sendAndConfirmTransaction };
4010
+ export { Account, type AccountBalancePair, type AccountChangeCallback, type AccountInfo, type AccountKeysFromLookups, type AccountMeta, type AccountSubscriptionConfig, type AccountsModeBlockResponse, AddressLookupTableAccount, type AddressLookupTableAccountArgs, AddressLookupTableInstruction, AddressLookupTableProgram, type AddressLookupTableState, type AdvanceNonceParams, type AllocateParams, type AllocateWithSeedParams, type AssignParams, type AssignWithSeedParams, type AuthorizeNonceParams, type AuthorizeStakeParams, type AuthorizeVoteParams, type AuthorizeVoteWithSeedParams, type AuthorizeWithSeedStakeParams, Authorized, type AuthorizedVoter, BPF_LOADER_DEPRECATED_PROGRAM_ID, BPF_LOADER_PROGRAM_ID, type BaseTransactionConfirmationStrategy, type BlockProduction, type BlockResponse, type BlockSignatures, type BlockTimestamp, type Blockhash, type BlockhashWithExpiryBlockHeight, type BlockheightBasedTransactionConfirmationStrategy, BpfLoader, type CloseLookupTableParams, type Cluster, type Commitment, type CompileLegacyArgs, type CompileV0Args, type CompiledInnerInstruction, type CompiledInstruction, ComputeBudgetInstruction, type ComputeBudgetInstructionType, ComputeBudgetProgram, type ConfirmOptions, type ConfirmedBlock, type ConfirmedSignatureInfo, type ConfirmedSignaturesForAddress2Options, type ConfirmedTransaction, type ConfirmedTransactionMeta, Connection, type ConnectionConfig, type ContactInfo, type Context, type CreateAccountParams, type CreateAccountWithSeedParams, type CreateEd25519InstructionWithPrivateKeyParams, type CreateEd25519InstructionWithPublicKeyParams, type CreateLookupTableParams, type CreateNonceAccountParams, type CreateNonceAccountWithSeedParams, type CreateSecp256k1InstructionWithEthAddressParams, type CreateSecp256k1InstructionWithPrivateKeyParams, type CreateSecp256k1InstructionWithPublicKeyParams, type CreateStakeAccountParams, type CreateStakeAccountWithSeedParams, type CreateVoteAccountParams, type DataSizeFilter, type DataSlice, type DeactivateLookupTableParams, type DeactivateStakeParams, type DecodedTransferInstruction, type DecodedTransferWithSeedInstruction, type DecompileArgs, type DelegateStakeParams, type DurableNonce, type DurableNonceTransactionConfirmationStrategy, type Ed25519Keypair, Ed25519Program, Enum, type EpochCredits, type EpochInfo, EpochSchedule, type ExtendLookupTableParams, type FeeCalculator, type FetchFn, type FetchMiddleware, type Finality, type FreezeLookupTableParams, type GetAccountInfoConfig, type GetAccountKeysArgs, type GetBalanceConfig, type GetBlockConfig, type GetBlockHeightConfig, type GetBlockProductionConfig, type GetEpochInfoConfig, type GetInflationRewardConfig, type GetLargestAccountsConfig, type GetLatestBlockhashConfig, type GetMultipleAccountsConfig, type GetNonceAndContextConfig, type GetNonceConfig, type GetParsedProgramAccountsConfig, type GetProgramAccountsConfig, type GetProgramAccountsFilter, type GetProgramAccountsResponse, type GetRecentPrioritizationFeesConfig, type GetSlotConfig, type GetSlotLeaderConfig, type GetStakeActivationConfig, type GetStakeMinimumDelegationConfig, type GetSupplyConfig, type GetTokenAccountsByOwnerConfig, type GetTransactionConfig, type GetTransactionCountConfig, type GetVersionedBlockConfig, type GetVersionedTransactionConfig, type HttpHeaders, type InflationGovernor, type InflationRate, type InflationReward, type Info, type InitializeAccountParams, type InitializeNonceParams, type InitializeStakeParams, type IsBlockhashValidConfig, type KeyedAccountInfo, Keypair, LAMPORTS_PER_SOL, type LargestAccountsFilter, type LeaderSchedule, type LoadedAddresses, Loader, type Lockout, Lockup, type Logs, type LogsCallback, type LogsFilter, type LookupTableInstructionType, MAX_SEED_LENGTH, type MemcmpFilter, type MergeStakeParams, Message, MessageAccountKeys, type MessageAddressTableLookup, type MessageArgs, type MessageCompiledInstruction, type MessageHeader, MessageV0, type MessageV0Args, NONCE_ACCOUNT_LENGTH, NonceAccount, type NonceInformation, type NoneModeBlockResponse, PACKET_DATA_SIZE, PUBLIC_KEY_LENGTH, type ParsedAccountData, type ParsedAccountsModeBlockResponse, type ParsedAddressTableLookup, type ParsedBlockResponse, type ParsedConfirmedTransaction, type ParsedConfirmedTransactionMeta, type ParsedInnerInstruction, type ParsedInstruction, type ParsedMessage, type ParsedMessageAccount, type ParsedNoneModeBlockResponse, type ParsedTransaction, type ParsedTransactionMeta, type ParsedTransactionWithMeta, type PartiallyDecodedInstruction, type PerfSample, type PriorVoter, type ProgramAccountChangeCallback, type ProgramAccountSubscriptionConfig, PublicKey, type PublicKeyData, type PublicKeyInitData, type RecentPrioritizationFees, type RequestHeapFrameParams, type RequestUnitsParams, type RootChangeCallback, type RpcResponseAndContext, SIGNATURE_LENGTH_IN_BYTES, SOLANA_SCHEMA, STAKE_CONFIG_ID, SYSVAR_CLOCK_PUBKEY, SYSVAR_EPOCH_SCHEDULE_PUBKEY, SYSVAR_INSTRUCTIONS_PUBKEY, SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY, SYSVAR_REWARDS_PUBKEY, SYSVAR_SLOT_HASHES_PUBKEY, SYSVAR_SLOT_HISTORY_PUBKEY, SYSVAR_STAKE_HISTORY_PUBKEY, Secp256k1Program, type SendOptions, SendTransactionError, type SerializeConfig, type SetComputeUnitLimitParams, type SetComputeUnitPriceParams, type SignaturePubkeyPair, type SignatureReceivedNotification, type SignatureResult, type SignatureResultCallback, type SignatureStatus, type SignatureStatusConfig, type SignatureStatusNotification, type SignatureSubscriptionCallback, type SignatureSubscriptionOptions, type SignaturesForAddressOptions, type Signer, type SimulateTransactionConfig, type SimulatedTransactionAccountInfo, type SimulatedTransactionResponse, type SlotChangeCallback, type SlotInfo, type SlotUpdate, type SlotUpdateCallback, SolanaJSONRPCError, SolanaJSONRPCErrorCode, type SolanaJSONRPCErrorCodeEnum, type SplitStakeParams, type SplitStakeWithSeedParams, type StakeActivationData, StakeAuthorizationLayout, type StakeAuthorizationType, StakeInstruction, type StakeInstructionType, StakeProgram, Struct, type Supply, SystemInstruction, type SystemInstructionType, SystemProgram, type TokenAccountBalancePair, type TokenAccountsFilter, type TokenAmount, type TokenBalance, Transaction, type TransactionBlockhashCtor, type TransactionConfirmationStatus, type TransactionConfirmationStrategy, type TransactionCtorFields, type TransactionCtorFields_DEPRECATED, type TransactionError, TransactionExpiredBlockheightExceededError, TransactionExpiredNonceInvalidError, TransactionExpiredTimeoutError, TransactionInstruction, type TransactionInstructionCtorFields, TransactionMessage, type TransactionMessageArgs, type TransactionNonceCtor, type TransactionResponse, type TransactionReturnData, type TransactionReturnDataEncoding, type TransactionSignature, TransactionStatus, type TransactionVersion, type TransferParams, type TransferWithSeedParams, type UpdateValidatorIdentityParams, VALIDATOR_INFO_KEY, VERSION_PREFIX_MASK, VOTE_PROGRAM_ID, ValidatorInfo, type Version, type VersionedAccountsModeBlockResponse, type VersionedBlockResponse, VersionedMessage, type VersionedNoneModeBlockResponse, VersionedTransaction, type VersionedTransactionResponse, VoteAccount, type VoteAccountInfo, type VoteAccountStatus, VoteAuthorizationLayout, type VoteAuthorizationType, VoteInit, VoteInstruction, type VoteInstructionType, VoteProgram, type WithdrawFromVoteAccountParams, type WithdrawNonceParams, type WithdrawStakeParams, clusterApiUrl, sendAndConfirmRawTransaction, sendAndConfirmTransaction };
package/lib/index.esm.js CHANGED
@@ -4757,7 +4757,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4757
4757
  /**
4758
4758
  * Metadata for a parsed confirmed transaction on the ledger
4759
4759
  *
4760
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
4760
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionMeta} instead.
4761
4761
  */
4762
4762
 
4763
4763
  /**
@@ -4787,7 +4787,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4787
4787
  /**
4788
4788
  * A confirmed transaction on the ledger
4789
4789
  *
4790
- * @deprecated Deprecated since Solana v1.8.0.
4790
+ * @deprecated Deprecated since RPC v1.8.0.
4791
4791
  */
4792
4792
 
4793
4793
  /**
@@ -4817,7 +4817,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4817
4817
  /**
4818
4818
  * A parsed and confirmed transaction on the ledger
4819
4819
  *
4820
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
4820
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
4821
4821
  */
4822
4822
 
4823
4823
  /**
@@ -4863,7 +4863,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4863
4863
  /**
4864
4864
  * A confirmed block on the ledger
4865
4865
  *
4866
- * @deprecated Deprecated since Solana v1.8.0.
4866
+ * @deprecated Deprecated since RPC v1.8.0.
4867
4867
  */
4868
4868
 
4869
4869
  /**
@@ -5588,7 +5588,7 @@ const GetParsedNoneModeBlockRpcResult = jsonRpcResult(nullable(type({
5588
5588
  /**
5589
5589
  * Expected JSON RPC response for the "getConfirmedBlock" message
5590
5590
  *
5591
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetBlockRpcResult} instead.
5591
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetBlockRpcResult} instead.
5592
5592
  */
5593
5593
  const GetConfirmedBlockRpcResult = jsonRpcResult(nullable(type({
5594
5594
  blockhash: string(),
@@ -5638,7 +5638,7 @@ const GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({
5638
5638
  /**
5639
5639
  * Expected JSON RPC response for the "getRecentBlockhash" message
5640
5640
  *
5641
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
5641
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
5642
5642
  */
5643
5643
  const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({
5644
5644
  blockhash: string(),
@@ -6326,6 +6326,8 @@ class Connection {
6326
6326
 
6327
6327
  /**
6328
6328
  * Returns epoch activation information for a stake account that has been delegated
6329
+ *
6330
+ * @deprecated Deprecated since RPC v1.18; will be removed in a future version.
6329
6331
  */
6330
6332
  async getStakeActivation(publicKey, commitmentOrConfig, epoch) {
6331
6333
  const {
@@ -6897,7 +6899,7 @@ class Connection {
6897
6899
  /**
6898
6900
  * Fetch the current total currency supply of the cluster in lamports
6899
6901
  *
6900
- * @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.
6902
+ * @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead.
6901
6903
  */
6902
6904
  async getTotalSupply(commitment) {
6903
6905
  const result = await this.getSupply({
@@ -7014,7 +7016,7 @@ class Connection {
7014
7016
  * Fetch a recent blockhash from the cluster, return with context
7015
7017
  * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
7016
7018
  *
7017
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
7019
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
7018
7020
  */
7019
7021
  async getRecentBlockhashAndContext(commitment) {
7020
7022
  const args = this._buildArgs([], commitment);
@@ -7042,7 +7044,7 @@ class Connection {
7042
7044
  /**
7043
7045
  * Fetch the fee calculator for a recent blockhash from the cluster, return with context
7044
7046
  *
7045
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.
7047
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead.
7046
7048
  */
7047
7049
  async getFeeCalculatorForBlockhash(blockhash, commitment) {
7048
7050
  const args = this._buildArgs([blockhash], commitment);
@@ -7095,7 +7097,7 @@ class Connection {
7095
7097
  * Fetch a recent blockhash from the cluster
7096
7098
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
7097
7099
  *
7098
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
7100
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead.
7099
7101
  */
7100
7102
  async getRecentBlockhash(commitment) {
7101
7103
  try {
@@ -7477,7 +7479,7 @@ class Connection {
7477
7479
  * Fetch a list of Transactions and transaction statuses from the cluster
7478
7480
  * for a confirmed block.
7479
7481
  *
7480
- * @deprecated Deprecated since v1.13.0. Please use {@link getBlock} instead.
7482
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead.
7481
7483
  */
7482
7484
  async getConfirmedBlock(slot, commitment) {
7483
7485
  const args = this._buildArgsAtLeastConfirmed([slot], commitment);
@@ -7556,7 +7558,7 @@ class Connection {
7556
7558
  /**
7557
7559
  * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
7558
7560
  *
7559
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.
7561
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead.
7560
7562
  */
7561
7563
  async getConfirmedBlockSignatures(slot, commitment) {
7562
7564
  const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {
@@ -7578,7 +7580,7 @@ class Connection {
7578
7580
  /**
7579
7581
  * Fetch a transaction details for a confirmed transaction
7580
7582
  *
7581
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.
7583
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead.
7582
7584
  */
7583
7585
  async getConfirmedTransaction(signature, commitment) {
7584
7586
  const args = this._buildArgsAtLeastConfirmed([signature], commitment);
@@ -7600,7 +7602,7 @@ class Connection {
7600
7602
  /**
7601
7603
  * Fetch parsed transaction details for a confirmed transaction
7602
7604
  *
7603
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.
7605
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead.
7604
7606
  */
7605
7607
  async getParsedConfirmedTransaction(signature, commitment) {
7606
7608
  const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
@@ -7615,7 +7617,7 @@ class Connection {
7615
7617
  /**
7616
7618
  * Fetch parsed transaction details for a batch of confirmed transactions
7617
7619
  *
7618
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.
7620
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead.
7619
7621
  */
7620
7622
  async getParsedConfirmedTransactions(signatures, commitment) {
7621
7623
  const batch = signatures.map(signature => {
@@ -7640,7 +7642,7 @@ class Connection {
7640
7642
  * Fetch a list of all the confirmed signatures for transactions involving an address
7641
7643
  * within a specified slot range. Max range allowed is 10,000 slots.
7642
7644
  *
7643
- * @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
7645
+ * @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
7644
7646
  *
7645
7647
  * @param address queried address
7646
7648
  * @param startSlot start slot, inclusive
@@ -7694,9 +7696,7 @@ class Connection {
7694
7696
  * Returns confirmed signatures for transactions involving an
7695
7697
  * address backwards in time from the provided signature or most recent confirmed block
7696
7698
  *
7697
- *
7698
- * @param address queried address
7699
- * @param options
7699
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead.
7700
7700
  */
7701
7701
  async getConfirmedSignaturesForAddress2(address, options, commitment) {
7702
7702
  const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);
@@ -8439,13 +8439,22 @@ class Connection {
8439
8439
  *
8440
8440
  * @param publicKey Public key of the account to monitor
8441
8441
  * @param callback Function to invoke whenever the account is changed
8442
- * @param commitment Specify the commitment level account changes must reach before notification
8442
+ * @param config
8443
8443
  * @return subscription id
8444
8444
  */
8445
- onAccountChange(publicKey, callback, commitment) {
8445
+
8446
+ /** @deprecated Instead, pass in an {@link AccountSubscriptionConfig} */
8447
+ // eslint-disable-next-line no-dupe-class-members
8448
+
8449
+ // eslint-disable-next-line no-dupe-class-members
8450
+ onAccountChange(publicKey, callback, commitmentOrConfig) {
8451
+ const {
8452
+ commitment,
8453
+ config
8454
+ } = extractCommitmentFromConfig(commitmentOrConfig);
8446
8455
  const args = this._buildArgs([publicKey.toBase58()], commitment || this._commitment || 'finalized',
8447
8456
  // Apply connection/server default.
8448
- 'base64');
8457
+ 'base64', config);
8449
8458
  return this._makeSubscription({
8450
8459
  callback,
8451
8460
  method: 'accountSubscribe',
@@ -8482,15 +8491,23 @@ class Connection {
8482
8491
  *
8483
8492
  * @param programId Public key of the program to monitor
8484
8493
  * @param callback Function to invoke whenever the account is changed
8485
- * @param commitment Specify the commitment level account changes must reach before notification
8486
- * @param filters The program account filters to pass into the RPC method
8494
+ * @param config
8487
8495
  * @return subscription id
8488
8496
  */
8489
- onProgramAccountChange(programId, callback, commitment, filters) {
8497
+
8498
+ /** @deprecated Instead, pass in a {@link ProgramAccountSubscriptionConfig} */
8499
+ // eslint-disable-next-line no-dupe-class-members
8500
+
8501
+ // eslint-disable-next-line no-dupe-class-members
8502
+ onProgramAccountChange(programId, callback, commitmentOrConfig, maybeFilters) {
8503
+ const {
8504
+ commitment,
8505
+ config
8506
+ } = extractCommitmentFromConfig(commitmentOrConfig);
8490
8507
  const args = this._buildArgs([programId.toBase58()], commitment || this._commitment || 'finalized',
8491
8508
  // Apply connection/server default.
8492
- 'base64' /* encoding */, filters ? {
8493
- filters: filters
8509
+ 'base64' /* encoding */, config ? config : maybeFilters ? {
8510
+ filters: maybeFilters
8494
8511
  } : undefined /* extra */);
8495
8512
  return this._makeSubscription({
8496
8513
  callback,