UNPKG

bitmask-core

Version:

Core functionality for the BitMask wallet

101 lines 2.92 kB
export declare const createWallet: (username: string, password: string) => Promise<CreateWalletResponse>; export declare const auth: (username: string, password: string) => Promise<AuthResponse>; export declare const createInvoice: (description: string, amount: number, token: string) => Promise<AddInvoiceResponse>; export declare const getBalance: (token: string) => Promise<Account>; export declare const getTxs: (token: string) => Promise<LnTransaction[]>; export declare const payInvoice: (paymentRequest: string, token: string) => Promise<PayInvoiceResponse>; export declare const checkPayment: (paymentHash: string) => Promise<CheckPaymentResponse>; export declare const swapBtcLn: (token: string) => Promise<SwapBtcLnResponse>; export declare const swapLnBtc: (address: string, amount: bigint, token: string) => Promise<SwapLnBtcResponse>; export interface LnCredentials { login: string; password: string; refreshToken: string; accessToken: string; } export interface CreateWalletResponse { username?: string; error?: string; } export type AuthResponse = ErrorResponse | AuthResponseOk; export interface AuthResponseOk { refresh: string; token: string; } export interface ErrorResponse { error: string; } export interface Account { account_id: string; balance: string; currency: string; } export interface Money { value: string; currency: string; } export interface AddInvoiceResponse { req_id: string; uid: number; payment_request: string; meta: string; metadata: string; amount: Money; rate: string; currency: string; target_account_currency: string; account_id: string; error: string; fees: string; } export interface LnTransaction { txid: string; fee_txid: string; outbound_txid: string; inbound_txid: string; created_at: bigint; date: number; outbound_amount: string; inbound_amount: string; outbound_account_id: string; inbound_account_id: string; outbound_uid: number; inbound_uid: number; outbound_currency: string; inbound_currency: string; exchange_rate: string; tx_type: string; fees: string; reference: string; } export interface LnWalletData { balance: Account; transactions: LnTransaction[]; } export interface PayInvoiceResponse { payment_hash: string; uid: number; success: boolean; currency: string; payment_request: string; amount: Money; fees: Money; error: string; payment_preimage: string; destination: string; description: string; } export interface CheckPaymentResponse { paid: boolean; } export interface SwapBtcLnResponse { address: string; commitment: string; signature: string; secret_access_key: string; } export interface SwapLnBtcResponse { bolt11_invoice: string; fee_sats: number; } //# sourceMappingURL=lightning.d.ts.map