@pooflabs/web 0.0.77 → 0.0.78
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/dist/index-Bdcc5821.js +2375 -0
- package/dist/index-Bdcc5821.js.map +1 -0
- package/dist/{index-KUU0aVzP.js → index-CKaaE12K.js} +24 -882
- package/dist/index-CKaaE12K.js.map +1 -0
- package/dist/{index-CeQ8hE3s.esm.js → index-Cmu0PVJD.esm.js} +23 -881
- package/dist/index-Cmu0PVJD.esm.js.map +1 -0
- package/dist/{index-DQVpAl5t.js → index-Cp727oEW.js} +517 -287
- package/dist/index-Cp727oEW.js.map +1 -0
- package/dist/index-CrOVJFX9.esm.js +2373 -0
- package/dist/index-CrOVJFX9.esm.js.map +1 -0
- package/dist/{index-CFh1x-M0.esm.js → index-CwGoYY0Y.esm.js} +517 -288
- package/dist/index-CwGoYY0Y.esm.js.map +1 -0
- package/dist/{index-Bfk81d8_.js → index-DE7k2G22.js} +25 -883
- package/dist/index-DE7k2G22.js.map +1 -0
- package/dist/{index-R7t9pRt_.esm.js → index-OAJ0rndN.esm.js} +24 -882
- package/dist/index-OAJ0rndN.esm.js.map +1 -0
- package/dist/{index.browser-Di1_YZpi.js → index.browser-AZQ5TnZ4.js} +2 -2
- package/dist/{index.browser-Di1_YZpi.js.map → index.browser-AZQ5TnZ4.js.map} +1 -1
- package/dist/{index.browser-BE44CEaJ.esm.js → index.browser-B4een3Gz.esm.js} +2 -2
- package/dist/{index.browser-BE44CEaJ.esm.js.map → index.browser-B4een3Gz.esm.js.map} +1 -1
- package/dist/{index.browser-Df7yN8D5.js → index.browser-BMtEulGJ.js} +6 -129
- package/dist/index.browser-BMtEulGJ.js.map +1 -0
- package/dist/{index.browser-C9bFQZyQ.esm.js → index.browser-DFeGGyO7.esm.js} +5 -128
- package/dist/index.browser-DFeGGyO7.esm.js.map +1 -0
- package/dist/{index.browser-dszs5oe5.js → index.browser-QPkAiPQp.js} +6 -129
- package/dist/index.browser-QPkAiPQp.js.map +1 -0
- package/dist/{index.browser-Dbq5Qf1G.esm.js → index.browser-x87QUr4N.esm.js} +5 -128
- package/dist/index.browser-x87QUr4N.esm.js.map +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.native-DAyMVhFq.esm.js → index.native-CjEJXA9y.esm.js} +548 -2688
- package/dist/index.native-CjEJXA9y.esm.js.map +1 -0
- package/dist/{index.native-CKd2b3_F.js → index.native-D7IrIMX1.js} +547 -2688
- package/dist/index.native-D7IrIMX1.js.map +1 -0
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +1 -1
- package/dist/{phantom-wallet-provider-DQ0uhl2v.esm.js → phantom-wallet-provider-B1TleWsy.esm.js} +4 -4
- package/dist/{phantom-wallet-provider-DQ0uhl2v.esm.js.map → phantom-wallet-provider-B1TleWsy.esm.js.map} +1 -1
- package/dist/{phantom-wallet-provider-DJ6qf2VB.js → phantom-wallet-provider-DwmdHVd-.js} +4 -4
- package/dist/{phantom-wallet-provider-DJ6qf2VB.js.map → phantom-wallet-provider-DwmdHVd-.js.map} +1 -1
- package/dist/{privy-wallet-provider-BhiHnphv.esm.js → privy-wallet-provider-CZgiUwUN.esm.js} +3 -3
- package/dist/privy-wallet-provider-CZgiUwUN.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-CMCv5g3O.js → privy-wallet-provider-Cf6WgpK1.js} +3 -3
- package/dist/privy-wallet-provider-Cf6WgpK1.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-DSSk_6CR.esm.js → solana-mobile-wallet-provider-C9j8O3mD.esm.js} +4 -4
- package/dist/{solana-mobile-wallet-provider-DSSk_6CR.esm.js.map → solana-mobile-wallet-provider-C9j8O3mD.esm.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-DaFNesCe.js → solana-mobile-wallet-provider-DZmpeNIS.js} +4 -4
- package/dist/{solana-mobile-wallet-provider-DaFNesCe.js.map → solana-mobile-wallet-provider-DZmpeNIS.js.map} +1 -1
- package/package.json +2 -2
- package/dist/index-Bfk81d8_.js.map +0 -1
- package/dist/index-CFh1x-M0.esm.js.map +0 -1
- package/dist/index-CdOv7Nw2.esm.js +0 -6
- package/dist/index-CdOv7Nw2.esm.js.map +0 -1
- package/dist/index-CeQ8hE3s.esm.js.map +0 -1
- package/dist/index-DDXzCx2W.js +0 -8
- package/dist/index-DDXzCx2W.js.map +0 -1
- package/dist/index-DQVpAl5t.js.map +0 -1
- package/dist/index-KUU0aVzP.js.map +0 -1
- package/dist/index-R7t9pRt_.esm.js.map +0 -1
- package/dist/index.browser-C9bFQZyQ.esm.js.map +0 -1
- package/dist/index.browser-Dbq5Qf1G.esm.js.map +0 -1
- package/dist/index.browser-Df7yN8D5.js.map +0 -1
- package/dist/index.browser-dszs5oe5.js.map +0 -1
- package/dist/index.native-CKd2b3_F.js.map +0 -1
- package/dist/index.native-DAyMVhFq.esm.js.map +0 -1
- package/dist/privy-wallet-provider-BhiHnphv.esm.js.map +0 -1
- package/dist/privy-wallet-provider-CMCv5g3O.js.map +0 -1
|
@@ -4,21 +4,6 @@ import * as anchor from '@coral-xyz/anchor';
|
|
|
4
4
|
import { Program } from '@coral-xyz/anchor';
|
|
5
5
|
import * as React$2 from 'react';
|
|
6
6
|
|
|
7
|
-
function _mergeNamespaces(n, m) {
|
|
8
|
-
m.forEach(function (e) {
|
|
9
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
10
|
-
if (k !== 'default' && !(k in n)) {
|
|
11
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return e[k]; }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
return Object.freeze(n);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
7
|
function getDefaultExportFromCjs$1 (x) {
|
|
23
8
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
24
9
|
}
|
|
@@ -6394,6 +6379,261 @@ var ReconnectingWebSocket = /** @class */ (function () {
|
|
|
6394
6379
|
return ReconnectingWebSocket;
|
|
6395
6380
|
}());
|
|
6396
6381
|
|
|
6382
|
+
function getDefaultExportFromCjs (x) {
|
|
6383
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6384
|
+
}
|
|
6385
|
+
|
|
6386
|
+
var isRetryAllowed$1;
|
|
6387
|
+
var hasRequiredIsRetryAllowed;
|
|
6388
|
+
|
|
6389
|
+
function requireIsRetryAllowed () {
|
|
6390
|
+
if (hasRequiredIsRetryAllowed) return isRetryAllowed$1;
|
|
6391
|
+
hasRequiredIsRetryAllowed = 1;
|
|
6392
|
+
|
|
6393
|
+
const denyList = new Set([
|
|
6394
|
+
'ENOTFOUND',
|
|
6395
|
+
'ENETUNREACH',
|
|
6396
|
+
|
|
6397
|
+
// SSL errors from https://github.com/nodejs/node/blob/fc8e3e2cdc521978351de257030db0076d79e0ab/src/crypto/crypto_common.cc#L301-L328
|
|
6398
|
+
'UNABLE_TO_GET_ISSUER_CERT',
|
|
6399
|
+
'UNABLE_TO_GET_CRL',
|
|
6400
|
+
'UNABLE_TO_DECRYPT_CERT_SIGNATURE',
|
|
6401
|
+
'UNABLE_TO_DECRYPT_CRL_SIGNATURE',
|
|
6402
|
+
'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY',
|
|
6403
|
+
'CERT_SIGNATURE_FAILURE',
|
|
6404
|
+
'CRL_SIGNATURE_FAILURE',
|
|
6405
|
+
'CERT_NOT_YET_VALID',
|
|
6406
|
+
'CERT_HAS_EXPIRED',
|
|
6407
|
+
'CRL_NOT_YET_VALID',
|
|
6408
|
+
'CRL_HAS_EXPIRED',
|
|
6409
|
+
'ERROR_IN_CERT_NOT_BEFORE_FIELD',
|
|
6410
|
+
'ERROR_IN_CERT_NOT_AFTER_FIELD',
|
|
6411
|
+
'ERROR_IN_CRL_LAST_UPDATE_FIELD',
|
|
6412
|
+
'ERROR_IN_CRL_NEXT_UPDATE_FIELD',
|
|
6413
|
+
'OUT_OF_MEM',
|
|
6414
|
+
'DEPTH_ZERO_SELF_SIGNED_CERT',
|
|
6415
|
+
'SELF_SIGNED_CERT_IN_CHAIN',
|
|
6416
|
+
'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
|
|
6417
|
+
'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
|
|
6418
|
+
'CERT_CHAIN_TOO_LONG',
|
|
6419
|
+
'CERT_REVOKED',
|
|
6420
|
+
'INVALID_CA',
|
|
6421
|
+
'PATH_LENGTH_EXCEEDED',
|
|
6422
|
+
'INVALID_PURPOSE',
|
|
6423
|
+
'CERT_UNTRUSTED',
|
|
6424
|
+
'CERT_REJECTED',
|
|
6425
|
+
'HOSTNAME_MISMATCH'
|
|
6426
|
+
]);
|
|
6427
|
+
|
|
6428
|
+
// TODO: Use `error?.code` when targeting Node.js 14
|
|
6429
|
+
isRetryAllowed$1 = error => !denyList.has(error && error.code);
|
|
6430
|
+
return isRetryAllowed$1;
|
|
6431
|
+
}
|
|
6432
|
+
|
|
6433
|
+
var isRetryAllowedExports = requireIsRetryAllowed();
|
|
6434
|
+
var isRetryAllowed = /*@__PURE__*/getDefaultExportFromCjs(isRetryAllowedExports);
|
|
6435
|
+
|
|
6436
|
+
const namespace = 'axios-retry';
|
|
6437
|
+
function isNetworkError(error) {
|
|
6438
|
+
const CODE_EXCLUDE_LIST = ['ERR_CANCELED', 'ECONNABORTED'];
|
|
6439
|
+
if (error.response) {
|
|
6440
|
+
return false;
|
|
6441
|
+
}
|
|
6442
|
+
if (!error.code) {
|
|
6443
|
+
return false;
|
|
6444
|
+
}
|
|
6445
|
+
// Prevents retrying timed out & cancelled requests
|
|
6446
|
+
if (CODE_EXCLUDE_LIST.includes(error.code)) {
|
|
6447
|
+
return false;
|
|
6448
|
+
}
|
|
6449
|
+
// Prevents retrying unsafe errors
|
|
6450
|
+
return isRetryAllowed(error);
|
|
6451
|
+
}
|
|
6452
|
+
const SAFE_HTTP_METHODS = ['get', 'head', 'options'];
|
|
6453
|
+
const IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);
|
|
6454
|
+
function isRetryableError(error) {
|
|
6455
|
+
return (error.code !== 'ECONNABORTED' &&
|
|
6456
|
+
(!error.response ||
|
|
6457
|
+
error.response.status === 429 ||
|
|
6458
|
+
(error.response.status >= 500 && error.response.status <= 599)));
|
|
6459
|
+
}
|
|
6460
|
+
function isSafeRequestError(error) {
|
|
6461
|
+
if (!error.config?.method) {
|
|
6462
|
+
// Cannot determine if the request can be retried
|
|
6463
|
+
return false;
|
|
6464
|
+
}
|
|
6465
|
+
return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
|
6466
|
+
}
|
|
6467
|
+
function isIdempotentRequestError(error) {
|
|
6468
|
+
if (!error.config?.method) {
|
|
6469
|
+
// Cannot determine if the request can be retried
|
|
6470
|
+
return false;
|
|
6471
|
+
}
|
|
6472
|
+
return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
|
6473
|
+
}
|
|
6474
|
+
function isNetworkOrIdempotentRequestError(error) {
|
|
6475
|
+
return isNetworkError(error) || isIdempotentRequestError(error);
|
|
6476
|
+
}
|
|
6477
|
+
function retryAfter(error = undefined) {
|
|
6478
|
+
const retryAfterHeader = error?.response?.headers['retry-after'];
|
|
6479
|
+
if (!retryAfterHeader) {
|
|
6480
|
+
return 0;
|
|
6481
|
+
}
|
|
6482
|
+
// if the retry after header is a number, convert it to milliseconds
|
|
6483
|
+
let retryAfterMs = (Number(retryAfterHeader) || 0) * 1000;
|
|
6484
|
+
// If the retry after header is a date, get the number of milliseconds until that date
|
|
6485
|
+
if (retryAfterMs === 0) {
|
|
6486
|
+
retryAfterMs = (new Date(retryAfterHeader).valueOf() || 0) - Date.now();
|
|
6487
|
+
}
|
|
6488
|
+
return Math.max(0, retryAfterMs);
|
|
6489
|
+
}
|
|
6490
|
+
function noDelay(_retryNumber = 0, error = undefined) {
|
|
6491
|
+
return Math.max(0, retryAfter(error));
|
|
6492
|
+
}
|
|
6493
|
+
function exponentialDelay(retryNumber = 0, error = undefined, delayFactor = 100) {
|
|
6494
|
+
const calculatedDelay = 2 ** retryNumber * delayFactor;
|
|
6495
|
+
const delay = Math.max(calculatedDelay, retryAfter(error));
|
|
6496
|
+
const randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay
|
|
6497
|
+
return delay + randomSum;
|
|
6498
|
+
}
|
|
6499
|
+
/**
|
|
6500
|
+
* Linear delay
|
|
6501
|
+
* @param {number | undefined} delayFactor - delay factor in milliseconds (default: 100)
|
|
6502
|
+
* @returns {function} (retryNumber: number, error: AxiosError | undefined) => number
|
|
6503
|
+
*/
|
|
6504
|
+
function linearDelay(delayFactor = 100) {
|
|
6505
|
+
return (retryNumber = 0, error = undefined) => {
|
|
6506
|
+
const delay = retryNumber * delayFactor;
|
|
6507
|
+
return Math.max(delay, retryAfter(error));
|
|
6508
|
+
};
|
|
6509
|
+
}
|
|
6510
|
+
const DEFAULT_OPTIONS = {
|
|
6511
|
+
retries: 3,
|
|
6512
|
+
retryCondition: isNetworkOrIdempotentRequestError,
|
|
6513
|
+
retryDelay: noDelay,
|
|
6514
|
+
shouldResetTimeout: false,
|
|
6515
|
+
onRetry: () => { },
|
|
6516
|
+
onMaxRetryTimesExceeded: () => { },
|
|
6517
|
+
validateResponse: null
|
|
6518
|
+
};
|
|
6519
|
+
function getRequestOptions(config, defaultOptions) {
|
|
6520
|
+
return { ...DEFAULT_OPTIONS, ...defaultOptions, ...config[namespace] };
|
|
6521
|
+
}
|
|
6522
|
+
function setCurrentState(config, defaultOptions, resetLastRequestTime = false) {
|
|
6523
|
+
const currentState = getRequestOptions(config, defaultOptions || {});
|
|
6524
|
+
currentState.retryCount = currentState.retryCount || 0;
|
|
6525
|
+
if (!currentState.lastRequestTime || resetLastRequestTime) {
|
|
6526
|
+
currentState.lastRequestTime = Date.now();
|
|
6527
|
+
}
|
|
6528
|
+
config[namespace] = currentState;
|
|
6529
|
+
return currentState;
|
|
6530
|
+
}
|
|
6531
|
+
function fixConfig(axiosInstance, config) {
|
|
6532
|
+
// @ts-ignore
|
|
6533
|
+
if (axiosInstance.defaults.agent === config.agent) {
|
|
6534
|
+
// @ts-ignore
|
|
6535
|
+
delete config.agent;
|
|
6536
|
+
}
|
|
6537
|
+
if (axiosInstance.defaults.httpAgent === config.httpAgent) {
|
|
6538
|
+
delete config.httpAgent;
|
|
6539
|
+
}
|
|
6540
|
+
if (axiosInstance.defaults.httpsAgent === config.httpsAgent) {
|
|
6541
|
+
delete config.httpsAgent;
|
|
6542
|
+
}
|
|
6543
|
+
}
|
|
6544
|
+
async function shouldRetry(currentState, error) {
|
|
6545
|
+
const { retries, retryCondition } = currentState;
|
|
6546
|
+
const shouldRetryOrPromise = (currentState.retryCount || 0) < retries && retryCondition(error);
|
|
6547
|
+
// This could be a promise
|
|
6548
|
+
if (typeof shouldRetryOrPromise === 'object') {
|
|
6549
|
+
try {
|
|
6550
|
+
const shouldRetryPromiseResult = await shouldRetryOrPromise;
|
|
6551
|
+
// keep return true unless shouldRetryPromiseResult return false for compatibility
|
|
6552
|
+
return shouldRetryPromiseResult !== false;
|
|
6553
|
+
}
|
|
6554
|
+
catch (_err) {
|
|
6555
|
+
return false;
|
|
6556
|
+
}
|
|
6557
|
+
}
|
|
6558
|
+
return shouldRetryOrPromise;
|
|
6559
|
+
}
|
|
6560
|
+
async function handleRetry(axiosInstance, currentState, error, config) {
|
|
6561
|
+
currentState.retryCount += 1;
|
|
6562
|
+
const { retryDelay, shouldResetTimeout, onRetry } = currentState;
|
|
6563
|
+
const delay = retryDelay(currentState.retryCount, error);
|
|
6564
|
+
// Axios fails merging this configuration to the default configuration because it has an issue
|
|
6565
|
+
// with circular structures: https://github.com/mzabriskie/axios/issues/370
|
|
6566
|
+
fixConfig(axiosInstance, config);
|
|
6567
|
+
if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {
|
|
6568
|
+
const lastRequestDuration = Date.now() - currentState.lastRequestTime;
|
|
6569
|
+
const timeout = config.timeout - lastRequestDuration - delay;
|
|
6570
|
+
if (timeout <= 0) {
|
|
6571
|
+
return Promise.reject(error);
|
|
6572
|
+
}
|
|
6573
|
+
config.timeout = timeout;
|
|
6574
|
+
}
|
|
6575
|
+
config.transformRequest = [(data) => data];
|
|
6576
|
+
await onRetry(currentState.retryCount, error, config);
|
|
6577
|
+
if (config.signal?.aborted) {
|
|
6578
|
+
return Promise.resolve(axiosInstance(config));
|
|
6579
|
+
}
|
|
6580
|
+
return new Promise((resolve) => {
|
|
6581
|
+
const abortListener = () => {
|
|
6582
|
+
clearTimeout(timeout);
|
|
6583
|
+
resolve(axiosInstance(config));
|
|
6584
|
+
};
|
|
6585
|
+
const timeout = setTimeout(() => {
|
|
6586
|
+
resolve(axiosInstance(config));
|
|
6587
|
+
if (config.signal?.removeEventListener) {
|
|
6588
|
+
config.signal.removeEventListener('abort', abortListener);
|
|
6589
|
+
}
|
|
6590
|
+
}, delay);
|
|
6591
|
+
if (config.signal?.addEventListener) {
|
|
6592
|
+
config.signal.addEventListener('abort', abortListener, { once: true });
|
|
6593
|
+
}
|
|
6594
|
+
});
|
|
6595
|
+
}
|
|
6596
|
+
async function handleMaxRetryTimesExceeded(currentState, error) {
|
|
6597
|
+
if (currentState.retryCount >= currentState.retries)
|
|
6598
|
+
await currentState.onMaxRetryTimesExceeded(error, currentState.retryCount);
|
|
6599
|
+
}
|
|
6600
|
+
const axiosRetry = (axiosInstance, defaultOptions) => {
|
|
6601
|
+
const requestInterceptorId = axiosInstance.interceptors.request.use((config) => {
|
|
6602
|
+
setCurrentState(config, defaultOptions, true);
|
|
6603
|
+
if (config[namespace]?.validateResponse) {
|
|
6604
|
+
// by setting this, all HTTP responses will be go through the error interceptor first
|
|
6605
|
+
config.validateStatus = () => false;
|
|
6606
|
+
}
|
|
6607
|
+
return config;
|
|
6608
|
+
});
|
|
6609
|
+
const responseInterceptorId = axiosInstance.interceptors.response.use(null, async (error) => {
|
|
6610
|
+
const { config } = error;
|
|
6611
|
+
// If we have no information to retry the request
|
|
6612
|
+
if (!config) {
|
|
6613
|
+
return Promise.reject(error);
|
|
6614
|
+
}
|
|
6615
|
+
const currentState = setCurrentState(config, defaultOptions);
|
|
6616
|
+
if (error.response && currentState.validateResponse?.(error.response)) {
|
|
6617
|
+
// no issue with response
|
|
6618
|
+
return error.response;
|
|
6619
|
+
}
|
|
6620
|
+
if (await shouldRetry(currentState, error)) {
|
|
6621
|
+
return handleRetry(axiosInstance, currentState, error, config);
|
|
6622
|
+
}
|
|
6623
|
+
await handleMaxRetryTimesExceeded(currentState, error);
|
|
6624
|
+
return Promise.reject(error);
|
|
6625
|
+
});
|
|
6626
|
+
return { requestInterceptorId, responseInterceptorId };
|
|
6627
|
+
};
|
|
6628
|
+
// Compatibility with CommonJS
|
|
6629
|
+
axiosRetry.isNetworkError = isNetworkError;
|
|
6630
|
+
axiosRetry.isSafeRequestError = isSafeRequestError;
|
|
6631
|
+
axiosRetry.isIdempotentRequestError = isIdempotentRequestError;
|
|
6632
|
+
axiosRetry.isNetworkOrIdempotentRequestError = isNetworkOrIdempotentRequestError;
|
|
6633
|
+
axiosRetry.exponentialDelay = exponentialDelay;
|
|
6634
|
+
axiosRetry.linearDelay = linearDelay;
|
|
6635
|
+
axiosRetry.isRetryableError = isRetryableError;
|
|
6636
|
+
|
|
6397
6637
|
let axiosClient;
|
|
6398
6638
|
async function getAxiosAuthClient() {
|
|
6399
6639
|
if (!axiosClient) {
|
|
@@ -6403,6 +6643,7 @@ async function getAxiosAuthClient() {
|
|
|
6403
6643
|
headers: {
|
|
6404
6644
|
'Content-Type': 'application/json',
|
|
6405
6645
|
},
|
|
6646
|
+
timeout: 30000, // 30s timeout, matching makeApiRequest
|
|
6406
6647
|
});
|
|
6407
6648
|
}
|
|
6408
6649
|
return axiosClient;
|
|
@@ -6449,15 +6690,41 @@ async function createSessionWithPrivy(authToken, address, privyIdToken) {
|
|
|
6449
6690
|
});
|
|
6450
6691
|
return response.data;
|
|
6451
6692
|
}
|
|
6693
|
+
// Deduplicate concurrent refreshSession calls to prevent multiple code paths
|
|
6694
|
+
// (WebSocket reconnection, periodic refresh, API 401 retry) from all hitting
|
|
6695
|
+
// /session/refresh simultaneously.
|
|
6696
|
+
// Note: module-level state is shared across requests in SSR/Node — acceptable
|
|
6697
|
+
// since there is only one active session per server instance (same pattern as
|
|
6698
|
+
// refreshInFlight in api.ts).
|
|
6699
|
+
let refreshInFlight$1 = null;
|
|
6700
|
+
let refreshInFlightToken = null;
|
|
6452
6701
|
async function refreshSession(refreshToken) {
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6702
|
+
if (refreshInFlight$1 && refreshInFlightToken === refreshToken) {
|
|
6703
|
+
return refreshInFlight$1;
|
|
6704
|
+
}
|
|
6705
|
+
refreshInFlightToken = refreshToken;
|
|
6706
|
+
let currentFlight;
|
|
6707
|
+
currentFlight = refreshInFlight$1 = (async () => {
|
|
6708
|
+
try {
|
|
6709
|
+
const client = await getAxiosAuthClient();
|
|
6710
|
+
const config = await getConfig();
|
|
6711
|
+
const appId = config.appId;
|
|
6712
|
+
const response = await client.post('/session/refresh', {
|
|
6713
|
+
refreshToken,
|
|
6714
|
+
appId
|
|
6715
|
+
});
|
|
6716
|
+
return response.data;
|
|
6717
|
+
}
|
|
6718
|
+
finally {
|
|
6719
|
+
// Only clear if we're still the active in-flight request.
|
|
6720
|
+
// A second call with a different token may have replaced us.
|
|
6721
|
+
if (refreshInFlight$1 === currentFlight) {
|
|
6722
|
+
refreshInFlight$1 = null;
|
|
6723
|
+
refreshInFlightToken = null;
|
|
6724
|
+
}
|
|
6725
|
+
}
|
|
6726
|
+
})();
|
|
6727
|
+
return refreshInFlight$1;
|
|
6461
6728
|
}
|
|
6462
6729
|
async function signSessionCreateMessage(_signMessageFunction) {
|
|
6463
6730
|
}
|
|
@@ -6595,14 +6862,10 @@ class WebSessionManager {
|
|
|
6595
6862
|
WebSessionManager.TAROBASE_SESSION_STORAGE_KEY = "tarobase_session_storage";
|
|
6596
6863
|
|
|
6597
6864
|
var webSessionManager = /*#__PURE__*/Object.freeze({
|
|
6598
|
-
|
|
6599
|
-
|
|
6865
|
+
__proto__: null,
|
|
6866
|
+
WebSessionManager: WebSessionManager
|
|
6600
6867
|
});
|
|
6601
6868
|
|
|
6602
|
-
function getDefaultExportFromCjs (x) {
|
|
6603
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6604
|
-
}
|
|
6605
|
-
|
|
6606
6869
|
var buffer$1 = {};
|
|
6607
6870
|
|
|
6608
6871
|
var base64Js$1 = {};
|
|
@@ -8974,15 +9237,15 @@ function requireBuffer$1 () {
|
|
|
8974
9237
|
|
|
8975
9238
|
var bufferExports$1 = requireBuffer$1();
|
|
8976
9239
|
|
|
8977
|
-
var safeBuffer
|
|
9240
|
+
var safeBuffer = {exports: {}};
|
|
8978
9241
|
|
|
8979
9242
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
8980
9243
|
|
|
8981
|
-
var hasRequiredSafeBuffer
|
|
9244
|
+
var hasRequiredSafeBuffer;
|
|
8982
9245
|
|
|
8983
|
-
function requireSafeBuffer
|
|
8984
|
-
if (hasRequiredSafeBuffer
|
|
8985
|
-
hasRequiredSafeBuffer
|
|
9246
|
+
function requireSafeBuffer () {
|
|
9247
|
+
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
9248
|
+
hasRequiredSafeBuffer = 1;
|
|
8986
9249
|
(function (module, exports$1) {
|
|
8987
9250
|
/* eslint-disable node/no-deprecated-api */
|
|
8988
9251
|
var buffer = requireBuffer$1();
|
|
@@ -9048,23 +9311,23 @@ function requireSafeBuffer$1 () {
|
|
|
9048
9311
|
}
|
|
9049
9312
|
return buffer.SlowBuffer(size)
|
|
9050
9313
|
};
|
|
9051
|
-
} (safeBuffer
|
|
9052
|
-
return safeBuffer
|
|
9314
|
+
} (safeBuffer, safeBuffer.exports));
|
|
9315
|
+
return safeBuffer.exports;
|
|
9053
9316
|
}
|
|
9054
9317
|
|
|
9055
|
-
var src
|
|
9056
|
-
var hasRequiredSrc
|
|
9318
|
+
var src;
|
|
9319
|
+
var hasRequiredSrc;
|
|
9057
9320
|
|
|
9058
|
-
function requireSrc
|
|
9059
|
-
if (hasRequiredSrc
|
|
9060
|
-
hasRequiredSrc
|
|
9321
|
+
function requireSrc () {
|
|
9322
|
+
if (hasRequiredSrc) return src;
|
|
9323
|
+
hasRequiredSrc = 1;
|
|
9061
9324
|
// base-x encoding / decoding
|
|
9062
9325
|
// Copyright (c) 2018 base-x contributors
|
|
9063
9326
|
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
9064
9327
|
// Distributed under the MIT software license, see the accompanying
|
|
9065
9328
|
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
9066
9329
|
// @ts-ignore
|
|
9067
|
-
var _Buffer = requireSafeBuffer
|
|
9330
|
+
var _Buffer = requireSafeBuffer().Buffer;
|
|
9068
9331
|
function base (ALPHABET) {
|
|
9069
9332
|
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
9070
9333
|
var BASE_MAP = new Uint8Array(256);
|
|
@@ -9179,25 +9442,25 @@ function requireSrc$1 () {
|
|
|
9179
9442
|
decode: decode
|
|
9180
9443
|
}
|
|
9181
9444
|
}
|
|
9182
|
-
src
|
|
9183
|
-
return src
|
|
9445
|
+
src = base;
|
|
9446
|
+
return src;
|
|
9184
9447
|
}
|
|
9185
9448
|
|
|
9186
|
-
var bs58$1
|
|
9187
|
-
var hasRequiredBs58
|
|
9449
|
+
var bs58$1;
|
|
9450
|
+
var hasRequiredBs58;
|
|
9188
9451
|
|
|
9189
|
-
function requireBs58
|
|
9190
|
-
if (hasRequiredBs58
|
|
9191
|
-
hasRequiredBs58
|
|
9192
|
-
var basex = requireSrc
|
|
9452
|
+
function requireBs58 () {
|
|
9453
|
+
if (hasRequiredBs58) return bs58$1;
|
|
9454
|
+
hasRequiredBs58 = 1;
|
|
9455
|
+
var basex = requireSrc();
|
|
9193
9456
|
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
9194
9457
|
|
|
9195
|
-
bs58$1
|
|
9196
|
-
return bs58$1
|
|
9458
|
+
bs58$1 = basex(ALPHABET);
|
|
9459
|
+
return bs58$1;
|
|
9197
9460
|
}
|
|
9198
9461
|
|
|
9199
|
-
var bs58Exports
|
|
9200
|
-
var bs58$2 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports
|
|
9462
|
+
var bs58Exports = requireBs58();
|
|
9463
|
+
var bs58$2 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports);
|
|
9201
9464
|
|
|
9202
9465
|
// ─────────────────────────────────────────────────────────────
|
|
9203
9466
|
// Local implementation of getSimulationComputeUnits
|
|
@@ -9399,7 +9662,19 @@ async function buildSetDocumentsTransaction(connection, idl, anchorProvider, pay
|
|
|
9399
9662
|
}
|
|
9400
9663
|
}
|
|
9401
9664
|
else if (lutKey != null) {
|
|
9402
|
-
|
|
9665
|
+
// The LUT may have just been created server-side and the client's RPC node
|
|
9666
|
+
// may not have indexed it yet (load-balancer split). Retry with exponential
|
|
9667
|
+
// back-off; first retry at 100 ms almost always resolves it.
|
|
9668
|
+
let table = null;
|
|
9669
|
+
for (let attempt = 0; attempt < 5; attempt++) {
|
|
9670
|
+
const { value } = await connection.getAddressLookupTable(new PublicKey(lutKey));
|
|
9671
|
+
if (value) {
|
|
9672
|
+
table = value;
|
|
9673
|
+
break;
|
|
9674
|
+
}
|
|
9675
|
+
if (attempt < 4)
|
|
9676
|
+
await new Promise(r => setTimeout(r, 100 * Math.pow(2, attempt)));
|
|
9677
|
+
}
|
|
9403
9678
|
if (!table)
|
|
9404
9679
|
throw new Error('LUT not found after creation/extend');
|
|
9405
9680
|
lookupTables.push(table);
|
|
@@ -9534,8 +9809,8 @@ class ServerSessionManager {
|
|
|
9534
9809
|
ServerSessionManager.instance = new ServerSessionManager();
|
|
9535
9810
|
|
|
9536
9811
|
var serverSessionManager = /*#__PURE__*/Object.freeze({
|
|
9537
|
-
|
|
9538
|
-
|
|
9812
|
+
__proto__: null,
|
|
9813
|
+
ServerSessionManager: ServerSessionManager
|
|
9539
9814
|
});
|
|
9540
9815
|
|
|
9541
9816
|
/**
|
|
@@ -9634,6 +9909,23 @@ async function updateIdTokenAndAccessToken(idToken, accessToken, isServer = fals
|
|
|
9634
9909
|
await WebSessionManager.updateIdTokenAndAccessToken(idToken, accessToken);
|
|
9635
9910
|
}
|
|
9636
9911
|
|
|
9912
|
+
const apiClient = globalAxios.create();
|
|
9913
|
+
axiosRetry(apiClient, {
|
|
9914
|
+
retries: 2,
|
|
9915
|
+
retryCondition: (error) => {
|
|
9916
|
+
var _a, _b;
|
|
9917
|
+
// Only retry GET requests on network errors (ECONNRESET, ETIMEDOUT, etc.)
|
|
9918
|
+
// Writes (POST/PUT) are not retried — the server may have processed
|
|
9919
|
+
// the request before the connection was reset.
|
|
9920
|
+
return axiosRetry.isNetworkError(error) && ((_b = (_a = error.config) === null || _a === void 0 ? void 0 : _a.method) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'get';
|
|
9921
|
+
},
|
|
9922
|
+
retryDelay: axiosRetry.exponentialDelay,
|
|
9923
|
+
shouldResetTimeout: true,
|
|
9924
|
+
onRetry: (retryCount, error, requestConfig) => {
|
|
9925
|
+
var _a;
|
|
9926
|
+
console.warn(`[tarobase-sdk] retry ${retryCount} for ${(_a = requestConfig.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()} ${requestConfig.url} — ${error.code || error.message}`);
|
|
9927
|
+
},
|
|
9928
|
+
});
|
|
9637
9929
|
const refreshInFlight = new Map();
|
|
9638
9930
|
async function refreshAuthSessionOnce(appId, isServer) {
|
|
9639
9931
|
const key = `${isServer ? "server" : "web"}:${appId}`;
|
|
@@ -9680,6 +9972,7 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
9680
9972
|
ServerSessionManager.instance.clearSession();
|
|
9681
9973
|
};
|
|
9682
9974
|
async function executeRequest() {
|
|
9975
|
+
var _a;
|
|
9683
9976
|
// When _getAuthHeaders is provided (wallet client), use it as the sole auth source.
|
|
9684
9977
|
// Otherwise use the global createAuthHeader (default path).
|
|
9685
9978
|
const authHeader = (_overrides === null || _overrides === void 0 ? void 0 : _overrides._getAuthHeaders)
|
|
@@ -9701,11 +9994,12 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
9701
9994
|
method,
|
|
9702
9995
|
url: `${config.apiUrl}${urlPath.startsWith("/") ? urlPath : `/${urlPath}`}`,
|
|
9703
9996
|
headers,
|
|
9997
|
+
timeout: (_a = _overrides === null || _overrides === void 0 ? void 0 : _overrides.timeout) !== null && _a !== void 0 ? _a : 30000,
|
|
9704
9998
|
};
|
|
9705
9999
|
if (method !== "GET" && method !== "get") {
|
|
9706
10000
|
requestConfig.data = data ? JSON.stringify(data) : {};
|
|
9707
10001
|
}
|
|
9708
|
-
const response = await
|
|
10002
|
+
const response = await apiClient(requestConfig);
|
|
9709
10003
|
return { data: response.data, status: response.status, headers: response.headers };
|
|
9710
10004
|
}
|
|
9711
10005
|
try {
|
|
@@ -10641,6 +10935,7 @@ function scheduleTokenRefresh(connection, isServer) {
|
|
|
10641
10935
|
// This replaces the old single setTimeout approach which was unreliable for long
|
|
10642
10936
|
// delays (browsers throttle/suspend timers in background tabs).
|
|
10643
10937
|
connection.tokenRefreshTimer = setInterval(async () => {
|
|
10938
|
+
var _a, _b;
|
|
10644
10939
|
try {
|
|
10645
10940
|
const currentToken = await getIdToken$1(isServer);
|
|
10646
10941
|
if (!currentToken)
|
|
@@ -10671,6 +10966,17 @@ function scheduleTokenRefresh(connection, isServer) {
|
|
|
10671
10966
|
}
|
|
10672
10967
|
}
|
|
10673
10968
|
catch (refreshError) {
|
|
10969
|
+
// If the refresh token itself is invalid (401/403), stop retrying —
|
|
10970
|
+
// the token won't magically become valid next interval, and continuing
|
|
10971
|
+
// to hammer /session/refresh causes 429 rate-limit storms.
|
|
10972
|
+
if (((_a = refreshError === null || refreshError === void 0 ? void 0 : refreshError.response) === null || _a === void 0 ? void 0 : _a.status) === 401 || ((_b = refreshError === null || refreshError === void 0 ? void 0 : refreshError.response) === null || _b === void 0 ? void 0 : _b.status) === 403) {
|
|
10973
|
+
console.warn('[WS v2] Refresh token rejected (401/403), stopping periodic refresh');
|
|
10974
|
+
if (connection.tokenRefreshTimer) {
|
|
10975
|
+
clearInterval(connection.tokenRefreshTimer);
|
|
10976
|
+
connection.tokenRefreshTimer = null;
|
|
10977
|
+
}
|
|
10978
|
+
return;
|
|
10979
|
+
}
|
|
10674
10980
|
console.warn('[WS v2] Proactive token refresh failed, will retry next interval:', refreshError);
|
|
10675
10981
|
}
|
|
10676
10982
|
}
|
|
@@ -10681,6 +10987,7 @@ function scheduleTokenRefresh(connection, isServer) {
|
|
|
10681
10987
|
}, TOKEN_CHECK_INTERVAL);
|
|
10682
10988
|
}
|
|
10683
10989
|
async function getFreshAuthToken(isServer) {
|
|
10990
|
+
var _a, _b;
|
|
10684
10991
|
const currentToken = await getIdToken$1(isServer);
|
|
10685
10992
|
if (!currentToken) {
|
|
10686
10993
|
return null;
|
|
@@ -10703,6 +11010,17 @@ async function getFreshAuthToken(isServer) {
|
|
|
10703
11010
|
}
|
|
10704
11011
|
catch (error) {
|
|
10705
11012
|
console.error('[WS v2] Error refreshing token:', error);
|
|
11013
|
+
// If the refresh token is permanently invalid (401/403), clear the stale
|
|
11014
|
+
// session from storage so future attempts don't keep retrying with it.
|
|
11015
|
+
if (!isServer && (((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) === 401 || ((_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.status) === 403)) {
|
|
11016
|
+
try {
|
|
11017
|
+
const { WebSessionManager } = await Promise.resolve().then(function () { return webSessionManager; });
|
|
11018
|
+
WebSessionManager.clearSession();
|
|
11019
|
+
}
|
|
11020
|
+
catch (clearError) {
|
|
11021
|
+
console.warn('[WS v2] Failed to clear stale session:', clearError);
|
|
11022
|
+
}
|
|
11023
|
+
}
|
|
10706
11024
|
}
|
|
10707
11025
|
// Return null instead of the expired token to prevent infinite 401 reconnect storms.
|
|
10708
11026
|
// The server accepts unauthenticated connections; auth-required subscriptions will
|
|
@@ -10823,7 +11141,16 @@ async function getOrCreateConnection(appId, isServer) {
|
|
|
10823
11141
|
ws.addEventListener('open', () => {
|
|
10824
11142
|
connection.isConnecting = false;
|
|
10825
11143
|
connection.isConnected = true;
|
|
10826
|
-
|
|
11144
|
+
// NOTE: Do NOT reset consecutiveAuthFailures here. It is reset when a
|
|
11145
|
+
// fresh auth token is actually obtained (in urlProvider, line ~389) or on
|
|
11146
|
+
// an explicit auth change (reconnectWithNewAuthV2, line ~854). Resetting
|
|
11147
|
+
// on every 'open' event created an infinite loop: auth fails 5x → connect
|
|
11148
|
+
// without auth → open resets counter → disconnect → auth fails 5x again →
|
|
11149
|
+
// repeat forever, hammering /session/refresh and causing 429s.
|
|
11150
|
+
//
|
|
11151
|
+
// An elevated counter is safe for anonymous/guest sessions: when there's no
|
|
11152
|
+
// token at all (getIdToken returns null), the counter is never checked —
|
|
11153
|
+
// urlProvider skips straight to unauthenticated connection.
|
|
10827
11154
|
// Schedule periodic token freshness checks
|
|
10828
11155
|
scheduleTokenRefresh(connection, isServer);
|
|
10829
11156
|
// Re-subscribe to all existing subscriptions after reconnect
|
|
@@ -15295,7 +15622,7 @@ async function loadDependencies() {
|
|
|
15295
15622
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
15296
15623
|
import('react'),
|
|
15297
15624
|
import('react-dom/client'),
|
|
15298
|
-
import('./index-
|
|
15625
|
+
import('./index-Cmu0PVJD.esm.js')
|
|
15299
15626
|
]);
|
|
15300
15627
|
// Extract default export from ESM module namespace
|
|
15301
15628
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -19607,235 +19934,137 @@ function createSolanaRpcSubscriptionsFromTransport(transport) {
|
|
|
19607
19934
|
});
|
|
19608
19935
|
}
|
|
19609
19936
|
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19614
|
-
|
|
19615
|
-
|
|
19616
|
-
|
|
19617
|
-
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
|
|
19626
|
-
|
|
19627
|
-
|
|
19628
|
-
|
|
19629
|
-
|
|
19630
|
-
|
|
19631
|
-
|
|
19632
|
-
|
|
19633
|
-
|
|
19634
|
-
|
|
19635
|
-
|
|
19636
|
-
|
|
19637
|
-
|
|
19638
|
-
|
|
19639
|
-
|
|
19640
|
-
|
|
19641
|
-
|
|
19642
|
-
|
|
19643
|
-
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
|
|
19656
|
-
|
|
19657
|
-
|
|
19658
|
-
|
|
19659
|
-
|
|
19660
|
-
|
|
19661
|
-
|
|
19662
|
-
|
|
19663
|
-
|
|
19664
|
-
|
|
19665
|
-
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19672
|
-
|
|
19673
|
-
|
|
19674
|
-
|
|
19675
|
-
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
|
|
19679
|
-
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19685
|
-
|
|
19686
|
-
}
|
|
19687
|
-
|
|
19688
|
-
|
|
19689
|
-
|
|
19690
|
-
|
|
19691
|
-
|
|
19692
|
-
|
|
19693
|
-
|
|
19694
|
-
|
|
19695
|
-
|
|
19696
|
-
|
|
19697
|
-
|
|
19698
|
-
|
|
19699
|
-
|
|
19700
|
-
|
|
19701
|
-
|
|
19702
|
-
|
|
19703
|
-
|
|
19704
|
-
|
|
19705
|
-
|
|
19706
|
-
|
|
19707
|
-
|
|
19708
|
-
|
|
19709
|
-
|
|
19710
|
-
|
|
19711
|
-
|
|
19712
|
-
|
|
19713
|
-
|
|
19714
|
-
|
|
19715
|
-
|
|
19716
|
-
|
|
19717
|
-
|
|
19718
|
-
|
|
19719
|
-
|
|
19720
|
-
|
|
19721
|
-
|
|
19722
|
-
|
|
19723
|
-
|
|
19724
|
-
|
|
19725
|
-
|
|
19726
|
-
|
|
19727
|
-
|
|
19728
|
-
|
|
19729
|
-
|
|
19730
|
-
|
|
19731
|
-
|
|
19732
|
-
var b58 = new Uint8Array(size);
|
|
19733
|
-
// Process the bytes.
|
|
19734
|
-
while (pbegin !== pend) {
|
|
19735
|
-
var carry = source[pbegin];
|
|
19736
|
-
// Apply "b58 = b58 * 256 + ch".
|
|
19737
|
-
var i = 0;
|
|
19738
|
-
for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
19739
|
-
carry += (256 * b58[it1]) >>> 0;
|
|
19740
|
-
b58[it1] = (carry % BASE) >>> 0;
|
|
19741
|
-
carry = (carry / BASE) >>> 0;
|
|
19742
|
-
}
|
|
19743
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
19744
|
-
length = i;
|
|
19745
|
-
pbegin++;
|
|
19746
|
-
}
|
|
19747
|
-
// Skip leading zeroes in base58 result.
|
|
19748
|
-
var it2 = size - length;
|
|
19749
|
-
while (it2 !== size && b58[it2] === 0) {
|
|
19750
|
-
it2++;
|
|
19751
|
-
}
|
|
19752
|
-
// Translate the result into a string.
|
|
19753
|
-
var str = LEADER.repeat(zeroes);
|
|
19754
|
-
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
19755
|
-
return str
|
|
19756
|
-
}
|
|
19757
|
-
function decodeUnsafe (source) {
|
|
19758
|
-
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
19759
|
-
if (source.length === 0) { return _Buffer.alloc(0) }
|
|
19760
|
-
var psz = 0;
|
|
19761
|
-
// Skip and count leading '1's.
|
|
19762
|
-
var zeroes = 0;
|
|
19763
|
-
var length = 0;
|
|
19764
|
-
while (source[psz] === LEADER) {
|
|
19765
|
-
zeroes++;
|
|
19766
|
-
psz++;
|
|
19767
|
-
}
|
|
19768
|
-
// Allocate enough space in big-endian base256 representation.
|
|
19769
|
-
var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
19770
|
-
var b256 = new Uint8Array(size);
|
|
19771
|
-
// Process the characters.
|
|
19772
|
-
while (psz < source.length) {
|
|
19773
|
-
// Find code of next character
|
|
19774
|
-
var charCode = source.charCodeAt(psz);
|
|
19775
|
-
// Base map can not be indexed using char code
|
|
19776
|
-
if (charCode > 255) { return }
|
|
19777
|
-
// Decode character
|
|
19778
|
-
var carry = BASE_MAP[charCode];
|
|
19779
|
-
// Invalid character
|
|
19780
|
-
if (carry === 255) { return }
|
|
19781
|
-
var i = 0;
|
|
19782
|
-
for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
19783
|
-
carry += (BASE * b256[it3]) >>> 0;
|
|
19784
|
-
b256[it3] = (carry % 256) >>> 0;
|
|
19785
|
-
carry = (carry / 256) >>> 0;
|
|
19786
|
-
}
|
|
19787
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
19788
|
-
length = i;
|
|
19789
|
-
psz++;
|
|
19790
|
-
}
|
|
19791
|
-
// Skip leading zeroes in b256.
|
|
19792
|
-
var it4 = size - length;
|
|
19793
|
-
while (it4 !== size && b256[it4] === 0) {
|
|
19794
|
-
it4++;
|
|
19795
|
-
}
|
|
19796
|
-
var vch = _Buffer.allocUnsafe(zeroes + (size - it4));
|
|
19797
|
-
vch.fill(0x00, 0, zeroes);
|
|
19798
|
-
var j = zeroes;
|
|
19799
|
-
while (it4 !== size) {
|
|
19800
|
-
vch[j++] = b256[it4++];
|
|
19801
|
-
}
|
|
19802
|
-
return vch
|
|
19803
|
-
}
|
|
19804
|
-
function decode (string) {
|
|
19805
|
-
var buffer = decodeUnsafe(string);
|
|
19806
|
-
if (buffer) { return buffer }
|
|
19807
|
-
throw new Error('Non-base' + BASE + ' character')
|
|
19808
|
-
}
|
|
19809
|
-
return {
|
|
19810
|
-
encode: encode,
|
|
19811
|
-
decodeUnsafe: decodeUnsafe,
|
|
19812
|
-
decode: decode
|
|
19813
|
-
}
|
|
19814
|
-
}
|
|
19815
|
-
src = base;
|
|
19816
|
-
return src;
|
|
19817
|
-
}
|
|
19818
|
-
|
|
19819
|
-
var bs58$1;
|
|
19820
|
-
var hasRequiredBs58;
|
|
19821
|
-
|
|
19822
|
-
function requireBs58 () {
|
|
19823
|
-
if (hasRequiredBs58) return bs58$1;
|
|
19824
|
-
hasRequiredBs58 = 1;
|
|
19825
|
-
var basex = requireSrc();
|
|
19826
|
-
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
19827
|
-
|
|
19828
|
-
bs58$1 = basex(ALPHABET);
|
|
19829
|
-
return bs58$1;
|
|
19937
|
+
// base-x encoding / decoding
|
|
19938
|
+
// Copyright (c) 2018 base-x contributors
|
|
19939
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
19940
|
+
// Distributed under the MIT software license, see the accompanying
|
|
19941
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
19942
|
+
function base (ALPHABET) {
|
|
19943
|
+
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
19944
|
+
const BASE_MAP = new Uint8Array(256);
|
|
19945
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
19946
|
+
BASE_MAP[j] = 255;
|
|
19947
|
+
}
|
|
19948
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
19949
|
+
const x = ALPHABET.charAt(i);
|
|
19950
|
+
const xc = x.charCodeAt(0);
|
|
19951
|
+
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
|
19952
|
+
BASE_MAP[xc] = i;
|
|
19953
|
+
}
|
|
19954
|
+
const BASE = ALPHABET.length;
|
|
19955
|
+
const LEADER = ALPHABET.charAt(0);
|
|
19956
|
+
const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
|
|
19957
|
+
const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
|
|
19958
|
+
function encode (source) {
|
|
19959
|
+
// eslint-disable-next-line no-empty
|
|
19960
|
+
if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
|
|
19961
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
19962
|
+
} else if (Array.isArray(source)) {
|
|
19963
|
+
source = Uint8Array.from(source);
|
|
19964
|
+
}
|
|
19965
|
+
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
|
19966
|
+
if (source.length === 0) { return '' }
|
|
19967
|
+
// Skip & count leading zeroes.
|
|
19968
|
+
let zeroes = 0;
|
|
19969
|
+
let length = 0;
|
|
19970
|
+
let pbegin = 0;
|
|
19971
|
+
const pend = source.length;
|
|
19972
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
19973
|
+
pbegin++;
|
|
19974
|
+
zeroes++;
|
|
19975
|
+
}
|
|
19976
|
+
// Allocate enough space in big-endian base58 representation.
|
|
19977
|
+
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
|
|
19978
|
+
const b58 = new Uint8Array(size);
|
|
19979
|
+
// Process the bytes.
|
|
19980
|
+
while (pbegin !== pend) {
|
|
19981
|
+
let carry = source[pbegin];
|
|
19982
|
+
// Apply "b58 = b58 * 256 + ch".
|
|
19983
|
+
let i = 0;
|
|
19984
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
19985
|
+
carry += (256 * b58[it1]) >>> 0;
|
|
19986
|
+
b58[it1] = (carry % BASE) >>> 0;
|
|
19987
|
+
carry = (carry / BASE) >>> 0;
|
|
19988
|
+
}
|
|
19989
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
19990
|
+
length = i;
|
|
19991
|
+
pbegin++;
|
|
19992
|
+
}
|
|
19993
|
+
// Skip leading zeroes in base58 result.
|
|
19994
|
+
let it2 = size - length;
|
|
19995
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
19996
|
+
it2++;
|
|
19997
|
+
}
|
|
19998
|
+
// Translate the result into a string.
|
|
19999
|
+
let str = LEADER.repeat(zeroes);
|
|
20000
|
+
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
20001
|
+
return str
|
|
20002
|
+
}
|
|
20003
|
+
function decodeUnsafe (source) {
|
|
20004
|
+
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
20005
|
+
if (source.length === 0) { return new Uint8Array() }
|
|
20006
|
+
let psz = 0;
|
|
20007
|
+
// Skip and count leading '1's.
|
|
20008
|
+
let zeroes = 0;
|
|
20009
|
+
let length = 0;
|
|
20010
|
+
while (source[psz] === LEADER) {
|
|
20011
|
+
zeroes++;
|
|
20012
|
+
psz++;
|
|
20013
|
+
}
|
|
20014
|
+
// Allocate enough space in big-endian base256 representation.
|
|
20015
|
+
const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
20016
|
+
const b256 = new Uint8Array(size);
|
|
20017
|
+
// Process the characters.
|
|
20018
|
+
while (psz < source.length) {
|
|
20019
|
+
// Find code of next character
|
|
20020
|
+
const charCode = source.charCodeAt(psz);
|
|
20021
|
+
// Base map can not be indexed using char code
|
|
20022
|
+
if (charCode > 255) { return }
|
|
20023
|
+
// Decode character
|
|
20024
|
+
let carry = BASE_MAP[charCode];
|
|
20025
|
+
// Invalid character
|
|
20026
|
+
if (carry === 255) { return }
|
|
20027
|
+
let i = 0;
|
|
20028
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
20029
|
+
carry += (BASE * b256[it3]) >>> 0;
|
|
20030
|
+
b256[it3] = (carry % 256) >>> 0;
|
|
20031
|
+
carry = (carry / 256) >>> 0;
|
|
20032
|
+
}
|
|
20033
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20034
|
+
length = i;
|
|
20035
|
+
psz++;
|
|
20036
|
+
}
|
|
20037
|
+
// Skip leading zeroes in b256.
|
|
20038
|
+
let it4 = size - length;
|
|
20039
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
20040
|
+
it4++;
|
|
20041
|
+
}
|
|
20042
|
+
const vch = new Uint8Array(zeroes + (size - it4));
|
|
20043
|
+
let j = zeroes;
|
|
20044
|
+
while (it4 !== size) {
|
|
20045
|
+
vch[j++] = b256[it4++];
|
|
20046
|
+
}
|
|
20047
|
+
return vch
|
|
20048
|
+
}
|
|
20049
|
+
function decode (string) {
|
|
20050
|
+
const buffer = decodeUnsafe(string);
|
|
20051
|
+
if (buffer) { return buffer }
|
|
20052
|
+
throw new Error('Non-base' + BASE + ' character')
|
|
20053
|
+
}
|
|
20054
|
+
return {
|
|
20055
|
+
encode,
|
|
20056
|
+
decodeUnsafe,
|
|
20057
|
+
decode
|
|
20058
|
+
}
|
|
19830
20059
|
}
|
|
19831
20060
|
|
|
19832
|
-
var
|
|
19833
|
-
var bs58 =
|
|
20061
|
+
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
20062
|
+
var bs58 = base(ALPHABET);
|
|
19834
20063
|
|
|
19835
|
-
var index = /*#__PURE__*/
|
|
20064
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
19836
20065
|
__proto__: null,
|
|
19837
20066
|
default: bs58
|
|
19838
|
-
}
|
|
20067
|
+
});
|
|
19839
20068
|
|
|
19840
20069
|
const SURFNET_RPC_URL$1 = "https://surfpool.fly.dev";
|
|
19841
20070
|
let React;
|
|
@@ -20749,7 +20978,7 @@ async function loadMwaProtocol() {
|
|
|
20749
20978
|
return mwaProtocolLoadPromise;
|
|
20750
20979
|
mwaProtocolLoadPromise = (async () => {
|
|
20751
20980
|
try {
|
|
20752
|
-
mwaProtocolModule = await import('./index.browser-
|
|
20981
|
+
mwaProtocolModule = await import('./index.browser-x87QUr4N.esm.js');
|
|
20753
20982
|
}
|
|
20754
20983
|
catch (e) {
|
|
20755
20984
|
console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
|
|
@@ -20771,7 +21000,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
20771
21000
|
if (typeof window === 'undefined')
|
|
20772
21001
|
return;
|
|
20773
21002
|
try {
|
|
20774
|
-
const walletStandardMobile = await import('./index.browser-
|
|
21003
|
+
const walletStandardMobile = await import('./index.browser-B4een3Gz.esm.js');
|
|
20775
21004
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
20776
21005
|
if (!registerMwa) {
|
|
20777
21006
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -21679,5 +21908,5 @@ class PrivyExpoProvider {
|
|
|
21679
21908
|
}
|
|
21680
21909
|
}
|
|
21681
21910
|
|
|
21682
|
-
export {
|
|
21683
|
-
//# sourceMappingURL=index-
|
|
21911
|
+
export { getCachedData as $, subscribe as A, useAuth as B, deserializeTransaction as C, getIdToken as D, setPlatform as E, getPlatform as F, PrivyWalletProvider as G, DEFAULT_TEST_ADDRESS as H, isMobileWalletAvailable as I, registerMobileWalletAdapter as J, PrivyExpoProvider as K, InsufficientBalanceError as L, MockAuthProvider as M, ServerSessionManager as N, OffchainAuthProvider as O, PhantomWalletProvider as P, buildSetDocumentsTransaction as Q, ReactNativeSessionManager as R, SolanaMobileWalletProvider as S, clearCache as T, closeAllSubscriptions as U, convertRemainingAccounts as V, WebSessionManager as W, createSessionWithPrivy as X, createSessionWithSignature as Y, genAuthNonce as Z, genSolanaMessage as _, bs58 as a, getMany as a0, reconnectWithNewAuth as a1, refreshSession as a2, signSessionCreateMessage as a3, bufferExports as b, getCurrentUser as c, onAuthLoadingChanged as d, getAuthLoading as e, logout as f, getDefaultExportFromCjs$1 as g, getConfig as h, init as i, getAuthProvider as j, get as k, login as l, setMany as m, setFile as n, onAuthStateChanged as o, getFiles as p, runQueryMany as q, runQuery as r, set as s, runExpression as t, runExpressionMany as u, signMessage as v, signTransaction as w, signAndSubmitTransaction as x, count as y, aggregate as z };
|
|
21912
|
+
//# sourceMappingURL=index-CwGoYY0Y.esm.js.map
|