@pooflabs/web 0.0.82 → 0.0.83-rc1
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-DlKo76M3.js → index-2qSlZ-n6.js} +7859 -11121
- package/dist/index-2qSlZ-n6.js.map +1 -0
- package/dist/{index-Ci3m3diI.js → index-BAz5F9Qr.js} +7858 -11120
- package/dist/index-BAz5F9Qr.js.map +1 -0
- package/dist/index-Bdcc5821.js +2375 -0
- package/dist/index-Bdcc5821.js.map +1 -0
- package/dist/{index-DWf2AOhe.esm.js → index-BpjqfeKL.esm.js} +7859 -11120
- package/dist/index-BpjqfeKL.esm.js.map +1 -0
- package/dist/{index-BicMkamC.js → index-CYhzBf0k.js} +270 -324
- package/dist/index-CYhzBf0k.js.map +1 -0
- package/dist/index-CrOVJFX9.esm.js +2373 -0
- package/dist/index-CrOVJFX9.esm.js.map +1 -0
- package/dist/{index-CK_2Zn89.esm.js → index-DOfXgVkn.esm.js} +7858 -11121
- package/dist/index-DOfXgVkn.esm.js.map +1 -0
- package/dist/{index-BsY_Lgiu.esm.js → index-DiSZgxvm.esm.js} +270 -323
- package/dist/index-DiSZgxvm.esm.js.map +1 -0
- package/dist/{index.browser-BkMiHSON.js → index.browser-BgibQtKi.js} +1571 -1368
- package/dist/index.browser-BgibQtKi.js.map +1 -0
- package/dist/{index.browser-DCOvqSUT.esm.js → index.browser-BlQ9w7lf.esm.js} +1571 -1368
- package/dist/index.browser-BlQ9w7lf.esm.js.map +1 -0
- package/dist/index.browser-CDhaFhaH.js +1099 -0
- package/dist/index.browser-CDhaFhaH.js.map +1 -0
- package/dist/index.browser-DVn6ApJy.esm.js +102 -0
- package/dist/index.browser-DVn6ApJy.esm.js.map +1 -0
- package/dist/index.browser-I9UnPFqe.esm.js +1096 -0
- package/dist/index.browser-I9UnPFqe.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-XpeHKCJM.js +105 -0
- package/dist/index.browser-XpeHKCJM.js.map +1 -0
- package/dist/index.browser-vuTr40so.js +1008 -0
- package/dist/index.browser-vuTr40so.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-CbNEYkFa.esm.js} +250 -2720
- package/dist/index.native-CbNEYkFa.esm.js.map +1 -0
- package/dist/{index.native-11supFRU.js → index.native-lubRe8nA.js} +250 -2723
- package/dist/index.native-lubRe8nA.js.map +1 -0
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +1 -1
- package/dist/{phantom-wallet-provider-Xb070-O6.js → phantom-wallet-provider-CfJti5dZ.js} +24 -5
- package/dist/phantom-wallet-provider-CfJti5dZ.js.map +1 -0
- package/dist/{phantom-wallet-provider-BN47klTp.esm.js → phantom-wallet-provider-YH1gySq_.esm.js} +24 -5
- package/dist/phantom-wallet-provider-YH1gySq_.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-DUJS5viU.esm.js → privy-wallet-provider-Bt7Jk-TE.esm.js} +4 -4
- package/dist/privy-wallet-provider-Bt7Jk-TE.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-Ch22rj_G.js → privy-wallet-provider-CeH9zTfE.js} +4 -4
- package/dist/privy-wallet-provider-CeH9zTfE.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-BXm94fqW.js → solana-mobile-wallet-provider-4PG6JNmJ.js} +34 -5
- package/dist/solana-mobile-wallet-provider-4PG6JNmJ.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-BF04Xp8P.esm.js → solana-mobile-wallet-provider-BtM0Saad.esm.js} +34 -5
- package/dist/solana-mobile-wallet-provider-BtM0Saad.esm.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-BAz5F9Qr.js'); })
|
|
15705
15702
|
]);
|
|
15706
15703
|
// Extract default export from ESM module namespace
|
|
15707
15704
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -15895,6 +15892,16 @@ class PhantomWalletProvider {
|
|
|
15895
15892
|
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
15893
|
return;
|
|
15897
15894
|
}
|
|
15895
|
+
// Don't clobber a session owned by MWA on Seeker. MWA marks the
|
|
15896
|
+
// auth method as soon as login starts (see solana-mobile-wallet-provider),
|
|
15897
|
+
// and clears it on logout, so this guard is correct in both
|
|
15898
|
+
// steady-state and post-logout cases.
|
|
15899
|
+
try {
|
|
15900
|
+
if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'mobile-wallet-adapter') {
|
|
15901
|
+
return;
|
|
15902
|
+
}
|
|
15903
|
+
}
|
|
15904
|
+
catch (_b) { }
|
|
15898
15905
|
// Need solana to be available AND connected for signing
|
|
15899
15906
|
if (!solana || !solanaHook.isAvailable || !solana.connected) {
|
|
15900
15907
|
return;
|
|
@@ -15924,12 +15931,21 @@ class PhantomWalletProvider {
|
|
|
15924
15931
|
const signatureBytes = signResult.signature;
|
|
15925
15932
|
const signature = bufferExports.Buffer.from(signatureBytes).toString('base64');
|
|
15926
15933
|
const createSessionResult = await createSessionWithSignature(publicKey, messageText, signature);
|
|
15934
|
+
// Pre-write guard: MWA may have started a login while we were
|
|
15935
|
+
// in flight. If MWA owns the auth method now, abort before we
|
|
15936
|
+
// overwrite its session (or its in-flight session).
|
|
15937
|
+
try {
|
|
15938
|
+
if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'mobile-wallet-adapter') {
|
|
15939
|
+
return;
|
|
15940
|
+
}
|
|
15941
|
+
}
|
|
15942
|
+
catch (_c) { }
|
|
15927
15943
|
await WebSessionManager.storeSession(publicKey, createSessionResult.accessToken, createSessionResult.idToken, createSessionResult.refreshToken);
|
|
15928
15944
|
// Mark auth method so clearIncompatibleSession() doesn't wipe this session
|
|
15929
15945
|
try {
|
|
15930
15946
|
getPlatform().storage.setItem('tarobase_last_auth_method', 'phantom');
|
|
15931
15947
|
}
|
|
15932
|
-
catch (
|
|
15948
|
+
catch (_d) { }
|
|
15933
15949
|
setCurrentUser({ provider: that, address: publicKey });
|
|
15934
15950
|
}
|
|
15935
15951
|
catch (error) {
|
|
@@ -20119,235 +20135,137 @@ function createSolanaRpcSubscriptionsFromTransport(transport) {
|
|
|
20119
20135
|
});
|
|
20120
20136
|
}
|
|
20121
20137
|
|
|
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;
|
|
20138
|
+
// base-x encoding / decoding
|
|
20139
|
+
// Copyright (c) 2018 base-x contributors
|
|
20140
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
20141
|
+
// Distributed under the MIT software license, see the accompanying
|
|
20142
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
20143
|
+
function base (ALPHABET) {
|
|
20144
|
+
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
20145
|
+
const BASE_MAP = new Uint8Array(256);
|
|
20146
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
20147
|
+
BASE_MAP[j] = 255;
|
|
20148
|
+
}
|
|
20149
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
20150
|
+
const x = ALPHABET.charAt(i);
|
|
20151
|
+
const xc = x.charCodeAt(0);
|
|
20152
|
+
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
|
20153
|
+
BASE_MAP[xc] = i;
|
|
20154
|
+
}
|
|
20155
|
+
const BASE = ALPHABET.length;
|
|
20156
|
+
const LEADER = ALPHABET.charAt(0);
|
|
20157
|
+
const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
|
|
20158
|
+
const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
|
|
20159
|
+
function encode (source) {
|
|
20160
|
+
// eslint-disable-next-line no-empty
|
|
20161
|
+
if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
|
|
20162
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
20163
|
+
} else if (Array.isArray(source)) {
|
|
20164
|
+
source = Uint8Array.from(source);
|
|
20165
|
+
}
|
|
20166
|
+
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
|
20167
|
+
if (source.length === 0) { return '' }
|
|
20168
|
+
// Skip & count leading zeroes.
|
|
20169
|
+
let zeroes = 0;
|
|
20170
|
+
let length = 0;
|
|
20171
|
+
let pbegin = 0;
|
|
20172
|
+
const pend = source.length;
|
|
20173
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
20174
|
+
pbegin++;
|
|
20175
|
+
zeroes++;
|
|
20176
|
+
}
|
|
20177
|
+
// Allocate enough space in big-endian base58 representation.
|
|
20178
|
+
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
|
|
20179
|
+
const b58 = new Uint8Array(size);
|
|
20180
|
+
// Process the bytes.
|
|
20181
|
+
while (pbegin !== pend) {
|
|
20182
|
+
let carry = source[pbegin];
|
|
20183
|
+
// Apply "b58 = b58 * 256 + ch".
|
|
20184
|
+
let i = 0;
|
|
20185
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
20186
|
+
carry += (256 * b58[it1]) >>> 0;
|
|
20187
|
+
b58[it1] = (carry % BASE) >>> 0;
|
|
20188
|
+
carry = (carry / BASE) >>> 0;
|
|
20189
|
+
}
|
|
20190
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20191
|
+
length = i;
|
|
20192
|
+
pbegin++;
|
|
20193
|
+
}
|
|
20194
|
+
// Skip leading zeroes in base58 result.
|
|
20195
|
+
let it2 = size - length;
|
|
20196
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
20197
|
+
it2++;
|
|
20198
|
+
}
|
|
20199
|
+
// Translate the result into a string.
|
|
20200
|
+
let str = LEADER.repeat(zeroes);
|
|
20201
|
+
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
20202
|
+
return str
|
|
20203
|
+
}
|
|
20204
|
+
function decodeUnsafe (source) {
|
|
20205
|
+
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
20206
|
+
if (source.length === 0) { return new Uint8Array() }
|
|
20207
|
+
let psz = 0;
|
|
20208
|
+
// Skip and count leading '1's.
|
|
20209
|
+
let zeroes = 0;
|
|
20210
|
+
let length = 0;
|
|
20211
|
+
while (source[psz] === LEADER) {
|
|
20212
|
+
zeroes++;
|
|
20213
|
+
psz++;
|
|
20214
|
+
}
|
|
20215
|
+
// Allocate enough space in big-endian base256 representation.
|
|
20216
|
+
const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
20217
|
+
const b256 = new Uint8Array(size);
|
|
20218
|
+
// Process the characters.
|
|
20219
|
+
while (psz < source.length) {
|
|
20220
|
+
// Find code of next character
|
|
20221
|
+
const charCode = source.charCodeAt(psz);
|
|
20222
|
+
// Base map can not be indexed using char code
|
|
20223
|
+
if (charCode > 255) { return }
|
|
20224
|
+
// Decode character
|
|
20225
|
+
let carry = BASE_MAP[charCode];
|
|
20226
|
+
// Invalid character
|
|
20227
|
+
if (carry === 255) { return }
|
|
20228
|
+
let i = 0;
|
|
20229
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
20230
|
+
carry += (BASE * b256[it3]) >>> 0;
|
|
20231
|
+
b256[it3] = (carry % 256) >>> 0;
|
|
20232
|
+
carry = (carry / 256) >>> 0;
|
|
20233
|
+
}
|
|
20234
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20235
|
+
length = i;
|
|
20236
|
+
psz++;
|
|
20237
|
+
}
|
|
20238
|
+
// Skip leading zeroes in b256.
|
|
20239
|
+
let it4 = size - length;
|
|
20240
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
20241
|
+
it4++;
|
|
20242
|
+
}
|
|
20243
|
+
const vch = new Uint8Array(zeroes + (size - it4));
|
|
20244
|
+
let j = zeroes;
|
|
20245
|
+
while (it4 !== size) {
|
|
20246
|
+
vch[j++] = b256[it4++];
|
|
20247
|
+
}
|
|
20248
|
+
return vch
|
|
20249
|
+
}
|
|
20250
|
+
function decode (string) {
|
|
20251
|
+
const buffer = decodeUnsafe(string);
|
|
20252
|
+
if (buffer) { return buffer }
|
|
20253
|
+
throw new Error('Non-base' + BASE + ' character')
|
|
20254
|
+
}
|
|
20255
|
+
return {
|
|
20256
|
+
encode,
|
|
20257
|
+
decodeUnsafe,
|
|
20258
|
+
decode
|
|
20259
|
+
}
|
|
20342
20260
|
}
|
|
20343
20261
|
|
|
20344
|
-
var
|
|
20345
|
-
var
|
|
20262
|
+
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
20263
|
+
var base58 = base(ALPHABET);
|
|
20346
20264
|
|
|
20347
|
-
var index = /*#__PURE__*/
|
|
20265
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
20348
20266
|
__proto__: null,
|
|
20349
|
-
default:
|
|
20350
|
-
}
|
|
20267
|
+
default: base58
|
|
20268
|
+
});
|
|
20351
20269
|
|
|
20352
20270
|
const SURFNET_RPC_URL$1 = "https://surfpool.fly.dev";
|
|
20353
20271
|
let React;
|
|
@@ -21081,7 +20999,7 @@ class PrivyWalletProvider {
|
|
|
21081
20999
|
// Handle case where signature might be bytes instead of string
|
|
21082
21000
|
const rawSig = result.signature;
|
|
21083
21001
|
if (rawSig instanceof Uint8Array || Array.isArray(rawSig)) {
|
|
21084
|
-
signature =
|
|
21002
|
+
signature = base58.encode(rawSig instanceof Uint8Array ? rawSig : new Uint8Array(rawSig));
|
|
21085
21003
|
}
|
|
21086
21004
|
else {
|
|
21087
21005
|
signature = rawSig;
|
|
@@ -21261,7 +21179,7 @@ async function loadMwaProtocol() {
|
|
|
21261
21179
|
return mwaProtocolLoadPromise;
|
|
21262
21180
|
mwaProtocolLoadPromise = (async () => {
|
|
21263
21181
|
try {
|
|
21264
|
-
mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-
|
|
21182
|
+
mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-XpeHKCJM.js'); });
|
|
21265
21183
|
}
|
|
21266
21184
|
catch (e) {
|
|
21267
21185
|
console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
|
|
@@ -21283,7 +21201,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
21283
21201
|
if (typeof window === 'undefined')
|
|
21284
21202
|
return;
|
|
21285
21203
|
try {
|
|
21286
|
-
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-
|
|
21204
|
+
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-BgibQtKi.js'); });
|
|
21287
21205
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
21288
21206
|
if (!registerMwa) {
|
|
21289
21207
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -21413,6 +21331,19 @@ class SolanaMobileWalletProvider {
|
|
|
21413
21331
|
async login() {
|
|
21414
21332
|
var _a, _b, _c, _d, _e;
|
|
21415
21333
|
setAuthLoading(true);
|
|
21334
|
+
// Mark the auth method early so a concurrent Phantom auto-create can see
|
|
21335
|
+
// 'mobile-wallet-adapter' during our slow transact() / session-creation
|
|
21336
|
+
// roundtrip and back off (see phantom-wallet-provider autoCreateSession).
|
|
21337
|
+
// Capture the previous value so we can restore it if login fails.
|
|
21338
|
+
let prevAuthMethod = null;
|
|
21339
|
+
try {
|
|
21340
|
+
prevAuthMethod = getPlatform().storage.getItem('tarobase_last_auth_method');
|
|
21341
|
+
}
|
|
21342
|
+
catch (_f) { }
|
|
21343
|
+
try {
|
|
21344
|
+
getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');
|
|
21345
|
+
}
|
|
21346
|
+
catch (_g) { }
|
|
21416
21347
|
try {
|
|
21417
21348
|
await loadMwaProtocol();
|
|
21418
21349
|
const { transact } = mwaProtocolModule;
|
|
@@ -21478,12 +21409,22 @@ class SolanaMobileWalletProvider {
|
|
|
21478
21409
|
try {
|
|
21479
21410
|
getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');
|
|
21480
21411
|
}
|
|
21481
|
-
catch (
|
|
21412
|
+
catch (_h) { }
|
|
21482
21413
|
const user = { provider: this, address: result.base58Address };
|
|
21483
21414
|
setCurrentUser(user);
|
|
21484
21415
|
return user;
|
|
21485
21416
|
}
|
|
21486
21417
|
catch (error) {
|
|
21418
|
+
// Restore the previous auth method since this login attempt failed.
|
|
21419
|
+
try {
|
|
21420
|
+
if (prevAuthMethod === null) {
|
|
21421
|
+
getPlatform().storage.removeItem('tarobase_last_auth_method');
|
|
21422
|
+
}
|
|
21423
|
+
else {
|
|
21424
|
+
getPlatform().storage.setItem('tarobase_last_auth_method', prevAuthMethod);
|
|
21425
|
+
}
|
|
21426
|
+
}
|
|
21427
|
+
catch (_j) { }
|
|
21487
21428
|
const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||
|
|
21488
21429
|
((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('user rejected')) ||
|
|
21489
21430
|
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('user denied')) ||
|
|
@@ -21529,6 +21470,12 @@ class SolanaMobileWalletProvider {
|
|
|
21529
21470
|
this.authorizedPublicKey = null;
|
|
21530
21471
|
this.publicKeyObj = null;
|
|
21531
21472
|
WebSessionManager.clearSession();
|
|
21473
|
+
// Clear the auth-method marker so Phantom auto-create is unblocked
|
|
21474
|
+
// for any subsequent fresh login on this device.
|
|
21475
|
+
try {
|
|
21476
|
+
getPlatform().storage.removeItem('tarobase_last_auth_method');
|
|
21477
|
+
}
|
|
21478
|
+
catch (_a) { }
|
|
21532
21479
|
setCurrentUser(null);
|
|
21533
21480
|
}
|
|
21534
21481
|
async signMessage(message) {
|
|
@@ -22036,7 +21983,7 @@ class PrivyExpoProvider {
|
|
|
22036
21983
|
const wallet = await this.getWalletOrThrow();
|
|
22037
21984
|
const messageBytes = getPlatform().textEncode(message);
|
|
22038
21985
|
const result = await wallet.signMessage(messageBytes);
|
|
22039
|
-
return
|
|
21986
|
+
return base58.encode(result.signature);
|
|
22040
21987
|
}
|
|
22041
21988
|
async signTransaction(transaction) {
|
|
22042
21989
|
await this.ensureReady();
|
|
@@ -22203,11 +22150,11 @@ exports.ServerSessionManager = ServerSessionManager;
|
|
|
22203
22150
|
exports.SolanaMobileWalletProvider = SolanaMobileWalletProvider;
|
|
22204
22151
|
exports.WebSessionManager = WebSessionManager;
|
|
22205
22152
|
exports.aggregate = aggregate;
|
|
22153
|
+
exports.base58 = base58;
|
|
22206
22154
|
exports.bufferExports = bufferExports;
|
|
22207
22155
|
exports.buildSetDocumentsTransaction = buildSetDocumentsTransaction;
|
|
22208
22156
|
exports.clearCache = clearCache;
|
|
22209
22157
|
exports.closeAllSubscriptions = closeAllSubscriptions;
|
|
22210
|
-
exports.commonjsRequire = commonjsRequire;
|
|
22211
22158
|
exports.convertRemainingAccounts = convertRemainingAccounts;
|
|
22212
22159
|
exports.count = count;
|
|
22213
22160
|
exports.createSessionWithPrivy = createSessionWithPrivy;
|
|
@@ -22235,7 +22182,6 @@ exports.onAuthStateChanged = onAuthStateChanged;
|
|
|
22235
22182
|
exports.reconnectWithNewAuth = reconnectWithNewAuth;
|
|
22236
22183
|
exports.refreshSession = refreshSession;
|
|
22237
22184
|
exports.registerMobileWalletAdapter = registerMobileWalletAdapter;
|
|
22238
|
-
exports.require$$0 = require$$0;
|
|
22239
22185
|
exports.runExpression = runExpression;
|
|
22240
22186
|
exports.runExpressionMany = runExpressionMany;
|
|
22241
22187
|
exports.runQuery = runQuery;
|
|
@@ -22250,4 +22196,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
|
22250
22196
|
exports.signTransaction = signTransaction;
|
|
22251
22197
|
exports.subscribe = subscribe;
|
|
22252
22198
|
exports.useAuth = useAuth;
|
|
22253
|
-
//# sourceMappingURL=index-
|
|
22199
|
+
//# sourceMappingURL=index-CYhzBf0k.js.map
|