@bounded-sh/client 0.0.16 → 0.0.18
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 +2 -1
- package/dist/auth/index.d.ts +2 -4
- package/dist/auth/providers/phantom-wallet-provider.d.ts +3 -2
- package/dist/auth/providers/privy-wallet-provider.d.ts +10 -7
- package/dist/auth/providers/solana-mobile-wallet-provider.d.ts +3 -2
- package/dist/auth/solana-rpc.d.ts +8 -0
- package/dist/index.js +5597 -17488
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5419 -17330
- package/dist/index.mjs.map +1 -1
- package/dist/index.native-DahSrHrM.mjs +8117 -0
- package/dist/index.native-DahSrHrM.mjs.map +1 -0
- package/dist/index.native-Dr3FOz16.js +8179 -0
- package/dist/index.native-Dr3FOz16.js.map +1 -0
- package/dist/index.native.js +89 -68
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +4 -3
- package/dist/index.native.mjs.map +1 -1
- package/dist/{phantom-wallet-provider-MW2H0SFY.js → phantom-wallet-provider-CeLJEdcL.js} +23 -34
- package/dist/phantom-wallet-provider-CeLJEdcL.js.map +1 -0
- package/dist/{phantom-wallet-provider-DU4WPFPM.mjs → phantom-wallet-provider-l-CNnHPs.mjs} +8 -19
- package/dist/phantom-wallet-provider-l-CNnHPs.mjs.map +1 -0
- package/dist/{privy-wallet-provider-dFxuvDf4.js → privy-wallet-provider-BSwx78fY.js} +86 -107
- package/dist/privy-wallet-provider-BSwx78fY.js.map +1 -0
- package/dist/{privy-wallet-provider-D5Kdp3Qp.mjs → privy-wallet-provider-BWM8TNO9.mjs} +69 -90
- package/dist/privy-wallet-provider-BWM8TNO9.mjs.map +1 -0
- package/dist/{solana-mobile-wallet-provider-DAR0BLTQ.js → solana-mobile-wallet-provider-BvCrAgk8.js} +56 -42
- package/dist/solana-mobile-wallet-provider-BvCrAgk8.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-CLiflgPj.mjs → solana-mobile-wallet-provider-C78VWmM-.mjs} +40 -26
- package/dist/solana-mobile-wallet-provider-C78VWmM-.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/index.native-CAygEkU7.mjs +0 -20012
- package/dist/index.native-CAygEkU7.mjs.map +0 -1
- package/dist/index.native-zD2ZzCLO.js +0 -20137
- package/dist/index.native-zD2ZzCLO.js.map +0 -1
- package/dist/phantom-wallet-provider-DU4WPFPM.mjs.map +0 -1
- package/dist/phantom-wallet-provider-MW2H0SFY.js.map +0 -1
- package/dist/privy-wallet-provider-D5Kdp3Qp.mjs.map +0 -1
- package/dist/privy-wallet-provider-dFxuvDf4.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-CLiflgPj.mjs.map +0 -1
- package/dist/solana-mobile-wallet-provider-DAR0BLTQ.js.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getActiveSessionManager, convertRemainingAccounts, buildSetDocumentsTransaction, genAuthNonce, genSolanaMessage, createSessionWithSignature } from '@bounded-sh/core';
|
|
2
|
+
import { n as normalizeSolanaRpcUrl, r as resolveSolanaRpcUrl, f as resolveSolanaWalletStandardChain, b as bufferExports, h as bs58, c as confirmAndCheckTransaction, g as getPlatform, s as setCurrentUser, S as SURFNET_RPC_URL } from './index.native-DahSrHrM.mjs';
|
|
2
3
|
import { Connection, VersionedTransaction, PublicKey, Transaction } from '@solana/web3.js';
|
|
3
4
|
import * as anchor from '@coral-xyz/anchor';
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import * as ReactDOM from 'react-dom/client';
|
|
6
|
-
import 'axios';
|
|
7
7
|
|
|
8
|
-
const SURFNET_RPC_URL = "https://surfpool.fly.dev";
|
|
9
8
|
// @privy-io/react-auth(/solana) are OPTIONAL peer deps. They are loaded lazily
|
|
10
9
|
// via dynamic import() rather than a static top-level import: a static import
|
|
11
10
|
// would (a) in the ESM bundle still be a bare `import` the consumer resolves —
|
|
@@ -38,31 +37,28 @@ async function loadSolanaKit() {
|
|
|
38
37
|
}
|
|
39
38
|
return solanaKit;
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
appId
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
appearance: {
|
|
50
|
-
walletChainType: 'solana-only'
|
|
51
|
-
},
|
|
52
|
-
externalWallets: { solana: { connectors: privySolana.toSolanaWalletConnectors() } }
|
|
40
|
+
function requirePrivyWalletConfig(privyConfig) {
|
|
41
|
+
if (!privyConfig || typeof privyConfig.appId !== 'string' || privyConfig.appId.trim() === '') {
|
|
42
|
+
throw new Error('Privy auth requires config.privyConfig.appId; no default Privy app is used.');
|
|
43
|
+
}
|
|
44
|
+
if (!privyConfig.config || typeof privyConfig.config !== 'object') {
|
|
45
|
+
throw new Error('Privy auth requires config.privyConfig.config for the app-scoped Privy provider.');
|
|
53
46
|
}
|
|
54
|
-
|
|
47
|
+
return {
|
|
48
|
+
appId: privyConfig.appId,
|
|
49
|
+
config: privyConfig.config,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
55
52
|
class PrivyWalletProvider {
|
|
56
|
-
constructor(appName, appLogoUrl, privyConfig, networkUrl = null) {
|
|
53
|
+
constructor(appName, appLogoUrl, privyConfig, networkUrl = null, configuredNetwork = null) {
|
|
57
54
|
this.containerElement = null;
|
|
58
|
-
this.chainId =
|
|
55
|
+
this.chainId = null;
|
|
59
56
|
this.root = null;
|
|
60
57
|
this.privyMethods = null;
|
|
61
58
|
this.pendingLogin = null;
|
|
62
59
|
// Resolved Solana RPC URLs (computed in the constructor; consumed in
|
|
63
60
|
// initialize() where @solana/kit is lazily loaded to build the transports).
|
|
64
|
-
this.
|
|
65
|
-
this.rpcMainnetUrl = SOLANA_MAINNET_RPC_URL;
|
|
61
|
+
this.configuredRpcUrl = null;
|
|
66
62
|
// This is used to store the pending transaction until the wallet is connected for workaround for the wallet not being connected after login completion
|
|
67
63
|
this.pendingTransaction = null;
|
|
68
64
|
// This is used to store pending signTransaction calls until the wallet is connected
|
|
@@ -71,41 +67,37 @@ class PrivyWalletProvider {
|
|
|
71
67
|
this.pendingSignMessage = null;
|
|
72
68
|
// This is used to store pending signAndSubmitTransaction calls until the wallet is connected
|
|
73
69
|
this.pendingSignAndSubmitTransaction = null;
|
|
74
|
-
this.networkUrl = networkUrl;
|
|
70
|
+
this.networkUrl = normalizeSolanaRpcUrl(networkUrl);
|
|
71
|
+
this.configuredNetwork = configuredNetwork;
|
|
75
72
|
if (typeof window === 'undefined') {
|
|
76
73
|
throw new Error('PrivyWalletProvider can only be instantiated in a browser environment');
|
|
77
74
|
}
|
|
75
|
+
const requiredPrivyConfig = requirePrivyWalletConfig(privyConfig);
|
|
78
76
|
if (PrivyWalletProvider.instance) {
|
|
79
77
|
return PrivyWalletProvider.instance;
|
|
80
78
|
}
|
|
81
79
|
this.containerElement = null;
|
|
82
80
|
this.root = null;
|
|
83
81
|
this.privyMethods = null;
|
|
84
|
-
this.privyConfig =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
this.privyConfig = requiredPrivyConfig;
|
|
83
|
+
if (!this.privyConfig.config.appearance) {
|
|
84
|
+
this.privyConfig.config.appearance = {};
|
|
85
|
+
}
|
|
86
|
+
if (appName != null && appName != '' && !this.privyConfig.config.appearance.landingHeader) {
|
|
87
|
+
this.privyConfig.config.appearance.landingHeader = appName;
|
|
88
|
+
}
|
|
89
|
+
if (appLogoUrl != null && appLogoUrl != '' && !this.privyConfig.config.appearance.logo) {
|
|
90
|
+
this.privyConfig.config.appearance.logo = appLogoUrl;
|
|
93
91
|
}
|
|
94
92
|
// (externalWallets connectors are configured in initialize() once the
|
|
95
93
|
// Privy SDK is lazily loaded — see loadPrivyModules.)
|
|
96
94
|
// Resolve Solana RPC URLs for v3. The @solana/kit transports are built
|
|
97
95
|
// lazily in initialize() so a non-Privy consumer never needs @solana/kit.
|
|
98
|
-
this.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.chainId = 'solana:mainnet';
|
|
104
|
-
}
|
|
105
|
-
else if (networkUrl.includes('devnet')) {
|
|
106
|
-
this.rpcDevnetUrl = networkUrl;
|
|
107
|
-
this.chainId = 'solana:devnet';
|
|
108
|
-
}
|
|
96
|
+
if (this.networkUrl || configuredNetwork) {
|
|
97
|
+
this.configuredRpcUrl = resolveSolanaRpcUrl(this.networkUrl, configuredNetwork, "Privy Solana RPC");
|
|
98
|
+
}
|
|
99
|
+
if (configuredNetwork) {
|
|
100
|
+
this.chainId = resolveSolanaWalletStandardChain(configuredNetwork, "Privy Solana transaction");
|
|
109
101
|
}
|
|
110
102
|
const existingProviders = document.querySelectorAll('[data-privy-provider]');
|
|
111
103
|
existingProviders.forEach(el => el.remove());
|
|
@@ -120,9 +112,9 @@ class PrivyWalletProvider {
|
|
|
120
112
|
PrivyWalletProvider.instance = this;
|
|
121
113
|
}
|
|
122
114
|
// Optional: Provide a static method to get the instance
|
|
123
|
-
static getInstance(appName, appLogoUrl, privyConfig) {
|
|
115
|
+
static getInstance(appName, appLogoUrl, privyConfig, networkUrl = null, configuredNetwork = null) {
|
|
124
116
|
if (!PrivyWalletProvider.instance) {
|
|
125
|
-
new PrivyWalletProvider(appName, appLogoUrl, privyConfig);
|
|
117
|
+
new PrivyWalletProvider(appName, appLogoUrl, privyConfig, networkUrl, configuredNetwork);
|
|
126
118
|
}
|
|
127
119
|
return PrivyWalletProvider.instance;
|
|
128
120
|
}
|
|
@@ -132,19 +124,17 @@ class PrivyWalletProvider {
|
|
|
132
124
|
// Build the Solana RPC transports now that we're on the async path, so
|
|
133
125
|
// @solana/kit can be lazily imported (kept out of the entry bundle).
|
|
134
126
|
const { createSolanaRpc, createSolanaRpcSubscriptions } = await loadSolanaKit();
|
|
135
|
-
if (!this.privyConfig.config.solana) {
|
|
127
|
+
if (this.configuredRpcUrl && this.chainId && !this.privyConfig.config.solana) {
|
|
136
128
|
this.privyConfig.config.solana = {};
|
|
137
129
|
}
|
|
138
|
-
this.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
};
|
|
130
|
+
if (this.configuredRpcUrl && this.chainId) {
|
|
131
|
+
this.privyConfig.config.solana.rpcs = {
|
|
132
|
+
[this.chainId]: {
|
|
133
|
+
rpc: createSolanaRpc(this.configuredRpcUrl),
|
|
134
|
+
rpcSubscriptions: createSolanaRpcSubscriptions(this.configuredRpcUrl.replace('https://', 'wss://'))
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
148
138
|
// Ensure externalWallets connectors are always configured — required for
|
|
149
139
|
// useWallets().ready to resolve even when no browser extension is present.
|
|
150
140
|
if (!this.privyConfig.config.externalWallets && privySolana) {
|
|
@@ -480,7 +470,7 @@ class PrivyWalletProvider {
|
|
|
480
470
|
try {
|
|
481
471
|
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
482
472
|
// Just sign, don't submit - return raw signed bytes (same as original runTransaction)
|
|
483
|
-
const signedTx = await this.signTransactionRaw(tx, privyWallet);
|
|
473
|
+
const signedTx = await this.signTransactionRaw(tx, privyWallet, solTransactionData.network);
|
|
484
474
|
return {
|
|
485
475
|
signedTransaction: signedTx, // Raw Uint8Array from Privy
|
|
486
476
|
blockNumber: 0,
|
|
@@ -489,7 +479,7 @@ class PrivyWalletProvider {
|
|
|
489
479
|
};
|
|
490
480
|
}
|
|
491
481
|
// Sign and submit using shared helper
|
|
492
|
-
const { signature, txInfo } = await this.signAndSubmitInternal(tx, privyWallet, rpcUrl, connection);
|
|
482
|
+
const { signature, txInfo } = await this.signAndSubmitInternal(tx, privyWallet, rpcUrl, connection, solTransactionData.network);
|
|
493
483
|
return {
|
|
494
484
|
transactionSignature: signature,
|
|
495
485
|
blockNumber: (txInfo === null || txInfo === void 0 ? void 0 : txInfo.slot) || 0,
|
|
@@ -661,26 +651,25 @@ class PrivyWalletProvider {
|
|
|
661
651
|
}
|
|
662
652
|
// ============ Private Helpers ============
|
|
663
653
|
getRpcUrl(network) {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
if (network
|
|
668
|
-
return
|
|
669
|
-
}
|
|
670
|
-
else if (network === 'solana_mainnet') {
|
|
671
|
-
return SOLANA_MAINNET_RPC_URL;
|
|
654
|
+
return resolveSolanaRpcUrl(this.networkUrl, network !== null && network !== void 0 ? network : this.configuredNetwork, "Privy Solana transaction");
|
|
655
|
+
}
|
|
656
|
+
getChainId(network) {
|
|
657
|
+
if (network) {
|
|
658
|
+
return resolveSolanaWalletStandardChain(network, "Privy Solana transaction");
|
|
672
659
|
}
|
|
673
|
-
|
|
674
|
-
return
|
|
660
|
+
if (this.chainId)
|
|
661
|
+
return this.chainId;
|
|
662
|
+
if (this.configuredNetwork) {
|
|
663
|
+
return resolveSolanaWalletStandardChain(this.configuredNetwork, "Privy Solana transaction");
|
|
675
664
|
}
|
|
676
|
-
|
|
665
|
+
throw new Error("Privy Solana transaction requires config.chain as solana_devnet, solana_mainnet, or surfnet.");
|
|
677
666
|
}
|
|
678
667
|
/**
|
|
679
668
|
* Internal sign transaction - serializes and signs via Privy
|
|
680
669
|
* Returns the raw result from Privy (Uint8Array)
|
|
681
670
|
* This mirrors exactly what runTransaction was doing
|
|
682
671
|
*/
|
|
683
|
-
async signTransactionRaw(transaction, privyWallet) {
|
|
672
|
+
async signTransactionRaw(transaction, privyWallet, network) {
|
|
684
673
|
var _a;
|
|
685
674
|
// Serialize the transaction
|
|
686
675
|
// Use duck typing instead of instanceof to handle multiple @solana/web3.js versions
|
|
@@ -696,7 +685,7 @@ class PrivyWalletProvider {
|
|
|
696
685
|
const result = await ((_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.signTransaction({
|
|
697
686
|
transaction: serializedForSign,
|
|
698
687
|
wallet: privyWallet,
|
|
699
|
-
chain: this.
|
|
688
|
+
chain: this.getChainId(network)
|
|
700
689
|
}));
|
|
701
690
|
// Privy returns { signedTransaction: Uint8Array }, unwrap it
|
|
702
691
|
const signedTx = (result === null || result === void 0 ? void 0 : result.signedTransaction) || result;
|
|
@@ -741,13 +730,13 @@ class PrivyWalletProvider {
|
|
|
741
730
|
* For Surfnet: sign with signTransactionRaw, then sendRawTransaction
|
|
742
731
|
* For non-Surfnet: use Privy's signAndSendTransaction (combined operation)
|
|
743
732
|
*/
|
|
744
|
-
async signAndSubmitInternal(transaction, privyWallet, rpcUrl, connection) {
|
|
733
|
+
async signAndSubmitInternal(transaction, privyWallet, rpcUrl, connection, network) {
|
|
745
734
|
var _a;
|
|
746
735
|
const isSurfnet = rpcUrl === SURFNET_RPC_URL;
|
|
747
736
|
let signature;
|
|
748
737
|
if (isSurfnet) {
|
|
749
738
|
// For Surfnet: sign with signTransactionRaw, then sendRawTransaction
|
|
750
|
-
const signedTx = await this.signTransactionRaw(transaction, privyWallet);
|
|
739
|
+
const signedTx = await this.signTransactionRaw(transaction, privyWallet, network);
|
|
751
740
|
signature = await connection.sendRawTransaction(signedTx);
|
|
752
741
|
}
|
|
753
742
|
else {
|
|
@@ -765,7 +754,7 @@ class PrivyWalletProvider {
|
|
|
765
754
|
const result = await ((_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.useSendTransactionSolana.signAndSendTransaction({
|
|
766
755
|
transaction: serializedTx,
|
|
767
756
|
wallet: privyWallet,
|
|
768
|
-
chain: this.
|
|
757
|
+
chain: this.getChainId(network)
|
|
769
758
|
}));
|
|
770
759
|
// Handle case where signature might be bytes instead of string
|
|
771
760
|
const rawSig = result.signature;
|
|
@@ -832,16 +821,7 @@ class PrivyWalletProvider {
|
|
|
832
821
|
}
|
|
833
822
|
let privyWallet = this.privyMethods.wallets.find((wallet) => wallet.address === sessionAddress);
|
|
834
823
|
if (!privyWallet) {
|
|
835
|
-
|
|
836
|
-
const accessToken = await this.privyMethods.getAccessToken();
|
|
837
|
-
await this.createSession(this.privyMethods.wallets[0].address, accessToken, this.privyMethods.identityToken);
|
|
838
|
-
setCurrentUser({ address: this.privyMethods.wallets[0].address, provider: this });
|
|
839
|
-
const session = await getActiveSessionManager().getSession();
|
|
840
|
-
sessionAddress = session === null || session === void 0 ? void 0 : session.address;
|
|
841
|
-
if (!sessionAddress) {
|
|
842
|
-
throw new Error('No wallet connected or logged in to sign message');
|
|
843
|
-
}
|
|
844
|
-
privyWallet = this.privyMethods.wallets[0];
|
|
824
|
+
throw new Error('Active Privy wallets do not include the authenticated session wallet; please log in again.');
|
|
845
825
|
}
|
|
846
826
|
// Use the Privy signMessage hook for Solana wallets
|
|
847
827
|
// The message needs to be passed as a Uint8Array
|
|
@@ -852,7 +832,7 @@ class PrivyWalletProvider {
|
|
|
852
832
|
}));
|
|
853
833
|
// The signature is returned as a Uint8Array, encode it as base58 (standard Solana format)
|
|
854
834
|
const signatureBytes = (result === null || result === void 0 ? void 0 : result.signature) || result;
|
|
855
|
-
const bs58 = await import('./index.native-
|
|
835
|
+
const bs58 = await import('./index.native-DahSrHrM.mjs').then(function (n) { return n.K; });
|
|
856
836
|
return bs58.default.encode(signatureBytes);
|
|
857
837
|
}
|
|
858
838
|
async restoreSession() {
|
|
@@ -871,22 +851,21 @@ class PrivyWalletProvider {
|
|
|
871
851
|
// Privy-specific token verification — it arrives as a Solana signature and is
|
|
872
852
|
// recorded server-side as authMethod 'phantom'.
|
|
873
853
|
async createSession(address, _accessToken, _idToken) {
|
|
874
|
-
var _a, _b, _c, _d
|
|
875
|
-
|
|
876
|
-
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];
|
|
854
|
+
var _a, _b, _c, _d;
|
|
855
|
+
const privyWallet = (_b = (_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.wallets) === null || _b === void 0 ? void 0 : _b.find((w) => w.address === address);
|
|
877
856
|
if (!privyWallet) {
|
|
878
|
-
throw new Error('No Privy Solana wallet
|
|
857
|
+
throw new Error('No Privy Solana wallet matching the requested session address is available.');
|
|
879
858
|
}
|
|
880
859
|
const nonce = await genAuthNonce();
|
|
881
860
|
const message = await genSolanaMessage(address, nonce);
|
|
882
861
|
const messageBytes = getPlatform().textEncode(message);
|
|
883
862
|
// Low-level Privy sign hook — signs WITHOUT touching the session (the public
|
|
884
863
|
// signMessage() bootstraps sessions, which would recurse here).
|
|
885
|
-
const signResult = await ((
|
|
864
|
+
const signResult = await ((_c = this.privyMethods) === null || _c === void 0 ? void 0 : _c.signMessage({
|
|
886
865
|
message: messageBytes,
|
|
887
866
|
wallet: privyWallet,
|
|
888
867
|
}));
|
|
889
|
-
const signatureBytes = (
|
|
868
|
+
const signatureBytes = (_d = signResult === null || signResult === void 0 ? void 0 : signResult.signature) !== null && _d !== void 0 ? _d : signResult;
|
|
890
869
|
// base64-encoded detached signature (matches Phantom + guest providers).
|
|
891
870
|
const signature = bufferExports.Buffer.from(signatureBytes).toString('base64');
|
|
892
871
|
const createSessionResult = await createSessionWithSignature(address, message, signature);
|
|
@@ -944,4 +923,4 @@ class PrivyWalletProvider {
|
|
|
944
923
|
PrivyWalletProvider.instance = null;
|
|
945
924
|
|
|
946
925
|
export { PrivyWalletProvider };
|
|
947
|
-
//# sourceMappingURL=privy-wallet-provider-
|
|
926
|
+
//# sourceMappingURL=privy-wallet-provider-BWM8TNO9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privy-wallet-provider-BWM8TNO9.mjs","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 { normalizeSolanaRpcUrl, resolveSolanaRpcUrl, resolveSolanaWalletStandardChain, SURFNET_RPC_URL, } from '../solana-rpc';\nimport { confirmAndCheckTransaction } from './transaction-utils';\nimport bs58 from 'bs58';\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}\n// @solana/kit is an OPTIONAL wallet-only dep, used only to build the Privy\n// Solana RPC transports. Loaded lazily (like the Privy SDKs) via dynamic\n// import() rather than a static top-level import: a static import is hoisted by\n// rollup into the entry chunk, forcing every consumer (including vanilla,\n// non-wallet web apps) to have @solana/kit installed and eagerly require()d.\n// Deferring it here keeps it out of the entry bundle.\nlet solanaKit;\nasync function loadSolanaKit() {\n if (!solanaKit) {\n solanaKit = await import('@solana/kit');\n }\n return solanaKit;\n}\nfunction requirePrivyWalletConfig(privyConfig) {\n if (!privyConfig || typeof privyConfig.appId !== 'string' || privyConfig.appId.trim() === '') {\n throw new Error('Privy auth requires config.privyConfig.appId; no default Privy app is used.');\n }\n if (!privyConfig.config || typeof privyConfig.config !== 'object') {\n throw new Error('Privy auth requires config.privyConfig.config for the app-scoped Privy provider.');\n }\n return {\n appId: privyConfig.appId,\n config: privyConfig.config,\n };\n}\nexport class PrivyWalletProvider {\n constructor(appName, appLogoUrl, privyConfig, networkUrl = null, configuredNetwork = null) {\n this.containerElement = null;\n this.chainId = null;\n this.root = null;\n this.privyMethods = null;\n this.pendingLogin = null;\n // Resolved Solana RPC URLs (computed in the constructor; consumed in\n // initialize() where @solana/kit is lazily loaded to build the transports).\n this.configuredRpcUrl = 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 = normalizeSolanaRpcUrl(networkUrl);\n this.configuredNetwork = configuredNetwork;\n if (typeof window === 'undefined') {\n throw new Error('PrivyWalletProvider can only be instantiated in a browser environment');\n }\n const requiredPrivyConfig = requirePrivyWalletConfig(privyConfig);\n if (PrivyWalletProvider.instance) {\n return PrivyWalletProvider.instance;\n }\n this.containerElement = null;\n this.root = null;\n this.privyMethods = null;\n this.privyConfig = requiredPrivyConfig;\n if (!this.privyConfig.config.appearance) {\n this.privyConfig.config.appearance = {};\n }\n if (appName != null && appName != '' && !this.privyConfig.config.appearance.landingHeader) {\n this.privyConfig.config.appearance.landingHeader = appName;\n }\n if (appLogoUrl != null && appLogoUrl != '' && !this.privyConfig.config.appearance.logo) {\n this.privyConfig.config.appearance.logo = appLogoUrl;\n }\n // (externalWallets connectors are configured in initialize() once the\n // Privy SDK is lazily loaded — see loadPrivyModules.)\n // Resolve Solana RPC URLs for v3. The @solana/kit transports are built\n // lazily in initialize() so a non-Privy consumer never needs @solana/kit.\n if (this.networkUrl || configuredNetwork) {\n this.configuredRpcUrl = resolveSolanaRpcUrl(this.networkUrl, configuredNetwork, \"Privy Solana RPC\");\n }\n if (configuredNetwork) {\n this.chainId = resolveSolanaWalletStandardChain(configuredNetwork, \"Privy Solana transaction\");\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, networkUrl = null, configuredNetwork = null) {\n if (!PrivyWalletProvider.instance) {\n new PrivyWalletProvider(appName, appLogoUrl, privyConfig, networkUrl, configuredNetwork);\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 // Build the Solana RPC transports now that we're on the async path, so\n // @solana/kit can be lazily imported (kept out of the entry bundle).\n const { createSolanaRpc, createSolanaRpcSubscriptions } = await loadSolanaKit();\n if (this.configuredRpcUrl && this.chainId && !this.privyConfig.config.solana) {\n this.privyConfig.config.solana = {};\n }\n if (this.configuredRpcUrl && this.chainId) {\n this.privyConfig.config.solana.rpcs = {\n [this.chainId]: {\n rpc: createSolanaRpc(this.configuredRpcUrl),\n rpcSubscriptions: createSolanaRpcSubscriptions(this.configuredRpcUrl.replace('https://', 'wss://'))\n }\n };\n }\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 const app_id = solTransactionData.appId;\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, solTransactionData.network);\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, solTransactionData.network);\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 return resolveSolanaRpcUrl(this.networkUrl, network !== null && network !== void 0 ? network : this.configuredNetwork, \"Privy Solana transaction\");\n }\n getChainId(network) {\n if (network) {\n return resolveSolanaWalletStandardChain(network, \"Privy Solana transaction\");\n }\n if (this.chainId)\n return this.chainId;\n if (this.configuredNetwork) {\n return resolveSolanaWalletStandardChain(this.configuredNetwork, \"Privy Solana transaction\");\n }\n throw new Error(\"Privy Solana transaction requires config.chain as solana_devnet, solana_mainnet, or surfnet.\");\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, network) {\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.getChainId(network)\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, network) {\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, network);\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.getChainId(network)\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 throw new Error('Active Privy wallets do not include the authenticated session wallet; please log in again.');\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;\n const privyWallet = (_b = (_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.wallets) === null || _b === void 0 ? void 0 : _b.find((w) => w.address === address);\n if (!privyWallet) {\n throw new Error('No Privy Solana wallet matching the requested session address is available.');\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 ((_c = this.privyMethods) === null || _c === void 0 ? void 0 : _c.signMessage({\n message: messageBytes,\n wallet: privyWallet,\n }));\n const signatureBytes = (_d = signResult === null || signResult === void 0 ? void 0 : signResult.signature) !== null && _d !== void 0 ? _d : 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":["SessionManager","Buffer"],"mappings":";;;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,eAAe,gBAAgB,GAAG;AAClC,IAAI,IAAI,YAAY,IAAI,WAAW;AACnC,QAAQ;AACR,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;AACpD,QAAQ,OAAO,sBAAsB,CAAC;AACtC,QAAQ,OAAO,6BAA6B,CAAC;AAC7C,KAAK,CAAC;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS;AACb,eAAe,aAAa,GAAG;AAC/B,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,SAAS,GAAG,MAAM,OAAO,aAAa,CAAC;AAC/C,IAAI;AACJ,IAAI,OAAO,SAAS;AACpB;AACA,SAAS,wBAAwB,CAAC,WAAW,EAAE;AAC/C,IAAI,IAAI,CAAC,WAAW,IAAI,OAAO,WAAW,CAAC,KAAK,KAAK,QAAQ,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;AAClG,QAAQ,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC;AACtG,IAAI;AACJ,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,QAAQ,EAAE;AACvE,QAAQ,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC;AAC3G,IAAI;AACJ,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE,WAAW,CA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