bitmask-core 0.5.2 → 0.6.0-beta.0
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/README.md +16 -7
- package/bitmask_core.d.ts +99 -70
- package/bitmask_core_bg.js +272 -199
- package/bitmask_core_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,15 +52,24 @@ Upon a new release, follow these steps:
|
|
|
52
52
|
1. Run `cargo +nightly udeps` to see if there are any unused dependencies.
|
|
53
53
|
|
|
54
54
|
## Docker
|
|
55
|
+
For running bitmask-core tests in Regtest Mode, please follow the steps below:
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
2. Up and running containers: `docker compose up -d node1`
|
|
57
|
+
### Initial Setup
|
|
58
|
+
1. Build bitcoin node + electrum: `docker-compose build`.
|
|
59
|
+
2. Up and running Docker containers: `docker-compose up -d node1`.
|
|
60
60
|
3. Load the command line: `source .commands`
|
|
61
|
-
4.
|
|
62
|
-
5.
|
|
63
|
-
6.
|
|
61
|
+
4. Download and install BDK cli: `cargo install bdk-cli`. We will use BDK to generate the mnemonic.
|
|
62
|
+
5. Generate a new mnemonic: `bdk-cli generate`.
|
|
63
|
+
6. Create an environment variable called **TEST_WALLET_SEED** with mnemonic generated in the **step 5**.
|
|
64
|
+
7. Run the test to get main address: `cargo test --test wallet -- create_wallet --exact`.
|
|
65
|
+
8. Load your wallet in the bitcoin node: `node1 loadwallet default`.
|
|
66
|
+
9. Generate new first 500 blocks: `node1 -generate 500`.
|
|
67
|
+
10. Send some coins to the main wallet address: `node1 sendtoaddress {ADDRESS} 10`. Change `{ADDRESS}` with the address generated in the **step 7**.
|
|
68
|
+
11. Mine a new block: `node1 -generate 1`
|
|
69
|
+
12. Run the test to check the balance: `cargo test --test wallet -- get_wallet_balance --exact`.
|
|
70
|
+
|
|
71
|
+
### Running the tests
|
|
72
|
+
Running the tests: `cargo test --test-threads 1`
|
|
64
73
|
|
|
65
74
|
### Troubleshooting
|
|
66
75
|
|
package/bitmask_core.d.ts
CHANGED
|
@@ -1,6 +1,79 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* @param {string} username
|
|
5
|
+
* @param {string} password
|
|
6
|
+
* @returns {Promise<any>}
|
|
7
|
+
*/
|
|
8
|
+
export function create_wallet(username: string, password: string): Promise<any>;
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} username
|
|
11
|
+
* @param {string} password
|
|
12
|
+
* @returns {Promise<any>}
|
|
13
|
+
*/
|
|
14
|
+
export function auth(username: string, password: string): Promise<any>;
|
|
15
|
+
/**
|
|
16
|
+
* @param {string} description
|
|
17
|
+
* @param {number} amount
|
|
18
|
+
* @param {string} token
|
|
19
|
+
* @returns {Promise<any>}
|
|
20
|
+
*/
|
|
21
|
+
export function ln_create_invoice(description: string, amount: number, token: string): Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* @param {string} token
|
|
24
|
+
* @returns {Promise<any>}
|
|
25
|
+
*/
|
|
26
|
+
export function get_balance(token: string): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* @param {string} token
|
|
29
|
+
* @returns {Promise<any>}
|
|
30
|
+
*/
|
|
31
|
+
export function get_txs(token: string): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* @param {string} payment_request
|
|
34
|
+
* @param {string} token
|
|
35
|
+
* @returns {Promise<any>}
|
|
36
|
+
*/
|
|
37
|
+
export function pay_invoice(payment_request: string, token: string): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* @param {string} payment_hash
|
|
40
|
+
* @returns {Promise<any>}
|
|
41
|
+
*/
|
|
42
|
+
export function check_payment(payment_hash: string): Promise<any>;
|
|
43
|
+
/**
|
|
44
|
+
* @returns {Promise<any>}
|
|
45
|
+
*/
|
|
46
|
+
export function get_network(): Promise<any>;
|
|
47
|
+
/**
|
|
48
|
+
* @param {string} network_str
|
|
49
|
+
* @returns {Promise<any>}
|
|
50
|
+
*/
|
|
51
|
+
export function switch_network(network_str: string): Promise<any>;
|
|
52
|
+
/**
|
|
53
|
+
* @param {string} key
|
|
54
|
+
* @returns {Promise<any>}
|
|
55
|
+
*/
|
|
56
|
+
export function get_env(key: string): Promise<any>;
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} key
|
|
59
|
+
* @param {string} value
|
|
60
|
+
* @returns {Promise<any>}
|
|
61
|
+
*/
|
|
62
|
+
export function set_env(key: string, value: string): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* @param {string} secret_key
|
|
65
|
+
* @param {string} name
|
|
66
|
+
* @param {Uint8Array} data
|
|
67
|
+
* @returns {Promise<any>}
|
|
68
|
+
*/
|
|
69
|
+
export function store(secret_key: string, name: string, data: Uint8Array): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* @param {string} secret_key
|
|
72
|
+
* @param {string} name
|
|
73
|
+
* @returns {Promise<any>}
|
|
74
|
+
*/
|
|
75
|
+
export function retrieve(secret_key: string, name: string): Promise<any>;
|
|
76
|
+
/**
|
|
4
77
|
* @param {string} password
|
|
5
78
|
* @param {string} encrypted_descriptors
|
|
6
79
|
* @returns {Promise<any>}
|
|
@@ -26,17 +99,6 @@ export function save_mnemonic_seed(mnemonic: string, encryption_password: string
|
|
|
26
99
|
*/
|
|
27
100
|
export function get_wallet_data(descriptor: string, change_descriptor?: string): Promise<any>;
|
|
28
101
|
/**
|
|
29
|
-
* @param {string} asset
|
|
30
|
-
* @param {string} utxo
|
|
31
|
-
* @returns {Promise<any>}
|
|
32
|
-
*/
|
|
33
|
-
export function import_asset(asset: string, utxo: string): Promise<any>;
|
|
34
|
-
/**
|
|
35
|
-
* @param {string} utxo_string
|
|
36
|
-
* @returns {Promise<any>}
|
|
37
|
-
*/
|
|
38
|
-
export function get_blinded_utxo(utxo_string: string): Promise<any>;
|
|
39
|
-
/**
|
|
40
102
|
* @param {string} descriptor
|
|
41
103
|
* @param {string} change_descriptor
|
|
42
104
|
* @param {string} destination
|
|
@@ -63,89 +125,56 @@ export function fund_vault(descriptor: string, change_descriptor: string, addres
|
|
|
63
125
|
*/
|
|
64
126
|
export function get_assets_vault(rgb_assets_descriptor_xpub: string, rgb_udas_descriptor_xpub: string): Promise<any>;
|
|
65
127
|
/**
|
|
128
|
+
* @param {string} nostr_hex_sk
|
|
66
129
|
* @param {string} ticker
|
|
67
130
|
* @param {string} name
|
|
131
|
+
* @param {string} description
|
|
68
132
|
* @param {number} precision
|
|
69
133
|
* @param {bigint} supply
|
|
70
|
-
* @param {string}
|
|
134
|
+
* @param {string} seal
|
|
135
|
+
* @param {string} iface
|
|
71
136
|
* @returns {Promise<any>}
|
|
72
137
|
*/
|
|
73
|
-
export function
|
|
138
|
+
export function issue_contract(nostr_hex_sk: string, ticker: string, name: string, description: string, precision: number, supply: bigint, seal: string, iface: string): Promise<any>;
|
|
74
139
|
/**
|
|
75
|
-
* @param {
|
|
76
|
-
* @
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
* @param {string} rgb_descriptor_xprv
|
|
81
|
-
* @param {string} psbt
|
|
82
|
-
* @returns {Promise<any>}
|
|
83
|
-
*/
|
|
84
|
-
export function sign_psbt(rgb_descriptor_xprv: string, psbt: string): Promise<any>;
|
|
85
|
-
/**
|
|
86
|
-
* @param {string} consignment
|
|
87
|
-
* @param {string} blinding_factor
|
|
88
|
-
* @param {string} outpoint
|
|
89
|
-
* @param {string} blinded
|
|
90
|
-
* @returns {Promise<any>}
|
|
91
|
-
*/
|
|
92
|
-
export function accept_transfer(consignment: string, blinding_factor: string, outpoint: string, blinded: string): Promise<any>;
|
|
93
|
-
/**
|
|
94
|
-
* @returns {Promise<any>}
|
|
95
|
-
*/
|
|
96
|
-
export function get_network(): Promise<any>;
|
|
97
|
-
/**
|
|
98
|
-
* @param {string} network_str
|
|
99
|
-
* @returns {Promise<any>}
|
|
100
|
-
*/
|
|
101
|
-
export function switch_network(network_str: string): Promise<any>;
|
|
102
|
-
/**
|
|
103
|
-
* @param {string} path
|
|
104
|
-
* @returns {Promise<any>}
|
|
105
|
-
*/
|
|
106
|
-
export function get_endpoint(path: string): Promise<any>;
|
|
107
|
-
/**
|
|
108
|
-
* @param {string} host
|
|
109
|
-
* @returns {Promise<any>}
|
|
110
|
-
*/
|
|
111
|
-
export function switch_host(host: string): Promise<any>;
|
|
112
|
-
/**
|
|
113
|
-
* @param {string} username
|
|
114
|
-
* @param {string} password
|
|
140
|
+
* @param {string} nostr_hex_sk
|
|
141
|
+
* @param {string} contract_id
|
|
142
|
+
* @param {string} iface
|
|
143
|
+
* @param {bigint} amount
|
|
144
|
+
* @param {string} seal
|
|
115
145
|
* @returns {Promise<any>}
|
|
116
146
|
*/
|
|
117
|
-
export function
|
|
147
|
+
export function rgb_create_invoice(nostr_hex_sk: string, contract_id: string, iface: string, amount: bigint, seal: string): Promise<any>;
|
|
118
148
|
/**
|
|
119
|
-
* @param {string}
|
|
120
|
-
* @param {
|
|
149
|
+
* @param {string} nostr_hex_sk
|
|
150
|
+
* @param {any} request
|
|
121
151
|
* @returns {Promise<any>}
|
|
122
152
|
*/
|
|
123
|
-
export function
|
|
153
|
+
export function create_psbt(nostr_hex_sk: string, request: any): Promise<any>;
|
|
124
154
|
/**
|
|
125
|
-
* @param {string}
|
|
126
|
-
* @param {
|
|
127
|
-
* @param {string} token
|
|
155
|
+
* @param {string} nostr_hex_sk
|
|
156
|
+
* @param {any} request
|
|
128
157
|
* @returns {Promise<any>}
|
|
129
158
|
*/
|
|
130
|
-
export function
|
|
159
|
+
export function pay_asset(nostr_hex_sk: string, request: any): Promise<any>;
|
|
131
160
|
/**
|
|
132
|
-
* @param {string}
|
|
161
|
+
* @param {string} nostr_hex_sk
|
|
162
|
+
* @param {any} request
|
|
133
163
|
* @returns {Promise<any>}
|
|
134
164
|
*/
|
|
135
|
-
export function
|
|
165
|
+
export function accept_transfer(nostr_hex_sk: string, request: any): Promise<any>;
|
|
136
166
|
/**
|
|
137
|
-
* @param {string}
|
|
167
|
+
* @param {string} nostr_hex_sk
|
|
138
168
|
* @returns {Promise<any>}
|
|
139
169
|
*/
|
|
140
|
-
export function
|
|
170
|
+
export function list_contracts(nostr_hex_sk: string): Promise<any>;
|
|
141
171
|
/**
|
|
142
|
-
* @param {string}
|
|
143
|
-
* @param {string} token
|
|
172
|
+
* @param {string} nostr_hex_sk
|
|
144
173
|
* @returns {Promise<any>}
|
|
145
174
|
*/
|
|
146
|
-
export function
|
|
175
|
+
export function list_interfaces(nostr_hex_sk: string): Promise<any>;
|
|
147
176
|
/**
|
|
148
|
-
* @param {string}
|
|
177
|
+
* @param {string} nostr_hex_sk
|
|
149
178
|
* @returns {Promise<any>}
|
|
150
179
|
*/
|
|
151
|
-
export function
|
|
180
|
+
export function list_schemas(nostr_hex_sk: string): Promise<any>;
|
package/bitmask_core_bg.js
CHANGED
|
@@ -24,11 +24,7 @@ function takeObject(idx) {
|
|
|
24
24
|
return ret;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
30
|
-
|
|
31
|
-
cachedTextDecoder.decode();
|
|
27
|
+
let WASM_VECTOR_LEN = 0;
|
|
32
28
|
|
|
33
29
|
let cachedUint8Memory0 = null;
|
|
34
30
|
|
|
@@ -39,21 +35,6 @@ function getUint8Memory0() {
|
|
|
39
35
|
return cachedUint8Memory0;
|
|
40
36
|
}
|
|
41
37
|
|
|
42
|
-
function getStringFromWasm0(ptr, len) {
|
|
43
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function addHeapObject(obj) {
|
|
47
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
48
|
-
const idx = heap_next;
|
|
49
|
-
heap_next = heap[idx];
|
|
50
|
-
|
|
51
|
-
heap[idx] = obj;
|
|
52
|
-
return idx;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
let WASM_VECTOR_LEN = 0;
|
|
56
|
-
|
|
57
38
|
const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
|
|
58
39
|
|
|
59
40
|
let cachedTextEncoder = new lTextEncoder('utf-8');
|
|
@@ -122,6 +103,25 @@ function getInt32Memory0() {
|
|
|
122
103
|
return cachedInt32Memory0;
|
|
123
104
|
}
|
|
124
105
|
|
|
106
|
+
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
107
|
+
|
|
108
|
+
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
109
|
+
|
|
110
|
+
cachedTextDecoder.decode();
|
|
111
|
+
|
|
112
|
+
function getStringFromWasm0(ptr, len) {
|
|
113
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function addHeapObject(obj) {
|
|
117
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
118
|
+
const idx = heap_next;
|
|
119
|
+
heap_next = heap[idx];
|
|
120
|
+
|
|
121
|
+
heap[idx] = obj;
|
|
122
|
+
return idx;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
125
|
let cachedFloat64Memory0 = null;
|
|
126
126
|
|
|
127
127
|
function getFloat64Memory0() {
|
|
@@ -230,339 +230,410 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
230
230
|
return real;
|
|
231
231
|
}
|
|
232
232
|
function __wbg_adapter_44(arg0, arg1, arg2) {
|
|
233
|
-
wasm.
|
|
233
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h528495516eecdc38(arg0, arg1, addHeapObject(arg2));
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
/**
|
|
237
|
+
* @param {string} username
|
|
237
238
|
* @param {string} password
|
|
238
|
-
* @param {string} encrypted_descriptors
|
|
239
239
|
* @returns {Promise<any>}
|
|
240
240
|
*/
|
|
241
|
-
export function
|
|
242
|
-
const ptr0 = passStringToWasm0(
|
|
241
|
+
export function create_wallet(username, password) {
|
|
242
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
243
243
|
const len0 = WASM_VECTOR_LEN;
|
|
244
|
-
const ptr1 = passStringToWasm0(
|
|
244
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
245
245
|
const len1 = WASM_VECTOR_LEN;
|
|
246
|
-
const ret = wasm.
|
|
246
|
+
const ret = wasm.create_wallet(ptr0, len0, ptr1, len1);
|
|
247
247
|
return takeObject(ret);
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
/**
|
|
251
|
-
* @param {string}
|
|
252
|
-
* @param {string}
|
|
251
|
+
* @param {string} username
|
|
252
|
+
* @param {string} password
|
|
253
253
|
* @returns {Promise<any>}
|
|
254
254
|
*/
|
|
255
|
-
export function
|
|
256
|
-
const ptr0 = passStringToWasm0(
|
|
255
|
+
export function auth(username, password) {
|
|
256
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
257
257
|
const len0 = WASM_VECTOR_LEN;
|
|
258
|
-
const ptr1 = passStringToWasm0(
|
|
258
|
+
const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
259
259
|
const len1 = WASM_VECTOR_LEN;
|
|
260
|
-
const ret = wasm.
|
|
260
|
+
const ret = wasm.auth(ptr0, len0, ptr1, len1);
|
|
261
261
|
return takeObject(ret);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
/**
|
|
265
|
-
* @param {string}
|
|
266
|
-
* @param {
|
|
267
|
-
* @param {string}
|
|
265
|
+
* @param {string} description
|
|
266
|
+
* @param {number} amount
|
|
267
|
+
* @param {string} token
|
|
268
268
|
* @returns {Promise<any>}
|
|
269
269
|
*/
|
|
270
|
-
export function
|
|
271
|
-
const ptr0 = passStringToWasm0(
|
|
270
|
+
export function ln_create_invoice(description, amount, token) {
|
|
271
|
+
const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
272
272
|
const len0 = WASM_VECTOR_LEN;
|
|
273
|
-
const ptr1 = passStringToWasm0(
|
|
273
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
274
274
|
const len1 = WASM_VECTOR_LEN;
|
|
275
|
-
const
|
|
276
|
-
const len2 = WASM_VECTOR_LEN;
|
|
277
|
-
const ret = wasm.save_mnemonic_seed(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
275
|
+
const ret = wasm.ln_create_invoice(ptr0, len0, amount, ptr1, len1);
|
|
278
276
|
return takeObject(ret);
|
|
279
277
|
}
|
|
280
278
|
|
|
281
279
|
/**
|
|
282
|
-
* @param {string}
|
|
283
|
-
* @param {string | undefined} change_descriptor
|
|
280
|
+
* @param {string} token
|
|
284
281
|
* @returns {Promise<any>}
|
|
285
282
|
*/
|
|
286
|
-
export function
|
|
287
|
-
const ptr0 = passStringToWasm0(
|
|
283
|
+
export function get_balance(token) {
|
|
284
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
288
285
|
const len0 = WASM_VECTOR_LEN;
|
|
289
|
-
|
|
290
|
-
var len1 = WASM_VECTOR_LEN;
|
|
291
|
-
const ret = wasm.get_wallet_data(ptr0, len0, ptr1, len1);
|
|
286
|
+
const ret = wasm.get_balance(ptr0, len0);
|
|
292
287
|
return takeObject(ret);
|
|
293
288
|
}
|
|
294
289
|
|
|
295
290
|
/**
|
|
296
|
-
* @param {string}
|
|
297
|
-
* @param {string} utxo
|
|
291
|
+
* @param {string} token
|
|
298
292
|
* @returns {Promise<any>}
|
|
299
293
|
*/
|
|
300
|
-
export function
|
|
301
|
-
const ptr0 = passStringToWasm0(
|
|
294
|
+
export function get_txs(token) {
|
|
295
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
302
296
|
const len0 = WASM_VECTOR_LEN;
|
|
303
|
-
const
|
|
297
|
+
const ret = wasm.get_txs(ptr0, len0);
|
|
298
|
+
return takeObject(ret);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @param {string} payment_request
|
|
303
|
+
* @param {string} token
|
|
304
|
+
* @returns {Promise<any>}
|
|
305
|
+
*/
|
|
306
|
+
export function pay_invoice(payment_request, token) {
|
|
307
|
+
const ptr0 = passStringToWasm0(payment_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
308
|
+
const len0 = WASM_VECTOR_LEN;
|
|
309
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
304
310
|
const len1 = WASM_VECTOR_LEN;
|
|
305
|
-
const ret = wasm.
|
|
311
|
+
const ret = wasm.pay_invoice(ptr0, len0, ptr1, len1);
|
|
306
312
|
return takeObject(ret);
|
|
307
313
|
}
|
|
308
314
|
|
|
309
315
|
/**
|
|
310
|
-
* @param {string}
|
|
316
|
+
* @param {string} payment_hash
|
|
311
317
|
* @returns {Promise<any>}
|
|
312
318
|
*/
|
|
313
|
-
export function
|
|
314
|
-
const ptr0 = passStringToWasm0(
|
|
319
|
+
export function check_payment(payment_hash) {
|
|
320
|
+
const ptr0 = passStringToWasm0(payment_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
315
321
|
const len0 = WASM_VECTOR_LEN;
|
|
316
|
-
const ret = wasm.
|
|
322
|
+
const ret = wasm.check_payment(ptr0, len0);
|
|
317
323
|
return takeObject(ret);
|
|
318
324
|
}
|
|
319
325
|
|
|
320
326
|
/**
|
|
321
|
-
* @param {string} descriptor
|
|
322
|
-
* @param {string} change_descriptor
|
|
323
|
-
* @param {string} destination
|
|
324
|
-
* @param {bigint} amount
|
|
325
|
-
* @param {number | undefined} fee_rate
|
|
326
327
|
* @returns {Promise<any>}
|
|
327
328
|
*/
|
|
328
|
-
export function
|
|
329
|
-
const
|
|
329
|
+
export function get_network() {
|
|
330
|
+
const ret = wasm.get_network();
|
|
331
|
+
return takeObject(ret);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @param {string} network_str
|
|
336
|
+
* @returns {Promise<any>}
|
|
337
|
+
*/
|
|
338
|
+
export function switch_network(network_str) {
|
|
339
|
+
const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
330
340
|
const len0 = WASM_VECTOR_LEN;
|
|
331
|
-
const
|
|
332
|
-
const len1 = WASM_VECTOR_LEN;
|
|
333
|
-
const ptr2 = passStringToWasm0(destination, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
334
|
-
const len2 = WASM_VECTOR_LEN;
|
|
335
|
-
const ret = wasm.send_sats(ptr0, len0, ptr1, len1, ptr2, len2, amount, !isLikeNone(fee_rate), isLikeNone(fee_rate) ? 0 : fee_rate);
|
|
341
|
+
const ret = wasm.switch_network(ptr0, len0);
|
|
336
342
|
return takeObject(ret);
|
|
337
343
|
}
|
|
338
344
|
|
|
339
345
|
/**
|
|
340
|
-
* @param {string}
|
|
341
|
-
* @param {string} change_descriptor
|
|
342
|
-
* @param {string} address
|
|
343
|
-
* @param {string} uda_address
|
|
344
|
-
* @param {bigint} asset_amount
|
|
345
|
-
* @param {bigint} uda_amount
|
|
346
|
-
* @param {number | undefined} fee_rate
|
|
346
|
+
* @param {string} key
|
|
347
347
|
* @returns {Promise<any>}
|
|
348
348
|
*/
|
|
349
|
-
export function
|
|
350
|
-
const ptr0 = passStringToWasm0(
|
|
349
|
+
export function get_env(key) {
|
|
350
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
351
351
|
const len0 = WASM_VECTOR_LEN;
|
|
352
|
-
const
|
|
353
|
-
const len1 = WASM_VECTOR_LEN;
|
|
354
|
-
const ptr2 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
355
|
-
const len2 = WASM_VECTOR_LEN;
|
|
356
|
-
const ptr3 = passStringToWasm0(uda_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
357
|
-
const len3 = WASM_VECTOR_LEN;
|
|
358
|
-
const ret = wasm.fund_vault(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, asset_amount, uda_amount, !isLikeNone(fee_rate), isLikeNone(fee_rate) ? 0 : fee_rate);
|
|
352
|
+
const ret = wasm.get_env(ptr0, len0);
|
|
359
353
|
return takeObject(ret);
|
|
360
354
|
}
|
|
361
355
|
|
|
362
356
|
/**
|
|
363
|
-
* @param {string}
|
|
364
|
-
* @param {string}
|
|
357
|
+
* @param {string} key
|
|
358
|
+
* @param {string} value
|
|
365
359
|
* @returns {Promise<any>}
|
|
366
360
|
*/
|
|
367
|
-
export function
|
|
368
|
-
const ptr0 = passStringToWasm0(
|
|
361
|
+
export function set_env(key, value) {
|
|
362
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
369
363
|
const len0 = WASM_VECTOR_LEN;
|
|
370
|
-
const ptr1 = passStringToWasm0(
|
|
364
|
+
const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
371
365
|
const len1 = WASM_VECTOR_LEN;
|
|
372
|
-
const ret = wasm.
|
|
366
|
+
const ret = wasm.set_env(ptr0, len0, ptr1, len1);
|
|
373
367
|
return takeObject(ret);
|
|
374
368
|
}
|
|
375
369
|
|
|
370
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
371
|
+
const ptr = malloc(arg.length * 1);
|
|
372
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
373
|
+
WASM_VECTOR_LEN = arg.length;
|
|
374
|
+
return ptr;
|
|
375
|
+
}
|
|
376
376
|
/**
|
|
377
|
-
* @param {string}
|
|
377
|
+
* @param {string} secret_key
|
|
378
378
|
* @param {string} name
|
|
379
|
-
* @param {
|
|
380
|
-
* @param {bigint} supply
|
|
381
|
-
* @param {string} utxo
|
|
379
|
+
* @param {Uint8Array} data
|
|
382
380
|
* @returns {Promise<any>}
|
|
383
381
|
*/
|
|
384
|
-
export function
|
|
385
|
-
const ptr0 = passStringToWasm0(
|
|
382
|
+
export function store(secret_key, name, data) {
|
|
383
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
386
384
|
const len0 = WASM_VECTOR_LEN;
|
|
387
385
|
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
388
386
|
const len1 = WASM_VECTOR_LEN;
|
|
389
|
-
const ptr2 =
|
|
387
|
+
const ptr2 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
390
388
|
const len2 = WASM_VECTOR_LEN;
|
|
391
|
-
const ret = wasm.
|
|
389
|
+
const ret = wasm.store(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
392
390
|
return takeObject(ret);
|
|
393
391
|
}
|
|
394
392
|
|
|
395
393
|
/**
|
|
396
|
-
* @param {
|
|
394
|
+
* @param {string} secret_key
|
|
395
|
+
* @param {string} name
|
|
397
396
|
* @returns {Promise<any>}
|
|
398
397
|
*/
|
|
399
|
-
export function
|
|
400
|
-
const
|
|
398
|
+
export function retrieve(secret_key, name) {
|
|
399
|
+
const ptr0 = passStringToWasm0(secret_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
400
|
+
const len0 = WASM_VECTOR_LEN;
|
|
401
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
402
|
+
const len1 = WASM_VECTOR_LEN;
|
|
403
|
+
const ret = wasm.retrieve(ptr0, len0, ptr1, len1);
|
|
401
404
|
return takeObject(ret);
|
|
402
405
|
}
|
|
403
406
|
|
|
404
407
|
/**
|
|
405
|
-
* @param {string}
|
|
406
|
-
* @param {string}
|
|
408
|
+
* @param {string} password
|
|
409
|
+
* @param {string} encrypted_descriptors
|
|
407
410
|
* @returns {Promise<any>}
|
|
408
411
|
*/
|
|
409
|
-
export function
|
|
410
|
-
const ptr0 = passStringToWasm0(
|
|
412
|
+
export function get_encrypted_wallet(password, encrypted_descriptors) {
|
|
413
|
+
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
411
414
|
const len0 = WASM_VECTOR_LEN;
|
|
412
|
-
const ptr1 = passStringToWasm0(
|
|
415
|
+
const ptr1 = passStringToWasm0(encrypted_descriptors, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
413
416
|
const len1 = WASM_VECTOR_LEN;
|
|
414
|
-
const ret = wasm.
|
|
417
|
+
const ret = wasm.get_encrypted_wallet(ptr0, len0, ptr1, len1);
|
|
415
418
|
return takeObject(ret);
|
|
416
419
|
}
|
|
417
420
|
|
|
418
421
|
/**
|
|
419
|
-
* @param {string}
|
|
420
|
-
* @param {string}
|
|
421
|
-
* @param {string} outpoint
|
|
422
|
-
* @param {string} blinded
|
|
422
|
+
* @param {string} encryption_password
|
|
423
|
+
* @param {string} seed_password
|
|
423
424
|
* @returns {Promise<any>}
|
|
424
425
|
*/
|
|
425
|
-
export function
|
|
426
|
-
const ptr0 = passStringToWasm0(
|
|
426
|
+
export function get_mnemonic_seed(encryption_password, seed_password) {
|
|
427
|
+
const ptr0 = passStringToWasm0(encryption_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
427
428
|
const len0 = WASM_VECTOR_LEN;
|
|
428
|
-
const ptr1 = passStringToWasm0(
|
|
429
|
+
const ptr1 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
429
430
|
const len1 = WASM_VECTOR_LEN;
|
|
430
|
-
const
|
|
431
|
-
const len2 = WASM_VECTOR_LEN;
|
|
432
|
-
const ptr3 = passStringToWasm0(blinded, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
433
|
-
const len3 = WASM_VECTOR_LEN;
|
|
434
|
-
const ret = wasm.accept_transfer(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
431
|
+
const ret = wasm.get_mnemonic_seed(ptr0, len0, ptr1, len1);
|
|
435
432
|
return takeObject(ret);
|
|
436
433
|
}
|
|
437
434
|
|
|
438
435
|
/**
|
|
436
|
+
* @param {string} mnemonic
|
|
437
|
+
* @param {string} encryption_password
|
|
438
|
+
* @param {string} seed_password
|
|
439
439
|
* @returns {Promise<any>}
|
|
440
440
|
*/
|
|
441
|
-
export function
|
|
442
|
-
const
|
|
441
|
+
export function save_mnemonic_seed(mnemonic, encryption_password, seed_password) {
|
|
442
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
443
|
+
const len0 = WASM_VECTOR_LEN;
|
|
444
|
+
const ptr1 = passStringToWasm0(encryption_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
445
|
+
const len1 = WASM_VECTOR_LEN;
|
|
446
|
+
const ptr2 = passStringToWasm0(seed_password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
447
|
+
const len2 = WASM_VECTOR_LEN;
|
|
448
|
+
const ret = wasm.save_mnemonic_seed(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
443
449
|
return takeObject(ret);
|
|
444
450
|
}
|
|
445
451
|
|
|
446
452
|
/**
|
|
447
|
-
* @param {string}
|
|
453
|
+
* @param {string} descriptor
|
|
454
|
+
* @param {string | undefined} change_descriptor
|
|
448
455
|
* @returns {Promise<any>}
|
|
449
456
|
*/
|
|
450
|
-
export function
|
|
451
|
-
const ptr0 = passStringToWasm0(
|
|
457
|
+
export function get_wallet_data(descriptor, change_descriptor) {
|
|
458
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
452
459
|
const len0 = WASM_VECTOR_LEN;
|
|
453
|
-
|
|
460
|
+
var ptr1 = isLikeNone(change_descriptor) ? 0 : passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
461
|
+
var len1 = WASM_VECTOR_LEN;
|
|
462
|
+
const ret = wasm.get_wallet_data(ptr0, len0, ptr1, len1);
|
|
454
463
|
return takeObject(ret);
|
|
455
464
|
}
|
|
456
465
|
|
|
457
466
|
/**
|
|
458
|
-
* @param {string}
|
|
467
|
+
* @param {string} descriptor
|
|
468
|
+
* @param {string} change_descriptor
|
|
469
|
+
* @param {string} destination
|
|
470
|
+
* @param {bigint} amount
|
|
471
|
+
* @param {number | undefined} fee_rate
|
|
459
472
|
* @returns {Promise<any>}
|
|
460
473
|
*/
|
|
461
|
-
export function
|
|
462
|
-
const ptr0 = passStringToWasm0(
|
|
474
|
+
export function send_sats(descriptor, change_descriptor, destination, amount, fee_rate) {
|
|
475
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
463
476
|
const len0 = WASM_VECTOR_LEN;
|
|
464
|
-
const
|
|
477
|
+
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
478
|
+
const len1 = WASM_VECTOR_LEN;
|
|
479
|
+
const ptr2 = passStringToWasm0(destination, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
480
|
+
const len2 = WASM_VECTOR_LEN;
|
|
481
|
+
const ret = wasm.send_sats(ptr0, len0, ptr1, len1, ptr2, len2, amount, !isLikeNone(fee_rate), isLikeNone(fee_rate) ? 0 : fee_rate);
|
|
465
482
|
return takeObject(ret);
|
|
466
483
|
}
|
|
467
484
|
|
|
468
485
|
/**
|
|
469
|
-
* @param {string}
|
|
486
|
+
* @param {string} descriptor
|
|
487
|
+
* @param {string} change_descriptor
|
|
488
|
+
* @param {string} address
|
|
489
|
+
* @param {string} uda_address
|
|
490
|
+
* @param {bigint} asset_amount
|
|
491
|
+
* @param {bigint} uda_amount
|
|
492
|
+
* @param {number | undefined} fee_rate
|
|
470
493
|
* @returns {Promise<any>}
|
|
471
494
|
*/
|
|
472
|
-
export function
|
|
473
|
-
const ptr0 = passStringToWasm0(
|
|
495
|
+
export function fund_vault(descriptor, change_descriptor, address, uda_address, asset_amount, uda_amount, fee_rate) {
|
|
496
|
+
const ptr0 = passStringToWasm0(descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
474
497
|
const len0 = WASM_VECTOR_LEN;
|
|
475
|
-
const
|
|
498
|
+
const ptr1 = passStringToWasm0(change_descriptor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
499
|
+
const len1 = WASM_VECTOR_LEN;
|
|
500
|
+
const ptr2 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
501
|
+
const len2 = WASM_VECTOR_LEN;
|
|
502
|
+
const ptr3 = passStringToWasm0(uda_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
503
|
+
const len3 = WASM_VECTOR_LEN;
|
|
504
|
+
const ret = wasm.fund_vault(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, asset_amount, uda_amount, !isLikeNone(fee_rate), isLikeNone(fee_rate) ? 0 : fee_rate);
|
|
476
505
|
return takeObject(ret);
|
|
477
506
|
}
|
|
478
507
|
|
|
479
508
|
/**
|
|
480
|
-
* @param {string}
|
|
481
|
-
* @param {string}
|
|
509
|
+
* @param {string} rgb_assets_descriptor_xpub
|
|
510
|
+
* @param {string} rgb_udas_descriptor_xpub
|
|
482
511
|
* @returns {Promise<any>}
|
|
483
512
|
*/
|
|
484
|
-
export function
|
|
485
|
-
const ptr0 = passStringToWasm0(
|
|
513
|
+
export function get_assets_vault(rgb_assets_descriptor_xpub, rgb_udas_descriptor_xpub) {
|
|
514
|
+
const ptr0 = passStringToWasm0(rgb_assets_descriptor_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
486
515
|
const len0 = WASM_VECTOR_LEN;
|
|
487
|
-
const ptr1 = passStringToWasm0(
|
|
516
|
+
const ptr1 = passStringToWasm0(rgb_udas_descriptor_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
488
517
|
const len1 = WASM_VECTOR_LEN;
|
|
489
|
-
const ret = wasm.
|
|
518
|
+
const ret = wasm.get_assets_vault(ptr0, len0, ptr1, len1);
|
|
490
519
|
return takeObject(ret);
|
|
491
520
|
}
|
|
492
521
|
|
|
493
522
|
/**
|
|
494
|
-
* @param {string}
|
|
495
|
-
* @param {string}
|
|
523
|
+
* @param {string} nostr_hex_sk
|
|
524
|
+
* @param {string} ticker
|
|
525
|
+
* @param {string} name
|
|
526
|
+
* @param {string} description
|
|
527
|
+
* @param {number} precision
|
|
528
|
+
* @param {bigint} supply
|
|
529
|
+
* @param {string} seal
|
|
530
|
+
* @param {string} iface
|
|
496
531
|
* @returns {Promise<any>}
|
|
497
532
|
*/
|
|
498
|
-
export function
|
|
499
|
-
const ptr0 = passStringToWasm0(
|
|
533
|
+
export function issue_contract(nostr_hex_sk, ticker, name, description, precision, supply, seal, iface) {
|
|
534
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
500
535
|
const len0 = WASM_VECTOR_LEN;
|
|
501
|
-
const ptr1 = passStringToWasm0(
|
|
536
|
+
const ptr1 = passStringToWasm0(ticker, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
502
537
|
const len1 = WASM_VECTOR_LEN;
|
|
503
|
-
const
|
|
538
|
+
const ptr2 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
539
|
+
const len2 = WASM_VECTOR_LEN;
|
|
540
|
+
const ptr3 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
541
|
+
const len3 = WASM_VECTOR_LEN;
|
|
542
|
+
const ptr4 = passStringToWasm0(seal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
543
|
+
const len4 = WASM_VECTOR_LEN;
|
|
544
|
+
const ptr5 = passStringToWasm0(iface, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
545
|
+
const len5 = WASM_VECTOR_LEN;
|
|
546
|
+
const ret = wasm.issue_contract(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, precision, supply, ptr4, len4, ptr5, len5);
|
|
504
547
|
return takeObject(ret);
|
|
505
548
|
}
|
|
506
549
|
|
|
507
550
|
/**
|
|
508
|
-
* @param {string}
|
|
509
|
-
* @param {
|
|
510
|
-
* @param {string}
|
|
551
|
+
* @param {string} nostr_hex_sk
|
|
552
|
+
* @param {string} contract_id
|
|
553
|
+
* @param {string} iface
|
|
554
|
+
* @param {bigint} amount
|
|
555
|
+
* @param {string} seal
|
|
511
556
|
* @returns {Promise<any>}
|
|
512
557
|
*/
|
|
513
|
-
export function
|
|
514
|
-
const ptr0 = passStringToWasm0(
|
|
558
|
+
export function rgb_create_invoice(nostr_hex_sk, contract_id, iface, amount, seal) {
|
|
559
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
515
560
|
const len0 = WASM_VECTOR_LEN;
|
|
516
|
-
const ptr1 = passStringToWasm0(
|
|
561
|
+
const ptr1 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
517
562
|
const len1 = WASM_VECTOR_LEN;
|
|
518
|
-
const
|
|
563
|
+
const ptr2 = passStringToWasm0(iface, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
564
|
+
const len2 = WASM_VECTOR_LEN;
|
|
565
|
+
const ptr3 = passStringToWasm0(seal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
566
|
+
const len3 = WASM_VECTOR_LEN;
|
|
567
|
+
const ret = wasm.rgb_create_invoice(ptr0, len0, ptr1, len1, ptr2, len2, amount, ptr3, len3);
|
|
519
568
|
return takeObject(ret);
|
|
520
569
|
}
|
|
521
570
|
|
|
522
571
|
/**
|
|
523
|
-
* @param {string}
|
|
572
|
+
* @param {string} nostr_hex_sk
|
|
573
|
+
* @param {any} request
|
|
524
574
|
* @returns {Promise<any>}
|
|
525
575
|
*/
|
|
526
|
-
export function
|
|
527
|
-
const ptr0 = passStringToWasm0(
|
|
576
|
+
export function create_psbt(nostr_hex_sk, request) {
|
|
577
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
528
578
|
const len0 = WASM_VECTOR_LEN;
|
|
529
|
-
const ret = wasm.
|
|
579
|
+
const ret = wasm.create_psbt(ptr0, len0, addHeapObject(request));
|
|
530
580
|
return takeObject(ret);
|
|
531
581
|
}
|
|
532
582
|
|
|
533
583
|
/**
|
|
534
|
-
* @param {string}
|
|
584
|
+
* @param {string} nostr_hex_sk
|
|
585
|
+
* @param {any} request
|
|
535
586
|
* @returns {Promise<any>}
|
|
536
587
|
*/
|
|
537
|
-
export function
|
|
538
|
-
const ptr0 = passStringToWasm0(
|
|
588
|
+
export function pay_asset(nostr_hex_sk, request) {
|
|
589
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
539
590
|
const len0 = WASM_VECTOR_LEN;
|
|
540
|
-
const ret = wasm.
|
|
591
|
+
const ret = wasm.pay_asset(ptr0, len0, addHeapObject(request));
|
|
541
592
|
return takeObject(ret);
|
|
542
593
|
}
|
|
543
594
|
|
|
544
595
|
/**
|
|
545
|
-
* @param {string}
|
|
546
|
-
* @param {
|
|
596
|
+
* @param {string} nostr_hex_sk
|
|
597
|
+
* @param {any} request
|
|
547
598
|
* @returns {Promise<any>}
|
|
548
599
|
*/
|
|
549
|
-
export function
|
|
550
|
-
const ptr0 = passStringToWasm0(
|
|
600
|
+
export function accept_transfer(nostr_hex_sk, request) {
|
|
601
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
551
602
|
const len0 = WASM_VECTOR_LEN;
|
|
552
|
-
const
|
|
553
|
-
const len1 = WASM_VECTOR_LEN;
|
|
554
|
-
const ret = wasm.ln_pay_invoice(ptr0, len0, ptr1, len1);
|
|
603
|
+
const ret = wasm.accept_transfer(ptr0, len0, addHeapObject(request));
|
|
555
604
|
return takeObject(ret);
|
|
556
605
|
}
|
|
557
606
|
|
|
558
607
|
/**
|
|
559
|
-
* @param {string}
|
|
608
|
+
* @param {string} nostr_hex_sk
|
|
560
609
|
* @returns {Promise<any>}
|
|
561
610
|
*/
|
|
562
|
-
export function
|
|
563
|
-
const ptr0 = passStringToWasm0(
|
|
611
|
+
export function list_contracts(nostr_hex_sk) {
|
|
612
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
613
|
+
const len0 = WASM_VECTOR_LEN;
|
|
614
|
+
const ret = wasm.list_contracts(ptr0, len0);
|
|
615
|
+
return takeObject(ret);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* @param {string} nostr_hex_sk
|
|
620
|
+
* @returns {Promise<any>}
|
|
621
|
+
*/
|
|
622
|
+
export function list_interfaces(nostr_hex_sk) {
|
|
623
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
624
|
+
const len0 = WASM_VECTOR_LEN;
|
|
625
|
+
const ret = wasm.list_interfaces(ptr0, len0);
|
|
626
|
+
return takeObject(ret);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* @param {string} nostr_hex_sk
|
|
631
|
+
* @returns {Promise<any>}
|
|
632
|
+
*/
|
|
633
|
+
export function list_schemas(nostr_hex_sk) {
|
|
634
|
+
const ptr0 = passStringToWasm0(nostr_hex_sk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
564
635
|
const len0 = WASM_VECTOR_LEN;
|
|
565
|
-
const ret = wasm.
|
|
636
|
+
const ret = wasm.list_schemas(ptr0, len0);
|
|
566
637
|
return takeObject(ret);
|
|
567
638
|
}
|
|
568
639
|
|
|
@@ -592,23 +663,14 @@ function handleError(f, args) {
|
|
|
592
663
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
593
664
|
}
|
|
594
665
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
598
|
-
}
|
|
599
|
-
function __wbg_adapter_157(arg0, arg1, arg2, arg3) {
|
|
600
|
-
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3e61d16b57f4f2a2(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
666
|
+
function __wbg_adapter_163(arg0, arg1, arg2, arg3) {
|
|
667
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h018b8fdd3fb29b86(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
601
668
|
}
|
|
602
669
|
|
|
603
670
|
export function __wbindgen_object_drop_ref(arg0) {
|
|
604
671
|
takeObject(arg0);
|
|
605
672
|
};
|
|
606
673
|
|
|
607
|
-
export function __wbindgen_string_new(arg0, arg1) {
|
|
608
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
609
|
-
return addHeapObject(ret);
|
|
610
|
-
};
|
|
611
|
-
|
|
612
674
|
export function __wbindgen_string_get(arg0, arg1) {
|
|
613
675
|
const obj = getObject(arg1);
|
|
614
676
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -623,6 +685,11 @@ export function __wbindgen_error_new(arg0, arg1) {
|
|
|
623
685
|
return addHeapObject(ret);
|
|
624
686
|
};
|
|
625
687
|
|
|
688
|
+
export function __wbindgen_string_new(arg0, arg1) {
|
|
689
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
690
|
+
return addHeapObject(ret);
|
|
691
|
+
};
|
|
692
|
+
|
|
626
693
|
export function __wbindgen_is_object(arg0) {
|
|
627
694
|
const val = getObject(arg0);
|
|
628
695
|
const ret = typeof(val) === 'object' && val !== null;
|
|
@@ -687,7 +754,7 @@ export function __wbindgen_object_clone_ref(arg0) {
|
|
|
687
754
|
return addHeapObject(ret);
|
|
688
755
|
};
|
|
689
756
|
|
|
690
|
-
export function
|
|
757
|
+
export function __wbg_getwithrefkey_5e6d9547403deab8(arg0, arg1) {
|
|
691
758
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
692
759
|
return addHeapObject(ret);
|
|
693
760
|
};
|
|
@@ -719,6 +786,12 @@ export function __wbg_debug_783a3d4910bc24c7(arg0, arg1) {
|
|
|
719
786
|
console.debug(...v0);
|
|
720
787
|
};
|
|
721
788
|
|
|
789
|
+
export function __wbg_error_71d6845bf00a930f(arg0, arg1) {
|
|
790
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
791
|
+
wasm.__wbindgen_free(arg0, arg1 * 4);
|
|
792
|
+
console.error(...v0);
|
|
793
|
+
};
|
|
794
|
+
|
|
722
795
|
export function __wbg_info_0d469cecacab90cb(arg0, arg1) {
|
|
723
796
|
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
724
797
|
wasm.__wbindgen_free(arg0, arg1 * 4);
|
|
@@ -731,7 +804,7 @@ export function __wbg_trace_fe50dc146726736b(arg0, arg1) {
|
|
|
731
804
|
console.trace(...v0);
|
|
732
805
|
};
|
|
733
806
|
|
|
734
|
-
export function
|
|
807
|
+
export function __wbg_fetch_56a6919da5e4c21c(arg0) {
|
|
735
808
|
const ret = fetch(getObject(arg0));
|
|
736
809
|
return addHeapObject(ret);
|
|
737
810
|
};
|
|
@@ -808,30 +881,30 @@ export function __wbg_newwithstrandinit_c45f0dc6da26fd03() { return handleError(
|
|
|
808
881
|
return addHeapObject(ret);
|
|
809
882
|
}, arguments) };
|
|
810
883
|
|
|
811
|
-
export function
|
|
812
|
-
getObject(arg0).
|
|
884
|
+
export function __wbg_getRandomValues_3774744e221a22ad() { return handleError(function (arg0, arg1) {
|
|
885
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
813
886
|
}, arguments) };
|
|
814
887
|
|
|
815
|
-
export function
|
|
816
|
-
getObject(arg0).
|
|
888
|
+
export function __wbg_randomFillSync_e950366c42764a07() { return handleError(function (arg0, arg1) {
|
|
889
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
817
890
|
}, arguments) };
|
|
818
891
|
|
|
819
|
-
export function
|
|
892
|
+
export function __wbg_crypto_70a96de3b6b73dac(arg0) {
|
|
820
893
|
const ret = getObject(arg0).crypto;
|
|
821
894
|
return addHeapObject(ret);
|
|
822
895
|
};
|
|
823
896
|
|
|
824
|
-
export function
|
|
897
|
+
export function __wbg_process_dd1577445152112e(arg0) {
|
|
825
898
|
const ret = getObject(arg0).process;
|
|
826
899
|
return addHeapObject(ret);
|
|
827
900
|
};
|
|
828
901
|
|
|
829
|
-
export function
|
|
902
|
+
export function __wbg_versions_58036bec3add9e6f(arg0) {
|
|
830
903
|
const ret = getObject(arg0).versions;
|
|
831
904
|
return addHeapObject(ret);
|
|
832
905
|
};
|
|
833
906
|
|
|
834
|
-
export function
|
|
907
|
+
export function __wbg_node_6a9d28205ed5b0d8(arg0) {
|
|
835
908
|
const ret = getObject(arg0).node;
|
|
836
909
|
return addHeapObject(ret);
|
|
837
910
|
};
|
|
@@ -841,12 +914,12 @@ export function __wbindgen_is_string(arg0) {
|
|
|
841
914
|
return ret;
|
|
842
915
|
};
|
|
843
916
|
|
|
844
|
-
export function
|
|
917
|
+
export function __wbg_msCrypto_adbc770ec9eca9c7(arg0) {
|
|
845
918
|
const ret = getObject(arg0).msCrypto;
|
|
846
919
|
return addHeapObject(ret);
|
|
847
920
|
};
|
|
848
921
|
|
|
849
|
-
export function
|
|
922
|
+
export function __wbg_require_f05d779769764e82() { return handleError(function () {
|
|
850
923
|
const ret = module.require;
|
|
851
924
|
return addHeapObject(ret);
|
|
852
925
|
}, arguments) };
|
|
@@ -969,7 +1042,7 @@ export function __wbg_new_9d3a9ce4282a18a8(arg0, arg1) {
|
|
|
969
1042
|
const a = state0.a;
|
|
970
1043
|
state0.a = 0;
|
|
971
1044
|
try {
|
|
972
|
-
return
|
|
1045
|
+
return __wbg_adapter_163(a, state0.b, arg0, arg1);
|
|
973
1046
|
} finally {
|
|
974
1047
|
state0.a = a;
|
|
975
1048
|
}
|
|
@@ -1080,8 +1153,8 @@ export function __wbindgen_memory() {
|
|
|
1080
1153
|
return addHeapObject(ret);
|
|
1081
1154
|
};
|
|
1082
1155
|
|
|
1083
|
-
export function
|
|
1084
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1156
|
+
export function __wbindgen_closure_wrapper10223(arg0, arg1, arg2) {
|
|
1157
|
+
const ret = makeMutClosure(arg0, arg1, 2598, __wbg_adapter_44);
|
|
1085
1158
|
return addHeapObject(ret);
|
|
1086
1159
|
};
|
|
1087
1160
|
|
package/bitmask_core_bg.wasm
CHANGED
|
Binary file
|