lwk_node 0.12.0 → 0.12.1

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/lwk_wasm.d.ts CHANGED
@@ -159,7 +159,7 @@ export class Amp0Connected {
159
159
  *
160
160
  * This must be signed with [`amp0_sign_challenge()`].
161
161
  */
162
- get_challenge(): Promise<string>;
162
+ getChallenge(): Promise<string>;
163
163
  /**
164
164
  * Log in
165
165
  *
@@ -177,25 +177,25 @@ export class Amp0LoggedIn {
177
177
  /**
178
178
  * List of AMP IDs.
179
179
  */
180
- get_amp_ids(): string[];
180
+ getAmpIds(): string[];
181
181
  /**
182
182
  * Get the next account for AMP0 account creation
183
183
  *
184
184
  * This must be given to [`amp0_account_xpub()`] to obtain the xpub to pass to
185
185
  * [`Amp0LoggedIn::create_amp0_account()`]
186
186
  */
187
- next_account(): number;
187
+ nextAccount(): number;
188
188
  /**
189
189
  * Create a new AMP0 account
190
190
  *
191
191
  * `account_xpub` must be obtained from [`amp0_account_xpub()`] called with the value obtained from
192
192
  * [`Amp0LoggedIn::next_account()`]
193
193
  */
194
- create_amp0_account(pointer: number, account_xpub: string): Promise<string>;
194
+ createAmp0Account(pointer: number, account_xpub: string): Promise<string>;
195
195
  /**
196
196
  * Create a new Watch-Only entry for this wallet
197
197
  */
198
- create_watch_only(username: string, password: string): Promise<void>;
198
+ createWatchOnly(username: string, password: string): Promise<void>;
199
199
  }
200
200
  /**
201
201
  * A PSET to use with AMP0
@@ -984,6 +984,10 @@ export class Signer {
984
984
  * Return keyorigin and xpub, like "[73c5da0a/84h/1h/0h]tpub..."
985
985
  */
986
986
  keyoriginXpub(bip: Bip): string;
987
+ /**
988
+ * Return the signer fingerprint
989
+ */
990
+ fingerprint(): string;
987
991
  /**
988
992
  * Return the mnemonic of the signer
989
993
  */
package/lwk_wasm.js CHANGED
@@ -207,18 +207,18 @@ function debugString(val) {
207
207
  return className;
208
208
  }
209
209
 
210
- function _assertClass(instance, klass) {
211
- if (!(instance instanceof klass)) {
212
- throw new Error(`expected instance of ${klass.name}`);
213
- }
214
- }
215
-
216
210
  function takeFromExternrefTable0(idx) {
217
211
  const value = wasm.__wbindgen_export_4.get(idx);
218
212
  wasm.__externref_table_dealloc(idx);
219
213
  return value;
220
214
  }
221
215
 
