@meshsdk/wallet 1.8.5 → 1.8.6

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.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { DataSignature, IFetcher, ISubmitter, ISigner, IWallet, Wallet, Asset, UTxO, AssetExtended } from '@meshsdk/common';
2
2
  import { Ed25519PublicKeyHex, TransactionUnspentOutput, Address, StricaPrivateKey, DRepID, Ed25519KeyHashHex, VkeyWitness } from '@meshsdk/core-cst';
3
+ import * as _simplewebauthn_browser from '@simplewebauthn/browser';
3
4
 
4
5
  type Cardano = {
5
6
  [key: string]: {
@@ -329,6 +330,55 @@ declare class BrowserWallet implements IWallet {
329
330
  }[];
330
331
  }
331
332
 
333
+ declare function connect({ username, password, serverUrl, }: {
334
+ username: string;
335
+ password: string;
336
+ serverUrl: string;
337
+ }): Promise<{
338
+ success: boolean;
339
+ wallet: {
340
+ bech32PrivateKey: string;
341
+ };
342
+ error?: undefined;
343
+ } | {
344
+ success: boolean;
345
+ error: any;
346
+ wallet?: undefined;
347
+ }>;
348
+
349
+ declare function login({ serverUrl, username, }: {
350
+ serverUrl: string;
351
+ username: string;
352
+ }): Promise<{
353
+ success: boolean;
354
+ error: any;
355
+ errorCode: any;
356
+ authJSON?: undefined;
357
+ } | {
358
+ success: boolean;
359
+ error: any;
360
+ errorCode?: undefined;
361
+ authJSON?: undefined;
362
+ } | {
363
+ success: boolean;
364
+ authJSON: _simplewebauthn_browser.AuthenticationResponseJSON;
365
+ error?: undefined;
366
+ errorCode?: undefined;
367
+ }>;
368
+
369
+ declare function register({ serverUrl, username, }: {
370
+ serverUrl: string;
371
+ username: string;
372
+ }): Promise<{
373
+ success: boolean;
374
+ error: any;
375
+ errorCode: any;
376
+ } | {
377
+ success: boolean;
378
+ error?: undefined;
379
+ errorCode?: undefined;
380
+ }>;
381
+
332
382
  type Account = {
333
383
  baseAddress: Address;
334
384
  enterpriseAddress: Address;
@@ -354,15 +404,19 @@ type EmbeddedWalletKeyType = {
354
404
  } | {
355
405
  type: "mnemonic";
356
406
  words: string[];
407
+ } | {
408
+ type: "bip32Bytes";
409
+ bip32Bytes: Uint8Array;
357
410
  };
358
411
  type CreateEmbeddedWalletOptions = {
359
412
  networkId: number;
360
413
  key: EmbeddedWalletKeyType;
361
414
  };
362
415
  declare class WalletStaticMethods {
363
- static privateKeyToEntropy(bech32: string): string;
416
+ static privateKeyToEntropy(_bech32: string): string;
364
417
  static mnemonicToEntropy(words: string[]): string;
365
418
  static signingKeyToEntropy(paymentKey: string, stakeKey: string): [string, string];
419
+ static bip32BytesToEntropy(bip32Bytes: Uint8Array): string;
366
420
  static getAddresses(paymentKey: StricaPrivateKey, stakingKey: StricaPrivateKey, networkId?: number): {
367
421
  baseAddress: Address;
368
422
  enterpriseAddress: Address;
@@ -400,6 +454,9 @@ type CreateMeshWalletOptions = {
400
454
  } | {
401
455
  type: "mnemonic";
402
456
  words: string[];
457
+ } | {
458
+ type: "bip32Bytes";
459
+ bip32Bytes: Uint8Array;
403
460
  } | {
404
461
  type: "address";
405
462
  address: string;
@@ -451,6 +508,21 @@ declare class MeshWallet implements IWallet {
451
508
  dRepIDHash?: Ed25519KeyHashHex;
452
509
  };
453
510
  constructor(options: CreateMeshWalletOptions);
511
+ /**
512
+ * Returns all derived addresses from the wallet.
513
+ * @returns a list of addresses
514
+ */
515
+ getAddresses(): {
516
+ baseAddress?: Address;
517
+ enterpriseAddress?: Address;
518
+ rewardAddress?: Address;
519
+ baseAddressBech32?: string;
520
+ enterpriseAddressBech32?: string;
521
+ rewardAddressBech32?: string;
522
+ pubDRepKey?: string;
523
+ dRepIDBech32?: DRepID;
524
+ dRepIDHash?: Ed25519KeyHashHex;
525
+ };
454
526
  /**
455
527
  * Returns a list of assets in the wallet. This API will return every assets in the wallet. Each asset is an object with the following properties:
456
528
  * - A unit is provided to display asset's name on the user interface.
@@ -646,4 +718,4 @@ declare class MeshWallet implements IWallet {
646
718
  private buildAddressFromBech32Address;
647
719
  }
648
720
 
649
- export { type Account, AppWallet, type AppWalletKeyType, BrowserWallet, type CreateAppWalletOptions, type CreateEmbeddedWalletOptions, type CreateMeshWalletOptions, EmbeddedWallet, type EmbeddedWalletKeyType, MeshWallet, WalletStaticMethods };
721
+ export { type Account, AppWallet, type AppWalletKeyType, BrowserWallet, type CreateAppWalletOptions, type CreateEmbeddedWalletOptions, type CreateMeshWalletOptions, EmbeddedWallet, type EmbeddedWalletKeyType, MeshWallet, WalletStaticMethods, connect, login, register };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { DataSignature, IFetcher, ISubmitter, ISigner, IWallet, Wallet, Asset, UTxO, AssetExtended } from '@meshsdk/common';
2
2
  import { Ed25519PublicKeyHex, TransactionUnspentOutput, Address, StricaPrivateKey, DRepID, Ed25519KeyHashHex, VkeyWitness } from '@meshsdk/core-cst';
3
+ import * as _simplewebauthn_browser from '@simplewebauthn/browser';
3
4
 
4
5
  type Cardano = {
5
6
  [key: string]: {
@@ -329,6 +330,55 @@ declare class BrowserWallet implements IWallet {
329
330
  }[];
330
331
  }
331
332
 
333
+ declare function connect({ username, password, serverUrl, }: {
334
+ username: string;
335
+ password: string;
336
+ serverUrl: string;
337
+ }): Promise<{
338
+ success: boolean;
339
+ wallet: {
340
+ bech32PrivateKey: string;
341
+ };
342
+ error?: undefined;
343
+ } | {
344
+ success: boolean;
345
+ error: any;
346
+ wallet?: undefined;
347
+ }>;
348
+
349
+ declare function login({ serverUrl, username, }: {
350
+ serverUrl: string;
351
+ username: string;
352
+ }): Promise<{
353
+ success: boolean;
354
+ error: any;
355
+ errorCode: any;
356
+ authJSON?: undefined;
357
+ } | {
358
+ success: boolean;
359
+ error: any;
360
+ errorCode?: undefined;
361
+ authJSON?: undefined;
362
+ } | {
363
+ success: boolean;
364
+ authJSON: _simplewebauthn_browser.AuthenticationResponseJSON;
365
+ error?: undefined;
366
+ errorCode?: undefined;
367
+ }>;
368
+
369
+ declare function register({ serverUrl, username, }: {
370
+ serverUrl: string;
371
+ username: string;
372
+ }): Promise<{
373
+ success: boolean;
374
+ error: any;
375
+ errorCode: any;
376
+ } | {
377
+ success: boolean;
378
+ error?: undefined;
379
+ errorCode?: undefined;
380
+ }>;
381
+
332
382
  type Account = {
333
383
  baseAddress: Address;
334
384
  enterpriseAddress: Address;
@@ -354,15 +404,19 @@ type EmbeddedWalletKeyType = {
354
404
  } | {
355
405
  type: "mnemonic";
356
406
  words: string[];
407
+ } | {
408
+ type: "bip32Bytes";
409
+ bip32Bytes: Uint8Array;
357
410
  };
358
411
  type CreateEmbeddedWalletOptions = {
359
412
  networkId: number;
360
413
  key: EmbeddedWalletKeyType;
361
414
  };
362
415
  declare class WalletStaticMethods {
363
- static privateKeyToEntropy(bech32: string): string;
416
+ static privateKeyToEntropy(_bech32: string): string;
364
417
  static mnemonicToEntropy(words: string[]): string;
365
418
  static signingKeyToEntropy(paymentKey: string, stakeKey: string): [string, string];
419
+ static bip32BytesToEntropy(bip32Bytes: Uint8Array): string;
366
420
  static getAddresses(paymentKey: StricaPrivateKey, stakingKey: StricaPrivateKey, networkId?: number): {
367
421
  baseAddress: Address;
368
422
  enterpriseAddress: Address;
@@ -400,6 +454,9 @@ type CreateMeshWalletOptions = {
400
454
  } | {
401
455
  type: "mnemonic";
402
456
  words: string[];
457
+ } | {
458
+ type: "bip32Bytes";
459
+ bip32Bytes: Uint8Array;
403
460
  } | {
404
461
  type: "address";
405
462
  address: string;
@@ -451,6 +508,21 @@ declare class MeshWallet implements IWallet {
451
508
  dRepIDHash?: Ed25519KeyHashHex;
452
509
  };
453
510
  constructor(options: CreateMeshWalletOptions);
511
+ /**
512
+ * Returns all derived addresses from the wallet.
513
+ * @returns a list of addresses
514
+ */
515
+ getAddresses(): {
516
+ baseAddress?: Address;
517
+ enterpriseAddress?: Address;
518
+ rewardAddress?: Address;
519
+ baseAddressBech32?: string;
520
+ enterpriseAddressBech32?: string;
521
+ rewardAddressBech32?: string;
522
+ pubDRepKey?: string;
523
+ dRepIDBech32?: DRepID;
524
+ dRepIDHash?: Ed25519KeyHashHex;
525
+ };
454
526
  /**
455
527
  * Returns a list of assets in the wallet. This API will return every assets in the wallet. Each asset is an object with the following properties:
456
528
  * - A unit is provided to display asset's name on the user interface.
@@ -646,4 +718,4 @@ declare class MeshWallet implements IWallet {
646
718
  private buildAddressFromBech32Address;
647
719
  }
648
720
 
649
- export { type Account, AppWallet, type AppWalletKeyType, BrowserWallet, type CreateAppWalletOptions, type CreateEmbeddedWalletOptions, type CreateMeshWalletOptions, EmbeddedWallet, type EmbeddedWalletKeyType, MeshWallet, WalletStaticMethods };
721
+ export { type Account, AppWallet, type AppWalletKeyType, BrowserWallet, type CreateAppWalletOptions, type CreateEmbeddedWalletOptions, type CreateMeshWalletOptions, EmbeddedWallet, type EmbeddedWalletKeyType, MeshWallet, WalletStaticMethods, connect, login, register };