@bounded-sh/client 0.0.17 → 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 +246 -188
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +246 -188
- package/dist/index.mjs.map +1 -1
- package/dist/{index.native-DlMO7aHv.mjs → index.native-DahSrHrM.mjs} +138 -62
- package/dist/index.native-DahSrHrM.mjs.map +1 -0
- package/dist/{index.native-DoiNBZlU.js → index.native-Dr3FOz16.js} +141 -64
- package/dist/index.native-Dr3FOz16.js.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{phantom-wallet-provider-DUdnFoyb.js → phantom-wallet-provider-CeLJEdcL.js} +7 -18
- package/dist/phantom-wallet-provider-CeLJEdcL.js.map +1 -0
- package/dist/{phantom-wallet-provider-DWG1LVJf.mjs → phantom-wallet-provider-l-CNnHPs.mjs} +7 -18
- package/dist/phantom-wallet-provider-l-CNnHPs.mjs.map +1 -0
- package/dist/{privy-wallet-provider-Kv6H3xcS.js → privy-wallet-provider-BSwx78fY.js} +69 -90
- package/dist/privy-wallet-provider-BSwx78fY.js.map +1 -0
- package/dist/{privy-wallet-provider-CyNLekvY.mjs → privy-wallet-provider-BWM8TNO9.mjs} +68 -89
- package/dist/privy-wallet-provider-BWM8TNO9.mjs.map +1 -0
- package/dist/{solana-mobile-wallet-provider-BfHBucO0.js → solana-mobile-wallet-provider-BvCrAgk8.js} +39 -25
- package/dist/solana-mobile-wallet-provider-BvCrAgk8.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-CKOSbLRd.mjs → solana-mobile-wallet-provider-C78VWmM-.mjs} +39 -25
- package/dist/solana-mobile-wallet-provider-C78VWmM-.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/index.native-DlMO7aHv.mjs.map +0 -1
- package/dist/index.native-DoiNBZlU.js.map +0 -1
- package/dist/phantom-wallet-provider-DUdnFoyb.js.map +0 -1
- package/dist/phantom-wallet-provider-DWG1LVJf.mjs.map +0 -1
- package/dist/privy-wallet-provider-CyNLekvY.mjs.map +0 -1
- package/dist/privy-wallet-provider-Kv6H3xcS.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-BfHBucO0.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-CKOSbLRd.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var core = require('@bounded-sh/core');
|
|
4
|
-
var index_native = require('./index.native-
|
|
4
|
+
var index_native = require('./index.native-Dr3FOz16.js');
|
|
5
5
|
var web3_js = require('@solana/web3.js');
|
|
6
6
|
var anchor = require('@coral-xyz/anchor');
|
|
7
7
|
var React = require('react');
|
|
@@ -28,7 +28,6 @@ var anchor__namespace = /*#__PURE__*/_interopNamespaceDefault(anchor);
|
|
|
28
28
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
29
29
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
|
|
30
30
|
|
|
31
|
-
const SURFNET_RPC_URL = "https://surfpool.fly.dev";
|
|
32
31
|
// @privy-io/react-auth(/solana) are OPTIONAL peer deps. They are loaded lazily
|
|
33
32
|
// via dynamic import() rather than a static top-level import: a static import
|
|
34
33
|
// would (a) in the ESM bundle still be a bare `import` the consumer resolves —
|
|
@@ -61,31 +60,28 @@ async function loadSolanaKit() {
|
|
|
61
60
|
}
|
|
62
61
|
return solanaKit;
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
appId
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
appearance: {
|
|
73
|
-
walletChainType: 'solana-only'
|
|
74
|
-
},
|
|
75
|
-
externalWallets: { solana: { connectors: privySolana.toSolanaWalletConnectors() } }
|
|
63
|
+
function requirePrivyWalletConfig(privyConfig) {
|
|
64
|
+
if (!privyConfig || typeof privyConfig.appId !== 'string' || privyConfig.appId.trim() === '') {
|
|
65
|
+
throw new Error('Privy auth requires config.privyConfig.appId; no default Privy app is used.');
|
|
66
|
+
}
|
|
67
|
+
if (!privyConfig.config || typeof privyConfig.config !== 'object') {
|
|
68
|
+
throw new Error('Privy auth requires config.privyConfig.config for the app-scoped Privy provider.');
|
|
76
69
|
}
|
|
77
|
-
|
|
70
|
+
return {
|
|
71
|
+
appId: privyConfig.appId,
|
|
72
|
+
config: privyConfig.config,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
78
75
|
class PrivyWalletProvider {
|
|
79
|
-
constructor(appName, appLogoUrl, privyConfig, networkUrl = null) {
|
|
76
|
+
constructor(appName, appLogoUrl, privyConfig, networkUrl = null, configuredNetwork = null) {
|
|
80
77
|
this.containerElement = null;
|
|
81
|
-
this.chainId =
|
|
78
|
+
this.chainId = null;
|
|
82
79
|
this.root = null;
|
|
83
80
|
this.privyMethods = null;
|
|
84
81
|
this.pendingLogin = null;
|
|
85
82
|
// Resolved Solana RPC URLs (computed in the constructor; consumed in
|
|
86
83
|
// initialize() where @solana/kit is lazily loaded to build the transports).
|
|
87
|
-
this.
|
|
88
|
-
this.rpcMainnetUrl = index_native.SOLANA_MAINNET_RPC_URL;
|
|
84
|
+
this.configuredRpcUrl = null;
|
|
89
85
|
// This is used to store the pending transaction until the wallet is connected for workaround for the wallet not being connected after login completion
|
|
90
86
|
this.pendingTransaction = null;
|
|
91
87
|
// This is used to store pending signTransaction calls until the wallet is connected
|
|
@@ -94,41 +90,37 @@ class PrivyWalletProvider {
|
|
|
94
90
|
this.pendingSignMessage = null;
|
|
95
91
|
// This is used to store pending signAndSubmitTransaction calls until the wallet is connected
|
|
96
92
|
this.pendingSignAndSubmitTransaction = null;
|
|
97
|
-
this.networkUrl = networkUrl;
|
|
93
|
+
this.networkUrl = index_native.normalizeSolanaRpcUrl(networkUrl);
|
|
94
|
+
this.configuredNetwork = configuredNetwork;
|
|
98
95
|
if (typeof window === 'undefined') {
|
|
99
96
|
throw new Error('PrivyWalletProvider can only be instantiated in a browser environment');
|
|
100
97
|
}
|
|
98
|
+
const requiredPrivyConfig = requirePrivyWalletConfig(privyConfig);
|
|
101
99
|
if (PrivyWalletProvider.instance) {
|
|
102
100
|
return PrivyWalletProvider.instance;
|
|
103
101
|
}
|
|
104
102
|
this.containerElement = null;
|
|
105
103
|
this.root = null;
|
|
106
104
|
this.privyMethods = null;
|
|
107
|
-
this.privyConfig =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
105
|
+
this.privyConfig = requiredPrivyConfig;
|
|
106
|
+
if (!this.privyConfig.config.appearance) {
|
|
107
|
+
this.privyConfig.config.appearance = {};
|
|
108
|
+
}
|
|
109
|
+
if (appName != null && appName != '' && !this.privyConfig.config.appearance.landingHeader) {
|
|
110
|
+
this.privyConfig.config.appearance.landingHeader = appName;
|
|
111
|
+
}
|
|
112
|
+
if (appLogoUrl != null && appLogoUrl != '' && !this.privyConfig.config.appearance.logo) {
|
|
113
|
+
this.privyConfig.config.appearance.logo = appLogoUrl;
|
|
116
114
|
}
|
|
117
115
|
// (externalWallets connectors are configured in initialize() once the
|
|
118
116
|
// Privy SDK is lazily loaded — see loadPrivyModules.)
|
|
119
117
|
// Resolve Solana RPC URLs for v3. The @solana/kit transports are built
|
|
120
118
|
// lazily in initialize() so a non-Privy consumer never needs @solana/kit.
|
|
121
|
-
this.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.chainId = 'solana:mainnet';
|
|
127
|
-
}
|
|
128
|
-
else if (networkUrl.includes('devnet')) {
|
|
129
|
-
this.rpcDevnetUrl = networkUrl;
|
|
130
|
-
this.chainId = 'solana:devnet';
|
|
131
|
-
}
|
|
119
|
+
if (this.networkUrl || configuredNetwork) {
|
|
120
|
+
this.configuredRpcUrl = index_native.resolveSolanaRpcUrl(this.networkUrl, configuredNetwork, "Privy Solana RPC");
|
|
121
|
+
}
|
|
122
|
+
if (configuredNetwork) {
|
|
123
|
+
this.chainId = index_native.resolveSolanaWalletStandardChain(configuredNetwork, "Privy Solana transaction");
|
|
132
124
|
}
|
|
133
125
|
const existingProviders = document.querySelectorAll('[data-privy-provider]');
|
|
134
126
|
existingProviders.forEach(el => el.remove());
|
|
@@ -143,9 +135,9 @@ class PrivyWalletProvider {
|
|
|
143
135
|
PrivyWalletProvider.instance = this;
|
|
144
136
|
}
|
|
145
137
|
// Optional: Provide a static method to get the instance
|
|
146
|
-
static getInstance(appName, appLogoUrl, privyConfig) {
|
|
138
|
+
static getInstance(appName, appLogoUrl, privyConfig, networkUrl = null, configuredNetwork = null) {
|
|
147
139
|
if (!PrivyWalletProvider.instance) {
|
|
148
|
-
new PrivyWalletProvider(appName, appLogoUrl, privyConfig);
|
|
140
|
+
new PrivyWalletProvider(appName, appLogoUrl, privyConfig, networkUrl, configuredNetwork);
|
|
149
141
|
}
|
|
150
142
|
return PrivyWalletProvider.instance;
|
|
151
143
|
}
|
|
@@ -155,19 +147,17 @@ class PrivyWalletProvider {
|
|
|
155
147
|
// Build the Solana RPC transports now that we're on the async path, so
|
|
156
148
|
// @solana/kit can be lazily imported (kept out of the entry bundle).
|
|
157
149
|
const { createSolanaRpc, createSolanaRpcSubscriptions } = await loadSolanaKit();
|
|
158
|
-
if (!this.privyConfig.config.solana) {
|
|
150
|
+
if (this.configuredRpcUrl && this.chainId && !this.privyConfig.config.solana) {
|
|
159
151
|
this.privyConfig.config.solana = {};
|
|
160
152
|
}
|
|
161
|
-
this.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
};
|
|
153
|
+
if (this.configuredRpcUrl && this.chainId) {
|
|
154
|
+
this.privyConfig.config.solana.rpcs = {
|
|
155
|
+
[this.chainId]: {
|
|
156
|
+
rpc: createSolanaRpc(this.configuredRpcUrl),
|
|
157
|
+
rpcSubscriptions: createSolanaRpcSubscriptions(this.configuredRpcUrl.replace('https://', 'wss://'))
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
171
161
|
// Ensure externalWallets connectors are always configured — required for
|
|
172
162
|
// useWallets().ready to resolve even when no browser extension is present.
|
|
173
163
|
if (!this.privyConfig.config.externalWallets && privySolana) {
|
|
@@ -503,7 +493,7 @@ class PrivyWalletProvider {
|
|
|
503
493
|
try {
|
|
504
494
|
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
505
495
|
// Just sign, don't submit - return raw signed bytes (same as original runTransaction)
|
|
506
|
-
const signedTx = await this.signTransactionRaw(tx, privyWallet);
|
|
496
|
+
const signedTx = await this.signTransactionRaw(tx, privyWallet, solTransactionData.network);
|
|
507
497
|
return {
|
|
508
498
|
signedTransaction: signedTx, // Raw Uint8Array from Privy
|
|
509
499
|
blockNumber: 0,
|
|
@@ -512,7 +502,7 @@ class PrivyWalletProvider {
|
|
|
512
502
|
};
|
|
513
503
|
}
|
|
514
504
|
// Sign and submit using shared helper
|
|
515
|
-
const { signature, txInfo } = await this.signAndSubmitInternal(tx, privyWallet, rpcUrl, connection);
|
|
505
|
+
const { signature, txInfo } = await this.signAndSubmitInternal(tx, privyWallet, rpcUrl, connection, solTransactionData.network);
|
|
516
506
|
return {
|
|
517
507
|
transactionSignature: signature,
|
|
518
508
|
blockNumber: (txInfo === null || txInfo === void 0 ? void 0 : txInfo.slot) || 0,
|
|
@@ -684,26 +674,25 @@ class PrivyWalletProvider {
|
|
|
684
674
|
}
|
|
685
675
|
// ============ Private Helpers ============
|
|
686
676
|
getRpcUrl(network) {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
if (network
|
|
691
|
-
return index_native.
|
|
692
|
-
}
|
|
693
|
-
else if (network === 'solana_mainnet') {
|
|
694
|
-
return index_native.SOLANA_MAINNET_RPC_URL;
|
|
677
|
+
return index_native.resolveSolanaRpcUrl(this.networkUrl, network !== null && network !== void 0 ? network : this.configuredNetwork, "Privy Solana transaction");
|
|
678
|
+
}
|
|
679
|
+
getChainId(network) {
|
|
680
|
+
if (network) {
|
|
681
|
+
return index_native.resolveSolanaWalletStandardChain(network, "Privy Solana transaction");
|
|
695
682
|
}
|
|
696
|
-
|
|
697
|
-
return
|
|
683
|
+
if (this.chainId)
|
|
684
|
+
return this.chainId;
|
|
685
|
+
if (this.configuredNetwork) {
|
|
686
|
+
return index_native.resolveSolanaWalletStandardChain(this.configuredNetwork, "Privy Solana transaction");
|
|
698
687
|
}
|
|
699
|
-
|
|
688
|
+
throw new Error("Privy Solana transaction requires config.chain as solana_devnet, solana_mainnet, or surfnet.");
|
|
700
689
|
}
|
|
701
690
|
/**
|
|
702
691
|
* Internal sign transaction - serializes and signs via Privy
|
|
703
692
|
* Returns the raw result from Privy (Uint8Array)
|
|
704
693
|
* This mirrors exactly what runTransaction was doing
|
|
705
694
|
*/
|
|
706
|
-
async signTransactionRaw(transaction, privyWallet) {
|
|
695
|
+
async signTransactionRaw(transaction, privyWallet, network) {
|
|
707
696
|
var _a;
|
|
708
697
|
// Serialize the transaction
|
|
709
698
|
// Use duck typing instead of instanceof to handle multiple @solana/web3.js versions
|
|
@@ -719,7 +708,7 @@ class PrivyWalletProvider {
|
|
|
719
708
|
const result = await ((_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.signTransaction({
|
|
720
709
|
transaction: serializedForSign,
|
|
721
710
|
wallet: privyWallet,
|
|
722
|
-
chain: this.
|
|
711
|
+
chain: this.getChainId(network)
|
|
723
712
|
}));
|
|
724
713
|
// Privy returns { signedTransaction: Uint8Array }, unwrap it
|
|
725
714
|
const signedTx = (result === null || result === void 0 ? void 0 : result.signedTransaction) || result;
|
|
@@ -764,13 +753,13 @@ class PrivyWalletProvider {
|
|
|
764
753
|
* For Surfnet: sign with signTransactionRaw, then sendRawTransaction
|
|
765
754
|
* For non-Surfnet: use Privy's signAndSendTransaction (combined operation)
|
|
766
755
|
*/
|
|
767
|
-
async signAndSubmitInternal(transaction, privyWallet, rpcUrl, connection) {
|
|
756
|
+
async signAndSubmitInternal(transaction, privyWallet, rpcUrl, connection, network) {
|
|
768
757
|
var _a;
|
|
769
|
-
const isSurfnet = rpcUrl === SURFNET_RPC_URL;
|
|
758
|
+
const isSurfnet = rpcUrl === index_native.SURFNET_RPC_URL;
|
|
770
759
|
let signature;
|
|
771
760
|
if (isSurfnet) {
|
|
772
761
|
// For Surfnet: sign with signTransactionRaw, then sendRawTransaction
|
|
773
|
-
const signedTx = await this.signTransactionRaw(transaction, privyWallet);
|
|
762
|
+
const signedTx = await this.signTransactionRaw(transaction, privyWallet, network);
|
|
774
763
|
signature = await connection.sendRawTransaction(signedTx);
|
|
775
764
|
}
|
|
776
765
|
else {
|
|
@@ -788,7 +777,7 @@ class PrivyWalletProvider {
|
|
|
788
777
|
const result = await ((_a = this.privyMethods) === null || _a === void 0 ? void 0 : _a.useSendTransactionSolana.signAndSendTransaction({
|
|
789
778
|
transaction: serializedTx,
|
|
790
779
|
wallet: privyWallet,
|
|
791
|
-
chain: this.
|
|
780
|
+
chain: this.getChainId(network)
|
|
792
781
|
}));
|
|
793
782
|
// Handle case where signature might be bytes instead of string
|
|
794
783
|
const rawSig = result.signature;
|
|
@@ -855,16 +844,7 @@ class PrivyWalletProvider {
|
|
|
855
844
|
}
|
|
856
845
|
let privyWallet = this.privyMethods.wallets.find((wallet) => wallet.address === sessionAddress);
|
|
857
846
|
if (!privyWallet) {
|
|
858
|
-
|
|
859
|
-
const accessToken = await this.privyMethods.getAccessToken();
|
|
860
|
-
await this.createSession(this.privyMethods.wallets[0].address, accessToken, this.privyMethods.identityToken);
|
|
861
|
-
index_native.setCurrentUser({ address: this.privyMethods.wallets[0].address, provider: this });
|
|
862
|
-
const session = await core.getActiveSessionManager().getSession();
|
|
863
|
-
sessionAddress = session === null || session === void 0 ? void 0 : session.address;
|
|
864
|
-
if (!sessionAddress) {
|
|
865
|
-
throw new Error('No wallet connected or logged in to sign message');
|
|
866
|
-
}
|
|
867
|
-
privyWallet = this.privyMethods.wallets[0];
|
|
847
|
+
throw new Error('Active Privy wallets do not include the authenticated session wallet; please log in again.');
|
|
868
848
|
}
|
|
869
849
|
// Use the Privy signMessage hook for Solana wallets
|
|
870
850
|
// The message needs to be passed as a Uint8Array
|
|
@@ -875,7 +855,7 @@ class PrivyWalletProvider {
|
|
|
875
855
|
}));
|
|
876
856
|
// The signature is returned as a Uint8Array, encode it as base58 (standard Solana format)
|
|
877
857
|
const signatureBytes = (result === null || result === void 0 ? void 0 : result.signature) || result;
|
|
878
|
-
const bs58 = await Promise.resolve().then(function () { return require('./index.native-
|
|
858
|
+
const bs58 = await Promise.resolve().then(function () { return require('./index.native-Dr3FOz16.js'); }).then(function (n) { return n.index; });
|
|
879
859
|
return bs58.default.encode(signatureBytes);
|
|
880
860
|
}
|
|
881
861
|
async restoreSession() {
|
|
@@ -894,22 +874,21 @@ class PrivyWalletProvider {
|
|
|
894
874
|
// Privy-specific token verification — it arrives as a Solana signature and is
|
|
895
875
|
// recorded server-side as authMethod 'phantom'.
|
|
896
876
|
async createSession(address, _accessToken, _idToken) {
|
|
897
|
-
var _a, _b, _c, _d
|
|
898
|
-
|
|
899
|
-
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];
|
|
877
|
+
var _a, _b, _c, _d;
|
|
878
|
+
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);
|
|
900
879
|
if (!privyWallet) {
|
|
901
|
-
throw new Error('No Privy Solana wallet
|
|
880
|
+
throw new Error('No Privy Solana wallet matching the requested session address is available.');
|
|
902
881
|
}
|
|
903
882
|
const nonce = await core.genAuthNonce();
|
|
904
883
|
const message = await core.genSolanaMessage(address, nonce);
|
|
905
884
|
const messageBytes = index_native.getPlatform().textEncode(message);
|
|
906
885
|
// Low-level Privy sign hook — signs WITHOUT touching the session (the public
|
|
907
886
|
// signMessage() bootstraps sessions, which would recurse here).
|
|
908
|
-
const signResult = await ((
|
|
887
|
+
const signResult = await ((_c = this.privyMethods) === null || _c === void 0 ? void 0 : _c.signMessage({
|
|
909
888
|
message: messageBytes,
|
|
910
889
|
wallet: privyWallet,
|
|
911
890
|
}));
|
|
912
|
-
const signatureBytes = (
|
|
891
|
+
const signatureBytes = (_d = signResult === null || signResult === void 0 ? void 0 : signResult.signature) !== null && _d !== void 0 ? _d : signResult;
|
|
913
892
|
// base64-encoded detached signature (matches Phantom + guest providers).
|
|
914
893
|
const signature = index_native.bufferExports.Buffer.from(signatureBytes).toString('base64');
|
|
915
894
|
const createSessionResult = await core.createSessionWithSignature(address, message, signature);
|
|
@@ -967,4 +946,4 @@ class PrivyWalletProvider {
|
|
|
967
946
|
PrivyWalletProvider.instance = null;
|
|
968
947
|
|
|
969
948
|
exports.PrivyWalletProvider = PrivyWalletProvider;
|
|
970
|
-
//# sourceMappingURL=privy-wallet-provider-
|
|
949
|
+
//# sourceMappingURL=privy-wallet-provider-BSwx78fY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privy-wallet-provider-BSwx78fY.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 { 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":["normalizeSolanaRpcUrl","resolveSolanaRpcUrl","resolveSolanaWalletStandardChain","SessionManager","setCurrentUser","React","ReactDOM","Connection","convertRemainingAccounts","anchor","VersionedTransaction","Buffer","buildSetDocumentsTransaction","PublicKey","Transaction","SURFNET_RPC_URL","bs58","confirmAndCheckTransaction","getPlatform","genAuthNonce","genSolanaMessage","createSessionWithSignature"],"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,MAA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