@pooflabs/web 0.0.82 → 0.0.83-rc2
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-Ci3m3diI.js → index-BycoUXcq.js} +7858 -11120
- package/dist/index-BycoUXcq.js.map +1 -0
- package/dist/index-CrOVJFX9.esm.js +2373 -0
- package/dist/index-CrOVJFX9.esm.js.map +1 -0
- package/dist/{index-DWf2AOhe.esm.js → index-DEwS-N9F.esm.js} +7859 -11120
- package/dist/index-DEwS-N9F.esm.js.map +1 -0
- package/dist/{index-DlKo76M3.js → index-DQLduP63.js} +7859 -11121
- package/dist/index-DQLduP63.js.map +1 -0
- package/dist/{index-BicMkamC.js → index-HSa4FZ9y.js} +283 -325
- package/dist/index-HSa4FZ9y.js.map +1 -0
- package/dist/{index-CK_2Zn89.esm.js → index-dyXVIGCy.esm.js} +7858 -11121
- package/dist/index-dyXVIGCy.esm.js.map +1 -0
- package/dist/{index-BsY_Lgiu.esm.js → index-p1LvAs78.esm.js} +283 -324
- package/dist/index-p1LvAs78.esm.js.map +1 -0
- package/dist/index.browser-CbVXUCv0.esm.js +102 -0
- package/dist/index.browser-CbVXUCv0.esm.js.map +1 -0
- package/dist/index.browser-DEfS865o.js +105 -0
- package/dist/index.browser-DEfS865o.js.map +1 -0
- package/dist/{index.browser-BkMiHSON.js → index.browser-DQvFxLjk.js} +1571 -1368
- package/dist/index.browser-DQvFxLjk.js.map +1 -0
- package/dist/{index.browser-DCOvqSUT.esm.js → index.browser-Dekybe_E.esm.js} +1571 -1368
- package/dist/index.browser-Dekybe_E.esm.js.map +1 -0
- package/dist/index.browser-OvGNsMPu.esm.js +1002 -0
- package/dist/index.browser-OvGNsMPu.esm.js.map +1 -0
- package/dist/index.browser-jwJFPtjK.js +1099 -0
- package/dist/index.browser-jwJFPtjK.js.map +1 -0
- package/dist/index.browser-vuTr40so.js +1008 -0
- package/dist/index.browser-vuTr40so.js.map +1 -0
- package/dist/index.browser-zXADedzh.esm.js +1096 -0
- package/dist/index.browser-zXADedzh.esm.js.map +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.native-CLaHKvDv.esm.js → index.native-Brt4NkkH.esm.js} +250 -2720
- package/dist/index.native-Brt4NkkH.esm.js.map +1 -0
- package/dist/{index.native-11supFRU.js → index.native-CawD5H6H.js} +250 -2723
- package/dist/index.native-CawD5H6H.js.map +1 -0
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +1 -1
- package/dist/{phantom-wallet-provider-BN47klTp.esm.js → phantom-wallet-provider-BR5R3OAI.esm.js} +37 -6
- package/dist/phantom-wallet-provider-BR5R3OAI.esm.js.map +1 -0
- package/dist/{phantom-wallet-provider-Xb070-O6.js → phantom-wallet-provider-CjI_IIr9.js} +37 -6
- package/dist/phantom-wallet-provider-CjI_IIr9.js.map +1 -0
- package/dist/{privy-wallet-provider-DUJS5viU.esm.js → privy-wallet-provider-ZQ4fLg4f.esm.js} +4 -4
- package/dist/privy-wallet-provider-ZQ4fLg4f.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-Ch22rj_G.js → privy-wallet-provider-wN23XtR8.js} +4 -4
- package/dist/privy-wallet-provider-wN23XtR8.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-BF04Xp8P.esm.js → solana-mobile-wallet-provider-DhtoJcqW.esm.js} +34 -5
- package/dist/solana-mobile-wallet-provider-DhtoJcqW.esm.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-BXm94fqW.js → solana-mobile-wallet-provider-Dt8K5Ils.js} +34 -5
- package/dist/solana-mobile-wallet-provider-Dt8K5Ils.js.map +1 -0
- package/package.json +2 -2
- package/dist/index-BicMkamC.js.map +0 -1
- package/dist/index-BsY_Lgiu.esm.js.map +0 -1
- package/dist/index-CHWmdXHE.esm.js +0 -6
- package/dist/index-CHWmdXHE.esm.js.map +0 -1
- package/dist/index-CK_2Zn89.esm.js.map +0 -1
- package/dist/index-Ci3m3diI.js.map +0 -1
- package/dist/index-DWf2AOhe.esm.js.map +0 -1
- package/dist/index-DlKo76M3.js.map +0 -1
- package/dist/index-Dz0bPXrU.js +0 -8
- package/dist/index-Dz0bPXrU.js.map +0 -1
- package/dist/index.browser-BkMiHSON.js.map +0 -1
- package/dist/index.browser-C-_FEr5M.esm.js +0 -1134
- package/dist/index.browser-C-_FEr5M.esm.js.map +0 -1
- package/dist/index.browser-C9bFQZyQ.esm.js +0 -1373
- package/dist/index.browser-C9bFQZyQ.esm.js.map +0 -1
- package/dist/index.browser-DCOvqSUT.esm.js.map +0 -1
- package/dist/index.browser-Dbq5Qf1G.esm.js +0 -242
- package/dist/index.browser-Dbq5Qf1G.esm.js.map +0 -1
- package/dist/index.browser-Df7yN8D5.js +0 -245
- package/dist/index.browser-Df7yN8D5.js.map +0 -1
- package/dist/index.browser-DjEZSiqI.js +0 -1137
- package/dist/index.browser-DjEZSiqI.js.map +0 -1
- package/dist/index.browser-dszs5oe5.js +0 -1376
- package/dist/index.browser-dszs5oe5.js.map +0 -1
- package/dist/index.native-11supFRU.js.map +0 -1
- package/dist/index.native-CLaHKvDv.esm.js.map +0 -1
- package/dist/phantom-wallet-provider-BN47klTp.esm.js.map +0 -1
- package/dist/phantom-wallet-provider-Xb070-O6.js.map +0 -1
- package/dist/privy-wallet-provider-Ch22rj_G.js.map +0 -1
- package/dist/privy-wallet-provider-DUJS5viU.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-BF04Xp8P.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-BXm94fqW.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
|
|
|
@@ -6785,6 +6770,28 @@ class WebSessionManager {
|
|
|
6785
6770
|
static async storeSession(address, accessToken, idToken, refreshToken) {
|
|
6786
6771
|
if (typeof window === "undefined")
|
|
6787
6772
|
return;
|
|
6773
|
+
// JWT-wallet binding: refuse to store a session whose idToken is bound
|
|
6774
|
+
// to a different wallet than `address`. Prevents races that would otherwise
|
|
6775
|
+
// leave localStorage with mismatched address/token state.
|
|
6776
|
+
try {
|
|
6777
|
+
const payloadB64 = idToken.split(".")[1];
|
|
6778
|
+
if (payloadB64) {
|
|
6779
|
+
const payload = JSON.parse(this.decodeBase64Url(payloadB64));
|
|
6780
|
+
const tokenWallet = payload["custom:walletAddress"];
|
|
6781
|
+
if (tokenWallet && tokenWallet !== address) {
|
|
6782
|
+
throw new Error(`[WebSessionManager] Refusing to store session: address (${address}) does not match idToken custom:walletAddress (${tokenWallet})`);
|
|
6783
|
+
}
|
|
6784
|
+
if (!tokenWallet) {
|
|
6785
|
+
console.warn("[WebSessionManager] storeSession: idToken has no custom:walletAddress claim — writing without validation");
|
|
6786
|
+
}
|
|
6787
|
+
}
|
|
6788
|
+
}
|
|
6789
|
+
catch (err) {
|
|
6790
|
+
if (typeof (err === null || err === void 0 ? void 0 : err.message) === "string" && err.message.includes("Refusing to store session")) {
|
|
6791
|
+
throw err;
|
|
6792
|
+
}
|
|
6793
|
+
console.warn("[WebSessionManager] storeSession: failed to decode idToken for validation:", err);
|
|
6794
|
+
}
|
|
6788
6795
|
const config = await getConfig();
|
|
6789
6796
|
const currentAppId = config.appId;
|
|
6790
6797
|
localStorage.setItem(this.TAROBASE_SESSION_STORAGE_KEY, JSON.stringify({
|
|
@@ -9273,15 +9280,15 @@ function requireBuffer$1 () {
|
|
|
9273
9280
|
|
|
9274
9281
|
var bufferExports$1 = requireBuffer$1();
|
|
9275
9282
|
|
|
9276
|
-
var safeBuffer
|
|
9283
|
+
var safeBuffer = {exports: {}};
|
|
9277
9284
|
|
|
9278
9285
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
9279
9286
|
|
|
9280
|
-
var hasRequiredSafeBuffer
|
|
9287
|
+
var hasRequiredSafeBuffer;
|
|
9281
9288
|
|
|
9282
|
-
function requireSafeBuffer
|
|
9283
|
-
if (hasRequiredSafeBuffer
|
|
9284
|
-
hasRequiredSafeBuffer
|
|
9289
|
+
function requireSafeBuffer () {
|
|
9290
|
+
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
9291
|
+
hasRequiredSafeBuffer = 1;
|
|
9285
9292
|
(function (module, exports$1) {
|
|
9286
9293
|
/* eslint-disable node/no-deprecated-api */
|
|
9287
9294
|
var buffer = requireBuffer$1();
|
|
@@ -9347,23 +9354,23 @@ function requireSafeBuffer$1 () {
|
|
|
9347
9354
|
}
|
|
9348
9355
|
return buffer.SlowBuffer(size)
|
|
9349
9356
|
};
|
|
9350
|
-
} (safeBuffer
|
|
9351
|
-
return safeBuffer
|
|
9357
|
+
} (safeBuffer, safeBuffer.exports));
|
|
9358
|
+
return safeBuffer.exports;
|
|
9352
9359
|
}
|
|
9353
9360
|
|
|
9354
|
-
var src
|
|
9355
|
-
var hasRequiredSrc
|
|
9361
|
+
var src;
|
|
9362
|
+
var hasRequiredSrc;
|
|
9356
9363
|
|
|
9357
|
-
function requireSrc
|
|
9358
|
-
if (hasRequiredSrc
|
|
9359
|
-
hasRequiredSrc
|
|
9364
|
+
function requireSrc () {
|
|
9365
|
+
if (hasRequiredSrc) return src;
|
|
9366
|
+
hasRequiredSrc = 1;
|
|
9360
9367
|
// base-x encoding / decoding
|
|
9361
9368
|
// Copyright (c) 2018 base-x contributors
|
|
9362
9369
|
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
9363
9370
|
// Distributed under the MIT software license, see the accompanying
|
|
9364
9371
|
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
9365
9372
|
// @ts-ignore
|
|
9366
|
-
var _Buffer = requireSafeBuffer
|
|
9373
|
+
var _Buffer = requireSafeBuffer().Buffer;
|
|
9367
9374
|
function base (ALPHABET) {
|
|
9368
9375
|
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
9369
9376
|
var BASE_MAP = new Uint8Array(256);
|
|
@@ -9478,25 +9485,25 @@ function requireSrc$1 () {
|
|
|
9478
9485
|
decode: decode
|
|
9479
9486
|
}
|
|
9480
9487
|
}
|
|
9481
|
-
src
|
|
9482
|
-
return src
|
|
9488
|
+
src = base;
|
|
9489
|
+
return src;
|
|
9483
9490
|
}
|
|
9484
9491
|
|
|
9485
|
-
var bs58$1
|
|
9486
|
-
var hasRequiredBs58
|
|
9492
|
+
var bs58$1;
|
|
9493
|
+
var hasRequiredBs58;
|
|
9487
9494
|
|
|
9488
|
-
function requireBs58
|
|
9489
|
-
if (hasRequiredBs58
|
|
9490
|
-
hasRequiredBs58
|
|
9491
|
-
var basex = requireSrc
|
|
9495
|
+
function requireBs58 () {
|
|
9496
|
+
if (hasRequiredBs58) return bs58$1;
|
|
9497
|
+
hasRequiredBs58 = 1;
|
|
9498
|
+
var basex = requireSrc();
|
|
9492
9499
|
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
9493
9500
|
|
|
9494
|
-
bs58$1
|
|
9495
|
-
return bs58$1
|
|
9501
|
+
bs58$1 = basex(ALPHABET);
|
|
9502
|
+
return bs58$1;
|
|
9496
9503
|
}
|
|
9497
9504
|
|
|
9498
|
-
var bs58Exports
|
|
9499
|
-
var bs58
|
|
9505
|
+
var bs58Exports = requireBs58();
|
|
9506
|
+
var bs58 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports);
|
|
9500
9507
|
|
|
9501
9508
|
// ─────────────────────────────────────────────────────────────
|
|
9502
9509
|
// Local implementation of getSimulationComputeUnits
|
|
@@ -9575,12 +9582,6 @@ async function genSolanaMessage(address, nonce) {
|
|
|
9575
9582
|
// Serialization Helpers
|
|
9576
9583
|
// ─────────────────────────────────────────────────────────────
|
|
9577
9584
|
function isHexString(value) {
|
|
9578
|
-
// Only strings can be hex-encoded. Numbers, BNs, and other shapes coming back
|
|
9579
|
-
// from the API for u64Val/i64Val should fall through to `new BN(value)` which
|
|
9580
|
-
// accepts those shapes natively. Without this guard, calling .startsWith on a
|
|
9581
|
-
// non-string blows up with TypeError.
|
|
9582
|
-
if (typeof value !== "string")
|
|
9583
|
-
return false;
|
|
9584
9585
|
// Matches strings containing only 0-9, a-f, or A-F (optionally prefixed with 0x)
|
|
9585
9586
|
let testValue = value;
|
|
9586
9587
|
// Handle negative values
|
|
@@ -9676,11 +9677,8 @@ async function buildSetDocumentsTransaction(connection, idl, anchorProvider, pay
|
|
|
9676
9677
|
}
|
|
9677
9678
|
else if (idl.address === "poof4b5pk1L9tmThvBmaABjcyjfhFGbMbQP5BXk2QZp") {
|
|
9678
9679
|
const program = new anchor.Program(idl, anchorProvider);
|
|
9679
|
-
// Targets `set_documents_v2` (Vec<u8> ra_indices). The on-chain program
|
|
9680
|
-
// also exposes the legacy `set_documents` (Vec<u64>) so SDKs already on npm
|
|
9681
|
-
// continue to work — but new releases of this SDK speak v2 only.
|
|
9682
9680
|
tx = await program.methods
|
|
9683
|
-
.
|
|
9681
|
+
.setDocuments(args.app_id, prepareAnchorArgs(args.documents), args.delete_paths, args.txData, simulate)
|
|
9684
9682
|
.preInstructions(instructions)
|
|
9685
9683
|
.accounts({
|
|
9686
9684
|
payer: payerPublicKey
|
|
@@ -9758,7 +9756,7 @@ function loadKeypairFromEnv() {
|
|
|
9758
9756
|
try {
|
|
9759
9757
|
const secretKey = secret.trim().startsWith("[")
|
|
9760
9758
|
? Uint8Array.from(JSON.parse(secret))
|
|
9761
|
-
: bs58
|
|
9759
|
+
: bs58.decode(secret.trim());
|
|
9762
9760
|
return web3_js.Keypair.fromSecretKey(secretKey);
|
|
9763
9761
|
}
|
|
9764
9762
|
catch (err) {
|
|
@@ -10035,17 +10033,11 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
10035
10033
|
if (_overrides === null || _overrides === void 0 ? void 0 : _overrides.headers) {
|
|
10036
10034
|
Object.assign(headers, _overrides.headers);
|
|
10037
10035
|
}
|
|
10038
|
-
// Writes (PUT/POST/DELETE) can take significantly longer than reads —
|
|
10039
|
-
// server-side they may trigger ad-hoc LUT creation (create + extend +
|
|
10040
|
-
// wait-for-finalization, ~15-30s on mainnet). Use a larger default for
|
|
10041
|
-
// non-GET so the SDK doesn't time out before client-api responds.
|
|
10042
|
-
const isRead = method.toUpperCase() === "GET";
|
|
10043
|
-
const defaultTimeout = isRead ? 30000 : 90000;
|
|
10044
10036
|
const requestConfig = {
|
|
10045
10037
|
method,
|
|
10046
10038
|
url: `${config.apiUrl}${urlPath.startsWith("/") ? urlPath : `/${urlPath}`}`,
|
|
10047
10039
|
headers,
|
|
10048
|
-
timeout: (_a = _overrides === null || _overrides === void 0 ? void 0 : _overrides.timeout) !== null && _a !== void 0 ? _a :
|
|
10040
|
+
timeout: (_a = _overrides === null || _overrides === void 0 ? void 0 : _overrides.timeout) !== null && _a !== void 0 ? _a : 30000,
|
|
10049
10041
|
};
|
|
10050
10042
|
if (method !== "GET" && method !== "get") {
|
|
10051
10043
|
requestConfig.data = data ? JSON.stringify(data) : {};
|
|
@@ -10690,38 +10682,21 @@ async function setMany(many, options) {
|
|
|
10690
10682
|
setDocumentData: tx.transactionArgs.setDocumentData,
|
|
10691
10683
|
deletePaths: tx.transactionArgs.deletePaths,
|
|
10692
10684
|
idl: tx.idl,
|
|
10693
|
-
txData: (_b = (_a = tx.txData) === null || _a === void 0 ? void 0 : _a.map((txData) =>
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
raIndices: (() => {
|
|
10702
|
-
const raw = txData.raIndices;
|
|
10703
|
-
if (raw == null)
|
|
10704
|
-
return bufferExports$1.Buffer.alloc(0);
|
|
10705
|
-
if (bufferExports$1.Buffer.isBuffer(raw))
|
|
10706
|
-
return raw;
|
|
10707
|
-
if (raw instanceof Uint8Array)
|
|
10708
|
-
return bufferExports$1.Buffer.from(raw);
|
|
10709
|
-
// Node's JSON-serialised Buffer: {type: "Buffer", data: number[]}
|
|
10710
|
-
const arrayLike = Array.isArray(raw)
|
|
10711
|
-
? raw
|
|
10712
|
-
: (raw && typeof raw === 'object' && Array.isArray(raw.data))
|
|
10713
|
-
? raw.data
|
|
10714
|
-
: (() => { throw new Error(`raIndices has unexpected shape: ${typeof raw}`); })();
|
|
10715
|
-
const bytes = arrayLike.map((raIndex) => {
|
|
10716
|
-
const n = isHexString(raIndex) ? parseInt(raIndex, 16) : Number(raIndex);
|
|
10717
|
-
if (!Number.isInteger(n) || n < 0 || n > 255) {
|
|
10718
|
-
throw new Error(`raIndex ${raIndex} is not a valid u8 (must be integer in 0..255)`);
|
|
10685
|
+
txData: (_b = (_a = tx.txData) === null || _a === void 0 ? void 0 : _a.map((txData) => {
|
|
10686
|
+
var _a;
|
|
10687
|
+
return ({
|
|
10688
|
+
pluginFunctionKey: txData.pluginFunctionKey,
|
|
10689
|
+
txData: bufferExports$1.Buffer.from(txData.txData),
|
|
10690
|
+
raIndices: (_a = txData.raIndices) === null || _a === void 0 ? void 0 : _a.map((raIndex) => {
|
|
10691
|
+
if (isHexString(raIndex)) {
|
|
10692
|
+
return new BN(raIndex, "hex");
|
|
10719
10693
|
}
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10694
|
+
else {
|
|
10695
|
+
return new BN(raIndex);
|
|
10696
|
+
}
|
|
10697
|
+
}),
|
|
10698
|
+
});
|
|
10699
|
+
})) !== null && _b !== void 0 ? _b : [],
|
|
10725
10700
|
};
|
|
10726
10701
|
const config = await getConfig();
|
|
10727
10702
|
const solTransaction = {
|
|
@@ -11703,6 +11678,28 @@ class ReactNativeSessionManager {
|
|
|
11703
11678
|
/* STORE */
|
|
11704
11679
|
/* ------------------------------------------------------------------ */
|
|
11705
11680
|
static async storeSession(address, accessToken, idToken, refreshToken) {
|
|
11681
|
+
// JWT-wallet binding: refuse to store a session whose idToken is bound
|
|
11682
|
+
// to a different wallet than `address`. Prevents races that would otherwise
|
|
11683
|
+
// leave storage with mismatched address/token state.
|
|
11684
|
+
try {
|
|
11685
|
+
const payloadB64 = idToken.split(".")[1];
|
|
11686
|
+
if (payloadB64) {
|
|
11687
|
+
const payload = JSON.parse(this.decodeBase64Url(payloadB64));
|
|
11688
|
+
const tokenWallet = payload["custom:walletAddress"];
|
|
11689
|
+
if (tokenWallet && tokenWallet !== address) {
|
|
11690
|
+
throw new Error(`[ReactNativeSessionManager] Refusing to store session: address (${address}) does not match idToken custom:walletAddress (${tokenWallet})`);
|
|
11691
|
+
}
|
|
11692
|
+
if (!tokenWallet) {
|
|
11693
|
+
console.warn("[ReactNativeSessionManager] storeSession: idToken has no custom:walletAddress claim — writing without validation");
|
|
11694
|
+
}
|
|
11695
|
+
}
|
|
11696
|
+
}
|
|
11697
|
+
catch (err) {
|
|
11698
|
+
if (typeof (err === null || err === void 0 ? void 0 : err.message) === "string" && err.message.includes("Refusing to store session")) {
|
|
11699
|
+
throw err;
|
|
11700
|
+
}
|
|
11701
|
+
console.warn("[ReactNativeSessionManager] storeSession: failed to decode idToken for validation:", err);
|
|
11702
|
+
}
|
|
11706
11703
|
const config = await getConfig();
|
|
11707
11704
|
const currentAppId = config.appId;
|
|
11708
11705
|
this.getStorage().setItem(this.TAROBASE_SESSION_STORAGE_KEY, JSON.stringify({
|
|
@@ -15701,7 +15698,7 @@ async function loadDependencies() {
|
|
|
15701
15698
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
15702
15699
|
import('react'),
|
|
15703
15700
|
import('react-dom/client'),
|
|
15704
|
-
Promise.resolve().then(function () { return require('./index-
|
|
15701
|
+
Promise.resolve().then(function () { return require('./index-BycoUXcq.js'); })
|
|
15705
15702
|
]);
|
|
15706
15703
|
// Extract default export from ESM module namespace
|
|
15707
15704
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -15847,6 +15844,17 @@ class PhantomWalletProvider {
|
|
|
15847
15844
|
const isMobile = detectMobile();
|
|
15848
15845
|
const hasPhantomInjected = discoveredWallets.some((w) => w.id === 'phantom');
|
|
15849
15846
|
const showDeeplink = isMobile && sdkProviders.includes('deeplink') && !hasPhantomInjected;
|
|
15847
|
+
// Treat MWA's own wallet-standard registrations as not-injected, so the MWA
|
|
15848
|
+
// button still appears when only MWA is present (e.g. Android Chrome on Seeker).
|
|
15849
|
+
const hasInjectedWallet = discoveredWallets.some((w) => {
|
|
15850
|
+
var _a, _b;
|
|
15851
|
+
const id = String((_a = w.id) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
15852
|
+
const name = String((_b = w.name) !== null && _b !== void 0 ? _b : '').toLowerCase();
|
|
15853
|
+
return (id !== 'mobile-wallet-adapter' &&
|
|
15854
|
+
id !== 'remote-mobile-wallet-adapter' &&
|
|
15855
|
+
name !== 'mobile wallet adapter' &&
|
|
15856
|
+
name !== 'remote mobile wallet adapter');
|
|
15857
|
+
});
|
|
15850
15858
|
// Track previous modal state to detect closes
|
|
15851
15859
|
const prevModalOpen = React$1.useRef(false);
|
|
15852
15860
|
// Track when modal was closed because user selected a wallet (not dismissed)
|
|
@@ -15895,6 +15903,16 @@ class PhantomWalletProvider {
|
|
|
15895
15903
|
if (!(phantom === null || phantom === void 0 ? void 0 : phantom.isConnected) || (phantom === null || phantom === void 0 ? void 0 : phantom.isLoading) || that.loginInProgress || that.autoLoginInProgress || that.pendingLogin) {
|
|
15896
15904
|
return;
|
|
15897
15905
|
}
|
|
15906
|
+
// Don't clobber a session owned by MWA on Seeker. MWA marks the
|
|
15907
|
+
// auth method as soon as login starts (see solana-mobile-wallet-provider),
|
|
15908
|
+
// and clears it on logout, so this guard is correct in both
|
|
15909
|
+
// steady-state and post-logout cases.
|
|
15910
|
+
try {
|
|
15911
|
+
if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'mobile-wallet-adapter') {
|
|
15912
|
+
return;
|
|
15913
|
+
}
|
|
15914
|
+
}
|
|
15915
|
+
catch (_b) { }
|
|
15898
15916
|
// Need solana to be available AND connected for signing
|
|
15899
15917
|
if (!solana || !solanaHook.isAvailable || !solana.connected) {
|
|
15900
15918
|
return;
|
|
@@ -15924,12 +15942,21 @@ class PhantomWalletProvider {
|
|
|
15924
15942
|
const signatureBytes = signResult.signature;
|
|
15925
15943
|
const signature = bufferExports.Buffer.from(signatureBytes).toString('base64');
|
|
15926
15944
|
const createSessionResult = await createSessionWithSignature(publicKey, messageText, signature);
|
|
15945
|
+
// Pre-write guard: MWA may have started a login while we were
|
|
15946
|
+
// in flight. If MWA owns the auth method now, abort before we
|
|
15947
|
+
// overwrite its session (or its in-flight session).
|
|
15948
|
+
try {
|
|
15949
|
+
if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'mobile-wallet-adapter') {
|
|
15950
|
+
return;
|
|
15951
|
+
}
|
|
15952
|
+
}
|
|
15953
|
+
catch (_c) { }
|
|
15927
15954
|
await WebSessionManager.storeSession(publicKey, createSessionResult.accessToken, createSessionResult.idToken, createSessionResult.refreshToken);
|
|
15928
15955
|
// Mark auth method so clearIncompatibleSession() doesn't wipe this session
|
|
15929
15956
|
try {
|
|
15930
15957
|
getPlatform().storage.setItem('tarobase_last_auth_method', 'phantom');
|
|
15931
15958
|
}
|
|
15932
|
-
catch (
|
|
15959
|
+
catch (_d) { }
|
|
15933
15960
|
setCurrentUser({ provider: that, address: publicKey });
|
|
15934
15961
|
}
|
|
15935
15962
|
catch (error) {
|
|
@@ -16285,8 +16312,9 @@ class PhantomWalletProvider {
|
|
|
16285
16312
|
}), 'Open Phantom app'));
|
|
16286
16313
|
}
|
|
16287
16314
|
// Mobile Wallet Adapter button — shown on Android when MWA callback is available
|
|
16315
|
+
// and no injected wallet is present (hides button inside Phantom/Solflare/etc. in-app browsers).
|
|
16288
16316
|
const isAndroid = detectAndroid();
|
|
16289
|
-
if (isAndroid && that.onSwitchToMWA) {
|
|
16317
|
+
if (isAndroid && that.onSwitchToMWA && !hasInjectedWallet) {
|
|
16290
16318
|
walletButtons.push(React$1.createElement('button', {
|
|
16291
16319
|
key: 'mobile-wallet',
|
|
16292
16320
|
style: buttonStyle('mobile-wallet'),
|
|
@@ -20119,235 +20147,137 @@ function createSolanaRpcSubscriptionsFromTransport(transport) {
|
|
|
20119
20147
|
});
|
|
20120
20148
|
}
|
|
20121
20149
|
|
|
20122
|
-
|
|
20123
|
-
|
|
20124
|
-
|
|
20125
|
-
|
|
20126
|
-
|
|
20127
|
-
|
|
20128
|
-
|
|
20129
|
-
|
|
20130
|
-
|
|
20131
|
-
|
|
20132
|
-
|
|
20133
|
-
|
|
20134
|
-
|
|
20135
|
-
|
|
20136
|
-
|
|
20137
|
-
|
|
20138
|
-
|
|
20139
|
-
|
|
20140
|
-
|
|
20141
|
-
|
|
20142
|
-
|
|
20143
|
-
|
|
20144
|
-
|
|
20145
|
-
|
|
20146
|
-
|
|
20147
|
-
|
|
20148
|
-
|
|
20149
|
-
|
|
20150
|
-
|
|
20151
|
-
|
|
20152
|
-
|
|
20153
|
-
|
|
20154
|
-
|
|
20155
|
-
|
|
20156
|
-
|
|
20157
|
-
|
|
20158
|
-
|
|
20159
|
-
|
|
20160
|
-
|
|
20161
|
-
|
|
20162
|
-
|
|
20163
|
-
|
|
20164
|
-
|
|
20165
|
-
|
|
20166
|
-
|
|
20167
|
-
|
|
20168
|
-
|
|
20169
|
-
|
|
20170
|
-
|
|
20171
|
-
|
|
20172
|
-
|
|
20173
|
-
|
|
20174
|
-
|
|
20175
|
-
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
|
|
20180
|
-
|
|
20181
|
-
|
|
20182
|
-
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
}
|
|
20199
|
-
|
|
20200
|
-
|
|
20201
|
-
|
|
20202
|
-
|
|
20203
|
-
|
|
20204
|
-
|
|
20205
|
-
|
|
20206
|
-
|
|
20207
|
-
|
|
20208
|
-
|
|
20209
|
-
|
|
20210
|
-
|
|
20211
|
-
|
|
20212
|
-
|
|
20213
|
-
|
|
20214
|
-
|
|
20215
|
-
|
|
20216
|
-
|
|
20217
|
-
|
|
20218
|
-
|
|
20219
|
-
|
|
20220
|
-
|
|
20221
|
-
|
|
20222
|
-
|
|
20223
|
-
|
|
20224
|
-
|
|
20225
|
-
|
|
20226
|
-
|
|
20227
|
-
|
|
20228
|
-
|
|
20229
|
-
|
|
20230
|
-
|
|
20231
|
-
|
|
20232
|
-
|
|
20233
|
-
|
|
20234
|
-
|
|
20235
|
-
|
|
20236
|
-
|
|
20237
|
-
|
|
20238
|
-
|
|
20239
|
-
|
|
20240
|
-
|
|
20241
|
-
|
|
20242
|
-
|
|
20243
|
-
|
|
20244
|
-
var b58 = new Uint8Array(size);
|
|
20245
|
-
// Process the bytes.
|
|
20246
|
-
while (pbegin !== pend) {
|
|
20247
|
-
var carry = source[pbegin];
|
|
20248
|
-
// Apply "b58 = b58 * 256 + ch".
|
|
20249
|
-
var i = 0;
|
|
20250
|
-
for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
20251
|
-
carry += (256 * b58[it1]) >>> 0;
|
|
20252
|
-
b58[it1] = (carry % BASE) >>> 0;
|
|
20253
|
-
carry = (carry / BASE) >>> 0;
|
|
20254
|
-
}
|
|
20255
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20256
|
-
length = i;
|
|
20257
|
-
pbegin++;
|
|
20258
|
-
}
|
|
20259
|
-
// Skip leading zeroes in base58 result.
|
|
20260
|
-
var it2 = size - length;
|
|
20261
|
-
while (it2 !== size && b58[it2] === 0) {
|
|
20262
|
-
it2++;
|
|
20263
|
-
}
|
|
20264
|
-
// Translate the result into a string.
|
|
20265
|
-
var str = LEADER.repeat(zeroes);
|
|
20266
|
-
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
20267
|
-
return str
|
|
20268
|
-
}
|
|
20269
|
-
function decodeUnsafe (source) {
|
|
20270
|
-
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
20271
|
-
if (source.length === 0) { return _Buffer.alloc(0) }
|
|
20272
|
-
var psz = 0;
|
|
20273
|
-
// Skip and count leading '1's.
|
|
20274
|
-
var zeroes = 0;
|
|
20275
|
-
var length = 0;
|
|
20276
|
-
while (source[psz] === LEADER) {
|
|
20277
|
-
zeroes++;
|
|
20278
|
-
psz++;
|
|
20279
|
-
}
|
|
20280
|
-
// Allocate enough space in big-endian base256 representation.
|
|
20281
|
-
var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
20282
|
-
var b256 = new Uint8Array(size);
|
|
20283
|
-
// Process the characters.
|
|
20284
|
-
while (psz < source.length) {
|
|
20285
|
-
// Find code of next character
|
|
20286
|
-
var charCode = source.charCodeAt(psz);
|
|
20287
|
-
// Base map can not be indexed using char code
|
|
20288
|
-
if (charCode > 255) { return }
|
|
20289
|
-
// Decode character
|
|
20290
|
-
var carry = BASE_MAP[charCode];
|
|
20291
|
-
// Invalid character
|
|
20292
|
-
if (carry === 255) { return }
|
|
20293
|
-
var i = 0;
|
|
20294
|
-
for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
20295
|
-
carry += (BASE * b256[it3]) >>> 0;
|
|
20296
|
-
b256[it3] = (carry % 256) >>> 0;
|
|
20297
|
-
carry = (carry / 256) >>> 0;
|
|
20298
|
-
}
|
|
20299
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20300
|
-
length = i;
|
|
20301
|
-
psz++;
|
|
20302
|
-
}
|
|
20303
|
-
// Skip leading zeroes in b256.
|
|
20304
|
-
var it4 = size - length;
|
|
20305
|
-
while (it4 !== size && b256[it4] === 0) {
|
|
20306
|
-
it4++;
|
|
20307
|
-
}
|
|
20308
|
-
var vch = _Buffer.allocUnsafe(zeroes + (size - it4));
|
|
20309
|
-
vch.fill(0x00, 0, zeroes);
|
|
20310
|
-
var j = zeroes;
|
|
20311
|
-
while (it4 !== size) {
|
|
20312
|
-
vch[j++] = b256[it4++];
|
|
20313
|
-
}
|
|
20314
|
-
return vch
|
|
20315
|
-
}
|
|
20316
|
-
function decode (string) {
|
|
20317
|
-
var buffer = decodeUnsafe(string);
|
|
20318
|
-
if (buffer) { return buffer }
|
|
20319
|
-
throw new Error('Non-base' + BASE + ' character')
|
|
20320
|
-
}
|
|
20321
|
-
return {
|
|
20322
|
-
encode: encode,
|
|
20323
|
-
decodeUnsafe: decodeUnsafe,
|
|
20324
|
-
decode: decode
|
|
20325
|
-
}
|
|
20326
|
-
}
|
|
20327
|
-
src = base;
|
|
20328
|
-
return src;
|
|
20329
|
-
}
|
|
20330
|
-
|
|
20331
|
-
var bs58$1;
|
|
20332
|
-
var hasRequiredBs58;
|
|
20333
|
-
|
|
20334
|
-
function requireBs58 () {
|
|
20335
|
-
if (hasRequiredBs58) return bs58$1;
|
|
20336
|
-
hasRequiredBs58 = 1;
|
|
20337
|
-
var basex = requireSrc();
|
|
20338
|
-
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
20339
|
-
|
|
20340
|
-
bs58$1 = basex(ALPHABET);
|
|
20341
|
-
return bs58$1;
|
|
20150
|
+
// base-x encoding / decoding
|
|
20151
|
+
// Copyright (c) 2018 base-x contributors
|
|
20152
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
20153
|
+
// Distributed under the MIT software license, see the accompanying
|
|
20154
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
20155
|
+
function base (ALPHABET) {
|
|
20156
|
+
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
20157
|
+
const BASE_MAP = new Uint8Array(256);
|
|
20158
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
20159
|
+
BASE_MAP[j] = 255;
|
|
20160
|
+
}
|
|
20161
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
20162
|
+
const x = ALPHABET.charAt(i);
|
|
20163
|
+
const xc = x.charCodeAt(0);
|
|
20164
|
+
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
|
20165
|
+
BASE_MAP[xc] = i;
|
|
20166
|
+
}
|
|
20167
|
+
const BASE = ALPHABET.length;
|
|
20168
|
+
const LEADER = ALPHABET.charAt(0);
|
|
20169
|
+
const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
|
|
20170
|
+
const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
|
|
20171
|
+
function encode (source) {
|
|
20172
|
+
// eslint-disable-next-line no-empty
|
|
20173
|
+
if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
|
|
20174
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
20175
|
+
} else if (Array.isArray(source)) {
|
|
20176
|
+
source = Uint8Array.from(source);
|
|
20177
|
+
}
|
|
20178
|
+
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
|
20179
|
+
if (source.length === 0) { return '' }
|
|
20180
|
+
// Skip & count leading zeroes.
|
|
20181
|
+
let zeroes = 0;
|
|
20182
|
+
let length = 0;
|
|
20183
|
+
let pbegin = 0;
|
|
20184
|
+
const pend = source.length;
|
|
20185
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
20186
|
+
pbegin++;
|
|
20187
|
+
zeroes++;
|
|
20188
|
+
}
|
|
20189
|
+
// Allocate enough space in big-endian base58 representation.
|
|
20190
|
+
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
|
|
20191
|
+
const b58 = new Uint8Array(size);
|
|
20192
|
+
// Process the bytes.
|
|
20193
|
+
while (pbegin !== pend) {
|
|
20194
|
+
let carry = source[pbegin];
|
|
20195
|
+
// Apply "b58 = b58 * 256 + ch".
|
|
20196
|
+
let i = 0;
|
|
20197
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
20198
|
+
carry += (256 * b58[it1]) >>> 0;
|
|
20199
|
+
b58[it1] = (carry % BASE) >>> 0;
|
|
20200
|
+
carry = (carry / BASE) >>> 0;
|
|
20201
|
+
}
|
|
20202
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20203
|
+
length = i;
|
|
20204
|
+
pbegin++;
|
|
20205
|
+
}
|
|
20206
|
+
// Skip leading zeroes in base58 result.
|
|
20207
|
+
let it2 = size - length;
|
|
20208
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
20209
|
+
it2++;
|
|
20210
|
+
}
|
|
20211
|
+
// Translate the result into a string.
|
|
20212
|
+
let str = LEADER.repeat(zeroes);
|
|
20213
|
+
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
20214
|
+
return str
|
|
20215
|
+
}
|
|
20216
|
+
function decodeUnsafe (source) {
|
|
20217
|
+
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
20218
|
+
if (source.length === 0) { return new Uint8Array() }
|
|
20219
|
+
let psz = 0;
|
|
20220
|
+
// Skip and count leading '1's.
|
|
20221
|
+
let zeroes = 0;
|
|
20222
|
+
let length = 0;
|
|
20223
|
+
while (source[psz] === LEADER) {
|
|
20224
|
+
zeroes++;
|
|
20225
|
+
psz++;
|
|
20226
|
+
}
|
|
20227
|
+
// Allocate enough space in big-endian base256 representation.
|
|
20228
|
+
const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
20229
|
+
const b256 = new Uint8Array(size);
|
|
20230
|
+
// Process the characters.
|
|
20231
|
+
while (psz < source.length) {
|
|
20232
|
+
// Find code of next character
|
|
20233
|
+
const charCode = source.charCodeAt(psz);
|
|
20234
|
+
// Base map can not be indexed using char code
|
|
20235
|
+
if (charCode > 255) { return }
|
|
20236
|
+
// Decode character
|
|
20237
|
+
let carry = BASE_MAP[charCode];
|
|
20238
|
+
// Invalid character
|
|
20239
|
+
if (carry === 255) { return }
|
|
20240
|
+
let i = 0;
|
|
20241
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
20242
|
+
carry += (BASE * b256[it3]) >>> 0;
|
|
20243
|
+
b256[it3] = (carry % 256) >>> 0;
|
|
20244
|
+
carry = (carry / 256) >>> 0;
|
|
20245
|
+
}
|
|
20246
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20247
|
+
length = i;
|
|
20248
|
+
psz++;
|
|
20249
|
+
}
|
|
20250
|
+
// Skip leading zeroes in b256.
|
|
20251
|
+
let it4 = size - length;
|
|
20252
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
20253
|
+
it4++;
|
|
20254
|
+
}
|
|
20255
|
+
const vch = new Uint8Array(zeroes + (size - it4));
|
|
20256
|
+
let j = zeroes;
|
|
20257
|
+
while (it4 !== size) {
|
|
20258
|
+
vch[j++] = b256[it4++];
|
|
20259
|
+
}
|
|
20260
|
+
return vch
|
|
20261
|
+
}
|
|
20262
|
+
function decode (string) {
|
|
20263
|
+
const buffer = decodeUnsafe(string);
|
|
20264
|
+
if (buffer) { return buffer }
|
|
20265
|
+
throw new Error('Non-base' + BASE + ' character')
|
|
20266
|
+
}
|
|
20267
|
+
return {
|
|
20268
|
+
encode,
|
|
20269
|
+
decodeUnsafe,
|
|
20270
|
+
decode
|
|
20271
|
+
}
|
|
20342
20272
|
}
|
|
20343
20273
|
|
|
20344
|
-
var
|
|
20345
|
-
var
|
|
20274
|
+
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
20275
|
+
var base58 = base(ALPHABET);
|
|
20346
20276
|
|
|
20347
|
-
var index = /*#__PURE__*/
|
|
20277
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
20348
20278
|
__proto__: null,
|
|
20349
|
-
default:
|
|
20350
|
-
}
|
|
20279
|
+
default: base58
|
|
20280
|
+
});
|
|
20351
20281
|
|
|
20352
20282
|
const SURFNET_RPC_URL$1 = "https://surfpool.fly.dev";
|
|
20353
20283
|
let React;
|
|
@@ -21081,7 +21011,7 @@ class PrivyWalletProvider {
|
|
|
21081
21011
|
// Handle case where signature might be bytes instead of string
|
|
21082
21012
|
const rawSig = result.signature;
|
|
21083
21013
|
if (rawSig instanceof Uint8Array || Array.isArray(rawSig)) {
|
|
21084
|
-
signature =
|
|
21014
|
+
signature = base58.encode(rawSig instanceof Uint8Array ? rawSig : new Uint8Array(rawSig));
|
|
21085
21015
|
}
|
|
21086
21016
|
else {
|
|
21087
21017
|
signature = rawSig;
|
|
@@ -21261,7 +21191,7 @@ async function loadMwaProtocol() {
|
|
|
21261
21191
|
return mwaProtocolLoadPromise;
|
|
21262
21192
|
mwaProtocolLoadPromise = (async () => {
|
|
21263
21193
|
try {
|
|
21264
|
-
mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-
|
|
21194
|
+
mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-DEfS865o.js'); });
|
|
21265
21195
|
}
|
|
21266
21196
|
catch (e) {
|
|
21267
21197
|
console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
|
|
@@ -21283,7 +21213,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
21283
21213
|
if (typeof window === 'undefined')
|
|
21284
21214
|
return;
|
|
21285
21215
|
try {
|
|
21286
|
-
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-
|
|
21216
|
+
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-DQvFxLjk.js'); });
|
|
21287
21217
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
21288
21218
|
if (!registerMwa) {
|
|
21289
21219
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -21413,6 +21343,19 @@ class SolanaMobileWalletProvider {
|
|
|
21413
21343
|
async login() {
|
|
21414
21344
|
var _a, _b, _c, _d, _e;
|
|
21415
21345
|
setAuthLoading(true);
|
|
21346
|
+
// Mark the auth method early so a concurrent Phantom auto-create can see
|
|
21347
|
+
// 'mobile-wallet-adapter' during our slow transact() / session-creation
|
|
21348
|
+
// roundtrip and back off (see phantom-wallet-provider autoCreateSession).
|
|
21349
|
+
// Capture the previous value so we can restore it if login fails.
|
|
21350
|
+
let prevAuthMethod = null;
|
|
21351
|
+
try {
|
|
21352
|
+
prevAuthMethod = getPlatform().storage.getItem('tarobase_last_auth_method');
|
|
21353
|
+
}
|
|
21354
|
+
catch (_f) { }
|
|
21355
|
+
try {
|
|
21356
|
+
getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');
|
|
21357
|
+
}
|
|
21358
|
+
catch (_g) { }
|
|
21416
21359
|
try {
|
|
21417
21360
|
await loadMwaProtocol();
|
|
21418
21361
|
const { transact } = mwaProtocolModule;
|
|
@@ -21478,12 +21421,22 @@ class SolanaMobileWalletProvider {
|
|
|
21478
21421
|
try {
|
|
21479
21422
|
getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');
|
|
21480
21423
|
}
|
|
21481
|
-
catch (
|
|
21424
|
+
catch (_h) { }
|
|
21482
21425
|
const user = { provider: this, address: result.base58Address };
|
|
21483
21426
|
setCurrentUser(user);
|
|
21484
21427
|
return user;
|
|
21485
21428
|
}
|
|
21486
21429
|
catch (error) {
|
|
21430
|
+
// Restore the previous auth method since this login attempt failed.
|
|
21431
|
+
try {
|
|
21432
|
+
if (prevAuthMethod === null) {
|
|
21433
|
+
getPlatform().storage.removeItem('tarobase_last_auth_method');
|
|
21434
|
+
}
|
|
21435
|
+
else {
|
|
21436
|
+
getPlatform().storage.setItem('tarobase_last_auth_method', prevAuthMethod);
|
|
21437
|
+
}
|
|
21438
|
+
}
|
|
21439
|
+
catch (_j) { }
|
|
21487
21440
|
const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||
|
|
21488
21441
|
((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('user rejected')) ||
|
|
21489
21442
|
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('user denied')) ||
|
|
@@ -21529,6 +21482,12 @@ class SolanaMobileWalletProvider {
|
|
|
21529
21482
|
this.authorizedPublicKey = null;
|
|
21530
21483
|
this.publicKeyObj = null;
|
|
21531
21484
|
WebSessionManager.clearSession();
|
|
21485
|
+
// Clear the auth-method marker so Phantom auto-create is unblocked
|
|
21486
|
+
// for any subsequent fresh login on this device.
|
|
21487
|
+
try {
|
|
21488
|
+
getPlatform().storage.removeItem('tarobase_last_auth_method');
|
|
21489
|
+
}
|
|
21490
|
+
catch (_a) { }
|
|
21532
21491
|
setCurrentUser(null);
|
|
21533
21492
|
}
|
|
21534
21493
|
async signMessage(message) {
|
|
@@ -22036,7 +21995,7 @@ class PrivyExpoProvider {
|
|
|
22036
21995
|
const wallet = await this.getWalletOrThrow();
|
|
22037
21996
|
const messageBytes = getPlatform().textEncode(message);
|
|
22038
21997
|
const result = await wallet.signMessage(messageBytes);
|
|
22039
|
-
return
|
|
21998
|
+
return base58.encode(result.signature);
|
|
22040
21999
|
}
|
|
22041
22000
|
async signTransaction(transaction) {
|
|
22042
22001
|
await this.ensureReady();
|
|
@@ -22203,11 +22162,11 @@ exports.ServerSessionManager = ServerSessionManager;
|
|
|
22203
22162
|
exports.SolanaMobileWalletProvider = SolanaMobileWalletProvider;
|
|
22204
22163
|
exports.WebSessionManager = WebSessionManager;
|
|
22205
22164
|
exports.aggregate = aggregate;
|
|
22165
|
+
exports.base58 = base58;
|
|
22206
22166
|
exports.bufferExports = bufferExports;
|
|
22207
22167
|
exports.buildSetDocumentsTransaction = buildSetDocumentsTransaction;
|
|
22208
22168
|
exports.clearCache = clearCache;
|
|
22209
22169
|
exports.closeAllSubscriptions = closeAllSubscriptions;
|
|
22210
|
-
exports.commonjsRequire = commonjsRequire;
|
|
22211
22170
|
exports.convertRemainingAccounts = convertRemainingAccounts;
|
|
22212
22171
|
exports.count = count;
|
|
22213
22172
|
exports.createSessionWithPrivy = createSessionWithPrivy;
|
|
@@ -22235,7 +22194,6 @@ exports.onAuthStateChanged = onAuthStateChanged;
|
|
|
22235
22194
|
exports.reconnectWithNewAuth = reconnectWithNewAuth;
|
|
22236
22195
|
exports.refreshSession = refreshSession;
|
|
22237
22196
|
exports.registerMobileWalletAdapter = registerMobileWalletAdapter;
|
|
22238
|
-
exports.require$$0 = require$$0;
|
|
22239
22197
|
exports.runExpression = runExpression;
|
|
22240
22198
|
exports.runExpressionMany = runExpressionMany;
|
|
22241
22199
|
exports.runQuery = runQuery;
|
|
@@ -22250,4 +22208,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
|
22250
22208
|
exports.signTransaction = signTransaction;
|
|
22251
22209
|
exports.subscribe = subscribe;
|
|
22252
22210
|
exports.useAuth = useAuth;
|
|
22253
|
-
//# sourceMappingURL=index-
|
|
22211
|
+
//# sourceMappingURL=index-HSa4FZ9y.js.map
|