Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitmask-segwit

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitmask-segwit - npm Package Compare versions

Comparing version 0.7.0-beta.11 to 0.7.0-rc.22

22

bitcoin.d.ts
export declare const hashPassword: (password: string) => string;
export declare const decryptWallet: (hash: string, encryptedDescriptors: string) => Promise<Vault>;
export declare const decryptWallet: (hash: string, encryptedDescriptors: string, seedPassword?: string) => Promise<Vault>;
export declare const upgradeWallet: (hash: string, encryptedDescriptors: string, seedPassword?: string) => Promise<string>;

@@ -9,5 +9,5 @@ export declare const syncWallets: () => Promise<void>;

export declare const getNewAddress: (descriptor: string, changeDescriptor?: string) => Promise<string>;
export declare const sendSats: (descriptor: string, changeDescriptor: string, address: string, amount: bigint, feeRate: number) => Promise<TransactionData>;
export declare const fundVault: (descriptor: string, changeDescriptor: string, assetAddress1: string, udaAddress1: string, feeRate: number) => Promise<FundVaultDetails>;
export declare const getAssetsVault: (rgbAssetsDescriptorXpub: string, rgbUdasDescriptorXpub: string) => Promise<FundVaultDetails>;
export declare const sendSats: (descriptor: string, changeDescriptor: string, address: string, amount: bigint, broadcast: boolean, feeRate: number) => Promise<TransactionData>;
export declare const fundVault: (descriptor: string, changeDescriptor: string, rgbAddress: string, broadcast: boolean, feeRate?: number) => Promise<FundVaultDetails>;
export declare const getAssetsVault: (rgbDescriptorXpub: string) => Promise<FundVaultDetails>;
export declare const drainWallet: (destination: string, descriptor: string, changeDescriptor?: string, feeRate?: number) => Promise<TransactionData>;

@@ -19,4 +19,3 @@ export declare const bumpFee: (txid: string, feeRate: number, broadcast: boolean, descriptor: string, changeDescriptor?: string) => Promise<TransactionData>;

btcChangeDescriptorXprv: string;
rgbAssetsDescriptorXprv: string;
rgbUdasDescriptorXprv: string;
rgbDescriptorXprv: string;
nostrPrv: string;

@@ -26,9 +25,6 @@ nostrNsec: string;

export interface PublicWalletData {
xpub: string;
xpubkh: string;
watcherXpub: string;
btcDescriptorXpub: string;
btcChangeDescriptorXpub: string;
rgbAssetsDescriptorXpub: string;
rgbUdasDescriptorXpub: string;
rgbDescriptorXpub: string;
nostrPub: string;

@@ -120,7 +116,7 @@ nostrNpub: string;

export interface FundVaultDetails {
assetsOutput?: string;
udasOutput?: string;
rgbOutput?: string;
isFunded: boolean;
fundTxid: string;
fundTxid?: string;
fundFee?: number;
}
//# sourceMappingURL=bitcoin.d.ts.map

@@ -41,3 +41,5 @@ "use strict";

exports.hashPassword = hashPassword;
const decryptWallet = (hash, encryptedDescriptors) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.decrypt_wallet(hash, encryptedDescriptors)); });
const decryptWallet = (hash, encryptedDescriptors, seedPassword = "") => __awaiter(void 0, void 0, void 0, function* () {
return JSON.parse(yield BMC.decrypt_wallet(hash, encryptedDescriptors, seedPassword));
});
exports.decryptWallet = decryptWallet;

