@solana/web3.js 2.0.0-experimental.0de6c3e → 2.0.0-experimental.0e03ca9

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.
Files changed (58) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1153 -43
  3. package/dist/index.browser.cjs +931 -27
  4. package/dist/index.browser.cjs.map +1 -1
  5. package/dist/index.browser.js +866 -28
  6. package/dist/index.browser.js.map +1 -1
  7. package/dist/index.development.js +5322 -552
  8. package/dist/index.development.js.map +1 -1
  9. package/dist/index.native.js +855 -28
  10. package/dist/index.native.js.map +1 -1
  11. package/dist/index.node.cjs +922 -27
  12. package/dist/index.node.cjs.map +1 -1
  13. package/dist/index.node.js +855 -28
  14. package/dist/index.node.js.map +1 -1
  15. package/dist/index.production.min.js +273 -19
  16. package/dist/types/airdrop-confirmer.d.ts +19 -0
  17. package/dist/types/airdrop-confirmer.d.ts.map +1 -0
  18. package/dist/types/airdrop.d.ts +21 -0
  19. package/dist/types/airdrop.d.ts.map +1 -0
  20. package/dist/types/cached-abortable-iterable.d.ts +11 -0
  21. package/dist/types/cached-abortable-iterable.d.ts.map +1 -0
  22. package/dist/types/decode-transaction.d.ts +10 -0
  23. package/dist/types/decode-transaction.d.ts.map +1 -0
  24. package/dist/types/index.d.ts +19 -2
  25. package/dist/types/index.d.ts.map +1 -0
  26. package/dist/types/rpc-default-config.d.ts.map +1 -0
  27. package/dist/types/rpc-integer-overflow-error.d.ts +3 -2
  28. package/dist/types/rpc-integer-overflow-error.d.ts.map +1 -0
  29. package/dist/types/rpc-request-coalescer.d.ts +2 -2
  30. package/dist/types/rpc-request-coalescer.d.ts.map +1 -0
  31. package/dist/types/rpc-request-deduplication.d.ts.map +1 -0
  32. package/dist/types/rpc-subscription-coalescer.d.ts +10 -0
  33. package/dist/types/rpc-subscription-coalescer.d.ts.map +1 -0
  34. package/dist/types/rpc-transport.d.ts +7 -2
  35. package/dist/types/rpc-transport.d.ts.map +1 -0
  36. package/dist/types/rpc-websocket-autopinger.d.ts +8 -0
  37. package/dist/types/rpc-websocket-autopinger.d.ts.map +1 -0
  38. package/dist/types/rpc-websocket-connection-sharding.d.ts +13 -0
  39. package/dist/types/rpc-websocket-connection-sharding.d.ts.map +1 -0
  40. package/dist/types/rpc-websocket-transport.d.ts +16 -0
  41. package/dist/types/rpc-websocket-transport.d.ts.map +1 -0
  42. package/dist/types/rpc.d.ts +12 -4
  43. package/dist/types/rpc.d.ts.map +1 -0
  44. package/dist/types/send-transaction.d.ts +37 -0
  45. package/dist/types/send-transaction.d.ts.map +1 -0
  46. package/dist/types/transaction-confirmation-strategy-blockheight.d.ts +14 -0
  47. package/dist/types/transaction-confirmation-strategy-blockheight.d.ts.map +1 -0
  48. package/dist/types/transaction-confirmation-strategy-nonce.d.ts +13 -0
  49. package/dist/types/transaction-confirmation-strategy-nonce.d.ts.map +1 -0
  50. package/dist/types/transaction-confirmation-strategy-racer.d.ts +14 -0
  51. package/dist/types/transaction-confirmation-strategy-racer.d.ts.map +1 -0
  52. package/dist/types/transaction-confirmation-strategy-recent-signature.d.ts +11 -0
  53. package/dist/types/transaction-confirmation-strategy-recent-signature.d.ts.map +1 -0
  54. package/dist/types/transaction-confirmation-strategy-timeout.d.ts +8 -0
  55. package/dist/types/transaction-confirmation-strategy-timeout.d.ts.map +1 -0
  56. package/dist/types/transaction-confirmation.d.ts +32 -0
  57. package/dist/types/transaction-confirmation.d.ts.map +1 -0
  58. package/package.json +30 -23
@@ -1,7 +1,16 @@
1
1
  'use strict';
2
2
 
3
+ var accounts = require('@solana/accounts');
4
+ var addresses = require('@solana/addresses');
5
+ var codecs = require('@solana/codecs');
6
+ var functional = require('@solana/functional');
3
7
  var instructions = require('@solana/instructions');
4
8
  var keys = require('@solana/keys');
9
+ var programs = require('@solana/programs');
10
+ var rpcParsedTypes = require('@solana/rpc-parsed-types');
11
+ var rpcTypes = require('@solana/rpc-types');
12
+ var signers = require('@solana/signers');
13
+ var transactions = require('@solana/transactions');
5
14
  var rpcCore = require('@solana/rpc-core');
6
15
  var rpcTransport = require('@solana/rpc-transport');
7
16
  var fastStableStringify = require('fast-stable-stringify');
@@ -10,27 +19,220 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
19
 
11
20
  var fastStableStringify__default = /*#__PURE__*/_interopDefault(fastStableStringify);
12
21
 
