bitmask-core 1.0.6-beta.10 → 1.0.7-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bitmask_core.d.ts +27 -27
- package/bitmask_core.js +142 -142
- package/bitmask_core_bg.wasm +0 -0
- package/bitmask_core_bg.wasm.d.ts +16 -16
- package/package.json +1 -1
package/bitmask_core.d.ts
CHANGED
|
@@ -71,15 +71,6 @@ export function check_watcher(nostr_hex_sk: string): Promise<any>;
|
|
|
71
71
|
export function watcher_next_address(nostr_hex_sk: string, request: string): Promise<any>;
|
|
72
72
|
export function watcher_next_utxo(nostr_hex_sk: string, request: string): Promise<any>;
|
|
73
73
|
export function watcher_unspent_utxos(nostr_hex_sk: string, request: string): Promise<any>;
|
|
74
|
-
export function create_wallet(username: string, password: string): Promise<any>;
|
|
75
|
-
export function auth(username: string, password: string): Promise<any>;
|
|
76
|
-
export function ln_create_invoice(description: string, amount: number, token: string): Promise<any>;
|
|
77
|
-
export function get_balance(token: string): Promise<any>;
|
|
78
|
-
export function get_txs(token: string): Promise<any>;
|
|
79
|
-
export function pay_invoice(payment_request: string, token: string): Promise<any>;
|
|
80
|
-
export function check_payment(payment_hash: string): Promise<any>;
|
|
81
|
-
export function swap_btc_ln(token: string, ln_address?: string | null): Promise<any>;
|
|
82
|
-
export function swap_ln_btc(address: string, amount: bigint, token: string): Promise<any>;
|
|
83
74
|
export function store(secret_key: string, name: string, data: Uint8Array, force: boolean, metadata?: Uint8Array | null): Promise<any>;
|
|
84
75
|
export function retrieve(secret_key: string, name: string): Promise<any>;
|
|
85
76
|
export function retrieve_metadata(secret_key: string, name: string): Promise<any>;
|
|
@@ -87,6 +78,8 @@ export function encode_hex(bytes: Uint8Array): string;
|
|
|
87
78
|
export function encode_base64(bytes: Uint8Array): string;
|
|
88
79
|
export function decode_hex(string: string): Uint8Array;
|
|
89
80
|
export function decode_base64(string: string): Uint8Array;
|
|
81
|
+
export function new_nostr_pubkey(pubkey: string, token: string): Promise<any>;
|
|
82
|
+
export function update_nostr_pubkey(pubkey: string, token: string): Promise<any>;
|
|
90
83
|
export function convert_contract_amount_raw(decimal: string, precision: number): string;
|
|
91
84
|
export function convert_contract_amount_string(amount: bigint, precision: number): string;
|
|
92
85
|
export function parse_contract_amount(amount: string): any;
|
|
@@ -97,8 +90,15 @@ export function switch_network(network_str: string): Promise<any>;
|
|
|
97
90
|
export function get_env(key: string): Promise<any>;
|
|
98
91
|
export function set_env(key: string, value: string): Promise<any>;
|
|
99
92
|
export function sleep(ms: number): Promise<any>;
|
|
100
|
-
export function
|
|
101
|
-
export function
|
|
93
|
+
export function create_wallet(username: string, password: string): Promise<any>;
|
|
94
|
+
export function auth(username: string, password: string): Promise<any>;
|
|
95
|
+
export function ln_create_invoice(description: string, amount: number, token: string): Promise<any>;
|
|
96
|
+
export function get_balance(token: string): Promise<any>;
|
|
97
|
+
export function get_txs(token: string): Promise<any>;
|
|
98
|
+
export function pay_invoice(payment_request: string, token: string): Promise<any>;
|
|
99
|
+
export function check_payment(payment_hash: string): Promise<any>;
|
|
100
|
+
export function swap_btc_ln(token: string, ln_address?: string | null): Promise<any>;
|
|
101
|
+
export function swap_ln_btc(address: string, amount: bigint, token: string): Promise<any>;
|
|
102
102
|
|
|
103
103
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
104
104
|
|
|
@@ -171,15 +171,6 @@ export interface InitOutput {
|
|
|
171
171
|
readonly watcher_next_address: (a: number, b: number, c: number, d: number) => any;
|
|
172
172
|
readonly watcher_next_utxo: (a: number, b: number, c: number, d: number) => any;
|
|
173
173
|
readonly watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => any;
|
|
174
|
-
readonly create_wallet: (a: number, b: number, c: number, d: number) => any;
|
|
175
|
-
readonly auth: (a: number, b: number, c: number, d: number) => any;
|
|
176
|
-
readonly ln_create_invoice: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
177
|
-
readonly get_balance: (a: number, b: number) => any;
|
|
178
|
-
readonly get_txs: (a: number, b: number) => any;
|
|
179
|
-
readonly pay_invoice: (a: number, b: number, c: number, d: number) => any;
|
|
180
|
-
readonly check_payment: (a: number, b: number) => any;
|
|
181
|
-
readonly swap_btc_ln: (a: number, b: number, c: number, d: number) => any;
|
|
182
|
-
readonly swap_ln_btc: (a: number, b: number, c: bigint, d: number, e: number) => any;
|
|
183
174
|
readonly store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
184
175
|
readonly retrieve: (a: number, b: number, c: number, d: number) => any;
|
|
185
176
|
readonly retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
|
|
@@ -187,6 +178,8 @@ export interface InitOutput {
|
|
|
187
178
|
readonly encode_base64: (a: number, b: number) => [number, number];
|
|
188
179
|
readonly decode_hex: (a: number, b: number) => [number, number, number, number];
|
|
189
180
|
readonly decode_base64: (a: number, b: number) => [number, number, number, number];
|
|
181
|
+
readonly new_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
|
|
182
|
+
readonly update_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
|
|
190
183
|
readonly convert_contract_amount_raw: (a: number, b: number, c: number) => [number, number];
|
|
191
184
|
readonly convert_contract_amount_string: (a: bigint, b: number) => [number, number];
|
|
192
185
|
readonly parse_contract_amount: (a: number, b: number) => any;
|
|
@@ -197,8 +190,15 @@ export interface InitOutput {
|
|
|
197
190
|
readonly get_env: (a: number, b: number) => any;
|
|
198
191
|
readonly set_env: (a: number, b: number, c: number, d: number) => any;
|
|
199
192
|
readonly sleep: (a: number) => any;
|
|
200
|
-
readonly
|
|
201
|
-
readonly
|
|
193
|
+
readonly create_wallet: (a: number, b: number, c: number, d: number) => any;
|
|
194
|
+
readonly auth: (a: number, b: number, c: number, d: number) => any;
|
|
195
|
+
readonly ln_create_invoice: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
196
|
+
readonly get_balance: (a: number, b: number) => any;
|
|
197
|
+
readonly get_txs: (a: number, b: number) => any;
|
|
198
|
+
readonly pay_invoice: (a: number, b: number, c: number, d: number) => any;
|
|
199
|
+
readonly check_payment: (a: number, b: number) => any;
|
|
200
|
+
readonly swap_btc_ln: (a: number, b: number, c: number, d: number) => any;
|
|
201
|
+
readonly swap_ln_btc: (a: number, b: number, c: bigint, d: number, e: number) => any;
|
|
202
202
|
readonly rustsecp256k1_v0_9_2_context_create: (a: number) => number;
|
|
203
203
|
readonly rustsecp256k1_v0_9_2_context_destroy: (a: number) => void;
|
|
204
204
|
readonly rustsecp256k1_v0_9_2_default_illegal_callback_fn: (a: number, b: number) => void;
|
|
@@ -224,12 +224,12 @@ export interface InitOutput {
|
|
|
224
224
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
225
225
|
readonly __wbindgen_export_7: WebAssembly.Table;
|
|
226
226
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
227
|
-
readonly
|
|
228
|
-
readonly
|
|
229
|
-
readonly
|
|
227
|
+
readonly closure1445_externref_shim: (a: number, b: number, c: any) => void;
|
|
228
|
+
readonly closure2689_externref_shim: (a: number, b: number, c: any) => void;
|
|
229
|
+
readonly closure2720_externref_shim: (a: number, b: number, c: any) => void;
|
|
230
230
|
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ceba1bc0c075797: (a: number, b: number) => void;
|
|
231
|
-
readonly
|
|
232
|
-
readonly
|
|
231
|
+
readonly closure3900_externref_shim: (a: number, b: number, c: any) => void;
|
|
232
|
+
readonly closure4192_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
233
233
|
readonly __wbindgen_start: () => void;
|
|
234
234
|
}
|
|
235
235
|
|
package/bitmask_core.js
CHANGED
|
@@ -1092,125 +1092,6 @@ export function watcher_unspent_utxos(nostr_hex_sk, request) {
|
|
|
1092
1092
|
return ret;
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
|
-
/**
|
|
1096
|
-
* @param {string} username
|
|
1097
|
-
* @param {string} password
|
|
1098
|
-
* @returns {Promise<any>}
|
|
1099
|
-
*/
|
|
1100
|
-
export function create_wallet(username, password) {
|
|
1101
|
-
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1102
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1103
|
-
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1104
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1105
|
-
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
1106
|
-
return ret;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
/**
|
|
1110
|
-
* @param {string} username
|
|
1111
|
-
* @param {string} password
|
|
1112
|
-
* @returns {Promise<any>}
|
|
1113
|
-
*/
|
|
1114
|
-
export function auth(username, password) {
|
|
1115
|
-
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1116
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1117
|
-
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1118
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1119
|
-
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
1120
|
-
return ret;
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
/**
|
|
1124
|
-
* @param {string} description
|
|
1125
|
-
* @param {number} amount
|
|
1126
|
-
* @param {string} token
|
|
1127
|
-
* @returns {Promise<any>}
|
|
1128
|
-
*/
|
|
1129
|
-
export function ln_create_invoice(description, amount, token) {
|
|
1130
|
-
const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1131
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1132
|
-
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1133
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1134
|
-
const ret = wasm.ln_create_invoice(ptr0, len0, amount, ptr1, len1);
|
|
1135
|
-
return ret;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
/**
|
|
1139
|
-
* @param {string} token
|
|
1140
|
-
* @returns {Promise<any>}
|
|
1141
|
-
*/
|
|
1142
|
-
export function get_balance(token) {
|
|
1143
|
-
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1144
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1145
|
-
const ret = wasm.get_balance(ptr0, len0);
|
|
1146
|
-
return ret;
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
/**
|
|
1150
|
-
* @param {string} token
|
|
1151
|
-
* @returns {Promise<any>}
|
|
1152
|
-
*/
|
|
1153
|
-
export function get_txs(token) {
|
|
1154
|
-
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1155
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1156
|
-
const ret = wasm.get_txs(ptr0, len0);
|
|
1157
|
-
return ret;
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
/**
|
|
1161
|
-
* @param {string} payment_request
|
|
1162
|
-
* @param {string} token
|
|
1163
|
-
* @returns {Promise<any>}
|
|
1164
|
-
*/
|
|
1165
|
-
export function pay_invoice(payment_request, token) {
|
|
1166
|
-
const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1167
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1168
|
-
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1169
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1170
|
-
const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
|
|
1171
|
-
return ret;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
/**
|
|
1175
|
-
* @param {string} payment_hash
|
|
1176
|
-
* @returns {Promise<any>}
|
|
1177
|
-
*/
|
|
1178
|
-
export function check_payment(payment_hash) {
|
|
1179
|
-
const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1180
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1181
|
-
const ret = wasm.check_payment(ptr0, len0);
|
|
1182
|
-
return ret;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
/**
|
|
1186
|
-
* @param {string} token
|
|
1187
|
-
* @param {string | null} [ln_address]
|
|
1188
|
-
* @returns {Promise<any>}
|
|
1189
|
-
*/
|
|
1190
|
-
export function swap_btc_ln(token, ln_address) {
|
|
1191
|
-
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1192
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1193
|
-
var ptr1 = isLikeNone(ln_address) ? 0 : passStringToWasm0(ln_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1194
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1195
|
-
const ret = wasm.swap_btc_ln(ptr0, len0, ptr1, len1);
|
|
1196
|
-
return ret;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* @param {string} address
|
|
1201
|
-
* @param {bigint} amount
|
|
1202
|
-
* @param {string} token
|
|
1203
|
-
* @returns {Promise<any>}
|
|
1204
|
-
*/
|
|
1205
|
-
export function swap_ln_btc(address, amount, token) {
|
|
1206
|
-
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1207
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1208
|
-
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1209
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1210
|
-
const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
|
|
1211
|
-
return ret;
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
1095
|
function passArray8ToWasm0(arg, malloc) {
|
|
1215
1096
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1216
1097
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -1341,6 +1222,34 @@ export function decode_base64(string) {
|
|
|
1341
1222
|
return v2;
|
|
1342
1223
|
}
|
|
1343
1224
|
|
|
1225
|
+
/**
|
|
1226
|
+
* @param {string} pubkey
|
|
1227
|
+
* @param {string} token
|
|
1228
|
+
* @returns {Promise<any>}
|
|
1229
|
+
*/
|
|
1230
|
+
export function new_nostr_pubkey(pubkey, token) {
|
|
1231
|
+
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1232
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1233
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1234
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1235
|
+
const ret = wasm.new_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
1236
|
+
return ret;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* @param {string} pubkey
|
|
1241
|
+
* @param {string} token
|
|
1242
|
+
* @returns {Promise<any>}
|
|
1243
|
+
*/
|
|
1244
|
+
export function update_nostr_pubkey(pubkey, token) {
|
|
1245
|
+
const ptr0 = passStringToWasm0(pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1246
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1247
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1248
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1249
|
+
const ret = wasm.update_nostr_pubkey(ptr0, len0, ptr1, len1);
|
|
1250
|
+
return ret;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1344
1253
|
/**
|
|
1345
1254
|
* @param {string} decimal
|
|
1346
1255
|
* @param {number} precision
|
|
@@ -1472,43 +1381,134 @@ export function sleep(ms) {
|
|
|
1472
1381
|
}
|
|
1473
1382
|
|
|
1474
1383
|
/**
|
|
1475
|
-
* @param {string}
|
|
1384
|
+
* @param {string} username
|
|
1385
|
+
* @param {string} password
|
|
1386
|
+
* @returns {Promise<any>}
|
|
1387
|
+
*/
|
|
1388
|
+
export function create_wallet(username, password) {
|
|
1389
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1390
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1391
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1392
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1393
|
+
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
1394
|
+
return ret;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* @param {string} username
|
|
1399
|
+
* @param {string} password
|
|
1400
|
+
* @returns {Promise<any>}
|
|
1401
|
+
*/
|
|
1402
|
+
export function auth(username, password) {
|
|
1403
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1404
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1405
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1406
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1407
|
+
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
1408
|
+
return ret;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
/**
|
|
1412
|
+
* @param {string} description
|
|
1413
|
+
* @param {number} amount
|
|
1476
1414
|
* @param {string} token
|
|
1477
1415
|
* @returns {Promise<any>}
|
|
1478
1416
|
*/
|
|
1479
|
-
export function
|
|
1480
|
-
const ptr0 = passStringToWasm0(
|
|
1417
|
+
export function ln_create_invoice(description, amount, token) {
|
|
1418
|
+
const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1481
1419
|
const len0 = WASM_VECTOR_LEN;
|
|
1482
1420
|
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1483
1421
|
const len1 = WASM_VECTOR_LEN;
|
|
1484
|
-
const ret = wasm.
|
|
1422
|
+
const ret = wasm.ln_create_invoice(ptr0, len0, amount, ptr1, len1);
|
|
1485
1423
|
return ret;
|
|
1486
1424
|
}
|
|
1487
1425
|
|
|
1488
1426
|
/**
|
|
1489
|
-
* @param {string} pubkey
|
|
1490
1427
|
* @param {string} token
|
|
1491
1428
|
* @returns {Promise<any>}
|
|
1492
1429
|
*/
|
|
1493
|
-
export function
|
|
1494
|
-
const ptr0 = passStringToWasm0(
|
|
1430
|
+
export function get_balance(token) {
|
|
1431
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1432
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1433
|
+
const ret = wasm.get_balance(ptr0, len0);
|
|
1434
|
+
return ret;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* @param {string} token
|
|
1439
|
+
* @returns {Promise<any>}
|
|
1440
|
+
*/
|
|
1441
|
+
export function get_txs(token) {
|
|
1442
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1443
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1444
|
+
const ret = wasm.get_txs(ptr0, len0);
|
|
1445
|
+
return ret;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
/**
|
|
1449
|
+
* @param {string} payment_request
|
|
1450
|
+
* @param {string} token
|
|
1451
|
+
* @returns {Promise<any>}
|
|
1452
|
+
*/
|
|
1453
|
+
export function pay_invoice(payment_request, token) {
|
|
1454
|
+
const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1495
1455
|
const len0 = WASM_VECTOR_LEN;
|
|
1496
1456
|
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1497
1457
|
const len1 = WASM_VECTOR_LEN;
|
|
1498
|
-
const ret = wasm.
|
|
1458
|
+
const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
|
|
1459
|
+
return ret;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
/**
|
|
1463
|
+
* @param {string} payment_hash
|
|
1464
|
+
* @returns {Promise<any>}
|
|
1465
|
+
*/
|
|
1466
|
+
export function check_payment(payment_hash) {
|
|
1467
|
+
const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1468
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1469
|
+
const ret = wasm.check_payment(ptr0, len0);
|
|
1470
|
+
return ret;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
/**
|
|
1474
|
+
* @param {string} token
|
|
1475
|
+
* @param {string | null} [ln_address]
|
|
1476
|
+
* @returns {Promise<any>}
|
|
1477
|
+
*/
|
|
1478
|
+
export function swap_btc_ln(token, ln_address) {
|
|
1479
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1480
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1481
|
+
var ptr1 = isLikeNone(ln_address) ? 0 : passStringToWasm0(ln_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1482
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1483
|
+
const ret = wasm.swap_btc_ln(ptr0, len0, ptr1, len1);
|
|
1484
|
+
return ret;
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
/**
|
|
1488
|
+
* @param {string} address
|
|
1489
|
+
* @param {bigint} amount
|
|
1490
|
+
* @param {string} token
|
|
1491
|
+
* @returns {Promise<any>}
|
|
1492
|
+
*/
|
|
1493
|
+
export function swap_ln_btc(address, amount, token) {
|
|
1494
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1495
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1496
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1497
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1498
|
+
const ret = wasm.swap_ln_btc(ptr0, len0, amount, ptr1, len1);
|
|
1499
1499
|
return ret;
|
|
1500
1500
|
}
|
|
1501
1501
|
|
|
1502
1502
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
1503
|
-
wasm.
|
|
1503
|
+
wasm.closure1445_externref_shim(arg0, arg1, arg2);
|
|
1504
1504
|
}
|
|
1505
1505
|
|
|
1506
1506
|
function __wbg_adapter_57(arg0, arg1, arg2) {
|
|
1507
|
-
wasm.
|
|
1507
|
+
wasm.closure2689_externref_shim(arg0, arg1, arg2);
|
|
1508
1508
|
}
|
|
1509
1509
|
|
|
1510
1510
|
function __wbg_adapter_60(arg0, arg1, arg2) {
|
|
1511
|
-
wasm.
|
|
1511
|
+
wasm.closure2720_externref_shim(arg0, arg1, arg2);
|
|
1512
1512
|
}
|
|
1513
1513
|
|
|
1514
1514
|
function __wbg_adapter_63(arg0, arg1) {
|
|
@@ -1516,11 +1516,11 @@ function __wbg_adapter_63(arg0, arg1) {
|
|
|
1516
1516
|
}
|
|
1517
1517
|
|
|
1518
1518
|
function __wbg_adapter_66(arg0, arg1, arg2) {
|
|
1519
|
-
wasm.
|
|
1519
|
+
wasm.closure3900_externref_shim(arg0, arg1, arg2);
|
|
1520
1520
|
}
|
|
1521
1521
|
|
|
1522
1522
|
function __wbg_adapter_428(arg0, arg1, arg2, arg3) {
|
|
1523
|
-
wasm.
|
|
1523
|
+
wasm.closure4192_externref_shim(arg0, arg1, arg2, arg3);
|
|
1524
1524
|
}
|
|
1525
1525
|
|
|
1526
1526
|
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
@@ -2287,24 +2287,24 @@ function __wbg_get_imports() {
|
|
|
2287
2287
|
const ret = false;
|
|
2288
2288
|
return ret;
|
|
2289
2289
|
};
|
|
2290
|
-
imports.wbg.
|
|
2291
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2290
|
+
imports.wbg.__wbindgen_closure_wrapper11844 = function(arg0, arg1, arg2) {
|
|
2291
|
+
const ret = makeMutClosure(arg0, arg1, 2690, __wbg_adapter_57);
|
|
2292
2292
|
return ret;
|
|
2293
2293
|
};
|
|
2294
|
-
imports.wbg.
|
|
2295
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2294
|
+
imports.wbg.__wbindgen_closure_wrapper11926 = function(arg0, arg1, arg2) {
|
|
2295
|
+
const ret = makeMutClosure(arg0, arg1, 2721, __wbg_adapter_60);
|
|
2296
2296
|
return ret;
|
|
2297
2297
|
};
|
|
2298
|
-
imports.wbg.
|
|
2299
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2298
|
+
imports.wbg.__wbindgen_closure_wrapper12106 = function(arg0, arg1, arg2) {
|
|
2299
|
+
const ret = makeMutClosure(arg0, arg1, 2812, __wbg_adapter_63);
|
|
2300
2300
|
return ret;
|
|
2301
2301
|
};
|
|
2302
|
-
imports.wbg.
|
|
2303
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2302
|
+
imports.wbg.__wbindgen_closure_wrapper16496 = function(arg0, arg1, arg2) {
|
|
2303
|
+
const ret = makeMutClosure(arg0, arg1, 3901, __wbg_adapter_66);
|
|
2304
2304
|
return ret;
|
|
2305
2305
|
};
|
|
2306
|
-
imports.wbg.
|
|
2307
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2306
|
+
imports.wbg.__wbindgen_closure_wrapper5869 = function(arg0, arg1, arg2) {
|
|
2307
|
+
const ret = makeMutClosure(arg0, arg1, 1446, __wbg_adapter_54);
|
|
2308
2308
|
return ret;
|
|
2309
2309
|
};
|
|
2310
2310
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
package/bitmask_core_bg.wasm
CHANGED
|
Binary file
|
|
@@ -68,15 +68,6 @@ export const check_watcher: (a: number, b: number) => any;
|
|
|
68
68
|
export const watcher_next_address: (a: number, b: number, c: number, d: number) => any;
|
|
69
69
|
export const watcher_next_utxo: (a: number, b: number, c: number, d: number) => any;
|
|
70
70
|
export const watcher_unspent_utxos: (a: number, b: number, c: number, d: number) => any;
|
|
71
|
-
export const create_wallet: (a: number, b: number, c: number, d: number) => any;
|
|
72
|
-
export const auth: (a: number, b: number, c: number, d: number) => any;
|
|
73
|
-
export const ln_create_invoice: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
74
|
-
export const get_balance: (a: number, b: number) => any;
|
|
75
|
-
export const get_txs: (a: number, b: number) => any;
|
|
76
|
-
export const pay_invoice: (a: number, b: number, c: number, d: number) => any;
|
|
77
|
-
export const check_payment: (a: number, b: number) => any;
|
|
78
|
-
export const swap_btc_ln: (a: number, b: number, c: number, d: number) => any;
|
|
79
|
-
export const swap_ln_btc: (a: number, b: number, c: bigint, d: number, e: number) => any;
|
|
80
71
|
export const store: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
81
72
|
export const retrieve: (a: number, b: number, c: number, d: number) => any;
|
|
82
73
|
export const retrieve_metadata: (a: number, b: number, c: number, d: number) => any;
|
|
@@ -84,6 +75,8 @@ export const encode_hex: (a: number, b: number) => [number, number];
|
|
|
84
75
|
export const encode_base64: (a: number, b: number) => [number, number];
|
|
85
76
|
export const decode_hex: (a: number, b: number) => [number, number, number, number];
|
|
86
77
|
export const decode_base64: (a: number, b: number) => [number, number, number, number];
|
|
78
|
+
export const new_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
|
|
79
|
+
export const update_nostr_pubkey: (a: number, b: number, c: number, d: number) => any;
|
|
87
80
|
export const convert_contract_amount_raw: (a: number, b: number, c: number) => [number, number];
|
|
88
81
|
export const convert_contract_amount_string: (a: bigint, b: number) => [number, number];
|
|
89
82
|
export const parse_contract_amount: (a: number, b: number) => any;
|
|
@@ -94,8 +87,15 @@ export const switch_network: (a: number, b: number) => any;
|
|
|
94
87
|
export const get_env: (a: number, b: number) => any;
|
|
95
88
|
export const set_env: (a: number, b: number, c: number, d: number) => any;
|
|
96
89
|
export const sleep: (a: number) => any;
|
|
97
|
-
export const
|
|
98
|
-
export const
|
|
90
|
+
export const create_wallet: (a: number, b: number, c: number, d: number) => any;
|
|
91
|
+
export const auth: (a: number, b: number, c: number, d: number) => any;
|
|
92
|
+
export const ln_create_invoice: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
93
|
+
export const get_balance: (a: number, b: number) => any;
|
|
94
|
+
export const get_txs: (a: number, b: number) => any;
|
|
95
|
+
export const pay_invoice: (a: number, b: number, c: number, d: number) => any;
|
|
96
|
+
export const check_payment: (a: number, b: number) => any;
|
|
97
|
+
export const swap_btc_ln: (a: number, b: number, c: number, d: number) => any;
|
|
98
|
+
export const swap_ln_btc: (a: number, b: number, c: bigint, d: number, e: number) => any;
|
|
99
99
|
export const rustsecp256k1_v0_9_2_context_create: (a: number) => number;
|
|
100
100
|
export const rustsecp256k1_v0_9_2_context_destroy: (a: number) => void;
|
|
101
101
|
export const rustsecp256k1_v0_9_2_default_illegal_callback_fn: (a: number, b: number) => void;
|
|
@@ -121,10 +121,10 @@ export const __externref_drop_slice: (a: number, b: number) => void;
|
|
|
121
121
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
122
122
|
export const __wbindgen_export_7: WebAssembly.Table;
|
|
123
123
|
export const __externref_table_dealloc: (a: number) => void;
|
|
124
|
-
export const
|
|
125
|
-
export const
|
|
126
|
-
export const
|
|
124
|
+
export const closure1445_externref_shim: (a: number, b: number, c: any) => void;
|
|
125
|
+
export const closure2689_externref_shim: (a: number, b: number, c: any) => void;
|
|
126
|
+
export const closure2720_externref_shim: (a: number, b: number, c: any) => void;
|
|
127
127
|
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ceba1bc0c075797: (a: number, b: number) => void;
|
|
128
|
-
export const
|
|
129
|
-
export const
|
|
128
|
+
export const closure3900_externref_shim: (a: number, b: number, c: any) => void;
|
|
129
|
+
export const closure4192_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
130
130
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED