@bounded-sh/client 0.0.1 → 0.0.3
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/phantom-wallet-provider.d.ts +1 -1
- package/dist/auth/providers/privy-expo-provider.d.ts +1 -1
- package/dist/auth/providers/solana-mobile-wallet-provider.d.ts +3 -3
- package/dist/{index-VGx-869x.js → index-2UpSvA7V.js} +2586 -124
- package/dist/index-2UpSvA7V.js.map +1 -0
- package/dist/{index-C1VOdmRN.js → index-C2JpxGAC.js} +1202 -450
- package/dist/index-C2JpxGAC.js.map +1 -0
- package/dist/{index-CT2j1oic.esm.js → index-C2yvle9S.esm.js} +1202 -450
- package/dist/index-C2yvle9S.esm.js.map +1 -0
- package/dist/{index-sKqrgk0t.js → index-CYVVTWs4.js} +1202 -450
- package/dist/index-CYVVTWs4.js.map +1 -0
- package/dist/{index-BHTfW8CV.esm.js → index-DJg-Dduo.esm.js} +1202 -450
- package/dist/index-DJg-Dduo.esm.js.map +1 -0
- package/dist/{index-o5Hv9pfS.esm.js → index-DyfiK3_X.esm.js} +2585 -124
- package/dist/index-DyfiK3_X.esm.js.map +1 -0
- package/dist/{index.browser-BJZ7fYwv.js → index.browser-BTJZmhY1.js} +766 -773
- package/dist/index.browser-BTJZmhY1.js.map +1 -0
- package/dist/{index.browser-DaNhOhkQ.esm.js → index.browser-C_TToxuO.esm.js} +230 -242
- package/dist/index.browser-C_TToxuO.esm.js.map +1 -0
- package/dist/{index.browser-utVKQsEC.js → index.browser-DcHalmEf.js} +230 -242
- package/dist/index.browser-DcHalmEf.js.map +1 -0
- package/dist/{index.browser-DhAcjdpV.esm.js → index.browser-pymH6o1X.esm.js} +766 -773
- package/dist/index.browser-pymH6o1X.esm.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{index.native-JPUkdHJj.esm.js → index.native-BTjBgNiE.esm.js} +2556 -95
- package/dist/index.native-BTjBgNiE.esm.js.map +1 -0
- package/dist/{index.native-B5IBOdv_.js → index.native-BvsmNFXn.js} +2557 -95
- package/dist/index.native-BvsmNFXn.js.map +1 -0
- package/dist/index.native.d.ts +1 -1
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +2 -1
- package/dist/index.native.js.map +1 -1
- package/dist/{phantom-wallet-provider-CDLyxrih.js → phantom-wallet-provider-BXMvoOrI.js} +10 -10
- package/dist/phantom-wallet-provider-BXMvoOrI.js.map +1 -0
- package/dist/{phantom-wallet-provider-DMlaSrAl.esm.js → phantom-wallet-provider-CTossIFB.esm.js} +10 -10
- package/dist/phantom-wallet-provider-CTossIFB.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-nR52lXzI.esm.js → privy-wallet-provider-1qE_f-DF.esm.js} +6 -6
- package/dist/privy-wallet-provider-1qE_f-DF.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-DiHHTDbZ.js → privy-wallet-provider-D64DJ3u4.js} +6 -6
- package/dist/privy-wallet-provider-D64DJ3u4.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-B4CeMMQd.esm.js → solana-mobile-wallet-provider-9M8U6AA7.esm.js} +22 -22
- package/dist/solana-mobile-wallet-provider-9M8U6AA7.esm.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-BYMfFjZb.js → solana-mobile-wallet-provider-C1wQ1DRK.js} +22 -22
- package/dist/solana-mobile-wallet-provider-C1wQ1DRK.js.map +1 -0
- package/package.json +2 -2
- package/dist/index-BHTfW8CV.esm.js.map +0 -1
- package/dist/index-C1VOdmRN.js.map +0 -1
- package/dist/index-CT2j1oic.esm.js.map +0 -1
- package/dist/index-VGx-869x.js.map +0 -1
- package/dist/index-o5Hv9pfS.esm.js.map +0 -1
- package/dist/index-sKqrgk0t.js.map +0 -1
- package/dist/index.browser-BJZ7fYwv.js.map +0 -1
- package/dist/index.browser-DaNhOhkQ.esm.js.map +0 -1
- package/dist/index.browser-DhAcjdpV.esm.js.map +0 -1
- package/dist/index.browser-utVKQsEC.js.map +0 -1
- package/dist/index.native-B5IBOdv_.js.map +0 -1
- package/dist/index.native-JPUkdHJj.esm.js.map +0 -1
- package/dist/phantom-wallet-provider-CDLyxrih.js.map +0 -1
- package/dist/phantom-wallet-provider-DMlaSrAl.esm.js.map +0 -1
- package/dist/privy-wallet-provider-DiHHTDbZ.js.map +0 -1
- package/dist/privy-wallet-provider-nR52lXzI.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-B4CeMMQd.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-BYMfFjZb.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index_native = require('./index.native-
|
|
3
|
+
var index_native = require('./index.native-BvsmNFXn.js');
|
|
4
4
|
var web3_js = require('@solana/web3.js');
|
|
5
5
|
var anchor = require('@coral-xyz/anchor');
|
|
6
6
|
var kit = require('@solana/kit');
|
|
@@ -438,8 +438,8 @@ class PrivyWalletProvider {
|
|
|
438
438
|
const connection = new web3_js.Connection(rpcUrl, "confirmed");
|
|
439
439
|
const remainingAccounts = index_native.convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
|
|
440
440
|
let app_id = solTransactionData.appId;
|
|
441
|
-
if (typeof window !== 'undefined' && window.
|
|
442
|
-
const customAppId = window.
|
|
441
|
+
if (typeof window !== 'undefined' && window.CUSTOM_BOUNDED_APP_ID_HEADER) {
|
|
442
|
+
const customAppId = window.CUSTOM_BOUNDED_APP_ID_HEADER;
|
|
443
443
|
if (customAppId) {
|
|
444
444
|
app_id = customAppId;
|
|
445
445
|
}
|
|
@@ -779,7 +779,7 @@ class PrivyWalletProvider {
|
|
|
779
779
|
// Handle case where signature might be bytes instead of string
|
|
780
780
|
const rawSig = result.signature;
|
|
781
781
|
if (rawSig instanceof Uint8Array || Array.isArray(rawSig)) {
|
|
782
|
-
signature = index_native.
|
|
782
|
+
signature = index_native.bs582.encode(rawSig instanceof Uint8Array ? rawSig : new Uint8Array(rawSig));
|
|
783
783
|
}
|
|
784
784
|
else {
|
|
785
785
|
signature = rawSig;
|
|
@@ -861,7 +861,7 @@ class PrivyWalletProvider {
|
|
|
861
861
|
}));
|
|
862
862
|
// The signature is returned as a Uint8Array, encode it as base58 (standard Solana format)
|
|
863
863
|
const signatureBytes = (result === null || result === void 0 ? void 0 : result.signature) || result;
|
|
864
|
-
const bs58 = await Promise.resolve().then(function () { return require('./index.native-
|
|
864
|
+
const bs58 = await Promise.resolve().then(function () { return require('./index.native-BvsmNFXn.js'); }).then(function (n) { return n.index; });
|
|
865
865
|
return bs58.default.encode(signatureBytes);
|
|
866
866
|
}
|
|
867
867
|
async restoreSession() {
|
|
@@ -953,4 +953,4 @@ class PrivyWalletProvider {
|
|
|
953
953
|
PrivyWalletProvider.instance = null;
|
|
954
954
|
|
|
955
955
|
exports.PrivyWalletProvider = PrivyWalletProvider;
|
|
956
|
-
//# sourceMappingURL=privy-wallet-provider-
|
|
956
|
+
//# sourceMappingURL=privy-wallet-provider-D64DJ3u4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privy-wallet-provider-D64DJ3u4.js","sources":["../.rollup-tmp/auth/providers/privy-wallet-provider.js"],"sourcesContent":["import { getActiveSessionManager as SessionManager, createSessionWithSignature, genAuthNonce, genSolanaMessage, buildSetDocumentsTransaction, convertRemainingAccounts } from '@bounded-sh/core';\nimport { Buffer } from 'buffer';\nimport { setCurrentUser } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { PublicKey, Connection, Transaction, VersionedTransaction } from '@solana/web3.js';\nimport * as anchor from '@coral-xyz/anchor';\nimport { createSolanaRpc, createSolanaRpcSubscriptions } from '@solana/kit';\nimport { SOLANA_DEVNET_RPC_URL, SOLANA_MAINNET_RPC_URL } from '..';\nimport { confirmAndCheckTransaction } from './transaction-utils';\nimport bs58 from 'bs58';\nconst SURFNET_RPC_URL = \"https://surfpool.fly.dev\";\n// React/react-dom are externalized peer deps (see rollup.config.js\n// sharedExternal / isExternal) — rollup emits these as bare ESM imports the\n// consumer's bundler resolves; they are NOT inlined. Static top-level ESM\n// imports (instead of a runtime require() behind a `typeof window` guard) so\n// the browser ESM bundle never evaluates `require`, which is undefined in a\n// production ESM/Vite build (it would throw ReferenceError at module eval).\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom/client';\n// @privy-io/react-auth(/solana) are OPTIONAL peer deps. They are loaded lazily\n// via dynamic import() rather than a static top-level import: a static import\n// would (a) in the ESM bundle still be a bare `import` the consumer resolves —\n// fine — but (b) in the CJS bundle become an eager top-level require() that\n// throws for any consumer who hasn't installed Privy (this module is pulled\n// into the entry via a static re-export). The lazy import keeps the browser\n// ESM bundle free of any runtime `require('@privy-io...')` AND lets a consumer\n// who never uses Privy load the package without it installed. Populated once\n// in `initialize()` (browser-only) before the Privy React tree renders.\nlet privyImports;\nlet privySolana;\nasync function loadPrivyModules() {\n if (privyImports && privySolana)\n return;\n [privyImports, privySolana] = await Promise.all([\n import('@privy-io/react-auth'),\n import('@privy-io/react-auth/solana'),\n ]);\n}\nconst getDefaultPrivyConfig = () => ({\n appId: \"cm4ve714908o27dk2yurpnfhd\",\n config: {\n embeddedWallets: {\n solana: {\n createOnLogin: \"users-without-wallets\"\n }\n },\n appearance: {\n walletChainType: 'solana-only'\n },\n externalWallets: { solana: { connectors: privySolana.toSolanaWalletConnectors() } }\n }\n});\nexport class PrivyWalletProvider {\n constructor(appName, appLogoUrl, privyConfig, networkUrl = null) {\n this.containerElement = null;\n this.chainId = 'solana:mainnet';\n this.root = null;\n this.privyMethods = null;\n this.pendingLogin = null;\n // This is used to store the pending transaction until the wallet is connected for workaround for the wallet not being connected after login completion\n this.pendingTransaction = null;\n // This is used to store pending signTransaction calls until the wallet is connected\n this.pendingSignTransaction = null;\n // This is used to store pending signMessage calls until the wallet is connected\n this.pendingSignMessage = null;\n // This is used to store pending signAndSubmitTransaction calls until the wallet is connected\n this.pendingSignAndSubmitTransaction = null;\n this.networkUrl = networkUrl;\n if (typeof window === 'undefined') {\n throw new Error('PrivyWalletProvider can only be instantiated in a browser environment');\n }\n if (PrivyWalletProvider.instance) {\n return PrivyWalletProvider.instance;\n }\n this.containerElement = null;\n this.root = null;\n this.privyMethods = null;\n this.privyConfig = privyConfig !== null && privyConfig !== void 0 ? privyConfig : getDefaultPrivyConfig();\n // Only use the appName and appLogoUrl if no privyConfig is provided\n if (privyConfig == null) {\n if (appName != null && appName != '') {\n this.privyConfig.config.appearance.landingHeader = appName;\n }\n if (appLogoUrl != null && appLogoUrl != '') {\n this.privyConfig.config.appearance.logo = appLogoUrl;\n }\n }\n // (externalWallets connectors are configured in initialize() once the\n // Privy SDK is lazily loaded — see loadPrivyModules.)\n // Add Solana RPC configuration for v3\n let devnetUrl = SOLANA_DEVNET_RPC_URL;\n let mainnetUrl = SOLANA_MAINNET_RPC_URL;\n if (networkUrl != null) {\n if (networkUrl.includes('mainnet')) {\n mainnetUrl = networkUrl;\n this.chainId = 'solana:mainnet';\n }\n else if (networkUrl.includes('devnet')) {\n devnetUrl = networkUrl;\n this.chainId = 'solana:devnet';\n }\n }\n if (!this.privyConfig.config.solana) {\n this.privyConfig.config.solana = {};\n }\n this.privyConfig.config.solana.rpcs = {\n 'solana:devnet': {\n rpc: createSolanaRpc(devnetUrl),\n rpcSubscriptions: createSolanaRpcSubscriptions(devnetUrl.replace('https://', 'wss://'))\n },\n 'solana:mainnet': {\n rpc: createSolanaRpc(mainnetUrl),\n rpcSubscriptions: createSolanaRpcSubscriptions(mainnetUrl.replace('https://', 'wss://'))\n }\n };\n const existingProviders = document.querySelectorAll('[data-privy-provider]');\n existingProviders.forEach(el => el.remove());\n // Fire-and-forget: initialize() lazily loads the Privy SDK then renders\n // the hidden React tree. privyMethods stays null until that render runs,\n // which the login/connect methods already wait for. Surface a clear error\n // if the optional @privy-io/react-auth peer dep isn't installed.\n this.initialize().catch((err) => {\n console.error('PrivyWalletProvider: failed to load @privy-io/react-auth — ensure it is installed to use Privy login.', err);\n });\n // Assign this instance to the static instance property\n PrivyWalletProvider.instance = this;\n }\n // Optional: Provide a static method to get the instance\n static getInstance(appName, appLogoUrl, privyConfig) {\n if (!PrivyWalletProvider.instance) {\n new PrivyWalletProvider(appName, appLogoUrl, privyConfig);\n }\n return PrivyWalletProvider.instance;\n }\n async initialize() {\n // Lazily load the Privy SDK (browser-only) before building the React tree.\n await loadPrivyModules();\n // Ensure externalWallets connectors are always configured — required for\n // useWallets().ready to resolve even when no browser extension is present.\n if (!this.privyConfig.config.externalWallets && privySolana) {\n this.privyConfig.config.externalWallets = {\n solana: { connectors: privySolana.toSolanaWalletConnectors() }\n };\n }\n if (!this.containerElement) {\n this.containerElement = document.createElement('div');\n this.containerElement.setAttribute('data-privy-provider', 'true');\n document.body.appendChild(this.containerElement);\n const that = this;\n const PrivyComponent = () => {\n const privy = privyImports.usePrivy();\n const useOAuthTokens = privyImports.useOAuthTokens();\n const useFundWalletSolana = privySolana.useFundWallet();\n const useSendTransactionSolana = privySolana.useSignAndSendTransaction();\n const { signTransaction } = privySolana.useSignTransaction();\n const { signMessage: signMessageHook } = privySolana.useSignMessage();\n const { ready: walletReady, wallets } = privySolana.useWallets();\n const { createWallet } = privySolana.useCreateWallet();\n const { exportWallet } = privySolana.useExportWallet();\n const useSolanaWallets = { createWallet, exportWallet, ready: walletReady, wallets };\n const useIdentityToken = privyImports.useIdentityToken();\n const { connectWallet } = privyImports.useConnectWallet({\n onSuccess: async ({ wallet }) => {\n await that.createSession(wallet.address, await privy.getAccessToken(), useIdentityToken.identityToken);\n // If there's a pending transaction, execute it now\n if (that.pendingTransaction) {\n const { evmTransactionData, solTransactionData, options, resolve, reject } = that.pendingTransaction;\n try {\n const result = await that.runTransaction(evmTransactionData, solTransactionData, options);\n resolve(result);\n }\n catch (error) {\n reject(error);\n }\n that.pendingTransaction = null;\n }\n // If there's a pending signTransaction, execute it now\n if (that.pendingSignTransaction) {\n const { transaction, resolve, reject } = that.pendingSignTransaction;\n try {\n const result = await that.signTransaction(transaction);\n resolve(result);\n }\n catch (error) {\n reject(error);\n }\n that.pendingSignTransaction = null;\n }\n // If there's a pending signMessage, execute it now\n if (that.pendingSignMessage) {\n const { message, resolve, reject } = that.pendingSignMessage;\n try {\n const result = await that.signMessage(message);\n resolve(result);\n }\n catch (error) {\n reject(error);\n }\n that.pendingSignMessage = null;\n }\n // If there's a pending signAndSubmitTransaction, execute it now\n if (that.pendingSignAndSubmitTransaction) {\n const { transaction, feePayer, resolve, reject } = that.pendingSignAndSubmitTransaction;\n try {\n const result = await that.signAndSubmitTransaction(transaction, feePayer);\n resolve(result);\n }\n catch (error) {\n reject(error);\n }\n that.pendingSignAndSubmitTransaction = null;\n }\n },\n onError: (error) => {\n // Only log errors that aren't user-initiated cancellations\n if (error !== 'exited_auth_flow' && (error === null || error === void 0 ? void 0 : error.message) !== 'exited_auth_flow') {\n console.error('Wallet connection error:', error);\n }\n if (that.pendingTransaction) {\n that.pendingTransaction.reject(error);\n that.pendingTransaction = null;\n }\n if (that.pendingSignTransaction) {\n that.pendingSignTransaction.reject(error);\n that.pendingSignTransaction = null;\n }\n if (that.pendingSignMessage) {\n that.pendingSignMessage.reject(error);\n that.pendingSignMessage = null;\n }\n if (that.pendingSignAndSubmitTransaction) {\n that.pendingSignAndSubmitTransaction.reject(error);\n that.pendingSignAndSubmitTransaction = null;\n }\n }\n });\n const { login } = privyImports.useLogin({\n onComplete: async ({ user }) => {\n var _a;\n // This is a hack to indicate to the app that privy login is not complete\n // @ts-ignore\n window.runningPrivyOnComplete = true;\n if (!user) {\n SessionManager().clearSession();\n return;\n }\n const solanaLinkedAccounts = user.linkedAccounts.filter((account) => account.chainType === 'solana');\n const sortedLinkedAccounts = solanaLinkedAccounts.sort((a, b) => new Date(b.latestVerifiedAt).getTime() - new Date(a.latestVerifiedAt).getTime());\n let finalAddress = (_a = sortedLinkedAccounts[0]) === null || _a === void 0 ? void 0 : _a.address;\n if (!finalAddress) {\n const solanaWallet = await createWallet();\n finalAddress = solanaWallet.address;\n SessionManager().clearSession();\n return;\n }\n const session = await SessionManager().getSession();\n if (!session || finalAddress !== session.address) {\n try {\n const accessToken = await privy.getAccessToken();\n const idToken = useIdentityToken.identityToken;\n await that.createSession(finalAddress, accessToken, idToken);\n }\n catch (error) {\n console.error('Error creating session:', error);\n }\n }\n // @ts-ignore\n window.runningPrivyOnComplete = false;\n setCurrentUser({ address: finalAddress, provider: that });\n if (that.pendingLogin) {\n that.pendingLogin.resolve({ address: finalAddress, provider: that });\n that.pendingLogin = null;\n }\n },\n onError: (error) => {\n // Only log errors that aren't user-initiated cancellations\n if (error !== 'exited_auth_flow' && (error === null || error === void 0 ? void 0 : error.message) !== 'exited_auth_flow') {\n console.error('Login error:', error);\n }\n if (that.pendingLogin) {\n that.pendingLogin.reject(error);\n that.pendingLogin = null;\n }\n }\n });\n const { logout } = privyImports.useLogout({\n onSuccess: () => {\n SessionManager().clearSession();\n setCurrentUser(null);\n }\n });\n React.useEffect(() => {\n if (privy.ready) {\n that.privyMethods = {\n ready: privy.ready,\n walletReady: walletReady,\n authenticated: privy.authenticated,\n wallets,\n login,\n logout,\n connectWallet,\n getAccessToken: privy.getAccessToken,\n identityToken: useIdentityToken.identityToken,\n usePrivy: privy,\n useOAuthTokens: useOAuthTokens,\n useFundWalletSolana: useFundWalletSolana,\n useSendTransactionSolana: useSendTransactionSolana,\n useSolanaWallets: useSolanaWallets,\n signTransaction: signTransaction,\n signMessage: signMessageHook,\n };\n }\n }, [privy.ready, privy.authenticated, wallets, login, logout, walletReady]);\n return null;\n };\n const FinalPrivyComponent = () => {\n if (typeof window === 'undefined') {\n return null;\n }\n return React.createElement(privyImports.PrivyProvider, {\n appId: this.privyConfig.appId,\n config: this.privyConfig.config,\n children: React.createElement(PrivyComponent)\n });\n };\n this.root = ReactDOM.createRoot(this.containerElement);\n this.root.render(React.createElement(FinalPrivyComponent));\n }\n }\n async login() {\n var _a, _b;\n await this.ensureReady();\n // Check if we have a valid session that matches an authenticated wallet\n const session = await SessionManager().getSession();\n if (((_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.authenticated) && ((_b = this.privyMethods.wallets) === null || _b === void 0 ? void 0 : _b.length) > 0 && session) {\n // Find the wallet matching the session\n const matchingWallet = this.privyMethods.wallets.find((wallet) => wallet.address === session.address);\n if (matchingWallet) {\n // Valid session with matching wallet, return immediately\n setCurrentUser({ address: matchingWallet.address, provider: this });\n return {\n address: matchingWallet.address,\n provider: this\n };\n }\n // Session exists but doesn't match any connected wallet\n // This can happen after wallet switching - force fresh login\n console.log('Session wallet mismatch detected, forcing fresh login flow');\n }\n // If no valid session or wallet mismatch, force a fresh login flow\n // This ensures the user can select the correct wallet, especially after logout\n if (this.pendingLogin) {\n return new Promise((resolve, reject) => {\n this.pendingLogin.resolve = resolve;\n this.pendingLogin.reject = reject;\n });\n }\n return new Promise((resolve, reject) => {\n this.pendingLogin = { resolve, reject };\n // open Privy modal to let user select/verify wallet\n this.privyMethods.login();\n // safety timeout\n setTimeout(() => {\n if (this.pendingLogin) {\n this.pendingLogin.reject(new Error(\"Login timed out\"));\n this.pendingLogin = null;\n }\n }, 180000);\n });\n }\n async getNativeMethods() {\n var _a;\n await this.ensureReady();\n return (_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.usePrivy;\n }\n async logout() {\n await this.ensureReady();\n await this.privyMethods.logout();\n }\n async runTransaction(_evmTransactionData, solTransactionData, options) {\n var _a, _b, _c;\n await this.ensureReady({ waitForWallets: true });\n let session = await SessionManager().getSession();\n let sessionAddress = session === null || session === void 0 ? void 0 : session.address;\n let privyWallets = (_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.wallets;\n let privyWallet = privyWallets === null || privyWallets === void 0 ? void 0 : privyWallets.find((wallet) => wallet.address === sessionAddress);\n // If wallet not found yet, it may be an embedded wallet (email login) that hasn't\n // appeared in the wallets array due to React state timing. Wait for it before\n // falling back to connectWallet() which shows an unwanted wallet selection modal.\n if (!privyWallets || privyWallets.length === 0 || !privyWallet) {\n if (((_b = this.privyMethods) === null || _b === void 0 ? void 0 : _b.authenticated) && sessionAddress) {\n privyWallet = await this.waitForMatchingWallet(sessionAddress);\n }\n }\n if (!privyWallet) {\n // If there's already a pending transaction, throw an error to prevent overlapping calls\n if (this.pendingTransaction) {\n throw new Error(\"Oops... something went wrong. Please try again.\");\n }\n // Create a promise to wait for the transaction result\n return new Promise((resolve, reject) => {\n this.pendingTransaction = {\n resolve,\n reject,\n evmTransactionData: _evmTransactionData,\n solTransactionData,\n options\n };\n this.privyMethods.connectWallet();\n // Set a timeout to reject the promise if connection takes too long\n setTimeout(() => {\n if (this.pendingTransaction) {\n this.pendingTransaction.reject(new Error(\"Wallet connection timed out\"));\n this.pendingTransaction = null;\n }\n }, 30000); // 30 seconds timeout\n });\n }\n // Proceed with the transaction using privyWallet\n const wallet = privyWallet;\n if (solTransactionData == null) {\n throw new Error(\"Solana transaction data is required\");\n }\n const rpcUrl = this.getRpcUrl(solTransactionData.network);\n const connection = new Connection(rpcUrl, \"confirmed\");\n const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);\n let app_id = solTransactionData.appId;\n if (typeof window !== 'undefined' && window.CUSTOM_BOUNDED_APP_ID_HEADER) {\n const customAppId = window.CUSTOM_BOUNDED_APP_ID_HEADER;\n if (customAppId) {\n app_id = customAppId;\n }\n }\n if (!app_id) {\n throw new Error(\"App ID is required\");\n }\n const anchorProvider = new anchor.AnchorProvider(connection, wallet.provider, anchor.AnchorProvider.defaultOptions());\n const finalDeduped = [];\n for (const acc of remainingAccounts) {\n const existing = finalDeduped.find((d) => d.pubkey.equals(acc.pubkey));\n if (existing) {\n existing.isSigner = existing.isSigner || acc.isSigner;\n existing.isWritable = existing.isWritable || acc.isWritable;\n }\n else {\n finalDeduped.push(acc);\n }\n }\n let tx;\n let blockhash;\n let lastValidBlockHeight;\n if (solTransactionData.signedTransaction) {\n // Server already set the blockhash and co-signed — do NOT overwrite\n // the blockhash or it will invalidate the server's signature.\n tx = VersionedTransaction.deserialize(Buffer.from(solTransactionData.signedTransaction, 'base64'));\n // Extract the blockhash that was baked into the signed message\n blockhash = tx.message.recentBlockhash;\n const latestBlockhash = await connection.getLatestBlockhash('confirmed');\n lastValidBlockHeight = latestBlockhash.lastValidBlockHeight;\n }\n else {\n const result = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, new PublicKey(wallet.address), { app_id, documents: solTransactionData.txArgs[0].setDocumentData, delete_paths: solTransactionData.txArgs[0].deletePaths, txData: solTransactionData.txArgs[0].txData }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false, solTransactionData.additionalLutAddresses);\n tx = result.tx;\n blockhash = result.blockhash;\n lastValidBlockHeight = result.lastValidBlockHeight;\n }\n // Use duck typing instead of instanceof to handle multiple @solana/web3.js versions\n const isLegacyTx = 'recentBlockhash' in tx && !('message' in tx && 'staticAccountKeys' in tx.message);\n if (isLegacyTx) {\n tx.recentBlockhash = blockhash;\n tx.lastValidBlockHeight = lastValidBlockHeight;\n }\n else {\n tx.message.recentBlockhash = blockhash;\n }\n try {\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {\n // Just sign, don't submit - return raw signed bytes (same as original runTransaction)\n const signedTx = await this.signTransactionRaw(tx, privyWallet);\n return {\n signedTransaction: signedTx, // Raw Uint8Array from Privy\n blockNumber: 0,\n gasUsed: \"0\",\n data: \"\"\n };\n }\n // Sign and submit using shared helper\n const { signature, txInfo } = await this.signAndSubmitInternal(tx, privyWallet, rpcUrl, connection);\n return {\n transactionSignature: signature,\n blockNumber: (txInfo === null || txInfo === void 0 ? void 0 : txInfo.slot) || 0,\n gasUsed: ((_c = txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta) === null || _c === void 0 ? void 0 : _c.fee.toString()) || '0',\n data: txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta,\n };\n }\n catch (err) {\n console.error(err);\n throw err;\n }\n }\n /**\n * Signs a Solana transaction without submitting it.\n *\n * This method handles blockhash automatically if not set - you do NOT need to\n * set recentBlockhash on the transaction before calling this method.\n * The network/RPC URL is derived from the provider's configuration (set during initialization).\n *\n * @param transaction - The transaction to sign (Transaction or VersionedTransaction)\n * @returns The signed transaction\n */\n async signTransaction(transaction) {\n var _a, _b;\n await this.ensureReady({ waitForWallets: true });\n let privyWallets = (_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.wallets;\n let session = await SessionManager().getSession();\n let sessionAddress = session === null || session === void 0 ? void 0 : session.address;\n let privyWallet = privyWallets === null || privyWallets === void 0 ? void 0 : privyWallets.find((wallet) => wallet.address === sessionAddress);\n // If there's already a pending sign transaction, throw an error to prevent overlapping calls\n if (this.pendingSignTransaction) {\n throw new Error(\"Oops... something went wrong. Please try again.\");\n }\n // If wallet not found yet, it may be an embedded wallet (email login) that hasn't\n // appeared in the wallets array due to React state timing. Wait for it before\n // falling back to connectWallet() which shows an unwanted wallet selection modal.\n if (!privyWallets || privyWallets.length === 0 || !privyWallet) {\n if (((_b = this.privyMethods) === null || _b === void 0 ? void 0 : _b.authenticated) && sessionAddress) {\n privyWallet = await this.waitForMatchingWallet(sessionAddress);\n }\n }\n // If still no wallet after waiting, trigger connection and queue the signing\n if (!privyWallet) {\n return new Promise((resolve, reject) => {\n this.pendingSignTransaction = {\n resolve,\n reject,\n transaction\n };\n this.privyMethods.connectWallet();\n // Set a timeout to reject the promise if connection takes too long\n setTimeout(() => {\n if (this.pendingSignTransaction) {\n this.pendingSignTransaction.reject(new Error(\"Wallet connection timed out\"));\n this.pendingSignTransaction = null;\n }\n }, 30000); // 30 seconds timeout\n });\n }\n // Privy requires serialized transaction bytes, which requires a blockhash.\n // If the transaction doesn't have one, get a fresh blockhash and set it.\n // Use duck typing instead of instanceof to handle multiple @solana/web3.js versions\n const isLegacyTransaction = 'recentBlockhash' in transaction && !('message' in transaction && 'staticAccountKeys' in transaction.message);\n if (isLegacyTransaction) {\n const legacyTx = transaction;\n if (!legacyTx.recentBlockhash) {\n const rpcUrl = this.getRpcUrl();\n const connection = new Connection(rpcUrl, 'confirmed');\n const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');\n legacyTx.recentBlockhash = blockhash;\n legacyTx.lastValidBlockHeight = lastValidBlockHeight;\n }\n // Set feePayer if not already set\n if (!legacyTx.feePayer) {\n legacyTx.feePayer = new PublicKey(privyWallet.address);\n }\n }\n else {\n // VersionedTransaction\n const versionedTx = transaction;\n if (!versionedTx.message.recentBlockhash) {\n const rpcUrl = this.getRpcUrl();\n const connection = new Connection(rpcUrl, 'confirmed');\n const { blockhash } = await connection.getLatestBlockhash('confirmed');\n versionedTx.message.recentBlockhash = blockhash;\n }\n }\n // Sign using raw method, then deserialize for the public API\n const signedTxRaw = await this.signTransactionRaw(transaction, privyWallet);\n return this.deserializeSignedTransaction(signedTxRaw);\n }\n /**\n * Signs and submits a Solana transaction to the network.\n *\n * This method handles blockhash and transaction confirmation automatically - you do NOT need to\n * set recentBlockhash or lastValidBlockHeight on the transaction before calling this method.\n * The network/RPC URL is derived from the provider's configuration (set during initialization).\n *\n * @param transaction - The transaction to sign and submit (Transaction or VersionedTransaction)\n * @param feePayer - Optional fee payer public key. If not provided and the transaction doesn't\n * already have a feePayer set, the connected wallet address will be used.\n * Useful for co-signing scenarios where a different account pays the fees.\n * @returns The transaction signature\n */\n async signAndSubmitTransaction(transaction, feePayer) {\n var _a, _b;\n await this.ensureReady({ waitForWallets: true });\n let privyWallets = (_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.wallets;\n let session = await SessionManager().getSession();\n let sessionAddress = session === null || session === void 0 ? void 0 : session.address;\n let privyWallet = privyWallets === null || privyWallets === void 0 ? void 0 : privyWallets.find((wallet) => wallet.address === sessionAddress);\n // If there's already a pending signAndSubmitTransaction, throw an error to prevent overlapping calls\n if (this.pendingSignAndSubmitTransaction) {\n throw new Error(\"Oops... something went wrong. Please try again.\");\n }\n // If wallet not found yet, it may be an embedded wallet (email login) that hasn't\n // appeared in the wallets array due to React state timing. Wait for it before\n // falling back to connectWallet() which shows an unwanted wallet selection modal.\n if (!privyWallets || privyWallets.length === 0 || !privyWallet) {\n if (((_b = this.privyMethods) === null || _b === void 0 ? void 0 : _b.authenticated) && sessionAddress) {\n privyWallet = await this.waitForMatchingWallet(sessionAddress);\n }\n }\n // If still no wallet after waiting, trigger connection and queue the signing\n if (!privyWallet) {\n return new Promise((resolve, reject) => {\n this.pendingSignAndSubmitTransaction = {\n resolve,\n reject,\n transaction,\n feePayer\n };\n this.privyMethods.connectWallet();\n // Set a timeout to reject the promise if connection takes too long\n setTimeout(() => {\n if (this.pendingSignAndSubmitTransaction) {\n this.pendingSignAndSubmitTransaction.reject(new Error(\"Wallet connection timed out\"));\n this.pendingSignAndSubmitTransaction = null;\n }\n }, 30000); // 30 seconds timeout\n });\n }\n // Get RPC URL and create connection\n const rpcUrl = this.getRpcUrl();\n const connection = new Connection(rpcUrl, 'confirmed');\n // Get fresh blockhash and set it on the transaction before signing\n const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');\n // Use duck typing instead of instanceof to handle multiple @solana/web3.js versions\n const isLegacyTransaction = 'recentBlockhash' in transaction && !('message' in transaction && 'staticAccountKeys' in transaction.message);\n if (isLegacyTransaction) {\n const legacyTx = transaction;\n legacyTx.recentBlockhash = blockhash;\n legacyTx.lastValidBlockHeight = lastValidBlockHeight;\n // Set feePayer if not already set\n if (!legacyTx.feePayer) {\n legacyTx.feePayer = feePayer !== null && feePayer !== void 0 ? feePayer : new PublicKey(privyWallet.address);\n }\n }\n else {\n // VersionedTransaction\n const versionedTx = transaction;\n versionedTx.message.recentBlockhash = blockhash;\n // Note: VersionedTransaction feePayer is set in the message at creation time\n // and cannot be modified after creation\n }\n // Use shared sign and submit logic\n const { signature } = await this.signAndSubmitInternal(transaction, privyWallet, rpcUrl, connection);\n return signature;\n }\n // ============ Private Helpers ============\n getRpcUrl(network) {\n if (this.networkUrl) {\n return this.networkUrl;\n }\n if (network === 'solana_devnet') {\n return SOLANA_DEVNET_RPC_URL;\n }\n else if (network === 'solana_mainnet') {\n return SOLANA_MAINNET_RPC_URL;\n }\n else if (network === 'surfnet') {\n return SURFNET_RPC_URL;\n }\n return SOLANA_MAINNET_RPC_URL; // default to mainnet\n }\n /**\n * Internal sign transaction - serializes and signs via Privy\n * Returns the raw result from Privy (Uint8Array)\n * This mirrors exactly what runTransaction was doing\n */\n async signTransactionRaw(transaction, privyWallet) {\n var _a;\n // Serialize the transaction\n // Use duck typing instead of instanceof to handle multiple @solana/web3.js versions\n const isLegacyTransaction = 'recentBlockhash' in transaction && !('message' in transaction && 'staticAccountKeys' in transaction.message);\n let serializedForSign;\n if (isLegacyTransaction) {\n serializedForSign = transaction.serialize({ requireAllSignatures: false, verifySignatures: false });\n }\n else {\n serializedForSign = transaction.serialize();\n }\n // Sign via Privy - returns { signedTransaction: Uint8Array }\n const result = await ((_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.signTransaction({\n transaction: serializedForSign,\n wallet: privyWallet,\n chain: this.chainId\n }));\n // Privy returns { signedTransaction: Uint8Array }, unwrap it\n const signedTx = (result === null || result === void 0 ? void 0 : result.signedTransaction) || result;\n return signedTx;\n }\n /**\n * Deserialize a signed transaction from Uint8Array to Transaction object\n */\n deserializeSignedTransaction(signedTxRaw) {\n // Handle different formats Privy might return\n let signedTx;\n if (signedTxRaw instanceof Uint8Array) {\n signedTx = signedTxRaw;\n }\n else if (Array.isArray(signedTxRaw)) {\n signedTx = new Uint8Array(signedTxRaw);\n }\n else if (signedTxRaw && typeof signedTxRaw === 'object' && 'signedTransaction' in signedTxRaw) {\n // Privy might wrap the result\n signedTx = signedTxRaw.signedTransaction instanceof Uint8Array\n ? signedTxRaw.signedTransaction\n : new Uint8Array(signedTxRaw.signedTransaction);\n }\n else if (Buffer.isBuffer(signedTxRaw)) {\n signedTx = new Uint8Array(signedTxRaw);\n }\n else {\n throw new Error(`Unexpected signed transaction format: ${typeof signedTxRaw}`);\n }\n // Try to deserialize as VersionedTransaction first, fall back to legacy Transaction\n try {\n return VersionedTransaction.deserialize(signedTx);\n }\n catch (_a) {\n return Transaction.from(signedTx);\n }\n }\n /**\n * Internal sign and submit - handles Surfnet vs non-Surfnet logic\n * This is the core submission logic used by both signAndSubmitTransaction and runTransaction\n *\n * For Surfnet: sign with signTransactionRaw, then sendRawTransaction\n * For non-Surfnet: use Privy's signAndSendTransaction (combined operation)\n */\n async signAndSubmitInternal(transaction, privyWallet, rpcUrl, connection) {\n var _a;\n const isSurfnet = rpcUrl === SURFNET_RPC_URL;\n let signature;\n if (isSurfnet) {\n // For Surfnet: sign with signTransactionRaw, then sendRawTransaction\n const signedTx = await this.signTransactionRaw(transaction, privyWallet);\n signature = await connection.sendRawTransaction(signedTx);\n }\n else {\n // For non-Surfnet: use Privy's combined signAndSendTransaction\n // Serialize the transaction for Privy API\n // Use duck typing instead of instanceof to handle multiple @solana/web3.js versions\n const isLegacyTransaction = 'recentBlockhash' in transaction && !('message' in transaction && 'staticAccountKeys' in transaction.message);\n let serializedTx;\n if (isLegacyTransaction) {\n serializedTx = transaction.serialize({ requireAllSignatures: false, verifySignatures: false });\n }\n else {\n serializedTx = transaction.serialize();\n }\n const result = await ((_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.useSendTransactionSolana.signAndSendTransaction({\n transaction: serializedTx,\n wallet: privyWallet,\n chain: this.chainId\n }));\n // Handle case where signature might be bytes instead of string\n const rawSig = result.signature;\n if (rawSig instanceof Uint8Array || Array.isArray(rawSig)) {\n signature = bs58.encode(rawSig instanceof Uint8Array ? rawSig : new Uint8Array(rawSig));\n }\n else {\n signature = rawSig;\n }\n }\n const txInfo = await confirmAndCheckTransaction(connection, signature);\n return { signature, txInfo };\n }\n async signMessage(message) {\n var _a, _b, _c;\n await this.ensureReady({ waitForWallets: true });\n const session = await SessionManager().getSession();\n let sessionAddress = session === null || session === void 0 ? void 0 : session.address;\n // If there's already a pending sign message, throw an error to prevent overlapping calls\n if (this.pendingSignMessage) {\n throw new Error(\"Oops... something went wrong. Please try again.\");\n }\n // If no wallets connected yet, it may be an embedded wallet (email login) that hasn't\n // appeared in the wallets array due to React state timing. Wait for it before\n // falling back to connectWallet() which shows an unwanted wallet selection modal.\n if (!((_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.wallets) || this.privyMethods.wallets.length === 0) {\n if (((_b = this.privyMethods) === null || _b === void 0 ? void 0 : _b.authenticated) && sessionAddress) {\n const matchedWallet = await this.waitForMatchingWallet(sessionAddress);\n if (!matchedWallet) {\n return new Promise((resolve, reject) => {\n this.pendingSignMessage = {\n resolve,\n reject,\n message\n };\n this.privyMethods.connectWallet();\n // Set a timeout to reject the promise if connection takes too long\n setTimeout(() => {\n if (this.pendingSignMessage) {\n this.pendingSignMessage.reject(new Error(\"Wallet connection timed out\"));\n this.pendingSignMessage = null;\n }\n }, 30000); // 30 seconds timeout\n });\n }\n }\n else {\n return new Promise((resolve, reject) => {\n this.pendingSignMessage = {\n resolve,\n reject,\n message\n };\n this.privyMethods.connectWallet();\n // Set a timeout to reject the promise if connection takes too long\n setTimeout(() => {\n if (this.pendingSignMessage) {\n this.pendingSignMessage.reject(new Error(\"Wallet connection timed out\"));\n this.pendingSignMessage = null;\n }\n }, 30000); // 30 seconds timeout\n });\n }\n }\n let privyWallet = this.privyMethods.wallets.find((wallet) => wallet.address === sessionAddress);\n if (!privyWallet) {\n // Session address is not a privy wallet, just default to the first wallet\n const accessToken = await this.privyMethods.getAccessToken();\n await this.createSession(this.privyMethods.wallets[0].address, accessToken, this.privyMethods.identityToken);\n setCurrentUser({ address: this.privyMethods.wallets[0].address, provider: this });\n const session = await SessionManager().getSession();\n sessionAddress = session === null || session === void 0 ? void 0 : session.address;\n if (!sessionAddress) {\n throw new Error('No wallet connected or logged in to sign message');\n }\n privyWallet = this.privyMethods.wallets[0];\n }\n // Use the Privy signMessage hook for Solana wallets\n // The message needs to be passed as a Uint8Array\n const messageBytes = getPlatform().textEncode(message);\n const result = await ((_c = this.privyMethods) === null || _c === void 0 ? void 0 : _c.signMessage({\n message: messageBytes,\n wallet: privyWallet,\n }));\n // The signature is returned as a Uint8Array, encode it as base58 (standard Solana format)\n const signatureBytes = (result === null || result === void 0 ? void 0 : result.signature) || result;\n const bs58 = await import('bs58');\n return bs58.default.encode(signatureBytes);\n }\n async restoreSession() {\n const session = await SessionManager().getSession();\n if (session) {\n return { provider: this, address: session.address };\n }\n else {\n return null;\n }\n }\n // NOTE: accessToken/idToken are accepted for backwards-compat with existing\n // call sites but are no longer used. The session is minted by having the Privy\n // Solana wallet SIGN the canonical SIWS challenge (the same wallet-signature\n // path Phantom/MWA/guest use), so the bounded /session issuer needs no\n // Privy-specific token verification — it arrives as a Solana signature and is\n // recorded server-side as authMethod 'phantom'.\n async createSession(address, _accessToken, _idToken) {\n var _a, _b, _c, _d, _e, _f, _g;\n // Resolve the Privy wallet for this address (fall back to the first wallet).\n const privyWallet = (_c = (_b = (_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.wallets) === null || _b === void 0 ? void 0 : _b.find((w) => w.address === address)) !== null && _c !== void 0 ? _c : (_e = (_d = this.privyMethods) === null || _d === void 0 ? void 0 : _d.wallets) === null || _e === void 0 ? void 0 : _e[0];\n if (!privyWallet) {\n throw new Error('No Privy Solana wallet available to mint a session.');\n }\n const nonce = await genAuthNonce();\n const message = await genSolanaMessage(address, nonce);\n const messageBytes = getPlatform().textEncode(message);\n // Low-level Privy sign hook — signs WITHOUT touching the session (the public\n // signMessage() bootstraps sessions, which would recurse here).\n const signResult = await ((_f = this.privyMethods) === null || _f === void 0 ? void 0 : _f.signMessage({\n message: messageBytes,\n wallet: privyWallet,\n }));\n const signatureBytes = (_g = signResult === null || signResult === void 0 ? void 0 : signResult.signature) !== null && _g !== void 0 ? _g : signResult;\n // base64-encoded detached signature (matches Phantom + guest providers).\n const signature = Buffer.from(signatureBytes).toString('base64');\n const createSessionResult = await createSessionWithSignature(address, message, signature);\n if (createSessionResult) {\n await SessionManager().storeSession(address, createSessionResult.accessToken, createSessionResult.idToken, createSessionResult.refreshToken);\n }\n }\n /**\n * Waits for a wallet matching the session address to appear in the wallets array.\n * This handles the timing gap where Privy's embedded wallet (created for email login users)\n * may not yet be in the useWallets() array when signTransaction is called immediately after login.\n */\n async waitForMatchingWallet(sessionAddress, timeoutMs = 10000) {\n var _a;\n const startTime = Date.now();\n while (Date.now() - startTime < timeoutMs) {\n const wallets = (_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.wallets;\n if (wallets && wallets.length > 0) {\n const wallet = wallets.find((w) => w.address === sessionAddress);\n if (wallet)\n return wallet;\n }\n await new Promise(resolve => setTimeout(resolve, 200));\n }\n return null;\n }\n async ensureReady({ waitForWallets = false, timeoutMs = 15000 } = {}) {\n const isReady = () => {\n var _a, _b;\n if (!((_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.ready))\n return false;\n if (waitForWallets && !((_b = this.privyMethods) === null || _b === void 0 ? void 0 : _b.walletReady))\n return false;\n return true;\n };\n if (isReady())\n return;\n return new Promise((resolve, reject) => {\n const startTime = Date.now();\n const check = () => {\n if (isReady()) {\n resolve();\n }\n else if (Date.now() - startTime > timeoutMs) {\n reject(new Error('Login provider failed to initialize. This can happen in incognito mode or when third-party cookies are blocked. Try using a regular browser window.'));\n }\n else {\n setTimeout(check, 100);\n }\n };\n check();\n });\n }\n}\nPrivyWalletProvider.instance = null;\n"],"names":["SOLANA_DEVNET_RPC_URL","SOLANA_MAINNET_RPC_URL","createSolanaRpc","createSolanaRpcSubscriptions","SessionManager","setCurrentUser","React","ReactDOM","Connection","convertRemainingAccounts","anchor","VersionedTransaction","Buffer","buildSetDocumentsTransaction","PublicKey","Transaction","bs58","confirmAndCheckTransaction","getPlatform","genAuthNonce","genSolanaMessage","createSessionWithSignature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,eAAe,GAAG,0BAA0B;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G,EAAE,GAAG,SAAS,GAAG,SAAS,EAAE;AAC7D,oBAAoB,MAAM,CAAC,IAAI,KAAK,CAAC,qJAAqJ,CAAC,CAAC;AAC5L,gBAAgB;AAChB,qBAAqB;AACrB,oBAAoB,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC;AAC1C,gBAAgB;AAChB,YAAY,CAAC;AACb,YAAY,KAAK,EAAE;AACnB,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;AACA,mBAAmB,CAAC,QAAQ,GAAG,IAAI;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getPlatform, n as getActiveSessionManager, k as genAuthNonce, b as bufferExports, l as genSolanaMessage, s as setCurrentUser, m as createSessionWithSignature, j as setAuthLoading, d as confirmAndCheckTransaction, o as
|
|
1
|
+
import { i as getPlatform, n as getActiveSessionManager, k as genAuthNonce, b as bufferExports, l as genSolanaMessage, s as setCurrentUser, m as createSessionWithSignature, j as setAuthLoading, d as confirmAndCheckTransaction, o as bs582, c as convertRemainingAccounts, a as buildSetDocumentsTransaction, S as SOLANA_DEVNET_RPC_URL, e as SOLANA_MAINNET_RPC_URL, f as SURFNET_RPC_URL } from './index.native-BTjBgNiE.esm.js';
|
|
2
2
|
import { PublicKey, Connection, VersionedTransaction, VersionedMessage, Transaction } from '@solana/web3.js';
|
|
3
3
|
import * as anchor from '@coral-xyz/anchor';
|
|
4
4
|
import 'axios';
|
|
@@ -11,9 +11,9 @@ import 'react';
|
|
|
11
11
|
* doesn't force the user back into Phantom's approval flow when the
|
|
12
12
|
* underlying wallet authorization is still valid.
|
|
13
13
|
*/
|
|
14
|
-
const MWA_AUTH_TOKEN_STORAGE_KEY = '
|
|
14
|
+
const MWA_AUTH_TOKEN_STORAGE_KEY = 'bounded_mwa_auth_token';
|
|
15
15
|
const ED25519_SIGNATURE_LENGTH = 64;
|
|
16
|
-
const STORED_AUTH_METHOD_KEY = '
|
|
16
|
+
const STORED_AUTH_METHOD_KEY = 'bounded_last_auth_method';
|
|
17
17
|
const MWA_AUTH_METHOD = 'mobile-wallet-adapter';
|
|
18
18
|
function findMwaError(e, maxDepth = 5) {
|
|
19
19
|
var _a;
|
|
@@ -116,7 +116,7 @@ async function withMwaAssociationRetry(fn) {
|
|
|
116
116
|
* no `blur` event fires, the protocol's `getDetectionPromise` (3000ms
|
|
117
117
|
* timeout, line 433) rejects, and we get `ERROR_WALLET_NOT_FOUND`.
|
|
118
118
|
*
|
|
119
|
-
* Fix: show a
|
|
119
|
+
* Fix: show a Bounded-controlled modal between the two transacts. When the
|
|
120
120
|
* user taps the modal's "Sign in" button, that tap IS a fresh user
|
|
121
121
|
* activation. We invoke the sign function directly inside the click handler
|
|
122
122
|
* — no `await` between the tap and the call — so the activation propagates
|
|
@@ -154,7 +154,7 @@ async function awaitSignInGestureAndSign(theme, signFn, noResultError = 'MWA ret
|
|
|
154
154
|
const closeColor = isDark ? '#71717a' : '#a1a1aa';
|
|
155
155
|
const fontStack = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
|
|
156
156
|
const overlay = document.createElement('div');
|
|
157
|
-
overlay.setAttribute('data-
|
|
157
|
+
overlay.setAttribute('data-bounded-mwa-gesture', 'true');
|
|
158
158
|
overlay.style.cssText = [
|
|
159
159
|
'position: fixed',
|
|
160
160
|
'inset: 0',
|
|
@@ -529,7 +529,7 @@ function readAuthMethod() {
|
|
|
529
529
|
* does.
|
|
530
530
|
*
|
|
531
531
|
* Notes on UX: login uses two wallet popups in succession — `standard:connect`
|
|
532
|
-
* (authorize) and `solana:signMessage` (sign the
|
|
532
|
+
* (authorize) and `solana:signMessage` (sign the Bounded nonce). The
|
|
533
533
|
* previous implementation combined both inside a single `transact` callback;
|
|
534
534
|
* splitting them is the cost of going through wallet-standard, and is
|
|
535
535
|
* acceptable given the alternative was broken on Seeker.
|
|
@@ -572,9 +572,9 @@ class SolanaMobileWalletProvider {
|
|
|
572
572
|
// entirely via `config.appIdentity.uri`.
|
|
573
573
|
const fallbackUri = hasDOM
|
|
574
574
|
? getPlatform().getLocationOrigin()
|
|
575
|
-
: '
|
|
575
|
+
: 'bounded://app';
|
|
576
576
|
this.appIdentity = config.appIdentity || {
|
|
577
|
-
name: '
|
|
577
|
+
name: 'Bounded App',
|
|
578
578
|
uri: fallbackUri,
|
|
579
579
|
};
|
|
580
580
|
this.cluster = config.cluster || 'mainnet-beta';
|
|
@@ -610,7 +610,7 @@ class SolanaMobileWalletProvider {
|
|
|
610
610
|
async ensureWallet() {
|
|
611
611
|
if (this.wallet)
|
|
612
612
|
return this.wallet;
|
|
613
|
-
const mod = await import('./index.browser-
|
|
613
|
+
const mod = await import('./index.browser-C_TToxuO.esm.js');
|
|
614
614
|
const chain = mapChainToWalletStandard(this.cluster);
|
|
615
615
|
this.wallet = new mod.LocalSolanaMobileWalletAdapterWallet({
|
|
616
616
|
appIdentity: this.appIdentity,
|
|
@@ -630,7 +630,7 @@ class SolanaMobileWalletProvider {
|
|
|
630
630
|
return this.wallet;
|
|
631
631
|
}
|
|
632
632
|
/**
|
|
633
|
-
* Ensure the wallet has an active authorization. After a
|
|
633
|
+
* Ensure the wallet has an active authorization. After a Bounded session
|
|
634
634
|
* is restored from storage on cold-start, `wallet.accounts` is empty until
|
|
635
635
|
* we silently reconnect from the AuthorizationCache. If the cache is also
|
|
636
636
|
* empty, fall back to interactive `login()` (which surfaces the three-stage
|
|
@@ -741,7 +741,7 @@ class SolanaMobileWalletProvider {
|
|
|
741
741
|
}
|
|
742
742
|
const account = auth.accounts[0];
|
|
743
743
|
// account.address is base64-encoded per MWA spec; convert to
|
|
744
|
-
// the base58 form
|
|
744
|
+
// the base58 form Bounded + the rest of the SDK use.
|
|
745
745
|
const base58Addr = new PublicKey(bufferExports.Buffer.from(account.address, 'base64')).toBase58();
|
|
746
746
|
// Reuse session if already valid for this address — skip the
|
|
747
747
|
// signMessages roundtrip entirely.
|
|
@@ -778,7 +778,7 @@ class SolanaMobileWalletProvider {
|
|
|
778
778
|
setCurrentUser(user);
|
|
779
779
|
return user;
|
|
780
780
|
}
|
|
781
|
-
// Create
|
|
781
|
+
// Create Bounded session on the server.
|
|
782
782
|
if (!result.signatureBase64 || !result.messageText) {
|
|
783
783
|
throw new Error('MWA login completed without signature');
|
|
784
784
|
}
|
|
@@ -807,7 +807,7 @@ class SolanaMobileWalletProvider {
|
|
|
807
807
|
}
|
|
808
808
|
const wallet = await this.ensureWallet();
|
|
809
809
|
// Quick-check: wallet may already have authorization (e.g. from a
|
|
810
|
-
// previous in-page login) and a matching
|
|
810
|
+
// previous in-page login) and a matching Bounded session — skip
|
|
811
811
|
// popups in that case.
|
|
812
812
|
if (wallet.accounts.length > 0) {
|
|
813
813
|
const accountPubkey = new PublicKey(wallet.accounts[0].publicKey);
|
|
@@ -838,14 +838,14 @@ class SolanaMobileWalletProvider {
|
|
|
838
838
|
const account = accounts[0];
|
|
839
839
|
const accountPubkey = new PublicKey(account.publicKey);
|
|
840
840
|
const base58Addr = accountPubkey.toBase58();
|
|
841
|
-
// If we happen to already have a matching
|
|
841
|
+
// If we happen to already have a matching Bounded session, reuse it.
|
|
842
842
|
const existingSession = await getActiveSessionManager().getSession();
|
|
843
843
|
if (existingSession && existingSession.address === base58Addr) {
|
|
844
844
|
const user = { provider: this, address: base58Addr };
|
|
845
845
|
setCurrentUser(user);
|
|
846
846
|
return user;
|
|
847
847
|
}
|
|
848
|
-
// Wallet popup #2: sign the
|
|
848
|
+
// Wallet popup #2: sign the Bounded nonce message.
|
|
849
849
|
//
|
|
850
850
|
// We cannot call signMessageFeat.signMessage() directly here:
|
|
851
851
|
// it would run as a JS continuation from the connect() resolve,
|
|
@@ -858,7 +858,7 @@ class SolanaMobileWalletProvider {
|
|
|
858
858
|
// protocol's 3-second getDetectionPromise rejects with
|
|
859
859
|
// ERROR_WALLET_NOT_FOUND.
|
|
860
860
|
//
|
|
861
|
-
// Insert a
|
|
861
|
+
// Insert a Bounded modal: the user's tap on "Sign in" provides a
|
|
862
862
|
// fresh activation, and signMessage is invoked synchronously
|
|
863
863
|
// inside the click handler so the activation propagates.
|
|
864
864
|
// C1: fetch the nonce HERE (after connect), not before — a pre-connect
|
|
@@ -875,7 +875,7 @@ class SolanaMobileWalletProvider {
|
|
|
875
875
|
}
|
|
876
876
|
const { signature: sigBytes } = signResult;
|
|
877
877
|
const signatureBase64 = bufferExports.Buffer.from(sigBytes).toString('base64');
|
|
878
|
-
// Create
|
|
878
|
+
// Create Bounded session on the server.
|
|
879
879
|
const createSessionResult = await createSessionWithSignature(base58Addr, messageText, signatureBase64);
|
|
880
880
|
await getActiveSessionManager().storeSession(base58Addr, createSessionResult.accessToken, createSessionResult.idToken, createSessionResult.refreshToken);
|
|
881
881
|
// Auth-method marker is already 'mobile-wallet-adapter' from above.
|
|
@@ -1228,7 +1228,7 @@ class SolanaMobileWalletProvider {
|
|
|
1228
1228
|
options: { commitment: 'confirmed' },
|
|
1229
1229
|
}));
|
|
1230
1230
|
const { signature: sigBytes } = sendResult;
|
|
1231
|
-
const signature =
|
|
1231
|
+
const signature = bs582.encode(sigBytes);
|
|
1232
1232
|
await confirmAndCheckTransaction(connection, signature);
|
|
1233
1233
|
return signature;
|
|
1234
1234
|
}
|
|
@@ -1264,8 +1264,8 @@ class SolanaMobileWalletProvider {
|
|
|
1264
1264
|
try {
|
|
1265
1265
|
const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
|
|
1266
1266
|
let app_id = solTransactionData.appId;
|
|
1267
|
-
if (typeof window !== 'undefined' && window.
|
|
1268
|
-
app_id = window.
|
|
1267
|
+
if (typeof window !== 'undefined' && window.CUSTOM_BOUNDED_APP_ID_HEADER) {
|
|
1268
|
+
app_id = window.CUSTOM_BOUNDED_APP_ID_HEADER;
|
|
1269
1269
|
}
|
|
1270
1270
|
if (!app_id) {
|
|
1271
1271
|
throw new Error('App ID is required');
|
|
@@ -1376,7 +1376,7 @@ class SolanaMobileWalletProvider {
|
|
|
1376
1376
|
throw new Error('MWA returned no signature');
|
|
1377
1377
|
}
|
|
1378
1378
|
const { signature: sigBytes } = sendResult;
|
|
1379
|
-
const signature =
|
|
1379
|
+
const signature = bs582.encode(sigBytes);
|
|
1380
1380
|
const txInfo = await confirmAndCheckTransaction(connection, signature);
|
|
1381
1381
|
return {
|
|
1382
1382
|
transactionSignature: signature,
|
|
@@ -1457,4 +1457,4 @@ class SolanaMobileWalletProvider {
|
|
|
1457
1457
|
SolanaMobileWalletProvider.instance = null;
|
|
1458
1458
|
|
|
1459
1459
|
export { SolanaMobileWalletProvider };
|
|
1460
|
-
//# sourceMappingURL=solana-mobile-wallet-provider-
|
|
1460
|
+
//# sourceMappingURL=solana-mobile-wallet-provider-9M8U6AA7.esm.js.map
|