@solana/web3.js 1.93.3 → 1.94.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 +40 -20
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +40 -20
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +40 -20
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +20 -17
- package/lib/index.esm.js +40 -20
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +40 -20
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +40 -20
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +65 -19
package/lib/index.browser.cjs.js
CHANGED
|
@@ -4093,6 +4093,16 @@ const VersionResult = superstruct.type({
|
|
|
4093
4093
|
'solana-core': superstruct.string(),
|
|
4094
4094
|
'feature-set': superstruct.optional(superstruct.number())
|
|
4095
4095
|
});
|
|
4096
|
+
const ParsedInstructionStruct = superstruct.type({
|
|
4097
|
+
program: superstruct.string(),
|
|
4098
|
+
programId: PublicKeyFromString,
|
|
4099
|
+
parsed: superstruct.unknown()
|
|
4100
|
+
});
|
|
4101
|
+
const PartiallyDecodedInstructionStruct = superstruct.type({
|
|
4102
|
+
programId: PublicKeyFromString,
|
|
4103
|
+
accounts: superstruct.array(PublicKeyFromString),
|
|
4104
|
+
data: superstruct.string()
|
|
4105
|
+
});
|
|
4096
4106
|
const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.type({
|
|
4097
4107
|
err: superstruct.nullable(superstruct.union([superstruct.type({}), superstruct.string()])),
|
|
4098
4108
|
logs: superstruct.nullable(superstruct.array(superstruct.string())),
|
|
@@ -4107,13 +4117,17 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
4107
4117
|
returnData: superstruct.optional(superstruct.nullable(superstruct.type({
|
|
4108
4118
|
programId: superstruct.string(),
|
|
4109
4119
|
data: superstruct.tuple([superstruct.string(), superstruct.literal('base64')])
|
|
4110
|
-
})))
|
|
4120
|
+
}))),
|
|
4121
|
+
innerInstructions: superstruct.optional(superstruct.nullable(superstruct.array(superstruct.type({
|
|
4122
|
+
index: superstruct.number(),
|
|
4123
|
+
instructions: superstruct.array(superstruct.union([ParsedInstructionStruct, PartiallyDecodedInstructionStruct]))
|
|
4124
|
+
}))))
|
|
4111
4125
|
}));
|
|
4112
4126
|
|
|
4113
4127
|
/**
|
|
4114
4128
|
* Metadata for a parsed confirmed transaction on the ledger
|
|
4115
4129
|
*
|
|
4116
|
-
* @deprecated Deprecated since
|
|
4130
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionMeta} instead.
|
|
4117
4131
|
*/
|
|
4118
4132
|
|
|
4119
4133
|
/**
|
|
@@ -4143,7 +4157,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
4143
4157
|
/**
|
|
4144
4158
|
* A confirmed transaction on the ledger
|
|
4145
4159
|
*
|
|
4146
|
-
* @deprecated Deprecated since
|
|
4160
|
+
* @deprecated Deprecated since RPC v1.8.0.
|
|
4147
4161
|
*/
|
|
4148
4162
|
|
|
4149
4163
|
/**
|
|
@@ -4173,7 +4187,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
4173
4187
|
/**
|
|
4174
4188
|
* A parsed and confirmed transaction on the ledger
|
|
4175
4189
|
*
|
|
4176
|
-
* @deprecated Deprecated since
|
|
4190
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
|
|
4177
4191
|
*/
|
|
4178
4192
|
|
|
4179
4193
|
/**
|
|
@@ -4219,7 +4233,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
4219
4233
|
/**
|
|
4220
4234
|
* A confirmed block on the ledger
|
|
4221
4235
|
*
|
|
4222
|
-
* @deprecated Deprecated since
|
|
4236
|
+
* @deprecated Deprecated since RPC v1.8.0.
|
|
4223
4237
|
*/
|
|
4224
4238
|
|
|
4225
4239
|
/**
|
|
@@ -4921,7 +4935,7 @@ const GetParsedNoneModeBlockRpcResult = jsonRpcResult(superstruct.nullable(super
|
|
|
4921
4935
|
/**
|
|
4922
4936
|
* Expected JSON RPC response for the "getConfirmedBlock" message
|
|
4923
4937
|
*
|
|
4924
|
-
* @deprecated Deprecated since
|
|
4938
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link GetBlockRpcResult} instead.
|
|
4925
4939
|
*/
|
|
4926
4940
|
const GetConfirmedBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
|
|
4927
4941
|
blockhash: superstruct.string(),
|
|
@@ -4971,7 +4985,7 @@ const GetParsedTransactionRpcResult = jsonRpcResult(superstruct.nullable(superst
|
|
|
4971
4985
|
/**
|
|
4972
4986
|
* Expected JSON RPC response for the "getRecentBlockhash" message
|
|
4973
4987
|
*
|
|
4974
|
-
* @deprecated Deprecated since
|
|
4988
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
|
|
4975
4989
|
*/
|
|
4976
4990
|
const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(superstruct.type({
|
|
4977
4991
|
blockhash: superstruct.string(),
|
|
@@ -5659,6 +5673,8 @@ class Connection {
|
|
|
5659
5673
|
|
|
5660
5674
|
/**
|
|
5661
5675
|
* Returns epoch activation information for a stake account that has been delegated
|
|
5676
|
+
*
|
|
5677
|
+
* @deprecated Deprecated since RPC v1.18; will be removed in a future version.
|
|
5662
5678
|
*/
|
|
5663
5679
|
async getStakeActivation(publicKey, commitmentOrConfig, epoch) {
|
|
5664
5680
|
const {
|
|
@@ -6230,7 +6246,7 @@ class Connection {
|
|
|
6230
6246
|
/**
|
|
6231
6247
|
* Fetch the current total currency supply of the cluster in lamports
|
|
6232
6248
|
*
|
|
6233
|
-
* @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.
|
|
6249
|
+
* @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead.
|
|
6234
6250
|
*/
|
|
6235
6251
|
async getTotalSupply(commitment) {
|
|
6236
6252
|
const result = await this.getSupply({
|
|
@@ -6347,7 +6363,7 @@ class Connection {
|
|
|
6347
6363
|
* Fetch a recent blockhash from the cluster, return with context
|
|
6348
6364
|
* @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
|
|
6349
6365
|
*
|
|
6350
|
-
* @deprecated Deprecated since
|
|
6366
|
+
* @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
|
|
6351
6367
|
*/
|
|
6352
6368
|
async getRecentBlockhashAndContext(commitment) {
|
|
6353
6369
|
const args = this._buildArgs([], commitment);
|
|
@@ -6375,7 +6391,7 @@ class Connection {
|
|
|
6375
6391
|
/**
|
|
6376
6392
|
* Fetch the fee calculator for a recent blockhash from the cluster, return with context
|
|
6377
6393
|
*
|
|
6378
|
-
* @deprecated Deprecated since
|
|
6394
|
+
* @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead.
|
|
6379
6395
|
*/
|
|
6380
6396
|
async getFeeCalculatorForBlockhash(blockhash, commitment) {
|
|
6381
6397
|
const args = this._buildArgs([blockhash], commitment);
|
|
@@ -6428,7 +6444,7 @@ class Connection {
|
|
|
6428
6444
|
* Fetch a recent blockhash from the cluster
|
|
6429
6445
|
* @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
|
|
6430
6446
|
*
|
|
6431
|
-
* @deprecated Deprecated since
|
|
6447
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead.
|
|
6432
6448
|
*/
|
|
6433
6449
|
async getRecentBlockhash(commitment) {
|
|
6434
6450
|
try {
|
|
@@ -6810,7 +6826,7 @@ class Connection {
|
|
|
6810
6826
|
* Fetch a list of Transactions and transaction statuses from the cluster
|
|
6811
6827
|
* for a confirmed block.
|
|
6812
6828
|
*
|
|
6813
|
-
* @deprecated Deprecated since v1.
|
|
6829
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead.
|
|
6814
6830
|
*/
|
|
6815
6831
|
async getConfirmedBlock(slot, commitment) {
|
|
6816
6832
|
const args = this._buildArgsAtLeastConfirmed([slot], commitment);
|
|
@@ -6889,7 +6905,7 @@ class Connection {
|
|
|
6889
6905
|
/**
|
|
6890
6906
|
* Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
|
|
6891
6907
|
*
|
|
6892
|
-
* @deprecated Deprecated since
|
|
6908
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead.
|
|
6893
6909
|
*/
|
|
6894
6910
|
async getConfirmedBlockSignatures(slot, commitment) {
|
|
6895
6911
|
const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {
|
|
@@ -6911,7 +6927,7 @@ class Connection {
|
|
|
6911
6927
|
/**
|
|
6912
6928
|
* Fetch a transaction details for a confirmed transaction
|
|
6913
6929
|
*
|
|
6914
|
-
* @deprecated Deprecated since
|
|
6930
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead.
|
|
6915
6931
|
*/
|
|
6916
6932
|
async getConfirmedTransaction(signature, commitment) {
|
|
6917
6933
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment);
|
|
@@ -6933,7 +6949,7 @@ class Connection {
|
|
|
6933
6949
|
/**
|
|
6934
6950
|
* Fetch parsed transaction details for a confirmed transaction
|
|
6935
6951
|
*
|
|
6936
|
-
* @deprecated Deprecated since
|
|
6952
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead.
|
|
6937
6953
|
*/
|
|
6938
6954
|
async getParsedConfirmedTransaction(signature, commitment) {
|
|
6939
6955
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
|
|
@@ -6948,7 +6964,7 @@ class Connection {
|
|
|
6948
6964
|
/**
|
|
6949
6965
|
* Fetch parsed transaction details for a batch of confirmed transactions
|
|
6950
6966
|
*
|
|
6951
|
-
* @deprecated Deprecated since
|
|
6967
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead.
|
|
6952
6968
|
*/
|
|
6953
6969
|
async getParsedConfirmedTransactions(signatures, commitment) {
|
|
6954
6970
|
const batch = signatures.map(signature => {
|
|
@@ -6973,7 +6989,7 @@ class Connection {
|
|
|
6973
6989
|
* Fetch a list of all the confirmed signatures for transactions involving an address
|
|
6974
6990
|
* within a specified slot range. Max range allowed is 10,000 slots.
|
|
6975
6991
|
*
|
|
6976
|
-
* @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
|
|
6992
|
+
* @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
|
|
6977
6993
|
*
|
|
6978
6994
|
* @param address queried address
|
|
6979
6995
|
* @param startSlot start slot, inclusive
|
|
@@ -7027,9 +7043,7 @@ class Connection {
|
|
|
7027
7043
|
* Returns confirmed signatures for transactions involving an
|
|
7028
7044
|
* address backwards in time from the provided signature or most recent confirmed block
|
|
7029
7045
|
*
|
|
7030
|
-
*
|
|
7031
|
-
* @param address queried address
|
|
7032
|
-
* @param options
|
|
7046
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead.
|
|
7033
7047
|
*/
|
|
7034
7048
|
async getConfirmedSignaturesForAddress2(address, options, commitment) {
|
|
7035
7049
|
const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);
|
|
@@ -7220,6 +7234,9 @@ class Connection {
|
|
|
7220
7234
|
if (!('commitment' in config)) {
|
|
7221
7235
|
config.commitment = this.commitment;
|
|
7222
7236
|
}
|
|
7237
|
+
if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
|
|
7238
|
+
config.innerInstructions = configOrSigners.innerInstructions;
|
|
7239
|
+
}
|
|
7223
7240
|
const args = [encodedTransaction, config];
|
|
7224
7241
|
const unsafeRes = await this._rpcRequest('simulateTransaction', args);
|
|
7225
7242
|
const res = superstruct.create(unsafeRes, SimulatedTransactionResponseStruct);
|
|
@@ -7291,6 +7308,9 @@ class Connection {
|
|
|
7291
7308
|
if (signers) {
|
|
7292
7309
|
config.sigVerify = true;
|
|
7293
7310
|
}
|
|
7311
|
+
if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
|
|
7312
|
+
config.innerInstructions = configOrSigners.innerInstructions;
|
|
7313
|
+
}
|
|
7294
7314
|
const args = [encodedTransaction, config];
|
|
7295
7315
|
const unsafeRes = await this._rpcRequest('simulateTransaction', args);
|
|
7296
7316
|
const res = superstruct.create(unsafeRes, SimulatedTransactionResponseStruct);
|