@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.
@@ -10219,6 +10219,8 @@ async function setMany(many, options) {
10219
10219
  data,
10220
10220
  });
10221
10221
  })) !== null && _e !== void 0 ? _e : [],
10222
+ // Server co-signed transaction (when CPI tx_data is present)
10223
+ signedTransaction: tx.signedTransaction,
10222
10224
  };
10223
10225
  const transactionResult = await authProvider.runTransaction(undefined, solTransaction, options);
10224
10226
  return transactionResult;
@@ -13541,7 +13543,7 @@ async function loadDependencies() {
13541
13543
  const [reactModule, reactDomModule, phantomModule] = await Promise.all([
13542
13544
  import('react'),
13543
13545
  import('react-dom/client'),
13544
- Promise.resolve().then(function () { return require('./index-CJuG7364.js'); })
13546
+ Promise.resolve().then(function () { return require('./index-BFJJZKXQ.js'); })
13545
13547
  ]);
13546
13548
  // Extract default export from ESM module namespace
13547
13549
  // Dynamic import() returns { default: Module, ...exports }, not the module directly
@@ -14447,12 +14449,22 @@ class PhantomWalletProvider {
14447
14449
  finalDeduped.push(acc);
14448
14450
  }
14449
14451
  }
14450
- const { tx } = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, publicKey, {
14451
- app_id,
14452
- documents: solTransactionData.txArgs[0].setDocumentData,
14453
- delete_paths: solTransactionData.txArgs[0].deletePaths,
14454
- txData: solTransactionData.txArgs[0].txData
14455
- }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false);
14452
+ // When the server has co-signed a transaction (CPI attestation),
14453
+ // deserialize it and just add the wallet signature instead of
14454
+ // building from components.
14455
+ let tx;
14456
+ if (solTransactionData.signedTransaction) {
14457
+ tx = web3_js.VersionedTransaction.deserialize(bufferExports.Buffer.from(solTransactionData.signedTransaction, 'base64'));
14458
+ }
14459
+ else {
14460
+ const result = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, publicKey, {
14461
+ app_id,
14462
+ documents: solTransactionData.txArgs[0].setDocumentData,
14463
+ delete_paths: solTransactionData.txArgs[0].deletePaths,
14464
+ txData: solTransactionData.txArgs[0].txData
14465
+ }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false);
14466
+ tx = result.tx;
14467
+ }
14456
14468
  if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
14457
14469
  const signedTx = await walletAdapter.signTransaction(tx);
14458
14470
  return {
@@ -33689,7 +33701,24 @@ class PrivyWalletProvider {
33689
33701
  finalDeduped.push(acc);
33690
33702
  }
33691
33703
  }
33692
- const { tx, blockhash, lastValidBlockHeight } = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, new web3_js.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);
33704
+ let tx;
33705
+ let blockhash;
33706
+ let lastValidBlockHeight;
33707
+ if (solTransactionData.signedTransaction) {
33708
+ // Server already set the blockhash and co-signed — do NOT overwrite
33709
+ // the blockhash or it will invalidate the server's signature.
33710
+ tx = web3_js.VersionedTransaction.deserialize(Buffer.from(solTransactionData.signedTransaction, 'base64'));
33711
+ // Extract the blockhash that was baked into the signed message
33712
+ blockhash = tx.message.recentBlockhash;
33713
+ const latestBlockhash = await connection.getLatestBlockhash('confirmed');
33714
+ lastValidBlockHeight = latestBlockhash.lastValidBlockHeight;
33715
+ }
33716
+ else {
33717
+ const result = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, new web3_js.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);
33718
+ tx = result.tx;
33719
+ blockhash = result.blockhash;
33720
+ lastValidBlockHeight = result.lastValidBlockHeight;
33721
+ }
33693
33722
  // Use duck typing instead of instanceof to handle multiple @solana/web3.js versions
33694
33723
  const isLegacyTx = 'recentBlockhash' in tx && !('message' in tx && 'staticAccountKeys' in tx.message);
33695
33724
  if (isLegacyTx) {
@@ -35003,7 +35032,7 @@ async function loadMwaProtocol() {
35003
35032
  return mwaProtocolLoadPromise;
35004
35033
  mwaProtocolLoadPromise = (async () => {
35005
35034
  try {
35006
- mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-CPRwXOyN.js'); });
35035
+ mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-BO1XxDi0.js'); });
35007
35036
  }
35008
35037
  catch (e) {
35009
35038
  console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
@@ -35025,7 +35054,7 @@ async function registerMobileWalletAdapter(config) {
35025
35054
  if (typeof window === 'undefined')
35026
35055
  return;
35027
35056
  try {
35028
- const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-jwxjZVpT.js'); });
35057
+ const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-wsb8xknL.js'); });
35029
35058
  const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
35030
35059
  if (!registerMwa) {
35031
35060
  console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
@@ -35470,12 +35499,19 @@ class SolanaMobileWalletProvider {
35470
35499
  finalDeduped.push(acc);
35471
35500
  }
35472
35501
  }
35473
- const { tx } = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, publicKey, {
35474
- app_id,
35475
- documents: solTransactionData.txArgs[0].setDocumentData,
35476
- delete_paths: solTransactionData.txArgs[0].deletePaths,
35477
- txData: solTransactionData.txArgs[0].txData
35478
- }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false);
35502
+ let tx;
35503
+ if (solTransactionData.signedTransaction) {
35504
+ tx = web3_js.VersionedTransaction.deserialize(bufferExports.Buffer.from(solTransactionData.signedTransaction, 'base64'));
35505
+ }
35506
+ else {
35507
+ const result = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, publicKey, {
35508
+ app_id,
35509
+ documents: solTransactionData.txArgs[0].setDocumentData,
35510
+ delete_paths: solTransactionData.txArgs[0].deletePaths,
35511
+ txData: solTransactionData.txArgs[0].txData
35512
+ }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false);
35513
+ tx = result.tx;
35514
+ }
35479
35515
  if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
35480
35516
  const [signedTx] = await transact(async (wallet) => {
35481
35517
  await this.reauthorizeWallet(wallet);
@@ -35994,4 +36030,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
35994
36030
  exports.signTransaction = signTransaction;
35995
36031
  exports.subscribe = subscribe;
35996
36032
  exports.useAuth = useAuth;
35997
- //# sourceMappingURL=index-CMTlhmPS.js.map
36033
+ //# sourceMappingURL=index-BV8MOXXy.js.map