@@ -58,13 +60,11 @@ const upgradeWallet = (hash, encryptedDescriptors, seedPassword = "") => __awaiter(void 0, void 0, void 0, function* () {

exports.getNewAddress = getNewAddress;
const sendSats = (descriptor, changeDescriptor, address, amount, feeRate) => __awaiter(void 0, void 0, void 0, function* () {
return JSON.parse(yield BMC.send_sats(descriptor, changeDescriptor, address, amount, feeRate));
const sendSats = (descriptor, changeDescriptor, address, amount, broadcast, feeRate) => __awaiter(void 0, void 0, void 0, function* () {
return JSON.parse(yield BMC.send_sats(descriptor, changeDescriptor, address, amount, broadcast, feeRate));
});
exports.sendSats = sendSats;
const fundVault = (descriptor, changeDescriptor, assetAddress1, udaAddress1, feeRate) => __awaiter(void 0, void 0, void 0, function* () {
return JSON.parse(yield BMC.fund_vault(descriptor, changeDescriptor, assetAddress1, udaAddress1, feeRate));
const fundVault = (descriptor, changeDescriptor, rgbAddress, broadcast, feeRate) => __awaiter(void 0, void 0, void 0, function* () {
return JSON.parse(yield BMC.fund_vault(descriptor, changeDescriptor, rgbAddress, broadcast, feeRate));
});
exports.fundVault = fundVault;
const getAssetsVault = (rgbAssetsDescriptorXpub, rgbUdasDescriptorXpub) => __awaiter(void 0, void 0, void 0, function* () {
return JSON.parse(yield BMC.get_assets_vault(rgbAssetsDescriptorXpub, rgbUdasDescriptorXpub));
});
const getAssetsVault = (rgbDescriptorXpub) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.get_assets_vault(rgbDescriptorXpub)); });
exports.getAssetsVault = getAssetsVault;

@@ -71,0 +71,0 @@ const drainWallet = (destination, descriptor, changeDescriptor, feeRate) => __awaiter(void 0, void 0, void 0, function* () {

@@ -10,5 +10,8 @@ // Methods meant to work with BDK defined within the web::bitcoin module from bitmask-core:

hash: string,
encryptedDescriptors: string
encryptedDescriptors: string,
seedPassword = ""
): Promise<Vault> =>
JSON.parse(await BMC.decrypt_wallet(hash, encryptedDescriptors));
JSON.parse(
await BMC.decrypt_wallet(hash, encryptedDescriptors, seedPassword)
);

@@ -55,6 +58,14 @@ export const upgradeWallet = async (

amount: bigint,
broadcast: boolean,
feeRate: number
): Promise<TransactionData> =>
JSON.parse(
await BMC.send_sats(descriptor, changeDescriptor, address, amount, feeRate)
await BMC.send_sats(
descriptor,
changeDescriptor,
address,
amount,
broadcast,
feeRate
)
);

@@ -65,5 +76,5 @@

changeDescriptor: string,
assetAddress1: string,
udaAddress1: string,
feeRate: number
rgbAddress: string,
broadcast: boolean,
feeRate?: number
): Promise<FundVaultDetails> =>

@@ -74,4 +85,4 @@ JSON.parse(

changeDescriptor,
assetAddress1,
udaAddress1,
rgbAddress,
broadcast,
feeRate

@@ -82,8 +93,5 @@ )

export const getAssetsVault = async (
rgbAssetsDescriptorXpub: string,
rgbUdasDescriptorXpub: string
rgbDescriptorXpub: string
): Promise<FundVaultDetails> =>
JSON.parse(
await BMC.get_assets_vault(rgbAssetsDescriptorXpub, rgbUdasDescriptorXpub)
);
JSON.parse(await BMC.get_assets_vault(rgbDescriptorXpub));

@@ -105,3 +113,3 @@ export const drainWallet = async (

descriptor: string,
changeDescriptor?: string,
changeDescriptor?: string
): Promise<TransactionData> =>

@@ -119,4 +127,3 @@ JSON.parse(

btcChangeDescriptorXprv: string;
rgbAssetsDescriptorXprv: string;
rgbUdasDescriptorXprv: string;
rgbDescriptorXprv: string;
nostrPrv: string;

@@ -127,9 +134,6 @@ nostrNsec: string;

export interface PublicWalletData {
xpub: string;
xpubkh: string;
watcherXpub: string;
btcDescriptorXpub: string;
btcChangeDescriptorXpub: string;
rgbAssetsDescriptorXpub: string;
rgbUdasDescriptorXpub: string;
rgbDescriptorXpub: string;
nostrPub: string;

@@ -232,6 +236,6 @@ nostrNpub: string;

export interface FundVaultDetails {
assetsOutput?: string;
udasOutput?: string;
rgbOutput?: string;
isFunded: boolean;
fundTxid: string;
fundTxid?: string;
fundFee?: number;
}

@@ -11,63 +11,59 @@ /* tslint:disable */

export function decode_base64(a: number, b: number, c: number): void;
export function to_contract_amount_string(a: number, b: number, c: number): void;
export function from_contract_amount_string(a: number, b: number): number;
export function format_contract_amount_string(a: number, b: number, c: number, d: number): void;
export function version(): number;
export function get_network(): number;
export function switch_network(a: number, b: number): number;
export function get_env(a: number, b: number): number;
export function set_env(a: number, b: number, c: number, d: number): number;
export function sleep(a: number): number;
export function list_contracts(a: number, b: number, c: number): number;
export function get_contract(a: number, b: number, c: number, d: number): number;
export function import_contract(a: number, b: number, c: number, d: number): number;
export function issue_contract(a: number, b: number, c: number): number;
export function full_issue_contract(a: number, b: number, c: number): number;
export function reissue_contract(a: number, b: number, c: number): number;
export function rgb_create_invoice(a: number, b: number, c: number): number;
export function create_psbt(a: number, b: number, c: number): number;
export function psbt_sign_file(a: number, b: number, c: number): number;
export function psbt_publish_file(a: number, b: number, c: number): number;
export function psbt_sign_and_publish_file(a: number, b: number, c: number): number;
export function transfer_asset(a: number, b: number, c: number): number;
export function full_transfer_asset(a: number, b: number, c: number): number;
export function issue_contract_proxy(a: number, b: number, c: number): number;
export function create_rgb_invoice(a: number, b: number, c: number): number;
export function create_rgb_transfer(a: number, b: number, c: number): number;
export function create_and_publish_rgb_transfer(a: number, b: number, c: number, d: number): number;
export function accept_transfer(a: number, b: number, c: number): number;
export function verify_transfers(a: number, b: number): number;
export function get_contract(a: number, b: number, c: number, d: number): number;
export function hidden_contract(a: number, b: number, c: number, d: number): number;
export function list_contracts(a: number, b: number): number;
export function list_all_contracts(a: number, b: number): number;
export function list_interfaces(a: number, b: number): number;
export function list_schemas(a: number, b: number): number;
export function import_contract(a: number, b: number, c: number): number;
export function create_watcher(a: number, b: number, c: number): number;
export function watcher_details(a: number, b: number, c: number, d: number): number;
export function clear_watcher(a: number, b: number, c: number, d: number): number;
export function watcher_address(a: number, b: number, c: number, d: number, e: number, f: number): number;
export function watcher_utxo(a: number, b: number, c: number, d: number, e: number, f: number): number;
export function watcher_next_address(a: number, b: number, c: number, d: number, e: number, f: number): number;
export function watcher_next_utxo(a: number, b: number, c: number, d: number, e: number, f: number): number;
export function watcher_unspent_utxos(a: number, b: number, c: number, d: number, e: number, f: number): number;
export function list_transfers(a: number, b: number, c: number, d: number): number;
export function save_transfer(a: number, b: number, c: number): number;
export function remove_transfer(a: number, b: number, c: number): number;
export function decode_invoice(a: number, b: number): number;
export function create_offer(a: number, b: number, c: number): number;
export function create_bid(a: number, b: number, c: number): number;
export function update_seller_offer(a: number, b: number, c: number): number;
export function create_swap(a: number, b: number, c: number): number;
export function create_auction_offers(a: number, b: number, c: number): number;
export function create_auction_bid(a: number, b: number, c: number): number;
export function finish_auction_offers(a: number, b: number, c: number): number;
export function list_auctions(): number;
export function direct_swap(a: number, b: number, c: number): number;
export function get_swap(a: number, b: number, c: number): number;
export function public_offers(a: number, b: number): number;
export function my_orders(a: number, b: number): number;
export function my_offers(a: number, b: number): number;
export function my_bids(a: number, b: number): number;
export function import_consignments(a: number): number;
export function get_consignment(a: number, b: number): number;
export function get_media_metadata(a: number, b: number): number;
export function import_uda_data(a: number): number;
export function contract_amount(a: number, b: number): number;
export function contract_amount_str(a: number, b: number, c: number): void;
export function contract_amount_parse_str(a: number, b: number, c: number, d: number): void;
export function contract_amount_parse_value(a: number, b: number, c: number): number;
export function contract_amount_parse_decimal_value(a: number, b: number): number;
export function get_network(): number;
export function switch_network(a: number, b: number): number;
export function get_env(a: number, b: number): number;
export function set_env(a: number, b: number, c: number, d: number): number;
export function sleep(a: number): number;
export function create_hotswap_offer(a: number, b: number, c: number): number;
export function create_hotswap_bid(a: number, b: number, c: number, d: number): number;
export function can_create_p2p_offer(a: number, b: number, c: number, d: number): number;
export function create_p2p_offer(a: number, b: number, c: number, d: number): number;
export function cancel_p2p_offer(a: number, b: number, c: number): number;
export function can_create_p2p_bid(a: number, b: number, c: number, d: number): number;
export function create_p2p_bid(a: number, b: number, c: number, d: number): number;
export function cancel_p2p_bid(a: number, b: number, c: number): number;
export function create_auction_offer(a: number, b: number, c: number, d: number): number;
export function create_auction_bid(a: number, b: number, c: number, d: number): number;
export function close_auction_offer(a: number, b: number, c: number): number;
export function create_airdrop_offer(a: number, b: number, c: number, d: number, e: number, f: number, g: number): number;
export function create_airdrop_bid(a: number, b: number, c: number): number;
export function close_airdrop_offer(a: number, b: number, c: number): number;
export function create_watcher(a: number, b: number, c: number): number;
export function watcher_next_address(a: number, b: number, c: number, d: number): number;
export function watcher_next_utxo(a: number, b: number, c: number, d: number): number;
export function watcher_unspent_utxos(a: number, b: number, c: number, d: number): number;
export function psbt_sign_file(a: number, b: number, c: number): number;
export function decode_invoice(a: number, b: number): number;
export function get_rgb_version(a: number): void;
export function create_wallet(a: number, b: number, c: number, d: number): number;
export function auth(a: number, b: number, c: number, d: number): number;
export function ln_create_invoice(a: number, b: number, c: number, d: number, e: number): number;
export function get_balance(a: number, b: number): number;
export function get_txs(a: number, b: number): number;
export function pay_invoice(a: number, b: number, c: number, d: number): number;
export function check_payment(a: number, b: number): number;
export function swap_btc_ln(a: number, b: number, c: number, d: number): number;
export function swap_ln_btc(a: number, b: number, c: number, d: number, e: number): number;
export function hash_password(a: number, b: number, c: number): void;
export function new_mnemonic(a: number, b: number): number;
export function decrypt_wallet(a: number, b: number, c: number, d: number): number;
export function save_mnemonic(a: number, b: number, c: number, d: number): number;
export function decrypt_wallet(a: number, b: number, c: number, d: number, e: number, f: number): number;
export function upgrade_wallet(a: number, b: number, c: number, d: number, e: number, f: number): number;

@@ -79,16 +75,9 @@ export function new_wallet(a: number, b: number, c: number, d: number): number;

export function get_new_address(a: number, b: number, c: number, d: number): number;
export function send_sats(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number): number;
export function fund_vault(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number): number;
export function get_assets_vault(a: number, b: number, c: number, d: number): number;
export function send_sats(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number): number;
export function fund_vault(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number): number;
export function get_assets_vault(a: number, b: number): number;
export function drain_wallet(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
export function bump_fee(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
export function create_wallet(a: number, b: number, c: number, d: number): number;
export function auth(a: number, b: number, c: number, d: number): number;
export function ln_create_invoice(a: number, b: number, c: number, d: number, e: number): number;
export function get_balance(a: number, b: number): number;
export function get_txs(a: number, b: number): number;
export function pay_invoice(a: number, b: number, c: number, d: number): number;
export function check_payment(a: number, b: number): number;
export function swap_btc_ln(a: number, b: number, c: number, d: number): number;
export function swap_ln_btc(a: number, b: number, c: number, d: number, e: number): number;
export function psbt_sign_and_publish_file(a: number): number;
export function psbt_publish_file(a: number): number;
export function new_nostr_pubkey(a: number, b: number, c: number, d: number): number;

@@ -98,6 +87,2 @@ export function update_nostr_pubkey(a: number, b: number, c: number, d: number): number;

export function rustsecp256k1zkp_v0_8_0_default_error_callback_fn(a: number, b: number): void;
export function rustsecp256k1_v0_9_1_context_create(a: number): number;
export function rustsecp256k1_v0_9_1_context_destroy(a: number): void;
export function rustsecp256k1_v0_9_1_default_illegal_callback_fn(a: number, b: number): void;
export function rustsecp256k1_v0_9_1_default_error_callback_fn(a: number, b: number): void;
export function rustsecp256k1_v0_8_1_context_create(a: number): number;

@@ -107,2 +92,6 @@ export function rustsecp256k1_v0_8_1_context_destroy(a: number): void;

export function rustsecp256k1_v0_8_1_default_error_callback_fn(a: number, b: number): void;
export function rustsecp256k1_v0_9_2_context_create(a: number): number;
export function rustsecp256k1_v0_9_2_context_destroy(a: number): void;
export function rustsecp256k1_v0_9_2_default_illegal_callback_fn(a: number, b: number): void;
export function rustsecp256k1_v0_9_2_default_error_callback_fn(a: number, b: number): void;
export function rustsecp256k1_v0_6_1_context_create(a: number): number;

@@ -115,6 +104,6 @@ export function rustsecp256k1_v0_6_1_context_destroy(a: number): void;

export const __wbindgen_export_2: WebAssembly.Table;
export function wasm_bindgen__convert__closures__invoke1_mut__ha65aecfe26cc1287(a: number, b: number, c: number): void;
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9234ceb3441bf402(a: number, b: number, c: number): void;
export function __wbindgen_add_to_stack_pointer(a: number): number;
export function __wbindgen_free(a: number, b: number, c: number): void;
export function __wbindgen_exn_store(a: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h4727315c59e6849d(a: number, b: number, c: number, d: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h2d80d82348cfb857(a: number, b: number, c: number, d: number): void;

@@ -45,110 +45,107 @@ /* tslint:disable */

/**
* @param {string} nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
* @param {bigint} amount
* @param {number} precision
* @returns {string}
*/
export function issue_contract(nostr_hex_sk: string, request: any): Promise<any>;
export function to_contract_amount_string(amount: bigint, precision: number): string;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
* @param {string} amount
* @returns {any}
*/
export function full_issue_contract(nostr_hex_sk: string, request: any): Promise<any>;
export function from_contract_amount_string(amount: string): any;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
* @param {string} amount
* @param {number} precision
* @returns {string}
*/
export function reissue_contract(nostr_hex_sk: string, request: any): Promise<any>;
export function format_contract_amount_string(amount: string, precision: number): string;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
* @returns {any}
*/
export function rgb_create_invoice(nostr_hex_sk: string, request: any): Promise<any>;
export function version(): any;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
*/
export function create_psbt(nostr_hex_sk: string, request: any): Promise<any>;
export function get_network(): Promise<any>;
/**
* @param {string} _nostr_hex_sk
* @param {any} request
* @param {string} network_str
* @returns {Promise<any>}
*/
export function psbt_sign_file(_nostr_hex_sk: string, request: any): Promise<any>;
export function switch_network(network_str: string): Promise<any>;
/**
* @param {string} _nostr_hex_sk
* @param {any} request
* @param {string} key
* @returns {Promise<any>}
*/
export function psbt_publish_file(_nostr_hex_sk: string, request: any): Promise<any>;
export function get_env(key: string): Promise<any>;
/**
* @param {string} _nostr_hex_sk
* @param {any} request
* @param {string} key
* @param {string} value
* @returns {Promise<any>}
*/
export function psbt_sign_and_publish_file(_nostr_hex_sk: string, request: any): Promise<any>;
export function set_env(key: string, value: string): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @param {number} ms
* @returns {Promise<any>}
*/
export function transfer_asset(nostr_hex_sk: string, request: any): Promise<any>;
export function sleep(ms: number): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @param {boolean} hidden
* @returns {Promise<any>}
*/
export function full_transfer_asset(nostr_hex_sk: string, request: any): Promise<any>;
export function list_contracts(nostr_hex_sk: string, hidden: boolean): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @param {string} request
* @returns {Promise<any>}
*/
export function accept_transfer(nostr_hex_sk: string, request: any): Promise<any>;
export function get_contract(nostr_hex_sk: string, request: string): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} request
* @returns {Promise<any>}
*/
export function verify_transfers(nostr_hex_sk: string): Promise<any>;
export function import_contract(nostr_hex_sk: string, request: string): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} contract_id
* @param {any} request
* @returns {Promise<any>}
*/
export function get_contract(nostr_hex_sk: string, contract_id: string): Promise<any>;
export function issue_contract(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} contract_id
* @param {any} request
* @returns {Promise<any>}
*/
export function hidden_contract(nostr_hex_sk: string, contract_id: string): Promise<any>;
export function issue_contract_proxy(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
*/
export function list_contracts(nostr_hex_sk: string): Promise<any>;
export function create_rgb_invoice(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
*/
export function list_all_contracts(nostr_hex_sk: string): Promise<any>;
export function create_rgb_transfer(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @param {any} secrets
* @returns {Promise<any>}
*/
export function list_interfaces(nostr_hex_sk: string): Promise<any>;
export function create_and_publish_rgb_transfer(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
*/
export function list_schemas(nostr_hex_sk: string): Promise<any>;
export function accept_transfer(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
*/
export function import_contract(nostr_hex_sk: string, request: any): Promise<any>;
export function verify_transfers(nostr_hex_sk: string): Promise<any>;
/**

@@ -159,74 +156,66 @@ * @param {string} nostr_hex_sk

*/
export function create_watcher(nostr_hex_sk: string, request: any): Promise<any>;
export function get_swap(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} name
* @returns {Promise<any>}
*/
export function watcher_details(nostr_hex_sk: string, name: string): Promise<any>;
export function public_offers(nostr_hex_sk: string): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} name
* @returns {Promise<any>}
*/
export function clear_watcher(nostr_hex_sk: string, name: string): Promise<any>;
export function my_offers(nostr_hex_sk: string): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} name
* @param {string} address
* @returns {Promise<any>}
*/
export function watcher_address(nostr_hex_sk: string, name: string, address: string): Promise<any>;
export function my_bids(nostr_hex_sk: string): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} name
* @param {string} utxo
* @param {any} request
* @returns {Promise<any>}
*/
export function watcher_utxo(nostr_hex_sk: string, name: string, utxo: string): Promise<any>;
export function create_hotswap_offer(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} name
* @param {string} iface
* @param {any} request
* @param {any} secrets
* @returns {Promise<any>}
*/
export function watcher_next_address(nostr_hex_sk: string, name: string, iface: string): Promise<any>;
export function create_hotswap_bid(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} name
* @param {string} iface
* @param {any} request
* @param {any} secrets
* @returns {Promise<any>}
*/
export function watcher_next_utxo(nostr_hex_sk: string, name: string, iface: string): Promise<any>;
export function can_create_p2p_offer(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} name
* @param {string} iface
* @param {any} request
* @param {any} secrets
* @returns {Promise<any>}
*/
export function watcher_unspent_utxos(nostr_hex_sk: string, name: string, iface: string): Promise<any>;
export function create_p2p_offer(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} contract_id
* @param {any} request
* @returns {Promise<any>}
*/
export function list_transfers(nostr_hex_sk: string, contract_id: string): Promise<any>;
export function cancel_p2p_offer(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @param {any} secrets
* @returns {Promise<any>}
*/
export function save_transfer(nostr_hex_sk: string, request: any): Promise<any>;
export function can_create_p2p_bid(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @param {any} secrets
* @returns {Promise<any>}
*/
export function remove_transfer(nostr_hex_sk: string, request: any): Promise<any>;
export function create_p2p_bid(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
/**
* @param {string} invoice
* @returns {Promise<any>}
*/
export function decode_invoice(invoice: string): Promise<any>;
/**
* @param {string} nostr_hex_sk

@@ -236,15 +225,17 @@ * @param {any} request

*/
export function create_offer(nostr_hex_sk: string, request: any): Promise<any>;
export function cancel_p2p_bid(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @param {any} secrets
* @returns {Promise<any>}
*/
export function create_bid(nostr_hex_sk: string, request: any): Promise<any>;
export function create_auction_offer(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @param {any} secrets
* @returns {Promise<any>}
*/
export function update_seller_offer(nostr_hex_sk: string, request: any): Promise<any>;
export function create_auction_bid(nostr_hex_sk: string, request: any, secrets: any): Promise<any>;
/**

@@ -255,9 +246,12 @@ * @param {string} nostr_hex_sk

*/
export function create_swap(nostr_hex_sk: string, request: any): Promise<any>;
export function close_auction_offer(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {any} request
* @param {any} secrets
* @param {bigint} fee
* @param {string} max_claim
* @returns {Promise<any>}
*/
export function create_auction_offers(nostr_hex_sk: string, request: any): Promise<any>;
export function create_airdrop_offer(nostr_hex_sk: string, request: any, secrets: any, fee: bigint, max_claim: string): Promise<any>;
/**

@@ -268,3 +262,3 @@ * @param {string} nostr_hex_sk

*/
export function create_auction_bid(nostr_hex_sk: string, request: any): Promise<any>;
export function create_airdrop_bid(nostr_hex_sk: string, request: any): Promise<any>;
/**

@@ -275,8 +269,4 @@ * @param {string} nostr_hex_sk

*/
export function finish_auction_offers(nostr_hex_sk: string, request: any): Promise<any>;
export function close_airdrop_offer(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @returns {Promise<any>}
*/
export function list_auctions(): Promise<any>;
/**
* @param {string} nostr_hex_sk

@@ -286,97 +276,89 @@ * @param {any} request

*/
export function direct_swap(nostr_hex_sk: string, request: any): Promise<any>;
export function create_watcher(nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} request
* @returns {Promise<any>}
*/
export function public_offers(nostr_hex_sk: string): Promise<any>;
export function watcher_next_address(nostr_hex_sk: string, request: string): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} request
* @returns {Promise<any>}
*/
export function my_orders(nostr_hex_sk: string): Promise<any>;
export function watcher_next_utxo(nostr_hex_sk: string, request: string): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} request
* @returns {Promise<any>}
*/
export function my_offers(nostr_hex_sk: string): Promise<any>;
export function watcher_unspent_utxos(nostr_hex_sk: string, request: string): Promise<any>;
/**
* @param {string} nostr_hex_sk
* @param {string} _nostr_hex_sk
* @param {any} request
* @returns {Promise<any>}
*/
export function my_bids(nostr_hex_sk: string): Promise<any>;
export function psbt_sign_file(_nostr_hex_sk: string, request: any): Promise<any>;
/**
* @param {any} request
* @param {string} invoice
* @returns {Promise<any>}
*/
export function import_consignments(request: any): Promise<any>;
export function decode_invoice(invoice: string): Promise<any>;
/**
* @param {string} consig_or_receipt_id
* @returns {Promise<any>}
* @returns {string}
*/
export function get_consignment(consig_or_receipt_id: string): Promise<any>;
export function get_rgb_version(): string;
/**
* @param {string} media_id
* @param {string} username
* @param {string} password
* @returns {Promise<any>}
*/
export function get_media_metadata(media_id: string): Promise<any>;
export function create_wallet(username: string, password: string): Promise<any>;
/**
* @param {any} request
* @param {string} username
* @param {string} password
* @returns {Promise<any>}
*/
export function import_uda_data(request: any): Promise<any>;
export function auth(username: string, password: string): Promise<any>;
/**
* @param {bigint} amount
* @param {number} precision
* @returns {bigint}
* @param {string} description
* @param {number} amount
* @param {string} token
* @returns {Promise<any>}
*/
export function contract_amount(amount: bigint, precision: number): bigint;
export function ln_create_invoice(description: string, amount: number, token: string): Promise<any>;
/**
* @param {bigint} amount
* @param {number} precision
* @returns {string}
* @param {string} token
* @returns {Promise<any>}
*/
export function contract_amount_str(amount: bigint, precision: number): string;
export function get_balance(token: string): Promise<any>;
/**
* @param {string} amount
* @param {number} precision
* @returns {string}
*/
export function contract_amount_parse_str(amount: string, precision: number): string;
/**
* @param {string} amount
* @param {number} precision
* @returns {bigint}
*/
export function contract_amount_parse_value(amount: string, precision: number): bigint;
/**
* @param {string} amount
* @returns {bigint}
*/
export function contract_amount_parse_decimal_value(amount: string): bigint;
/**
* @param {string} token
* @returns {Promise<any>}
*/
export function get_network(): Promise<any>;
export function get_txs(token: string): Promise<any>;
/**
* @param {string} network_str
* @param {string} payment_request
* @param {string} token
* @returns {Promise<any>}
*/
export function switch_network(network_str: string): Promise<any>;
export function pay_invoice(payment_request: string, token: string): Promise<any>;
/**
* @param {string} key
* @param {string} payment_hash
* @returns {Promise<any>}
*/
export function get_env(key: string): Promise<any>;
export function check_payment(payment_hash: string): Promise<any>;
/**
* @param {string} key
* @param {string} value
* @param {string} token
* @param {string | undefined} [ln_address]
* @returns {Promise<any>}
*/
export function set_env(key: string, value: string): Promise<any>;
export function swap_btc_ln(token: string, ln_address?: string): Promise<any>;
/**
* @param {number} ms
* @param {string} address
* @param {bigint} amount
* @param {string} token
* @returns {Promise<any>}
*/
export function sleep(ms: number): Promise<any>;
export function swap_ln_btc(address: string, amount: bigint, token: string): Promise<any>;
/**

@@ -393,7 +375,14 @@ * @param {string} password

/**
* @param {string} seed
* @param {string} password
* @returns {Promise<any>}
*/
export function save_mnemonic(seed: string, password: string): Promise<any>;
/**
* @param {string} hash
* @param {string} encrypted_descriptors
* @param {string} seed_password
* @returns {Promise<any>}
*/
export function decrypt_wallet(hash: string, encrypted_descriptors: string): Promise<any>;
export function decrypt_wallet(hash: string, encrypted_descriptors: string, seed_password: string): Promise<any>;
/**

@@ -440,21 +429,21 @@ * @param {string} hash

* @param {bigint} amount
* @param {boolean} broadcast
* @param {number | undefined} [fee_rate]
* @returns {Promise<any>}
*/
export function send_sats(descriptor: string, change_descriptor: string, destination: string, amount: bigint, fee_rate?: number): Promise<any>;
export function send_sats(descriptor: string, change_descriptor: string, destination: string, amount: bigint, broadcast: boolean, fee_rate?: number): Promise<any>;
/**
* @param {string} descriptor
* @param {string} change_descriptor
* @param {string} asset_address
* @param {string} uda_address
* @param {string} rgb_address
* @param {boolean} broadcast
* @param {number | undefined} [fee_rate]
* @returns {Promise<any>}
*/
export function fund_vault(descriptor: string, change_descriptor: string, asset_address: string, uda_address: string, fee_rate?: number): Promise<any>;
export function fund_vault(descriptor: string, change_descriptor: string, rgb_address: string, broadcast: boolean, fee_rate?: number): Promise<any>;
/**
* @param {string} rgb_assets_descriptor_xpub
* @param {string} rgb_udas_descriptor_xpub
* @param {string} rgb_descriptor_xpub
* @returns {Promise<any>}
*/
export function get_assets_vault(rgb_assets_descriptor_xpub: string, rgb_udas_descriptor_xpub: string): Promise<any>;
export function get_assets_vault(rgb_descriptor_xpub: string): Promise<any>;
/**

@@ -478,55 +467,12 @@ * @param {string} destination

/**
* @param {string} username
* @param {string} password
* @param {any} request
* @returns {Promise<any>}
*/
export function create_wallet(username: string, password: string): Promise<any>;
export function psbt_sign_and_publish_file(request: any): Promise<any>;
/**
* @param {string} username
* @param {string} password
* @param {any} request
* @returns {Promise<any>}
*/
export function auth(username: string, password: string): Promise<any>;
export function psbt_publish_file(request: any): Promise<any>;
/**
* @param {string} description
* @param {number} amount
* @param {string} token
* @returns {Promise<any>}
*/
export function ln_create_invoice(description: string, amount: number, token: string): Promise<any>;
/**
* @param {string} token
* @returns {Promise<any>}
*/
export function get_balance(token: string): Promise<any>;
/**
* @param {string} token
* @returns {Promise<any>}
*/
export function get_txs(token: string): Promise<any>;
/**
* @param {string} payment_request
* @param {string} token
* @returns {Promise<any>}
*/
export function pay_invoice(payment_request: string, token: string): Promise<any>;
/**
* @param {string} payment_hash
* @returns {Promise<any>}
*/
export function check_payment(payment_hash: string): Promise<any>;
/**
* @param {string} token
* @param {string | undefined} [ln_address]
* @returns {Promise<any>}
*/
export function swap_btc_ln(token: string, ln_address?: string): Promise<any>;
/**
* @param {string} address
* @param {bigint} amount
* @param {string} token
* @returns {Promise<any>}
*/
export function swap_ln_btc(address: string, amount: bigint, token: string): Promise<any>;
/**
* @param {string} pubkey

@@ -555,63 +501,59 @@ * @param {string} token

readonly decode_base64: (a: number, b: number, c: number) => void;
readonly to_contract_amount_string: (a: number, b: number, c: number) => void;
readonly from_contract_amount_string: (a: number, b: number) => number;
readonly format_contract_amount_string: (a: number, b: number, c: number, d: number) => void;
readonly version: () => number;
readonly get_network: () => number;
readonly switch_network: (a: number, b: number) => number;
readonly get_env: (a: number, b: number) => number;
readonly set_env: (a: number, b: number, c: number, d: number) => number;
readonly sleep: (a: number) => number;
readonly list_contracts: (a: number, b: number, c: number) => number;
readonly get_contract: (a: number, b: number, c: number, d: number) => number;
readonly import_contract: (a: number, b: number, c: number, d: number) => number;
readonly issue_contract: (a: number, b: number, c: number) => number;
readonly full_issue_contract: (a: number, b: number, c: number) => number;
readonly reissue_contract: (a: number, b: number, c: number) => number;
readonly rgb_create_invoice: (a: number, b: number, c: number) => number;
readonly create_psbt: (a: number, b: number, c: number) => number;
readonly psbt_sign_file: (a: number, b: number, c: number) => number;
readonly psbt_publish_file: (a: number, b: number, c: number) => number;
readonly psbt_sign_and_publish_file: (a: number, b: number, c: number) => number;
readonly transfer_asset: (a: number, b: number, c: number) => number;
readonly full_transfer_asset: (a: number, b: number, c: number) => number;
readonly issue_contract_proxy: (a: number, b: number, c: number) => number;
readonly create_rgb_invoice: (a: number, b: number, c: number) => number;
readonly create_rgb_transfer: (a: number, b: number, c: number) => number;
readonly create_and_publish_rgb_transfer: (a: number, b: number, c: number, d: number) => number;
readonly accept_transfer: (a: number, b: number, c: number) => number;
readonly verify_transfers: (a: number, b: number) => number;
readonly get_contract: (a: number, b: number, c: number, d: number) => number;
readonly hidden_contract: (a: number, b: number, c: number, d: number) => number;
readonly list_contracts: (a: number, b: number) => number;
readonly list_all_contracts: (a: number, b: number) => number;
readonly list_interfaces: (a: number, b: number) => number;
readonly list_schemas: (a: number, b: number) => number;
readonly import_contract: (a: number, b: number, c: number) => number;
readonly create_watcher: (a: number, b: number, c: number) => number;
readonly watcher_details: (a: number, b: number, c: number, d: number) => number;
readonly clear_watcher: (a: number, b: number, c: number, d: number) => number;
readonly watcher_address: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
readonly watcher_utxo: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
readonly watcher_next_address: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
readonly watcher_next_utxo: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
readonly watcher_unspent_utxos: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
readonly list_transfers: (a: number, b: number, c: number, d: number) => number;
readonly save_transfer: (a: number, b: number, c: number) => number;
readonly remove_transfer: (a: number, b: number, c: number) => number;
readonly decode_invoice: (a: number, b: number) => number;
readonly create_offer: (a: number, b: number, c: number) => number;
readonly create_bid: (a: number, b: number, c: number) => number;
readonly update_seller_offer: (a: number, b: number, c: number) => number;
readonly create_swap: (a: number, b: number, c: number) => number;
readonly create_auction_offers: (a: number, b: number, c: number) => number;
readonly create_auction_bid: (a: number, b: number, c: number) => number;
readonly finish_auction_offers: (a: number, b: number, c: number) => number;
readonly list_auctions: () => number;
readonly direct_swap: (a: number, b: number, c: number) => number;
readonly get_swap: (a: number, b: number, c: number) => number;
readonly public_offers: (a: number, b: number) => number;
readonly my_orders: (a: number, b: number) => number;
readonly my_offers: (a: number, b: number) => number;
readonly my_bids: (a: number, b: number) => number;
readonly import_consignments: (a: number) => number;
readonly get_consignment: (a: number, b: number) => number;
readonly get_media_metadata: (a: number, b: number) => number;
readonly import_uda_data: (a: number) => number;
readonly contract_amount: (a: number, b: number) => number;
readonly contract_amount_str: (a: number, b: number, c: number) => void;
readonly contract_amount_parse_str: (a: number, b: number, c: number, d: number) => void;
readonly contract_amount_parse_value: (a: number, b: number, c: number) => number;
readonly contract_amount_parse_decimal_value: (a: number, b: number) => number;
readonly get_network: () => number;
readonly switch_network: (a: number, b: number) => number;
readonly get_env: (a: number, b: number) => number;
readonly set_env: (a: number, b: number, c: number, d: number) => number;
readonly sleep: (a: number) => number;
readonly create_hotswap_offer: (a: number, b: number, c: number) => number;
readonly create_hotswap_bid: (a: number, b: number, c: number, d: number) => number;
readonly can_create_p2p_offer: (a: number, b: number, c: number, d: number) => number;
readonly create_p2p_offer: (a: number, b: number, c: number, d: number) => number;
readonly cancel_p2p_offer: (a: number, b: number, c: number) => number;
readonly can_create_p2p_bid: (a: number, b: number, c: number, d: number) => number;
readonly create_p2p_bid: (a: number, b: number, c: number, d: number) => number;
readonly cancel_p2p_bid: (a: number, b: number, c: number) => number;
readonly create_auction_offer: (a: number, b: number, c: number, d: number) => number;
readonly create_auction_bid: (a: number, b: number, c: number, d: number) => number;
readonly close_auction_offer: (a: number, b: number, c: number) => number;
readonly create_airdrop_offer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
readonly create_airdrop_bid: (a: number, b: number, c: number) => number;
readonly close_airdrop_offer: (a: number, b: number, c: number) => number;
readonly create_watcher: (a: number, b: number, c: number) => number;
readonly watcher_next_address: (a: number, b: number, c: number, d: number) => number;
readonly watcher_next_utxo: (a: number, b: number, c: number, d: number) => number;
readonly watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => number;
readonly psbt_sign_file: (a: number, b: number, c: number) => number;
readonly decode_invoice: (a: number, b: number) => number;
readonly get_rgb_version: (a: number) => void;
readonly create_wallet: (a: number, b: number, c: number, d: number) => number;
readonly auth: (a: number, b: number, c: number, d: number) => number;
readonly ln_create_invoice: (a: number, b: number, c: number, d: number, e: number) => number;
readonly get_balance: (a: number, b: number) => number;
readonly get_txs: (a: number, b: number) => number;
readonly pay_invoice: (a: number, b: number, c: number, d: number) => number;
readonly check_payment: (a: number, b: number) => number;
readonly swap_btc_ln: (a: number, b: number, c: number, d: number) => number;
readonly swap_ln_btc: (a: number, b: number, c: number, d: number, e: number) => number;
readonly hash_password: (a: number, b: number, c: number) => void;
readonly new_mnemonic: (a: number, b: number) => number;
readonly decrypt_wallet: (a: number, b: number, c: number, d: number) => number;
readonly save_mnemonic: (a: number, b: number, c: number, d: number) => number;
readonly decrypt_wallet: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
readonly upgrade_wallet: (a: number, b: number, c: number, d: number, e: number, f: number) => number;

@@ -623,16 +565,9 @@ readonly new_wallet: (a: number, b: number, c: number, d: number) => number;

readonly get_new_address: (a: number, b: number, c: number, d: number) => number;
readonly send_sats: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
readonly fund_vault: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
readonly get_assets_vault: (a: number, b: number, c: number, d: number) => number;
readonly send_sats: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
readonly fund_vault: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
readonly get_assets_vault: (a: number, b: number) => number;
readonly drain_wallet: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
readonly bump_fee: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
readonly create_wallet: (a: number, b: number, c: number, d: number) => number;
readonly auth: (a: number, b: number, c: number, d: number) => number;
readonly ln_create_invoice: (a: number, b: number, c: number, d: number, e: number) => number;
readonly get_balance: (a: number, b: number) => number;
readonly get_txs: (a: number, b: number) => number;
readonly pay_invoice: (a: number, b: number, c: number, d: number) => number;
readonly check_payment: (a: number, b: number) => number;
readonly swap_btc_ln: (a: number, b: number, c: number, d: number) => number;
readonly swap_ln_btc: (a: number, b: number, c: number, d: number, e: number) => number;
readonly psbt_sign_and_publish_file: (a: number) => number;
readonly psbt_publish_file: (a: number) => number;
readonly new_nostr_pubkey: (a: number, b: number, c: number, d: number) => number;

@@ -642,6 +577,2 @@ readonly update_nostr_pubkey: (a: number, b: number, c: number, d: number) => number;

readonly rustsecp256k1zkp_v0_8_0_default_error_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_9_1_context_create: (a: number) => number;
readonly rustsecp256k1_v0_9_1_context_destroy: (a: number) => void;
readonly rustsecp256k1_v0_9_1_default_illegal_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_9_1_default_error_callback_fn: (a: number, b: number) => void;
readonly rustsecp256k1_v0_8_1_context_create: (a: number) => number;

@@ -651,2 +582,6 @@ readonly rustsecp256k1_v0_8_1_context_destroy: (a: number) => void;

readonly rustsecp256k1_v0_8_1_default_error_callback_fn: (a: number, b: number) => void;
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_6_1_context_create: (a: number) => number;

@@ -659,7 +594,7 @@ readonly rustsecp256k1_v0_6_1_context_destroy: (a: number) => void;

readonly __wbindgen_export_2: WebAssembly.Table;
readonly wasm_bindgen__convert__closures__invoke1_mut__ha65aecfe26cc1287: (a: number, b: number, c: number) => void;
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9234ceb3441bf402: (a: number, b: number, c: number) => void;
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_exn_store: (a: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h4727315c59e6849d: (a: number, b: number, c: number, d: number) => void;
readonly wasm_bindgen__convert__closures__invoke2_mut__h2d80d82348cfb857: (a: number, b: number, c: number, d: number) => void;
}

@@ -666,0 +601,0 @@

@@ -88,2 +88,5 @@ "use strict";

}
if (process.env.BITCOIN_EXPLORER_API_TESTNET) {
yield (0, exports.setEnv)("BITCOIN_EXPLORER_API_TESTNET", process.env.BITCOIN_EXPLORER_API_TESTNET);
}
}

@@ -97,5 +100,7 @@ catch (err) {

try {
yield fetch(`${lndhubx}/nodeinfo`);
exports.LNDHUBX = true;
console.debug(`${lndhubx}/nodeinfo successfully reached`);
if (!exports.DISABLE_LN) {
yield fetch(`${lndhubx}/nodeinfo`);
exports.LNDHUBX = true;
console.debug(`${lndhubx}/nodeinfo successfully reached`);
}
}

@@ -124,2 +129,3 @@ catch (e) {

}
console.debug(BMC.version(), "initialized");
console.debug("Using LNDHubX endpoint:", lndhubx);

@@ -126,0 +132,0 @@ console.debug("Using Carbonado endpoint:", carbonado);

@@ -66,2 +66,8 @@ // Methods meant to work with bitmask-core constants defined within the web::constants module from bitmask-core:

}
if (process.env.BITCOIN_EXPLORER_API_TESTNET) {
await setEnv(
"BITCOIN_EXPLORER_API_TESTNET",
process.env.BITCOIN_EXPLORER_API_TESTNET
);
}
} catch (err) {

@@ -76,5 +82,7 @@ console.error("Error in setEnv", err);

try {
await fetch(`${lndhubx}/nodeinfo`);
LNDHUBX = true;
console.debug(`${lndhubx}/nodeinfo successfully reached`);
if (!DISABLE_LN) {
await fetch(`${lndhubx}/nodeinfo`);
LNDHUBX = true;
console.debug(`${lndhubx}/nodeinfo successfully reached`);
}
} catch (e) {

@@ -101,2 +109,3 @@ LNDHUBX = false;

console.debug(BMC.version(), "initialized");
console.debug("Using LNDHubX endpoint:", lndhubx);

@@ -103,0 +112,0 @@ console.debug("Using Carbonado endpoint:", carbonado);

@@ -6,6 +6,7 @@ {

"Hunter Trujillo <hunter@diba.io>",
"Francisco Calderón <francisco@diba.io>"
"Francisco Calderón <francisco@diba.io>",
"Armando Dutra <armando@diba.io>"
],
"description": "Core functionality for the BitMask wallet",
"version": "0.7.0-beta.11",
"version": "0.7.0-rc.22",
"license": "MIT",

@@ -12,0 +13,0 @@ "repository": {

# BitMask Core
Core functionality for the BitMask wallet - <https://bitmask.app>

@@ -63,19 +64,17 @@

1. Build bitcoin node + electrum: `docker-compose build`.
2. Up and running Docker containers: `docker-compose up -d node1 bitmaskd`.
3. Load the command line: `source .commands`
4. Download and install BDK cli: `cargo install bdk-cli`. We will use BDK to generate the mnemonic.
5. Generate a new mnemonic: `bdk-cli generate`.
1. Load the command line: `source .commands` or if using fish shell, `bass source .commands`
2. Build bitcoin node + electrum: `docker-compose build`.
3. Up and running Docker containers: `docker-compose up -d bitcoin1 electrs carbonado rgb-proxy`.
4. Download and install BDK cli: `cargo install bdk-cli` (We will use BDK to generate the mnemonic).
5. Generate a new mnemonic: `bdk-cli key generate`.
6. Create an environment variable called **TEST_WALLET_SEED** with mnemonic generated in the **step 5** (only wasm32).
7. Run the test to get main address for bitcoin and rgb: `cargo test --test wallet -- create_wallet --exact`.
8. Load your wallet in the bitcoin node: `node1 loadwallet default`.
9. Generate new first 500 blocks: `node1 -generate 500`.
10. Send some coins to the main wallet address: `node1 sendtoaddress {MAIN_VAULT_ADDRESS} 10`. Change `{MAIN_VAULT_ADDRESS}` with the address generated in the **step 7**.
11. Send some coins to the rgb wallet address: `node1 sendtoaddress {RGB_VAULT_ADDRESS} 10`. Change `{RGB_VAULT_ADDRESS}` with the address generated in the **step 7**.
12. Mine a new block: `node1 -generate 1`
13. Run the test to check the balance: `cargo test --test wallet -- get_wallet_balance --exact`.
7. Run the test to get regtest address for bitcoin and rgb: `cargo test --test wallet -- create_wallet --exact --nocapture`.
8. Load your wallet in the bitcoin node: `bc1 loadwallet default`, or if using a new wallet, `bc1 createwallet default`.
9. Generate new first 500 blocks: `bc1 -generate 500`.
10. Send some coins to the main wallet address: `bc1 sendtoaddress {MAIN_VAULT_ADDRESS} 10`. Change `{MAIN_VAULT_ADDRESS}` with the address generated in the **step 7**.
11. Mine a new block: `bc1 -generate 1`
### Running the tests
Running the tests: `cargo test --test-threads 1`
Running the tests: `cargo test -- --test-threads 1`

@@ -88,6 +87,6 @@ ### Troubleshooting

Check if your wallet is loaded. For that, run the command `node1 loadwallet default`.
Check if your wallet is loaded. For that, run the command `bitcoin1 loadwallet default`.
**B.The electrs node does not work?**
To stop the electrs freeze, run `node1 -generate`.
To stop the electrs freeze, run `bitcoin1 -generate`.

@@ -1,107 +0,71 @@

export declare const fullIssueContract: (nostrHexSk: string, request: FullIssueRequest) => Promise<IssueResponse>;
export declare const createInvoice: (nostrHexSk: string, request: InvoiceRequest) => Promise<InvoiceResponse>;
export declare const createPsbt: (nostrHexSk: string, request: PsbtRequest) => Promise<PsbtResponse>;
export declare const psbtSignFile: (nostrHexSk: string, request: SignPsbtRequest) => Promise<SignedPsbtResponse>;
export declare const psbtSignAndPublishFile: (nostrHexSk: string, request: SignPsbtRequest) => Promise<SignedPsbtResponse>;
export declare const transferAsset: (nostrHexSk: string, request: RgbTransferRequest) => Promise<RgbTransferResponse>;
export declare const fullTransferAsset: (nostrHexSk: string, request: FullRgbTransferRequest) => Promise<RgbTransferResponse>;
export declare const importContract: (nostrHexSk: string, request: ImportRequest) => Promise<ImportResponse>;
export declare const importContract: (nostrHexSk: string, request: string) => Promise<ContractResponse>;
export declare const listContracts: (nostrHexSk: string, hidden: boolean) => Promise<ListContractsResponse>;
export declare const getContract: (nostrHexSk: string, request: string) => Promise<ContractResponse>;
export declare const issueContract: (nostrHexSk: string, request: IssueRequest) => Promise<IssueResponse>;
export declare const createInvoice: (nostrHexSk: string, request: RgbInvoiceRequest) => Promise<RgbInvoiceResponse>;
export declare const createTransfer: (nostrHexSk: string, request: RgbTransferRequest) => Promise<RgbTransferResponse>;
export declare const createAndPublishTransfer: (nostrHexSk: string, request: RgbTransferRequest, secrets: string[]) => Promise<RgbTransferResponse>;
export declare const acceptTransfer: (nostrHexSk: string, request: AcceptRequest) => Promise<AcceptResponse>;
export declare const listContracts: (nostrHexSk: string) => Promise<ContractsResponse>;
export declare const hideContract: (nostrHexSk: string, contractId: string) => Promise<ContractHiddenResponse>;
export declare const listInterfaces: (nostrHexSk: string) => Promise<InterfacesResponse>;
export declare const listSchemas: (nostrHexSk: string) => Promise<SchemasResponse>;
export declare const verifyTransfers: (nostrHexSk: string) => Promise<ListTransfersResponse>;
export declare const createWatcher: (nostrHexSk: string, request: WatcherRequest) => Promise<WatcherResponse>;
export declare const watcherDetails: (nostrHexSk: string, name: string) => Promise<WatcherDetailResponse>;
export declare const watcherNextAddress: (nostrHexSk: string, name: string, iface: string) => Promise<NextAddressResponse>;
export declare const watcherNextUtxo: (nostrHexSk: string, name: string, iface: string) => Promise<NextUtxoResponse>;
export declare const watcherUnspentUtxos: (nostrHexSk: string, name: string, iface: string) => Promise<NextUtxosResponse>;
export declare const watcherAddress: (nostrHexSk: string, name: string, address: string) => Promise<WatcherUtxoResponse>;
export declare const watcherUtxo: (nostrHexSk: string, name: string, utxo: string) => Promise<WatcherUtxoResponse>;
export declare const listTransfers: (nostrHexSk: string, contractId: string) => Promise<RgbTransfersResponse>;
export declare const saveTransfer: (nostrHexSk: string, request: RgbSaveTransferRequest) => Promise<RgbTransferStatusResponse>;
export declare const removeTransfer: (nostrHexSk: string, request: RgbRemoveTransferRequest) => Promise<RgbTransferStatusResponse>;
export declare const verifyTransfers: (nostrHexSk: string) => Promise<BatchRgbTransferResponse>;
export declare const decodeInvoice: (invoice: string) => Promise<RgbInvoiceResponse>;
export declare const createOffer: (nostrHexSk: string, request: RgbOfferRequest) => Promise<RgbOfferResponse>;
export declare const createBid: (nostrHexSk: string, request: RgbBidRequest) => Promise<RgbBidResponse>;
export declare const createSwap: (nostrHexSk: string, request: RgbSwapRequest) => Promise<RgbSwapResponse>;
export declare const createAuctionOffer: (nostrHexSk: string, request: RgbAuctionOfferRequest) => Promise<RgbAuctionBidResponse>;
export declare const createAuctionBid: (nostrHexSk: string, request: RgbAuctionBidRequest) => Promise<RgbAuctionBidResponse>;
export declare const finishAuction: (nostrHexSk: string, request: string) => Promise<RgbAuctionOfferResponse[]>;
export declare const listAuctions: () => Promise<RgbOffersResponse>;
export declare const directSwap: (nostrHexSk: string, request: RgbBidRequest) => Promise<RgbSwapResponse>;
export declare const publicOffers: (nostrHexSk: string) => Promise<PublicRgbOffersResponse>;
export declare const myOrders: (nostrHexSk: string) => Promise<RgbOfferBidsResponse>;
export declare const myOffers: (nostrHexSk: string) => Promise<RgbOffersResponse>;
export declare const myBids: (nostrHexSk: string) => Promise<RgbBidsResponse>;
export declare const importConsignments: (request: ImportConsignmentsRequest) => Promise<boolean>;
export declare const getConsignment: (consigOrReceiptId: string) => Promise<string>;
export declare const importUdaData: (request: MediaRequest) => Promise<boolean>;
export declare const getMedia: (mediaId: string) => Promise<MediaMetadata>;
export declare const contractAmount: (amount: bigint, precision: number) => bigint;
export declare const contractAmountStr: (amount: bigint, precision: number) => String;
export declare const contractAmountParseStr: (amount: string, precision: number) => String;
export declare const contractAmountParseValue: (amount: string, precision: number) => bigint;
export declare const contractDecimalParseValue: (amount: string) => bigint;
export interface ContractFormats {
legacy: string;
strict: string;
armored: string;
export declare const nextAddress: (nostrHexSk: string, request: string) => Promise<NextAddressResponse>;
export declare const nextUtxo: (nostrHexSk: string, request: string) => Promise<NextUtxoResponse>;
export declare const getSwap: (nostrHexSk: string, request: RgbSwapRequest) => Promise<RgbSwapResponse>;
export declare const createHotswapOffer: (nostrHexSk: string, request: RgbOfferRequest) => Promise<RgbOfferLocalResponse>;
export declare const createHotswapBid: (nostrHexSk: string, request: RgbBidRequest, secretKeys: String[]) => Promise<RgbBidLocalResponse>;
export declare const canCreateP2POffer: (nostrHexSk: string, request: RgbOfferRequest, secretKeys: String[]) => Promise<RgbSwapValidationResponse>;
export declare const createP2POffer: (nostrHexSk: string, request: RgbOfferRequest, secretKeys: String[]) => Promise<RgbOfferLocalResponse>;
export declare const cancelP2POffer: (nostrHexSk: string, request: RgbCancelOffersRequest) => Promise<RgbSwapCancelResponse>;
export declare const canCreateP2PBid: (nostrHexSk: string, request: RgbBidRequest, secretKeys: String[]) => Promise<RgbSwapValidationResponse>;
export declare const createP2PBid: (nostrHexSk: string, request: RgbBidRequest, secretKeys: String[]) => Promise<RgbBidLocalResponse>;
export declare const cancelP2PBid: (nostrHexSk: string, request: RgbCancelBidsRequest) => Promise<RgbSwapCancelResponse>;
export declare const createAuctionOffer: (nostrHexSk: string, request: RgbOfferRequest, secretKeys: String[]) => Promise<RgbOfferLocalResponse>;
export declare const createAuctionBid: (nostrHexSk: string, request: RgbBidRequest, secretKeys: String[]) => Promise<RgbBidLocalResponse>;
export declare const createAirdropOffer: (nostrHexSk: string, request: RgbOfferRequest, secretKeys: String[], fee: bigint, maxClaim: string) => Promise<RgbOfferLocalResponse>;
export declare const createAirdropBid: (nostrHexSk: string, request: RgbBidRequest) => Promise<RgbBidLocalResponse>;
export declare const psbtSignFile: (nostrHexSk: string, request: SignPsbtRequest) => Promise<SignedPsbtResponse>;
export declare const psbtPublishFile: (request: PublishPsbtRequest) => Promise<SignedPsbtResponse>;
export declare const psbtSignAndPublishFile: (_nostrHexSk: string, request: SignPsbtRequest) => Promise<PublishedPsbtResponse>;
export declare const decodeInvoice: (invoice: string) => Promise<RgbInvoiceDecoded>;
export declare const displayContractAmount: (amount: bigint, precision: number) => string;
export declare const getContractAmount: (amount: string) => ContractAmount;
export declare const parseContractAmount: (amount: string, precision: number) => string;
export declare const getVersion: () => string;
export interface LocalResponse<T> {
data: T;
carbonado: RgbContainer;
}
export interface GenesisFormats {
legacy: string;
strict: string;
armored: string;
export interface RgbContainer {
rgbStock?: string;
rgbAccount?: string;
rgbTransfers?: string;
}
/**
* @deprecated please use `IssueMediaRequest` instead
*/
export interface IssueMetadata {
uda?: MediaInfo[];
collectible?: NewCollectible[];
}
export interface FullIssueRequest {
export interface IssueRequest {
ticker: string;
name: string;
description: string;
supply: bigint;
supply: string;
precision: number;
seal: string;
iface: string;
meta?: MediaRequest;
chain: string;
meta?: IssueMedia;
}
export interface NewCollectible {
ticker: string;
name: string;
description: string;
media: MediaInfo[];
export type ChainFee = {
value?: bigint;
feeRate?: number;
none?: string;
};
export interface IssueMedia {
preview?: MediaData;
media?: MediaData;
attachments: MediaData[];
}
export interface UDADetail {
tokenIndex: number;
ticker: string;
name: string;
description: string;
media: MediaInfo[];
balance: bigint;
allocations: AllocationDetail[];
export interface MediaData {
type: string;
uri: string;
}
export interface ContractMediaDetail {
tokenIndex: number;
ticker: string;
name: string;
description: string;
balance: bigint;
allocations: AllocationDetail[];
preview?: MediaInfo;
media?: MediaInfo;
attachments: MediaInfo[];
}
/**
* @deprecated please use `ContractMediaDetail` instead
*/
export interface ContractMetadata {
uda?: UDADetail;
collectible?: UDADetail[];
}
export type ContractResponse = IssueResponse;
export type IssueLocalResponse = LocalResponse<IssueResponse>;
export type ListContractsResponse = LocalResponse<ContractResponse[]>;
export interface IssueResponse {

@@ -111,120 +75,76 @@ contractId: string;

iface: string;
issueMethod: string;
issueUtxo: string;
ticker: string;
name: string;
created: bigint;
description: string;
supply: bigint;
precision: number;
balance: ContractValue;
allocations: ContractAllocation[];
contract: ContractFormats;
genesis: GenesisFormats;
meta?: ContractMediaDetail;
meta?: UDAItem;
}
export interface ImportRequest {
import: string;
data: string;
export type ContractValue = {
value?: bigint;
uda?: Allocation;
};
export interface Allocation {
tokenIndex: number;
fraction: bigint;
}
export interface ImportResponse {
contractId: string;
iimplId: string;
iface: string;
ticker: string;
name: string;
description: string;
supply: bigint;
precision: number;
balance: bigint;
balanceNormalized: number;
allocations: AllocationDetail[];
contract: ContractFormats;
genesis: GenesisFormats;
meta?: ContractMediaDetail;
}
export interface MediaInfo {
type: string;
source: string;
}
export interface SimpleContractResponse {
contractId: string;
ifaceId: string;
precision: number;
}
export interface InvoiceRequest {
contractId: string;
iface: string;
amount: string;
seal: string;
params: {
[key: string]: string;
};
}
export interface InvoiceResponse {
invoice: string;
}
export interface PsbtRequest {
assetInputs: PsbtInputRequest[];
assetDescriptorChange: string;
assetTerminalChange: string;
bitcoinInputs: PsbtInputRequest[];
bitcoinChanges: string[];
fee: PsbtFeeRequest;
rbf: boolean;
}
interface PsbtInputRequest {
descriptor: string;
export interface ContractAllocation {
utxo: string;
utxoTerminal: string;
tapret?: string;
sighHash?: PsbtSigHashRequest;
value: ContractValue;
derivation: string;
isMine: boolean;
isSpent: boolean;
}
interface PsbtSigHashRequest {
All: string;
None: string;
Single: string;
AllPlusAnyoneCanPay: string;
NonePlusAnyoneCanPay: string;
SinglePlusAnyoneCanPay: string;
export interface UDAItem {
tokenIndex: number;
media: IssueMedia;
}
interface PsbtFeeRequest {
value?: number;
feeRate?: number;
export interface ContractFormats {
strict: string;
armored: string;
}
export interface PsbtResponse {
psbt: string;
terminal: string;
export interface GenesisFormats {
strict: string;
}
export interface SignPsbtRequest {
psbt: string;
descriptors: string[];
export interface RgbInvoiceRequest {
contractId?: string;
iface?: string;
amount: RgbInvoiceValue;
seal?: RgbSealSelection;
expireAt?: number;
}
export interface PublishedPsbtResponse {
sign: boolean;
txid: string;
export interface RgbSealSelection {
utxo?: string;
address?: string;
}
export interface SignedPsbtResponse {
sign: boolean;
psbt: string;
export interface RgbInvoiceValue {
value?: string;
uda?: Allocation;
}
export interface PublishPsbtRequest {
psbt: string;
export type RgbInvoiceLocalResponse = LocalResponse<RgbInvoiceResponse>;
export interface RgbInvoiceResponse {
invoice: string;
}
export interface RgbTransferRequest {
rgbInvoice: string;
psbt: string;
terminal: string;
}
export interface FullRgbTransferRequest {
contractId: string;
iface: string;
rgbInvoice: string;
descriptor: string;
changeTerminal: string;
fee: PsbtFeeRequest;
invoice: string;
chain: string;
chainFee: ChainFee;
bitcoinChanges: string[];
}
export type RgbTransferLocalResponse = LocalResponse<RgbTransferResponse>;
export interface RgbTransferResponse {
consigId: string;
consig: string;
txid: string;
psbt: string;
commit: string;
txid: string;
commit?: string;
}

@@ -235,2 +155,3 @@ export interface AcceptRequest {

}
export type RgbAcceptLocalResponse = LocalResponse<AcceptResponse>;
export interface AcceptResponse {

@@ -241,24 +162,27 @@ transferId: string;

}
export interface ContractsResponse {
contracts: ImportResponse[];
export type ListTransfersResponse = LocalResponse<RgbTransferItem[]>;
export interface RgbTransferItem {
contractId: String;
transferId: String;
iface: String;
status: TxStatus;
isAccept: boolean;
isMine: boolean;
txid: String;
}
export interface ContractHiddenResponse {
contractId: string;
hidden: boolean;
export interface SignPsbtRequest {
psbt: string;
descriptors: string[];
}
export interface InterfacesResponse {
interfaces: InterfaceDetail[];
export interface SignedPsbtResponse {
sign: boolean;
psbt: string;
}
export interface InterfaceDetail {
name: string;
iface: string;
iimpl: string;
export interface PublishPsbtRequest {
psbt: string;
}
export interface SchemasResponse {
schemas: SchemaDetail[];
export interface PublishedPsbtResponse {
sign: boolean;
txid: string;
}
export interface SchemaDetail {
schema: string;
ifaces: string[];
}
export interface WatcherRequest {

@@ -271,14 +195,7 @@ name: string;

name: string;
migrate: boolean;
}
export interface UtxoResponse {
outpoint: string;
amount: bigint;
status: TxStatus;
}
export interface NextUtxoResponse {
utxo?: UtxoResponse;
utxo?: string;
}
export interface NextUtxosResponse {
utxos: UtxoResponse[];
}
export interface NextAddressResponse {

@@ -288,76 +205,2 @@ address: string;

}
export interface WatcherDetailResponse {
contracts: WatcherDetail[];
}
export interface WatcherUtxoResponse {
utxos: string[];
}
export interface WatcherDetail {
contractId: string;
allocations: AllocationDetail[];
}
export interface UDAPosition {
tokenIndex: number;
fraction: bigint;
}
export type AllocationValue = {
value?: bigint;
uda?: UDAPosition;
};
export interface AllocationDetail {
utxo: string;
value: AllocationValue;
derivation: string;
isMine: boolean;
isSpent: boolean;
}
export interface DeclareRequest {
disclosure: string;
changeTransfers: ChangeTansfer[];
transfers: FinalizeTransfer[];
}
export interface FinalizeTransfer {
previousUtxo: string;
consignment: string;
asset: string;
beneficiaries: BlindedOrNotOutpoint[];
}
export interface ChangeTansfer {
previousUtxo: string;
asset: string;
change: BlindedOrNotOutpoint;
}
export interface BlindedOrNotOutpoint {
outpoint: string;
balance: number;
}
export interface Contract {
id: string;
ticker: string;
name: string;
description: string;
allocations: AllocationDetail[];
balance: bigint;
genesis: string;
}
export interface RgbSaveTransferRequest {
iface: string;
consignment: string;
}
export interface RgbRemoveTransferRequest {
contractId: string;
consigIds: string[];
}
export interface RgbTransferStatusResponse {
contractId: string;
consigStatus: Map<string, boolean>;
}
export interface RgbTransfersResponse {
transfers: RgbTransferDetail[];
}
export interface RgbTransferDetail {
consigId: string;
status: TxStatus;
type: TransferType;
}
export interface TxStatus {

@@ -369,87 +212,34 @@ notFound?: any;

}
export interface TransferType {
sended?: any;
received?: any;
unknown?: any;
}
export interface RgbInvoiceResponse {
export interface RgbInvoiceDecoded {
contractId: string;
amount: bigint;
amount: RgbInvoiceValue;
}
export interface BatchRgbTransferResponse {
transfers: BatchRgbTransferItem[];
export interface ContractAmount {
int: bigint;
fract: bigint;
precision: number;
}
export interface BatchRgbTransferItem {
contractId: string;
consigId: string;
status: TxStatus;
isAccept: boolean;
iface: string;
txid: string;
export interface RgbOfferRequest {
strategy: RgbSwap;
offers: RgbOfferItem[];
}
export interface RgbOfferRequest {
export declare enum RgbSwap {
auction = "auction",
p2p = "p2p",
hotSwap = "hotswap",
airdrop = "airdrop"
}
export interface RgbOfferItem {
contractId: string;
iface: string;
contractAmount: string;
assetAmount: string;
bitcoinPrice: bigint;
descriptor: string;
changeTerminal: string;
bitcoinChanges: string[];
strategy: RgbSwapStrategy;
expireAt?: number;
}
export declare enum RgbSwapStrategy {
Auction = "auction",
P2P = "p2p",
HotSwap = "hotswap"
}
export interface RgbAuctionStrategy {
auction?: string;
airdrop?: string;
}
export interface RgbAuctionOfferRequest {
offers: RgbOfferRequest[];
signKeys: string[];
strategy: RgbAuctionStrategy;
fee?: PsbtFeeRequest;
}
export interface RgbOfferUpdateRequest {
contract_id: string;
offer_id: string;
offer_psbt: string;
}
export interface RgbOfferUpdateResponse {
contract_id: string;
offer_id: string;
updated: boolean;
}
export interface RgbAuctionBidRequest {
export interface RgbOfferResponse {
offerId: string;
assetAmount: string;
descriptor: string;
changeTerminal: string;
signKeys: string[];
fee: PsbtFeeRequest;
}
export interface RgbAuctionBidResponse {
bidId: string;
offerId: string;
feeValue: number;
}
export interface RgbMatchResponse {
consigId: string;
offerId: string;
bidId: string;
}
export interface RgbAuctionOfferResponse {
offerId: string;
sharedKey: string;
status: string;
contractId: string;
assetAmount: number;
bitcoinPrice: number;
bundleId: string;
}
export interface RgbOfferResponse {
offerId: string;
contractId: string;
contractAmount: number;
bitcoinPrice: bigint;

@@ -459,9 +249,11 @@ sellerAddress: string;

bundleId?: string;
expireAt: number;
}
export type RgbOfferLocalResponse = LocalResponse<RgbOfferResponse[]>;
export interface RgbBidRequest {
offerId: string;
assetAmount: string;
descriptor: string;
changeTerminal: string;
fee: PsbtFeeRequest;
bitcoinPrice: bigint;
fee: ChainFee;
bundleId?: string;
}

@@ -471,113 +263,40 @@ export interface RgbBidResponse {

offerId: string;
assetAmount: number;
bitcoinPrice: bigint;
invoice: string;
swapPsbt: string;
swapPsbt?: string;
feeValue: bigint;
}
export type RgbBidLocalResponse = LocalResponse<RgbBidResponse>;
export interface RgbAuctionCloseRequest {
bundleId: string;
}
export interface RgbSwapRequest {
offerId: string;
bidId: string;
swapPsbt: string;
sharedKey: string;
}
export interface RgbSwapResponse {
consigId: string;
finalConsig: string;
finalPsbt: string;
consig: string;
txid: string;
psbt: string;
}
export interface PublicRgbOffersResponse {
offers: PublicRgbOfferResponse[];
bids: Map<string, PublicRgbBidResponse[]>;
export interface RgbCancelOffersRequest {
offers: string[];
}
export interface PublicRgbOfferResponse {
offerId: string;
contractId: string;
offerPub: string;
assetAmount: bigint;
bitcoinPrice: bigint;
offerPsbt?: string;
export interface RgbCancelBidsRequest {
bids: string[];
}
export interface RgbAuctionFinishResponse {
bundle_id: string;
outpoint: string;
sold: Map<string, RgbSwapItem>;
remaining: Map<string, RgbSwapItem>;
export interface RgbSwapCancelResponse {
records: number;
offers: string[];
bids: string[];
}
export interface RgbSwapItem {
contractId: string;
iface: string;
contractAmount: string;
export interface RgbSwapValidationResponse {
valid: boolean;
message: string;
warnings: string[];
failures: string[];
}
export interface PublicRgbBidResponse {
bidId: string;
assetAmount: bigint;
bitcoinPrice: bigint;
}
export interface RgbOfferBidsResponse {
offers: RgbOfferDetail[];
bids: RgbBidDetail[];
}
export interface RgbOffersResponse {
offers: RgbOfferDetail[];
}
export interface RgbBidsResponse {
bids: RgbBidDetail[];
}
export interface RgbOfferDetail {
contractId: string;
offerId: string;
offerStatus: string;
assetAmount: bigint;
bitcoinPrice: bigint;
}
export interface RgbBidDetail {
contractId: string;
bidId: string;
offerId: string;
bidStatus: string;
assetAmount: bigint;
bitcoinPrice: bigint;
}
export interface IssueMediaRequest {
preview?: MediaInfo;
media?: MediaInfo;
attachments: MediaInfo[];
}
export interface MediaRequest {
preview?: MediaItemRequest;
media?: MediaItemRequest;
attachments: MediaItemRequest[];
}
export interface MediaExtractRequest {
encode: MediaEncode;
item: MediaItemRequest;
}
export interface MediaItemRequest {
type: string;
uri: string;
}
export interface MediaResponse {
preview?: MediaView;
media?: MediaView;
attachments: MediaView[];
}
export interface MediaView {
id: string;
type: string;
source: string;
encode: MediaEncode;
}
export interface MediaEncode {
base64?: string;
sha2?: string;
blake3?: string;
}
export interface ImportConsignmentsRequest {
[consignmentId: string]: string;
}
export interface MediaMetadata {
id: string;
mime: string;
uri: string;
digest: string;
}
export {};
//# sourceMappingURL=rgb.d.ts.map

@@ -37,101 +37,91 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.RgbSwapStrategy = exports.contractDecimalParseValue = exports.contractAmountParseValue = exports.contractAmountParseStr = exports.contractAmountStr = exports.contractAmount = exports.getMedia = exports.importUdaData = exports.getConsignment = exports.importConsignments = exports.myBids = exports.myOffers = exports.myOrders = exports.publicOffers = exports.directSwap = exports.listAuctions = exports.finishAuction = exports.createAuctionBid = exports.createAuctionOffer = exports.createSwap = exports.createBid = exports.createOffer = exports.decodeInvoice = exports.verifyTransfers = exports.removeTransfer = exports.saveTransfer = exports.listTransfers = exports.watcherUtxo = exports.watcherAddress = exports.watcherUnspentUtxos = exports.watcherNextUtxo = exports.watcherNextAddress = exports.watcherDetails = exports.createWatcher = exports.listSchemas = exports.listInterfaces = exports.hideContract = exports.listContracts = exports.acceptTransfer = exports.importContract = exports.fullTransferAsset = exports.transferAsset = exports.psbtSignAndPublishFile = exports.psbtSignFile = exports.createPsbt = exports.createInvoice = exports.fullIssueContract = void 0;
exports.RgbSwap = exports.getVersion = exports.parseContractAmount = exports.getContractAmount = exports.displayContractAmount = exports.decodeInvoice = exports.psbtSignAndPublishFile = exports.psbtPublishFile = exports.psbtSignFile = exports.createAirdropBid = exports.createAirdropOffer = exports.createAuctionBid = exports.createAuctionOffer = exports.cancelP2PBid = exports.createP2PBid = exports.canCreateP2PBid = exports.cancelP2POffer = exports.createP2POffer = exports.canCreateP2POffer = exports.createHotswapBid = exports.createHotswapOffer = exports.getSwap = exports.nextUtxo = exports.nextAddress = exports.createWatcher = exports.verifyTransfers = exports.acceptTransfer = exports.createAndPublishTransfer = exports.createTransfer = exports.createInvoice = exports.issueContract = exports.getContract = exports.listContracts = exports.importContract = void 0;
const BMC = __importStar(require("./bitmask_core"));
const fullIssueContract = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.full_issue_contract(nostrHexSk, request)); });
exports.fullIssueContract = fullIssueContract;
const createInvoice = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.rgb_create_invoice(nostrHexSk, request)); });
exports.createInvoice = createInvoice;
const createPsbt = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_psbt(nostrHexSk, request)); });
exports.createPsbt = createPsbt;
const psbtSignFile = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.psbt_sign_file(nostrHexSk, request)); });
exports.psbtSignFile = psbtSignFile;
const psbtSignAndPublishFile = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.psbt_sign_and_publish_file(nostrHexSk, request)); });
exports.psbtSignAndPublishFile = psbtSignAndPublishFile;
const transferAsset = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.transfer_asset(nostrHexSk, request)); });
exports.transferAsset = transferAsset;
const fullTransferAsset = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.full_transfer_asset(nostrHexSk, request)); });
exports.fullTransferAsset = fullTransferAsset;
const importContract = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.import_contract(nostrHexSk, request)); });
exports.importContract = importContract;
const acceptTransfer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.accept_transfer(nostrHexSk, request)); });
const listContracts = (nostrHexSk, hidden) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_contracts(nostrHexSk, hidden)); });
exports.listContracts = listContracts;
const getContract = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.get_contract(nostrHexSk, request)); });
exports.getContract = getContract;
const issueContract = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () {
const resp = JSON.parse(yield BMC.issue_contract_proxy(nostrHexSk, request));
return resp.data;
});
exports.issueContract = issueContract;
const createInvoice = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () {
const resp = JSON.parse(yield BMC.create_rgb_invoice(nostrHexSk, request));
return resp.data;
});
exports.createInvoice = createInvoice;
const createTransfer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () {
const resp = JSON.parse(yield BMC.create_rgb_transfer(nostrHexSk, request));
return resp.data;
});
exports.createTransfer = createTransfer;
const createAndPublishTransfer = (nostrHexSk, request, secrets) => __awaiter(void 0, void 0, void 0, function* () {
const resp = JSON.parse(yield BMC.create_and_publish_rgb_transfer(nostrHexSk, request, secrets));
return resp.data;
});
exports.createAndPublishTransfer = createAndPublishTransfer;
const acceptTransfer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () {
const resp = JSON.parse(yield BMC.accept_transfer(nostrHexSk, request));
return resp.data;
});
exports.acceptTransfer = acceptTransfer;
const listContracts = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_contracts(nostrHexSk)); });
exports.listContracts = listContracts;
const hideContract = (nostrHexSk, contractId) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.hidden_contract(nostrHexSk, contractId)); });
exports.hideContract = hideContract;
const listInterfaces = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_interfaces(nostrHexSk)); });
exports.listInterfaces = listInterfaces;
const listSchemas = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_schemas(nostrHexSk)); });
exports.listSchemas = listSchemas;
const verifyTransfers = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.verify_transfers(nostrHexSk)); });
exports.verifyTransfers = verifyTransfers;
const createWatcher = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_watcher(nostrHexSk, request)); });
exports.createWatcher = createWatcher;
const watcherDetails = (nostrHexSk, name) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.watcher_details(nostrHexSk, name)); });
exports.watcherDetails = watcherDetails;
const watcherNextAddress = (nostrHexSk, name, iface) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.watcher_next_address(nostrHexSk, name, iface)); });
exports.watcherNextAddress = watcherNextAddress;
const watcherNextUtxo = (nostrHexSk, name, iface) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.watcher_next_utxo(nostrHexSk, name, iface)); });
exports.watcherNextUtxo = watcherNextUtxo;
const watcherUnspentUtxos = (nostrHexSk, name, iface) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.watcher_unspent_utxos(nostrHexSk, name, iface)); });
exports.watcherUnspentUtxos = watcherUnspentUtxos;
const watcherAddress = (nostrHexSk, name, address) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.watcher_address(nostrHexSk, name, address)); });
exports.watcherAddress = watcherAddress;
const watcherUtxo = (nostrHexSk, name, utxo) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.watcher_utxo(nostrHexSk, name, utxo)); });
exports.watcherUtxo = watcherUtxo;
const listTransfers = (nostrHexSk, contractId) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_transfers(nostrHexSk, contractId)); });
exports.listTransfers = listTransfers;
const saveTransfer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.save_transfer(nostrHexSk, request)); });
exports.saveTransfer = saveTransfer;
const removeTransfer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.remove_transfer(nostrHexSk, request)); });
exports.removeTransfer = removeTransfer;
const verifyTransfers = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.verify_transfers(nostrHexSk)); });
exports.verifyTransfers = verifyTransfers;
const nextAddress = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.watcher_next_address(nostrHexSk, request)); });
exports.nextAddress = nextAddress;
const nextUtxo = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.watcher_next_utxo(nostrHexSk, request)); });
exports.nextUtxo = nextUtxo;
const getSwap = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.get_swap(nostrHexSk, request)); });
exports.getSwap = getSwap;
const createHotswapOffer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_hotswap_offer(nostrHexSk, request)); });
exports.createHotswapOffer = createHotswapOffer;
const createHotswapBid = (nostrHexSk, request, secretKeys) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_hotswap_bid(nostrHexSk, request, secretKeys)); });
exports.createHotswapBid = createHotswapBid;
const canCreateP2POffer = (nostrHexSk, request, secretKeys) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.can_create_p2p_offer(nostrHexSk, request, secretKeys)); });
exports.canCreateP2POffer = canCreateP2POffer;
const createP2POffer = (nostrHexSk, request, secretKeys) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_p2p_offer(nostrHexSk, request, secretKeys)); });
exports.createP2POffer = createP2POffer;
const cancelP2POffer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.cancel_p2p_offer(nostrHexSk, request)); });
exports.cancelP2POffer = cancelP2POffer;
const canCreateP2PBid = (nostrHexSk, request, secretKeys) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.can_create_p2p_bid(nostrHexSk, request, secretKeys)); });
exports.canCreateP2PBid = canCreateP2PBid;
const createP2PBid = (nostrHexSk, request, secretKeys) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_p2p_bid(nostrHexSk, request, secretKeys)); });
exports.createP2PBid = createP2PBid;
const cancelP2PBid = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.cancel_p2p_bid(nostrHexSk, request)); });
exports.cancelP2PBid = cancelP2PBid;
const createAuctionOffer = (nostrHexSk, request, secretKeys) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_auction_offer(nostrHexSk, request, secretKeys)); });
exports.createAuctionOffer = createAuctionOffer;
const createAuctionBid = (nostrHexSk, request, secretKeys) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_auction_bid(nostrHexSk, request, secretKeys)); });
exports.createAuctionBid = createAuctionBid;
const createAirdropOffer = (nostrHexSk, request, secretKeys, fee, maxClaim) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_airdrop_offer(nostrHexSk, request, secretKeys, fee, maxClaim)); });
exports.createAirdropOffer = createAirdropOffer;
const createAirdropBid = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_airdrop_bid(nostrHexSk, request)); });
exports.createAirdropBid = createAirdropBid;
const psbtSignFile = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.psbt_sign_file(nostrHexSk, request)); });
exports.psbtSignFile = psbtSignFile;
const psbtPublishFile = (request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.psbt_publish_file(request)); });
exports.psbtPublishFile = psbtPublishFile;
const psbtSignAndPublishFile = (_nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.psbt_sign_and_publish_file(request)); });
exports.psbtSignAndPublishFile = psbtSignAndPublishFile;
const decodeInvoice = (invoice) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.decode_invoice(invoice)); });
exports.decodeInvoice = decodeInvoice;
const createOffer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_offer(nostrHexSk, request)); });
exports.createOffer = createOffer;
const createBid = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_bid(nostrHexSk, request)); });
exports.createBid = createBid;
const createSwap = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_swap(nostrHexSk, request)); });
exports.createSwap = createSwap;
const createAuctionOffer = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_auction_offers(nostrHexSk, request)); });
exports.createAuctionOffer = createAuctionOffer;
const createAuctionBid = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.create_auction_bid(nostrHexSk, request)); });
exports.createAuctionBid = createAuctionBid;
const finishAuction = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.finish_auction_offers(nostrHexSk, request)); });
exports.finishAuction = finishAuction;
const listAuctions = () => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.list_auctions()); });
exports.listAuctions = listAuctions;
const directSwap = (nostrHexSk, request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.direct_swap(nostrHexSk, request)); });
exports.directSwap = directSwap;
const publicOffers = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.public_offers(nostrHexSk)); });
exports.publicOffers = publicOffers;
const myOrders = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.my_orders(nostrHexSk)); });
exports.myOrders = myOrders;
const myOffers = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.my_offers(nostrHexSk)); });
exports.myOffers = myOffers;
const myBids = (nostrHexSk) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.my_bids(nostrHexSk)); });
exports.myBids = myBids;
const importConsignments = (request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.import_consignments(request)); });
exports.importConsignments = importConsignments;
const getConsignment = (consigOrReceiptId) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.get_consignment(consigOrReceiptId)); });
exports.getConsignment = getConsignment;
const importUdaData = (request) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.import_uda_data(request)); });
exports.importUdaData = importUdaData;
const getMedia = (mediaId) => __awaiter(void 0, void 0, void 0, function* () { return JSON.parse(yield BMC.get_media_metadata(mediaId)); });
exports.getMedia = getMedia;
const contractAmount = (amount, precision) => JSON.parse(BMC.contract_amount(amount, precision).toString());
exports.contractAmount = contractAmount;
const contractAmountStr = (amount, precision) => JSON.parse(BMC.contract_amount_str(amount, precision));
exports.contractAmountStr = contractAmountStr;
const contractAmountParseStr = (amount, precision) => JSON.parse(BMC.contract_amount_parse_str(amount, precision).toString());
exports.contractAmountParseStr = contractAmountParseStr;
const contractAmountParseValue = (amount, precision) => JSON.parse(BMC.contract_amount_parse_value(amount, precision).toString());
exports.contractAmountParseValue = contractAmountParseValue;
const contractDecimalParseValue = (amount) => JSON.parse(BMC.contract_amount_parse_decimal_value(amount).toString());
exports.contractDecimalParseValue = contractDecimalParseValue;
var RgbSwapStrategy;
(function (RgbSwapStrategy) {
RgbSwapStrategy["Auction"] = "auction";
RgbSwapStrategy["P2P"] = "p2p";
RgbSwapStrategy["HotSwap"] = "hotswap";
})(RgbSwapStrategy || (exports.RgbSwapStrategy = RgbSwapStrategy = {}));
const displayContractAmount = (amount, precision) => JSON.parse(BMC.to_contract_amount_string(amount, precision));
exports.displayContractAmount = displayContractAmount;
const getContractAmount = (amount) => JSON.parse(BMC.from_contract_amount_string(amount));
exports.getContractAmount = getContractAmount;
const parseContractAmount = (amount, precision) => JSON.parse(BMC.format_contract_amount_string(amount, precision));
exports.parseContractAmount = parseContractAmount;
const getVersion = () => JSON.parse(BMC.get_rgb_version());
exports.getVersion = getVersion;
var RgbSwap;
(function (RgbSwap) {
RgbSwap["auction"] = "auction";
RgbSwap["p2p"] = "p2p";
RgbSwap["hotSwap"] = "hotswap";
RgbSwap["airdrop"] = "airdrop";
})(RgbSwap || (exports.RgbSwap = RgbSwap = {}));

