@solana/web3.js 1.49.0 → 1.50.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 +43 -6
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +43 -6
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +43 -6
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +16 -3
- package/lib/index.esm.js +43 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +43 -6
- 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 +43 -6
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +46 -6
package/lib/index.browser.esm.js
CHANGED
|
@@ -7104,8 +7104,13 @@ class Connection {
|
|
|
7104
7104
|
*/
|
|
7105
7105
|
|
|
7106
7106
|
|
|
7107
|
-
async getParsedTransaction(signature,
|
|
7108
|
-
const
|
|
7107
|
+
async getParsedTransaction(signature, commitmentOrConfig) {
|
|
7108
|
+
const {
|
|
7109
|
+
commitment,
|
|
7110
|
+
config
|
|
7111
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
7112
|
+
|
|
7113
|
+
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);
|
|
7109
7114
|
|
|
7110
7115
|
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
7111
7116
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
@@ -7121,9 +7126,13 @@ class Connection {
|
|
|
7121
7126
|
*/
|
|
7122
7127
|
|
|
7123
7128
|
|
|
7124
|
-
async getParsedTransactions(signatures,
|
|
7129
|
+
async getParsedTransactions(signatures, commitmentOrConfig) {
|
|
7130
|
+
const {
|
|
7131
|
+
commitment,
|
|
7132
|
+
config
|
|
7133
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
7125
7134
|
const batch = signatures.map(signature => {
|
|
7126
|
-
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
|
|
7135
|
+
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);
|
|
7127
7136
|
|
|
7128
7137
|
return {
|
|
7129
7138
|
methodName: 'getTransaction',
|
|
@@ -7148,9 +7157,15 @@ class Connection {
|
|
|
7148
7157
|
*/
|
|
7149
7158
|
|
|
7150
7159
|
|
|
7151
|
-
async getTransactions(signatures,
|
|
7160
|
+
async getTransactions(signatures, commitmentOrConfig) {
|
|
7161
|
+
const {
|
|
7162
|
+
commitment,
|
|
7163
|
+
config
|
|
7164
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
7152
7165
|
const batch = signatures.map(signature => {
|
|
7153
|
-
const args = this._buildArgsAtLeastConfirmed([signature], commitment
|
|
7166
|
+
const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined
|
|
7167
|
+
/* encoding */
|
|
7168
|
+
, config);
|
|
7154
7169
|
|
|
7155
7170
|
return {
|
|
7156
7171
|
methodName: 'getTransaction',
|
|
@@ -7592,6 +7607,28 @@ class Connection {
|
|
|
7592
7607
|
this._pollingBlockhash = false;
|
|
7593
7608
|
}
|
|
7594
7609
|
}
|
|
7610
|
+
/**
|
|
7611
|
+
* get the stake minimum delegation
|
|
7612
|
+
*/
|
|
7613
|
+
|
|
7614
|
+
|
|
7615
|
+
async getStakeMinimumDelegation(config) {
|
|
7616
|
+
const {
|
|
7617
|
+
commitment,
|
|
7618
|
+
config: configArg
|
|
7619
|
+
} = extractCommitmentFromConfig(config);
|
|
7620
|
+
|
|
7621
|
+
const args = this._buildArgs([], commitment, 'base64', configArg);
|
|
7622
|
+
|
|
7623
|
+
const unsafeRes = await this._rpcRequest('getStakeMinimumDelegation', args);
|
|
7624
|
+
const res = create(unsafeRes, jsonRpcResultAndContext(number()));
|
|
7625
|
+
|
|
7626
|
+
if ('error' in res) {
|
|
7627
|
+
throw new SolanaJSONRPCError(res.error, `failed to get stake minimum delegation`);
|
|
7628
|
+
}
|
|
7629
|
+
|
|
7630
|
+
return res.result;
|
|
7631
|
+
}
|
|
7595
7632
|
/**
|
|
7596
7633
|
* Simulate a transaction
|
|
7597
7634
|
*/
|