@pooflabs/web 0.0.81 → 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.
Files changed (57) hide show
  1. package/dist/{index-D_DiP8XQ.js → index-2qSlZ-n6.js} +7850 -10985
  2. package/dist/index-2qSlZ-n6.js.map +1 -0
  3. package/dist/{index-DXPkkq81.js → index-BAz5F9Qr.js} +7850 -10985
  4. package/dist/index-BAz5F9Qr.js.map +1 -0
  5. package/dist/{index-CjHbp7Dq.esm.js → index-BpjqfeKL.esm.js} +7850 -10985
  6. package/dist/index-BpjqfeKL.esm.js.map +1 -0
  7. package/dist/{index-B2WGCssJ.js → index-CYhzBf0k.js} +231 -180
  8. package/dist/index-CYhzBf0k.js.map +1 -0
  9. package/dist/{index-dcJIjFrs.esm.js → index-DOfXgVkn.esm.js} +7850 -10985
  10. package/dist/index-DOfXgVkn.esm.js.map +1 -0
  11. package/dist/{index-nt_HQVrk.esm.js → index-DiSZgxvm.esm.js} +232 -179
  12. package/dist/index-DiSZgxvm.esm.js.map +1 -0
  13. package/dist/{index.browser-CT6PUv9G.js → index.browser-BgibQtKi.js} +2 -2
  14. package/dist/{index.browser-CT6PUv9G.js.map → index.browser-BgibQtKi.js.map} +1 -1
  15. package/dist/{index.browser-BNdFfyIg.esm.js → index.browser-BlQ9w7lf.esm.js} +2 -2
  16. package/dist/{index.browser-BNdFfyIg.esm.js.map → index.browser-BlQ9w7lf.esm.js.map} +1 -1
  17. package/dist/{index.browser-ZD7Tz2bn.js → index.browser-CDhaFhaH.js} +2 -2
  18. package/dist/{index.browser-ZD7Tz2bn.js.map → index.browser-CDhaFhaH.js.map} +1 -1
  19. package/dist/{index.browser-pE1s68e9.esm.js → index.browser-DVn6ApJy.esm.js} +2 -2
  20. package/dist/{index.browser-pE1s68e9.esm.js.map → index.browser-DVn6ApJy.esm.js.map} +1 -1
  21. package/dist/{index.browser-Cy21yaX0.esm.js → index.browser-I9UnPFqe.esm.js} +2 -2
  22. package/dist/{index.browser-Cy21yaX0.esm.js.map → index.browser-I9UnPFqe.esm.js.map} +1 -1
  23. package/dist/{index.browser-d0PlOXpF.js → index.browser-XpeHKCJM.js} +2 -2
  24. package/dist/{index.browser-d0PlOXpF.js.map → index.browser-XpeHKCJM.js.map} +1 -1
  25. package/dist/index.esm.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/{index.native-BqYr--vb.esm.js → index.native-CbNEYkFa.esm.js} +185 -180
  28. package/dist/index.native-CbNEYkFa.esm.js.map +1 -0
  29. package/dist/{index.native-CyA-RdvW.js → index.native-lubRe8nA.js} +184 -181
  30. package/dist/index.native-lubRe8nA.js.map +1 -0
  31. package/dist/index.native.esm.js +1 -1
  32. package/dist/index.native.js +1 -1
  33. package/dist/{phantom-wallet-provider-DWCaMkyz.js → phantom-wallet-provider-CfJti5dZ.js} +23 -4
  34. package/dist/phantom-wallet-provider-CfJti5dZ.js.map +1 -0
  35. package/dist/{phantom-wallet-provider-K2V96G-G.esm.js → phantom-wallet-provider-YH1gySq_.esm.js} +23 -4
  36. package/dist/phantom-wallet-provider-YH1gySq_.esm.js.map +1 -0
  37. package/dist/{privy-wallet-provider-DoX8q99w.esm.js → privy-wallet-provider-Bt7Jk-TE.esm.js} +3 -3
  38. package/dist/{privy-wallet-provider-DoX8q99w.esm.js.map → privy-wallet-provider-Bt7Jk-TE.esm.js.map} +1 -1
  39. package/dist/{privy-wallet-provider-BMg_S_d0.js → privy-wallet-provider-CeH9zTfE.js} +3 -3
  40. package/dist/{privy-wallet-provider-BMg_S_d0.js.map → privy-wallet-provider-CeH9zTfE.js.map} +1 -1
  41. package/dist/{solana-mobile-wallet-provider-t22Ie8lY.js → solana-mobile-wallet-provider-4PG6JNmJ.js} +33 -4
  42. package/dist/solana-mobile-wallet-provider-4PG6JNmJ.js.map +1 -0
  43. package/dist/{solana-mobile-wallet-provider-Cmphb3oB.esm.js → solana-mobile-wallet-provider-BtM0Saad.esm.js} +33 -4
  44. package/dist/solana-mobile-wallet-provider-BtM0Saad.esm.js.map +1 -0
  45. package/package.json +2 -2
  46. package/dist/index-B2WGCssJ.js.map +0 -1
  47. package/dist/index-CjHbp7Dq.esm.js.map +0 -1
  48. package/dist/index-DXPkkq81.js.map +0 -1
  49. package/dist/index-D_DiP8XQ.js.map +0 -1
  50. package/dist/index-dcJIjFrs.esm.js.map +0 -1
  51. package/dist/index-nt_HQVrk.esm.js.map +0 -1
  52. package/dist/index.native-BqYr--vb.esm.js.map +0 -1
  53. package/dist/index.native-CyA-RdvW.js.map +0 -1
  54. package/dist/phantom-wallet-provider-DWCaMkyz.js.map +0 -1
  55. package/dist/phantom-wallet-provider-K2V96G-G.esm.js.map +0 -1
  56. package/dist/solana-mobile-wallet-provider-Cmphb3oB.esm.js.map +0 -1
  57. package/dist/solana-mobile-wallet-provider-t22Ie8lY.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({
@@ -9483,11 +9490,11 @@ function requireSrc () {
9483
9490
  }
9484
9491
 
9485
9492
  var bs58$1;
9486
- var hasRequiredBs58$1;
9493
+ var hasRequiredBs58;
9487
9494
 
9488
- function requireBs58$1 () {
9489
- if (hasRequiredBs58$1) return bs58$1;
9490
- hasRequiredBs58$1 = 1;
9495
+ function requireBs58 () {
9496
+ if (hasRequiredBs58) return bs58$1;
9497
+ hasRequiredBs58 = 1;
9491
9498
  var basex = requireSrc();
9492
9499
  var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
9493
9500
 
@@ -9495,8 +9502,8 @@ function requireBs58$1 () {
9495
9502
  return bs58$1;
9496
9503
  }
9497
9504
 
9498
- var bs58Exports$1 = requireBs58$1();
9499
- var bs58$2 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports$1);
9505
+ var bs58Exports = requireBs58();
9506
+ var bs58 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports);
9500
9507
 
9501
9508
  // ─────────────────────────────────────────────────────────────
9502
9509
  // Local implementation of getSimulationComputeUnits
@@ -9749,7 +9756,7 @@ function loadKeypairFromEnv() {
9749
9756
  try {
9750
9757
  const secretKey = secret.trim().startsWith("[")
9751
9758
  ? Uint8Array.from(JSON.parse(secret))
9752
- : bs58$2.decode(secret.trim());
9759
+ : bs58.decode(secret.trim());
9753
9760
  return web3_js.Keypair.fromSecretKey(secretKey);
9754
9761
  }
9755
9762
  catch (err) {
@@ -11671,6 +11678,28 @@ class ReactNativeSessionManager {
11671
11678
  /* STORE */
11672
11679
  /* ------------------------------------------------------------------ */
11673
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
+ }
11674
11703
  const config = await getConfig();
11675
11704
  const currentAppId = config.appId;
11676
11705
  this.getStorage().setItem(this.TAROBASE_SESSION_STORAGE_KEY, JSON.stringify({
@@ -15669,7 +15698,7 @@ async function loadDependencies() {
15669
15698
  const [reactModule, reactDomModule, phantomModule] = await Promise.all([
15670
15699
  import('react'),
15671
15700
  import('react-dom/client'),
15672
- Promise.resolve().then(function () { return require('./index-DXPkkq81.js'); })
15701
+ Promise.resolve().then(function () { return require('./index-BAz5F9Qr.js'); })
15673
15702
  ]);
15674
15703
  // Extract default export from ESM module namespace
15675
15704
  // Dynamic import() returns { default: Module, ...exports }, not the module directly
@@ -15863,6 +15892,16 @@ class PhantomWalletProvider {
15863
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) {
15864
15893
  return;
15865
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) { }
15866
15905
  // Need solana to be available AND connected for signing
15867
15906
  if (!solana || !solanaHook.isAvailable || !solana.connected) {
15868
15907
  return;
@@ -15892,12 +15931,21 @@ class PhantomWalletProvider {
15892
15931
  const signatureBytes = signResult.signature;
15893
15932
  const signature = bufferExports.Buffer.from(signatureBytes).toString('base64');
15894
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) { }
15895
15943
  await WebSessionManager.storeSession(publicKey, createSessionResult.accessToken, createSessionResult.idToken, createSessionResult.refreshToken);
15896
15944
  // Mark auth method so clearIncompatibleSession() doesn't wipe this session
15897
15945
  try {
15898
15946
  getPlatform().storage.setItem('tarobase_last_auth_method', 'phantom');
15899
15947
  }
15900
- catch (_b) { }
15948
+ catch (_d) { }
15901
15949
  setCurrentUser({ provider: that, address: publicKey });
15902
15950
  }
15903
15951
  catch (error) {
@@ -20087,161 +20135,137 @@ function createSolanaRpcSubscriptionsFromTransport(transport) {
20087
20135
  });
20088
20136
  }
20089
20137
 
20090
- var cjs = {};
20091
-
20092
- var hasRequiredCjs;
20093
-
20094
- function requireCjs () {
20095
- if (hasRequiredCjs) return cjs;
20096
- hasRequiredCjs = 1;
20097
- // base-x encoding / decoding
20098
- // Copyright (c) 2018 base-x contributors
20099
- // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
20100
- // Distributed under the MIT software license, see the accompanying
20101
- // file LICENSE or http://www.opensource.org/licenses/mit-license.php.
20102
- Object.defineProperty(cjs, '__esModule', { value: true });
20103
- function base (ALPHABET) {
20104
- if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
20105
- const BASE_MAP = new Uint8Array(256);
20106
- for (let j = 0; j < BASE_MAP.length; j++) {
20107
- BASE_MAP[j] = 255;
20108
- }
20109
- for (let i = 0; i < ALPHABET.length; i++) {
20110
- const x = ALPHABET.charAt(i);
20111
- const xc = x.charCodeAt(0);
20112
- if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
20113
- BASE_MAP[xc] = i;
20114
- }
20115
- const BASE = ALPHABET.length;
20116
- const LEADER = ALPHABET.charAt(0);
20117
- const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
20118
- const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
20119
- function encode (source) {
20120
- // eslint-disable-next-line no-empty
20121
- if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
20122
- source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
20123
- } else if (Array.isArray(source)) {
20124
- source = Uint8Array.from(source);
20125
- }
20126
- if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
20127
- if (source.length === 0) { return '' }
20128
- // Skip & count leading zeroes.
20129
- let zeroes = 0;
20130
- let length = 0;
20131
- let pbegin = 0;
20132
- const pend = source.length;
20133
- while (pbegin !== pend && source[pbegin] === 0) {
20134
- pbegin++;
20135
- zeroes++;
20136
- }
20137
- // Allocate enough space in big-endian base58 representation.
20138
- const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
20139
- const b58 = new Uint8Array(size);
20140
- // Process the bytes.
20141
- while (pbegin !== pend) {
20142
- let carry = source[pbegin];
20143
- // Apply "b58 = b58 * 256 + ch".
20144
- let i = 0;
20145
- for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
20146
- carry += (256 * b58[it1]) >>> 0;
20147
- b58[it1] = (carry % BASE) >>> 0;
20148
- carry = (carry / BASE) >>> 0;
20149
- }
20150
- if (carry !== 0) { throw new Error('Non-zero carry') }
20151
- length = i;
20152
- pbegin++;
20153
- }
20154
- // Skip leading zeroes in base58 result.
20155
- let it2 = size - length;
20156
- while (it2 !== size && b58[it2] === 0) {
20157
- it2++;
20158
- }
20159
- // Translate the result into a string.
20160
- let str = LEADER.repeat(zeroes);
20161
- for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
20162
- return str
20163
- }
20164
- function decodeUnsafe (source) {
20165
- if (typeof source !== 'string') { throw new TypeError('Expected String') }
20166
- if (source.length === 0) { return new Uint8Array() }
20167
- let psz = 0;
20168
- // Skip and count leading '1's.
20169
- let zeroes = 0;
20170
- let length = 0;
20171
- while (source[psz] === LEADER) {
20172
- zeroes++;
20173
- psz++;
20174
- }
20175
- // Allocate enough space in big-endian base256 representation.
20176
- const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
20177
- const b256 = new Uint8Array(size);
20178
- // Process the characters.
20179
- while (psz < source.length) {
20180
- // Find code of next character
20181
- const charCode = source.charCodeAt(psz);
20182
- // Base map can not be indexed using char code
20183
- if (charCode > 255) { return }
20184
- // Decode character
20185
- let carry = BASE_MAP[charCode];
20186
- // Invalid character
20187
- if (carry === 255) { return }
20188
- let i = 0;
20189
- for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
20190
- carry += (BASE * b256[it3]) >>> 0;
20191
- b256[it3] = (carry % 256) >>> 0;
20192
- carry = (carry / 256) >>> 0;
20193
- }
20194
- if (carry !== 0) { throw new Error('Non-zero carry') }
20195
- length = i;
20196
- psz++;
20197
- }
20198
- // Skip leading zeroes in b256.
20199
- let it4 = size - length;
20200
- while (it4 !== size && b256[it4] === 0) {
20201
- it4++;
20202
- }
20203
- const vch = new Uint8Array(zeroes + (size - it4));
20204
- let j = zeroes;
20205
- while (it4 !== size) {
20206
- vch[j++] = b256[it4++];
20207
- }
20208
- return vch
20209
- }
20210
- function decode (string) {
20211
- const buffer = decodeUnsafe(string);
20212
- if (buffer) { return buffer }
20213
- throw new Error('Non-base' + BASE + ' character')
20214
- }
20215
- return {
20216
- encode,
20217
- decodeUnsafe,
20218
- decode
20219
- }
20220
- }
20221
- cjs.default = base;
20222
- return cjs;
20223
- }
20224
-
20225
- var bs58;
20226
- var hasRequiredBs58;
20227
-
20228
- function requireBs58 () {
20229
- if (hasRequiredBs58) return bs58;
20230
- hasRequiredBs58 = 1;
20231
- var basex = requireCjs();
20232
- var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
20233
-
20234
- bs58 = basex(ALPHABET);
20235
- return bs58;
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
+ }
20236
20260
  }
20237
20261
 
20238
- var bs58Exports = requireBs58();
20239
- var base58 = /*@__PURE__*/getDefaultExportFromCjs$1(bs58Exports);
20262
+ var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
20263
+ var base58 = base(ALPHABET);
20240
20264
 
20241
- var index = /*#__PURE__*/_mergeNamespaces({
20265
+ var index = /*#__PURE__*/Object.freeze({
20242
20266
  __proto__: null,
20243
20267
  default: base58
20244
- }, [bs58Exports]);
20268
+ });
20245
20269
 
20246
20270
  const SURFNET_RPC_URL$1 = "https://surfpool.fly.dev";
20247
20271
  let React;
@@ -21155,7 +21179,7 @@ async function loadMwaProtocol() {
21155
21179
  return mwaProtocolLoadPromise;
21156
21180
  mwaProtocolLoadPromise = (async () => {
21157
21181
  try {
21158
- mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-d0PlOXpF.js'); });
21182
+ mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-XpeHKCJM.js'); });
21159
21183
  }
21160
21184
  catch (e) {
21161
21185
  console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
@@ -21177,7 +21201,7 @@ async function registerMobileWalletAdapter(config) {
21177
21201
  if (typeof window === 'undefined')
21178
21202
  return;
21179
21203
  try {
21180
- const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-CT6PUv9G.js'); });
21204
+ const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-BgibQtKi.js'); });
21181
21205
  const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
21182
21206
  if (!registerMwa) {
21183
21207
  console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
@@ -21307,6 +21331,19 @@ class SolanaMobileWalletProvider {
21307
21331
  async login() {
21308
21332
  var _a, _b, _c, _d, _e;
21309
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) { }
21310
21347
  try {
21311
21348
  await loadMwaProtocol();
21312
21349
  const { transact } = mwaProtocolModule;
@@ -21372,12 +21409,22 @@ class SolanaMobileWalletProvider {
21372
21409
  try {
21373
21410
  getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');
21374
21411
  }
21375
- catch (_f) { }
21412
+ catch (_h) { }
21376
21413
  const user = { provider: this, address: result.base58Address };
21377
21414
  setCurrentUser(user);
21378
21415
  return user;
21379
21416
  }
21380
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) { }
21381
21428
  const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||
21382
21429
  ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('user rejected')) ||
21383
21430
  ((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('user denied')) ||
@@ -21423,6 +21470,12 @@ class SolanaMobileWalletProvider {
21423
21470
  this.authorizedPublicKey = null;
21424
21471
  this.publicKeyObj = null;
21425
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) { }
21426
21479
  setCurrentUser(null);
21427
21480
  }
21428
21481
  async signMessage(message) {
@@ -22102,7 +22155,6 @@ exports.bufferExports = bufferExports;
22102
22155
  exports.buildSetDocumentsTransaction = buildSetDocumentsTransaction;
22103
22156
  exports.clearCache = clearCache;
22104
22157
  exports.closeAllSubscriptions = closeAllSubscriptions;
22105
- exports.commonjsRequire = commonjsRequire;
22106
22158
  exports.convertRemainingAccounts = convertRemainingAccounts;
22107
22159
  exports.count = count;
22108
22160
  exports.createSessionWithPrivy = createSessionWithPrivy;
@@ -22130,7 +22182,6 @@ exports.onAuthStateChanged = onAuthStateChanged;
22130
22182
  exports.reconnectWithNewAuth = reconnectWithNewAuth;
22131
22183
  exports.refreshSession = refreshSession;
22132
22184
  exports.registerMobileWalletAdapter = registerMobileWalletAdapter;
22133
- exports.require$$0 = require$$0;
22134
22185
  exports.runExpression = runExpression;
22135
22186
  exports.runExpressionMany = runExpressionMany;
22136
22187
  exports.runQuery = runQuery;
@@ -22145,4 +22196,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
22145
22196
  exports.signTransaction = signTransaction;
22146
22197
  exports.subscribe = subscribe;
22147
22198
  exports.useAuth = useAuth;
22148
- //# sourceMappingURL=index-B2WGCssJ.js.map
22199
+ //# sourceMappingURL=index-CYhzBf0k.js.map