@bounded-sh/core 0.0.103 → 0.0.105

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 (27) hide show
  1. package/dist/client/solana-operations.d.ts +15 -0
  2. package/dist/{index-D7dRe0PL.js → index-62gjQH30.js} +55 -26
  3. package/dist/index-62gjQH30.js.map +1 -0
  4. package/dist/{index-CC2WVN43.mjs → index-CLst0IiM.mjs} +55 -26
  5. package/dist/index-CLst0IiM.mjs.map +1 -0
  6. package/dist/index.js +1 -1
  7. package/dist/index.mjs +1 -1
  8. package/dist/{realtime-store-CuFYPLgk.js → realtime-store-9SCt1RPf.js} +2 -2
  9. package/dist/{realtime-store-CuFYPLgk.js.map → realtime-store-9SCt1RPf.js.map} +1 -1
  10. package/dist/{realtime-store-2iWofj5n.mjs → realtime-store-C9AgPg7U.mjs} +2 -2
  11. package/dist/{realtime-store-2iWofj5n.mjs.map → realtime-store-C9AgPg7U.mjs.map} +1 -1
  12. package/dist/{solana-message-DLBiBfnG.js → solana-message-Bf2q_JO1.js} +2 -2
  13. package/dist/{solana-message-DLBiBfnG.js.map → solana-message-Bf2q_JO1.js.map} +1 -1
  14. package/dist/{solana-message-Bx04VMG1.mjs → solana-message-Deru1tF1.mjs} +2 -2
  15. package/dist/{solana-message-Bx04VMG1.mjs.map → solana-message-Deru1tF1.mjs.map} +1 -1
  16. package/dist/{solana-operations-CCFNQIgd.mjs → solana-operations-Cm19J14R.mjs} +34 -5
  17. package/dist/{solana-operations-CCFNQIgd.mjs.map → solana-operations-Cm19J14R.mjs.map} +1 -1
  18. package/dist/{solana-operations-Be0dWtVZ.js → solana-operations-eTiLgak2.js} +34 -3
  19. package/dist/{solana-operations-Be0dWtVZ.js.map → solana-operations-eTiLgak2.js.map} +1 -1
  20. package/dist/{solana-v1-operations-Bbj0F4cp.js → solana-v1-operations-CnmiKiyj.js} +3 -3
  21. package/dist/{solana-v1-operations-Bbj0F4cp.js.map → solana-v1-operations-CnmiKiyj.js.map} +1 -1
  22. package/dist/{solana-v1-operations-C6Qev1fZ.mjs → solana-v1-operations-Dxs4XM_F.mjs} +3 -3
  23. package/dist/{solana-v1-operations-C6Qev1fZ.mjs.map → solana-v1-operations-Dxs4XM_F.mjs.map} +1 -1
  24. package/dist/types.d.ts +16 -1
  25. package/package.json +1 -1
  26. package/dist/index-CC2WVN43.mjs.map +0 -1
  27. package/dist/index-D7dRe0PL.js.map +0 -1
