@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
|
@@ -779,15 +779,35 @@ function resolveSolanaWalletStandardChain(network, context) {
|
|
|
779
779
|
`Expected one of: solana_devnet, solana_mainnet.`);
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
+
/**
|
|
783
|
+
* The platform RPC endpoint for a supported Solana network, or null when the
|
|
784
|
+
* network is missing or unsupported. Used when the app passes no rpcUrl.
|
|
785
|
+
*/
|
|
786
|
+
function defaultSolanaRpcUrl(network) {
|
|
787
|
+
switch (network) {
|
|
788
|
+
case "solana_mainnet":
|
|
789
|
+
return SOLANA_MAINNET_RPC_URL;
|
|
790
|
+
case "solana_devnet":
|
|
791
|
+
return SOLANA_DEVNET_RPC_URL;
|
|
792
|
+
default:
|
|
793
|
+
return null;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* An explicit rpcUrl always wins. Otherwise the platform RPC for the configured
|
|
798
|
+
* network is used. With neither, fail closed.
|
|
799
|
+
*/
|
|
782
800
|
function resolveSolanaRpcUrl(explicitRpcUrl, network, context) {
|
|
801
|
+
var _a;
|
|
783
802
|
if (network != null && network !== "" && !isSupportedSolanaRpcNetwork(network)) {
|
|
784
803
|
throw new Error(`${context} does not support Solana network "${network}". ` +
|
|
785
804
|
`Expected one of: solana_devnet, solana_mainnet.`);
|
|
786
805
|
}
|
|
787
|
-
const rpcUrl = normalizeSolanaRpcUrl(explicitRpcUrl);
|
|
806
|
+
const rpcUrl = (_a = normalizeSolanaRpcUrl(explicitRpcUrl)) !== null && _a !== void 0 ? _a : defaultSolanaRpcUrl(network);
|
|
788
807
|
if (rpcUrl)
|
|
789
808
|
return rpcUrl;
|
|
790
|
-
throw new Error(`${context} requires
|
|
809
|
+
throw new Error(`${context} requires a Solana network. Set init({ chain: "solana_mainnet" | "solana_devnet" }) ` +
|
|
810
|
+
`or pass config.rpcUrl before signing or submitting onchain transactions.`);
|
|
791
811
|
}
|
|
792
812
|
|
|
793
813
|
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
@@ -6181,7 +6201,7 @@ async function getAuthProvider(config) {
|
|
|
6181
6201
|
// manager as legacy email sessions. Human login should be started
|
|
6182
6202
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
6183
6203
|
// logout surface for those sessions.
|
|
6184
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-
|
|
6204
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-DxS2WYxM.js'); })).EmailAuthProvider();
|
|
6185
6205
|
break;
|
|
6186
6206
|
case "phantom": {
|
|
6187
6207
|
// First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
|
|
@@ -6223,7 +6243,7 @@ async function getAuthProvider(config) {
|
|
|
6223
6243
|
// (bounded-login-widget.ts), so registration never counts as
|
|
6224
6244
|
// evidence the user has a wallet.
|
|
6225
6245
|
await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
|
|
6226
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6246
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-Cfb4ayCP.js'); });
|
|
6227
6247
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
6228
6248
|
break;
|
|
6229
6249
|
}
|
|
@@ -6236,7 +6256,7 @@ async function getAuthProvider(config) {
|
|
|
6236
6256
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
6237
6257
|
// to point at a specific wallet or set chainId/domain.
|
|
6238
6258
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
6239
|
-
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-
|
|
6259
|
+
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-Ckb85p6a.js'); });
|
|
6240
6260
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
6241
6261
|
break;
|
|
6242
6262
|
}
|
|
@@ -6261,7 +6281,7 @@ async function getAuthProvider(config) {
|
|
|
6261
6281
|
break;
|
|
6262
6282
|
case "guest":
|
|
6263
6283
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
6264
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6284
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DDBXeHoo.js'); })).GuestAuthProvider();
|
|
6265
6285
|
break;
|
|
6266
6286
|
}
|
|
6267
6287
|
if (!currentAuthProvider) {
|
|
@@ -6323,7 +6343,7 @@ async function signInAnonymously() {
|
|
|
6323
6343
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
6324
6344
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
6325
6345
|
// so bundle-splitting can see it.
|
|
6326
|
-
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6346
|
+
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DDBXeHoo.js'); })).GuestAuthProvider();
|
|
6327
6347
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
6328
6348
|
// adoptSessionProvider awaits only getConfig() (already resolved here) and then
|
|
6329
6349
|
// runs every write - provider/method/config/marker/user - in one synchronous
|
|
@@ -6494,7 +6514,7 @@ function ensureSharedWalletLoginReady() {
|
|
|
6494
6514
|
if (!sharedWalletReady) {
|
|
6495
6515
|
sharedWalletReady = (async () => {
|
|
6496
6516
|
await core.getConfig();
|
|
6497
|
-
await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6517
|
+
await Promise.resolve().then(function () { return require('./injected-wallet-provider-Cfb4ayCP.js'); });
|
|
6498
6518
|
})().catch((error) => {
|
|
6499
6519
|
sharedWalletReady = null;
|
|
6500
6520
|
throw error;
|
|
@@ -6597,7 +6617,7 @@ async function loginWithWallet(options) {
|
|
|
6597
6617
|
await ensureSharedWalletLoginReady();
|
|
6598
6618
|
else
|
|
6599
6619
|
await ensureWalletLoginReady();
|
|
6600
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6620
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-Cfb4ayCP.js'); });
|
|
6601
6621
|
// Keep the RAW wallet provider: the offchain wrapper forwards only a fixed
|
|
6602
6622
|
// set of methods, so cleanup below must speak to the provider that actually
|
|
6603
6623
|
// holds the config rather than to whatever is wrapping it.
|
|
@@ -6872,6 +6892,17 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
6872
6892
|
signInAnonymously: signInAnonymously
|
|
6873
6893
|
});
|
|
6874
6894
|
|
|
6895
|
+
/**
|
|
6896
|
+
* An explicit rpcUrl wins; otherwise a Solana chain gets the platform RPC so
|
|
6897
|
+
* every onchain path (wallet signing, submission, reconcile) has one.
|
|
6898
|
+
*/
|
|
6899
|
+
function withDefaultSolanaRpcUrl(config) {
|
|
6900
|
+
var _a;
|
|
6901
|
+
if (normalizeSolanaRpcUrl(config.rpcUrl))
|
|
6902
|
+
return config;
|
|
6903
|
+
const rpcUrl = defaultSolanaRpcUrl((_a = config.chain) === null || _a === void 0 ? void 0 : _a.trim());
|
|
6904
|
+
return rpcUrl ? Object.assign(Object.assign({}, config), { rpcUrl }) : config;
|
|
6905
|
+
}
|
|
6875
6906
|
/**
|
|
6876
6907
|
* Subscribed once per process, not per init(): re-registering on every init would
|
|
6877
6908
|
* stack duplicate handlers on repeated initialization.
|
|
@@ -6940,7 +6971,8 @@ let initializationGeneration = 0;
|
|
|
6940
6971
|
function getInitializationGeneration() { return initializationGeneration; }
|
|
6941
6972
|
// This file acts as a middleware for the global state of the SDK
|
|
6942
6973
|
// This mostly involves setting up the AuthProvider and managing the current user
|
|
6943
|
-
async function initialize(
|
|
6974
|
+
async function initialize(requestedConfig) {
|
|
6975
|
+
const newConfig = withDefaultSolanaRpcUrl(requestedConfig);
|
|
6944
6976
|
// Mark auth as loading for the ENTIRE init/restore window so consumers render
|
|
6945
6977
|
// a neutral/loading state instead of the signed-out UI while we rehydrate the
|
|
6946
6978
|
// session — otherwise getCurrentUser() is null + loading is false during the
|
|
@@ -10452,7 +10484,7 @@ class PrivyExpoProvider {
|
|
|
10452
10484
|
if (isLegacyTx) {
|
|
10453
10485
|
const legacyTx = transaction;
|
|
10454
10486
|
if (!legacyTx.recentBlockhash) {
|
|
10455
|
-
const rpcUrl = this.getRpcUrl();
|
|
10487
|
+
const rpcUrl = await this.getRpcUrl();
|
|
10456
10488
|
const connection = new Connection(rpcUrl, 'confirmed');
|
|
10457
10489
|
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');
|
|
10458
10490
|
legacyTx.recentBlockhash = blockhash;
|
|
@@ -10465,7 +10497,7 @@ class PrivyExpoProvider {
|
|
|
10465
10497
|
else {
|
|
10466
10498
|
const versionedTx = transaction;
|
|
10467
10499
|
if (!versionedTx.message.recentBlockhash) {
|
|
10468
|
-
const rpcUrl = this.getRpcUrl();
|
|
10500
|
+
const rpcUrl = await this.getRpcUrl();
|
|
10469
10501
|
const connection = new Connection(rpcUrl, 'confirmed');
|
|
10470
10502
|
const { blockhash } = await connection.getLatestBlockhash('confirmed');
|
|
10471
10503
|
versionedTx.message.recentBlockhash = blockhash;
|
|
@@ -10485,7 +10517,7 @@ class PrivyExpoProvider {
|
|
|
10485
10517
|
await this.ensureReady();
|
|
10486
10518
|
const { Connection, PublicKey } = await import('@solana/web3.js');
|
|
10487
10519
|
const wallet = await this.getWalletOrThrow('submitting this transaction');
|
|
10488
|
-
const rpcUrl = this.getRpcUrl();
|
|
10520
|
+
const rpcUrl = await this.getRpcUrl();
|
|
10489
10521
|
const connection = new Connection(rpcUrl, 'confirmed');
|
|
10490
10522
|
// Ensure blockhash.
|
|
10491
10523
|
// DS3-0414: a Solana signature covers the compiled message (recentBlockhash
|
|
@@ -10586,8 +10618,12 @@ class PrivyExpoProvider {
|
|
|
10586
10618
|
const txInfo = await confirmAndCheckTransaction(connection, signature);
|
|
10587
10619
|
return { signature, txInfo };
|
|
10588
10620
|
}
|
|
10589
|
-
|
|
10590
|
-
|
|
10621
|
+
// The constructor rpcUrl wins, then init()'s rpcUrl, then the platform RPC
|
|
10622
|
+
// for init()'s chain.
|
|
10623
|
+
async getRpcUrl() {
|
|
10624
|
+
var _a;
|
|
10625
|
+
const config = await core.getConfig();
|
|
10626
|
+
return resolveSolanaRpcUrl((_a = this.networkUrl) !== null && _a !== void 0 ? _a : config.rpcUrl, isSupportedSolanaRpcNetwork(config.chain) ? config.chain : null, "Privy Expo Solana transaction");
|
|
10591
10627
|
}
|
|
10592
10628
|
async ensureReady(timeoutMs = 15000) {
|
|
10593
10629
|
if (!this.privyMethods) {
|
|
@@ -11094,4 +11130,4 @@ exports.useAuth = useAuth;
|
|
|
11094
11130
|
exports.useBuildRun = useBuildRun;
|
|
11095
11131
|
exports.useQuery = useQuery;
|
|
11096
11132
|
exports.waitForAuthReady = waitForAuthReady;
|
|
11097
|
-
//# sourceMappingURL=index-
|
|
11133
|
+
//# sourceMappingURL=index-BghQ8jX0.js.map
|