@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
|
@@ -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-dyXVIGCy.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
|
|
@@ -15826,6 +15823,17 @@ class PhantomWalletProvider {
|
|
|
15826
15823
|
const isMobile = detectMobile();
|
|
15827
15824
|
const hasPhantomInjected = discoveredWallets.some((w) => w.id === 'phantom');
|
|
15828
15825
|
const showDeeplink = isMobile && sdkProviders.includes('deeplink') && !hasPhantomInjected;
|
|
15826
|
+
// Treat MWA's own wallet-standard registrations as not-injected, so the MWA
|
|
15827
|
+
// button still appears when only MWA is present (e.g. Android Chrome on Seeker).
|
|
15828
|
+
const hasInjectedWallet = discoveredWallets.some((w) => {
|
|
15829
|
+
var _a, _b;
|
|
15830
|
+
const id = String((_a = w.id) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
15831
|
+
const name = String((_b = w.name) !== null && _b !== void 0 ? _b : '').toLowerCase();
|
|
15832
|
+
return (id !== 'mobile-wallet-adapter' &&
|
|
15833
|
+
id !== 'remote-mobile-wallet-adapter' &&
|
|
15834
|
+
name !== 'mobile wallet adapter' &&
|
|
15835
|
+
name !== 'remote mobile wallet adapter');
|
|
15836
|
+
});
|
|
15829
15837
|
// Track previous modal state to detect closes
|
|
15830
15838
|
const prevModalOpen = React$1.useRef(false);
|
|
15831
15839
|
// Track when modal was closed because user selected a wallet (not dismissed)
|
|
@@ -15874,6 +15882,16 @@ class PhantomWalletProvider {
|
|
|
15874
15882
|
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
15883
|
return;
|
|
15876
15884
|
}
|
|
15885
|
+
// Don't clobber a session owned by MWA on Seeker. MWA marks the
|
|
15886
|
+
// auth method as soon as login starts (see solana-mobile-wallet-provider),
|
|
15887
|
+
// and clears it on logout, so this guard is correct in both
|
|
15888
|
+
// steady-state and post-logout cases.
|
|
15889
|
+
try {
|
|
15890
|
+
if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'mobile-wallet-adapter') {
|
|
15891
|
+
return;
|
|
15892
|
+
}
|
|
15893
|
+
}
|
|
15894
|
+
catch (_b) { }
|
|
15877
15895
|
// Need solana to be available AND connected for signing
|
|
15878
15896
|
if (!solana || !solanaHook.isAvailable || !solana.connected) {
|
|
15879
15897
|
return;
|
|
@@ -15903,12 +15921,21 @@ class PhantomWalletProvider {
|
|
|
15903
15921
|
const signatureBytes = signResult.signature;
|
|
15904
15922
|
const signature = bufferExports.Buffer.from(signatureBytes).toString('base64');
|
|
15905
15923
|
const createSessionResult = await createSessionWithSignature(publicKey, messageText, signature);
|
|
15924
|
+
// Pre-write guard: MWA may have started a login while we were
|
|
15925
|
+
// in flight. If MWA owns the auth method now, abort before we
|
|
15926
|
+
// overwrite its session (or its in-flight session).
|
|
15927
|
+
try {
|
|
15928
|
+
if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'mobile-wallet-adapter') {
|
|
15929
|
+
return;
|
|
15930
|
+
}
|
|
15931
|
+
}
|
|
15932
|
+
catch (_c) { }
|
|
15906
15933
|
await WebSessionManager.storeSession(publicKey, createSessionResult.accessToken, createSessionResult.idToken, createSessionResult.refreshToken);
|
|
15907
15934
|
// Mark auth method so clearIncompatibleSession() doesn't wipe this session
|
|
15908
15935
|
try {
|
|
15909
15936
|
getPlatform().storage.setItem('tarobase_last_auth_method', 'phantom');
|
|
15910
15937
|
}
|
|
15911
|
-
catch (
|
|
15938
|
+
catch (_d) { }
|
|
15912
15939
|
setCurrentUser({ provider: that, address: publicKey });
|
|
15913
15940
|
}
|
|
15914
15941
|
catch (error) {
|
|
@@ -16264,8 +16291,9 @@ class PhantomWalletProvider {
|
|
|
16264
16291
|
}), 'Open Phantom app'));
|
|
16265
16292
|
}
|
|
16266
16293
|
// Mobile Wallet Adapter button — shown on Android when MWA callback is available
|
|
16294
|
+
// and no injected wallet is present (hides button inside Phantom/Solflare/etc. in-app browsers).
|
|
16267
16295
|
const isAndroid = detectAndroid();
|
|
16268
|
-
if (isAndroid && that.onSwitchToMWA) {
|
|
16296
|
+
if (isAndroid && that.onSwitchToMWA && !hasInjectedWallet) {
|
|
16269
16297
|
walletButtons.push(React$1.createElement('button', {
|
|
16270
16298
|
key: 'mobile-wallet',
|
|
16271
16299
|
style: buttonStyle('mobile-wallet'),
|
|
@@ -20098,235 +20126,137 @@ function createSolanaRpcSubscriptionsFromTransport(transport) {
|
|
|
20098
20126
|
});
|
|
20099
20127
|
}
|
|
20100
20128
|
|
|
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;
|
|
20129
|
+
// base-x encoding / decoding
|
|
20130
|
+
// Copyright (c) 2018 base-x contributors
|
|
20131
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
20132
|
+
// Distributed under the MIT software license, see the accompanying
|
|
20133
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
20134
|
+
function base (ALPHABET) {
|
|
20135
|
+
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
20136
|
+
const BASE_MAP = new Uint8Array(256);
|
|
20137
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
20138
|
+
BASE_MAP[j] = 255;
|
|
20139
|
+
}
|
|
20140
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
20141
|
+
const x = ALPHABET.charAt(i);
|
|
20142
|
+
const xc = x.charCodeAt(0);
|
|
20143
|
+
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
|
20144
|
+
BASE_MAP[xc] = i;
|
|
20145
|
+
}
|
|
20146
|
+
const BASE = ALPHABET.length;
|
|
20147
|
+
const LEADER = ALPHABET.charAt(0);
|
|
20148
|
+
const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
|
|
20149
|
+
const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
|
|
20150
|
+
function encode (source) {
|
|
20151
|
+
// eslint-disable-next-line no-empty
|
|
20152
|
+
if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
|
|
20153
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
20154
|
+
} else if (Array.isArray(source)) {
|
|
20155
|
+
source = Uint8Array.from(source);
|
|
20156
|
+
}
|
|
20157
|
+
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
|
20158
|
+
if (source.length === 0) { return '' }
|
|
20159
|
+
// Skip & count leading zeroes.
|
|
20160
|
+
let zeroes = 0;
|
|
20161
|
+
let length = 0;
|
|
20162
|
+
let pbegin = 0;
|
|
20163
|
+
const pend = source.length;
|
|
20164
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
20165
|
+
pbegin++;
|
|
20166
|
+
zeroes++;
|
|
20167
|
+
}
|
|
20168
|
+
// Allocate enough space in big-endian base58 representation.
|
|
20169
|
+
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
|
|
20170
|
+
const b58 = new Uint8Array(size);
|
|
20171
|
+
// Process the bytes.
|
|
20172
|
+
while (pbegin !== pend) {
|
|
20173
|
+
let carry = source[pbegin];
|
|
20174
|
+
// Apply "b58 = b58 * 256 + ch".
|
|
20175
|
+
let i = 0;
|
|
20176
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
20177
|
+
carry += (256 * b58[it1]) >>> 0;
|
|
20178
|
+
b58[it1] = (carry % BASE) >>> 0;
|
|
20179
|
+
carry = (carry / BASE) >>> 0;
|
|
20180
|
+
}
|
|
20181
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20182
|
+
length = i;
|
|
20183
|
+
pbegin++;
|
|
20184
|
+
}
|
|
20185
|
+
// Skip leading zeroes in base58 result.
|
|
20186
|
+
let it2 = size - length;
|
|
20187
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
20188
|
+
it2++;
|
|
20189
|
+
}
|
|
20190
|
+
// Translate the result into a string.
|
|
20191
|
+
let str = LEADER.repeat(zeroes);
|
|
20192
|
+
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
20193
|
+
return str
|
|
20194
|
+
}
|
|
20195
|
+
function decodeUnsafe (source) {
|
|
20196
|
+
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
20197
|
+
if (source.length === 0) { return new Uint8Array() }
|
|
20198
|
+
let psz = 0;
|
|
20199
|
+
// Skip and count leading '1's.
|
|
20200
|
+
let zeroes = 0;
|
|
20201
|
+
let length = 0;
|
|
20202
|
+
while (source[psz] === LEADER) {
|
|
20203
|
+
zeroes++;
|
|
20204
|
+
psz++;
|
|
20205
|
+
}
|
|
20206
|
+
// Allocate enough space in big-endian base256 representation.
|
|
20207
|
+
const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
20208
|
+
const b256 = new Uint8Array(size);
|
|
20209
|
+
// Process the characters.
|
|
20210
|
+
while (psz < source.length) {
|
|
20211
|
+
// Find code of next character
|
|
20212
|
+
const charCode = source.charCodeAt(psz);
|
|
20213
|
+
// Base map can not be indexed using char code
|
|
20214
|
+
if (charCode > 255) { return }
|
|
20215
|
+
// Decode character
|
|
20216
|
+
let carry = BASE_MAP[charCode];
|
|
20217
|
+
// Invalid character
|
|
20218
|
+
if (carry === 255) { return }
|
|
20219
|
+
let i = 0;
|
|
20220
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
20221
|
+
carry += (BASE * b256[it3]) >>> 0;
|
|
20222
|
+
b256[it3] = (carry % 256) >>> 0;
|
|
20223
|
+
carry = (carry / 256) >>> 0;
|
|
20224
|
+
}
|
|
20225
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20226
|
+
length = i;
|
|
20227
|
+
psz++;
|
|
20228
|
+
}
|
|
20229
|
+
// Skip leading zeroes in b256.
|
|
20230
|
+
let it4 = size - length;
|
|
20231
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
20232
|
+
it4++;
|
|
20233
|
+
}
|
|
20234
|
+
const vch = new Uint8Array(zeroes + (size - it4));
|
|
20235
|
+
let j = zeroes;
|
|
20236
|
+
while (it4 !== size) {
|
|
20237
|
+
vch[j++] = b256[it4++];
|
|
20238
|
+
}
|
|
20239
|
+
return vch
|
|
20240
|
+
}
|
|
20241
|
+
function decode (string) {
|
|
20242
|
+
const buffer = decodeUnsafe(string);
|
|
20243
|
+
if (buffer) { return buffer }
|
|
20244
|
+
throw new Error('Non-base' + BASE + ' character')
|
|
20245
|
+
}
|
|
20246
|
+
return {
|
|
20247
|
+
encode,
|
|
20248
|
+
decodeUnsafe,
|
|
20249
|
+
decode
|
|
20250
|
+
}
|
|
20321
20251
|
}
|
|
20322
20252
|
|
|
20323
|
-
var
|
|
20324
|
-
var
|
|
20253
|
+
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
20254
|
+
var base58 = base(ALPHABET);
|
|
20325
20255
|
|
|
20326
|
-
var index = /*#__PURE__*/
|
|
20256
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
20327
20257
|
__proto__: null,
|
|
20328
|
-
default:
|
|
20329
|
-
}
|
|
20258
|
+
default: base58
|
|
20259
|
+
});
|
|
20330
20260
|
|
|
20331
20261
|
const SURFNET_RPC_URL$1 = "https://surfpool.fly.dev";
|
|
20332
20262
|
let React;
|
|
@@ -21060,7 +20990,7 @@ class PrivyWalletProvider {
|
|
|
21060
20990
|
// Handle case where signature might be bytes instead of string
|
|
21061
20991
|
const rawSig = result.signature;
|
|
21062
20992
|
if (rawSig instanceof Uint8Array || Array.isArray(rawSig)) {
|
|
21063
|
-
signature =
|
|
20993
|
+
signature = base58.encode(rawSig instanceof Uint8Array ? rawSig : new Uint8Array(rawSig));
|
|
21064
20994
|
}
|
|
21065
20995
|
else {
|
|
21066
20996
|
signature = rawSig;
|
|
@@ -21240,7 +21170,7 @@ async function loadMwaProtocol() {
|
|
|
21240
21170
|
return mwaProtocolLoadPromise;
|
|
21241
21171
|
mwaProtocolLoadPromise = (async () => {
|
|
21242
21172
|
try {
|
|
21243
|
-
mwaProtocolModule = await import('./index.browser-
|
|
21173
|
+
mwaProtocolModule = await import('./index.browser-CbVXUCv0.esm.js');
|
|
21244
21174
|
}
|
|
21245
21175
|
catch (e) {
|
|
21246
21176
|
console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
|
|
@@ -21262,7 +21192,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
21262
21192
|
if (typeof window === 'undefined')
|
|
21263
21193
|
return;
|
|
21264
21194
|
try {
|
|
21265
|
-
const walletStandardMobile = await import('./index.browser-
|
|
21195
|
+
const walletStandardMobile = await import('./index.browser-Dekybe_E.esm.js');
|
|
21266
21196
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
21267
21197
|
if (!registerMwa) {
|
|
21268
21198
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -21392,6 +21322,19 @@ class SolanaMobileWalletProvider {
|
|
|
21392
21322
|
async login() {
|
|
21393
21323
|
var _a, _b, _c, _d, _e;
|
|
21394
21324
|
setAuthLoading(true);
|
|
21325
|
+
// Mark the auth method early so a concurrent Phantom auto-create can see
|
|
21326
|
+
// 'mobile-wallet-adapter' during our slow transact() / session-creation
|
|
21327
|
+
// roundtrip and back off (see phantom-wallet-provider autoCreateSession).
|
|
21328
|
+
// Capture the previous value so we can restore it if login fails.
|
|
21329
|
+
let prevAuthMethod = null;
|
|
21330
|
+
try {
|
|
21331
|
+
prevAuthMethod = getPlatform().storage.getItem('tarobase_last_auth_method');
|
|
21332
|
+
}
|
|
21333
|
+
catch (_f) { }
|
|
21334
|
+
try {
|
|
21335
|
+
getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');
|
|
21336
|
+
}
|
|
21337
|
+
catch (_g) { }
|
|
21395
21338
|
try {
|
|
21396
21339
|
await loadMwaProtocol();
|
|
21397
21340
|
const { transact } = mwaProtocolModule;
|
|
@@ -21457,12 +21400,22 @@ class SolanaMobileWalletProvider {
|
|
|
21457
21400
|
try {
|
|
21458
21401
|
getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');
|
|
21459
21402
|
}
|
|
21460
|
-
catch (
|
|
21403
|
+
catch (_h) { }
|
|
21461
21404
|
const user = { provider: this, address: result.base58Address };
|
|
21462
21405
|
setCurrentUser(user);
|
|
21463
21406
|
return user;
|
|
21464
21407
|
}
|
|
21465
21408
|
catch (error) {
|
|
21409
|
+
// Restore the previous auth method since this login attempt failed.
|
|
21410
|
+
try {
|
|
21411
|
+
if (prevAuthMethod === null) {
|
|
21412
|
+
getPlatform().storage.removeItem('tarobase_last_auth_method');
|
|
21413
|
+
}
|
|
21414
|
+
else {
|
|
21415
|
+
getPlatform().storage.setItem('tarobase_last_auth_method', prevAuthMethod);
|
|
21416
|
+
}
|
|
21417
|
+
}
|
|
21418
|
+
catch (_j) { }
|
|
21466
21419
|
const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||
|
|
21467
21420
|
((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('user rejected')) ||
|
|
21468
21421
|
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('user denied')) ||
|
|
@@ -21508,6 +21461,12 @@ class SolanaMobileWalletProvider {
|
|
|
21508
21461
|
this.authorizedPublicKey = null;
|
|
21509
21462
|
this.publicKeyObj = null;
|
|
21510
21463
|
WebSessionManager.clearSession();
|
|
21464
|
+
// Clear the auth-method marker so Phantom auto-create is unblocked
|
|
21465
|
+
// for any subsequent fresh login on this device.
|
|
21466
|
+
try {
|
|
21467
|
+
getPlatform().storage.removeItem('tarobase_last_auth_method');
|
|
21468
|
+
}
|
|
21469
|
+
catch (_a) { }
|
|
21511
21470
|
setCurrentUser(null);
|
|
21512
21471
|
}
|
|
21513
21472
|
async signMessage(message) {
|
|
@@ -22015,7 +21974,7 @@ class PrivyExpoProvider {
|
|
|
22015
21974
|
const wallet = await this.getWalletOrThrow();
|
|
22016
21975
|
const messageBytes = getPlatform().textEncode(message);
|
|
22017
21976
|
const result = await wallet.signMessage(messageBytes);
|
|
22018
|
-
return
|
|
21977
|
+
return base58.encode(result.signature);
|
|
22019
21978
|
}
|
|
22020
21979
|
async signTransaction(transaction) {
|
|
22021
21980
|
await this.ensureReady();
|
|
@@ -22170,5 +22129,5 @@ class PrivyExpoProvider {
|
|
|
22170
22129
|
}
|
|
22171
22130
|
}
|
|
22172
22131
|
|
|
22173
|
-
export {
|
|
22174
|
-
//# sourceMappingURL=index-
|
|
22132
|
+
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 };
|
|
22133
|
+
//# sourceMappingURL=index-p1LvAs78.esm.js.map
|