@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.cjs.js
CHANGED
|
@@ -7135,8 +7135,13 @@ class Connection {
|
|
|
7135
7135
|
*/
|
|
7136
7136
|
|
|
7137
7137
|
|
|
7138
|
-
async getParsedTransaction(signature,
|
|
7139
|
-
const
|
|
7138
|
+
async getParsedTransaction(signature, commitmentOrConfig) {
|
|
7139
|
+
const {
|
|
7140
|
+
commitment,
|
|
7141
|
+
config
|
|
7142
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
7143
|
+
|
|
7144
|
+
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);
|
|
7140
7145
|
|
|
7141
7146
|
const unsafeRes = await this._rpcRequest('getTransaction', args);
|
|
7142
7147
|
const res = superstruct.create(unsafeRes, GetParsedTransactionRpcResult);
|
|
@@ -7152,9 +7157,13 @@ class Connection {
|
|
|
7152
7157
|
*/
|
|
7153
7158
|
|
|
7154
7159
|
|
|
7155
|
-
async getParsedTransactions(signatures,
|
|
7160
|
+
async getParsedTransactions(signatures, commitmentOrConfig) {
|
|
7161
|
+
const {
|
|
7162
|
+
commitment,
|
|
7163
|
+
config
|
|
7164
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
7156
7165
|
const batch = signatures.map(signature => {
|
|
7157
|
-
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
|
|
7166
|
+
const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);
|
|
7158
7167
|
|
|
7159
7168
|
return {
|
|
7160
7169
|
methodName: 'getTransaction',
|
|
@@ -7179,9 +7188,15 @@ class Connection {
|
|
|
7179
7188
|
*/
|
|
7180
7189
|
|
|
7181
7190
|
|
|
7182
|
-
async getTransactions(signatures,
|
|
7191
|
+
async getTransactions(signatures, commitmentOrConfig) {
|
|
7192
|
+
const {
|
|
7193
|
+
commitment,
|
|
7194
|
+
config
|
|
7195
|
+
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
7183
7196
|
const batch = signatures.map(signature => {
|
|
7184
|
-
const args = this._buildArgsAtLeastConfirmed([signature], commitment
|
|
7197
|
+
const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined
|
|
7198
|
+
/* encoding */
|
|
7199
|
+
, config);
|
|
7185
7200
|
|
|
7186
7201
|
return {
|
|
7187
7202
|
methodName: 'getTransaction',
|
|
@@ -7623,6 +7638,28 @@ class Connection {
|
|
|
7623
7638
|
this._pollingBlockhash = false;
|
|
7624
7639
|
}
|
|
7625
7640
|
}
|
|
7641
|
+
/**
|
|
7642
|
+
* get the stake minimum delegation
|
|
7643
|
+
*/
|
|
7644
|
+
|
|
7645
|
+
|
|
7646
|
+
async getStakeMinimumDelegation(config) {
|
|
7647
|
+
const {
|
|
7648
|
+
commitment,
|
|
7649
|
+
config: configArg
|
|
7650
|
+
} = extractCommitmentFromConfig(config);
|
|
7651
|
+
|
|
7652
|
+
const args = this._buildArgs([], commitment, 'base64', configArg);
|
|
7653
|
+
|
|
7654
|
+
const unsafeRes = await this._rpcRequest('getStakeMinimumDelegation', args);
|
|
7655
|
+
const res = superstruct.create(unsafeRes, jsonRpcResultAndContext(superstruct.number()));
|
|
7656
|
+
|
|
7657
|
+
if ('error' in res) {
|
|
7658
|
+
throw new SolanaJSONRPCError(res.error, `failed to get stake minimum delegation`);
|
|
7659
|
+
}
|
|
7660
|
+
|
|
7661
|
+
return res.result;
|
|
7662
|
+
}
|
|
7626
7663
|
/**
|
|
7627
7664
|
* Simulate a transaction
|
|
7628
7665
|
*/
|