@pooflabs/web 0.0.83 → 0.0.85-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/auth/providers/solana-mobile-wallet-provider.d.ts +42 -20
- package/dist/{index-CpaP1yGp.esm.js → index-4TKz3Mn_.esm.js} +14 -364
- package/dist/index-4TKz3Mn_.esm.js.map +1 -0
- package/dist/{index-FviRSm3S.js → index-BoWQVxMI.js} +13 -363
- package/dist/index-BoWQVxMI.js.map +1 -0
- package/dist/{index-CP_wLmYu.esm.js → index-Buu8v-Oe.esm.js} +13 -363
- package/dist/index-Buu8v-Oe.esm.js.map +1 -0
- package/dist/{index-BxXQhFLQ.js → index-C2p1Cldz.js} +14 -364
- package/dist/index-C2p1Cldz.js.map +1 -0
- package/dist/index-COF6zNCs.esm.js +6 -0
- package/dist/index-COF6zNCs.esm.js.map +1 -0
- package/dist/{index-DQWyH96R.js → index-DlyeWzMk.js} +2 -2
- package/dist/index-DlyeWzMk.js.map +1 -0
- package/dist/{index-DP0xF34Z.js → index-R7cvXys2.js} +486 -299
- package/dist/index-R7cvXys2.js.map +1 -0
- package/dist/{index-B7yaLhND.esm.js → index-ZKzq5QT_.esm.js} +487 -300
- package/dist/index-ZKzq5QT_.esm.js.map +1 -0
- package/dist/{index.browser-_zN3Uapq.js → index.browser-BQSN-6X2.js} +846 -815
- package/dist/index.browser-BQSN-6X2.js.map +1 -0
- package/dist/index.browser-DZCNegue.js +6070 -0
- package/dist/index.browser-DZCNegue.js.map +1 -0
- package/dist/{index.browser-B_wQp2A8.esm.js → index.browser-tPepE5fo.esm.js} +836 -802
- package/dist/index.browser-tPepE5fo.esm.js.map +1 -0
- package/dist/index.browser-zfGYm0ST.esm.js +6060 -0
- package/dist/index.browser-zfGYm0ST.esm.js.map +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.native-Dkf8NZ2O.js → index.native-BGaUOX9f.js} +61 -42
- package/dist/index.native-BGaUOX9f.js.map +1 -0
- package/dist/{index.native-CyEwEeKr.esm.js → index.native-BPQqeP6_.esm.js} +62 -43
- package/dist/index.native-BPQqeP6_.esm.js.map +1 -0
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +1 -1
- package/dist/{phantom-wallet-provider-fkcFbwPk.esm.js → phantom-wallet-provider-DheGhOp4.esm.js} +37 -6
- package/dist/phantom-wallet-provider-DheGhOp4.esm.js.map +1 -0
- package/dist/{phantom-wallet-provider-CVyVJmH0.js → phantom-wallet-provider-MFcwrRpJ.js} +37 -6
- package/dist/phantom-wallet-provider-MFcwrRpJ.js.map +1 -0
- package/dist/{privy-wallet-provider-CrBZ52nR.js → privy-wallet-provider-CFw6o7O5.js} +3 -3
- package/dist/privy-wallet-provider-CFw6o7O5.js.map +1 -0
- package/dist/{privy-wallet-provider-CpHAxPcv.esm.js → privy-wallet-provider-D15Au3j8.esm.js} +3 -3
- package/dist/privy-wallet-provider-D15Au3j8.esm.js.map +1 -0
- package/dist/solana-mobile-wallet-provider-BM9wdF0m.js +719 -0
- package/dist/solana-mobile-wallet-provider-BM9wdF0m.js.map +1 -0
- package/dist/solana-mobile-wallet-provider-ChHh-U_p.esm.js +698 -0
- package/dist/solana-mobile-wallet-provider-ChHh-U_p.esm.js.map +1 -0
- package/package.json +3 -2
- package/dist/index-B7yaLhND.esm.js.map +0 -1
- package/dist/index-BxXQhFLQ.js.map +0 -1
- package/dist/index-CP_wLmYu.esm.js.map +0 -1
- package/dist/index-CpaP1yGp.esm.js.map +0 -1
- package/dist/index-DP0xF34Z.js.map +0 -1
- package/dist/index-DQWyH96R.js.map +0 -1
- package/dist/index-DfOd8wW4.esm.js +0 -6
- package/dist/index-DfOd8wW4.esm.js.map +0 -1
- package/dist/index-FviRSm3S.js.map +0 -1
- package/dist/index.browser-1_M66nQ6.esm.js +0 -1096
- package/dist/index.browser-1_M66nQ6.esm.js.map +0 -1
- package/dist/index.browser-B_wQp2A8.esm.js.map +0 -1
- package/dist/index.browser-BfnOoa_h.js +0 -1099
- package/dist/index.browser-BfnOoa_h.js.map +0 -1
- package/dist/index.browser-BhppfDyf.js +0 -105
- package/dist/index.browser-BhppfDyf.js.map +0 -1
- package/dist/index.browser-OvGNsMPu.esm.js +0 -1002
- package/dist/index.browser-OvGNsMPu.esm.js.map +0 -1
- package/dist/index.browser-_zN3Uapq.js.map +0 -1
- package/dist/index.browser-vUinl_9y.esm.js +0 -102
- package/dist/index.browser-vUinl_9y.esm.js.map +0 -1
- package/dist/index.browser-vuTr40so.js +0 -1008
- package/dist/index.browser-vuTr40so.js.map +0 -1
- package/dist/index.native-CyEwEeKr.esm.js.map +0 -1
- package/dist/index.native-Dkf8NZ2O.js.map +0 -1
- package/dist/phantom-wallet-provider-CVyVJmH0.js.map +0 -1
- package/dist/phantom-wallet-provider-fkcFbwPk.esm.js.map +0 -1
- package/dist/privy-wallet-provider-CpHAxPcv.esm.js.map +0 -1
- package/dist/privy-wallet-provider-CrBZ52nR.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-CAaGfPZJ.js +0 -579
- package/dist/solana-mobile-wallet-provider-CAaGfPZJ.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-DGyWHJVI.esm.js +0 -558
- package/dist/solana-mobile-wallet-provider-DGyWHJVI.esm.js.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { H as DEFAULT_TEST_ADDRESS, L as InsufficientBalanceError, M as MockAuthProvider, O as OffchainAuthProvider, P as PhantomWalletProvider, K as PrivyExpoProvider, G as PrivyWalletProvider, R as ReactNativeSessionManager, N as ServerSessionManager, S as SolanaMobileWalletProvider, W as WebSessionManager, z as aggregate, Q as buildSetDocumentsTransaction, T as clearCache, U as closeAllSubscriptions, V as convertRemainingAccounts, y as count, X as createSessionWithPrivy, Y as createSessionWithSignature, C as deserializeTransaction, Z as genAuthNonce, _ as genSolanaMessage, k as get, e as getAuthLoading, j as getAuthProvider, $ as getCachedData, h as getConfig, c as getCurrentUser, p as getFiles, D as getIdToken, a0 as getMany, F as getPlatform, i as init, I as isMobileWalletAvailable, l as login, f as logout, d as onAuthLoadingChanged, o as onAuthStateChanged, a1 as reconnectWithNewAuth, a2 as refreshSession, J as registerMobileWalletAdapter, t as runExpression, u as runExpressionMany, r as runQuery, q as runQueryMany, s as set, n as setFile, m as setMany, E as setPlatform, x as signAndSubmitTransaction, v as signMessage, a3 as signSessionCreateMessage, w as signTransaction, A as subscribe, B as useAuth } from './index-
|
|
1
|
+
export { H as DEFAULT_TEST_ADDRESS, L as InsufficientBalanceError, M as MockAuthProvider, O as OffchainAuthProvider, P as PhantomWalletProvider, K as PrivyExpoProvider, G as PrivyWalletProvider, R as ReactNativeSessionManager, N as ServerSessionManager, S as SolanaMobileWalletProvider, W as WebSessionManager, z as aggregate, Q as buildSetDocumentsTransaction, T as clearCache, U as closeAllSubscriptions, V as convertRemainingAccounts, y as count, X as createSessionWithPrivy, Y as createSessionWithSignature, C as deserializeTransaction, Z as genAuthNonce, _ as genSolanaMessage, k as get, e as getAuthLoading, j as getAuthProvider, $ as getCachedData, h as getConfig, c as getCurrentUser, p as getFiles, D as getIdToken, a0 as getMany, F as getPlatform, i as init, I as isMobileWalletAvailable, l as login, f as logout, d as onAuthLoadingChanged, o as onAuthStateChanged, a1 as reconnectWithNewAuth, a2 as refreshSession, J as registerMobileWalletAdapter, t as runExpression, u as runExpressionMany, r as runQuery, q as runQueryMany, s as set, n as setFile, m as setMany, E as setPlatform, x as signAndSubmitTransaction, v as signMessage, a3 as signSessionCreateMessage, w as signTransaction, A as subscribe, B as useAuth } from './index-ZKzq5QT_.esm.js';
|
|
2
2
|
import 'axios';
|
|
3
3
|
import '@solana/web3.js';
|
|
4
4
|
import '@coral-xyz/anchor';
|
package/dist/index.js
CHANGED
|
@@ -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);
|
|
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$1 () {
|
|
|
9483
9490
|
}
|
|
9484
9491
|
|
|
9485
9492
|
var bs58$1;
|
|
9486
|
-
var hasRequiredBs58
|
|
9493
|
+
var hasRequiredBs58;
|
|
9487
9494
|
|
|
9488
|
-
function requireBs58
|
|
9489
|
-
if (hasRequiredBs58
|
|
9490
|
-
hasRequiredBs58
|
|
9495
|
+
function requireBs58 () {
|
|
9496
|
+
if (hasRequiredBs58) return bs58$1;
|
|
9497
|
+
hasRequiredBs58 = 1;
|
|
9491
9498
|
var basex = requireSrc$1();
|
|
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
|
|
9499
|
-
var bs58
|
|
9505
|
+
var bs58Exports = requireBs58();
|
|
9506
|
+
var bs58 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports);
|
|
9500
9507
|
|
|
9501
9508
|
// ─────────────────────────────────────────────────────────────
|
|
9502
9509
|
// Local implementation of getSimulationComputeUnits
|
|
@@ -9758,7 +9765,7 @@ function loadKeypairFromEnv() {
|
|
|
9758
9765
|
try {
|
|
9759
9766
|
const secretKey = secret.trim().startsWith("[")
|
|
9760
9767
|
? Uint8Array.from(JSON.parse(secret))
|
|
9761
|
-
: bs58
|
|
9768
|
+
: bs58.decode(secret.trim());
|
|
9762
9769
|
return web3_js.Keypair.fromSecretKey(secretKey);
|
|
9763
9770
|
}
|
|
9764
9771
|
catch (err) {
|
|
@@ -11703,6 +11710,28 @@ class ReactNativeSessionManager {
|
|
|
11703
11710
|
/* STORE */
|
|
11704
11711
|
/* ------------------------------------------------------------------ */
|
|
11705
11712
|
static async storeSession(address, accessToken, idToken, refreshToken) {
|
|
11713
|
+
// JWT-wallet binding: refuse to store a session whose idToken is bound
|
|
11714
|
+
// to a different wallet than `address`. Prevents races that would otherwise
|
|
11715
|
+
// leave storage with mismatched address/token state.
|
|
11716
|
+
try {
|
|
11717
|
+
const payloadB64 = idToken.split(".")[1];
|
|
11718
|
+
if (payloadB64) {
|
|
11719
|
+
const payload = JSON.parse(this.decodeBase64Url(payloadB64));
|
|
11720
|
+
const tokenWallet = payload["custom:walletAddress"];
|
|
11721
|
+
if (tokenWallet && tokenWallet !== address) {
|
|
11722
|
+
throw new Error(`[ReactNativeSessionManager] Refusing to store session: address (${address}) does not match idToken custom:walletAddress (${tokenWallet})`);
|
|
11723
|
+
}
|
|
11724
|
+
if (!tokenWallet) {
|
|
11725
|
+
console.warn("[ReactNativeSessionManager] storeSession: idToken has no custom:walletAddress claim — writing without validation");
|
|
11726
|
+
}
|
|
11727
|
+
}
|
|
11728
|
+
}
|
|
11729
|
+
catch (err) {
|
|
11730
|
+
if (typeof (err === null || err === void 0 ? void 0 : err.message) === "string" && err.message.includes("Refusing to store session")) {
|
|
11731
|
+
throw err;
|
|
11732
|
+
}
|
|
11733
|
+
console.warn("[ReactNativeSessionManager] storeSession: failed to decode idToken for validation:", err);
|
|
11734
|
+
}
|
|
11706
11735
|
const config = await getConfig();
|
|
11707
11736
|
const currentAppId = config.appId;
|
|
11708
11737
|
this.getStorage().setItem(this.TAROBASE_SESSION_STORAGE_KEY, JSON.stringify({
|
|
@@ -12857,15 +12886,15 @@ function clearIncompatibleSession() {
|
|
|
12857
12886
|
// Lazy loaders for web-only providers.
|
|
12858
12887
|
// Using dynamic import() ensures Metro (RN) never resolves these modules.
|
|
12859
12888
|
async function loadPrivyWalletProvider() {
|
|
12860
|
-
const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-
|
|
12889
|
+
const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-CFw6o7O5.js'); });
|
|
12861
12890
|
return mod.PrivyWalletProvider;
|
|
12862
12891
|
}
|
|
12863
12892
|
async function loadPhantomWalletProvider() {
|
|
12864
|
-
const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-
|
|
12893
|
+
const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-MFcwrRpJ.js'); });
|
|
12865
12894
|
return { PhantomWalletProvider: mod.PhantomWalletProvider };
|
|
12866
12895
|
}
|
|
12867
12896
|
async function loadSolanaMobileWalletProvider() {
|
|
12868
|
-
const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-
|
|
12897
|
+
const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-BM9wdF0m.js'); });
|
|
12869
12898
|
return mod.SolanaMobileWalletProvider;
|
|
12870
12899
|
}
|
|
12871
12900
|
async function hotSwapToPrivyProvider(config) {
|
|
@@ -15861,26 +15890,16 @@ function requireSrc () {
|
|
|
15861
15890
|
return src;
|
|
15862
15891
|
}
|
|
15863
15892
|
|
|
15864
|
-
var
|
|
15865
|
-
var
|
|
15893
|
+
var srcExports = requireSrc();
|
|
15894
|
+
var basex = /*@__PURE__*/getDefaultExportFromCjs$1(srcExports);
|
|
15866
15895
|
|
|
15867
|
-
|
|
15868
|
-
|
|
15869
|
-
hasRequiredBs58 = 1;
|
|
15870
|
-
var basex = requireSrc();
|
|
15871
|
-
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
15896
|
+
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
15897
|
+
var base58 = basex(ALPHABET);
|
|
15872
15898
|
|
|
15873
|
-
|
|
15874
|
-
return bs58;
|
|
15875
|
-
}
|
|
15876
|
-
|
|
15877
|
-
var bs58Exports = requireBs58();
|
|
15878
|
-
var base58 = /*@__PURE__*/getDefaultExportFromCjs$1(bs58Exports);
|
|
15879
|
-
|
|
15880
|
-
var index = /*#__PURE__*/_mergeNamespaces({
|
|
15899
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
15881
15900
|
__proto__: null,
|
|
15882
15901
|
default: base58
|
|
15883
|
-
}
|
|
15902
|
+
});
|
|
15884
15903
|
|
|
15885
15904
|
/**
|
|
15886
15905
|
* Privy Expo Auth Provider — React Native implementation of AuthProvider.
|
|
@@ -16283,4 +16302,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
|
16283
16302
|
exports.signTransaction = signTransaction;
|
|
16284
16303
|
exports.subscribe = subscribe;
|
|
16285
16304
|
exports.useAuth = useAuth;
|
|
16286
|
-
//# sourceMappingURL=index.native-
|
|
16305
|
+
//# sourceMappingURL=index.native-BGaUOX9f.js.map
|