@bounded-sh/client 0.0.64 → 0.0.65

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.
Files changed (65) hide show
  1. package/dist/auth/providers/injected-wallet-provider.d.ts +1 -1
  2. package/dist/auth/providers/privy-expo-provider.d.ts +1 -1
  3. package/dist/auth/turnkey-signing-capability.d.ts +20 -0
  4. package/dist/{email-auth-provider-v9xvY0Ky.mjs → email-auth-provider-BLHNLu5l.mjs} +2 -2
  5. package/dist/{email-auth-provider-v9xvY0Ky.mjs.map → email-auth-provider-BLHNLu5l.mjs.map} +1 -1
  6. package/dist/{email-auth-provider-97CluDlZ.js → email-auth-provider-CJVJsWXv.js} +2 -2
  7. package/dist/{email-auth-provider-97CluDlZ.js.map → email-auth-provider-CJVJsWXv.js.map} +1 -1
  8. package/dist/{email-auth-provider-CKM4O5Z1.js → email-auth-provider-DYtoSrdm.js} +2 -2
  9. package/dist/{email-auth-provider-CKM4O5Z1.js.map → email-auth-provider-DYtoSrdm.js.map} +1 -1
  10. package/dist/{email-auth-provider-h0fPnU76.mjs → email-auth-provider-wqNimboO.mjs} +2 -2
  11. package/dist/{email-auth-provider-h0fPnU76.mjs.map → email-auth-provider-wqNimboO.mjs.map} +1 -1
  12. package/dist/{guest-auth-provider-Dmup2WIL.mjs → guest-auth-provider-C3EGlSSp.mjs} +2 -2
  13. package/dist/{guest-auth-provider-BLRbjAv2.mjs.map → guest-auth-provider-C3EGlSSp.mjs.map} +1 -1
  14. package/dist/{guest-auth-provider-BLRbjAv2.mjs → guest-auth-provider-CKkNZ-1p.mjs} +2 -2
  15. package/dist/{guest-auth-provider-Dmup2WIL.mjs.map → guest-auth-provider-CKkNZ-1p.mjs.map} +1 -1
  16. package/dist/{guest-auth-provider-CLnFuodt.js → guest-auth-provider-CoI0r92a.js} +2 -2
  17. package/dist/{guest-auth-provider-CLnFuodt.js.map → guest-auth-provider-CoI0r92a.js.map} +1 -1
  18. package/dist/{guest-auth-provider-BvIf5W5c.js → guest-auth-provider-UMP8Z_bK.js} +2 -2
  19. package/dist/{guest-auth-provider-BvIf5W5c.js.map → guest-auth-provider-UMP8Z_bK.js.map} +1 -1
  20. package/dist/{index-7yz-Olrm.mjs → index-Cgbr0abz.mjs} +111 -108
  21. package/dist/index-Cgbr0abz.mjs.map +1 -0
  22. package/dist/{index-Bk0nEjB6.js → index-FkEGh6dx.js} +109 -107
  23. package/dist/index-FkEGh6dx.js.map +1 -0
  24. package/dist/index.d.ts +0 -1
  25. package/dist/index.js +1 -2
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +1 -1
  28. package/dist/{index.native-Do-VhPUG.js → index.native-CAHw3k3_.js} +108 -106
  29. package/dist/index.native-CAHw3k3_.js.map +1 -0
  30. package/dist/{index.native-CWcQMPZd.mjs → index.native-wyaknPBR.mjs} +110 -107
  31. package/dist/index.native-wyaknPBR.mjs.map +1 -0
  32. package/dist/index.native.d.ts +0 -1
  33. package/dist/index.native.js +1 -2
  34. package/dist/index.native.js.map +1 -1
  35. package/dist/index.native.mjs +1 -1
  36. package/dist/{injected-evm-wallet-provider-xvZq9Zli.mjs → injected-evm-wallet-provider-B8x7dNuL.mjs} +2 -2
  37. package/dist/{injected-evm-wallet-provider-xvZq9Zli.mjs.map → injected-evm-wallet-provider-B8x7dNuL.mjs.map} +1 -1
  38. package/dist/{injected-evm-wallet-provider-BMiT8I-4.js → injected-evm-wallet-provider-BAToKWZo.js} +2 -2
  39. package/dist/{injected-evm-wallet-provider-BMiT8I-4.js.map → injected-evm-wallet-provider-BAToKWZo.js.map} +1 -1
  40. package/dist/{injected-evm-wallet-provider-B5MA0w8I.js → injected-evm-wallet-provider-D-7Eg6TS.js} +2 -2
  41. package/dist/{injected-evm-wallet-provider-B5MA0w8I.js.map → injected-evm-wallet-provider-D-7Eg6TS.js.map} +1 -1
  42. package/dist/{injected-evm-wallet-provider-DlPsOmik.mjs → injected-evm-wallet-provider-pVKJtDHL.mjs} +2 -2
  43. package/dist/{injected-evm-wallet-provider-DlPsOmik.mjs.map → injected-evm-wallet-provider-pVKJtDHL.mjs.map} +1 -1
  44. package/dist/{injected-wallet-provider-CSj0lY9H.js → injected-wallet-provider-28GE3rH9.js} +8 -75
  45. package/dist/injected-wallet-provider-28GE3rH9.js.map +1 -0
  46. package/dist/{injected-wallet-provider-Dd7ij6bc.mjs → injected-wallet-provider-5NeXEzui.mjs} +9 -76
  47. package/dist/injected-wallet-provider-5NeXEzui.mjs.map +1 -0
  48. package/dist/{injected-wallet-provider-YHhhFzsj.mjs → injected-wallet-provider-BojBmTAQ.mjs} +9 -76
  49. package/dist/injected-wallet-provider-BojBmTAQ.mjs.map +1 -0
  50. package/dist/{injected-wallet-provider-CoE5XQQn.js → injected-wallet-provider-DvwlPJea.js} +8 -75
  51. package/dist/injected-wallet-provider-DvwlPJea.js.map +1 -0
  52. package/dist/onramp.d.ts +4 -1
  53. package/package.json +2 -2
  54. package/dist/auth/providers/phantom-wallet-provider.d.ts +0 -111
  55. package/dist/auth/providers/privy-wallet-provider.d.ts +0 -83
  56. package/dist/auth/providers/sol/sol-utils.d.ts +0 -2
  57. package/dist/auth/providers/solana-mobile-wallet-provider.d.ts +0 -151
  58. package/dist/index-7yz-Olrm.mjs.map +0 -1
  59. package/dist/index-Bk0nEjB6.js.map +0 -1
  60. package/dist/index.native-CWcQMPZd.mjs.map +0 -1
  61. package/dist/index.native-Do-VhPUG.js.map +0 -1
  62. package/dist/injected-wallet-provider-CSj0lY9H.js.map +0 -1
  63. package/dist/injected-wallet-provider-CoE5XQQn.js.map +0 -1
  64. package/dist/injected-wallet-provider-Dd7ij6bc.mjs.map +0 -1
  65. package/dist/injected-wallet-provider-YHhhFzsj.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-Do-VhPUG.js');
