/** * The NEAR Wallet Selector action shapes, declared locally. * * These were previously imported from `@near-wallet-selector/core`, which caused three problems in * the published package (REVIEW-consumer-implementation B-01): * * 1. `@near-wallet-selector/core` was never declared as a dependency — it only resolved through * monorepo hoisting, so a fresh checkout or a consumer type-check had nothing to resolve. * 2. Its `FinalExecutionOutcome` re-export dragged `near-api-js/lib/providers/index.js` into the * shipped `.d.ts`, forcing downstream wallets to patch the generated types. * 3. Bundling its declarations pulled in rxjs's `/// ` * triple-slash directives, which point at files that do not exist in `dist/` and made every * consumer `tsc` run fail. * * The definitions are plain data shapes and are structurally identical to * `@near-wallet-selector/core@9.x`, so a caller can still pass wallet-selector actions straight in. * Keep them in sync if wallet selector ever extends the action union. */import { IActionPayload_Request_JsonObject, IBridgeSessionTerminalOutcome, IPushWakeOutcomeClassification, ISessionResultReceipt, METEOR_CONNECT_BACKENDS, PartnerSessionClient, TMeteorConnectBackendEnvironment, TMeteorConnectBackendEnvironment as TMeteorConnectBackendEnvironment$1, TPartnerPairedWallet, TSessionErrorKind, TSessionLinkPhase, deriveLocalBackendUrl } from "@meteorwallet/connect"; import * as _meteorwallet_connect_shared0 from "@meteorwallet/connect-shared"; import { AddKeyJournalError, EMeteorAppId, EMeteorAppId as EMeteorAppId$1, IAddKeyJournalChain, IAddKeyJournalChain as IAddKeyJournalChain$1, IAddKeyJournalJob, IAddKeySignedTransaction, IJournaledNewKeyStartResult, INewKeyTransferFencedOperation, INewKeyTransferReconcileResult, INewKeyTransferReconciliationReport, TAccountBasicData, TAccountSecretData, TAccountTransferDataDecrypted, TAccountTransferDataDecrypted as TAccountTransferDataDecrypted$1, TAddKeyJournalErrorCode, TAllAccountsTransferDataEncrypted, TBlockchainId, TCryptoGenericNetworkId, TDeriveNearPublicKeyFromSecretResult, TDeriveNearSigningKeyFromSecretResult, TMeteorBridgeWalletLink, TNewKeyTransferStartInputV1, TNewKeyTransferStartOutputV1, TNewKeyTransferVerifyActiveInputV1, TNewKeyTransferVerifyActiveOutputV1, TSessionFacts, deriveNearPublicKeyFromAccountSecret, deriveNearSigningKeyFromAccountSecret, formatNearEd25519PublicKey } from "@meteorwallet/connect-shared"; import { KeyStore } from "@near-js/keystores"; import { KeyPair, KeyType, PublicKey } from "@near-js/crypto"; import * as _near_js_signers0 from "@near-js/signers"; import { SignedMessage, Signer } from "@near-js/signers"; import * as _near_js_types0 from "@near-js/types"; import { AccessKeyInfoView, Enum, FinalExecutionOutcome } from "@near-js/types"; import * as _near_js_transactions0 from "@near-js/transactions"; import { Action, DelegateAction, SignedDelegate, Transaction } from "@near-js/transactions"; import { z } from "zod"; import { Account } from "@near-js/accounts"; import { JsonRpcProvider, Provider } from "@near-js/providers"; import { LoggerService } from "@near-js/utils"; import { Schema } from "borsh"; //#region src/envConfig.d.ts interface IEnvConfig { wallet_base_url: string; } declare function setEnvConfig(config: Partial): void; //#endregion //#region src/MeteorConnect/action_ui/action_ui.types.d.ts type TRenderStrategy = { strategy: "target_element"; element: HTMLElement | string; } | { strategy: "create_popup"; }; interface IRenderActionUi_Input = ExecutableAction> { action: A; strategy?: TRenderStrategy; } //#endregion //#region src/ported_common/utils/storage/storage.types.d.ts interface ILocalStorageInterface { setItem: (key: string, value: string) => Promise; getItem: (key: string) => Promise; removeItem: (key: string) => Promise; /** Optional prefix enumeration used for safe cross-tab bridge leases and comprehensive reset. */ getKeys?: (prefix?: string) => Promise; } interface IEnumerableLocalStorageInterface extends ILocalStorageInterface { getKeys: (prefix?: string) => Promise; } //#endregion //#region src/MeteorConnect/MeteorConnect.types.d.ts type TMCLoggingLevel = "none" | "basic" | "debug"; type TMeteorConnectAccountType = "near"; type TMeteorConnectAccountNetwork = "mainnet" | "testnet"; interface IMeteorConnectNetworkTarget { blockchain: T; network: TMeteorConnectAccountNetwork; } interface IMeteorConnectAccountIdentifier extends IMeteorConnectNetworkTarget { accountId: string; } interface IMeteorConnectAccountIdentifier_Near extends IMeteorConnectAccountIdentifier<"near"> {} type TMeteorConnectAccountIdentifier = IMeteorConnectAccountIdentifier_Near; interface IMeteorConnectPublicKey_Ed25519 { type: "ed25519"; publicKey: string; meta?: any; } type TMeteorConnectPublicKey = IMeteorConnectPublicKey_Ed25519; type TMeteorConnectionExecutionTarget = "v1_web" | "v1_web_localhost" | "v1_ext" | "v2_bridge_mobile" | "v2_rid_mobile_deep_link" | "v2_rid_qr_code" | "test" | "test_rid_deep_link" | "test_rid_qr_code"; interface IMeteorConnection_Base { executionTarget: T; } interface IMeteorConnection_Test extends IMeteorConnection_Base<"test"> {} interface IMeteorConnection_Test_RidDeepLink extends IMeteorConnection_Base<"test_rid_deep_link"> {} interface IMeteorConnection_Test_RidQrCode extends IMeteorConnection_Base<"test_rid_qr_code"> {} interface IMeteorConnection_V1_Web extends IMeteorConnection_Base<"v1_web"> {} interface IMeteorConnection_V1_Web_Localhost extends IMeteorConnection_Base<"v1_web_localhost"> { baseUrl: string; } interface IMeteorConnection_V1_Ext extends IMeteorConnection_Base<"v1_ext"> {} interface IMeteorConnection_V2_BridgeMobile extends IMeteorConnection_Base<"v2_bridge_mobile"> { schemaVersion: 1; bridgeEnvironmentId: string; meteorAppId: EMeteorAppId$1; partnerClientId: string; walletVerifyPublicKey: string; } interface IMeteorConnection_V2_MobileDeepLink extends IMeteorConnection_Base<"v2_rid_mobile_deep_link"> {} interface IMeteorConnection_V2_QrCode extends IMeteorConnection_Base<"v2_rid_qr_code"> {} type TMeteorExecutionTargetConfig = IMeteorConnection_V1_Web | IMeteorConnection_V1_Web_Localhost | IMeteorConnection_V1_Ext | IMeteorConnection_V2_BridgeMobile | IMeteorConnection_V2_MobileDeepLink | IMeteorConnection_V2_QrCode | IMeteorConnection_Test | IMeteorConnection_Test_RidDeepLink | IMeteorConnection_Test_RidQrCode; interface IMeteorConnectAccount { identifier: TMeteorConnectAccountIdentifier; publicKeys: TMeteorConnectPublicKey[]; connection: TMeteorExecutionTargetConfig; } type TNetworkTargetKey = `${TMeteorConnectAccountType}::${TMeteorConnectAccountNetwork}`; type TMCSelectedAccountForNetwork = { [key in TNetworkTargetKey]: IMeteorConnectAccountIdentifier }; interface IMeteorConnectTypedStorage { accounts: IMeteorConnectAccount[]; lastInitialized: number; selectedNetworkAccounts: TMCSelectedAccountForNetwork; webDevLocalhostBaseUrl: string; dev_000_met: number; /** * Dev-only mobile wallet switch from the Connect popup: which Meteor Connect environment (bridge * backend + mobile wallet build) the mobile bridge targets. Ignored outside the dev gate — see * `MeteorConnectMobileBridgeClient.getDevMobileWalletEnvironment`. */ devMobileWalletEnvironment: TMeteorConnectBackendEnvironment$1; /** * Opt-in staged transfer accounts (plaintext-at-rest — see * IMeteorConnectTransferAccountsConfig.persistStagedAccounts). Lives under the `met_data_` * prefix deliberately: the `met_bridge_partner::` namespace is wiped wholesale by identity * reset, and staged secrets must never share that fate implicitly. */ stagedTransferAccounts: unknown; /** * Secret-free, validated new-key transfer orchestration journal. The shared AddKey journal * machinery keeps its own three slots beside this one — `newKeyTransferAddKeyJournal`, * `newKeyTransferStartResultJournal` and `newKeyTransferPendingVerify` — written as raw strings * through the storage adapter (they are serialized by connect-shared, not by this map), under * the same `met_data_` prefix so a partner-identity reset cannot wipe AddKey recovery. */ newKeyTransferSessions: unknown; /** * Cached terminal verify exchanges keyed by transferSessionId (stabilization SDK-4, * `exact_cached_result`): a byte-identical repeated verification replays from here without * asking the wallet again. Secret-free (request + signed-output rows only). */ newKeyTransferVerifyResults: unknown; /** * Bounded archive of fully completed transfer sessions (stabilization SD10): retention that * keeps the active journal under its capacity without deleting completion records. */ newKeyTransferArchivedSessions: unknown; } interface IMeteorConnect_Initialize_Input { storage: ILocalStorageInterface; mobileBridge?: IMeteorConnectMobileBridgeConfig; nearKeyStoreProvider?: IMeteorConnectNearKeyStoreProvider; } interface IMeteorConnectBridgeLeaseHandle { readonly ownerToken: string; assertOwned(): Promise; release(): Promise; } interface IMeteorConnectBridgeLeaseProvider { acquire(name: string, options?: { timeoutMs?: number; }): Promise; } interface IMeteorConnectNativeAppOpener { /** * Must synchronously attempt the opaque custom-scheme link from the originating click. * * A host that can only relay the attempt (the NEAR Connect sandbox asks its host frame to open the * link) may return a promise: it resolves once the host has attempted the link and rejects when the * host refused it. The SDK counts the request as handed to the wallet only once that promise * resolves, and reports a rejection to the user instead of waiting for a wallet that was never * reached. A synchronous opener that throws is treated the same way as a rejection. */ open(fullLink: string): void | Promise; } interface IMeteorConnectNearKeyStoreProvider { getKeyStore(): KeyStore; } interface IMeteorConnectTransferAccountsConfig { /** * Master switch for the transfer flow (dark by default). When off, * transferAccounts.prompt()/createAction() throw `transfer_accounts_unavailable` and no * UI/registry behavior changes for existing consumers. The staging API works regardless — * it is inert data handling. */ enabled?: boolean; /** * Ordered app-id preference for transfer bridges (link selection takes the first match; * the whole list is sent to create_bridge). Default: [meteor_wallet_web_dev] when the * configured mobile app id is the dev variant, else [meteor_wallet_web] — matching how * meteor-frontend identifies per environment. Override with [meteor_bridge_test_web] when * testing against the mc_backend demo wallet. */ meteorAppIds?: EMeteorAppId$1[]; /** * Persist staged accounts (plaintext-at-rest in this origin's storage) under typed storage. * Recommended only for development/testnet integration; default false = in-memory staging * that is lost on reload and dropped on dispose(). */ persistStagedAccounts?: boolean; /** * Opt-in: clear the staged set after a signed { success: true } result. Default FALSE — staged * accounts remain so the user can transfer them to another platform too, and because silently * emptying the partner's working set after one transfer is surprising. Staged entries are * copies; keeping them never blocks a retry (the receiving wallet skips already-imported * accounts). */ clearStagedOnSuccess?: boolean; /** * TESTING ESCAPE HATCH: raise the staged-set cap above the protocol's per-transfer bound * (TRANSFER_ACCOUNTS_MAX_ACCOUNTS = 50). Staging beyond 50 becomes possible, but a single * transfer still cannot exceed 50 accounts — the shared schemas, the bridge backend, and the * receiving wallet each enforce that bound independently. With an oversized staged set, * prompt() with no options throws `transfer_accounts_invalid_input`; pass a ≤50 subset via * prompt({ accounts }) instead (e.g. chunked transfers). Leave unset in production. */ maxStagedAccounts?: number; } interface IMeteorConnectMobileBridgeConfig { enabled?: boolean; backendUrl?: string; meteorAppId?: EMeteorAppId$1.meteor_wallet_mobile | EMeteorAppId$1.meteor_wallet_mobile_dev; leaseProvider?: IMeteorConnectBridgeLeaseProvider; nativeAppOpener?: IMeteorConnectNativeAppOpener; /** * Open Meteor Mobile automatically for a request from an account signed in with it, instead of * waiting for the user to tap "Open Meteor Mobile". Default `true`. * * Browsers only let a page open an app right after a real tap, so this happens only on a phone, * while the tap that started the request is still live, through the SDK's own opener (never a * host-supplied `nativeAppOpener`), and only for a wallet this browser has opened before — the * evidence that the app is on this device. In every other case nothing changes: the push * notification and the Open button behave exactly as before, and both stay as fallbacks. */ autoOpenPairedWallet?: boolean; partnerMetadata?: { name?: string; description?: string; iconUrl?: string; originUrl?: string; }; transferAccounts?: IMeteorConnectTransferAccountsConfig; /** * Dedicated enable flag for the new-key transfer surface (stabilization SDK-12). When omitted, * it follows `transferAccounts.enabled` for continuity with pre-stabilization hosts; set it * explicitly to run the two features independently. */ newKeyTransfer?: { enabled?: boolean; }; } //#endregion //#region src/ported_common/utils/special_typescript_types.d.ts type PartialBy = Omit & Partial>; type StringKeys = keyof T & string; //#endregion //#region src/ported_common/utils/storage/EnvironmentStorageAdapter.d.ts interface IStorageKeyGetterAndSetter { get: () => Promise; set: (value: T) => Promise; } declare class CEnvironmentStorageAdapter { private implementation; constructor(implementation: ILocalStorageInterface); removeItem(key: string): Promise; setJson(key: string, value: any): Promise; getJson(key: string): Promise; setString(key: string, value: string): Promise; getString(key: string): Promise; createJsonGetterSetter(key: string): IStorageKeyGetterAndSetter; createStringGetterSetter(key: string): IStorageKeyGetterAndSetter; } //#endregion //#region src/ported_common/utils/storage/TypedStorageHelper.d.ts interface ITypedStorageHelper> { getJson>(key: K): Promise; getJsonOrDef>(key: K, defVal: T[K]): Promise; setJson>(key: K, val: T[K]): Promise; removeItem>(key: K): Promise; } //#endregion //#region src/MeteorConnect/action/mc_action.meteor_wallet_core.d.ts interface IMCAOutput_MeteorWalletCore_TransferAccounts { success: boolean; } //#endregion //#region src/near_utils/wallet_selector_actions.types.d.ts interface CreateAccountAction { type: "CreateAccount"; } interface DeployContractAction { type: "DeployContract"; params: { code: Uint8Array; }; } interface FunctionCallAction { type: "FunctionCall"; params: { methodName: string; args: object; gas: string; deposit: string; }; } interface TransferAction { type: "Transfer"; params: { deposit: string; }; } interface StakeAction { type: "Stake"; params: { stake: string; publicKey: string; }; } type AddKeyPermission = "FullAccess" | { receiverId: string; allowance?: string; methodNames?: Array; }; interface AddKeyAction { type: "AddKey"; params: { publicKey: string; accessKey: { nonce?: number; permission: AddKeyPermission; }; }; } interface DeleteKeyAction { type: "DeleteKey"; params: { publicKey: string; }; } interface DeleteAccountAction { type: "DeleteAccount"; params: { beneficiaryId: string; }; } type Action$2 = CreateAccountAction | DeployContractAction | FunctionCallAction | TransferAction | StakeAction | AddKeyAction | DeleteKeyAction | DeleteAccountAction; interface Transaction$1 { signerId: string; receiverId: string; actions: Array; } //#endregion //#region src/near_utils/actionCreator/constants.d.ts /** All supported key types */ declare enum KeyType$1 { ED25519 = 0, SECP256K1 = 1, MLDSA65 = 2 } //#endregion //#region src/near_utils/actionCreator/public_key.d.ts declare class ED25519PublicKey { keyType: KeyType$1; data: Uint8Array; } declare class SECP256K1PublicKey { keyType: KeyType$1; data: Uint8Array; } declare class MLDSA65PublicKey { keyType: KeyType$1; data: Uint8Array; } /** * DUPLICATED FROM @near-js/types - REPLACE WITH IMPORTED REFERENCE AND DELETE * This ends up being necessary for Wallet Selector dependencies with * outdated peer dependencies and should only be temporary */ declare abstract class Enum$1 { abstract enum: string; constructor(properties: any); } /** * PublicKey representation that has type and bytes of the key. */ declare class PublicKey$1 extends Enum$1 { enum: string; ed25519Key?: ED25519PublicKey; secp256k1Key?: SECP256K1PublicKey; mlDsa65Key?: MLDSA65PublicKey; constructor(publicKey: { keyType: KeyType$1; data: Uint8Array; }); /** * Creates a PublicKey instance from a string or an existing PublicKey instance. * @param value The string or PublicKey instance to create a PublicKey from. * @returns {PublicKey} The PublicKey instance. */ static from(value: string | PublicKey$1): PublicKey$1; /** * Creates a PublicKey instance from an encoded key string. * @param encodedKey The encoded key string. * @returns {PublicKey} The PublicKey instance created from the encoded key string. */ static fromString(encodedKey: string): PublicKey$1; /** * Returns a string representation of the public key. * @returns {string} The string representation of the public key. */ toString(): string; /** * Verifies a message signature using the public key. * @param message The message to be verified. * @param signature The signature to be verified. * @returns {boolean} `true` if the signature is valid, otherwise `false`. */ verify(message: Uint8Array, signature: Uint8Array): boolean; get keyPair(): ED25519PublicKey | SECP256K1PublicKey | MLDSA65PublicKey; get keyType(): KeyType$1; get data(): Uint8Array; } //#endregion //#region src/near_utils/actionCreator/delegate.d.ts declare class DelegateAction$1 { senderId: string; receiverId: string; actions: Array; nonce: bigint; maxBlockHeight: bigint; publicKey: PublicKey$1; constructor({ senderId, receiverId, actions, nonce, maxBlockHeight, publicKey }: { senderId: string; receiverId: string; actions: Action$1[]; nonce: bigint; maxBlockHeight: bigint; publicKey: PublicKey$1; }); } //#endregion //#region src/near_utils/actionCreator/signature.d.ts declare class ED25519Signature { keyType: KeyType$1; data: Uint8Array; } declare class SECP256K1Signature { keyType: KeyType$1; data: Uint8Array; } declare class MLDsa65Signature { keyType: number; data: Uint8Array; } declare class Signature extends Enum { enum: string; ed25519Signature?: ED25519Signature; secp256k1Signature?: SECP256K1Signature; mlDsa65Signature?: MLDsa65Signature; constructor(signature: { keyType: KeyType$1 | number; data: Uint8Array; }); get signature(): ED25519Signature | SECP256K1Signature | MLDsa65Signature; get signatureType(): KeyType$1 | number; get data(): Uint8Array; } //#endregion //#region src/near_utils/actionCreator/actions.d.ts declare class FunctionCallPermission { allowance?: bigint; receiverId: string; methodNames: string[]; constructor({ allowance, receiverId, methodNames }: { allowance?: bigint; receiverId: string; methodNames: string[]; }); } declare class FullAccessPermission {} declare class GasKeyInfo { balance: bigint; numNonces: number; constructor({ balance, numNonces }: { balance: bigint; numNonces: number; }); } declare class GasKeyFunctionCallPermission { gasKeyInfo: GasKeyInfo; functionCall: FunctionCallPermission; constructor({ gasKeyInfo, functionCall }: { gasKeyInfo: GasKeyInfo; functionCall: FunctionCallPermission; }); } declare class GasKeyFullAccessPermission { gasKeyInfo: GasKeyInfo; constructor({ gasKeyInfo }: { gasKeyInfo: GasKeyInfo; }); } declare class AccessKeyPermission extends Enum { enum: string; functionCall?: FunctionCallPermission; fullAccess?: FullAccessPermission; gasKeyFunctionCall?: GasKeyFunctionCallPermission; gasKeyFullAccess?: GasKeyFullAccessPermission; constructor(props: any); } declare class AccessKey { nonce: bigint; permission: AccessKeyPermission; constructor({ nonce, permission }: { nonce: bigint; permission: AccessKeyPermission; }); } declare class CreateAccount {} declare class DeployContract { code: Uint8Array; constructor({ code }: { code: Uint8Array; }); } declare class FunctionCall { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; constructor({ methodName, args, gas, deposit }: { methodName: string; args: Uint8Array; gas: bigint; deposit: bigint; }); } declare class Transfer { deposit: bigint; constructor({ deposit }: { deposit: bigint; }); } declare class Stake { stake: bigint; publicKey: PublicKey$1; constructor({ stake, publicKey }: { stake: bigint; publicKey: PublicKey$1; }); } declare class AddKey { publicKey: PublicKey$1; accessKey: AccessKey; constructor({ publicKey, accessKey }: { publicKey: PublicKey$1; accessKey: AccessKey; }); } declare class DeleteKey { publicKey: PublicKey$1; constructor({ publicKey }: { publicKey: PublicKey$1; }); } declare class DeleteAccount { beneficiaryId: string; constructor({ beneficiaryId }: { beneficiaryId: string; }); } declare class GlobalContractDeployMode extends Enum { enum: string; CodeHash?: Record; AccountId?: Record; constructor(props: { CodeHash?: Record; AccountId?: Record; }); } declare class GlobalContractIdentifier extends Enum { enum: string; CodeHash?: Uint8Array; AccountId?: string; constructor(props: { CodeHash?: Uint8Array; AccountId?: string; }); } declare class DeployGlobalContract { code: Uint8Array; deployMode: GlobalContractDeployMode; constructor({ code, deployMode }: { code: Uint8Array; deployMode: GlobalContractDeployMode; }); } declare class UseGlobalContract { contractIdentifier: GlobalContractIdentifier; constructor({ contractIdentifier }: { contractIdentifier: GlobalContractIdentifier; }); } declare class DeterministicAccountStateInitV1 { code: GlobalContractIdentifier; data: Map; constructor({ code, data }: { code: GlobalContractIdentifier; data: Map; }); } declare class StateInit extends Enum { enum: string; V1?: DeterministicAccountStateInitV1; constructor(props: { V1: DeterministicAccountStateInitV1; }); } declare class DeterministicStateInit { deposit: bigint; stateInit: StateInit; constructor({ deposit, stateInit }: { deposit: bigint; stateInit: StateInit; }); } declare class TransferToGasKey { publicKey: PublicKey$1; deposit: bigint; constructor({ publicKey, deposit }: { publicKey: PublicKey$1; deposit: bigint; }); } declare class WithdrawFromGasKey { publicKey: PublicKey$1; amount: bigint; constructor({ publicKey, amount }: { publicKey: PublicKey$1; amount: bigint; }); } declare class SignedDelegate$1 { delegateAction: DelegateAction$1; signature: Signature; constructor({ delegateAction, signature }: { delegateAction: DelegateAction$1; signature: Signature; }); } declare class Nonce { nonce: bigint; constructor({ nonce }: { nonce: bigint; }); } declare class GasKeyNonce { nonce: bigint; nonceIndex: number; constructor({ nonce, nonceIndex }: { nonce: bigint; nonceIndex: number; }); } declare class TransactionNonce extends Enum { enum: string; nonce?: Nonce; gasKeyNonce?: GasKeyNonce; constructor(props: { nonce?: Nonce; gasKeyNonce?: GasKeyNonce; }); } declare class DelegateActionV2 { senderId: string; receiverId: string; actions: Action$1[]; nonce: TransactionNonce; maxBlockHeight: bigint; publicKey: PublicKey$1; constructor({ senderId, receiverId, actions, nonce, maxBlockHeight, publicKey }: { senderId: string; receiverId: string; actions: Action$1[]; nonce: TransactionNonce; maxBlockHeight: bigint; publicKey: PublicKey$1; }); } declare class VersionedDelegateActionPayloadSchema extends Enum { enum: string; v2?: DelegateActionV2; constructor(props: { v2: DelegateActionV2; }); } declare class DelegateV2 { delegateAction: VersionedDelegateActionPayloadSchema; signature: Signature; constructor({ delegateAction, signature }: { delegateAction: VersionedDelegateActionPayloadSchema; signature: Signature; }); } /** * Contains a list of the valid transaction Actions available with this API * @see {@link https://nomicon.io/RuntimeSpec/Actions.html | Actions Spec} */ declare class Action$1 extends Enum { enum: string; createAccount?: CreateAccount; deployContract?: DeployContract; functionCall?: FunctionCall; transfer?: Transfer; stake?: Stake; addKey?: AddKey; deleteKey?: DeleteKey; deleteAccount?: DeleteAccount; signedDelegate?: SignedDelegate$1; deployGlobalContract?: DeployGlobalContract; useGlobalContract?: UseGlobalContract; deterministicStateInit?: DeterministicStateInit; transferToGasKey?: TransferToGasKey; withdrawFromGasKey?: WithdrawFromGasKey; delegateV2?: DelegateV2; constructor(props: any); } //#endregion //#region src/near_utils/meteor_actions.types.d.ts /** * A native NEAR action instance accepted by SDK transaction inputs: either a standard * @near-js/transactions action or one built by the SDK's extended action creators * (gas keys, ML-DSA). The two are structurally compatible on every standard action, but * TypeScript cannot unify them across @near-js copies/versions in the monorepo, so SDK * boundaries accept the union and narrow with a cast where a specific family is required. */ type TNearNativeAction = Action | Action$1; /** Gas-key metadata carried by Meteor's extended actions. JSON-safe: yoctoNEAR balance as string. */ interface IMeteorGasKeyInfo { balance: string; numNonces: number; } interface IMeteorTransferToGasKeyAction { type: "TransferToGasKey"; params: { publicKey: string; /** yoctoNEAR amount as string */ deposit: string; }; } interface IMeteorWithdrawFromGasKeyAction { type: "WithdrawFromGasKey"; params: { publicKey: string; /** yoctoNEAR amount as string */ amount: string; }; } /** The wallet-selector AddKeyAction plus Meteor's optional gas-key metadata. */ interface IMeteorAddKeyAction { type: "AddKey"; params: AddKeyAction["params"] & { gasKeyInfo?: IMeteorGasKeyInfo; }; } /** * The wallet-selector Action union extended with Meteor's gas-key actions. Wallet-selector's * Action type has no knowledge of these NEAR protocol extensions — they are serialized through * the patched @near-js/transactions borsh schema (see patches/) — so this union is the SDK's * public action type wherever gas-key actions can appear. A plain wallet-selector Action is * assignable to it, so existing callers keep working unchanged. */ type TMeteorAction = Exclude | IMeteorAddKeyAction | IMeteorTransferToGasKeyAction | IMeteorWithdrawFromGasKeyAction; //#endregion //#region src/MeteorConnect/target_clients/v1_client/MeteorConnectV1Client.types.d.ts type TMeteorConnectV1ExecutionTargetConfig = IMeteorConnection_V1_Web | IMeteorConnection_V1_Web_Localhost | IMeteorConnection_V1_Ext; //#endregion //#region src/ported_common/near/near_basic_types.d.ts declare enum ENearNetwork { localnet = "localnet", testnet = "testnet", betanet = "betanet", mainnet = "mainnet" } //#endregion //#region src/ported_common/dapp/dapp.enums.d.ts declare enum EExternalActionType { login = "login", sign = "sign", logout = "logout", verify_owner = "verify_owner", keypom_claim = "keypom_claim", sign_message = "sign_message", sign_delegate_actions = "sign_delegate_actions" } declare enum EMeteorWalletSignInType { ALL_METHODS = "ALL_METHODS", SELECTED_METHODS = "SELECTED_METHODS", ACCOUNT_ONLY = "ACCOUNT_ONLY" } declare enum EWalletExternalActionStatus { UNCONFIRMED = "UNCONFIRMED", PENDING = "PENDING", SUCCESS = "SUCCESS", FAILURE = "FAILURE" } declare enum EMeteorInjectedFeature { new_key_transfer = "new_key_transfer", open_page = "open_page", batch_import = "batch_import", sync_check = "sync_check", account_sync = "account_sync" } declare enum EDappActionSource { website_callback = "wcb", website_post_message = "wpm", website_visit = "wv", extension_injected = "ext" } declare enum EDappActionConnectionStatus { initializing = "initializing", connected = "connected", attempting_reconnect = "attempting_reconnect", disconnected = "disconnected", closed_success = "closed_success", closed_fail = "closed_fail", closed_window = "closed_window" } //#endregion //#region src/ported_common/dapp/dapp.errors.d.ts declare enum EDappActionErrorTag { NEW_ACTION_STARTED = "NEW_ACTION_STARTED", INCOMPLETE_ACTION = "INCOMPLETE_ACTION", NO_ACCOUNTS = "NO_ACCOUNTS", WINDOW_CLOSED = "WINDOW_CLOSED", USER_CANCELLED = "USER_CANCELLED", POPUP_WINDOW_REFUSED = "POPUP_WINDOW_REFUSED", POPUP_WINDOW_OPEN_FAILED = "POPUP_WINDOW_OPEN_FAILED", EXT_DIRECT_RESPONSE_FAILED = "EXT_DIRECT_RESPONSE_FAILED" } //#endregion //#region src/ported_common/dapp/dapp.validation.d.ts declare const ZO_DappSignInAction_Contract_SelectedMethods: z.ZodObject<{ contract_id: z.ZodString; public_key: z.ZodString; type: z.ZodLiteral; methods: z.ZodArray; }, z.core.$strip>; declare const ZO_DappSignInAction_Contract_AllMethods: z.ZodObject<{ contract_id: z.ZodString; public_key: z.ZodString; type: z.ZodLiteral; methods: z.ZodOptional; }, z.core.$strip>; declare const ZO_DappSignInAction_AccountOnly: z.ZodObject<{ type: z.ZodLiteral; }, z.core.$strip>; //#endregion //#region src/ported_common/dapp/dapp.types.d.ts interface IRejectReason { message: string; endTags: (EDappActionErrorTag | string)[]; } declare class MeteorActionError extends Error { _reason: IRejectReason; cause?: Error; constructor(reason: PartialBy, previousError?: Error); } type TMeteorWalletExternalAction_SignIn_AllMethods = z.infer; type TMeteorWalletExternalAction_SignIn_SelectedMethods = z.infer; type TMeteorWalletExternalAction_SignIn_AccountOnly = z.infer; interface IMeteorWalletExternalAction_SignIn_OptionalMessageParams { messageParams?: Omit; } type TDappAction_SignIn_Data = IMeteorWalletExternalAction_SignIn_OptionalMessageParams & (TMeteorWalletExternalAction_SignIn_AllMethods | TMeteorWalletExternalAction_SignIn_SelectedMethods | TMeteorWalletExternalAction_SignIn_AccountOnly); interface IOMeteorWalletSdk_RequestSignIn_Inputs { addFunctionCallKey?: PartialBy; messageParams?: IODappAction_SignMessage_Input; } interface IWithAccountIdentifier { accountIdentifier: IMeteorConnectAccountIdentifier; } interface IWithMeteorWalletAccount { account: IMeteorConnectAccount; } interface IODappAction_SignMessage_Input { message: string; nonce: Buffer | { [key: number]: number; }; recipient: string; callbackUrl?: string; state?: string; accountId?: string; } interface IODappAction_SignMessage_Output { accountId: string; publicKey: string; signature: string; state?: string; } interface IOMeteorWalletSdkAccount_SignAndSendTransaction_Input { receiverId: string; actions: Action$2[]; } interface IWithCallbackUrl { callback_url: string; } interface IOMeteorWalletSdk_SignIn_Output { accessKey?: KeyPair; accountId: string; signedMessage?: IODappAction_SignMessage_Output; } interface IODappAction_PostMessage_SignIn_Output { accountId: string; allKeys: string[]; signedMessage?: IODappAction_SignMessage_Output; } interface IODappAction_VerifyOwner_Input { message: string; accountId?: string; } interface IODappAction_VerifyOwner_Output { accountId: string; message: string; blockId: string; publicKey: string; signature: string; keyType: KeyType; } interface IODappAction_PostMessage_SignTransactions_Input { transactions: string; } interface ITransactionHashOutput { hash: string; nonceString: string; } interface IODappAction_PostMessage_SignTransactions_Output { executionOutcomes: FinalExecutionOutcome[]; } /** * Information to send NEAR wallet for signing transactions and redirecting the browser back to the calling application */ interface IORequestSignTransactionsRedirect_Inputs { /** list of transactions to sign */ transactions: Transaction$1[]; /** url NEAR Wallet will redirect to after transaction signing is complete */ callback_url?: string; /** meta information NEAR Wallet will send back to the application. `meta` will be attached to the `callbackUrl` as a url search param */ meta?: string; } type TMeteorSdkV1Transaction = Omit & { actions: TMeteorAction[]; }; interface IORequestSignTransactions_Inputs { /** list of transactions to sign */ transactions: TMeteorSdkV1Transaction[]; } interface IDappAction_SignTransactions_Data { status: EWalletExternalActionStatus; transactions: Transaction[]; } interface IORequestSignDelegateActions_Input { /** list of delegate actions to sign */ delegateActions: TSimpleNearDelegateAction[]; } interface ISignDelegateActionReturn { delegateHash: Uint8Array; signedDelegate: SignedDelegate; } interface IORequestSignDelegateActions_Output { signedDelegatesWithHashes: ISignDelegateActionReturn[]; } interface IDappAction_SignDelegateActions_Data { delegateActions: DelegateAction[]; } interface ISignedDelegateWithHash { delegateHash: Uint8Array; signedDelegate: SignedDelegate; } interface IODappAction_PostMessage_SignDelegateActions_Input { delegateActions: string; } interface ISerializedSignedDelegateWithHashes { delegateHash: string; signedDelegateAction: string; } interface IODappAction_PostMessage_SignDelegateActions_Output { signedDelegatesWithHashes: ISerializedSignedDelegateWithHashes[]; } interface IOWalletExternalLinkedContract { contract_id: string; public_key: string; } interface IDappAction_Logout_Data { accountId: string; contractInfo: IOWalletExternalLinkedContract; } type TMeteorComListener = (data?: D) => void; declare enum EMeteorExtensionDirectActionType { open_meteor_connect = "open_meteor_connect", check_sync_status = "check_sync_status", sync_accounts = "sync_accounts", open_page = "open_page" } interface IMeteorExtensionDirectAction_Input { actionType: A; inputs: I; } type TMeteorExtensionDirectAction_OpenPage_Input = IMeteorExtensionDirectAction_Input; type TMeteorExtensionDirectAction_OpenMeteorConnect_Input = IMeteorExtensionDirectAction_Input; interface IMeteorExtensionDirectAction_OpenPage_Output { opened: boolean; } interface IMeteorComInjectedObject { sendMessageData: (data: any) => void; addMessageDataListener: (listener: TMeteorComListener) => void; directAction: = IMeteorExtensionDirectAction_Input, O = any>(data: I) => Promise; features?: EMeteorInjectedFeature[]; } interface IMeteorComInjectedObjectV2 { version: "v2"; featureFlags: string[]; sendMessageDataAndRespond: (data: any) => Promise; } interface IExternalAction_Base { uid: string; connectionStatus: EDappActionConnectionStatus; source: EDappActionSource; network: ENearNetwork; referrerHost?: string; referrerOrigin?: string; referrerFull?: string; } interface IDappAction_Login extends IExternalAction_Base { actionType: EExternalActionType.login; inputs: TDappAction_SignIn_Data; } interface IDappAction_SignMessage extends IExternalAction_Base { actionType: EExternalActionType.sign_message; inputs: IODappAction_SignMessage_Input; } interface IDappAction_SignTransaction extends IExternalAction_Base { actionType: EExternalActionType.sign; inputs: IDappAction_SignTransactions_Data; callbackUrl?: string; meta?: string; } interface IDappAction_Logout extends IExternalAction_Base { actionType: EExternalActionType.logout; inputs: IDappAction_Logout_Data; } interface IDappAction_VerifyOwner extends IExternalAction_Base { actionType: EExternalActionType.verify_owner; inputs: IODappAction_VerifyOwner_Input; } interface IDappAction_SignDelegateActions extends IExternalAction_Base { actionType: EExternalActionType.sign_delegate_actions; inputs: IDappAction_SignDelegateActions_Data; } type IMeteorActionResponse_Output = { success: true; payload: T; message?: string; endTags: string[]; } | { success: false; payload?: undefined; message: string; endTags: string[]; }; interface IPostMessageConnection { uid: string; actionType: EExternalActionType; status: EDappActionConnectionStatus; promise: Promise>; resolve: (output: IMeteorActionResponse_Output) => void; reject: (reason: MeteorActionError) => void; currentPayload: any; endTags: (string | EDappActionErrorTag)[]; inputs: any; lastAttemptedConnection: number; lastConnection: number; network: ENearNetwork; forceExecutionTargetConfig?: TMeteorConnectV1ExecutionTargetConfig; } type TPostMessageSend = Pick & { tabId?: number; inputs?: any; }; type TClientPostMessageResponse = Pick & { tabId?: number; payload?: any; }; type TReferrerBits = { knownRef: true; referrerHost: string; referrerOrigin: string; referrerFull: string; } | { knownRef: false; referrerHost?: string; referrerOrigin?: string; referrerFull?: string; }; //#endregion //#region src/MeteorConnect/action/mc_action.types.d.ts type TMCActionInputTransform = "targeted_account" | "custom_expansion"; type TMCActionExecutionTargetSource = "on_execution" | "targeted_account"; interface IMCActionMeta { inputTransform?: TMCActionInputTransform[]; executionTargetSource?: TMCActionExecutionTargetSource; } interface IMCActionSchema { input: Record; output: Record; expandedInput: Record; meta?: IMCActionMeta; } type TMCActionRequestUnion> = { [K in keyof T]: { id: K; input: T[K]["input"]; } }[keyof T]; type TMCActionRequestUnionExpandedInput> = { [K in keyof T]: { id: K; expandedInput: T[K]["expandedInput"]; } }[keyof T]; interface IMCAction_WithNetworkTarget { target: IMeteorConnectNetworkTarget; } interface IMCAction_WithExactAccountTarget { target: IMeteorConnectAccountIdentifier; } interface IMCAction_WithFullAccount { account: IMeteorConnectAccount; } interface IMCActionExecutionState { isExecuting: boolean; targetedPlatform: TMeteorConnectionExecutionTarget | "unset"; } //#endregion //#region src/MeteorConnect/action/mc_action.near.d.ts interface FunctionCallAccessKey_AllowMethods_AnyMethod { anyMethod: true; } interface FunctionCallAccessKey_AllowMethods_SelectMethods { anyMethod: false; methodNames: string[]; } type AddFunctionCallKey_AllowMethods = FunctionCallAccessKey_AllowMethods_AnyMethod | FunctionCallAccessKey_AllowMethods_SelectMethods; interface FunctionCallAccessKey_GasAllowance_Unlimited { kind: "unlimited"; } interface FunctionCallAccessKey_GasAllowance_Limited { kind: "limited"; /** The amount of gas allowed over the lifetime of the key in yoctoNEAR. */ amount: string; } type AddFunctionCallKey_GasAllowance = FunctionCallAccessKey_GasAllowance_Unlimited | FunctionCallAccessKey_GasAllowance_Limited; interface AddFunctionCallKeyParams { contractId: string; /** Using format ":" e.g. "ed25519:3N5QmbhVqLh9ZtZs1zj8X9v1u1Z1Z1Z1Z1Z1Z1Z1Z1Z" */ publicKey: string; allowMethods: AddFunctionCallKey_AllowMethods; /** Optional: The gas allowance for the function call key over its lifetime of executing transactions. * Default to "limited" with 0.25 NEAR (non-Yocto). */ gasAllowance?: AddFunctionCallKey_GasAllowance; } interface IMCAInput_Near_SignIn_BaseParams { /** @deprecated use addFunctionCallKey */ contract?: { id: string; methods?: string[]; }; /** * If this is provided, the connector will filter for wallets that support the "signInWithFunctionCallAccessKey" feature and use these * params to add a function call access key during sign in. * * These params indicate to the wallet that a Function Call Key with these parameters should be added during the sign in process with the specified parameters. * * See: https://docs.near.org/protocol/access-keys#function-call-keys */ addFunctionCallKey?: PartialBy; } interface IMCAInput_Near_SignIn extends IMCAInput_Near_SignIn_BaseParams, IMCAction_WithNetworkTarget {} interface IMCAInput_Near_SignInAndSignMessage extends IMCAInput_Near_SignIn { messageParams: INearSignMessageParams; } interface IMCAOutput_Near_SignInAndSignMessage extends IMeteorConnectAccount { signedMessage: SignedMessage; } interface INearSignMessageParams { message: string; recipient: string; nonce: Uint8Array; callbackUrl?: string; state?: string; } interface IMCAInput_Near_SignMessage extends IMCAction_WithExactAccountTarget { messageParams: INearSignMessageParams; } interface IMCAInput_Near_VerifyOwner extends IMCAction_WithExactAccountTarget { message: string; } type TSimpleNearTransaction = { receiverId: string; actions: TNearNativeAction[]; }; interface IMCA_Near_SignTransactions_Input extends IMCAction_WithExactAccountTarget { transactions: TSimpleNearTransaction[]; /** * Default `true`: when the account signed in with a function-call key (`addFunctionCallKey`) * that covers every transaction — calls to that contract, allowed methods, no deposit — they are * signed and sent with it directly, without opening the wallet. Anything it does not cover (a * deposit, another contract) still goes to the wallet. Set `false` to always ask the wallet. */ useFunctionCallKey?: boolean; } interface INearNativeDelegateAction { senderId: string; receiverId: string; actions: Array; nonce: bigint; maxBlockHeight: bigint; publicKey: PublicKey; } type TSimpleNearDelegateAction = Omit; interface IMCA_Near_SignDelegateActions_Input extends IMCAction_WithExactAccountTarget { delegateActions: TSimpleNearDelegateAction[]; } //#endregion //#region src/MeteorConnect/action/mc_action.combined.d.ts declare const MCActionRegistryMap: { "meteor_wallet_core::transfer_accounts": { readonly input: _meteorwallet_connect_shared0.TAllAccountsTransferDataEncrypted; readonly expandedInput: _meteorwallet_connect_shared0.TAllAccountsTransferDataEncrypted; readonly output: IMCAOutput_MeteorWalletCore_TransferAccounts; readonly meta: { readonly executionTargetSource: "on_execution"; }; }; "meteor_wallet_core::new_key_account_transfer_start": { readonly input: _meteorwallet_connect_shared0.TNewKeyTransferStartInputV1; readonly expandedInput: _meteorwallet_connect_shared0.TNewKeyTransferStartInputV1; readonly output: _meteorwallet_connect_shared0.TNewKeyTransferStartOutputV1; readonly meta: { readonly executionTargetSource: "on_execution"; }; }; "meteor_wallet_core::new_key_account_transfer_verify_active": { readonly input: _meteorwallet_connect_shared0.TNewKeyTransferVerifyActiveInputV1; readonly expandedInput: _meteorwallet_connect_shared0.TNewKeyTransferVerifyActiveInputV1; readonly output: _meteorwallet_connect_shared0.TNewKeyTransferVerifyActiveOutputV1; readonly meta: { readonly executionTargetSource: "on_execution"; }; }; "near::sign_in": { readonly input: IMCAInput_Near_SignIn; readonly expandedInput: IMCAInput_Near_SignIn; readonly output: IMeteorConnectAccount; readonly meta: { readonly executionTargetSource: "on_execution"; }; }; "near::sign_in_and_sign_message": { readonly input: IMCAInput_Near_SignInAndSignMessage; readonly expandedInput: IMCAInput_Near_SignInAndSignMessage; readonly output: IMCAOutput_Near_SignInAndSignMessage; readonly meta: { readonly executionTargetSource: "on_execution"; }; }; "near::sign_out": { readonly input: IMCAction_WithExactAccountTarget; readonly expandedInput: IMCAction_WithFullAccount; readonly output: IMeteorConnectAccountIdentifier; readonly meta: { readonly inputTransform: ["targeted_account"]; readonly executionTargetSource: "targeted_account"; }; }; "near::sign_message": { readonly input: IMCAInput_Near_SignMessage; readonly expandedInput: IMCAInput_Near_SignMessage & IMCAction_WithFullAccount; readonly output: _near_js_signers0.SignedMessage; readonly meta: { readonly inputTransform: ["targeted_account"]; readonly executionTargetSource: "targeted_account"; }; }; "near::sign_transactions": { readonly input: IMCA_Near_SignTransactions_Input; readonly expandedInput: IMCA_Near_SignTransactions_Input & IMCAction_WithFullAccount; readonly output: _near_js_types0.FinalExecutionOutcome[]; readonly meta: { readonly inputTransform: ["targeted_account"]; readonly executionTargetSource: "targeted_account"; }; }; "near::sign_delegate_actions": { readonly input: IMCA_Near_SignDelegateActions_Input; readonly expandedInput: IMCA_Near_SignDelegateActions_Input & IMCAction_WithFullAccount; readonly output: IORequestSignDelegateActions_Output; readonly meta: { readonly inputTransform: ["targeted_account"]; readonly executionTargetSource: "targeted_account"; }; }; "near::verify_owner": { readonly input: IMCAInput_Near_VerifyOwner; readonly expandedInput: IMCAInput_Near_VerifyOwner & IMCAction_WithFullAccount; readonly output: IODappAction_VerifyOwner_Output; readonly meta: { readonly inputTransform: ["targeted_account"]; readonly executionTargetSource: "targeted_account"; }; }; }; type TMCActionRegistry = typeof MCActionRegistryMap; type TMCActionOutput> = TMCActionRegistry[R["id"]]["output"]; //#endregion //#region src/MeteorConnect/logging/MeteorLogger.d.ts /** * Centralized logging utility for MeteorConnect * Manages global logging level and provides customized logger instances */ declare class MeteorLogger { private static globalLoggingLevel; /** * Set the global logging level for all logger instances */ static setGlobalLoggingLevel(level: TMCLoggingLevel): void; /** * Get the current global logging level */ static getGlobalLoggingLevel(): TMCLoggingLevel; /** * Create a new logger instance with a custom prefix * @param prefix - The prefix to use for log messages (e.g., "MeteorConnect", "MeteorConnect [ExecutableAction]") */ static createLogger(prefix: string): LoggerInstance; } /** * Logger instance with customized prefix */ declare class LoggerInstance { private readonly prefix; constructor(prefix: string); /** * Log a message respecting the global logging level * @param message - The message to log * @param meta - Optional metadata to log in debug mode */ log(message: string, meta?: any): void; err(message: string, meta?: any): void; formatMsg(message: string): string; } //#endregion //#region src/MeteorConnect/target_clients/base/MeteorConnectClientBase.d.ts declare abstract class MeteorConnectClientBase { protected readonly meteorConnect: MeteorConnect; abstract readonly clientName: string; abstract readonly executionTargets: TMeteorConnectionExecutionTarget[]; protected abstract logger: LoggerInstance; constructor(meteorConnect: MeteorConnect); abstract getExecutionTargetConfigs>(request: R): Promise; abstract makeRequest>(request: R, connection: TMeteorExecutionTargetConfig): Promise>; abstract getEnvironmentSupportedPlatforms(): Promise; } //#endregion //#region src/MeteorConnect/target_clients/mobile_bridge/MobileBridgeSession.d.ts /** * This SDK's own flow-ending sentinels. They are the SDK's vocabulary, not protocol errors — * every BACKEND failure is classified through `describeSessionError` (kind / ids / retry) and is * never matched by message. Shared so the thrower here and the outcome mapper in * `MeteorConnectTransferAccounts` cannot drift apart. */ declare const MOBILE_BRIDGE_ENDING: { /** The user, the wallet, or a phase-safe close ended the flow before a result was accepted. */readonly cancelled: "mobile_bridge_cancelled"; /** A deadline passed, or the bridge was already gone, with no signed result. */ readonly expired: "mobile_bridge_expired"; /** The owning action released this session. */ readonly disposed: "mobile_bridge_session_disposed"; /** The session terminalized in `failed`, or its redial budget ran out. */ readonly failed: "mobile_bridge_failed"; /** The signed result did not answer the request this session staged. */ readonly resultMismatch: "mobile_bridge_action_result_mismatch"; /** Prefix of a signed typed-error result; the typed ids follow after ": ". */ readonly walletDeclined: "mobile_bridge_wallet_declined"; /** The backend refused this partner identity's handshake; only a reset re-pairs. */ readonly identityPinMismatch: "mobile_bridge_identity_pin_mismatch"; /** The SDK's own 3-submission cap (the protocol exposes no attempt counter). */ readonly pinAttemptsExceeded: "PIN attempts exceeded"; /** A next turn was asked for on a session that is not holding an external-work window. */ readonly externalWorkHoldUnavailable: "mobile_bridge_external_work_hold_unavailable"; }; /** * How long a turn keeps re-sending a closing verb the transport lost (`sendClosingVerb`). The * wallet's verified answer waits on it, so the window is short: long enough for a resumed mobile * tab to redial its bridge link, never long enough to leave the user watching a spinner. */ interface IClosingVerbRetryPolicy { /** Re-sends after the first attempt. */ maxRetries: number; /** The whole window, first attempt included; no re-send starts after it. */ budgetMs: number; /** Pause before the first re-send, doubled for each one after it. */ initialBackoffMs: number; } type TMobileBridgePhase = "initializing" | "busy_other_tab" | "creating_bridge" | "waiting_for_wallet" | "wallet_confirmation" | "wallet_verification" | "wallet_action" /** The wallet's signed result is staged on the bridge and has not been acknowledged yet. */ | "result_ready" /** The session is held open while off-bridge work (the AddKey window) completes. */ | "external_work" | "completed" | "failed" | "cancelled"; interface IMobileBridgeSnapshot { phase: TMobileBridgePhase; push: "not_attempted" | "sending" | "delivered" | "not_delivered"; /** * The SDK's own judgment of the push-wake outcome (`classifyPushWakeOutcome`). A wallet with no * push registration — every web wallet — reports `delivered: false, reason: no_token`, which is * `expected`/`informational`: the QR/link is the delivery path there, not a fallback. */ pushOutcome?: IPushWakeOutcomeClassification; /** The typed `ESessionNotifyWalletReason` behind a non-delivery, when the backend named one. */ pushReason?: string; deepLink?: string; /** Idle deadline — the countdown; every successful transition pushes it out. */ idleExpiresAt?: number; /** Absolute deadline — the hard wall no refresh moves. */ absoluteExpiresAt?: number; /** * The last accepted authenticated session facts. Carried verbatim so the UI can derive its own * presentation from the SDK's own pure helpers — `describeCloseOptions(facts, "partner")` for * the close verb, `isTerminalPhase(facts)` for terminality — instead of re-deriving either from * the projected phase. Facts carry no secret material (phase, deadlines, policy bounds only). */ facts?: Readonly; /** The SDK-maintained bridge link health phase (`client.linkStatus`). */ linkPhase: TSessionLinkPhase; /** Redial attempt within the current outage; 0 whenever no redial is pending. */ linkRedialAttempt: number; /** How long until that redial fires, when one is scheduled. */ linkRetryInMs?: number; /** * The request has reached the wallet's side at least once: its link was opened from this page, * or the page went to the background while the request was live (a push wake, or the user * switching to the wallet app). A link drop after that is the backgrounded tab having lost its * socket, so the UI resumes quietly instead of presenting the redial ladder and an Open button. */ handedOff?: boolean; /** Why the bridge session was permanently released, when it was. */ terminalReason?: IBridgeSessionTerminalOutcome["reason"]; pinAttemptsUsed: number; pinError?: string; /** * Failure copy, classified ONCE here through `describeSessionError` (DX5). The UI renders * `errorHeadline`/`errorDetail` and keeps `error` — the untouched original message — as fine * print; `errorIds` carries the typed protocol ids so no consumer ever matches on a string. */ errorHeadline?: string; errorDetail?: string; errorIds?: string[]; /** * The classifier's typed kind for the failure — `"connection"` when the backend could not be * reached (or answered wrongly), as opposed to a protocol rejection or a local guard. The * Connect popup decides presentation against this, never against the message: a backend that * is unreachable before any wallet took part is dropped quietly while another wallet platform * is on offer (`isMobileBridgeQuietlyUnavailable`). */ errorKind?: TSessionErrorKind; error?: string; /** * The flow phase this session was in when it failed, recorded by the failure itself. It tells a * request no wallet ever took part in — one that failed while being created, or while its link * waited to be opened — apart from one a wallet was already handling, without reading the error: * only the first is safely replaced by a fresh request (`mobileBridgeRetryableFailure`). */ failedFromPhase?: TMobileBridgePhase; identityResetRequired?: boolean; } interface IMobileBridgeSessionInput { token: string; client: PartnerSessionClient; prepared: IMobileBridgePreparedAction; /** Ordered app-id preference: session targeting + wallet-link selection (first match wins). */ targetMeteorAppIds: EMeteorAppId$1[]; /** Dev-only: rebase the selected web wallet link onto a local origin (transfer "web_local_dev"). */ localDevLinkRewrite?: { baseUrl: string; mcBackendHintUrl: string; }; pushWallet?: TPartnerPairedWallet; /** * Bind the session to ONE already-paired wallet server-side as well as locally (the new-key * verification turn, which must reach exactly the wallet that minted the destination key). */ pinnedWallet?: TPartnerPairedWallet; /** * The exact wallet verify key this session is FOR, when the full paired-wallet record needed for * a backend pin is unavailable (stabilization SDK-3 recovery): the claim is open (QR-directed), * but a claimant with any other verify key is refused locally before an action result is * consumed. The wallet-side (partnerVerifyPublicKey, transferSessionId) binding remains the * authoritative gate either way (D4). */ expectedWalletVerifyPublicKey?: string; /** * Journal-before-hold seam. Present only for `new_key_account_transfer_start`: supplying it is * what swaps this turn's closing verb from `acknowledgeAndClose` to * `acknowledgeAndBeginExternalWork`, leaving the session held open for the AddKey window. */ journalBeforeExternalWorkHold?: TMobileBridgeExternalWorkJournal; buildConnection(wallet: TPartnerPairedWallet): IMeteorConnection_V2_BridgeMobile; persistFunctionCallKey?: (network: string, accountId: string, keyPair: KeyPair) => Promise; isCurrent(token: string): boolean; assertIdentityGeneration(): Promise; acquireFirstPairingLease(): Promise; registerLiveSession(): Promise<{ stop(): Promise; }>; /** * Same-device auto-open (`mobileAppAutoOpen.ts`), offered only for an eligible request. Called * once, after the link is published and before the push wake; resolves true only when the app * demonstrably came to the foreground, in which case the push is skipped — it would only race * the link's claim with a second one for the same bridge. */ autoOpen?: (session: MobileBridgeSession) => Promise; /** Records what this page learned about whether the wallet's app lives on this device. */ sameDevice?: { remember(walletVerifyPublicKey: string): void; forget(walletVerifyPublicKey: string): void; }; /** Test seam: the re-send window for a lost closing verb. Defaults to {@link CLOSING_VERB_RETRY}. */ closingVerbRetry?: IClosingVerbRetryPolicy; } declare class MobileBridgeSession { readonly token: string; /** * The turn this session is currently carrying. Mutable because the new-key flow is two-turn: * the verification request replaces the start request on the SAME session after the * external-work hold (`beginNextTurn`). */ private preparedAction; private readonly input; private readonly listeners; private readonly clientSubscriptions; private visibilityListener?; /** The SDK's echoed idempotency id for this logical request — the exact-retry handle (D8). */ private partnerRequestId?; private createdSession?; private selectedWalletLink?; private resultSettled; private resultReceipt?; /** * Set the moment this turn's result is validated — BEFORE the verb that ends the turn is sent. * `acknowledgeAndClose` terminalizes the session inside its own still-pending await, and the * client dispatches `factsChanged`/`terminal` synchronously from there, so without this flag the * `closed` phase this session just asked for reads back as a counterparty close and rejects the * very result being acknowledged. Only that one reading is suppressed here: a `failed` phase, or * any terminal outcome other than the `closed` we asked for, still fails the turn — unless * {@link deliveringWalletAnswer} says the answer is delivered whatever the session does. */ private closingAfterOwnResult; /** * Set once this turn holds the wallet's verified answer and is only closing the session behind it * (`acknowledgeAndClose`). From then on the session's own fate — a failed phase, a terminal * outcome, a refused link, a passed deadline — no longer decides the turn: acknowledgement is * transport receipt, never acceptance, so the answer is delivered whatever becomes of the bridge. * The external-work hold never sets it; that verb opens state the next turn depends on, so a * session failing under it still fails the turn. */ private deliveringWalletAnswer; /** * How this page last opened the wallet link (a tap, or an automatic same-device attempt) and * whether the page went to the background after it. Together with a claim, that is the evidence * the wallet's app is on this device (`input.sameDevice`). */ private linkOpened?; private hiddenAfterLinkOpened; private sameDeviceNoted; /** Set once this session parks in the external-work hold; cleared when the next turn starts. */ private externalWorkHold?; /** * The journal-before-hold seam of the CURRENT turn. Only an initial `..._start` turn can carry * one, so the turn installed after a hold clears it — a hold is never entered twice. */ private turnExternalWorkJournal?; private claimedWallet?; private completedConnection?; private resolveResult; private rejectResult; private resultPromise; private preparationPromise?; /** * Once-only guard for `collectResult()` — both entry points assign it with `??=`, and * `beginNextTurn` clears it to re-arm the next turn. Its value is deliberately never read: * biome's `noUnusedPrivateClassMembers` therefore reports it, and applying that autofix * would let one turn collect its result twice. */ private collectionPromise?; private readonly abortController; private pairingLease?; private pairingLeasePromise?; private pairingRetryTimer?; private liveSession?; private expiryTimer?; private disposePromise?; private snapshot; /** One turn's result promise; re-armed for the turn that follows an external-work hold. */ private armResultPromise; /** The turn this session is carrying right now. */ get prepared(): IMobileBridgePreparedAction; constructor(input: IMobileBridgeSessionInput); startPreparation(): Promise; getSnapshot(): IMobileBridgeSnapshot; subscribe(listener: (snapshot: IMobileBridgeSnapshot) => void): () => void; private update; prepare(): Promise; /** * Re-arm this session for the turn that follows its external-work hold, and stage that turn on * the SAME bridge. `prepareAction` is the client's own prepare-before-send seam — it durably * persists the exact signed turn under the session mutation lock — and `submitPreparedAction` * re-validates and transmits it. The turn's own request, result promise and receipt are * replaced; the bridge, the pairing and the claimed wallet are the ones the held turn proved. */ beginNextTurn(prepared: IMobileBridgePreparedAction): Promise; /** The idempotency id this session was allocated under — reuse only for an exact retry. */ getPartnerRequestId(): string | undefined; /** The bridge this session was allocated on, once creation succeeded. */ getBridgeId(): string | undefined; /** The verified result receipt, once the wallet's signed result has been validated. */ getResultReceipt(): ISessionResultReceipt | undefined; /** * The live external-work hold this session is parked in, or `undefined` when it is not holding * one. Only a held session can carry the next turn; anything else takes a fresh session. */ getExternalWorkHold(): IMobileBridgeExternalWorkHold | undefined; /** * `client.events` replaces the deleted subclass hooks. Handlers run synchronously inside the * client's own hook processing, so none of them may call a client mutation — they only read * getters and update this projection (the pairing lease is the SDK's own, not the client's). */ private watchClientEvents; private watchDocumentVisibility; /** Only a live request with a published link can have been handed to the wallet. */ private markHandedOff; private applySessionFacts; private applyTerminalOutcome; /** * A failure the SESSION reported — its facts, its terminal outcome, its deadline — as opposed to * one this turn's own collection raised. Ignored while {@link deliveringWalletAnswer}: the * wallet's verified answer is delivered whatever becomes of the bridge behind it. */ private failFromSession; private publishWalletLink; /** * Wake an already-paired wallet for the initial claim. The outcome is CLASSIFIED, never * booleanised: a web wallet has no push registration at all, so `delivered: false` with reason * `no_token` is the expected path and the QR/link stays the real delivery channel. */ private notifyPairedWallet; /** * Wake the already-claimed wallet for the turn that follows the external-work hold. Same * classification rule as the initial claim: never booleanised, and never a reason to hide the * link — the wallet may simply still be sitting on the same bridge. */ private notifyWalletForTurn; private applyWakeOutcome; /** * Wait → match → validate against the exact request we staged, then end in ONE explicit verb. * `waitForValidatedResult` never acknowledges anything itself, and a session parked in * `result_ready` blocks the wallet — so every arm below, the failures included, sends a verb. */ private collectResult; private collectMeteorWalletCoreResult; private collectNearResult; /** * End this turn with `acknowledgeAndClose`. Never throws: the wallet's answer is already verified * and bound to this turn, and acknowledgement is transport receipt, never acceptance — so a verb * that cannot be delivered (the backgrounded mobile tab whose bridge socket died as it resumed) * must not discard that answer. The unacknowledged session expires on the backend by itself. */ private acknowledgeAndClose; /** * Send one closing verb, re-sending it while the failure was the transport's. Every closing verb * is an exact replay — the client caches its signed request per receipt and the backend converges * on a repeat — so a send the bridge link dropped mid-flight is simply sent again once the link is * back, inside the {@link IClosingVerbRetryPolicy} window. A session that ended in the meantime * (the first send may have landed and only its answer been lost) is not sent to again. Rejects * with the last failure. */ private sendClosingVerb; /** * Whether a failed closing verb is worth sending again. An exact replay converges on the backend, * so the only question is whether the transport lost it: an `exact`-retry classification, or none * at all — a request the link dropped mid-flight (`err_nice_transport` `send_failed`, "link * channel disconnected") is still unclassified by this client version. Typed refusals, terminal * outcomes and local guards are final. */ private isTransportLoss; /** * Pause before re-sending a lost closing verb, then give the bridge link — usually mid-redial * after the drop that lost the verb — until `deadline` to come back `live`. An `offline` link (the * bounded redial ladder gave up while the tab sat in the background) is revived first. A link that * stays down is never waited out past the deadline; the re-send finds out for itself. */ private awaitBridgeLinkForResend; /** * Which wallet claimed THIS session. * * `client.claimedWallet` is the session's own binding (0.13+), so this no longer has to diff the * whole paired-wallet ledger against a pre-session baseline and fail closed on an ambiguous * result. A pushed session additionally pins the exact verify key it targeted — a claim by any * other wallet is refused rather than accepted. */ private resolveClaimedWallet; private scheduleExpiry; private ensureFirstPairingLease; private releaseFirstPairingLease; private fail; private markCancelled; submitPin(pinCode: string): Promise; /** * Revive a bridge link the SDK's bounded redial ladder gave up on (`linkPhase === "offline"`). * The panel's Reconnect button is the user-mediated half of `maxRedialAttempts`: while * `reconnecting`, the ladder still owns the dial and this is a no-op. */ reconnectLink(): Promise; /** The backend-issued wallet link the deep link / QR was built from (undefined pre-session). */ getSelectedWalletLink(): TMeteorBridgeWalletLink | undefined; /** Exact verified wallet identity that authored a completed new-key transfer result. */ getCompletedConnection(): IMeteorConnection_V2_BridgeMobile | undefined; isCommitted(): boolean; /** * Cancel before the wallet commits. The close verb is never chosen by hand: `describeCloseOptions` * names the one operation the §5.7 matrix permits for the partner in the current authenticated * phase, and `closePhaseSafe` performs exactly that one — never a blind destructive close. */ cancel(): Promise<"cancelled_before_commit" | "target_already_committed">; /** * End this session from the owning action's teardown. Unlike {@link cancel} — whose * `target_already_committed` answer deliberately keeps a wallet-held request alive so another * execution target can adopt it — abandonment always sends the ONE close verb §5.7 permits for * the current authenticated phase, so a session is never left parked in `result_ready` sitting * on the wallet's signed result. An external-work hold is closed here too: reaching abandonment * means the owning action was cancelled, so the AddKey window is over before it began. */ abandon(): Promise; awaitResult(): Promise; /** * Open the wallet link through `open`. A synchronous opener counts as an attempt as soon as it * returns; an opener that answers asynchronously (a sandboxed host relaying the attempt to its * host frame) counts only once its promise resolves — a refusal is a rejection, returned to the * caller so the UI can report it, and it never reads as a hand-off: the wallet was not reached. */ openInApp(open: (fullLink: string) => void | Promise, options?: { automatic?: boolean; }): void | Promise; private noteLinkOpened; /** * A wallet claimed after this page opened its app link and then went to the background: the app * that claimed is on this device. Web wallet links prove nothing about the device. */ private noteSameDeviceClaim; /** * An automatic open the page never left for means the app did not come up on this device — * blocked, dismissed, or uninstalled since. Forget the evidence so later requests go back to * waiting for a tap rather than repeating an attempt this device does not honour. */ private concludeSameDeviceEvidence; private disposeInternal; dispose(): Promise; /** * Release the owning ACTION's grip on a session that is holding an external-work window, without * touching the bridge. The start action's UI is finished, but the held session IS the transport * for the verification turn — disconnecting here would force the wallet to mint a second * destination key. Local observers (the transfer key handle, the panel) are dropped; the client * subscriptions stay, because the hold's own expiry and terminal outcomes must still land. */ releaseUiObservers(): void; } //#endregion //#region src/MeteorConnect/target_clients/mobile_bridge/MeteorConnectMobileBridgeClient.types.d.ts type TMobileNearActionId = "sign_in" | "sign_in_and_sign_message" | "sign_out" | "sign_message" | "sign_and_send_transaction" | "sign_and_send_transactions" | "sign_delegate_actions" | "verify_owner"; /** * Which Meteor Wallet platform a transfer bridge targets. Chosen by the user on the transfer * popup's platform screen; decides the app ids sent to create_bridge and therefore which wallet * links come back. NEAR actions always target the configured mobile wallet. * * "web_local_dev" (dev-gated, mirrors the V1 client's "Dev Web (Localhost)" target): a normal * dev-web-identity bridge, but the backend-issued wallet link is rebased onto the * `webDevLocalhostBaseUrl` origin (default https://localhost:3001) so QR/open-link land on a * locally running meteor-frontend. */ /** "extension" opens the V1 extension popup and is supported only for new-key transfers. */ type TTransferTargetPlatform = "web" | "mobile" | "web_local_dev" | "extension"; type TMobileBridgePreparedActionKind = { domain: "near"; sharedActionId: TMobileNearActionId; pendingFunctionCallKey?: KeyPair; retainedMessageState?: string; } | { domain: "meteor_wallet_core"; sharedActionId: "transfer_accounts" | "new_key_account_transfer_start" | "new_key_account_transfer_verify_active"; }; interface IMobileBridgePreparedAction { sdkRequest: TMCActionRequestUnionExpandedInput; actionRequest: IActionPayload_Request_JsonObject; /** * The exact pre-serialization input `actionRequest` was built from — handed to * `waitForValidatedResult({ input })` so the signed result is bound back to the request we * actually staged. For transfer this is the attachment's fresh per-bridge payload (already * encrypted, and already carried inside `actionRequest`), never the initial * `sdkRequest.expandedInput` build. */ actionInput: unknown; kind: TMobileBridgePreparedActionKind; } /** * The transfer flow's regeneration hook, threaded prepareMobileBridge → prepareRequest → adapter. * Every bridge (initial and refreshed) gets a freshly generated key + ciphertext; the pending * key handle is bound to the new session immediately after construction, inside prepareRequest. * The source itself must never be stored on IMobileBridgePreparedAction — `session.prepared` is * publicly reachable. */ interface IMobileBridgeSensitiveTransferSource { /** Re-encrypts the retained decrypted snapshot under a brand-new key; wipes any previous handle. */ buildFreshBridgePayload(): Promise; /** Binds the handle minted by the latest buildFreshBridgePayload() to its owning session. */ bindPendingHandleToSession(session: MobileBridgeSession): void; } /** * A live session parked in the bounded external-work hold. `new_key_account_transfer_start` is the * one contract whose recovery declaration permits one (`externalWorkHoldAllowed`): once the * wallet's signed start result is durably journaled, `acknowledgeAndBeginExternalWork` holds the * session open across the AddKey window so the verification turn rides the SAME bridge instead of * asking the wallet to mint a second destination key. */ interface IMobileBridgeExternalWorkHold { bridgeId: string; /** The idempotency id this session was created under — reuse only for an exact retry. */ partnerRequestId: string; /** Receipt of the held turn; the next turn is prepared against exactly this result. */ receipt: ISessionResultReceipt; /** The exact wallet identity that authored the held result. */ walletConnection: IMeteorConnection_V2_BridgeMobile; } /** * Journal-before-hold seam (D33 "journal-before-effect"). The host durably persists the wallet's * already-verified result and returns the EXACT `receipt.resultHash` it wrote; only then is the * hold verb sent. A drifted hash is refused by the backend as `external_work_journal_mismatch`, * so this callback must never invent one. */ type TMobileBridgeExternalWorkJournal = (input: { receipt: ISessionResultReceipt; output: unknown; }) => Promise; /** Everything that steers WHICH wallet, and which session, a prepared request lands on. */ interface IMobileBridgeRequestTarget { /** Transfer only: the wallet platform the user chose on the popup's platform screen. */ transferTargetPlatform?: TTransferTargetPlatform; /** Pin the session to one already-paired wallet (the new-key verification turn). */ walletConnection?: IMeteorConnection_V2_BridgeMobile; /** Journal-before-hold seam; supplied only for `new_key_account_transfer_start`. */ journalBeforeExternalWorkHold?: TMobileBridgeExternalWorkJournal; /** * Install this request as the NEXT turn of the retained external-work hold instead of creating * a new session. Refused unless the retained session is still holding exactly that bridge. */ continueExternalWorkHold?: IMobileBridgeExternalWorkHold; } //#endregion //#region src/MeteorConnect/target_clients/mobile_bridge/MeteorConnectMobileBridgeClient.d.ts declare class MeteorConnectMobileBridgeClient extends MeteorConnectClientBase { readonly clientName = "Meteor Connect Mobile Bridge Client"; readonly executionTargets: TMeteorConnectionExecutionTarget[]; protected readonly logger: LoggerInstance; private config?; /** * The backend + mobile wallet this bridge actually runs against, resolved on initialization: the * host's config, or the dev switch's pair (`setDevMobileWalletEnvironment`). */ private bridgeTarget?; private storage?; private sessionClient?; private initializePromise?; private currentSession?; private currentToken?; private currentTransferTargetPlatform?; private sessionDisposalPromise?; private coordinatorKey?; private leaseProvider?; private fencingGeneration?; private storageImplementation?; private storageIdentity?; configure(config: IMeteorConnectMobileBridgeConfig | undefined, storage: ILocalStorageInterface): void; private initializeBridgeClient; /** The mobile wallet this bridge links to — the dev switch's choice once initialized. */ private get targetMeteorAppId(); private resolveBridgeTarget; /** * The development gate shared with the V1 client's "Dev Web (Localhost)" target: a development * build, or the persisted force-dev flag. */ private isDevGateOpen; /** * The deployed environment whose backend the host configured, if any. The dev switch is only * offered on a deployed backend, so it can never silently replace a local or custom one (e.g. the * demo's `?backend=local`). */ private configuredDeployedEnvironment; private isDevMobileWalletSwitchAvailable; private getDevMobileWalletEnvironmentOverride; /** * Dev-only mobile wallet switch, offered beside the Connect popup's mobile QR like the V1 * "Dev Web (Localhost)" target: which environment's mobile wallet build the bridge links to. * `undefined` when the switch is not offered — outside the dev gate, with the bridge disabled, * or on a local/custom backend. */ getDevMobileWalletEnvironment(): Promise; /** * Persist the dev switch's environment and tear down the current, uncommitted bridge: the * session client, its storage scope and its coordinator slot all belong to one backend. The next * `prepareRequest` re-initializes against the chosen backend + mobile wallet pair. */ setDevMobileWalletEnvironment(environment: TMeteorConnectBackendEnvironment$1): Promise; /** * Serialize one durable mutation behind a named lease, re-checking the identity fence inside it. * A stale generation must never write through a lease it acquired before the reset. */ private withBridgeLease; private createStorageLeaseProvider; private assertCurrentGeneration; private releaseCoordinatorOwnership; getEnvironmentSupportedPlatforms(): Promise; getExecutionTargetConfigs>(request: R): Promise; /** * Ordered app-id preference for a prepared action. NEAR actions keep the single configured * mobile wallet id (behavior unchanged). Transfer targets the platform the user chose on the * popup's platform screen: "mobile" → the configured mobile wallet id; "web" (default) → the * web wallet matching this config's environment (meteor-frontend identifies as * meteor_wallet_web / meteor_wallet_web_dev, env-selected). Integrations testing against the * mc_backend demo wallet override the web list via transferAccounts.meteorAppIds. */ private targetMeteorAppIdsFor; /** * Whether the transfer popup offers "Meteor Web (Local Dev)" — same gate as the V1 client's * "Dev Web (Localhost)" target: a development build, or the persisted force-dev flag. */ isTransferLocalDevWebAvailable(): Promise; /** The origin a "web_local_dev" transfer link is rebased onto (shared with the V1 dev target). */ private localDevLinkBaseUrl; private connectionShell; private selectPushWallet; prepareRequest(request: TMCActionRequestUnionExpandedInput, sensitiveTransferSource?: IMobileBridgeSensitiveTransferSource, target?: IMobileBridgeRequestTarget): Promise; /** See `mobileAppAutoOpen.ts` for why each condition is required. */ private isSameDeviceAutoOpenEligible; /** * The automatic open itself: only while the starting tap is still live, the page is in the * foreground, this is still the current request, and the wallet has not already picked it up. * Resolves whether the app demonstrably came up (the page went to the background). */ private autoOpenSession; /** * Install a request as the next turn of the retained external-work hold. Only the exact session * that is still holding the named bridge may carry it: anything else (a disposed session, a * spent hold, a different bridge) falls through to a fresh session, which is the documented * recovery path — a lease is never replayed. */ private continueExternalWorkHold; /** * The persistent client id, or undefined before one has been assigned. The getter throws a * typed local guard when the identity has not been provisioned yet, so it is always fenced. */ private partnerClientId; /** The connection describing one paired wallet — 0.12 has no "active paired wallet" of its own. */ private buildConnection; getCurrentSession(): MobileBridgeSession | undefined; releaseSession(session: MobileBridgeSession, beforeDispose?: Promise): Promise; refreshRequest(request: TMCActionRequestUnionExpandedInput, sensitiveTransferSource?: IMobileBridgeSensitiveTransferSource, target?: IMobileBridgeRequestTarget): Promise; /** * The connection of the wallet that completed the current session. Only the NEAR account * actions consume it; an account-less transfer never reaches here. */ getActiveConnection(): IMeteorConnection_V2_BridgeMobile; /** * Synchronously claim the sized wallet popup window during a user gesture, before the bridge * session (and thus the wallet URL) exists. Browsers only reliably allow `window.open` inside * the gesture's own call stack, so a caller that must first await session creation opens this * placeholder immediately on click and hands it to `openCurrentSessionInApp` once the link is * published. The popup's `opener` is severed right away — navigation happens through the handle * this side keeps, and the wallet page never sees `window.opener` (the same isolation the * direct-open path gets from `noopener`). Returns null when the browser blocks the popup; * callers then fall back to the connect panel's Open button / QR. */ openPendingWalletWindow(): Window | null; /** * @param pendingWindow A placeholder window from `openPendingWalletWindow`, claimed inside the * user gesture that chose a web wallet. When given, a web link navigates it instead of opening * a fresh popup; a placeholder the user already closed is respected as a decline. Native deep * links never navigate it — it is closed rather than stranded. */ openCurrentSessionInApp(pendingWindow?: Window, options?: { /** * A same-device auto-open rather than a tap: only ever the paired app's custom-scheme link * — never a web-wallet window, which would be an unrequested popup. */ automatic?: boolean; }): void | Promise; resetPartnerIdentity(): Promise; makeRequest>(request: R, connection: TMeteorExecutionTargetConfig): Promise>; dispose(): Promise; /** Drop the live bridge but keep `configure()`'s state, so the next request re-initializes. */ private teardownBridge; } //#endregion //#region src/MeteorConnect/new_key_transfer/new_key_transfer.types.d.ts type TNewKeyTransferSdkPhase = "start_pending" | "destination_keys_staged" | "add_key_in_progress" | "verification_pending" /** * Stabilization SD4/SD6: chain proof passed for every requested account, but the WALLET still * owes completion work on at least one (`verified_pending_completion` — import or the SD13 * activation self-test). Re-run `verifyActive` with the same activations to converge; render as * "finishing in the wallet", never as done. */ | "verification_pending_wallet" | "destination_keys_verified"; type TNewKeyTransferTargetPlatform = TTransferTargetPlatform; interface INewKeyTransferSdkSession { formatVersion: 1; phase: TNewKeyTransferSdkPhase; /** * The Meteor Wallet platform this transfer runs against. Absent only while a start that left * the choice to the popup is still `start_pending`; once the wallet answers the start turn it * is always recorded (the verify turn is pinned to it). */ targetPlatform?: TNewKeyTransferTargetPlatform; clientTransferId: string; canonicalInputHash: string; startRequest: TNewKeyTransferStartInputV1; startOutput?: TNewKeyTransferStartOutputV1; walletConnection?: IMeteorConnection_V2_BridgeMobile; addKeyIntentAccounts: string[]; /** * Accounts whose chain proof the wallet has accepted — the union of `securedAccounts` and * `pendingCompletionAccounts`. Kept for continuity; render user-facing state from the two * specific sets below (SD6). */ verifiedAccounts: string[]; /** Accounts the wallet reported `secured`: proven on-chain AND durably imported (SD3/SD4). */ securedAccounts: string[]; /** Accounts still `verified_pending_completion` wallet-side; re-verify later to converge. */ pendingCompletionAccounts: string[]; updatedAt: number; } interface INewKeyTransferStartOptions { accounts: TNewKeyTransferStartInputV1["accounts"]; /** * Pin the Meteor Wallet platform up front and the popup opens straight onto it (contextual, * no chooser). Omit it and the popup asks the user to choose (Meteor Web / Meteor Mobile), * exactly like the regular action popup for a not-signed-in user. Either way the platform the * wallet actually answered on is recorded on the session and reused for the verify turn. */ targetPlatform?: TNewKeyTransferTargetPlatform; /** Supply this when resuming a caller-owned id; otherwise the SDK generates and persists one. */ clientTransferId?: string; } interface INewKeyTransferVerifyOptions { transferSessionId: string; activations: TNewKeyTransferVerifyActiveInputV1["activations"]; } interface INewKeyTransferStartResult { output: TNewKeyTransferStartOutputV1; session: INewKeyTransferSdkSession; /** * Whether the bridge session is still parked in its bounded external-work hold. `true` means * the AddKey window and the verification turn ride the SAME session; `false` means the hold was * lost (or was never entered) and `verifyActive` will open a fresh recovery session instead. */ externalWorkHeld: boolean; } interface INewKeyTransferVerifyResult { output: TNewKeyTransferVerifyActiveOutputV1; session: INewKeyTransferSdkSession; } interface INewKeyTransferAddKeyOptions { transferSessionId: string; /** * The host's chain seam. MNW owns the source full-access signing keys and derives/signs with * them; they never reach this SDK — every method here receives only the job's public identity. */ chain: IAddKeyJournalChain$1; /** 1-based progress across the accounts this transfer still has to submit. */ onProgress?: (progress: { accountId: string; index: number; total: number; }) => void; } interface INewKeyTransferAddKeyResult { /** The complete, secret-free verification request — durable before this resolves. */ verifyInput: TNewKeyTransferVerifyActiveInputV1; session: INewKeyTransferSdkSession; } /** * Everything a host needs to resume a transfer after process loss, read without mutating a byte of * it. `startResult` is the wallet's exact signed start output; `pendingVerification` is the * complete verification request recorded after the last AddKey finalized. */ interface INewKeyTransferRecoveryState { startResult: IJournaledNewKeyStartResult | null; pendingVerification: TNewKeyTransferVerifyActiveInputV1 | null; /** * A signed (or finalized) AddKey transaction is journaled with no start-result record to bind * it. Nothing new may be started until it is reconciled — the bytes may still land on-chain. * * Equivalent to `reconciliation.fenced`; kept so existing callers do not break. Use * `reconciliation` for anything a user sees: this flag alone cannot tell them what is stuck or * what to do about it. */ orphanedSignedAddKey: boolean; /** * The non-secret evidence behind the fence and the support reference to quote — everything a * host needs to render real recovery choices instead of a dead end * (REVIEW-consumer-implementation B-04). Resolve entries through * {@link MeteorConnectNewKeyTransfer.reconcileFencedOperation}. */ reconciliation: INewKeyTransferReconciliationReport; } /** Options for one pass of the fenced-operation state machine. */ interface INewKeyTransferReconcileOptions { operation: INewKeyTransferFencedOperation; /** * The host's chain seam — the same one `runAddKeys` takes. Reconciliation only reads: it proves * finality and access-key state, and never signs or broadcasts. Implement the optional * `isSignedTransactionExpired` to let `destination_key_absent` be reachable without a revocation. */ chain: IAddKeyJournalChain$1; } interface INewKeyTransferArchiveOptions { operation: INewKeyTransferFencedOperation; /** Used to re-prove on-chain absence of the exact destination key before the row is retired. */ chain: IAddKeyJournalChain$1; } //#endregion //#region src/MeteorConnect/new_key_transfer/MeteorConnectNewKeyTransfer.d.ts /** * Secret-free orchestration for the new-key transfer, in the two-turn session shape 0.12 requires. * * `new_key_account_transfer_start` is the one action whose recovery contract permits an * external-work hold: its signed result is journaled BEFORE `acknowledgeAndBeginExternalWork` * parks the session, the AddKey window then runs through the shared crash-safe journal runner, and * `new_key_account_transfer_verify_active` is installed as the NEXT turn of that same held * session. When the hold is lost — a reload, a dead tab, an expired session — verification opens a * FRESH `single_turn_v1` session with a freshly generated `partnerRequestId`, pinned to the exact * wallet that minted the destination keys. A lease is never replayed. * * Every D33 invariant of the AddKey window itself (journal-before-chain-call, durable intent * before signing, durable exact signed bytes before broadcast, same-bytes-only rebroadcast, proof * verification before checkpointing) belongs to `@meteorwallet/connect-shared`'s runner and is * deliberately not re-implemented here. What this layer owns is the orchestration journal: schema * and account-set integrity, replay, exact-wallet routing, and phase-aware host state. * * Stabilization changes (SD-series in PLAN-new-key-transfer-stabilization.md): * - SD4 three-literal verify results with per-account `secured`/`pendingCompletion` facts; * - SD6/SDK-7 one completion definition (the intent set, fully secured); * - SDK-1 the start fence agrees with the reconciliation report (a bound signed row fences * nothing it cannot explain); * - SDK-2 self-healing start-result orphans + `discardOrphanedStartResult()`; * - SDK-4 terminal verify exchanges are cached and replayed without re-asking the wallet; * - SDK-8/9/10 lock-scope and validate-before-effect corrections; * - SD10 retention: stale pending sweep, capacity as a typed error, and `archiveCompletedSession`. */ declare class MeteorConnectNewKeyTransfer { private readonly meteorConnect; private enabled; /** * Live external-work holds by `transferSessionId`. In-memory ON PURPOSE: a hold is only usable * while the process that created it still holds the memory-only partner secret, so losing this * map is exactly the signal to take the fresh-session recovery path. */ private readonly externalWorkHolds; /** In-flight `start()` calls by clientTransferId — concurrent same-id callers join one prompt. */ private readonly inFlightStarts; private readonly sessionListeners; constructor(meteorConnect: MeteorConnect); configure(enabled: boolean): void; private requireEnabled; /** * Notify on every durable session-journal change (start/verify/intent/revoke/clear/archive) in * THIS process. Pull the fresh state with {@link getSessions}; the callback carries nothing. */ onSessionsChanged(listener: () => void): () => void; private notifySessionsChanged; /** * Bind the shared AddKey journal machinery to this SDK's storage. `chain` is the host's — the * runner is the only thing that may talk to it, and only after the journal has been read. */ private addKeyRunner; private readSessions; private writeSessions; private replaceSession; private withInProcessLock; private withNamedLock; private withJournalLock; private readCachedVerifyResults; private writeCachedVerifyResult; getSessions(): Promise; start(options: INewKeyTransferStartOptions): Promise; private executeStart; /** * Run every pending AddKey for one transfer through the shared crash-safe journal runner, then * durably record the complete verification request. * * The runner owns the invariants: it reads (and fails closed on) the journal before the first * chain call, records intent before signing, records the exact signed bytes and hash before * broadcasting, rebroadcasts only those identical bytes after an ambiguous send, and verifies * the finalized proof before replacing them with a checkpoint. This method owns the SDK's own * fences: the transfer must be the one the durable start-result journal remembers, the accounts * must be the exact rows the wallet answered `ok` for, and the AddKey intent must be visible in * the orchestration journal before any chain call — so `clear()` cannot drop a transfer whose * key may already be live. */ runAddKeys(options: INewKeyTransferAddKeyOptions): Promise; /** * Everything a host needs to resume after process loss, read without mutating anything. A * corrupt record throws here exactly as it does everywhere else — an empty answer would invite a * second AddKey. */ getRecoveryState(): Promise; /** * Just the fence, for a host that only needs to decide whether to offer recovery. * `getRecoveryState()` returns the same report alongside the resume records. */ getReconciliationReport(): Promise; /** * Advance one fenced operation as far as the chain allows (B-04). Read-only against the chain — * it proves finality and access-key state, never signs and never broadcasts. The only mutation * it can make is promoting a proven `transaction_signed` row to `finalized`, after which the * transfer resumes through normal verification. * * The four outcomes and what a host does with each: * * - `finalized` — the AddKey landed. Resume verification with the recorded proof. * - `destination_key_present_unproven` — the key is granted but nothing binds it to this * transfer. Remove it with the SOURCE signer, wait for finality, then * {@link archiveReconciledOperation}. * - `destination_key_absent` — the transaction can never land and the key is not there. Call * {@link archiveReconciledOperation} to retire the row. * - `ambiguous` — nothing could be established this pass; nothing changed. Retry later. Never * offer "start again": the fence guarantees a fresh start would be refused. */ reconcileFencedOperation(options: INewKeyTransferReconcileOptions): Promise; /** * Retire a fenced row once its destination key is proven ABSENT on-chain. Re-proves absence * itself before touching the journal, so a host that revoked the key but lost finality cannot * clear the fence by asserting it did. Returns `false` when it refused. */ archiveReconciledOperation(options: INewKeyTransferArchiveOptions): Promise; /** * Discard a journaled start result that NO session references (SDK-2's wedge exit): a crash * between the wallet's answer and the session commit could historically orphan the one-slot * start-result journal, refusing every later transfer as `start_result_conflict` with no public * way out. Guarded: a referenced result throws `start_result_referenced` (resume that transfer * instead), and protected AddKey rows keep the recovery fence. */ discardOrphanedStartResult(): Promise; /** The one session this transfer id names, or a fail-closed miss. Callers hold the journal lock. */ private requireSession; /** Record the AddKey intent in the orchestration journal. Callers hold the journal lock. */ private applyAddKeyIntent; /** * Record an AddKey intent for a host that submits the transaction itself. Hosts that let the SDK * drive the window call {@link runAddKeys} instead — it records the same intent and adds every * D33 crash-cut the shared runner enforces. */ markAddKeyIntent(input: { transferSessionId: string; accounts: Array<{ blockchainId: string; networkId: string; accountId: string; }>; }): Promise; /** * Acknowledge that the host has finalized removal of the exact destination keys for these * accounts. This is deliberately separate from `clear`: the SDK only releases its recovery * fence after the caller has reconciled on-chain absence of every key it may have submitted. * * It clears BOTH fences. Dropping the accounts from this session's intent list is not enough on * its own: the shared AddKey journal keeps its own protected `transaction_signed`/`finalized` * rows, and `clear()` consults `hasProtectedRecovery()` — so revocation that only touched the * session left the transfer just as stuck as before (REVIEW-consumer-implementation B-04). Each * protected row is retired through the runner, which re-proves on-chain absence of the exact * destination key first. * * SDK-9: the session and account membership are validated BEFORE any fence evidence is * archived, so a stale or wrong id can no longer retire journal rows and then fail. */ markDestinationKeysRevoked(input: { transferSessionId: string; accounts: Array<{ blockchainId: string; networkId: string; accountId: string; }>; /** * Required whenever any of these accounts still has a protected AddKey row. The SDK uses it to * re-prove that the destination key is gone; a caller's assurance is never enough, because the * whole point of the fence is that the signed bytes may have taken effect. */ chain?: IAddKeyJournalChain$1; }): Promise; /** * Prove the destination keys are live AND secured wallet-side. Two paths, decided by whether * this process still holds the start turn's external-work hold: * * - **same session** — the verification request is installed as the NEXT turn of the held * session (`prepareAction` persists the exact signed turn before `submitPreparedAction` * transmits it), so the wallet answers on the bridge it already trusts; * - **fresh recovery session** — a new `single_turn_v1` session with a freshly generated * `partnerRequestId`, pinned to the exact wallet that minted the destination keys. An expired * or process-lost lease is never replayed. * * A byte-identical repeat of an already TERMINAL exchange (every row `secured`/`not_verified`) * replays from the durable cache without asking the wallet again (SDK-4); anything pending * re-asks, and the wallet answers idempotently. */ verifyActive(options: INewKeyTransferVerifyOptions): Promise; /** * Fold a verify output into the durable session facts. SDK-5: the wallet has already completed * its side by the time this runs, so a session-journal failure here must NOT masquerade as a * verification failure — it retries once, then surfaces the distinct * `verify_session_update_failed` code whose contract is "re-run verifyActive to converge". */ private recordVerifyOutcome; /** * End the bridge session a cleared transfer was still holding. Without this a held session would * stay the bridge client's current session — blocking every other action until its own deadline * passes. Only ever called for a transfer with no AddKey intent, so nothing is at risk. */ private releaseExternalWorkHold; /** * Move one fully completed transfer out of the active journal into the bounded archive (SD10). * Allowed only for `destination_keys_verified` sessions — everything else still owes work or a * recovery decision. The archive holds secret-free records and trims oldest-first at its cap. */ archiveCompletedSession(clientTransferId: string): Promise; clear(clientTransferId: string): Promise; } //#endregion //#region src/MeteorConnect/transfer_accounts/transfer_accounts.types.d.ts /** * Raw partner input for staging one secret against one account. The SDK owns parsing + encoding * into the shared TAccountSecretData shape (via connect-shared's buildAccountSecretData). */ interface IStageTransferAccountInput { /** Optional — defaults to "near", the only blockchainId in transfer v1. */ blockchainId?: TBlockchainId; networkId: TCryptoGenericNetworkId; /** Trimmed + lowercased, then validated by vAccountBasicData (2..64, NEAR account grammar). */ accountId: string; /** Mnemonic phrase (12/24 words) OR "ed25519:" private key. */ secretInput: string; /** Mnemonic secrets only. Passed through to buildAccountSecretData; defaults to the shared NEAR_DEFAULT_DERIVATION_PATH. */ derivationPath?: string; } /** Secret-free summary for partner UI listings — identity tuple + what kinds of secrets are staged. */ type TStagedTransferAccountSummary = TAccountBasicData & { secretTypes: Array<"mnemonic" | "private_key">; }; /** * Typed staging failure reasons. The secret-level reasons are passed through verbatim from * connect-shared's buildAccountSecretData (TBuildAccountSecretDataResult); the account/set-level * reasons are SDK-added. */ type TStageTransferAccountFailureReason = "invalid_account_id" | "empty_secret_input" | "invalid_private_key" | "invalid_mnemonic_word_count" | "invalid_secret_data" | "duplicate_secret" | "too_many_secrets" | "too_many_accounts"; type TStageTransferAccountResult = { ok: true; account: TStagedTransferAccountSummary; } | { ok: false; reason: TStageTransferAccountFailureReason; message: string; /** Present for invalid_mnemonic_word_count — from the shared encoder. */ wordCount?: number; }; /** Live "detected: mnemonic" feedback for partner UIs, without staging anything. */ type TParseTransferSecretInputResult = { type: "mnemonic" | "private_key"; } | { type: "invalid"; reason: string; }; type TTransferAccountsOutcome = { status: "imported"; } | { status: "declined"; } | { status: "cancelled"; } | { status: "expired"; } | { status: "failed"; reason: "pin_attempts_exhausted" | "wallet_update_required" | "bridge_failed"; }; interface ITransferAccountsPromptOptions { /** Override the staged set for this transfer (bypasses staging storage entirely). */ accounts?: _meteorwallet_connect_shared0.TAccountTransferDataDecrypted[]; } //#endregion //#region src/MeteorConnect/transfer_accounts/MeteorConnectTransferAccounts.d.ts type TTransferActionRequest = Extract, { id: "meteor_wallet_core::transfer_accounts"; }>; type TTransferExecutableAction = ExecutableAction; /** * The public transfer surface (`meteorConnect.transferAccounts`): staging + the one-shot popup * flow. Flow endings resolve to a typed outcome; integration errors throw (§ error semantics). */ declare class MeteorConnectTransferAccounts { private readonly meteorConnect; private staging?; private config?; constructor(meteorConnect: MeteorConnect); /** Called from MeteorConnect.initialize — staging works regardless of the enabled flag. */ configure(config: IMeteorConnectTransferAccountsConfig | undefined): void; private getStaging; /** * Drop the in-memory staged set without touching persisted data — called from * `MeteorConnect.disposeMobileBridge()`. Safe before initialize: there is simply nothing staged. */ dropStagedFromMemory(): void; /** * Stages a secret for an account. Staging the same (blockchainId, networkId, accountId) tuple * again ADDS the secret to that account's secret array (schema: 1..10, deduped) — it does not * replace the account. Use removeStaged to start an account over. */ stage(input: IStageTransferAccountInput): Promise; getStagedSummaries(): Promise; /** Hazard is in the name — full staged shape including plaintext secrets. */ getStagedWithSecrets(): Promise; removeStaged(identifier: TAccountBasicData): Promise; clearStaged(): Promise; /** * Escape hatch for advanced integrations: the raw ExecutableAction with wire output * { success: boolean }; rejects on cancel/expiry like every other action. */ createAction(options?: ITransferAccountsPromptOptions): Promise; private createActionInternal; /** * The one-shot flow: stage → prompt() → switch on outcome.status. Every user- or * wallet-driven ending resolves; only integration/config errors throw. */ prompt(options?: ITransferAccountsPromptOptions): Promise; } //#endregion //#region src/MeteorConnect/MeteorConnect.d.ts declare class MeteorConnect { private _localStorageAdapter; private _typedStorageHelper; private isDev; private logger; private _storageImplementation; private _nearKeyStoreProvider; private initializeFingerprint?; private initializePromise?; /** * Set the moment `initializeInternal` binds this instance's storage/key-store properties. Those * are write-once (see `initProp`), so once bound a retry MUST use the same configuration — the * failure rearm below keeps the fingerprint in that case so a mismatched retry is refused loudly * instead of silently reusing the first configuration's adapters. */ private initializeBoundConfig; private browserKeyStore?; private clients; supportedPlatforms: TMeteorConnectionExecutionTarget[]; /** The account-transfer surface (staging + popup flow) — one namespace for the whole feature. */ readonly transferAccounts: MeteorConnectTransferAccounts; /** Secret-free account transfer that grants a newly generated Meteor signer on-chain. */ readonly newKeyTransfer: MeteorConnectNewKeyTransfer; constructor({ isDev }?: { isDev?: boolean; }); setLoggingLevel(level: TMCLoggingLevel): void; getLoggingLevel(): TMCLoggingLevel; get isDevelopment(): boolean; get localStorageImplementation(): ILocalStorageInterface; get nearKeyStoreProvider(): IMeteorConnectNearKeyStoreProvider; get mobileBridgeClient(): MeteorConnectMobileBridgeClient; initialize(input: IMeteorConnect_Initialize_Input): Promise; private initializeInternal; get storage(): ITypedStorageHelper; get localStorageAdapter(): CEnvironmentStorageAdapter; private getClients; updateSignedInAccountConnection(account: IMeteorConnectAccount): Promise; disposeMobileBridge(): Promise; getClientByExecutionTargetId(id: TMeteorConnectionExecutionTarget): MeteorConnectClientBase; hasAccounts(networkTarget?: IMeteorConnectNetworkTarget): Promise; getAllAccounts(networkTarget?: IMeteorConnectNetworkTarget): Promise; getAccount(accountIdentifier: PartialBy, networkAccountFallback?: boolean): Promise; addSignedInAccount(account: IMeteorConnectAccount): Promise; removeSignedInAccount(identifier: IMeteorConnectAccountIdentifier): Promise; getAccountOrThrow(accountIdentifier: PartialBy): Promise; createAction>(request: R): Promise>; } //#endregion //#region src/MeteorConnect/action/ExecutableAction.d.ts declare class ExecutableAction> { #private; private readonly request; readonly meteorConnect: MeteorConnect; private readonly connectionTargetConfig; readonly id: R["id"]; readonly expandedInput: any; private readonly meta; private executionStateListeners; private executingTargetedPlatform?; private execute_promise?; private executeWithUi_promise?; private waitForExecutionOutput_promise?; private actionResolvers; private actionRejecters; private preparedMobileSession?; private prepareMobilePromise?; private cancelPromise?; private cancelled; private settled; /** How the request was carried out: by a wallet, or with the account's function-call key. */ private executionMethod?; private unsubscribeMobile?; /** Transfer only: the wallet platform the user chose; refresh/re-pair reuse it. */ private transferTargetPlatform?; /** New-key verify actions are pinned to the exact wallet that completed start. */ private transferTargetWalletConnection?; /** Journal-before-hold seam; set only for `new_key_account_transfer_start`. */ private externalWorkJournal?; /** Set for a verification turn that must ride the session the start turn is still holding. */ private continueExternalWorkHold?; /** Keep the prepared session alive past this action's teardown (the AddKey window). */ private retainSessionForExternalWork; private logger; constructor(request: R, expandedInput: any, meteorConnect: MeteorConnect, connectionTargetConfig: { allExecutionTargets: TMeteorExecutionTargetConfig[]; contextualExecutionTarget?: TMeteorConnectionExecutionTarget; }); getAllExecutionTargetConfigs(): TMeteorExecutionTargetConfig[]; getExpandedRequest(): TMCActionRequestUnionExpandedInput; getPreparedMobileSession(): MobileBridgeSession | undefined; /** Attached once by the transfer flow right after createAction; never readable back. */ setSensitiveTransferSource(source: IMobileBridgeSensitiveTransferSource): void; setTransferTarget(input: { /** * Omit to let the action UI's platform chooser pick it — the popup then calls * `prepareMobileBridge({ transferTargetPlatform })` with the user's choice, and * `getTransferTargetPlatform()` reports what was actually chosen after execution. */ platform?: TTransferTargetPlatform; walletConnection?: IMeteorConnection_V2_BridgeMobile; /** * `new_key_account_transfer_start` only: the seam that durably journals the wallet's signed * result BEFORE the bounded external-work hold begins (D33). Supplying it is what keeps the * session open for the AddKey window instead of closing it. */ externalWorkJournal?: TMobileBridgeExternalWorkJournal; /** Verification turn only: install this request on the session still holding that bridge. */ continueExternalWorkHold?: IMobileBridgeExternalWorkHold; /** Keep the prepared session alive after this action finishes (start → AddKey → verify). */ retainSessionForExternalWork?: boolean; }): void; /** The external-work hold the prepared session parked in, when it did. */ getExternalWorkHold(): IMobileBridgeExternalWorkHold | undefined; private mobileBridgeTarget; getTransferTargetPlatform(): TTransferTargetPlatform | undefined; getCompletedMobileConnection(): IMeteorConnection_V2_BridgeMobile | undefined; prepareMobileBridge(options?: { transferTargetPlatform?: TTransferTargetPlatform; }): Promise; private watchMobileSession; /** * The wallet answered without this page ever seeing it hold the request. A backgrounded mobile * tab drops its bridge link, so the facts it reconnects to can already be past `wallet_action` * — while the session, which collects the result on its own, settles it regardless. Without * adopting that answer the action never resolves: the popup sits on its finishing state and a * close reports a cancellation for a request the wallet signed. * * Only for THIS action's own turn on the client's current session, which is exactly when * `makeRequest` adopts the session instead of preparing a new request. That excludes the stale * `external_work` snapshot a held session shows the next turn's action before that turn is * staged — executing from it would send a second request to the wallet. */ private isWalletAnswerToThisRequest; refreshMobileBridge(options?: { /** Retarget the replacement bridge at a different transfer platform (chooser → web click). */transferTargetPlatform?: TTransferTargetPlatform; }): Promise; resetMobileIdentityAndRePair(): Promise; /** * Dev-only mobile wallet switch: retarget the bridge at the other environment's backend + mobile * wallet build and prepare a replacement session, so the QR opens that build instead. */ switchDevMobileWalletEnvironment(environment: TMeteorConnectBackendEnvironment$1): Promise; private prepareReplacementMobileBridge; getActionKnownContextualTarget(): TMeteorConnectionExecutionTarget | undefined; getExecutionState(): IMCActionExecutionState; addExecutionStateListener(listener: (executionState: IMCActionExecutionState) => void): () => void; private triggerExecutionStateUpdate; private _execute; private resolveAction; private rejectAction; execute(executionTarget?: TMeteorConnectionExecutionTarget): Promise; /** The one place an execution becomes this action's outcome, however it was carried out. */ private settleExecution; /** * `"function_call_key"` when the request was signed and sent locally with the account's * function-call key (no wallet involved), `"wallet"` when a wallet carried it, and `undefined` * before either has started. */ getExecutionMethod(): "wallet" | "function_call_key" | undefined; /** * A transaction request the account's function-call key fully covers is signed and sent right * here, with no wallet prompt — the user granted those calls when signing in with the key. A * request it does not cover, or any doubt before something is broadcast, returns `undefined` and * goes to the wallet exactly as before. Once something may have been broadcast, the action * settles with that error instead: the wallet is never asked to sign the same calls again. */ private tryFunctionCallKey; /** * The account is bound to an execution target this Meteor Connect configuration does not offer, * so no client can carry its request to the wallet. `createAction` only lets `near::sign_out` * reach here — every other account-bound action throws at creation — which is what keeps the * local escape below narrow. */ private isStrandedFromContextualTarget; private isLocalOnlySignOut; private executeLocalSignOut; private commitAndExecute; private _promptForExecution; promptForExecution(input?: Omit, "action">): Promise; private _waitForExecutionOutput; waitForExecutionOutput(): Promise; cancelAction(): Promise; private cancelPreparedMobileRequest; disposePreparedMobileSession(): Promise; private makeTargetedActionRequest; } //#endregion //#region src/MeteorConnect/function_call_key/nearFunctionCallKey.d.ts /** * Signing with the function-call access key added at sign-in (`near::sign_in` with * `addFunctionCallKey`), so a call that key is allowed to make never needs the wallet. That is * the point of the key: the user granted the dApp those calls up front. * * A function-call key cannot attach a deposit, call another contract, or call a method outside its * list — the chain enforces that — so anything else, or any doubt before a transaction is * broadcast, goes to the wallet exactly as before. Once a transaction may have been broadcast the * wallet is never asked to sign it again: an unknown outcome is reported, not retried. */ interface IFunctionCallKeyTransaction { receiverId: string; actions: TNearNativeAction[]; } type TFunctionCallKeyCoverage = { covered: true; publicKey: string; contractId: string; } | { covered: false; reason: "no_transactions" | "no_function_call_key" | "wrong_receiver" | "not_a_function_call" | "deposit_attached" | "method_not_allowed"; }; /** * Whether the account's function-call key can sign EVERY transaction of a request, judged from what * was recorded at sign-in. Local and synchronous, so a request it does not cover (a donation, say) * reaches the wallet without any delay. The chain's own view of the key is checked again before * signing. */ declare function functionCallKeyCoverage(account: IMeteorConnectAccount, transactions: readonly IFunctionCallKeyTransaction[]): TFunctionCallKeyCoverage; /** Thrown only once a transaction may already be on-chain: the caller must NOT re-sign it. */ declare class FunctionCallKeyExecutionError extends Error { /** Outcomes of the transactions that did execute before this one. */ readonly executedOutcomes: FinalExecutionOutcome[]; /** Hash of the transaction whose outcome is unknown or that failed mid-batch. */ readonly transactionHash: string; constructor(message: string, /** Outcomes of the transactions that did execute before this one. */ executedOutcomes: FinalExecutionOutcome[], /** Hash of the transaction whose outcome is unknown or that failed mid-batch. */ transactionHash: string); } //#endregion //#region src/MeteorConnect/new_key_transfer/new_key_transfer_errors.d.ts /** * The typed error surface of the new-key transfer SDK (stabilization SD11/XR-4). * * Every failure the SDK raises on this surface is a {@link NewKeyTransferError} whose `code` is * one of {@link NEW_KEY_TRANSFER_ERROR_CODES}. `message` always equals `code`, so hosts that * still string-match keep working — but hosts MUST migrate to `instanceof NewKeyTransferError` * + `error.code`, which is the only contract: raw message prose is never shown to users. * * Two shared error surfaces pass through this SDK unchanged and are re-exported from the package * index so hosts can `instanceof` them: `AddKeyJournalError` (the crash-safe AddKey runner's 20 * stable codes) and the `MOBILE_BRIDGE_ENDING` sentinel table for bridge-flow endings. */ declare const NEW_KEY_TRANSFER_ERROR_CODES: readonly ["new_key_transfer_unavailable", "new_key_transfer_client_id_conflict", "new_key_transfer_orphaned_add_key_recovery", "new_key_transfer_wallet_binding_missing", "new_key_transfer_wallet_connection_missing", "new_key_transfer_session_not_found", "new_key_transfer_start_result_journal_missing", "new_key_transfer_start_result_conflict", "new_key_transfer_start_result_referenced", "new_key_transfer_start_result_discard_failed", "new_key_transfer_no_accounts_ready", "new_key_transfer_add_key_account_mismatch", "new_key_transfer_add_key_chain_required", "new_key_transfer_journal_corrupt", "new_key_transfer_journal_retention_required", "new_key_transfer_verify_before_add_key_intent", "new_key_transfer_verify_hash_mismatch", "new_key_transfer_verify_session_update_failed", "new_key_transfer_recovery_required", "new_key_transfer_revoke_chain_required", "new_key_transfer_revoke_destination_key_present", "new_key_transfer_revoked_accounts_required", "new_key_transfer_revoke_account_mismatch", "new_key_transfer_session_not_terminal"]; type TNewKeyTransferErrorCode = (typeof NEW_KEY_TRANSFER_ERROR_CODES)[number]; /** Which fence produced a `new_key_transfer_recovery_required` refusal. */ type TNewKeyTransferRecoveryFence = "session_intent" | "protected_journal"; declare class NewKeyTransferError extends Error { readonly code: TNewKeyTransferErrorCode; /** Present only on `new_key_transfer_recovery_required` — which fence refused. */ readonly fence?: TNewKeyTransferRecoveryFence; constructor(code: TNewKeyTransferErrorCode, options?: { fence?: TNewKeyTransferRecoveryFence; cause?: unknown; }); } declare const isNewKeyTransferError: (error: unknown, code?: TNewKeyTransferErrorCode) => error is NewKeyTransferError; //#endregion //#region src/MeteorConnect/target_clients/mobile_bridge/mobileBridgeLease.d.ts declare class WebLockBridgeLeaseProvider implements IMeteorConnectBridgeLeaseProvider { acquire(name: string, options?: { timeoutMs?: number; }): Promise; } /** Lamport bakery lock over unique enumerable storage registers (no unsafe shared RMW record). */ declare class StorageBakeryBridgeLeaseProvider implements IMeteorConnectBridgeLeaseProvider { private readonly storage; private readonly prefix; constructor(storage: IEnumerableLocalStorageInterface, prefix?: string); acquire(name: string, options?: { timeoutMs?: number; }): Promise; } declare const directBrowserNativeAppOpener: { open(fullLink: string): void; }; //#endregion //#region src/MeteorConnect/transfer_accounts/TransferAccountsStaging.d.ts /** * Live secret-kind detection for partner UIs ("detected: mnemonic"), without staging anything. * A thin wrapper over the shared encoder — the SDK contains zero detection rules of its own. */ declare function parseTransferSecretInput(secretInput: string): TParseTransferSecretInputResult; //#endregion //#region src/MeteorConnect/transfer_accounts/transfer_accounts.limits.d.ts /** * Mirror of connect-shared's account-count bound, pinned locally so the SDK's PUBLIC export of * `TRANSFER_ACCOUNTS_MAX_ACCOUNTS` (src/index.ts) never depends on the `/internal` subpath — * the shared package no longer carries this constant on its curated root barrel. * * `transfer_accounts.limits.test.ts` asserts it still equals the shared value; if that tripwire * fires, connect-shared moved the bound and this constant must follow it in the same commit. */ declare const TRANSFER_ACCOUNTS_MAX_ACCOUNTS = 50; //#endregion //#region src/ported_common/near/nearConnectConfig.types.d.ts /** * Structural stand-in for `near-api-js`'s `NearConfig`/`ConnectConfig`. * * The SDK deliberately does **not** import types from `near-api-js`. Doing so would drag the whole * `near-api-js` package into the public `@meteorwallet/sdk` type surface, forcing every consumer to * install (and resolve a single version of) it — which is exactly what made downstream wallets patch * the published artifacts. The shape below is assignment-compatible with `ConnectConfig`, so an * existing `near-api-js` config object still satisfies it structurally. */ interface INearConnectConfig { /** Holds `KeyPair`s for signing transactions. */ keyStore?: KeyStore; /** @hidden */ signer?: Signer; /** NEAR Contract Helper url, used to create accounts when no master account is provided. */ helperUrl?: string; /** Balance transferred from `masterAccount` to a created account. */ initialBalance?: string; /** The account to use when creating new accounts. */ masterAccount?: string; /** `KeyPair`s are stored in a `KeyStore` under this namespace. */ networkId: string; /** NEAR RPC API url, used to make JSON RPC calls. */ nodeUrl: string; /** NEAR RPC API headers. Can be used to pass an API key and other parameters. */ headers?: { [key: string]: string | number; }; /** NEAR wallet url, used to redirect users to their wallet in browser applications. */ walletUrl?: string; /** Backward-compatibility for older versions. */ deps?: { keyStore: KeyStore; }; /** Logger to use. Pass `false` to turn logging off. */ logger?: LoggerService | false; /** Explicit NEAR RPC API connection. */ provider?: Provider; /** Initialize an `InMemoryKeyStore` by reading the file at this path. */ keyPath?: string; } //#endregion //#region src/MeteorWallet.d.ts interface IMeteorV1TypedStorage {} interface IMeteorWallet_Init_Inputs extends Partial { networkId: string; appKeyPrefix?: string; } interface IMeteorWallet_Constructor extends IMeteorWallet_Init_Inputs { forceTargetPlatformConfig?: TMeteorConnectV1ExecutionTargetConfig; keyStore: KeyStore; meteorConnect?: MeteorConnect; } /** * This class is used in conjunction with `near-api-js` and `BrowserLocalStorageKeyStore`. * It directs users to the Meteor Extension or (if not available) a popup of the Meteor Wallet website for key management. * * @example * ```js * import { MeteorWallet } from "@meteorwallet/sdk"; * * // create new MeteorWallet instance (passing in your initialized Near connection) * const meteorWallet = new MeteorWallet({ near: connectedNear, appKeyPrefix: 'my-app' }); * * // -- or -- (for a quick and default Near connection config) * const meteorWallet = MeteorWallet.init({ networkId: "testnet" }); * * // If not signed in, start the sign-in flow with Meteor Wallet. * // Keys will be stored in the BrowserLocalStorageKeyStore * if(!meteorWallet.isSignedIn()) { * const { accountId } = await meteorWallet.requestSignIn(); * } * ``` */ declare class MeteorWallet { /** @hidden */ _walletBaseUrl: string; /** @hidden */ _keyStore: KeyStore; /** @hidden */ _networkId: string; /** @hidden */ _provider: JsonRpcProvider; /** @hidden */ _connectedAccount: ConnectedMeteorWalletAccount | undefined; _forceTargetPlatformConfig?: TMeteorConnectV1ExecutionTargetConfig; private readonly _fakePublicKey; /** @hidden */ _initializationPromises: Promise[]; _meteorConnect?: MeteorConnect; _localStorageAdapter: CEnvironmentStorageAdapter; _typedStorageHelper: { set: (prop: ITypedStorageHelper) => void; get: () => ITypedStorageHelper; }; private logger; /** * The easiest way to set up the SDK. Returns an instance of MeteorWallet, automatically connected to the Near API. * * If you need more control over the Near Network configuration- rather use {@link MeteorWallet:constructor} * * @example * ```js * const wallet = await MeteorWallet.init({ networkId: "testnet" }); * ``` */ /** * Construct MeteorWallet. If you'd a quick and default way, you can also use {@link MeteorWallet.init} * * @example * ```js * // create new MeteorWallet instance (passing in your initialized Near connection) * const meteorWallet = new MeteorWallet({ near: connectedNear, appKeyPrefix: 'my-app' }); * * if(!meteorWallet.isSignedIn()) { * const { accountId } = await meteorWallet.requestSignIn(); * } * ``` */ constructor({ keyStore, networkId, walletUrl, nodeUrl, meteorConnect, forceTargetPlatformConfig }: IMeteorWallet_Constructor); isExtensionInstalled(): boolean; /** * Returns true, if this app is authorized with an account in the wallet. * @example * ```js * const wallet = new MeteorWallet({ near: connectedNear, appKeyPrefix: 'my-app' }); * wallet.isSignedIn(); * ``` */ get storage(): ITypedStorageHelper; /** * Verifies that the user is the owner of a specific Near account, available in the wallet. * Removes the need to do blockchain operations for simple Dapp actions. * Signs a payload with the wallet's private key. Will return a promise with a payload like so: * * ```ts * interface VerifiedOwner { * accountId: string; * message: string; // The same passed message, unencrypted * blockId: string; * publicKey: string; // The public key which should be verified as belonging to this account * signature: string; // The signed payload (this exact same object JSON stringified, excluding this "signature" property) * keyType: KeyType; // Type from `@near-js/crypto` * } * ``` * * or throw a {@link MeteorActionError} error if the verification failed for whatever reason. * */ verifyOwner(options: Omit & IWithAccountIdentifier): Promise>; /** * Requests a sign-in using Meteor Wallet. Will return a promise with the `accountId` of the * signed-in account, or throw a {@link MeteorActionError} error if the sign-in failed for whatever reason. * */ requestSignIn(options: IOMeteorWalletSdk_RequestSignIn_Inputs): Promise>; /** * Sign out from the current account */ signOut({ accountIdentifier, functionCallKey }: IWithAccountIdentifier & { functionCallKey?: AddFunctionCallKeyParams; }): Promise; /** * Allows users to sign a message for a specific recipient using their NEAR account, based on the [NEP413](https://github.com/near/NEPs/pull/413). * * Will return a promise with a payload like so: * * ```ts * interface signMessage { * accountId: string; // The account name to which the publicKey corresponds as plain text * publicKey: string; // The public counterpart of the key used to sign * signature: string; // The base64 representation of the signature * state?: string; // The same state passed in. * } * ``` * * or throw a {@link MeteorActionError} error if the signing failed for whatever reason. * */ signMessage({ message, nonce, recipient, callbackUrl, state, accountIdentifier }: Omit & IWithAccountIdentifier): Promise>; /** * Sign transactions using Meteor Wallet. Will return a promise with an array of `FinalExecutionOutcome` * of the given transactions. * */ requestSignTransactions(inputs: IORequestSignTransactions_Inputs & IWithMeteorWalletAccount): Promise; requestSignDelegateActions({ delegateActions, account }: IORequestSignDelegateActions_Input & IWithMeteorWalletAccount): Promise; /** * Returns the current connected wallet account */ transformDelegateActions({ delegateActions, blockHeightTtl, meteorConnectAccount }: { delegateActions: TSimpleNearDelegateAction[]; blockHeightTtl?: number; meteorConnectAccount: IMeteorConnectAccount; }): Promise; transformTransactions({ transactions, meteorConnectAccount }: { transactions: TMeteorSdkV1Transaction[]; meteorConnectAccount: IMeteorConnectAccount; }): Promise<_near_js_transactions0.Transaction[]>; } /** * Near Account implementation which makes use of {@link MeteorWallet} when no local key is available. * * Generally won't be created directly- can be obtained by using {@link MeteorWallet.account} * * @example * ```js * const account = meteorWallet.account(); * * // uses Meteor Wallet to sign the transaction using this account * const response = await account.requestSignTransaction({ * actions: transactionActions, * receiverId: "my-contract" * }); * ``` */ declare class ConnectedMeteorWalletAccount extends Account { /** @hidden */ meteorWallet: MeteorWallet; meteorConnectAccount: IMeteorConnectAccount; /** @hidden */ constructor(walletConnection: MeteorWallet, meteorConnectAccount: IMeteorConnectAccount); /** * Sign a transaction using Meteor Wallet. Overrides the Near Account API method of the same name, makes use of {@link ConnectedMeteorWalletAccount.signAndSendTransaction_direct} */ signAndSendTransaction(...args: any[]): Promise; /** @hidden */ private trySendOrCreateTransaction; /** * Sign a transaction using Meteor Wallet * @see {@link MeteorWallet.requestSignTransactions} */ signAndSendTransaction_direct({ receiverId, actions }: IOMeteorWalletSdkAccount_SignAndSendTransaction_Input): Promise; /** * Check if given access key allows the function call or method attempted in transaction * @param accessKey Array of {access_key: AccessKey, public_key: PublicKey} items * @param receiverId The NEAR account attempting to have access * @param actions The action(s) needed to be checked for access */ accessKeyMatchesTransaction(accessKey: AccessKeyInfoView, receiverId: string, actions: Action$2[]): Promise; /** * Helper function returning the access key (if it exists) to the receiver that grants the designated permission * @param localKey A local public key provided to check for access * @returns Promise */ accessKeyForTransaction(localKey?: PublicKey): Promise; } //#endregion //#region src/MeteorWalletConstants.d.ts declare const WALLET_URL_DEV_BASE = "https://wallet-dev.meteorwallet.app"; declare const WALLET_URL_PRODUCTION_BASE = "https://wallet.meteorwallet.app"; declare const WALLET_URL_LOCALHOST_BASE = "https://localhost:3000"; //#endregion //#region src/near_utils/convertOldFunctionCallKeyDefToNew.d.ts declare function convertOldFunctionCallKeyDefToNew({ contractId, methodNames }: { contractId: string; methodNames?: Array; }): PartialBy; //#endregion //#region src/near_utils/convertSelectorActionToNearAction.d.ts declare const parseArgs: (data: Object | string) => Object | Buffer; declare const convertSelectorActionToNearAction: (action: TMeteorAction) => Action$1; //#endregion //#region src/near_utils/serializeMessageNep413.d.ts interface NearNep413MessagePayload { message: string; recipient: string; nonce: Uint8Array; callbackUrl?: string; } declare const Nep413MessageSchema: Schema; declare function serializeMessageNep413(payload: NearNep413MessagePayload): Uint8Array; //#endregion //#region src/ported_common/utils/storage/webpage/webpage_local_storage.d.ts declare const webpage_local_storage: ILocalStorageInterface; //#endregion //#region src/utils/MeteorSdkUtils.d.ts declare const resolveWalletUrl: (network: string, walletUrl?: string) => string; interface INetworkPreset { networkId: string; nodeUrl: string; helperUrl: string; explorerUrl: string; } declare const getNetworkPreset: (networkId: string) => INetworkPreset; //#endregion export { AddKeyJournalError, ConnectedMeteorWalletAccount, EMeteorAppId, EMeteorExtensionDirectActionType, EMeteorWalletSignInType, ExecutableAction, FunctionCallKeyExecutionError, type IAddKeyJournalChain, type IAddKeyJournalJob, type IAddKeySignedTransaction, IDappAction_Login, IDappAction_Logout, IDappAction_Logout_Data, IDappAction_SignDelegateActions, IDappAction_SignDelegateActions_Data, IDappAction_SignMessage, IDappAction_SignTransaction, IDappAction_SignTransactions_Data, IDappAction_VerifyOwner, IExternalAction_Base, type IFunctionCallKeyTransaction, IMeteorActionResponse_Output, IMeteorAddKeyAction, IMeteorComInjectedObject, IMeteorComInjectedObjectV2, IMeteorConnectAccount, IMeteorConnectAccountIdentifier, IMeteorConnectAccountIdentifier_Near, IMeteorConnectBridgeLeaseHandle, IMeteorConnectBridgeLeaseProvider, IMeteorConnectMobileBridgeConfig, IMeteorConnectNativeAppOpener, IMeteorConnectNearKeyStoreProvider, IMeteorConnectNetworkTarget, IMeteorConnectPublicKey_Ed25519, IMeteorConnectTransferAccountsConfig, IMeteorConnectTypedStorage, IMeteorConnect_Initialize_Input, IMeteorConnection_Base, IMeteorConnection_Test, IMeteorConnection_Test_RidDeepLink, IMeteorConnection_Test_RidQrCode, IMeteorConnection_V1_Ext, IMeteorConnection_V1_Web, IMeteorConnection_V1_Web_Localhost, IMeteorConnection_V2_BridgeMobile, IMeteorConnection_V2_MobileDeepLink, IMeteorConnection_V2_QrCode, IMeteorExtensionDirectAction_Input, IMeteorExtensionDirectAction_OpenPage_Output, IMeteorGasKeyInfo, IMeteorTransferToGasKeyAction, IMeteorWalletExternalAction_SignIn_OptionalMessageParams, IMeteorWallet_Constructor, IMeteorWallet_Init_Inputs, IMeteorWithdrawFromGasKeyAction, INewKeyTransferAddKeyOptions, INewKeyTransferAddKeyResult, INewKeyTransferArchiveOptions, type INewKeyTransferFencedOperation, INewKeyTransferReconcileOptions, type INewKeyTransferReconcileResult, type INewKeyTransferReconciliationReport, INewKeyTransferRecoveryState, INewKeyTransferSdkSession, INewKeyTransferStartOptions, INewKeyTransferStartResult, INewKeyTransferVerifyOptions, INewKeyTransferVerifyResult, IODappAction_PostMessage_SignDelegateActions_Input, IODappAction_PostMessage_SignDelegateActions_Output, IODappAction_PostMessage_SignIn_Output, IODappAction_PostMessage_SignTransactions_Input, IODappAction_PostMessage_SignTransactions_Output, IODappAction_SignMessage_Input, IODappAction_SignMessage_Output, IODappAction_VerifyOwner_Input, IODappAction_VerifyOwner_Output, IOMeteorWalletSdkAccount_SignAndSendTransaction_Input, IOMeteorWalletSdk_RequestSignIn_Inputs, IOMeteorWalletSdk_SignIn_Output, IORequestSignDelegateActions_Input, IORequestSignDelegateActions_Output, IORequestSignTransactionsRedirect_Inputs, IORequestSignTransactions_Inputs, IOWalletExternalLinkedContract, IPostMessageConnection, IRejectReason, ISerializedSignedDelegateWithHashes, ISignDelegateActionReturn, ISignedDelegateWithHash, IStageTransferAccountInput, ITransactionHashOutput, ITransferAccountsPromptOptions, IWithAccountIdentifier, IWithCallbackUrl, IWithMeteorWalletAccount, LoggerInstance, MCActionRegistryMap, METEOR_CONNECT_BACKENDS, MOBILE_BRIDGE_ENDING, MeteorActionError, MeteorConnect, MeteorLogger, MeteorWallet, NEW_KEY_TRANSFER_ERROR_CODES, NearNep413MessagePayload, Nep413MessageSchema, NewKeyTransferError, StorageBakeryBridgeLeaseProvider, type TAccountSecretData, type TAccountTransferDataDecrypted, type TAddKeyJournalErrorCode, TClientPostMessageResponse, TDappAction_SignIn_Data, type TDeriveNearPublicKeyFromSecretResult, type TDeriveNearSigningKeyFromSecretResult, type TFunctionCallKeyCoverage, TMCActionOutput, TMCActionRegistry, TMCLoggingLevel, TMCSelectedAccountForNetwork, TMeteorAction, TMeteorComListener, TMeteorConnectAccountIdentifier, TMeteorConnectAccountNetwork, TMeteorConnectAccountType, type TMeteorConnectBackendEnvironment, TMeteorConnectPublicKey, TMeteorConnectionExecutionTarget, TMeteorExecutionTargetConfig, TMeteorExtensionDirectAction_OpenMeteorConnect_Input, TMeteorExtensionDirectAction_OpenPage_Input, TMeteorSdkV1Transaction, TMeteorWalletExternalAction_SignIn_AccountOnly, TMeteorWalletExternalAction_SignIn_AllMethods, TMeteorWalletExternalAction_SignIn_SelectedMethods, TNearNativeAction, TNetworkTargetKey, type TNewKeyTransferErrorCode, type TNewKeyTransferRecoveryFence, TNewKeyTransferSdkPhase, TNewKeyTransferTargetPlatform, TParseTransferSecretInputResult, TPostMessageSend, TRANSFER_ACCOUNTS_MAX_ACCOUNTS, TReferrerBits, TStageTransferAccountFailureReason, TStageTransferAccountResult, TStagedTransferAccountSummary, TTransferAccountsOutcome, WALLET_URL_DEV_BASE, WALLET_URL_LOCALHOST_BASE, WALLET_URL_PRODUCTION_BASE, WebLockBridgeLeaseProvider, convertOldFunctionCallKeyDefToNew, convertSelectorActionToNearAction, deriveLocalBackendUrl, deriveNearPublicKeyFromAccountSecret, deriveNearSigningKeyFromAccountSecret, directBrowserNativeAppOpener, formatNearEd25519PublicKey, functionCallKeyCoverage, getNetworkPreset, isNewKeyTransferError, parseArgs, parseTransferSecretInput, resolveWalletUrl, serializeMessageNep413, setEnvConfig, webpage_local_storage }; //# sourceMappingURL=index.d.cts.map