@pooflabs/web 0.0.72 → 0.0.73

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.
@@ -10199,6 +10199,8 @@ async function setMany(many, options) {
10199
10199
  data,
10200
10200
  });
10201
10201
  })) !== null && _e !== void 0 ? _e : [],
10202
+ // Server co-signed transaction (when CPI tx_data is present)
10203
+ signedTransaction: tx.signedTransaction,
10202
10204
  };
10203
10205
  const transactionResult = await authProvider.runTransaction(undefined, solTransaction, options);
10204
10206
  return transactionResult;
@@ -13521,7 +13523,7 @@ async function loadDependencies() {
13521
13523
  const [reactModule, reactDomModule, phantomModule] = await Promise.all([
13522
13524
  import('react'),
13523
13525
  import('react-dom/client'),
13524
- import('./index-Crc3B1ZK.esm.js')
13526
+ import('./index-TfCOBCez.esm.js')
13525
13527
  ]);
13526
13528
  // Extract default export from ESM module namespace
13527
13529
  // Dynamic import() returns { default: Module, ...exports }, not the module directly
@@ -14427,12 +14429,22 @@ class PhantomWalletProvider {
14427
14429
  finalDeduped.push(acc);
14428
14430
  }
14429
14431
  }
14430
- const { tx } = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, publicKey, {
14431
- app_id,
14432
- documents: solTransactionData.txArgs[0].setDocumentData,
14433
- delete_paths: solTransactionData.txArgs[0].deletePaths,
14434
- txData: solTransactionData.txArgs[0].txData
14435
- }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false);
14432
+ // When the server has co-signed a transaction (CPI attestation),
14433
+ // deserialize it and just add the wallet signature instead of
14434
+ // building from components.
14435
+ let tx;
14436
+ if (solTransactionData.signedTransaction) {
14437
+ tx = VersionedTransaction.deserialize(bufferExports.Buffer.from(solTransactionData.signedTransaction, 'base64'));
14438
+ }
14439
+ else {
14440
+ const result = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, publicKey, {
14441
+ app_id,
14442
+ documents: solTransactionData.txArgs[0].setDocumentData,
14443
+ delete_paths: solTransactionData.txArgs[0].deletePaths,
14444
+ txData: solTransactionData.txArgs[0].txData
14445
+ }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false);
14446
+ tx = result.tx;
14447
+ }
14436
14448
  if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
14437
14449
  const signedTx = await walletAdapter.signTransaction(tx);
14438
14450
  return {
@@ -33669,7 +33681,24 @@ class PrivyWalletProvider {
33669
33681
  finalDeduped.push(acc);
33670
33682
  }
33671
33683
  }
33672
- const { tx, blockhash, lastValidBlockHeight } = 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);
33684
+ let tx;
33685
+ let blockhash;
33686
+ let lastValidBlockHeight;
33687
+ if (solTransactionData.signedTransaction) {
33688
+ // Server already set the blockhash and co-signed — do NOT overwrite
33689
+ // the blockhash or it will invalidate the server's signature.
33690
+ tx = VersionedTransaction.deserialize(Buffer.from(solTransactionData.signedTransaction, 'base64'));
33691
+ // Extract the blockhash that was baked into the signed message
33692
+ blockhash = tx.message.recentBlockhash;
33693
+ const latestBlockhash = await connection.getLatestBlockhash('confirmed');
33694
+ lastValidBlockHeight = latestBlockhash.lastValidBlockHeight;
33695
+ }
33696
+ else {
33697
+ 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);
33698
+ tx = result.tx;
33699
+ blockhash = result.blockhash;
33700
+ lastValidBlockHeight = result.lastValidBlockHeight;
33701
+ }
33673
33702
  // Use duck typing instead of instanceof to handle multiple @solana/web3.js versions
33674
33703
  const isLegacyTx = 'recentBlockhash' in tx && !('message' in tx && 'staticAccountKeys' in tx.message);
