@bounded-sh/core 0.0.89 → 0.0.91
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/client/client-transaction-versions.d.ts +2 -0
- package/dist/client/solana-operations.d.ts +63 -0
- package/dist/client/solana-transaction-read.d.ts +13 -0
- package/dist/client/solana-v1-operations.d.ts +9 -0
- package/dist/{index-BxzaztPl.js → index-BjLa1c_O.js} +71 -10
- package/dist/index-BjLa1c_O.js.map +1 -0
- package/dist/{index-P9HgYxQ6.mjs → index-DM016I43.mjs} +70 -11
- package/dist/index-DM016I43.mjs.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{realtime-store-BfnJefdw.js → realtime-store-O-5CDrGm.js} +2 -2
- package/dist/{realtime-store-BfnJefdw.js.map → realtime-store-O-5CDrGm.js.map} +1 -1
- package/dist/{realtime-store-65vgABGG.mjs → realtime-store-zORqBwjW.mjs} +2 -2
- package/dist/{realtime-store-65vgABGG.mjs.map → realtime-store-zORqBwjW.mjs.map} +1 -1
- package/dist/{solana-message-CIwmajWk.mjs → solana-message-CmvedcGr.mjs} +2 -2
- package/dist/{solana-message-CIwmajWk.mjs.map → solana-message-CmvedcGr.mjs.map} +1 -1
- package/dist/{solana-message-CfwyiOZc.js → solana-message-DY0FVgHp.js} +2 -2
- package/dist/{solana-message-CfwyiOZc.js.map → solana-message-DY0FVgHp.js.map} +1 -1
- package/dist/{solana-operations-BFH2w7qn.js → solana-operations-DSAWnjWi.js} +146 -28
- package/dist/solana-operations-DSAWnjWi.js.map +1 -0
- package/dist/{solana-operations-BbyfKGSN.mjs → solana-operations-D_e7AMhd.mjs} +139 -29
- package/dist/solana-operations-D_e7AMhd.mjs.map +1 -0
- package/dist/solana-v1-operations-ByWdgO_7.js +175 -0
- package/dist/solana-v1-operations-ByWdgO_7.js.map +1 -0
- package/dist/solana-v1-operations-DF6Cp0IX.mjs +173 -0
- package/dist/solana-v1-operations-DF6Cp0IX.mjs.map +1 -0
- package/dist/types.d.ts +36 -0
- package/package.json +2 -1
- package/dist/index-BxzaztPl.js.map +0 -1
- package/dist/index-P9HgYxQ6.mjs.map +0 -1
- package/dist/solana-operations-BFH2w7qn.js.map +0 -1
- package/dist/solana-operations-BbyfKGSN.mjs.map +0 -1
|
@@ -4131,7 +4131,7 @@ class ServerSessionManager {
|
|
|
4131
4131
|
const sessionConfig = (_a = this.sessionConfig) !== null && _a !== void 0 ? _a : undefined;
|
|
4132
4132
|
/* fetch nonce from auth API (bound to the snapshotted app+issuer) */
|
|
4133
4133
|
const nonce = await genAuthNonce(sessionConfig);
|
|
4134
|
-
const { genSolanaMessage } = await import('./solana-message-
|
|
4134
|
+
const { genSolanaMessage } = await import('./solana-message-CmvedcGr.mjs');
|
|
4135
4135
|
const message = await genSolanaMessage(address, nonce, sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.appId);
|
|
4136
4136
|
/* sign the message */
|
|
4137
4137
|
const sigBytes = nacl.sign.detached(new TextEncoder().encode(message), kp.secretKey);
|
|
@@ -5155,6 +5155,23 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
5155
5155
|
}
|
|
5156
5156
|
}
|
|
5157
5157
|
|
|
5158
|
+
async function resolveClientTransactionVersions(authProvider) {
|
|
5159
|
+
if (!authProvider)
|
|
5160
|
+
return ['legacy', 0];
|
|
5161
|
+
if (typeof authProvider.supportedTransactionVersions === 'function') {
|
|
5162
|
+
try {
|
|
5163
|
+
const declared = await authProvider.supportedTransactionVersions();
|
|
5164
|
+
const versions = declared.filter((v) => v === 'legacy' || v === 0 || v === 1);
|
|
5165
|
+
// v1 needs a v1 signer no matter what the provider claims.
|
|
5166
|
+
return versions.filter((v) => v !== 1 || typeof authProvider.signTransactionV1 === 'function');
|
|
5167
|
+
}
|
|
5168
|
+
catch (_a) {
|
|
5169
|
+
return ['legacy', 0];
|
|
5170
|
+
}
|
|
5171
|
+
}
|
|
5172
|
+
return typeof authProvider.signTransactionV1 === 'function' ? ['legacy', 0, 1] : ['legacy', 0];
|
|
5173
|
+
}
|
|
5174
|
+
|
|
5158
5175
|
/**
|
|
5159
5176
|
* WebSocket v2 Subscription Manager
|
|
5160
5177
|
*
|
|
@@ -6899,7 +6916,7 @@ async function doReconnectWithNewAuth() {
|
|
|
6899
6916
|
console.warn('[WS v2] Failed to clear HTTP read cache on auth change:', error);
|
|
6900
6917
|
}
|
|
6901
6918
|
try {
|
|
6902
|
-
const { reconnectRealtimeStoreWithNewAuth } = await import('./realtime-store-
|
|
6919
|
+
const { reconnectRealtimeStoreWithNewAuth } = await import('./realtime-store-zORqBwjW.mjs');
|
|
6903
6920
|
await reconnectRealtimeStoreWithNewAuth();
|
|
6904
6921
|
}
|
|
6905
6922
|
catch (error) {
|
|
@@ -8279,7 +8296,10 @@ async function setMany(many, options) {
|
|
|
8279
8296
|
}
|
|
8280
8297
|
let setResponse;
|
|
8281
8298
|
try {
|
|
8282
|
-
|
|
8299
|
+
// SIMD-0385: tell the worker which Solana transaction formats this client
|
|
8300
|
+
// can sign, so it builds v1 only for a client that can complete it.
|
|
8301
|
+
const clientTransactionVersions = await resolveClientTransactionVersions(authProvider);
|
|
8302
|
+
setResponse = await makeApiRequest('PUT', `items`, { documents, clientTransactionVersions }, options === null || options === void 0 ? void 0 : options._overrides);
|
|
8283
8303
|
}
|
|
8284
8304
|
catch (error) {
|
|
8285
8305
|
if ((error === null || error === void 0 ? void 0 : error.statusCode) === 402 && (error === null || error === void 0 ? void 0 : error.error) === 'INSUFFICIENT_BALANCE') {
|
|
@@ -8346,7 +8366,7 @@ async function setMany(many, options) {
|
|
|
8346
8366
|
'Nothing was signed or submitted.');
|
|
8347
8367
|
}
|
|
8348
8368
|
const solanaChain = workerChain;
|
|
8349
|
-
const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await import('./solana-operations-
|
|
8369
|
+
const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await import('./solana-operations-D_e7AMhd.mjs');
|
|
8350
8370
|
// OA-0001: derive the expected intent from OUR OWN request (the one
|
|
8351
8371
|
// ground truth a tampered builder response cannot change) so the
|
|
8352
8372
|
// validator can reject any transaction whose operation semantics
|
|
@@ -8667,6 +8687,48 @@ var operations = /*#__PURE__*/Object.freeze({
|
|
|
8667
8687
|
syncItems: syncItems
|
|
8668
8688
|
});
|
|
8669
8689
|
|
|
8690
|
+
/** The highest Solana transaction version this SDK reads back (SIMD-0385 v1). */
|
|
8691
|
+
const SOLANA_MAX_SUPPORTED_TRANSACTION_VERSION = 1;
|
|
8692
|
+
/**
|
|
8693
|
+
* getTransaction that survives a SIMD-0385 v1 response. @solana/web3.js 1.98.x
|
|
8694
|
+
* validates `version` against `0 | 'legacy'` and THROWS on 1 even when the request
|
|
8695
|
+
* raised the ceiling, so a real `Connection` (which exposes `rpcEndpoint`) is read
|
|
8696
|
+
* as raw JSON-RPC instead. An injected double without an endpoint goes through its
|
|
8697
|
+
* own `getTransaction` with the ceiling raised. Returns the RPC `result` (null when
|
|
8698
|
+
* the signature is unknown); RPC and transport failures throw so callers keep
|
|
8699
|
+
* treating a failed lookup as inconclusive rather than as absence.
|
|
8700
|
+
*/
|
|
8701
|
+
async function getTransactionJson(rpc, signature, commitment = 'confirmed') {
|
|
8702
|
+
var _a;
|
|
8703
|
+
const endpoint = typeof (rpc === null || rpc === void 0 ? void 0 : rpc.rpcEndpoint) === 'string' ? rpc.rpcEndpoint.trim() : '';
|
|
8704
|
+
if (!endpoint) {
|
|
8705
|
+
return rpc.getTransaction(signature, {
|
|
8706
|
+
maxSupportedTransactionVersion: SOLANA_MAX_SUPPORTED_TRANSACTION_VERSION,
|
|
8707
|
+
commitment,
|
|
8708
|
+
});
|
|
8709
|
+
}
|
|
8710
|
+
const response = await fetch(endpoint, {
|
|
8711
|
+
method: 'POST',
|
|
8712
|
+
headers: { 'content-type': 'application/json' },
|
|
8713
|
+
body: JSON.stringify({
|
|
8714
|
+
jsonrpc: '2.0',
|
|
8715
|
+
id: 1,
|
|
8716
|
+
method: 'getTransaction',
|
|
8717
|
+
params: [signature, {
|
|
8718
|
+
commitment,
|
|
8719
|
+
encoding: 'json',
|
|
8720
|
+
maxSupportedTransactionVersion: SOLANA_MAX_SUPPORTED_TRANSACTION_VERSION,
|
|
8721
|
+
}],
|
|
8722
|
+
}),
|
|
8723
|
+
});
|
|
8724
|
+
if (!response.ok)
|
|
8725
|
+
throw new Error(`getTransaction http ${response.status}`);
|
|
8726
|
+
const body = await response.json();
|
|
8727
|
+
if (body === null || body === void 0 ? void 0 : body.error)
|
|
8728
|
+
throw new Error(`getTransaction rpc error ${body.error.code}: ${body.error.message}`);
|
|
8729
|
+
return (_a = body === null || body === void 0 ? void 0 : body.result) !== null && _a !== void 0 ? _a : null;
|
|
8730
|
+
}
|
|
8731
|
+
|
|
8670
8732
|
const DEFAULT_TIMEOUT_MS = 60000;
|
|
8671
8733
|
const DEFAULT_MAX_ATTEMPTS = 20;
|
|
8672
8734
|
const DEFAULT_POLL_INTERVAL_MS = 3000;
|
|
@@ -8796,10 +8858,7 @@ async function reconcileSolana(receipt, config, options) {
|
|
|
8796
8858
|
// Expired. Prove absence from history before declaring the write retry-safe.
|
|
8797
8859
|
let history;
|
|
8798
8860
|
try {
|
|
8799
|
-
history = await rpc
|
|
8800
|
-
maxSupportedTransactionVersion: 0,
|
|
8801
|
-
commitment: 'confirmed',
|
|
8802
|
-
});
|
|
8861
|
+
history = await getTransactionJson(rpc, receipt.transactionId, 'confirmed');
|
|
8803
8862
|
}
|
|
8804
8863
|
catch (error) {
|
|
8805
8864
|
return stillSubmitted(receipt, `history lookup failed after expiry: ${errorText(error)}`);
|
|
@@ -9792,7 +9851,7 @@ function toMillis(seconds) {
|
|
|
9792
9851
|
|
|
9793
9852
|
/** SIWS message creation is async already, so its onchain module can be lazy. */
|
|
9794
9853
|
async function genSolanaMessage(address, nonce) {
|
|
9795
|
-
const implementation = await import('./solana-message-
|
|
9854
|
+
const implementation = await import('./solana-message-CmvedcGr.mjs');
|
|
9796
9855
|
return implementation.genSolanaMessage(address, nonce);
|
|
9797
9856
|
}
|
|
9798
9857
|
|
|
@@ -10267,5 +10326,5 @@ function defineLiveModule(mod) {
|
|
|
10267
10326
|
return mod;
|
|
10268
10327
|
}
|
|
10269
10328
|
|
|
10270
|
-
export {
|
|
10271
|
-
//# sourceMappingURL=index-
|
|
10329
|
+
export { getIdToken as $, subscribe as A, closeAllSubscriptions as B, clearCache as C, getCachedData as D, reconnectWithNewAuth as E, createClient as F, ScopedClientReadOnlyError as G, subscribeQuery as H, InsufficientBalanceError as I, closeAllQuerySubscriptions as J, canonicalizeArgs as K, canonicalizeResult as L, DEFAULT_QUERY_POLL_INTERVAL_MS as M, MIN_QUERY_POLL_INTERVAL_MS as N, BoundedDeclineError as O, deriveDecline as P, dispatchDeclineEvent as Q, DECLINE_EVENT_NAME as R, SOLANA_MAX_SUPPORTED_TRANSACTION_VERSION as S, dispatchRateLimitEvent as T, RATE_LIMIT_EVENT_NAME as U, hasActiveConnection as V, increment as W, serverTimestamp as X, now as Y, toSeconds as Z, toMillis as _, getTransactionJson as a, deriveUserIdentityFromIdToken as a0, getSessionGeneration as a1, WebSessionManager as a2, ReactNativeSessionManager as a3, getActiveSessionManager as a4, onSessionCleared as a5, SessionEnvironmentError as a6, UNSUPPORTED_ENVIRONMENT_CODE as a7, AUTH_CHANGED_CODE as a8, AUTH_EXPIRED_CODE as a9, isAuthExpiredError as aa, getFreshAuthToken as ab, ServerSessionManager as ac, createSessionWithSignature as ad, refreshSession as ae, revokeSession as af, signSessionCreateMessage as ag, genAuthNonce as ah, genSolanaMessage as ai, genSiweMessage as aj, normalizeEvmAddress as ak, toLowerEvmAddress as al, functions as am, invoke as an, FunctionInvokeError as ao, live as ap, intent as aq, status as ar, subscribeView as as, LiveIntentError as at, withEffects as au, isEffectResult as av, defineLiveModule as aw, EFFECT_INTENT_ADDRESS as ax, 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 };
|
|
10330
|
+
//# sourceMappingURL=index-DM016I43.mjs.map
|