@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
|
@@ -22,21 +22,6 @@ function _interopNamespaceDefault(e) {
|
|
|
22
22
|
return Object.freeze(n);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function _mergeNamespaces(n, m) {
|
|
26
|
-
m.forEach(function (e) {
|
|
27
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
28
|
-
if (k !== 'default' && !(k in n)) {
|
|
29
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
30
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () { return e[k]; }
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
return Object.freeze(n);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
25
|
var anchor__namespace = /*#__PURE__*/_interopNamespaceDefault(anchor);
|
|
41
26
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React$2);
|
|
42
27
|
|
|
@@ -6415,6 +6400,261 @@ var ReconnectingWebSocket = /** @class */ (function () {
|
|
|
6415
6400
|
return ReconnectingWebSocket;
|
|
6416
6401
|
}());
|
|
6417
6402
|
|
|
6403
|
+
function getDefaultExportFromCjs (x) {
|
|
6404
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6405
|
+
}
|
|
6406
|
+
|
|
6407
|
+
var isRetryAllowed$1;
|
|
6408
|
+
var hasRequiredIsRetryAllowed;
|
|
6409
|
+
|
|
6410
|
+
function requireIsRetryAllowed () {
|
|
6411
|
+
if (hasRequiredIsRetryAllowed) return isRetryAllowed$1;
|
|
6412
|
+
hasRequiredIsRetryAllowed = 1;
|
|
6413
|
+
|
|
6414
|
+
const denyList = new Set([
|
|
6415
|
+
'ENOTFOUND',
|
|
6416
|
+
'ENETUNREACH',
|
|
6417
|
+
|
|
6418
|
+
// SSL errors from https://github.com/nodejs/node/blob/fc8e3e2cdc521978351de257030db0076d79e0ab/src/crypto/crypto_common.cc#L301-L328
|
|
6419
|
+
'UNABLE_TO_GET_ISSUER_CERT',
|
|
6420
|
+
'UNABLE_TO_GET_CRL',
|
|
6421
|
+
'UNABLE_TO_DECRYPT_CERT_SIGNATURE',
|
|
6422
|
+
'UNABLE_TO_DECRYPT_CRL_SIGNATURE',
|
|
6423
|
+
'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY',
|
|
6424
|
+
'CERT_SIGNATURE_FAILURE',
|
|
6425
|
+
'CRL_SIGNATURE_FAILURE',
|
|
6426
|
+
'CERT_NOT_YET_VALID',
|
|
6427
|
+
'CERT_HAS_EXPIRED',
|
|
6428
|
+
'CRL_NOT_YET_VALID',
|
|
6429
|
+
'CRL_HAS_EXPIRED',
|
|
6430
|
+
'ERROR_IN_CERT_NOT_BEFORE_FIELD',
|
|
6431
|
+
'ERROR_IN_CERT_NOT_AFTER_FIELD',
|
|
6432
|
+
'ERROR_IN_CRL_LAST_UPDATE_FIELD',
|
|
6433
|
+
'ERROR_IN_CRL_NEXT_UPDATE_FIELD',
|
|
6434
|
+
'OUT_OF_MEM',
|
|
6435
|
+
'DEPTH_ZERO_SELF_SIGNED_CERT',
|
|
6436
|
+
'SELF_SIGNED_CERT_IN_CHAIN',
|
|
6437
|
+
'UNABLE_TO_GET_ISSUER_CERT_LOCALLY',
|
|
6438
|
+
'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
|
|
6439
|
+
'CERT_CHAIN_TOO_LONG',
|
|
6440
|
+
'CERT_REVOKED',
|
|
6441
|
+
'INVALID_CA',
|
|
6442
|
+
'PATH_LENGTH_EXCEEDED',
|
|
6443
|
+
'INVALID_PURPOSE',
|
|
6444
|
+
'CERT_UNTRUSTED',
|
|
6445
|
+
'CERT_REJECTED',
|
|
6446
|
+
'HOSTNAME_MISMATCH'
|
|
6447
|
+
]);
|
|
6448
|
+
|
|
6449
|
+
// TODO: Use `error?.code` when targeting Node.js 14
|
|
6450
|
+
isRetryAllowed$1 = error => !denyList.has(error && error.code);
|
|
6451
|
+
return isRetryAllowed$1;
|
|
6452
|
+
}
|
|
6453
|
+
|
|
6454
|
+
var isRetryAllowedExports = requireIsRetryAllowed();
|
|
6455
|
+
var isRetryAllowed = /*@__PURE__*/getDefaultExportFromCjs(isRetryAllowedExports);
|
|
6456
|
+
|
|
6457
|
+
const namespace = 'axios-retry';
|
|
6458
|
+
function isNetworkError(error) {
|
|
6459
|
+
const CODE_EXCLUDE_LIST = ['ERR_CANCELED', 'ECONNABORTED'];
|
|
6460
|
+
if (error.response) {
|
|
6461
|
+
return false;
|
|
6462
|
+
}
|
|
6463
|
+
if (!error.code) {
|
|
6464
|
+
return false;
|
|
6465
|
+
}
|
|
6466
|
+
// Prevents retrying timed out & cancelled requests
|
|
6467
|
+
if (CODE_EXCLUDE_LIST.includes(error.code)) {
|
|
6468
|
+
return false;
|
|
6469
|
+
}
|
|
6470
|
+
// Prevents retrying unsafe errors
|
|
6471
|
+
return isRetryAllowed(error);
|
|
6472
|
+
}
|
|
6473
|
+
const SAFE_HTTP_METHODS = ['get', 'head', 'options'];
|
|
6474
|
+
const IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);
|
|
6475
|
+
function isRetryableError(error) {
|
|
6476
|
+
return (error.code !== 'ECONNABORTED' &&
|
|
6477
|
+
(!error.response ||
|
|
6478
|
+
error.response.status === 429 ||
|
|
6479
|
+
(error.response.status >= 500 && error.response.status <= 599)));
|
|
6480
|
+
}
|
|
6481
|
+
function isSafeRequestError(error) {
|
|
6482
|
+
if (!error.config?.method) {
|
|
6483
|
+
// Cannot determine if the request can be retried
|
|
6484
|
+
return false;
|
|
6485
|
+
}
|
|
6486
|
+
return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
|
6487
|
+
}
|
|
6488
|
+
function isIdempotentRequestError(error) {
|
|
6489
|
+
if (!error.config?.method) {
|
|
6490
|
+
// Cannot determine if the request can be retried
|
|
6491
|
+
return false;
|
|
6492
|
+
}
|
|
6493
|
+
return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
|
6494
|
+
}
|
|
6495
|
+
function isNetworkOrIdempotentRequestError(error) {
|
|
6496
|
+
return isNetworkError(error) || isIdempotentRequestError(error);
|
|
6497
|
+
}
|
|
6498
|
+
function retryAfter(error = undefined) {
|
|
6499
|
+
const retryAfterHeader = error?.response?.headers['retry-after'];
|
|
6500
|
+
if (!retryAfterHeader) {
|
|
6501
|
+
return 0;
|
|
6502
|
+
}
|
|
6503
|
+
// if the retry after header is a number, convert it to milliseconds
|
|
6504
|
+
let retryAfterMs = (Number(retryAfterHeader) || 0) * 1000;
|
|
6505
|
+
// If the retry after header is a date, get the number of milliseconds until that date
|
|
6506
|
+
if (retryAfterMs === 0) {
|
|
6507
|
+
retryAfterMs = (new Date(retryAfterHeader).valueOf() || 0) - Date.now();
|
|
6508
|
+
}
|
|
6509
|
+
return Math.max(0, retryAfterMs);
|
|
6510
|
+
}
|
|
6511
|
+
function noDelay(_retryNumber = 0, error = undefined) {
|
|
6512
|
+
return Math.max(0, retryAfter(error));
|
|
6513
|
+
}
|
|
6514
|
+
function exponentialDelay(retryNumber = 0, error = undefined, delayFactor = 100) {
|
|
6515
|
+
const calculatedDelay = 2 ** retryNumber * delayFactor;
|
|
6516
|
+
const delay = Math.max(calculatedDelay, retryAfter(error));
|
|
6517
|
+
const randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay
|
|
6518
|
+
return delay + randomSum;
|
|
6519
|
+
}
|
|
6520
|
+
/**
|
|
6521
|
+
* Linear delay
|
|
6522
|
+
* @param {number | undefined} delayFactor - delay factor in milliseconds (default: 100)
|
|
6523
|
+
* @returns {function} (retryNumber: number, error: AxiosError | undefined) => number
|
|
6524
|
+
*/
|
|
6525
|
+
function linearDelay(delayFactor = 100) {
|
|
6526
|
+
return (retryNumber = 0, error = undefined) => {
|
|
6527
|
+
const delay = retryNumber * delayFactor;
|
|
6528
|
+
return Math.max(delay, retryAfter(error));
|
|
6529
|
+
};
|
|
6530
|
+
}
|
|
6531
|
+
const DEFAULT_OPTIONS = {
|
|
6532
|
+
retries: 3,
|
|
6533
|
+
retryCondition: isNetworkOrIdempotentRequestError,
|
|
6534
|
+
retryDelay: noDelay,
|
|
6535
|
+
shouldResetTimeout: false,
|
|
6536
|
+
onRetry: () => { },
|
|
6537
|
+
onMaxRetryTimesExceeded: () => { },
|
|
6538
|
+
validateResponse: null
|
|
6539
|
+
};
|
|
6540
|
+
function getRequestOptions(config, defaultOptions) {
|
|
6541
|
+
return { ...DEFAULT_OPTIONS, ...defaultOptions, ...config[namespace] };
|
|
6542
|
+
}
|
|
6543
|
+
function setCurrentState(config, defaultOptions, resetLastRequestTime = false) {
|
|
6544
|
+
const currentState = getRequestOptions(config, defaultOptions || {});
|
|
6545
|
+
currentState.retryCount = currentState.retryCount || 0;
|
|
6546
|
+
if (!currentState.lastRequestTime || resetLastRequestTime) {
|
|
6547
|
+
currentState.lastRequestTime = Date.now();
|
|
6548
|
+
}
|
|
6549
|
+
config[namespace] = currentState;
|
|
6550
|
+
return currentState;
|
|
6551
|
+
}
|
|
6552
|
+
function fixConfig(axiosInstance, config) {
|
|
6553
|
+
// @ts-ignore
|
|
6554
|
+
if (axiosInstance.defaults.agent === config.agent) {
|
|
6555
|
+
// @ts-ignore
|
|
6556
|
+
delete config.agent;
|
|
6557
|
+
}
|
|
6558
|
+
if (axiosInstance.defaults.httpAgent === config.httpAgent) {
|
|
6559
|
+
delete config.httpAgent;
|
|
6560
|
+
}
|
|
6561
|
+
if (axiosInstance.defaults.httpsAgent === config.httpsAgent) {
|
|
6562
|
+
delete config.httpsAgent;
|
|
6563
|
+
}
|
|
6564
|
+
}
|
|
6565
|
+
async function shouldRetry(currentState, error) {
|
|
6566
|
+
const { retries, retryCondition } = currentState;
|
|
6567
|
+
const shouldRetryOrPromise = (currentState.retryCount || 0) < retries && retryCondition(error);
|
|
6568
|
+
// This could be a promise
|
|
6569
|
+
if (typeof shouldRetryOrPromise === 'object') {
|
|
6570
|
+
try {
|
|
6571
|
+
const shouldRetryPromiseResult = await shouldRetryOrPromise;
|
|
6572
|
+
// keep return true unless shouldRetryPromiseResult return false for compatibility
|
|
6573
|
+
return shouldRetryPromiseResult !== false;
|
|
6574
|
+
}
|
|
6575
|
+
catch (_err) {
|
|
6576
|
+
return false;
|
|
6577
|
+
}
|
|
6578
|
+
}
|
|
6579
|
+
return shouldRetryOrPromise;
|
|
6580
|
+
}
|
|
6581
|
+
async function handleRetry(axiosInstance, currentState, error, config) {
|
|
6582
|
+
currentState.retryCount += 1;
|
|
6583
|
+
const { retryDelay, shouldResetTimeout, onRetry } = currentState;
|
|
6584
|
+
const delay = retryDelay(currentState.retryCount, error);
|
|
6585
|
+
// Axios fails merging this configuration to the default configuration because it has an issue
|
|
6586
|
+
// with circular structures: https://github.com/mzabriskie/axios/issues/370
|
|
6587
|
+
fixConfig(axiosInstance, config);
|
|
6588
|
+
if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {
|
|
6589
|
+
const lastRequestDuration = Date.now() - currentState.lastRequestTime;
|
|
6590
|
+
const timeout = config.timeout - lastRequestDuration - delay;
|
|
6591
|
+
if (timeout <= 0) {
|
|
6592
|
+
return Promise.reject(error);
|
|
6593
|
+
}
|
|
6594
|
+
config.timeout = timeout;
|
|
6595
|
+
}
|
|
6596
|
+
config.transformRequest = [(data) => data];
|
|
6597
|
+
await onRetry(currentState.retryCount, error, config);
|
|
6598
|
+
if (config.signal?.aborted) {
|
|
6599
|
+
return Promise.resolve(axiosInstance(config));
|
|
6600
|
+
}
|
|
6601
|
+
return new Promise((resolve) => {
|
|
6602
|
+
const abortListener = () => {
|
|
6603
|
+
clearTimeout(timeout);
|
|
6604
|
+
resolve(axiosInstance(config));
|
|
6605
|
+
};
|
|
6606
|
+
const timeout = setTimeout(() => {
|
|
6607
|
+
resolve(axiosInstance(config));
|
|
6608
|
+
if (config.signal?.removeEventListener) {
|
|
6609
|
+
config.signal.removeEventListener('abort', abortListener);
|
|
6610
|
+
}
|
|
6611
|
+
}, delay);
|
|
6612
|
+
if (config.signal?.addEventListener) {
|
|
6613
|
+
config.signal.addEventListener('abort', abortListener, { once: true });
|
|
6614
|
+
}
|
|
6615
|
+
});
|
|
6616
|
+
}
|
|
6617
|
+
async function handleMaxRetryTimesExceeded(currentState, error) {
|
|
6618
|
+
if (currentState.retryCount >= currentState.retries)
|
|
6619
|
+
await currentState.onMaxRetryTimesExceeded(error, currentState.retryCount);
|
|
6620
|
+
}
|
|
6621
|
+
const axiosRetry = (axiosInstance, defaultOptions) => {
|
|
6622
|
+
const requestInterceptorId = axiosInstance.interceptors.request.use((config) => {
|
|
6623
|
+
setCurrentState(config, defaultOptions, true);
|
|
6624
|
+
if (config[namespace]?.validateResponse) {
|
|
6625
|
+
// by setting this, all HTTP responses will be go through the error interceptor first
|
|
6626
|
+
config.validateStatus = () => false;
|
|
6627
|
+
}
|
|
6628
|
+
return config;
|
|
6629
|
+
});
|
|
6630
|
+
const responseInterceptorId = axiosInstance.interceptors.response.use(null, async (error) => {
|
|
6631
|
+
const { config } = error;
|
|
6632
|
+
// If we have no information to retry the request
|
|
6633
|
+
if (!config) {
|
|
6634
|
+
return Promise.reject(error);
|
|
6635
|
+
}
|
|
6636
|
+
const currentState = setCurrentState(config, defaultOptions);
|
|
6637
|
+
if (error.response && currentState.validateResponse?.(error.response)) {
|
|
6638
|
+
// no issue with response
|
|
6639
|
+
return error.response;
|
|
6640
|
+
}
|
|
6641
|
+
if (await shouldRetry(currentState, error)) {
|
|
6642
|
+
return handleRetry(axiosInstance, currentState, error, config);
|
|
6643
|
+
}
|
|
6644
|
+
await handleMaxRetryTimesExceeded(currentState, error);
|
|
6645
|
+
return Promise.reject(error);
|
|
6646
|
+
});
|
|
6647
|
+
return { requestInterceptorId, responseInterceptorId };
|
|
6648
|
+
};
|
|
6649
|
+
// Compatibility with CommonJS
|
|
6650
|
+
axiosRetry.isNetworkError = isNetworkError;
|
|
6651
|
+
axiosRetry.isSafeRequestError = isSafeRequestError;
|
|
6652
|
+
axiosRetry.isIdempotentRequestError = isIdempotentRequestError;
|
|
6653
|
+
axiosRetry.isNetworkOrIdempotentRequestError = isNetworkOrIdempotentRequestError;
|
|
6654
|
+
axiosRetry.exponentialDelay = exponentialDelay;
|
|
6655
|
+
axiosRetry.linearDelay = linearDelay;
|
|
6656
|
+
axiosRetry.isRetryableError = isRetryableError;
|
|
6657
|
+
|
|
6418
6658
|
let axiosClient;
|
|
6419
6659
|
async function getAxiosAuthClient() {
|
|
6420
6660
|
if (!axiosClient) {
|
|
@@ -6424,6 +6664,7 @@ async function getAxiosAuthClient() {
|
|
|
6424
6664
|
headers: {
|
|
6425
6665
|
'Content-Type': 'application/json',
|
|
6426
6666
|
},
|
|
6667
|
+
timeout: 30000, // 30s timeout, matching makeApiRequest
|
|
6427
6668
|
});
|
|
6428
6669
|
}
|
|
6429
6670
|
return axiosClient;
|
|
@@ -6470,15 +6711,41 @@ async function createSessionWithPrivy(authToken, address, privyIdToken) {
|
|
|
6470
6711
|
});
|
|
6471
6712
|
return response.data;
|
|
6472
6713
|
}
|
|
6714
|
+
// Deduplicate concurrent refreshSession calls to prevent multiple code paths
|
|
6715
|
+
// (WebSocket reconnection, periodic refresh, API 401 retry) from all hitting
|
|
6716
|
+
// /session/refresh simultaneously.
|
|
6717
|
+
// Note: module-level state is shared across requests in SSR/Node — acceptable
|
|
6718
|
+
// since there is only one active session per server instance (same pattern as
|
|
6719
|
+
// refreshInFlight in api.ts).
|
|
6720
|
+
let refreshInFlight$1 = null;
|
|
6721
|
+
let refreshInFlightToken = null;
|
|
6473
6722
|
async function refreshSession(refreshToken) {
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6723
|
+
if (refreshInFlight$1 && refreshInFlightToken === refreshToken) {
|
|
6724
|
+
return refreshInFlight$1;
|
|
6725
|
+
}
|
|
6726
|
+
refreshInFlightToken = refreshToken;
|
|
6727
|
+
let currentFlight;
|
|
6728
|
+
currentFlight = refreshInFlight$1 = (async () => {
|
|
6729
|
+
try {
|
|
6730
|
+
const client = await getAxiosAuthClient();
|
|
6731
|
+
const config = await getConfig();
|
|
6732
|
+
const appId = config.appId;
|
|
6733
|
+
const response = await client.post('/session/refresh', {
|
|
6734
|
+
refreshToken,
|
|
6735
|
+
appId
|
|
6736
|
+
});
|
|
6737
|
+
return response.data;
|
|
6738
|
+
}
|
|
6739
|
+
finally {
|
|
6740
|
+
// Only clear if we're still the active in-flight request.
|
|
6741
|
+
// A second call with a different token may have replaced us.
|
|
6742
|
+
if (refreshInFlight$1 === currentFlight) {
|
|
6743
|
+
refreshInFlight$1 = null;
|
|
6744
|
+
refreshInFlightToken = null;
|
|
6745
|
+
}
|
|
6746
|
+
}
|
|
6747
|
+
})();
|
|
6748
|
+
return refreshInFlight$1;
|
|
6482
6749
|
}
|
|
6483
6750
|
async function signSessionCreateMessage(_signMessageFunction) {
|
|
6484
6751
|
}
|
|
@@ -6616,14 +6883,10 @@ class WebSessionManager {
|
|
|
6616
6883
|
WebSessionManager.TAROBASE_SESSION_STORAGE_KEY = "tarobase_session_storage";
|
|
6617
6884
|
|
|
6618
6885
|
var webSessionManager = /*#__PURE__*/Object.freeze({
|
|
6619
|
-
|
|
6620
|
-
|
|
6886
|
+
__proto__: null,
|
|
6887
|
+
WebSessionManager: WebSessionManager
|
|
6621
6888
|
});
|
|
6622
6889
|
|
|
6623
|
-
function getDefaultExportFromCjs (x) {
|
|
6624
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6625
|
-
}
|
|
6626
|
-
|
|
6627
6890
|
var buffer$1 = {};
|
|
6628
6891
|
|
|
6629
6892
|
var base64Js$1 = {};
|
|
@@ -8995,15 +9258,15 @@ function requireBuffer$1 () {
|
|
|
8995
9258
|
|
|
8996
9259
|
var bufferExports$1 = requireBuffer$1();
|
|
8997
9260
|
|
|
8998
|
-
var safeBuffer
|
|
9261
|
+
var safeBuffer = {exports: {}};
|
|
8999
9262
|
|
|
9000
9263
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
9001
9264
|
|
|
9002
|
-
var hasRequiredSafeBuffer
|
|
9265
|
+
var hasRequiredSafeBuffer;
|
|
9003
9266
|
|
|
9004
|
-
function requireSafeBuffer
|
|
9005
|
-
if (hasRequiredSafeBuffer
|
|
9006
|
-
hasRequiredSafeBuffer
|
|
9267
|
+
function requireSafeBuffer () {
|
|
9268
|
+
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
9269
|
+
hasRequiredSafeBuffer = 1;
|
|
9007
9270
|
(function (module, exports$1) {
|
|
9008
9271
|
/* eslint-disable node/no-deprecated-api */
|
|
9009
9272
|
var buffer = requireBuffer$1();
|
|
@@ -9069,23 +9332,23 @@ function requireSafeBuffer$1 () {
|
|
|
9069
9332
|
}
|
|
9070
9333
|
return buffer.SlowBuffer(size)
|
|
9071
9334
|
};
|
|
9072
|
-
} (safeBuffer
|
|
9073
|
-
return safeBuffer
|
|
9335
|
+
} (safeBuffer, safeBuffer.exports));
|
|
9336
|
+
return safeBuffer.exports;
|
|
9074
9337
|
}
|
|
9075
9338
|
|
|
9076
|
-
var src
|
|
9077
|
-
var hasRequiredSrc
|
|
9339
|
+
var src;
|
|
9340
|
+
var hasRequiredSrc;
|
|
9078
9341
|
|
|
9079
|
-
function requireSrc
|
|
9080
|
-
if (hasRequiredSrc
|
|
9081
|
-
hasRequiredSrc
|
|
9342
|
+
function requireSrc () {
|
|
9343
|
+
if (hasRequiredSrc) return src;
|
|
9344
|
+
hasRequiredSrc = 1;
|
|
9082
9345
|
// base-x encoding / decoding
|
|
9083
9346
|
// Copyright (c) 2018 base-x contributors
|
|
9084
9347
|
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
9085
9348
|
// Distributed under the MIT software license, see the accompanying
|
|
9086
9349
|
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
9087
9350
|
// @ts-ignore
|
|
9088
|
-
var _Buffer = requireSafeBuffer
|
|
9351
|
+
var _Buffer = requireSafeBuffer().Buffer;
|
|
9089
9352
|
function base (ALPHABET) {
|
|
9090
9353
|
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
9091
9354
|
var BASE_MAP = new Uint8Array(256);
|
|
@@ -9200,25 +9463,25 @@ function requireSrc$1 () {
|
|
|
9200
9463
|
decode: decode
|
|
9201
9464
|
}
|
|
9202
9465
|
}
|
|
9203
|
-
src
|
|
9204
|
-
return src
|
|
9466
|
+
src = base;
|
|
9467
|
+
return src;
|
|
9205
9468
|
}
|
|
9206
9469
|
|
|
9207
|
-
var bs58$1
|
|
9208
|
-
var hasRequiredBs58
|
|
9470
|
+
var bs58$1;
|
|
9471
|
+
var hasRequiredBs58;
|
|
9209
9472
|
|
|
9210
|
-
function requireBs58
|
|
9211
|
-
if (hasRequiredBs58
|
|
9212
|
-
hasRequiredBs58
|
|
9213
|
-
var basex = requireSrc
|
|
9473
|
+
function requireBs58 () {
|
|
9474
|
+
if (hasRequiredBs58) return bs58$1;
|
|
9475
|
+
hasRequiredBs58 = 1;
|
|
9476
|
+
var basex = requireSrc();
|
|
9214
9477
|
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
9215
9478
|
|
|
9216
|
-
bs58$1
|
|
9217
|
-
return bs58$1
|
|
9479
|
+
bs58$1 = basex(ALPHABET);
|
|
9480
|
+
return bs58$1;
|
|
9218
9481
|
}
|
|
9219
9482
|
|
|
9220
|
-
var bs58Exports
|
|
9221
|
-
var bs58$2 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports
|
|
9483
|
+
var bs58Exports = requireBs58();
|
|
9484
|
+
var bs58$2 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports);
|
|
9222
9485
|
|
|
9223
9486
|
// ─────────────────────────────────────────────────────────────
|
|
9224
9487
|
// Local implementation of getSimulationComputeUnits
|
|
@@ -9420,7 +9683,19 @@ async function buildSetDocumentsTransaction(connection, idl, anchorProvider, pay
|
|
|
9420
9683
|
}
|
|
9421
9684
|
}
|
|
9422
9685
|
else if (lutKey != null) {
|
|
9423
|
-
|
|
9686
|
+
// The LUT may have just been created server-side and the client's RPC node
|
|
9687
|
+
// may not have indexed it yet (load-balancer split). Retry with exponential
|
|
9688
|
+
// back-off; first retry at 100 ms almost always resolves it.
|
|
9689
|
+
let table = null;
|
|
9690
|
+
for (let attempt = 0; attempt < 5; attempt++) {
|
|
9691
|
+
const { value } = await connection.getAddressLookupTable(new web3_js.PublicKey(lutKey));
|
|
9692
|
+
if (value) {
|
|
9693
|
+
table = value;
|
|
9694
|
+
break;
|
|
9695
|
+
}
|
|
9696
|
+
if (attempt < 4)
|
|
9697
|
+
await new Promise(r => setTimeout(r, 100 * Math.pow(2, attempt)));
|
|
9698
|
+
}
|
|
9424
9699
|
if (!table)
|
|
9425
9700
|
throw new Error('LUT not found after creation/extend');
|
|
9426
9701
|
lookupTables.push(table);
|
|
@@ -9555,8 +9830,8 @@ class ServerSessionManager {
|
|
|
9555
9830
|
ServerSessionManager.instance = new ServerSessionManager();
|
|
9556
9831
|
|
|
9557
9832
|
var serverSessionManager = /*#__PURE__*/Object.freeze({
|
|
9558
|
-
|
|
9559
|
-
|
|
9833
|
+
__proto__: null,
|
|
9834
|
+
ServerSessionManager: ServerSessionManager
|
|
9560
9835
|
});
|
|
9561
9836
|
|
|
9562
9837
|
/**
|
|
@@ -9655,6 +9930,23 @@ async function updateIdTokenAndAccessToken(idToken, accessToken, isServer = fals
|
|
|
9655
9930
|
await WebSessionManager.updateIdTokenAndAccessToken(idToken, accessToken);
|
|
9656
9931
|
}
|
|
9657
9932
|
|
|
9933
|
+
const apiClient = globalAxios.create();
|
|
9934
|
+
axiosRetry(apiClient, {
|
|
9935
|
+
retries: 2,
|
|
9936
|
+
retryCondition: (error) => {
|
|
9937
|
+
var _a, _b;
|
|
9938
|
+
// Only retry GET requests on network errors (ECONNRESET, ETIMEDOUT, etc.)
|
|
9939
|
+
// Writes (POST/PUT) are not retried — the server may have processed
|
|
9940
|
+
// the request before the connection was reset.
|
|
9941
|
+
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';
|
|
9942
|
+
},
|
|
9943
|
+
retryDelay: axiosRetry.exponentialDelay,
|
|
9944
|
+
shouldResetTimeout: true,
|
|
9945
|
+
onRetry: (retryCount, error, requestConfig) => {
|
|
9946
|
+
var _a;
|
|
9947
|
+
console.warn(`[tarobase-sdk] retry ${retryCount} for ${(_a = requestConfig.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()} ${requestConfig.url} — ${error.code || error.message}`);
|
|
9948
|
+
},
|
|
9949
|
+
});
|
|
9658
9950
|
const refreshInFlight = new Map();
|
|
9659
9951
|
async function refreshAuthSessionOnce(appId, isServer) {
|
|
9660
9952
|
const key = `${isServer ? "server" : "web"}:${appId}`;
|
|
@@ -9701,6 +9993,7 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
9701
9993
|
ServerSessionManager.instance.clearSession();
|
|
9702
9994
|
};
|
|
9703
9995
|
async function executeRequest() {
|
|
9996
|
+
var _a;
|
|
9704
9997
|
// When _getAuthHeaders is provided (wallet client), use it as the sole auth source.
|
|
9705
9998
|
// Otherwise use the global createAuthHeader (default path).
|
|
9706
9999
|
const authHeader = (_overrides === null || _overrides === void 0 ? void 0 : _overrides._getAuthHeaders)
|
|
@@ -9722,11 +10015,12 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
9722
10015
|
method,
|
|
9723
10016
|
url: `${config.apiUrl}${urlPath.startsWith("/") ? urlPath : `/${urlPath}`}`,
|
|
9724
10017
|
headers,
|
|
10018
|
+
timeout: (_a = _overrides === null || _overrides === void 0 ? void 0 : _overrides.timeout) !== null && _a !== void 0 ? _a : 30000,
|
|
9725
10019
|
};
|
|
9726
10020
|
if (method !== "GET" && method !== "get") {
|
|
9727
10021
|
requestConfig.data = data ? JSON.stringify(data) : {};
|
|
9728
10022
|
}
|
|
9729
|
-
const response = await
|
|
10023
|
+
const response = await apiClient(requestConfig);
|
|
9730
10024
|
return { data: response.data, status: response.status, headers: response.headers };
|
|
9731
10025
|
}
|
|
9732
10026
|
try {
|
|
@@ -10662,6 +10956,7 @@ function scheduleTokenRefresh(connection, isServer) {
|
|
|
10662
10956
|
// This replaces the old single setTimeout approach which was unreliable for long
|
|
10663
10957
|
// delays (browsers throttle/suspend timers in background tabs).
|
|
10664
10958
|
connection.tokenRefreshTimer = setInterval(async () => {
|
|
10959
|
+
var _a, _b;
|
|
10665
10960
|
try {
|
|
10666
10961
|
const currentToken = await getIdToken$1(isServer);
|
|
10667
10962
|
if (!currentToken)
|
|
@@ -10692,6 +10987,17 @@ function scheduleTokenRefresh(connection, isServer) {
|
|
|
10692
10987
|
}
|
|
10693
10988
|
}
|
|
10694
10989
|
catch (refreshError) {
|
|
10990
|
+
// If the refresh token itself is invalid (401/403), stop retrying —
|
|
10991
|
+
// the token won't magically become valid next interval, and continuing
|
|
10992
|
+
// to hammer /session/refresh causes 429 rate-limit storms.
|
|
10993
|
+
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) {
|
|
10994
|
+
console.warn('[WS v2] Refresh token rejected (401/403), stopping periodic refresh');
|
|
10995
|
+
if (connection.tokenRefreshTimer) {
|
|
10996
|
+
clearInterval(connection.tokenRefreshTimer);
|
|
10997
|
+
connection.tokenRefreshTimer = null;
|
|
10998
|
+
}
|
|
10999
|
+
return;
|
|
11000
|
+
}
|
|
10695
11001
|
console.warn('[WS v2] Proactive token refresh failed, will retry next interval:', refreshError);
|
|
10696
11002
|
}
|
|
10697
11003
|
}
|
|
@@ -10702,6 +11008,7 @@ function scheduleTokenRefresh(connection, isServer) {
|
|
|
10702
11008
|
}, TOKEN_CHECK_INTERVAL);
|
|
10703
11009
|
}
|
|
10704
11010
|
async function getFreshAuthToken(isServer) {
|
|
11011
|
+
var _a, _b;
|
|
10705
11012
|
const currentToken = await getIdToken$1(isServer);
|
|
10706
11013
|
if (!currentToken) {
|
|
10707
11014
|
return null;
|
|
@@ -10724,6 +11031,17 @@ async function getFreshAuthToken(isServer) {
|
|
|
10724
11031
|
}
|
|
10725
11032
|
catch (error) {
|
|
10726
11033
|
console.error('[WS v2] Error refreshing token:', error);
|
|
11034
|
+
// If the refresh token is permanently invalid (401/403), clear the stale
|
|
11035
|
+
// session from storage so future attempts don't keep retrying with it.
|
|
11036
|
+
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)) {
|
|
11037
|
+
try {
|
|
11038
|
+
const { WebSessionManager } = await Promise.resolve().then(function () { return webSessionManager; });
|
|
11039
|
+
WebSessionManager.clearSession();
|
|
11040
|
+
}
|
|
11041
|
+
catch (clearError) {
|
|
11042
|
+
console.warn('[WS v2] Failed to clear stale session:', clearError);
|
|
11043
|
+
}
|
|
11044
|
+
}
|
|
10727
11045
|
}
|
|
10728
11046
|
// Return null instead of the expired token to prevent infinite 401 reconnect storms.
|
|
10729
11047
|
// The server accepts unauthenticated connections; auth-required subscriptions will
|
|
@@ -10844,7 +11162,16 @@ async function getOrCreateConnection(appId, isServer) {
|
|
|
10844
11162
|
ws.addEventListener('open', () => {
|
|
10845
11163
|
connection.isConnecting = false;
|
|
10846
11164
|
connection.isConnected = true;
|
|
10847
|
-
|
|
11165
|
+
// NOTE: Do NOT reset consecutiveAuthFailures here. It is reset when a
|
|
11166
|
+
// fresh auth token is actually obtained (in urlProvider, line ~389) or on
|
|
11167
|
+
// an explicit auth change (reconnectWithNewAuthV2, line ~854). Resetting
|
|
11168
|
+
// on every 'open' event created an infinite loop: auth fails 5x → connect
|
|
11169
|
+
// without auth → open resets counter → disconnect → auth fails 5x again →
|
|
11170
|
+
// repeat forever, hammering /session/refresh and causing 429s.
|
|
11171
|
+
//
|
|
11172
|
+
// An elevated counter is safe for anonymous/guest sessions: when there's no
|
|
11173
|
+
// token at all (getIdToken returns null), the counter is never checked —
|
|
11174
|
+
// urlProvider skips straight to unauthenticated connection.
|
|
10848
11175
|
// Schedule periodic token freshness checks
|
|
10849
11176
|
scheduleTokenRefresh(connection, isServer);
|
|
10850
11177
|
// Re-subscribe to all existing subscriptions after reconnect
|
|
@@ -15316,7 +15643,7 @@ async function loadDependencies() {
|
|
|
15316
15643
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
15317
15644
|
import('react'),
|
|
15318
15645
|
import('react-dom/client'),
|
|
15319
|
-
Promise.resolve().then(function () { return require('./index-
|
|
15646
|
+
Promise.resolve().then(function () { return require('./index-CKaaE12K.js'); })
|
|
15320
15647
|
]);
|
|
15321
15648
|
// Extract default export from ESM module namespace
|
|
15322
15649
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -19628,235 +19955,137 @@ function createSolanaRpcSubscriptionsFromTransport(transport) {
|
|
|
19628
19955
|
});
|
|
19629
19956
|
}
|
|
19630
19957
|
|
|
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
|
-
|
|
19733
|
-
|
|
19734
|
-
|
|
19735
|
-
|
|
19736
|
-
|
|
19737
|
-
|
|
19738
|
-
|
|
19739
|
-
|
|
19740
|
-
|
|
19741
|
-
|
|
19742
|
-
|
|
19743
|
-
|
|
19744
|
-
|
|
19745
|
-
|
|
19746
|
-
|
|
19747
|
-
|
|
19748
|
-
|
|
19749
|
-
|
|
19750
|
-
|
|
19751
|
-
|
|
19752
|
-
|
|
19753
|
-
var b58 = new Uint8Array(size);
|
|
19754
|
-
// Process the bytes.
|
|
19755
|
-
while (pbegin !== pend) {
|
|
19756
|
-
var carry = source[pbegin];
|
|
19757
|
-
// Apply "b58 = b58 * 256 + ch".
|
|
19758
|
-
var i = 0;
|
|
19759
|
-
for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
19760
|
-
carry += (256 * b58[it1]) >>> 0;
|
|
19761
|
-
b58[it1] = (carry % BASE) >>> 0;
|
|
19762
|
-
carry = (carry / BASE) >>> 0;
|
|
19763
|
-
}
|
|
19764
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
19765
|
-
length = i;
|
|
19766
|
-
pbegin++;
|
|
19767
|
-
}
|
|
19768
|
-
// Skip leading zeroes in base58 result.
|
|
19769
|
-
var it2 = size - length;
|
|
19770
|
-
while (it2 !== size && b58[it2] === 0) {
|
|
19771
|
-
it2++;
|
|
19772
|
-
}
|
|
19773
|
-
// Translate the result into a string.
|
|
19774
|
-
var str = LEADER.repeat(zeroes);
|
|
19775
|
-
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
19776
|
-
return str
|
|
19777
|
-
}
|
|
19778
|
-
function decodeUnsafe (source) {
|
|
19779
|
-
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
19780
|
-
if (source.length === 0) { return _Buffer.alloc(0) }
|
|
19781
|
-
var psz = 0;
|
|
19782
|
-
// Skip and count leading '1's.
|
|
19783
|
-
var zeroes = 0;
|
|
19784
|
-
var length = 0;
|
|
19785
|
-
while (source[psz] === LEADER) {
|
|
19786
|
-
zeroes++;
|
|
19787
|
-
psz++;
|
|
19788
|
-
}
|
|
19789
|
-
// Allocate enough space in big-endian base256 representation.
|
|
19790
|
-
var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
19791
|
-
var b256 = new Uint8Array(size);
|
|
19792
|
-
// Process the characters.
|
|
19793
|
-
while (psz < source.length) {
|
|
19794
|
-
// Find code of next character
|
|
19795
|
-
var charCode = source.charCodeAt(psz);
|
|
19796
|
-
// Base map can not be indexed using char code
|
|
19797
|
-
if (charCode > 255) { return }
|
|
19798
|
-
// Decode character
|
|
19799
|
-
var carry = BASE_MAP[charCode];
|
|
19800
|
-
// Invalid character
|
|
19801
|
-
if (carry === 255) { return }
|
|
19802
|
-
var i = 0;
|
|
19803
|
-
for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
19804
|
-
carry += (BASE * b256[it3]) >>> 0;
|
|
19805
|
-
b256[it3] = (carry % 256) >>> 0;
|
|
19806
|
-
carry = (carry / 256) >>> 0;
|
|
19807
|
-
}
|
|
19808
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
19809
|
-
length = i;
|
|
19810
|
-
psz++;
|
|
19811
|
-
}
|
|
19812
|
-
// Skip leading zeroes in b256.
|
|
19813
|
-
var it4 = size - length;
|
|
19814
|
-
while (it4 !== size && b256[it4] === 0) {
|
|
19815
|
-
it4++;
|
|
19816
|
-
}
|
|
19817
|
-
var vch = _Buffer.allocUnsafe(zeroes + (size - it4));
|
|
19818
|
-
vch.fill(0x00, 0, zeroes);
|
|
19819
|
-
var j = zeroes;
|
|
19820
|
-
while (it4 !== size) {
|
|
19821
|
-
vch[j++] = b256[it4++];
|
|
19822
|
-
}
|
|
19823
|
-
return vch
|
|
19824
|
-
}
|
|
19825
|
-
function decode (string) {
|
|
19826
|
-
var buffer = decodeUnsafe(string);
|
|
19827
|
-
if (buffer) { return buffer }
|
|
19828
|
-
throw new Error('Non-base' + BASE + ' character')
|
|
19829
|
-
}
|
|
19830
|
-
return {
|
|
19831
|
-
encode: encode,
|
|
19832
|
-
decodeUnsafe: decodeUnsafe,
|
|
19833
|
-
decode: decode
|
|
19834
|
-
}
|
|
19835
|
-
}
|
|
19836
|
-
src = base;
|
|
19837
|
-
return src;
|
|
19838
|
-
}
|
|
19839
|
-
|
|
19840
|
-
var bs58$1;
|
|
19841
|
-
var hasRequiredBs58;
|
|
19842
|
-
|
|
19843
|
-
function requireBs58 () {
|
|
19844
|
-
if (hasRequiredBs58) return bs58$1;
|
|
19845
|
-
hasRequiredBs58 = 1;
|
|
19846
|
-
var basex = requireSrc();
|
|
19847
|
-
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
19848
|
-
|
|
19849
|
-
bs58$1 = basex(ALPHABET);
|
|
19850
|
-
return bs58$1;
|
|
19958
|
+
// base-x encoding / decoding
|
|
19959
|
+
// Copyright (c) 2018 base-x contributors
|
|
19960
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
19961
|
+
// Distributed under the MIT software license, see the accompanying
|
|
19962
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
19963
|
+
function base (ALPHABET) {
|
|
19964
|
+
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
19965
|
+
const BASE_MAP = new Uint8Array(256);
|
|
19966
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
19967
|
+
BASE_MAP[j] = 255;
|
|
19968
|
+
}
|
|
19969
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
19970
|
+
const x = ALPHABET.charAt(i);
|
|
19971
|
+
const xc = x.charCodeAt(0);
|
|
19972
|
+
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
|
19973
|
+
BASE_MAP[xc] = i;
|
|
19974
|
+
}
|
|
19975
|
+
const BASE = ALPHABET.length;
|
|
19976
|
+
const LEADER = ALPHABET.charAt(0);
|
|
19977
|
+
const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
|
|
19978
|
+
const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
|
|
19979
|
+
function encode (source) {
|
|
19980
|
+
// eslint-disable-next-line no-empty
|
|
19981
|
+
if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
|
|
19982
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
19983
|
+
} else if (Array.isArray(source)) {
|
|
19984
|
+
source = Uint8Array.from(source);
|
|
19985
|
+
}
|
|
19986
|
+
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
|
19987
|
+
if (source.length === 0) { return '' }
|
|
19988
|
+
// Skip & count leading zeroes.
|
|
19989
|
+
let zeroes = 0;
|
|
19990
|
+
let length = 0;
|
|
19991
|
+
let pbegin = 0;
|
|
19992
|
+
const pend = source.length;
|
|
19993
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
19994
|
+
pbegin++;
|
|
19995
|
+
zeroes++;
|
|
19996
|
+
}
|
|
19997
|
+
// Allocate enough space in big-endian base58 representation.
|
|
19998
|
+
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
|
|
19999
|
+
const b58 = new Uint8Array(size);
|
|
20000
|
+
// Process the bytes.
|
|
20001
|
+
while (pbegin !== pend) {
|
|
20002
|
+
let carry = source[pbegin];
|
|
20003
|
+
// Apply "b58 = b58 * 256 + ch".
|
|
20004
|
+
let i = 0;
|
|
20005
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
20006
|
+
carry += (256 * b58[it1]) >>> 0;
|
|
20007
|
+
b58[it1] = (carry % BASE) >>> 0;
|
|
20008
|
+
carry = (carry / BASE) >>> 0;
|
|
20009
|
+
}
|
|
20010
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20011
|
+
length = i;
|
|
20012
|
+
pbegin++;
|
|
20013
|
+
}
|
|
20014
|
+
// Skip leading zeroes in base58 result.
|
|
20015
|
+
let it2 = size - length;
|
|
20016
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
20017
|
+
it2++;
|
|
20018
|
+
}
|
|
20019
|
+
// Translate the result into a string.
|
|
20020
|
+
let str = LEADER.repeat(zeroes);
|
|
20021
|
+
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
20022
|
+
return str
|
|
20023
|
+
}
|
|
20024
|
+
function decodeUnsafe (source) {
|
|
20025
|
+
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
20026
|
+
if (source.length === 0) { return new Uint8Array() }
|
|
20027
|
+
let psz = 0;
|
|
20028
|
+
// Skip and count leading '1's.
|
|
20029
|
+
let zeroes = 0;
|
|
20030
|
+
let length = 0;
|
|
20031
|
+
while (source[psz] === LEADER) {
|
|
20032
|
+
zeroes++;
|
|
20033
|
+
psz++;
|
|
20034
|
+
}
|
|
20035
|
+
// Allocate enough space in big-endian base256 representation.
|
|
20036
|
+
const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
20037
|
+
const b256 = new Uint8Array(size);
|
|
20038
|
+
// Process the characters.
|
|
20039
|
+
while (psz < source.length) {
|
|
20040
|
+
// Find code of next character
|
|
20041
|
+
const charCode = source.charCodeAt(psz);
|
|
20042
|
+
// Base map can not be indexed using char code
|
|
20043
|
+
if (charCode > 255) { return }
|
|
20044
|
+
// Decode character
|
|
20045
|
+
let carry = BASE_MAP[charCode];
|
|
20046
|
+
// Invalid character
|
|
20047
|
+
if (carry === 255) { return }
|
|
20048
|
+
let i = 0;
|
|
20049
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
20050
|
+
carry += (BASE * b256[it3]) >>> 0;
|
|
20051
|
+
b256[it3] = (carry % 256) >>> 0;
|
|
20052
|
+
carry = (carry / 256) >>> 0;
|
|
20053
|
+
}
|
|
20054
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20055
|
+
length = i;
|
|
20056
|
+
psz++;
|
|
20057
|
+
}
|
|
20058
|
+
// Skip leading zeroes in b256.
|
|
20059
|
+
let it4 = size - length;
|
|
20060
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
20061
|
+
it4++;
|
|
20062
|
+
}
|
|
20063
|
+
const vch = new Uint8Array(zeroes + (size - it4));
|
|
20064
|
+
let j = zeroes;
|
|
20065
|
+
while (it4 !== size) {
|
|
20066
|
+
vch[j++] = b256[it4++];
|
|
20067
|
+
}
|
|
20068
|
+
return vch
|
|
20069
|
+
}
|
|
20070
|
+
function decode (string) {
|
|
20071
|
+
const buffer = decodeUnsafe(string);
|
|
20072
|
+
if (buffer) { return buffer }
|
|
20073
|
+
throw new Error('Non-base' + BASE + ' character')
|
|
20074
|
+
}
|
|
20075
|
+
return {
|
|
20076
|
+
encode,
|
|
20077
|
+
decodeUnsafe,
|
|
20078
|
+
decode
|
|
20079
|
+
}
|
|
19851
20080
|
}
|
|
19852
20081
|
|
|
19853
|
-
var
|
|
19854
|
-
var bs58 =
|
|
20082
|
+
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
20083
|
+
var bs58 = base(ALPHABET);
|
|
19855
20084
|
|
|
19856
|
-
var index = /*#__PURE__*/
|
|
20085
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
19857
20086
|
__proto__: null,
|
|
19858
20087
|
default: bs58
|
|
19859
|
-
}
|
|
20088
|
+
});
|
|
19860
20089
|
|
|
19861
20090
|
const SURFNET_RPC_URL$1 = "https://surfpool.fly.dev";
|
|
19862
20091
|
let React;
|
|
@@ -20770,7 +20999,7 @@ async function loadMwaProtocol() {
|
|
|
20770
20999
|
return mwaProtocolLoadPromise;
|
|
20771
21000
|
mwaProtocolLoadPromise = (async () => {
|
|
20772
21001
|
try {
|
|
20773
|
-
mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-
|
|
21002
|
+
mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-BMtEulGJ.js'); });
|
|
20774
21003
|
}
|
|
20775
21004
|
catch (e) {
|
|
20776
21005
|
console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
|
|
@@ -20792,7 +21021,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
20792
21021
|
if (typeof window === 'undefined')
|
|
20793
21022
|
return;
|
|
20794
21023
|
try {
|
|
20795
|
-
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-
|
|
21024
|
+
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-AZQ5TnZ4.js'); });
|
|
20796
21025
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
20797
21026
|
if (!registerMwa) {
|
|
20798
21027
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -21712,6 +21941,7 @@ exports.ServerSessionManager = ServerSessionManager;
|
|
|
21712
21941
|
exports.SolanaMobileWalletProvider = SolanaMobileWalletProvider;
|
|
21713
21942
|
exports.WebSessionManager = WebSessionManager;
|
|
21714
21943
|
exports.aggregate = aggregate;
|
|
21944
|
+
exports.bs58 = bs58;
|
|
21715
21945
|
exports.bufferExports = bufferExports;
|
|
21716
21946
|
exports.buildSetDocumentsTransaction = buildSetDocumentsTransaction;
|
|
21717
21947
|
exports.clearCache = clearCache;
|
|
@@ -21757,4 +21987,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
|
21757
21987
|
exports.signTransaction = signTransaction;
|
|
21758
21988
|
exports.subscribe = subscribe;
|
|
21759
21989
|
exports.useAuth = useAuth;
|
|
21760
|
-
//# sourceMappingURL=index-
|
|
21990
|
+
//# sourceMappingURL=index-Cp727oEW.js.map
|