@solana/web3.js 1.77.3 → 1.78.0

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.
@@ -20,6 +20,10 @@ import { secp256k1 } from '@noble/curves/secp256k1';
20
20
  * Read more: https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/
21
21
  */
22
22
 
23
+ /**
24
+ * Ed25519 Keypair
25
+ */
26
+
23
27
  const generatePrivateKey = ed25519.utils.randomPrivateKey;
24
28
  const generateKeypair = () => {
25
29
  const privateScalar = ed25519.utils.randomPrivateKey();
@@ -102,6 +106,10 @@ const PUBLIC_KEY_LENGTH = 32;
102
106
  * Value to be converted into public key
103
107
  */
104
108
 
109
+ /**
110
+ * JSON object representation of PublicKey class
111
+ */
112
+
105
113
  function isPublicKeyData(value) {
106
114
  return value._bn !== undefined;
107
115
  }
@@ -114,14 +122,13 @@ let uniquePublicKeyCounter = 1;
114
122
  */
115
123
  _Symbol$toStringTag = Symbol.toStringTag;
116
124
  class PublicKey extends Struct {
117
- /** @internal */
118
-
119
125
  /**
120
126
  * Create a new PublicKey object
121
127
  * @param value ed25519 public key as buffer or base-58 encoded string
122
128
  */
123
129
  constructor(value) {
124
130
  super({});
131
+ /** @internal */
125
132
  this._bn = void 0;
126
133
  if (isPublicKeyData(value)) {
127
134
  this._bn = value._bn;
@@ -303,10 +310,6 @@ SOLANA_SCHEMA.set(PublicKey, {
303
310
  * @deprecated since v1.10.0, please use {@link Keypair} instead.
304
311
  */
305
312
  class Account {
306
- /** @internal */
307
-
308
- /** @internal */
309
-
310
313
  /**
311
314
  * Create a new Account object
312
315
  *
@@ -316,7 +319,9 @@ class Account {
316
319
  * @param secretKey Secret key for the account
317
320
  */
318
321
  constructor(secretKey) {
322
+ /** @internal */
319
323
  this._publicKey = void 0;
324
+ /** @internal */
320
325
  this._secretKey = void 0;
321
326
  if (secretKey) {
322
327
  const secretKeyBuffer = toBuffer(secretKey);
@@ -673,6 +678,10 @@ class CompiledKeys {
673
678
  * @property {string} data
674
679
  */
675
680
 
681
+ /**
682
+ * Message constructor arguments
683
+ */
684
+
676
685
  /**
677
686
  * List of instructions to be processed atomically
678
687
  */
@@ -1117,17 +1126,17 @@ const VersionedMessage = {
1117
1126
  * Transaction signature as base-58 encoded string
1118
1127
  */
1119
1128
 
1120
- let TransactionStatus;
1121
-
1122
- /**
1123
- * Default (empty) signature
1124
- */
1125
- (function (TransactionStatus) {
1129
+ let TransactionStatus = /*#__PURE__*/function (TransactionStatus) {
1126
1130
  TransactionStatus[TransactionStatus["BLOCKHEIGHT_EXCEEDED"] = 0] = "BLOCKHEIGHT_EXCEEDED";
1127
1131
  TransactionStatus[TransactionStatus["PROCESSED"] = 1] = "PROCESSED";
1128
1132
  TransactionStatus[TransactionStatus["TIMED_OUT"] = 2] = "TIMED_OUT";
1129
1133
  TransactionStatus[TransactionStatus["NONCE_INVALID"] = 3] = "NONCE_INVALID";
1130
- })(TransactionStatus || (TransactionStatus = {}));
1134
+ return TransactionStatus;
1135
+ }({});
1136
+
1137
+ /**
1138
+ * Default (empty) signature
1139
+ */
1131
1140
  const DEFAULT_SIGNATURE = Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);
1132
1141
 
1133
1142
  /**
@@ -1135,25 +1144,34 @@ const DEFAULT_SIGNATURE = Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);
1135
1144
  */
1136
1145
 
1137
1146
  /**
1138
- * Transaction Instruction class
1147
+ * List of TransactionInstruction object fields that may be initialized at construction
1139
1148
  */
1140
- class TransactionInstruction {
1141
- /**
1142
- * Public keys to include in this transaction
1143
- * Boolean represents whether this pubkey needs to sign the transaction
1144
- */
1145
1149
 
1146
- /**
1147
- * Program Id to execute
1148
- */
1150
+ /**
1151
+ * Configuration object for Transaction.serialize()
1152
+ */
1149
1153
 
1150
- /**
1151
- * Program input
1152
- */
1154
+ /**
1155
+ * @internal
1156
+ */
1153
1157
 
1158
+ /**
1159
+ * Transaction Instruction class
1160
+ */
1161
+ class TransactionInstruction {
1154
1162
  constructor(opts) {
1163
+ /**
1164
+ * Public keys to include in this transaction
1165
+ * Boolean represents whether this pubkey needs to sign the transaction
1166
+ */
1155
1167
  this.keys = void 0;
1168
+ /**
1169
+ * Program Id to execute
1170
+ */
1156
1171
  this.programId = void 0;
1172
+ /**
1173
+ * Program input
1174
+ */
1157
1175
  this.data = Buffer.alloc(0);
1158
1176
  this.programId = opts.programId;
1159
1177
  this.keys = opts.keys;
@@ -1186,15 +1204,31 @@ class TransactionInstruction {
1186
1204
  * Pair of signature and corresponding public key
1187
1205
  */
1188
1206
 
1207
+ /**
1208
+ * List of Transaction object fields that may be initialized at construction
1209
+ */
1210
+
1211
+ // For backward compatibility; an unfortunate consequence of being
1212
+ // forced to over-export types by the documentation generator.
1213
+ // See https://github.com/solana-labs/solana/pull/25820
1214
+ /**
1215
+ * Blockhash-based transactions have a lifetime that are defined by
1216
+ * the blockhash they include. Any transaction whose blockhash is
1217
+ * too old will be rejected.
1218
+ */
1219
+ /**
1220
+ * Use these options to construct a durable nonce transaction.
1221
+ */
1222
+ /**
1223
+ * Nonce information to be used to build an offline Transaction.
1224
+ */
1225
+ /**
1226
+ * @internal
1227
+ */
1189
1228
  /**
1190
1229
  * Transaction class
1191
1230
  */
1192
1231
  class Transaction {
1193
- /**
1194
- * Signatures for the transaction. Typically created by invoking the
1195
- * `sign()` method
1196
- */
1197
-
1198
1232
  /**
1199
1233
  * The first (payer) Transaction signature
1200
1234
  */
@@ -1209,18 +1243,57 @@ class Transaction {
1209
1243
  * The transaction fee payer
1210
1244
  */
1211
1245
 
1246
+ // Construct a transaction with a blockhash and lastValidBlockHeight
1247
+
1248
+ // Construct a transaction using a durable nonce
1249
+
1250
+ /**
1251
+ * @deprecated `TransactionCtorFields` has been deprecated and will be removed in a future version.
1252
+ * Please supply a `TransactionBlockhashCtor` instead.
1253
+ */
1254
+
1212
1255
  /**
1213
1256
  * Construct an empty Transaction
1214
1257
  */
1215
1258
  constructor(opts) {
1259
+ /**
1260
+ * Signatures for the transaction. Typically created by invoking the
1261
+ * `sign()` method
1262
+ */
1216
1263
  this.signatures = [];
1217
1264
  this.feePayer = void 0;
1265
+ /**
1266
+ * The instructions to atomically execute
1267
+ */
1218
1268
  this.instructions = [];
1269
+ /**
1270
+ * A recent transaction id. Must be populated by the caller
1271
+ */
1219
1272
  this.recentBlockhash = void 0;
1273
+ /**
1274
+ * the last block chain can advance to before tx is declared expired
1275
+ * */
1220
1276
  this.lastValidBlockHeight = void 0;
1277
+ /**
1278
+ * Optional Nonce information. If populated, transaction will use a durable
1279
+ * Nonce hash instead of a recentBlockhash. Must be populated by the caller
1280
+ */
1221
1281
  this.nonceInfo = void 0;
1282
+ /**
1283
+ * If this is a nonce transaction this represents the minimum slot from which
1284
+ * to evaluate if the nonce has advanced when attempting to confirm the
1285
+ * transaction. This protects against a case where the transaction confirmation
1286
+ * logic loads the nonce account from an old slot and assumes the mismatch in
1287
+ * nonce value implies that the nonce has been advanced.
1288
+ */
1222
1289
  this.minNonceContextSlot = void 0;
1290
+ /**
1291
+ * @internal
1292
+ */
1223
1293
  this._message = void 0;
1294
+ /**
1295
+ * @internal
1296
+ */
1224
1297
  this._json = void 0;
1225
1298
  if (!opts) {
1226
1299
  return;
@@ -2035,6 +2108,10 @@ function sleep(ms) {
2035
2108
  return new Promise(resolve => setTimeout(resolve, ms));
2036
2109
  }
2037
2110
 
2111
+ /**
2112
+ * @internal
2113
+ */
2114
+
2038
2115
  /**
2039
2116
  * Populate a buffer of instruction data using an InstructionType
2040
2117
  * @internal
@@ -2154,6 +2231,62 @@ const u64 = bigInt(8);
2154
2231
  * Create account system transaction params
2155
2232
  */
2156
2233
 
2234
+ /**
2235
+ * Transfer system transaction params
2236
+ */
2237
+
2238
+ /**
2239
+ * Assign system transaction params
2240
+ */
2241
+
2242
+ /**
2243
+ * Create account with seed system transaction params
2244
+ */
2245
+
2246
+ /**
2247
+ * Create nonce account system transaction params
2248
+ */
2249
+
2250
+ /**
2251
+ * Create nonce account with seed system transaction params
2252
+ */
2253
+
2254
+ /**
2255
+ * Initialize nonce account system instruction params
2256
+ */
2257
+
2258
+ /**
2259
+ * Advance nonce account system instruction params
2260
+ */
2261
+
2262
+ /**
2263
+ * Withdraw nonce account system transaction params
2264
+ */
2265
+
2266
+ /**
2267
+ * Authorize nonce account system transaction params
2268
+ */
2269
+
2270
+ /**
2271
+ * Allocate account system transaction params
2272
+ */
2273
+
2274
+ /**
2275
+ * Allocate account with seed system transaction params
2276
+ */
2277
+
2278
+ /**
2279
+ * Assign account with seed system transaction params
2280
+ */
2281
+
2282
+ /**
2283
+ * Transfer with seed system transaction params
2284
+ */
2285
+
2286
+ /** Decoded transfer system transaction instruction */
2287
+
2288
+ /** Decoded transferWithSeed system transaction instruction */
2289
+
2157
2290
  /**
2158
2291
  * System Instruction class
2159
2292
  */
@@ -3053,6 +3186,10 @@ class BpfLoader {
3053
3186
  }
3054
3187
  }
3055
3188
 
3189
+ function getDefaultExportFromCjs (x) {
3190
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3191
+ }
3192
+
3056
3193
  var objToString = Object.prototype.toString;
3057
3194
  var objKeys = Object.keys || function(obj) {
3058
3195
  var keys = [];
@@ -3127,7 +3264,7 @@ var fastStableStringify = function(val) {
3127
3264
  }
3128
3265
  };
3129
3266
 
3130
- var fastStableStringify$1 = fastStableStringify;
3267
+ var fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);
3131
3268
 
3132
3269
  const MINIMUM_SLOT_PER_EPOCH = 32;
3133
3270
 
@@ -3160,21 +3297,16 @@ function nextPowerOfTwo(n) {
3160
3297
  * Can be retrieved with the {@link Connection.getEpochSchedule} method
3161
3298
  */
3162
3299
  class EpochSchedule {
3163
- /** The maximum number of slots in each epoch */
3164
-
3165
- /** The number of slots before beginning of an epoch to calculate a leader schedule for that epoch */
3166
-
3167
- /** Indicates whether epochs start short and grow */
3168
-
3169
- /** The first epoch with `slotsPerEpoch` slots */
3170
-
3171
- /** The first slot of `firstNormalEpoch` */
3172
-
3173
3300
  constructor(slotsPerEpoch, leaderScheduleSlotOffset, warmup, firstNormalEpoch, firstNormalSlot) {
3301
+ /** The maximum number of slots in each epoch */
3174
3302
  this.slotsPerEpoch = void 0;
3303
+ /** The number of slots before beginning of an epoch to calculate a leader schedule for that epoch */
3175
3304
  this.leaderScheduleSlotOffset = void 0;
3305
+ /** Indicates whether epochs start short and grow */
3176
3306
  this.warmup = void 0;
3307
+ /** The first epoch with `slotsPerEpoch` slots */
3177
3308
  this.firstNormalEpoch = void 0;
3309
+ /** The first slot of `firstNormalEpoch` */
3178
3310
  this.firstNormalSlot = void 0;
3179
3311
  this.slotsPerEpoch = slotsPerEpoch;
3180
3312
  this.leaderScheduleSlotOffset = leaderScheduleSlotOffset;
@@ -3397,6 +3529,92 @@ const BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1000;
3397
3529
  * https://gist.github.com/steveluscher/c057eca81d479ef705cdb53162f9971d
3398
3530
  */
3399
3531
 
3532
+ /** @internal */
3533
+ /** @internal */
3534
+ /** @internal */
3535
+ /** @internal */
3536
+
3537
+ /** @internal */
3538
+ /**
3539
+ * @internal
3540
+ * Every subscription contains the args used to open the subscription with
3541
+ * the server, and a list of callers interested in notifications.
3542
+ */
3543
+
3544
+ /**
3545
+ * @internal
3546
+ * A subscription may be in various states of connectedness. Only when it is
3547
+ * fully connected will it have a server subscription id associated with it.
3548
+ * This id can be returned to the server to unsubscribe the client entirely.
3549
+ */
3550
+
3551
+ /**
3552
+ * A type that encapsulates a subscription's RPC method
3553
+ * names and notification (callback) signature.
3554
+ */
3555
+
3556
+ /**
3557
+ * @internal
3558
+ * Utility type that keeps tagged unions intact while omitting properties.
3559
+ */
3560
+
3561
+ /**
3562
+ * @internal
3563
+ * This type represents a single subscribable 'topic.' It's made up of:
3564
+ *
3565
+ * - The args used to open the subscription with the server,
3566
+ * - The state of the subscription, in terms of its connectedness, and
3567
+ * - The set of callbacks to call when the server publishes notifications
3568
+ *
3569
+ * This record gets indexed by `SubscriptionConfigHash` and is used to
3570
+ * set up subscriptions, fan out notifications, and track subscription state.
3571
+ */
3572
+
3573
+ /**
3574
+ * @internal
3575
+ */
3576
+
3577
+ /**
3578
+ * Extra contextual information for RPC responses
3579
+ */
3580
+
3581
+ /**
3582
+ * Options for sending transactions
3583
+ */
3584
+
3585
+ /**
3586
+ * Options for confirming transactions
3587
+ */
3588
+
3589
+ /**
3590
+ * Options for getConfirmedSignaturesForAddress2
3591
+ */
3592
+
3593
+ /**
3594
+ * Options for getSignaturesForAddress
3595
+ */
3596
+
3597
+ /**
3598
+ * RPC Response with extra contextual information
3599
+ */
3600
+
3601
+ /**
3602
+ * A strategy for confirming transactions that uses the last valid
3603
+ * block height for a given blockhash to check for transaction expiration.
3604
+ */
3605
+
3606
+ /**
3607
+ * A strategy for confirming durable nonce transactions.
3608
+ */
3609
+
3610
+ /**
3611
+ * Properties shared by all transaction confirmation strategies
3612
+ */
3613
+
3614
+ /**
3615
+ * This type represents all transaction confirmation strategies
3616
+ */
3617
+
3400
3618
  /* @internal */
3401
3619
  function assertEndpointUrl(putativeUrl) {
3402
3620
  if (/^https?:/.test(putativeUrl) === false) {
@@ -3515,6 +3733,85 @@ function versionedMessageFromResponse(version, response) {
3515
3733
  * </pre>
3516
3734
  */
3517
3735
 
3736
+ // Deprecated as of v1.5.5
3737
+ /**
3738
+ * A subset of Commitment levels, which are at least optimistically confirmed
3739
+ * <pre>
3740
+ * 'confirmed': Query the most recent block which has reached 1 confirmation by the cluster
3741
+ * 'finalized': Query the most recent block which has been finalized by the cluster
3742
+ * </pre>
3743
+ */
3744
+ /**
3745
+ * Filter for largest accounts query
3746
+ * <pre>
3747
+ * 'circulating': Return the largest accounts that are part of the circulating supply
3748
+ * 'nonCirculating': Return the largest accounts that are not part of the circulating supply
3749
+ * </pre>
3750
+ */
3751
+ /**
3752
+ * Configuration object for changing `getAccountInfo` query behavior
3753
+ */
3754
+ /**
3755
+ * Configuration object for changing `getBalance` query behavior
3756
+ */
3757
+ /**
3758
+ * Configuration object for changing `getBlock` query behavior
3759
+ */
3760
+ /**
3761
+ * Configuration object for changing `getBlock` query behavior
3762
+ */
3763
+ /**
3764
+ * Configuration object for changing `getStakeMinimumDelegation` query behavior
3765
+ */
3766
+ /**
3767
+ * Configuration object for changing `getBlockHeight` query behavior
3768
+ */
3769
+ /**
3770
+ * Configuration object for changing `getEpochInfo` query behavior
3771
+ */
3772
+ /**
3773
+ * Configuration object for changing `getInflationReward` query behavior
3774
+ */
3775
+ /**
3776
+ * Configuration object for changing `getLatestBlockhash` query behavior
3777
+ */
3778
+ /**
3779
+ * Configuration object for changing `isBlockhashValid` query behavior
3780
+ */
3781
+ /**
3782
+ * Configuration object for changing `getSlot` query behavior
3783
+ */
3784
+ /**
3785
+ * Configuration object for changing `getSlotLeader` query behavior
3786
+ */
3787
+ /**
3788
+ * Configuration object for changing `getTransaction` query behavior
3789
+ */
3790
+ /**
3791
+ * Configuration object for changing `getTransaction` query behavior
3792
+ */
3793
+ /**
3794
+ * Configuration object for changing `getLargestAccounts` query behavior
3795
+ */
3796
+ /**
3797
+ * Configuration object for changing `getSupply` request behavior
3798
+ */
3799
+ /**
3800
+ * Configuration object for changing query behavior
3801
+ */
3802
+ /**
3803
+ * Information describing a cluster node
3804
+ */
3805
+ /**
3806
+ * Information describing a vote account
3807
+ */
3808
+ /**
3809
+ * A collection of cluster vote accounts
3810
+ */
3811
+ /**
3812
+ * Network Inflation
3813
+ * (see https://docs.solana.com/implemented-proposals/ed_overview)
3814
+ */
3518
3815
  const GetInflationGovernorResult = type({
3519
3816
  foundation: number(),
3520
3817
  foundationTerm: number(),
@@ -3537,6 +3834,11 @@ const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
3537
3834
  postBalance: number(),
3538
3835
  commission: optional(nullable(number()))
3539
3836
  }))));
3837
+
3838
+ /**
3839
+ * Configuration object for changing `getRecentPrioritizationFees` query behavior
3840
+ */
3841
+
3540
3842
  /**
3541
3843
  * Expected JSON RPC response for the "getRecentPrioritizationFees" message
3542
3844
  */
@@ -3622,6 +3924,127 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
3622
3924
  data: tuple([string(), literal('base64')])
3623
3925
  })))
3624
3926
  }));
3927
+
3928
+ /**
3929
+ * Metadata for a parsed confirmed transaction on the ledger
3930
+ *
3931
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
3932
+ */
3933
+
3934
+ /**
3935
+ * Collection of addresses loaded by a transaction using address table lookups
3936
+ */
3937
+
3938
+ /**
3939
+ * Metadata for a parsed transaction on the ledger
3940
+ */
3941
+
3942
+ /**
3943
+ * Metadata for a confirmed transaction on the ledger
3944
+ */
3945
+
3946
+ /**
3947
+ * A processed transaction from the RPC API
3948
+ */
3949
+
3950
+ /**
3951
+ * A processed transaction from the RPC API
3952
+ */
3953
+
3954
+ /**
3955
+ * A processed transaction message from the RPC API
3956
+ */
3957
+
3958
+ /**
3959
+ * A confirmed transaction on the ledger
3960
+ *
3961
+ * @deprecated Deprecated since Solana v1.8.0.
3962
+ */
3963
+
3964
+ /**
3965
+ * A partially decoded transaction instruction
3966
+ */
3967
+
3968
+ /**
3969
+ * A parsed transaction message account
3970
+ */
3971
+
3972
+ /**
3973
+ * A parsed transaction instruction
3974
+ */
3975
+
3976
+ /**
3977
+ * A parsed address table lookup
3978
+ */
3979
+
3980
+ /**
3981
+ * A parsed transaction message
3982
+ */
3983
+
3984
+ /**
3985
+ * A parsed transaction
3986
+ */
3987
+
3988
+ /**
3989
+ * A parsed and confirmed transaction on the ledger
3990
+ *
3991
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
3992
+ */
3993
+
3994
+ /**
3995
+ * A parsed transaction on the ledger with meta
3996
+ */
3997
+
3998
+ /**
3999
+ * A processed block fetched from the RPC API
4000
+ */
4001
+
4002
+ /**
4003
+ * A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`
4004
+ */
4005
+
4006
+ /**
4007
+ * A processed block fetched from the RPC API where the `transactionDetails` mode is `none`
4008
+ */
4009
+
4010
+ /**
4011
+ * A block with parsed transactions
4012
+ */
4013
+
4014
+ /**
4015
+ * A block with parsed transactions where the `transactionDetails` mode is `accounts`
4016
+ */
4017
+
4018
+ /**
4019
+ * A block with parsed transactions where the `transactionDetails` mode is `none`
4020
+ */
4021
+
4022
+ /**
4023
+ * A processed block fetched from the RPC API
4024
+ */
4025
+
4026
+ /**
4027
+ * A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`
4028
+ */
4029
+
4030
+ /**
4031
+ * A processed block fetched from the RPC API where the `transactionDetails` mode is `none`
4032
+ */
4033
+
4034
+ /**
4035
+ * A confirmed block on the ledger
4036
+ *
4037
+ * @deprecated Deprecated since Solana v1.8.0.
4038
+ */
4039
+
4040
+ /**
4041
+ * A Block on the ledger with signatures only
4042
+ */
4043
+
4044
+ /**
4045
+ * recent block production information
4046
+ */
4047
+
3625
4048
  /**
3626
4049
  * Expected JSON RPC response for the "getBlockProduction" message
3627
4050
  */
@@ -4361,57 +4784,166 @@ const GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({
4361
4784
  })));
4362
4785
 
4363
4786
  /**
4364
- * Expected JSON RPC response for the "getRecentBlockhash" message
4365
- *
4366
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
4787
+ * Expected JSON RPC response for the "getRecentBlockhash" message
4788
+ *
4789
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
4790
+ */
4791
+ const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({
4792
+ blockhash: string(),
4793
+ feeCalculator: type({
4794
+ lamportsPerSignature: number()
4795
+ })
4796
+ }));
4797
+
4798
+ /**
4799
+ * Expected JSON RPC response for the "getLatestBlockhash" message
4800
+ */
4801
+ const GetLatestBlockhashRpcResult = jsonRpcResultAndContext(type({
4802
+ blockhash: string(),
4803
+ lastValidBlockHeight: number()
4804
+ }));
4805
+
4806
+ /**
4807
+ * Expected JSON RPC response for the "isBlockhashValid" message
4808
+ */
4809
+ const IsBlockhashValidRpcResult = jsonRpcResultAndContext(boolean());
4810
+ const PerfSampleResult = type({
4811
+ slot: number(),
4812
+ numTransactions: number(),
4813
+ numSlots: number(),
4814
+ samplePeriodSecs: number()
4815
+ });
4816
+
4817
+ /*
4818
+ * Expected JSON RPC response for "getRecentPerformanceSamples" message
4819
+ */
4820
+ const GetRecentPerformanceSamplesRpcResult = jsonRpcResult(array(PerfSampleResult));
4821
+
4822
+ /**
4823
+ * Expected JSON RPC response for the "getFeeCalculatorForBlockhash" message
4824
+ */
4825
+ const GetFeeCalculatorRpcResult = jsonRpcResultAndContext(nullable(type({
4826
+ feeCalculator: type({
4827
+ lamportsPerSignature: number()
4828
+ })
4829
+ })));
4830
+
4831
+ /**
4832
+ * Expected JSON RPC response for the "requestAirdrop" message
4833
+ */
4834
+ const RequestAirdropRpcResult = jsonRpcResult(string());
4835
+
4836
+ /**
4837
+ * Expected JSON RPC response for the "sendTransaction" message
4838
+ */
4839
+ const SendTransactionRpcResult = jsonRpcResult(string());
4840
+
4841
+ /**
4842
+ * Information about the latest slot being processed by a node
4843
+ */
4844
+
4845
+ /**
4846
+ * Parsed account data
4847
+ */
4848
+
4849
+ /**
4850
+ * Stake Activation data
4851
+ */
4852
+
4853
+ /**
4854
+ * Data slice argument for getProgramAccounts
4855
+ */
4856
+
4857
+ /**
4858
+ * Memory comparison filter for getProgramAccounts
4859
+ */
4860
+
4861
+ /**
4862
+ * Data size comparison filter for getProgramAccounts
4863
+ */
4864
+
4865
+ /**
4866
+ * A filter object for getProgramAccounts
4867
+ */
4868
+
4869
+ /**
4870
+ * Configuration object for getProgramAccounts requests
4871
+ */
4872
+
4873
+ /**
4874
+ * Configuration object for getParsedProgramAccounts
4875
+ */
4876
+
4877
+ /**
4878
+ * Configuration object for getMultipleAccounts
4879
+ */
4880
+
4881
+ /**
4882
+ * Configuration object for `getStakeActivation`
4883
+ */
4884
+
4885
+ /**
4886
+ * Configuration object for `getStakeActivation`
4887
+ */
4888
+
4889
+ /**
4890
+ * Configuration object for `getStakeActivation`
4891
+ */
4892
+
4893
+ /**
4894
+ * Configuration object for `getNonce`
4895
+ */
4896
+
4897
+ /**
4898
+ * Configuration object for `getNonceAndContext`
4899
+ */
4900
+
4901
+ /**
4902
+ * Information describing an account
4903
+ */
4904
+
4905
+ /**
4906
+ * Account information identified by pubkey
4907
+ */
4908
+
4909
+ /**
4910
+ * Callback function for account change notifications
4911
+ */
4912
+
4913
+ /**
4914
+ * Callback function for program account change notifications
4915
+ */
4916
+
4917
+ /**
4918
+ * Callback function for slot change notifications
4919
+ */
4920
+
4921
+ /**
4922
+ * Callback function for slot update notifications
4367
4923
  */
4368
- const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({
4369
- blockhash: string(),
4370
- feeCalculator: type({
4371
- lamportsPerSignature: number()
4372
- })
4373
- }));
4374
4924
 
4375
4925
  /**
4376
- * Expected JSON RPC response for the "getLatestBlockhash" message
4926
+ * Callback function for signature status notifications
4377
4927
  */
4378
- const GetLatestBlockhashRpcResult = jsonRpcResultAndContext(type({
4379
- blockhash: string(),
4380
- lastValidBlockHeight: number()
4381
- }));
4382
- const PerfSampleResult = type({
4383
- slot: number(),
4384
- numTransactions: number(),
4385
- numSlots: number(),
4386
- samplePeriodSecs: number()
4387
- });
4388
4928
 
4389
- /*
4390
- * Expected JSON RPC response for "getRecentPerformanceSamples" message
4929
+ /**
4930
+ * Signature status notification with transaction result
4391
4931
  */
4392
- const GetRecentPerformanceSamplesRpcResult = jsonRpcResult(array(PerfSampleResult));
4393
4932
 
4394
4933
  /**
4395
- * Expected JSON RPC response for the "getFeeCalculatorForBlockhash" message
4934
+ * Signature received notification
4396
4935
  */
4397
- const GetFeeCalculatorRpcResult = jsonRpcResultAndContext(nullable(type({
4398
- feeCalculator: type({
4399
- lamportsPerSignature: number()
4400
- })
4401
- })));
4402
4936
 
4403
4937
  /**
4404
- * Expected JSON RPC response for the "requestAirdrop" message
4938
+ * Callback function for signature notifications
4405
4939
  */
4406
- const RequestAirdropRpcResult = jsonRpcResult(string());
4407
4940
 
4408
4941
  /**
4409
- * Expected JSON RPC response for the "sendTransaction" message
4942
+ * Signature subscription options
4410
4943
  */
4411
- const SendTransactionRpcResult = jsonRpcResult(string());
4412
4944
 
4413
4945
  /**
4414
- * Information about the latest slot being processed by a node
4946
+ * Callback function for root change notifications
4415
4947
  */
4416
4948
 
4417
4949
  /**
@@ -4439,66 +4971,60 @@ const LogsNotificationResult = type({
4439
4971
  * Filter for log subscriptions.
4440
4972
  */
4441
4973
 
4442
- /** @internal */
4443
- const COMMON_HTTP_HEADERS = {
4444
- 'solana-client': `js/${"0.0.0-development" }`
4445
- };
4974
+ /**
4975
+ * Callback function for log notifications.
4976
+ */
4446
4977
 
4447
4978
  /**
4448
- * A connection to a fullnode JSON RPC endpoint
4979
+ * Signature result
4449
4980
  */
4450
- class Connection {
4451
- /** @internal */
4452
- /** @internal */
4453
- /** @internal */
4454
- /** @internal */
4455
- /** @internal */
4456
- /** @internal */
4457
- /** @internal */
4458
- /** @internal */
4459
- /** @internal */
4460
- /** @internal */
4461
4981
 
4462
- /** @internal */
4982
+ /**
4983
+ * Transaction error
4984
+ */
4463
4985
 
4464
- /** @internal
4465
- * A number that we increment every time an active connection closes.
4466
- * Used to determine whether the same socket connection that was open
4467
- * when an async operation started is the same one that's active when
4468
- * its continuation fires.
4469
- *
4470
- */
4986
+ /**
4987
+ * Transaction confirmation status
4988
+ * <pre>
4989
+ * 'processed': Transaction landed in a block which has reached 1 confirmation by the connected node
4990
+ * 'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster
4991
+ * 'finalized': Transaction landed in a block which has been finalized by the cluster
4992
+ * </pre>
4993
+ */
4471
4994
 
4472
- /** @internal */
4473
- /** @internal */
4474
- /** @internal */
4995
+ /**
4996
+ * Signature status
4997
+ */
4475
4998
 
4476
- /** @internal */
4477
- /** @internal */
4999
+ /**
5000
+ * A confirmed signature with its status
5001
+ */
4478
5002
 
4479
- /** @internal */
5003
+ /**
5004
+ * An object defining headers to be passed to the RPC server
5005
+ */
4480
5006
 
4481
- /** @internal */
5007
+ /**
5008
+ * The type of the JavaScript `fetch()` API
5009
+ */
4482
5010
 
4483
- /** @internal */
5011
+ /**
5012
+ * A callback used to augment the outgoing HTTP request
5013
+ */
4484
5014
 
4485
- /** @internal */
5015
+ /**
5016
+ * Configuration for instantiating a Connection
5017
+ */
4486
5018
 
4487
- /**
4488
- * Special case.
4489
- * After a signature is processed, RPCs automatically dispose of the
4490
- * subscription on the server side. We need to track which of these
4491
- * subscriptions have been disposed in such a way, so that we know
4492
- * whether the client is dealing with a not-yet-processed signature
4493
- * (in which case we must tear down the server subscription) or an
4494
- * already-processed signature (in which case the client can simply
4495
- * clear out the subscription locally without telling the server).
4496
- *
4497
- * NOTE: There is a proposal to eliminate this special case, here:
4498
- * https://github.com/solana-labs/solana/issues/18892
4499
- */
4500
- /** @internal */
5019
+ /** @internal */
5020
+ const COMMON_HTTP_HEADERS = {
5021
+ 'solana-client': `js/${"0.0.0-development" }`
5022
+ };
4501
5023
 
5024
+ /**
5025
+ * A connection to a fullnode JSON RPC endpoint
5026
+ */
5027
+ class Connection {
4502
5028
  /**
4503
5029
  * Establish a JSON RPC connection
4504
5030
  *
@@ -4506,33 +5032,77 @@ class Connection {
4506
5032
  * @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object
4507
5033
  */
4508
5034
  constructor(endpoint, _commitmentOrConfig) {
5035
+ /** @internal */
4509
5036
  this._commitment = void 0;
5037
+ /** @internal */
4510
5038
  this._confirmTransactionInitialTimeout = void 0;
5039
+ /** @internal */
4511
5040
  this._rpcEndpoint = void 0;
5041
+ /** @internal */
4512
5042
  this._rpcWsEndpoint = void 0;
5043
+ /** @internal */
4513
5044
  this._rpcClient = void 0;
5045
+ /** @internal */
4514
5046
  this._rpcRequest = void 0;
5047
+ /** @internal */
4515
5048
  this._rpcBatchRequest = void 0;
5049
+ /** @internal */
4516
5050
  this._rpcWebSocket = void 0;
5051
+ /** @internal */
4517
5052
  this._rpcWebSocketConnected = false;
5053
+ /** @internal */
4518
5054
  this._rpcWebSocketHeartbeat = null;
5055
+ /** @internal */
4519
5056
  this._rpcWebSocketIdleTimeout = null;
5057
+ /** @internal
5058
+ * A number that we increment every time an active connection closes.
5059
+ * Used to determine whether the same socket connection that was open
5060
+ * when an async operation started is the same one that's active when
5061
+ * its continuation fires.
5062
+ *
5063
+ */
4520
5064
  this._rpcWebSocketGeneration = 0;
5065
+ /** @internal */
4521
5066
  this._disableBlockhashCaching = false;
5067
+ /** @internal */
4522
5068
  this._pollingBlockhash = false;
5069
+ /** @internal */
4523
5070
  this._blockhashInfo = {
4524
5071
  latestBlockhash: null,
4525
5072
  lastFetch: 0,
4526
5073
  transactionSignatures: [],
4527
5074
  simulatedSignatures: []
4528
5075
  };
5076
+ /** @internal */
4529
5077
  this._nextClientSubscriptionId = 0;
5078
+ /** @internal */
4530
5079
  this._subscriptionDisposeFunctionsByClientSubscriptionId = {};
5080
+ /** @internal */
4531
5081
  this._subscriptionHashByClientSubscriptionId = {};
5082
+ /** @internal */
4532
5083
  this._subscriptionStateChangeCallbacksByHash = {};
5084
+ /** @internal */
4533
5085
  this._subscriptionCallbacksByServerSubscriptionId = {};
5086
+ /** @internal */
4534
5087
  this._subscriptionsByHash = {};
5088
+ /**
5089
+ * Special case.
5090
+ * After a signature is processed, RPCs automatically dispose of the
5091
+ * subscription on the server side. We need to track which of these
5092
+ * subscriptions have been disposed in such a way, so that we know
5093
+ * whether the client is dealing with a not-yet-processed signature
5094
+ * (in which case we must tear down the server subscription) or an
5095
+ * already-processed signature (in which case the client can simply
5096
+ * clear out the subscription locally without telling the server).
5097
+ *
5098
+ * NOTE: There is a proposal to eliminate this special case, here:
5099
+ * https://github.com/solana-labs/solana/issues/18892
5100
+ */
5101
+ /** @internal */
4535
5102
  this._subscriptionsAutoDisposedByRpc = new Set();
5103
+ /*
5104
+ * Returns the current block height of the node
5105
+ */
4536
5106
  this.getBlockHeight = (() => {
4537
5107
  const requestPromises = {};
4538
5108
  return async commitmentOrConfig => {
@@ -4928,6 +5498,8 @@ class Connection {
4928
5498
  * @return {Promise<Array<{pubkey: PublicKey, account: AccountInfo<Buffer>}>>}
4929
5499
  */
4930
5500
 
5501
+ // eslint-disable-next-line no-dupe-class-members
5502
+
4931
5503
  // eslint-disable-next-line no-dupe-class-members
4932
5504
  async getProgramAccounts(programId, configOrCommitment) {
4933
5505
  const {
@@ -4966,6 +5538,8 @@ class Connection {
4966
5538
  }
4967
5539
  return res.result;
4968
5540
  }
5541
+
5542
+ /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */ // eslint-disable-next-line no-dupe-class-members
4969
5543
  // eslint-disable-next-line no-dupe-class-members
4970
5544
  async confirmTransaction(strategy, commitment) {
4971
5545
  let rawSignature;
@@ -5709,6 +6283,23 @@ class Connection {
5709
6283
  return res.result;
5710
6284
  }
5711
6285
 
6286
+ /**
6287
+ * Returns whether a blockhash is still valid or not
6288
+ */
6289
+ async isBlockhashValid(blockhash, rawConfig) {
6290
+ const {
6291
+ commitment,
6292
+ config
6293
+ } = extractCommitmentFromConfig(rawConfig);
6294
+ const args = this._buildArgs([blockhash], commitment, undefined /* encoding */, config);
6295
+ const unsafeRes = await this._rpcRequest('isBlockhashValid', args);
6296
+ const res = create(unsafeRes, IsBlockhashValidRpcResult);
6297
+ if ('error' in res) {
6298
+ throw new SolanaJSONRPCError(res.error, 'failed to determine if the blockhash `' + blockhash + '`is valid');
6299
+ }
6300
+ return res.result;
6301
+ }
6302
+
5712
6303
  /**
5713
6304
  * Fetch the node version
5714
6305
  */
@@ -5740,10 +6331,24 @@ class Connection {
5740
6331
  * setting the `maxSupportedTransactionVersion` property.
5741
6332
  */
5742
6333
 
6334
+ /**
6335
+ * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by
6336
+ * setting the `maxSupportedTransactionVersion` property.
6337
+ */ // eslint-disable-next-line no-dupe-class-members
6338
+ /**
6339
+ * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by
6340
+ * setting the `maxSupportedTransactionVersion` property.
6341
+ */
6342
+ // eslint-disable-next-line no-dupe-class-members
5743
6343
  /**
5744
6344
  * Fetch a processed block from the cluster.
5745
6345
  */
5746
6346
  // eslint-disable-next-line no-dupe-class-members
6347
+ // eslint-disable-next-line no-dupe-class-members
6348
+ // eslint-disable-next-line no-dupe-class-members
6349
+ /**
6350
+ * Fetch a processed block from the cluster.
6351
+ */ // eslint-disable-next-line no-dupe-class-members
5747
6352
  async getBlock(slot, rawConfig) {
5748
6353
  const {
5749
6354
  commitment,
@@ -5804,6 +6409,10 @@ class Connection {
5804
6409
  * Fetch parsed transaction details for a confirmed or finalized block
5805
6410
  */
5806
6411
 
6412
+ // eslint-disable-next-line no-dupe-class-members
6413
+
6414
+ // eslint-disable-next-line no-dupe-class-members
6415
+
5807
6416
  // eslint-disable-next-line no-dupe-class-members
5808
6417
  async getParsedBlock(slot, rawConfig) {
5809
6418
  const {
@@ -5843,11 +6452,6 @@ class Connection {
5843
6452
  throw new SolanaJSONRPCError(e, 'failed to get block');
5844
6453
  }
5845
6454
  }
5846
-
5847
- /*
5848
- * Returns the current block height of the node
5849
- */
5850
-
5851
6455
  /*
5852
6456
  * Returns recent block production information from the current or previous epoch
5853
6457
  */
@@ -5883,8 +6487,10 @@ class Connection {
5883
6487
 
5884
6488
  /**
5885
6489
  * Fetch a confirmed or finalized transaction from the cluster.
5886
- */
5887
- // eslint-disable-next-line no-dupe-class-members
6490
+ */ // eslint-disable-next-line no-dupe-class-members
6491
+ /**
6492
+ * Fetch a confirmed or finalized transaction from the cluster.
6493
+ */ // eslint-disable-next-line no-dupe-class-members
5888
6494
  async getTransaction(signature, rawConfig) {
5889
6495
  const {
5890
6496
  commitment,
@@ -5963,8 +6569,12 @@ class Connection {
5963
6569
  * Fetch transaction details for a batch of confirmed transactions.
5964
6570
  * Similar to {@link getParsedTransactions} but returns a {@link
5965
6571
  * VersionedTransactionResponse}.
5966
- */
5967
- // eslint-disable-next-line no-dupe-class-members
6572
+ */ // eslint-disable-next-line no-dupe-class-members
6573
+ /**
6574
+ * Fetch transaction details for a batch of confirmed transactions.
6575
+ * Similar to {@link getParsedTransactions} but returns a {@link
6576
+ * VersionedTransactionResponse}.
6577
+ */ // eslint-disable-next-line no-dupe-class-members
5968
6578
  async getTransactions(signatures, commitmentOrConfig) {
5969
6579
  const {
5970
6580
  commitment,
@@ -6390,8 +7000,10 @@ class Connection {
6390
7000
 
6391
7001
  /**
6392
7002
  * Simulate a transaction
6393
- */
6394
- // eslint-disable-next-line no-dupe-class-members
7003
+ */ // eslint-disable-next-line no-dupe-class-members
7004
+ /**
7005
+ * Simulate a transaction
7006
+ */ // eslint-disable-next-line no-dupe-class-members
6395
7007
  async simulateTransaction(transactionOrMessage, configOrSigners, includeAccounts) {
6396
7008
  if ('message' in transactionOrMessage) {
6397
7009
  const versionedTx = transactionOrMessage;
@@ -6502,10 +7114,12 @@ class Connection {
6502
7114
  * VersionedTransaction}
6503
7115
  */
6504
7116
 
7117
+ /**
7118
+ * Send a signed transaction
7119
+ */ // eslint-disable-next-line no-dupe-class-members
6505
7120
  /**
6506
7121
  * Sign and send a transaction
6507
- */
6508
- // eslint-disable-next-line no-dupe-class-members
7122
+ */ // eslint-disable-next-line no-dupe-class-members
6509
7123
  async sendTransaction(transaction, signersOrOptions, options) {
6510
7124
  if ('version' in transaction) {
6511
7125
  if (signersOrOptions && Array.isArray(signersOrOptions)) {
@@ -6913,7 +7527,7 @@ class Connection {
6913
7527
  */
6914
7528
  args) {
6915
7529
  const clientSubscriptionId = this._nextClientSubscriptionId++;
6916
- const hash = fastStableStringify$1([subscriptionConfig.method, args]);
7530
+ const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);
6917
7531
 
6918
7532
  const existingSubscription = this._subscriptionsByHash[hash];
6919
7533
  if (existingSubscription === undefined) {
@@ -7395,6 +8009,10 @@ class Keypair {
7395
8009
  }
7396
8010
  }
7397
8011
 
8012
+ /**
8013
+ * An enumeration of valid LookupTableInstructionType's
8014
+ */
8015
+
7398
8016
  /**
7399
8017
  * An enumeration of valid address lookup table InstructionType's
7400
8018
  * @internal
@@ -7736,6 +8354,22 @@ class ComputeBudgetInstruction {
7736
8354
  * An enumeration of valid ComputeBudgetInstructionType's
7737
8355
  */
7738
8356
 
8357
+ /**
8358
+ * Request units instruction params
8359
+ */
8360
+
8361
+ /**
8362
+ * Request heap frame instruction params
8363
+ */
8364
+
8365
+ /**
8366
+ * Set compute unit limit instruction params
8367
+ */
8368
+
8369
+ /**
8370
+ * Set compute unit price instruction params
8371
+ */
8372
+
7739
8373
  /**
7740
8374
  * An enumeration of valid ComputeBudget InstructionType's
7741
8375
  * @internal
@@ -7824,6 +8458,10 @@ const SIGNATURE_BYTES = 64;
7824
8458
  * Params for creating an ed25519 instruction using a public key
7825
8459
  */
7826
8460
 
8461
+ /**
8462
+ * Params for creating an ed25519 instruction using a private key
8463
+ */
8464
+
7827
8465
  const ED25519_INSTRUCTION_LAYOUT = BufferLayout.struct([BufferLayout.u8('numSignatures'), BufferLayout.u8('padding'), BufferLayout.u16('signatureOffset'), BufferLayout.u16('signatureInstructionIndex'), BufferLayout.u16('publicKeyOffset'), BufferLayout.u16('publicKeyInstructionIndex'), BufferLayout.u16('messageDataOffset'), BufferLayout.u16('messageDataSize'), BufferLayout.u16('messageInstructionIndex')]);
7828
8466
  class Ed25519Program {
7829
8467
  /**
@@ -7921,6 +8559,14 @@ const SIGNATURE_OFFSETS_SERIALIZED_SIZE = 11;
7921
8559
  * Params for creating an secp256k1 instruction using a public key
7922
8560
  */
7923
8561
 
8562
+ /**
8563
+ * Params for creating an secp256k1 instruction using an Ethereum address
8564
+ */
8565
+
8566
+ /**
8567
+ * Params for creating an secp256k1 instruction using a private key
8568
+ */
8569
+
7924
8570
  const SECP256K1_INSTRUCTION_LAYOUT = BufferLayout.struct([BufferLayout.u8('numSignatures'), BufferLayout.u16('signatureOffset'), BufferLayout.u8('signatureInstructionIndex'), BufferLayout.u16('ethAddressOffset'), BufferLayout.u8('ethAddressInstructionIndex'), BufferLayout.u16('messageDataOffset'), BufferLayout.u16('messageDataSize'), BufferLayout.u8('messageInstructionIndex'), BufferLayout.blob(20, 'ethAddress'), BufferLayout.blob(64, 'signature'), BufferLayout.u8('recoveryId')]);
7925
8571
  class Secp256k1Program {
7926
8572
  /**
@@ -8056,17 +8702,15 @@ const STAKE_CONFIG_ID = new PublicKey('StakeConfig111111111111111111111111111111
8056
8702
  * Stake account authority info
8057
8703
  */
8058
8704
  class Authorized {
8059
- /** stake authority */
8060
-
8061
- /** withdraw authority */
8062
-
8063
8705
  /**
8064
8706
  * Create a new Authorized object
8065
8707
  * @param staker the stake authority
8066
8708
  * @param withdrawer the withdraw authority
8067
8709
  */
8068
8710
  constructor(staker, withdrawer) {
8711
+ /** stake authority */
8069
8712
  this.staker = void 0;
8713
+ /** withdraw authority */
8070
8714
  this.withdrawer = void 0;
8071
8715
  this.staker = staker;
8072
8716
  this.withdrawer = withdrawer;
@@ -8076,18 +8720,15 @@ class Authorized {
8076
8720
  * Stake account lockup info
8077
8721
  */
8078
8722
  class Lockup {
8079
- /** Unix timestamp of lockup expiration */
8080
-
8081
- /** Epoch of lockup expiration */
8082
-
8083
- /** Lockup custodian authority */
8084
-
8085
8723
  /**
8086
8724
  * Create a new Lockup object
8087
8725
  */
8088
8726
  constructor(unixTimestamp, epoch, custodian) {
8727
+ /** Unix timestamp of lockup expiration */
8089
8728
  this.unixTimestamp = void 0;
8729
+ /** Epoch of lockup expiration */
8090
8730
  this.epoch = void 0;
8731
+ /** Lockup custodian authority */
8091
8732
  this.custodian = void 0;
8092
8733
  this.unixTimestamp = unixTimestamp;
8093
8734
  this.epoch = epoch;
@@ -8099,6 +8740,39 @@ class Lockup {
8099
8740
  */
8100
8741
  }
8101
8742
  Lockup.default = new Lockup(0, 0, PublicKey.default);
8743
+ /**
8744
+ * Create stake account transaction params
8745
+ */
8746
+ /**
8747
+ * Create stake account with seed transaction params
8748
+ */
8749
+ /**
8750
+ * Initialize stake instruction params
8751
+ */
8752
+ /**
8753
+ * Delegate stake instruction params
8754
+ */
8755
+ /**
8756
+ * Authorize stake instruction params
8757
+ */
8758
+ /**
8759
+ * Authorize stake instruction params using a derived key
8760
+ */
8761
+ /**
8762
+ * Split stake instruction params
8763
+ */
8764
+ /**
8765
+ * Split with seed transaction params
8766
+ */
8767
+ /**
8768
+ * Withdraw stake instruction params
8769
+ */
8770
+ /**
8771
+ * Deactivate stake instruction params
8772
+ */
8773
+ /**
8774
+ * Merge stake instruction params
8775
+ */
8102
8776
  /**
8103
8777
  * Stake Instruction class
8104
8778
  */
@@ -8787,6 +9461,13 @@ class StakeProgram {
8787
9461
  }
8788
9462
  }
8789
9463
  StakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111111');
9464
+ /**
9465
+ * Max space of a Stake account
9466
+ *
9467
+ * This is generated from the solana-stake-program StakeState struct as
9468
+ * `StakeState::size_of()`:
9469
+ * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeState.html
9470
+ */
8790
9471
  StakeProgram.space = 200;
8791
9472
 
8792
9473
  /**
@@ -8811,6 +9492,22 @@ class VoteInit {
8811
9492
  * Create vote account transaction params
8812
9493
  */
8813
9494
 
9495
+ /**
9496
+ * InitializeAccount instruction params
9497
+ */
9498
+
9499
+ /**
9500
+ * Authorize instruction params
9501
+ */
9502
+
9503
+ /**
9504
+ * AuthorizeWithSeed instruction params
9505
+ */
9506
+
9507
+ /**
9508
+ * Withdraw from vote account transaction params
9509
+ */
9510
+
8814
9511
  /**
8815
9512
  * Vote Instruction class
8816
9513
  */
@@ -8942,6 +9639,8 @@ class VoteInstruction {
8942
9639
  * An enumeration of valid VoteInstructionType's
8943
9640
  */
8944
9641
 
9642
+ /** @internal */
9643
+
8945
9644
  const VOTE_INSTRUCTION_LAYOUTS = Object.freeze({
8946
9645
  InitializeAccount: {
8947
9646
  index: 0,
@@ -9178,6 +9877,15 @@ class VoteProgram {
9178
9877
  }
9179
9878
  }
9180
9879
  VoteProgram.programId = new PublicKey('Vote111111111111111111111111111111111111111');
9880
+ /**
9881
+ * Max space of a Vote account
9882
+ *
9883
+ * This is generated from the solana-vote-program VoteState struct as
9884
+ * `VoteState::size_of()`:
9885
+ * https://docs.rs/solana-vote-program/1.9.5/solana_vote_program/vote_state/struct.VoteState.html#method.size_of
9886
+ *
9887
+ * KEEP IN SYNC WITH `VoteState::size_of()` in https://github.com/solana-labs/solana/blob/a474cb24b9238f5edcc982f65c0b37d4a1046f7e/sdk/program/src/vote/state/mod.rs#L340-L342
9888
+ */
9181
9889
  VoteProgram.space = 3731;
9182
9890
 
9183
9891
  const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo111111111111111111111111111111');
@@ -9186,6 +9894,10 @@ const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo1111111111111111111111111
9186
9894
  * @internal
9187
9895
  */
9188
9896
 
9897
+ /**
9898
+ * Info used to identity validators.
9899
+ */
9900
+
9189
9901
  const InfoString = type({
9190
9902
  name: string(),
9191
9903
  website: optional(string()),
@@ -9197,14 +9909,6 @@ const InfoString = type({
9197
9909
  * ValidatorInfo class
9198
9910
  */
9199
9911
  class ValidatorInfo {
9200
- /**
9201
- * validator public key
9202
- */
9203
-
9204
- /**
9205
- * validator information
9206
- */
9207
-
9208
9912
  /**
9209
9913
  * Construct a valid ValidatorInfo
9210
9914
  *
@@ -9212,7 +9916,13 @@ class ValidatorInfo {
9212
9916
  * @param info validator information
9213
9917
  */
9214
9918
  constructor(key, info) {
9919
+ /**
9920
+ * validator public key
9921
+ */
9215
9922
  this.key = void 0;
9923
+ /**
9924
+ * validator information
9925
+ */
9216
9926
  this.info = void 0;
9217
9927
  this.key = key;
9218
9928
  this.info = info;
@@ -9253,6 +9963,11 @@ class ValidatorInfo {
9253
9963
  }
9254
9964
 
9255
9965
  const VOTE_PROGRAM_ID = new PublicKey('Vote111111111111111111111111111111111111111');
9966
+
9967
+ /**
9968
+ * History of how many credits earned by the end of each epoch
9969
+ */
9970
+
9256
9971
  /**
9257
9972
  * See https://github.com/solana-labs/solana/blob/8a12ed029cfa38d4a45400916c2463fb82bbec8c/programs/vote_api/src/vote_state.rs#L68-L88
9258
9973
  *
@@ -9392,9 +10107,7 @@ function clusterApiUrl(cluster, tls) {
9392
10107
  /**
9393
10108
  * @deprecated Calling `sendAndConfirmRawTransaction()` without a `confirmationStrategy`
9394
10109
  * is no longer supported and will be removed in a future version.
9395
- */
9396
- // eslint-disable-next-line no-redeclare
9397
-
10110
+ */ // eslint-disable-next-line no-redeclare
9398
10111
  // eslint-disable-next-line no-redeclare
9399
10112
  async function sendAndConfirmRawTransaction(connection, rawTransaction, confirmationStrategyOrConfirmOptions, maybeConfirmOptions) {
9400
10113
  let confirmationStrategy;