@bounded-sh/core 0.0.118-openapps.0 → 0.0.119
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/operations.d.ts +19 -1
- package/dist/client/reconcile.d.ts +2 -2
- package/dist/client/solana-confirm.d.ts +49 -0
- package/dist/client/solana-operations.d.ts +13 -1
- package/dist/{index-DQ0FXeI8.js → index-D7-5ecyu.js} +356 -237
- package/dist/index-D7-5ecyu.js.map +1 -0
- package/dist/{index-C6ZW5Gt2.mjs → index-D93TEYGf.mjs} +355 -238
- package/dist/index-D93TEYGf.mjs.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{mirror-sync-kt9PzQen.mjs → mirror-sync-DPMtQC3A.mjs} +2 -2
- package/dist/{mirror-sync-kt9PzQen.mjs.map → mirror-sync-DPMtQC3A.mjs.map} +1 -1
- package/dist/{mirror-sync-ChzMq7bH.js → mirror-sync-DzbDh6G_.js} +2 -2
- package/dist/{mirror-sync-ChzMq7bH.js.map → mirror-sync-DzbDh6G_.js.map} +1 -1
- package/dist/{realtime-store-CURbZ68v.js → realtime-store-C2Jz8YM0.js} +2 -2
- package/dist/{realtime-store-CURbZ68v.js.map → realtime-store-C2Jz8YM0.js.map} +1 -1
- package/dist/{realtime-store-FUjGL_Z8.mjs → realtime-store-FObAdw-J.mjs} +2 -2
- package/dist/{realtime-store-FUjGL_Z8.mjs.map → realtime-store-FObAdw-J.mjs.map} +1 -1
- package/dist/{solana-message-F1e5wPKF.js → solana-message-CPotom18.js} +2 -2
- package/dist/{solana-message-F1e5wPKF.js.map → solana-message-CPotom18.js.map} +1 -1
- package/dist/{solana-message-CEjXjnaG.mjs → solana-message-DqKp-y53.mjs} +2 -2
- package/dist/{solana-message-CEjXjnaG.mjs.map → solana-message-DqKp-y53.mjs.map} +1 -1
- package/dist/{solana-operations-CI0sREvl.js → solana-operations-DsT1303T.js} +55 -39
- package/dist/solana-operations-DsT1303T.js.map +1 -0
- package/dist/{solana-operations-5WjFwhnt.mjs → solana-operations-cwcuTNyk.mjs} +54 -40
- package/dist/solana-operations-cwcuTNyk.mjs.map +1 -0
- package/dist/{solana-v1-operations-DB9pih7o.mjs → solana-v1-operations-Jzg3uAot.mjs} +10 -24
- package/dist/solana-v1-operations-Jzg3uAot.mjs.map +1 -0
- package/dist/{solana-v1-operations-oot2R63I.js → solana-v1-operations-qj0WA2tF.js} +10 -24
- package/dist/solana-v1-operations-qj0WA2tF.js.map +1 -0
- package/dist/types.d.ts +22 -15
- package/package.json +1 -1
- package/dist/index-C6ZW5Gt2.mjs.map +0 -1
- package/dist/index-DQ0FXeI8.js.map +0 -1
- package/dist/solana-operations-5WjFwhnt.mjs.map +0 -1
- package/dist/solana-operations-CI0sREvl.js.map +0 -1
- package/dist/solana-v1-operations-DB9pih7o.mjs.map +0 -1
- package/dist/solana-v1-operations-oot2R63I.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthProvider, MirrorSync, SetResult, SolanaSubmittedSetResult, SolanaWriteRpc } from '../types';
|
|
1
|
+
import type { AuthProvider, SignerReadiness, MirrorSync, SetResult, SolanaSubmittedSetResult, SolanaWriteRpc } from '../types';
|
|
2
2
|
import { type ClientConfig } from './config';
|
|
3
3
|
import type { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
4
4
|
/** Internal overrides for per-request auth and headers. */
|
|
@@ -47,6 +47,14 @@ export type GrantLane = {
|
|
|
47
47
|
};
|
|
48
48
|
export type SetOptions = {
|
|
49
49
|
shouldSubmitTx?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* This write takes the wallet's signature (an onchain collection). The signer is then prepared
|
|
52
|
+
* BEFORE the transaction is built: a hosted embedded wallet whose 24-hour session has lapsed
|
|
53
|
+
* collects its emailed code first, so the code never runs inside the transaction's blockhash
|
|
54
|
+
* lifetime and no build is thrown away. Without it the SDK still copes, by building again after
|
|
55
|
+
* the code, at the cost of one sponsored build left to expire.
|
|
56
|
+
*/
|
|
57
|
+
onchain?: boolean;
|
|
50
58
|
/**
|
|
51
59
|
* Called with the signed transaction's `submitted` receipt immediately BEFORE
|
|
52
60
|
* it is broadcast (Solana lanes only). Persist it to reconcile the exact
|
|
@@ -389,6 +397,16 @@ export declare function setFile(path: string, file: File | null, options?: {
|
|
|
389
397
|
}): Promise<FileUploadResult | FileDeleteResult>;
|
|
390
398
|
export declare function signMessage(message: string): Promise<string>;
|
|
391
399
|
export declare function signTransaction(transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
|
|
400
|
+
/**
|
|
401
|
+
* Make the signed-in wallet ready to sign without delay, BEFORE the transaction it will sign
|
|
402
|
+
* exists. A hosted embedded wallet whose 24-hour signing session has lapsed collects its emailed
|
|
403
|
+
* code here; a transaction built before that code is dead by the time it is signed, because a
|
|
404
|
+
* blockhash lives about 33 seconds on mainnet (late 2026) and the code takes longer. `set` and
|
|
405
|
+
* `setMany` do this themselves before a wallet signature; call it directly before a flow that
|
|
406
|
+
* builds and signs outside them, such as a permit approval. Resolves `'established'` when a
|
|
407
|
+
* ceremony ran, else `'ready'`; a wallet that holds its own key always answers `'ready'`.
|
|
408
|
+
*/
|
|
409
|
+
export declare function prepareToSign(): Promise<SignerReadiness>;
|
|
392
410
|
export declare function signAndSubmitTransaction(transaction: Transaction | VersionedTransaction, feePayer?: PublicKey): Promise<string>;
|
|
393
411
|
/** Refresh concrete paths, or index a confirmed transaction and read its requested paths. */
|
|
394
412
|
export declare function syncItems(paths: string[], options?: SetOptions, transactionSignature?: string): Promise<any>;
|
|
@@ -23,9 +23,9 @@ export type ReconcileSetResultOptions = {
|
|
|
23
23
|
export type WaitForSetResultOptions = ReconcileSetResultOptions & {
|
|
24
24
|
/** Total wall-clock bound. Default 60s. */
|
|
25
25
|
timeoutMs?: number;
|
|
26
|
-
/** Maximum reconciliation attempts. Default
|
|
26
|
+
/** Maximum reconciliation attempts. Default 60. */
|
|
27
27
|
maxAttempts?: number;
|
|
28
|
-
/** Delay between attempts. Default
|
|
28
|
+
/** Delay between attempts. Default 1s. */
|
|
29
29
|
pollIntervalMs?: number;
|
|
30
30
|
/** Cancels the wait. The latest `submitted` receipt is returned, never discarded. */
|
|
31
31
|
signal?: AbortSignal;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { SolanaWriteRpc } from '../types';
|
|
2
|
+
/** A signature status as `getSignatureStatuses` reports it. */
|
|
3
|
+
export interface SolanaSignatureStatus {
|
|
4
|
+
slot?: number;
|
|
5
|
+
err?: unknown;
|
|
6
|
+
confirmationStatus?: string | null;
|
|
7
|
+
confirmations?: number | null;
|
|
8
|
+
}
|
|
9
|
+
export type SolanaConfirmation =
|
|
10
|
+
/** Seen at `confirmed` or better; `status.err` says whether it succeeded. */
|
|
11
|
+
{
|
|
12
|
+
landed: true;
|
|
13
|
+
status: SolanaSignatureStatus;
|
|
14
|
+
contextSlot?: number;
|
|
15
|
+
}
|
|
16
|
+
/** Not seen at `confirmed` before the fence closed, or the RPC never answered usefully. */
|
|
17
|
+
| {
|
|
18
|
+
landed: false;
|
|
19
|
+
reason: string;
|
|
20
|
+
};
|
|
21
|
+
export interface ConfirmSignatureOptions {
|
|
22
|
+
/** Delay between status reads. Default 1s. */
|
|
23
|
+
pollIntervalMs?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Wall-clock ceiling. A healthy RPC always ends the wait at the blockhash expiry (about
|
|
26
|
+
* a minute); this bounds one whose block height never advances or that fails every read.
|
|
27
|
+
* Default 120s.
|
|
28
|
+
*/
|
|
29
|
+
maxWaitMs?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Whether a status is final enough to decide on. `processed` can still belong to a fork
|
|
33
|
+
* that is dropped, so only `confirmed` or `finalized` settle a write; an RPC that omits
|
|
34
|
+
* `confirmationStatus` reports a rooted transaction as `confirmations: null`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function settledSignatureStatus(status: SolanaSignatureStatus | null | undefined): status is SolanaSignatureStatus;
|
|
37
|
+
/**
|
|
38
|
+
* Poll the SAME signature until it is seen at `confirmed` or the blockhash fence closes.
|
|
39
|
+
* Never broadcasts. A `processed` status, even one carrying an error, is not a verdict and
|
|
40
|
+
* keeps the loop going. Once the confirmed block height passes `lastValidBlockHeight`, one
|
|
41
|
+
* history-searching read decides whether the transaction landed anyway; if not, the answer
|
|
42
|
+
* is "not seen" or "seen only below confirmed", never "never landed": only a finalized
|
|
43
|
+
* expiry proves that, which is `reconcileSetResult`'s job. Transient RPC failures retry the
|
|
44
|
+
* same signature.
|
|
45
|
+
*/
|
|
46
|
+
export declare function confirmSignature(rpc: SolanaWriteRpc, fence: {
|
|
47
|
+
signature: string;
|
|
48
|
+
lastValidBlockHeight: number;
|
|
49
|
+
}, options?: ConfirmSignatureOptions): Promise<SolanaConfirmation>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { getTransactionJson, SOLANA_MAX_SUPPORTED_TRANSACTION_VERSION } from './solana-transaction-read';
|
|
2
2
|
import type { VersionedTransaction } from '@solana/web3.js';
|
|
3
|
-
import type { AuthProvider, SolanaFence, SolanaTransactionResult } from '../types';
|
|
3
|
+
import type { AuthProvider, SolanaFence, SolanaTransactionResult, SolanaWriteRpc } from '../types';
|
|
4
4
|
import type { SetOptions } from './operations';
|
|
5
5
|
/**
|
|
6
6
|
* Minimal base58 encoder, used ONLY to derive a Solana transaction signature
|
|
@@ -19,6 +19,12 @@ export declare function encodeBase58(bytes: Uint8Array): string;
|
|
|
19
19
|
/** true when the base64 wire is a SIMD-0385 v1 transaction (first byte 0x81). */
|
|
20
20
|
export declare function isTransactionV1Base64(serializedTransaction: string): boolean;
|
|
21
21
|
export declare function deriveTransactionSignature(signedTransaction: VersionedTransaction): string;
|
|
22
|
+
/**
|
|
23
|
+
* The send was refused because the transaction's blockhash is no longer current: the RPC's
|
|
24
|
+
* preflight simulation names it, and no byte entered the network. The one send failure a
|
|
25
|
+
* fresh build cures, since the bytes were right and only their lifetime ran out.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isExpiredBlockhashRejection(error: unknown): boolean;
|
|
22
28
|
export declare function isDefinitiveSolanaSendFailure(error: unknown): boolean;
|
|
23
29
|
/**
|
|
24
30
|
* Whether a definitive Solana send/confirm failure is the BOUNDED PROGRAM
|
|
@@ -43,6 +49,12 @@ export declare class BoundedOnchainRuleRejection extends Error {
|
|
|
43
49
|
constructor(cause: unknown, extraLogs?: unknown);
|
|
44
50
|
}
|
|
45
51
|
export declare function errorText(error: unknown): string;
|
|
52
|
+
/**
|
|
53
|
+
* The tagged failure for a transaction that LANDED and failed on-chain: a Bounded
|
|
54
|
+
* rule/invariant rejection when the logs say so, otherwise the raw error, with the
|
|
55
|
+
* program logs attached whenever the RPC can still read them.
|
|
56
|
+
*/
|
|
57
|
+
export declare function landedTransactionFailure(rpc: SolanaWriteRpc, signature: string, err: unknown): Promise<Error>;
|
|
46
58
|
/**
|
|
47
59
|
* One expected field operation, derived from the caller's request document.
|
|
48
60
|
* `value`/`delta` are the JSON-round-tripped request values (what the server
|