import { I as TSerializedCryptoKeyData_Ed25519_Raw$1, K as TTypeAndId } from "./index-LpxnCt_F-DNsGOYe-.cjs"; import { C as JSONSerializableValue, E as NiceErrorDomain, p as INiceErrorIdMetadata } from "./index-BAgdJKZy-COfXA16I.cjs"; import { G as IActionRootDomain, Mt as TActionDomainChildDef, Nt as TActionDomainSchema, V as IActionPayload_Result_JsonObject, dn as TTransportedValue, j as IActionErrorDeclaration, k as IActionDomain, n as ActionDomain, s as ActionRootDomain, tn as TPossibleDomainIdList, u as ActionSchema, z as IActionPayload_Request_JsonObject } from "./index-Ch33zhaR.cjs"; import { Mt as TInferRealmState, _t as ISchemaStandard, ct as ISchemaBoolean, ft as ISchemaNumber, mt as ISchemaOptional, q as IRealmDefinition, vt as ISchemaString } from "./index-BJ3t8xvJ.cjs"; import "./index-DnNeDkZ5.cjs"; import * as v from "valibot"; //#region src/error/merr_bridge.d.ts declare enum EErr_Bridge { bridge_expired = "bridge_expired", bridge_not_found = "bridge_not_found", bridge_already_exists = "bridge_already_exists", bridge_no_exchange_key_found = "bridge_no_exchange_key_found", websocket_upgrade_failed = "websocket_upgrade_failed", invalid_websocket_path = "invalid_websocket_path", idempotency_conflict = "idempotency_conflict", invalid_action_request = "invalid_action_request", /** The creation proof's `issuedAt` is outside the freshness window (or the version is unknown). */ creation_proof_stale = "creation_proof_stale", /** The creation proof signature does not verify against the presented partner verify key. */ creation_proof_invalid = "creation_proof_invalid", /** Operator/circuit control is temporarily refusing NEW bridge allocation. */ allocation_halted = "allocation_halted", /** * Terminal, non-retryable (Phase 2c): this bridge is missing — expired, deleted, or never * created. After whole-object deletion the server cannot distinguish those histories, so every * post-lifetime request shares this one stable outcome. Clients must stop retrying, release the * connection, and (if appropriate) create a NEW bridge request. */ bridge_gone = "bridge_gone" } declare const merr_bridge: NiceErrorDomain<{ domain: string; allDomains: [string, "merr_meteor_connect"]; schema: { bridge_expired: INiceErrorIdMetadata; bridge_not_found: INiceErrorIdMetadata; bridge_already_exists: INiceErrorIdMetadata; bridge_no_exchange_key_found: INiceErrorIdMetadata; invalid_websocket_path: INiceErrorIdMetadata; websocket_upgrade_failed: INiceErrorIdMetadata; idempotency_conflict: INiceErrorIdMetadata; invalid_action_request: INiceErrorIdMetadata; creation_proof_stale: INiceErrorIdMetadata; creation_proof_invalid: INiceErrorIdMetadata; allocation_halted: INiceErrorIdMetadata; bridge_gone: INiceErrorIdMetadata; }; }>; //#endregion //#region src/error/merr_bridge_session.d.ts /** * Typed errors for `session_v1` sessions — the exact matrix in * `docs/multiple-actions-bridge-protocol.md` §7 (scope and retryability live there). Bounded, * payload-free text only: no hashes, bridge/turn IDs, signatures, ciphertext, or native exception * messages may enter these messages or retained telemetry (plan §8.3). */ declare enum EErr_Bridge_Session { session_unsupported = "session_unsupported", session_disabled = "session_disabled", pin_incorrect = "pin_incorrect", partner_secret_hash_mismatch = "partner_secret_hash_mismatch", wallet_update_required = "wallet_update_required", turn_limit_reached = "turn_limit_reached", sequence_mismatch = "sequence_mismatch", phase_mismatch = "phase_mismatch", state_revision_conflict = "state_revision_conflict", turn_mismatch = "turn_mismatch", turn_already_active = "turn_already_active", result_not_ready = "result_not_ready", ack_mismatch = "ack_mismatch", conflicting_replay = "conflicting_replay", request_hash_mismatch = "request_hash_mismatch", recovery_contract_mismatch = "recovery_contract_mismatch", action_ineligible = "action_ineligible", resource_profile_not_permitted = "resource_profile_not_permitted", external_work_not_permitted = "external_work_not_permitted", external_work_hold_consumed = "external_work_hold_consumed", external_work_journal_mismatch = "external_work_journal_mismatch", session_closing = "session_closing", close_not_permitted = "close_not_permitted", wallet_capability_required = "wallet_capability_required", session_authorization_insufficient = "session_authorization_insufficient", trusted_link_revoked = "trusted_link_revoked", request_too_large = "request_too_large", result_too_large = "result_too_large", stale_operation = "stale_operation", idle_expired = "idle_expired", absolute_expired = "absolute_expired", projection_repair_pending = "projection_repair_pending", valid_lease_rate_limited = "valid_lease_rate_limited" } declare const merr_bridge_session: NiceErrorDomain<{ domain: string; allDomains: [string, "merr_meteor_connect"]; schema: { session_unsupported: INiceErrorIdMetadata; session_disabled: INiceErrorIdMetadata; pin_incorrect: INiceErrorIdMetadata; partner_secret_hash_mismatch: INiceErrorIdMetadata; wallet_update_required: INiceErrorIdMetadata<{ requiredWalletProtocolVersion: number; requiredWalletCapabilities: string[]; }, JSONSerializableValue> & { context: { required: true; }; }; turn_limit_reached: INiceErrorIdMetadata; sequence_mismatch: INiceErrorIdMetadata; phase_mismatch: INiceErrorIdMetadata; state_revision_conflict: INiceErrorIdMetadata; turn_mismatch: INiceErrorIdMetadata; turn_already_active: INiceErrorIdMetadata; result_not_ready: INiceErrorIdMetadata; ack_mismatch: INiceErrorIdMetadata; conflicting_replay: INiceErrorIdMetadata; request_hash_mismatch: INiceErrorIdMetadata; recovery_contract_mismatch: INiceErrorIdMetadata; action_ineligible: INiceErrorIdMetadata; resource_profile_not_permitted: INiceErrorIdMetadata; external_work_not_permitted: INiceErrorIdMetadata; external_work_hold_consumed: INiceErrorIdMetadata; external_work_journal_mismatch: INiceErrorIdMetadata; session_closing: INiceErrorIdMetadata; close_not_permitted: INiceErrorIdMetadata; wallet_capability_required: INiceErrorIdMetadata; session_authorization_insufficient: INiceErrorIdMetadata; trusted_link_revoked: INiceErrorIdMetadata; request_too_large: INiceErrorIdMetadata; result_too_large: INiceErrorIdMetadata; stale_operation: INiceErrorIdMetadata; idle_expired: INiceErrorIdMetadata; absolute_expired: INiceErrorIdMetadata; projection_repair_pending: INiceErrorIdMetadata; valid_lease_rate_limited: INiceErrorIdMetadata; }; }>; //#endregion //#region src/error/merr_connect_client.d.ts declare enum EErr_ConnectClient { runtime_unspecified = "runtime_unspecified" } declare const merr_connect_client: NiceErrorDomain<{ domain: string; allDomains: [string, "merr_meteor_connect"]; schema: { runtime_unspecified: { message: string; }; }; }>; //#endregion //#region src/error/merr_meteor_connect.d.ts declare enum EErr_MeteorConnect { dur_obj_state_load_failed = "dur_obj_state_load_failed", dur_obj_state_persist_failed = "dur_obj_state_persist_failed", dur_obj_bad_state = "dur_obj_bad_state" } declare const merr_meteor_connect: NiceErrorDomain<{ domain: "merr_meteor_connect"; allDomains: ["merr_meteor_connect"]; schema: { readonly dur_obj_state_load_failed: INiceErrorIdMetadata; readonly dur_obj_state_persist_failed: INiceErrorIdMetadata; readonly dur_obj_bad_state: INiceErrorIdMetadata; }; }>; //#endregion //#region src/error/merr_new_key_account_transfer.d.ts declare enum EErr_NewKeyAccountTransfer { wallet_declined = "wallet_declined", client_transfer_id_conflict = "client_transfer_id_conflict" } declare const merr_new_key_account_transfer: NiceErrorDomain<{ domain: string; allDomains: [string, "merr_meteor_connect"]; schema: { wallet_declined: INiceErrorIdMetadata; client_transfer_id_conflict: INiceErrorIdMetadata; }; }>; //#endregion //#region src/error/merr_partner_client.d.ts declare enum EErr_PartnerClient { partner_not_found = "partner_not_found", partner_invalid_signature = "partner_invalid_signature", partner_no_verify_key_found = "partner_no_verify_key_found", partner_already_exists = "partner_already_exists" } declare const merr_partner_client: NiceErrorDomain<{ domain: string; allDomains: [string, "merr_meteor_connect"]; schema: { partner_already_exists: INiceErrorIdMetadata; partner_not_found: INiceErrorIdMetadata; partner_invalid_signature: INiceErrorIdMetadata; partner_no_verify_key_found: INiceErrorIdMetadata; }; }>; //#endregion //#region src/error/merr_wallet_client.d.ts declare enum EErr_WalletClient { already_exists = "already_exists", not_found = "not_found", invalid_signature = "invalid_signature", id_mismatch = "id_mismatch", /** The registration proof's issuedAt is outside the freshness window (or unknown version). */ registration_proof_stale = "registration_proof_stale", /** The wallet DO exists but is owned by a different verified identity/app tuple. */ owner_mismatch = "owner_mismatch", /** Operator/circuit control is temporarily refusing NEW wallet allocation. */ allocation_halted = "allocation_halted", link_capacity = "link_capacity", /** An authenticated destructive request is outside its bounded freshness window. */ operation_stale = "operation_stale", /** The same operationId was replayed with different signed contents. */ operation_conflict = "operation_conflict", /** The bounded idempotency-result window is full. */ operation_capacity = "operation_capacity", /** Local deletion has begun but raw storage cleanup has not yet been verified. */ deletion_pending = "deletion_pending" } declare const merr_wallet_client: NiceErrorDomain<{ domain: string; allDomains: [string, "merr_meteor_connect"]; schema: { already_exists: INiceErrorIdMetadata; not_found: INiceErrorIdMetadata; invalid_signature: INiceErrorIdMetadata; id_mismatch: INiceErrorIdMetadata; registration_proof_stale: INiceErrorIdMetadata; owner_mismatch: INiceErrorIdMetadata; allocation_halted: INiceErrorIdMetadata; link_capacity: INiceErrorIdMetadata; operation_stale: INiceErrorIdMetadata; operation_conflict: INiceErrorIdMetadata; operation_capacity: INiceErrorIdMetadata; deletion_pending: INiceErrorIdMetadata; }; }>; //#endregion //#region src/model/core/meteor_core.schema.d.ts declare enum EWalletPlatform { web = "web", mobile = "mobile" } declare enum ERuntimeEnvironment { wallet = "wallet", partner = "partner", mc_backend = "mc_backend", mc_bridge_session = "mc_bridge_session", mc_admin = "mc_admin", impl_near_connect = "impl_near_connect" } declare const vWalletPlatform: v.EnumSchema; declare enum EMeteorAppId { meteor_bridge_test_mobile = "meteor_bridge_test_mobile", meteor_bridge_test_web = "meteor_bridge_test_web", meteor_wallet_web = "meteor_wallet_web", meteor_wallet_web_dev = "meteor_wallet_web_dev", meteor_wallet_mobile = "meteor_wallet_mobile", meteor_wallet_mobile_dev = "meteor_wallet_mobile_dev" } declare const META_METEOR_APP: { [key in EMeteorAppId]: TWalletMetaData; }; declare const vMeteorAppId: v.EnumSchema; declare const vMeteorAppIds: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate Meteor app id">]>; /** Canonical Cloudflare Durable Object id; validate before `idFromString()`/namespace lookup. */ declare const vDurableObjectId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; /** Random account/link/operation incarnation generated with `crypto.randomUUID()`. */ declare const vIncarnationId: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; declare const vWalletMetaData: v.ObjectSchema<{ readonly appId: v.EnumSchema; readonly walletName: v.StringSchema; readonly walletDescription: v.StringSchema; readonly platform: v.EnumSchema; }, undefined>; declare enum EPartnerOrigin { web_url = "web_url" } type TWalletMetaData = v.InferInput; declare enum EBridgeLinkType { web_app_url = "web_app_url", app_deep_link = "app_deep_link" } declare const vMeteorBridgeWalletLink: v.ObjectSchema<{ readonly linkString: v.StringSchema; readonly linkType: v.EnumSchema; }, undefined>; type TMeteorBridgeWalletLink = v.InferInput; declare const vMeteorBridgeWalletLinkWithMeta: v.IntersectSchema<[v.ObjectSchema<{ readonly appId: v.EnumSchema; readonly walletName: v.StringSchema; readonly walletDescription: v.StringSchema; readonly platform: v.EnumSchema; }, undefined>, v.ObjectSchema<{ readonly linkString: v.StringSchema; readonly linkType: v.EnumSchema; }, undefined>], undefined>; type TMeteorBridgeWalletLinkWithMeta = v.InferInput; declare const vClientSourceId_Wallet: v.SchemaWithPipe | undefined>]>; declare const vClientSourceId_Partner: v.SchemaWithPipe | undefined>]>; declare const vClientSourceId_Any: v.SchemaWithPipe | undefined>]>; type TClientSourceId_Wallet = v.InferInput; type TClientSourceId_Partner = v.InferInput; type TClientSourceId_Any = v.InferInput; /** * The canonical `::` client source id, used as the opaque key for a * {@link ClientCryptoKeyLink} linked client. Uses the shared `nice-code/util` `TTypeAndId` (`::`) * convention so the link's keys are typed without any local fork or casting. */ declare const buildClientSourceId: (runtimeEnvironment: ERuntimeEnvironment, id: string) => TTypeAndId; interface IVerifiedClientState { isValid: true; state: S; /** * The verify key the client REGISTERED with (the DO-authoritative identity, never * caller-supplied). Returned here so one verified read answers everything a bridge transition * needs — the separate `getVerifyPublicKey()` round trip is gone (Phase 8c RPC budget). */ verifyPublicKey: TSerializedCryptoKeyData_Ed25519_Raw$1; } //#endregion //#region src/model/core/wallet_protocol.schema.d.ts /** * Protocol 3 requires wallet-owned first-link confirmation and action-scoped fresh PIN. Capabilities below describe only * genuinely optional action families; mandatory bridge behavior is versioned here instead of * being advertised piecemeal. */ declare const METEOR_WALLET_PROTOCOL_VERSION = 3; declare enum EWalletProtocolCapability { transfer_accounts_v1 = "transfer_accounts_v1", new_key_account_transfer_v1 = "new_key_account_transfer_v1", session_demo_review_v1 = "session_demo_review_v1" } /** Mandatory bridge behavior is represented by protocol version 3, not capability flags. */ declare const REQUIRED_METEOR_WALLET_CAPABILITIES: readonly []; declare const vWalletProtocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; declare const vWalletProtocolCapability: v.EnumSchema; declare const vWalletProtocolCapabilities: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate capability">, v.TransformAction[], v.EnumValues[]>]>; declare const hasRequiredWalletCapabilities: (walletProtocolVersion: number, walletCapabilities: EWalletProtocolCapability[], requiredWalletProtocolVersion: number, requiredWalletCapabilities: EWalletProtocolCapability[]) => boolean; //#endregion //#region src/model/crypto/crypto.schema.d.ts declare enum ECryptoKeyAlgo { ed25519 = "ed25519", x25519 = "x25519" } declare enum ECryptoKeyFormat { raw_base64 = "raw_base64", jwk = "jwk" } declare const vSerializedCryptoKeyDataEd25519_Raw: v.SchemaWithPipe | undefined>]>; declare const vSerializedCryptoKeyDataEd25519_Jwk: v.SchemaWithPipe | undefined>]>; type TSerializedCryptoKeyData_Ed25519_Raw = v.InferInput; type TSerializedCryptoKeyData_Ed25519_Raw_Transformed = { formattedString: `${ECryptoKeyAlgo.ed25519}::${ECryptoKeyFormat.raw_base64}::${string}`; type: ECryptoKeyAlgo.ed25519; format: ECryptoKeyFormat.raw_base64; data: string; }; type TSerializedCryptoKeyData_Ed25519_Jwk = v.InferInput; type TSerializedCryptoKeyData_Ed25519_Jwk_Transformed = { formattedString: `${ECryptoKeyAlgo.ed25519}::${ECryptoKeyFormat.jwk}::${string}`; type: ECryptoKeyAlgo.ed25519; format: ECryptoKeyFormat.jwk; data: JsonWebKey; }; declare const vSerializedCryptoKeyDataX25519_Raw: v.SchemaWithPipe | undefined>]>; declare const vSerializedCryptoKeyDataX25519_Jwk: v.SchemaWithPipe | undefined>]>; declare const vCryptoKeyPairDataX25519: v.ObjectSchema<{ readonly publicKey: v.SchemaWithPipe | undefined>]>; readonly privateKey: v.SchemaWithPipe | undefined>]>; }, undefined>; type TSerializedCryptoKeyPairDataX25519 = v.InferInput; declare const vCryptoKeyPairDataEd25519: v.ObjectSchema<{ readonly publicKey: v.SchemaWithPipe | undefined>]>; readonly privateKey: v.SchemaWithPipe | undefined>]>; }, undefined>; type TSerializedCryptoKeyPairDataEd25519 = v.InferInput; type TSerializedCryptoKeyData_X25519_Raw = v.InferInput; type TSerializedCryptoKeyData_X25519_Raw_Transformed = { formattedString: `${ECryptoKeyAlgo.x25519}::${ECryptoKeyFormat.raw_base64}::${string}`; type: ECryptoKeyAlgo.x25519; format: ECryptoKeyFormat.raw_base64; data: string; }; type TSerializedCryptoKeyData_X25519_Jwk = v.InferInput; type TSerializedCryptoKeyData_X25519_Jwk_Transformed = { formattedString: `${ECryptoKeyAlgo.x25519}::${ECryptoKeyFormat.jwk}::${string}`; type: ECryptoKeyAlgo.x25519; format: ECryptoKeyFormat.jwk; data: JsonWebKey; }; declare const vEncryptedAesGcmPayload: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; type TEncryptedAesGcmPayload = v.InferInput; type TEncryptedAesGcmPayload_Transformed = v.InferOutput; interface ISerializedKeyData { transformed: T; prefixed: P; } interface ISerializedKeyData_Ed25519_Raw extends ISerializedKeyData {} interface ISerializedKeyData_Ed25519_Jwk extends ISerializedKeyData {} interface ISerializedKeyData_X25519_Raw extends ISerializedKeyData {} interface ISerializedKeyData_X25519_Jwk extends ISerializedKeyData {} type TSerializedKeyData = ISerializedKeyData_Ed25519_Raw | ISerializedKeyData_Ed25519_Jwk | ISerializedKeyData_X25519_Raw | ISerializedKeyData_X25519_Jwk; //#endregion //#region src/model/durable_object/bridge/bridge.schema.d.ts /** Canonical Cloudflare Durable Object id, as a raw pattern for non-valibot call sites. */ declare const CANONICAL_DURABLE_OBJECT_ID_PATTERN: RegExp; declare const isCanonicalDurableObjectId: (value: string) => boolean; /** * Opaque backend-signed routing capability for a session Durable Object. * * The lower bound is the exact length of a `v2` lease (71 characters, see `bridge_lease_codec.ts`). * It used to be 80 — sized for the `v1` JSON layout — which would have rejected every `v2` lease on * the push and claim paths, one file away from where anyone changing the lease would be looking. */ declare const BRIDGE_LEASE_MAX_LENGTH = 512; declare const vBridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; type TBridgeLease = v.InferInput; /** Persisted behavior discriminator for the session-only resource model. */ declare const RESOURCE_BEHAVIOR_VERSION: "resource-v2-session"; declare const RESOURCE_COHORT_BUCKET_COUNT = 10000; declare const vResourceBehaviorVersion: v.LiteralSchema<"resource-v2-session", undefined>; declare const vResourceCohort: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>; declare function resourceCohortForBridgeId(bridgeId: string): number; /** Partner identity and E2E material retained by a session. */ declare const vSessionPartnerData: v.StrictObjectSchema<{ readonly metadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly verifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly exchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly saltHash: v.CustomSchema | undefined>; }, undefined>; type TSessionPartnerData = v.InferOutput; /** Partner material supplied while allocating a session. */ declare const vSessionCreatePartnerData: v.StrictObjectSchema<{ readonly saltAndExchangePublicKeySignature: v.CustomSchema | undefined>; readonly metadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly verifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly exchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly saltHash: v.CustomSchema | undefined>; }, undefined>; type TSessionCreatePartnerData = v.InferInput; type TSessionCreatePartnerDataTransformed = v.InferOutput; declare const vSessionCreationProof: v.StrictObjectSchema<{ readonly version: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; type TSessionCreationProofInput = v.InferInput; declare const vSessionWalletClaimOutputData: v.StrictObjectSchema<{ readonly pinCodeEncrypted: v.OptionalSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>, undefined>; readonly bridgeSaltEncrypted: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; readonly partnerIdEncrypted: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; readonly bridgeExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partner: Omit, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly verifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly exchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly saltHash: v.CustomSchema | undefined>; }, undefined>, "~types" | "~run" | "~standard" | "entries"> & { readonly entries: Omit<{ readonly metadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly verifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly exchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly saltHash: v.CustomSchema | undefined>; }, "saltHash">; readonly "~standard": v.StandardProps<{ metadata: { name: string; origin: `web_url::${string}`; description?: string | undefined; iconUrl?: string | undefined; }; verifyPublicKey: `ed25519::raw_base64::${string}`; exchangePublicKey: `x25519::raw_base64::${string}`; }, { metadata: { name: string; origin: `web_url::${string}`; description?: string | undefined; iconUrl?: string | undefined; }; verifyPublicKey: `ed25519::raw_base64::${string}`; exchangePublicKey: `x25519::raw_base64::${string}`; }>; readonly "~run": (dataset: v.UnknownDataset, config: v.Config>) => v.OutputDataset<{ metadata: { name: string; origin: `web_url::${string}`; description?: string | undefined; iconUrl?: string | undefined; }; verifyPublicKey: `ed25519::raw_base64::${string}`; exchangePublicKey: `x25519::raw_base64::${string}`; }, v.CustomIssue | v.StringIssue | v.RegexIssue | v.ObjectIssue | v.MinLengthIssue | v.MaxLengthIssue | v.MaxLengthIssue<`web_url::${string}`, 2100> | v.MaxLengthIssue | v.MaxLengthIssue | v.StartsWithIssue | v.StrictObjectIssue>; readonly "~types"?: { readonly input: { metadata: { name: string; origin: `web_url::${string}`; description?: string | undefined; iconUrl?: string | undefined; }; verifyPublicKey: `ed25519::raw_base64::${string}`; exchangePublicKey: `x25519::raw_base64::${string}`; }; readonly output: { metadata: { name: string; origin: `web_url::${string}`; description?: string | undefined; iconUrl?: string | undefined; }; verifyPublicKey: `ed25519::raw_base64::${string}`; exchangePublicKey: `x25519::raw_base64::${string}`; }; readonly issue: v.CustomIssue | v.StringIssue | v.RegexIssue | v.ObjectIssue | v.MinLengthIssue | v.MaxLengthIssue | v.MaxLengthIssue<`web_url::${string}`, 2100> | v.MaxLengthIssue | v.MaxLengthIssue | v.StartsWithIssue | v.StrictObjectIssue; } | undefined; }; }, undefined>; type TSessionWalletClaimOutputData = v.InferInput; declare const vSessionWalletClaim: v.StrictObjectSchema<{ readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly linkIncarnation: v.OptionalSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly appExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly meteorAppId: v.EnumSchema; readonly connectedAt: v.NumberSchema; readonly pinCode: v.OptionalSchema, undefined>; readonly pinCodeVerified: v.OptionalSchema, undefined>; readonly linkProgress: v.OptionalSchema, undefined>; readonly pinCodeAttempts: v.OptionalSchema, undefined>; readonly pinCodeVerifiedAt: v.OptionalSchema, undefined>; readonly lastPinCodeAttemptAt: v.OptionalSchema, undefined>; readonly walletProtocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; readonly walletCapabilities: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate capability">, v.TransformAction[], v.EnumValues[]>]>; readonly actionRequestEncryptedForWallet: v.OptionalSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>, undefined>; readonly appClaimOutputData: v.CustomSchema<{ pinCodeEncrypted?: { nonce: string; ciphertext: string; } | undefined; bridgeSaltEncrypted: { nonce: string; ciphertext: string; }; partnerIdEncrypted: { nonce: string; ciphertext: string; }; bridgeExchangePublicKey: `x25519::raw_base64::${string}`; partner: { metadata: { name: string; origin: `web_url::${string}`; description?: string | undefined; iconUrl?: string | undefined; }; verifyPublicKey: `ed25519::raw_base64::${string}`; exchangePublicKey: `x25519::raw_base64::${string}`; }; }, v.ErrorMessage | undefined>; }, undefined>; type TSessionWalletClaim = v.InferInput; declare enum ESessionNotifyWalletReason { link_not_found = "link_not_found", not_trusted = "not_trusted", no_token = "no_token", send_failed = "send_failed", capability_missing = "capability_missing", /** * The backend deployment has wallet push delivery switched off (`WALLET_PUSH_DELIVERY`), so no * push was attempted. Expected/informational: live-session delivery is unaffected and the * session link/QR remains the way to (re)open the wallet. */ push_disabled = "push_disabled" } declare const vActionPayloadJsonObject: v.CustomSchema, string>, undefined>; //#endregion //#region src/model/durable_object/bridge/session/session.schema.d.ts /** * Shared contracts for the session-only bridge protocol. * * Every schema at a durable or client boundary is `v.strictObject` (D20/§8.1): unknown persisted or * wire fields fail closed instead of being silently stripped or carried. */ declare enum EBridgeInteractionMode { /** One claimed bridge carrying a bounded sequence of action turns. */ session_v1 = "session_v1" } declare const vBridgeInteractionMode: v.EnumSchema; declare enum ESessionPhase { /** Private allocation: initial action validated but not yet bridge-bound/staged; unclaimable. */ initializing = "initializing", waiting_for_wallet = "waiting_for_wallet", wallet_verification = "wallet_verification", wallet_confirmation = "wallet_confirmation", wallet_action = "wallet_action", result_ready = "result_ready", ready = "ready", external_work = "external_work", closed = "closed", failed = "failed" } declare const vSessionPhase: v.EnumSchema; /** The partner's claim-time authorization policy, bound by the creation proof. */ declare enum ESessionAuthorizationMode { /** First contact requires wallet consent; an exact live link skips repeated consent. */ partner_link = "partner_link", /** Always run a new PIN ceremony, even when this wallet/partner pair is already trusted. */ fresh_pin = "fresh_pin" } declare const vSessionAuthorizationMode: v.EnumSchema; /** * Authorization is selected once at claim and never stepped up in-session (amended D4). A fresh * PIN is stronger than a trusted link; a trusted-link session therefore rejects any later turn * whose server-owned action policy requires `fresh_pin`. */ declare enum ESessionAuthorizationLevel { trusted_link = "trusted_link", fresh_pin = "fresh_pin" } declare const vSessionAuthorizationLevel: v.EnumSchema; /** Immutable server-approved authority/resource envelopes (D35). */ declare enum ESessionResourceProfile { single_turn_v1 = "single_turn_v1", interactive_v1 = "interactive_v1", external_work_v1 = "external_work_v1" } declare const vSessionResourceProfile: v.EnumSchema; declare const SESSION_MAX_TURNS = 8; /** Idle/progress window: extended only by successful state-changing transitions (plan §7.2). */ declare const SESSION_IDLE_WINDOW_MILLIS = 300000; /** Non-renewable absolute session lifetime; embedded in the routing lease (D11/D18). */ declare const SESSION_MAX_ABSOLUTE_LIFETIME_MILLIS = 1800000; /** Largest immutable reconnect budget exposed by any V1 resource profile. */ declare const SESSION_MAX_REDIAL_ATTEMPTS = 64; interface ISessionResourceProfilePolicy { maxTurns: number; idleWindowMillis: number; absoluteLifetimeMillis: number; maxRedialAttempts: number; externalWorkHoldAllowed: boolean; } /** * Frozen D35 profile limits. Increasing any value is a protocol/authority review; deployment * bindings independently cap the idle and absolute dimensions. */ declare const SESSION_RESOURCE_PROFILE_POLICIES: { readonly single_turn_v1: { readonly maxTurns: 1; readonly idleWindowMillis: 300000; readonly absoluteLifetimeMillis: 300000; readonly maxRedialAttempts: 24; readonly externalWorkHoldAllowed: false; }; readonly interactive_v1: { readonly maxTurns: 8; readonly idleWindowMillis: 300000; readonly absoluteLifetimeMillis: 600000; readonly maxRedialAttempts: 32; readonly externalWorkHoldAllowed: false; }; readonly external_work_v1: { readonly maxTurns: 8; readonly idleWindowMillis: 300000; readonly absoluteLifetimeMillis: 1800000; readonly maxRedialAttempts: 64; readonly externalWorkHoldAllowed: true; }; }; declare const getSessionResourceProfilePolicy: (profile: ESessionResourceProfile) => ISessionResourceProfilePolicy; /** Canonical-JSON cap for a wallet action result — the result-side sibling of the request cap. */ declare const MAX_SESSION_RESULT_CANONICAL_JSON_LENGTH = 400000; /** * Serialized operation frames above this must use the authenticated HTTP bridge lane; the inbound * WebSocket frame cap is 131,072 bytes and the margin covers envelope/framing overhead. */ declare const MAX_SESSION_WS_OPERATION_BYTES = 100000; /** Signature freshness for a NEW operation's `issuedAt` (mirrors the creation-proof policy). */ declare const SESSION_OPERATION_MAX_AGE_MILLIS = 120000; declare const SESSION_OPERATION_MAX_FUTURE_SKEW_MILLIS = 30000; declare const vSessionTurnSequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; declare const vSessionTurnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; declare const vSessionOperationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; declare const vSessionNotificationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; declare const vSessionIssuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; /** * Bounded monotonic commit counter for the session record (§9.1). Not an analytics dimension and * never caller-controlled; projected to the realm as a synchronization fence. */ declare const vSessionStateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; declare const vSessionRequestPayload: v.CustomSchema, string>, undefined>; declare const vSessionResultPayload: v.CustomSchema, string>, undefined>; declare const SESSION_ENVELOPE_FORMAT_VERSION = 1; /** * Purpose tag prepended to the plaintext before the DO encrypts a sensitive turn's complete signed * envelope to the claiming wallet (the multi sibling of `ACTION_REQUEST_ENVELOPE_PURPOSE_TAG` — * same derived AES key family, so the tag pins which ciphertext this is). The tagged plaintext is * `JSON.stringify({ envelope, partnerTurnSignatureBase64 })`. */ declare const SESSION_TURN_ENVELOPE_PURPOSE_TAG = "session_turn::"; /** * The partner-authored request envelope for one turn. `requestHash` is the canonical hash of the * backend-validated request (normalization-stability contract, §5.4), computed with * `nice-code/util`'s serializer — never the unsupported one (§8.4). `priorResultHash` binds the * acknowledged previous result for sequence ≥ 2 and is explicitly `null` at sequence 1 (D6). */ declare const vSessionRequestEnvelopeV1: v.StrictObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly interactionMode: v.LiteralSchema; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly recoveryContractHash: v.CustomSchema | undefined>; readonly requestHash: v.CustomSchema | undefined>; readonly priorResultHash: v.NullableSchema | undefined>, undefined>; readonly actionRequest: v.CustomSchema, string>, undefined>; }, undefined>; type TSessionRequestEnvelopeV1 = v.InferOutput; /** * The wallet-authored result envelope for one turn: signed as plaintext with the fixed wallet * identity, then encrypted for the fixed partner link (§5.5). The bridge never sees this plaintext. */ declare const vSessionResultEnvelopeV1: v.StrictObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly interactionMode: v.LiteralSchema; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly requestHash: v.CustomSchema | undefined>; readonly resultHash: v.CustomSchema | undefined>; readonly actionResult: v.CustomSchema, string>, undefined>; }, undefined>; type TSessionResultEnvelopeV1 = v.InferOutput; /** * The session policy the session creation proof binds through `sessionPolicyHash`: the frozen * operational limits plus the partner's wallet requirements. Built only through * {@link buildSessionPolicyV1} so the capability list is canonically ordered and the * limits can never drift from the frozen constants; hashed with the library serializer (§8.4 — * every `session_v1` hash uses `nice-code/util`, never the unsupported serializer). */ interface ISessionPolicyV1 { formatVersion: 1; interactionMode: EBridgeInteractionMode.session_v1; authorizationMode: ESessionAuthorizationMode; resourceProfile: ESessionResourceProfile; maxTurns: number; maxRedialAttempts: number; idleWindowMillis: number; absoluteLifetimeMillis: number; requiredWalletProtocolVersion: number; requiredWalletCapabilities: string[]; } declare const buildSessionPolicyV1: (requirements: { authorizationMode: ESessionAuthorizationMode; resourceProfile: ESessionResourceProfile; requiredWalletProtocolVersion: number; requiredWalletCapabilities: readonly EWalletProtocolCapability[]; }) => ISessionPolicyV1; declare const hashSessionPolicyV1: (policy: ISessionPolicyV1) => string; //#endregion //#region src/model/durable_object/bridge/session/session_api.schema.d.ts /** * Operation input/output contracts for the `session_v1` API surface (§9.2 of * `PLAN-multiple-actions-bridge.md`; challenge construction in `session_challenges.ts`). * Every schema is `v.strictObject`: these are signed contracts, so an unknown field is either * unsigned data (reject) or a version drift (fail closed and surface the typed update path) — * never something to silently strip or carry (D20/§8.1). * Shared component schemas keep the crypto material consistent across allocation and claim. */ /** * The authoritative session facts most steady-state operations return, and the metadata half of * the realm projection. Deadlines are absolute epoch ms; `sequence` is `null` before staging and * in `ready`/terminal phases. */ declare const vSessionFacts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; type TSessionFacts = v.InferOutput; /** * * [CREATE SESSION BRIDGE] — allocation half of D26's two-phase creation. The creation proof is * the canonical `meteor-connect-session-create-proof-v1` challenge, * binding mode, session policy hash, validated-initial-action hash, and recovery-contract hash. No wallet * links are returned here: they come from staging (D3 — nothing claimable/shareable exists yet). * */ declare const vSession_Create_Input: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly authorizationMode: v.EnumSchema; readonly resourceProfile: v.EnumSchema; readonly partnerRequestId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly initialActionRequest: v.CustomSchema, string>, undefined>; readonly recoveryContractHash: v.CustomSchema | undefined>; readonly partner: v.StrictObjectSchema<{ readonly saltAndExchangePublicKeySignature: v.CustomSchema | undefined>; readonly metadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly verifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly exchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly saltHash: v.CustomSchema | undefined>; }, undefined>; readonly meteorAppIds: v.OptionalSchema, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate Meteor app id">]>, undefined>; readonly clientConnectionInfo: v.OptionalSchema; readonly walletExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly walletProtocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; readonly walletCapabilities: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate capability">, v.TransformAction[], v.EnumValues[]>]>; }, undefined>, undefined>; readonly requiredWalletProtocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>, v.MinValueAction]>; readonly requiredWalletCapabilities: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate capability">, v.TransformAction[], v.EnumValues[]>]>, v.MaxLengthAction[], 32, undefined>]>; readonly creationProof: v.StrictObjectSchema<{ readonly version: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; }, undefined>; declare const vSession_Create_Output: v.StrictObjectSchema<{ readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeSaltEncrypted: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; readonly bridgeExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; }, undefined>; type TSession_Create_Input = v.InferInput; type TSession_Create_Input_Transformed = v.InferOutput; type TSession_Create_Output = v.InferOutput; /** * * [STAGE INITIAL ACTION] — staging half of D26. Exact-retryable; conflicting re-stage fails * closed. Wallet links become available only in this output. * */ declare const vSession_StageInitialAction_Input: v.StrictObjectSchema<{ readonly envelope: v.StrictObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly interactionMode: v.LiteralSchema; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly recoveryContractHash: v.CustomSchema | undefined>; readonly requestHash: v.CustomSchema | undefined>; readonly priorResultHash: v.NullableSchema | undefined>, undefined>; readonly actionRequest: v.CustomSchema, string>, undefined>; }, undefined>; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; declare const vSession_StageInitialAction_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; readonly walletLinks: v.SchemaWithPipe; readonly walletName: v.StringSchema; readonly walletDescription: v.StringSchema; readonly platform: v.EnumSchema; }, undefined>, v.ObjectSchema<{ readonly linkString: v.StringSchema; readonly linkType: v.EnumSchema; }, undefined>], undefined>, undefined>, v.MaxLengthAction<({ appId: EMeteorAppId; walletName: string; walletDescription: string; platform: EWalletPlatform; } & { linkString: string; linkType: EBridgeLinkType; })[], 16, undefined>]>; }, undefined>; type TSession_StageInitialAction_Input = v.InferInput; type TSession_StageInitialAction_Output = v.InferOutput; /** * * [CLAIM / VERIFY PIN] — same mechanics and strength as the unsupported pair (§9.3), with two * deliberate differences: the claim response NEVER carries the action (delivery is * post-authorization only), and the output confirms the mode so an older wallet fails typed * rather than misreading session state. * */ declare const vSession_ClientClaim_Input: v.StrictObjectSchema<{ readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly interactionMode: v.LiteralSchema; readonly partnerSaltHash: v.CustomSchema | undefined>; readonly hashSignatureBase64: v.CustomSchema | undefined>; readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly exchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly walletProtocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; readonly walletCapabilities: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate capability">, v.TransformAction[], v.EnumValues[]>]>; }, undefined>; declare const vSession_ClientClaim_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; readonly clientData: v.StrictObjectSchema<{ /** Null exactly when the claim selected the trusted-link fast path. */ readonly pinCodeEncrypted: v.NullableSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>, undefined>; readonly linkConfirmation: v.OptionalSchema; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly walletExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly partnerVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerMetadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly requestHash: v.CustomSchema | undefined>; readonly authorizationMode: v.LiteralSchema<"partner_link", undefined>; readonly rememberPartner: v.LiteralSchema; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly expiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; }, undefined>, undefined>; readonly bridgeSaltEncrypted: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; readonly partnerIdEncrypted: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; readonly bridgeExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partner: v.StrictObjectSchema<{ readonly metadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly verifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly exchangePublicKey: v.SchemaWithPipe | undefined>]>; }, undefined>; }, undefined>; }, undefined>; type TSession_ClientClaim_Input = v.InferInput; type TSession_ClientClaim_Output = v.InferOutput; declare const vSession_VerifyPin_Input: v.StrictObjectSchema<{ readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly encryptedPinCode: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; readonly pinCodeSignatureBase64: v.CustomSchema | undefined>; }, undefined>; declare const vSession_VerifyPin_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; readonly clientConnection: v.ObjectSchema<{ readonly meteorAppId: v.EnumSchema; readonly walletExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly walletProtocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; readonly walletCapabilities: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate capability">, v.TransformAction[], v.EnumValues[]>]>; }, undefined>; }, undefined>; type TSession_VerifyPin_Input = v.InferInput; type TSession_VerifyPin_Output = v.InferOutput; /** * * [SUBMIT / COMPLETE / ACK / ADVANCE] * */ declare const vSession_SubmitAction_Input: v.StrictObjectSchema<{ readonly envelope: v.StrictObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly interactionMode: v.LiteralSchema; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly recoveryContractHash: v.CustomSchema | undefined>; readonly requestHash: v.CustomSchema | undefined>; readonly priorResultHash: v.NullableSchema | undefined>, undefined>; readonly actionRequest: v.CustomSchema, string>, undefined>; }, undefined>; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; declare const vSession_SubmitAction_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; }, undefined>; type TSession_SubmitAction_Input = v.InferInput; type TSession_SubmitAction_Output = v.InferOutput; /** * The DO verifies the wallet's bridge-authorization challenge (which covers the ciphertext nonce * and hash it recomputes from `resultEnvelopeEncrypted`) without ever decrypting the result. */ declare const vSession_Complete_Input: v.StrictObjectSchema<{ readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly requestHash: v.CustomSchema | undefined>; readonly resultHash: v.CustomSchema | undefined>; readonly resultEnvelopeEncrypted: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; /** Wallet E2E signature over the plaintext result-envelope challenge; relayed to the partner. */ readonly resultEnvelopeSignatureBase64: v.CustomSchema | undefined>; /** Wallet-to-bridge authorization over the ciphertext identity and E2E signature. */ readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; declare const vSession_Complete_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; }, undefined>; type TSession_Complete_Input = v.InferInput; type TSession_Complete_Output = v.InferOutput; declare const vSession_AcknowledgeResult_Input: v.StrictObjectSchema<{ readonly signatureBase64: v.CustomSchema | undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly requestHash: v.CustomSchema | undefined>; readonly resultHash: v.CustomSchema | undefined>; }, undefined>; declare const vSession_AcknowledgeResult_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; }, undefined>; type TSession_AcknowledgeResult_Input = v.InferInput; type TSession_AcknowledgeResult_Output = v.InferOutput; /** * Host attestation that the exact result is durably journaled before the bridge releases its * retained relay and grants the one bounded external-work hold. */ declare const vSession_AcknowledgeAndBeginExternalWork_Input: v.StrictObjectSchema<{ readonly resourceProfile: v.LiteralSchema; readonly journaledResultHash: v.CustomSchema | undefined>; readonly signatureBase64: v.CustomSchema | undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly requestHash: v.CustomSchema | undefined>; readonly resultHash: v.CustomSchema | undefined>; }, undefined>; declare const vSession_AcknowledgeAndBeginExternalWork_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; }, undefined>; type TSession_AcknowledgeAndBeginExternalWork_Input = v.InferInput; type TSession_AcknowledgeAndBeginExternalWork_Output = v.InferOutput; /** * Atomic ack + next-turn install (§5.6). `advanceSignatureBase64` signs the single advance * challenge over both halves; `nextEnvelopeSignatureBase64` is the stage/submit-style per-turn * signature stored with the installed turn so the wallet can verify it independently (§5.4). */ declare const vSession_AdvanceAction_Input: v.StrictObjectSchema<{ readonly advanceSignatureBase64: v.CustomSchema | undefined>; readonly nextEnvelope: v.StrictObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly interactionMode: v.LiteralSchema; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly recoveryContractHash: v.CustomSchema | undefined>; readonly requestHash: v.CustomSchema | undefined>; readonly priorResultHash: v.NullableSchema | undefined>, undefined>; readonly actionRequest: v.CustomSchema, string>, undefined>; }, undefined>; readonly nextEnvelopeSignatureBase64: v.CustomSchema | undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly requestHash: v.CustomSchema | undefined>; readonly resultHash: v.CustomSchema | undefined>; }, undefined>; declare const vSession_AdvanceAction_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; }, undefined>; type TSession_AdvanceAction_Input = v.InferInput; type TSession_AdvanceAction_Output = v.InferOutput; declare const vSession_AcknowledgeAndClose_Input: v.StrictObjectSchema<{ readonly signatureBase64: v.CustomSchema | undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly requestHash: v.CustomSchema | undefined>; readonly resultHash: v.CustomSchema | undefined>; }, undefined>; declare const vSession_AcknowledgeAndClose_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; }, undefined>; type TSession_AcknowledgeAndClose_Input = v.InferInput; type TSession_AcknowledgeAndClose_Output = v.InferOutput; /** * * [CLOSE FAMILY] — the §5.7 role/phase matrix. One shared input shape (mirroring the shared close * challenge layout); the ACTION ID carries the operation intent, and the server enforces the * matrix. Turn members are explicit `null` where the phase has none. * */ declare const vSession_Close_Input: v.StrictObjectSchema<{ readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly role: v.PicklistSchema<["partner", "wallet"], undefined>; readonly phase: v.EnumSchema; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly turnId: v.NullableSchema, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly requestHash: v.NullableSchema | undefined>, undefined>; readonly resultHash: v.NullableSchema | undefined>, undefined>; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; declare const vSession_Close_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; }, undefined>; type TSession_Close_Input = v.InferInput; type TSession_Close_Output = v.InferOutput; /** * * [NOTIFY — INITIAL CLAIM PUSH / PER-TURN WAKE] * */ declare const vSession_NotifyWallet_Input: v.StrictObjectSchema<{ readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly notificationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly sealedSecret: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; declare const vSession_NotifyWallet_Output: v.StrictObjectSchema<{ readonly delivered: v.BooleanSchema; readonly reason: v.OptionalSchema, undefined>; }, undefined>; type TSession_NotifyWallet_Input = v.InferInput; type TSession_NotifyWallet_Output = v.InferOutput; /** D24 per-turn wake: bound to the exact installed turn; never extends deadlines; no plaintext. */ declare const vSession_NotifyWalletTurn_Input: v.StrictObjectSchema<{ readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly requestHash: v.CustomSchema | undefined>; readonly notificationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly sealedReentry: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; declare const vSession_NotifyWalletTurn_Output: v.StrictObjectSchema<{ readonly delivered: v.BooleanSchema; readonly reason: v.OptionalSchema, undefined>; }, undefined>; type TSession_NotifyWalletTurn_Input = v.InferInput; type TSession_NotifyWalletTurn_Output = v.InferOutput; declare const vSession_ConfirmLink_Input: v.StrictObjectSchema<{ readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly receipt: v.StrictObjectSchema<{ readonly confirmation: v.StrictObjectSchema<{ readonly version: v.LiteralSchema<1, undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly walletExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly partnerVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerMetadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly requestHash: v.CustomSchema | undefined>; readonly authorizationMode: v.LiteralSchema<"partner_link", undefined>; readonly rememberPartner: v.LiteralSchema; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly expiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; }, undefined>; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; }, undefined>; type TSession_ConfirmLink_Input = v.InferOutput; declare const vSession_ConfirmLink_Output: v.StrictObjectSchema<{ readonly facts: v.StrictObjectSchema<{ readonly interactionMode: v.LiteralSchema; readonly resourceProfile: v.EnumSchema; readonly maxTurns: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly maxRedialAttempts: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly authorizationMode: v.EnumSchema; readonly authorizationLevel: v.NullableSchema, undefined>; readonly authorizationLinkIncarnation: v.NullableSchema, v.UuidAction, v.RegexAction]>, undefined>; readonly phase: v.EnumSchema; readonly stateRevision: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly sequence: v.NullableSchema, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>, undefined>; readonly idleExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly absoluteExpiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly closeAfterTurn: v.BooleanSchema; readonly closeAfterResultAck: v.BooleanSchema; readonly externalWorkHoldConsumed: v.BooleanSchema; }, undefined>; }, undefined>; //#endregion //#region src/model/durable_object/bridge/session/session_link.schema.d.ts /** * Versioned link/push payload contracts for `session_v1` (plan §8.1): the QR/app-link query, * the initial claim push payload, and the D24 per-turn wake payload. In every case the carried * mode/format is ADVISORY routing data, never authorization — the wallet claims over the HTTP lane * first and trusts only the authenticated response's mode confirmation (§9.4); a mode mismatch * between link and backend fails closed. */ /** * Link format markers. * * `s2` is the only format the backend BUILDS. It exists because `s1` was 409 characters — a 93×93 * QR grid that users could not scan at arm's length — and `s2` is 147: no second copy of the bridge * id (it is an authenticated claim inside the lease), no advisory `interactionMode`, no inert * `protocolVersion`, single-character parameter names, and a 71-character `v2` lease. * * `s1` is still PARSED, and only that. A link minted seconds before the backend deploys has to stay * claimable by the wallet that scans it a minute later; nothing builds one. See * `PLAN-session-link-length.md` §6 for when this branch goes. * * Both markers are strict literals in strict objects, so an unknown marker — an `s3` from a newer * backend, or a mangled QR — returns `null` from {@link parseSessionLinkQuery} rather than * half-parsing into something a caller might act on. */ declare const SESSION_LINK_FORMAT_V1 = "s1"; declare const SESSION_LINK_FORMAT_V2 = "s2"; /** * Wire keys. Readability lives in the parser and its types, not on the wire — every character here * is a QR module, and the `s2` link sits 7 bytes under QR version 7's level-L capacity (154 bytes), * so anything added back to it costs the user a 49×49 grid. */ declare const SESSION_LINK_QUERY_KEY_FORMAT_V2 = "f"; declare const SESSION_LINK_QUERY_KEY_LEASE_V2 = "l"; /** Fragment key carrying the partner secret. Fragments never reach a server; that is why it is one. */ declare const SESSION_LINK_FRAGMENT_KEY_SECRET_V2 = "s"; declare const SESSION_LINK_FRAGMENT_KEY_SECRET_V1 = "partnerSecret"; /** `data.type` marker routing a push into the session claim path. */ declare const PUSH_TYPE_SESSION_CLAIM = "bridge_session_claim"; /** `data.type` marker for the D24 per-turn wake/re-entry handoff. */ declare const PUSH_TYPE_SESSION_TURN_WAKE = "bridge_session_turn_wake"; /** Legacy `s1` payload. Parsed, never built. */ declare const vSessionLinkPayloadV1: v.StrictObjectSchema<{ readonly linkFormat: v.LiteralSchema<"s1", undefined>; readonly interactionMode: v.LiteralSchema; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly protocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; }, undefined>; /** * The `s2` payload: a format marker and a lease, and that is the whole link. * * `bridgeId` is not absent from the protocol, only from the wire — it is recovered from the signed * lease body by {@link readBridgeLeaseV2BridgeId} and validated here exactly as the query copy used * to be. That is why removing the copy is a simplification rather than a weakening: the route * segment was never authorization (it selects a stub before any validation runs, and the DO checks * the signed id against its own identity), so a second, unsigned copy could only ever disagree with * the signed one. `validateBridgeLease`'s `wrong_bridge` check is untouched, and the push payloads * below still carry `bridgeId` alongside the lease because that path still needs it. * * `interactionMode` and `protocolVersion` are gone. The mode was advisory by construction — the * wallet claims over the HTTP lane and trusts only the authenticated response's mode confirmation * (§9.4) — and `s2` pins it one-to-one anyway. `protocolVersion` was written into every link and * read by nothing; the compatibility gate that actually runs is `isWalletProtocolCompatible` * against `session.requiredWalletProtocolVersion`, on the authenticated claim. */ declare const vSessionLinkPayloadV2: v.StrictObjectSchema<{ readonly linkFormat: v.LiteralSchema<"s2", undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>; type TSessionLinkPayloadV1 = v.InferOutput; type TSessionLinkPayloadV2 = v.InferOutput; /** What {@link parseSessionLinkQuery} returns: discriminated on `linkFormat`. */ type TSessionLinkPayload = TSessionLinkPayloadV1 | TSessionLinkPayloadV2; /** * Build the query-string half of a session wallet link. The host/scheme selection stays with the * backend link builder; the partner secret rides the URL fragment appended client-side. * * Written by hand rather than through `URLSearchParams` for two reasons: the parameter order is * part of the length budget and must be deterministic, and base64url needs no percent-encoding, so * there is nothing for an encoder to do except risk doing it differently one day. */ declare const buildSessionLinkQuery: (payload: { bridgeLease: string; }) => string; /** * Build a legacy `s1` query. Nothing in production calls this — it exists so the compatibility * branch of {@link parseSessionLinkQuery} can be exercised by tests until §6 removes both. * * @deprecated `s1` is parse-only; build `s2` with {@link buildSessionLinkQuery}. */ declare const buildSessionLinkQueryV1: (payload: { bridgeId: string; bridgeLease: string; protocolVersion: number; }) => string; /** * Parse a supported link query. Missing, unknown, or invalid format data returns `null` and must be * rejected by the caller — including a lease whose body will not decode, which fails here rather * than surviving into a claim that cannot work. */ declare const parseSessionLinkQuery: (query: string) => TSessionLinkPayload | null; /** * The FCM `data` payload for initial claim delivery (`notify_wallet_session`). All values are * strings on the wire (FCM constraint); `sealedSecret` travels JSON-encoded like the unsupported push. */ declare const vSessionClaimPushPayload: v.StrictObjectSchema<{ readonly type: v.LiteralSchema<"bridge_session_claim", undefined>; readonly notificationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly interactionMode: v.LiteralSchema; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly sealedSecret: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; }, undefined>; type TSessionClaimPushPayload = v.InferOutput; /** * The FCM `data` payload for the D24 per-turn wake. Carries NO action plaintext — only the exact * turn identity for authoritative correlation after re-claim, plus the sealed session re-entry * material. Processing it never extends any deadline; the wallet independently rejects delivery * at/after the authenticated idle deadline (§7.4). */ declare const vSessionTurnWakePushPayload: v.StrictObjectSchema<{ readonly type: v.LiteralSchema<"bridge_session_turn_wake", undefined>; readonly notificationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly interactionMode: v.LiteralSchema; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; /** Advisory lookup key for the wallet's locally persisted partner public keys. */ readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly requestHash: v.CustomSchema | undefined>; readonly sealedReentry: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; }, undefined>; type TSessionTurnWakePushPayload = v.InferOutput; /** What {@link classifySessionPushPayload} made of an untrusted FCM `data` payload. */ type TSessionPushClassification = { kind: "session_claim"; payload: TSessionClaimPushPayload; } | { kind: "session_turn_wake"; payload: TSessionTurnWakePushPayload; } | /** Not a Meteor Connect session push, or not a well-formed one. Ignore it. */ { kind: "unrecognized"; }; /** * Transport-shaped push schemas: FCM `data` values are ALWAYS strings on the wire, and the DO * sends exactly that (`sequence: String(...)`, sealed members `JSON.stringify(...)`-encoded). The * typed payload schemas above describe the DECODED shape; these describe what actually arrives. * The bound on the sealed members rejects oversized garbage before any JSON parse. */ declare const MAX_SESSION_PUSH_SEALED_JSON_LENGTH = 4096; /** * Decode a transport-shaped (string-valued) claim push into the typed payload, or `null`. Also * accepts an already-decoded payload so hosts that persisted one keep working. */ declare const decodeSessionClaimPushData: (data: unknown) => TSessionClaimPushPayload | null; /** * Decode a transport-shaped (string-valued) D24 turn wake into the typed payload, or `null`. Also * accepts an already-decoded payload. */ declare const decodeSessionTurnWakePushData: (data: unknown) => TSessionTurnWakePushPayload | null; /** * Classify an untrusted FCM `data` payload into one of the two session pushes a wallet acts on. * * A wallet receives every push its app is registered for, from a transport it cannot authenticate, * and has to decide which of `claimInitialPush` / `claimTurnWake` to route it to. Doing that by * hand means re-deriving the discriminator and the field shapes in every host — and a host that * gets it slightly wrong either drops real sessions or feeds malformed input to a claim. * * Accepts BOTH the raw transport shape (every value a string, sealed members JSON-encoded — what * FCM actually delivers) and the decoded typed shape, converging on the typed payload * (stabilization XR-1: the original classifier validated only the typed shape, so every real * device push classified as `unrecognized` and was silently dropped). * * Fail-closed by construction: anything that matches neither shape comes back as `unrecognized`. * It validates shape only — the payload stays unauthenticated until the SDK claims against it, * which is where the sealed material is actually verified. */ declare const classifySessionPushPayload: (data: unknown) => TSessionPushClassification; //#endregion //#region src/utils/serialization/canonical_json.d.ts /** * Signing-grade canonical JSON and the hashes/challenges built on it. * * These bytes are a frozen protocol contract: creation proofs, idempotency bindings, deterministic * names and every signed challenge hash them, and already-shipped clients compute the same bytes. * `canonicalJsonFrozenVectors.test.ts` pins them; never change an accepted output. * * Rules (not RFC 8785): * - `null`, booleans, strings and finite numbers use native `JSON.stringify` spelling (`-0` → `0`). * - Objects emit their own enumerable string keys, sorted by UTF-16 code unit (`Array#sort`), * skipping entries whose value is `undefined`. `toJSON` is never called. * - Arrays keep order; a sparse hole emits `null`, an explicit `undefined` element throws. * - Non-finite numbers, bigint, function, symbol, top-level `undefined` and cycles throw. * Repeated non-cyclic references are fine. */ /** A strict JSON value: the input type for anything that gets signed. */ type TCanonicalJsonValue = null | boolean | number | string | readonly TCanonicalJsonValue[] | { readonly [key: string]: TCanonicalJsonValue; }; declare function stringifyCanonicalJson(value: unknown): string; /** SHA-256 of a UTF-8 string or raw bytes, lowercase hex. */ declare const sha256Hex: (input: string | Uint8Array) => string; /** SHA-256 of a UTF-8 string or raw bytes, standard padded base64. */ declare const sha256Base64: (input: string | Uint8Array) => string; declare const hashCanonicalJsonSha256Hex: (value: unknown) => string; declare const hashCanonicalJsonSha256Base64: (value: unknown) => string; /** Standard (RFC 4648 §4, padded) base64; works in browsers, Workers, Node and Hermes. */ declare const bytesToBase64: (bytes: Uint8Array) => string; declare const base64ToBytes: (encoded: string) => Uint8Array; /** * A signing challenge: a domain tag + version namespace the signature, and the fields are encoded * as canonical JSON so boundaries and key order are unambiguous. */ interface ICanonicalChallenge { readonly domainTag: string; readonly version: number; readonly fields: Readonly>; } /** * The exact string a {@link ICanonicalChallenge} signs: * `stringifyCanonicalJson({ domainTag, version, fields })`. Stricter than the serializer: any * value that is not a strict {@link TCanonicalJsonValue} (undefined entries, sparse arrays, * non-plain objects, non-finite numbers) is rejected instead of normalised. */ declare function buildCanonicalChallenge(challenge: ICanonicalChallenge): string; //#endregion //#region src/model/durable_object/bridge/session/session_link_confirmation.d.ts /** Frozen, wallet-only pending consent. No action payload or user secrets belong here. */ declare const vSessionLinkConfirmation: v.StrictObjectSchema<{ readonly version: v.LiteralSchema<1, undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly walletExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly partnerVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerMetadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly requestHash: v.CustomSchema | undefined>; readonly authorizationMode: v.LiteralSchema<"partner_link", undefined>; readonly rememberPartner: v.LiteralSchema; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly expiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; }, undefined>; type TSessionLinkConfirmation = v.InferOutput; /** The lease binds the backend trust domain; the hash covers every displayed/identity field. */ declare const buildSessionLinkConfirmationChallenge: (confirmation: TSessionLinkConfirmation) => ICanonicalChallenge; declare const vSessionLinkConfirmationReceipt: v.StrictObjectSchema<{ readonly confirmation: v.StrictObjectSchema<{ readonly version: v.LiteralSchema<1, undefined>; readonly bridgeId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly bridgeLease: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly walletExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly partnerVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerMetadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly requestHash: v.CustomSchema | undefined>; readonly authorizationMode: v.LiteralSchema<"partner_link", undefined>; readonly rememberPartner: v.LiteralSchema; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly expiresAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; }, undefined>; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; type TSessionLinkConfirmationReceipt = v.InferOutput; //#endregion //#region src/model/durable_object/client/partner/partner_client.schema.d.ts declare const vPartnerMetadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; type TPartnerMetadata = v.InferInput; /** * One wallet the partner has paired with, stored on the PartnerClientDO. The partner never handles * `walletPerId` itself — it addresses a wallet only by its verify key (the E2E handle it already * holds); the DO resolves that handle to `walletPerId` internally when relaying a push. Holding the * wallet's exchange + verify keys here also lets a push be sealed for a wallet the partner is not * currently bridged to. */ declare const vPartnerWalletClientLink: v.ObjectSchema<{ readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly linkIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly walletExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly meteorAppId: v.EnumSchema; readonly linkedAt: v.NumberSchema; readonly walletProtocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; readonly walletCapabilities: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate capability">, v.TransformAction[], v.EnumValues[]>]>; }, undefined>; type TPartnerWalletClientLink = v.InferInput; declare const vPartnerClientDO_State: v.ObjectSchema<{ readonly metadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; }, undefined>; type TPartnerClientDO_State = v.InferInput; declare const vRegisterPartnerConnection_Input: v.ObjectSchema<{ readonly partnerVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly partnerMetadata: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly linkIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly walletExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly meteorAppId: v.EnumSchema; readonly walletProtocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; readonly walletCapabilities: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate capability">, v.TransformAction[], v.EnumValues[]>]>; }, undefined>; type TRegisterPartnerConnection_Input = v.InferInput; declare const vWalletClientConnectionInfo: v.ObjectSchema<{ readonly meteorAppId: v.EnumSchema; readonly walletExchangePublicKey: v.SchemaWithPipe | undefined>]>; readonly walletVerifyPublicKey: v.SchemaWithPipe | undefined>]>; readonly walletProtocolVersion: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; readonly walletCapabilities: v.SchemaWithPipe, undefined>, v.MaxLengthAction[], number, undefined>, v.CheckAction[], "Duplicate capability">, v.TransformAction[], v.EnumValues[]>]>; }, undefined>; type TWalletClientConnectionInfo = v.InferInput; //#endregion //#region src/model/durable_object/client/wallet/wallet_do.api_schema.d.ts declare const vWalletClient_Register_Input: v.ObjectSchema<{ readonly meteorAppId: v.EnumSchema; readonly verifyKey: v.SchemaWithPipe | undefined>]>; /** * Phase-3a proof of possession (see wallet_registration_proof.ts): a fresh signature over the * structured, domain-separated canonical identity challenge with the wallet identity key. * Verified at the Worker before the deterministic DO stub is resolved, and again in the DO before * the request is treated as ownership of an existing wallet. */ readonly registrationProof: v.ObjectSchema<{ readonly version: v.NumberSchema; readonly issuedAt: v.NumberSchema; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; }, undefined>; type TWalletClient_Register_Input = v.InferInput; declare const vWalletClient_Register_Output: v.ObjectSchema<{ readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; }, undefined>; type TWalletClient_Register_Output = v.InferInput; /** * [REGISTER PUSH TOKEN] * * The wallet registers (or refreshes) its device push token against its already-registered * WalletClientDO. Routed on the stateless creator endpoint but addressed to the *existing* DO by * `walletPerId`; the DO authenticates a fresh, canonical signature binding the wallet id, current * account incarnation, token, platform, version, and issue time against the stored verify key. The * shared endpoint's per-boot transport identity never gates it, old account incarnations cannot * mutate a recreated wallet, and a captured registration cannot reinstate a stale token forever. */ declare const vWalletClient_RegisterPushToken_Input: v.ObjectSchema<{ readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly token: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly platform: v.PicklistSchema<["android", "ios"], undefined>; readonly version: v.NumberSchema; readonly issuedAt: v.NumberSchema; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; type TWalletClient_RegisterPushToken_Input = v.InferInput; declare const vWalletClient_RegisterPushToken_Output: v.ObjectSchema<{ readonly success: v.LiteralSchema; }, undefined>; type TWalletClient_RegisterPushToken_Output = v.InferInput; declare const vWalletClient_RevokePartner_Input: v.ObjectSchema<{ readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly linkIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly version: v.NumberSchema; readonly issuedAt: v.NumberSchema; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; type TWalletClient_RevokePartner_Input = v.InferInput; declare const vWalletClient_RevokePartner_Output: v.ObjectSchema<{ readonly success: v.LiteralSchema; readonly revoked: v.BooleanSchema; }, undefined>; type TWalletClient_RevokePartner_Output = v.InferInput; declare const vWalletClient_DeleteWallet_Input: v.ObjectSchema<{ walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; operationId: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; version: v.NumberSchema; issuedAt: v.NumberSchema; signatureBase64: v.CustomSchema | undefined>; }, undefined>; type TWalletClient_DeleteWallet_Input = v.InferInput; declare const vWalletClient_DeleteWallet_Output: v.ObjectSchema<{ readonly success: v.LiteralSchema; }, undefined>; type TWalletClient_DeleteWallet_Output = v.InferInput; declare const vWalletClient_GetLinkAuthority_Input: v.ObjectSchema<{ readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly version: v.NumberSchema; readonly issuedAt: v.NumberSchema; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; type TWalletClient_GetLinkAuthority_Input = v.InferInput; declare const vWalletClient_GetLinkAuthority_Output: v.ObjectSchema<{ readonly linkIncarnation: v.OptionalSchema, v.UuidAction, v.RegexAction]>, undefined>; }, undefined>; type TWalletClient_GetLinkAuthority_Output = v.InferInput; declare const vWalletClient_UnregisterPushToken_Input: v.ObjectSchema<{ readonly token: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly walletPerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly version: v.NumberSchema; readonly issuedAt: v.NumberSchema; readonly signatureBase64: v.CustomSchema | undefined>; }, undefined>; type TWalletClient_UnregisterPushToken_Input = v.InferInput; declare const vWalletClient_UnregisterPushToken_Output: v.ObjectSchema<{ readonly success: v.LiteralSchema; readonly unregistered: v.BooleanSchema; }, undefined>; type TWalletClient_UnregisterPushToken_Output = v.InferInput; //#endregion //#region src/model/durable_object/client/wallet/wallet_do.schema.d.ts declare const vConnectedPartnerClient: v.ObjectSchema<{ readonly partnerId: v.SchemaWithPipe, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly linkIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly meta: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly verifyKey: v.StringSchema; readonly partnerExchangeKey: v.OptionalSchema | undefined>]>, undefined>; }, undefined>; type TConnectedPartnerClient = v.InferInput; declare const vWalletPushPlatform: v.PicklistSchema<["android", "ios"], undefined>; type TWalletPushPlatform = v.InferInput; declare const vWalletPushRegistration: v.ObjectSchema<{ readonly token: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly platform: v.PicklistSchema<["android", "ios"], undefined>; readonly updatedAt: v.NumberSchema; }, undefined>; /** Tokens older than this are treated as absent and compare-deleted before any FCM send. */ declare const WALLET_PUSH_TOKEN_MAX_AGE_MILLIS: number; type TWalletPushRegistration = v.InferInput; declare const vWalletClientState: v.ObjectSchema<{ readonly meteorAppId: v.EnumSchema; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly connectedPartnerClients: v.ArraySchema, v.LengthAction, v.RegexAction]>; readonly accountIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly linkIncarnation: v.SchemaWithPipe, v.UuidAction, v.RegexAction]>; readonly meta: v.ObjectSchema<{ readonly name: v.SchemaWithPipe, v.TrimAction, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly origin: v.SchemaWithPipe | undefined>]>, v.MaxLengthAction<`web_url::${string}`, 2100, undefined>]>; readonly description: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.RegexAction]>, undefined>; readonly iconUrl: v.OptionalSchema, v.TrimAction, v.MaxLengthAction, v.StartsWithAction]>, undefined>; }, undefined>; readonly verifyKey: v.StringSchema; readonly partnerExchangeKey: v.OptionalSchema | undefined>]>, undefined>; }, undefined>, undefined>; readonly pushRegistration: v.OptionalSchema, v.MinLengthAction, v.MaxLengthAction]>; readonly platform: v.PicklistSchema<["android", "ios"], undefined>; readonly updatedAt: v.NumberSchema; }, undefined>, undefined>; }, undefined>; type TWalletClientState = v.InferInput; //#endregion //#region src/nice_action/action_policies.d.ts /** * Server-authoritative per-action security policy. The bridge Durable Object — not the partner — * consults this registry at bridge creation, claim, notify, and realm projection. Partner-supplied * requirements can only ADD strictness on top of what is declared here. * * Every action of a first-party domain must make an explicit policy choice — the `satisfies * Record` maps below turn a missing entry into a compile error. */ type TActionDeliveryMode = "claim_response" | "post_pin_wallet_encrypted"; type TActionMinimumSessionAuthorization = "trusted_link" | "fresh_pin"; type TActionResourceProfile = `${ESessionResourceProfile}`; /** * Prepended to the plaintext before the DO encrypts a `post_pin_wallet_encrypted` action request * to the claiming wallet, and verified/stripped by the wallet client on decrypt. Cheap context * binding: the envelope shares its derived AES key with the other bridge-link ciphertexts * (`pinCodeEncrypted`, `bridgeSaltEncrypted`, …), so the tag pins what this one is. */ declare const ACTION_REQUEST_ENVELOPE_PURPOSE_TAG = "action_request::"; interface IActionPolicyShared { requiredWalletCapabilities: readonly EWalletProtocolCapability[]; allowedResourceProfiles: readonly TActionResourceProfile[]; } /** * Delivery mode and minimum session authorization are COUPLED, not independent knobs. * `post_pin_wallet_encrypted` means "the DO hands this to the wallet only after a PIN verified on * this bridge", so a policy asking for the encrypted envelope while allowing the trusted PIN-skip * fast path would be self-contradictory — and worse, that fast path returns the PLAINTEXT action. * * Encoding it as a discriminated union makes the bad combination a compile error under the * `satisfies Record<…>` maps below, instead of an invariant every future action has to remember. */ type TActionPolicy = (IActionPolicyShared & { delivery: "claim_response"; minimumSessionAuthorization: TActionMinimumSessionAuthorization; }) | (IActionPolicyShared & { delivery: "post_pin_wallet_encrypted"; minimumSessionAuthorization: "fresh_pin"; }); /** * Unrecognized (third-party) domains and nullish input use the generic action policy; a recognized * first-party domain with an unknown id fails closed instead. */ declare const getActionPolicy: (action: { domain?: string; id?: string; } | null | undefined) => TActionPolicy; /** Server-owned D35 gate; partner profile selection may only reduce to an allowed profile. */ declare const isActionResourceProfileAllowed: (action: { domain?: string; id?: string; } | null | undefined, profile: ESessionResourceProfile) => boolean; declare const actionRequiresFreshPin: (action: { domain?: string; id?: string; } | null | undefined) => boolean; declare const getActionMinimumSessionAuthorization: (action: { domain?: string; id?: string; } | null | undefined) => TActionMinimumSessionAuthorization; declare const getActionAllowedResourceProfiles: (action: { domain?: string; id?: string; } | null | undefined) => readonly TActionResourceProfile[]; declare const getServerRequiredWalletCapabilities: (action: { domain?: string; id?: string; } | null | undefined) => readonly EWalletProtocolCapability[]; declare const actionRequiresWalletEncryptedDelivery: (action: { domain?: string; id?: string; } | null | undefined) => boolean; /** * Domain-agnostic serialized-size cap applied to EVERY incoming `actionRequest` at bridge * creation, unknown domains included — first-party payload bounds must not be dodgeable by * relabeling the domain. Sized against the transport chain documented in * `act_impl_meteor_wallet_core.schemas.ts`. */ declare const MAX_ACTION_REQUEST_CANONICAL_JSON_LENGTH = 400000; type TActionRequestValidationResult = { ok: true; /** * The request to STORE, with a recognized first-party `input` replaced by the valibot-validated * output. Callers should persist this rather than the raw wire object, so what gets stored, * relayed and encrypted to the wallet is the value that was actually checked. * * Identical to the input for unrecognized domains (nothing to validate against) — the * domain-agnostic size cap still applied. */ validatedRequest: IActionPayload_Request_JsonObject; } | { ok: false; reason: "request_too_large" | "invalid_first_party_request"; }; /** * Bridge-creation gate: enforces the domain-agnostic size cap on every request, then — for * recognized first-party domains — hydrates the request through its real action domain and * validates the input against the action's schema, so a handcrafted partner payload cannot bypass * the versioned/bounded transfer schemas. Unknown domains keep generic-envelope validation only. * * On success it returns `validatedRequest`: the request with a first-party `input` replaced by the * schema's own output. Callers must persist THAT, not the object they passed in — the schemas are * `v.object` rather than `v.strictObject`, so unknown keys on the raw wire object survive * validation and would otherwise be stored, relayed, and encrypted to the wallet unchecked. * * Deliberately not `v.strictObject`: generic action payloads may carry extension fields that the * current first-party schema does not retain. Named fields are bounded; unknown keys are counted * against the size cap and then dropped before storage or relay. */ declare const validateKnownFirstPartyActionRequest: (actionRequest: IActionPayload_Request_JsonObject) => TActionRequestValidationResult; //#endregion //#region src/nice_action/actions/act_root_meteor_connect.d.ts declare const act_root_meteor_connect: ActionRootDomain>; //#endregion //#region src/nice_action/actions/impl/act_impl_meteor_wallet_core.schemas.d.ts /** * Transfer-accounts v1 wire protocol — versioned and bounded BEFORE first ship, so the limits are * part of the compatibility contract (capability `transfer_accounts_v1` means exactly this shape). * * Every numeric bound is an exported named constant: the partner wrapper, the backend's * first-party request validation, and the wallet's post-decrypt validation all consume these same * values — no magic numbers, no drift. * * Size-cap derivation (re-verify the whole chain before ever raising the ciphertext cap): * ~1 MiB Workers RPC serialization on `create_session` → 2 MB per-value SQLite-backed DO storage * (the whole bridge state persists as ONE value, and D8 stores a second wallet-encrypted envelope * of the same request) → 1 MiB realm WebSocket message. 350,000 base64 chars (≈256 KiB plaintext) * keeps ≥2× margin at every hop. */ declare const TRANSFER_ACCOUNTS_FORMAT_VERSION = 1; declare const TRANSFER_ACCOUNTS_MIN_ACCOUNTS = 1; declare const TRANSFER_ACCOUNTS_MAX_ACCOUNTS = 50; declare const TRANSFER_ACCOUNTS_MIN_SECRETS_PER_ACCOUNT = 1; declare const TRANSFER_ACCOUNTS_MAX_SECRETS_PER_ACCOUNT = 10; declare const TRANSFER_ACCOUNTS_MIN_ACCOUNT_ID_LENGTH = 2; declare const TRANSFER_ACCOUNTS_MAX_ACCOUNT_ID_LENGTH = 64; /** NEAR's account-id grammar. See the note on `vAccountBasicData.accountId`. */ declare const TRANSFER_ACCOUNTS_ACCOUNT_ID_PATTERN: RegExp; declare const TRANSFER_ACCOUNTS_MAX_DERIVATION_PATH_LENGTH = 128; declare const TRANSFER_ACCOUNTS_MAX_SECRET_DATA_LENGTH = 16384; declare const TRANSFER_ACCOUNTS_MAX_CIPHERTEXT_BASE64_LENGTH = 350000; declare const TRANSFER_ACCOUNTS_NONCE_BYTE_LENGTH = 12; declare const vBlockchainId: v.PicklistSchema<["near"], undefined>; declare const vCryptoGenericNetworkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; declare const vAccountSecretType: v.PicklistSchema<["mnemonic", "private_key"], undefined>; declare const vAccountSecretMnemonic: v.ObjectSchema<{ readonly type: v.LiteralSchema<"mnemonic", undefined>; readonly encoding: v.LiteralSchema<"utf8_base64", undefined>; readonly derivationPath: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>; declare const vAccountSecretPrivateKey: v.ObjectSchema<{ readonly type: v.LiteralSchema<"private_key", undefined>; readonly encoding: v.LiteralSchema<"near_prefixed_utf8_base64", undefined>; readonly keyAlgorithm: v.LiteralSchema<"ed25519", undefined>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>; declare const vAccountSecretData: v.VariantSchema<"type", [v.ObjectSchema<{ readonly type: v.LiteralSchema<"mnemonic", undefined>; readonly encoding: v.LiteralSchema<"utf8_base64", undefined>; readonly derivationPath: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"private_key", undefined>; readonly encoding: v.LiteralSchema<"near_prefixed_utf8_base64", undefined>; readonly keyAlgorithm: v.LiteralSchema<"ed25519", undefined>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>], undefined>; /** * The only free-form account identity field (`blockchainId`/`networkId` are closed picklists), and * it is rendered verbatim in approval UIs. The grammar prevents homoglyph/bidi/zero-width labels. */ declare const vNearAccountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; declare const vAccountBasicData: v.ObjectSchema<{ readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>; declare const vAccountTransferDataDecrypted: v.ObjectSchema<{ readonly secret: v.SchemaWithPipe; readonly encoding: v.LiteralSchema<"utf8_base64", undefined>; readonly derivationPath: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"private_key", undefined>; readonly encoding: v.LiteralSchema<"near_prefixed_utf8_base64", undefined>; readonly keyAlgorithm: v.LiteralSchema<"ed25519", undefined>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>], undefined>, undefined>, v.MinLengthAction<({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[], 1, undefined>, v.MaxLengthAction<({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[], 10, undefined>, v.CheckAction<({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[], "Duplicate secret entries for the same account are not allowed">]>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>; declare const vAllAccountsTransferDataDecrypted: v.ObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly accounts: v.SchemaWithPipe; readonly encoding: v.LiteralSchema<"utf8_base64", undefined>; readonly derivationPath: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"private_key", undefined>; readonly encoding: v.LiteralSchema<"near_prefixed_utf8_base64", undefined>; readonly keyAlgorithm: v.LiteralSchema<"ed25519", undefined>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>], undefined>, undefined>, v.MinLengthAction<({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[], 1, undefined>, v.MaxLengthAction<({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[], 10, undefined>, v.CheckAction<({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[], "Duplicate secret entries for the same account are not allowed">]>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, undefined>, v.MinLengthAction<{ secret: ({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[]; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], 1, undefined>, v.MaxLengthAction<{ secret: ({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[]; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], 50, undefined>, v.CheckAction<{ secret: ({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[]; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], "Duplicate (blockchainId, networkId, accountId) accounts are not allowed">]>; }, undefined>; declare const vTransferAccountsCiphertext: v.SchemaWithPipe, v.Base64Action]>; readonly ciphertext: v.SchemaWithPipe, v.Base64Action]>; }, undefined>, v.CheckAction<{ nonce: string; ciphertext: string; }, "Transfer ciphertext exceeds the v1 size cap">, v.CheckAction<{ nonce: string; ciphertext: string; }, "Transfer ciphertext nonce must decode to exactly 12 bytes">]>; declare const TRANSFER_ACCOUNTS_ID_RANDOM_BYTE_LENGTH = 16; declare const TRANSFER_ACCOUNTS_MIN_ID_LENGTH = 22; declare const TRANSFER_ACCOUNTS_MAX_ID_LENGTH = 128; declare const TRANSFER_ACCOUNTS_ID_PATTERN: RegExp; /** Stable source-generated identity used by the wallet's transactional import receipt. */ declare const vAccountTransferOpaqueId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; declare const vAllAccountsTransferDataEncrypted: v.ObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly clientTransferId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly allAccountsBasicInfo: v.SchemaWithPipe; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, undefined>, v.MinLengthAction<{ blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], 1, undefined>, v.MaxLengthAction<{ blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], 50, undefined>, v.CheckAction<{ blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], "Duplicate (blockchainId, networkId, accountId) accounts are not allowed">]>; readonly encryptedData: v.SchemaWithPipe, v.Base64Action]>; readonly ciphertext: v.SchemaWithPipe, v.Base64Action]>; }, undefined>, v.CheckAction<{ nonce: string; ciphertext: string; }, "Transfer ciphertext exceeds the v1 size cap">, v.CheckAction<{ nonce: string; ciphertext: string; }, "Transfer ciphertext nonce must decode to exactly 12 bytes">]>; }, undefined>; type TBlockchainId = v.InferOutput; type TCryptoGenericNetworkId = v.InferOutput; type TAccountSecretData = v.InferOutput; type TAccountBasicData = v.InferOutput; type TAccountTransferDataDecrypted = v.InferOutput; type TAllAccountsTransferDataDecrypted = v.InferOutput; type TAllAccountsTransferDataEncrypted = v.InferOutput; declare const NEW_KEY_ACCOUNT_TRANSFER_FORMAT_VERSION = 1; declare const NEW_KEY_ACCOUNT_TRANSFER_MIN_ACCOUNTS = 1; declare const NEW_KEY_ACCOUNT_TRANSFER_MAX_ACCOUNTS = 50; declare const NEW_KEY_ACCOUNT_TRANSFER_ID_RANDOM_BYTE_LENGTH = 16; declare const NEW_KEY_ACCOUNT_TRANSFER_MIN_ID_LENGTH = 22; declare const NEW_KEY_ACCOUNT_TRANSFER_MAX_ID_LENGTH = 128; declare const NEW_KEY_ACCOUNT_TRANSFER_MAX_PUBLIC_KEY_LENGTH = 64; declare const NEW_KEY_ACCOUNT_TRANSFER_MAX_TRANSACTION_HASH_LENGTH = 64; declare const NEW_KEY_ACCOUNT_TRANSFER_KEY_BYTE_LENGTH = 32; declare const NEW_KEY_ACCOUNT_TRANSFER_ID_PATTERN: RegExp; declare const vNewKeyTransferOpaqueId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; declare const vNearEd25519PublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; declare const vNearTransactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; declare const NEW_KEY_TRANSFER_START_ISSUES: readonly ["account_not_found", "source_key_not_found", "source_key_not_full_access", "rpc_lookup_failed", "pending_transfer_conflict", "key_generation_failed", "secure_storage_failed"]; declare const NEW_KEY_TRANSFER_VERIFY_ACTIVE_ISSUES: readonly ["session_not_found", "account_not_in_session", "activation_not_found", "activation_not_full_access", "invalid_add_key_transaction", "source_signer_mismatch", "rpc_lookup_failed"]; declare const vNewKeyTransferStartIssueV1: v.PicklistSchema; declare const vNewKeyTransferVerifyActiveIssueV1: v.PicklistSchema; declare const vNewKeyTransferDestinationSignerTypeV1: v.PicklistSchema<["seed_phrase", "ledger"], undefined>; declare const vNewKeyTransferStartInputAccountV1: v.ObjectSchema<{ readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>; declare const vNewKeyTransferStartOutputAccountV1: v.UnionSchema<[v.ObjectSchema<{ readonly ok: v.LiteralSchema; readonly destinationSignerType: v.PicklistSchema<["seed_phrase", "ledger"], undefined>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, v.ObjectSchema<{ readonly ok: v.LiteralSchema; readonly issue: v.PicklistSchema; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>], undefined>; declare const vNewKeyTransferVerifyActiveInputAccountV1: v.ObjectSchema<{ readonly addKeyTransactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>; /** * Stabilization SD4 verify-output states. * * `secured` means the wallet proved the finalized AddKey AND durably imported the destination * signer + account into its real inventory (SD3) — under the SD1/SD5 ordering the recovery phrase * was already confirmed in full before the key was ever published, so `secured` is the partner's * only "done" signal (SD6). `verified_pending_completion` means chain proof passed but a wallet * completion fact is still outstanding; the bounded `pendingFact` says which one, and a re-entrant * verify later resolves it to `secured`. `not_verified` remains the proof-failure arm. * * The optional `liveness` fact on `secured` rows reports the SD13 1-yocto activation self-test: * `confirmed` (test transaction executed, hash journaled wallet-side) or `skipped` (policy off, * balance below the gas floor, or RPC-uncertain after bounded retries). A *definitive* * signing/execution failure of the self-test is never reported as `secured` — it surfaces as * `verified_pending_completion` with `pendingFact: "liveness_check_failed"`. */ declare const NEW_KEY_TRANSFER_PENDING_FACTS: readonly ["import_incomplete", "liveness_check_failed"]; declare const NEW_KEY_TRANSFER_LIVENESS_FACTS: readonly ["confirmed", "skipped"]; declare const vNewKeyTransferPendingFactV1: v.PicklistSchema; declare const vNewKeyTransferLivenessFactV1: v.PicklistSchema; declare const vNewKeyTransferVerifyActiveOutputAccountV1: v.UnionSchema<[v.ObjectSchema<{ readonly activation: v.LiteralSchema<"secured", undefined>; readonly liveness: v.OptionalSchema, undefined>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, v.ObjectSchema<{ readonly activation: v.LiteralSchema<"verified_pending_completion", undefined>; readonly pendingFact: v.PicklistSchema; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, v.ObjectSchema<{ readonly activation: v.LiteralSchema<"not_verified", undefined>; readonly issue: v.PicklistSchema; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>], undefined>; declare const vNewKeyTransferStartInputV1: v.ObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly clientTransferId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly accounts: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, undefined>, v.MinLengthAction<{ sourcePublicKey: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], 1, undefined>, v.MaxLengthAction<{ sourcePublicKey: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], 50, undefined>, v.CheckAction<{ sourcePublicKey: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], "Duplicate (blockchainId, networkId, accountId) accounts are not allowed">]>; }, undefined>; declare const vNewKeyTransferStartOutputV1: v.ObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly clientTransferId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly accounts: v.SchemaWithPipe; readonly destinationSignerType: v.PicklistSchema<["seed_phrase", "ledger"], undefined>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, v.ObjectSchema<{ readonly ok: v.LiteralSchema; readonly issue: v.PicklistSchema; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>], undefined>, undefined>, v.MinLengthAction<({ ok: true; destinationSignerType: "seed_phrase" | "ledger"; destinationPublicKey: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { ok: false; issue: "account_not_found" | "source_key_not_found" | "source_key_not_full_access" | "rpc_lookup_failed" | "pending_transfer_conflict" | "key_generation_failed" | "secure_storage_failed"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; })[], 1, undefined>, v.MaxLengthAction<({ ok: true; destinationSignerType: "seed_phrase" | "ledger"; destinationPublicKey: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { ok: false; issue: "account_not_found" | "source_key_not_found" | "source_key_not_full_access" | "rpc_lookup_failed" | "pending_transfer_conflict" | "key_generation_failed" | "secure_storage_failed"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; })[], 50, undefined>, v.CheckAction<({ ok: true; destinationSignerType: "seed_phrase" | "ledger"; destinationPublicKey: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { ok: false; issue: "account_not_found" | "source_key_not_found" | "source_key_not_full_access" | "rpc_lookup_failed" | "pending_transfer_conflict" | "key_generation_failed" | "secure_storage_failed"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; })[], "Duplicate (blockchainId, networkId, accountId) accounts are not allowed">]>; }, undefined>; declare const vNewKeyTransferVerifyActiveInputV1: v.ObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly activations: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, undefined>, v.MinLengthAction<{ addKeyTransactionHash: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], 1, undefined>, v.MaxLengthAction<{ addKeyTransactionHash: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], 50, undefined>, v.CheckAction<{ addKeyTransactionHash: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], "Duplicate (blockchainId, networkId, accountId) accounts are not allowed">]>; }, undefined>; declare const vNewKeyTransferVerifyActiveOutputV1: v.ObjectSchema<{ readonly formatVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly accounts: v.SchemaWithPipe; readonly liveness: v.OptionalSchema, undefined>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, v.ObjectSchema<{ readonly activation: v.LiteralSchema<"verified_pending_completion", undefined>; readonly pendingFact: v.PicklistSchema; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, v.ObjectSchema<{ readonly activation: v.LiteralSchema<"not_verified", undefined>; readonly issue: v.PicklistSchema; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>], undefined>, undefined>, v.MinLengthAction<({ activation: "secured"; liveness?: "confirmed" | "skipped" | undefined; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { activation: "verified_pending_completion"; pendingFact: "import_incomplete" | "liveness_check_failed"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { activation: "not_verified"; issue: "rpc_lookup_failed" | "session_not_found" | "account_not_in_session" | "activation_not_found" | "activation_not_full_access" | "invalid_add_key_transaction" | "source_signer_mismatch"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; })[], 1, undefined>, v.MaxLengthAction<({ activation: "secured"; liveness?: "confirmed" | "skipped" | undefined; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { activation: "verified_pending_completion"; pendingFact: "import_incomplete" | "liveness_check_failed"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { activation: "not_verified"; issue: "rpc_lookup_failed" | "session_not_found" | "account_not_in_session" | "activation_not_found" | "activation_not_full_access" | "invalid_add_key_transaction" | "source_signer_mismatch"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; })[], 50, undefined>, v.CheckAction<({ activation: "secured"; liveness?: "confirmed" | "skipped" | undefined; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { activation: "verified_pending_completion"; pendingFact: "import_incomplete" | "liveness_check_failed"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { activation: "not_verified"; issue: "rpc_lookup_failed" | "session_not_found" | "account_not_in_session" | "activation_not_found" | "activation_not_full_access" | "invalid_add_key_transaction" | "source_signer_mismatch"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; })[], "Duplicate (blockchainId, networkId, accountId) accounts are not allowed">]>; }, undefined>; type TNewKeyTransferStartIssueV1 = v.InferOutput; type TNewKeyTransferVerifyActiveIssueV1 = v.InferOutput; type TNewKeyTransferDestinationSignerTypeV1 = v.InferOutput; type TNewKeyTransferPendingFactV1 = v.InferOutput; type TNewKeyTransferLivenessFactV1 = v.InferOutput; type TNewKeyTransferStartInputAccountV1 = v.InferOutput; type TNewKeyTransferStartOutputAccountV1 = v.InferOutput; type TNewKeyTransferVerifyActiveInputAccountV1 = v.InferOutput; type TNewKeyTransferVerifyActiveOutputAccountV1 = v.InferOutput; type TNewKeyTransferStartInputV1 = v.InferOutput; type TNewKeyTransferStartOutputV1 = v.InferOutput; type TNewKeyTransferVerifyActiveInputV1 = v.InferOutput; type TNewKeyTransferVerifyActiveOutputV1 = v.InferOutput; //#endregion //#region src/nice_action/actions/impl/account_transfer_import_receipt.d.ts declare const ACCOUNT_IMPORT_RECORD_FORMAT_VERSION = 3; /** * How many receipts keep their full per-account evidence. * * This is a WORKING SET, not a lifetime ceiling. Format v2 kept every completed receipt forever in * one bounded array of 64 and refused the 65th transfer permanently — correct about never making an * old `clientTransferId` replayable, wrong about what that requires * (REVIEW-consumer-implementation B-03). Detailed rows are only needed while a transfer is live or * freshly completed; replay safety only needs the id and the account-set hash. */ declare const ACCOUNT_IMPORT_MAX_ACTIVE_RECEIPTS = 64; /** * How many archived replay fences are retained. Each is ~80 bytes against a full receipt's ~1 KB, * so the whole archive stays inside a single storage slot while covering orders of magnitude more * transfers than any real wallet profile performs. Exhausting it fails closed as * `archive_capacity_exceeded` — an old transfer id is never silently made valid again. */ declare const ACCOUNT_IMPORT_MAX_ARCHIVED_RECEIPTS = 4096; /** @deprecated Format v2's single combined bound. Use {@link ACCOUNT_IMPORT_MAX_ACTIVE_RECEIPTS}. */ declare const ACCOUNT_IMPORT_MAX_RECEIPTS = 64; declare const vAccountImportReceipt: v.StrictObjectSchema<{ readonly clientTransferId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly canonicalAccountSetHash: v.SchemaWithPipe, v.RegexAction]>; readonly status: v.PicklistSchema<["prepared", "completed"], undefined>; readonly rows: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly accountDataHash: v.SchemaWithPipe, v.RegexAction]>; readonly outcome: v.PicklistSchema<["imported", "replaced", "already_present"], undefined>; }, undefined>, undefined>, v.MinLengthAction<{ accountKey: string; accountDataHash: string; outcome: "imported" | "replaced" | "already_present"; }[], 1, undefined>, v.MaxLengthAction<{ accountKey: string; accountDataHash: string; outcome: "imported" | "replaced" | "already_present"; }[], 50, undefined>]>; }, undefined>; /** * A completed receipt reduced to its replay identity. Keeping the account-set hash is what lets a * conflicting reuse of an archived id still be caught as `transfer_id_conflict` rather than * degrading into a generic "already done". */ declare const vArchivedAccountImportReceipt: v.StrictObjectSchema<{ readonly clientTransferId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly canonicalAccountSetHash: v.SchemaWithPipe, v.RegexAction]>; }, undefined>; declare const vAccountImportRecord: v.StrictObjectSchema<{ readonly formatVersion: v.LiteralSchema<3, undefined>; readonly accounts: v.SchemaWithPipe; readonly encoding: v.LiteralSchema<"utf8_base64", undefined>; readonly derivationPath: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"private_key", undefined>; readonly encoding: v.LiteralSchema<"near_prefixed_utf8_base64", undefined>; readonly keyAlgorithm: v.LiteralSchema<"ed25519", undefined>; readonly prefixedBase64DataString: v.SchemaWithPipe, v.CheckAction' with non-empty, bounded, decodable data">]>; }, undefined>], undefined>, undefined>, v.MinLengthAction<({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[], 1, undefined>, v.MaxLengthAction<({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[], 10, undefined>, v.CheckAction<({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[], "Duplicate secret entries for the same account are not allowed">]>; readonly blockchainId: v.PicklistSchema<["near"], undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; }, undefined>, undefined>, v.MaxLengthAction<{ secret: ({ type: "mnemonic"; encoding: "utf8_base64"; derivationPath: string; prefixedBase64DataString: string; } | { type: "private_key"; encoding: "near_prefixed_utf8_base64"; keyAlgorithm: "ed25519"; prefixedBase64DataString: string; })[]; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; }[], 500, undefined>]>; readonly receipts: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly canonicalAccountSetHash: v.SchemaWithPipe, v.RegexAction]>; readonly status: v.PicklistSchema<["prepared", "completed"], undefined>; readonly rows: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly accountDataHash: v.SchemaWithPipe, v.RegexAction]>; readonly outcome: v.PicklistSchema<["imported", "replaced", "already_present"], undefined>; }, undefined>, undefined>, v.MinLengthAction<{ accountKey: string; accountDataHash: string; outcome: "imported" | "replaced" | "already_present"; }[], 1, undefined>, v.MaxLengthAction<{ accountKey: string; accountDataHash: string; outcome: "imported" | "replaced" | "already_present"; }[], 50, undefined>]>; }, undefined>, undefined>, v.MaxLengthAction<{ clientTransferId: string; canonicalAccountSetHash: string; status: "prepared" | "completed"; rows: { accountKey: string; accountDataHash: string; outcome: "imported" | "replaced" | "already_present"; }[]; }[], 64, undefined>]>; readonly archivedReceipts: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly canonicalAccountSetHash: v.SchemaWithPipe, v.RegexAction]>; }, undefined>, undefined>, v.MaxLengthAction<{ clientTransferId: string; canonicalAccountSetHash: string; }[], 4096, undefined>]>; }, undefined>; type TAccountImportReceipt = v.InferOutput; type TArchivedAccountImportReceipt = v.InferOutput; type TAccountImportRecord = v.InferOutput; declare const emptyAccountImportRecord: () => TAccountImportRecord; type TAccountImportCapacityReason = /** Every retained receipt is still `prepared`; nothing may be archived out from under a commit. */ "receipt_capacity_exceeded" | /** The compact replay-fence archive is full. Never resolved by dropping a fence. */ "archive_capacity_exceeded"; /** * Upgrade a stored record to the current format, or return `null` if it is not a record at all. * * v2 → v3 keeps every receipt exactly as it was and adds an empty archive: a profile that never * reached the old ceiling is unchanged, and one that did now has somewhere for its completed * receipts to go on the next import. Call this on load, before any prepare/commit; the record * schemas deliberately refuse an unmigrated version rather than coercing it. */ declare const migrateAccountImportRecord: (stored: unknown) => TAccountImportRecord | null; declare const accountImportKey: (account: { blockchainId: string; networkId: string; accountId: string; }) => string; declare const hashAccountImportSet: (accounts: readonly TAccountTransferDataDecrypted[]) => string; type TPrepareAccountImportResult = { ok: true; record: TAccountImportRecord; receipt: TAccountImportReceipt; disposition: "prepared" | "already_prepared" | "already_completed"; } | { ok: false; reason: "transfer_id_conflict" | "completed_receipt_drift" | /** * This exact transfer completed, but its detailed receipt has been archived down to a * replay fence. Treat it as done: do NOT import again. The per-account outcome rows are no * longer retained, which is why this is not an `ok` disposition. */ "already_completed_archived" | TAccountImportCapacityReason; }; /** * Prepare the durable intent before mutating account inventory. Persist the returned record before * calling {@link commitPreparedAccountImport}; a crash after this step is provably not-started. */ declare const prepareAccountImport: (input: { record: TAccountImportRecord; clientTransferId: string; accounts: readonly TAccountTransferDataDecrypted[]; }) => TPrepareAccountImportResult; type TCommitAccountImportResult = { ok: true; record: TAccountImportRecord; receipt: TAccountImportReceipt; disposition: "completed" | "already_completed"; } | { ok: false; reason: "receipt_missing" | "transfer_id_conflict" | "completed_receipt_drift" | "prepared_receipt_mismatch" | /** Completed earlier and archived down to a replay fence; nothing left to commit. */ "already_completed_archived"; }; /** Atomically materialize account inventory and the completed receipt in one persisted record. */ declare const commitPreparedAccountImport: (input: { record: TAccountImportRecord; clientTransferId: string; accounts: readonly TAccountTransferDataDecrypted[]; }) => TCommitAccountImportResult; //#endregion //#region src/nice_action/actions/impl/act_impl_meteor_connect_demo.d.ts declare const vSessionDemoReviewInput: v.StrictObjectSchema<{ readonly scenarioId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly turn: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly message: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; }, undefined>; declare const vSessionDemoReviewOutput: v.StrictObjectSchema<{ readonly scenarioId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly turn: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly acknowledgedMessage: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; readonly approved: v.LiteralSchema; }, undefined>; /** * Strictly test-harness action domain. The server policy also requires the test-only * `session_demo_review_v1` wallet capability, so no production wallet can be targeted by it. */ declare const act_impl_meteor_connect_demo: ActionDomain, { domain: string; actions: { review_session_message: ActionSchema, TTransportedValue<{ scenarioId: string; turn: number; acknowledgedMessage: string; approved: true; }, any>, readonly []>; }; }>>; /** * The demo wallets' typed decline for `review_session_message`; the partner renders the serialized * error ids. Lives here (not in the demo apps) so the demos need no direct error-library import. */ declare const merr_demo_wallet_review: NiceErrorDomain<{ domain: string; allDomains: [string, "merr_meteor_connect"]; schema: { wallet_declined: INiceErrorIdMetadata; }; }>; //#endregion //#region src/nice_action/actions/impl/act_impl_meteor_wallet_core.d.ts declare const act_impl_meteor_wallet_core: ActionDomain, { domain: string; actions: { /** * ⚠ **A decline is a SUCCESS result on this action, not an error.** * * This action's entire output is one boolean, and it declares no `.throws(...)` arm — so a user * refusing the transfer is `successResult({ success: false })`, which reaches the partner as * `waitForValidatedResult`'s `"ok"` arm. Its two siblings * (`new_key_account_transfer_start`, `_verify_active`) DO declare typed error arms, so the same * `waitForValidatedResult` call means different things per action id, and the difference is * invisible at the call site. Code that reads `status === "ok"` as "the user approved" is wrong * here; read `output.success`. * * The output is also the entire report: per-account detail (imported / already present / * failed) stays local to the wallet by design, and the signed result is all-or-nothing. * * Why this is a doc and not a `.throws` arm: every wallet in the field — both demos and the * shipped Meteor wallet — sends `{ success: false }` today. Adding the arm would create a * SECOND decline representation without retiring the first, so `status === "ok"` still would * not mean "approved" until every deployed wallet had been updated. Making the arm worth having * therefore needs a coordinated migration: add the arm, update every wallet, then narrow this * output to `{ success: true }` so the old representation cannot be sent. Until that lands, * this comment is the honest mitigation. */ transfer_accounts: ActionSchema, TTransportedValue<{ success: boolean; outcome?: "imported" | "declined" | "partially_imported" | undefined; }, any>, readonly []>; new_key_account_transfer_start: ActionSchema, TTransportedValue<{ formatVersion: 1; clientTransferId: string; transferSessionId: string; accounts: ({ ok: true; destinationSignerType: "seed_phrase" | "ledger"; destinationPublicKey: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { ok: false; issue: "account_not_found" | "source_key_not_found" | "source_key_not_full_access" | "rpc_lookup_failed" | "pending_transfer_conflict" | "key_generation_failed" | "secure_storage_failed"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; })[]; }, any>, readonly [IActionErrorDeclaration<{ domain: string; allDomains: [string, "merr_meteor_connect"]; schema: { wallet_declined: INiceErrorIdMetadata; client_transfer_id_conflict: INiceErrorIdMetadata; }; }, EErr_NewKeyAccountTransfer>]>; new_key_account_transfer_verify_active: ActionSchema, TTransportedValue<{ formatVersion: 1; transferSessionId: string; accounts: ({ activation: "secured"; liveness?: "confirmed" | "skipped" | undefined; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { activation: "verified_pending_completion"; pendingFact: "import_incomplete" | "liveness_check_failed"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; } | { activation: "not_verified"; issue: "rpc_lookup_failed" | "session_not_found" | "account_not_in_session" | "activation_not_found" | "activation_not_full_access" | "invalid_add_key_transaction" | "source_signer_mismatch"; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; })[]; }, any>, readonly [IActionErrorDeclaration<{ domain: string; allDomains: [string, "merr_meteor_connect"]; schema: { wallet_declined: INiceErrorIdMetadata; client_transfer_id_conflict: INiceErrorIdMetadata; }; }, EErr_NewKeyAccountTransfer>]>; }; }>>; //#endregion //#region src/nice_action/actions/impl/act_impl_meteor_wallet_core.utils.d.ts declare const METEOR_CONNECT_KEY_PREFIX = "mck1"; /** NEAR's standard mnemonic derivation path — the default for mnemonic secrets built here. */ declare const NEAR_DEFAULT_DERIVATION_PATH = "m/44'/397'/0'"; type TBuildAccountSecretDataResult = { ok: true; secret: TAccountSecretData; } | { ok: false; reason: "empty_secret_input"; } | { ok: false; reason: "invalid_private_key"; } | { ok: false; reason: "invalid_mnemonic_word_count"; wordCount: number; } | { ok: false; reason: "invalid_secret_data"; issueMessage: string; }; type TDeriveNearSigningKeyFromSecretResult = { ok: true; publicKey: string; privateKey: `ed25519:${string}`; } | { ok: false; reason: "invalid_secret_encoding" | "invalid_derivation_path" | "invalid_private_key"; }; /** * The one shared raw-secret encoder: turns user-pasted input into a schema-valid * {@link TAccountSecretData} entry for `buildAccountsTransferRequestData`. Partner UIs and SDKs * must use this rather than mirroring the encoding rules locally. * * Auto-detects the secret kind: `ed25519:…` → private key, otherwise a mnemonic phrase (12 or 24 * words, whitespace-normalized and lowercased). `derivationPath` applies to mnemonics only and * defaults to {@link NEAR_DEFAULT_DERIVATION_PATH}. * * Failures are typed reason codes (not display strings) so each consumer writes its own copy; * `invalid_secret_data` is the schema backstop (e.g. an over-length secret or derivation path). */ declare const buildAccountSecretData: (input: { secretInput: string; derivationPath?: string; }) => TBuildAccountSecretDataResult; type TMeteorConnectKeyString = `mck1.${string}.${string}`; /** Generate the stable receipt identity for one existing-secret transfer attempt. */ declare const createAccountTransferOpaqueId: () => string; /** * Partner side: validates and bounds the v1 payload, encrypts it under a freshly generated * `mck1.*` key, and derives the plaintext preview by explicit allowlist mapping. * * `transferKeyString` must NEVER be put on the bridge — hold it in partner-local component state * only and hand it to the user via QR / copy after fresh PIN verification. */ declare const buildAccountsTransferRequestData: (input: { decrypted: TAllAccountsTransferDataDecrypted; }) => Promise<{ transferKeyString: TMeteorConnectKeyString; actionInput: TAllAccountsTransferDataEncrypted; }>; type TAccountsTransferDecryptResult = { ok: true; data: TAllAccountsTransferDataDecrypted; } | { ok: false; reason: "bad_key_string" | "decrypt_failed" | "invalid_payload" | "preview_mismatch"; }; /** * Wallet side: decrypts with the user-entered key, validates the plaintext against the v1 schema, * then compares the unauthenticated plaintext preview to the authenticated decrypted account list: * set equality over canonical JSON of the three allowlisted fields, PLUS a length check, so array * order differences are not a mismatch but multiplicity still is. * * The length check is load-bearing and cannot be dropped in favour of "D7 rejects duplicates": * that rule lives in `vAllAccountsTransferDataEncrypted`, which is applied at bridge creation to * the request as a whole — this function never applies it to `input.actionInput`. Without the * length comparison, a relay could duplicate a preview row (`[alice, bob]` → `[alice, bob, bob]`) * and the sets would still match. * * `preview_mismatch` is tamper-evidence, defense in depth: the approval gate is always the * decrypted data. UIs must block approval on mismatch rather than silently preferring either list. */ declare const decryptAccountsTransferRequestData: (input: { transferKeyString: string; actionInput: TAllAccountsTransferDataEncrypted; }) => Promise; type TNewKeyTransferAccountIdentity = { blockchainId: string; networkId: string; accountId: string; }; declare const newKeyTransferAccountIdentityKey: (account: TNewKeyTransferAccountIdentity) => string; /** Generate an opaque v1 transfer id from 128 CSPRNG bits in unpadded base64url form. */ declare const createNewKeyTransferOpaqueId: () => string; /** Format raw 32-byte Ed25519 material as NEAR's canonical public-key string. */ declare const formatNearEd25519PublicKey: (publicKeyBytes: Uint8Array) => string; /** Format raw 32-byte NEAR transaction-hash material as canonical base58. */ declare const formatNearTransactionHash: (transactionHashBytes: Uint8Array) => string; type TDeriveNearPublicKeyFromSecretResult = { ok: true; publicKey: string; } | { ok: false; reason: "invalid_secret_encoding" | "invalid_private_key" | "invalid_derivation_path"; }; /** * Derive canonical NEAR signing material from one stored Ed25519 account secret. This is intended * for a local signer boundary only: callers must never serialize, persist, or log the private key. * * Mnemonics use BIP-39's empty-passphrase seed derivation followed by hardened SLIP-0010 Ed25519 * derivation at the stored path. Private-key entries must contain NEAR's canonical 64-byte * seed-plus-public-key representation; their embedded public half is checked against the seed. */ declare const deriveNearSigningKeyFromAccountSecret: (secret: TAccountSecretData) => TDeriveNearSigningKeyFromSecretResult; /** * Derive the public half of one stored NEAR Ed25519 account secret. This deliberately drops the * private half returned by {@link deriveNearSigningKeyFromAccountSecret}; use the signing helper * only in a local signer boundary and never serialize or log its result. */ declare const deriveNearPublicKeyFromAccountSecret: (secret: TAccountSecretData) => TDeriveNearPublicKeyFromSecretResult; /** * Validate and canonicalize a start request for the wallet's idempotency binding. Array order is * presentation-only, so complete rows are sorted by the protocol account tuple before hashing. */ declare const canonicalizeNewKeyTransferStartInput: (input: TNewKeyTransferStartInputV1) => TNewKeyTransferStartInputV1; declare const hashNewKeyTransferStartInput: (input: TNewKeyTransferStartInputV1) => string; /** Fail-closed primitives for validating durable wallet/host journal fields without Valibot. */ declare const isValidNewKeyTransferOpaqueId: (value: unknown) => value is string; declare const isValidNearEd25519PublicKey: (value: unknown) => value is string; declare const isValidNearTransactionHash: (value: unknown) => value is string; declare const isValidMeteorConnectVerifyPublicKey: (value: unknown) => value is string; declare const isValidMeteorConnectDurableObjectId: (value: unknown) => value is string; /** Parse a stored standalone output when the original request is not available at load time. */ declare const parseNewKeyTransferStartOutputV1: (output: unknown) => TNewKeyTransferStartOutputV1; /** * SDK receive-boundary validation. Authorship/hash checks happen before this helper; this proves * the signed value also conforms to the action schema and describes exactly the requested rows. */ declare const validateNewKeyTransferStartOutputForInput: (input: { request: TNewKeyTransferStartInputV1; output: unknown; }) => TNewKeyTransferStartOutputV1; declare const validateNewKeyTransferVerifyActiveOutputForInput: (input: { request: TNewKeyTransferVerifyActiveInputV1; output: unknown; }) => TNewKeyTransferVerifyActiveOutputV1; //#endregion //#region src/nice_action/actions/impl/act_impl_near.d.ts /** * NiceCode action domain for the public NEAR Connect wallet interface. Requests and results match * `NearWalletBase`; the only wire adaptation is replacing non-JSON runtime values with the forms * documented in `act_impl_near.schemas.ts`. */ declare const act_impl_near: ActionDomain, { domain: string; actions: { sign_in: ActionSchema, TTransportedValue<{ accountId: string; publicKey?: string | undefined; }[], any>, readonly []>; sign_in_and_sign_message: ActionSchema, TTransportedValue<{ signedMessage: { accountId: string; publicKey: string; signature: string; }; accountId: string; publicKey?: string | undefined; }[], any>, readonly []>; sign_out: ActionSchema, TTransportedValue<{ accountId: string; }, any>, readonly []>; sign_message: ActionSchema, TTransportedValue<{ accountId: string; publicKey: string; signature: string; }, any>, readonly []>; sign_and_send_transaction: ActionSchema, TTransportedValue<{ [x: string]: unknown; }, any>, readonly []>; sign_and_send_transactions: ActionSchema, TTransportedValue<{ [x: string]: unknown; }[], any>, readonly []>; sign_delegate_actions: ActionSchema, TTransportedValue<{ signedDelegateActions: string[]; }, any>, readonly []>; verify_owner: ActionSchema, TTransportedValue<{ accountId: string; message: string; blockId: string; publicKey: string; signature: string; }, any>, readonly []>; }; }>>; //#endregion //#region src/nice_action/actions/impl/new_key_account_transfer_proof.d.ts declare const vNewKeyTransferNormalizedAddKeyAction: v.ObjectSchema<{ readonly type: v.LiteralSchema<"add_key", undefined>; readonly publicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly permission: v.PicklistSchema<["full_access", "function_call"], undefined>; }, undefined>; declare const vNewKeyTransferNormalizedOtherAction: v.ObjectSchema<{ readonly type: v.LiteralSchema<"other", undefined>; readonly actionType: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; }, undefined>; declare const vNewKeyTransferNormalizedTransactionAction: v.UnionSchema<[v.ObjectSchema<{ readonly type: v.LiteralSchema<"add_key", undefined>; readonly publicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly permission: v.PicklistSchema<["full_access", "function_call"], undefined>; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"other", undefined>; readonly actionType: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; }, undefined>], undefined>; declare const vNewKeyTransferNormalizedDestinationAccess: v.UnionSchema<[v.ObjectSchema<{ readonly exists: v.LiteralSchema; }, undefined>, v.ObjectSchema<{ readonly exists: v.LiteralSchema; readonly permission: v.PicklistSchema<["full_access", "function_call"], undefined>; }, undefined>], undefined>; /** * Wallet-specific RPC adapters normalize provider/library response variants into this shape. The * authorization decision below is then identical in V1, V2, and the demos. */ declare const vNewKeyTransferNormalizedAddKeyProof: v.ObjectSchema<{ readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly finalExecutionStatus: v.PicklistSchema<["final", "not_final"], undefined>; readonly executionSucceeded: v.BooleanSchema; readonly transactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly signerId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly receiverId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly signerPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly actions: v.SchemaWithPipe; readonly publicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly permission: v.PicklistSchema<["full_access", "function_call"], undefined>; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"other", undefined>; readonly actionType: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction]>; }, undefined>], undefined>, undefined>, v.MinLengthAction<({ type: "add_key"; publicKey: string; permission: "full_access" | "function_call"; } | { type: "other"; actionType: string; })[], 1, undefined>, v.MaxLengthAction<({ type: "add_key"; publicKey: string; permission: "full_access" | "function_call"; } | { type: "other"; actionType: string; })[], 16, undefined>]>; readonly destinationAccess: v.UnionSchema<[v.ObjectSchema<{ readonly exists: v.LiteralSchema; }, undefined>, v.ObjectSchema<{ readonly exists: v.LiteralSchema; readonly permission: v.PicklistSchema<["full_access", "function_call"], undefined>; }, undefined>], undefined>; }, undefined>; type TNewKeyTransferNormalizedAddKeyProof = v.InferOutput; type TNewKeyTransferAddKeyProofResult = { verified: true; } | { verified: false; issue: Extract; }; /** * What the caller asserts the AddKey transaction must prove. `networkId` is load-bearing: it is the * check that stops a testnet transaction from authorizing a mainnet account, so a proof that omits * it can never verify. */ interface INewKeyTransferAddKeyProofExpectation { networkId: "mainnet" | "testnet"; accountId: string; sourcePublicKey: string; destinationPublicKey: string; addKeyTransactionHash: string; } /** * Verify a normalized AddKey proof against what the transfer expects. * * `proof` is typed rather than `unknown` on purpose. This function's runtime parse is strict, so a * proof missing a field it has since gained fails as `invalid_add_key_transaction` — for every * account, permanently, with nothing to distinguish it from a genuinely bad transaction. When the * parameter was `unknown`, a host that hand-rolled its proof object got no compiler signal when the * schema grew `networkId`, and the break was invisible until it reached users. Build the proof with * {@link normalizeNearAddKeyProof} so the type tracks the schema, and the compiler tells you. * * The runtime parse still runs — the static type is a guard-rail, never the guarantee. For input * whose shape genuinely is not known at build time (a stored journal row, a value off the wire), * use {@link verifyNewKeyTransferAddKeyProofFromUnknown}, which is the same check with the * parameter widened and the risk stated at the call site. */ declare const verifyNewKeyTransferAddKeyProof: (input: { expected: INewKeyTransferAddKeyProofExpectation; proof: TNewKeyTransferNormalizedAddKeyProof; }) => TNewKeyTransferAddKeyProofResult; /** * {@link verifyNewKeyTransferAddKeyProof} for a proof whose shape is not known at build time. * Identical checks; the only difference is that the caller has said so explicitly. */ declare const verifyNewKeyTransferAddKeyProofFromUnknown: (input: { expected: INewKeyTransferAddKeyProofExpectation; proof: unknown; }) => TNewKeyTransferAddKeyProofResult; //#endregion //#region src/nice_action/actions/impl/new_key_account_transfer_proof_normalize.d.ts type TNormalizeNearAddKeyProofFailure = "malformed_transaction_status" | "malformed_access_key_list" | "proof_shape_invalid"; type TNormalizeNearAddKeyProofResult = { ok: true; proof: TNewKeyTransferNormalizedAddKeyProof; } | { ok: false; reason: TNormalizeNearAddKeyProofFailure; }; /** * Normalize a raw NEAR transaction-status outcome plus the account's current access-key list into * the shared AddKey proof shape. The result is meant to feed `verifyNewKeyTransferAddKeyProof`, * which owns EVERY authorization decision (exact hash/signer/receiver, exactly-one-AddKey, * full-access destination, finality, execution success, destination-key liveness). */ declare const normalizeNearAddKeyProof: (input: { networkId: "mainnet" | "testnet"; destinationPublicKey: string; /** Raw NEAR RPC transaction-status result (`send_tx` / `EXPERIMENTAL_tx_status`, FINAL wait). */ outcome: unknown; /** * Raw NEAR RPC `view_access_key_list` result for the account, at final finality: every page of * it merged into one `{ keys }` object, or a `{ keys }` holding just the destination key's own * entry (`view_access_key`) — only that key is read here. */ accessKeys: unknown; }) => TNormalizeNearAddKeyProofResult; //#endregion //#region src/nice_action/actions/impl/new_key_account_transfer_state.d.ts /** * Durable state machines for the new-key account transfer (stabilization SD5 ordering). * * Meteor side — the load-bearing change from the pre-stabilization machine: the seed-phrase * backup states sit BEFORE `public_key_published`, so no destination public key is ever released * to the partner (and therefore no key ever reaches the chain) whose recovery phrase the user has * not confirmed in full (SD1/SD2). Import follows verification directly (SD3); the signed * `secured` result is produced only at/after `signer_imported`. * * Two deliberate branch edges: * - `key_stored -> public_key_published` is the Ledger path (backup-exempt per D9; the wallet * must hold on-device confirmation evidence instead — SD2). * - `public_key_published -> signer_imported` is the SD9 guarded import: AddKey landed on-chain * but `verify_active` never arrived and the partner is gone. The wallet may import after a live * destination-FAK chain check, recording `provenance: "unproven"` in its journal beside the * state; such accounts never qualify for source-key DeleteKey (no proven source key exists). * * MNW side — `verify_requested` resolves to `destination_secured` (row came back `secured`) or * `wallet_completion_pending` (row came back `verified_pending_completion`; re-verify later). * Source-cleanup remains separate facts per D12: `source_key_absent` is entered only from * on-chain observation at finality, never from a wallet claim. */ declare const NEW_KEY_TRANSFER_METEOR_ACCOUNT_STATES: readonly ["key_stored", "backup_required", "backed_up", "public_key_published", "activation_verified", "signer_imported", "removal_awaiting_consent", "removal_submitted", "source_key_absent"]; type TNewKeyTransferMeteorAccountState = (typeof NEW_KEY_TRANSFER_METEOR_ACCOUNT_STATES)[number]; declare const NEW_KEY_TRANSFER_MNW_SESSION_STATES: readonly ["created", "start_requested", "start_result_committed"]; type TNewKeyTransferMnwSessionState = (typeof NEW_KEY_TRANSFER_MNW_SESSION_STATES)[number]; declare const NEW_KEY_TRANSFER_MNW_ACCOUNT_STATES: readonly ["add_key_intent", "add_key_submitted", "add_key_finalized", "verify_requested", "wallet_completion_pending", "destination_secured", "source_key_absent", "local_source_cleaned"]; type TNewKeyTransferMnwAccountState = (typeof NEW_KEY_TRANSFER_MNW_ACCOUNT_STATES)[number]; declare const canAdvanceNewKeyTransferMeteorAccountState: (from: TNewKeyTransferMeteorAccountState, to: TNewKeyTransferMeteorAccountState) => boolean; declare const canAdvanceNewKeyTransferMnwSessionState: (from: TNewKeyTransferMnwSessionState, to: TNewKeyTransferMnwSessionState) => boolean; declare const canAdvanceNewKeyTransferMnwAccountState: (from: TNewKeyTransferMnwAccountState, to: TNewKeyTransferMnwAccountState) => boolean; //#endregion //#region src/nice_action/actions/impl/new_key_transfer_reconciliation.d.ts /** * The public reconciliation contract for a FENCED new-key transfer (D33 / A7). * * A journaled `transaction_signed` AddKey whose start-result record is missing or damaged is * correctly fail-closed: the exact bytes may still land on-chain, so nothing new may be started * and the row must not be generically cleared. Before this module the only thing a host could see * was a single `orphanedSignedAddKey: boolean`, which is enough to refuse work and not enough to * do anything about it — every affected browser profile was permanently stranded * (REVIEW-consumer-implementation B-04). * * This module turns that fence into a state a host can actually resolve. It exposes: * * - {@link INewKeyTransferFencedOperation} — the non-secret evidence for one fenced operation. * Deliberately NOT the signed transaction bytes: a host needs to know they exist and are * replayable, never to handle them. * - {@link INewKeyTransferReconciliationReport} — what is fenced, why, and a stable support * reference the user can quote. * - {@link TNewKeyTransferReconcileStatus} — the states the chain-backed state machine in * `createAddKeyJournalRunner().reconcileFencedOperation()` can reach. * * The state machine itself lives with the runner because only the runner holds the chain seam. */ /** Why the transfer surface is fenced. Both states refuse new work; only one carries evidence. */ type TNewKeyTransferFenceReason = /** One or more signed AddKey rows exist with no start-result record to bind them. */ "orphaned_signed_add_key" | /** * The journal could not be parsed. Evidence is unavailable, so no operation can be listed and * the fence cannot be resolved automatically — this is the state that needs a support path. */ "journal_unreadable"; /** * One fenced AddKey operation, in non-secret terms only. * * Every field here is already known to the wallet and the chain: account, the source key that * signed, the destination key that was granted, and the transaction hash. The signed bytes stay * inside the journal — `hasReplayableSignedTransaction` reports only that a rebroadcast is * possible. */ interface INewKeyTransferFencedOperation { transferSessionId: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; sourcePublicKey: string; destinationPublicKey: string; /** `transaction_signed` may still land on-chain; `finalized` already did. */ phase: "transaction_signed" | "finalized"; transactionHash: string; /** True while the exact signed bytes are retained and could be rebroadcast unchanged. */ hasReplayableSignedTransaction: boolean; } interface INewKeyTransferReconciliationReport { /** True while this host must refuse to start or clear a transfer. */ fenced: boolean; reason: TNewKeyTransferFenceReason | null; /** Empty when `reason` is `journal_unreadable` — there is nothing safe to read. */ operations: readonly INewKeyTransferFencedOperation[]; /** * A stable, non-secret reference for support. Derived from the fenced identities, so the same * damaged profile always quotes the same string and two different profiles never collide. * `null` when nothing is fenced. */ supportReference: string | null; } /** What one pass of the chain-backed reconciliation state machine established. */ type TNewKeyTransferReconcileStatus = /** Proven exact and final on-chain. The row is now `finalized`; resume verification. */ "finalized" | /** * The transaction never took effect AND the destination key is absent at final finality. * `archiveReconciledOperation` may now retire the row. */ "destination_key_absent" | /** * The destination key IS on the account but no proof binds it to this transfer. It must be * removed with the source signer, then proven absent, before the row can be retired. */ "destination_key_present_unproven" | /** Chain state could not be established this pass. Nothing changed; retry later. */ "ambiguous" | /** No journal row matches this operation identity — it was already reconciled. */ "not_found"; interface INewKeyTransferReconcileResult { status: TNewKeyTransferReconcileStatus; operation: INewKeyTransferFencedOperation; /** Present for `finalized`; the exact hash proven on-chain. */ transactionHash?: string; /** Machine-readable detail for `ambiguous` / `destination_key_present_unproven`. */ detail?: string; } /** * Every protected (signed or finalized) operation in the journal, optionally narrowed to one * transfer session and/or a set of accounts. * * Unlike {@link buildNewKeyTransferReconciliationReport} this does not care whether the rows are * orphaned: a host revoking destination keys for a transfer that still HAS its start result needs * the same evidence, and needs the same on-chain absence proof before the rows can be retired. */ declare const newKeyTransferProtectedOperations: (entries: readonly TAddKeyJournalEntry[], filter?: { transferSessionId?: string; accountIds?: readonly string[]; }) => INewKeyTransferFencedOperation[]; /** The job identity the chain seam expects, rebuilt from a fenced operation. */ declare const fencedOperationToJob: (operation: INewKeyTransferFencedOperation) => IAddKeyJournalJob; /** * A short, stable, non-secret support reference. * * Hashed rather than assembled from the raw identities: the reference is meant to be pasted into a * support ticket, and a truncated digest correlates a damaged profile without republishing account * ids or public keys through a channel that was never scoped for them. Base32 (no padding, * unambiguous when read aloud or retyped), 16 characters, grouped for legibility. */ declare const newKeyTransferSupportReference: (input: { reason: TNewKeyTransferFenceReason; operations: readonly INewKeyTransferFencedOperation[]; }) => string; /** * Read the fence and everything safe to say about it, without mutating a byte. * * A transfer is fenced when signed AddKey rows exist that no start-result record binds — either * because there is no start result at all, or because the one on file belongs to a different * transfer session. `finalized` rows for the same orphaned session are reported too: they are part * of the same stranded operation set and a host reconciling one needs to see all of them. */ declare const buildNewKeyTransferReconciliationReport: (input: { /** * Parsed journal rows, or `null` when the journal could not be parsed at all. Taking rows rather * than raw storage keeps this module free of any runtime dependency on the journal module, so * the journal and the runner can both import it without a cycle. */ entries: readonly TAddKeyJournalEntry[] | null; /** The transfer session the stored start result binds, or `null` when there is none. */ boundTransferSessionId: string | null; }) => INewKeyTransferReconciliationReport; //#endregion //#region src/nice_action/actions/impl/new_key_transfer_add_key_journal.d.ts /** * Generic D33 AddKey journal machinery for the SOURCE host of a new-key account transfer (A7). * * This module owns the crash-safe three-phase AddKey journal (`intent_recorded` → * `transaction_signed` → `finalized`) plus the two secret-free companion records every source host * must keep across process loss: * * - the **start-result journal** — the wallet's exact signed start output, durable BEFORE the host * acknowledges it into the external-work hold, so a crashed host can resume AddKey without * asking the wallet to mint a different destination key; * - the **pending-verify record** — the complete secret-free verification request, durable AFTER * every AddKey finalized and BEFORE the start-result journal is released. * * Everything here is host-neutral: no chain client, no storage technology, no UI copy. Failures * are typed {@link AddKeyJournalError}s so hosts can keep their own recovery copy while the * invariants stay centralized. Hosts with synchronous storage (web `localStorage`) bind through * {@link createAddKeyJournalStore}; the full submission driver (which adds the chain seam) lives * in `createAddKeyJournalRunner`. */ declare const ADD_KEY_JOURNAL_FORMAT_VERSION = 2; declare const MAX_SIGNED_ADD_KEY_TRANSACTION_BYTES = 4096; declare const MAX_ADD_KEY_JOURNAL_ENTRIES = 1000; /** The three storage slots the AddKey journal machinery persists, overridable per host. */ interface IAddKeyJournalStorageKeys { journal: string; startResult: string; pendingVerify: string; } declare const DEFAULT_ADD_KEY_JOURNAL_STORAGE_KEYS: IAddKeyJournalStorageKeys; type TAddKeyJournalErrorCode = "journal_unreadable" | "journal_unsupported_shape" | "journal_duplicate_operations" | "journal_operation_conflict" | "journal_record_mismatch" | "journal_persist_failed" | "access_keys_malformed" | "destination_key_unproven" | "source_key_missing" | "source_key_not_full_access" | "signed_transaction_invalid" | "broadcast_ambiguous" | "finalized_proof_invalid" | "start_result_conflict" | "start_result_corrupt" | "start_result_persist_failed" | "start_result_clear_failed" | "pending_verify_conflict" | "pending_verify_corrupt" | "pending_verify_persist_failed"; /** * Typed failure for every AddKey journal invariant. The default messages are safe host-neutral * copy; hosts that want their own recovery wording switch on {@link AddKeyJournalError.code}. */ declare class AddKeyJournalError extends Error { readonly code: TAddKeyJournalErrorCode; constructor(code: TAddKeyJournalErrorCode, message: string, options?: { cause?: unknown; }); } declare const vAddKeyIntentJournalEntry: v.StrictObjectSchema<{ readonly phase: v.LiteralSchema<"intent_recorded", undefined>; readonly operationVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly blockchainId: v.LiteralSchema<"near", undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>; declare const vAddKeySignedJournalEntry: v.StrictObjectSchema<{ readonly phase: v.LiteralSchema<"transaction_signed", undefined>; readonly transactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly signedTransactionBase64: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly operationVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly blockchainId: v.LiteralSchema<"near", undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>; declare const vAddKeyFinalizedJournalEntry: v.StrictObjectSchema<{ readonly phase: v.LiteralSchema<"finalized", undefined>; readonly transactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly operationVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly blockchainId: v.LiteralSchema<"near", undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>; declare const vAddKeyJournalEntry: v.UnionSchema<[v.StrictObjectSchema<{ readonly phase: v.LiteralSchema<"intent_recorded", undefined>; readonly operationVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly blockchainId: v.LiteralSchema<"near", undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>, v.StrictObjectSchema<{ readonly phase: v.LiteralSchema<"transaction_signed", undefined>; readonly transactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly signedTransactionBase64: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly operationVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly blockchainId: v.LiteralSchema<"near", undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>, v.StrictObjectSchema<{ readonly phase: v.LiteralSchema<"finalized", undefined>; readonly transactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly operationVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly blockchainId: v.LiteralSchema<"near", undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>], undefined>; declare const vAddKeyJournal: v.StrictObjectSchema<{ readonly formatVersion: v.LiteralSchema<2, undefined>; readonly entries: v.SchemaWithPipe; readonly operationVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly blockchainId: v.LiteralSchema<"near", undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>, v.StrictObjectSchema<{ readonly phase: v.LiteralSchema<"transaction_signed", undefined>; readonly transactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly signedTransactionBase64: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly operationVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly blockchainId: v.LiteralSchema<"near", undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>, v.StrictObjectSchema<{ readonly phase: v.LiteralSchema<"finalized", undefined>; readonly transactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly operationVersion: v.LiteralSchema<1, undefined>; readonly transferSessionId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly blockchainId: v.LiteralSchema<"near", undefined>; readonly networkId: v.PicklistSchema<["mainnet", "testnet"], undefined>; readonly accountId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly sourcePublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly destinationPublicKey: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>], undefined>, undefined>, v.MaxLengthAction<({ phase: "intent_recorded"; operationVersion: 1; transferSessionId: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; sourcePublicKey: string; destinationPublicKey: string; } | { phase: "transaction_signed"; transactionHash: string; signedTransactionBase64: string; operationVersion: 1; transferSessionId: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; sourcePublicKey: string; destinationPublicKey: string; } | { phase: "finalized"; transactionHash: string; operationVersion: 1; transferSessionId: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; sourcePublicKey: string; destinationPublicKey: string; })[], 1000, undefined>]>; }, undefined>; type TAddKeyJournalEntry = v.InferOutput; type TAddKeyIntentJournalEntry = v.InferOutput; type TAddKeySignedJournalEntry = v.InferOutput; type TAddKeyFinalizedJournalEntry = v.InferOutput; /** One AddKey operation's full identity — the exact keys the journal converges on. */ interface IAddKeyJournalJob { transferSessionId: string; blockchainId: "near"; networkId: "mainnet" | "testnet"; accountId: string; sourcePublicKey: string; destinationPublicKey: string; } /** * Parse the serialized mutation journal without narrowing or dropping malformed rows. Returning an * empty journal for damaged storage could cause a second AddKey, so corruption is deliberately a * hard stop. */ declare const parseAddKeyJournalEntries: (serialized: string | null | undefined) => TAddKeyJournalEntry[]; /** Validate and serialize the journal for persistence; duplicate operations fail closed. */ declare const serializeAddKeyJournalEntries: (entries: readonly TAddKeyJournalEntry[]) => string; /** * Replace (or insert) one operation's journal entry. An existing record for the same operation id * with DIFFERENT key material is a conflicting concurrent transfer and fails closed. */ declare const replaceAddKeyJournalEntry: (entries: readonly TAddKeyJournalEntry[], entry: TAddKeyJournalEntry) => TAddKeyJournalEntry[]; /** * Find the journal entry for one job, requiring the stored record to match the job's EXACT key * material — a partial match is a different transfer and fails closed. */ declare const findAddKeyJournalEntry: (entries: readonly TAddKeyJournalEntry[], job: IAddKeyJournalJob) => TAddKeyJournalEntry | null; /** * Signed/finalized operations cannot be abandoned by a generic "start fresh" reset. A malformed * journal must fence reset just as it fences submission, so corruption reports `true`. */ declare const addKeyJournalHasProtectedRecovery: (serialized: string | null | undefined, transferSessionId: string) => boolean; /** Global fence for a replayable artifact whose start-result record was lost or damaged. */ declare const addKeyJournalHasOrphanedSignedRecovery: (serialized: string | null | undefined) => boolean; /** * * [ START-RESULT JOURNAL ] * */ interface IJournaledNewKeyStartResult { formatVersion: 1; resultHash: string; output: TNewKeyTransferStartOutputV1; } type TReceivedNewKeyStartResult = { accepted: true; journal: IJournaledNewKeyStartResult; } | { accepted: false; reason: string; }; declare const parseJournaledNewKeyStartResult: (serialized: string | null | undefined) => IJournaledNewKeyStartResult | null; /** * Validate one start result into its durable journal form, refusing to displace a DIFFERENT * remembered transfer (only an exact re-remember of the same session + result hash converges). */ declare const buildJournaledNewKeyStartResult: (input: { existingSerialized: string | null | undefined; resultHash: string; output: TNewKeyTransferStartOutputV1; }) => { journal: IJournaledNewKeyStartResult; serialized: string; }; /** * Consume a signed start result against the exact remembered request. A validation failure is a * transport RECEIPT, never an acceptance: nothing durable may be touched, and the caller still * acknowledges receipt so the session is not parked in `result_ready`. */ declare const consumeSignedNewKeyStartResult: (input: { request: TNewKeyTransferStartInputV1; resultHash: string; actionResult: IActionPayload_Result_JsonObject; existingSerialized: string | null | undefined; }) => { accepted: true; journal: IJournaledNewKeyStartResult; serialized: string; } | { accepted: false; reason: string; }; /** * Parse the complete, secret-free verification request recorded after every AddKey finalized. * Exact-key validation prevents a malformed or future storage shape from being silently narrowed * into a request the user did not save. */ declare const parsePendingNewKeyVerification: (serialized: string | null | undefined) => TNewKeyTransferVerifyActiveInputV1 | null; /** * Validate one verification request into its durable form, refusing to displace a DIFFERENT * pending proof (only a byte-identical re-remember converges). */ declare const buildPendingNewKeyVerification: (input: { existingSerialized: string | null | undefined; verifyInput: TNewKeyTransferVerifyActiveInputV1; }) => { parsed: TNewKeyTransferVerifyActiveInputV1; serialized: string; }; /** * * [ SYNCHRONOUS STORE BINDING ] * */ /** Minimal synchronous storage; web `localStorage` satisfies it directly. */ interface IAddKeyJournalSyncStorage { getItem(key: string): string | null; setItem(key: string, value: string): void; removeItem(key: string): void; } /** * The record/guard surface of the AddKey journal machinery. The synchronous binding exists for * hosts whose storage is synchronous (web `localStorage`) and whose UIs read journal state during * render; `createAddKeyJournalRunner` exposes the same surface asynchronously plus the chain * driver. */ interface IAddKeyJournalStore { loadJournalEntries(): TAddKeyJournalEntry[]; hasProtectedRecovery(transferSessionId: string): boolean; hasOrphanedSignedRecovery(): boolean; /** * The non-secret evidence behind the fence, for a host that needs to show a user what is stuck * (B-04). Record-only: resolving the fence needs chain calls and lives on the runner. */ buildReconciliationReport(): INewKeyTransferReconciliationReport; rememberStartResult(input: { resultHash: string; output: TNewKeyTransferStartOutputV1; }): IJournaledNewKeyStartResult; receiveSignedStartResult(input: { request: TNewKeyTransferStartInputV1; resultHash: string; actionResult: IActionPayload_Result_JsonObject; }): TReceivedNewKeyStartResult; loadStartResult(): IJournaledNewKeyStartResult | null; discardStartResult(): boolean; loadPendingVerification(): TNewKeyTransferVerifyActiveInputV1 | null; rememberPendingVerification(verifyInput: TNewKeyTransferVerifyActiveInputV1): TNewKeyTransferVerifyActiveInputV1; clearPendingVerification(transferSessionId: string): boolean; discardPendingVerification(): boolean; commitVerificationIntent(verifyInput: TNewKeyTransferVerifyActiveInputV1): TNewKeyTransferVerifyActiveInputV1; } declare const createAddKeyJournalStore: (input: { storage: IAddKeyJournalSyncStorage; storageKeys?: Partial; }) => IAddKeyJournalStore; //#endregion //#region src/nice_action/actions/impl/new_key_transfer_add_key_runner.d.ts /** * The crash-safe AddKey submission engine (A7): the full D33 journal driver over two seams — * a minimal storage-methods interface (sync or async; NO storage technology baked in) and a chain * interface carrying the NEAR RPC calls. It owns every invariant a source host would otherwise * have to re-prove: * * - **journal-before-everything**: the journal is read (and fails closed on ANY corruption) * before the first chain call; * - **durable intent before signing**; **durable exact signed bytes/hash before broadcast**; * - **same-byte-only rebroadcast**: an ambiguous broadcast never builds a replacement transaction — * it reconciles the precomputed hash, and a retry rebroadcasts only the identical journaled * bytes; * - **finality verified through the shared proof verifier** (exact hash/signer/receiver, * exactly-one-AddKey, full-access destination, execution success, destination-key liveness) * before the replayable bytes are replaced by the finalized checkpoint; * - **fail-closed convergence**: duplicate operation records, mismatched recovery records, and a * destination key present without journaled proof all refuse submission. */ interface IAddKeyJournalStorageMethods { getItem(key: string): string | null | undefined | Promise; setItem(key: string, value: string): void | Promise; removeItem(key: string): void | Promise; } /** * The `getString`/`setString` vocabulary `StorageAdapter` speaks (`nice-code/util`, re-exported by * `@meteorwallet/connect`). Accepted directly so a host that already built a storage adapter for the * client does not have to hand-write an adapter-of-an-adapter just to reach the journal runner. */ interface IAddKeyJournalStorageStringMethods { getString(key: string): string | null | undefined | Promise; setString(key: string, value: string): void | Promise; removeItem(key: string): void | Promise; } /** Either storage vocabulary; {@link createAddKeyJournalRunner} normalizes them. */ type TAddKeyJournalStorage = IAddKeyJournalStorageMethods | IAddKeyJournalStorageStringMethods; interface IAddKeySignedTransaction { transactionHash: string; signedTransactionBase64: string; } /** * The chain seam. Every method receives the full job identity; implementations close over their * chain client and signing material (signing keys NEVER reach this module). */ interface IAddKeyJournalChain { /** * Raw NEAR RPC `view_access_key_list` result for the job's account, at final finality — the * COMPLETE list. Nodes refuse the unpaginated request for an account with more than 100 keys * (`TOO_MANY_ACCESS_KEYS`), so read it page by page (`limit`/`after_key`, later pages pinned to * the first page's `block_id`) and answer with every page's `keys` in one `{ keys }` object. */ getAccessKeys(job: IAddKeyJournalJob): Promise; /** Build and sign the exact AddKey transaction. MUST NOT broadcast anything. */ signAddKeyTransaction(job: IAddKeyJournalJob): Promise; /** * Broadcast the exact signed bytes with FINAL wait; returns the raw transaction-status outcome. * A thrown error is treated as AMBIGUOUS (the transaction may still land) and reconciled. */ broadcastSignedTransaction(job: IAddKeyJournalJob, signed: IAddKeySignedTransaction): Promise; /** Raw transaction-status for a precomputed hash, with FINAL wait. */ getFinalTransactionStatus(job: IAddKeyJournalJob, transactionHash: string): Promise; /** * Whether these exact signed bytes can NEVER be accepted by the chain any more. * * Used only by the reconciliation state machine, and only to separate "has not landed yet" from * "can no longer land". Absence of the destination key is not by itself evidence that a signed * transaction is dead — it may simply be in flight — so without a definitive answer here * reconciliation stays `ambiguous` rather than retiring a row that could still take effect. * * A NEAR host can implement this by rebroadcasting the exact bytes and mapping * `InvalidTxError::Expired` (the transaction's block hash has fallen outside the validity * window) to `true`. Returning `false` when unsure is correct; throwing is treated as unknown. * * Optional: a host that cannot determine expiry never reaches `destination_key_absent` * automatically and reconciles through explicit revocation instead. */ isSignedTransactionExpired?(job: IAddKeyJournalJob, signed: IAddKeySignedTransaction): Promise; } interface IAddKeyJournalRunnerConfig { storage: TAddKeyJournalStorage; chain: IAddKeyJournalChain; storageKeys?: Partial; /** * Serializes whole submissions across every tab/process sharing this storage (e.g. a Web Lock on * multi-tab web). Defaults to per-runner serialization, which is only sufficient when this * process is the storage's sole writer. */ withMutationLock?: (operation: () => Promise) => Promise; } /** Async record/guard surface plus the submission driver. */ interface IAddKeyJournalRunner { /** * Submit one account's AddKey through the crash-safe journal; returns the finalized transaction * hash. Idempotent per journal state: finalized entries reconcile, signed entries rebroadcast * the identical bytes, and fresh jobs record intent before signing. */ submitAddKey(job: IAddKeyJournalJob): Promise; loadJournalEntries(): Promise; hasProtectedRecovery(transferSessionId: string): Promise; hasOrphanedSignedRecovery(): Promise; rememberStartResult(input: { resultHash: string; output: TNewKeyTransferStartOutputV1; }): Promise; receiveSignedStartResult(input: { request: TNewKeyTransferStartInputV1; resultHash: string; actionResult: IActionPayload_Result_JsonObject; }): Promise; loadStartResult(): Promise; discardStartResult(): Promise; loadPendingVerification(): Promise; rememberPendingVerification(verifyInput: TNewKeyTransferVerifyActiveInputV1): Promise; clearPendingVerification(transferSessionId: string): Promise; discardPendingVerification(): Promise; commitVerificationIntent(verifyInput: TNewKeyTransferVerifyActiveInputV1): Promise; /** * Non-secret evidence for whatever is fencing this host, without mutating anything. Empty * `operations` with reason `journal_unreadable` means the fence cannot be resolved from stored * data — that is the case that needs the support reference. */ buildReconciliationReport(): Promise; /** * Advance ONE fenced operation as far as the chain allows. Never destructive: the only mutation * it can make is promoting a proven `transaction_signed` row to `finalized`. */ reconcileFencedOperation(operation: INewKeyTransferFencedOperation): Promise; /** * Retire a fenced row once its destination key is proven ABSENT on-chain at final finality — * either because the transaction can never land (`destination_key_absent`) or because the host * removed the key with the source signer and waited for finality. Re-proves absence itself; a * caller's assurance is never taken at face value. Returns `false` when it refused. */ archiveReconciledOperation(operation: INewKeyTransferFencedOperation): Promise; } declare const createAddKeyJournalRunner: (config: IAddKeyJournalRunnerConfig) => IAddKeyJournalRunner; //#endregion //#region src/nice_action/actions/impl/new_key_transfer_completion.d.ts /** * Wallet-completion primitives for the new-key transfer stabilization: * * - SD2 backup-confirmation evidence — the journal-level proof a wallet must hold before it may * mark a seed-phrase session `backed_up` and publish destination keys. A UI boolean is never * sufficient; the wallet's journal-mutation API takes this object and validates it. * - SD13 activation self-test ("liveness transfer") — the optional 1-yoctoNEAR transfer each * transferred account sends to the team-owned migration receiver during the verify turn, after * proof + import, as an end-to-end signing check. Strictly additive to the AddKey proof. * * Both wallets and the demo references consume these single definitions so the receiver ids, * bounds, and outcome shapes can never drift per consumer. */ declare const NEW_KEY_TRANSFER_BACKUP_EVIDENCE_FORMAT_VERSION = 1; declare const NEW_KEY_TRANSFER_BACKUP_METHODS: readonly ["full_phrase_word_selection", "full_phrase_reentry", "first_last_word_selection"]; /** How many words a `first_last_word_selection` confirmation proves: exactly the two endpoints. */ declare const NEW_KEY_TRANSFER_FIRST_LAST_CONFIRMED_WORD_COUNT = 2; /** * Normalize a recovery phrase exactly the way derivation does (trim, collapse whitespace, * lowercase, NFKD) so the evidence hash is stable across renderings of the same phrase. */ declare const normalizeNewKeyTransferRecoveryPhrase: (phrase: string) => string; /** * One-way commitment to the confirmed phrase. The evidence stores ONLY this hash — never words, * word indexes' values, or any recoverable fragment of the phrase. */ declare const hashNewKeyTransferRecoveryPhrase: (phrase: string) => string; declare const vNewKeyTransferBackupEvidenceV1: v.SchemaWithPipe; readonly method: v.PicklistSchema; /** Phrase length in words. The transfer flow issues standard 12- or 24-word phrases only. */ readonly wordCount: v.PicklistSchema<[12, 24], undefined>; /** How many words the user confirmed. The per-method requirement is enforced below. */ readonly confirmedWordCount: v.SchemaWithPipe, v.IntegerAction, v.MinValueAction]>; /** {@link hashNewKeyTransferRecoveryPhrase} of the confirmed phrase (standard base64, 32 bytes). */ readonly phraseSha256Base64: v.SchemaWithPipe, v.LengthAction]>; readonly confirmedAt: v.SchemaWithPipe, v.CheckAction]>; }, undefined>, v.CheckAction<{ formatVersion: 1; method: "full_phrase_word_selection" | "full_phrase_reentry" | "first_last_word_selection"; wordCount: 12 | 24; confirmedWordCount: number; phraseSha256Base64: string; confirmedAt: number; }, "Full-phrase methods must confirm every word; the first/last spot-check confirms exactly two">]>; type TNewKeyTransferBackupEvidenceV1 = v.InferOutput; /** * The store-level gate for advancing `backup_required -> backed_up`: the evidence must parse, be * complete, and commit to exactly the session phrase the wallet holds. */ declare const isCompleteNewKeyTransferBackupEvidence: (input: { evidence: unknown; sessionPhrase: string; }) => boolean; /** * Team-owned migration receivers. These accounts MUST exist and be controlled by the Meteor team * on their networks before the self-test is enabled anywhere (stabilization plan Phase 6.6) — a * NEAR transfer to a non-existent named account fails. */ declare const NEW_KEY_TRANSFER_LIVENESS_RECEIVER_ACCOUNT_IDS: { readonly mainnet: "meteor-migrate.near"; readonly testnet: "meteor-migrate.testnet"; }; declare const resolveNewKeyTransferLivenessReceiver: (networkId: TCryptoGenericNetworkId) => string; /** The self-test sends exactly this amount; its value is deliberately irrelevant. */ declare const NEW_KEY_TRANSFER_LIVENESS_AMOUNT_YOCTO = 1n; /** * Available-balance floor below which the self-test is skipped rather than attempted: a transfer * action costs ~0.00005 N in gas, so 0.0005 N keeps a 10× margin without ever blocking a * low-balance account's completion (Phase 0.4 default). */ declare const NEW_KEY_TRANSFER_LIVENESS_MIN_AVAILABLE_BALANCE_YOCTO = 500000000000000000000n; /** Bounded fan-out so a 30-account batch fits the 5-minute turn window with margin (Phase 0.4). */ declare const NEW_KEY_TRANSFER_LIVENESS_MAX_CONCURRENCY = 4; /** Bounded broadcast attempts before an uncertain outcome becomes `skipped` (never a block). */ declare const NEW_KEY_TRANSFER_LIVENESS_MAX_ATTEMPTS = 2; declare const NEW_KEY_TRANSFER_LIVENESS_SKIP_REASONS: readonly ["policy_disabled", "insufficient_balance", "rpc_uncertain"]; declare const NEW_KEY_TRANSFER_LIVENESS_FAILURE_REASONS: readonly ["signing_failed", "execution_failed"]; /** * The wallet-journal record of one account's self-test. `confirmed` and `failed` are terminal; * a re-entrant verify reuses a journaled `confirmed`/`skipped` outcome and NEVER re-sends a * confirmed test, while `failed` is retried on the next verify. Maps onto the wire as: * `confirmed`/`skipped` → `secured` + `liveness`; `failed` → `verified_pending_completion` + * `pendingFact: "liveness_check_failed"`. */ declare const vNewKeyTransferLivenessOutcomeV1: v.UnionSchema<[v.ObjectSchema<{ readonly status: v.LiteralSchema<"confirmed", undefined>; readonly transactionHash: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; readonly confirmedAt: v.SchemaWithPipe, v.CheckAction]>; }, undefined>, v.ObjectSchema<{ readonly status: v.LiteralSchema<"skipped", undefined>; readonly reason: v.PicklistSchema; }, undefined>, v.ObjectSchema<{ readonly status: v.LiteralSchema<"failed", undefined>; readonly reason: v.PicklistSchema; readonly failedAt: v.SchemaWithPipe, v.CheckAction]>; }, undefined>], undefined>; type TNewKeyTransferLivenessOutcomeV1 = v.InferOutput; declare const parseNewKeyTransferLivenessOutcomeV1: (outcome: unknown) => TNewKeyTransferLivenessOutcomeV1; //#endregion //#region src/nice_realm/session_realm.d.ts /** * `bridge_session_realm` — the view-sliced projection of a `session_v1` session (plan §9.4). A * It is hosted in the session bridge DO; a wallet attaching with an unknown or stale definition * gets the typed `realm_unknown`/`schema_mismatch` refusal. * * Contract posture (0.79.0 surface, §8.4 N5/N6): * - every `t.schema` leaf carries a `hashTag` from birth — bump the tag on ANY leaf-contract * change so stale clients fail at attach instead of only failing CI fixtures; * - everything else uses bounded primitives (`t.number({min,max,integer})`, * `t.string({maxLength})`), enforced state-aware against the candidate next state of every * commit INCLUDING server `update()` output — an over-bound projection fails the realm commit * and takes the D21 projection-repair path, never a broadcast; * - all paths are `r.serverOnly` (clients only observe); * - realm state is a disposable materialized view — `stateRevision` is projected as the bounded * synchronization fence, and every leaf derives from the committed session/turn snapshot. * * View slicing is role separation, not an authorization boundary: the E2E * envelopes, salt-hash gate, and handler signature checks carry authorization. No secret (PIN, * salts, keys, plaintext results) ever enters this realm. */ declare enum ESessionRealmAvatar { wallet = "wallet", partner = "partner" } /** Partner-facing E2E result relay for the CURRENT turn, bound to its exact identity. */ declare const vSessionRealmTurnResult: v.StrictObjectSchema<{ readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly requestHash: v.CustomSchema | undefined>; readonly resultHash: v.CustomSchema | undefined>; readonly resultEnvelopeEncrypted: v.ObjectSchema<{ readonly nonce: v.CustomSchema | undefined>; readonly ciphertext: v.CustomSchema | undefined>; }, undefined>; readonly walletResultEnvelopeSignatureBase64: v.CustomSchema | undefined>; }, undefined>; /** * Wallet-facing signed plaintext turn delivery (non-sensitive actions, post-authorization). Carries * the COMPLETE signed envelope fields so the wallet can rebuild the exact stage/submit canonical * challenge and verify `partnerTurnSignatureBase64` independently (§5.4). */ declare const vSessionRealmTurnRequest: v.StrictObjectSchema<{ readonly sequence: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction, v.MaxValueAction]>; readonly turnId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly operationId: v.SchemaWithPipe, v.MinLengthAction, v.MaxLengthAction, v.RegexAction]>; readonly issuedAt: v.SchemaWithPipe, v.SafeIntegerAction, v.MinValueAction]>; readonly recoveryContractHash: v.CustomSchema | undefined>; readonly requestHash: v.CustomSchema | undefined>; readonly priorResultHash: v.NullableSchema | undefined>, undefined>; readonly actionRequest: v.CustomSchema, string>, undefined>; readonly partnerTurnSignatureBase64: v.CustomSchema | undefined>; }, undefined>; declare const vSessionRealmFailureCode: v.PicklistSchema<["wallet_update_required", "pin_attempts_exceeded", "trusted_link_revoked", "bridge_failed", "bridge_expired", "session_closed"], undefined>; type TSessionRealmFailureCode = v.InferOutput; declare const bridge_session_realm: IRealmDefinition<{ authorizationMode: ESessionAuthorizationMode; interactionMode: EBridgeInteractionMode; maxRedialAttempts: number; resourceProfile: ESessionResourceProfile; maxTurns: number; phase: ESessionPhase; stateRevision: number; idleExpiresAt: number; absoluteExpiresAt: number; closeAfterTurn: boolean; closeAfterResultAck: boolean; externalWorkHoldConsumed: boolean; requestHash?: string | undefined; authorizationLevel?: ESessionAuthorizationLevel | undefined; authorizationLinkIncarnation?: string | undefined; sequence?: number | undefined; turnId?: string | undefined; clientConnection?: { linkConfirmationReceipt?: { confirmation: { version: 1; bridgeId: string; bridgeLease: string; walletPerId: string; accountIncarnation: string; walletVerifyPublicKey: `ed25519::raw_base64::${string}`; walletExchangePublicKey: `x25519::raw_base64::${string}`; partnerId: string; partnerVerifyPublicKey: `ed25519::raw_base64::${string}`; partnerExchangePublicKey: `x25519::raw_base64::${string}`; partnerMetadata: { name: string; origin: `web_url::${string}`; description?: string | undefined; iconUrl?: string | undefined; }; requestHash: string; authorizationMode: "partner_link"; rememberPartner: true; operationId: string; issuedAt: number; expiresAt: number; }; signatureBase64: string; } | undefined; meteorAppId: EMeteorAppId; walletExchangePublicKey: `x25519::raw_base64::${string}`; walletVerifyPublicKey: `ed25519::raw_base64::${string}`; walletProtocolVersion: number; walletCapabilities: v.EnumValues[]; } | undefined; failureCode?: "wallet_update_required" | "pin_attempts_exceeded" | "trusted_link_revoked" | "bridge_failed" | "bridge_expired" | "session_closed" | undefined; turnRequest?: { sequence: number; turnId: string; operationId: string; issuedAt: number; recoveryContractHash: string; requestHash: string; priorResultHash: string | null; actionRequest: IActionPayload_Request_JsonObject, string>; partnerTurnSignatureBase64: string; } | undefined; turnRequestEncrypted?: { nonce: string; ciphertext: string; } | undefined; turnResult?: { sequence: number; turnId: string; requestHash: string; resultHash: string; resultEnvelopeEncrypted: { nonce: string; ciphertext: string; }; walletResultEnvelopeSignatureBase64: string; } | undefined; }, ESessionRealmAvatar, undefined, Record, { interactionMode: ISchemaStandard; phase: ISchemaStandard>; resourceProfile: ISchemaStandard>; maxTurns: ISchemaNumber; maxRedialAttempts: ISchemaNumber; authorizationMode: ISchemaStandard>; authorizationLevel: ISchemaOptional>>; authorizationLinkIncarnation: ISchemaOptional>; stateRevision: ISchemaNumber; sequence: ISchemaOptional; turnId: ISchemaOptional; requestHash: ISchemaOptional; idleExpiresAt: ISchemaNumber; absoluteExpiresAt: ISchemaNumber; closeAfterTurn: ISchemaBoolean; closeAfterResultAck: ISchemaBoolean; externalWorkHoldConsumed: ISchemaBoolean; failureCode: ISchemaOptional<"wallet_update_required" | "pin_attempts_exceeded" | "trusted_link_revoked" | "bridge_failed" | "bridge_expired" | "session_closed", ISchemaStandard<"wallet_update_required" | "pin_attempts_exceeded" | "trusted_link_revoked" | "bridge_failed" | "bridge_expired" | "session_closed">>; turnRequest: ISchemaOptional<{ sequence: number; turnId: string; operationId: string; issuedAt: number; recoveryContractHash: string; requestHash: string; priorResultHash: string | null; actionRequest: IActionPayload_Request_JsonObject, string>; partnerTurnSignatureBase64: string; }, ISchemaStandard<{ sequence: number; turnId: string; operationId: string; issuedAt: number; recoveryContractHash: string; requestHash: string; priorResultHash: string | null; actionRequest: IActionPayload_Request_JsonObject, string>; partnerTurnSignatureBase64: string; }>>; turnRequestEncrypted: ISchemaOptional<{ nonce: string; ciphertext: string; }, ISchemaStandard<{ nonce: string; ciphertext: string; }>>; clientConnection: ISchemaOptional<{ linkConfirmationReceipt?: { confirmation: { version: 1; bridgeId: string; bridgeLease: string; walletPerId: string; accountIncarnation: string; walletVerifyPublicKey: `ed25519::raw_base64::${string}`; walletExchangePublicKey: `x25519::raw_base64::${string}`; partnerId: string; partnerVerifyPublicKey: `ed25519::raw_base64::${string}`; partnerExchangePublicKey: `x25519::raw_base64::${string}`; partnerMetadata: { name: string; origin: `web_url::${string}`; description?: string | undefined; iconUrl?: string | undefined; }; requestHash: string; authorizationMode: "partner_link"; rememberPartner: true; operationId: string; issuedAt: number; expiresAt: number; }; signatureBase64: string; } | undefined; meteorAppId: EMeteorAppId; walletExchangePublicKey: `x25519::raw_base64::${string}`; walletVerifyPublicKey: `ed25519::raw_base64::${string}`; walletProtocolVersion: number; walletCapabilities: v.EnumValues[]; }, ISchemaStandard<{ linkConfirmationReceipt?: { confirmation: { version: 1; bridgeId: string; bridgeLease: string; walletPerId: string; accountIncarnation: string; walletVerifyPublicKey: `ed25519::raw_base64::${string}`; walletExchangePublicKey: `x25519::raw_base64::${string}`; partnerId: string; partnerVerifyPublicKey: `ed25519::raw_base64::${string}`; partnerExchangePublicKey: `x25519::raw_base64::${string}`; partnerMetadata: { name: string; origin: `web_url::${string}`; description?: string | undefined; iconUrl?: string | undefined; }; requestHash: string; authorizationMode: "partner_link"; rememberPartner: true; operationId: string; issuedAt: number; expiresAt: number; }; signatureBase64: string; } | undefined; meteorAppId: EMeteorAppId; walletExchangePublicKey: `x25519::raw_base64::${string}`; walletVerifyPublicKey: `ed25519::raw_base64::${string}`; walletProtocolVersion: number; walletCapabilities: v.EnumValues[]; }>>; turnResult: ISchemaOptional<{ sequence: number; turnId: string; requestHash: string; resultHash: string; resultEnvelopeEncrypted: { nonce: string; ciphertext: string; }; walletResultEnvelopeSignatureBase64: string; }, ISchemaStandard<{ sequence: number; turnId: string; requestHash: string; resultHash: string; resultEnvelopeEncrypted: { nonce: string; ciphertext: string; }; walletResultEnvelopeSignatureBase64: string; }>>; }, "bridge_session_realm">; type TSessionRealmState = TInferRealmState; /** Genesis projection for a freshly allocated (still private, unclaimable) session. */ declare const sessionRealmGenesisState: (facts: { idleExpiresAt: number; absoluteExpiresAt: number; resourceProfile?: ESessionResourceProfile; authorizationMode?: ESessionAuthorizationMode; }) => { readonly interactionMode: EBridgeInteractionMode; readonly phase: ESessionPhase.initializing; readonly resourceProfile: ESessionResourceProfile; readonly maxTurns: number; readonly maxRedialAttempts: number; readonly authorizationMode: ESessionAuthorizationMode; readonly stateRevision: 0; readonly idleExpiresAt: number; readonly absoluteExpiresAt: number; readonly closeAfterTurn: false; readonly closeAfterResultAck: false; readonly externalWorkHoldConsumed: false; }; //#endregion //#region src/utils/serialization/client_keys/ClientKeySerialization.types.d.ts interface IClientKeys_PublicKeys_Serialized { signingPublicKeySerialized: TSerializedCryptoKeyData_Ed25519_Raw; exchangePublicKeySerialized: TSerializedCryptoKeyData_X25519_Raw; } interface IClientKeys_Serialized { signingKeyPairSerialized: { private: TSerializedCryptoKeyData_Ed25519_Jwk; public: TSerializedCryptoKeyData_Ed25519_Raw; }; exchangeKeyPairSerialized: { private: TSerializedCryptoKeyData_X25519_Jwk; public: TSerializedCryptoKeyData_X25519_Raw; }; } interface IClientKeys_Deserialized { signingKeyPair: CryptoKeyPair; exchangeKeyPair: CryptoKeyPair; } interface IClientKeys_Combined extends IClientKeys_Serialized, IClientKeys_Deserialized {} //#endregion //#region src/utils/serialization/client_keys/ClientKeySerialization.d.ts declare const ClientKeySerialization: { /** * Serializes IBridgeKeysInput into the standard persisted format for Third Party clients. */ serializeClientKeys(keys: IClientKeys_Deserialized): Promise; /** * Deserializes the persisted format back into IBridgeKeysInput for Third Party clients. */ deserializeClientKeys(serialized: IClientKeys_Serialized): Promise; }; //#endregion export { TAddKeyJournalEntry as $, TSessionPushClassification as $a, vWalletProtocolCapability as $c, TWalletClient_RevokePartner_Input as $i, NEW_KEY_ACCOUNT_TRANSFER_MAX_ACCOUNTS as $n, vSession_Complete_Input as $o, vAllAccountsTransferDataEncrypted as $r, BRIDGE_LEASE_MAX_LENGTH as $s, NEAR_DEFAULT_DERIVATION_PATH as $t, resolveNewKeyTransferLivenessReceiver as A, ICanonicalChallenge as Aa, TSerializedCryptoKeyData_Ed25519_Jwk as Ac, getActionAllowedResourceProfiles as Ai, EErr_NewKeyAccountTransfer as Al, ACCOUNT_IMPORT_MAX_ACTIVE_RECEIPTS as An, TSession_NotifyWalletTurn_Input as Ao, TRANSFER_ACCOUNTS_FORMAT_VERSION as Ar, SESSION_OPERATION_MAX_FUTURE_SKEW_MILLIS as As, NEW_KEY_TRANSFER_MNW_ACCOUNT_STATES as At, createAddKeyJournalRunner as B, MAX_SESSION_PUSH_SEALED_JSON_LENGTH as Ba, TSerializedKeyData as Bc, WALLET_PUSH_TOKEN_MAX_AGE_MILLIS as Bi, accountImportKey as Bn, vSessionFacts as Bo, TRANSFER_ACCOUNTS_MIN_ACCOUNTS as Br, vSessionAuthorizationMode as Bs, normalizeNearAddKeyProof as Bt, NEW_KEY_TRANSFER_LIVENESS_SKIP_REASONS as C, vRegisterPartnerConnection_Input as Ca, ECryptoKeyFormat as Cc, TActionDeliveryMode as Ci, vMeteorBridgeWalletLinkWithMeta as Cl, validateNewKeyTransferStartOutputForInput as Cn, TSession_Close_Output as Co, TNewKeyTransferStartOutputV1 as Cr, MAX_SESSION_WS_OPERATION_BYTES as Cs, TNewKeyTransferFenceReason as Ct, isCompleteNewKeyTransferBackupEvidence as D, buildSessionLinkConfirmationChallenge as Da, ISerializedKeyData_X25519_Raw as Dc, TActionResourceProfile as Di, merr_wallet_client as Dl, merr_demo_wallet_review as Dn, TSession_Create_Input as Do, TNewKeyTransferVerifyActiveOutputAccountV1 as Dr, SESSION_MAX_REDIAL_ATTEMPTS as Ds, newKeyTransferProtectedOperations as Dt, hashNewKeyTransferRecoveryPhrase as E, TSessionLinkConfirmationReceipt as Ea, ISerializedKeyData_X25519_Jwk as Ec, TActionRequestValidationResult as Ei, EErr_WalletClient as El, act_impl_meteor_connect_demo as En, TSession_ConfirmLink_Input as Eo, TNewKeyTransferVerifyActiveIssueV1 as Er, SESSION_MAX_ABSOLUTE_LIFETIME_MILLIS as Es, fencedOperationToJob as Et, IAddKeyJournalRunnerConfig as F, hashCanonicalJsonSha256Base64 as Fa, TSerializedCryptoKeyData_X25519_Jwk_Transformed as Fc, validateKnownFirstPartyActionRequest as Fi, merr_connect_client as Fl, TAccountImportReceipt as Fn, TSession_StageInitialAction_Output as Fo, TRANSFER_ACCOUNTS_MAX_CIPHERTEXT_BASE64_LENGTH as Fr, buildSessionPolicyV1 as Fs, canAdvanceNewKeyTransferMeteorAccountState as Ft, IAddKeyJournalStorageKeys as G, SESSION_LINK_FRAGMENT_KEY_SECRET_V1 as Ga, vSerializedCryptoKeyDataEd25519_Raw as Gc, TWalletClient_DeleteWallet_Input as Gi, prepareAccountImport as Gn, vSession_AcknowledgeResult_Input as Go, vAccountBasicData as Gr, vSessionRequestEnvelopeV1 as Gs, vNewKeyTransferNormalizedAddKeyProof as Gt, AddKeyJournalError as H, PUSH_TYPE_SESSION_TURN_WAKE as Ha, vCryptoKeyPairDataX25519 as Hc, vWalletClientState as Hi, emptyAccountImportRecord as Hn, vSession_AcknowledgeAndBeginExternalWork_Output as Ho, TRANSFER_ACCOUNTS_MIN_ID_LENGTH as Hr, vSessionNotificationId as Hs, TNewKeyTransferAddKeyProofResult as Ht, IAddKeyJournalStorageMethods as I, hashCanonicalJsonSha256Hex as Ia, TSerializedCryptoKeyData_X25519_Raw as Ic, TConnectedPartnerClient as Ii, EErr_Bridge_Session as Il, TAccountImportRecord as In, TSession_SubmitAction_Input as Io, TRANSFER_ACCOUNTS_MAX_DERIVATION_PATH_LENGTH as Ir, getSessionResourceProfilePolicy as Is, canAdvanceNewKeyTransferMnwAccountState as It, IJournaledNewKeyStartResult as J, SESSION_LINK_QUERY_KEY_LEASE_V2 as Ja, EWalletProtocolCapability as Jc, TWalletClient_GetLinkAuthority_Output as Ji, vArchivedAccountImportReceipt as Jn, vSession_AdvanceAction_Output as Jo, vAccountSecretPrivateKey as Jr, vSessionResultEnvelopeV1 as Js, vNewKeyTransferNormalizedTransactionAction as Jt, IAddKeyJournalStore as K, SESSION_LINK_FRAGMENT_KEY_SECRET_V2 as Ka, vSerializedCryptoKeyDataX25519_Jwk as Kc, TWalletClient_DeleteWallet_Output as Ki, vAccountImportReceipt as Kn, vSession_AcknowledgeResult_Output as Ko, vAccountSecretData as Kr, vSessionRequestPayload as Ks, vNewKeyTransferNormalizedDestinationAccess as Kt, IAddKeyJournalStorageStringMethods as L, sha256Base64 as La, TSerializedCryptoKeyData_X25519_Raw_Transformed as Lc, TWalletClientState as Li, merr_bridge_session as Ll, TArchivedAccountImportReceipt as Ln, TSession_SubmitAction_Output as Lo, TRANSFER_ACCOUNTS_MAX_ID_LENGTH as Lr, hashSessionPolicyV1 as Ls, canAdvanceNewKeyTransferMnwSessionState as Lt, vNewKeyTransferLivenessOutcomeV1 as M, base64ToBytes as Ma, TSerializedCryptoKeyData_Ed25519_Raw as Mc, getActionPolicy as Mi, EErr_MeteorConnect as Ml, ACCOUNT_IMPORT_MAX_RECEIPTS as Mn, TSession_NotifyWallet_Input as Mo, TRANSFER_ACCOUNTS_ID_RANDOM_BYTE_LENGTH as Mr, SESSION_TURN_ENVELOPE_PURPOSE_TAG as Ms, TNewKeyTransferMeteorAccountState as Mt, IAddKeyJournalChain as N, buildCanonicalChallenge as Na, TSerializedCryptoKeyData_Ed25519_Raw_Transformed as Nc, getServerRequiredWalletCapabilities as Ni, merr_meteor_connect as Nl, ACCOUNT_IMPORT_RECORD_FORMAT_VERSION as Nn, TSession_NotifyWallet_Output as No, TRANSFER_ACCOUNTS_MAX_ACCOUNTS as Nr, TSessionRequestEnvelopeV1 as Ns, TNewKeyTransferMnwAccountState as Nt, normalizeNewKeyTransferRecoveryPhrase as O, vSessionLinkConfirmation as Oa, TEncryptedAesGcmPayload as Oc, actionRequiresFreshPin as Oi, EErr_PartnerClient as Ol, vSessionDemoReviewInput as On, TSession_Create_Input_Transformed as Oo, TNewKeyTransferVerifyActiveOutputV1 as Or, SESSION_MAX_TURNS as Os, newKeyTransferSupportReference as Ot, IAddKeyJournalRunner as P, bytesToBase64 as Pa, TSerializedCryptoKeyData_X25519_Jwk as Pc, isActionResourceProfileAllowed as Pi, EErr_ConnectClient as Pl, TAccountImportCapacityReason as Pn, TSession_StageInitialAction_Input as Po, TRANSFER_ACCOUNTS_MAX_ACCOUNT_ID_LENGTH as Pr, TSessionResultEnvelopeV1 as Ps, TNewKeyTransferMnwSessionState as Pt, TAddKeyIntentJournalEntry as Q, TSessionLinkPayloadV2 as Qa, vWalletProtocolCapabilities as Qc, TWalletClient_Register_Output as Qi, NEW_KEY_ACCOUNT_TRANSFER_KEY_BYTE_LENGTH as Qn, vSession_Close_Output as Qo, vAllAccountsTransferDataDecrypted as Qr, vSessionTurnSequence as Qs, METEOR_CONNECT_KEY_PREFIX as Qt, IAddKeySignedTransaction as R, sha256Hex as Ra, TSerializedCryptoKeyPairDataEd25519 as Rc, TWalletPushPlatform as Ri, EErr_Bridge as Rl, TCommitAccountImportResult as Rn, TSession_VerifyPin_Input as Ro, TRANSFER_ACCOUNTS_MAX_SECRETS_PER_ACCOUNT as Rr, vBridgeInteractionMode as Rs, TNormalizeNearAddKeyProofFailure as Rt, NEW_KEY_TRANSFER_LIVENESS_RECEIVER_ACCOUNT_IDS as S, vPartnerWalletClientLink as Sa, ECryptoKeyAlgo as Sc, MAX_ACTION_REQUEST_CANONICAL_JSON_LENGTH as Si, vMeteorBridgeWalletLink as Sl, parseNewKeyTransferStartOutputV1 as Sn, TSession_Close_Input as So, TNewKeyTransferStartOutputAccountV1 as Sr, MAX_SESSION_RESULT_CANONICAL_JSON_LENGTH as Ss, INewKeyTransferReconciliationReport as St, TNewKeyTransferLivenessOutcomeV1 as T, TSessionLinkConfirmation as Ta, ISerializedKeyData_Ed25519_Raw as Tc, TActionPolicy as Ti, vWalletPlatform as Tl, act_impl_meteor_wallet_core as Tn, TSession_Complete_Output as To, TNewKeyTransferVerifyActiveInputV1 as Tr, SESSION_IDLE_WINDOW_MILLIS as Ts, buildNewKeyTransferReconciliationReport as Tt, DEFAULT_ADD_KEY_JOURNAL_STORAGE_KEYS as U, SESSION_LINK_FORMAT_V1 as Ua, vEncryptedAesGcmPayload as Uc, vWalletPushPlatform as Ui, hashAccountImportSet as Un, vSession_AcknowledgeAndClose_Input as Uo, TRANSFER_ACCOUNTS_MIN_SECRETS_PER_ACCOUNT as Ur, vSessionOperationId as Us, TNewKeyTransferNormalizedAddKeyProof as Ut, ADD_KEY_JOURNAL_FORMAT_VERSION as V, PUSH_TYPE_SESSION_CLAIM as Va, vCryptoKeyPairDataEd25519 as Vc, vConnectedPartnerClient as Vi, commitPreparedAccountImport as Vn, vSession_AcknowledgeAndBeginExternalWork_Input as Vo, TRANSFER_ACCOUNTS_MIN_ACCOUNT_ID_LENGTH as Vr, vSessionIssuedAt as Vs, INewKeyTransferAddKeyProofExpectation as Vt, IAddKeyJournalJob as W, SESSION_LINK_FORMAT_V2 as Wa, vSerializedCryptoKeyDataEd25519_Jwk as Wc, vWalletPushRegistration as Wi, migrateAccountImportRecord as Wn, vSession_AcknowledgeAndClose_Output as Wo, TRANSFER_ACCOUNTS_NONCE_BYTE_LENGTH as Wr, vSessionPhase as Ws, vNewKeyTransferNormalizedAddKeyAction as Wt, MAX_SIGNED_ADD_KEY_TRANSACTION_BYTES as X, TSessionLinkPayload as Xa, REQUIRED_METEOR_WALLET_CAPABILITIES as Xc, TWalletClient_RegisterPushToken_Output as Xi, NEW_KEY_ACCOUNT_TRANSFER_ID_PATTERN as Xn, vSession_ClientClaim_Output as Xo, vAccountTransferDataDecrypted as Xr, vSessionStateRevision as Xs, verifyNewKeyTransferAddKeyProofFromUnknown as Xt, MAX_ADD_KEY_JOURNAL_ENTRIES as Y, TSessionClaimPushPayload as Ya, METEOR_WALLET_PROTOCOL_VERSION as Yc, TWalletClient_RegisterPushToken_Input as Yi, NEW_KEY_ACCOUNT_TRANSFER_FORMAT_VERSION as Yn, vSession_ClientClaim_Input as Yo, vAccountSecretType as Yr, vSessionResultPayload as Ys, verifyNewKeyTransferAddKeyProof as Yt, TAddKeyFinalizedJournalEntry as Z, TSessionLinkPayloadV1 as Za, hasRequiredWalletCapabilities as Zc, TWalletClient_Register_Input as Zi, NEW_KEY_ACCOUNT_TRANSFER_ID_RANDOM_BYTE_LENGTH as Zn, vSession_Close_Input as Zo, vAccountTransferOpaqueId as Zr, vSessionTurnId as Zs, act_impl_near as Zt, NEW_KEY_TRANSFER_LIVENESS_AMOUNT_YOCTO as _, TPartnerWalletClientLink as _a, vSessionCreatePartnerData as _c, vNewKeyTransferVerifyActiveOutputAccountV1 as _i, vClientSourceId_Wallet as _l, isValidMeteorConnectVerifyPublicKey as _n, TSession_AcknowledgeResult_Output as _o, TNewKeyTransferLivenessFactV1 as _r, ESessionAuthorizationMode as _s, vAddKeyJournal as _t, IClientKeys_Serialized as a, vWalletClient_GetLinkAuthority_Input as aa, TSessionCreatePartnerData as ac, vNewKeyTransferDestinationSignerTypeV1 as ai, EWalletPlatform as al, buildAccountSecretData as an, decodeSessionTurnWakePushData as ao, NEW_KEY_TRANSFER_LIVENESS_FACTS as ar, vSession_NotifyWalletTurn_Input as as, buildJournaledNewKeyStartResult as at, NEW_KEY_TRANSFER_LIVENESS_MAX_CONCURRENCY as b, vPartnerClientDO_State as ba, vSessionWalletClaim as bc, act_root_meteor_connect as bi, vMeteorAppId as bl, isValidNewKeyTransferOpaqueId as bn, TSession_ClientClaim_Input as bo, TNewKeyTransferStartInputV1 as br, ISessionPolicyV1 as bs, INewKeyTransferFencedOperation as bt, TSessionRealmState as c, vWalletClient_RegisterPushToken_Output as ca, TSessionPartnerData as cc, vNewKeyTransferPendingFactV1 as ci, TClientSourceId_Any as cl, createAccountTransferOpaqueId as cn, vSessionLinkPayloadV1 as co, NEW_KEY_TRANSFER_VERIFY_ACTIVE_ISSUES as cr, vSession_NotifyWallet_Output as cs, createAddKeyJournalStore as ct, vSessionRealmFailureCode as d, vWalletClient_RevokePartner_Input as da, isCanonicalDurableObjectId as dc, vNewKeyTransferStartIssueV1 as di, TMeteorBridgeWalletLink as dl, deriveNearPublicKeyFromAccountSecret as dn, TSessionFacts as do, TAccountTransferDataDecrypted as dr, vSession_SubmitAction_Input as ds, parseJournaledNewKeyStartResult as dt, TWalletClient_RevokePartner_Output as ea, CANONICAL_DURABLE_OBJECT_ID_PATTERN as ec, vBlockchainId as ei, vWalletProtocolVersion as el, TAccountsTransferDecryptResult as en, TSessionTurnWakePushPayload as eo, NEW_KEY_ACCOUNT_TRANSFER_MAX_ID_LENGTH as er, vSession_Complete_Output as es, TAddKeyJournalErrorCode as et, vSessionRealmTurnRequest as f, vWalletClient_RevokePartner_Output as fa, resourceCohortForBridgeId as fc, vNewKeyTransferStartOutputAccountV1 as fi, TMeteorBridgeWalletLinkWithMeta as fl, deriveNearSigningKeyFromAccountSecret as fn, TSession_AcknowledgeAndBeginExternalWork_Input as fo, TAllAccountsTransferDataDecrypted as fr, vSession_SubmitAction_Output as fs, parsePendingNewKeyVerification as ft, NEW_KEY_TRANSFER_FIRST_LAST_CONFIRMED_WORD_COUNT as g, TPartnerMetadata as ga, vResourceCohort as gc, vNewKeyTransferVerifyActiveIssueV1 as gi, vClientSourceId_Partner as gl, isValidMeteorConnectDurableObjectId as gn, TSession_AcknowledgeResult_Input as go, TNewKeyTransferDestinationSignerTypeV1 as gr, ESessionAuthorizationLevel as gs, vAddKeyIntentJournalEntry as gt, NEW_KEY_TRANSFER_BACKUP_METHODS as h, TPartnerClientDO_State as ha, vResourceBehaviorVersion as hc, vNewKeyTransferVerifyActiveInputV1 as hi, vClientSourceId_Any as hl, hashNewKeyTransferStartInput as hn, TSession_AcknowledgeAndClose_Output as ho, TCryptoGenericNetworkId as hr, EBridgeInteractionMode as hs, vAddKeyFinalizedJournalEntry as ht, IClientKeys_PublicKeys_Serialized as i, vWalletClient_DeleteWallet_Output as ia, TBridgeLease as ic, vNearTransactionHash as ii, ERuntimeEnvironment as il, TMeteorConnectKeyString as in, decodeSessionClaimPushData as io, NEW_KEY_ACCOUNT_TRANSFER_MIN_ID_LENGTH as ir, vSession_Create_Output as is, addKeyJournalHasProtectedRecovery as it, vNewKeyTransferBackupEvidenceV1 as j, TCanonicalJsonValue as ja, TSerializedCryptoKeyData_Ed25519_Jwk_Transformed as jc, getActionMinimumSessionAuthorization as ji, merr_new_key_account_transfer as jl, ACCOUNT_IMPORT_MAX_ARCHIVED_RECEIPTS as jn, TSession_NotifyWalletTurn_Output as jo, TRANSFER_ACCOUNTS_ID_PATTERN as jr, SESSION_RESOURCE_PROFILE_POLICIES as js, NEW_KEY_TRANSFER_MNW_SESSION_STATES as jt, parseNewKeyTransferLivenessOutcomeV1 as k, vSessionLinkConfirmationReceipt as ka, TEncryptedAesGcmPayload_Transformed as kc, actionRequiresWalletEncryptedDelivery as ki, merr_partner_client as kl, vSessionDemoReviewOutput as kn, TSession_Create_Output as ko, TRANSFER_ACCOUNTS_ACCOUNT_ID_PATTERN as kr, SESSION_OPERATION_MAX_AGE_MILLIS as ks, NEW_KEY_TRANSFER_METEOR_ACCOUNT_STATES as kt, bridge_session_realm as l, vWalletClient_Register_Input as la, TSessionWalletClaim as lc, vNewKeyTransferStartInputAccountV1 as li, TClientSourceId_Partner as ll, createNewKeyTransferOpaqueId as ln, vSessionLinkPayloadV2 as lo, TAccountBasicData as lr, vSession_StageInitialAction_Input as ls, findAddKeyJournalEntry as lt, NEW_KEY_TRANSFER_BACKUP_EVIDENCE_FORMAT_VERSION as m, vWalletClient_UnregisterPushToken_Output as ma, vBridgeLease as mc, vNewKeyTransferVerifyActiveInputAccountV1 as mi, buildClientSourceId as ml, formatNearTransactionHash as mn, TSession_AcknowledgeAndClose_Input as mo, TBlockchainId as mr, vSession_VerifyPin_Output as ms, serializeAddKeyJournalEntries as mt, IClientKeys_Combined as n, TWalletClient_UnregisterPushToken_Output as na, RESOURCE_BEHAVIOR_VERSION as nc, vNearAccountId as ni, EMeteorAppId as nl, TDeriveNearPublicKeyFromSecretResult as nn, buildSessionLinkQueryV1 as no, NEW_KEY_ACCOUNT_TRANSFER_MAX_TRANSACTION_HASH_LENGTH as nr, vSession_ConfirmLink_Output as ns, TReceivedNewKeyStartResult as nt, ESessionRealmAvatar as o, vWalletClient_GetLinkAuthority_Output as oa, TSessionCreatePartnerDataTransformed as oc, vNewKeyTransferLivenessFactV1 as oi, IVerifiedClientState as ol, buildAccountsTransferRequestData as on, parseSessionLinkQuery as oo, NEW_KEY_TRANSFER_PENDING_FACTS as or, vSession_NotifyWalletTurn_Output as os, buildPendingNewKeyVerification as ot, vSessionRealmTurnResult as p, vWalletClient_UnregisterPushToken_Input as pa, vActionPayloadJsonObject as pc, vNewKeyTransferStartOutputV1 as pi, TWalletMetaData as pl, formatNearEd25519PublicKey as pn, TSession_AcknowledgeAndBeginExternalWork_Output as po, TAllAccountsTransferDataEncrypted as pr, vSession_VerifyPin_Input as ps, replaceAddKeyJournalEntry as pt, IAddKeyJournalSyncStorage as q, SESSION_LINK_QUERY_KEY_FORMAT_V2 as qa, vSerializedCryptoKeyDataX25519_Raw as qc, TWalletClient_GetLinkAuthority_Input as qi, vAccountImportRecord as qn, vSession_AdvanceAction_Input as qo, vAccountSecretMnemonic as qr, vSessionResourceProfile as qs, vNewKeyTransferNormalizedOtherAction as qt, IClientKeys_Deserialized as r, vWalletClient_DeleteWallet_Input as ra, RESOURCE_COHORT_BUCKET_COUNT as rc, vNearEd25519PublicKey as ri, EPartnerOrigin as rl, TDeriveNearSigningKeyFromSecretResult as rn, classifySessionPushPayload as ro, NEW_KEY_ACCOUNT_TRANSFER_MIN_ACCOUNTS as rr, vSession_Create_Input as rs, addKeyJournalHasOrphanedSignedRecovery as rt, TSessionRealmFailureCode as s, vWalletClient_RegisterPushToken_Input as sa, TSessionCreationProofInput as sc, vNewKeyTransferOpaqueId as si, META_METEOR_APP as sl, canonicalizeNewKeyTransferStartInput as sn, vSessionClaimPushPayload as so, NEW_KEY_TRANSFER_START_ISSUES as sr, vSession_NotifyWallet_Input as ss, consumeSignedNewKeyStartResult as st, ClientKeySerialization as t, TWalletClient_UnregisterPushToken_Input as ta, ESessionNotifyWalletReason as tc, vCryptoGenericNetworkId as ti, EBridgeLinkType as tl, TBuildAccountSecretDataResult as tn, buildSessionLinkQuery as to, NEW_KEY_ACCOUNT_TRANSFER_MAX_PUBLIC_KEY_LENGTH as tr, vSession_ConfirmLink_Input as ts, TAddKeySignedJournalEntry as tt, sessionRealmGenesisState as u, vWalletClient_Register_Output as ua, TSessionWalletClaimOutputData as uc, vNewKeyTransferStartInputV1 as ui, TClientSourceId_Wallet as ul, decryptAccountsTransferRequestData as un, vSessionTurnWakePushPayload as uo, TAccountSecretData as ur, vSession_StageInitialAction_Output as us, parseAddKeyJournalEntries as ut, NEW_KEY_TRANSFER_LIVENESS_FAILURE_REASONS as v, TRegisterPartnerConnection_Input as va, vSessionCreationProof as vc, vNewKeyTransferVerifyActiveOutputV1 as vi, vDurableObjectId as vl, isValidNearEd25519PublicKey as vn, TSession_AdvanceAction_Input as vo, TNewKeyTransferPendingFactV1 as vr, ESessionPhase as vs, vAddKeyJournalEntry as vt, TNewKeyTransferBackupEvidenceV1 as w, vWalletClientConnectionInfo as wa, ISerializedKeyData_Ed25519_Jwk as wc, TActionMinimumSessionAuthorization as wi, vWalletMetaData as wl, validateNewKeyTransferVerifyActiveOutputForInput as wn, TSession_Complete_Input as wo, TNewKeyTransferVerifyActiveInputAccountV1 as wr, SESSION_ENVELOPE_FORMAT_VERSION as ws, TNewKeyTransferReconcileStatus as wt, NEW_KEY_TRANSFER_LIVENESS_MIN_AVAILABLE_BALANCE_YOCTO as x, vPartnerMetadata as xa, vSessionWalletClaimOutputData as xc, ACTION_REQUEST_ENVELOPE_PURPOSE_TAG as xi, vMeteorAppIds as xl, newKeyTransferAccountIdentityKey as xn, TSession_ClientClaim_Output as xo, TNewKeyTransferStartIssueV1 as xr, ISessionResourceProfilePolicy as xs, INewKeyTransferReconcileResult as xt, NEW_KEY_TRANSFER_LIVENESS_MAX_ATTEMPTS as y, TWalletClientConnectionInfo as ya, vSessionPartnerData as yc, vTransferAccountsCiphertext as yi, vIncarnationId as yl, isValidNearTransactionHash as yn, TSession_AdvanceAction_Output as yo, TNewKeyTransferStartInputAccountV1 as yr, ESessionResourceProfile as ys, vAddKeySignedJournalEntry as yt, TAddKeyJournalStorage as z, stringifyCanonicalJson as za, TSerializedCryptoKeyPairDataX25519 as zc, TWalletPushRegistration as zi, merr_bridge as zl, TPrepareAccountImportResult as zn, TSession_VerifyPin_Output as zo, TRANSFER_ACCOUNTS_MAX_SECRET_DATA_LENGTH as zr, vSessionAuthorizationLevel as zs, TNormalizeNearAddKeyProofResult as zt }; //# sourceMappingURL=index-BmMhfOsf.d.cts.map