4
+ var index_native = require('./index.native-CAHw3k3_.js');
5
5
  require('react');
6
6
 
7
7
  /**
@@ -192,79 +192,12 @@ class InjectedWalletProvider {
192
192
  * set-documents transaction with the injected wallet as payer, then sign +
193
193
  * submit with the wallet's own keypair.
194
194
  */
195
- async runTransaction(_evmTransactionData, solTransactionData, options) {
196
- var _a, _b;
197
- const [chainSdk, programSdk] = await Promise.all([
198
- import('@solana/web3.js'),
199
- import('@coral-xyz/anchor'),
200
- ]);
201
- const { Connection, PublicKey, VersionedTransaction } = chainSdk;
202
- if (!solTransactionData) {
203
- throw new Error('Solana transaction data is required for wallet login');
204
- }
205
- const provider = this.resolveProvider();
206
- const address = await this.connectAddress(provider, true).catch(() => this.connectAddress(provider));
207
- const publicKey = new PublicKey(address);
208
- const rpcUrl = this.getRpcUrl(solTransactionData.network);
209
- const connection = new Connection(rpcUrl, 'confirmed');
210
- const app_id = solTransactionData.appId;
211
- if (!app_id)
212
- throw new Error('App ID is required');
213
- const walletAdapter = {
214
- publicKey,
215
- signTransaction: async (tx) => provider.signTransaction(tx),
216
- signAllTransactions: async (txs) => provider.signAllTransactions
217
- ? provider.signAllTransactions(txs)
218
- : Promise.all(txs.map((t) => provider.signTransaction(t))),
219
- };
220
- const ProviderClass = programSdk[['Anch', 'orProvider'].join('')];
221
- const programProvider = new ProviderClass(connection, walletAdapter, ProviderClass.defaultOptions());
222
- const remainingAccounts = core.convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
223
- const finalDeduped = [];
224
- for (const acc of remainingAccounts) {
225
- const existing = finalDeduped.find((d) => d.pubkey.equals(acc.pubkey));
226
- if (existing) {
227
- existing.isSigner = existing.isSigner || acc.isSigner;
228
- existing.isWritable = existing.isWritable || acc.isWritable;
229
- }
230
- else {
231
- finalDeduped.push(acc);
232
- }
233
- }
234
- let tx;
235
- if (solTransactionData.signedTransaction) {
236
- // Server co-signed (CPI attestation) — just add the wallet signature.
237
- tx = VersionedTransaction.deserialize(index_native.bufferExports.Buffer.from(solTransactionData.signedTransaction, 'base64'));
238
- }
239
- else {
240
- const result = await core.buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, programProvider, publicKey, {
241
- app_id,
242
- documents: solTransactionData.txArgs[0].setDocumentData,
243
- delete_paths: solTransactionData.txArgs[0].deletePaths,
244
- txData: solTransactionData.txArgs[0].txData,
245
- }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false, solTransactionData.additionalLutAddresses);
246
- tx = result.tx;
247
- }
248
- if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
249
- const signedTx = await walletAdapter.signTransaction(tx);
250
- return { signedTransaction: signedTx, blockNumber: 0, gasUsed: '0', data: '' };
251
- }
252
- let signature;
253
- if (typeof provider.signAndSendTransaction === 'function') {
254
- const res = await provider.signAndSendTransaction(tx);
255
- signature = res.signature;
256
- }
257
- else {
258
- const signedTx = await walletAdapter.signTransaction(tx);
259
- signature = await connection.sendRawTransaction(signedTx.serialize());
260
- }
261
- const txInfo = await index_native.confirmAndCheckTransaction(connection, signature);
262
- return {
263
- transactionSignature: signature,
264
- blockNumber: (txInfo === null || txInfo === void 0 ? void 0 : txInfo.slot) || 0,
265
- gasUsed: ((_b = (_a = txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta) === null || _a === void 0 ? void 0 : _a.fee) === null || _b === void 0 ? void 0 : _b.toString()) || '0',
266
- data: txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta,
267
- };
195
+ async runTransaction(_evmTransactionData, _solTransactionData, _options) {
196
+ // Client-side Solana transaction building is retired: the realtime
197
+ // worker returns a fully-built (and, when sponsored, partially-signed)
198
+ // transaction on its 202, which the SDK validates and signs via
199
+ // signTransaction. This provider serves no EVM payload either.
200
+ throw new Error('runTransaction is not supported by this provider; Bounded returns pre-built Solana transactions that are signed with signTransaction.');
268
201
  }
