@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
|
@@ -4,21 +4,6 @@ import * as anchor from '@coral-xyz/anchor';
|
|
|
4
4
|
import { Program } from '@coral-xyz/anchor';
|
|
5
5
|
import * as React$2 from 'react';
|
|
6
6
|
|
|
7
|
-
function _mergeNamespaces(n, m) {
|
|
8
|
-
m.forEach(function (e) {
|
|
9
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
10
|
-
if (k !== 'default' && !(k in n)) {
|
|
11
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return e[k]; }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
return Object.freeze(n);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
7
|
function getDefaultExportFromCjs$1 (x) {
|
|
23
8
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
24
9
|
}
|
|
@@ -6764,6 +6749,28 @@ class WebSessionManager {
|
|
|
6764
6749
|
static async storeSession(address, accessToken, idToken, refreshToken) {
|
|
6765
6750
|
if (typeof window === "undefined")
|
|
6766
6751
|
return;
|
|
6752
|
+
// JWT-wallet binding: refuse to store a session whose idToken is bound
|
|
6753
|
+
// to a different wallet than `address`. Prevents races that would otherwise
|
|
6754
|
+
// leave localStorage with mismatched address/token state.
|
|
6755
|
+
try {
|
|
6756
|
+
const payloadB64 = idToken.split(".")[1];
|
|
6757
|
+
if (payloadB64) {
|
|
6758
|
+
const payload = JSON.parse(this.decodeBase64Url(payloadB64));
|
|
6759
|
+
const tokenWallet = payload["custom:walletAddress"];
|
|
6760
|
+
if (tokenWallet && tokenWallet !== address) {
|
|
6761
|
+
throw new Error(`[WebSessionManager] Refusing to store session: address (${address}) does not match idToken custom:walletAddress (${tokenWallet})`);
|
|
6762
|
+
}
|
|
6763
|
+
if (!tokenWallet) {
|
|
6764
|
+
console.warn("[WebSessionManager] storeSession: idToken has no custom:walletAddress claim — writing without validation");
|
|
6765
|
+
}
|
|
6766
|
+
}
|
|
6767
|
+
}
|
|
6768
|
+
catch (err) {
|
|
6769
|
+
if (typeof (err === null || err === void 0 ? void 0 : err.message) === "string" && err.message.includes("Refusing to store session")) {
|
|
6770
|
+
throw err;
|
|
6771
|
+
}
|
|
6772
|
+
console.warn("[WebSessionManager] storeSession: failed to decode idToken for validation:", err);
|
|
6773
|
+
}
|
|
6767
6774
|
const config = await getConfig();
|
|
6768
6775
|
const currentAppId = config.appId;
|
|
6769
6776
|
localStorage.setItem(this.TAROBASE_SESSION_STORAGE_KEY, JSON.stringify({
|
|
@@ -9252,15 +9259,15 @@ function requireBuffer$1 () {
|
|
|
9252
9259
|
|
|
9253
9260
|
var bufferExports$1 = requireBuffer$1();
|
|
9254
9261
|
|
|
9255
|
-
var safeBuffer
|
|
9262
|
+
var safeBuffer = {exports: {}};
|
|
9256
9263
|
|
|
9257
9264
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
9258
9265
|
|
|
9259
|
-
var hasRequiredSafeBuffer
|
|
9266
|
+
var hasRequiredSafeBuffer;
|
|
9260
9267
|
|
|
9261
|
-
function requireSafeBuffer
|
|
9262
|
-
if (hasRequiredSafeBuffer
|
|
9263
|
-
hasRequiredSafeBuffer
|
|
9268
|
+
function requireSafeBuffer () {
|
|
9269
|
+
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
9270
|
+
hasRequiredSafeBuffer = 1;
|
|
9264
9271
|
(function (module, exports$1) {
|
|
9265
9272
|
/* eslint-disable node/no-deprecated-api */
|
|
9266
9273
|
var buffer = requireBuffer$1();
|
|
@@ -9326,23 +9333,23 @@ function requireSafeBuffer$1 () {
|
|
|
9326
9333
|
}
|
|
9327
9334
|
return buffer.SlowBuffer(size)
|
|
9328
9335
|
};
|
|
9329
|
-
} (safeBuffer
|
|
9330
|
-
return safeBuffer
|
|
9336
|
+
} (safeBuffer, safeBuffer.exports));
|
|
9337
|
+
return safeBuffer.exports;
|
|
9331
9338
|
}
|
|
9332
9339
|
|
|
9333
|
-
var src
|
|
9334
|
-
var hasRequiredSrc
|
|
9340
|
+
var src;
|
|
9341
|
+
var hasRequiredSrc;
|
|
9335
9342
|
|
|
9336
|
-
function requireSrc
|
|
9337
|
-
if (hasRequiredSrc
|
|
9338
|
-
hasRequiredSrc
|
|
9343
|
+
function requireSrc () {
|
|
9344
|
+
if (hasRequiredSrc) return src;
|
|
9345
|
+
hasRequiredSrc = 1;
|
|
9339
9346
|
// base-x encoding / decoding
|
|
9340
9347
|
// Copyright (c) 2018 base-x contributors
|
|
9341
9348
|
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
9342
9349
|
// Distributed under the MIT software license, see the accompanying
|
|
9343
9350
|
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
9344
9351
|
// @ts-ignore
|
|
9345
|
-
var _Buffer = requireSafeBuffer
|
|
9352
|
+
var _Buffer = requireSafeBuffer().Buffer;
|
|
9346
9353
|
function base (ALPHABET) {
|
|
9347
9354
|
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
9348
9355
|
var BASE_MAP = new Uint8Array(256);
|
|
@@ -9457,25 +9464,25 @@ function requireSrc$1 () {
|
|
|
9457
9464
|
decode: decode
|
|
9458
9465
|
}
|
|
9459
9466
|
}
|
|
9460
|
-
src
|
|
9461
|
-
return src
|
|
9467
|
+
src = base;
|
|
9468
|
+
return src;
|
|
9462
9469
|
}
|
|
9463
9470
|
|
|
9464
|
-
var bs58$1
|
|
9465
|
-
var hasRequiredBs58
|
|
9471
|
+
var bs58$1;
|
|
9472
|
+
var hasRequiredBs58;
|
|
9466
9473
|
|
|
9467
|
-
function requireBs58
|
|
9468
|
-
if (hasRequiredBs58
|
|
9469
|
-
hasRequiredBs58
|
|
9470
|
-
var basex = requireSrc
|
|
9474
|
+
function requireBs58 () {
|
|
9475
|
+
if (hasRequiredBs58) return bs58$1;
|
|
9476
|
+
hasRequiredBs58 = 1;
|
|
9477
|
+
var basex = requireSrc();
|
|
9471
9478
|
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
9472
9479
|
|
|
9473
|
-
bs58$1
|
|
9474
|
-
return bs58$1
|
|
9480
|
+
bs58$1 = basex(ALPHABET);
|
|
9481
|
+
return bs58$1;
|
|
9475
9482
|
}
|
|
9476
9483
|
|
|
9477
|
-
var bs58Exports
|
|
9478
|
-
var bs58
|
|
9484
|
+
var bs58Exports = requireBs58();
|
|
9485
|
+
var bs58 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports);
|
|
9479
9486
|
|
|
9480
9487
|
// ─────────────────────────────────────────────────────────────
|
|
9481
9488
|
// Local implementation of getSimulationComputeUnits
|
|
@@ -9554,12 +9561,6 @@ async function genSolanaMessage(address, nonce) {
|
|
|
9554
9561
|
// Serialization Helpers
|
|
9555
9562
|
// ─────────────────────────────────────────────────────────────
|
|
9556
9563
|
function isHexString(value) {
|
|
9557
|
-
// Only strings can be hex-encoded. Numbers, BNs, and other shapes coming back
|
|
9558
|
-
// from the API for u64Val/i64Val should fall through to `new BN(value)` which
|
|
9559
|
-
// accepts those shapes natively. Without this guard, calling .startsWith on a
|
|
9560
|
-
// non-string blows up with TypeError.
|
|
9561
|
-
if (typeof value !== "string")
|
|
9562
|
-
return false;
|
|
9563
9564
|
// Matches strings containing only 0-9, a-f, or A-F (optionally prefixed with 0x)
|
|
9564
9565
|
let testValue = value;
|
|
9565
9566
|
// Handle negative values
|
|
@@ -9655,11 +9656,8 @@ async function buildSetDocumentsTransaction(connection, idl, anchorProvider, pay
|
|
|
9655
9656
|
}
|
|
9656
9657
|
else if (idl.address === "poof4b5pk1L9tmThvBmaABjcyjfhFGbMbQP5BXk2QZp") {
|
|
9657
9658
|
const program = new Program(idl, anchorProvider);
|
|
9658
|
-
// Targets `set_documents_v2` (Vec<u8> ra_indices). The on-chain program
|
|
9659
|
-
// also exposes the legacy `set_documents` (Vec<u64>) so SDKs already on npm
|
|
9660
|
-
// continue to work — but new releases of this SDK speak v2 only.
|
|
9661
9659
|
tx = await program.methods
|
|
9662
|
-
.
|
|
9660
|
+
.setDocuments(args.app_id, prepareAnchorArgs(args.documents), args.delete_paths, args.txData, simulate)
|
|
9663
9661
|
.preInstructions(instructions)
|
|
9664
9662
|
.accounts({
|
|
9665
9663
|
payer: payerPublicKey
|
|
@@ -9737,7 +9735,7 @@ function loadKeypairFromEnv() {
|
|
|
9737
9735
|
try {
|
|
9738
9736
|
const secretKey = secret.trim().startsWith("[")
|
|
9739
9737
|
? Uint8Array.from(JSON.parse(secret))
|
|
9740
|
-
: bs58
|
|
9738
|
+
: bs58.decode(secret.trim());
|
|
9741
9739
|
return Keypair.fromSecretKey(secretKey);
|
|
9742
9740
|
}
|
|
9743
9741
|
catch (err) {
|
|
@@ -10014,17 +10012,11 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
10014
10012
|
if (_overrides === null || _overrides === void 0 ? void 0 : _overrides.headers) {
|
|
10015
10013
|
Object.assign(headers, _overrides.headers);
|
|
10016
10014
|
}
|
|
10017
|
-
// Writes (PUT/POST/DELETE) can take significantly longer than reads —
|
|
10018
|
-
// server-side they may trigger ad-hoc LUT creation (create + extend +
|
|
10019
|
-
// wait-for-finalization, ~15-30s on mainnet). Use a larger default for
|
|
10020
|
-
// non-GET so the SDK doesn't time out before client-api responds.
|
|
10021
|
-
const isRead = method.toUpperCase() === "GET";
|
|
10022
|
-
const defaultTimeout = isRead ? 30000 : 90000;
|
|
10023
10015
|
const requestConfig = {
|
|
10024
10016
|
method,
|
|
10025
10017
|
url: `${config.apiUrl}${urlPath.startsWith("/") ? urlPath : `/${urlPath}`}`,
|
|
10026
10018
|
headers,
|
|
10027
|
-
timeout: (_a = _overrides === null || _overrides === void 0 ? void 0 : _overrides.timeout) !== null && _a !== void 0 ? _a :
|
|
10019
|
+
timeout: (_a = _overrides === null || _overrides === void 0 ? void 0 : _overrides.timeout) !== null && _a !== void 0 ? _a : 30000,
|
|
10028
10020
|
};
|
|
10029
10021
|
if (method !== "GET" && method !== "get") {
|
|
10030
10022
|
requestConfig.data = data ? JSON.stringify(data) : {};
|
|
@@ -10669,38 +10661,21 @@ async function setMany(many, options) {
|
|
|
10669
10661
|
setDocumentData: tx.transactionArgs.setDocumentData,
|
|
10670
10662
|
deletePaths: tx.transactionArgs.deletePaths,
|
|
10671
10663
|
idl: tx.idl,
|
|
10672
|
-
txData: (_b = (_a = tx.txData) === null || _a === void 0 ? void 0 : _a.map((txData) =>
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
raIndices: (() => {
|
|
10681
|
-
const raw = txData.raIndices;
|
|
10682
|
-
if (raw == null)
|
|
10683
|
-
return bufferExports$1.Buffer.alloc(0);
|
|
10684
|
-
if (bufferExports$1.Buffer.isBuffer(raw))
|
|
10685
|
-
return raw;
|
|
10686
|
-
if (raw instanceof Uint8Array)
|
|
10687
|
-
return bufferExports$1.Buffer.from(raw);
|
|
10688
|
-
// Node's JSON-serialised Buffer: {type: "Buffer", data: number[]}
|
|
10689
|
-
const arrayLike = Array.isArray(raw)
|
|
10690
|
-
? raw
|
|
10691
|
-
: (raw && typeof raw === 'object' && Array.isArray(raw.data))
|
|
10692
|
-
? raw.data
|
|
10693
|
-
: (() => { throw new Error(`raIndices has unexpected shape: ${typeof raw}`); })();
|
|
10694
|
-
const bytes = arrayLike.map((raIndex) => {
|
|
10695
|
-
const n = isHexString(raIndex) ? parseInt(raIndex, 16) : Number(raIndex);
|
|
10696
|
-
if (!Number.isInteger(n) || n < 0 || n > 255) {
|
|
10697
|
-
throw new Error(`raIndex ${raIndex} is not a valid u8 (must be integer in 0..255)`);
|
|
10664
|
+
txData: (_b = (_a = tx.txData) === null || _a === void 0 ? void 0 : _a.map((txData) => {
|
|
10665
|
+
var _a;
|
|
10666
|
+
return ({
|
|
10667
|
+
pluginFunctionKey: txData.pluginFunctionKey,
|
|
10668
|
+
txData: bufferExports$1.Buffer.from(txData.txData),
|
|
10669
|
+
raIndices: (_a = txData.raIndices) === null || _a === void 0 ? void 0 : _a.map((raIndex) => {
|
|
10670
|
+
if (isHexString(raIndex)) {
|
|
10671
|
+
return new BN(raIndex, "hex");
|
|
10698
10672
|
}
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10673
|
+
else {
|
|
10674
|
+
return new BN(raIndex);
|
|
10675
|
+
}
|
|
10676
|
+
}),
|
|
10677
|
+
});
|
|
10678
|
+
})) !== null && _b !== void 0 ? _b : [],
|
|
10704
10679
|
};
|
|
10705
10680
|
const config = await getConfig();
|
|
10706
10681
|
const solTransaction = {
|
|
@@ -11682,6 +11657,28 @@ class ReactNativeSessionManager {
|
|
|
11682
11657
|
/* STORE */
|
|
11683
11658
|
/* ------------------------------------------------------------------ */
|
|
11684
11659
|
static async storeSession(address, accessToken, idToken, refreshToken) {
|
|
11660
|
+
// JWT-wallet binding: refuse to store a session whose idToken is bound
|
|
11661
|
+
// to a different wallet than `address`. Prevents races that would otherwise
|
|
11662
|
+
// leave storage with mismatched address/token state.
|
|
11663
|
+
try {
|
|
11664
|
+
const payloadB64 = idToken.split(".")[1];
|
|
11665
|
+
if (payloadB64) {
|
|
11666
|
+
const payload = JSON.parse(this.decodeBase64Url(payloadB64));
|
|
11667
|
+
const tokenWallet = payload["custom:walletAddress"];
|
|
11668
|
+
if (tokenWallet && tokenWallet !== address) {
|
|
11669
|
+
throw new Error(`[ReactNativeSessionManager] Refusing to store session: address (${address}) does not match idToken custom:walletAddress (${tokenWallet})`);
|
|
11670
|
+
}
|
|
11671
|
+
if (!tokenWallet) {
|
|
11672
|
+
console.warn("[ReactNativeSessionManager] storeSession: idToken has no custom:walletAddress claim — writing without validation");
|
|
11673
|
+
}
|
|
11674
|
+
}
|
|
11675
|
+
}
|
|
11676
|
+
catch (err) {
|
|
11677
|
+
if (typeof (err === null || err === void 0 ? void 0 : err.message) === "string" && err.message.includes("Refusing to store session")) {
|
|
11678
|
+
throw err;
|
|
11679
|
+
}
|
|
11680
|
+
console.warn("[ReactNativeSessionManager] storeSession: failed to decode idToken for validation:", err);
|
|
11681
|
+
}
|
|
11685
11682
|
const config = await getConfig();
|
|
11686
11683
|
const currentAppId = config.appId;
|
|
11687
11684
|
this.getStorage().setItem(this.TAROBASE_SESSION_STORAGE_KEY, JSON.stringify({
|
|
@@ -15680,7 +15677,7 @@ async function loadDependencies() {
|
|
|
15680
15677
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
15681
15678
|
import('react'),
|
|
15682
15679
|
import('react-dom/client'),
|
|
15683
|
-
import('./index-
|
|
15680
|
+
import('./index-DOfXgVkn.esm.js')
|
|
15684
15681
|
]);
|
|
15685
15682
|
// Extract default export from ESM module namespace
|
|
15686
15683
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -15874,6 +15871,16 @@ class PhantomWalletProvider {
|
|
|
15874
15871
|
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) {
|
|
15875
15872
|
return;
|
|
15876
15873
|
}
|
|
15874
|
+
// Don't clobber a session owned by MWA on Seeker. MWA marks the
|
|
15875
|
+
// auth method as soon as login starts (see solana-mobile-wallet-provider),
|
|
15876
|
+
// and clears it on logout, so this guard is correct in both
|
|
15877
|
+
// steady-state and post-logout cases.
|
|
15878
|
+
try {
|
|
15879
|
+
if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'mobile-wallet-adapter') {
|
|
15880
|
+
return;
|
|
15881
|
+
}
|
|
15882
|
+
}
|
|
15883
|
+
catch (_b) { }
|
|
15877
15884
|
// Need solana to be available AND connected for signing
|
|
15878
15885
|
if (!solana || !solanaHook.isAvailable || !solana.connected) {
|
|
15879
15886
|
return;
|
|
@@ -15903,12 +15910,21 @@ class PhantomWalletProvider {
|
|
|
15903
15910
|
const signatureBytes = signResult.signature;
|
|
15904
15911
|
const signature = bufferExports.Buffer.from(signatureBytes).toString('base64');
|
|
15905
15912
|
const createSessionResult = await createSessionWithSignature(publicKey, messageText, signature);
|
|
15913
|
+
// Pre-write guard: MWA may have started a login while we were
|
|
15914
|
+
// in flight. If MWA owns the auth method now, abort before we
|
|
15915
|
+
// overwrite its session (or its in-flight session).
|
|
15916
|
+
try {
|
|
15917
|
+
if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'mobile-wallet-adapter') {
|
|
15918
|
+
return;
|
|
15919
|
+
}
|
|
15920
|
+
}
|
|
15921
|
+
catch (_c) { }
|
|
15906
15922
|
await WebSessionManager.storeSession(publicKey, createSessionResult.accessToken, createSessionResult.idToken, createSessionResult.refreshToken);
|
|
15907
15923
|
// Mark auth method so clearIncompatibleSession() doesn't wipe this session
|
|
15908
15924
|
try {
|
|
15909
15925
|
getPlatform().storage.setItem('tarobase_last_auth_method', 'phantom');
|
|
15910
15926
|
}
|
|
15911
|
-
catch (
|
|
15927
|
+
catch (_d) { }
|
|
15912
15928
|
setCurrentUser({ provider: that, address: publicKey });
|
|
15913
15929
|
}
|
|
15914
15930
|
catch (error) {
|
|
@@ -20098,235 +20114,137 @@ function createSolanaRpcSubscriptionsFromTransport(transport) {
|
|
|
20098
20114
|
});
|
|
20099
20115
|
}
|
|
20100
20116
|
|
|
20101
|
-
|
|
20102
|
-
|
|
20103
|
-
|
|
20104
|
-
|
|
20105
|
-
|
|
20106
|
-
|
|
20107
|
-
|
|
20108
|
-
|
|
20109
|
-
|
|
20110
|
-
|
|
20111
|
-
|
|
20112
|
-
|
|
20113
|
-
|
|
20114
|
-
|
|
20115
|
-
|
|
20116
|
-
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
|
|
20120
|
-
|
|
20121
|
-
|
|
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
|
-
var b58 = new Uint8Array(size);
|
|
20224
|
-
// Process the bytes.
|
|
20225
|
-
while (pbegin !== pend) {
|
|
20226
|
-
var carry = source[pbegin];
|
|
20227
|
-
// Apply "b58 = b58 * 256 + ch".
|
|
20228
|
-
var i = 0;
|
|
20229
|
-
for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
20230
|
-
carry += (256 * b58[it1]) >>> 0;
|
|
20231
|
-
b58[it1] = (carry % BASE) >>> 0;
|
|
20232
|
-
carry = (carry / BASE) >>> 0;
|
|
20233
|
-
}
|
|
20234
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20235
|
-
length = i;
|
|
20236
|
-
pbegin++;
|
|
20237
|
-
}
|
|
20238
|
-
// Skip leading zeroes in base58 result.
|
|
20239
|
-
var it2 = size - length;
|
|
20240
|
-
while (it2 !== size && b58[it2] === 0) {
|
|
20241
|
-
it2++;
|
|
20242
|
-
}
|
|
20243
|
-
// Translate the result into a string.
|
|
20244
|
-
var str = LEADER.repeat(zeroes);
|
|
20245
|
-
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
20246
|
-
return str
|
|
20247
|
-
}
|
|
20248
|
-
function decodeUnsafe (source) {
|
|
20249
|
-
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
20250
|
-
if (source.length === 0) { return _Buffer.alloc(0) }
|
|
20251
|
-
var psz = 0;
|
|
20252
|
-
// Skip and count leading '1's.
|
|
20253
|
-
var zeroes = 0;
|
|
20254
|
-
var length = 0;
|
|
20255
|
-
while (source[psz] === LEADER) {
|
|
20256
|
-
zeroes++;
|
|
20257
|
-
psz++;
|
|
20258
|
-
}
|
|
20259
|
-
// Allocate enough space in big-endian base256 representation.
|
|
20260
|
-
var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
20261
|
-
var b256 = new Uint8Array(size);
|
|
20262
|
-
// Process the characters.
|
|
20263
|
-
while (psz < source.length) {
|
|
20264
|
-
// Find code of next character
|
|
20265
|
-
var charCode = source.charCodeAt(psz);
|
|
20266
|
-
// Base map can not be indexed using char code
|
|
20267
|
-
if (charCode > 255) { return }
|
|
20268
|
-
// Decode character
|
|
20269
|
-
var carry = BASE_MAP[charCode];
|
|
20270
|
-
// Invalid character
|
|
20271
|
-
if (carry === 255) { return }
|
|
20272
|
-
var i = 0;
|
|
20273
|
-
for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
20274
|
-
carry += (BASE * b256[it3]) >>> 0;
|
|
20275
|
-
b256[it3] = (carry % 256) >>> 0;
|
|
20276
|
-
carry = (carry / 256) >>> 0;
|
|
20277
|
-
}
|
|
20278
|
-
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20279
|
-
length = i;
|
|
20280
|
-
psz++;
|
|
20281
|
-
}
|
|
20282
|
-
// Skip leading zeroes in b256.
|
|
20283
|
-
var it4 = size - length;
|
|
20284
|
-
while (it4 !== size && b256[it4] === 0) {
|
|
20285
|
-
it4++;
|
|
20286
|
-
}
|
|
20287
|
-
var vch = _Buffer.allocUnsafe(zeroes + (size - it4));
|
|
20288
|
-
vch.fill(0x00, 0, zeroes);
|
|
20289
|
-
var j = zeroes;
|
|
20290
|
-
while (it4 !== size) {
|
|
20291
|
-
vch[j++] = b256[it4++];
|
|
20292
|
-
}
|
|
20293
|
-
return vch
|
|
20294
|
-
}
|
|
20295
|
-
function decode (string) {
|
|
20296
|
-
var buffer = decodeUnsafe(string);
|
|
20297
|
-
if (buffer) { return buffer }
|
|
20298
|
-
throw new Error('Non-base' + BASE + ' character')
|
|
20299
|
-
}
|
|
20300
|
-
return {
|
|
20301
|
-
encode: encode,
|
|
20302
|
-
decodeUnsafe: decodeUnsafe,
|
|
20303
|
-
decode: decode
|
|
20304
|
-
}
|
|
20305
|
-
}
|
|
20306
|
-
src = base;
|
|
20307
|
-
return src;
|
|
20308
|
-
}
|
|
20309
|
-
|
|
20310
|
-
var bs58$1;
|
|
20311
|
-
var hasRequiredBs58;
|
|
20312
|
-
|
|
20313
|
-
function requireBs58 () {
|
|
20314
|
-
if (hasRequiredBs58) return bs58$1;
|
|
20315
|
-
hasRequiredBs58 = 1;
|
|
20316
|
-
var basex = requireSrc();
|
|
20317
|
-
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
20318
|
-
|
|
20319
|
-
bs58$1 = basex(ALPHABET);
|
|
20320
|
-
return bs58$1;
|
|
20117
|
+
// base-x encoding / decoding
|
|
20118
|
+
// Copyright (c) 2018 base-x contributors
|
|
20119
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
20120
|
+
// Distributed under the MIT software license, see the accompanying
|
|
20121
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
20122
|
+
function base (ALPHABET) {
|
|
20123
|
+
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
20124
|
+
const BASE_MAP = new Uint8Array(256);
|
|
20125
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
20126
|
+
BASE_MAP[j] = 255;
|
|
20127
|
+
}
|
|
20128
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
20129
|
+
const x = ALPHABET.charAt(i);
|
|
20130
|
+
const xc = x.charCodeAt(0);
|
|
20131
|
+
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
|
20132
|
+
BASE_MAP[xc] = i;
|
|
20133
|
+
}
|
|
20134
|
+
const BASE = ALPHABET.length;
|
|
20135
|
+
const LEADER = ALPHABET.charAt(0);
|
|
20136
|
+
const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
|
|
20137
|
+
const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
|
|
20138
|
+
function encode (source) {
|
|
20139
|
+
// eslint-disable-next-line no-empty
|
|
20140
|
+
if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
|
|
20141
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
20142
|
+
} else if (Array.isArray(source)) {
|
|
20143
|
+
source = Uint8Array.from(source);
|
|
20144
|
+
}
|
|
20145
|
+
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
|
20146
|
+
if (source.length === 0) { return '' }
|
|
20147
|
+
// Skip & count leading zeroes.
|
|
20148
|
+
let zeroes = 0;
|
|
20149
|
+
let length = 0;
|
|
20150
|
+
let pbegin = 0;
|
|
20151
|
+
const pend = source.length;
|
|
20152
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
20153
|
+
pbegin++;
|
|
20154
|
+
zeroes++;
|
|
20155
|
+
}
|
|
20156
|
+
// Allocate enough space in big-endian base58 representation.
|
|
20157
|
+
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
|
|
20158
|
+
const b58 = new Uint8Array(size);
|
|
20159
|
+
// Process the bytes.
|
|
20160
|
+
while (pbegin !== pend) {
|
|
20161
|
+
let carry = source[pbegin];
|
|
20162
|
+
// Apply "b58 = b58 * 256 + ch".
|
|
20163
|
+
let i = 0;
|
|
20164
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
20165
|
+
carry += (256 * b58[it1]) >>> 0;
|
|
20166
|
+
b58[it1] = (carry % BASE) >>> 0;
|
|
20167
|
+
carry = (carry / BASE) >>> 0;
|
|
20168
|
+
}
|
|
20169
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20170
|
+
length = i;
|
|
20171
|
+
pbegin++;
|
|
20172
|
+
}
|
|
20173
|
+
// Skip leading zeroes in base58 result.
|
|
20174
|
+
let it2 = size - length;
|
|
20175
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
20176
|
+
it2++;
|
|
20177
|
+
}
|
|
20178
|
+
// Translate the result into a string.
|
|
20179
|
+
let str = LEADER.repeat(zeroes);
|
|
20180
|
+
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
20181
|
+
return str
|
|
20182
|
+
}
|
|
20183
|
+
function decodeUnsafe (source) {
|
|
20184
|
+
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
20185
|
+
if (source.length === 0) { return new Uint8Array() }
|
|
20186
|
+
let psz = 0;
|
|
20187
|
+
// Skip and count leading '1's.
|
|
20188
|
+
let zeroes = 0;
|
|
20189
|
+
let length = 0;
|
|
20190
|
+
while (source[psz] === LEADER) {
|
|
20191
|
+
zeroes++;
|
|
20192
|
+
psz++;
|
|
20193
|
+
}
|
|
20194
|
+
// Allocate enough space in big-endian base256 representation.
|
|
20195
|
+
const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
20196
|
+
const b256 = new Uint8Array(size);
|
|
20197
|
+
// Process the characters.
|
|
20198
|
+
while (psz < source.length) {
|
|
20199
|
+
// Find code of next character
|
|
20200
|
+
const charCode = source.charCodeAt(psz);
|
|
20201
|
+
// Base map can not be indexed using char code
|
|
20202
|
+
if (charCode > 255) { return }
|
|
20203
|
+
// Decode character
|
|
20204
|
+
let carry = BASE_MAP[charCode];
|
|
20205
|
+
// Invalid character
|
|
20206
|
+
if (carry === 255) { return }
|
|
20207
|
+
let i = 0;
|
|
20208
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
20209
|
+
carry += (BASE * b256[it3]) >>> 0;
|
|
20210
|
+
b256[it3] = (carry % 256) >>> 0;
|
|
20211
|
+
carry = (carry / 256) >>> 0;
|
|
20212
|
+
}
|
|
20213
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20214
|
+
length = i;
|
|
20215
|
+
psz++;
|
|
20216
|
+
}
|
|
20217
|
+
// Skip leading zeroes in b256.
|
|
20218
|
+
let it4 = size - length;
|
|
20219
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
20220
|
+
it4++;
|
|
20221
|
+
}
|
|
20222
|
+
const vch = new Uint8Array(zeroes + (size - it4));
|
|
20223
|
+
let j = zeroes;
|
|
20224
|
+
while (it4 !== size) {
|
|
20225
|
+
vch[j++] = b256[it4++];
|
|
20226
|
+
}
|
|
20227
|
+
return vch
|
|
20228
|
+
}
|
|
20229
|
+
function decode (string) {
|
|
20230
|
+
const buffer = decodeUnsafe(string);
|
|
20231
|
+
if (buffer) { return buffer }
|
|
20232
|
+
throw new Error('Non-base' + BASE + ' character')
|
|
20233
|
+
}
|
|
20234
|
+
return {
|
|
20235
|
+
encode,
|
|
20236
|
+
decodeUnsafe,
|
|
20237
|
+
decode
|
|
20238
|
+
}
|
|
20321
20239
|
}
|
|
20322
20240
|
|
|
20323
|
-
var
|
|
20324
|
-
var
|
|
20241
|
+
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
20242
|
+
var base58 = base(ALPHABET);
|
|
20325
20243
|
|
|
20326
|
-
var index = /*#__PURE__*/
|
|
20244
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
20327
20245
|
__proto__: null,
|
|
20328
|
-
default:
|
|
20329
|
-
}
|
|
20246
|
+
default: base58
|
|
20247
|
+
});
|
|
20330
20248
|
|
|
20331
20249
|
const SURFNET_RPC_URL$1 = "https://surfpool.fly.dev";
|
|
20332
20250
|
let React;
|
|
@@ -21060,7 +20978,7 @@ class PrivyWalletProvider {
|
|
|
21060
20978
|
// Handle case where signature might be bytes instead of string
|
|
21061
20979
|
const rawSig = result.signature;
|
|
21062
20980
|
if (rawSig instanceof Uint8Array || Array.isArray(rawSig)) {
|
|
21063
|
-
signature =
|
|
20981
|
+
signature = base58.encode(rawSig instanceof Uint8Array ? rawSig : new Uint8Array(rawSig));
|
|
21064
20982
|
}
|
|
21065
20983
|
else {
|
|
21066
20984
|
signature = rawSig;
|
|
@@ -21240,7 +21158,7 @@ async function loadMwaProtocol() {
|
|
|
21240
21158
|
return mwaProtocolLoadPromise;
|
|
21241
21159
|
mwaProtocolLoadPromise = (async () => {
|
|
21242
21160
|
try {
|
|
21243
|
-
mwaProtocolModule = await import('./index.browser-
|
|
21161
|
+
mwaProtocolModule = await import('./index.browser-DVn6ApJy.esm.js');
|
|
21244
21162
|
}
|
|
21245
21163
|
catch (e) {
|
|
21246
21164
|
console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
|
|
@@ -21262,7 +21180,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
21262
21180
|
if (typeof window === 'undefined')
|
|
21263
21181
|
return;
|
|
21264
21182
|
try {
|
|
21265
|
-
const walletStandardMobile = await import('./index.browser-
|
|
21183
|
+
const walletStandardMobile = await import('./index.browser-BlQ9w7lf.esm.js');
|
|
21266
21184
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
21267
21185
|
if (!registerMwa) {
|
|
21268
21186
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -21392,6 +21310,19 @@ class SolanaMobileWalletProvider {
|
|
|
21392
21310
|
async login() {
|
|
21393
21311
|
var _a, _b, _c, _d, _e;
|
|
21394
21312
|
setAuthLoading(true);
|
|
21313
|
+
// Mark the auth method early so a concurrent Phantom auto-create can see
|
|
21314
|
+
// 'mobile-wallet-adapter' during our slow transact() / session-creation
|
|
21315
|
+
// roundtrip and back off (see phantom-wallet-provider autoCreateSession).
|
|
21316
|
+
// Capture the previous value so we can restore it if login fails.
|
|
21317
|
+
let prevAuthMethod = null;
|
|
21318
|
+
try {
|
|
21319
|
+
prevAuthMethod = getPlatform().storage.getItem('tarobase_last_auth_method');
|
|
21320
|
+
}
|
|
21321
|
+
catch (_f) { }
|
|
21322
|
+
try {
|
|
21323
|
+
getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');
|
|
21324
|
+
}
|
|
21325
|
+
catch (_g) { }
|
|
21395
21326
|
try {
|
|
21396
21327
|
await loadMwaProtocol();
|
|
21397
21328
|
const { transact } = mwaProtocolModule;
|
|
@@ -21457,12 +21388,22 @@ class SolanaMobileWalletProvider {
|
|
|
21457
21388
|
try {
|
|
21458
21389
|
getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');
|
|
21459
21390
|
}
|
|
21460
|
-
catch (
|
|
21391
|
+
catch (_h) { }
|
|
21461
21392
|
const user = { provider: this, address: result.base58Address };
|
|
21462
21393
|
setCurrentUser(user);
|
|
21463
21394
|
return user;
|
|
21464
21395
|
}
|
|
21465
21396
|
catch (error) {
|
|
21397
|
+
// Restore the previous auth method since this login attempt failed.
|
|
21398
|
+
try {
|
|
21399
|
+
if (prevAuthMethod === null) {
|
|
21400
|
+
getPlatform().storage.removeItem('tarobase_last_auth_method');
|
|
21401
|
+
}
|
|
21402
|
+
else {
|
|
21403
|
+
getPlatform().storage.setItem('tarobase_last_auth_method', prevAuthMethod);
|
|
21404
|
+
}
|
|
21405
|
+
}
|
|
21406
|
+
catch (_j) { }
|
|
21466
21407
|
const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||
|
|
21467
21408
|
((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('user rejected')) ||
|
|
21468
21409
|
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('user denied')) ||
|
|
@@ -21508,6 +21449,12 @@ class SolanaMobileWalletProvider {
|
|
|
21508
21449
|
this.authorizedPublicKey = null;
|
|
21509
21450
|
this.publicKeyObj = null;
|
|
21510
21451
|
WebSessionManager.clearSession();
|
|
21452
|
+
// Clear the auth-method marker so Phantom auto-create is unblocked
|
|
21453
|
+
// for any subsequent fresh login on this device.
|
|
21454
|
+
try {
|
|
21455
|
+
getPlatform().storage.removeItem('tarobase_last_auth_method');
|
|
21456
|
+
}
|
|
21457
|
+
catch (_a) { }
|
|
21511
21458
|
setCurrentUser(null);
|
|
21512
21459
|
}
|
|
21513
21460
|
async signMessage(message) {
|
|
@@ -22015,7 +21962,7 @@ class PrivyExpoProvider {
|
|
|
22015
21962
|
const wallet = await this.getWalletOrThrow();
|
|
22016
21963
|
const messageBytes = getPlatform().textEncode(message);
|
|
22017
21964
|
const result = await wallet.signMessage(messageBytes);
|
|
22018
|
-
return
|
|
21965
|
+
return base58.encode(result.signature);
|
|
22019
21966
|
}
|
|
22020
21967
|
async signTransaction(transaction) {
|
|
22021
21968
|
await this.ensureReady();
|
|
@@ -22170,5 +22117,5 @@ class PrivyExpoProvider {
|
|
|
22170
22117
|
}
|
|
22171
22118
|
}
|
|
22172
22119
|
|
|
22173
|
-
export {
|
|
22174
|
-
//# sourceMappingURL=index-
|
|
22120
|
+
export { getCachedData as $, subscribe as A, useAuth as B, deserializeTransaction as C, getIdToken as D, setPlatform as E, getPlatform as F, PrivyWalletProvider as G, DEFAULT_TEST_ADDRESS as H, isMobileWalletAvailable as I, registerMobileWalletAdapter as J, PrivyExpoProvider as K, InsufficientBalanceError as L, MockAuthProvider as M, ServerSessionManager as N, OffchainAuthProvider as O, PhantomWalletProvider as P, buildSetDocumentsTransaction as Q, ReactNativeSessionManager as R, SolanaMobileWalletProvider as S, clearCache as T, closeAllSubscriptions as U, convertRemainingAccounts as V, WebSessionManager as W, createSessionWithPrivy as X, createSessionWithSignature as Y, genAuthNonce as Z, genSolanaMessage as _, base58 as a, getMany as a0, reconnectWithNewAuth as a1, refreshSession as a2, signSessionCreateMessage as a3, bufferExports as b, getCurrentUser as c, onAuthLoadingChanged as d, getAuthLoading as e, logout as f, getDefaultExportFromCjs$1 as g, getConfig as h, init as i, getAuthProvider as j, get as k, login as l, setMany as m, setFile as n, onAuthStateChanged as o, getFiles as p, runQueryMany as q, runQuery as r, set as s, runExpression as t, runExpressionMany as u, signMessage as v, signTransaction as w, signAndSubmitTransaction as x, count as y, aggregate as z };
|
|
22121
|
+
//# sourceMappingURL=index-DiSZgxvm.esm.js.map
|