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