269
202
  async getNativeMethods() {
270
203
  return this.resolveProvider();
@@ -277,4 +210,4 @@ InjectedWalletProvider.instance = null;
277
210
 
278
211
  exports.InjectedWalletProvider = InjectedWalletProvider;
279
212
  exports.defaultInjectedProvider = defaultInjectedProvider;
280
- //# sourceMappingURL=injected-wallet-provider-CoE5XQQn.js.map
213
+ //# sourceMappingURL=injected-wallet-provider-DvwlPJea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injected-wallet-provider-DvwlPJea.js","sources":["../.rollup-tmp/auth/providers/injected-wallet-types.js","../.rollup-tmp/auth/providers/injected-wallet-provider.js"],"sourcesContent":["/**\n * Default provider discovery: Phantom-first, then any Wallet-Standard\n * `window.solana`. Kept tiny + synchronous (no heavy imports) so it works inside\n * a user gesture and can be eagerly exported from the SDK entry.\n */\nexport function defaultInjectedProvider() {\n var _a;\n if (typeof window === 'undefined')\n return null;\n const w = window;\n const phantom = (_a = w === null || w === void 0 ? void 0 : w.phantom) === null || _a === void 0 ? void 0 : _a.solana;\n if (phantom && typeof phantom.signMessage === 'function')\n return phantom;\n const generic = w === null || w === void 0 ? void 0 : w.solana;\n if (generic && typeof generic.signMessage === 'function')\n return generic;\n return null;\n}\n","import { getActiveSessionManager as SessionManager, createSessionWithSignature, genAuthNonce, genSolanaMessage, } from '@bounded-sh/core';\nimport { Buffer } from 'buffer';\nimport bs58 from 'bs58';\nimport { setCurrentUser, setAuthLoading } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { normalizeSolanaRpcUrl, resolveSolanaRpcUrl } from '../solana-rpc';\nimport { confirmAndCheckTransaction } from './transaction-utils';\nimport { defaultInjectedProvider, } from './injected-wallet-types';\n// Re-export the type surface + discovery helper for callers who import the\n// provider module directly.\nexport { defaultInjectedProvider };\nconst STORED_AUTH_METHOD_KEY = 'bounded_last_auth_method';\nconst INJECTED_AUTH_METHOD = 'phantom';\nconst NO_WALLET_ERR = 'No injected Solana wallet found. Install a wallet like Phantom (phantom.app) and try again, ' +\n 'or pass config.injectedWalletConfig.getProvider to point at your wallet.';\nexport class InjectedWalletProvider {\n constructor(config = {}, networkUrl = null, configuredNetwork = null) {\n var _a;\n if (typeof window === 'undefined') {\n throw new Error('InjectedWalletProvider can only be instantiated in a browser environment');\n }\n // `config.rpcUrl` is the legacy wallet-login-local override. Normalize\n // it before precedence so an empty legacy value cannot shadow the\n // current top-level config.rpcUrl. Re-initialization must also replace\n // every singleton field; otherwise a previous app's provider/RPC can\n // survive getAuthProvider()'s config-key rotation.\n const resolvedNetworkUrl = (_a = normalizeSolanaRpcUrl(config.rpcUrl)) !== null && _a !== void 0 ? _a : normalizeSolanaRpcUrl(networkUrl);\n const localNetwork = typeof config.network === 'string' && config.network.trim() !== ''\n ? config.network.trim()\n : null;\n const resolvedConfiguredNetwork = localNetwork !== null && localNetwork !== void 0 ? localNetwork : (typeof configuredNetwork === 'string' && configuredNetwork.trim() !== ''\n ? configuredNetwork.trim()\n : null);\n // Singleton so the SDK reuses one instance (mirrors the other providers).\n if (InjectedWalletProvider.instance) {\n InjectedWalletProvider.instance.config = Object.assign({}, config);\n InjectedWalletProvider.instance.networkUrl = resolvedNetworkUrl;\n InjectedWalletProvider.instance.configuredNetwork = resolvedConfiguredNetwork;\n return InjectedWalletProvider.instance;\n }\n this.config = Object.assign({}, config);\n this.networkUrl = resolvedNetworkUrl;\n this.configuredNetwork = resolvedConfiguredNetwork;\n InjectedWalletProvider.instance = this;\n }\n resolveProvider() {\n var _a;\n const provider = (_a = (this.config.getProvider ? this.config.getProvider() : null)) !== null && _a !== void 0 ? _a : defaultInjectedProvider();\n if (!provider)\n throw new Error(NO_WALLET_ERR);\n return provider;\n }\n /** Connect the injected wallet (if needed) and return its Solana address. */\n async connectAddress(provider, onlyIfTrusted = false) {\n var _a, _b;\n // Already connected — reuse the pubkey.\n if (provider.publicKey && ((_a = provider.isConnected) !== null && _a !== void 0 ? _a : true)) {\n return provider.publicKey.toString();\n }\n const res = await provider.connect(onlyIfTrusted ? { onlyIfTrusted: true } : undefined);\n const pk = (_b = res === null || res === void 0 ? void 0 : res.publicKey) !== null && _b !== void 0 ? _b : provider.publicKey;\n if (!pk)\n throw new Error('Wallet did not return a public key on connect');\n return pk.toString();\n }\n async login() {\n var _a;\n setAuthLoading(true);\n try {\n const provider = this.resolveProvider();\n const address = await this.connectAddress(provider);\n // Reuse a still-valid session for THIS wallet.\n const existing = await SessionManager().getSession();\n if (existing && existing.address === address) {\n const user = { address, id: address, provider: this };\n setCurrentUser(user);\n this.markAuthMethod();\n return user;\n }\n // SIWS: nonce -> canonical prompt -> the wallet signs it locally.\n const nonce = await genAuthNonce();\n const message = await genSolanaMessage(address, nonce);\n const messageBytes = getPlatform().textEncode(message);\n const signResult = await provider.signMessage(messageBytes, 'utf8');\n const signatureBytes = (_a = signResult === null || signResult === void 0 ? void 0 : signResult.signature) !== null && _a !== void 0 ? _a : signResult;\n // base64 detached ed25519 signature — matches guest/privy providers and\n // the bounded-auth issuer's base64ToBytes() verify path.\n const signature = Buffer.from(signatureBytes).toString('base64');\n const result = await createSessionWithSignature(address, message, signature);\n await SessionManager().storeSession(address, result.accessToken, result.idToken, result.refreshToken);\n this.markAuthMethod();\n const user = { address, id: address, provider: this };\n setCurrentUser(user);\n return user;\n }\n finally {\n setAuthLoading(false);\n }\n }\n markAuthMethod() {\n // Mark the auth method so clearIncompatibleSession() doesn't wipe this\n // wallet session on the next init().\n try {\n getPlatform().storage.setItem(STORED_AUTH_METHOD_KEY, INJECTED_AUTH_METHOD);\n }\n catch ( /* no storage */_a) { /* no storage */ }\n }\n async restoreSession() {\n const session = await SessionManager().getSession();\n if (!session)\n return null;\n const user = { address: session.address, id: session.address, provider: this };\n setCurrentUser(user);\n return user;\n }\n async logout() {\n // Clear the Bounded session; best-effort disconnect the wallet.\n await SessionManager().clearSession();\n try {\n const provider = this.config.getProvider ? this.config.getProvider() : defaultInjectedProvider();\n if (provider && typeof provider.disconnect === 'function')\n await provider.disconnect();\n }\n catch ( /* ignore */_a) { /* ignore */ }\n setCurrentUser(null);\n }\n // --- Full local-keypair signing surface (the wallet's OWN methods) --------\n async signMessage(message) {\n var _a;\n const provider = this.resolveProvider();\n await this.connectAddress(provider, true).catch(() => this.connectAddress(provider));\n const messageBytes = getPlatform().textEncode(message);\n const res = await provider.signMessage(messageBytes, 'utf8');\n const signatureBytes = (_a = res === null || res === void 0 ? void 0 : res.signature) !== null && _a !== void 0 ? _a : res;\n // base58 is the standard Solana signature encoding for app-facing signMessage.\n return bs58.encode(signatureBytes instanceof Uint8Array ? signatureBytes : new Uint8Array(signatureBytes));\n }\n async signTransaction(transaction) {\n const provider = this.resolveProvider();\n await this.connectAddress(provider, true).catch(() => this.connectAddress(provider));\n return provider.signTransaction(transaction);\n }\n async signAndSubmitTransaction(transaction, _feePayer) {\n const { Connection, PublicKey } = await import(\"@solana/web3.js\");\n const provider = this.resolveProvider();\n const address = await this.connectAddress(provider, true).catch(() => this.connectAddress(provider));\n const rpcUrl = this.getRpcUrl();\n const connection = new Connection(rpcUrl, 'confirmed');\n // Set a fresh blockhash on the tx (mirrors the other providers).\n const { blockhash } = await connection.getLatestBlockhash('confirmed');\n const isLegacy = 'recentBlockhash' in transaction &&\n !('message' in transaction && 'staticAccountKeys' in transaction.message);\n if (isLegacy) {\n const legacy = transaction;\n legacy.recentBlockhash = blockhash;\n if (!legacy.feePayer)\n legacy.feePayer = new PublicKey(address);\n }\n else {\n transaction.message.recentBlockhash = blockhash;\n }\n // Prefer the wallet's native signAndSend; fall back to\n // sign + manual submit for wallets without send.\n if (typeof provider.signAndSendTransaction === 'function') {\n const res = await provider.signAndSendTransaction(transaction);\n const signature = res.signature;\n await confirmAndCheckTransaction(connection, signature);\n return signature;\n }\n const signed = await provider.signTransaction(transaction);\n const raw = signed.serialize();\n const signature = await connection.sendRawTransaction(raw);\n await confirmAndCheckTransaction(connection, signature);\n return signature;\n }\n /**\n * Onchain write path (mirrors the other wallet providers): build the Bounded\n * set-documents transaction with the injected wallet as payer, then sign +\n * submit with the wallet's own keypair.\n */\n async runTransaction(_evmTransactionData, _solTransactionData, _options) {\n // Client-side Solana transaction building is retired: the realtime\n // worker returns a fully-built (and, when sponsored, partially-signed)\n // transaction on its 202, which the SDK validates and signs via\n // signTransaction. This provider serves no EVM payload either.\n throw new Error('runTransaction is not supported by this provider; Bounded returns pre-built Solana transactions that are signed with signTransaction.');\n }\n async getNativeMethods() {\n return this.resolveProvider();\n }\n getRpcUrl(network) {\n return resolveSolanaRpcUrl(this.networkUrl, network !== null && network !== void 0 ? network : this.configuredNetwork, 'Wallet-login Solana transaction');\n }\n}\nInjectedWalletProvider.instance = null;\n"],"names":["normalizeSolanaRpcUrl","setAuthLoading","SessionManager","setCurrentUser","genAuthNonce","genSolanaMessage","getPlatform","Buffer","createSessionWithSignature","bs58","confirmAndCheckTransaction","resolveSolanaRpcUrl"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,GAAG;AAC1C,IAAI,IAAI,EAAE;AACV,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW;AACrC,QAAQ,OAAO,IAAI;AACnB,IAAI,MAAM,CAAC,GAAG,MAAM;AACpB,IAAI,MAAM,OAAO,GAAG,CAAC,EAAE,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,MAAM;AACzH,IAAI,IAAI,OAAO,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU;AAC5D,QAAQ,OAAO,OAAO;AACtB,IAAI,MAAM,OAAO,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,MAAM;AAClE,IAAI,IAAI,OAAO,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU;AAC5D,QAAQ,OAAO,OAAO;AACtB,IAAI,OAAO,IAAI;AACf;;ACNA,MAAM,sBAAsB,GAAG,0BAA0B;AACzD,MAAM,oBAAoB,GAAG,SAAS;AACtC,MAAM,aAAa,GAAG,8FAA8F;AACpH,IAAI,0EAA0E;AACvE,MAAM,sBAAsB,CAAC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set to buy. Default 'USDC'. */
3
3
  asset?: 'SOL' | 'USDC';
4
- /** Destination Solana address. Default: the signed-in user's wallet. */
4
+ /**
5
+ * @deprecated Ignored. Onramp always funds the signed-in user's own embedded
6
+ * wallet; a caller-supplied destination is dropped server-side (DS2-0076).
7
+ */
5
8
  address?: string;
6
9
  /** Exact fiat amount in USD ($2-$25,000). Mutually exclusive with minAmountOut. */
7
10
  amountUsd?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bounded-sh/client",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "description": "Web and React Native client SDK for Bounded, the full-stack app builder and runtime for AI-built apps: hosted auth, policy-enforced data, files and search, functions, realtime subscriptions, and atomic writes.",
5
5
  "homepage": "https://bounded.sh/docs/sdk",
6
6
  "main": "./dist/index.js",
@@ -125,7 +125,7 @@
125
125
  "vite": "7.3.5"
126
126
  },