13
- // src/index.ts
22
+ // ../build-scripts/env-shim.ts
23
+ var __DEV__ = /* @__PURE__ */ (() => process["env"].NODE_ENV === "development")();
24
+
25
+ // src/transaction-confirmation-strategy-racer.ts
26
+ async function raceStrategies(signature, config, getSpecificStrategiesForRace) {
27
+ const { abortSignal: callerAbortSignal, commitment, getRecentSignatureConfirmationPromise } = config;
28
+ callerAbortSignal?.throwIfAborted();
29
+ const abortController = new AbortController();
30
+ if (callerAbortSignal) {
31
+ const handleAbort = () => {
32
+ abortController.abort();
33
+ };
34
+ callerAbortSignal.addEventListener("abort", handleAbort, { signal: abortController.signal });
35
+ }
36
+ try {
37
+ const specificStrategies = getSpecificStrategiesForRace({
38
+ ...config,
39
+ abortSignal: abortController.signal
40
+ });
41
+ return await Promise.race([
42
+ getRecentSignatureConfirmationPromise({
43
+ abortSignal: abortController.signal,
44
+ commitment,
45
+ signature
46
+ }),
47
+ ...specificStrategies
48
+ ]);
49
+ } finally {
50
+ abortController.abort();
51
+ }
52
+ }
53
+ function createRecentSignatureConfirmationPromiseFactory(rpc, rpcSubscriptions) {
54
+ return async function getRecentSignatureConfirmationPromise({
55
+ abortSignal: callerAbortSignal,
56
+ commitment,
57
+ signature
58
+ }) {
59
+ const abortController = new AbortController();
60
+ function handleAbort() {
61
+ abortController.abort();
62
+ }
63
+ callerAbortSignal.addEventListener("abort", handleAbort, { signal: abortController.signal });
64
+ const signatureStatusNotifications = await rpcSubscriptions.signatureNotifications(signature, { commitment }).subscribe({ abortSignal: abortController.signal });
65
+ const signatureDidCommitPromise = (async () => {
66
+ for await (const signatureStatusNotification of signatureStatusNotifications) {
67
+ if (signatureStatusNotification.value.err) {
68
+ throw new Error(`The transaction with signature \`${signature}\` failed.`, {
69
+ cause: signatureStatusNotification.value.err
70
+ });
71
+ } else {
72
+ return;
73
+ }
74
+ }
75
+ })();
76
+ const signatureStatusLookupPromise = (async () => {
77
+ const { value: signatureStatusResults } = await rpc.getSignatureStatuses([signature]).send({ abortSignal: abortController.signal });
78
+ const signatureStatus = signatureStatusResults[0];
79
+ if (signatureStatus && signatureStatus.confirmationStatus && rpcTypes.commitmentComparator(signatureStatus.confirmationStatus, commitment) >= 0) {
80
+ return;
81
+ } else {
82
+ await new Promise(() => {
83
+ });
84
+ }
85
+ })();
86
+ try {
87
+ return await Promise.race([signatureDidCommitPromise, signatureStatusLookupPromise]);
88
+ } finally {
89
+ abortController.abort();
90
+ }
91
+ };
92
+ }
93
+
94
+ // src/transaction-confirmation-strategy-timeout.ts
95
+ async function getTimeoutPromise({ abortSignal: callerAbortSignal, commitment }) {
96
+ return await new Promise((_, reject) => {
97
+ const handleAbort = (e) => {
98
+ clearTimeout(timeoutId);
99
+ const abortError = new DOMException(e.target.reason, "AbortError");
100
+ reject(abortError);
101
+ };
102
+ callerAbortSignal.addEventListener("abort", handleAbort);
103
+ const timeoutMs = commitment === "processed" ? 3e4 : 6e4;
104
+ const startMs = performance.now();
105
+ const timeoutId = (
106
+ // We use `setTimeout` instead of `AbortSignal.timeout()` because we want to measure
107
+ // elapsed time instead of active time.
108
+ // See https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static
109
+ setTimeout(() => {
110
+ const elapsedMs = performance.now() - startMs;
111
+ reject(new DOMException(`Timeout elapsed after ${elapsedMs} ms`, "TimeoutError"));
112
+ }, timeoutMs)
113
+ );
114
+ });
115
+ }
116
+
117
+ // src/airdrop-confirmer.ts
118
+ function createDefaultSignatureOnlyRecentTransactionConfirmer({
119
+ rpc,
120
+ rpcSubscriptions
121
+ }) {
122
+ const getRecentSignatureConfirmationPromise = createRecentSignatureConfirmationPromiseFactory(
123
+ rpc,
124
+ rpcSubscriptions
125
+ );
126
+ return async function confirmSignatureOnlyRecentTransaction(config) {
127
+ await waitForRecentTransactionConfirmationUntilTimeout({
128
+ ...config,
129
+ getRecentSignatureConfirmationPromise,
130
+ getTimeoutPromise
131
+ });
132
+ };
133
+ }
134
+ async function waitForRecentTransactionConfirmationUntilTimeout(config) {
135
+ await raceStrategies(
136
+ config.signature,
137
+ config,
138
+ function getSpecificStrategiesForRace({ abortSignal, commitment, getTimeoutPromise: getTimeoutPromise2 }) {
139
+ return [
140
+ getTimeoutPromise2({
141
+ abortSignal,
142
+ commitment
143
+ })
144
+ ];
145
+ }
146
+ );
147
+ }
148
+
149
+ // src/airdrop.ts
150
+ function createDefaultAirdropRequester({ rpc, rpcSubscriptions }) {
151
+ const confirmSignatureOnlyTransaction = createDefaultSignatureOnlyRecentTransactionConfirmer({
152
+ rpc,
153
+ rpcSubscriptions
154
+ });
155
+ return async function requestAirdrop(config) {
156
+ return await requestAndConfirmAirdrop({
157
+ ...config,
158
+ confirmSignatureOnlyTransaction,
159
+ rpc
160
+ });
161
+ };
162
+ }
163
+ async function requestAndConfirmAirdrop({
164
+ abortSignal,
165
+ commitment,
166
+ confirmSignatureOnlyTransaction,
167
+ lamports,
168
+ recipientAddress,
169
+ rpc
170
+ }) {
171
+ const airdropTransactionSignature = await rpc.requestAirdrop(recipientAddress, lamports, { commitment }).send({ abortSignal });
172
+ await confirmSignatureOnlyTransaction({
173
+ abortSignal,
174
+ commitment,
175
+ signature: airdropTransactionSignature
176
+ });
177
+ return airdropTransactionSignature;
178
+ }
179
+ var compiledTransactionDecoder = void 0;
180
+ async function fetchLookupTables(lookupTableAddresses, rpc, config) {
181
+ const fetchedLookupTables = await accounts.fetchJsonParsedAccounts(
182
+ rpc,
183
+ lookupTableAddresses,
184
+ config
185
+ );
186
+ accounts.assertAccountsDecoded(fetchedLookupTables);
187
+ accounts.assertAccountsExist(fetchedLookupTables);
188
+ return fetchedLookupTables.reduce((acc, lookup) => {
189
+ return {
190
+ ...acc,
191
+ [lookup.address]: lookup.data.addresses
192
+ };
193
+ }, {});
194
+ }
195
+ async function decodeTransaction(encodedTransaction, rpc, config) {
196
+ const { lastValidBlockHeight, ...fetchAccountsConfig } = config ?? {};
197
+ if (!compiledTransactionDecoder)
198
+ compiledTransactionDecoder = transactions.getCompiledTransactionDecoder();
199
+ const compiledTransaction = compiledTransactionDecoder.decode(encodedTransaction);
200
+ const { compiledMessage } = compiledTransaction;
201
+ const lookupTables = "addressTableLookups" in compiledMessage && compiledMessage.addressTableLookups !== void 0 && compiledMessage.addressTableLookups.length > 0 ? compiledMessage.addressTableLookups : [];
202
+ const lookupTableAddresses = lookupTables.map((l) => l.lookupTableAddress);
203
+ const fetchedLookupTables = lookupTableAddresses.length > 0 ? await fetchLookupTables(lookupTableAddresses, rpc, fetchAccountsConfig) : {};
204
+ return transactions.decompileTransaction(compiledTransaction, {
205
+ addressesByLookupTableAddress: fetchedLookupTables,
206
+ lastValidBlockHeight
207
+ });
208
+ }
14
209
 
