@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.browser.cjs.js +879 -165
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +870 -157
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +911 -221
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +13 -0
- package/lib/index.esm.js +902 -213
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +1258 -486
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +3 -3
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +879 -165
- package/lib/index.native.js.map +1 -1
- package/package.json +12 -11
- package/src/connection.ts +40 -0
package/lib/index.browser.cjs.js
CHANGED
|
@@ -48,6 +48,10 @@ var createRpc__default = /*#__PURE__*/_interopDefaultCompat(createRpc);
|
|
|
48
48
|
* Read more: https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Ed25519 Keypair
|
|
53
|
+
*/
|
|
54
|
+
|
|
51
55
|
const generatePrivateKey = ed25519.ed25519.utils.randomPrivateKey;
|
|
52
56
|
const generateKeypair = () => {
|
|
53
57
|
const privateScalar = ed25519.ed25519.utils.randomPrivateKey();
|
|
@@ -130,6 +134,10 @@ const PUBLIC_KEY_LENGTH = 32;
|
|
|
130
134
|
* Value to be converted into public key
|
|
131
135
|
*/
|
|
132
136
|
|
|
137
|
+
/**
|
|
138
|
+
* JSON object representation of PublicKey class
|
|
139
|
+
*/
|
|
140
|
+
|
|
133
141
|
function isPublicKeyData(value) {
|
|
134
142
|
return value._bn !== undefined;
|
|
135
143
|
}
|
|
@@ -142,14 +150,13 @@ let uniquePublicKeyCounter = 1;
|
|
|
142
150
|
*/
|
|
143
151
|
_Symbol$toStringTag = Symbol.toStringTag;
|
|
144
152
|
class PublicKey extends Struct {
|
|
145
|
-
/** @internal */
|
|
146
|
-
|
|
147
153
|
/**
|
|
148
154
|
* Create a new PublicKey object
|
|
149
155
|
* @param value ed25519 public key as buffer or base-58 encoded string
|
|
150
156
|
*/
|
|
151
157
|
constructor(value) {
|
|
152
158
|
super({});
|
|
159
|
+
/** @internal */
|
|
153
160
|
this._bn = void 0;
|
|
154
161
|
if (isPublicKeyData(value)) {
|
|
155
162
|
this._bn = value._bn;
|
|
@@ -331,10 +338,6 @@ SOLANA_SCHEMA.set(PublicKey, {
|
|
|
331
338
|
* @deprecated since v1.10.0, please use {@link Keypair} instead.
|
|
332
339
|
*/
|
|
333
340
|
class Account {
|
|
334
|
-
/** @internal */
|
|
335
|
-
|
|
336
|
-
/** @internal */
|
|
337
|
-
|
|
338
341
|
/**
|
|
339
342
|
* Create a new Account object
|
|
340
343
|
*
|
|
@@ -344,7 +347,9 @@ class Account {
|
|
|
344
347
|
* @param secretKey Secret key for the account
|
|
345
348
|
*/
|
|
346
349
|
constructor(secretKey) {
|
|
350
|
+
/** @internal */
|
|
347
351
|
this._publicKey = void 0;
|
|
352
|
+
/** @internal */
|
|
348
353
|
this._secretKey = void 0;
|
|
349
354
|
if (secretKey) {
|
|
350
355
|
const secretKeyBuffer = toBuffer(secretKey);
|
|
@@ -701,6 +706,10 @@ class CompiledKeys {
|
|
|
701
706
|
* @property {string} data
|
|
702
707
|
*/
|
|
703
708
|
|
|
709
|
+
/**
|
|
710
|
+
* Message constructor arguments
|
|
711
|
+
*/
|
|
712
|
+
|
|
704
713
|
/**
|
|
705
714
|
* List of instructions to be processed atomically
|
|
706
715
|
*/
|
|
@@ -1145,17 +1154,17 @@ const VersionedMessage = {
|
|
|
1145
1154
|
* Transaction signature as base-58 encoded string
|
|
1146
1155
|
*/
|
|
1147
1156
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
/**
|
|
1151
|
-
* Default (empty) signature
|
|
1152
|
-
*/
|
|
1153
|
-
(function (TransactionStatus) {
|
|
1157
|
+
let TransactionStatus = /*#__PURE__*/function (TransactionStatus) {
|
|
1154
1158
|
TransactionStatus[TransactionStatus["BLOCKHEIGHT_EXCEEDED"] = 0] = "BLOCKHEIGHT_EXCEEDED";
|
|
1155
1159
|
TransactionStatus[TransactionStatus["PROCESSED"] = 1] = "PROCESSED";
|
|
1156
1160
|
TransactionStatus[TransactionStatus["TIMED_OUT"] = 2] = "TIMED_OUT";
|
|
1157
1161
|
TransactionStatus[TransactionStatus["NONCE_INVALID"] = 3] = "NONCE_INVALID";
|
|
1158
|
-
|
|
1162
|
+
return TransactionStatus;
|
|
1163
|
+
}({});
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Default (empty) signature
|
|
1167
|
+
*/
|
|
1159
1168
|
const DEFAULT_SIGNATURE = buffer.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);
|
|
1160
1169
|
|
|
1161
1170
|
/**
|
|
@@ -1163,25 +1172,34 @@ const DEFAULT_SIGNATURE = buffer.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0)
|
|
|
1163
1172
|
*/
|
|
1164
1173
|
|
|
1165
1174
|
/**
|
|
1166
|
-
*
|
|
1175
|
+
* List of TransactionInstruction object fields that may be initialized at construction
|
|
1167
1176
|
*/
|
|
1168
|
-
class TransactionInstruction {
|
|
1169
|
-
/**
|
|
1170
|
-
* Public keys to include in this transaction
|
|
1171
|
-
* Boolean represents whether this pubkey needs to sign the transaction
|
|
1172
|
-
*/
|
|
1173
1177
|
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1178
|
+
/**
|
|
1179
|
+
* Configuration object for Transaction.serialize()
|
|
1180
|
+
*/
|
|
1177
1181
|
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1182
|
+
/**
|
|
1183
|
+
* @internal
|
|
1184
|
+
*/
|
|
1181
1185
|
|
|
1186
|
+
/**
|
|
1187
|
+
* Transaction Instruction class
|
|
1188
|
+
*/
|
|
1189
|
+
class TransactionInstruction {
|
|
1182
1190
|
constructor(opts) {
|
|
1191
|
+
/**
|
|
1192
|
+
* Public keys to include in this transaction
|
|
1193
|
+
* Boolean represents whether this pubkey needs to sign the transaction
|
|
1194
|
+
*/
|
|
1183
1195
|
this.keys = void 0;
|
|
1196
|
+
/**
|
|
1197
|
+
* Program Id to execute
|
|
1198
|
+
*/
|
|
1184
1199
|
this.programId = void 0;
|
|
1200
|
+
/**
|
|
1201
|
+
* Program input
|
|
1202
|
+
*/
|
|
1185
1203
|
this.data = buffer.Buffer.alloc(0);
|
|
1186
1204
|
this.programId = opts.programId;
|
|
1187
1205
|
this.keys = opts.keys;
|
|
@@ -1214,15 +1232,31 @@ class TransactionInstruction {
|
|
|
1214
1232
|
* Pair of signature and corresponding public key
|
|
1215
1233
|
*/
|
|
1216
1234
|
|
|
1235
|
+
/**
|
|
1236
|
+
* List of Transaction object fields that may be initialized at construction
|
|
1237
|
+
*/
|
|
1238
|
+
|
|
1239
|
+
// For backward compatibility; an unfortunate consequence of being
|
|
1240
|
+
// forced to over-export types by the documentation generator.
|
|
1241
|
+
// See https://github.com/solana-labs/solana/pull/25820
|
|
1242
|
+
/**
|
|
1243
|
+
* Blockhash-based transactions have a lifetime that are defined by
|
|
1244
|
+
* the blockhash they include. Any transaction whose blockhash is
|
|
1245
|
+
* too old will be rejected.
|
|
1246
|
+
*/
|
|
1247
|
+
/**
|
|
1248
|
+
* Use these options to construct a durable nonce transaction.
|
|
1249
|
+
*/
|
|
1250
|
+
/**
|
|
1251
|
+
* Nonce information to be used to build an offline Transaction.
|
|
1252
|
+
*/
|
|
1253
|
+
/**
|
|
1254
|
+
* @internal
|
|
1255
|
+
*/
|
|
1217
1256
|
/**
|
|
1218
1257
|
* Transaction class
|
|
1219
1258
|
*/
|
|
1220
1259
|
class Transaction {
|
|
1221
|
-
/**
|
|
1222
|
-
* Signatures for the transaction. Typically created by invoking the
|
|
1223
|
-
* `sign()` method
|
|
1224
|
-
*/
|
|
1225
|
-
|
|
1226
1260
|
/**
|
|
1227
1261
|
* The first (payer) Transaction signature
|
|
1228
1262
|
*/
|
|
@@ -1237,18 +1271,57 @@ class Transaction {
|
|
|
1237
1271
|
* The transaction fee payer
|
|
1238
1272
|
*/
|
|
1239
1273
|
|
|
1274
|
+
// Construct a transaction with a blockhash and lastValidBlockHeight
|
|
1275
|
+
|
|
1276
|
+
// Construct a transaction using a durable nonce
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* @deprecated `TransactionCtorFields` has been deprecated and will be removed in a future version.
|
|
1280
|
+
* Please supply a `TransactionBlockhashCtor` instead.
|
|
1281
|
+
*/
|
|
1282
|
+
|
|
1240
1283
|
/**
|
|
1241
1284
|
* Construct an empty Transaction
|
|
1242
1285
|
*/
|
|
1243
1286
|
constructor(opts) {
|
|
1287
|
+
/**
|
|
1288
|
+
* Signatures for the transaction. Typically created by invoking the
|
|
1289
|
+
* `sign()` method
|
|
1290
|
+
*/
|
|
1244
1291
|
this.signatures = [];
|
|
1245
1292
|
this.feePayer = void 0;
|
|
1293
|
+
/**
|
|
1294
|
+
* The instructions to atomically execute
|
|
1295
|
+
*/
|
|
1246
1296
|
this.instructions = [];
|
|
1297
|
+
/**
|
|
1298
|
+
* A recent transaction id. Must be populated by the caller
|
|
1299
|
+
*/
|
|
1247
1300
|
this.recentBlockhash = void 0;
|
|
1301
|
+
/**
|
|
1302
|
+
* the last block chain can advance to before tx is declared expired
|
|
1303
|
+
* */
|
|
1248
1304
|
this.lastValidBlockHeight = void 0;
|
|
1305
|
+
/**
|
|
1306
|
+
* Optional Nonce information. If populated, transaction will use a durable
|
|
1307
|
+
* Nonce hash instead of a recentBlockhash. Must be populated by the caller
|
|
1308
|
+
*/
|
|
1249
1309
|
this.nonceInfo = void 0;
|
|
1310
|
+
/**
|
|
1311
|
+
* If this is a nonce transaction this represents the minimum slot from which
|
|
1312
|
+
* to evaluate if the nonce has advanced when attempting to confirm the
|
|
1313
|
+
* transaction. This protects against a case where the transaction confirmation
|
|
1314
|
+
* logic loads the nonce account from an old slot and assumes the mismatch in
|
|
1315
|
+
* nonce value implies that the nonce has been advanced.
|
|
1316
|
+
*/
|
|
1250
1317
|
this.minNonceContextSlot = void 0;
|
|
1318
|
+
/**
|
|
1319
|
+
* @internal
|
|
1320
|
+
*/
|
|
1251
1321
|
this._message = void 0;
|
|
1322
|
+
/**
|
|
1323
|
+
* @internal
|
|
1324
|
+
*/
|
|
1252
1325
|
this._json = void 0;
|
|
1253
1326
|
if (!opts) {
|
|
1254
1327
|
return;
|
|
@@ -2063,6 +2136,10 @@ function sleep(ms) {
|
|
|
2063
2136
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
2064
2137
|
}
|
|
2065
2138
|
|
|
2139
|
+
/**
|
|
2140
|
+
* @internal
|
|
2141
|
+
*/
|
|
2142
|
+
|
|
2066
2143
|
/**
|
|
2067
2144
|
* Populate a buffer of instruction data using an InstructionType
|
|
2068
2145
|
* @internal
|
|
@@ -2182,6 +2259,62 @@ const u64 = bigInt(8);
|
|
|
2182
2259
|
* Create account system transaction params
|
|
2183
2260
|
*/
|
|
2184
2261
|
|
|
2262
|
+
/**
|
|
2263
|
+
* Transfer system transaction params
|
|
2264
|
+
*/
|
|
2265
|
+
|
|
2266
|
+
/**
|
|
2267
|
+
* Assign system transaction params
|
|
2268
|
+
*/
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* Create account with seed system transaction params
|
|
2272
|
+
*/
|
|
2273
|
+
|
|
2274
|
+
/**
|
|
2275
|
+
* Create nonce account system transaction params
|
|
2276
|
+
*/
|
|
2277
|
+
|
|
2278
|
+
/**
|
|
2279
|
+
* Create nonce account with seed system transaction params
|
|
2280
|
+
*/
|
|
2281
|
+
|
|
2282
|
+
/**
|
|
2283
|
+
* Initialize nonce account system instruction params
|
|
2284
|
+
*/
|
|
2285
|
+
|
|
2286
|
+
/**
|
|
2287
|
+
* Advance nonce account system instruction params
|
|
2288
|
+
*/
|
|
2289
|
+
|
|
2290
|
+
/**
|
|
2291
|
+
* Withdraw nonce account system transaction params
|
|
2292
|
+
*/
|
|
2293
|
+
|
|
2294
|
+
/**
|
|
2295
|
+
* Authorize nonce account system transaction params
|
|
2296
|
+
*/
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* Allocate account system transaction params
|
|
2300
|
+
*/
|
|
2301
|
+
|
|
2302
|
+
/**
|
|
2303
|
+
* Allocate account with seed system transaction params
|
|
2304
|
+
*/
|
|
2305
|
+
|
|
2306
|
+
/**
|
|
2307
|
+
* Assign account with seed system transaction params
|
|
2308
|
+
*/
|
|
2309
|
+
|
|
2310
|
+
/**
|
|
2311
|
+
* Transfer with seed system transaction params
|
|
2312
|
+
*/
|
|
2313
|
+
|
|
2314
|
+
/** Decoded transfer system transaction instruction */
|
|
2315
|
+
|
|
2316
|
+
/** Decoded transferWithSeed system transaction instruction */
|
|
2317
|
+
|
|
2185
2318
|
/**
|
|
2186
2319
|
* System Instruction class
|
|
2187
2320
|
*/
|
|
@@ -3081,6 +3214,10 @@ class BpfLoader {
|
|
|
3081
3214
|
}
|
|
3082
3215
|
}
|
|
3083
3216
|
|
|
3217
|
+
function getDefaultExportFromCjs (x) {
|
|
3218
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3219
|
+
}
|
|
3220
|
+
|
|
3084
3221
|
var objToString = Object.prototype.toString;
|
|
3085
3222
|
var objKeys = Object.keys || function(obj) {
|
|
3086
3223
|
var keys = [];
|
|
@@ -3155,7 +3292,7 @@ var fastStableStringify = function(val) {
|
|
|
3155
3292
|
}
|
|
3156
3293
|
};
|
|
3157
3294
|
|
|
3158
|
-
var fastStableStringify$1 = fastStableStringify;
|
|
3295
|
+
var fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);
|
|
3159
3296
|
|
|
3160
3297
|
const MINIMUM_SLOT_PER_EPOCH = 32;
|
|
3161
3298
|
|
|
@@ -3188,21 +3325,16 @@ function nextPowerOfTwo(n) {
|
|
|
3188
3325
|
* Can be retrieved with the {@link Connection.getEpochSchedule} method
|
|
3189
3326
|
*/
|
|
3190
3327
|
class EpochSchedule {
|
|
3191
|
-
/** The maximum number of slots in each epoch */
|
|
3192
|
-
|
|
3193
|
-
/** The number of slots before beginning of an epoch to calculate a leader schedule for that epoch */
|
|
3194
|
-
|
|
3195
|
-
/** Indicates whether epochs start short and grow */
|
|
3196
|
-
|
|
3197
|
-
/** The first epoch with `slotsPerEpoch` slots */
|
|
3198
|
-
|
|
3199
|
-
/** The first slot of `firstNormalEpoch` */
|
|
3200
|
-
|
|
3201
3328
|
constructor(slotsPerEpoch, leaderScheduleSlotOffset, warmup, firstNormalEpoch, firstNormalSlot) {
|
|
3329
|
+
/** The maximum number of slots in each epoch */
|
|
3202
3330
|
this.slotsPerEpoch = void 0;
|
|
3331
|
+
/** The number of slots before beginning of an epoch to calculate a leader schedule for that epoch */
|
|
3203
3332
|
this.leaderScheduleSlotOffset = void 0;
|
|
3333
|
+
/** Indicates whether epochs start short and grow */
|
|
3204
3334
|
this.warmup = void 0;
|
|
3335
|
+
/** The first epoch with `slotsPerEpoch` slots */
|
|
3205
3336
|
this.firstNormalEpoch = void 0;
|
|
3337
|
+
/** The first slot of `firstNormalEpoch` */
|
|
3206
3338
|
this.firstNormalSlot = void 0;
|
|
3207
3339
|
this.slotsPerEpoch = slotsPerEpoch;
|
|
3208
3340
|
this.leaderScheduleSlotOffset = leaderScheduleSlotOffset;
|
|
@@ -3425,6 +3557,92 @@ const BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1000;
|
|
|
3425
3557
|
* https://gist.github.com/steveluscher/c057eca81d479ef705cdb53162f9971d
|
|
3426
3558
|
*/
|
|
3427
3559
|
|
|
3560
|
+
/** @internal */
|
|
3561
|
+
/** @internal */
|
|
3562
|
+
/** @internal */
|
|
3563
|
+
/** @internal */
|
|
3564
|
+
|
|
3565
|
+
/** @internal */
|
|
3566
|
+
/**
|
|
3567
|
+
* @internal
|
|
3568
|
+
* Every subscription contains the args used to open the subscription with
|
|
3569
|
+
* the server, and a list of callers interested in notifications.
|
|
3570
|
+
*/
|
|
3571
|
+
|
|
3572
|
+
/**
|
|
3573
|
+
* @internal
|
|
3574
|
+
* A subscription may be in various states of connectedness. Only when it is
|
|
3575
|
+
* fully connected will it have a server subscription id associated with it.
|
|
3576
|
+
* This id can be returned to the server to unsubscribe the client entirely.
|
|
3577
|
+
*/
|
|
3578
|
+
|
|
3579
|
+
/**
|
|
3580
|
+
* A type that encapsulates a subscription's RPC method
|
|
3581
|
+
* names and notification (callback) signature.
|
|
3582
|
+
*/
|
|
3583
|
+
|
|
3584
|
+
/**
|
|
3585
|
+
* @internal
|
|
3586
|
+
* Utility type that keeps tagged unions intact while omitting properties.
|
|
3587
|
+
*/
|
|
3588
|
+
|
|
3589
|
+
/**
|
|
3590
|
+
* @internal
|
|
3591
|
+
* This type represents a single subscribable 'topic.' It's made up of:
|
|
3592
|
+
*
|
|
3593
|
+
* - The args used to open the subscription with the server,
|
|
3594
|
+
* - The state of the subscription, in terms of its connectedness, and
|
|
3595
|
+
* - The set of callbacks to call when the server publishes notifications
|
|
3596
|
+
*
|
|
3597
|
+
* This record gets indexed by `SubscriptionConfigHash` and is used to
|
|
3598
|
+
* set up subscriptions, fan out notifications, and track subscription state.
|
|
3599
|
+
*/
|
|
3600
|
+
|
|
3601
|
+
/**
|
|
3602
|
+
* @internal
|
|
3603
|
+
*/
|
|
3604
|
+
|
|
3605
|
+
/**
|
|
3606
|
+
* Extra contextual information for RPC responses
|
|
3607
|
+
*/
|
|
3608
|
+
|
|
3609
|
+
/**
|
|
3610
|
+
* Options for sending transactions
|
|
3611
|
+
*/
|
|
3612
|
+
|
|
3613
|
+
/**
|
|
3614
|
+
* Options for confirming transactions
|
|
3615
|
+
*/
|
|
3616
|
+
|
|
3617
|
+
/**
|
|
3618
|
+
* Options for getConfirmedSignaturesForAddress2
|
|
3619
|
+
*/
|
|
3620
|
+
|
|
3621
|
+
/**
|
|
3622
|
+
* Options for getSignaturesForAddress
|
|
3623
|
+
*/
|
|
3624
|
+
|
|
3625
|
+
/**
|
|
3626
|
+
* RPC Response with extra contextual information
|
|
3627
|
+
*/
|
|
3628
|
+
|
|
3629
|
+
/**
|
|
3630
|
+
* A strategy for confirming transactions that uses the last valid
|
|
3631
|
+
* block height for a given blockhash to check for transaction expiration.
|
|
3632
|
+
*/
|
|
3633
|
+
|
|
3634
|
+
/**
|
|
3635
|
+
* A strategy for confirming durable nonce transactions.
|
|
3636
|
+
*/
|
|
3637
|
+
|
|
3638
|
+
/**
|
|
3639
|
+
* Properties shared by all transaction confirmation strategies
|
|
3640
|
+
*/
|
|
3641
|
+
|
|
3642
|
+
/**
|
|
3643
|
+
* This type represents all transaction confirmation strategies
|
|
3644
|
+
*/
|
|
3645
|
+
|
|
3428
3646
|
/* @internal */
|
|
3429
3647
|
function assertEndpointUrl(putativeUrl) {
|
|
3430
3648
|
if (/^https?:/.test(putativeUrl) === false) {
|
|
@@ -3543,6 +3761,85 @@ function versionedMessageFromResponse(version, response) {
|
|
|
3543
3761
|
* </pre>
|
|
3544
3762
|
*/
|
|
3545
3763
|
|
|
3764
|
+
// Deprecated as of v1.5.5
|
|
3765
|
+
/**
|
|
3766
|
+
* A subset of Commitment levels, which are at least optimistically confirmed
|
|
3767
|
+
* <pre>
|
|
3768
|
+
* 'confirmed': Query the most recent block which has reached 1 confirmation by the cluster
|
|
3769
|
+
* 'finalized': Query the most recent block which has been finalized by the cluster
|
|
3770
|
+
* </pre>
|
|
3771
|
+
*/
|
|
3772
|
+
/**
|
|
3773
|
+
* Filter for largest accounts query
|
|
3774
|
+
* <pre>
|
|
3775
|
+
* 'circulating': Return the largest accounts that are part of the circulating supply
|
|
3776
|
+
* 'nonCirculating': Return the largest accounts that are not part of the circulating supply
|
|
3777
|
+
* </pre>
|
|
3778
|
+
*/
|
|
3779
|
+
/**
|
|
3780
|
+
* Configuration object for changing `getAccountInfo` query behavior
|
|
3781
|
+
*/
|
|
3782
|
+
/**
|
|
3783
|
+
* Configuration object for changing `getBalance` query behavior
|
|
3784
|
+
*/
|
|
3785
|
+
/**
|
|
3786
|
+
* Configuration object for changing `getBlock` query behavior
|
|
3787
|
+
*/
|
|
3788
|
+
/**
|
|
3789
|
+
* Configuration object for changing `getBlock` query behavior
|
|
3790
|
+
*/
|
|
3791
|
+
/**
|
|
3792
|
+
* Configuration object for changing `getStakeMinimumDelegation` query behavior
|
|
3793
|
+
*/
|
|
3794
|
+
/**
|
|
3795
|
+
* Configuration object for changing `getBlockHeight` query behavior
|
|
3796
|
+
*/
|
|
3797
|
+
/**
|
|
3798
|
+
* Configuration object for changing `getEpochInfo` query behavior
|
|
3799
|
+
*/
|
|
3800
|
+
/**
|
|
3801
|
+
* Configuration object for changing `getInflationReward` query behavior
|
|
3802
|
+
*/
|
|
3803
|
+
/**
|
|
3804
|
+
* Configuration object for changing `getLatestBlockhash` query behavior
|
|
3805
|
+
*/
|
|
3806
|
+
/**
|
|
3807
|
+
* Configuration object for changing `isBlockhashValid` query behavior
|
|
3808
|
+
*/
|
|
3809
|
+
/**
|
|
3810
|
+
* Configuration object for changing `getSlot` query behavior
|
|
3811
|
+
*/
|
|
3812
|
+
/**
|
|
3813
|
+
* Configuration object for changing `getSlotLeader` query behavior
|
|
3814
|
+
*/
|
|
3815
|
+
/**
|
|
3816
|
+
* Configuration object for changing `getTransaction` query behavior
|
|
3817
|
+
*/
|
|
3818
|
+
/**
|
|
3819
|
+
* Configuration object for changing `getTransaction` query behavior
|
|
3820
|
+
*/
|
|
3821
|
+
/**
|
|
3822
|
+
* Configuration object for changing `getLargestAccounts` query behavior
|
|
3823
|
+
*/
|
|
3824
|
+
/**
|
|
3825
|
+
* Configuration object for changing `getSupply` request behavior
|
|
3826
|
+
*/
|
|
3827
|
+
/**
|
|
3828
|
+
* Configuration object for changing query behavior
|
|
3829
|
+
*/
|
|
3830
|
+
/**
|
|
3831
|
+
* Information describing a cluster node
|
|
3832
|
+
*/
|
|
3833
|
+
/**
|
|
3834
|
+
* Information describing a vote account
|
|
3835
|
+
*/
|
|
3836
|
+
/**
|
|
3837
|
+
* A collection of cluster vote accounts
|
|
3838
|
+
*/
|
|
3839
|
+
/**
|
|
3840
|
+
* Network Inflation
|
|
3841
|
+
* (see https://docs.solana.com/implemented-proposals/ed_overview)
|
|
3842
|
+
*/
|
|
3546
3843
|
const GetInflationGovernorResult = superstruct.type({
|
|
3547
3844
|
foundation: superstruct.number(),
|
|
3548
3845
|
foundationTerm: superstruct.number(),
|
|
@@ -3565,6 +3862,11 @@ const GetInflationRewardResult = jsonRpcResult(superstruct.array(superstruct.nul
|
|
|
3565
3862
|
postBalance: superstruct.number(),
|
|
3566
3863
|
commission: superstruct.optional(superstruct.nullable(superstruct.number()))
|
|
3567
3864
|
}))));
|
|
3865
|
+
|
|
3866
|
+
/**
|
|
3867
|
+
* Configuration object for changing `getRecentPrioritizationFees` query behavior
|
|
3868
|
+
*/
|
|
3869
|
+
|
|
3568
3870
|
/**
|
|
3569
3871
|
* Expected JSON RPC response for the "getRecentPrioritizationFees" message
|
|
3570
3872
|
*/
|
|
@@ -3650,6 +3952,127 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
3650
3952
|
data: superstruct.tuple([superstruct.string(), superstruct.literal('base64')])
|
|
3651
3953
|
})))
|
|
3652
3954
|
}));
|
|
3955
|
+
|
|
3956
|
+
/**
|
|
3957
|
+
* Metadata for a parsed confirmed transaction on the ledger
|
|
3958
|
+
*
|
|
3959
|
+
* @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
|
|
3960
|
+
*/
|
|
3961
|
+
|
|
3962
|
+
/**
|
|
3963
|
+
* Collection of addresses loaded by a transaction using address table lookups
|
|
3964
|
+
*/
|
|
3965
|
+
|
|
3966
|
+
/**
|
|
3967
|
+
* Metadata for a parsed transaction on the ledger
|
|
3968
|
+
*/
|
|
3969
|
+
|
|
3970
|
+
/**
|
|
3971
|
+
* Metadata for a confirmed transaction on the ledger
|
|
3972
|
+
*/
|
|
3973
|
+
|
|
3974
|
+
/**
|
|
3975
|
+
* A processed transaction from the RPC API
|
|
3976
|
+
*/
|
|
3977
|
+
|
|
3978
|
+
/**
|
|
3979
|
+
* A processed transaction from the RPC API
|
|
3980
|
+
*/
|
|
3981
|
+
|
|
3982
|
+
/**
|
|
3983
|
+
* A processed transaction message from the RPC API
|
|
3984
|
+
*/
|
|
3985
|
+
|
|
3986
|
+
/**
|
|
3987
|
+
* A confirmed transaction on the ledger
|
|
3988
|
+
*
|
|
3989
|
+
* @deprecated Deprecated since Solana v1.8.0.
|
|
3990
|
+
*/
|
|
3991
|
+
|
|
3992
|
+
/**
|
|
3993
|
+
* A partially decoded transaction instruction
|
|
3994
|
+
*/
|
|
3995
|
+
|
|
3996
|
+
/**
|
|
3997
|
+
* A parsed transaction message account
|
|
3998
|
+
*/
|
|
3999
|
+
|
|
4000
|
+
/**
|
|
4001
|
+
* A parsed transaction instruction
|
|
4002
|
+
*/
|
|
4003
|
+
|
|
4004
|
+
/**
|
|
4005
|
+
* A parsed address table lookup
|
|
4006
|
+
*/
|
|
4007
|
+
|
|
4008
|
+
/**
|
|
4009
|
+
* A parsed transaction message
|
|
4010
|
+
*/
|
|
4011
|
+
|
|
4012
|
+
/**
|
|
4013
|
+
* A parsed transaction
|
|
4014
|
+
*/
|
|
4015
|
+
|
|
4016
|
+
/**
|
|
4017
|
+
* A parsed and confirmed transaction on the ledger
|
|
4018
|
+
*
|
|
4019
|
+
* @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
|
|
4020
|
+
*/
|
|
4021
|
+
|
|
4022
|
+
/**
|
|
4023
|
+
* A parsed transaction on the ledger with meta
|
|
4024
|
+
*/
|
|
4025
|
+
|
|
4026
|
+
/**
|
|
4027
|
+
* A processed block fetched from the RPC API
|
|
4028
|
+
*/
|
|
4029
|
+
|
|
4030
|
+
/**
|
|
4031
|
+
* A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`
|
|
4032
|
+
*/
|
|
4033
|
+
|
|
4034
|
+
/**
|
|
4035
|
+
* A processed block fetched from the RPC API where the `transactionDetails` mode is `none`
|
|
4036
|
+
*/
|
|
4037
|
+
|
|
4038
|
+
/**
|
|
4039
|
+
* A block with parsed transactions
|
|
4040
|
+
*/
|
|
4041
|
+
|
|
4042
|
+
/**
|
|
4043
|
+
* A block with parsed transactions where the `transactionDetails` mode is `accounts`
|
|
4044
|
+
*/
|
|
4045
|
+
|
|
4046
|
+
/**
|
|
4047
|
+
* A block with parsed transactions where the `transactionDetails` mode is `none`
|
|
4048
|
+
*/
|
|
4049
|
+
|
|
4050
|
+
/**
|
|
4051
|
+
* A processed block fetched from the RPC API
|
|
4052
|
+
*/
|
|
4053
|
+
|
|
4054
|
+
/**
|
|
4055
|
+
* A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`
|
|
4056
|
+
*/
|
|
4057
|
+
|
|
4058
|
+
/**
|
|
4059
|
+
* A processed block fetched from the RPC API where the `transactionDetails` mode is `none`
|
|
4060
|
+
*/
|
|
4061
|
+
|
|
4062
|
+
/**
|
|
4063
|
+
* A confirmed block on the ledger
|
|
4064
|
+
*
|
|
4065
|
+
* @deprecated Deprecated since Solana v1.8.0.
|
|
4066
|
+
*/
|
|
4067
|
+
|
|
4068
|
+
/**
|
|
4069
|
+
* A Block on the ledger with signatures only
|
|
4070
|
+
*/
|
|
4071
|
+
|
|
4072
|
+
/**
|
|
4073
|
+
* recent block production information
|
|
4074
|
+
*/
|
|
4075
|
+
|
|
3653
4076
|
/**
|
|
3654
4077
|
* Expected JSON RPC response for the "getBlockProduction" message
|
|
3655
4078
|
*/
|
|
@@ -4389,57 +4812,166 @@ const GetParsedTransactionRpcResult = jsonRpcResult(superstruct.nullable(superst
|
|
|
4389
4812
|
})));
|
|
4390
4813
|
|
|
4391
4814
|
/**
|
|
4392
|
-
* Expected JSON RPC response for the "getRecentBlockhash" message
|
|
4393
|
-
*
|
|
4394
|
-
* @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
|
|
4815
|
+
* Expected JSON RPC response for the "getRecentBlockhash" message
|
|
4816
|
+
*
|
|
4817
|
+
* @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
|
|
4818
|
+
*/
|
|
4819
|
+
const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(superstruct.type({
|
|
4820
|
+
blockhash: superstruct.string(),
|
|
4821
|
+
feeCalculator: superstruct.type({
|
|
4822
|
+
lamportsPerSignature: superstruct.number()
|
|
4823
|
+
})
|
|
4824
|
+
}));
|
|
4825
|
+
|
|
4826
|
+
/**
|
|
4827
|
+
* Expected JSON RPC response for the "getLatestBlockhash" message
|
|
4828
|
+
*/
|
|
4829
|
+
const GetLatestBlockhashRpcResult = jsonRpcResultAndContext(superstruct.type({
|
|
4830
|
+
blockhash: superstruct.string(),
|
|
4831
|
+
lastValidBlockHeight: superstruct.number()
|
|
4832
|
+
}));
|
|
4833
|
+
|
|
4834
|
+
/**
|
|
4835
|
+
* Expected JSON RPC response for the "isBlockhashValid" message
|
|
4836
|
+
*/
|
|
4837
|
+
const IsBlockhashValidRpcResult = jsonRpcResultAndContext(superstruct.boolean());
|
|
4838
|
+
const PerfSampleResult = superstruct.type({
|
|
4839
|
+
slot: superstruct.number(),
|
|
4840
|
+
numTransactions: superstruct.number(),
|
|
4841
|
+
numSlots: superstruct.number(),
|
|
4842
|
+
samplePeriodSecs: superstruct.number()
|
|
4843
|
+
});
|
|
4844
|
+
|
|
4845
|
+
/*
|
|
4846
|
+
* Expected JSON RPC response for "getRecentPerformanceSamples" message
|
|
4847
|
+
*/
|
|
4848
|
+
const GetRecentPerformanceSamplesRpcResult = jsonRpcResult(superstruct.array(PerfSampleResult));
|
|
4849
|
+
|
|
4850
|
+
/**
|
|
4851
|
+
* Expected JSON RPC response for the "getFeeCalculatorForBlockhash" message
|
|
4852
|
+
*/
|
|
4853
|
+
const GetFeeCalculatorRpcResult = jsonRpcResultAndContext(superstruct.nullable(superstruct.type({
|
|
4854
|
+
feeCalculator: superstruct.type({
|
|
4855
|
+
lamportsPerSignature: superstruct.number()
|
|
4856
|
+
})
|
|
4857
|
+
})));
|
|
4858
|
+
|
|
4859
|
+
/**
|
|
4860
|
+
* Expected JSON RPC response for the "requestAirdrop" message
|
|
4861
|
+
*/
|
|
4862
|
+
const RequestAirdropRpcResult = jsonRpcResult(superstruct.string());
|
|
4863
|
+
|
|
4864
|
+
/**
|
|
4865
|
+
* Expected JSON RPC response for the "sendTransaction" message
|
|
4866
|
+
*/
|
|
4867
|
+
const SendTransactionRpcResult = jsonRpcResult(superstruct.string());
|
|
4868
|
+
|
|
4869
|
+
/**
|
|
4870
|
+
* Information about the latest slot being processed by a node
|
|
4871
|
+
*/
|
|
4872
|
+
|
|
4873
|
+
/**
|
|
4874
|
+
* Parsed account data
|
|
4875
|
+
*/
|
|
4876
|
+
|
|
4877
|
+
/**
|
|
4878
|
+
* Stake Activation data
|
|
4879
|
+
*/
|
|
4880
|
+
|
|
4881
|
+
/**
|
|
4882
|
+
* Data slice argument for getProgramAccounts
|
|
4883
|
+
*/
|
|
4884
|
+
|
|
4885
|
+
/**
|
|
4886
|
+
* Memory comparison filter for getProgramAccounts
|
|
4887
|
+
*/
|
|
4888
|
+
|
|
4889
|
+
/**
|
|
4890
|
+
* Data size comparison filter for getProgramAccounts
|
|
4891
|
+
*/
|
|
4892
|
+
|
|
4893
|
+
/**
|
|
4894
|
+
* A filter object for getProgramAccounts
|
|
4895
|
+
*/
|
|
4896
|
+
|
|
4897
|
+
/**
|
|
4898
|
+
* Configuration object for getProgramAccounts requests
|
|
4899
|
+
*/
|
|
4900
|
+
|
|
4901
|
+
/**
|
|
4902
|
+
* Configuration object for getParsedProgramAccounts
|
|
4903
|
+
*/
|
|
4904
|
+
|
|
4905
|
+
/**
|
|
4906
|
+
* Configuration object for getMultipleAccounts
|
|
4907
|
+
*/
|
|
4908
|
+
|
|
4909
|
+
/**
|
|
4910
|
+
* Configuration object for `getStakeActivation`
|
|
4911
|
+
*/
|
|
4912
|
+
|
|
4913
|
+
/**
|
|
4914
|
+
* Configuration object for `getStakeActivation`
|
|
4915
|
+
*/
|
|
4916
|
+
|
|
4917
|
+
/**
|
|
4918
|
+
* Configuration object for `getStakeActivation`
|
|
4919
|
+
*/
|
|
4920
|
+
|
|
4921
|
+
/**
|
|
4922
|
+
* Configuration object for `getNonce`
|
|
4923
|
+
*/
|
|
4924
|
+
|
|
4925
|
+
/**
|
|
4926
|
+
* Configuration object for `getNonceAndContext`
|
|
4927
|
+
*/
|
|
4928
|
+
|
|
4929
|
+
/**
|
|
4930
|
+
* Information describing an account
|
|
4931
|
+
*/
|
|
4932
|
+
|
|
4933
|
+
/**
|
|
4934
|
+
* Account information identified by pubkey
|
|
4935
|
+
*/
|
|
4936
|
+
|
|
4937
|
+
/**
|
|
4938
|
+
* Callback function for account change notifications
|
|
4939
|
+
*/
|
|
4940
|
+
|
|
4941
|
+
/**
|
|
4942
|
+
* Callback function for program account change notifications
|
|
4943
|
+
*/
|
|
4944
|
+
|
|
4945
|
+
/**
|
|
4946
|
+
* Callback function for slot change notifications
|
|
4947
|
+
*/
|
|
4948
|
+
|
|
4949
|
+
/**
|
|
4950
|
+
* Callback function for slot update notifications
|
|
4395
4951
|
*/
|
|
4396
|
-
const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(superstruct.type({
|
|
4397
|
-
blockhash: superstruct.string(),
|
|
4398
|
-
feeCalculator: superstruct.type({
|
|
4399
|
-
lamportsPerSignature: superstruct.number()
|
|
4400
|
-
})
|
|
4401
|
-
}));
|
|
4402
4952
|
|
|
4403
4953
|
/**
|
|
4404
|
-
*
|
|
4954
|
+
* Callback function for signature status notifications
|
|
4405
4955
|
*/
|
|
4406
|
-
const GetLatestBlockhashRpcResult = jsonRpcResultAndContext(superstruct.type({
|
|
4407
|
-
blockhash: superstruct.string(),
|
|
4408
|
-
lastValidBlockHeight: superstruct.number()
|
|
4409
|
-
}));
|
|
4410
|
-
const PerfSampleResult = superstruct.type({
|
|
4411
|
-
slot: superstruct.number(),
|
|
4412
|
-
numTransactions: superstruct.number(),
|
|
4413
|
-
numSlots: superstruct.number(),
|
|
4414
|
-
samplePeriodSecs: superstruct.number()
|
|
4415
|
-
});
|
|
4416
4956
|
|
|
4417
|
-
|
|
4418
|
-
*
|
|
4957
|
+
/**
|
|
4958
|
+
* Signature status notification with transaction result
|
|
4419
4959
|
*/
|
|
4420
|
-
const GetRecentPerformanceSamplesRpcResult = jsonRpcResult(superstruct.array(PerfSampleResult));
|
|
4421
4960
|
|
|
4422
4961
|
/**
|
|
4423
|
-
*
|
|
4962
|
+
* Signature received notification
|
|
4424
4963
|
*/
|
|
4425
|
-
const GetFeeCalculatorRpcResult = jsonRpcResultAndContext(superstruct.nullable(superstruct.type({
|
|
4426
|
-
feeCalculator: superstruct.type({
|
|
4427
|
-
lamportsPerSignature: superstruct.number()
|
|
4428
|
-
})
|
|
4429
|
-
})));
|
|
4430
4964
|
|
|
4431
4965
|
/**
|
|
4432
|
-
*
|
|
4966
|
+
* Callback function for signature notifications
|
|
4433
4967
|
*/
|
|
4434
|
-
const RequestAirdropRpcResult = jsonRpcResult(superstruct.string());
|
|
4435
4968
|
|
|
4436
4969
|
/**
|
|
4437
|
-
*
|
|
4970
|
+
* Signature subscription options
|
|
4438
4971
|
*/
|
|
4439
|
-
const SendTransactionRpcResult = jsonRpcResult(superstruct.string());
|
|
4440
4972
|
|
|
4441
4973
|
/**
|
|
4442
|
-
*
|
|
4974
|
+
* Callback function for root change notifications
|
|
4443
4975
|
*/
|
|
4444
4976
|
|
|
4445
4977
|
/**
|
|
@@ -4467,66 +4999,60 @@ const LogsNotificationResult = superstruct.type({
|
|
|
4467
4999
|
* Filter for log subscriptions.
|
|
4468
5000
|
*/
|
|
4469
5001
|
|
|
4470
|
-
/**
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
};
|
|
5002
|
+
/**
|
|
5003
|
+
* Callback function for log notifications.
|
|
5004
|
+
*/
|
|
4474
5005
|
|
|
4475
5006
|
/**
|
|
4476
|
-
*
|
|
5007
|
+
* Signature result
|
|
4477
5008
|
*/
|
|
4478
|
-
class Connection {
|
|
4479
|
-
/** @internal */
|
|
4480
|
-
/** @internal */
|
|
4481
|
-
/** @internal */
|
|
4482
|
-
/** @internal */
|
|
4483
|
-
/** @internal */
|
|
4484
|
-
/** @internal */
|
|
4485
|
-
/** @internal */
|
|
4486
|
-
/** @internal */
|
|
4487
|
-
/** @internal */
|
|
4488
|
-
/** @internal */
|
|
4489
5009
|
|
|
4490
|
-
|
|
5010
|
+
/**
|
|
5011
|
+
* Transaction error
|
|
5012
|
+
*/
|
|
4491
5013
|
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
5014
|
+
/**
|
|
5015
|
+
* Transaction confirmation status
|
|
5016
|
+
* <pre>
|
|
5017
|
+
* 'processed': Transaction landed in a block which has reached 1 confirmation by the connected node
|
|
5018
|
+
* 'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster
|
|
5019
|
+
* 'finalized': Transaction landed in a block which has been finalized by the cluster
|
|
5020
|
+
* </pre>
|
|
5021
|
+
*/
|
|
4499
5022
|
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
5023
|
+
/**
|
|
5024
|
+
* Signature status
|
|
5025
|
+
*/
|
|
4503
5026
|
|
|
4504
|
-
|
|
4505
|
-
|
|
5027
|
+
/**
|
|
5028
|
+
* A confirmed signature with its status
|
|
5029
|
+
*/
|
|
4506
5030
|
|
|
4507
|
-
|
|
5031
|
+
/**
|
|
5032
|
+
* An object defining headers to be passed to the RPC server
|
|
5033
|
+
*/
|
|
4508
5034
|
|
|
4509
|
-
|
|
5035
|
+
/**
|
|
5036
|
+
* The type of the JavaScript `fetch()` API
|
|
5037
|
+
*/
|
|
4510
5038
|
|
|
4511
|
-
|
|
5039
|
+
/**
|
|
5040
|
+
* A callback used to augment the outgoing HTTP request
|
|
5041
|
+
*/
|
|
4512
5042
|
|
|
4513
|
-
|
|
5043
|
+
/**
|
|
5044
|
+
* Configuration for instantiating a Connection
|
|
5045
|
+
*/
|
|
4514
5046
|
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
* subscriptions have been disposed in such a way, so that we know
|
|
4520
|
-
* whether the client is dealing with a not-yet-processed signature
|
|
4521
|
-
* (in which case we must tear down the server subscription) or an
|
|
4522
|
-
* already-processed signature (in which case the client can simply
|
|
4523
|
-
* clear out the subscription locally without telling the server).
|
|
4524
|
-
*
|
|
4525
|
-
* NOTE: There is a proposal to eliminate this special case, here:
|
|
4526
|
-
* https://github.com/solana-labs/solana/issues/18892
|
|
4527
|
-
*/
|
|
4528
|
-
/** @internal */
|
|
5047
|
+
/** @internal */
|
|
5048
|
+
const COMMON_HTTP_HEADERS = {
|
|
5049
|
+
'solana-client': `js/${"0.0.0-development" }`
|
|
5050
|
+
};
|
|
4529
5051
|
|
|
5052
|
+
/**
|
|
5053
|
+
* A connection to a fullnode JSON RPC endpoint
|
|
5054
|
+
*/
|
|
5055
|
+
class Connection {
|
|
4530
5056
|
/**
|
|
4531
5057
|
* Establish a JSON RPC connection
|
|
4532
5058
|
*
|
|
@@ -4534,33 +5060,77 @@ class Connection {
|
|
|
4534
5060
|
* @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object
|
|
4535
5061
|
*/
|
|
4536
5062
|
constructor(endpoint, _commitmentOrConfig) {
|
|
5063
|
+
/** @internal */
|
|
4537
5064
|
this._commitment = void 0;
|
|
5065
|
+
/** @internal */
|
|
4538
5066
|
this._confirmTransactionInitialTimeout = void 0;
|
|
5067
|
+
/** @internal */
|
|
4539
5068
|
this._rpcEndpoint = void 0;
|
|
5069
|
+
/** @internal */
|
|
4540
5070
|
this._rpcWsEndpoint = void 0;
|
|
5071
|
+
/** @internal */
|
|
4541
5072
|
this._rpcClient = void 0;
|
|
5073
|
+
/** @internal */
|
|
4542
5074
|
this._rpcRequest = void 0;
|
|
5075
|
+
/** @internal */
|
|
4543
5076
|
this._rpcBatchRequest = void 0;
|
|
5077
|
+
/** @internal */
|
|
4544
5078
|
this._rpcWebSocket = void 0;
|
|
5079
|
+
/** @internal */
|
|
4545
5080
|
this._rpcWebSocketConnected = false;
|
|
5081
|
+
/** @internal */
|
|
4546
5082
|
this._rpcWebSocketHeartbeat = null;
|
|
5083
|
+
/** @internal */
|
|
4547
5084
|
this._rpcWebSocketIdleTimeout = null;
|
|
5085
|
+
/** @internal
|
|
5086
|
+
* A number that we increment every time an active connection closes.
|
|
5087
|
+
* Used to determine whether the same socket connection that was open
|
|
5088
|
+
* when an async operation started is the same one that's active when
|
|
5089
|
+
* its continuation fires.
|
|
5090
|
+
*
|
|
5091
|
+
*/
|
|
4548
5092
|
this._rpcWebSocketGeneration = 0;
|
|
5093
|
+
/** @internal */
|
|
4549
5094
|
this._disableBlockhashCaching = false;
|
|
5095
|
+
/** @internal */
|
|
4550
5096
|
this._pollingBlockhash = false;
|
|
5097
|
+
/** @internal */
|
|
4551
5098
|
this._blockhashInfo = {
|
|
4552
5099
|
latestBlockhash: null,
|
|
4553
5100
|
lastFetch: 0,
|
|
4554
5101
|
transactionSignatures: [],
|
|
4555
5102
|
simulatedSignatures: []
|
|
4556
5103
|
};
|
|
5104
|
+
/** @internal */
|
|
4557
5105
|
this._nextClientSubscriptionId = 0;
|
|
5106
|
+
/** @internal */
|
|
4558
5107
|
this._subscriptionDisposeFunctionsByClientSubscriptionId = {};
|
|
5108
|
+
/** @internal */
|
|
4559
5109
|
this._subscriptionHashByClientSubscriptionId = {};
|
|
5110
|
+
/** @internal */
|
|
4560
5111
|
this._subscriptionStateChangeCallbacksByHash = {};
|
|
5112
|
+
/** @internal */
|
|
4561
5113
|
this._subscriptionCallbacksByServerSubscriptionId = {};
|
|
5114
|
+
/** @internal */
|
|
4562
5115
|
this._subscriptionsByHash = {};
|
|
5116
|
+
/**
|
|
5117
|
+
* Special case.
|
|
5118
|
+
* After a signature is processed, RPCs automatically dispose of the
|
|
5119
|
+
* subscription on the server side. We need to track which of these
|
|
5120
|
+
* subscriptions have been disposed in such a way, so that we know
|
|
5121
|
+
* whether the client is dealing with a not-yet-processed signature
|
|
5122
|
+
* (in which case we must tear down the server subscription) or an
|
|
5123
|
+
* already-processed signature (in which case the client can simply
|
|
5124
|
+
* clear out the subscription locally without telling the server).
|
|
5125
|
+
*
|
|
5126
|
+
* NOTE: There is a proposal to eliminate this special case, here:
|
|
5127
|
+
* https://github.com/solana-labs/solana/issues/18892
|
|
5128
|
+
*/
|
|
5129
|
+
/** @internal */
|
|
4563
5130
|
this._subscriptionsAutoDisposedByRpc = new Set();
|
|
5131
|
+
/*
|
|
5132
|
+
* Returns the current block height of the node
|
|
5133
|
+
*/
|
|
4564
5134
|
this.getBlockHeight = (() => {
|
|
4565
5135
|
const requestPromises = {};
|
|
4566
5136
|
return async commitmentOrConfig => {
|
|
@@ -4956,6 +5526,8 @@ class Connection {
|
|
|
4956
5526
|
* @return {Promise<Array<{pubkey: PublicKey, account: AccountInfo<Buffer>}>>}
|
|
4957
5527
|
*/
|
|
4958
5528
|
|
|
5529
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
5530
|
+
|
|
4959
5531
|
// eslint-disable-next-line no-dupe-class-members
|
|
4960
5532
|
async getProgramAccounts(programId, configOrCommitment) {
|
|
4961
5533
|
const {
|
|
@@ -4994,6 +5566,8 @@ class Connection {
|
|
|
4994
5566
|
}
|
|
4995
5567
|
return res.result;
|
|
4996
5568
|
}
|
|
5569
|
+
|
|
5570
|
+
/** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */ // eslint-disable-next-line no-dupe-class-members
|
|
4997
5571
|
// eslint-disable-next-line no-dupe-class-members
|
|
4998
5572
|
async confirmTransaction(strategy, commitment) {
|
|
4999
5573
|
let rawSignature;
|
|
@@ -5060,7 +5634,7 @@ class Connection {
|
|
|
5060
5634
|
value: result
|
|
5061
5635
|
};
|
|
5062
5636
|
resolve({
|
|
5063
|
-
__type:
|
|
5637
|
+
__type: TransactionStatus.PROCESSED,
|
|
5064
5638
|
response
|
|
5065
5639
|
});
|
|
5066
5640
|
}, commitment);
|
|
@@ -5118,7 +5692,7 @@ class Connection {
|
|
|
5118
5692
|
}
|
|
5119
5693
|
done = true;
|
|
5120
5694
|
resolve({
|
|
5121
|
-
__type:
|
|
5695
|
+
__type: TransactionStatus.PROCESSED,
|
|
5122
5696
|
response: {
|
|
5123
5697
|
context,
|
|
5124
5698
|
value
|
|
@@ -5173,7 +5747,7 @@ class Connection {
|
|
|
5173
5747
|
if (done) return;
|
|
5174
5748
|
}
|
|
5175
5749
|
resolve({
|
|
5176
|
-
__type:
|
|
5750
|
+
__type: TransactionStatus.BLOCKHEIGHT_EXCEEDED
|
|
5177
5751
|
});
|
|
5178
5752
|
})();
|
|
5179
5753
|
});
|
|
@@ -5188,7 +5762,7 @@ class Connection {
|
|
|
5188
5762
|
let result;
|
|
5189
5763
|
try {
|
|
5190
5764
|
const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]);
|
|
5191
|
-
if (outcome.__type ===
|
|
5765
|
+
if (outcome.__type === TransactionStatus.PROCESSED) {
|
|
5192
5766
|
result = outcome.response;
|
|
5193
5767
|
} else {
|
|
5194
5768
|
throw new TransactionExpiredBlockheightExceededError(signature);
|
|
@@ -5237,7 +5811,7 @@ class Connection {
|
|
|
5237
5811
|
) {
|
|
5238
5812
|
if (nonceValue !== currentNonceValue) {
|
|
5239
5813
|
resolve({
|
|
5240
|
-
__type:
|
|
5814
|
+
__type: TransactionStatus.NONCE_INVALID,
|
|
5241
5815
|
slotInWhichNonceDidAdvance: lastCheckedSlot
|
|
5242
5816
|
});
|
|
5243
5817
|
return;
|
|
@@ -5260,7 +5834,7 @@ class Connection {
|
|
|
5260
5834
|
let result;
|
|
5261
5835
|
try {
|
|
5262
5836
|
const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]);
|
|
5263
|
-
if (outcome.__type ===
|
|
5837
|
+
if (outcome.__type === TransactionStatus.PROCESSED) {
|
|
5264
5838
|
result = outcome.response;
|
|
5265
5839
|
} else {
|
|
5266
5840
|
// Double check that the transaction is indeed unconfirmed.
|
|
@@ -5344,7 +5918,7 @@ class Connection {
|
|
|
5344
5918
|
}
|
|
5345
5919
|
}
|
|
5346
5920
|
timeoutId = setTimeout(() => resolve({
|
|
5347
|
-
__type:
|
|
5921
|
+
__type: TransactionStatus.TIMED_OUT,
|
|
5348
5922
|
timeoutMs
|
|
5349
5923
|
}), timeoutMs);
|
|
5350
5924
|
});
|
|
@@ -5358,7 +5932,7 @@ class Connection {
|
|
|
5358
5932
|
let result;
|
|
5359
5933
|
try {
|
|
5360
5934
|
const outcome = await Promise.race([confirmationPromise, expiryPromise]);
|
|
5361
|
-
if (outcome.__type ===
|
|
5935
|
+
if (outcome.__type === TransactionStatus.PROCESSED) {
|
|
5362
5936
|
result = outcome.response;
|
|
5363
5937
|
} else {
|
|
5364
5938
|
throw new TransactionExpiredTimeoutError(signature, outcome.timeoutMs / 1000);
|
|
@@ -5737,6 +6311,23 @@ class Connection {
|
|
|
5737
6311
|
return res.result;
|
|
5738
6312
|
}
|
|
5739
6313
|
|
|
6314
|
+
/**
|
|
6315
|
+
* Returns whether a blockhash is still valid or not
|
|
6316
|
+
*/
|
|
6317
|
+
async isBlockhashValid(blockhash, rawConfig) {
|
|
6318
|
+
const {
|
|
6319
|
+
commitment,
|
|
6320
|
+
config
|
|
6321
|
+
} = extractCommitmentFromConfig(rawConfig);
|
|
6322
|
+
const args = this._buildArgs([blockhash], commitment, undefined /* encoding */, config);
|
|
6323
|
+
const unsafeRes = await this._rpcRequest('isBlockhashValid', args);
|
|
6324
|
+
const res = superstruct.create(unsafeRes, IsBlockhashValidRpcResult);
|
|
6325
|
+
if ('error' in res) {
|
|
6326
|
+
throw new SolanaJSONRPCError(res.error, 'failed to determine if the blockhash `' + blockhash + '`is valid');
|
|
6327
|
+
}
|
|
6328
|
+
return res.result;
|
|
6329
|
+
}
|
|
6330
|
+
|
|
5740
6331
|
/**
|
|
5741
6332
|
* Fetch the node version
|
|
5742
6333
|
*/
|
|
@@ -5768,10 +6359,24 @@ class Connection {
|
|
|
5768
6359
|
* setting the `maxSupportedTransactionVersion` property.
|
|
5769
6360
|
*/
|
|
5770
6361
|
|
|
6362
|
+
/**
|
|
6363
|
+
* @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by
|
|
6364
|
+
* setting the `maxSupportedTransactionVersion` property.
|
|
6365
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
6366
|
+
/**
|
|
6367
|
+
* @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by
|
|
6368
|
+
* setting the `maxSupportedTransactionVersion` property.
|
|
6369
|
+
*/
|
|
6370
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
5771
6371
|
/**
|
|
5772
6372
|
* Fetch a processed block from the cluster.
|
|
5773
6373
|
*/
|
|
5774
6374
|
// eslint-disable-next-line no-dupe-class-members
|
|
6375
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
6376
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
6377
|
+
/**
|
|
6378
|
+
* Fetch a processed block from the cluster.
|
|
6379
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
5775
6380
|
async getBlock(slot, rawConfig) {
|
|
5776
6381
|
const {
|
|
5777
6382
|
commitment,
|
|
@@ -5832,6 +6437,10 @@ class Connection {
|
|
|
5832
6437
|
* Fetch parsed transaction details for a confirmed or finalized block
|
|
5833
6438
|
*/
|
|
5834
6439
|
|
|
6440
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
6441
|
+
|
|
6442
|
+
// eslint-disable-next-line no-dupe-class-members
|
|
6443
|
+
|
|
5835
6444
|
// eslint-disable-next-line no-dupe-class-members
|
|
5836
6445
|
async getParsedBlock(slot, rawConfig) {
|
|
5837
6446
|
const {
|
|
@@ -5871,11 +6480,6 @@ class Connection {
|
|
|
5871
6480
|
throw new SolanaJSONRPCError(e, 'failed to get block');
|
|
5872
6481
|
}
|
|
5873
6482
|
}
|
|
5874
|
-
|
|
5875
|
-
/*
|
|
5876
|
-
* Returns the current block height of the node
|
|
5877
|
-
*/
|
|
5878
|
-
|
|
5879
6483
|
/*
|
|
5880
6484
|
* Returns recent block production information from the current or previous epoch
|
|
5881
6485
|
*/
|
|
@@ -5911,8 +6515,10 @@ class Connection {
|
|
|
5911
6515
|
|
|
5912
6516
|
/**
|
|
5913
6517
|
* Fetch a confirmed or finalized transaction from the cluster.
|
|
5914
|
-
*/
|
|
5915
|
-
|
|
6518
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
6519
|
+
/**
|
|
6520
|
+
* Fetch a confirmed or finalized transaction from the cluster.
|
|
6521
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
5916
6522
|
async getTransaction(signature, rawConfig) {
|
|
5917
6523
|
const {
|
|
5918
6524
|
commitment,
|
|
@@ -5991,8 +6597,12 @@ class Connection {
|
|
|
5991
6597
|
* Fetch transaction details for a batch of confirmed transactions.
|
|
5992
6598
|
* Similar to {@link getParsedTransactions} but returns a {@link
|
|
5993
6599
|
* VersionedTransactionResponse}.
|
|
5994
|
-
*/
|
|
5995
|
-
|
|
6600
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
6601
|
+
/**
|
|
6602
|
+
* Fetch transaction details for a batch of confirmed transactions.
|
|
6603
|
+
* Similar to {@link getParsedTransactions} but returns a {@link
|
|
6604
|
+
* VersionedTransactionResponse}.
|
|
6605
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
5996
6606
|
async getTransactions(signatures, commitmentOrConfig) {
|
|
5997
6607
|
const {
|
|
5998
6608
|
commitment,
|
|
@@ -6418,8 +7028,10 @@ class Connection {
|
|
|
6418
7028
|
|
|
6419
7029
|
/**
|
|
6420
7030
|
* Simulate a transaction
|
|
6421
|
-
*/
|
|
6422
|
-
|
|
7031
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
7032
|
+
/**
|
|
7033
|
+
* Simulate a transaction
|
|
7034
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
6423
7035
|
async simulateTransaction(transactionOrMessage, configOrSigners, includeAccounts) {
|
|
6424
7036
|
if ('message' in transactionOrMessage) {
|
|
6425
7037
|
const versionedTx = transactionOrMessage;
|
|
@@ -6530,10 +7142,12 @@ class Connection {
|
|
|
6530
7142
|
* VersionedTransaction}
|
|
6531
7143
|
*/
|
|
6532
7144
|
|
|
7145
|
+
/**
|
|
7146
|
+
* Send a signed transaction
|
|
7147
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
6533
7148
|
/**
|
|
6534
7149
|
* Sign and send a transaction
|
|
6535
|
-
*/
|
|
6536
|
-
// eslint-disable-next-line no-dupe-class-members
|
|
7150
|
+
*/ // eslint-disable-next-line no-dupe-class-members
|
|
6537
7151
|
async sendTransaction(transaction, signersOrOptions, options) {
|
|
6538
7152
|
if ('version' in transaction) {
|
|
6539
7153
|
if (signersOrOptions && Array.isArray(signersOrOptions)) {
|
|
@@ -6941,7 +7555,7 @@ class Connection {
|
|
|
6941
7555
|
*/
|
|
6942
7556
|
args) {
|
|
6943
7557
|
const clientSubscriptionId = this._nextClientSubscriptionId++;
|
|
6944
|
-
const hash = fastStableStringify$1([subscriptionConfig.method, args]);
|
|
7558
|
+
const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);
|
|
6945
7559
|
|
|
6946
7560
|
const existingSubscription = this._subscriptionsByHash[hash];
|
|
6947
7561
|
if (existingSubscription === undefined) {
|
|
@@ -7423,6 +8037,10 @@ class Keypair {
|
|
|
7423
8037
|
}
|
|
7424
8038
|
}
|
|
7425
8039
|
|
|
8040
|
+
/**
|
|
8041
|
+
* An enumeration of valid LookupTableInstructionType's
|
|
8042
|
+
*/
|
|
8043
|
+
|
|
7426
8044
|
/**
|
|
7427
8045
|
* An enumeration of valid address lookup table InstructionType's
|
|
7428
8046
|
* @internal
|
|
@@ -7764,6 +8382,22 @@ class ComputeBudgetInstruction {
|
|
|
7764
8382
|
* An enumeration of valid ComputeBudgetInstructionType's
|
|
7765
8383
|
*/
|
|
7766
8384
|
|
|
8385
|
+
/**
|
|
8386
|
+
* Request units instruction params
|
|
8387
|
+
*/
|
|
8388
|
+
|
|
8389
|
+
/**
|
|
8390
|
+
* Request heap frame instruction params
|
|
8391
|
+
*/
|
|
8392
|
+
|
|
8393
|
+
/**
|
|
8394
|
+
* Set compute unit limit instruction params
|
|
8395
|
+
*/
|
|
8396
|
+
|
|
8397
|
+
/**
|
|
8398
|
+
* Set compute unit price instruction params
|
|
8399
|
+
*/
|
|
8400
|
+
|
|
7767
8401
|
/**
|
|
7768
8402
|
* An enumeration of valid ComputeBudget InstructionType's
|
|
7769
8403
|
* @internal
|
|
@@ -7852,6 +8486,10 @@ const SIGNATURE_BYTES = 64;
|
|
|
7852
8486
|
* Params for creating an ed25519 instruction using a public key
|
|
7853
8487
|
*/
|
|
7854
8488
|
|
|
8489
|
+
/**
|
|
8490
|
+
* Params for creating an ed25519 instruction using a private key
|
|
8491
|
+
*/
|
|
8492
|
+
|
|
7855
8493
|
const ED25519_INSTRUCTION_LAYOUT = BufferLayout__namespace.struct([BufferLayout__namespace.u8('numSignatures'), BufferLayout__namespace.u8('padding'), BufferLayout__namespace.u16('signatureOffset'), BufferLayout__namespace.u16('signatureInstructionIndex'), BufferLayout__namespace.u16('publicKeyOffset'), BufferLayout__namespace.u16('publicKeyInstructionIndex'), BufferLayout__namespace.u16('messageDataOffset'), BufferLayout__namespace.u16('messageDataSize'), BufferLayout__namespace.u16('messageInstructionIndex')]);
|
|
7856
8494
|
class Ed25519Program {
|
|
7857
8495
|
/**
|
|
@@ -7949,6 +8587,14 @@ const SIGNATURE_OFFSETS_SERIALIZED_SIZE = 11;
|
|
|
7949
8587
|
* Params for creating an secp256k1 instruction using a public key
|
|
7950
8588
|
*/
|
|
7951
8589
|
|
|
8590
|
+
/**
|
|
8591
|
+
* Params for creating an secp256k1 instruction using an Ethereum address
|
|
8592
|
+
*/
|
|
8593
|
+
|
|
8594
|
+
/**
|
|
8595
|
+
* Params for creating an secp256k1 instruction using a private key
|
|
8596
|
+
*/
|
|
8597
|
+
|
|
7952
8598
|
const SECP256K1_INSTRUCTION_LAYOUT = BufferLayout__namespace.struct([BufferLayout__namespace.u8('numSignatures'), BufferLayout__namespace.u16('signatureOffset'), BufferLayout__namespace.u8('signatureInstructionIndex'), BufferLayout__namespace.u16('ethAddressOffset'), BufferLayout__namespace.u8('ethAddressInstructionIndex'), BufferLayout__namespace.u16('messageDataOffset'), BufferLayout__namespace.u16('messageDataSize'), BufferLayout__namespace.u8('messageInstructionIndex'), BufferLayout__namespace.blob(20, 'ethAddress'), BufferLayout__namespace.blob(64, 'signature'), BufferLayout__namespace.u8('recoveryId')]);
|
|
7953
8599
|
class Secp256k1Program {
|
|
7954
8600
|
/**
|
|
@@ -8084,17 +8730,15 @@ const STAKE_CONFIG_ID = new PublicKey('StakeConfig111111111111111111111111111111
|
|
|
8084
8730
|
* Stake account authority info
|
|
8085
8731
|
*/
|
|
8086
8732
|
class Authorized {
|
|
8087
|
-
/** stake authority */
|
|
8088
|
-
|
|
8089
|
-
/** withdraw authority */
|
|
8090
|
-
|
|
8091
8733
|
/**
|
|
8092
8734
|
* Create a new Authorized object
|
|
8093
8735
|
* @param staker the stake authority
|
|
8094
8736
|
* @param withdrawer the withdraw authority
|
|
8095
8737
|
*/
|
|
8096
8738
|
constructor(staker, withdrawer) {
|
|
8739
|
+
/** stake authority */
|
|
8097
8740
|
this.staker = void 0;
|
|
8741
|
+
/** withdraw authority */
|
|
8098
8742
|
this.withdrawer = void 0;
|
|
8099
8743
|
this.staker = staker;
|
|
8100
8744
|
this.withdrawer = withdrawer;
|
|
@@ -8104,18 +8748,15 @@ class Authorized {
|
|
|
8104
8748
|
* Stake account lockup info
|
|
8105
8749
|
*/
|
|
8106
8750
|
class Lockup {
|
|
8107
|
-
/** Unix timestamp of lockup expiration */
|
|
8108
|
-
|
|
8109
|
-
/** Epoch of lockup expiration */
|
|
8110
|
-
|
|
8111
|
-
/** Lockup custodian authority */
|
|
8112
|
-
|
|
8113
8751
|
/**
|
|
8114
8752
|
* Create a new Lockup object
|
|
8115
8753
|
*/
|
|
8116
8754
|
constructor(unixTimestamp, epoch, custodian) {
|
|
8755
|
+
/** Unix timestamp of lockup expiration */
|
|
8117
8756
|
this.unixTimestamp = void 0;
|
|
8757
|
+
/** Epoch of lockup expiration */
|
|
8118
8758
|
this.epoch = void 0;
|
|
8759
|
+
/** Lockup custodian authority */
|
|
8119
8760
|
this.custodian = void 0;
|
|
8120
8761
|
this.unixTimestamp = unixTimestamp;
|
|
8121
8762
|
this.epoch = epoch;
|
|
@@ -8127,6 +8768,39 @@ class Lockup {
|
|
|
8127
8768
|
*/
|
|
8128
8769
|
}
|
|
8129
8770
|
Lockup.default = new Lockup(0, 0, PublicKey.default);
|
|
8771
|
+
/**
|
|
8772
|
+
* Create stake account transaction params
|
|
8773
|
+
*/
|
|
8774
|
+
/**
|
|
8775
|
+
* Create stake account with seed transaction params
|
|
8776
|
+
*/
|
|
8777
|
+
/**
|
|
8778
|
+
* Initialize stake instruction params
|
|
8779
|
+
*/
|
|
8780
|
+
/**
|
|
8781
|
+
* Delegate stake instruction params
|
|
8782
|
+
*/
|
|
8783
|
+
/**
|
|
8784
|
+
* Authorize stake instruction params
|
|
8785
|
+
*/
|
|
8786
|
+
/**
|
|
8787
|
+
* Authorize stake instruction params using a derived key
|
|
8788
|
+
*/
|
|
8789
|
+
/**
|
|
8790
|
+
* Split stake instruction params
|
|
8791
|
+
*/
|
|
8792
|
+
/**
|
|
8793
|
+
* Split with seed transaction params
|
|
8794
|
+
*/
|
|
8795
|
+
/**
|
|
8796
|
+
* Withdraw stake instruction params
|
|
8797
|
+
*/
|
|
8798
|
+
/**
|
|
8799
|
+
* Deactivate stake instruction params
|
|
8800
|
+
*/
|
|
8801
|
+
/**
|
|
8802
|
+
* Merge stake instruction params
|
|
8803
|
+
*/
|
|
8130
8804
|
/**
|
|
8131
8805
|
* Stake Instruction class
|
|
8132
8806
|
*/
|
|
@@ -8815,6 +9489,13 @@ class StakeProgram {
|
|
|
8815
9489
|
}
|
|
8816
9490
|
}
|
|
8817
9491
|
StakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111111');
|
|
9492
|
+
/**
|
|
9493
|
+
* Max space of a Stake account
|
|
9494
|
+
*
|
|
9495
|
+
* This is generated from the solana-stake-program StakeState struct as
|
|
9496
|
+
* `StakeState::size_of()`:
|
|
9497
|
+
* https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeState.html
|
|
9498
|
+
*/
|
|
8818
9499
|
StakeProgram.space = 200;
|
|
8819
9500
|
|
|
8820
9501
|
/**
|
|
@@ -8839,6 +9520,22 @@ class VoteInit {
|
|
|
8839
9520
|
* Create vote account transaction params
|
|
8840
9521
|
*/
|
|
8841
9522
|
|
|
9523
|
+
/**
|
|
9524
|
+
* InitializeAccount instruction params
|
|
9525
|
+
*/
|
|
9526
|
+
|
|
9527
|
+
/**
|
|
9528
|
+
* Authorize instruction params
|
|
9529
|
+
*/
|
|
9530
|
+
|
|
9531
|
+
/**
|
|
9532
|
+
* AuthorizeWithSeed instruction params
|
|
9533
|
+
*/
|
|
9534
|
+
|
|
9535
|
+
/**
|
|
9536
|
+
* Withdraw from vote account transaction params
|
|
9537
|
+
*/
|
|
9538
|
+
|
|
8842
9539
|
/**
|
|
8843
9540
|
* Vote Instruction class
|
|
8844
9541
|
*/
|
|
@@ -8970,6 +9667,8 @@ class VoteInstruction {
|
|
|
8970
9667
|
* An enumeration of valid VoteInstructionType's
|
|
8971
9668
|
*/
|
|
8972
9669
|
|
|
9670
|
+
/** @internal */
|
|
9671
|
+
|
|
8973
9672
|
const VOTE_INSTRUCTION_LAYOUTS = Object.freeze({
|
|
8974
9673
|
InitializeAccount: {
|
|
8975
9674
|
index: 0,
|
|
@@ -9206,6 +9905,15 @@ class VoteProgram {
|
|
|
9206
9905
|
}
|
|
9207
9906
|
}
|
|
9208
9907
|
VoteProgram.programId = new PublicKey('Vote111111111111111111111111111111111111111');
|
|
9908
|
+
/**
|
|
9909
|
+
* Max space of a Vote account
|
|
9910
|
+
*
|
|
9911
|
+
* This is generated from the solana-vote-program VoteState struct as
|
|
9912
|
+
* `VoteState::size_of()`:
|
|
9913
|
+
* https://docs.rs/solana-vote-program/1.9.5/solana_vote_program/vote_state/struct.VoteState.html#method.size_of
|
|
9914
|
+
*
|
|
9915
|
+
* 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
|
|
9916
|
+
*/
|
|
9209
9917
|
VoteProgram.space = 3731;
|
|
9210
9918
|
|
|
9211
9919
|
const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo111111111111111111111111111111');
|
|
@@ -9214,6 +9922,10 @@ const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo1111111111111111111111111
|
|
|
9214
9922
|
* @internal
|
|
9215
9923
|
*/
|
|
9216
9924
|
|
|
9925
|
+
/**
|
|
9926
|
+
* Info used to identity validators.
|
|
9927
|
+
*/
|
|
9928
|
+
|
|
9217
9929
|
const InfoString = superstruct.type({
|
|
9218
9930
|
name: superstruct.string(),
|
|
9219
9931
|
website: superstruct.optional(superstruct.string()),
|
|
@@ -9225,14 +9937,6 @@ const InfoString = superstruct.type({
|
|
|
9225
9937
|
* ValidatorInfo class
|
|
9226
9938
|
*/
|
|
9227
9939
|
class ValidatorInfo {
|
|
9228
|
-
/**
|
|
9229
|
-
* validator public key
|
|
9230
|
-
*/
|
|
9231
|
-
|
|
9232
|
-
/**
|
|
9233
|
-
* validator information
|
|
9234
|
-
*/
|
|
9235
|
-
|
|
9236
9940
|
/**
|
|
9237
9941
|
* Construct a valid ValidatorInfo
|
|
9238
9942
|
*
|
|
@@ -9240,7 +9944,13 @@ class ValidatorInfo {
|
|
|
9240
9944
|
* @param info validator information
|
|
9241
9945
|
*/
|
|
9242
9946
|
constructor(key, info) {
|
|
9947
|
+
/**
|
|
9948
|
+
* validator public key
|
|
9949
|
+
*/
|
|
9243
9950
|
this.key = void 0;
|
|
9951
|
+
/**
|
|
9952
|
+
* validator information
|
|
9953
|
+
*/
|
|
9244
9954
|
this.info = void 0;
|
|
9245
9955
|
this.key = key;
|
|
9246
9956
|
this.info = info;
|
|
@@ -9281,6 +9991,11 @@ class ValidatorInfo {
|
|
|
9281
9991
|
}
|
|
9282
9992
|
|
|
9283
9993
|
const VOTE_PROGRAM_ID = new PublicKey('Vote111111111111111111111111111111111111111');
|
|
9994
|
+
|
|
9995
|
+
/**
|
|
9996
|
+
* History of how many credits earned by the end of each epoch
|
|
9997
|
+
*/
|
|
9998
|
+
|
|
9284
9999
|
/**
|
|
9285
10000
|
* See https://github.com/solana-labs/solana/blob/8a12ed029cfa38d4a45400916c2463fb82bbec8c/programs/vote_api/src/vote_state.rs#L68-L88
|
|
9286
10001
|
*
|
|
@@ -9420,9 +10135,7 @@ function clusterApiUrl(cluster, tls) {
|
|
|
9420
10135
|
/**
|
|
9421
10136
|
* @deprecated Calling `sendAndConfirmRawTransaction()` without a `confirmationStrategy`
|
|
9422
10137
|
* is no longer supported and will be removed in a future version.
|
|
9423
|
-
*/
|
|
9424
|
-
// eslint-disable-next-line no-redeclare
|
|
9425
|
-
|
|
10138
|
+
*/ // eslint-disable-next-line no-redeclare
|
|
9426
10139
|
// eslint-disable-next-line no-redeclare
|
|
9427
10140
|
async function sendAndConfirmRawTransaction(connection, rawTransaction, confirmationStrategyOrConfirmOptions, maybeConfirmOptions) {
|
|
9428
10141
|
let confirmationStrategy;
|
|
@@ -9517,6 +10230,7 @@ exports.TransactionExpiredNonceInvalidError = TransactionExpiredNonceInvalidErro
|
|
|
9517
10230
|
exports.TransactionExpiredTimeoutError = TransactionExpiredTimeoutError;
|
|
9518
10231
|
exports.TransactionInstruction = TransactionInstruction;
|
|
9519
10232
|
exports.TransactionMessage = TransactionMessage;
|
|
10233
|
+
exports.TransactionStatus = TransactionStatus;
|
|
9520
10234
|
exports.VALIDATOR_INFO_KEY = VALIDATOR_INFO_KEY;
|
|
9521
10235
|
exports.VERSION_PREFIX_MASK = VERSION_PREFIX_MASK;
|
|
9522
10236
|
exports.VOTE_PROGRAM_ID = VOTE_PROGRAM_ID;
|