127
127
  "dependencies": {
128
- "@bounded-sh/core": "0.0.64",
128
+ "@bounded-sh/core": "0.0.65",
129
129
  "@coral-xyz/anchor": "0.31.1",
130
130
  "@solana/wallet-standard-features": "1.3.0",
131
131
  "@solana/web3.js": "1.98.4",
@@ -1,111 +0,0 @@
1
- import type { EVMTransaction, SolTransaction, TransactionResult, User, AuthProvider, SetOptions } from '@bounded-sh/core';
2
- import type { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
3
- export type PhantomProviderType = 'injected' | 'google' | 'apple' | 'deeplink' | 'phantom';
4
- export interface PhantomWalletConfig {
5
- appId?: string;
6
- /** Providers to use for authentication. Accepts string[] for convenience (e.g., ["injected"]) */
7
- providers?: PhantomProviderType[] | string[];
8
- autoConnect?: boolean;
9
- /** Theme for the connect modal: 'light' or 'dark'. Defaults to 'dark'. */
10
- theme?: 'light' | 'dark';
11
- /** App name displayed in the connect modal */
12
- appName?: string;
13
- /** App icon URL displayed in the connect modal */
14
- appIcon?: string;
15
- /** Custom title shown at the top of the login modal. Overrides the default "Log in to your account". */
16
- modalTitle?: string;
17
- /** Custom subtitle shown below the title in the login modal. */
18
- modalSubtitle?: string;
19
- }
20
- /**
21
- * Per-call overrides for `login()`. All fields are optional and take precedence
22
- * over the values set in `PhantomWalletConfig` during `init()`.
23
- */
24
- export interface LoginOptions {
25
- /** Override the modal theme just for this login call. */
26
- theme?: 'light' | 'dark';
27
- /** Override the modal title just for this login call. */
28
- modalTitle?: string;
29
- /** Override the modal subtitle just for this login call. */
30
- modalSubtitle?: string;
31
- }
32
- export declare class PhantomWalletProvider implements AuthProvider {
33
- private static instance;
34
- private containerElement;
35
- private networkUrl;
36
- private configuredNetwork;
37
- private root;
38
- private phantomMethods;
39
- private config;
40
- private resolvedProviders;
41
- private pendingLogin;
42
- private loginInProgress;
43
- private autoLoginInProgress;
44
- private initPromise;
45
- private loginOverrides;
46
- /** Temporarily override modal appearance for a single login() call. Cleared automatically after login settles. */
47
- setLoginOverrides(opts: LoginOptions | null): void;
48
- /** Callback to swap to a Mobile Wallet Adapter provider when the user clicks "Connect Mobile Wallet" */
49
- onSwitchToMWA: (() => Promise<AuthProvider>) | null;
50
- constructor(networkUrl?: string | null, config?: PhantomWalletConfig, configuredNetwork?: string | null);
51
- private initializeAsync;
52
- /**
53
- * Check if social login providers are configured (non-injected providers).
54
- */
55
- private hasSocialProviders;
56
- static getInstance(networkUrl: string | null, config: PhantomWalletConfig, configuredNetwork?: string | null): PhantomWalletProvider;
57
- private resolveProviders;
58
- /**
59
- * Patch the Phantom extension's provider to gracefully handle `phantom_getFeatures`
60
- * instead of throwing. Some SDKs probe this method to check feature support, but the
61
- * extension doesn't implement it, causing noisy console errors.
62
- */
63
- private patchPhantomGetFeatures;
64
- private initialize;
65
- private ensureReady;
66
- private ensureSolanaReady;
67
- /**
68
- * Get the list of available (configured) providers for this wallet.
69
- */
70
- getAvailableProviders(): PhantomProviderType[];
71
- /**
72
- * Login using the Phantom connect modal. A custom modal is rendered with the
73
- * discovered wallets and configured social providers instead of the SDK's
74
- * built-in modal.
75
- */
76
- login(): Promise<User | null>;
77
- restoreSession(): Promise<User | null>;
78
- private awaitTopLevelConnect;
79
- address(): Promise<string | null>;
80
- runTransaction(_evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise<TransactionResult>;
81
- /**
82
- * Signs a Solana transaction without submitting it.
83
- *
84
- * This method handles blockhash automatically if not set - you do NOT need to
85
- * set recentBlockhash on the transaction before calling this method.
86
- * The network/RPC URL is derived from the provider's configuration (set during initialization).
87
- *
88
- * @param transaction - The transaction to sign (Transaction or VersionedTransaction)
89
- * @returns The signed transaction
90
- */
91
- signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
92
- /**
93
- * Signs and submits a Solana transaction to the network.
94
- *
95
- * This method handles blockhash and transaction confirmation automatically - you do NOT need to
96
- * set recentBlockhash or lastValidBlockHeight on the transaction before calling this method.
97
- * The network/RPC URL is derived from the provider's configuration (set during initialization).
98
- *
99
- * @param transaction - The transaction to sign and submit (Transaction or VersionedTransaction)
100
- * @param feePayer - Optional fee payer public key. If not provided and the transaction doesn't
101
- * already have a feePayer set, the connected wallet address will be used.
102
- * Useful for co-signing scenarios where a different account pays the fees.
103
- * @returns The transaction signature
104
- */
105
- signAndSubmitTransaction(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise<string>;
106
- signMessage(message: string): Promise<string>;
107
- logout(): Promise<void>;
108
- getNativeMethods(): Promise<any>;
109
- private getRpcUrl;
110
- private signAndSendViaPhantom;
111
- }
@@ -1,83 +0,0 @@
1
- import type { EVMTransaction, SolTransaction, TransactionResult, AuthProvider, User, SetOptions } from '@bounded-sh/core';
2
- import type { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
3
- type PrivyWalletConfig = {
4
- appId: string;
5
- config: any;
6
- };
7
- export declare class PrivyWalletProvider implements AuthProvider {
8
- private static instance;
9
- private containerElement;
10
- private networkUrl;
11
- private configuredNetwork;
12
- private chainId;
13
- private root;
14
- private privyMethods;
15
- private privyConfig;
16
- private pendingLogin;
17
- private configuredRpcUrl;
18
- private pendingTransaction;
19
- private pendingSignTransaction;
20
- private pendingSignMessage;
21
- private pendingSignAndSubmitTransaction;
22
- constructor(appName: string | null, appLogoUrl: string | null, privyConfig: PrivyWalletConfig | undefined, networkUrl?: string | null, configuredNetwork?: string | null);
23
- static getInstance(appName: string | null, appLogoUrl: string | null, privyConfig: PrivyWalletConfig, networkUrl?: string | null, configuredNetwork?: string | null): PrivyWalletProvider;
24
- private initialize;
25
- login(): Promise<User | null>;
26
- getNativeMethods(): Promise<any>;
27
- logout(): Promise<void>;
28
- runTransaction(_evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise<TransactionResult>;
29
- /**
30
- * Signs a Solana transaction without submitting it.
31
- *
32
- * This method handles blockhash automatically if not set - you do NOT need to
33
- * set recentBlockhash on the transaction before calling this method.
34
- * The network/RPC URL is derived from the provider's configuration (set during initialization).
35
- *
36
- * @param transaction - The transaction to sign (Transaction or VersionedTransaction)
37
- * @returns The signed transaction
38
- */
39
- signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
40
- /**
41
- * Signs and submits a Solana transaction to the network.
42
- *
43
- * This method handles blockhash and transaction confirmation automatically - you do NOT need to
44
- * set recentBlockhash or lastValidBlockHeight on the transaction before calling this method.
45
- * The network/RPC URL is derived from the provider's configuration (set during initialization).
46
- *
47
- * @param transaction - The transaction to sign and submit (Transaction or VersionedTransaction)
48
- * @param feePayer - Optional fee payer public key. If not provided and the transaction doesn't
49
- * already have a feePayer set, the connected wallet address will be used.
50
- * Useful for co-signing scenarios where a different account pays the fees.
51
- * @returns The transaction signature
52
- */
53
- signAndSubmitTransaction(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise<string>;
54
- private getRpcUrl;
55
- private getChainId;
56
- /**
57
- * Internal sign transaction - serializes and signs via Privy
58
- * Returns the raw result from Privy (Uint8Array)
59
- * This mirrors exactly what runTransaction was doing
60
- */
61
- private signTransactionRaw;
62
- /**
63
- * Deserialize a signed transaction from Uint8Array to Transaction object
64
- */
65
- private deserializeSignedTransaction;
66
- /**
67
- * Internal sign and submit - the core submission logic used by both
68
- * signAndSubmitTransaction and runTransaction, via Privy's combined
69
- * signAndSendTransaction operation.
70
- */
71
- private signAndSubmitInternal;
72
- signMessage(message: string): Promise<string>;
73
- restoreSession(): Promise<User | null>;
74
- private createSession;
75
- /**
76
- * Waits for a wallet matching the session address to appear in the wallets array.
77
- * This handles the timing gap where Privy's embedded wallet (created for email login users)
78
- * may not yet be in the useWallets() array when signTransaction is called immediately after login.
79
- */
80
- private waitForMatchingWallet;
81
- private ensureReady;
82
- }
83
- export {};
@@ -1,2 +0,0 @@
1
- import type { Transaction, VersionedTransaction } from "@solana/web3.js";
2
- export declare function deserializeTransaction(tx: string | Buffer): Promise<Transaction | VersionedTransaction>;
@@ -1,151 +0,0 @@
1
- import type { EVMTransaction, SolTransaction, TransactionResult, User, AuthProvider, SetOptions } from '@bounded-sh/core';
2
- import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
3
- export interface SolanaMobileWalletConfig {
4
- /** App identity shown to the wallet during authorization */
5
- appIdentity?: {
6
- name?: string;
7
- uri?: string;
8
- icon?: string;
9
- };
10
- /** Solana cluster: 'mainnet-beta' | 'devnet' | 'testnet' */
11
- cluster?: string;
12
- /** Theme for any UI elements: 'light' or 'dark' */
13
- theme?: 'light' | 'dark';
14
- }
15
- /**
16
- * Detects whether the current environment is a mobile browser capable of
17
- * Mobile Wallet Adapter (MWA) communication.
18
- *
19
- * Returns true on Android browsers (Chrome, etc.) where MWA intents work,
20
- * or inside a Seeker/Saga in-app browser context.
21
- */
22
- export declare function isMobileWalletAvailable(): boolean;
23
- /**
24
- * Registers Mobile Wallet Adapter as a wallet-standard wallet so it appears
25
- * in wallet selection UIs and can be discovered by other wallet-standard consumers.
26
- *
27
- * Call this once at app startup (in a browser-only / non-SSR context).
28
- *
29
- * @param config - App identity and optional remote host authority for desktop QR code support
30
- */
31
- export declare function registerMobileWalletAdapter(config?: {
32
- appIdentity?: {
33
- name?: string;
34
- uri?: string;
35
- icon?: string;
36
- };
37
- chains?: string[];
38
- remoteHostAuthority?: string;
39
- /**
40
- * Optional custom wallet-not-found handler. If omitted, the SDK installs
41
- * a no-op (NOT the library default) — see comment below.
42
- */
43
- onWalletNotFound?: (mobileWalletAdapter: any) => Promise<void>;
44
- }): Promise<void>;
45
- /**
46
- * SolanaMobileWalletProvider implements the AuthProvider interface using
47
- * Solana Mobile's wallet-standard wrapper (`LocalSolanaMobileWalletAdapterWallet`).
48
- *
49
- * Why wallet-standard and not the raw MWA protocol: as of
50
- * `@solana-mobile/wallet-standard-mobile@0.5.0+`, the wallet's internal
51
- * `#transact` calls `checkLocalNetworkAccessPermission()` before opening the
52
- * localhost WebSocket. That helper renders a three-stage UX flow Solana
53
- * Mobile designed specifically to defuse Chrome's Local Network Access
54
- * permission dialog (which renders with disabled buttons on Android Chrome,
55
- * the source of the long-running Seeker MWA bug):
56
- *
57
- * 1. "Allow connections to your wallet" informational modal.
58
- * 2. Chrome's permission prompt (interactive because it's spawned as a
59
- * fresh user gesture from step 1).
60
- * 3. "Ready to connect!" success modal.
61
- *
62
- * `checkLocalNetworkAccessPermission` is internal to the library — it's not
63
- * exported. The only way to invoke it is to go through the wallet's
64
- * `standard:connect` / `solana:sign*` features, which is what this provider
65
- * does.
66
- *
67
- * Notes on UX: login uses two wallet popups in succession — `standard:connect`
68
- * (authorize) and `solana:signMessage` (sign the Bounded nonce). The
69
- * previous implementation combined both inside a single `transact` callback;
70
- * splitting them is the cost of going through wallet-standard, and is
71
- * acceptable given the alternative was broken on Seeker.
72
- */
73
- export declare class SolanaMobileWalletProvider implements AuthProvider {
74
- private static instance;
75
- private networkUrl;
76
- private configuredNetwork;
77
- private config;
78
- private appIdentity;
79
- /** Raw cluster name (e.g. 'mainnet-beta'); mapped via mapChainToWalletStandard. */
80
- private cluster;
81
- /** LocalSolanaMobileWalletAdapterWallet, lazy-constructed in ensureWallet(). */
82
- private wallet;
83
- constructor(networkUrl?: string | null, config?: SolanaMobileWalletConfig, configuredNetwork?: string | null);
84
- static getInstance(networkUrl: string | null, config: SolanaMobileWalletConfig, configuredNetwork?: string | null): SolanaMobileWalletProvider;
85
- /** Lazy-construct LocalSolanaMobileWalletAdapterWallet on first need. */
86
- private ensureWallet;
87
- /**
88
- * Ensure the wallet has an active authorization. After a Bounded session
89
- * is restored from storage on cold-start, `wallet.accounts` is empty until
90
- * we silently reconnect from the AuthorizationCache. If the cache is also
91
- * empty, fall back to interactive `login()` (which surfaces the three-stage
92
- * Solana Mobile LNA flow + wallet popups).
93
- *
94
- * Returns the wallet-standard `WalletAccount` to use for sign operations.
95
- */
96
- private ensureAuthorized;
97
- /** Returns the active wallet-standard chain identifier (e.g. 'solana:mainnet'). */
98
- private getChain;
99
- /**
100
- * Cached MWA auth_token returned by `wallet.authorize()`. Reused by
101
- * subsequent native transact() calls (signMessage / signTransaction)
102
- * so the user doesn't get the wallet-pick popup on every operation.
103
- * Persisted to platform storage and hydrated by the constructor on
104
- * native; cleared by logout() and on `ERROR_REAUTHORIZE`.
105
- */
106
- private nativeAuthToken;
107
- /** Cached public key string for the connected MWA wallet (native). */
108
- private nativeAddress;
109
- /**
110
- * Dynamically import and unwrap `transact` from the MWA web3js
111
- * package. The package is externalized in rollup.config.js so this
112
- * resolves to `lib/cjs/index.native.js` (TurboModule-backed) on
113
- * Metro and `lib/esm/index.browser.js` (WebSocket) on webpack/vite
114
- * per their respective platform conditions. Handles Metro's CJS-to-
115
- * ESM interop variance (`mod.transact` vs `mod.default?.transact`).
116
- */
117
- private loadTransact;
118
- /**
119
- * Cache and persist a fresh MWA auth_token + address. Called from
120
- * `_loginNative` after a successful authorize. Storage failures are
121
- * non-fatal (next cold-start re-auths).
122
- */
123
- private persistNativeAuth;
124
- /** Clear cached + persisted native auth state. */
125
- private clearNativeAuth;
126
- /**
127
- * Classify an MWA-native error as a user cancellation. User-cancel
128
- * shouldn't surface as a red console.error; callers can swallow or
129
- * show a softer message. MWA spec codes plus the same substring
130
- * checks the web path uses to catch wallet-specific phrasing.
131
- */
132
- private isNativeUserCancel;
133
- /**
134
- * Native MWA login via @solana-mobile/mobile-wallet-adapter-protocol-web3js.
135
- * Used in true React Native (Expo) environments where wallet-standard-mobile's
136
- * web universal-link path doesn't apply. Does authorize + signMessage in a
137
- * single transact() roundtrip — intent-based MWA doesn't need the two-popup
138
- * dance the web path uses (no Chrome activation-loss concern). Persists the
139
- * resulting auth_token so cold-start can reauthorize without a fresh popup.
140
- */
141
- private _loginNative;
142
- login(): Promise<User | null>;
143
- restoreSession(): Promise<User | null>;
144
- logout(): Promise<void>;
145
- signMessage(message: string): Promise<string>;
146
- signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
147
- signAndSubmitTransaction(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise<string>;
148
- runTransaction(_evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise<TransactionResult>;
149
- getNativeMethods(): Promise<any>;
150
- private getRpcUrl;
151
- }