15
210
  // src/rpc-integer-overflow-error.ts
16
211
  var SolanaJsonRpcIntegerOverflowError = class extends Error {
212
+ methodName;
213
+ keyPath;
214
+ value;
17
215
  constructor(methodName, keyPath, value) {
18
- const argPosition = (typeof keyPath[0] === "number" ? keyPath[0] : parseInt(keyPath[0], 10)) + 1;
19
- let ordinal = "";
20
- const lastDigit = argPosition % 10;
21
- const lastTwoDigits = argPosition % 100;
22
- if (lastDigit == 1 && lastTwoDigits != 11) {
23
- ordinal = argPosition + "st";
24
- } else if (lastDigit == 2 && lastTwoDigits != 12) {
25
- ordinal = argPosition + "nd";
26
- } else if (lastDigit == 3 && lastTwoDigits != 13) {
27
- ordinal = argPosition + "rd";
216
+ let argumentLabel = "";
217
+ if (typeof keyPath[0] === "number") {
218
+ const argPosition = keyPath[0] + 1;
219
+ const lastDigit = argPosition % 10;
220
+ const lastTwoDigits = argPosition % 100;
221
+ if (lastDigit == 1 && lastTwoDigits != 11) {
222
+ argumentLabel = argPosition + "st";
223
+ } else if (lastDigit == 2 && lastTwoDigits != 12) {
224
+ argumentLabel = argPosition + "nd";
225
+ } else if (lastDigit == 3 && lastTwoDigits != 13) {
226
+ argumentLabel = argPosition + "rd";
227
+ } else {
228
+ argumentLabel = argPosition + "th";
229
+ }
28
230
  } else {
29
- ordinal = argPosition + "th";
231
+ argumentLabel = `\`${keyPath[0].toString()}\``;
30
232
  }
31
233
  const path = keyPath.length > 1 ? keyPath.slice(1).map((pathPart) => typeof pathPart === "number" ? `[${pathPart}]` : pathPart).join(".") : null;
32
234
  super(
33
- `The ${ordinal} argument to the \`${methodName}\` RPC method${path ? ` at path \`${path}\`` : ""} was \`${value}\`. This number is unsafe for use with the Solana JSON-RPC because it exceeds \`Number.MAX_SAFE_INTEGER\`.`
235
+ `The ${argumentLabel} argument to the \`${methodName}\` RPC method${path ? ` at path \`${path}\`` : ""} was \`${value}\`. This number is unsafe for use with the Solana JSON-RPC because it exceeds \`Number.MAX_SAFE_INTEGER\`.`
34
236
  );
35
237
  this.keyPath = keyPath;
36
238
  this.methodName = methodName;
@@ -43,16 +245,223 @@ var SolanaJsonRpcIntegerOverflowError = class extends Error {
43
245
 
44
246
  // src/rpc-default-config.ts
45
247
  var DEFAULT_RPC_CONFIG = {
248
+ defaultCommitment: "confirmed",
46
249
  onIntegerOverflow(methodName, keyPath, value) {
47
250
  throw new SolanaJsonRpcIntegerOverflowError(methodName, keyPath, value);
48
251
  }
49
252
  };
50
253
 
254
+ // src/cached-abortable-iterable.ts
255
+ function registerIterableCleanup(iterable, cleanupFn) {
256
+ (async () => {
257
+ try {
258
+ for await (const _ of iterable)
259
+ ;
260
+ } catch {
261
+ } finally {
262
+ cleanupFn();
263
+ }
264
+ })();
265
+ }
266
+ function getCachedAbortableIterableFactory({
267
+ getAbortSignalFromInputArgs,
268
+ getCacheEntryMissingError,
269
+ getCacheKeyFromInputArgs,
270
+ onCacheHit,
271
+ onCreateIterable
272
+ }) {
273
+ const cache = /* @__PURE__ */ new Map();
274
+ function getCacheEntryOrThrow(cacheKey) {
275
+ const currentCacheEntry = cache.get(cacheKey);
276
+ if (!currentCacheEntry) {
277
+ throw getCacheEntryMissingError(cacheKey);
278
+ }
279
+ return currentCacheEntry;
280
+ }
281
+ return async (...args) => {
282
+ const cacheKey = getCacheKeyFromInputArgs(...args);
283
+ const signal = getAbortSignalFromInputArgs(...args);
284
+ if (cacheKey === void 0) {
285
+ return await onCreateIterable(signal, ...args);
286
+ }
287
+ const cleanup = () => {
288
+ cache.delete(cacheKey);
289
+ signal.removeEventListener("abort", handleAbort);
290
+ };
291
+ const handleAbort = () => {
292
+ const cacheEntry = getCacheEntryOrThrow(cacheKey);
293
+ if (cacheEntry.purgeScheduled !== true) {
294
+ cacheEntry.purgeScheduled = true;
295
+ globalThis.queueMicrotask(() => {
296
+ cacheEntry.purgeScheduled = false;
297
+ if (cacheEntry.referenceCount === 0) {
298
+ cacheEntry.abortController.abort();
299
+ cleanup();
300
+ }
301
+ });
302
+ }
303
+ cacheEntry.referenceCount--;
304
+ };
305
+ signal.addEventListener("abort", handleAbort);
306
+ try {
307
+ const cacheEntry = cache.get(cacheKey);
308
+ if (!cacheEntry) {
309
+ const singletonAbortController = new AbortController();
310
+ const newIterablePromise = onCreateIterable(singletonAbortController.signal, ...args);
311
+ const newCacheEntry = {
312
+ abortController: singletonAbortController,
313
+ iterable: newIterablePromise,
314
+ purgeScheduled: false,
315
+ referenceCount: 1
316
+ };
317
+ cache.set(cacheKey, newCacheEntry);
318
+ const newIterable = await newIterablePromise;
319
+ registerIterableCleanup(newIterable, cleanup);
320
+ newCacheEntry.iterable = newIterable;
321
+ return newIterable;
322
+ } else {
323
+ cacheEntry.referenceCount++;
324
+ const iterableOrIterablePromise = cacheEntry.iterable;
325
+ const cachedIterable = "then" in iterableOrIterablePromise ? await iterableOrIterablePromise : iterableOrIterablePromise;
326
+ await onCacheHit(cachedIterable, ...args);
327
+ return cachedIterable;
328
+ }
329
+ } catch (e) {
330
+ cleanup();
331
+ throw e;
332
+ }
333
+ };
334
+ }
335
+
336
+ // src/rpc-subscription-coalescer.ts
337
+ var EXPLICIT_ABORT_TOKEN = Symbol(
338
+ __DEV__ ? "This symbol is thrown from a subscription's iterator when the subscription is explicitly aborted by the user" : void 0
339
+ );
340
+ function registerIterableCleanup2(iterable, cleanupFn) {
341
+ (async () => {
342
+ try {
343
+ for await (const _ of iterable)
344
+ ;
345
+ } catch {
346
+ } finally {
347
+ cleanupFn();
348
+ }
349
+ })();
350
+ }
351
+ function getRpcSubscriptionsWithSubscriptionCoalescing({
352
+ getDeduplicationKey,
353
+ rpcSubscriptions
354
+ }) {
355
+ const cache = /* @__PURE__ */ new Map();
356
+ return new Proxy(rpcSubscriptions, {
357
+ defineProperty() {
358
+ return false;
359
+ },
360
+ deleteProperty() {
361
+ return false;
362
+ },
363
+ get(target, p, receiver) {
364
+ const subscriptionMethod = Reflect.get(target, p, receiver);
365
+ if (typeof subscriptionMethod !== "function") {
366
+ return subscriptionMethod;
367
+ }
368
+ return function(...rawParams) {
369
+ const deduplicationKey = getDeduplicationKey(p, rawParams);
370
+ if (deduplicationKey === void 0) {
371
+ return subscriptionMethod(...rawParams);
372
+ }
373
+ if (cache.has(deduplicationKey)) {
374
+ return cache.get(deduplicationKey);
375
+ }
376
+ const iterableFactory = getCachedAbortableIterableFactory({
377
+ getAbortSignalFromInputArgs: ({ abortSignal }) => abortSignal,
378
+ getCacheEntryMissingError(deduplicationKey2) {
379
+ return new Error(
380
+ `Found no cache entry for subscription with deduplication key \`${deduplicationKey2?.toString()}\``
381
+ );
382
+ },
383
+ getCacheKeyFromInputArgs: () => deduplicationKey,
384
+ async onCacheHit(_iterable, _config) {
385
+ },
386
+ async onCreateIterable(abortSignal, config) {
387
+ const pendingSubscription2 = subscriptionMethod(
388
+ ...rawParams
389
+ );
390
+ const iterable = await pendingSubscription2.subscribe({
391
+ ...config,
392
+ abortSignal
393
+ });
394
+ registerIterableCleanup2(iterable, () => {
395
+ cache.delete(deduplicationKey);
396
+ });
397
+ return iterable;
398
+ }
399
+ });
400
+ const pendingSubscription = {
401
+ async subscribe(...args) {
402
+ const iterable = await iterableFactory(...args);
403
+ const { abortSignal } = args[0];
404
+ let abortPromise;
405
+ return {
406
+ ...iterable,
407
+ async *[Symbol.asyncIterator]() {
408
+ abortPromise ||= abortSignal.aborted ? Promise.reject(EXPLICIT_ABORT_TOKEN) : new Promise((_, reject) => {
409
+ abortSignal.addEventListener("abort", () => {
410
+ reject(EXPLICIT_ABORT_TOKEN);
411
+ });
412
+ });
413
+ try {
414
+ const iterator = iterable[Symbol.asyncIterator]();
415
+ while (true) {
416
+ const iteratorResult = await Promise.race([iterator.next(), abortPromise]);
417
+ if (iteratorResult.done) {
418
+ return;
419
+ } else {
420
+ yield iteratorResult.value;
421
+ }
422
+ }
423
+ } catch (e) {
424
+ if (e === EXPLICIT_ABORT_TOKEN) {
425
+ return;
426
+ }
427
+ cache.delete(deduplicationKey);
428
+ throw e;
429
+ }
430
+ }
431
+ };
432
+ }
433
+ };
434
+ cache.set(deduplicationKey, pendingSubscription);
435
+ return pendingSubscription;
436
+ };
437
+ }
438
+ });
439
+ }
440
+
51
441
  // src/rpc.ts
52
442
  function createSolanaRpc(config) {
443
+ const api = rpcCore.createSolanaRpcApi(DEFAULT_RPC_CONFIG);
53
444
  return rpcTransport.createJsonRpc({
54
445
  ...config,
55
- api: rpcCore.createSolanaRpcApi(DEFAULT_RPC_CONFIG)
446
+ api
447
+ });
448
+ }
449
+ function createSolanaRpcSubscriptions(config) {
450
+ return functional.pipe(
451
+ rpcTransport.createJsonSubscriptionRpc({
452
+ ...config,
453
+ api: rpcCore.createSolanaRpcSubscriptionsApi(DEFAULT_RPC_CONFIG)
454
+ }),
455
+ (rpcSubscriptions) => getRpcSubscriptionsWithSubscriptionCoalescing({
456
+ getDeduplicationKey: (...args) => fastStableStringify__default.default(args),
457
+ rpcSubscriptions
458
+ })
459
+ );
460
+ }
461
+ function createSolanaRpcSubscriptions_UNSTABLE(config) {
462
+ return rpcTransport.createJsonSubscriptionRpc({
463
+ ...config,
464
+ api: rpcCore.createSolanaRpcSubscriptionsApi_UNSTABLE(DEFAULT_RPC_CONFIG)
56
465
  });
57
466
  }
58
467
 
@@ -73,13 +482,23 @@ function getRpcTransportWithRequestCoalescing(transport, getDeduplicationKey) {
73
482
  }
74
483
  if (coalescedRequestsByDeduplicationKey[deduplicationKey] == null) {
75
484
  const abortController = new AbortController();
485
+ const responsePromise = (async () => {
486
+ try {
487
+ return await transport({
488
+ ...config,
489
+ signal: abortController.signal
490
+ });
491
+ } catch (e) {
492
+ if (e && typeof e === "object" && "name" in e && e.name === "AbortError") {
493
+ return;
494
+ }
495
+ throw e;
496
+ }
497
+ })();
76
498
  coalescedRequestsByDeduplicationKey[deduplicationKey] = {
77
499
  abortController,
78
500
  numConsumers: 0,
79
- responsePromise: transport({
80
- ...config,
81
- signal: abortController.signal
82
- })
501
+ responsePromise
83
502
  };
84
503
  }
85
504
  const coalescedRequest = coalescedRequestsByDeduplicationKey[deduplicationKey];
@@ -107,13 +526,14 @@ function getRpcTransportWithRequestCoalescing(transport, getDeduplicationKey) {
107
526
  }
108
527
  };
109
528
  }
