@bounded-sh/core 0.0.117-sync.0 → 0.0.117
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/mirror-sync.d.ts +11 -0
- package/dist/client/operations.d.ts +1 -6
- package/dist/{index-l5JPD7_a.mjs → index-C6ZW5Gt2.mjs} +11 -78
- package/dist/index-C6ZW5Gt2.mjs.map +1 -0
- package/dist/{index-BcJOeks0.js → index-DQ0FXeI8.js} +11 -77
- package/dist/index-DQ0FXeI8.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/mirror-sync-ChzMq7bH.js +89 -0
- package/dist/mirror-sync-ChzMq7bH.js.map +1 -0
- package/dist/mirror-sync-kt9PzQen.mjs +86 -0
- package/dist/mirror-sync-kt9PzQen.mjs.map +1 -0
- package/dist/{realtime-store-5vXHb5Br.js → realtime-store-CURbZ68v.js} +2 -2
- package/dist/{realtime-store-5vXHb5Br.js.map → realtime-store-CURbZ68v.js.map} +1 -1
- package/dist/{realtime-store-CofPUMMC.mjs → realtime-store-FUjGL_Z8.mjs} +2 -2
- package/dist/{realtime-store-CofPUMMC.mjs.map → realtime-store-FUjGL_Z8.mjs.map} +1 -1
- package/dist/{solana-message-DXWlEuK5.mjs → solana-message-CEjXjnaG.mjs} +2 -2
- package/dist/{solana-message-DXWlEuK5.mjs.map → solana-message-CEjXjnaG.mjs.map} +1 -1
- package/dist/{solana-message-CaPunjVI.js → solana-message-F1e5wPKF.js} +2 -2
- package/dist/{solana-message-CaPunjVI.js.map → solana-message-F1e5wPKF.js.map} +1 -1
- package/dist/{solana-operations-CuWKt_pG.mjs → solana-operations-5WjFwhnt.mjs} +3 -3
- package/dist/{solana-operations-CuWKt_pG.mjs.map → solana-operations-5WjFwhnt.mjs.map} +1 -1
- package/dist/{solana-operations-BPOTddBI.js → solana-operations-CI0sREvl.js} +3 -3
- package/dist/{solana-operations-BPOTddBI.js.map → solana-operations-CI0sREvl.js.map} +1 -1
- package/dist/{solana-v1-operations-MbUM3wgC.mjs → solana-v1-operations-DB9pih7o.mjs} +3 -3
- package/dist/{solana-v1-operations-MbUM3wgC.mjs.map → solana-v1-operations-DB9pih7o.mjs.map} +1 -1
- package/dist/{solana-v1-operations-DTXPM_aZ.js → solana-v1-operations-oot2R63I.js} +3 -3
- package/dist/{solana-v1-operations-DTXPM_aZ.js.map → solana-v1-operations-oot2R63I.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-BcJOeks0.js.map +0 -1
- package/dist/index-l5JPD7_a.mjs.map +0 -1
|
@@ -4307,7 +4307,7 @@ class ServerSessionManager {
|
|
|
4307
4307
|
const sessionConfig = (_a = this.sessionConfig) !== null && _a !== void 0 ? _a : undefined;
|
|
4308
4308
|
/* fetch nonce from auth API (bound to the snapshotted app+issuer) */
|
|
4309
4309
|
const nonce = await genAuthNonce(sessionConfig);
|
|
4310
|
-
const { genSolanaMessage } = await Promise.resolve().then(function () { return require('./solana-message-
|
|
4310
|
+
const { genSolanaMessage } = await Promise.resolve().then(function () { return require('./solana-message-F1e5wPKF.js'); });
|
|
4311
4311
|
const message = await genSolanaMessage(address, nonce, sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.appId);
|
|
4312
4312
|
/* sign the message */
|
|
4313
4313
|
const sigBytes = nacl.sign.detached(new TextEncoder().encode(message), kp.secretKey);
|
|
@@ -7679,7 +7679,7 @@ async function doReconnectWithNewAuth() {
|
|
|
7679
7679
|
console.warn('[WS v2] Failed to clear HTTP read cache on auth change:', error);
|
|
7680
7680
|
}
|
|
7681
7681
|
try {
|
|
7682
|
-
const { reconnectRealtimeStoreWithNewAuth } = await Promise.resolve().then(function () { return require('./realtime-store-
|
|
7682
|
+
const { reconnectRealtimeStoreWithNewAuth } = await Promise.resolve().then(function () { return require('./realtime-store-CURbZ68v.js'); });
|
|
7683
7683
|
await reconnectRealtimeStoreWithNewAuth();
|
|
7684
7684
|
}
|
|
7685
7685
|
catch (error) {
|
|
@@ -8895,64 +8895,11 @@ function buildRequestedDocuments(documents) {
|
|
|
8895
8895
|
});
|
|
8896
8896
|
});
|
|
8897
8897
|
}
|
|
8898
|
-
/**
|
|
8899
|
-
function pickPathDocument(source, path) {
|
|
8900
|
-
if (Object.prototype.hasOwnProperty.call(source, path))
|
|
8901
|
-
return source[path];
|
|
8902
|
-
const withSlash = path.startsWith('/') ? path : `/${path}`;
|
|
8903
|
-
if (Object.prototype.hasOwnProperty.call(source, withSlash))
|
|
8904
|
-
return source[withSlash];
|
|
8905
|
-
const withoutSlash = path.startsWith('/') ? path.slice(1) : path;
|
|
8906
|
-
if (Object.prototype.hasOwnProperty.call(source, withoutSlash))
|
|
8907
|
-
return source[withoutSlash];
|
|
8908
|
-
return undefined;
|
|
8909
|
-
}
|
|
8910
|
-
/**
|
|
8911
|
-
* `observed: true` only when EVERY requested concrete path was read back as a
|
|
8912
|
-
* real document. The sync endpoint answers `null` for a document that is
|
|
8913
|
-
* absent, lagging, or read-denied, and a deleted path reads back as `null` too
|
|
8914
|
-
* — none of those are evidence of synchronization.
|
|
8915
|
-
*/
|
|
8916
|
-
function validatePathKeyedDocuments(paths, source) {
|
|
8917
|
-
if (!source || typeof source !== 'object' || Array.isArray(source)) {
|
|
8918
|
-
return { observed: false, reason: 'the synchronization response was not a path-keyed document map' };
|
|
8919
|
-
}
|
|
8920
|
-
const map = source;
|
|
8921
|
-
const documents = [];
|
|
8922
|
-
const unobserved = [];
|
|
8923
|
-
for (const path of paths) {
|
|
8924
|
-
const document = pickPathDocument(map, path);
|
|
8925
|
-
if (document == null || typeof document !== 'object' || Array.isArray(document)) {
|
|
8926
|
-
unobserved.push(path);
|
|
8927
|
-
documents.push({ path, document: null });
|
|
8928
|
-
continue;
|
|
8929
|
-
}
|
|
8930
|
-
documents.push({ path, document: document });
|
|
8931
|
-
}
|
|
8932
|
-
if (unobserved.length > 0) {
|
|
8933
|
-
return {
|
|
8934
|
-
observed: false,
|
|
8935
|
-
reason: `no readable document was returned for ${unobserved.join(', ')} ` +
|
|
8936
|
-
'(absent, deleted, lagging, read-denied, or a passthrough write)',
|
|
8937
|
-
};
|
|
8938
|
-
}
|
|
8939
|
-
return { observed: true, documents };
|
|
8940
|
-
}
|
|
8941
|
-
/**
|
|
8942
|
-
* Best-effort chain synchronization. A confirmed transaction must NEVER be lost to a
|
|
8943
|
-
* synchronization failure, so this reports its outcome in `mirrorSync` and
|
|
8944
|
-
* never rejects. The signature lets the server index the exact transaction,
|
|
8945
|
-
* including hook-mutated documents beyond the requested destination paths.
|
|
8946
|
-
*/
|
|
8898
|
+
/** Best-effort readback, including a failure to load its lazy implementation. */
|
|
8947
8899
|
async function attemptMirrorSync(paths, options, transactionSignature) {
|
|
8948
8900
|
try {
|
|
8949
|
-
const
|
|
8950
|
-
|
|
8951
|
-
// path always contains a `/`, so a top-level `data` key is never one.
|
|
8952
|
-
const map = (synced && typeof synced === 'object' && !Array.isArray(synced) && 'data' in synced)
|
|
8953
|
-
? synced.data
|
|
8954
|
-
: synced;
|
|
8955
|
-
return validatePathKeyedDocuments(paths, map);
|
|
8901
|
+
const mirror = await Promise.resolve().then(function () { return require('./mirror-sync-ChzMq7bH.js'); });
|
|
8902
|
+
return await mirror.attemptMirrorSync(paths, options, transactionSignature);
|
|
8956
8903
|
}
|
|
8957
8904
|
catch (error) {
|
|
8958
8905
|
const message = typeof (error === null || error === void 0 ? void 0 : error.message) === 'string' ? error.message : String(error);
|
|
@@ -9171,7 +9118,7 @@ async function setMany(many, options) {
|
|
|
9171
9118
|
if (typeof curTx.serializedTransaction !== 'string' || typeof curTx.poofnetIntentId !== 'string') {
|
|
9172
9119
|
throw new Error('Unsupported 202 transaction shape: a poofnet write needs serializedTransaction and poofnetIntentId');
|
|
9173
9120
|
}
|
|
9174
|
-
const { signPoofnetTransaction, buildExpectedWriteIntent } = await Promise.resolve().then(function () { return require('./solana-operations-
|
|
9121
|
+
const { signPoofnetTransaction, buildExpectedWriteIntent } = await Promise.resolve().then(function () { return require('./solana-operations-CI0sREvl.js'); });
|
|
9175
9122
|
const signedTransaction = await signPoofnetTransaction(curTx.serializedTransaction, authProvider, options, buildExpectedWriteIntent(documents));
|
|
9176
9123
|
// Signing-only, exactly as on a real chain: signed and NOT committed.
|
|
9177
9124
|
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
@@ -9209,7 +9156,7 @@ async function setMany(many, options) {
|
|
|
9209
9156
|
'Nothing was signed or submitted.');
|
|
9210
9157
|
}
|
|
9211
9158
|
const solanaChain = workerChain;
|
|
9212
|
-
const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await Promise.resolve().then(function () { return require('./solana-operations-
|
|
9159
|
+
const { handlePreBuiltTransaction, buildExpectedWriteIntent } = await Promise.resolve().then(function () { return require('./solana-operations-CI0sREvl.js'); });
|
|
9213
9160
|
// OA-0001: derive the expected intent from OUR OWN request (the one
|
|
9214
9161
|
// ground truth a tampered builder response cannot change) so the
|
|
9215
9162
|
// validator can reject any transaction whose operation semantics
|
|
@@ -9522,19 +9469,6 @@ async function signAndSubmitTransaction(transaction, feePayer) {
|
|
|
9522
9469
|
}
|
|
9523
9470
|
return config.authProvider.signAndSubmitTransaction(transaction, feePayer);
|
|
9524
9471
|
}
|
|
9525
|
-
/** Refresh concrete paths, or index a confirmed transaction and read its requested paths. */
|
|
9526
|
-
async function syncItems(paths, options, transactionSignature) {
|
|
9527
|
-
var _a, _b;
|
|
9528
|
-
const response = await makeApiRequest('PUT', 'items/sync', Object.assign({ paths }, (transactionSignature !== undefined ? { transactionSignature } : {})), options === null || options === void 0 ? void 0 : options._overrides);
|
|
9529
|
-
if (transactionSignature !== undefined && (response.status !== 200
|
|
9530
|
-
|| ((_a = response.data) === null || _a === void 0 ? void 0 : _a.synchronized) !== true
|
|
9531
|
-
|| ((_b = response.data) === null || _b === void 0 ? void 0 : _b.transactionSignature) !== transactionSignature)) {
|
|
9532
|
-
// An older server's local-read stub can return 200 with stale documents.
|
|
9533
|
-
// Only the matching server acknowledgment proves this transaction was indexed.
|
|
9534
|
-
throw new Error('the synchronization response did not acknowledge the confirmed transaction');
|
|
9535
|
-
}
|
|
9536
|
-
return response.data;
|
|
9537
|
-
}
|
|
9538
9472
|
|
|
9539
9473
|
var operations = /*#__PURE__*/Object.freeze({
|
|
9540
9474
|
__proto__: null,
|
|
@@ -9559,8 +9493,7 @@ var operations = /*#__PURE__*/Object.freeze({
|
|
|
9559
9493
|
setMany: setMany,
|
|
9560
9494
|
signAndSubmitTransaction: signAndSubmitTransaction,
|
|
9561
9495
|
signMessage: signMessage,
|
|
9562
|
-
signTransaction: signTransaction
|
|
9563
|
-
syncItems: syncItems
|
|
9496
|
+
signTransaction: signTransaction
|
|
9564
9497
|
});
|
|
9565
9498
|
|
|
9566
9499
|
const DEFAULT_TIMEOUT_MS = 60000;
|
|
@@ -11055,7 +10988,7 @@ function toMillis(seconds) {
|
|
|
11055
10988
|
|
|
11056
10989
|
/** SIWS message creation is async already, so its onchain module can be lazy. */
|
|
11057
10990
|
async function genSolanaMessage(address, nonce) {
|
|
11058
|
-
const implementation = await Promise.resolve().then(function () { return require('./solana-message-
|
|
10991
|
+
const implementation = await Promise.resolve().then(function () { return require('./solana-message-F1e5wPKF.js'); });
|
|
11059
10992
|
return implementation.genSolanaMessage(address, nonce);
|
|
11060
10993
|
}
|
|
11061
10994
|
|
|
@@ -11673,6 +11606,7 @@ exports.isAuthExpiredError = isAuthExpiredError;
|
|
|
11673
11606
|
exports.isEffectResult = isEffectResult;
|
|
11674
11607
|
exports.isWriteNotApplied = isWriteNotApplied;
|
|
11675
11608
|
exports.live = live;
|
|
11609
|
+
exports.makeApiRequest = makeApiRequest;
|
|
11676
11610
|
exports.markWriteNotApplied = markWriteNotApplied;
|
|
11677
11611
|
exports.normalizeEvmAddress = normalizeEvmAddress;
|
|
11678
11612
|
exports.now = now;
|
|
@@ -11708,4 +11642,4 @@ exports.toSeconds = toSeconds;
|
|
|
11708
11642
|
exports.waitForSetResult = waitForSetResult;
|
|
11709
11643
|
exports.withEffects = withEffects;
|
|
11710
11644
|
exports.writeNotAppliedPhase = writeNotAppliedPhase;
|
|
11711
|
-
//# sourceMappingURL=index-
|
|
11645
|
+
//# sourceMappingURL=index-DQ0FXeI8.js.map
|