import type { HybridObject } from 'react-native-nitro-modules'; export interface BarkConfigOpts { ark: string; /** Client identifier sent as `x-user-agent`, formatted as `/`. */ user_agent?: string; esplora?: string; bitcoind?: string; bitcoind_cookie?: string; bitcoind_user?: string; bitcoind_pass?: string; /** Number of blocks before expiry to refresh VTXOs (0–65535). */ vtxo_refresh_expiry_threshold: number; /** Unused VTXO key indices to scan during recovery. Default: 250; integer from 0 to 100000. */ vtxo_key_gap_limit?: number; fallback_fee_rate: number; htlc_recv_claim_delta: number; vtxo_exit_margin: number; /** Required round confirmations (0–65535). */ round_tx_required_confirmations: number; } export interface BarkCreateOpts { regtest?: boolean; signet?: boolean; bitcoin?: boolean; mnemonic: string; birthday_height?: number; config?: BarkConfigOpts; } export interface RecoveryGroup { vtxo_ids: string[]; /** Sum of known amounts; failed fetches may have no known amount. */ known_amount_sat: number; } export interface RecoveryReport { /** False when the scan has failed or foreign candidates. */ is_complete: boolean; recovered: RecoveryGroup; skipped: RecoveryGroup; exited: RecoveryGroup; failed: RecoveryGroup; /** Keys not found within the configured VTXO key gap. */ foreign: RecoveryGroup; /** VTXO ids the Ark server reported as unknown; recovery does not retry them. */ not_found: RecoveryGroup; } export interface RestoreWalletResult { status: string; report?: RecoveryReport; error?: string; } export interface BarkArkInfo { network: string; server_pubkey: string; mailbox_pubkey: string; round_interval: number; nb_round_nonces: number; vtxo_exit_delta: number; vtxo_lifetime: number; htlc_send_expiry_delta: number; max_vtxo_amount: number; required_board_confirmations: number; min_board_amount: number; ln_receive_anti_dos_required: boolean; } /** Public identity information for diagnosing a loaded wallet. */ export interface WalletDebugInfo { network: string; mailbox_id: string; vtxo_xpub: string; } export interface BarkSendManyOutput { destination: string; amountSat: number; } interface BarkVtxo { id: string; amount: number; expiry_height: number; server_pubkey: string; exit_delta: number; anchor_point: string; point: string; state: string; } export interface BoardResult { funding_txid: string; vtxos: string[]; } export interface Bolt11Invoice { payment_request: string; payment_secret: string; payment_hash: string; } export interface ArkoorPaymentResult { amount_sat: number; destination_pubkey: string; movement_id: number; } /** Result of an offboard or an on-chain send from Ark funds. */ export interface OffboardResult { txid: string; movement_id: number; } export interface PaymentRequestOption { /** Same values as a movement's payment_method: ark, bitcoin, output-script, invoice, offer, lightning-address, lnurl, custom. */ method_type: string; value: string; /** Validation problems, e.g. network mismatch. Non-empty means the option should not be paid. */ errors: string[]; } export interface ParsedPaymentRequest { amount_sat?: number; label?: string; message?: string; options: PaymentRequestOption[]; /** Bark's pick among error-free options: Ark, then Lightning, then on-chain. */ default_option_index?: number; } export interface BarkFeeEstimate { gross_amount_sat: number; fee_sat: number; net_amount_sat: number; vtxos_spent: string[]; } export interface ExitFeeEstimate { exit_broadcast_fee_sat: number; claim_fee_sat: number; total_fee_sat: number; fee_rate_sat_per_vb: number; txs_to_broadcast: number; } export interface BarkFeeRates { fast: number; regular: number; slow: number; } export interface OnchainTransactionInfo { txid: string; tx_hex: string; has_onchain_fee: boolean; onchain_fee_sat: number; balance_change_sat: number; has_confirmation: boolean; confirmation_height: number; confirmation_hash: string; } export interface ExitBlockRefResult { height: number; hash: string; } export interface ExitTxOriginResult { kind: string; confirmed_in?: ExitBlockRefResult; } export interface ExitTxStatusResult { kind: string; txids?: string[]; child_txid?: string; origin?: ExitTxOriginResult; block?: ExitBlockRefResult; } export interface ExitTxResult { txid: string; status: ExitTxStatusResult; } export interface ExitStateDetailsResult { kind: string; tip_height: number; /** Present for vtxo-swept; spent exit-chain inputs formatted as txid:vout. */ spent_inputs?: string[]; transactions?: ExitTxResult[]; confirmed_block?: ExitBlockRefResult; claimable_height?: number; claimable_since?: ExitBlockRefResult; last_scanned_block?: ExitBlockRefResult; claim_txid?: string; txid?: string; block?: ExitBlockRefResult; } export interface ExitProgressStatusResult { vtxo_id: string; state: string; state_details: ExitStateDetailsResult; error?: string; } export interface ExitVtxoResult { vtxo_id: string; amount_sat: number; state: string; state_details: ExitStateDetailsResult; history: string[]; history_details: ExitStateDetailsResult[]; txids: string[]; is_claimable: boolean; is_initialized: boolean; } export interface ExitTransactionPackageResult { exit_txid: string; exit_tx_hex: string; child_txid: string; child_tx_hex: string; child_origin: string; has_child: boolean; } export interface ExitStatusResult { vtxo_id: string; state: string; state_details: ExitStateDetailsResult; history: string[]; history_details: ExitStateDetailsResult[]; transactions: ExitTransactionPackageResult[]; } export interface LightningPaymentResult { state: string; invoice?: string; payment_hash: string; amount?: number; htlc_vtxos: BarkVtxo[]; movement_id?: number; preimage?: string; } export type LightningPaymentOriginMethod = 'lightning-address' | 'lnurl' | 'custom'; /** * The original user-facing destination that was resolved to a Lightning * invoice outside Bark. Only origin kinds that Bark can persist through this * API are accepted; Rust validates the value again at the native boundary. */ export interface LightningPaymentOrigin { method: LightningPaymentOriginMethod; value: string; } export interface OnchainPaymentResult { txid: string; amount_sat: number; destination_address: string; } /** All amounts are integer satoshis. Summary fields overlap the breakdown. */ export interface OffchainBalanceResult { spendable: number; needs_refresh: number; pending: number; total: number; pending_arkoor_send: number; pending_lightning_send: number; claimable_lightning_receive: number; pending_in_round: number; pending_board: number; pending_offboard: number; pending_exit: number; } export interface OnchainBalanceResult { immature: number; trusted_pending: number; untrusted_pending: number; confirmed: number; } export interface NewAddressResult { user_pubkey: string; ark_id: string; address: string; } export interface KeyPairResult { public_key: string; secret_key: string; } export interface MailboxAuthorizationResult { mailbox_id: string; expiry: number; encoded: string; } export interface LightningReceive { state: string; phase?: string; payment_hash: string; payment_preimage: string; invoice: string; htlc_vtxo_ids: string[]; movement_id?: number; amount_sat?: number; settled_at?: number; } export interface BarkMovementSubsystem { name: string; kind: string; } export interface BarkMovementDestination { destination: string; payment_method: string; amount_sat: number; } export interface BarkMovement { id: number; status: string; subsystem: BarkMovementSubsystem; metadata_json: string; intended_balance_sat: number; effective_balance_sat: number; offchain_fee_sat: number; sent_to: BarkMovementDestination[]; received_on: BarkMovementDestination[]; input_vtxos: string[]; output_vtxos: string[]; exited_vtxos: string[]; created_at: string; updated_at: string; completed_at?: string; } export interface PendingRoundStatus { round_id: number; status: string; funding_txid: string; unsigned_funding_txids: string[]; error: string; is_final: boolean; is_success: boolean; } export interface DelegatedRoundState { round_id: number; } export interface BarkNotificationEvent { kind: string; movement?: BarkMovement; } export interface BarkNotificationSubscription extends HybridObject<{ ios: 'c++'; android: 'c++'; }> { stop(): void; isActive(): boolean; } export interface WalletSnapshotInfo { path: string; sizeBytes: number; sha256: string; network: string; walletFingerprint: string; serverPubkey?: string; mailboxPubkey?: string; schemaVersion: number; } export interface WalletSnapshotExpectation { network?: string; walletFingerprint?: string; serverPubkey?: string; } export interface WalletStateChangeEvent { sequence: number; reason: string; } export interface WalletStateChangeSubscription extends HybridObject<{ ios: 'c++'; android: 'c++'; }> { stop(): void; isActive(): boolean; } export interface NitroArk extends HybridObject<{ ios: 'c++'; android: 'c++'; }> { getBarkVersion(): string; createMnemonic(): Promise; createWallet(datadir: string, opts: BarkCreateOpts): Promise; loadWallet(datadir: string, config: BarkCreateOpts): Promise; restoreWalletFromArkServer(datadir: string, opts: BarkCreateOpts): Promise; isWalletLoaded(): Promise; closeWallet(): Promise; createWalletSnapshot(destinationPath: string): Promise; validateWalletSnapshot(path: string, expected?: WalletSnapshotExpectation): Promise; subscribeWalletStateChanges(onEvent: (event: WalletStateChangeEvent) => void): WalletStateChangeSubscription; refreshServer(): Promise; syncPendingBoards(): Promise; maintenance(): Promise; maintenanceDelegated(): Promise; maintenanceRefresh(): Promise; sync(): Promise; startExitForEntireWallet(): Promise; startExitForVtxos(vtxoIds: string[]): Promise; cancelExit(vtxoId: string): Promise; syncExit(): Promise; progressExits(feeRateSatPerKvb?: number): Promise; estimateEmergencyExitFee(vtxoIds: string[], feeRateSatPerKvb?: number, destinationAddress?: string, feeMargin?: number): Promise; getExitVtxos(): Promise; listClaimable(): Promise; getExitStatus(vtxoId: string, includeHistory?: boolean, includeTransactions?: boolean): Promise; hasPendingExits(): Promise; pendingExitTotal(): Promise; allClaimableAtHeight(): Promise; drainExits(vtxoIds: string[], destinationAddress: string, feeRateSatPerKvb?: number): Promise; extractTransaction(psbt: string): Promise; broadcastTransaction(txHex: string): Promise; syncPendingRounds(): Promise; getArkInfo(): Promise; debugInfo(): Promise; offchainBalance(): Promise; deriveStoreNextKeypair(): Promise; peekKeyPair(index: number): Promise; peekAddress(index: number): Promise; newAddress(): Promise; signMessage(message: string, index: number): Promise; signMesssageWithMnemonic(message: string, mnemonic: string, network: string, index: number): Promise; deriveKeypairFromMnemonic(mnemonic: string, network: string, index: number): Promise; verifyMessage(message: string, signature: string, publicKey: string): Promise; mailboxKeypair(): Promise; mailboxAuthorization(authorizationExpiry: number): Promise; subscribeNotifications(onEvent: (event: BarkNotificationEvent) => void): BarkNotificationSubscription; subscribeArkoorAddressMovements(address: string, onEvent: (event: BarkNotificationEvent) => void): BarkNotificationSubscription; subscribeLightningPaymentMovements(paymentHash: string, onEvent: (event: BarkNotificationEvent) => void): BarkNotificationSubscription; history(): Promise; vtxos(): Promise; updateHistoryMetadata(movementId: number, patchJson: string): Promise; decodeVtxoHex(vtxoHex: string): Promise; importVtxo(vtxoHex: string): Promise; dangerousDropVtxo(vtxoId: string): Promise; unlockVtxos(vtxoIds: string[]): Promise; refreshVtxosDelegated(vtxoIds: string[]): Promise; getFirstExpiringVtxoBlockheight(): Promise; getNextRequiredRefreshBlockheight(): Promise; getExpiringVtxos(threshold: number): Promise; onchainBalance(): Promise; onchainSync(): Promise; onchainIsMine(address: string): Promise; onchainListUnspent(): Promise; onchainUtxos(): Promise; onchainFeeRates(): Promise; onchainTransactions(): Promise; onchainAddress(): Promise; onchainSend(destination: string, amountSat: number, feeRate?: number): Promise; onchainDrain(destination: string, feeRate?: number): Promise; onchainSendMany(outputs: BarkSendManyOutput[], feeRate?: number): Promise; boardAmount(amountSat: number): Promise; boardAll(): Promise; validateArkoorAddress(address: string): Promise; sendArkoorPayment(destination: string, amountSat: number): Promise; /** * Parses anything a user may paste: BIP 321 and lightning: URIs, BOLT11 * invoices, BOLT12 offers, lightning addresses, LNURL-pay links, Ark and * bitcoin addresses. Throws when no payment option is found. */ parsePaymentRequest(payment: string): Promise; estimateArkoorPaymentFee(amountSat: number): Promise; estimateBoardOffchainFee(amountSat: number): Promise; estimateRefreshFee(vtxoIds: string[]): Promise; payLightningInvoice(destination: string, wait: boolean, amountSat?: number, retryForSeconds?: number): Promise; /** * Pays an invoice already resolved by the caller while preserving the * original user-facing destination in Bark's movement history. */ payLightningInvoiceWithOrigin(invoice: string, origin: LightningPaymentOrigin, wait: boolean, retryForSeconds?: number): Promise; payLightningOffer(offer: string, wait: boolean, amountSat?: number, retryForSeconds?: number): Promise; payLightningAddress(addr: string, amountSat: number, comment: string, wait: boolean, retryForSeconds?: number): Promise; estimateLightningSendFee(amountSat: number): Promise; sendOnchain(destination: string, amountSat: number): Promise; estimateSendOnchain(destination: string, amountSat: number): Promise; bolt11Invoice(amountSat: number, description?: string, token?: string): Promise; lightningReceiveStatus(paymentHash: string): Promise; checkLightningPayment(paymentHash: string, wait: boolean): Promise; tryClaimLightningReceive(paymentHash: string, wait: boolean): Promise; tryClaimAllLightningReceives(wait: boolean): Promise; offboardSpecific(vtxoIds: string[], destinationAddress: string): Promise; offboardAll(destinationAddress: string): Promise; estimateOffboardAll(destinationAddress: string): Promise; } export {}; //# sourceMappingURL=NitroArk.nitro.d.ts.map