110
- function getSolanaRpcPayloadDeduplicationKey(payload) {
529
+ function isJsonRpcPayload(payload) {
111
530
  if (payload == null || typeof payload !== "object" || Array.isArray(payload)) {
112
- return;
113
- }
114
- if ("jsonrpc" in payload && payload.jsonrpc === "2.0" && "method" in payload && "params" in payload) {
115
- return fastStableStringify__default.default([payload.method, payload.params]);
531
+ return false;
116
532
  }
533
+ return "jsonrpc" in payload && payload.jsonrpc === "2.0" && "method" in payload && typeof payload.method === "string" && "params" in payload;
534
+ }
535
+ function getSolanaRpcPayloadDeduplicationKey(payload) {
536
+ return isJsonRpcPayload(payload) ? fastStableStringify__default.default([payload.method, payload.params]) : void 0;
117
537
  }
118
538
 
119
539
  // src/rpc-transport.ts
@@ -125,7 +545,7 @@ function normalizeHeaders(headers) {
125
545
  return out;
126
546
  }
127
547
  function createDefaultRpcTransport(config) {
128
- return getRpcTransportWithRequestCoalescing(
548
+ return functional.pipe(
129
549
  rpcTransport.createHttpTransport({
130
550
  ...config,
131
551
  headers: {
@@ -136,23 +556,507 @@ function createDefaultRpcTransport(config) {
136
556
  }
137
557
  }
138
558
  }),
139
- getSolanaRpcPayloadDeduplicationKey
559
+ (transport) => getRpcTransportWithRequestCoalescing(transport, getSolanaRpcPayloadDeduplicationKey)
140
560
  );
141
561
  }
142
562
 
563
+ // src/rpc-websocket-autopinger.ts
564
+ var PING_PAYLOAD = {
565
+ jsonrpc: "2.0",
566
+ method: "ping"
567
+ };
568
+ function getWebSocketTransportWithAutoping({
569
+ intervalMs,
570
+ transport
571
+ }) {
572
+ const pingableConnections = /* @__PURE__ */ new Map();
573
+ return async (...args) => {
574
+ const connection = await transport(...args);
575
+ let intervalId;
576
+ function sendPing() {
577
+ connection.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(PING_PAYLOAD);
578
+ }
579
+ function restartPingTimer() {
580
+ clearInterval(intervalId);
581
+ intervalId = setInterval(sendPing, intervalMs);
582
+ }
583
+ if (pingableConnections.has(connection) === false) {
584
+ pingableConnections.set(connection, {
585
+ [Symbol.asyncIterator]: connection[Symbol.asyncIterator].bind(connection),
586
+ send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: (...args2) => {
587
+ restartPingTimer();
588
+ return connection.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(...args2);
589
+ }
590
+ });
591
+ (async () => {
592
+ try {
593
+ for await (const _ of connection) {
594
+ restartPingTimer();
595
+ }
596
+ } catch {
597
+ } finally {
598
+ pingableConnections.delete(connection);
599
+ clearInterval(intervalId);
600
+ if (handleOffline) {
601
+ globalThis.window.removeEventListener("offline", handleOffline);
602
+ }
603
+ if (handleOnline) {
604
+ globalThis.window.removeEventListener("online", handleOnline);
605
+ }
606
+ }
607
+ })();
608
+ if (globalThis.navigator.onLine) {
609
+ restartPingTimer();
610
+ }
611
+ let handleOffline;
612
+ let handleOnline;
613
+ {
614
+ handleOffline = () => {
615
+ clearInterval(intervalId);
616
+ };
617
+ handleOnline = () => {
618
+ sendPing();
619
+ restartPingTimer();
620
+ };
621
+ globalThis.window.addEventListener("offline", handleOffline);
622
+ globalThis.window.addEventListener("online", handleOnline);
623
+ }
624
+ }
625
+ return pingableConnections.get(connection);
626
+ };
627
+ }
628
+
629
+ // src/rpc-websocket-connection-sharding.ts
630
+ var NULL_SHARD_CACHE_KEY = Symbol(
631
+ __DEV__ ? "Cache key to use when there is no connection sharding strategy" : void 0
632
+ );
633
+ function getWebSocketTransportWithConnectionSharding({
634
+ getShard,
635
+ transport
636
+ }) {
637
+ return getCachedAbortableIterableFactory({
638
+ getAbortSignalFromInputArgs: ({ signal }) => signal,
639
+ getCacheEntryMissingError(shardKey) {
640
+ return new Error(`Found no cache entry for connection with shard key \`${shardKey?.toString()}\``);
641
+ },
642
+ getCacheKeyFromInputArgs: ({ payload }) => getShard ? getShard(payload) : NULL_SHARD_CACHE_KEY,
643
+ onCacheHit: (connection, { payload }) => connection.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(payload),
644
+ onCreateIterable: (abortSignal, config) => transport({
645
+ ...config,
646
+ signal: abortSignal
647
+ })
648
+ });
649
+ }
650
+
651
+ // src/rpc-websocket-transport.ts
652
+ function createDefaultRpcSubscriptionsTransport(config) {
653
+ const { getShard, intervalMs, ...rest } = config;
654
+ return functional.pipe(
655
+ rpcTransport.createWebSocketTransport({
656
+ ...rest,
657
+ sendBufferHighWatermark: config.sendBufferHighWatermark ?? // Let 128KB of data into the WebSocket buffer before buffering it in the app.
658
+ 131072
659
+ }),
660
+ (transport) => getWebSocketTransportWithAutoping({
661
+ intervalMs: intervalMs ?? 5e3,
662
+ transport
663
+ }),
664
+ (transport) => getWebSocketTransportWithConnectionSharding({
665
+ getShard,
666
+ transport
667
+ })
668
+ );
669
+ }
670
+
671
+ // src/transaction-confirmation-strategy-blockheight.ts
672
+ function createBlockHeightExceedencePromiseFactory({
673
+ rpc,
674
+ rpcSubscriptions
675
+ }) {
676
+ return async function getBlockHeightExceedencePromise({
677
+ abortSignal: callerAbortSignal,
678
+ commitment,
679
+ lastValidBlockHeight
680
+ }) {
681
+ const abortController = new AbortController();
682
+ const handleAbort = () => {
683
+ abortController.abort();
684
+ };
685
+ callerAbortSignal.addEventListener("abort", handleAbort, { signal: abortController.signal });
686
+ async function getBlockHeightAndDifferenceBetweenSlotHeightAndBlockHeight() {
687
+ const { absoluteSlot, blockHeight } = await rpc.getEpochInfo({ commitment }).send({ abortSignal: abortController.signal });
688
+ return {
689
+ blockHeight,
690
+ differenceBetweenSlotHeightAndBlockHeight: absoluteSlot - blockHeight
691
+ };
692
+ }
693
+ try {
694
+ const [slotNotifications, { blockHeight, differenceBetweenSlotHeightAndBlockHeight }] = await Promise.all([
695
+ rpcSubscriptions.slotNotifications().subscribe({ abortSignal: abortController.signal }),
696
+ getBlockHeightAndDifferenceBetweenSlotHeightAndBlockHeight()
697
+ ]);
698
+ if (blockHeight <= lastValidBlockHeight) {
699
+ let lastKnownDifferenceBetweenSlotHeightAndBlockHeight = differenceBetweenSlotHeightAndBlockHeight;
700
+ for await (const slotNotification of slotNotifications) {
701
+ const { slot } = slotNotification;
702
+ if (slot - lastKnownDifferenceBetweenSlotHeightAndBlockHeight > lastValidBlockHeight) {
703
+ const {
704
+ blockHeight: currentBlockHeight,
705
+ differenceBetweenSlotHeightAndBlockHeight: currentDifferenceBetweenSlotHeightAndBlockHeight
706
+ } = await getBlockHeightAndDifferenceBetweenSlotHeightAndBlockHeight();
707
+ if (currentBlockHeight > lastValidBlockHeight) {
708
+ break;
709
+ } else {
710
+ lastKnownDifferenceBetweenSlotHeightAndBlockHeight = currentDifferenceBetweenSlotHeightAndBlockHeight;
711
+ }
712
+ }
713
+ }
714
+ }
715
+ throw new Error(
716
+ "The network has progressed past the last block for which this transaction could have been committed."
717
+ );
718
+ } finally {
719
+ abortController.abort();
720
+ }
721
+ };
722
+ }
723
+ var NONCE_VALUE_OFFSET = 4 + // version(u32)
724
+ 4 + // state(u32)
725
+ 32;
726
+ function createNonceInvalidationPromiseFactory(rpc, rpcSubscriptions) {
727
+ return async function getNonceInvalidationPromise({
728
+ abortSignal: callerAbortSignal,
729
+ commitment,
730
+ currentNonceValue,
731
+ nonceAccountAddress
732
+ }) {
733
+ const abortController = new AbortController();
734
+ function handleAbort() {
735
+ abortController.abort();
736
+ }
737
+ callerAbortSignal.addEventListener("abort", handleAbort, { signal: abortController.signal });
738
+ const accountNotifications = await rpcSubscriptions.accountNotifications(nonceAccountAddress, { commitment, encoding: "base64" }).subscribe({ abortSignal: abortController.signal });
739
+ const base58Decoder = codecs.getBase58Decoder();
740
+ const base64Encoder = codecs.getBase64Encoder();
741
+ function getNonceFromAccountData([base64EncodedBytes]) {
742
+ const data = base64Encoder.encode(base64EncodedBytes);
743
+ const nonceValueBytes = data.slice(NONCE_VALUE_OFFSET, NONCE_VALUE_OFFSET + 32);
744
+ return base58Decoder.decode(nonceValueBytes);
745
+ }
746
+ const nonceAccountDidAdvancePromise = (async () => {
747
+ for await (const accountNotification of accountNotifications) {
748
+ const nonceValue = getNonceFromAccountData(accountNotification.value.data);
749
+ if (nonceValue !== currentNonceValue) {
750
+ throw new Error(
751
+ `The nonce \`${currentNonceValue}\` is no longer valid. It has advanced to \`${nonceValue}\`.`
752
+ );
753
+ }
754
+ }
755
+ })();
756
+ const nonceIsAlreadyInvalidPromise = (async () => {
757
+ const { value: nonceAccount } = await rpc.getAccountInfo(nonceAccountAddress, {
758
+ commitment,
759
+ dataSlice: { length: 32, offset: NONCE_VALUE_OFFSET },
760
+ encoding: "base58"
761
+ }).send({ abortSignal: abortController.signal });
762
+ if (!nonceAccount) {
763
+ throw new Error(`No nonce account could be found at address \`${nonceAccountAddress}\`.`);
764
+ }
765
+ const nonceValue = (
766
+ // This works because we asked for the exact slice of data representing the nonce
767
+ // value, and furthermore asked for it in `base58` encoding.
768
+ nonceAccount.data[0]
769
+ );
770
+ if (nonceValue !== currentNonceValue) {
771
+ throw new Error(
772
+ `The nonce \`${currentNonceValue}\` is no longer valid. It has advanced to \`${nonceValue}\`.`
773
+ );
774
+ } else {
775
+ await new Promise(() => {
776
+ });
777
+ }
778
+ })();
779
+ try {
780
+ return await Promise.race([nonceAccountDidAdvancePromise, nonceIsAlreadyInvalidPromise]);
781
+ } finally {
782
+ abortController.abort();
783
+ }
784
+ };
785
+ }
786
+
787
+ // src/transaction-confirmation.ts
788
+ function createDefaultDurableNonceTransactionConfirmer({
789
+ rpc,
790
+ rpcSubscriptions
791
+ }) {
792
+ const getNonceInvalidationPromise = createNonceInvalidationPromiseFactory(rpc, rpcSubscriptions);
793
+ const getRecentSignatureConfirmationPromise = createRecentSignatureConfirmationPromiseFactory(
794
+ rpc,
795
+ rpcSubscriptions
796
+ );
797
+ return async function confirmDurableNonceTransaction(config) {
798
+ await waitForDurableNonceTransactionConfirmation({
799
+ ...config,
800
+ getNonceInvalidationPromise,
801
+ getRecentSignatureConfirmationPromise
802
+ });
803
+ };
804
+ }
805
+ function createDefaultRecentTransactionConfirmer({
806
+ rpc,
807
+ rpcSubscriptions
808
+ }) {
809
+ const getBlockHeightExceedencePromise = createBlockHeightExceedencePromiseFactory({
810
+ rpc,
811
+ rpcSubscriptions
812
+ });
813
+ const getRecentSignatureConfirmationPromise = createRecentSignatureConfirmationPromiseFactory(
814
+ rpc,
815
+ rpcSubscriptions
816
+ );
817
+ return async function confirmRecentTransaction(config) {
818
+ await waitForRecentTransactionConfirmation({
819
+ ...config,
820
+ getBlockHeightExceedencePromise,
821
+ getRecentSignatureConfirmationPromise
822
+ });
823
+ };
824
+ }
825
+ async function waitForDurableNonceTransactionConfirmation(config) {
826
+ await raceStrategies(
827
+ transactions.getSignatureFromTransaction(config.transaction),
828
+ config,
829
+ function getSpecificStrategiesForRace({ abortSignal, commitment, getNonceInvalidationPromise, transaction }) {
830
+ return [
831
+ getNonceInvalidationPromise({
832
+ abortSignal,
833
+ commitment,
834
+ currentNonceValue: transaction.lifetimeConstraint.nonce,
835
+ nonceAccountAddress: transaction.instructions[0].accounts[0].address
836
+ })
837
+ ];
838
+ }
839
+ );
840
+ }
841
+ async function waitForRecentTransactionConfirmation(config) {
842
+ await raceStrategies(
843
+ transactions.getSignatureFromTransaction(config.transaction),
844
+ config,
845
+ function getSpecificStrategiesForRace({
846
+ abortSignal,
847
+ commitment,
848
+ getBlockHeightExceedencePromise,
849
+ transaction
850
+ }) {
851
+ return [
852
+ getBlockHeightExceedencePromise({
853
+ abortSignal,
854
+ commitment,
855
+ lastValidBlockHeight: transaction.lifetimeConstraint.lastValidBlockHeight
856
+ })
857
+ ];
858
+ }
859
+ );
860
+ }
861
+
862
+ // src/send-transaction.ts
863
+ function getSendTransactionConfigWithAdjustedPreflightCommitment(commitment, config) {
864
+ if (
865
+ // The developer has supplied no value for `preflightCommitment`.
866
+ !config?.preflightCommitment && // The value of `commitment` is lower than the server default of `preflightCommitment`.
867
+ rpcTypes.commitmentComparator(
868
+ commitment,
869
+ "finalized"
870
+ /* default value of `preflightCommitment` */
871
+ ) < 0
872
+ ) {
873
+ return {
874
+ ...config,
875
+ // In the common case, it is unlikely that you want to simulate a transaction at
876
+ // `finalized` commitment when your standard of commitment for confirming the
877
+ // transaction is lower. Cap the simulation commitment level to the level of the
878
+ // confirmation commitment.
879
+ preflightCommitment: commitment
880
+ };
881
+ }
882
+ return config;
883
+ }
884
+ async function sendTransaction_INTERNAL({
885
+ abortSignal,
886
+ commitment,
887
+ rpc,
888
+ transaction,
889
+ ...sendTransactionConfig
890
+ }) {
891
+ const base64EncodedWireTransaction = transactions.getBase64EncodedWireTransaction(transaction);
892
+ return await rpc.sendTransaction(base64EncodedWireTransaction, {
893
+ ...getSendTransactionConfigWithAdjustedPreflightCommitment(commitment, sendTransactionConfig),
894
+ encoding: "base64"
895
+ }).send({ abortSignal });
896
+ }
897
+ function createDefaultDurableNonceTransactionSender({
898
+ rpc,
899
+ rpcSubscriptions
900
+ }) {
901
+ const confirmDurableNonceTransaction = createDefaultDurableNonceTransactionConfirmer({
902
+ rpc,
903
+ rpcSubscriptions
904
+ });
905
+ return async function sendDurableNonceTransaction(transaction, config) {
906
+ await sendAndConfirmDurableNonceTransaction({
907
+ ...config,
908
+ confirmDurableNonceTransaction,
909
+ rpc,
910
+ transaction
911
+ });
912
+ };
913
+ }
914
+ function createDefaultTransactionSender({
915
+ rpc,
916
+ rpcSubscriptions
917
+ }) {
918
+ const confirmRecentTransaction = createDefaultRecentTransactionConfirmer({
919
+ rpc,
920
+ rpcSubscriptions
921
+ });
922
+ return async function sendTransaction(transaction, config) {
923
+ await sendAndConfirmTransaction({
924
+ ...config,
925
+ confirmRecentTransaction,
926
+ rpc,
927
+ transaction
928
+ });
929
+ };
930
+ }
931
+ async function sendAndConfirmDurableNonceTransaction({
932
+ abortSignal,
933
+ commitment,
934
+ confirmDurableNonceTransaction,
935
+ rpc,
936
+ transaction,
937
+ ...sendTransactionConfig
938
+ }) {
939
+ const transactionSignature = await sendTransaction_INTERNAL({
940
+ ...sendTransactionConfig,
941
+ abortSignal,
942
+ commitment,
943
+ rpc,
944
+ transaction
945
+ });
946
+ await confirmDurableNonceTransaction({
947
+ abortSignal,
948
+ commitment,
949
+ transaction
950
+ });
951
+ return transactionSignature;
952
+ }
953
+ async function sendAndConfirmTransaction({
954
+ abortSignal,
955
+ commitment,
956
+ confirmRecentTransaction,
957
+ rpc,
958
+ transaction,
959
+ ...sendTransactionConfig
960
+ }) {
961
+ const transactionSignature = await sendTransaction_INTERNAL({
962
+ ...sendTransactionConfig,
963
+ abortSignal,
964
+ commitment,
965
+ rpc,
966
+ transaction
967
+ });
968
+ await confirmRecentTransaction({
969
+ abortSignal,
970
+ commitment,
971
+ transaction
972
+ });
973
+ return transactionSignature;
974
+ }
975
+
976
+ exports.createBlockHeightExceedencePromiseFactory = createBlockHeightExceedencePromiseFactory;
977
+ exports.createDefaultAirdropRequester = createDefaultAirdropRequester;
978
+ exports.createDefaultDurableNonceTransactionConfirmer = createDefaultDurableNonceTransactionConfirmer;
979
+ exports.createDefaultDurableNonceTransactionSender = createDefaultDurableNonceTransactionSender;
980
+ exports.createDefaultRecentTransactionConfirmer = createDefaultRecentTransactionConfirmer;
981
+ exports.createDefaultRpcSubscriptionsTransport = createDefaultRpcSubscriptionsTransport;
143
982
  exports.createDefaultRpcTransport = createDefaultRpcTransport;
983
+ exports.createDefaultTransactionSender = createDefaultTransactionSender;
984
+ exports.createNonceInvalidationPromiseFactory = createNonceInvalidationPromiseFactory;
985
+ exports.createRecentSignatureConfirmationPromiseFactory = createRecentSignatureConfirmationPromiseFactory;
144
986
  exports.createSolanaRpc = createSolanaRpc;
987
+ exports.createSolanaRpcSubscriptions = createSolanaRpcSubscriptions;
988
+ exports.createSolanaRpcSubscriptions_UNSTABLE = createSolanaRpcSubscriptions_UNSTABLE;
989
+ exports.decodeTransaction = decodeTransaction;
990
+ exports.requestAndConfirmAirdrop = requestAndConfirmAirdrop;
991
+ exports.sendAndConfirmDurableNonceTransaction = sendAndConfirmDurableNonceTransaction;
992
+ exports.sendAndConfirmTransaction = sendAndConfirmTransaction;
993
+ exports.waitForDurableNonceTransactionConfirmation = waitForDurableNonceTransactionConfirmation;
994
+ exports.waitForRecentTransactionConfirmation = waitForRecentTransactionConfirmation;
995
+ Object.keys(accounts).forEach(function (k) {
996
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
997
+ enumerable: true,
998
+ get: function () { return accounts[k]; }
999
+ });
1000
+ });
1001
+ Object.keys(addresses).forEach(function (k) {
1002
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1003
+ enumerable: true,
1004
+ get: function () { return addresses[k]; }
1005
+ });
1006
+ });
1007
+ Object.keys(codecs).forEach(function (k) {
1008
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1009
+ enumerable: true,
1010
+ get: function () { return codecs[k]; }
1011
+ });
1012
+ });
1013
+ Object.keys(functional).forEach(function (k) {
1014
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1015
+ enumerable: true,
1016
+ get: function () { return functional[k]; }
1017
+ });
1018
+ });
145
1019
  Object.keys(instructions).forEach(function (k) {
146
- if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
1020
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
147
1021
  enumerable: true,
148
1022
  get: function () { return instructions[k]; }
149
1023
  });
