@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.cjs.js
CHANGED
|
@@ -4767,6 +4767,16 @@ const VersionResult = superstruct.type({
|
|
|
4767
4767
|
'solana-core': superstruct.string(),
|
|
4768
4768
|
'feature-set': superstruct.optional(superstruct.number())
|
|
4769
4769
|
});
|
|
4770
|
+
const ParsedInstructionStruct = superstruct.type({
|
|
4771
|
+
program: superstruct.string(),
|
|
4772
|
+
programId: PublicKeyFromString,
|
|
4773
|
+
parsed: superstruct.unknown()
|
|
4774
|
+
});
|
|
4775
|
+
const PartiallyDecodedInstructionStruct = superstruct.type({
|
|
4776
|
+
programId: PublicKeyFromString,
|
|
4777
|
+
accounts: superstruct.array(PublicKeyFromString),
|
|
4778
|
+
data: superstruct.string()
|
|
4779
|
+
});
|
|
4770
4780
|
const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.type({
|
|
4771
4781
|
err: superstruct.nullable(superstruct.union([superstruct.type({}), superstruct.string()])),
|
|
4772
4782
|
logs: superstruct.nullable(superstruct.array(superstruct.string())),
|
|
@@ -4781,13 +4791,17 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
4781
4791
|
returnData: superstruct.optional(superstruct.nullable(superstruct.type({
|
|
4782
4792
|
programId: superstruct.string(),
|
|
4783
4793
|
data: superstruct.tuple([superstruct.string(), superstruct.literal('base64')])
|
|
4784
|
-
})))
|
|
4794
|
+
}))),
|
|
4795
|
+
innerInstructions: superstruct.optional(superstruct.nullable(superstruct.array(superstruct.type({
|
|
4796
|
+
index: superstruct.number(),
|
|
4797
|
+
instructions: superstruct.array(superstruct.union([ParsedInstructionStruct, PartiallyDecodedInstructionStruct]))
|
|
4798
|
+
}))))
|
|
4785
4799
|
}));
|
|
4786
4800
|
|
|
4787
4801
|
/**
|
|
4788
4802
|
* Metadata for a parsed confirmed transaction on the ledger
|
|
4789
4803
|
*
|
|
4790
|
-
* @deprecated Deprecated since
|
|
4804
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionMeta} instead.
|
|
4791
4805
|
*/
|
|
4792
4806
|
|
|
4793
4807
|
/**
|
|
@@ -4817,7 +4831,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
4817
4831
|
/**
|
|
4818
4832
|
* A confirmed transaction on the ledger
|
|
4819
4833
|
*
|
|
4820
|
-
* @deprecated Deprecated since
|
|
4834
|
+
* @deprecated Deprecated since RPC v1.8.0.
|
|
4821
4835
|
*/
|
|
4822
4836
|
|
|
4823
4837
|
/**
|
|
@@ -4847,7 +4861,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
4847
4861
|
/**
|
|
4848
4862
|
* A parsed and confirmed transaction on the ledger
|
|
4849
4863
|
*
|
|
4850
|
-
* @deprecated Deprecated since
|
|
4864
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
|
|
4851
4865
|
*/
|
|
4852
4866
|
|
|
4853
4867
|
/**
|
|
@@ -4893,7 +4907,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
4893
4907
|
/**
|
|
4894
4908
|
* A confirmed block on the ledger
|
|
4895
4909
|
*
|
|
4896
|
-
* @deprecated Deprecated since
|
|
4910
|
+
* @deprecated Deprecated since RPC v1.8.0.
|
|
4897
4911
|
*/
|
|
4898
4912
|
|
|
4899
4913
|
/**
|
|
@@ -5618,7 +5632,7 @@ const GetParsedNoneModeBlockRpcResult = jsonRpcResult(superstruct.nullable(super
|
|
|
5618
5632
|
/**
|
|
5619
5633
|
* Expected JSON RPC response for the "getConfirmedBlock" message
|
|
5620
5634
|
*
|
|
5621
|
-
* @deprecated Deprecated since
|
|
5635
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link GetBlockRpcResult} instead.
|
|
5622
5636
|
*/
|
|
5623
5637
|
const GetConfirmedBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
|
|
5624
5638
|
blockhash: superstruct.string(),
|
|
@@ -5668,7 +5682,7 @@ const GetParsedTransactionRpcResult = jsonRpcResult(superstruct.nullable(superst
|
|
|
5668
5682
|
/**
|
|
5669
5683
|
* Expected JSON RPC response for the "getRecentBlockhash" message
|
|
5670
5684
|
*
|
|
5671
|
-
* @deprecated Deprecated since
|
|
5685
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
|
|
5672
5686
|
*/
|
|
5673
5687
|
const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(superstruct.type({
|
|
5674
5688
|
blockhash: superstruct.string(),
|
|
@@ -6356,6 +6370,8 @@ class Connection {
|
|
|
6356
6370
|
|
|
6357
6371
|
/**
|
|
6358
6372
|
* Returns epoch activation information for a stake account that has been delegated
|
|
6373
|
+
*
|
|
6374
|
+
* @deprecated Deprecated since RPC v1.18; will be removed in a future version.
|
|
6359
6375
|
*/
|
|
6360
6376
|
async getStakeActivation(publicKey, commitmentOrConfig, epoch) {
|
|
6361
6377
|
const {
|
|
@@ -6927,7 +6943,7 @@ class Connection {
|
|
|
6927
6943
|
/**
|
|
6928
6944
|
* Fetch the current total currency supply of the cluster in lamports
|
|
6929
6945
|
*
|
|
6930
|
-
* @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.
|
|
6946
|
+
* @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead.
|
|
6931
6947
|
*/
|
|
6932
6948
|
async getTotalSupply(commitment) {
|
|
6933
6949
|
const result = await this.getSupply({
|
|
@@ -7044,7 +7060,7 @@ class Connection {
|
|
|
7044
7060
|
* Fetch a recent blockhash from the cluster, return with context
|
|
7045
7061
|
* @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
|
|
7046
7062
|
*
|
|
7047
|
-
* @deprecated Deprecated since
|
|
7063
|
+
* @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
|
|
7048
7064
|
*/
|
|
7049
7065
|
async getRecentBlockhashAndContext(commitment) {
|
|
7050
7066
|
const args = this._buildArgs([], commitment);
|
|
@@ -7072,7 +7088,7 @@ class Connection {
|
|
|
7072
7088
|
/**
|
|
7073
7089
|
* Fetch the fee calculator for a recent blockhash from the cluster, return with context
|
|
7074
7090
|
*
|
|
7075
|
-
* @deprecated Deprecated since
|
|
7091
|
+
* @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead.
|
|
7076
7092
|
*/
|
|
7077
7093
|
async getFeeCalculatorForBlockhash(blockhash, commitment) {
|
|
7078
7094
|
const args = this._buildArgs([blockhash], commitment);
|
|
@@ -7125,7 +7141,7 @@ class Connection {
|
|
|
7125
7141
|
* Fetch a recent blockhash from the cluster
|
|
7126
7142
|
* @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
|
|
7127
7143
|
*
|
|
7128
|
-
* @deprecated Deprecated since
|
|
7144
|
+
* @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead.
|
|
7129
7145
|
*/
|
|
7130
7146
|
async getRecentBlockhash(commitment) {
|
|
7131
7147
|
try {
|
|
@@ -7507,7 +7523,7 @@ class Connection {
|
|
|
7507
7523
|
* Fetch a list of Transactions and transaction statuses from the cluster
|
|
7508
7524
|
* for a confirmed block.
|
|
7509
7525
|
*
|
|
7510
|
-
* @deprecated Deprecated since v1.
|
|
7526
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead.
|
|
7511
7527
|
*/
|
|
7512
7528
|
async getConfirmedBlock(slot, commitment) {
|
|
7513
7529
|
const args = this._buildArgsAtLeastConfirmed([slot], commitment);
|
|
@@ -7586,7 +7602,7 @@ class Connection {
|
|
|
7586
7602
|
/**
|
|
7587
7603
|
* Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
|
|
7588
7604
|
*
|
|
7589
|
-
* @deprecated Deprecated since
|
|
7605
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead.
|
|
7590
7606
|
*/
|
|
7591
7607
|
async getConfirmedBlockSignatures(slot, commitment) {
|
|
7592
7608
|
const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {
|
|
@@ -7608,7 +7624,7 @@ class Connection {
|
|
|
7608
7624
|
/**
|
|
7609
7625
|
* Fetch a transaction details for a confirmed transaction
|
|
7610
7626
|
*
|
|
7611
|
-
* @deprecated Deprecated since
|
|
7627
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead.
|
|
7612
7628
|
*/
|
|
7613
7629
|
async getConfirmedTransaction(signature, commitment) {
|
|
7614
7630
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment);
|
|
@@ -7630,7 +7646,7 @@ class Connection {
|
|
|
7630
7646
|
/**
|
|
7631
7647
|
* Fetch parsed transaction details for a confirmed transaction
|
|
7632
7648
|
*
|
|
7633
|
-
* @deprecated Deprecated since
|
|
7649
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead.
|
|
7634
7650
|
*/
|
|
7635
7651
|
async getParsedConfirmedTransaction(signature, commitment) {
|
|
7636
7652
|
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
|
|
@@ -7645,7 +7661,7 @@ class Connection {
|
|
|
7645
7661
|
/**
|
|
7646
7662
|
* Fetch parsed transaction details for a batch of confirmed transactions
|
|
7647
7663
|
*
|
|
7648
|
-
* @deprecated Deprecated since
|
|
7664
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead.
|
|
7649
7665
|
*/
|
|
7650
7666
|
async getParsedConfirmedTransactions(signatures, commitment) {
|
|
7651
7667
|
const batch = signatures.map(signature => {
|
|
@@ -7670,7 +7686,7 @@ class Connection {
|
|
|
7670
7686
|
* Fetch a list of all the confirmed signatures for transactions involving an address
|
|
7671
7687
|
* within a specified slot range. Max range allowed is 10,000 slots.
|
|
7672
7688
|
*
|
|
7673
|
-
* @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
|
|
7689
|
+
* @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
|
|
7674
7690
|
*
|
|
7675
7691
|
* @param address queried address
|
|
7676
7692
|
* @param startSlot start slot, inclusive
|
|
@@ -7724,9 +7740,7 @@ class Connection {
|
|
|
7724
7740
|
* Returns confirmed signatures for transactions involving an
|
|
7725
7741
|
* address backwards in time from the provided signature or most recent confirmed block
|
|
7726
7742
|
*
|
|
7727
|
-
*
|
|
7728
|
-
* @param address queried address
|
|
7729
|
-
* @param options
|
|
7743
|
+
* @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead.
|
|
7730
7744
|
*/
|
|
7731
7745
|
async getConfirmedSignaturesForAddress2(address, options, commitment) {
|
|
7732
7746
|
const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);
|
|
@@ -7917,6 +7931,9 @@ class Connection {
|
|
|
7917
7931
|
if (!('commitment' in config)) {
|
|
7918
7932
|
config.commitment = this.commitment;
|
|
7919
7933
|
}
|
|
7934
|
+
if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
|
|
7935
|
+
config.innerInstructions = configOrSigners.innerInstructions;
|
|
7936
|
+
}
|
|
7920
7937
|
const args = [encodedTransaction, config];
|
|
7921
7938
|
const unsafeRes = await this._rpcRequest('simulateTransaction', args);
|
|
7922
7939
|
const res = superstruct.create(unsafeRes, SimulatedTransactionResponseStruct);
|
|
@@ -7988,6 +8005,9 @@ class Connection {
|
|
|
7988
8005
|
if (signers) {
|
|
7989
8006
|
config.sigVerify = true;
|
|
7990
8007
|
}
|
|
8008
|
+
if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
|
|
8009
|
+
config.innerInstructions = configOrSigners.innerInstructions;
|
|
8010
|
+
}
|
|
7991
8011
|
const args = [encodedTransaction, config];
|
|
7992
8012
|
const unsafeRes = await this._rpcRequest('simulateTransaction', args);
|
|
7993
8013
|
const res = superstruct.create(unsafeRes, SimulatedTransactionResponseStruct);
|