@solana/web3.js 1.46.0 → 1.47.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 +90 -53
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +89 -54
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +90 -53
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +36 -0
- package/lib/index.esm.js +89 -54
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +90 -53
- 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 +101 -99
- 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;
|
|
@@ -21355,7 +21390,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21355
21390
|
const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult);
|
|
21356
21391
|
|
|
21357
21392
|
if ('error' in res) {
|
|
21358
|
-
throw new
|
|
21393
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get recent performance samples');
|
|
21359
21394
|
}
|
|
21360
21395
|
|
|
21361
21396
|
return res.result;
|
|
@@ -21374,7 +21409,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21374
21409
|
const res = create(unsafeRes, GetFeeCalculatorRpcResult);
|
|
21375
21410
|
|
|
21376
21411
|
if ('error' in res) {
|
|
21377
|
-
throw new
|
|
21412
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get fee calculator');
|
|
21378
21413
|
}
|
|
21379
21414
|
|
|
21380
21415
|
const {
|
|
@@ -21400,7 +21435,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21400
21435
|
const res = create(unsafeRes, jsonRpcResultAndContext(nullable(number())));
|
|
21401
21436
|
|
|
21402
21437
|
if ('error' in res) {
|
|
21403
|
-
throw new
|
|
21438
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get slot');
|
|
21404
21439
|
}
|
|
21405
21440
|
|
|
21406
21441
|
if (res.result === null) {
|
|
@@ -21459,7 +21494,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21459
21494
|
const res = create(unsafeRes, GetLatestBlockhashRpcResult);
|
|
21460
21495
|
|
|
21461
21496
|
if ('error' in res) {
|
|
21462
|
-
throw new
|
|
21497
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get latest blockhash');
|
|
21463
21498
|
}
|
|
21464
21499
|
|
|
21465
21500
|
return res.result;
|
|
@@ -21474,7 +21509,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21474
21509
|
const res = create(unsafeRes, jsonRpcResult(VersionResult));
|
|
21475
21510
|
|
|
21476
21511
|
if ('error' in res) {
|
|
21477
|
-
throw new
|
|
21512
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get version');
|
|
21478
21513
|
}
|
|
21479
21514
|
|
|
21480
21515
|
return res.result;
|
|
@@ -21489,7 +21524,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21489
21524
|
const res = create(unsafeRes, jsonRpcResult(string()));
|
|
21490
21525
|
|
|
21491
21526
|
if ('error' in res) {
|
|
21492
|
-
throw new
|
|
21527
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get genesis hash');
|
|
21493
21528
|
}
|
|
21494
21529
|
|
|
21495
21530
|
return res.result;
|
|
@@ -21506,7 +21541,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21506
21541
|
const res = create(unsafeRes, GetBlockRpcResult);
|
|
21507
21542
|
|
|
21508
21543
|
if ('error' in res) {
|
|
21509
|
-
throw new
|
|
21544
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');
|
|
21510
21545
|
}
|
|
21511
21546
|
|
|
21512
21547
|
const result = res.result;
|
|
@@ -21545,7 +21580,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21545
21580
|
const res = create(unsafeRes, jsonRpcResult(number()));
|
|
21546
21581
|
|
|
21547
21582
|
if ('error' in res) {
|
|
21548
|
-
throw new
|
|
21583
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block height information');
|
|
21549
21584
|
}
|
|
21550
21585
|
|
|
21551
21586
|
return res.result;
|
|
@@ -21576,7 +21611,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21576
21611
|
const res = create(unsafeRes, BlockProductionResponseStruct);
|
|
21577
21612
|
|
|
21578
21613
|
if ('error' in res) {
|
|
21579
|
-
throw new
|
|
21614
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block production information');
|
|
21580
21615
|
}
|
|
21581
21616
|
|
|
21582
21617
|
return res.result;
|
|
@@ -21593,7 +21628,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21593
21628
|
const res = create(unsafeRes, GetTransactionRpcResult);
|
|
21594
21629
|
|
|
21595
21630
|
if ('error' in res) {
|
|
21596
|
-
throw new
|
|
21631
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
|
|
21597
21632
|
}
|
|
21598
21633
|
|
|
21599
21634
|
const result = res.result;
|
|
@@ -21616,7 +21651,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21616
21651
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
21617
21652
|
|
|
21618
21653
|
if ('error' in res) {
|
|
21619
|
-
throw new
|
|
21654
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
|
|
21620
21655
|
}
|
|
21621
21656
|
|
|
21622
21657
|
return res.result;
|
|
@@ -21640,7 +21675,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21640
21675
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
21641
21676
|
|
|
21642
21677
|
if ('error' in res) {
|
|
21643
|
-
throw new
|
|
21678
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transactions');
|
|
21644
21679
|
}
|
|
21645
21680
|
|
|
21646
21681
|
return res.result;
|
|
@@ -21667,7 +21702,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21667
21702
|
const res = create(unsafeRes, GetTransactionRpcResult);
|
|
21668
21703
|
|
|
21669
21704
|
if ('error' in res) {
|
|
21670
|
-
throw new
|
|
21705
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transactions');
|
|
21671
21706
|
}
|
|
21672
21707
|
|
|
21673
21708
|
const result = res.result;
|
|
@@ -21695,7 +21730,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21695
21730
|
const res = create(unsafeRes, GetConfirmedBlockRpcResult);
|
|
21696
21731
|
|
|
21697
21732
|
if ('error' in res) {
|
|
21698
|
-
throw new
|
|
21733
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');
|
|
21699
21734
|
}
|
|
21700
21735
|
|
|
21701
21736
|
const result = res.result;
|
|
@@ -21742,7 +21777,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21742
21777
|
const res = create(unsafeRes, jsonRpcResult(array(number())));
|
|
21743
21778
|
|
|
21744
21779
|
if ('error' in res) {
|
|
21745
|
-
throw new
|
|
21780
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get blocks');
|
|
21746
21781
|
}
|
|
21747
21782
|
|
|
21748
21783
|
return res.result;
|
|
@@ -21762,7 +21797,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21762
21797
|
const res = create(unsafeRes, GetBlockSignaturesRpcResult);
|
|
21763
21798
|
|
|
21764
21799
|
if ('error' in res) {
|
|
21765
|
-
throw new
|
|
21800
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get block');
|
|
21766
21801
|
}
|
|
21767
21802
|
|
|
21768
21803
|
const result = res.result;
|
|
@@ -21790,7 +21825,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21790
21825
|
const res = create(unsafeRes, GetBlockSignaturesRpcResult);
|
|
21791
21826
|
|
|
21792
21827
|
if ('error' in res) {
|
|
21793
|
-
throw new
|
|
21828
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');
|
|
21794
21829
|
}
|
|
21795
21830
|
|
|
21796
21831
|
const result = res.result;
|
|
@@ -21815,7 +21850,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21815
21850
|
const res = create(unsafeRes, GetTransactionRpcResult);
|
|
21816
21851
|
|
|
21817
21852
|
if ('error' in res) {
|
|
21818
|
-
throw new
|
|
21853
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get transaction');
|
|
21819
21854
|
}
|
|
21820
21855
|
|
|
21821
21856
|
const result = res.result;
|
|
@@ -21840,7 +21875,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21840
21875
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
21841
21876
|
|
|
21842
21877
|
if ('error' in res) {
|
|
21843
|
-
throw new
|
|
21878
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transaction');
|
|
21844
21879
|
}
|
|
21845
21880
|
|
|
21846
21881
|
return res.result;
|
|
@@ -21866,7 +21901,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21866
21901
|
const res = create(unsafeRes, GetParsedTransactionRpcResult);
|
|
21867
21902
|
|
|
21868
21903
|
if ('error' in res) {
|
|
21869
|
-
throw new
|
|
21904
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transactions');
|
|
21870
21905
|
}
|
|
21871
21906
|
|
|
21872
21907
|
return res.result;
|
|
@@ -21955,7 +21990,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21955
21990
|
const res = create(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult);
|
|
21956
21991
|
|
|
21957
21992
|
if ('error' in res) {
|
|
21958
|
-
throw new
|
|
21993
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get confirmed signatures for address');
|
|
21959
21994
|
}
|
|
21960
21995
|
|
|
21961
21996
|
return res.result;
|
|
@@ -21977,7 +22012,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21977
22012
|
const res = create(unsafeRes, GetSignaturesForAddressRpcResult);
|
|
21978
22013
|
|
|
21979
22014
|
if ('error' in res) {
|
|
21980
|
-
throw new
|
|
22015
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get signatures for address');
|
|
21981
22016
|
}
|
|
21982
22017
|
|
|
21983
22018
|
return res.result;
|
|
@@ -22034,7 +22069,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
22034
22069
|
const res = create(unsafeRes, RequestAirdropRpcResult);
|
|
22035
22070
|
|
|
22036
22071
|
if ('error' in res) {
|
|
22037
|
-
throw new
|
|
22072
|
+
throw new SolanaJSONRPCError(res.error, `airdrop to ${to.toBase58()} failed`);
|
|
22038
22073
|
}
|
|
22039
22074
|
|
|
22040
22075
|
return res.result;
|
|
@@ -30367,6 +30402,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
30367
30402
|
exports.SYSVAR_STAKE_HISTORY_PUBKEY = SYSVAR_STAKE_HISTORY_PUBKEY;
|
|
30368
30403
|
exports.Secp256k1Program = Secp256k1Program;
|
|
30369
30404
|
exports.SendTransactionError = SendTransactionError;
|
|
30405
|
+
exports.SolanaJSONRPCError = SolanaJSONRPCError;
|
|
30406
|
+
exports.SolanaJSONRPCErrorCode = SolanaJSONRPCErrorCode;
|
|
30370
30407
|
exports.StakeAuthorizationLayout = StakeAuthorizationLayout;
|
|
30371
30408
|
exports.StakeInstruction = StakeInstruction;
|
|
30372
30409
|
exports.StakeProgram = StakeProgram;
|