150
1024
  });
151
1025
  Object.keys(keys).forEach(function (k) {
152
- if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
1026
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
153
1027
  enumerable: true,
154
1028
  get: function () { return keys[k]; }
155
1029
  });
156
1030
  });
1031
+ Object.keys(programs).forEach(function (k) {
1032
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1033
+ enumerable: true,
1034
+ get: function () { return programs[k]; }
1035
+ });
1036
+ });
1037
+ Object.keys(rpcParsedTypes).forEach(function (k) {
1038
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1039
+ enumerable: true,
1040
+ get: function () { return rpcParsedTypes[k]; }
1041
+ });
1042
+ });
1043
+ Object.keys(rpcTypes).forEach(function (k) {
1044
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1045
+ enumerable: true,
1046
+ get: function () { return rpcTypes[k]; }
1047
+ });
1048
+ });
1049
+ Object.keys(signers).forEach(function (k) {
1050
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1051
+ enumerable: true,
1052
+ get: function () { return signers[k]; }
1053
+ });
1054
+ });
1055
+ Object.keys(transactions).forEach(function (k) {
1056
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
1057
+ enumerable: true,
1058
+ get: function () { return transactions[k]; }
1059
+ });
1060
+ });
157
1061
  //# sourceMappingURL=out.js.map
158
1062
  //# sourceMappingURL=index.browser.cjs.map