@bounded-sh/client 0.0.110 → 0.0.111
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/README.md +1 -1
- package/dist/auth/solana-rpc.d.ts +9 -0
- package/dist/{email-auth-provider-BPeQo6xL.mjs → email-auth-provider-BfBvF_4M.mjs} +2 -2
- package/dist/{email-auth-provider-D9SQu9c1.mjs.map → email-auth-provider-BfBvF_4M.mjs.map} +1 -1
- package/dist/{email-auth-provider-D9SQu9c1.mjs → email-auth-provider-CVp6hSCo.mjs} +2 -2
- package/dist/{email-auth-provider-BPeQo6xL.mjs.map → email-auth-provider-CVp6hSCo.mjs.map} +1 -1
- package/dist/{email-auth-provider-Czo-xM6n.js → email-auth-provider-CiqhQ1c2.js} +2 -2
- package/dist/{email-auth-provider-Czo-xM6n.js.map → email-auth-provider-CiqhQ1c2.js.map} +1 -1
- package/dist/{email-auth-provider-T-Go_9h9.js → email-auth-provider-DxS2WYxM.js} +2 -2
- package/dist/{email-auth-provider-T-Go_9h9.js.map → email-auth-provider-DxS2WYxM.js.map} +1 -1
- package/dist/{guest-auth-provider-BIohNOHi.mjs → guest-auth-provider-Bm_yqQF6.mjs} +2 -2
- package/dist/{guest-auth-provider-DsFTB844.mjs.map → guest-auth-provider-Bm_yqQF6.mjs.map} +1 -1
- package/dist/{guest-auth-provider-DsFTB844.mjs → guest-auth-provider-Cc8y4Qd1.mjs} +2 -2
- package/dist/{guest-auth-provider-BIohNOHi.mjs.map → guest-auth-provider-Cc8y4Qd1.mjs.map} +1 -1
- package/dist/{guest-auth-provider-DJ5nCGjq.js → guest-auth-provider-D9FGNuP9.js} +2 -2
- package/dist/{guest-auth-provider-DJ5nCGjq.js.map → guest-auth-provider-D9FGNuP9.js.map} +1 -1
- package/dist/{guest-auth-provider-BDhwvzem.js → guest-auth-provider-DDBXeHoo.js} +2 -2
- package/dist/{guest-auth-provider-BDhwvzem.js.map → guest-auth-provider-DDBXeHoo.js.map} +1 -1
- package/dist/{index-DbXoOlIa.mjs → index-B9__gwTi.mjs} +52 -16
- package/dist/index-B9__gwTi.mjs.map +1 -0
- package/dist/{index-Cs5nPIzA.js → index-BghQ8jX0.js} +52 -16
- package/dist/index-BghQ8jX0.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index.native-BSOqaKIz.mjs → index.native-BHjpXkKQ.mjs} +53 -15
- package/dist/index.native-BHjpXkKQ.mjs.map +1 -0
- package/dist/{index.native-BpcNwWQX.js → index.native-B_AFa0GD.js} +53 -15
- package/dist/index.native-B_AFa0GD.js.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-Xb2G-ZGI.mjs → injected-evm-wallet-provider-BUjqxQxp.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-Xb2G-ZGI.mjs.map → injected-evm-wallet-provider-BUjqxQxp.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BjqqLfPD.mjs → injected-evm-wallet-provider-CIeCSOPL.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-BjqqLfPD.mjs.map → injected-evm-wallet-provider-CIeCSOPL.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-CMl0Fyxk.js → injected-evm-wallet-provider-Ckb85p6a.js} +2 -2
- package/dist/{injected-evm-wallet-provider-CMl0Fyxk.js.map → injected-evm-wallet-provider-Ckb85p6a.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-_UNpc_hM.js → injected-evm-wallet-provider-DeLUwvGs.js} +2 -2
- package/dist/{injected-evm-wallet-provider-_UNpc_hM.js.map → injected-evm-wallet-provider-DeLUwvGs.js.map} +1 -1
- package/dist/{injected-wallet-provider-DZOwvKgd.mjs → injected-wallet-provider-BEuj4sM3.mjs} +2 -2
- package/dist/{injected-wallet-provider-DZOwvKgd.mjs.map → injected-wallet-provider-BEuj4sM3.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-D-Pq9QVK.mjs → injected-wallet-provider-BlzA0J_V.mjs} +2 -2
- package/dist/{injected-wallet-provider-D-Pq9QVK.mjs.map → injected-wallet-provider-BlzA0J_V.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-C7Q0haGY.js → injected-wallet-provider-CUKdAuFu.js} +2 -2
- package/dist/{injected-wallet-provider-C7Q0haGY.js.map → injected-wallet-provider-CUKdAuFu.js.map} +1 -1
- package/dist/{injected-wallet-provider-CgHOrtmj.js → injected-wallet-provider-Cfb4ayCP.js} +2 -2
- package/dist/{injected-wallet-provider-CgHOrtmj.js.map → injected-wallet-provider-Cfb4ayCP.js.map} +1 -1
- package/package.json +2 -2
- package/dist/index-Cs5nPIzA.js.map +0 -1
- package/dist/index-DbXoOlIa.mjs.map +0 -1
- package/dist/index.native-BSOqaKIz.mjs.map +0 -1
- package/dist/index.native-BpcNwWQX.js.map +0 -1
|
@@ -707,6 +707,8 @@ async function clearSessionProviderForLogout() {
|
|
|
707
707
|
setStoredAuthMethod(null);
|
|
708
708
|
}
|
|
709
709
|
|
|
710
|
+
const SOLANA_DEVNET_RPC_URL = "https://idelle-8nxsep-fast-devnet.helius-rpc.com";
|
|
711
|
+
const SOLANA_MAINNET_RPC_URL = "https://celestia-cegncv-fast-mainnet.helius-rpc.com";
|
|
710
712
|
const SUPPORTED_SOLANA_NETWORKS = new Set([
|
|
711
713
|
"solana_devnet",
|
|
712
714
|
"solana_mainnet",
|
|
@@ -736,15 +738,35 @@ function resolveSolanaWalletStandardChain(network, context) {
|
|
|
736
738
|
`Expected one of: solana_devnet, solana_mainnet.`);
|
|
737
739
|
}
|
|
738
740
|
}
|
|
741
|
+
/**
|
|
742
|
+
* The platform RPC endpoint for a supported Solana network, or null when the
|
|
743
|
+
* network is missing or unsupported. Used when the app passes no rpcUrl.
|
|
744
|
+
*/
|
|
745
|
+
function defaultSolanaRpcUrl(network) {
|
|
746
|
+
switch (network) {
|
|
747
|
+
case "solana_mainnet":
|
|
748
|
+
return SOLANA_MAINNET_RPC_URL;
|
|
749
|
+
case "solana_devnet":
|
|
750
|
+
return SOLANA_DEVNET_RPC_URL;
|
|
751
|
+
default:
|
|
752
|
+
return null;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* An explicit rpcUrl always wins. Otherwise the platform RPC for the configured
|
|
757
|
+
* network is used. With neither, fail closed.
|
|
758
|
+
*/
|
|
739
759
|
function resolveSolanaRpcUrl(explicitRpcUrl, network, context) {
|
|
760
|
+
var _a;
|
|
740
761
|
if (network != null && network !== "" && !isSupportedSolanaRpcNetwork(network)) {
|
|
741
762
|
throw new Error(`${context} does not support Solana network "${network}". ` +
|
|
742
763
|
`Expected one of: solana_devnet, solana_mainnet.`);
|
|
743
764
|
}
|
|
744
|
-
const rpcUrl = normalizeSolanaRpcUrl(explicitRpcUrl);
|
|
765
|
+
const rpcUrl = (_a = normalizeSolanaRpcUrl(explicitRpcUrl)) !== null && _a !== void 0 ? _a : defaultSolanaRpcUrl(network);
|
|
745
766
|
if (rpcUrl)
|
|
746
767
|
return rpcUrl;
|
|
747
|
-
throw new Error(`${context} requires
|
|
768
|
+
throw new Error(`${context} requires a Solana network. Set init({ chain: "solana_mainnet" | "solana_devnet" }) ` +
|
|
769
|
+
`or pass config.rpcUrl before signing or submitting onchain transactions.`);
|
|
748
770
|
}
|
|
749
771
|
|
|
750
772
|
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
@@ -5887,7 +5909,7 @@ async function getAuthProvider(config) {
|
|
|
5887
5909
|
// manager as legacy email sessions. Human login should be started
|
|
5888
5910
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
5889
5911
|
// logout surface for those sessions.
|
|
5890
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-
|
|
5912
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-CiqhQ1c2.js'); })).EmailAuthProvider();
|
|
5891
5913
|
break;
|
|
5892
5914
|
case "phantom": {
|
|
5893
5915
|
// First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
|
|
@@ -5929,7 +5951,7 @@ async function getAuthProvider(config) {
|
|
|
5929
5951
|
// (bounded-login-widget.ts), so registration never counts as
|
|
5930
5952
|
// evidence the user has a wallet.
|
|
5931
5953
|
await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
|
|
5932
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
5954
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-CUKdAuFu.js'); });
|
|
5933
5955
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
5934
5956
|
break;
|
|
5935
5957
|
}
|
|
@@ -5942,7 +5964,7 @@ async function getAuthProvider(config) {
|
|
|
5942
5964
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
5943
5965
|
// to point at a specific wallet or set chainId/domain.
|
|
5944
5966
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
5945
|
-
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-
|
|
5967
|
+
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-DeLUwvGs.js'); });
|
|
5946
5968
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
5947
5969
|
break;
|
|
5948
5970
|
}
|
|
@@ -5967,7 +5989,7 @@ async function getAuthProvider(config) {
|
|
|
5967
5989
|
break;
|
|
5968
5990
|
case "guest":
|
|
5969
5991
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
5970
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
5992
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-D9FGNuP9.js'); })).GuestAuthProvider();
|
|
5971
5993
|
break;
|
|
5972
5994
|
}
|
|
5973
5995
|
if (!currentAuthProvider) {
|
|
@@ -6029,7 +6051,7 @@ async function signInAnonymously() {
|
|
|
6029
6051
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
6030
6052
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
6031
6053
|
// so bundle-splitting can see it.
|
|
6032
|
-
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6054
|
+
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-D9FGNuP9.js'); })).GuestAuthProvider();
|
|
6033
6055
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
6034
6056
|
// adoptSessionProvider awaits only getConfig() (already resolved here) and then
|
|
6035
6057
|
// runs every write - provider/method/config/marker/user - in one synchronous
|
|
@@ -6200,7 +6222,7 @@ function ensureSharedWalletLoginReady() {
|
|
|
6200
6222
|
if (!sharedWalletReady) {
|
|
6201
6223
|
sharedWalletReady = (async () => {
|
|
6202
6224
|
await core.getConfig();
|
|
6203
|
-
await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6225
|
+
await Promise.resolve().then(function () { return require('./injected-wallet-provider-CUKdAuFu.js'); });
|
|
6204
6226
|
})().catch((error) => {
|
|
6205
6227
|
sharedWalletReady = null;
|
|
6206
6228
|
throw error;
|
|
@@ -6421,6 +6443,17 @@ async function logout$1(options) {
|
|
|
6421
6443
|
}
|
|
6422
6444
|
}
|
|
6423
6445
|
|
|
6446
|
+
/**
|
|
6447
|
+
* An explicit rpcUrl wins; otherwise a Solana chain gets the platform RPC so
|
|
6448
|
+
* every onchain path (wallet signing, submission, reconcile) has one.
|
|
6449
|
+
*/
|
|
6450
|
+
function withDefaultSolanaRpcUrl(config) {
|
|
6451
|
+
var _a;
|
|
6452
|
+
if (normalizeSolanaRpcUrl(config.rpcUrl))
|
|
6453
|
+
return config;
|
|
6454
|
+
const rpcUrl = defaultSolanaRpcUrl((_a = config.chain) === null || _a === void 0 ? void 0 : _a.trim());
|
|
6455
|
+
return rpcUrl ? Object.assign(Object.assign({}, config), { rpcUrl }) : config;
|
|
6456
|
+
}
|
|
6424
6457
|
/**
|
|
6425
6458
|
* Subscribed once per process, not per init(): re-registering on every init would
|
|
6426
6459
|
* stack duplicate handlers on repeated initialization.
|
|
@@ -6489,7 +6522,8 @@ let initializationGeneration = 0;
|
|
|
6489
6522
|
function getInitializationGeneration() { return initializationGeneration; }
|
|
6490
6523
|
// This file acts as a middleware for the global state of the SDK
|
|
6491
6524
|
// This mostly involves setting up the AuthProvider and managing the current user
|
|
6492
|
-
async function initialize(
|
|
6525
|
+
async function initialize(requestedConfig) {
|
|
6526
|
+
const newConfig = withDefaultSolanaRpcUrl(requestedConfig);
|
|
6493
6527
|
// Mark auth as loading for the ENTIRE init/restore window so consumers render
|
|
6494
6528
|
// a neutral/loading state instead of the signed-out UI while we rehydrate the
|
|
6495
6529
|
// session — otherwise getCurrentUser() is null + loading is false during the
|
|
@@ -8417,7 +8451,7 @@ class PrivyExpoProvider {
|
|
|
8417
8451
|
if (isLegacyTx) {
|
|
8418
8452
|
const legacyTx = transaction;
|
|
8419
8453
|
if (!legacyTx.recentBlockhash) {
|
|
8420
|
-
const rpcUrl = this.getRpcUrl();
|
|
8454
|
+
const rpcUrl = await this.getRpcUrl();
|
|
8421
8455
|
const connection = new Connection(rpcUrl, 'confirmed');
|
|
8422
8456
|
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');
|
|
8423
8457
|
legacyTx.recentBlockhash = blockhash;
|
|
@@ -8430,7 +8464,7 @@ class PrivyExpoProvider {
|
|
|
8430
8464
|
else {
|
|
8431
8465
|
const versionedTx = transaction;
|
|
8432
8466
|
if (!versionedTx.message.recentBlockhash) {
|
|
8433
|
-
const rpcUrl = this.getRpcUrl();
|
|
8467
|
+
const rpcUrl = await this.getRpcUrl();
|
|
8434
8468
|
const connection = new Connection(rpcUrl, 'confirmed');
|
|
8435
8469
|
const { blockhash } = await connection.getLatestBlockhash('confirmed');
|
|
8436
8470
|
versionedTx.message.recentBlockhash = blockhash;
|
|
@@ -8450,7 +8484,7 @@ class PrivyExpoProvider {
|
|
|
8450
8484
|
await this.ensureReady();
|
|
8451
8485
|
const { Connection, PublicKey } = await import('@solana/web3.js');
|
|
8452
8486
|
const wallet = await this.getWalletOrThrow('submitting this transaction');
|
|
8453
|
-
const rpcUrl = this.getRpcUrl();
|
|
8487
|
+
const rpcUrl = await this.getRpcUrl();
|
|
8454
8488
|
const connection = new Connection(rpcUrl, 'confirmed');
|
|
8455
8489
|
// Ensure blockhash.
|
|
8456
8490
|
// DS3-0414: a Solana signature covers the compiled message (recentBlockhash
|
|
@@ -8551,8 +8585,12 @@ class PrivyExpoProvider {
|
|
|
8551
8585
|
const txInfo = await confirmAndCheckTransaction(connection, signature);
|
|
8552
8586
|
return { signature, txInfo };
|
|
8553
8587
|
}
|
|
8554
|
-
|
|
8555
|
-
|
|
8588
|
+
// The constructor rpcUrl wins, then init()'s rpcUrl, then the platform RPC
|
|
8589
|
+
// for init()'s chain.
|
|
8590
|
+
async getRpcUrl() {
|
|
8591
|
+
var _a;
|
|
8592
|
+
const config = await core.getConfig();
|
|
8593
|
+
return resolveSolanaRpcUrl((_a = this.networkUrl) !== null && _a !== void 0 ? _a : config.rpcUrl, isSupportedSolanaRpcNetwork(config.chain) ? config.chain : null, "Privy Expo Solana transaction");
|
|
8556
8594
|
}
|
|
8557
8595
|
async ensureReady(timeoutMs = 15000) {
|
|
8558
8596
|
if (!this.privyMethods) {
|
|
@@ -8636,4 +8674,4 @@ exports.useAuth = useAuth;
|
|
|
8636
8674
|
exports.useBuildRun = useBuildRun;
|
|
8637
8675
|
exports.useQuery = useQuery;
|
|
8638
8676
|
exports.waitForAuthReady = waitForAuthReady;
|
|
8639
|
-
//# sourceMappingURL=index.native-
|
|
8677
|
+
//# sourceMappingURL=index.native-B_AFa0GD.js.map
|