bitmask-core
Version:
Core functionality for the BitMask wallet
248 lines (243 loc) • 18.1 kB
TypeScript
/* tslint:disable */
/* eslint-disable */
export function create_watcher(nostr_hex_sk: string, request: any): Promise<any>;
export function recover_watcher(nostr_hex_sk: string, request: any): Promise<any>;
export function destroy_watcher(nostr_hex_sk: string): Promise<any>;
export function destroy_recover_watcher(nostr_hex_sk: string): Promise<any>;
export function check_watcher(nostr_hex_sk: string): Promise<any>;
export function watcher_next_address(nostr_hex_sk: string, request: string): Promise<any>;
export function watcher_next_utxo(nostr_hex_sk: string, request: string): Promise<any>;
export function watcher_unspent_utxos(nostr_hex_sk: string, request: string): Promise<any>;
export function store(secret_key: string, name: string, data: Uint8Array, force: boolean, metadata?: Uint8Array | null): Promise<any>;
export function retrieve(secret_key: string, name: string): Promise<any>;
export function retrieve_metadata(secret_key: string, name: string): Promise<any>;
export function encode_hex(bytes: Uint8Array): string;
export function encode_base64(bytes: Uint8Array): string;
export function decode_hex(string: string): Uint8Array;
export function decode_base64(string: string): Uint8Array;
export function fund_rgb_vault(sk: string, fee_rate: number, secrets: any, broadcast: boolean, fund_value: bigint | null | undefined, onetime_fee: boolean): Promise<any>;
export function transfer_sats(sk: string, address: string, sats: bigint, fee_rate: number, secrets: any): Promise<any>;
export function get_btc_wallet(sk: string): Promise<any>;
export function backup_btc_data(nostr_hex_sk: string): Promise<any>;
export function recover_funds_from_bad_wallets(seed: string, pass_phrase: string, recover_address: string): Promise<any>;
export function restore_btc_data(nostr_hex_sk: string): Promise<any>;
export function get_rgb_version(): string;
export function get_rgb_wallet(nostr_hex_sk: string): Promise<any>;
export function get_contract(nostr_hex_sk: string, request: string): Promise<any>;
export function list_contracts(nostr_hex_sk: string, arg1: boolean): Promise<any>;
export function import_contract(nostr_hex_sk: string, request: string): Promise<any>;
export function issue_contract(nostr_hex_sk: string, request: any): Promise<any>;
export function issue_contract_proxy(nostr_hex_sk: string, request: any): Promise<any>;
export function create_rgb_invoice(nostr_hex_sk: string, request: any): Promise<any>;
export function remove_rgb_invoice(nostr_hex_sk: string, request: string): Promise<any>;
export function list_rgb_invoices(nostr_hex_sk: string): Promise<any>;
export function decode_rgb_invoice(invoice: string): Promise<any>;
export function can_create_transfer_contract(nostr_hex_sk: string, request: any): Promise<any>;
export function create_rgb_transfer(nostr_hex_sk: string, request: any): Promise<any>;
export function create_and_publish_rgb_transfer(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
export function psbt_sign_file(_nostr_hex_sk: string, request: any): Promise<any>;
export function accept_transfer(nostr_hex_sk: string, request: any): Promise<any>;
export function save_transfer(nostr_hex_sk: string, request: any): Promise<any>;
export function list_transfers(nostr_hex_sk: string): Promise<any>;
export function verify_transfers(nostr_hex_sk: string): Promise<any>;
export function list_offers(nostr_hex_sk: string): Promise<any>;
export function offers(nostr_hex_sk: string): Promise<any>;
export function bids(nostr_hex_sk: string): Promise<any>;
export function offer_swap_suppl(nostr_hex_sk: string, offer_id: string): Promise<any>;
export function bid_swap_suppl(nostr_hex_sk: string, bid_id: string): Promise<any>;
export function can_create_offer(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
export function create_offer(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
export function cancel_offer(nostr_hex_sk: string, request: any): Promise<any>;
export function can_create_bid(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
export function create_bid(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
export function cancel_bid(nostr_hex_sk: string, request: any): Promise<any>;
export function create_airdrop(nostr_hex_sk: string, request: any, secrets: any, fee: bigint, max_claim: string): Promise<any>;
export function create_airdrop_claim(nostr_hex_sk: string, request: any): Promise<any>;
export function close_airdrop(nostr_hex_sk: string, request: any): Promise<any>;
export function backup_rgb_data(nostr_hex_sk: string): Promise<any>;
export function restore_rgb_data(nostr_hex_sk: string): Promise<any>;
export function convert_contract_amount_raw(decimal: string, precision: number): string;
export function convert_contract_amount_string(amount: bigint, precision: number): string;
export function parse_contract_amount(amount: string): any;
export function parse_contract_amount_precision(amount: string, precision: number): string;
export function version(): any;
export function hash_password(password: string): string;
export function new_mnemonic(password: string): Promise<any>;
export function save_mnemonic(seed: string, password: string): Promise<any>;
export function decrypt_wallet(hash: string, encrypted_descriptors: string, seed_password: string): Promise<any>;
export function upgrade_wallet(hash: string, encrypted_descriptors: string, seed_password: string): Promise<any>;
export function new_wallet(hash: string, seed_password: string): Promise<any>;
export function encrypt_wallet(mnemonic: string, hash: string, seed_password: string): Promise<any>;
export function get_wallet_data(descriptor: string, change_descriptor?: string | null): Promise<any>;
export function sync_wallets(): Promise<any>;
export function get_new_address(descriptor: string, change_descriptor?: string | null): Promise<any>;
export function send_sats(descriptor: string, change_descriptor: string, destination: string, amount: bigint, broadcast: boolean, fee_rate?: number | null): Promise<any>;
export function fund_vault(descriptor: string, change_descriptor: string, rgb_address: string, broadcast: boolean, fee_rate?: number | null): Promise<any>;
export function get_assets_vault(rgb_descriptor_xpub: string): Promise<any>;
export function drain_wallet(destination: string, descriptor: string, change_descriptor?: string | null, fee_rate?: number | null): Promise<any>;
export function bump_fee(txid: string, fee_rate: number, descriptor: string, change_descriptor: string | null | undefined, broadcast: boolean): Promise<any>;
export function psbt_sign_and_publish_file(request: any): Promise<any>;
export function psbt_publish_file(request: any): Promise<any>;
export function create_wallet(username: string, password: string): Promise<any>;
export function auth(username: string, password: string): Promise<any>;
export function ln_create_invoice(description: string, amount: number, token: string): Promise<any>;
export function get_balance(token: string): Promise<any>;
export function get_txs(token: string): Promise<any>;
export function pay_invoice(payment_request: string, token: string): Promise<any>;
export function check_payment(payment_hash: string): Promise<any>;
export function swap_btc_ln(token: string, ln_address?: string | null): Promise<any>;
export function swap_ln_btc(address: string, amount: bigint, token: string): Promise<any>;
export function new_nostr_pubkey(pubkey: string, token: string): Promise<any>;
export function update_nostr_pubkey(pubkey: string, token: string): Promise<any>;
export function get_network(): Promise<any>;
export function switch_network(network_str: string): Promise<any>;
export function get_env(key: string): Promise<any>;
export function set_env(key: string, value: string): Promise<any>;
export function sleep(ms: number): Promise<any>;
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly create_watcher: (a: number, b: number, c: any) => any;
readonly recover_watcher: (a: number, b: number, c: any) => any;
readonly destroy_watcher: (a: number, b: number) => any;
readonly destroy_recover_watcher: (a: number, b: number) => any;
readonly check_watcher: (a: number, b: number) => any;
readonly watcher_next_address: (a: number, b: number, c: number, d: number) => any;
readonly watcher_next_utxo: (a: number, b: number, c: number, d: number) => any;
readonly watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => any;
readonly store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
readonly retrieve: (a: number, b: number, c: number, d: number) => any;
readonly retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
readonly encode_hex: (a: number, b: number) => [number, number];
readonly encode_base64: (a: number, b: number) => [number, number];
readonly decode_hex: (a: number, b: number) => [number, number, number, number];
readonly decode_base64: (a: number, b: number) => [number, number, number, number];
readonly fund_rgb_vault: (a: number, b: number, c: number, d: any, e: number, f: number, g: bigint, h: number) => any;
readonly transfer_sats: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: any) => any;
readonly get_btc_wallet: (a: number, b: number) => any;
readonly backup_btc_data: (a: number, b: number) => any;
readonly recover_funds_from_bad_wallets: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
readonly restore_btc_data: (a: number, b: number) => any;
readonly get_rgb_version: () => [number, number];
readonly get_rgb_wallet: (a: number, b: number) => any;
readonly get_contract: (a: number, b: number, c: number, d: number) => any;
readonly list_contracts: (a: number, b: number, c: number) => any;
readonly import_contract: (a: number, b: number, c: number, d: number) => any;
readonly issue_contract: (a: number, b: number, c: any) => any;
readonly issue_contract_proxy: (a: number, b: number, c: any) => any;
readonly create_rgb_invoice: (a: number, b: number, c: any) => any;
readonly remove_rgb_invoice: (a: number, b: number, c: number, d: number) => any;
readonly list_rgb_invoices: (a: number, b: number) => any;
readonly decode_rgb_invoice: (a: number, b: number) => any;
readonly can_create_transfer_contract: (a: number, b: number, c: any) => any;
readonly create_rgb_transfer: (a: number, b: number, c: any) => any;
readonly create_and_publish_rgb_transfer: (a: number, b: number, c: any, d: any) => any;
readonly psbt_sign_file: (a: number, b: number, c: any) => any;
readonly accept_transfer: (a: number, b: number, c: any) => any;
readonly save_transfer: (a: number, b: number, c: any) => any;
readonly list_transfers: (a: number, b: number) => any;
readonly verify_transfers: (a: number, b: number) => any;
readonly list_offers: (a: number, b: number) => any;
readonly offers: (a: number, b: number) => any;
readonly bids: (a: number, b: number) => any;
readonly offer_swap_suppl: (a: number, b: number, c: number, d: number) => any;
readonly bid_swap_suppl: (a: number, b: number, c: number, d: number) => any;
readonly can_create_offer: (a: number, b: number, c: any, d: any) => any;
readonly create_offer: (a: number, b: number, c: any, d: any) => any;
readonly cancel_offer: (a: number, b: number, c: any) => any;
readonly can_create_bid: (a: number, b: number, c: any, d: any) => any;
readonly create_bid: (a: number, b: number, c: any, d: any) => any;
readonly cancel_bid: (a: number, b: number, c: any) => any;
readonly create_airdrop: (a: number, b: number, c: any, d: any, e: bigint, f: number, g: number) => any;
readonly create_airdrop_claim: (a: number, b: number, c: any) => any;
readonly close_airdrop: (a: number, b: number, c: any) => any;
readonly backup_rgb_data: (a: number, b: number) => any;
readonly restore_rgb_data: (a: number, b: number) => any;
readonly convert_contract_amount_raw: (a: number, b: number, c: number) => [number, number];
readonly convert_contract_amount_string: (a: bigint, b: number) => [number, number];
readonly parse_contract_amount: (a: number, b: number) => any;
readonly parse_contract_amount_precision: (a: number, b: number, c: number) => [number, number];
readonly version: () => any;
readonly hash_password: (a: number, b: number) => [number, number];
readonly new_mnemonic: (a: number, b: number) => any;
readonly save_mnemonic: (a: number, b: number, c: number, d: number) => any;
readonly decrypt_wallet: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
readonly upgrade_wallet: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
readonly new_wallet: (a: number, b: number, c: number, d: number) => any;
readonly encrypt_wallet: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
readonly get_wallet_data: (a: number, b: number, c: number, d: number) => any;
readonly get_new_address: (a: number, b: number, c: number, d: number) => any;
readonly send_sats: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number) => any;
readonly fund_vault: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
readonly get_assets_vault: (a: number, b: number) => any;
readonly drain_wallet: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
readonly bump_fee: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
readonly create_wallet: (a: number, b: number, c: number, d: number) => any;
readonly auth: (a: number, b: number, c: number, d: number) => any;
readonly ln_create_invoice: (a: number, b: number, c: number, d: number, e: number) => any;
readonly get_balance: (a: number, b: number) => any;
readonly get_txs: (a: number, b: number) => any;
readonly pay_invoice: (a: number, b: number, c: number, d: number) => any;
readonly check_payment: (a: number, b: number) => any;
readonly swap_btc_ln: (a: number, b: number, c: number, d: number) => any;
readonly swap_ln_btc: (a: number, b: number, c: bigint, d: number, e: number) => any;
readonly new_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
readonly update_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
readonly psbt_sign_and_publish_file: (a: any) => any;
readonly psbt_publish_file: (a: any) => any;
readonly sync_wallets: () => any;
readonly switch_network: (a: number, b: number) => any;
readonly get_env: (a: number, b: number) => any;
readonly set_env: (a: number, b: number, c: number, d: number) => any;
readonly sleep: (a: number) => any;
readonly get_network: () => any;
readonly rustsecp256k1_v0_9_2_context_create: (a: number) => number;
readonly rustsecp256k1_v0_9_2_context_destroy: (a: number) => void;
readonly rustsecp256k1_v0_9_2_default_illegal_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_9_2_default_error_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_8_1_context_create: (a: number) => number;
readonly rustsecp256k1_v0_8_1_context_destroy: (a: number) => void;
readonly rustsecp256k1_v0_8_1_default_illegal_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_8_1_default_error_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_10_0_context_create: (a: number) => number;
readonly rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
readonly rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_6_1_context_create: (a: number) => number;
readonly rustsecp256k1_v0_6_1_context_destroy: (a: number) => void;
readonly rustsecp256k1_v0_6_1_default_illegal_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_6_1_default_error_callback_fn: (a: number, b: number) => void;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_exn_store: (a: number) => void;
readonly __externref_table_alloc: () => number;
readonly __wbindgen_export_4: WebAssembly.Table;
readonly __externref_drop_slice: (a: number, b: number) => void;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_export_7: WebAssembly.Table;
readonly __externref_table_dealloc: (a: number) => void;
readonly closure1299_externref_shim: (a: number, b: number, c: any) => void;
readonly closure1925_externref_shim: (a: number, b: number, c: any) => void;
readonly closure3787_externref_shim: (a: number, b: number, c: any) => void;
readonly closure4081_externref_shim: (a: number, b: number, c: any, d: any) => void;
readonly __wbindgen_start: () => void;
}
export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
*
* @returns {InitOutput}
*/
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;