1233

rgb.ts

@@ -6,76 +6,68 @@ // Methods meant to work with RGB contracts defined within the web::rgb module from bitmask-core:

export const fullIssueContract = async (
export const importContract = async (
nostrHexSk: string,
request: FullIssueRequest
): Promise<IssueResponse> =>
JSON.parse(await BMC.full_issue_contract(nostrHexSk, request));
request: string
): Promise<ContractResponse> =>
JSON.parse(await BMC.import_contract(nostrHexSk, request));
export const createInvoice = async (
export const listContracts = async (
nostrHexSk: string,
request: InvoiceRequest
): Promise<InvoiceResponse> =>
JSON.parse(await BMC.rgb_create_invoice(nostrHexSk, request));
hidden: boolean
): Promise<ListContractsResponse> =>
JSON.parse(await BMC.list_contracts(nostrHexSk, hidden));
export const createPsbt = async (
export const getContract = async (
nostrHexSk: string,
request: PsbtRequest
): Promise<PsbtResponse> =>
JSON.parse(await BMC.create_psbt(nostrHexSk, request));
request: string
): Promise<ContractResponse> =>
JSON.parse(await BMC.get_contract(nostrHexSk, request));
export const psbtSignFile = async (
export const issueContract = async (
nostrHexSk: string,
request: SignPsbtRequest
): Promise<SignedPsbtResponse> =>
JSON.parse(await BMC.psbt_sign_file(nostrHexSk, request));
request: IssueRequest
): Promise<IssueResponse> => {
const resp = JSON.parse(await BMC.issue_contract_proxy(nostrHexSk, request));
return resp.data;
};
export const psbtSignAndPublishFile = async (
export const createInvoice = async (
nostrHexSk: string,
request: SignPsbtRequest
): Promise<SignedPsbtResponse> =>
JSON.parse(await BMC.psbt_sign_and_publish_file(nostrHexSk, request));
request: RgbInvoiceRequest
): Promise<RgbInvoiceResponse> => {
const resp = JSON.parse(await BMC.create_rgb_invoice(nostrHexSk, request));
return resp.data;
};
export const transferAsset = async (
export const createTransfer = async (
nostrHexSk: string,
request: RgbTransferRequest
): Promise<RgbTransferResponse> =>
JSON.parse(await BMC.transfer_asset(nostrHexSk, request));
): Promise<RgbTransferResponse> => {
const resp = JSON.parse(await BMC.create_rgb_transfer(nostrHexSk, request));
return resp.data;
};
export const fullTransferAsset = async (
export const createAndPublishTransfer = async (
nostrHexSk: string,
request: FullRgbTransferRequest
): Promise<RgbTransferResponse> =>
JSON.parse(await BMC.full_transfer_asset(nostrHexSk, request));
request: RgbTransferRequest,
secrets: string[]
): Promise<RgbTransferResponse> => {
const resp = JSON.parse(
await BMC.create_and_publish_rgb_transfer(nostrHexSk, request, secrets)
);
return resp.data;
};
export const importContract = async (
nostrHexSk: string,
request: ImportRequest
): Promise<ImportResponse> =>
JSON.parse(await BMC.import_contract(nostrHexSk, request));
export const acceptTransfer = async (
nostrHexSk: string,
request: AcceptRequest
): Promise<AcceptResponse> =>
JSON.parse(await BMC.accept_transfer(nostrHexSk, request));
): Promise<AcceptResponse> => {
const resp = JSON.parse(await BMC.accept_transfer(nostrHexSk, request));
return resp.data;
};
export const listContracts = async (
export const verifyTransfers = async (
nostrHexSk: string
): Promise<ContractsResponse> =>
JSON.parse(await BMC.list_contracts(nostrHexSk));
): Promise<ListTransfersResponse> =>
JSON.parse(await BMC.verify_transfers(nostrHexSk));
export const hideContract = async (
nostrHexSk: string,
contractId: string
): Promise<ContractHiddenResponse> =>
JSON.parse(await BMC.hidden_contract(nostrHexSk, contractId));
export const listInterfaces = async (
nostrHexSk: string
): Promise<InterfacesResponse> =>
JSON.parse(await BMC.list_interfaces(nostrHexSk));
export const listSchemas = async (
nostrHexSk: string
): Promise<SchemasResponse> => JSON.parse(await BMC.list_schemas(nostrHexSk));
export const createWatcher = async (

@@ -87,192 +79,153 @@ nostrHexSk: string,

export const watcherDetails = async (
export const nextAddress = async (
nostrHexSk: string,
name: string
): Promise<WatcherDetailResponse> =>
JSON.parse(await BMC.watcher_details(nostrHexSk, name));
export const watcherNextAddress = async (
nostrHexSk: string,
name: string,
iface: string
request: string
): Promise<NextAddressResponse> =>
JSON.parse(await BMC.watcher_next_address(nostrHexSk, name, iface));
JSON.parse(await BMC.watcher_next_address(nostrHexSk, request));
export const watcherNextUtxo = async (
export const nextUtxo = async (
nostrHexSk: string,
name: string,
iface: string
request: string
): Promise<NextUtxoResponse> =>
JSON.parse(await BMC.watcher_next_utxo(nostrHexSk, name, iface));
JSON.parse(await BMC.watcher_next_utxo(nostrHexSk, request));
export const watcherUnspentUtxos = async (
nostrHexSk: string,
name: string,
iface: string
): Promise<NextUtxosResponse> =>
JSON.parse(await BMC.watcher_unspent_utxos(nostrHexSk, name, iface));
export const getSwap = async (
nostrHexSk: string,
request: RgbSwapRequest
): Promise<RgbSwapResponse> =>
JSON.parse(await BMC.get_swap(nostrHexSk, request));
export const watcherAddress = async (
nostrHexSk: string,
name: string,
address: string
): Promise<WatcherUtxoResponse> =>
JSON.parse(await BMC.watcher_address(nostrHexSk, name, address));
export const createHotswapOffer = async (
nostrHexSk: string,
request: RgbOfferRequest
): Promise<RgbOfferLocalResponse> =>
JSON.parse(await BMC.create_hotswap_offer(nostrHexSk, request));
export const watcherUtxo = async (
nostrHexSk: string,
name: string,
utxo: string
): Promise<WatcherUtxoResponse> =>
JSON.parse(await BMC.watcher_utxo(nostrHexSk, name, utxo));
export const createHotswapBid = async (
nostrHexSk: string,
request: RgbBidRequest,
secretKeys: String[],
): Promise<RgbBidLocalResponse> =>
JSON.parse(await BMC.create_hotswap_bid(nostrHexSk, request, secretKeys));
export const listTransfers = async (
nostrHexSk: string,
contractId: string
): Promise<RgbTransfersResponse> =>
JSON.parse(await BMC.list_transfers(nostrHexSk, contractId));
export const canCreateP2POffer = async (
nostrHexSk: string,
request: RgbOfferRequest,
secretKeys: String[]
): Promise<RgbSwapValidationResponse> =>
JSON.parse(await BMC.can_create_p2p_offer(nostrHexSk, request, secretKeys));
export const saveTransfer = async (
nostrHexSk: string,
request: RgbSaveTransferRequest
): Promise<RgbTransferStatusResponse> =>
JSON.parse(await BMC.save_transfer(nostrHexSk, request));
export const createP2POffer = async (
nostrHexSk: string,
request: RgbOfferRequest,
secretKeys: String[]
): Promise<RgbOfferLocalResponse> =>
JSON.parse(await BMC.create_p2p_offer(nostrHexSk, request, secretKeys));
export const removeTransfer = async (
nostrHexSk: string,
request: RgbRemoveTransferRequest
): Promise<RgbTransferStatusResponse> =>
JSON.parse(await BMC.remove_transfer(nostrHexSk, request));
export const cancelP2POffer = async (
nostrHexSk: string,
request: RgbCancelOffersRequest
): Promise<RgbSwapCancelResponse> =>
JSON.parse(await BMC.cancel_p2p_offer(nostrHexSk, request));
export const verifyTransfers = async (
nostrHexSk: string
): Promise<BatchRgbTransferResponse> =>
JSON.parse(await BMC.verify_transfers(nostrHexSk));
export const canCreateP2PBid = async (
nostrHexSk: string,
request: RgbBidRequest,
secretKeys: String[],
): Promise<RgbSwapValidationResponse> =>
JSON.parse(await BMC.can_create_p2p_bid(nostrHexSk, request, secretKeys));
export const decodeInvoice = async (
invoice: string
): Promise<RgbInvoiceResponse> => JSON.parse(await BMC.decode_invoice(invoice));
export const createP2PBid = async (
nostrHexSk: string,
request: RgbBidRequest,
secretKeys: String[],
): Promise<RgbBidLocalResponse> =>
JSON.parse(await BMC.create_p2p_bid(nostrHexSk, request, secretKeys));
export const createOffer = async (
nostrHexSk: string,
request: RgbOfferRequest
): Promise<RgbOfferResponse> =>
JSON.parse(await BMC.create_offer(nostrHexSk, request));
export const cancelP2PBid = async (
nostrHexSk: string,
request: RgbCancelBidsRequest,
): Promise<RgbSwapCancelResponse> =>
JSON.parse(await BMC.cancel_p2p_bid(nostrHexSk, request));
export const createBid = async (
nostrHexSk: string,
request: RgbBidRequest
): Promise<RgbBidResponse> =>
JSON.parse(await BMC.create_bid(nostrHexSk, request));
export const createSwap = async (
nostrHexSk: string,
request: RgbSwapRequest
): Promise<RgbSwapResponse> =>
JSON.parse(await BMC.create_swap(nostrHexSk, request));
export const createAuctionOffer = async (
nostrHexSk: string,
request: RgbAuctionOfferRequest
): Promise<RgbAuctionBidResponse> =>
JSON.parse(await BMC.create_auction_offers(nostrHexSk, request));
nostrHexSk: string,
request: RgbOfferRequest,
secretKeys: String[]
): Promise<RgbOfferLocalResponse> =>
JSON.parse(await BMC.create_auction_offer(nostrHexSk, request, secretKeys));
export const createAuctionBid = async (
nostrHexSk: string,
request: RgbAuctionBidRequest
): Promise<RgbAuctionBidResponse> =>
JSON.parse(await BMC.create_auction_bid(nostrHexSk, request));
nostrHexSk: string,
request: RgbBidRequest,
secretKeys: String[],
): Promise<RgbBidLocalResponse> =>
JSON.parse(await BMC.create_auction_bid(nostrHexSk, request, secretKeys));
export const finishAuction = async (
nostrHexSk: string,
request: string
): Promise<RgbAuctionOfferResponse[]> =>
JSON.parse(await BMC.finish_auction_offers(nostrHexSk, request));
export const createAirdropOffer = async (
nostrHexSk: string,
request: RgbOfferRequest,
secretKeys: String[],
fee: bigint,
maxClaim: string,
): Promise<RgbOfferLocalResponse> =>
JSON.parse(await BMC.create_airdrop_offer(nostrHexSk, request, secretKeys, fee, maxClaim));
export const listAuctions = async (): Promise<RgbOffersResponse> =>
JSON.parse(await BMC.list_auctions());
export const createAirdropBid = async (
nostrHexSk: string,
request: RgbBidRequest,
): Promise<RgbBidLocalResponse> =>
JSON.parse(await BMC.create_airdrop_bid(nostrHexSk, request));
export const directSwap = async (
export const psbtSignFile = async (
nostrHexSk: string,
request: RgbBidRequest
): Promise<RgbSwapResponse> =>
JSON.parse(await BMC.direct_swap(nostrHexSk, request));
request: SignPsbtRequest
): Promise<SignedPsbtResponse> =>
JSON.parse(await BMC.psbt_sign_file(nostrHexSk, request));
export const publicOffers = async (
nostrHexSk: string
): Promise<PublicRgbOffersResponse> =>
JSON.parse(await BMC.public_offers(nostrHexSk));
export const psbtPublishFile = async (
request: PublishPsbtRequest
): Promise<SignedPsbtResponse> =>
JSON.parse(await BMC.psbt_publish_file(request));
export const myOrders = async (
nostrHexSk: string
): Promise<RgbOfferBidsResponse> => JSON.parse(await BMC.my_orders(nostrHexSk));
export const psbtSignAndPublishFile = async (
_nostrHexSk: string,
request: SignPsbtRequest
): Promise<PublishedPsbtResponse> =>
JSON.parse(await BMC.psbt_sign_and_publish_file(request));
export const myOffers = async (
nostrHexSk: string
): Promise<RgbOffersResponse> => JSON.parse(await BMC.my_offers(nostrHexSk));
export const decodeInvoice = async (
invoice: string
): Promise<RgbInvoiceDecoded> => JSON.parse(await BMC.decode_invoice(invoice));
export const myBids = async (nostrHexSk: string): Promise<RgbBidsResponse> =>
JSON.parse(await BMC.my_bids(nostrHexSk));
export const displayContractAmount = (
amount: bigint,
precision: number
): string => JSON.parse(BMC.to_contract_amount_string(amount, precision));
export const importConsignments = async (
request: ImportConsignmentsRequest
): Promise<boolean> => JSON.parse(await BMC.import_consignments(request));
export const getContractAmount = (amount: string): ContractAmount =>
JSON.parse(BMC.from_contract_amount_string(amount));
export const getConsignment = async (
consigOrReceiptId: string
): Promise<string> => JSON.parse(await BMC.get_consignment(consigOrReceiptId));
export const parseContractAmount = (
amount: string,
precision: number
): string => JSON.parse(BMC.format_contract_amount_string(amount, precision));
export const importUdaData = async (request: MediaRequest): Promise<boolean> =>
JSON.parse(await BMC.import_uda_data(request));
export const getVersion = (): string => JSON.parse(BMC.get_rgb_version());
export const getMedia = async (mediaId: string): Promise<MediaMetadata> =>
JSON.parse(await BMC.get_media_metadata(mediaId));
export const contractAmount = (amount: bigint, precision: number): bigint =>
JSON.parse(BMC.contract_amount(amount, precision).toString());
export const contractAmountStr = (amount: bigint, precision: number): String =>
JSON.parse(BMC.contract_amount_str(amount, precision));
export const contractAmountParseStr = (amount: string, precision: number): String =>
JSON.parse(BMC.contract_amount_parse_str(amount, precision).toString());
export const contractAmountParseValue = (amount: string, precision: number): bigint =>
JSON.parse(BMC.contract_amount_parse_value(amount, precision).toString());
export const contractDecimalParseValue = (amount: string): bigint =>
JSON.parse(BMC.contract_amount_parse_decimal_value(amount).toString());
// Core type interfaces based on structs defined within the bitmask-core Rust crate:
// https://github.com/diba-io/bitmask-core/blob/development/src/structs.rs
export interface ContractFormats {
/// The contract state (encoded in bech32m)
legacy: string;
/// The contract state (encoded in strict)
strict: string;
/// The contract state (compiled in armored mode)
armored: string;
export interface LocalResponse<T> {
data: T;
carbonado: RgbContainer;
}
export interface GenesisFormats {
/// The genesis state (encoded in bech32m)
legacy: string;
/// The genesis state (encoded in strict)
strict: string;
/// The contract state (compiled in armored mode)
armored: string;
export interface RgbContainer {
rgbStock?: string;
rgbAccount?: string;
rgbTransfers?: string;
}
/**
* @deprecated please use `IssueMediaRequest` instead
*/
export interface IssueMetadata {
uda?: MediaInfo[];
collectible?: NewCollectible[];
}
export interface FullIssueRequest {
export interface IssueRequest {
/// The ticker of the asset

@@ -285,3 +238,3 @@ ticker: string;

/// Amount of the asset
supply: bigint;
supply: string;
/// Precision of the asset

@@ -293,63 +246,37 @@ precision: number;

iface: string;
/// Chain Target
/// enum ChainTarget {
/// "bitcoin"
/// }
chain: string;
/// contract metadata (only RGB21/UDA)
meta?: MediaRequest;
meta?: IssueMedia;
}
export interface NewCollectible {
/// The ticker of the asset
ticker: string;
/// Name of the asset
name: string;
/// Description of the asset
description: string;
/// attachments and media
media: MediaInfo[];
}
export type ChainFee = {
value?: bigint;
feeRate?: number;
none?: string;
};
export interface UDADetail {
/// the token index of the uda
tokenIndex: number;
/// The ticker of the uda
ticker: string;
/// Name of the uda
name: string;
/// Description of the uda
description: string;
/// Media of the uda
media: MediaInfo[];
/// The user contract balance
balance: bigint;
/// The contract allocations
allocations: AllocationDetail[];
}
export interface ContractMediaDetail {
/// the token index of the uda
tokenIndex: number;
/// The ticker of the uda
ticker: string;
/// Name of the uda
name: string;
/// Description of the uda
description: string;
/// The user contract balance
balance: bigint;
/// The contract allocations
allocations: AllocationDetail[];
export interface IssueMedia {
/// Preview of the uda
preview?: MediaInfo;
preview?: MediaData;
/// Media of the uda
media?: MediaInfo;
media?: MediaData;
/// Attachments of the uda
attachments: MediaInfo[];
attachments: MediaData[];
}
/**
* @deprecated please use `ContractMediaDetail` instead
*/
export interface ContractMetadata {
uda?: UDADetail;
collectible?: UDADetail[];
export interface MediaData {
/// Mime Type of the media
type: string;
/// Source (aka. hyperlink) of the media
uri: string;
}
export type ContractResponse = IssueResponse;
export type IssueLocalResponse = LocalResponse<IssueResponse>;
export type ListContractsResponse = LocalResponse<ContractResponse[]>;
export interface IssueResponse {

@@ -362,2 +289,4 @@ /// The contract id

iface: string;
/// The Issue Method
issueMethod: string;
/// The Issue Utxo

@@ -369,2 +298,4 @@ issueUtxo: string;

name: string;
/// creation date (timestamp)
created: bigint;
/// Description of the asset

@@ -376,44 +307,6 @@ description: string;

precision: number;
/// The contract state (multiple formats)
contract: ContractFormats;
/// Genesis
genesis: GenesisFormats;
/// attachments and media (only RGB21/UDA)
meta?: ContractMediaDetail;
}
export interface ImportRequest {
/// The type data
/// enum ImportType {
/// "contract"
/// }
import: string;
/// The payload data (in hexadecimal)
data: string;
}
// In structs.rs this is called ContractResponse
export interface ImportResponse {
/// The contract id
contractId: string;
/// The contract impl id
iimplId: string;
/// The contract interface
iface: string;
/// The ticker of the asset
ticker: string;
/// Name of the asset
name: string;
/// Description of the asset
description: string;
/// Amount of the asset
supply: bigint;
/// Precision of the asset
precision: number;
/// The user contract balance
balance: bigint;
/// The user contract balance
balanceNormalized: number;
balance: ContractValue;
/// The contract allocations
allocations: AllocationDetail[];
allocations: ContractAllocation[];
/// The contract state (multiple formats)

@@ -424,135 +317,79 @@ contract: ContractFormats;

/// attachments and media (only RGB21/UDA)
meta?: ContractMediaDetail;
meta?: UDAItem;
}
export interface MediaInfo {
/// Mime Type of the media
type: string;
/// Source (aka. hyperlink) of the media
source: string;
}
export type ContractValue = {
value?: bigint;
uda?: Allocation;
};
// In structs.rs this is called SimpleContractResponse
export interface SimpleContractResponse {
/// The contract id
contractId: string;
/// The contract interface
ifaceId: string;
/// Precision of the asset
precision: number;
export interface Allocation {
tokenIndex: number;
fraction: bigint;
}
export interface InvoiceRequest {
/// The contract id
contractId: string;
/// The contract interface
iface: string;
/// Amount of the asset
amount: string;
/// UTXO or Blinded UTXO
seal: string;
/// Query parameters
params: { [key: string]: string };
}
export interface InvoiceResponse {
/// Invoice encoded in Baid58
invoice: string;
}
export interface PsbtRequest {
/// Asset UTXOs
assetInputs: PsbtInputRequest[];
/// Asset Descriptor Change
assetDescriptorChange: string;
/// Asset Terminal Change (default: /10/0)
assetTerminalChange: string;
/// Bitcoin UTXOs
bitcoinInputs: PsbtInputRequest[];
/// Bitcoin Change Addresses (format: {address}:{amount})
bitcoinChanges: string[];
/// Bitcoin Fee
fee: PsbtFeeRequest;
/// Allow RBF
rbf: boolean;
}
interface PsbtInputRequest {
/// Asset or Bitcoin Descriptor
descriptor: string;
/// Asset or Bitcoin UTXO
export interface ContractAllocation {
/// Anchored UTXO
utxo: string;
/// Asset or Bitcoin UTXO Terminal (ex. /0/0)
utxoTerminal: string;
/// Asset or Bitcoin Tweak
tapret?: string;
/// Asset or Bitcoin Tweak
sighHash?: PsbtSigHashRequest;
/// Asset Value
value: ContractValue;
/// Derivation Path
derivation: string;
/// Derivation Path
isMine: boolean;
/// Allocation spent?
isSpent: boolean;
}
interface PsbtSigHashRequest {
All: string;
/// 0x2: Sign no outputs --- anyone can choose the destination.
None: string;
/// 0x3: Sign the output whose index matches this input's index. If none exists,
/// sign the hash `0000000000000000000000000000000000000000000000000000000000000001`.
/// (This rule is probably an unintentional C++ism, but it's consensus so we have
/// to follow it.)
Single: string;
/// 0x81: Sign all outputs but only this input.
AllPlusAnyoneCanPay: string;
/// 0x82: Sign no outputs and only this input.
NonePlusAnyoneCanPay: string;
/// 0x83: Sign one output and only this input (see `Single` for what "one output" means).
SinglePlusAnyoneCanPay: string;
export interface UDAItem {
tokenIndex: number;
media: IssueMedia;
}
interface PsbtFeeRequest {
value?: number;
feeRate?: number;
export interface ContractFormats {
/// The contract state (encoded in strict)
strict: string;
/// The contract state (compiled in armored mode)
armored: string;
}
export interface PsbtResponse {
/// PSBT encoded in Base64
psbt: string;
/// Asset UTXO Terminal (ex. /0/0)
terminal: string;
export interface GenesisFormats {
/// The genesis state (encoded in strict)
strict: string;
}
export interface SignPsbtRequest {
/// PSBT encoded in Base64
psbt: string;
/// Descriptors to Sign
descriptors: string[];
export interface RgbInvoiceRequest {
/// The contract id
contractId?: string;
/// The contract interface
iface?: string;
/// Amount of the asset
amount: RgbInvoiceValue;
/// Seal Selection
seal?: RgbSealSelection;
/// Invoice Experation Date
expireAt?: number;
}
export interface PublishedPsbtResponse {
/// PSBT is signed?
sign: boolean;
/// TX id
txid: string;
export interface RgbSealSelection {
/// Chain/Network UTXO
utxo?: string;
/// Chain/Network Address
address?: string;
}
export interface SignedPsbtResponse {
/// PSBT is signed?
sign: boolean;
/// PSBT signed
psbt: string;
export interface RgbInvoiceValue {
/// Decimal representation
value?: string;
// Allocation representation
uda?: Allocation;
}
export interface PublishPsbtRequest {
/// PSBT encoded in Base64
psbt: string;
export type RgbInvoiceLocalResponse = LocalResponse<RgbInvoiceResponse>;
export interface RgbInvoiceResponse {
/// Invoice encoded in Baid58
invoice: string;
}
export interface RgbTransferRequest {
/// RGB Invoice
rgbInvoice: string;
/// PSBT File Information
psbt: string;
/// Asset UTXO Terminal (ex. /0/0)
terminal: string;
}
export interface FullRgbTransferRequest {
/// The contract id

@@ -563,9 +400,10 @@ contractId: string;

/// RGB Invoice
rgbInvoice: string;
/// Asset or Bitcoin Descriptor
descriptor: string;
/// Bitcoin Terminal Change
changeTerminal: string;
invoice: string;
/// Chain Target
/// enum ChainTarget {
/// "bitcoin"
/// }
chain: string;
/// Bitcoin Fee
fee: PsbtFeeRequest;
chainFee: ChainFee;
/// Bitcoin Change Addresses (format: {address}:{amount})

@@ -575,17 +413,18 @@ bitcoinChanges: string[];

export type RgbTransferLocalResponse = LocalResponse<RgbTransferResponse>;
export interface RgbTransferResponse {
/// Consignment ID
/// Consignment ID (in base58)
consigId: string;
/// Consignment encoded (in hexadecimal)
/// Consignment encoded (in armored)
consig: string;
/// PSBT File Information with tapret (in hexadecimal)
psbt: string;
/// Tapret Commitment (used to spend output)
commit: string;
/// Transfer Bitcoin L1 transaction id
txid: string;
/// PSBT File (in base64)
psbt: string;
/// Tapret Commitment
commit?: string;
}
export interface AcceptRequest {
/// Consignment encoded in hexadecimal
/// Consignment encoded in base58
consignment: string;

@@ -596,2 +435,3 @@ /// Force Consignment accept

export type RgbAcceptLocalResponse = LocalResponse<AcceptResponse>;
export interface AcceptResponse {

@@ -606,40 +446,39 @@ /// Transfer ID

export interface ContractsResponse {
/// List of available contracts
contracts: ImportResponse[];
export type ListTransfersResponse = LocalResponse<RgbTransferItem[]>;
export interface RgbTransferItem {
contractId: String;
transferId: String;
iface: String;
status: TxStatus;
isAccept: boolean;
isMine: boolean;
txid: String;
}
export interface ContractHiddenResponse {
/// The contract id
contractId: string;
/// is hidden
hidden: boolean;
export interface SignPsbtRequest {
/// PSBT encoded in Base64
psbt: string;
/// Descriptors to Sign
descriptors: string[];
}
export interface InterfacesResponse {
/// List of available interfaces and implementations
interfaces: InterfaceDetail[];
export interface SignedPsbtResponse {
/// PSBT is signed?
sign: boolean;
/// PSBT signed
psbt: string;
}
export interface InterfaceDetail {
/// Interface Name
name: string;
/// Interface ID
iface: string;
/// Interface ID
iimpl: string;
export interface PublishPsbtRequest {
/// PSBT encoded in Base64
psbt: string;
}
export interface SchemasResponse {
/// List of available schemas
schemas: SchemaDetail[];
export interface PublishedPsbtResponse {
/// PSBT is signed?
sign: boolean;
/// TX id
txid: string;
}
export interface SchemaDetail {
/// Schema ID
schema: string;
/// Available Interfaces
ifaces: string[];
}
export interface WatcherRequest {

@@ -657,18 +496,10 @@ /// The watcher name

name: string;
/// migrate?
migrate: boolean;
}
export interface UtxoResponse {
outpoint: string;
amount: bigint;
status: TxStatus;
}
export interface NextUtxoResponse {
utxo?: UtxoResponse;
utxo?: string;
}
export interface NextUtxosResponse {
utxos: UtxoResponse[];
}
export interface NextAddressResponse {

@@ -679,108 +510,2 @@ address: string;

export interface WatcherDetailResponse {
/// Allocations
contracts: WatcherDetail[];
}
export interface WatcherUtxoResponse {
utxos: string[];
}
export interface WatcherDetail {
/// Contract ID
contractId: string;
/// Allocations
allocations: AllocationDetail[];
}
export interface UDAPosition {
tokenIndex: number;
fraction: bigint;
}
export type AllocationValue = {
value?: bigint;
uda?: UDAPosition;
};
export interface AllocationDetail {
/// Anchored UTXO
utxo: string;
/// Asset Value
value: AllocationValue;
/// Derivation Path
derivation: string;
/// Derivation Path
isMine: boolean;
/// Allocation spent?
isSpent: boolean;
}
export interface DeclareRequest {
disclosure: string;
// disclosure: Declare; // TODO: Revisit after 0.6 release
changeTransfers: ChangeTansfer[];
transfers: FinalizeTransfer[];
}
export interface FinalizeTransfer {
previousUtxo: string;
consignment: string;
asset: string;
beneficiaries: BlindedOrNotOutpoint[];
}
export interface ChangeTansfer {
previousUtxo: string;
asset: string;
change: BlindedOrNotOutpoint;
}
export interface BlindedOrNotOutpoint {
outpoint: string;
balance: number;
}
export interface Contract {
id: string;
ticker: string;
name: string;
description: string;
allocations: AllocationDetail[];
balance: bigint;
genesis: string;
}
export interface RgbSaveTransferRequest {
/// iFace Name
iface: string;
/// Consignment encoded in hexadecimal
consignment: string;
}
export interface RgbRemoveTransferRequest {
/// Contract ID
contractId: string;
/// Consignment ID
consigIds: string[];
}
export interface RgbTransferStatusResponse {
/// Contract ID
contractId: string;
/// Transfer ID
consigStatus: Map<string, boolean>;
}
export interface RgbTransfersResponse {
/// List of available transfers
transfers: RgbTransferDetail[];
}
export interface RgbTransferDetail {
consigId: string;
status: TxStatus;
type: TransferType;
}
export interface TxStatus {

@@ -793,158 +518,76 @@ notFound?: any;

export interface TransferType {
sended?: any;
received?: any;
unknown?: any;
export interface RgbInvoiceDecoded {
contractId: string;
amount: RgbInvoiceValue;
}
export interface RgbInvoiceResponse {
contractId: string;
amount: bigint;
export interface ContractAmount {
int: bigint;
fract: bigint;
precision: number;
}
export interface BatchRgbTransferResponse {
transfers: BatchRgbTransferItem[];
export interface RgbOfferRequest {
/// The Offer Strategy
strategy: RgbSwap,
/// Offers
offers: RgbOfferItem[],
}
export interface BatchRgbTransferItem {
contractId: string;
consigId: string;
status: TxStatus;
isAccept: boolean;
iface: string;
txid: string;
export enum RgbSwap {
auction = "auction",
p2p = "p2p",
hotSwap = "hotswap",
airdrop = "airdrop"
}
export interface RgbOfferRequest {
export interface RgbOfferItem {
/// The Contract ID
contractId: string;
contractId: string,
/// The Contract Interface
iface: string;
iface: string,
/// Contract Amount
contractAmount: string;
assetAmount: string,
/// Bitcoin Price (in sats)
bitcoinPrice: bigint;
/// Universal Descriptor
descriptor: string;
/// Asset Terminal Change
changeTerminal: string;
/// Bitcoin Change Addresses (format: {address}:{amount})
bitcoinChanges: string[];
strategy: RgbSwapStrategy;
expireAt?: number;
bitcoinPrice: bigint,
/// Offer Expire Date
expireAt?: number
}
export enum RgbSwapStrategy {
Auction = "auction",
P2P = "p2p",
HotSwap = "hotswap",
}
export interface RgbAuctionStrategy {
auction?: string,
airdrop?: string,
}
export interface RgbAuctionOfferRequest {
offers: RgbOfferRequest[],
signKeys: string[],
strategy: RgbAuctionStrategy,
fee?: PsbtFeeRequest
}
export interface RgbOfferUpdateRequest {
export interface RgbOfferResponse {
/// The Contract ID
contract_id: string,
/// The Offer ID
offer_id: string,
// Swap PSBT
offer_psbt: string
}
export interface RgbOfferUpdateResponse {
offerId: string,
/// Share Key
sharedKey: string,
/// Order Status
status: string,
/// The Contract ID
contract_id: string,
/// The Offer ID
offer_id: string,
/// Updated?
updated: boolean
}
export interface RgbAuctionBidRequest {
/// The Offer ID
offerId: string,
/// Asset Amount
assetAmount: string,
/// Universal Descriptor
descriptor: string,
/// Bitcoin Terminal Change
changeTerminal: string,
/// Descriptors to Sign
signKeys: string[],
/// Bitcoin Fee
fee: PsbtFeeRequest,
}
export interface RgbAuctionBidResponse {
/// The Bid ID
bidId: string,
/// The Offer ID
offerId: string,
/// Fee Value
feeValue: number,
}
export interface RgbMatchResponse {
/// Transfer ID
consigId: string,
/// Offer ID
offerId: string,
/// Bid ID
bidId: string,
}
export interface RgbAuctionOfferResponse {
/// Offer ID
offerId: string,
/// Contract ID
contractId: string,
/// Asset/Contract Amount
/// Contract Amount
assetAmount: number,
/// Bitcoin Price
bitcoinPrice: number,
/// Bundle ID
bundleId: string,
}
export interface RgbOfferResponse {
/// The Contract ID
offerId: string;
/// The Contract ID
contractId: string;
/// Contract Amount
contractAmount: number;
/// Bitcoin Price
bitcoinPrice: bigint;
bitcoinPrice: bigint,
/// Seller Address
sellerAddress: string;
/// Seller PSBT (encoded in base64)
sellerPsbt: string;
sellerAddress: string,
/// Seller PSBT
sellerPsbt: string,
/// Bundle ID (collection)
bundleId?: string,
/// Expire Date
expireAt: number
}
export type RgbOfferLocalResponse = LocalResponse<RgbOfferResponse[]>
export interface RgbBidRequest {
/// The Offer ID
offerId: string;
offerId: string,
/// Asset Amount
assetAmount: string;
/// Universal Descriptor
descriptor: string;
/// Bitcoin Terminal Change
changeTerminal: string;
assetAmount: string,
/// Bitcoin Price
bitcoinPrice: bigint,
/// Bitcoin Fee
fee: PsbtFeeRequest;
fee: ChainFee,
/// Optional Bundle ID (For Auctions)
bundleId?: string
}

@@ -954,181 +597,63 @@

/// The Bid ID
bidId: string;
bidId: string,
/// The Offer ID
offerId: string;
offerId: string,
/// Contract Amount
assetAmount: number,
/// Bitcoin Price
bitcoinPrice: bigint,
/// Buyer Invoice
invoice: string;
invoice: string,
/// Final PSBT (encoded in base64)
swapPsbt: string;
swapPsbt?: string,
/// Fee Value
feeValue: bigint;
feeValue: bigint
}
export interface RgbSwapRequest {
/// Offer ID
offerId: string;
/// Bid ID
bidId: string;
/// Swap PSBT
swapPsbt: string;
}
export type RgbBidLocalResponse = LocalResponse<RgbBidResponse>;
export interface RgbSwapResponse {
/// Transfer ID
consigId: string;
/// Final Consig
finalConsig: string;
/// Final PSBT
finalPsbt: string;
}
export interface PublicRgbOffersResponse {
/// Offers
offers: PublicRgbOfferResponse[];
/// Public bids
bids: Map<string, PublicRgbBidResponse[]>;
}
export interface PublicRgbOfferResponse {
/// Offer ID
offerId: string;
/// Contract ID
contractId: string;
/// Offer PubKey
offerPub: string;
/// Asset/Contract Amount
assetAmount: bigint;
/// Bitcoin Price
bitcoinPrice: bigint;
/// Initial Offer PSBT
offerPsbt?: string;
}
export interface RgbAuctionFinishResponse {
export interface RgbAuctionCloseRequest {
/// Bundle ID
bundle_id: string,
/// New Change Outpoint
outpoint: string,
/// Sold Items
sold: Map<string, RgbSwapItem>,
/// Reamining Items
remaining: Map<string, RgbSwapItem>,
bundleId: string
}
export interface RgbSwapItem {
/// Contract ID
contractId: string,
/// Iface
iface: string,
/// Final Consig
contractAmount: string,
export interface RgbSwapRequest {
/// The Offer ID
offerId: string,
/// The Bid ID
bidId: string,
/// The Share Key
sharedKey: string
}
export interface PublicRgbBidResponse {
/// Bid ID
bidId: string;
/// Asset/Contract Amount
assetAmount: bigint;
/// Bitcoin Price
bitcoinPrice: bigint;
export interface RgbSwapResponse {
/// Consignment ID (in base58)
consigId: string,
/// Consignment (in armored)
consig: string,
/// L1 Transaction ID
txid: string,
/// PSBT File (in base64)
psbt: string
}
export interface RgbOfferBidsResponse {
/// Offers
offers: RgbOfferDetail[];
/// bids
bids: RgbBidDetail[];
export interface RgbCancelOffersRequest {
offers: string[],
}
export interface RgbOffersResponse {
/// Offers
offers: RgbOfferDetail[];
export interface RgbCancelBidsRequest {
bids: string[],
}
export interface RgbBidsResponse {
/// Bids
bids: RgbBidDetail[];
export interface RgbSwapCancelResponse {
records: number,
offers: string[],
bids: string[],
}
export interface RgbOfferDetail {
/// Contract ID
contractId: string;
/// Offer ID
offerId: string;
/// Offer Status
offerStatus: string;
/// Asset/Contract Amount
assetAmount: bigint;
/// Bitcoin Price
bitcoinPrice: bigint;
}
export interface RgbBidDetail {
/// Contract ID
contractId: string;
/// Bid ID
bidId: string;
/// Offer ID
offerId: string;
/// Bid Status
bidStatus: string;
/// Asset/Contract Amount
assetAmount: bigint;
/// Bitcoin Price
bitcoinPrice: bigint;
}
export interface IssueMediaRequest {
preview?: MediaInfo;
media?: MediaInfo;
attachments: MediaInfo[];
}
export interface MediaRequest {
preview?: MediaItemRequest;
media?: MediaItemRequest;
attachments: MediaItemRequest[];
}
export interface MediaExtractRequest {
encode: MediaEncode;
item: MediaItemRequest;
}
export interface MediaItemRequest {
/// Media Type
type: string;
/// Media URI
uri: string;
}
export interface MediaResponse {
preview?: MediaView;
media?: MediaView;
attachments: MediaView[];
}
export interface MediaView {
/// Media ID
id: string;
/// Media Type
type: string;
/// Media Encoded Representation
source: string;
/// Media Encoded Type
encode: MediaEncode;
}
export interface MediaEncode {
base64?: string;
sha2?: string;
blake3?: string;
}
export interface ImportConsignmentsRequest {
[consignmentId: string]: string;
}
export interface MediaMetadata {
id: string;
mime: string;
uri: string;
digest: string;
}
export interface RgbSwapValidationResponse {
valid: boolean,
message: string,
warnings: string[],
failures:string[],
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc