@tari-project/ootle-wallet-daemon-signer 0.5.0 → 0.7.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/dist/index.d.ts CHANGED
@@ -22,7 +22,10 @@ import { WalletDaemonClient } from '@tari-project/wallet_jrpc_client';
22
22
  export declare function authenticate(client: WalletDaemonClient, options?: AuthOptions): Promise<string>;
23
23
 
24
24
  export declare interface AuthOptions {
25
- /** Permissions to request from the wallet daemon. Defaults to `["Admin"]`. */
25
+ /**
26
+ * Permissions to request from the wallet daemon. Defaults to `["Admin"]`. Not applied when
27
+ * this call enrols the wallet's first WebAuthn credential: that bootstrap token is always `Admin`.
28
+ */
26
29
  permissions?: Permission[];
27
30
  /** Application name used as the WebAuthn username/identifier. Defaults to `"tari-wallet-sdk"`. */
28
31
  appName?: string;
package/dist/index.js CHANGED
@@ -157,6 +157,12 @@ var l = class e3 {
157
157
  accountsGet(e4) {
158
158
  return this.sendRequest("accounts.get", e4);
159
159
  }
160
+ accountsGetByKeyIndex(e4) {
161
+ return this.sendRequest("accounts.get_by_key_index", e4);
162
+ }
163
+ accountsCreateOrGet(e4) {
164
+ return this.sendRequest("accounts.create_or_get", e4);
165
+ }
160
166
  accountsTransfer(e4) {
161
167
  return this.sendRequest("accounts.transfer", e4);
162
168
  }
@@ -166,6 +172,9 @@ var l = class e3 {
166
172
  stealthTransfer(e4) {
167
173
  return this.sendRequest("accounts.stealth_transfer", e4);
168
174
  }
175
+ accountsCreateStealthTransferStatement(e4) {
176
+ return this.sendRequest("accounts.create_stealth_transfer_statement", e4);
177
+ }
169
178
  accountsGetDefault(e4) {
170
179
  return this.sendRequest("accounts.get_default", e4);
171
180
  }
@@ -175,6 +184,9 @@ var l = class e3 {
175
184
  submitTransaction(e4) {
176
185
  return this.sendRequest("transactions.submit", e4);
177
186
  }
187
+ submitInstruction(e4) {
188
+ return this.sendRequest("transactions.submit_instruction", e4);
189
+ }
178
190
  submitTransactionDryRun(e4) {
179
191
  return this.sendRequest("transactions.submit_dry_run", e4);
180
192
  }
@@ -217,9 +229,15 @@ var l = class e3 {
217
229
  templatesListAuthored(e4) {
218
230
  return this.sendRequest("templates.list_authored", e4);
219
231
  }
232
+ templatesSignMetadata(e4) {
233
+ return this.sendRequest("templates.sign_metadata", e4);
234
+ }
220
235
  createFreeTestCoins(e4) {
221
236
  return this.sendRequest("accounts.create_free_test_coins", e4);
222
237
  }
238
+ getFaucetBalance(e4) {
239
+ return this.sendRequest("accounts.get_faucet_balance", e4);
240
+ }
223
241
  createKey(e4) {
224
242
  return this.sendRequest("keys.create", e4);
225
243
  }
@@ -229,12 +247,30 @@ var l = class e3 {
229
247
  listKeys(e4) {
230
248
  return this.sendRequest("keys.list", e4);
231
249
  }
250
+ importKey(e4) {
251
+ return this.sendRequest("keys.import", e4);
252
+ }
232
253
  viewVaultBalance(e4) {
233
254
  return this.sendRequest("confidential.view_vault_balance", e4);
234
255
  }
256
+ confidentialCreateTransferProof(e4) {
257
+ return this.sendRequest("confidential.create_transfer_proof", e4);
258
+ }
259
+ confidentialFinalize(e4) {
260
+ return this.sendRequest("confidential.finalize", e4);
261
+ }
262
+ confidentialCancel(e4) {
263
+ return this.sendRequest("confidential.cancel", e4);
264
+ }
265
+ confidentialCreateOutputProof(e4) {
266
+ return this.sendRequest("confidential.create_output_proof", e4);
267
+ }
235
268
  nftsList(e4) {
236
269
  return this.sendRequest("nfts.list", e4);
237
270
  }
271
+ nftsGet(e4) {
272
+ return this.sendRequest("nfts.get", e4);
273
+ }
238
274
  nftTransfer(e4) {
239
275
  return this.sendRequest("nfts.transfer", e4);
240
276
  }
@@ -277,6 +313,15 @@ var l = class e3 {
277
313
  stealthUtxosDecryptValue(e4) {
278
314
  return this.sendRequest("stealth_utxos.decrypt_value", e4);
279
315
  }
316
+ stealthUtxosGetValueLookupInfo(e4) {
317
+ return this.sendRequest("stealth_utxos.get_value_lookup_info", e4);
318
+ }
319
+ resourcesGet(e4) {
320
+ return this.sendRequest("resources.get", e4);
321
+ }
322
+ resourcesGetMany(e4) {
323
+ return this.sendRequest("resources.get_many", e4);
324
+ }
280
325
  addressBookAdd(e4) {
281
326
  return this.sendRequest("address_book.add", e4);
282
327
  }
@@ -357,8 +402,8 @@ async function p(t2, n2) {
357
402
  }
358
403
  async function m(t2, n2, r2) {
359
404
  if (globalThis.navigator === void 0 || !globalThis.navigator.credentials) throw new e("WebAuthn is browser-only. Run in a browser, or pass `authToken` explicitly to `WalletDaemonSigner.connect({ url, authToken })` from Node.");
360
- let { registered: i3 } = await t2.webauthnAlreadyRegistered({ username: n2 });
361
- return i3 ? h(t2, n2, r2) : g(t2, n2, r2);
405
+ let { registered: i3 } = await t2.webauthnAlreadyRegistered({});
406
+ return i3 ? h(t2, n2, r2) : g(t2, n2);
362
407
  }
363
408
  async function h(t2, n2, r2) {
364
409
  var _a;
@@ -381,24 +426,24 @@ async function h(t2, n2, r2) {
381
426
  credential: l2
382
427
  } });
383
428
  }
384
- async function g(t2, n2, r2) {
429
+ async function g(t2, n2) {
385
430
  var _a, _b, _c;
386
- let i3 = await t2.webauthnStartRegistration({ username: n2 });
387
- if (!i3.public_key) throw new e("WebAuthn registration start: missing public_key");
388
- let a2 = i3.public_key;
389
- if (!a2.challenge) throw new e("WebAuthn registration start: malformed public_key response");
390
- let o2 = f(a2.challenge), s2 = await navigator.credentials.create({ publicKey: {
431
+ let r2 = await t2.webauthnStartRegistration({ username: n2 });
432
+ if (!r2.public_key) throw new e("WebAuthn registration start: missing public_key");
433
+ let i3 = r2.public_key;
434
+ if (!i3.challenge) throw new e("WebAuthn registration start: malformed public_key response");
435
+ let a2 = f(i3.challenge), o2 = await navigator.credentials.create({ publicKey: {
391
436
  rp: {
392
- name: ((_a = a2.rp) == null ? void 0 : _a.name) ?? "Tari Wallet",
393
- id: ((_b = a2.rp) == null ? void 0 : _b.id) ?? ((_c = globalThis.location) == null ? void 0 : _c.hostname)
437
+ name: ((_a = i3.rp) == null ? void 0 : _a.name) ?? "Tari Wallet",
438
+ id: ((_b = i3.rp) == null ? void 0 : _b.id) ?? ((_c = globalThis.location) == null ? void 0 : _c.hostname)
394
439
  },
395
440
  user: {
396
441
  id: Uint8Array.from(n2, (e4) => e4.charCodeAt(0)),
397
442
  name: n2,
398
443
  displayName: n2
399
444
  },
400
- challenge: o2,
401
- pubKeyCredParams: a2.pubKeyCredParams ?? [
445
+ challenge: a2,
446
+ pubKeyCredParams: i3.pubKeyCredParams ?? [
402
447
  {
403
448
  type: "public-key",
404
449
  alg: -8
@@ -417,13 +462,12 @@ async function g(t2, n2, r2) {
417
462
  attestation: "none",
418
463
  authenticatorSelection: { userVerification: "required" }
419
464
  } });
420
- if (!s2) throw new e("WebAuthn registration was cancelled");
421
- let { token: c2 } = await t2.webauthnFinishRegistration({
422
- session_id: i3.session_id,
423
- credential: s2,
424
- requested_permissions: r2
465
+ if (!o2) throw new e("WebAuthn registration was cancelled");
466
+ let { token: s2 } = await t2.webauthnFinishRegistration({
467
+ session_id: r2.session_id,
468
+ credential: o2
425
469
  });
426
- return c2;
470
+ return s2;
427
471
  }
428
472
  var _ = class i2 {
429
473
  constructor(e4) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/ootle-wallet-daemon-signer",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/tari-project/ootle.ts.git",
@@ -25,9 +25,9 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@tari-project/ootle-ts-bindings": "^1.52.0",
29
- "@tari-project/wallet_jrpc_client": "^1.22.0",
30
- "@tari-project/ootle": "0.5.0"
28
+ "@tari-project/ootle-ts-bindings": "^1.56.0",
29
+ "@tari-project/wallet_jrpc_client": "^1.24.0",
30
+ "@tari-project/ootle": "0.7.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@microsoft/api-extractor": "^7.57.7",