@pooflabs/core 0.0.19 → 0.0.21

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/dist/index.mjs CHANGED
@@ -3523,8 +3523,11 @@ async function setMany(many, options) {
3523
3523
  async function handleOffchainTransaction(tx, authProvider, options) {
3524
3524
  var _a, _b, _c, _d, _e;
3525
3525
  const config = await getConfig();
3526
- // 1. Sign the transaction message using the auth provider
3527
- const signature = await authProvider.signMessage(tx.message);
3526
+ // 1. Sign the transaction message using mock signing for offchain transactions
3527
+ // Use signMessageMock if available (OffchainAuthProvider), otherwise fall back to signMessage
3528
+ const signature = authProvider.signMessageMock
3529
+ ? await authProvider.signMessageMock(tx.message)
3530
+ : await authProvider.signMessage(tx.message);
3528
3531
  // 2. Create signed transaction
3529
3532
  const signedTx = {
3530
3533
  transaction: tx,
@@ -3635,6 +3638,27 @@ async function setFile(path, file) {
3635
3638
  // Optionally return the file's public URL or some confirmation
3636
3639
  return true;
3637
3640
  }
3641
+ async function signMessage(message) {
3642
+ const config = await getConfig();
3643
+ if (!config.authProvider) {
3644
+ throw new Error('Auth provider not initialized. Please call init() first.');
3645
+ }
3646
+ return config.authProvider.signMessage(message);
3647
+ }
3648
+ async function signTransaction(transaction) {
3649
+ const config = await getConfig();
3650
+ if (!config.authProvider) {
3651
+ throw new Error('Auth provider not initialized. Please call init() first.');
3652
+ }
3653
+ return config.authProvider.signTransaction(transaction);
3654
+ }
3655
+ async function signAndSubmitTransaction(transaction, feePayer) {
3656
+ const config = await getConfig();
3657
+ if (!config.authProvider) {
3658
+ throw new Error('Auth provider not initialized. Please call init() first.');
3659
+ }
3660
+ return config.authProvider.signAndSubmitTransaction(transaction, feePayer);
3661
+ }
3638
3662
 
3639
3663
  const activeConnections = {};
3640
3664
  const responseCache = {};
@@ -3835,5 +3859,5 @@ async function removeSubscription(connectionKey, subscription) {
3835
3859
  delete activeConnections[connectionKey];
3836
3860
  }
3837
3861
 
3838
- export { ServerSessionManager, WebSessionManager, buildSetDocumentsTransaction, convertRemainingAccounts, createSessionWithPrivy, createSessionWithSignature, genAuthNonce, genSolanaMessage, get, getConfig, getFiles, getIdToken, init, refreshSession, runExpression, runExpressionMany, runQuery, runQueryMany, set, setFile, setMany, signSessionCreateMessage, subscribe };
3862
+ export { ServerSessionManager, WebSessionManager, buildSetDocumentsTransaction, convertRemainingAccounts, createSessionWithPrivy, createSessionWithSignature, genAuthNonce, genSolanaMessage, get, getConfig, getFiles, getIdToken, init, refreshSession, runExpression, runExpressionMany, runQuery, runQueryMany, set, setFile, setMany, signAndSubmitTransaction, signMessage, signSessionCreateMessage, signTransaction, subscribe };
3839
3863
  //# sourceMappingURL=index.mjs.map