@bounded-sh/core 0.0.65 → 0.0.67
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/decline.d.ts +5 -3
- package/dist/client/live-effects.d.ts +4 -2
- package/dist/client/operations.d.ts +90 -5
- package/dist/client/reconcile.d.ts +51 -0
- package/dist/client/solana-operations.d.ts +13 -2
- package/dist/{index-C8ocsC_W.js → index-DNZifL5j.js} +801 -91
- package/dist/index-DNZifL5j.js.map +1 -0
- package/dist/{index-BNOU00XY.mjs → index-TyXiW4Uf.mjs} +800 -92
- package/dist/index-TyXiW4Uf.mjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{realtime-store-I_bcryPz.js → realtime-store-CINyAkPw.js} +2 -2
- package/dist/{realtime-store-I_bcryPz.js.map → realtime-store-CINyAkPw.js.map} +1 -1
- package/dist/{realtime-store-mzFJ8bHE.mjs → realtime-store-CpbnXM7q.mjs} +2 -2
- package/dist/{realtime-store-mzFJ8bHE.mjs.map → realtime-store-CpbnXM7q.mjs.map} +1 -1
- package/dist/{solana-message-D_CN0H6r.js → solana-message-Bycv-L5n.js} +2 -2
- package/dist/{solana-message-D_CN0H6r.js.map → solana-message-Bycv-L5n.js.map} +1 -1
- package/dist/{solana-message-VZBGvV0S.mjs → solana-message-DXXwC95Z.mjs} +2 -2
- package/dist/{solana-message-VZBGvV0S.mjs.map → solana-message-DXXwC95Z.mjs.map} +1 -1
- package/dist/{solana-operations-BlCYbdiN.mjs → solana-operations-ChHG25O0.mjs} +157 -20
- package/dist/solana-operations-ChHG25O0.mjs.map +1 -0
- package/dist/{solana-operations-CYpu6EU8.js → solana-operations-Dm_4VnlB.js} +158 -19
- package/dist/solana-operations-Dm_4VnlB.js.map +1 -0
- package/dist/types.d.ts +370 -4
- package/dist/utils/core-platform.d.ts +7 -0
- package/package.json +2 -2
- package/dist/index-BNOU00XY.mjs.map +0 -1
- package/dist/index-C8ocsC_W.js.map +0 -1
- package/dist/solana-operations-BlCYbdiN.mjs.map +0 -1
- package/dist/solana-operations-CYpu6EU8.js.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -23,6 +23,18 @@ export interface AuthProvider {
|
|
|
23
23
|
restoreSession(): Promise<User | null>;
|
|
24
24
|
logout(): Promise<void>;
|
|
25
25
|
getNativeMethods(): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Poll an already-broadcast EVM transaction through THIS provider's own
|
|
28
|
+
* transport, so `reconcileSetResult` never has to guess an RPC endpoint or
|
|
29
|
+
* cross wallet identities. Optional: a provider that cannot submit EVM
|
|
30
|
+
* transactions has nothing to reconcile, and a `submitted` receipt simply
|
|
31
|
+
* stays `submitted`.
|
|
32
|
+
*
|
|
33
|
+
* It must NEVER build a fresh transaction. It may rebroadcast the
|
|
34
|
+
* byte-identical fenced bytes only when `allowRebroadcast` is true and the
|
|
35
|
+
* fenced nonce is still unused.
|
|
36
|
+
*/
|
|
37
|
+
reconcileEvmTransaction?(request: EvmReconcileRequest): Promise<TransactionReconciliation>;
|
|
26
38
|
}
|
|
27
39
|
export interface User {
|
|
28
40
|
/**
|
|
@@ -103,13 +115,367 @@ export interface SolTransaction {
|
|
|
103
115
|
/** Base64-encoded VersionedTransaction prebuilt server-side for sponsorship and/or required co-signers. */
|
|
104
116
|
signedTransaction?: string;
|
|
105
117
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Execution-lane tag for a Solana write. Reported verbatim by the realtime
|
|
120
|
+
* worker on its 202; the SDK never infers it from the app protocol.
|
|
121
|
+
*/
|
|
122
|
+
export type SolanaChainTag = 'solana_devnet' | 'solana_mainnet';
|
|
123
|
+
/**
|
|
124
|
+
* Execution-lane tag for an EVM write, reported verbatim by the realtime worker
|
|
125
|
+
* as the resolved EVM NETWORK key (protocol tier × chain), e.g. `base_sepolia`
|
|
126
|
+
* on a testnet-tier app and `base_mainnet` on a mainnet-tier one. The
|
|
127
|
+
* `evm_<chain>` form is the worker's fallback when a network cannot be resolved.
|
|
128
|
+
*
|
|
129
|
+
* The SDK never derives this from `evmTransaction.chainId`: a receipt states
|
|
130
|
+
* where the write actually ran, and only the worker knows that.
|
|
131
|
+
*/
|
|
132
|
+
export type EvmChainTag = 'base_sepolia' | 'base_mainnet' | 'robinhood_testnet' | 'robinhood_mainnet' | 'eth_sepolia' | 'eth_mainnet' | `evm_${string}`;
|
|
133
|
+
/**
|
|
134
|
+
* The execution lane a write actually ran on — NOT the app's declared protocol.
|
|
135
|
+
* Routing is per batch, so a batch touching only unflagged collections in a
|
|
136
|
+
* `realtime_devnet` app commits directly offchain and reports the offchain lane.
|
|
137
|
+
* Mirrors the CLI's `Chain` field ("reports which path ran").
|
|
138
|
+
*
|
|
139
|
+
* `'unknown'` is never a lane the platform runs; it appears only when a worker
|
|
140
|
+
* predating the batch-receipt contract returned a direct commit with no lane at
|
|
141
|
+
* all. Discarding a committed write's receipt over a missing tag would be worse
|
|
142
|
+
* than reporting the gap honestly.
|
|
143
|
+
*/
|
|
144
|
+
export type ChainTag = SolanaChainTag | EvmChainTag | 'realtime_offchain' | 'unknown' | (string & {});
|
|
145
|
+
/**
|
|
146
|
+
* One requested write, keyed by its CONCRETE destination path (never by index).
|
|
147
|
+
* A `null` document means the entry was deleted or is absent.
|
|
148
|
+
*
|
|
149
|
+
* Positional correlation is provably wrong for Bounded writes: the worker
|
|
150
|
+
* processes deletes before upserts and returns the deleted document's PREVIOUS
|
|
151
|
+
* value, a missing delete and a passthrough write emit no result entry at all,
|
|
152
|
+
* and hooks run after the result array is captured. Only the path correlates.
|
|
153
|
+
*/
|
|
154
|
+
export type SetEntry = {
|
|
155
|
+
path: string;
|
|
156
|
+
document: Record<string, unknown> | null;
|
|
157
|
+
};
|
|
158
|
+
export type SetDocuments = SetEntry[];
|
|
159
|
+
/** Solana expiry fence from the worker's 202, used for same-signature reconciliation. */
|
|
160
|
+
export type SolanaFence = {
|
|
161
|
+
blockhash: string;
|
|
162
|
+
lastValidBlockHeight: number;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* EVM fence for a SERVER-KEYPAIR write: the exact signed bytes plus the sender
|
|
166
|
+
* and nonce they consume. Reconciliation may rebroadcast these identical bytes
|
|
167
|
+
* while the nonce is still unused, which cannot produce a second execution.
|
|
168
|
+
* Injected browser wallets never produce one (the wallet holds the signed bytes).
|
|
169
|
+
*/
|
|
170
|
+
export type EvmFence = {
|
|
171
|
+
chainId: number;
|
|
172
|
+
sender: string;
|
|
173
|
+
nonce: number;
|
|
174
|
+
signedTransaction: string;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Whether server state was actually observed after a write.
|
|
178
|
+
*
|
|
179
|
+
* A successful sync HTTP call is NOT evidence of synchronization: the sync
|
|
180
|
+
* endpoint returns `null` for a document that is absent, lagging, or
|
|
181
|
+
* read-denied. `observed: true` requires every requested path to have been read
|
|
182
|
+
* back and validated; anything else reports `observed: false` with a reason.
|
|
183
|
+
*/
|
|
184
|
+
export type MirrorSync = {
|
|
185
|
+
observed: true;
|
|
186
|
+
documents: SetDocuments;
|
|
187
|
+
} | {
|
|
188
|
+
observed: false;
|
|
189
|
+
reason: string;
|
|
190
|
+
};
|
|
191
|
+
/** The write committed directly on the worker (no client-signed transaction). */
|
|
192
|
+
export type CommittedSetResult = {
|
|
193
|
+
status: 'committed';
|
|
194
|
+
/** The caller's own proposed writes — an echo, never authoritative state. */
|
|
195
|
+
requestedDocuments: SetDocuments;
|
|
196
|
+
/** Post-hook server state, when the worker reported it per concrete path. */
|
|
197
|
+
observation: MirrorSync;
|
|
198
|
+
chain: ChainTag;
|
|
199
|
+
/** The batch's own transaction id, verbatim from the worker receipt. Never lifted from a result document. */
|
|
200
|
+
transactionId: string | null;
|
|
201
|
+
};
|
|
202
|
+
/** A Solana transaction that confirmed on-chain without error. */
|
|
203
|
+
export type SolanaConfirmedSetResult = {
|
|
204
|
+
status: 'confirmed';
|
|
205
|
+
appId: string;
|
|
206
|
+
requestedDocuments: SetDocuments;
|
|
207
|
+
chain: SolanaChainTag;
|
|
208
|
+
transactionId: string;
|
|
209
|
+
signedTransaction: string;
|
|
210
|
+
fence: SolanaFence;
|
|
211
|
+
/**
|
|
212
|
+
* The RPC response context slot observed at confirmation — deliberately NOT
|
|
213
|
+
* called `slot`. It is not the slot the transaction landed in; polling the
|
|
214
|
+
* mirror for a `_block_number` matching it would never succeed.
|
|
215
|
+
*/
|
|
216
|
+
confirmationContextSlot: number;
|
|
217
|
+
mirrorSync: MirrorSync;
|
|
218
|
+
};
|
|
219
|
+
/** An EVM transaction whose receipt reported success. */
|
|
220
|
+
export type EvmConfirmedSetResult = {
|
|
221
|
+
status: 'confirmed';
|
|
222
|
+
appId: string;
|
|
223
|
+
requestedDocuments: SetDocuments;
|
|
224
|
+
chain: EvmChainTag;
|
|
225
|
+
transactionId: string;
|
|
226
|
+
/** A real EVM block number. */
|
|
227
|
+
blockNumber: number;
|
|
228
|
+
mirrorSync: MirrorSync;
|
|
229
|
+
};
|
|
230
|
+
export type ConfirmedSetResult = SolanaConfirmedSetResult | EvmConfirmedSetResult;
|
|
231
|
+
/**
|
|
232
|
+
* Solana broadcast whose confirmation outcome is unknown. The signature is
|
|
233
|
+
* derived from the signed bytes BEFORE broadcast, so it survives a lost send
|
|
234
|
+
* response. Never auto-resubmit — reconcile this same signature instead.
|
|
235
|
+
*/
|
|
236
|
+
export type SolanaSubmittedSetResult = {
|
|
237
|
+
status: 'submitted';
|
|
238
|
+
appId: string;
|
|
239
|
+
requestedDocuments: SetDocuments;
|
|
240
|
+
chain: SolanaChainTag;
|
|
241
|
+
transactionId: string;
|
|
242
|
+
signedTransaction: string;
|
|
243
|
+
fence: SolanaFence;
|
|
244
|
+
confirmation: {
|
|
245
|
+
state: 'unknown';
|
|
246
|
+
reason: string;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Server-keypair EVM broadcast with an unknown outcome. Fenced, so
|
|
251
|
+
* reconciliation may rebroadcast the byte-identical signed transaction while
|
|
252
|
+
* the nonce is unused. There is deliberately NO retry-safe terminal state here.
|
|
253
|
+
*/
|
|
254
|
+
export type EvmFencedSubmittedSetResult = {
|
|
255
|
+
status: 'submitted';
|
|
256
|
+
appId: string;
|
|
257
|
+
requestedDocuments: SetDocuments;
|
|
258
|
+
chain: EvmChainTag;
|
|
259
|
+
transactionId: string;
|
|
260
|
+
fence: EvmFence;
|
|
261
|
+
confirmation: {
|
|
262
|
+
state: 'unknown';
|
|
263
|
+
reason: string;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Injected-wallet EVM broadcast whose hash IS known (eth_sendTransaction
|
|
268
|
+
* returned before receipt polling timed out). Pollable, never rebroadcastable:
|
|
269
|
+
* the signed bytes live inside the wallet.
|
|
270
|
+
*/
|
|
271
|
+
export type EvmHashKnownSubmittedSetResult = {
|
|
272
|
+
status: 'submitted';
|
|
273
|
+
appId: string;
|
|
274
|
+
requestedDocuments: SetDocuments;
|
|
275
|
+
chain: EvmChainTag;
|
|
276
|
+
transactionId: string;
|
|
277
|
+
rebroadcastable: false;
|
|
278
|
+
confirmation: {
|
|
279
|
+
state: 'unknown';
|
|
280
|
+
reason: string;
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Injected-wallet EVM send whose RESPONSE was lost, so no hash exists at all.
|
|
285
|
+
* Explicitly irreconcilable and never auto-retried: the wallet owns nonce
|
|
286
|
+
* selection and may have replaced the transaction outside our view.
|
|
287
|
+
*/
|
|
288
|
+
export type EvmIrreconcilableSubmittedSetResult = {
|
|
289
|
+
status: 'submitted';
|
|
290
|
+
appId: string;
|
|
291
|
+
requestedDocuments: SetDocuments;
|
|
292
|
+
chain: EvmChainTag;
|
|
293
|
+
transactionId: null;
|
|
294
|
+
confirmation: {
|
|
295
|
+
state: 'unknown';
|
|
296
|
+
reason: string;
|
|
297
|
+
reconcilable: false;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
export type SubmittedSetResult = SolanaSubmittedSetResult | EvmFencedSubmittedSetResult | EvmHashKnownSubmittedSetResult | EvmIrreconcilableSubmittedSetResult;
|
|
301
|
+
/**
|
|
302
|
+
* The one retry-safe terminal state: the write provably did NOT land. Reached
|
|
303
|
+
* only after observed blockhash expiry PLUS history proving the signature is
|
|
304
|
+
* absent. Solana only — nonce advancement is not proof an EVM write did not
|
|
305
|
+
* execute, so EVM has no equivalent by design.
|
|
306
|
+
*/
|
|
307
|
+
export type SolanaExpiredNotLandedSetResult = {
|
|
308
|
+
status: 'expired_not_landed';
|
|
309
|
+
appId: string;
|
|
310
|
+
requestedDocuments: SetDocuments;
|
|
311
|
+
chain: SolanaChainTag;
|
|
312
|
+
transactionId: string;
|
|
313
|
+
fence: SolanaFence;
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* `shouldSubmitTx: false`: the transaction was signed and NOT sent. There is no
|
|
317
|
+
* signature to report and nothing to mirror, so `transactionId` is `null` (not
|
|
318
|
+
* an empty string) and no synchronization is attempted. Solana only — the EVM
|
|
319
|
+
* providers sign and submit atomically.
|
|
320
|
+
*/
|
|
321
|
+
export type SolanaSignedSetResult = {
|
|
322
|
+
status: 'signed';
|
|
323
|
+
appId: string;
|
|
324
|
+
requestedDocuments: SetDocuments;
|
|
325
|
+
chain: SolanaChainTag;
|
|
326
|
+
transactionId: null;
|
|
327
|
+
signedTransaction: string;
|
|
328
|
+
fence: SolanaFence;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* What every Bounded write resolves to. Discriminate on `status` first.
|
|
332
|
+
*
|
|
333
|
+
* NOTE ON DELIVERY: this is not exactly-once delivery. A direct write commits
|
|
334
|
+
* and runs hooks before its HTTP response is produced, so a LOST response to a
|
|
335
|
+
* direct write is ambiguous. The SDK never retries writes for that reason;
|
|
336
|
+
* resolve an ambiguous direct write by reading the path back, not by resubmitting.
|
|
337
|
+
*/
|
|
338
|
+
export type SetResult = CommittedSetResult | SolanaConfirmedSetResult | EvmConfirmedSetResult | SolanaSubmittedSetResult | EvmFencedSubmittedSetResult | EvmHashKnownSubmittedSetResult | EvmIrreconcilableSubmittedSetResult | SolanaExpiredNotLandedSetResult | SolanaSignedSetResult;
|
|
339
|
+
/**
|
|
340
|
+
* What `AuthProvider.runTransaction` (and the Solana pre-built lane) resolves
|
|
341
|
+
* to. Discriminated so the identifier ESCAPES an unknown confirmation outcome:
|
|
342
|
+
* previously every lane awaited a receipt and threw on timeout, so a landed
|
|
343
|
+
* transaction surfaced as an error with no hash and invited a duplicate submit.
|
|
344
|
+
*
|
|
345
|
+
* Definitive failures — an EIP-1193 user rejection, pre-broadcast validation,
|
|
346
|
+
* or an on-chain revert/err — still THROW. Only an ambiguous transport outcome
|
|
347
|
+
* resolves as `submitted`.
|
|
348
|
+
*/
|
|
349
|
+
export type SolanaConfirmedTransactionResult = {
|
|
350
|
+
outcome: 'confirmed';
|
|
351
|
+
lane: 'solana';
|
|
352
|
+
transactionSignature: string;
|
|
353
|
+
/** Base64 signed transaction bytes. */
|
|
354
|
+
signedTransaction: string;
|
|
355
|
+
fence: SolanaFence;
|
|
356
|
+
/** RPC response context slot at confirmation, NOT the landing slot. */
|
|
357
|
+
confirmationContextSlot: number;
|
|
358
|
+
};
|
|
359
|
+
export type SolanaSubmittedTransactionResult = {
|
|
360
|
+
outcome: 'submitted';
|
|
361
|
+
lane: 'solana';
|
|
362
|
+
/** Derived from the signed bytes before broadcast, so a lost send cannot orphan it. */
|
|
363
|
+
transactionSignature: string;
|
|
364
|
+
signedTransaction: string;
|
|
365
|
+
fence: SolanaFence;
|
|
366
|
+
reason: string;
|
|
367
|
+
};
|
|
368
|
+
export type SolanaSignedTransactionResult = {
|
|
369
|
+
outcome: 'signed';
|
|
370
|
+
lane: 'solana';
|
|
371
|
+
transactionSignature: null;
|
|
372
|
+
signedTransaction: string;
|
|
373
|
+
fence: SolanaFence;
|
|
374
|
+
};
|
|
375
|
+
export type EvmConfirmedTransactionResult = {
|
|
376
|
+
outcome: 'confirmed';
|
|
377
|
+
lane: 'evm';
|
|
378
|
+
transactionSignature: string;
|
|
109
379
|
blockNumber: number;
|
|
110
380
|
gasUsed: string;
|
|
111
|
-
data?:
|
|
381
|
+
data?: unknown;
|
|
382
|
+
};
|
|
383
|
+
/** Server-keypair EVM: fenced, so the identical bytes may be rebroadcast. */
|
|
384
|
+
export type EvmFencedSubmittedTransactionResult = {
|
|
385
|
+
outcome: 'submitted';
|
|
386
|
+
lane: 'evm';
|
|
387
|
+
transactionSignature: string;
|
|
388
|
+
fence: EvmFence;
|
|
389
|
+
reason: string;
|
|
390
|
+
};
|
|
391
|
+
/** Injected wallet, hash known: pollable, never rebroadcastable. */
|
|
392
|
+
export type EvmHashKnownSubmittedTransactionResult = {
|
|
393
|
+
outcome: 'submitted';
|
|
394
|
+
lane: 'evm';
|
|
395
|
+
transactionSignature: string;
|
|
396
|
+
rebroadcastable: false;
|
|
397
|
+
reason: string;
|
|
398
|
+
};
|
|
399
|
+
/** Injected wallet, send response lost: no hash at all. */
|
|
400
|
+
export type EvmIrreconcilableSubmittedTransactionResult = {
|
|
401
|
+
outcome: 'submitted';
|
|
402
|
+
lane: 'evm';
|
|
403
|
+
transactionSignature: null;
|
|
404
|
+
reconcilable: false;
|
|
405
|
+
reason: string;
|
|
406
|
+
};
|
|
407
|
+
export type SolanaTransactionResult = SolanaConfirmedTransactionResult | SolanaSubmittedTransactionResult | SolanaSignedTransactionResult;
|
|
408
|
+
export type EvmTransactionResult = EvmConfirmedTransactionResult | EvmFencedSubmittedTransactionResult | EvmHashKnownSubmittedTransactionResult | EvmIrreconcilableSubmittedTransactionResult;
|
|
409
|
+
export type TransactionResult = SolanaTransactionResult | EvmTransactionResult;
|
|
410
|
+
/**
|
|
411
|
+
* The result of polling an already-broadcast transaction. Providers implement
|
|
412
|
+
* `reconcileEvmTransaction` to answer it for their own transport; Solana is
|
|
413
|
+
* reconciled by core against the configured RPC.
|
|
414
|
+
*/
|
|
415
|
+
export type TransactionReconciliation =
|
|
416
|
+
/** A receipt/status exists and reports success. */
|
|
417
|
+
{
|
|
418
|
+
state: 'confirmed';
|
|
419
|
+
blockNumber?: number;
|
|
420
|
+
confirmationContextSlot?: number;
|
|
421
|
+
}
|
|
422
|
+
/** It landed and FAILED on-chain. The caller throws; this is not `submitted`. */
|
|
423
|
+
| {
|
|
424
|
+
state: 'failed';
|
|
425
|
+
reason: string;
|
|
426
|
+
}
|
|
427
|
+
/** Solana only: expiry observed AND history proves the signature is absent. */
|
|
428
|
+
| {
|
|
429
|
+
state: 'absent_after_expiry';
|
|
112
430
|
}
|
|
431
|
+
/** Nothing conclusive. Stays `submitted`. */
|
|
432
|
+
| {
|
|
433
|
+
state: 'unknown';
|
|
434
|
+
reason: string;
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* The Solana RPC surface the write + reconciliation lanes use. A real
|
|
438
|
+
* `Connection` satisfies it structurally; tests inject a double through
|
|
439
|
+
* `_overrides._solanaRpc` so the send-loss / confirm-timeout / exactly-one-
|
|
440
|
+
* broadcast / expiry paths are exercised without a validator.
|
|
441
|
+
*/
|
|
442
|
+
export interface SolanaWriteRpc {
|
|
443
|
+
sendRawTransaction(rawTransaction: Uint8Array, options?: {
|
|
444
|
+
skipPreflight?: boolean;
|
|
445
|
+
maxRetries?: number;
|
|
446
|
+
}): Promise<string>;
|
|
447
|
+
confirmTransaction(strategy: {
|
|
448
|
+
signature: string;
|
|
449
|
+
blockhash: string;
|
|
450
|
+
lastValidBlockHeight: number;
|
|
451
|
+
}, commitment?: any): Promise<{
|
|
452
|
+
value?: {
|
|
453
|
+
err?: unknown;
|
|
454
|
+
} | null;
|
|
455
|
+
context?: {
|
|
456
|
+
slot?: number;
|
|
457
|
+
};
|
|
458
|
+
}>;
|
|
459
|
+
getTransaction(signature: string, options?: any): Promise<any>;
|
|
460
|
+
getSignatureStatuses?(signatures: string[], config?: any): Promise<{
|
|
461
|
+
value?: Array<any>;
|
|
462
|
+
context?: {
|
|
463
|
+
slot?: number;
|
|
464
|
+
};
|
|
465
|
+
}>;
|
|
466
|
+
getBlockHeight?(commitment?: any): Promise<number>;
|
|
467
|
+
}
|
|
468
|
+
/** Request passed to a provider's `reconcileEvmTransaction`. */
|
|
469
|
+
export type EvmReconcileRequest = {
|
|
470
|
+
transactionHash: string;
|
|
471
|
+
/** Present only for the fenced (server-keypair) receipt. */
|
|
472
|
+
fence?: EvmFence;
|
|
473
|
+
/**
|
|
474
|
+
* Whether the caller permits a byte-identical rebroadcast of `fence`'s signed
|
|
475
|
+
* transaction while its nonce is unused. Always false for injected wallets.
|
|
476
|
+
*/
|
|
477
|
+
allowRebroadcast: boolean;
|
|
478
|
+
};
|
|
113
479
|
export interface TransactionReceipt {
|
|
114
480
|
}
|
|
115
481
|
export interface SubscriptionOptions {
|
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
* These are used instead of bare `atob()`/`btoa()` so the core package
|
|
8
8
|
* works in React Native without requiring the consumer to polyfill globals.
|
|
9
|
+
*
|
|
10
|
+
* Both directions are UTF-8-safe: bare btoa / Buffer('binary') are LATIN-1 and
|
|
11
|
+
* throw (surrogate-pair emoji) or silently mangle (accents, CJK) any code point
|
|
12
|
+
* > 0xFF, corrupting user text - e.g. an AI-query `prompt` - before it is sent.
|
|
13
|
+
* safeBtoa base64s the UTF-8 bytes; safeAtob is its exact inverse, and the
|
|
14
|
+
* realtime worker decodes the same bytes as UTF-8 (src/utf8-base64.ts). ASCII is
|
|
15
|
+
* byte-identical either way, so JWT (decodeBase64Url) decoding is unaffected.
|
|
9
16
|
*/
|
|
10
17
|
export declare function safeAtob(input: string): string;
|
|
11
18
|
export declare function safeBtoa(input: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bounded-sh/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
4
4
|
"description": "Shared client, data-plane, and transport primitives for Bounded, the full-stack app builder and runtime for AI-built apps: policy-enforced operations, files, functions, and realtime.",
|
|
5
5
|
"homepage": "https://bounded.sh/docs/sdk",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "rm -rf ./dist ./.rollup-tmp && tsc -p tsconfig.build.json --outDir .rollup-tmp --declarationDir .rollup-tmp --emitDeclarationOnly false && rollup -c && tsc -p tsconfig.build.json --emitDeclarationOnly --declarationDir dist && rm -rf ./.rollup-tmp",
|
|
18
18
|
"watch": "rollup -c -w",
|
|
19
|
-
"test": "node src/client/run-config-network-test.mjs && node src/client/run-read-principal-test.mjs && node src/client/run-principal-collision-test.mjs && node src/client/run-abortable-read-test.mjs && node src/utils/run-api-abort-test.mjs && node src/utils/run-api-transient-get-retry-test.mjs && node src/utils/run-auth-api-issuer-switch-test.mjs && node src/utils/run-auth-api-server-credential-test.mjs && node src/utils/run-session-manager-binding-test.mjs && node src/utils/rn-session-manager-example.source.test.mjs && node src/utils/run-session-protocol-test.mjs && node src/utils/run-auth-token-freshness-test.mjs && node src/utils/run-api-401-recovery-test.mjs && node src/utils/run-server-session-manager-test.mjs && node src/utils/api-refresh-inflight-key.source.test.mjs && node src/client/run-row-shape-test.mjs && node src/client/run-transport-test.mjs && node src/client/run-queries-coalesce-test.mjs && node src/client/run-runexpression-overrides-test.mjs && node src/client/run-subscribe-query-test.mjs && node src/client/subscribe-query-defaults.source.test.mjs && node src/client/run-public-export-surface-test.mjs && node src/client/run-live-auth-test.mjs && node src/client/run-live-view-principal-test.mjs && node src/client/run-subscription-auth-error-test.mjs && node src/client/run-subscription-confirmation-retry-test.mjs && node src/client/subscription-handoff-grace.source.test.mjs && node src/client/run-onchain-validation-test.mjs && node src/client/run-evm-dispatch-test.mjs && node src/utils/evm/run-evm-utils-test.mjs && node src/client/websocket-auth-url.test.mjs && node src/client/run-create-client-http-test.mjs && node src/client/run-create-client-subscribe-test.mjs && node src/client/run-wallet-config-binding-test.mjs",
|
|
19
|
+
"test": "node src/client/run-config-network-test.mjs && node src/client/run-read-principal-test.mjs && node src/client/run-principal-collision-test.mjs && node src/client/run-abortable-read-test.mjs && node src/utils/run-api-abort-test.mjs && node src/utils/run-api-transient-get-retry-test.mjs && node src/utils/run-auth-api-issuer-switch-test.mjs && node src/utils/run-auth-api-server-credential-test.mjs && node src/utils/run-session-manager-binding-test.mjs && node src/utils/run-web-session-manager-signout-test.mjs && node src/utils/run-auth-api-refresh-per-token-test.mjs && node src/utils/run-core-platform-encode-test.mjs && node src/utils/rn-session-manager-example.source.test.mjs && node src/utils/run-session-protocol-test.mjs && node src/utils/run-auth-token-freshness-test.mjs && node src/utils/run-api-401-recovery-test.mjs && node src/utils/run-server-session-manager-test.mjs && node src/utils/api-refresh-inflight-key.source.test.mjs && node src/client/run-row-shape-test.mjs && node src/client/run-transport-test.mjs && node src/client/run-queries-coalesce-test.mjs && node src/client/run-runexpression-overrides-test.mjs && node src/client/run-subscribe-query-test.mjs && node src/client/subscribe-query-defaults.source.test.mjs && node src/client/run-public-export-surface-test.mjs && node src/client/run-decline-cause-test.mjs && node src/client/run-live-auth-test.mjs && node src/client/run-live-view-principal-test.mjs && node src/client/run-subscription-auth-error-test.mjs && node src/client/run-subscription-confirmation-retry-test.mjs && node src/client/subscription-handoff-grace.source.test.mjs && node src/client/run-onchain-validation-test.mjs && node src/client/run-evm-dispatch-test.mjs && node src/client/run-set-result-test.mjs && node src/client/run-reconcile-set-result-test.mjs && node src/client/run-set-file-result-test.mjs && node src/client/run-set-result-types-test.mjs && node src/utils/evm/run-evm-utils-test.mjs && node src/client/websocket-auth-url.test.mjs && node src/client/run-create-client-http-test.mjs && node src/client/run-create-client-subscribe-test.mjs && node src/client/run-wallet-config-binding-test.mjs",
|
|
20
20
|
"prepare": "npm run build"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|