33675
33704
  if (isLegacyTx) {
@@ -34983,7 +35012,7 @@ async function loadMwaProtocol() {
34983
35012
  return mwaProtocolLoadPromise;
34984
35013
  mwaProtocolLoadPromise = (async () => {
34985
35014
  try {
34986
- mwaProtocolModule = await import('./index.browser-DjDHEvuF.esm.js');
35015
+ mwaProtocolModule = await import('./index.browser-BuIgwfvv.esm.js');
34987
35016
  }
34988
35017
  catch (e) {
34989
35018
  console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
@@ -35005,7 +35034,7 @@ async function registerMobileWalletAdapter(config) {
35005
35034
  if (typeof window === 'undefined')
35006
35035
  return;
35007
35036
  try {
35008
- const walletStandardMobile = await import('./index.browser-C6e2ssNC.esm.js');
35037
+ const walletStandardMobile = await import('./index.browser-ChrwVq76.esm.js');
35009
35038
  const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
35010
35039
  if (!registerMwa) {
35011
35040
  console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
@@ -35450,12 +35479,19 @@ class SolanaMobileWalletProvider {
35450
35479
  finalDeduped.push(acc);
35451
35480
  }
35452
35481
  }
35453
- const { tx } = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, publicKey, {
35454
- app_id,
35455
- documents: solTransactionData.txArgs[0].setDocumentData,
35456
- delete_paths: solTransactionData.txArgs[0].deletePaths,
35457
- txData: solTransactionData.txArgs[0].txData
35458
- }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false);
35482
+ let tx;
35483
+ if (solTransactionData.signedTransaction) {
35484
+ tx = VersionedTransaction.deserialize(bufferExports.Buffer.from(solTransactionData.signedTransaction, 'base64'));
35485
+ }
35486
+ else {
35487
+ const result = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, publicKey, {
35488
+ app_id,
35489
+ documents: solTransactionData.txArgs[0].setDocumentData,
35490
+ delete_paths: solTransactionData.txArgs[0].deletePaths,
35491
+ txData: solTransactionData.txArgs[0].txData
35492
+ }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false);
35493
+ tx = result.tx;
35494
+ }
35459
35495
  if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
35460
35496
  const [signedTx] = await transact(async (wallet) => {
35461
35497
  await this.reauthorizeWallet(wallet);
@@ -35923,4 +35959,4 @@ async function getIdToken() {
35923
35959
  }
35924
35960
 
35925
35961
  export { subscribe as A, useAuth as B, getIdToken as C, PrivyWalletProvider as D, EventEmitter3 as E, DEFAULT_TEST_ADDRESS as F, isMobileWalletAvailable as G, registerMobileWalletAdapter as H, ServerSessionManager as I, buildSetDocumentsTransaction as J, clearCache as K, closeAllSubscriptions as L, MockAuthProvider as M, convertRemainingAccounts as N, OffchainAuthProvider as O, PhantomWalletProvider as P, createSessionWithPrivy as Q, createSessionWithSignature as R, SolanaMobileWalletProvider as S, genAuthNonce as T, genSolanaMessage as U, getCachedData as V, WebSessionManager as W, reconnectWithNewAuth as X, refreshSession as Y, signSessionCreateMessage as Z, bs58 as a, bufferExports as b, getCurrentUser as c, onAuthLoadingChanged as d, getAuthLoading as e, logout as f, getDefaultExportFromCjs$1 as g, getConfig as h, init as i, getAuthProvider as j, get$2 as k, login as l, setMany as m, setFile as n, onAuthStateChanged as o, getFiles as p, runQueryMany as q, runQuery as r, set$1 as s, runExpression as t, runExpressionMany as u, signMessage as v, signTransaction as w, signAndSubmitTransaction as x, count as y, aggregate as z };
35926
- //# sourceMappingURL=index-u0Q8zhkj.esm.js.map
35962
+ //# sourceMappingURL=index-D0yz-P8G.esm.js.map