@@ -4188,7 +4188,7 @@ class ServerSessionManager {
4188
4188
  const sessionConfig = (_a = this.sessionConfig) !== null && _a !== void 0 ? _a : undefined;
4189
4189
  /* fetch nonce from auth API (bound to the snapshotted app+issuer) */
4190
4190
  const nonce = await genAuthNonce(sessionConfig);
4191
- const { genSolanaMessage } = await import('./solana-message-Bx04VMG1.mjs');
4191
+ const { genSolanaMessage } = await import('./solana-message-Deru1tF1.mjs');
4192
4192
  const message = await genSolanaMessage(address, nonce, sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.appId);
4193
4193
  /* sign the message */
4194
4194
  const sigBytes = nacl.sign.detached(new TextEncoder().encode(message), kp.secretKey);
@@ -7467,7 +7467,7 @@ async function doReconnectWithNewAuth() {
7467
7467
  console.warn('[WS v2] Failed to clear HTTP read cache on auth change:', error);
7468
7468
  }
7469
7469
  try {
7470
- const { reconnectRealtimeStoreWithNewAuth } = await import('./realtime-store-2iWofj5n.mjs');
7470
+ const { reconnectRealtimeStoreWithNewAuth } = await import('./realtime-store-C9AgPg7U.mjs');
7471
7471
  await reconnectRealtimeStoreWithNewAuth();
7472
7472
  }
7473
7473
  catch (error) {
@@ -8810,7 +8810,7 @@ async function set(path, document, options) {
8810
8810
  * state appears only under `observation`/`mirrorSync` once actually observed.
8811
8811
  */
8812
8812
  async function setMany(many, options) {
8813
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
8813
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
8814
8814
  // Returns the data that was set, or undefined if the document was already set.
8815
8815
  try {
8816
8816
  // A server WalletClient threads its immutable config snapshot; the default
@@ -8915,13 +8915,35 @@ async function setMany(many, options) {
8915
8915
  throw new Error('The write response carried no execution-chain tag, so this receipt could not state where the write ran. ' +
8916
8916
  'Nothing was signed or submitted.');
8917
8917
  }
8918
+ if (workerChain === 'realtime_offchain') {
8919
+ // Poofnet: the wallet signs the worker's unsendable approval message and
8920
+ // the worker verifies and commits it. Nothing is submitted to any chain.
8921
+ if (typeof curTx.serializedTransaction !== 'string' || typeof curTx.poofnetIntentId !== 'string') {
8922
+ throw new Error('Unsupported 202 transaction shape: a poofnet write needs serializedTransaction and poofnetIntentId');
8923
+ }
8924
+ const { signPoofnetTransaction, buildExpectedWriteIntent } = await import('./solana-operations-Cm19J14R.mjs');
8925
+ const signedTransaction = await signPoofnetTransaction(curTx.serializedTransaction, authProvider, options, buildExpectedWriteIntent(documents));
8926
+ // Signing-only, exactly as on a real chain: signed and NOT committed.
8927
+ if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
8928
+ return {
8929
+ status: 'signed', appId, requestedDocuments: buildRequestedDocuments(documents),
8930
+ chain: 'realtime_offchain', transactionId: null, signedTransaction,
8931
+ poofnetIntentId: curTx.poofnetIntentId,
8932
+ };
8933
+ }
8934
+ const commitResponse = await makeApiRequest('PUT', 'items/signed', { intentId: curTx.poofnetIntentId, signedTransaction }, options === null || options === void 0 ? void 0 : options._overrides);
8935
+ if (commitResponse.status !== 200) {
8936
+ throw new Error(`Poofnet signed write was not committed (status ${commitResponse.status})`);
8937
+ }
8938
+ return directCommitResult(commitResponse, documents);
8939
+ }
8918
8940
  if (curTx.serializedTransaction) {
8919
8941
  if (!SOLANA_CHAIN_TAGS.has(workerChain)) {
8920
8942
  throw new Error(`The write response reported execution chain "${workerChain}" for a Solana transaction. ` +
8921
8943
  'Nothing was signed or submitted.');
8922
8944
  }
8923
8945
  const solanaChain = workerChain;
8924
- const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await import('./solana-operations-CCFNQIgd.mjs');
8946
+ const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await import('./solana-operations-Cm19J14R.mjs');
8925
8947
  // OA-0001: derive the expected intent from OUR OWN request (the one
8926
8948
  // ground truth a tampered builder response cannot change) so the
8927
8949
  // validator can reject any transaction whose operation semantics
@@ -8964,26 +8986,7 @@ async function setMany(many, options) {
8964
8986
  }
8965
8987
  }
8966
8988
  else if (setResponse.status === 200) {
8967
- // Direct commit: the worker applied the batch itself. The receipt is
8968
- // batch-level — `transactionId` comes from the worker's own receipt and is
8969
- // NEVER lifted out of a result document (a delete returns the PREVIOUS
8970
- // document, so its stale `_transaction_hash` would misreport the delete).
8971
- const body = (setResponse.data && typeof setResponse.data === 'object' && !Array.isArray(setResponse.data))
8972
- ? setResponse.data
8973
- : null;
8974
- const receipt = ((body === null || body === void 0 ? void 0 : body.receipt) && typeof body.receipt === 'object' && !Array.isArray(body.receipt))
8975
- ? body.receipt
8976
- : null;
8977
- const rawTransactionId = receipt === null || receipt === void 0 ? void 0 : receipt.transactionId;
8978
- return {
8979
- status: 'committed',
8980
- requestedDocuments: buildRequestedDocuments(documents),
8981
- observation: observationFromDirectCommit(documents.map(d => d.destinationPath), receipt === null || receipt === void 0 ? void 0 : receipt.observation),
8982
- // A worker predating the batch receipt reports no lane. Say so rather
8983
- // than inventing one — and never discard a committed write's receipt.
8984
- chain: ((_l = readWorkerChainTag(receipt)) !== null && _l !== void 0 ? _l : 'unknown'),
8985
- transactionId: typeof rawTransactionId === 'string' && rawTransactionId.length > 0 ? rawTransactionId : null,
8986
- };
8989
+ return directCommitResult(setResponse, documents);
8987
8990
  }
8988
8991
  else {
8989
8992
  throw new Error(`Failed to set document: ${setResponse}`);
@@ -8993,6 +8996,32 @@ async function setMany(many, options) {
8993
8996
  throw error;
8994
8997
  }
8995
8998
  }
8999
+ /**
9000
+ * Direct commit: the worker applied the batch itself (an offchain write, or a
9001
+ * poofnet onchain write after its signature verified). The receipt is batch-level
9002
+ * - `transactionId` comes from the worker's own receipt and is NEVER lifted out
9003
+ * of a result document (a delete returns the PREVIOUS document, so its stale
9004
+ * `_transaction_hash` would misreport the delete).
9005
+ */
9006
+ function directCommitResult(response, documents) {
9007
+ var _a;
9008
+ const body = (response.data && typeof response.data === 'object' && !Array.isArray(response.data))
9009
+ ? response.data
9010
+ : null;
9011
+ const receipt = ((body === null || body === void 0 ? void 0 : body.receipt) && typeof body.receipt === 'object' && !Array.isArray(body.receipt))
9012
+ ? body.receipt
9013
+ : null;
9014
+ const rawTransactionId = receipt === null || receipt === void 0 ? void 0 : receipt.transactionId;
9015
+ return {
9016
+ status: 'committed',
9017
+ requestedDocuments: buildRequestedDocuments(documents),
9018
+ observation: observationFromDirectCommit(documents.map(d => d.destinationPath), receipt === null || receipt === void 0 ? void 0 : receipt.observation),
9019
+ // A worker predating the batch receipt reports no lane. Say so rather
9020
+ // than inventing one - and never discard a committed write's receipt.
9021
+ chain: ((_a = readWorkerChainTag(receipt)) !== null && _a !== void 0 ? _a : 'unknown'),
9022
+ transactionId: typeof rawTransactionId === 'string' && rawTransactionId.length > 0 ? rawTransactionId : null,
9023
+ };
9024
+ }
8996
9025
  /**
8997
9026
  * Extract the document/collection path from a cache key. Keys are
8998
9027
  * `<appId:principal>|<path>:<...>` (H1 principal-scoped) — strip the principal
@@ -10696,7 +10725,7 @@ function toMillis(seconds) {
10696
10725
 
10697
10726
  /** SIWS message creation is async already, so its onchain module can be lazy. */
10698
10727
  async function genSolanaMessage(address, nonce) {
10699
- const implementation = await import('./solana-message-Bx04VMG1.mjs');
10728
+ const implementation = await import('./solana-message-Deru1tF1.mjs');
10700
10729
  return implementation.genSolanaMessage(address, nonce);
10701
10730
  }
10702
10731
 
@@ -11246,4 +11275,4 @@ function defineLiveModule(mod) {
11246
11275
  }
11247
11276
 
11248
11277
  export { serverTimestamp as $, subscribe as A, closeAllSubscriptions as B, clearCache as C, getCachedData as D, reconnectWithNewAuth as E, createClient as F, ScopedClientReadOnlyError as G, exchangeAppToken as H, InsufficientBalanceError as I, clearAppTokenCache as J, createAppTokenAuthHeaders as K, AppTokenExchangeError as L, subscribeQuery as M, closeAllQuerySubscriptions as N, canonicalizeArgs as O, canonicalizeResult as P, DEFAULT_QUERY_POLL_INTERVAL_MS as Q, MIN_QUERY_POLL_INTERVAL_MS as R, SOLANA_MAX_SUPPORTED_TRANSACTION_VERSION as S, BoundedDeclineError as T, deriveDecline as U, dispatchDeclineEvent as V, DECLINE_EVENT_NAME as W, dispatchRateLimitEvent as X, RATE_LIMIT_EVENT_NAME as Y, hasActiveConnection as Z, increment as _, getTransactionJson as a, now as a0, toSeconds as a1, toMillis as a2, getIdToken as a3, deriveUserIdentityFromIdToken as a4, getSessionGeneration as a5, WebSessionManager as a6, ReactNativeSessionManager as a7, getActiveSessionManager as a8, onSessionCleared as a9, intent as aA, status as aB, subscribeView as aC, LiveIntentError as aD, withEffects as aE, isEffectResult as aF, defineLiveModule as aG, EFFECT_INTENT_ADDRESS as aH, SessionEnvironmentError as aa, UNSUPPORTED_ENVIRONMENT_CODE as ab, AUTH_CHANGED_CODE as ac, AUTH_EXPIRED_CODE as ad, isAuthExpiredError as ae, getFreshAuthToken as af, ServerSessionManager as ag, createSessionWithSignature as ah, refreshSession as ai, revokeSession as aj, signSessionCreateMessage as ak, genAuthNonce as al, genSolanaMessage as am, createSolanaSignInRequest as an, createSolanaSignInMessageText as ao, genSolanaSignInRequest as ap, genSolanaSignInMessage as aq, browserSignInDomain as ar, SOLANA_SIGN_IN_STATEMENT as as, genSiweMessage as at, normalizeEvmAddress as au, toLowerEvmAddress as av, functions as aw, invoke as ax, FunctionInvokeError as ay, live as az, bufferExports as b, getWebhookKeysUrl as c, getConfiguredAppId as d, get as e, getMany as f, getConfig as g, docId as h, init as i, setMany as j, setFile as k, getFiles as l, search as m, runQueryMany as n, runExpression as o, runExpressionMany as p, queryAggregate as q, runQuery as r, set as s, signMessage as t, signTransaction as u, signAndSubmitTransaction as v, count as w, aggregate as x, reconcileSetResult as y, waitForSetResult as z };
11249
- //# sourceMappingURL=index-CC2WVN43.mjs.map
11278
+ //# sourceMappingURL=index-CLst0IiM.mjs.map