216
+ function _assertClass(instance, klass) {
217
+ if (!(instance instanceof klass)) {
218
+ throw new Error(`expected instance of ${klass.name}`);
219
+ }
220
+ }
221
+
222
222
  function passArrayJsValueToWasm0(array, malloc) {
223
223
  const ptr = malloc(array.length * 4, 4) >>> 0;
224
224
  for (let i = 0; i < array.length; i++) {
@@ -228,6 +228,13 @@ function passArrayJsValueToWasm0(array, malloc) {
228
228
  WASM_VECTOR_LEN = array.length;
229
229
  return ptr;
230
230
  }
231
+ /**
232
+ * @returns {Promise<HIDDevice>}
233
+ */
234
+ module.exports.searchLedgerDevice = function() {
235
+ const ret = wasm.searchLedgerDevice();
236
+ return ret;
237
+ };
231
238
 
232
239
  function getArrayJsValueFromWasm0(ptr, len) {
233
240
  ptr = ptr >>> 0;
@@ -246,13 +253,6 @@ function passArray8ToWasm0(arg, malloc) {
246
253
  WASM_VECTOR_LEN = arg.length;
247
254
  return ptr;
248
255
  }
249
- /**
250
- * @returns {Promise<HIDDevice>}
251
- */
252
- module.exports.searchLedgerDevice = function() {
253
- const ret = wasm.searchLedgerDevice();
254
- return ret;
255
- };
256
256
 
257
257
  let cachedUint32ArrayMemory0 = null;
258
258
 
@@ -263,27 +263,27 @@ function getUint32ArrayMemory0() {
263
263
  return cachedUint32ArrayMemory0;
264
264
  }
265
265
 
266
+ function getArrayU32FromWasm0(ptr, len) {
267
+ ptr = ptr >>> 0;
268
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
269
+ }
270
+
266
271
  function passArray32ToWasm0(arg, malloc) {
267
272
  const ptr = malloc(arg.length * 4, 4) >>> 0;
268
273
  getUint32ArrayMemory0().set(arg, ptr / 4);
269
274
  WASM_VECTOR_LEN = arg.length;
270
275
  return ptr;
271
276
  }
272
-
273
- function getArrayU32FromWasm0(ptr, len) {
274
- ptr = ptr >>> 0;
275
- return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
276
- }
277
277
  function __wbg_adapter_34(arg0, arg1, arg2) {
278
- wasm.closure696_externref_shim(arg0, arg1, arg2);
278
+ wasm.closure444_externref_shim(arg0, arg1, arg2);
279
279
  }
280
280
 
281
281
  function __wbg_adapter_41(arg0, arg1, arg2) {
282
- wasm.closure1367_externref_shim(arg0, arg1, arg2);
282
+ wasm.closure1370_externref_shim(arg0, arg1, arg2);
283
283
  }
284
284
 
285
- function __wbg_adapter_543(arg0, arg1, arg2, arg3) {
286
- wasm.closure2127_externref_shim(arg0, arg1, arg2, arg3);
285
+ function __wbg_adapter_544(arg0, arg1, arg2, arg3) {
286
+ wasm.closure2130_externref_shim(arg0, arg1, arg2, arg3);
287
287
  }
288
288
 
289
289
  /**
@@ -723,8 +723,8 @@ class Amp0Connected {
723
723
  * This must be signed with [`amp0_sign_challenge()`].
724
724
  * @returns {Promise<string>}
725
725
  */
726
- get_challenge() {
727
- const ret = wasm.amp0connected_get_challenge(this.__wbg_ptr);
726
+ getChallenge() {
727
+ const ret = wasm.amp0connected_getChallenge(this.__wbg_ptr);
728
728
  return ret;
729
729
  }
730
730
  /**
@@ -776,8 +776,8 @@ class Amp0LoggedIn {
776
776
  * List of AMP IDs.
777
777
  * @returns {string[]}
778
778
  */
779
- get_amp_ids() {
780
- const ret = wasm.amp0loggedin_get_amp_ids(this.__wbg_ptr);
779
+ getAmpIds() {
780
+ const ret = wasm.amp0loggedin_getAmpIds(this.__wbg_ptr);
781
781
  if (ret[3]) {
782
782
  throw takeFromExternrefTable0(ret[2]);
783
783
  }
@@ -792,8 +792,8 @@ class Amp0LoggedIn {
792
792
  * [`Amp0LoggedIn::create_amp0_account()`]
793
793
  * @returns {number}
794
794
  */
795
- next_account() {
796
- const ret = wasm.amp0loggedin_next_account(this.__wbg_ptr);
795
+ nextAccount() {
796
+ const ret = wasm.amp0loggedin_nextAccount(this.__wbg_ptr);
797
797
  if (ret[2]) {
798
798
  throw takeFromExternrefTable0(ret[1]);
799
799
  }
@@ -808,10 +808,10 @@ class Amp0LoggedIn {
808
808
  * @param {string} account_xpub
809
809
  * @returns {Promise<string>}
810
810
  */
811
- create_amp0_account(pointer, account_xpub) {
811
+ createAmp0Account(pointer, account_xpub) {
812
812
  const ptr0 = passStringToWasm0(account_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
813
813
  const len0 = WASM_VECTOR_LEN;
814
- const ret = wasm.amp0loggedin_create_amp0_account(this.__wbg_ptr, pointer, ptr0, len0);
814
+ const ret = wasm.amp0loggedin_createAmp0Account(this.__wbg_ptr, pointer, ptr0, len0);
815
815
  return ret;
816
816
  }
817
817
  /**
@@ -820,12 +820,12 @@ class Amp0LoggedIn {
820
820
  * @param {string} password
821
821
  * @returns {Promise<void>}
822
822
  */
823
- create_watch_only(username, password) {
823
+ createWatchOnly(username, password) {
824
824
  const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
825
825
  const len0 = WASM_VECTOR_LEN;
826
826
  const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
827
827
  const len1 = WASM_VECTOR_LEN;
828
- const ret = wasm.amp0loggedin_create_watch_only(this.__wbg_ptr, ptr0, len0, ptr1, len1);
828
+ const ret = wasm.amp0loggedin_createWatchOnly(this.__wbg_ptr, ptr0, len0, ptr1, len1);
829
829
  return ret;
830
830
  }
831
831
  }
@@ -3514,6 +3514,28 @@ class Signer {
3514
3514
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
3515
3515
  }
3516
3516
  }
3517
+ /**
3518
+ * Return the signer fingerprint
3519
+ * @returns {string}
3520
+ */
3521
+ fingerprint() {
3522
+ let deferred2_0;
3523
+ let deferred2_1;
3524
+ try {
3525
+ const ret = wasm.signer_fingerprint(this.__wbg_ptr);
3526
+ var ptr1 = ret[0];
3527
+ var len1 = ret[1];
3528
+ if (ret[3]) {
3529
+ ptr1 = 0; len1 = 0;
3530
+ throw takeFromExternrefTable0(ret[2]);
3531
+ }
3532
+ deferred2_0 = ptr1;
3533
+ deferred2_1 = len1;
3534
+ return getStringFromWasm0(ptr1, len1);
3535
+ } finally {
3536
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
3537
+ }
3538
+ }
3517
3539
  /**
3518
3540
  * Return the mnemonic of the signer
3519
3541
  * @returns {Mnemonic}
@@ -5461,7 +5483,7 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
5461
5483
  return ret;
5462
5484
  };
5463
5485
 
5464
- module.exports.__wbg_log_b7d655e59d158495 = function(arg0, arg1) {
5486
+ module.exports.__wbg_log_4dd7615accd2b3e2 = function(arg0, arg1) {
5465
5487
  console.log(getStringFromWasm0(arg0, arg1));
5466
5488
  };
5467
5489
 
@@ -5492,7 +5514,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
5492
5514
  const a = state0.a;
5493
5515
  state0.a = 0;
5494
5516
  try {
5495
- return __wbg_adapter_543(a, state0.b, arg0, arg1);
5517
+ return __wbg_adapter_544(a, state0.b, arg0, arg1);
5496
5518
  } finally {
5497
5519
  state0.a = a;
5498
5520
  }
@@ -5932,23 +5954,23 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
5932
5954
  return ret;
5933
5955
  };
5934
5956
 
5935
- module.exports.__wbindgen_closure_wrapper12904 = function(arg0, arg1, arg2) {
5936
- const ret = makeMutClosure(arg0, arg1, 1368, __wbg_adapter_41);
5957
+ module.exports.__wbindgen_closure_wrapper12924 = function(arg0, arg1, arg2) {
5958
+ const ret = makeMutClosure(arg0, arg1, 1371, __wbg_adapter_41);
5937
5959
  return ret;
5938
5960
  };
5939
5961
 
5940
- module.exports.__wbindgen_closure_wrapper4336 = function(arg0, arg1, arg2) {
5941
- const ret = makeMutClosure(arg0, arg1, 698, __wbg_adapter_34);
5962
+ module.exports.__wbindgen_closure_wrapper6187 = function(arg0, arg1, arg2) {
5963
+ const ret = makeMutClosure(arg0, arg1, 445, __wbg_adapter_34);
5942
5964
  return ret;
5943
5965
  };
5944
5966
 
5945
- module.exports.__wbindgen_closure_wrapper4338 = function(arg0, arg1, arg2) {
5946
- const ret = makeMutClosure(arg0, arg1, 697, __wbg_adapter_34);
5967
+ module.exports.__wbindgen_closure_wrapper6189 = function(arg0, arg1, arg2) {
5968
+ const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_34);
5947
5969
  return ret;
5948
5970
  };
5949
5971
 
5950
- module.exports.__wbindgen_closure_wrapper4340 = function(arg0, arg1, arg2) {
5951
- const ret = makeMutClosure(arg0, arg1, 697, __wbg_adapter_34);
5972
+ module.exports.__wbindgen_closure_wrapper6191 = function(arg0, arg1, arg2) {
5973
+ const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_34);
5952
5974
  return ret;
5953
5975
  };
5954
5976
 
package/lwk_wasm_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lwk_node",
3
3
  "description": "Liquid Wallet Kit - WASM",
4
- "version": "0.12.0",
4
+ "version": "0.12.1",
5
5
  "license": "MIT OR BSD-2-Clause",
6
6
  "files": [
7
7
  "lwk_wasm_bg.wasm",