@solana/web3.js 1.46.0 → 1.47.2
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 +92 -57
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +91 -58
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +92 -57
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +36 -0
- package/lib/index.esm.js +91 -58
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +92 -57
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -2
- package/lib/index.iife.min.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +103 -102
- package/src/errors.ts +41 -0
package/lib/index.iife.js
CHANGED
|
@@ -19357,6 +19357,41 @@ var solanaWeb3 = (function (exports) {
|
|
|
19357
19357
|
this.logs = logs;
|
|
19358
19358
|
}
|
|
19359
19359
|
|
|
19360
|
+
} // Keep in sync with client/src/rpc_custom_errors.rs
|
|
19361
|
+
// Typescript `enums` thwart tree-shaking. See https://bargsten.org/jsts/enums/
|
|
19362
|
+
|
|
19363
|
+
const SolanaJSONRPCErrorCode = {
|
|
19364
|
+
JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001,
|
|
19365
|
+
JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002,
|
|
19366
|
+
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003,
|
|
19367
|
+
JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004,
|
|
19368
|
+
JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005,
|
|
19369
|
+
JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006,
|
|
19370
|
+
JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007,
|
|
19371
|
+
JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008,
|
|
19372
|
+
JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009,
|
|
19373
|
+
JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010,
|
|
19374
|
+
JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011,
|
|
19375
|
+
JSON_RPC_SCAN_ERROR: -32012,
|
|
19376
|
+
JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013,
|
|
19377
|
+
JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014,
|
|
19378
|
+
JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015,
|
|
19379
|
+
JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016
|
|
19380
|
+
};
|
|
19381
|
+
class SolanaJSONRPCError extends Error {
|
|
19382
|
+
constructor({
|
|
19383
|
+
code,
|
|
19384
|
+
message,
|
|
19385
|
+
data
|
|
19386
|
+
}, customMessage) {
|
|
19387
|
+
super(customMessage != null ? `${customMessage}: ${message}` : message);
|
|
19388
|
+
this.code = void 0;
|
|
19389
|
+
this.data = void 0;
|
|
19390
|
+
this.code = code;
|
|
19391
|
+
this.data = data;
|
|
19392
|
+
this.name = 'SolanaJSONRPCError';
|
|
19393
|
+
}
|
|
19394
|
+
|
|
19360
19395
|
}
|
|
19361
19396
|
|
|
19362
19397
|
var fetchImpl = globalThis.fetch;
|
|
@@ -20519,7 +20554,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20519
20554
|
const res = create(unsafeRes, jsonRpcResultAndContext(number()));
|
|
20520
20555
|
|
|
20521
20556
|
if ('error' in res) {
|
|
20522
|
-
throw new
|
|
20557
|
+
throw new SolanaJSONRPCError(res.error, `failed to get balance for ${publicKey.toBase58()}`);
|
|
20523
20558
|
}
|
|
20524
20559
|
|
|
20525
20560
|
return res.result;
|
|
@@ -20544,7 +20579,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20544
20579
|
const res = create(unsafeRes, jsonRpcResult(nullable(number())));
|
|
20545
20580
|
|
|
20546
20581
|
if ('error' in res) {
|
|
20547
|
-
throw new
|
|
20582
|
+
throw new SolanaJSONRPCError(res.error, `failed to get block time for slot ${slot}`);
|
|
20548
20583
|
}
|
|
20549
20584
|
|
|
20550
20585
|
return res.result;
|
|
@@ -20560,7 +20595,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20560
20595
|
const res = create(unsafeRes, jsonRpcResult(number()));
|
|
20561
20596
|
|
|
20562
20597
|
if ('error' in res) {
|
|
20563
|
-
throw new
|
|
20598
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get minimum ledger slot');
|
|
20564
20599
|
}
|
|
20565
20600
|
|
|
20566
20601
|
return res.result;
|
|
@@ -20575,7 +20610,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20575
20610
|
const res = create(unsafeRes, SlotRpcResult);
|
|
20576
20611
|
|
|
20577
20612
|
if ('error' in res) {
|
|
20578
|
-
throw new
|
|
20613
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get first available block');
|
|
20579
20614
|
}
|
|
20580
20615
|
|
|
20581
20616
|
return res.result;
|
|
@@ -20606,7 +20641,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20606
20641
|
const res = create(unsafeRes, GetSupplyRpcResult);
|
|
20607
20642
|
|
|
20608
20643
|
if ('error' in res) {
|
|
20609
|
-
throw new
|
|
20644
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get supply');
|
|
20610
20645
|
}
|
|
20611
20646
|
|
|
20612
20647
|
return res.result;
|
|
@@ -20623,7 +20658,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20623
20658
|
const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));
|
|
20624
20659
|
|
|
20625
20660
|
if ('error' in res) {
|
|
20626
|
-
throw new
|
|
20661
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get token supply');
|
|
20627
20662
|
}
|
|
20628
20663
|
|
|
20629
20664
|
return res.result;
|
|
@@ -20640,7 +20675,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20640
20675
|
const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));
|
|
20641
20676
|
|
|
20642
20677
|
if ('error' in res) {
|
|
20643
|
-
throw new
|
|
20678
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get token account balance');
|
|
20644
20679
|
}
|
|
20645
20680
|
|
|
20646
20681
|
return res.result;
|
|
@@ -20675,7 +20710,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20675
20710
|
const res = create(unsafeRes, GetTokenAccountsByOwner);
|
|
20676
20711
|
|
|
20677
20712
|
if ('error' in res) {
|
|
20678
|
-
throw new
|
|
20713
|
+
throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`);
|
|
20679
20714
|
}
|
|
20680
20715
|
|
|
20681
20716
|
return res.result;
|
|
@@ -20706,7 +20741,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20706
20741
|
const res = create(unsafeRes, GetParsedTokenAccountsByOwner);
|
|
20707
20742
|
|
|
20708
20743
|
if ('error' in res) {
|
|
20709
|
-
throw new
|
|
20744
|
+
throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`);
|
|
20710
20745
|
}
|
|
20711
20746
|
|
|
20712
20747
|
return res.result;
|
|
@@ -20725,7 +20760,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20725
20760
|
const res = create(unsafeRes, GetLargestAccountsRpcResult);
|
|
20726
20761
|
|
|
20727
20762
|
if ('error' in res) {
|
|
20728
|
-
throw new
|
|
20763
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get largest accounts');
|
|
20729
20764
|
}
|
|
20730
20765
|
|
|
20731
20766
|
return res.result;
|
|
@@ -20743,7 +20778,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20743
20778
|
const res = create(unsafeRes, GetTokenLargestAccountsResult);
|
|
20744
20779
|
|
|
20745
20780
|
if ('error' in res) {
|
|
20746
|
-
throw new
|
|
20781
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get token largest accounts');
|
|
20747
20782
|
}
|
|
20748
20783
|
|
|
20749
20784
|
return res.result;
|
|
@@ -20765,7 +20800,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20765
20800
|
const res = create(unsafeRes, jsonRpcResultAndContext(nullable(AccountInfoResult)));
|
|
20766
20801
|
|
|
20767
20802
|
if ('error' in res) {
|
|
20768
|
-
throw new
|
|
20803
|
+
throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey.toBase58()}`);
|
|
20769
20804
|
}
|
|
20770
20805
|
|
|
20771
20806
|
return res.result;
|
|
@@ -20782,7 +20817,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20782
20817
|
const res = create(unsafeRes, jsonRpcResultAndContext(nullable(ParsedAccountInfoResult)));
|
|
20783
20818
|
|
|
20784
20819
|
if ('error' in res) {
|
|
20785
|
-
throw new
|
|
20820
|
+
throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey.toBase58()}`);
|
|
20786
20821
|
}
|
|
20787
20822
|
|
|
20788
20823
|
return res.result;
|
|
@@ -20818,7 +20853,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20818
20853
|
const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(AccountInfoResult))));
|
|
20819
20854
|
|
|
20820
20855
|
if ('error' in res) {
|
|
20821
|
-
throw new
|
|
20856
|
+
throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys}`);
|
|
20822
20857
|
}
|
|
20823
20858
|
|
|
20824
20859
|
return res.result;
|
|
@@ -20853,7 +20888,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20853
20888
|
const res = create(unsafeRes, jsonRpcResult(StakeActivationResult));
|
|
20854
20889
|
|
|
20855
20890
|
if ('error' in res) {
|
|
20856
|
-
throw new
|
|
20891
|
+
throw new SolanaJSONRPCError(res.error, `failed to get Stake Activation ${publicKey.toBase58()}`);
|
|
20857
20892
|
}
|
|
20858
20893
|
|
|
20859
20894
|
return res.result;
|
|
@@ -20881,7 +20916,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20881
20916
|
const res = create(unsafeRes, jsonRpcResult(array(KeyedAccountInfoResult)));
|
|
20882
20917
|
|
|
20883
20918
|
if ('error' in res) {
|
|
20884
|
-
throw new
|
|
20919
|
+
throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`);
|
|
20885
20920
|
}
|
|
20886
20921
|
|
|
20887
20922
|
return res.result;
|
|
@@ -20905,7 +20940,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20905
20940
|
const res = create(unsafeRes, jsonRpcResult(array(KeyedParsedAccountInfoResult)));
|
|
20906
20941
|
|
|
20907
20942
|
if ('error' in res) {
|
|
20908
|
-
throw new
|
|
20943
|
+
throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`);
|
|
20909
20944
|
}
|
|
20910
20945
|
|
|
20911
20946
|
return res.result;
|
|
@@ -21039,7 +21074,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21039
21074
|
const res = create(unsafeRes, jsonRpcResult(array(ContactInfoResult)));
|
|
21040
21075
|
|
|
21041
21076
|
if ('error' in res) {
|
|
21042
|
-
throw new
|
|
21077
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get cluster nodes');
|
|
21043
21078
|
}
|
|
21044
21079
|
|
|
21045
21080
|
return res.result;
|
|
@@ -21056,7 +21091,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21056
21091
|
const res = create(unsafeRes, GetVoteAccounts);
|
|
21057
21092
|
|
|
21058
21093
|
if ('error' in res) {
|
|
21059
|
-
throw new
|
|
21094
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get vote accounts');
|
|
21060
21095
|
}
|
|
21061
21096
|
|
|
21062
21097
|
return res.result;
|
|
@@ -21080,7 +21115,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21080
21115
|
const res = create(unsafeRes, jsonRpcResult(number()));
|
|
21081
21116
|
|
|
21082
21117
|
if ('error' in res) {
|
|
21083
|
-
throw new
|
|
21118
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get slot');
|
|
21084
21119
|
}
|
|
21085
21120
|
|
|
21086
21121
|
return res.result;
|
|
@@ -21104,7 +21139,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21104
21139
|
const res = create(unsafeRes, jsonRpcResult(string()));
|
|
21105
21140
|
|
|
21106
21141
|
if ('error' in res) {
|
|
21107
|
-
throw new
|
|
21142
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get slot leader');
|
|
21108
21143
|
}
|
|
21109
21144
|
|
|
21110
21145
|
return res.result;
|
|
@@ -21123,7 +21158,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21123
21158
|
const res = create(unsafeRes, jsonRpcResult(array(PublicKeyFromString)));
|
|
21124
21159
|
|
|
21125
21160
|
if ('error' in res) {
|
|
21126
|
-
throw new
|
|
21161
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get slot leaders');
|
|
21127
21162
|
}
|
|
21128
21163
|
|
|
21129
21164
|
return res.result;
|
|
@@ -21161,7 +21196,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21161
21196
|
const res = create(unsafeRes, GetSignatureStatusesRpcResult);
|
|
21162
21197
|
|
|
21163
21198
|
if ('error' in res) {
|
|
21164
|
-
throw new
|
|
21199
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get signature status');
|
|
21165
21200
|
}
|
|
21166
21201
|
|
|
21167
21202
|
return res.result;
|
|
@@ -21185,7 +21220,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21185
21220
|
const res = create(unsafeRes, jsonRpcResult(number()));
|
|
21186
21221
|
|
|
21187
21222
|
if ('error' in res) {
|
|
21188
|
-
throw new
|
|
21223
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transaction count');
|
|
21189
21224
|
}
|
|
21190
21225
|
|
|
21191
21226
|
return res.result;
|
|
@@ -21216,7 +21251,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21216
21251
|
const res = create(unsafeRes, GetInflationGovernorRpcResult);
|
|
21217
21252
|
|
|
21218
21253
|
if ('error' in res) {
|
|
21219
|
-
throw new
|
|
21254
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation');
|
|
21220
21255
|
}
|
|
21221
21256
|
|
|
21222
21257
|
return res.result;
|
|
@@ -21242,7 +21277,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21242
21277
|
const res = create(unsafeRes, GetInflationRewardResult);
|
|
21243
21278
|
|
|
21244
21279
|
if ('error' in res) {
|
|
21245
|
-
throw new
|
|
21280
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation reward');
|
|
21246
21281
|
}
|
|
21247
21282
|
|
|
21248
21283
|
return res.result;
|
|
@@ -21266,7 +21301,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21266
21301
|
const res = create(unsafeRes, GetEpochInfoRpcResult);
|
|
21267
21302
|
|
|
21268
21303
|
if ('error' in res) {
|
|
21269
|
-
throw new
|
|
21304
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get epoch info');
|
|
21270
21305
|
}
|
|
21271
21306
|
|
|
21272
21307
|
return res.result;
|
|
@@ -21281,7 +21316,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21281
21316
|
const res = create(unsafeRes, GetEpochScheduleRpcResult);
|
|
21282
21317
|
|
|
21283
21318
|
if ('error' in res) {
|
|
21284
|
-
throw new
|
|
21319
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get epoch schedule');
|
|
21285
21320
|
}
|
|
21286
21321
|
|
|
21287
21322
|
const epochSchedule = res.result;
|
|
@@ -21298,7 +21333,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21298
21333
|
const res = create(unsafeRes, GetLeaderScheduleRpcResult);
|
|
21299
21334
|
|
|
21300
21335
|
if ('error' in res) {
|
|
21301
|
-
throw new
|
|
21336
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get leader schedule');
|
|
21302
21337
|
}
|
|
21303
21338
|
|
|
21304
21339
|
return res.result;
|
|
@@ -21337,7 +21372,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21337
21372
|
const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult);
|
|
21338
21373
|
|
|
21339
21374
|
if ('error' in res) {
|
|
21340
|
-
throw new
|
|
21375
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get recent blockhash');
|
|
21341
21376
|
}
|
|
21342
21377
|
|
|
21343
21378
|
return res.result;
|
|
@@ -21349,13 +21384,11 @@ var solanaWeb3 = (function (exports) {
|
|
|
21349
21384
|
|
|
21350
21385
|
|
|
21351
21386
|
async getRecentPerformanceSamples(limit) {
|
|
21352
|
-
const
|
|
21353
|
-
|
|
21354
|
-
const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', args);
|
|
21387
|
+
const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', limit ? [limit] : []);
|
|
21355
21388
|
const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult);
|
|
21356
21389
|
|
|
21357
21390
|
if ('error' in res) {
|
|
21358
|
-
throw new
|
|
21391
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get recent performance samples');
|
|
21359
21392
|
}
|
|
21360
21393
|
|
|
21361
21394
|
return res.result;
|
|
@@ -21374,7 +21407,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21374
21407
|
const res = create(unsafeRes, GetFeeCalculatorRpcResult);
|
|
21375
21408
|
|
|
21376
21409
|
if ('error' in res) {
|
|
21377
|
-
throw new
|
|
21410
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get fee calculator');
|
|
21378
21411
|
}
|
|
21379
21412
|
|
|
21380
21413
|
const {
|
|
@@ -21400,7 +21433,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21400
21433
|
const res = create(unsafeRes, jsonRpcResultAndContext(nullable(number())));
|
|
21401
21434
|
|
|
21402
21435
|
if ('error' in res) {
|
|
21403
|
-
throw new
|
|
21436
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get slot');
|
|
21404
21437
|
}
|
|
21405
21438
|
|
|
21406
21439
|
if (res.result === null) {
|
|
@@ -21459,7 +21492,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21459
21492
|
const res = create(unsafeRes, GetLatestBlockhashRpcResult);
|
|
21460
21493
|
|
|
21461
21494
|
if ('error' in res) {
|
|
21462
|
-
throw new
|
|
21495
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get latest blockhash');
|
|
21463
21496
|
}
|
|
21464
21497
|
|
|
21465
21498
|
return res.result;
|
|
@@ -21474,7 +21507,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21474
21507
|
const res = create(unsafeRes, jsonRpcResult(VersionResult));
|
|
21475
21508
|
|
|
21476
21509
|
if ('error' in res) {
|
|
21477
|
-
throw new
|
|
21510
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get version');
|
|
21478
21511
|
}
|
|
21479
21512
|
|
|
21480
21513
|
return res.result;
|
|
@@ -21489,7 +21522,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21489
21522
|
const res = create(unsafeRes, jsonRpcResult(string()));
|
|
21490
21523
|
|
|
21491
21524
|
if ('error' in res) {
|
|
21492
|
-
throw new
|
|
21525
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get genesis hash');
|
|
21493
21526
|
}
|
|
21494
21527
|
|
|
21495
21528
|
return res.result;
|
|
@@ -21506,7 +21539,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21506
21539
|
const res = create(unsafeRes, GetBlockRpcResult);
|
|
21507
21540
|
|
|
21508
21541
|
if ('error' in res) {
|
|
21509
|
-
throw new
|
|
21542
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');
|
|
21510
21543
|
}
|
|
21511
21544
|
|
|
21512
21545
|
const result = res.result;
|
|
@@ -21545,7 +21578,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21545
21578
|
const res = create(unsafeRes, jsonRpcResult(number()));
|
|
21546
21579
|
|
|
21547
21580
|
if ('error' in res) {
|
|
21548
|
-
throw new
|
|
21581
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block height information');
|
|
21549
21582
|
}
|
|
21550
21583
|
|
|
21551
21584
|
return res.result;
|
|
@@ -21576,7 +21609,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21576
21609
|
const res = create(unsafeRes, BlockProductionResponseStruct);
|
|
21577
21610
|
|
|
21578
21611
|
if ('error' in res) {
|
|
21579
|
-
throw new
|
|
21612
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block production information');
|
|
21580
21613
|
}
|
|
21581
21614
|
|
|
21582
21615
|
return res.result;
|
|
@@ -21593,7 +21626,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21593
21626
|
const res = create(unsafeRes, GetTransactionRpcResult);
|
|
21594
21627
|
|
|
21595
21628
|
if ('error' in res) {
|
|
21596
|
-
throw new
|
|
21629
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
|
|
21597
21630
|
}
|
|
21598
21631
|
|
|
21599
21632
|
const result = res.result;
|
|
@@ -21616,7 +21649,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21616
21649
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
21617
21650
|
|
|
21618
21651
|
if ('error' in res) {
|
|
21619
|
-
throw new
|
|
21652
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
|
|
21620
21653
|
}
|
|
21621
21654
|
|
|
21622
21655
|
return res.result;
|
|
@@ -21640,7 +21673,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21640
21673
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
21641
21674
|
|
|
21642
21675
|
if ('error' in res) {
|
|
21643
|
-
throw new
|
|
21676
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transactions');
|
|
21644
21677
|
}
|
|
21645
21678
|
|
|
21646
21679
|
return res.result;
|
|
@@ -21667,7 +21700,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21667
21700
|
const res = create(unsafeRes, GetTransactionRpcResult);
|
|
21668
21701
|
|
|
21669
21702
|
if ('error' in res) {
|
|
21670
|
-
throw new
|
|
21703
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transactions');
|
|
21671
21704
|
}
|
|
21672
21705
|
|
|
21673
21706
|
const result = res.result;
|
|
@@ -21695,7 +21728,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21695
21728
|
const res = create(unsafeRes, GetConfirmedBlockRpcResult);
|
|
21696
21729
|
|
|
21697
21730
|
if ('error' in res) {
|
|
21698
|
-
throw new
|
|
21731
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');
|
|
21699
21732
|
}
|
|
21700
21733
|
|
|
21701
21734
|
const result = res.result;
|
|
@@ -21742,7 +21775,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21742
21775
|
const res = create(unsafeRes, jsonRpcResult(array(number())));
|
|
21743
21776
|
|
|
21744
21777
|
if ('error' in res) {
|
|
21745
|
-
throw new
|
|
21778
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get blocks');
|
|
21746
21779
|
}
|
|
21747
21780
|
|
|
21748
21781
|
return res.result;
|
|
@@ -21762,7 +21795,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21762
21795
|
const res = create(unsafeRes, GetBlockSignaturesRpcResult);
|
|
21763
21796
|
|
|
21764
21797
|
if ('error' in res) {
|
|
21765
|
-
throw new
|
|
21798
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block');
|
|
21766
21799
|
}
|
|
21767
21800
|
|
|
21768
21801
|
const result = res.result;
|
|
@@ -21790,7 +21823,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21790
21823
|
const res = create(unsafeRes, GetBlockSignaturesRpcResult);
|
|
21791
21824
|
|
|
21792
21825
|
if ('error' in res) {
|
|
21793
|
-
throw new
|
|
21826
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');
|
|
21794
21827
|
}
|
|
21795
21828
|
|
|
21796
21829
|
const result = res.result;
|
|
@@ -21815,7 +21848,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21815
21848
|
const res = create(unsafeRes, GetTransactionRpcResult);
|
|
21816
21849
|
|
|
21817
21850
|
if ('error' in res) {
|
|
21818
|
-
throw new
|
|
21851
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
|
|
21819
21852
|
}
|
|
21820
21853
|
|
|
21821
21854
|
const result = res.result;
|
|
@@ -21840,7 +21873,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21840
21873
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
21841
21874
|
|
|
21842
21875
|
if ('error' in res) {
|
|
21843
|
-
throw new
|
|
21876
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transaction');
|
|
21844
21877
|
}
|
|
21845
21878
|
|
|
21846
21879
|
return res.result;
|
|
@@ -21866,7 +21899,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21866
21899
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
21867
21900
|
|
|
21868
21901
|
if ('error' in res) {
|
|
21869
|
-
throw new
|
|
21902
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transactions');
|
|
21870
21903
|
}
|
|
21871
21904
|
|
|
21872
21905
|
return res.result;
|
|
@@ -21955,7 +21988,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21955
21988
|
const res = create(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult);
|
|
21956
21989
|
|
|
21957
21990
|
if ('error' in res) {
|
|
21958
|
-
throw new
|
|
21991
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed signatures for address');
|
|
21959
21992
|
}
|
|
21960
21993
|
|
|
21961
21994
|
return res.result;
|
|
@@ -21977,7 +22010,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21977
22010
|
const res = create(unsafeRes, GetSignaturesForAddressRpcResult);
|
|
21978
22011
|
|
|
21979
22012
|
if ('error' in res) {
|
|
21980
|
-
throw new
|
|
22013
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get signatures for address');
|
|
21981
22014
|
}
|
|
21982
22015
|
|
|
21983
22016
|
return res.result;
|
|
@@ -22034,7 +22067,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
22034
22067
|
const res = create(unsafeRes, RequestAirdropRpcResult);
|
|
22035
22068
|
|
|
22036
22069
|
if ('error' in res) {
|
|
22037
|
-
throw new
|
|
22070
|
+
throw new SolanaJSONRPCError(res.error, `airdrop to ${to.toBase58()} failed`);
|
|
22038
22071
|
}
|
|
22039
22072
|
|
|
22040
22073
|
return res.result;
|
|
@@ -22264,7 +22297,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
22264
22297
|
const skipPreflight = options && options.skipPreflight;
|
|
22265
22298
|
const preflightCommitment = options && options.preflightCommitment || this.commitment;
|
|
22266
22299
|
|
|
22267
|
-
if (options && options.maxRetries) {
|
|
22300
|
+
if (options && options.maxRetries != null) {
|
|
22268
22301
|
config.maxRetries = options.maxRetries;
|
|
22269
22302
|
}
|
|
22270
22303
|
|
|
@@ -30367,6 +30400,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
30367
30400
|
exports.SYSVAR_STAKE_HISTORY_PUBKEY = SYSVAR_STAKE_HISTORY_PUBKEY;
|
|
30368
30401
|
exports.Secp256k1Program = Secp256k1Program;
|
|
30369
30402
|
exports.SendTransactionError = SendTransactionError;
|
|
30403
|
+
exports.SolanaJSONRPCError = SolanaJSONRPCError;
|
|
30404
|
+
exports.SolanaJSONRPCErrorCode = SolanaJSONRPCErrorCode;
|
|
30370
30405
|
exports.StakeAuthorizationLayout = StakeAuthorizationLayout;
|
|
30371
30406
|
exports.StakeInstruction = StakeInstruction;
|
|
30372
30407
|
exports.StakeProgram = StakeProgram;
|