@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.
package/lib/index.esm.js CHANGED
@@ -27,6 +27,10 @@ import { secp256k1 } from '@noble/curves/secp256k1';
27
27
  * Read more: https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/
28
28
  */
29
29
 
30
+ /**
31
+ * Ed25519 Keypair
32
+ */
33
+
30
34
  const generatePrivateKey = ed25519.utils.randomPrivateKey;
31
35
  const generateKeypair = () => {
32
36
  const privateScalar = ed25519.utils.randomPrivateKey();
@@ -109,6 +113,10 @@ const PUBLIC_KEY_LENGTH = 32;
109
113
  * Value to be converted into public key
110
114
  */
111
115
 
116
+ /**
117
+ * JSON object representation of PublicKey class
118
+ */
119
+
112
120
  function isPublicKeyData(value) {
113
121
  return value._bn !== undefined;
114
122
  }
@@ -121,14 +129,13 @@ let uniquePublicKeyCounter = 1;
121
129
  */
122
130
  _Symbol$toStringTag = Symbol.toStringTag;
123
131
  class PublicKey extends Struct {
124
- /** @internal */
125
-
126
132
  /**
127
133
  * Create a new PublicKey object
128
134
  * @param value ed25519 public key as buffer or base-58 encoded string
129
135
  */
130
136
  constructor(value) {
131
137
  super({});
138
+ /** @internal */
132
139
  this._bn = void 0;
133
140
  if (isPublicKeyData(value)) {
134
141
  this._bn = value._bn;
@@ -310,10 +317,6 @@ SOLANA_SCHEMA.set(PublicKey, {
310
317
  * @deprecated since v1.10.0, please use {@link Keypair} instead.
311
318
  */
312
319
  class Account {
313
- /** @internal */
314
-
315
- /** @internal */
316
-
317
320
  /**
318
321
  * Create a new Account object
319
322
  *
@@ -323,7 +326,9 @@ class Account {
323
326
  * @param secretKey Secret key for the account
324
327
  */
325
328
  constructor(secretKey) {
329
+ /** @internal */
326
330
  this._publicKey = void 0;
331
+ /** @internal */
327
332
  this._secretKey = void 0;
328
333
  if (secretKey) {
329
334
  const secretKeyBuffer = toBuffer(secretKey);
@@ -680,6 +685,10 @@ class CompiledKeys {
680
685
  * @property {string} data
681
686
  */
682
687
 
688
+ /**
689
+ * Message constructor arguments
690
+ */
691
+
683
692
  /**
684
693
  * List of instructions to be processed atomically
685
694
  */
@@ -1124,17 +1133,17 @@ const VersionedMessage = {
1124
1133
  * Transaction signature as base-58 encoded string
1125
1134
  */
1126
1135
 
1127
- let TransactionStatus;
1128
-
1129
- /**
1130
- * Default (empty) signature
1131
- */
1132
- (function (TransactionStatus) {
1136
+ let TransactionStatus = /*#__PURE__*/function (TransactionStatus) {
1133
1137
  TransactionStatus[TransactionStatus["BLOCKHEIGHT_EXCEEDED"] = 0] = "BLOCKHEIGHT_EXCEEDED";
1134
1138
  TransactionStatus[TransactionStatus["PROCESSED"] = 1] = "PROCESSED";
1135
1139
  TransactionStatus[TransactionStatus["TIMED_OUT"] = 2] = "TIMED_OUT";
1136
1140
  TransactionStatus[TransactionStatus["NONCE_INVALID"] = 3] = "NONCE_INVALID";
1137
- })(TransactionStatus || (TransactionStatus = {}));
1141
+ return TransactionStatus;
1142
+ }({});
1143
+
1144
+ /**
1145
+ * Default (empty) signature
1146
+ */
1138
1147
  const DEFAULT_SIGNATURE = Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);
1139
1148
 
1140
1149
  /**
@@ -1142,25 +1151,34 @@ const DEFAULT_SIGNATURE = Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);
1142
1151
  */
1143
1152
 
1144
1153
  /**
1145
- * Transaction Instruction class
1154
+ * List of TransactionInstruction object fields that may be initialized at construction
1146
1155
  */
1147
- class TransactionInstruction {
1148
- /**
1149
- * Public keys to include in this transaction
1150
- * Boolean represents whether this pubkey needs to sign the transaction
1151
- */
1152
1156
 
1153
- /**
1154
- * Program Id to execute
1155
- */
1157
+ /**
1158
+ * Configuration object for Transaction.serialize()
1159
+ */
1156
1160
 
1157
- /**
1158
- * Program input
1159
- */
1161
+ /**
1162
+ * @internal
1163
+ */
1160
1164
 
1165
+ /**
1166
+ * Transaction Instruction class
1167
+ */
1168
+ class TransactionInstruction {
1161
1169
  constructor(opts) {
1170
+ /**
1171
+ * Public keys to include in this transaction
1172
+ * Boolean represents whether this pubkey needs to sign the transaction
1173
+ */
1162
1174
  this.keys = void 0;
1175
+ /**
1176
+ * Program Id to execute
1177
+ */
1163
1178
  this.programId = void 0;
1179
+ /**
1180
+ * Program input
1181
+ */
1164
1182
  this.data = Buffer.alloc(0);
1165
1183
  this.programId = opts.programId;
1166
1184
  this.keys = opts.keys;
@@ -1193,15 +1211,31 @@ class TransactionInstruction {
1193
1211
  * Pair of signature and corresponding public key
1194
1212
  */
1195
1213
 
1214
+ /**
1215
+ * List of Transaction object fields that may be initialized at construction
1216
+ */
1217
+
1218
+ // For backward compatibility; an unfortunate consequence of being
1219
+ // forced to over-export types by the documentation generator.
1220
+ // See https://github.com/solana-labs/solana/pull/25820
1221
+ /**
1222
+ * Blockhash-based transactions have a lifetime that are defined by
1223
+ * the blockhash they include. Any transaction whose blockhash is
1224
+ * too old will be rejected.
1225
+ */
1226
+ /**
1227
+ * Use these options to construct a durable nonce transaction.
1228
+ */
1229
+ /**
1230
+ * Nonce information to be used to build an offline Transaction.
1231
+ */
1232
+ /**
1233
+ * @internal
1234
+ */
1196
1235
  /**
1197
1236
  * Transaction class
1198
1237
  */
1199
1238
  class Transaction {
1200
- /**
1201
- * Signatures for the transaction. Typically created by invoking the
1202
- * `sign()` method
1203
- */
1204
-
1205
1239
  /**
1206
1240
  * The first (payer) Transaction signature
1207
1241
  */
@@ -1216,18 +1250,57 @@ class Transaction {
1216
1250
  * The transaction fee payer
1217
1251
  */
1218
1252
 
1253
+ // Construct a transaction with a blockhash and lastValidBlockHeight
1254
+
1255
+ // Construct a transaction using a durable nonce
1256
+
1257
+ /**
1258
+ * @deprecated `TransactionCtorFields` has been deprecated and will be removed in a future version.
1259
+ * Please supply a `TransactionBlockhashCtor` instead.
1260
+ */
1261
+
1219
1262
  /**
1220
1263
  * Construct an empty Transaction
1221
1264
  */
1222
1265
  constructor(opts) {
1266
+ /**
1267
+ * Signatures for the transaction. Typically created by invoking the
1268
+ * `sign()` method
1269
+ */
1223
1270
  this.signatures = [];
1224
1271
  this.feePayer = void 0;
1272
+ /**
1273
+ * The instructions to atomically execute
1274
+ */
1225
1275
  this.instructions = [];
1276
+ /**
1277
+ * A recent transaction id. Must be populated by the caller
1278
+ */
1226
1279
  this.recentBlockhash = void 0;
1280
+ /**
1281
+ * the last block chain can advance to before tx is declared expired
1282
+ * */
1227
1283
  this.lastValidBlockHeight = void 0;
1284
+ /**
1285
+ * Optional Nonce information. If populated, transaction will use a durable
1286
+ * Nonce hash instead of a recentBlockhash. Must be populated by the caller
1287
+ */
1228
1288
  this.nonceInfo = void 0;
1289
+ /**
1290
+ * If this is a nonce transaction this represents the minimum slot from which
1291
+ * to evaluate if the nonce has advanced when attempting to confirm the
1292
+ * transaction. This protects against a case where the transaction confirmation
1293
+ * logic loads the nonce account from an old slot and assumes the mismatch in
1294
+ * nonce value implies that the nonce has been advanced.
1295
+ */
1229
1296
  this.minNonceContextSlot = void 0;
1297
+ /**
1298
+ * @internal
1299
+ */
1230
1300
  this._message = void 0;
1301
+ /**
1302
+ * @internal
1303
+ */
1231
1304
  this._json = void 0;
1232
1305
  if (!opts) {
1233
1306
  return;
@@ -2042,6 +2115,10 @@ function sleep(ms) {
2042
2115
  return new Promise(resolve => setTimeout(resolve, ms));
2043
2116
  }
2044
2117
 
2118
+ /**
2119
+ * @internal
2120
+ */
2121
+
2045
2122
  /**
2046
2123
  * Populate a buffer of instruction data using an InstructionType
2047
2124
  * @internal
@@ -2161,6 +2238,62 @@ const u64 = bigInt(8);
2161
2238
  * Create account system transaction params
2162
2239
  */
2163
2240
 
2241
+ /**
2242
+ * Transfer system transaction params
2243
+ */
2244
+
2245
+ /**
2246
+ * Assign system transaction params
2247
+ */
2248
+
2249
+ /**
2250
+ * Create account with seed system transaction params
2251
+ */
2252
+
2253
+ /**
2254
+ * Create nonce account system transaction params
2255
+ */
2256
+
2257
+ /**
2258
+ * Create nonce account with seed system transaction params
2259
+ */
2260
+
2261
+ /**
2262
+ * Initialize nonce account system instruction params
2263
+ */
2264
+
2265
+ /**
2266
+ * Advance nonce account system instruction params
2267
+ */
2268
+
2269
+ /**
2270
+ * Withdraw nonce account system transaction params
2271
+ */
2272
+
2273
+ /**
2274
+ * Authorize nonce account system transaction params
2275
+ */
2276
+
2277
+ /**
2278
+ * Allocate account system transaction params
2279
+ */
2280
+
2281
+ /**
2282
+ * Allocate account with seed system transaction params
2283
+ */
2284
+
2285
+ /**
2286
+ * Assign account with seed system transaction params
2287
+ */
2288
+
2289
+ /**
2290
+ * Transfer with seed system transaction params
2291
+ */
2292
+
2293
+ /** Decoded transfer system transaction instruction */
2294
+
2295
+ /** Decoded transferWithSeed system transaction instruction */
2296
+
2164
2297
  /**
2165
2298
  * System Instruction class
2166
2299
  */
@@ -3064,11 +3197,7 @@ function getDefaultExportFromCjs (x) {
3064
3197
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3065
3198
  }
3066
3199
 
3067
- var agentkeepaliveExports = {};
3068
- var agentkeepalive = {
3069
- get exports(){ return agentkeepaliveExports; },
3070
- set exports(v){ agentkeepaliveExports = v; },
3071
- };
3200
+ var agentkeepalive = {exports: {}};
3072
3201
 
3073
3202
  /**
3074
3203
  * Helpers.
@@ -3256,17 +3385,9 @@ var humanizeMs = function (t) {
3256
3385
  return r;
3257
3386
  };
3258
3387
 
3259
- var srcExports = {};
3260
- var src = {
3261
- get exports(){ return srcExports; },
3262
- set exports(v){ srcExports = v; },
3263
- };
3388
+ var src = {exports: {}};
3264
3389
 
3265
- var browserExports = {};
3266
- var browser$1 = {
3267
- get exports(){ return browserExports; },
3268
- set exports(v){ browserExports = v; },
3269
- };
3390
+ var browser$1 = {exports: {}};
3270
3391
 
3271
3392
  /**
3272
3393
  * Helpers.
@@ -3726,7 +3847,7 @@ function requireCommon () {
3726
3847
  var hasRequiredBrowser$1;
3727
3848
 
3728
3849
  function requireBrowser$1 () {
3729
- if (hasRequiredBrowser$1) return browserExports;
3850
+ if (hasRequiredBrowser$1) return browser$1.exports;
3730
3851
  hasRequiredBrowser$1 = 1;
3731
3852
  (function (module, exports) {
3732
3853
  /**
@@ -3995,16 +4116,12 @@ function requireBrowser$1 () {
3995
4116
  } catch (error) {
3996
4117
  return '[UnexpectedJSONParseError]: ' + error.message;
3997
4118
  }
3998
- };
3999
- } (browser$1, browserExports));
4000
- return browserExports;
4119
+ };
4120
+ } (browser$1, browser$1.exports));
4121
+ return browser$1.exports;
4001
4122
  }
4002
4123
 
4003
- var nodeExports = {};
4004
- var node = {
4005
- get exports(){ return nodeExports; },
4006
- set exports(v){ nodeExports = v; },
4007
- };
4124
+ var node = {exports: {}};
4008
4125
 
4009
4126
  /* eslint-env browser */
4010
4127
 
@@ -4046,7 +4163,7 @@ function requireBrowser () {
4046
4163
  var hasRequiredNode;
4047
4164
 
4048
4165
  function requireNode () {
4049
- if (hasRequiredNode) return nodeExports;
4166
+ if (hasRequiredNode) return node.exports;
4050
4167
  hasRequiredNode = 1;
4051
4168
  (function (module, exports) {
4052
4169
  const tty = require$$0$1;
@@ -4307,9 +4424,9 @@ function requireNode () {
4307
4424
  formatters.O = function (v) {
4308
4425
  this.inspectOpts.colors = this.useColors;
4309
4426
  return util.inspect(v, this.inspectOpts);
4310
- };
4311
- } (node, nodeExports));
4312
- return nodeExports;
4427
+ };
4428
+ } (node, node.exports));
4429
+ return node.exports;
4313
4430
  }
4314
4431
 
4315
4432
  /**
@@ -4317,19 +4434,15 @@ function requireNode () {
4317
4434
  * treat as a browser.
4318
4435
  */
4319
4436
 
4320
- (function (module) {
4321
- if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
4322
- module.exports = requireBrowser$1();
4323
- } else {
4324
- module.exports = requireNode();
4325
- }
4326
- } (src));
4437
+ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
4438
+ src.exports = requireBrowser$1();
4439
+ } else {
4440
+ src.exports = requireNode();
4441
+ }
4327
4442
 
4328
- var compatExports = {};
4329
- var compat = {
4330
- get exports(){ return compatExports; },
4331
- set exports(v){ compatExports = v; },
4332
- };
4443
+ var srcExports = src.exports;
4444
+
4445
+ var compat = {exports: {}};
4333
4446
 
4334
4447
  /*!
4335
4448
  * depd
@@ -4550,9 +4663,11 @@ function requireEventListenerCount () {
4550
4663
 
4551
4664
  function toString (obj) {
4552
4665
  return obj.toString()
4553
- }
4666
+ }
4554
4667
  } (compat));
4555
4668
 
4669
+ var compatExports = compat.exports;
4670
+
4556
4671
  /*!
4557
4672
  * depd
4558
4673
  * Copyright(c) 2014-2017 Douglas Christopher Wilson
@@ -5492,7 +5607,7 @@ const {
5492
5607
  CREATE_HTTPS_CONNECTION,
5493
5608
  } = constants;
5494
5609
 
5495
- class HttpsAgent extends HttpAgent {
5610
+ let HttpsAgent$1 = class HttpsAgent extends HttpAgent {
5496
5611
  constructor(options) {
5497
5612
  super(options);
5498
5613
 
@@ -5515,10 +5630,10 @@ class HttpsAgent extends HttpAgent {
5515
5630
  this[INIT_SOCKET](socket, options);
5516
5631
  return socket;
5517
5632
  }
5518
- }
5633
+ };
5519
5634
 
5520
5635
  // https://github.com/nodejs/node/blob/master/lib/https.js#L89
5521
- HttpsAgent.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.createConnection;
5636
+ HttpsAgent$1.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.createConnection;
5522
5637
 
5523
5638
  [
5524
5639
  'getName',
@@ -5529,19 +5644,17 @@ HttpsAgent.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.cre
5529
5644
  ].forEach(function(method) {
5530
5645
  /* istanbul ignore next */
5531
5646
  if (typeof OriginalHttpsAgent.prototype[method] === 'function') {
5532
- HttpsAgent.prototype[method] = OriginalHttpsAgent.prototype[method];
5647
+ HttpsAgent$1.prototype[method] = OriginalHttpsAgent.prototype[method];
5533
5648
  }
5534
5649
  });
5535
5650
 
5536
- var https_agent = HttpsAgent;
5537
-
5538
- (function (module) {
5651
+ var https_agent = HttpsAgent$1;
5539
5652
 
5540
- module.exports = agent;
5541
- module.exports.HttpsAgent = https_agent;
5542
- module.exports.constants = constants;
5543
- } (agentkeepalive));
5653
+ agentkeepalive.exports = agent;
5654
+ var HttpsAgent = agentkeepalive.exports.HttpsAgent = https_agent;
5655
+ agentkeepalive.exports.constants = constants;
5544
5656
 
5657
+ var agentkeepaliveExports = agentkeepalive.exports;
5545
5658
  var HttpKeepAliveAgent = /*@__PURE__*/getDefaultExportFromCjs(agentkeepaliveExports);
5546
5659
 
5547
5660
  var objToString = Object.prototype.toString;
@@ -5618,7 +5731,7 @@ var fastStableStringify = function(val) {
5618
5731
  }
5619
5732
  };
5620
5733
 
5621
- var fastStableStringify$1 = fastStableStringify;
5734
+ var fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);
5622
5735
 
5623
5736
  const MINIMUM_SLOT_PER_EPOCH = 32;
5624
5737
 
@@ -5651,21 +5764,16 @@ function nextPowerOfTwo(n) {
5651
5764
  * Can be retrieved with the {@link Connection.getEpochSchedule} method
5652
5765
  */
5653
5766
  class EpochSchedule {
5654
- /** The maximum number of slots in each epoch */
5655
-
5656
- /** The number of slots before beginning of an epoch to calculate a leader schedule for that epoch */
5657
-
5658
- /** Indicates whether epochs start short and grow */
5659
-
5660
- /** The first epoch with `slotsPerEpoch` slots */
5661
-
5662
- /** The first slot of `firstNormalEpoch` */
5663
-
5664
5767
  constructor(slotsPerEpoch, leaderScheduleSlotOffset, warmup, firstNormalEpoch, firstNormalSlot) {
5768
+ /** The maximum number of slots in each epoch */
5665
5769
  this.slotsPerEpoch = void 0;
5770
+ /** The number of slots before beginning of an epoch to calculate a leader schedule for that epoch */
5666
5771
  this.leaderScheduleSlotOffset = void 0;
5772
+ /** Indicates whether epochs start short and grow */
5667
5773
  this.warmup = void 0;
5774
+ /** The first epoch with `slotsPerEpoch` slots */
5668
5775
  this.firstNormalEpoch = void 0;
5776
+ /** The first slot of `firstNormalEpoch` */
5669
5777
  this.firstNormalSlot = void 0;
5670
5778
  this.slotsPerEpoch = slotsPerEpoch;
5671
5779
  this.leaderScheduleSlotOffset = leaderScheduleSlotOffset;
@@ -5891,6 +5999,92 @@ const BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1000;
5891
5999
  * https://gist.github.com/steveluscher/c057eca81d479ef705cdb53162f9971d
5892
6000
  */
5893
6001
 
6002
+ /** @internal */
6003
+ /** @internal */
6004
+ /** @internal */
6005
+ /** @internal */
6006
+
6007
+ /** @internal */
6008
+ /**
6009
+ * @internal
6010
+ * Every subscription contains the args used to open the subscription with
6011
+ * the server, and a list of callers interested in notifications.
6012
+ */
6013
+
6014
+ /**
6015
+ * @internal
6016
+ * A subscription may be in various states of connectedness. Only when it is
6017
+ * fully connected will it have a server subscription id associated with it.
6018
+ * This id can be returned to the server to unsubscribe the client entirely.
6019
+ */
6020
+
6021
+ /**
6022
+ * A type that encapsulates a subscription's RPC method
6023
+ * names and notification (callback) signature.
6024
+ */
6025
+
6026
+ /**
6027
+ * @internal
6028
+ * Utility type that keeps tagged unions intact while omitting properties.
6029
+ */
6030
+
6031
+ /**
6032
+ * @internal
6033
+ * This type represents a single subscribable 'topic.' It's made up of:
6034
+ *
6035
+ * - The args used to open the subscription with the server,
6036
+ * - The state of the subscription, in terms of its connectedness, and
6037
+ * - The set of callbacks to call when the server publishes notifications
6038
+ *
6039
+ * This record gets indexed by `SubscriptionConfigHash` and is used to
6040
+ * set up subscriptions, fan out notifications, and track subscription state.
6041
+ */
6042
+
6043
+ /**
6044
+ * @internal
6045
+ */
6046
+
6047
+ /**
6048
+ * Extra contextual information for RPC responses
6049
+ */
6050
+
6051
+ /**
6052
+ * Options for sending transactions
6053
+ */
6054
+
6055
+ /**
6056
+ * Options for confirming transactions
6057
+ */
6058
+
6059
+ /**
6060
+ * Options for getConfirmedSignaturesForAddress2
6061
+ */
6062
+
6063
+ /**
6064
+ * Options for getSignaturesForAddress
6065
+ */
6066
+
6067
+ /**
6068
+ * RPC Response with extra contextual information
6069
+ */
6070
+
6071
+ /**
6072
+ * A strategy for confirming transactions that uses the last valid
6073
+ * block height for a given blockhash to check for transaction expiration.
6074
+ */
6075
+
6076
+ /**
6077
+ * A strategy for confirming durable nonce transactions.
6078
+ */
6079
+
6080
+ /**
6081
+ * Properties shared by all transaction confirmation strategies
6082
+ */
6083
+
6084
+ /**
6085
+ * This type represents all transaction confirmation strategies
6086
+ */
6087
+
5894
6088
  /* @internal */
5895
6089
  function assertEndpointUrl(putativeUrl) {
5896
6090
  if (/^https?:/.test(putativeUrl) === false) {
@@ -6009,53 +6203,137 @@ function versionedMessageFromResponse(version, response) {
6009
6203
  * </pre>
6010
6204
  */
6011
6205
 
6012
- const GetInflationGovernorResult = type({
6013
- foundation: number(),
6014
- foundationTerm: number(),
6015
- initial: number(),
6016
- taper: number(),
6017
- terminal: number()
6018
- });
6019
-
6206
+ // Deprecated as of v1.5.5
6020
6207
  /**
6021
- * The inflation reward for an epoch
6208
+ * A subset of Commitment levels, which are at least optimistically confirmed
6209
+ * <pre>
6210
+ * 'confirmed': Query the most recent block which has reached 1 confirmation by the cluster
6211
+ * 'finalized': Query the most recent block which has been finalized by the cluster
6212
+ * </pre>
6022
6213
  */
6023
-
6024
6214
  /**
6025
- * Expected JSON RPC response for the "getInflationReward" message
6215
+ * Filter for largest accounts query
6216
+ * <pre>
6217
+ * 'circulating': Return the largest accounts that are part of the circulating supply
6218
+ * 'nonCirculating': Return the largest accounts that are not part of the circulating supply
6219
+ * </pre>
6026
6220
  */
6027
- const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
6028
- epoch: number(),
6029
- effectiveSlot: number(),
6030
- amount: number(),
6031
- postBalance: number(),
6032
- commission: optional(nullable(number()))
6033
- }))));
6034
6221
  /**
6035
- * Expected JSON RPC response for the "getRecentPrioritizationFees" message
6222
+ * Configuration object for changing `getAccountInfo` query behavior
6036
6223
  */
6037
- const GetRecentPrioritizationFeesResult = array(type({
6038
- slot: number(),
6039
- prioritizationFee: number()
6040
- }));
6041
6224
  /**
6042
- * Expected JSON RPC response for the "getInflationRate" message
6225
+ * Configuration object for changing `getBalance` query behavior
6043
6226
  */
6044
- const GetInflationRateResult = type({
6045
- total: number(),
6046
- validator: number(),
6047
- foundation: number(),
6048
- epoch: number()
6049
- });
6050
-
6051
6227
  /**
6052
- * Information about the current epoch
6228
+ * Configuration object for changing `getBlock` query behavior
6053
6229
  */
6054
-
6055
- const GetEpochInfoResult = type({
6056
- epoch: number(),
6057
- slotIndex: number(),
6058
- slotsInEpoch: number(),
6230
+ /**
6231
+ * Configuration object for changing `getBlock` query behavior
6232
+ */
6233
+ /**
6234
+ * Configuration object for changing `getStakeMinimumDelegation` query behavior
6235
+ */
6236
+ /**
6237
+ * Configuration object for changing `getBlockHeight` query behavior
6238
+ */
6239
+ /**
6240
+ * Configuration object for changing `getEpochInfo` query behavior
6241
+ */
6242
+ /**
6243
+ * Configuration object for changing `getInflationReward` query behavior
6244
+ */
6245
+ /**
6246
+ * Configuration object for changing `getLatestBlockhash` query behavior
6247
+ */
6248
+ /**
6249
+ * Configuration object for changing `isBlockhashValid` query behavior
6250
+ */
6251
+ /**
6252
+ * Configuration object for changing `getSlot` query behavior
6253
+ */
6254
+ /**
6255
+ * Configuration object for changing `getSlotLeader` query behavior
6256
+ */
6257
+ /**
6258
+ * Configuration object for changing `getTransaction` query behavior
6259
+ */
6260
+ /**
6261
+ * Configuration object for changing `getTransaction` query behavior
6262
+ */
6263
+ /**
6264
+ * Configuration object for changing `getLargestAccounts` query behavior
6265
+ */
6266
+ /**
6267
+ * Configuration object for changing `getSupply` request behavior
6268
+ */
6269
+ /**
6270
+ * Configuration object for changing query behavior
6271
+ */
6272
+ /**
6273
+ * Information describing a cluster node
6274
+ */
6275
+ /**
6276
+ * Information describing a vote account
6277
+ */
6278
+ /**
6279
+ * A collection of cluster vote accounts
6280
+ */
6281
+ /**
6282
+ * Network Inflation
6283
+ * (see https://docs.solana.com/implemented-proposals/ed_overview)
6284
+ */
6285
+ const GetInflationGovernorResult = type({
6286
+ foundation: number(),
6287
+ foundationTerm: number(),
6288
+ initial: number(),
6289
+ taper: number(),
6290
+ terminal: number()
6291
+ });
6292
+
6293
+ /**
6294
+ * The inflation reward for an epoch
6295
+ */
6296
+
6297
+ /**
6298
+ * Expected JSON RPC response for the "getInflationReward" message
6299
+ */
6300
+ const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
6301
+ epoch: number(),
6302
+ effectiveSlot: number(),
6303
+ amount: number(),
6304
+ postBalance: number(),
6305
+ commission: optional(nullable(number()))
6306
+ }))));
6307
+
6308
+ /**
6309
+ * Configuration object for changing `getRecentPrioritizationFees` query behavior
6310
+ */
6311
+
6312
+ /**
6313
+ * Expected JSON RPC response for the "getRecentPrioritizationFees" message
6314
+ */
6315
+ const GetRecentPrioritizationFeesResult = array(type({
6316
+ slot: number(),
6317
+ prioritizationFee: number()
6318
+ }));
6319
+ /**
6320
+ * Expected JSON RPC response for the "getInflationRate" message
6321
+ */
6322
+ const GetInflationRateResult = type({
6323
+ total: number(),
6324
+ validator: number(),
6325
+ foundation: number(),
6326
+ epoch: number()
6327
+ });
6328
+
6329
+ /**
6330
+ * Information about the current epoch
6331
+ */
6332
+
6333
+ const GetEpochInfoResult = type({
6334
+ epoch: number(),
6335
+ slotIndex: number(),
6336
+ slotsInEpoch: number(),
6059
6337
  absoluteSlot: number(),
6060
6338
  blockHeight: optional(number()),
6061
6339
  transactionCount: optional(number())
@@ -6116,6 +6394,127 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
6116
6394
  data: tuple([string(), literal('base64')])
6117
6395
  })))
6118
6396
  }));
6397
+
6398
+ /**
6399
+ * Metadata for a parsed confirmed transaction on the ledger
6400
+ *
6401
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
6402
+ */
6403
+
6404
+ /**
6405
+ * Collection of addresses loaded by a transaction using address table lookups
6406
+ */
6407
+
6408
+ /**
6409
+ * Metadata for a parsed transaction on the ledger
6410
+ */
6411
+
6412
+ /**
6413
+ * Metadata for a confirmed transaction on the ledger
6414
+ */
6415
+
6416
+ /**
6417
+ * A processed transaction from the RPC API
6418
+ */
6419
+
6420
+ /**
6421
+ * A processed transaction from the RPC API
6422
+ */
6423
+
6424
+ /**
6425
+ * A processed transaction message from the RPC API
6426
+ */
6427
+
6428
+ /**
6429
+ * A confirmed transaction on the ledger
6430
+ *
6431
+ * @deprecated Deprecated since Solana v1.8.0.
6432
+ */
6433
+
6434
+ /**
6435
+ * A partially decoded transaction instruction
6436
+ */
6437
+
6438
+ /**
6439
+ * A parsed transaction message account
6440
+ */
6441
+
6442
+ /**
6443
+ * A parsed transaction instruction
6444
+ */
6445
+
6446
+ /**
6447
+ * A parsed address table lookup
6448
+ */
6449
+
6450
+ /**
6451
+ * A parsed transaction message
6452
+ */
6453
+
6454
+ /**
6455
+ * A parsed transaction
6456
+ */
6457
+
6458
+ /**
6459
+ * A parsed and confirmed transaction on the ledger
6460
+ *
6461
+ * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
6462
+ */
6463
+
6464
+ /**
6465
+ * A parsed transaction on the ledger with meta
6466
+ */
6467
+
6468
+ /**
6469
+ * A processed block fetched from the RPC API
6470
+ */
6471
+
6472
+ /**
6473
+ * A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`
6474
+ */
6475
+
6476
+ /**
6477
+ * A processed block fetched from the RPC API where the `transactionDetails` mode is `none`
6478
+ */
6479
+
6480
+ /**
6481
+ * A block with parsed transactions
6482
+ */
6483
+
6484
+ /**
6485
+ * A block with parsed transactions where the `transactionDetails` mode is `accounts`
6486
+ */
6487
+
6488
+ /**
6489
+ * A block with parsed transactions where the `transactionDetails` mode is `none`
6490
+ */
6491
+
6492
+ /**
6493
+ * A processed block fetched from the RPC API
6494
+ */
6495
+
6496
+ /**
6497
+ * A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`
6498
+ */
6499
+
6500
+ /**
6501
+ * A processed block fetched from the RPC API where the `transactionDetails` mode is `none`
6502
+ */
6503
+
6504
+ /**
6505
+ * A confirmed block on the ledger
6506
+ *
6507
+ * @deprecated Deprecated since Solana v1.8.0.
6508
+ */
6509
+
6510
+ /**
6511
+ * A Block on the ledger with signatures only
6512
+ */
6513
+
6514
+ /**
6515
+ * recent block production information
6516
+ */
6517
+
6119
6518
  /**
6120
6519
  * Expected JSON RPC response for the "getBlockProduction" message
6121
6520
  */
@@ -6145,7 +6544,7 @@ function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disable
6145
6544
  maxSockets: 25
6146
6545
  };
6147
6546
  if (url.startsWith('https:')) {
6148
- agent = new agentkeepaliveExports.HttpsAgent(agentOptions);
6547
+ agent = new HttpsAgent(agentOptions);
6149
6548
  } else {
6150
6549
  agent = new HttpKeepAliveAgent(agentOptions);
6151
6550
  }
@@ -6896,6 +7295,11 @@ const GetLatestBlockhashRpcResult = jsonRpcResultAndContext(type({
6896
7295
  blockhash: string(),
6897
7296
  lastValidBlockHeight: number()
6898
7297
  }));
7298
+
7299
+ /**
7300
+ * Expected JSON RPC response for the "isBlockhashValid" message
7301
+ */
7302
+ const IsBlockhashValidRpcResult = jsonRpcResultAndContext(boolean());
6899
7303
  const PerfSampleResult = type({
6900
7304
  slot: number(),
6901
7305
  numTransactions: number(),
@@ -6931,6 +7335,110 @@ const SendTransactionRpcResult = jsonRpcResult(string());
6931
7335
  * Information about the latest slot being processed by a node
6932
7336
  */
6933
7337
 
7338
+ /**
7339
+ * Parsed account data
7340
+ */
7341
+
7342
+ /**
7343
+ * Stake Activation data
7344
+ */
7345
+
7346
+ /**
7347
+ * Data slice argument for getProgramAccounts
7348
+ */
7349
+
7350
+ /**
7351
+ * Memory comparison filter for getProgramAccounts
7352
+ */
7353
+
7354
+ /**
7355
+ * Data size comparison filter for getProgramAccounts
7356
+ */
7357
+
7358
+ /**
7359
+ * A filter object for getProgramAccounts
7360
+ */
7361
+
7362
+ /**
7363
+ * Configuration object for getProgramAccounts requests
7364
+ */
7365
+
7366
+ /**
7367
+ * Configuration object for getParsedProgramAccounts
7368
+ */
7369
+
7370
+ /**
7371
+ * Configuration object for getMultipleAccounts
7372
+ */
7373
+
7374
+ /**
7375
+ * Configuration object for `getStakeActivation`
7376
+ */
7377
+
7378
+ /**
7379
+ * Configuration object for `getStakeActivation`
7380
+ */
7381
+
7382
+ /**
7383
+ * Configuration object for `getStakeActivation`
7384
+ */
7385
+
7386
+ /**
7387
+ * Configuration object for `getNonce`
7388
+ */
7389
+
7390
+ /**
7391
+ * Configuration object for `getNonceAndContext`
7392
+ */
7393
+
7394
+ /**
7395
+ * Information describing an account
7396
+ */
7397
+
7398
+ /**
7399
+ * Account information identified by pubkey
7400
+ */
7401
+
7402
+ /**
7403
+ * Callback function for account change notifications
7404
+ */
7405
+
7406
+ /**
7407
+ * Callback function for program account change notifications
7408
+ */
7409
+
7410
+ /**
7411
+ * Callback function for slot change notifications
7412
+ */
7413
+
7414
+ /**
7415
+ * Callback function for slot update notifications
7416
+ */
7417
+
7418
+ /**
7419
+ * Callback function for signature status notifications
7420
+ */
7421
+
7422
+ /**
7423
+ * Signature status notification with transaction result
7424
+ */
7425
+
7426
+ /**
7427
+ * Signature received notification
7428
+ */
7429
+
7430
+ /**
7431
+ * Callback function for signature notifications
7432
+ */
7433
+
7434
+ /**
7435
+ * Signature subscription options
7436
+ */
7437
+
7438
+ /**
7439
+ * Callback function for root change notifications
7440
+ */
7441
+
6934
7442
  /**
6935
7443
  * @internal
6936
7444
  */
@@ -6956,66 +7464,60 @@ const LogsNotificationResult = type({
6956
7464
  * Filter for log subscriptions.
6957
7465
  */
6958
7466
 
6959
- /** @internal */
6960
- const COMMON_HTTP_HEADERS = {
6961
- 'solana-client': `js/${"0.0.0-development" }`
6962
- };
7467
+ /**
7468
+ * Callback function for log notifications.
7469
+ */
6963
7470
 
6964
7471
  /**
6965
- * A connection to a fullnode JSON RPC endpoint
7472
+ * Signature result
6966
7473
  */
6967
- class Connection {
6968
- /** @internal */
6969
- /** @internal */
6970
- /** @internal */
6971
- /** @internal */
6972
- /** @internal */
6973
- /** @internal */
6974
- /** @internal */
6975
- /** @internal */
6976
- /** @internal */
6977
- /** @internal */
6978
7474
 
6979
- /** @internal */
7475
+ /**
7476
+ * Transaction error
7477
+ */
6980
7478
 
6981
- /** @internal
6982
- * A number that we increment every time an active connection closes.
6983
- * Used to determine whether the same socket connection that was open
6984
- * when an async operation started is the same one that's active when
6985
- * its continuation fires.
6986
- *
6987
- */
7479
+ /**
7480
+ * Transaction confirmation status
7481
+ * <pre>
7482
+ * 'processed': Transaction landed in a block which has reached 1 confirmation by the connected node
7483
+ * 'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster
7484
+ * 'finalized': Transaction landed in a block which has been finalized by the cluster
7485
+ * </pre>
7486
+ */
6988
7487
 
6989
- /** @internal */
6990
- /** @internal */
6991
- /** @internal */
7488
+ /**
7489
+ * Signature status
7490
+ */
6992
7491
 
6993
- /** @internal */
6994
- /** @internal */
7492
+ /**
7493
+ * A confirmed signature with its status
7494
+ */
6995
7495
 
6996
- /** @internal */
7496
+ /**
7497
+ * An object defining headers to be passed to the RPC server
7498
+ */
6997
7499
 
6998
- /** @internal */
7500
+ /**
7501
+ * The type of the JavaScript `fetch()` API
7502
+ */
6999
7503
 
7000
- /** @internal */
7504
+ /**
7505
+ * A callback used to augment the outgoing HTTP request
7506
+ */
7001
7507
 
7002
- /** @internal */
7508
+ /**
7509
+ * Configuration for instantiating a Connection
7510
+ */
7003
7511
 
7004
- /**
7005
- * Special case.
7006
- * After a signature is processed, RPCs automatically dispose of the
7007
- * subscription on the server side. We need to track which of these
7008
- * subscriptions have been disposed in such a way, so that we know
7009
- * whether the client is dealing with a not-yet-processed signature
7010
- * (in which case we must tear down the server subscription) or an
7011
- * already-processed signature (in which case the client can simply
7012
- * clear out the subscription locally without telling the server).
7013
- *
7014
- * NOTE: There is a proposal to eliminate this special case, here:
7015
- * https://github.com/solana-labs/solana/issues/18892
7016
- */
7017
- /** @internal */
7512
+ /** @internal */
7513
+ const COMMON_HTTP_HEADERS = {
7514
+ 'solana-client': `js/${"0.0.0-development" }`
7515
+ };
7018
7516
 
7517
+ /**
7518
+ * A connection to a fullnode JSON RPC endpoint
7519
+ */
7520
+ class Connection {
7019
7521
  /**
7020
7522
  * Establish a JSON RPC connection
7021
7523
  *
@@ -7023,33 +7525,77 @@ class Connection {
7023
7525
  * @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object
7024
7526
  */
7025
7527
  constructor(endpoint, _commitmentOrConfig) {
7528
+ /** @internal */
7026
7529
  this._commitment = void 0;
7530
+ /** @internal */
7027
7531
  this._confirmTransactionInitialTimeout = void 0;
7532
+ /** @internal */
7028
7533
  this._rpcEndpoint = void 0;
7534
+ /** @internal */
7029
7535
  this._rpcWsEndpoint = void 0;
7536
+ /** @internal */
7030
7537
  this._rpcClient = void 0;
7538
+ /** @internal */
7031
7539
  this._rpcRequest = void 0;
7540
+ /** @internal */
7032
7541
  this._rpcBatchRequest = void 0;
7542
+ /** @internal */
7033
7543
  this._rpcWebSocket = void 0;
7544
+ /** @internal */
7034
7545
  this._rpcWebSocketConnected = false;
7546
+ /** @internal */
7035
7547
  this._rpcWebSocketHeartbeat = null;
7548
+ /** @internal */
7036
7549
  this._rpcWebSocketIdleTimeout = null;
7550
+ /** @internal
7551
+ * A number that we increment every time an active connection closes.
7552
+ * Used to determine whether the same socket connection that was open
7553
+ * when an async operation started is the same one that's active when
7554
+ * its continuation fires.
7555
+ *
7556
+ */
7037
7557
  this._rpcWebSocketGeneration = 0;
7558
+ /** @internal */
7038
7559
  this._disableBlockhashCaching = false;
7560
+ /** @internal */
7039
7561
  this._pollingBlockhash = false;
7562
+ /** @internal */
7040
7563
  this._blockhashInfo = {
7041
7564
  latestBlockhash: null,
7042
7565
  lastFetch: 0,
7043
7566
  transactionSignatures: [],
7044
7567
  simulatedSignatures: []
7045
7568
  };
7569
+ /** @internal */
7046
7570
  this._nextClientSubscriptionId = 0;
7571
+ /** @internal */
7047
7572
  this._subscriptionDisposeFunctionsByClientSubscriptionId = {};
7573
+ /** @internal */
7048
7574
  this._subscriptionHashByClientSubscriptionId = {};
7575
+ /** @internal */
7049
7576
  this._subscriptionStateChangeCallbacksByHash = {};
7577
+ /** @internal */
7050
7578
  this._subscriptionCallbacksByServerSubscriptionId = {};
7579
+ /** @internal */
7051
7580
  this._subscriptionsByHash = {};
7581
+ /**
7582
+ * Special case.
7583
+ * After a signature is processed, RPCs automatically dispose of the
7584
+ * subscription on the server side. We need to track which of these
7585
+ * subscriptions have been disposed in such a way, so that we know
7586
+ * whether the client is dealing with a not-yet-processed signature
7587
+ * (in which case we must tear down the server subscription) or an
7588
+ * already-processed signature (in which case the client can simply
7589
+ * clear out the subscription locally without telling the server).
7590
+ *
7591
+ * NOTE: There is a proposal to eliminate this special case, here:
7592
+ * https://github.com/solana-labs/solana/issues/18892
7593
+ */
7594
+ /** @internal */
7052
7595
  this._subscriptionsAutoDisposedByRpc = new Set();
7596
+ /*
7597
+ * Returns the current block height of the node
7598
+ */
7053
7599
  this.getBlockHeight = (() => {
7054
7600
  const requestPromises = {};
7055
7601
  return async commitmentOrConfig => {
@@ -7445,6 +7991,8 @@ class Connection {
7445
7991
  * @return {Promise<Array<{pubkey: PublicKey, account: AccountInfo<Buffer>}>>}
7446
7992
  */
7447
7993
 
7994
+ // eslint-disable-next-line no-dupe-class-members
7995
+
7448
7996
  // eslint-disable-next-line no-dupe-class-members
7449
7997
  async getProgramAccounts(programId, configOrCommitment) {
7450
7998
  const {
@@ -7483,6 +8031,8 @@ class Connection {
7483
8031
  }
7484
8032
  return res.result;
7485
8033
  }
8034
+
8035
+ /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */ // eslint-disable-next-line no-dupe-class-members
7486
8036
  // eslint-disable-next-line no-dupe-class-members
7487
8037
  async confirmTransaction(strategy, commitment) {
7488
8038
  let rawSignature;
@@ -8226,6 +8776,23 @@ class Connection {
8226
8776
  return res.result;
8227
8777
  }
8228
8778
 
8779
+ /**
8780
+ * Returns whether a blockhash is still valid or not
8781
+ */
8782
+ async isBlockhashValid(blockhash, rawConfig) {
8783
+ const {
8784
+ commitment,
8785
+ config
8786
+ } = extractCommitmentFromConfig(rawConfig);
8787
+ const args = this._buildArgs([blockhash], commitment, undefined /* encoding */, config);
8788
+ const unsafeRes = await this._rpcRequest('isBlockhashValid', args);
8789
+ const res = create(unsafeRes, IsBlockhashValidRpcResult);
8790
+ if ('error' in res) {
8791
+ throw new SolanaJSONRPCError(res.error, 'failed to determine if the blockhash `' + blockhash + '`is valid');
8792
+ }
8793
+ return res.result;
8794
+ }
8795
+
8229
8796
  /**
8230
8797
  * Fetch the node version
8231
8798
  */
@@ -8257,10 +8824,24 @@ class Connection {
8257
8824
  * setting the `maxSupportedTransactionVersion` property.
8258
8825
  */
8259
8826
 
8827
+ /**
8828
+ * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by
8829
+ * setting the `maxSupportedTransactionVersion` property.
8830
+ */ // eslint-disable-next-line no-dupe-class-members
8831
+ /**
8832
+ * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by
8833
+ * setting the `maxSupportedTransactionVersion` property.
8834
+ */
8835
+ // eslint-disable-next-line no-dupe-class-members
8260
8836
  /**
8261
8837
  * Fetch a processed block from the cluster.
8262
8838
  */
8263
8839
  // eslint-disable-next-line no-dupe-class-members
8840
+ // eslint-disable-next-line no-dupe-class-members
8841
+ // eslint-disable-next-line no-dupe-class-members
8842
+ /**
8843
+ * Fetch a processed block from the cluster.
8844
+ */ // eslint-disable-next-line no-dupe-class-members
8264
8845
  async getBlock(slot, rawConfig) {
8265
8846
  const {
8266
8847
  commitment,
@@ -8321,6 +8902,10 @@ class Connection {
8321
8902
  * Fetch parsed transaction details for a confirmed or finalized block
8322
8903
  */
8323
8904
 
8905
+ // eslint-disable-next-line no-dupe-class-members
8906
+
8907
+ // eslint-disable-next-line no-dupe-class-members
8908
+
8324
8909
  // eslint-disable-next-line no-dupe-class-members
8325
8910
  async getParsedBlock(slot, rawConfig) {
8326
8911
  const {
@@ -8360,11 +8945,6 @@ class Connection {
8360
8945
  throw new SolanaJSONRPCError(e, 'failed to get block');
8361
8946
  }
8362
8947
  }
8363
-
8364
- /*
8365
- * Returns the current block height of the node
8366
- */
8367
-
8368
8948
  /*
8369
8949
  * Returns recent block production information from the current or previous epoch
8370
8950
  */
@@ -8400,8 +8980,10 @@ class Connection {
8400
8980
 
8401
8981
  /**
8402
8982
  * Fetch a confirmed or finalized transaction from the cluster.
8403
- */
8404
- // eslint-disable-next-line no-dupe-class-members
8983
+ */ // eslint-disable-next-line no-dupe-class-members
8984
+ /**
8985
+ * Fetch a confirmed or finalized transaction from the cluster.
8986
+ */ // eslint-disable-next-line no-dupe-class-members
8405
8987
  async getTransaction(signature, rawConfig) {
8406
8988
  const {
8407
8989
  commitment,
@@ -8480,8 +9062,12 @@ class Connection {
8480
9062
  * Fetch transaction details for a batch of confirmed transactions.
8481
9063
  * Similar to {@link getParsedTransactions} but returns a {@link
8482
9064
  * VersionedTransactionResponse}.
8483
- */
8484
- // eslint-disable-next-line no-dupe-class-members
9065
+ */ // eslint-disable-next-line no-dupe-class-members
9066
+ /**
9067
+ * Fetch transaction details for a batch of confirmed transactions.
9068
+ * Similar to {@link getParsedTransactions} but returns a {@link
9069
+ * VersionedTransactionResponse}.
9070
+ */ // eslint-disable-next-line no-dupe-class-members
8485
9071
  async getTransactions(signatures, commitmentOrConfig) {
8486
9072
  const {
8487
9073
  commitment,
@@ -8907,8 +9493,10 @@ class Connection {
8907
9493
 
8908
9494
  /**
8909
9495
  * Simulate a transaction
8910
- */
8911
- // eslint-disable-next-line no-dupe-class-members
9496
+ */ // eslint-disable-next-line no-dupe-class-members
9497
+ /**
9498
+ * Simulate a transaction
9499
+ */ // eslint-disable-next-line no-dupe-class-members
8912
9500
  async simulateTransaction(transactionOrMessage, configOrSigners, includeAccounts) {
8913
9501
  if ('message' in transactionOrMessage) {
8914
9502
  const versionedTx = transactionOrMessage;
@@ -9019,10 +9607,12 @@ class Connection {
9019
9607
  * VersionedTransaction}
9020
9608
  */
9021
9609
 
9610
+ /**
9611
+ * Send a signed transaction
9612
+ */ // eslint-disable-next-line no-dupe-class-members
9022
9613
  /**
9023
9614
  * Sign and send a transaction
9024
- */
9025
- // eslint-disable-next-line no-dupe-class-members
9615
+ */ // eslint-disable-next-line no-dupe-class-members
9026
9616
  async sendTransaction(transaction, signersOrOptions, options) {
9027
9617
  if ('version' in transaction) {
9028
9618
  if (signersOrOptions && Array.isArray(signersOrOptions)) {
@@ -9430,7 +10020,7 @@ class Connection {
9430
10020
  */
9431
10021
  args) {
9432
10022
  const clientSubscriptionId = this._nextClientSubscriptionId++;
9433
- const hash = fastStableStringify$1([subscriptionConfig.method, args]);
10023
+ const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);
9434
10024
 
9435
10025
  const existingSubscription = this._subscriptionsByHash[hash];
9436
10026
  if (existingSubscription === undefined) {
@@ -9912,6 +10502,10 @@ class Keypair {
9912
10502
  }
9913
10503
  }
9914
10504
 
10505
+ /**
10506
+ * An enumeration of valid LookupTableInstructionType's
10507
+ */
10508
+
9915
10509
  /**
9916
10510
  * An enumeration of valid address lookup table InstructionType's
9917
10511
  * @internal
@@ -10253,6 +10847,22 @@ class ComputeBudgetInstruction {
10253
10847
  * An enumeration of valid ComputeBudgetInstructionType's
10254
10848
  */
10255
10849
 
10850
+ /**
10851
+ * Request units instruction params
10852
+ */
10853
+
10854
+ /**
10855
+ * Request heap frame instruction params
10856
+ */
10857
+
10858
+ /**
10859
+ * Set compute unit limit instruction params
10860
+ */
10861
+
10862
+ /**
10863
+ * Set compute unit price instruction params
10864
+ */
10865
+
10256
10866
  /**
10257
10867
  * An enumeration of valid ComputeBudget InstructionType's
10258
10868
  * @internal
@@ -10341,6 +10951,10 @@ const SIGNATURE_BYTES = 64;
10341
10951
  * Params for creating an ed25519 instruction using a public key
10342
10952
  */
10343
10953
 
10954
+ /**
10955
+ * Params for creating an ed25519 instruction using a private key
10956
+ */
10957
+
10344
10958
  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')]);
10345
10959
  class Ed25519Program {
10346
10960
  /**
@@ -10438,6 +11052,14 @@ const SIGNATURE_OFFSETS_SERIALIZED_SIZE = 11;
10438
11052
  * Params for creating an secp256k1 instruction using a public key
10439
11053
  */
10440
11054
 
11055
+ /**
11056
+ * Params for creating an secp256k1 instruction using an Ethereum address
11057
+ */
11058
+
11059
+ /**
11060
+ * Params for creating an secp256k1 instruction using a private key
11061
+ */
11062
+
10441
11063
  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')]);
10442
11064
  class Secp256k1Program {
10443
11065
  /**
@@ -10573,17 +11195,15 @@ const STAKE_CONFIG_ID = new PublicKey('StakeConfig111111111111111111111111111111
10573
11195
  * Stake account authority info
10574
11196
  */
10575
11197
  class Authorized {
10576
- /** stake authority */
10577
-
10578
- /** withdraw authority */
10579
-
10580
11198
  /**
10581
11199
  * Create a new Authorized object
10582
11200
  * @param staker the stake authority
10583
11201
  * @param withdrawer the withdraw authority
10584
11202
  */
10585
11203
  constructor(staker, withdrawer) {
11204
+ /** stake authority */
10586
11205
  this.staker = void 0;
11206
+ /** withdraw authority */
10587
11207
  this.withdrawer = void 0;
10588
11208
  this.staker = staker;
10589
11209
  this.withdrawer = withdrawer;
@@ -10593,18 +11213,15 @@ class Authorized {
10593
11213
  * Stake account lockup info
10594
11214
  */
10595
11215
  class Lockup {
10596
- /** Unix timestamp of lockup expiration */
10597
-
10598
- /** Epoch of lockup expiration */
10599
-
10600
- /** Lockup custodian authority */
10601
-
10602
11216
  /**
10603
11217
  * Create a new Lockup object
10604
11218
  */
10605
11219
  constructor(unixTimestamp, epoch, custodian) {
11220
+ /** Unix timestamp of lockup expiration */
10606
11221
  this.unixTimestamp = void 0;
11222
+ /** Epoch of lockup expiration */
10607
11223
  this.epoch = void 0;
11224
+ /** Lockup custodian authority */
10608
11225
  this.custodian = void 0;
10609
11226
  this.unixTimestamp = unixTimestamp;
10610
11227
  this.epoch = epoch;
@@ -10616,6 +11233,39 @@ class Lockup {
10616
11233
  */
10617
11234
  }
10618
11235
  Lockup.default = new Lockup(0, 0, PublicKey.default);
11236
+ /**
11237
+ * Create stake account transaction params
11238
+ */
11239
+ /**
11240
+ * Create stake account with seed transaction params
11241
+ */
11242
+ /**
11243
+ * Initialize stake instruction params
11244
+ */
11245
+ /**
11246
+ * Delegate stake instruction params
11247
+ */
11248
+ /**
11249
+ * Authorize stake instruction params
11250
+ */
11251
+ /**
11252
+ * Authorize stake instruction params using a derived key
11253
+ */
11254
+ /**
11255
+ * Split stake instruction params
11256
+ */
11257
+ /**
11258
+ * Split with seed transaction params
11259
+ */
11260
+ /**
11261
+ * Withdraw stake instruction params
11262
+ */
11263
+ /**
11264
+ * Deactivate stake instruction params
11265
+ */
11266
+ /**
11267
+ * Merge stake instruction params
11268
+ */
10619
11269
  /**
10620
11270
  * Stake Instruction class
10621
11271
  */
@@ -11304,6 +11954,13 @@ class StakeProgram {
11304
11954
  }
11305
11955
  }
11306
11956
  StakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111111');
11957
+ /**
11958
+ * Max space of a Stake account
11959
+ *
11960
+ * This is generated from the solana-stake-program StakeState struct as
11961
+ * `StakeState::size_of()`:
11962
+ * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeState.html
11963
+ */
11307
11964
  StakeProgram.space = 200;
11308
11965
 
11309
11966
  /**
@@ -11328,6 +11985,22 @@ class VoteInit {
11328
11985
  * Create vote account transaction params
11329
11986
  */
11330
11987
 
11988
+ /**
11989
+ * InitializeAccount instruction params
11990
+ */
11991
+
11992
+ /**
11993
+ * Authorize instruction params
11994
+ */
11995
+
11996
+ /**
11997
+ * AuthorizeWithSeed instruction params
11998
+ */
11999
+
12000
+ /**
12001
+ * Withdraw from vote account transaction params
12002
+ */
12003
+
11331
12004
  /**
11332
12005
  * Vote Instruction class
11333
12006
  */
@@ -11459,6 +12132,8 @@ class VoteInstruction {
11459
12132
  * An enumeration of valid VoteInstructionType's
11460
12133
  */
11461
12134
 
12135
+ /** @internal */
12136
+
11462
12137
  const VOTE_INSTRUCTION_LAYOUTS = Object.freeze({
11463
12138
  InitializeAccount: {
11464
12139
  index: 0,
@@ -11695,6 +12370,15 @@ class VoteProgram {
11695
12370
  }
11696
12371
  }
11697
12372
  VoteProgram.programId = new PublicKey('Vote111111111111111111111111111111111111111');
12373
+ /**
12374
+ * Max space of a Vote account
12375
+ *
12376
+ * This is generated from the solana-vote-program VoteState struct as
12377
+ * `VoteState::size_of()`:
12378
+ * https://docs.rs/solana-vote-program/1.9.5/solana_vote_program/vote_state/struct.VoteState.html#method.size_of
12379
+ *
12380
+ * 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
12381
+ */
11698
12382
  VoteProgram.space = 3731;
11699
12383
 
11700
12384
  const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo111111111111111111111111111111');
@@ -11703,6 +12387,10 @@ const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo1111111111111111111111111
11703
12387
  * @internal
11704
12388
  */
11705
12389
 
12390
+ /**
12391
+ * Info used to identity validators.
12392
+ */
12393
+
11706
12394
  const InfoString = type({
11707
12395
  name: string(),
11708
12396
  website: optional(string()),
@@ -11714,14 +12402,6 @@ const InfoString = type({
11714
12402
  * ValidatorInfo class
11715
12403
  */
11716
12404
  class ValidatorInfo {
11717
- /**
11718
- * validator public key
11719
- */
11720
-
11721
- /**
11722
- * validator information
11723
- */
11724
-
11725
12405
  /**
11726
12406
  * Construct a valid ValidatorInfo
11727
12407
  *
@@ -11729,7 +12409,13 @@ class ValidatorInfo {
11729
12409
  * @param info validator information
11730
12410
  */
11731
12411
  constructor(key, info) {
12412
+ /**
12413
+ * validator public key
12414
+ */
11732
12415
  this.key = void 0;
12416
+ /**
12417
+ * validator information
12418
+ */
11733
12419
  this.info = void 0;
11734
12420
  this.key = key;
11735
12421
  this.info = info;
@@ -11770,6 +12456,11 @@ class ValidatorInfo {
11770
12456
  }
11771
12457
 
11772
12458
  const VOTE_PROGRAM_ID = new PublicKey('Vote111111111111111111111111111111111111111');
12459
+
12460
+ /**
12461
+ * History of how many credits earned by the end of each epoch
12462
+ */
12463
+
11773
12464
  /**
11774
12465
  * See https://github.com/solana-labs/solana/blob/8a12ed029cfa38d4a45400916c2463fb82bbec8c/programs/vote_api/src/vote_state.rs#L68-L88
11775
12466
  *
@@ -11909,9 +12600,7 @@ function clusterApiUrl(cluster, tls) {
11909
12600
  /**
11910
12601
  * @deprecated Calling `sendAndConfirmRawTransaction()` without a `confirmationStrategy`
11911
12602
  * is no longer supported and will be removed in a future version.
11912
- */
11913
- // eslint-disable-next-line no-redeclare
11914
-
12603
+ */ // eslint-disable-next-line no-redeclare
11915
12604
  // eslint-disable-next-line no-redeclare
11916
12605
  async function sendAndConfirmRawTransaction(connection, rawTransaction, confirmationStrategyOrConfirmOptions, maybeConfirmOptions) {
11917
12606
  let confirmationStrategy;