@meshsdk/wallet 1.8.13 → 1.9.0-beta-38
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.cjs +94 -67
- package/dist/index.d.cts +43 -27
- package/dist/index.d.ts +43 -27
- package/dist/index.js +100 -70
- package/package.json +4 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataSignature, IFetcher, ISubmitter, ISigner, IWallet, Wallet, Asset, UTxO, AssetExtended } from '@meshsdk/common';
|
|
2
|
-
import { Ed25519PublicKeyHex, TransactionUnspentOutput, Address,
|
|
1
|
+
import { DataSignature, IFetcher, ISubmitter, ISigner, IWallet, Wallet, Extension, Asset, UTxO, AssetExtended } from '@meshsdk/common';
|
|
2
|
+
import { Ed25519PublicKeyHex, TransactionUnspentOutput, Address, Ed25519PrivateKey, DRepID, Ed25519KeyHashHex, VkeyWitness } from '@meshsdk/core-cst';
|
|
3
3
|
import * as _simplewebauthn_browser from '@simplewebauthn/browser';
|
|
4
4
|
|
|
5
5
|
type Cardano = {
|
|
@@ -77,6 +77,11 @@ declare class AppWallet implements ISigner, ISubmitter {
|
|
|
77
77
|
private readonly _submitter?;
|
|
78
78
|
private readonly _wallet;
|
|
79
79
|
constructor(options: CreateAppWalletOptions);
|
|
80
|
+
/**
|
|
81
|
+
* Initializes the wallet. This is a required call as fetching addresses from the wallet is an async operation.
|
|
82
|
+
* @returns void
|
|
83
|
+
*/
|
|
84
|
+
init(): Promise<void>;
|
|
80
85
|
/**
|
|
81
86
|
* Get a list of UTXOs to be used as collateral inputs for transactions with plutus script inputs.
|
|
82
87
|
*
|
|
@@ -107,7 +112,7 @@ declare global {
|
|
|
107
112
|
/**
|
|
108
113
|
* Browser Wallet provides a set of APIs to interact with the blockchain. This wallet is compatible with Mesh transaction builders.
|
|
109
114
|
*
|
|
110
|
-
* These wallets APIs are in accordance to CIP-30, which defines the API for
|
|
115
|
+
* These wallets APIs are in accordance to CIP-30, which defines the API for apps to communicate with the user's wallet. Additional utility functions provided for developers that are useful for building applications.
|
|
111
116
|
* ```javascript
|
|
112
117
|
* import { BrowserWallet } from '@meshsdk/core';
|
|
113
118
|
*
|
|
@@ -140,7 +145,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
140
145
|
*/
|
|
141
146
|
static getInstalledWallets(): Wallet[];
|
|
142
147
|
/**
|
|
143
|
-
* This is the entrypoint to start communication with the user's wallet. The wallet should request the user's permission to connect the web page to the user's wallet, and if permission has been granted, the wallet will be returned and exposing the full API for the
|
|
148
|
+
* This is the entrypoint to start communication with the user's wallet. The wallet should request the user's permission to connect the web page to the user's wallet, and if permission has been granted, the wallet will be returned and exposing the full API for the app to use.
|
|
144
149
|
*
|
|
145
150
|
* Query BrowserWallet.getInstalledWallets() to get a list of available wallets, then provide the wallet name for which wallet the user would like to connect with.
|
|
146
151
|
*
|
|
@@ -148,7 +153,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
148
153
|
* @param extensions - optional, a list of CIPs that the wallet should support
|
|
149
154
|
* @returns WalletInstance
|
|
150
155
|
*/
|
|
151
|
-
static enable(walletName: string, extensions?:
|
|
156
|
+
static enable(walletName: string, extensions?: Extension[]): Promise<BrowserWallet>;
|
|
152
157
|
/**
|
|
153
158
|
* 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:
|
|
154
159
|
* - A unit is provided to display asset's name on the user interface.
|
|
@@ -235,7 +240,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
235
240
|
/**
|
|
236
241
|
* Submits the signed transaction to the blockchain network.
|
|
237
242
|
*
|
|
238
|
-
* As wallets should already have this ability to submit transaction, we allow
|
|
243
|
+
* As wallets should already have this ability to submit transaction, we allow apps to request that a transaction be sent through it. If the wallet accepts the transaction and tries to send it, it shall return the transaction ID for the app to track. The wallet can return error messages or failure if there was an error in sending it.
|
|
239
244
|
*
|
|
240
245
|
* @param tx
|
|
241
246
|
* @returns a transaction hash
|
|
@@ -294,7 +299,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
294
299
|
* The connected wallet account provides the account's public DRep Key, derivation as described in CIP-0105.
|
|
295
300
|
* These are used by the client to identify the user's on-chain CIP-1694 interactions, i.e. if a user has registered to be a DRep.
|
|
296
301
|
*
|
|
297
|
-
* @returns
|
|
302
|
+
* @returns DRep object
|
|
298
303
|
*/
|
|
299
304
|
getDRep(): Promise<{
|
|
300
305
|
publicKey: string;
|
|
@@ -307,11 +312,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
307
312
|
*
|
|
308
313
|
* @returns wallet account's public DRep Key
|
|
309
314
|
*/
|
|
310
|
-
getPubDRepKey(): Promise<
|
|
311
|
-
pubDRepKey: string;
|
|
312
|
-
dRepIDHash: string;
|
|
313
|
-
dRepIDBech32: string;
|
|
314
|
-
} | undefined>;
|
|
315
|
+
getPubDRepKey(): Promise<string | undefined>;
|
|
315
316
|
getRegisteredPubStakeKeys(): Promise<{
|
|
316
317
|
pubStakeKeys: string[];
|
|
317
318
|
pubStakeKeyHashes: string[];
|
|
@@ -384,13 +385,14 @@ type Account = {
|
|
|
384
385
|
baseAddressBech32: string;
|
|
385
386
|
enterpriseAddressBech32: string;
|
|
386
387
|
rewardAddressBech32: string;
|
|
387
|
-
paymentKey:
|
|
388
|
-
stakeKey:
|
|
388
|
+
paymentKey: Ed25519PrivateKey;
|
|
389
|
+
stakeKey: Ed25519PrivateKey;
|
|
389
390
|
paymentKeyHex: string;
|
|
390
391
|
stakeKeyHex: string;
|
|
391
392
|
pubDRepKey?: string;
|
|
392
393
|
dRepIDBech32?: DRepID;
|
|
393
394
|
dRepIDHash?: Ed25519KeyHashHex;
|
|
395
|
+
dRepIDCip105?: string;
|
|
394
396
|
};
|
|
395
397
|
type EmbeddedWalletKeyType = {
|
|
396
398
|
type: "root";
|
|
@@ -411,27 +413,30 @@ type CreateEmbeddedWalletOptions = {
|
|
|
411
413
|
key: EmbeddedWalletKeyType;
|
|
412
414
|
};
|
|
413
415
|
declare class WalletStaticMethods {
|
|
414
|
-
static
|
|
415
|
-
static
|
|
416
|
-
static
|
|
417
|
-
static
|
|
418
|
-
static getAddresses(paymentKey:
|
|
416
|
+
static privateKeyBech32ToPrivateKeyHex(_bech32: string): string;
|
|
417
|
+
static mnemonicToPrivateKeyHex(words: string[]): string;
|
|
418
|
+
static signingKeyToHexes(paymentKey: string, stakeKey: string): [string, string];
|
|
419
|
+
static bip32BytesToPrivateKeyHex(bip32Bytes: Uint8Array): string;
|
|
420
|
+
static getAddresses(paymentKey: Ed25519PrivateKey, stakingKey: Ed25519PrivateKey, networkId?: number): {
|
|
419
421
|
baseAddress: Address;
|
|
420
422
|
enterpriseAddress: Address;
|
|
421
423
|
rewardAddress: Address;
|
|
422
424
|
};
|
|
423
|
-
static getDRepKey(dRepKey:
|
|
425
|
+
static getDRepKey(dRepKey: Ed25519PrivateKey, networkId?: number): {
|
|
424
426
|
pubDRepKey: string;
|
|
425
427
|
dRepIDBech32: DRepID;
|
|
426
428
|
dRepIDHash: Ed25519KeyHashHex;
|
|
429
|
+
dRepIDCip105: string;
|
|
427
430
|
};
|
|
428
431
|
static generateMnemonic(strength?: number): string[];
|
|
429
432
|
static addWitnessSets(txHex: string, witnesses: VkeyWitness[]): string;
|
|
430
433
|
}
|
|
431
434
|
declare class EmbeddedWallet extends WalletStaticMethods {
|
|
432
|
-
private readonly
|
|
435
|
+
private readonly _walletSecret?;
|
|
433
436
|
private readonly _networkId;
|
|
437
|
+
cryptoIsReady: boolean;
|
|
434
438
|
constructor(options: CreateEmbeddedWalletOptions);
|
|
439
|
+
init(): Promise<void>;
|
|
435
440
|
getAccount(accountIndex?: number, keyIndex?: number): Account;
|
|
436
441
|
/**
|
|
437
442
|
* Get wallet network ID.
|
|
@@ -495,20 +500,23 @@ type CreateMeshWalletOptions = {
|
|
|
495
500
|
* ```javascript
|
|
496
501
|
* import { MeshWallet, BlockfrostProvider } from '@meshsdk/core';
|
|
497
502
|
*
|
|
498
|
-
* const
|
|
503
|
+
* const provider = new BlockfrostProvider('<BLOCKFROST_API_KEY>');
|
|
499
504
|
*
|
|
500
505
|
* const wallet = new MeshWallet({
|
|
501
506
|
* networkId: 0,
|
|
502
|
-
* fetcher:
|
|
503
|
-
* submitter:
|
|
507
|
+
* fetcher: provider,
|
|
508
|
+
* submitter: provider,
|
|
504
509
|
* key: {
|
|
505
510
|
* type: 'mnemonic',
|
|
506
511
|
* words: ["solution","solution","solution","solution","solution",","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution"],
|
|
507
512
|
* },
|
|
508
513
|
* });
|
|
509
514
|
* ```
|
|
515
|
+
*
|
|
516
|
+
* Please call `await wallet.init()` after creating the wallet to fetch the addresses from the wallet.
|
|
510
517
|
*/
|
|
511
518
|
declare class MeshWallet implements IWallet {
|
|
519
|
+
private readonly _keyType;
|
|
512
520
|
private readonly _wallet;
|
|
513
521
|
private readonly _accountIndex;
|
|
514
522
|
private readonly _keyIndex;
|
|
@@ -525,8 +533,14 @@ declare class MeshWallet implements IWallet {
|
|
|
525
533
|
pubDRepKey?: string;
|
|
526
534
|
dRepIDBech32?: DRepID;
|
|
527
535
|
dRepIDHash?: Ed25519KeyHashHex;
|
|
536
|
+
dRepIDCip105?: string;
|
|
528
537
|
};
|
|
529
538
|
constructor(options: CreateMeshWalletOptions);
|
|
539
|
+
/**
|
|
540
|
+
* Initializes the wallet. This is a required call as fetching addresses from the wallet is an async operation.
|
|
541
|
+
* @returns void
|
|
542
|
+
*/
|
|
543
|
+
init(): Promise<void>;
|
|
530
544
|
/**
|
|
531
545
|
* Returns all derived addresses from the wallet.
|
|
532
546
|
* @returns a list of addresses
|
|
@@ -541,6 +555,7 @@ declare class MeshWallet implements IWallet {
|
|
|
541
555
|
pubDRepKey?: string;
|
|
542
556
|
dRepIDBech32?: DRepID;
|
|
543
557
|
dRepIDHash?: Ed25519KeyHashHex;
|
|
558
|
+
dRepIDCip105?: string;
|
|
544
559
|
};
|
|
545
560
|
/**
|
|
546
561
|
* 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:
|
|
@@ -555,7 +570,7 @@ declare class MeshWallet implements IWallet {
|
|
|
555
570
|
*
|
|
556
571
|
* @returns an address
|
|
557
572
|
*/
|
|
558
|
-
getChangeAddress(): string
|
|
573
|
+
getChangeAddress(addressType?: GetAddressType): Promise<string>;
|
|
559
574
|
/**
|
|
560
575
|
* This function shall return a list of one or more UTXOs (unspent transaction outputs) controlled by the wallet that are required to reach AT LEAST the combined ADA value target specified in amount AND the best suitable to be used as collateral inputs for transactions with plutus script inputs (pure ADA-only UTXOs).
|
|
561
576
|
*
|
|
@@ -584,7 +599,7 @@ declare class MeshWallet implements IWallet {
|
|
|
584
599
|
* The connected wallet account provides the account's public DRep Key, derivation as described in CIP-0105.
|
|
585
600
|
* These are used by the client to identify the user's on-chain CIP-1694 interactions, i.e. if a user has registered to be a DRep.
|
|
586
601
|
*
|
|
587
|
-
* @returns
|
|
602
|
+
* @returns DRep object
|
|
588
603
|
*/
|
|
589
604
|
getDRep(): Promise<{
|
|
590
605
|
publicKey: string;
|
|
@@ -658,7 +673,7 @@ declare class MeshWallet implements IWallet {
|
|
|
658
673
|
/**
|
|
659
674
|
* Submits the signed transaction to the blockchain network.
|
|
660
675
|
*
|
|
661
|
-
* As wallets should already have this ability to submit transaction, we allow
|
|
676
|
+
* As wallets should already have this ability to submit transaction, we allow apps to request that a transaction be sent through it. If the wallet accepts the transaction and tries to send it, it shall return the transaction ID for the app to track. The wallet can return error messages or failure if there was an error in sending it.
|
|
662
677
|
*
|
|
663
678
|
* @param tx - a signed transaction in CBOR
|
|
664
679
|
* @returns a transaction hash
|
|
@@ -725,6 +740,7 @@ declare class MeshWallet implements IWallet {
|
|
|
725
740
|
pubDRepKey: string | undefined;
|
|
726
741
|
dRepIDBech32: string | undefined;
|
|
727
742
|
dRepIDHash: string | undefined;
|
|
743
|
+
dRepIDCip105: string | undefined;
|
|
728
744
|
};
|
|
729
745
|
/**
|
|
730
746
|
* Generate mnemonic or private key
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataSignature, IFetcher, ISubmitter, ISigner, IWallet, Wallet, Asset, UTxO, AssetExtended } from '@meshsdk/common';
|
|
2
|
-
import { Ed25519PublicKeyHex, TransactionUnspentOutput, Address,
|
|
1
|
+
import { DataSignature, IFetcher, ISubmitter, ISigner, IWallet, Wallet, Extension, Asset, UTxO, AssetExtended } from '@meshsdk/common';
|
|
2
|
+
import { Ed25519PublicKeyHex, TransactionUnspentOutput, Address, Ed25519PrivateKey, DRepID, Ed25519KeyHashHex, VkeyWitness } from '@meshsdk/core-cst';
|
|
3
3
|
import * as _simplewebauthn_browser from '@simplewebauthn/browser';
|
|
4
4
|
|
|
5
5
|
type Cardano = {
|
|
@@ -77,6 +77,11 @@ declare class AppWallet implements ISigner, ISubmitter {
|
|
|
77
77
|
private readonly _submitter?;
|
|
78
78
|
private readonly _wallet;
|
|
79
79
|
constructor(options: CreateAppWalletOptions);
|
|
80
|
+
/**
|
|
81
|
+
* Initializes the wallet. This is a required call as fetching addresses from the wallet is an async operation.
|
|
82
|
+
* @returns void
|
|
83
|
+
*/
|
|
84
|
+
init(): Promise<void>;
|
|
80
85
|
/**
|
|
81
86
|
* Get a list of UTXOs to be used as collateral inputs for transactions with plutus script inputs.
|
|
82
87
|
*
|
|
@@ -107,7 +112,7 @@ declare global {
|
|
|
107
112
|
/**
|
|
108
113
|
* Browser Wallet provides a set of APIs to interact with the blockchain. This wallet is compatible with Mesh transaction builders.
|
|
109
114
|
*
|
|
110
|
-
* These wallets APIs are in accordance to CIP-30, which defines the API for
|
|
115
|
+
* These wallets APIs are in accordance to CIP-30, which defines the API for apps to communicate with the user's wallet. Additional utility functions provided for developers that are useful for building applications.
|
|
111
116
|
* ```javascript
|
|
112
117
|
* import { BrowserWallet } from '@meshsdk/core';
|
|
113
118
|
*
|
|
@@ -140,7 +145,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
140
145
|
*/
|
|
141
146
|
static getInstalledWallets(): Wallet[];
|
|
142
147
|
/**
|
|
143
|
-
* This is the entrypoint to start communication with the user's wallet. The wallet should request the user's permission to connect the web page to the user's wallet, and if permission has been granted, the wallet will be returned and exposing the full API for the
|
|
148
|
+
* This is the entrypoint to start communication with the user's wallet. The wallet should request the user's permission to connect the web page to the user's wallet, and if permission has been granted, the wallet will be returned and exposing the full API for the app to use.
|
|
144
149
|
*
|
|
145
150
|
* Query BrowserWallet.getInstalledWallets() to get a list of available wallets, then provide the wallet name for which wallet the user would like to connect with.
|
|
146
151
|
*
|
|
@@ -148,7 +153,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
148
153
|
* @param extensions - optional, a list of CIPs that the wallet should support
|
|
149
154
|
* @returns WalletInstance
|
|
150
155
|
*/
|
|
151
|
-
static enable(walletName: string, extensions?:
|
|
156
|
+
static enable(walletName: string, extensions?: Extension[]): Promise<BrowserWallet>;
|
|
152
157
|
/**
|
|
153
158
|
* 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:
|
|
154
159
|
* - A unit is provided to display asset's name on the user interface.
|
|
@@ -235,7 +240,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
235
240
|
/**
|
|
236
241
|
* Submits the signed transaction to the blockchain network.
|
|
237
242
|
*
|
|
238
|
-
* As wallets should already have this ability to submit transaction, we allow
|
|
243
|
+
* As wallets should already have this ability to submit transaction, we allow apps to request that a transaction be sent through it. If the wallet accepts the transaction and tries to send it, it shall return the transaction ID for the app to track. The wallet can return error messages or failure if there was an error in sending it.
|
|
239
244
|
*
|
|
240
245
|
* @param tx
|
|
241
246
|
* @returns a transaction hash
|
|
@@ -294,7 +299,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
294
299
|
* The connected wallet account provides the account's public DRep Key, derivation as described in CIP-0105.
|
|
295
300
|
* These are used by the client to identify the user's on-chain CIP-1694 interactions, i.e. if a user has registered to be a DRep.
|
|
296
301
|
*
|
|
297
|
-
* @returns
|
|
302
|
+
* @returns DRep object
|
|
298
303
|
*/
|
|
299
304
|
getDRep(): Promise<{
|
|
300
305
|
publicKey: string;
|
|
@@ -307,11 +312,7 @@ declare class BrowserWallet implements IWallet {
|
|
|
307
312
|
*
|
|
308
313
|
* @returns wallet account's public DRep Key
|
|
309
314
|
*/
|
|
310
|
-
getPubDRepKey(): Promise<
|
|
311
|
-
pubDRepKey: string;
|
|
312
|
-
dRepIDHash: string;
|
|
313
|
-
dRepIDBech32: string;
|
|
314
|
-
} | undefined>;
|
|
315
|
+
getPubDRepKey(): Promise<string | undefined>;
|
|
315
316
|
getRegisteredPubStakeKeys(): Promise<{
|
|
316
317
|
pubStakeKeys: string[];
|
|
317
318
|
pubStakeKeyHashes: string[];
|
|
@@ -384,13 +385,14 @@ type Account = {
|
|
|
384
385
|
baseAddressBech32: string;
|
|
385
386
|
enterpriseAddressBech32: string;
|
|
386
387
|
rewardAddressBech32: string;
|
|
387
|
-
paymentKey:
|
|
388
|
-
stakeKey:
|
|
388
|
+
paymentKey: Ed25519PrivateKey;
|
|
389
|
+
stakeKey: Ed25519PrivateKey;
|
|
389
390
|
paymentKeyHex: string;
|
|
390
391
|
stakeKeyHex: string;
|
|
391
392
|
pubDRepKey?: string;
|
|
392
393
|
dRepIDBech32?: DRepID;
|
|
393
394
|
dRepIDHash?: Ed25519KeyHashHex;
|
|
395
|
+
dRepIDCip105?: string;
|
|
394
396
|
};
|
|
395
397
|
type EmbeddedWalletKeyType = {
|
|
396
398
|
type: "root";
|
|
@@ -411,27 +413,30 @@ type CreateEmbeddedWalletOptions = {
|
|
|
411
413
|
key: EmbeddedWalletKeyType;
|
|
412
414
|
};
|
|
413
415
|
declare class WalletStaticMethods {
|
|
414
|
-
static
|
|
415
|
-
static
|
|
416
|
-
static
|
|
417
|
-
static
|
|
418
|
-
static getAddresses(paymentKey:
|
|
416
|
+
static privateKeyBech32ToPrivateKeyHex(_bech32: string): string;
|
|
417
|
+
static mnemonicToPrivateKeyHex(words: string[]): string;
|
|
418
|
+
static signingKeyToHexes(paymentKey: string, stakeKey: string): [string, string];
|
|
419
|
+
static bip32BytesToPrivateKeyHex(bip32Bytes: Uint8Array): string;
|
|
420
|
+
static getAddresses(paymentKey: Ed25519PrivateKey, stakingKey: Ed25519PrivateKey, networkId?: number): {
|
|
419
421
|
baseAddress: Address;
|
|
420
422
|
enterpriseAddress: Address;
|
|
421
423
|
rewardAddress: Address;
|
|
422
424
|
};
|
|
423
|
-
static getDRepKey(dRepKey:
|
|
425
|
+
static getDRepKey(dRepKey: Ed25519PrivateKey, networkId?: number): {
|
|
424
426
|
pubDRepKey: string;
|
|
425
427
|
dRepIDBech32: DRepID;
|
|
426
428
|
dRepIDHash: Ed25519KeyHashHex;
|
|
429
|
+
dRepIDCip105: string;
|
|
427
430
|
};
|
|
428
431
|
static generateMnemonic(strength?: number): string[];
|
|
429
432
|
static addWitnessSets(txHex: string, witnesses: VkeyWitness[]): string;
|
|
430
433
|
}
|
|
431
434
|
declare class EmbeddedWallet extends WalletStaticMethods {
|
|
432
|
-
private readonly
|
|
435
|
+
private readonly _walletSecret?;
|
|
433
436
|
private readonly _networkId;
|
|
437
|
+
cryptoIsReady: boolean;
|
|
434
438
|
constructor(options: CreateEmbeddedWalletOptions);
|
|
439
|
+
init(): Promise<void>;
|
|
435
440
|
getAccount(accountIndex?: number, keyIndex?: number): Account;
|
|
436
441
|
/**
|
|
437
442
|
* Get wallet network ID.
|
|
@@ -495,20 +500,23 @@ type CreateMeshWalletOptions = {
|
|
|
495
500
|
* ```javascript
|
|
496
501
|
* import { MeshWallet, BlockfrostProvider } from '@meshsdk/core';
|
|
497
502
|
*
|
|
498
|
-
* const
|
|
503
|
+
* const provider = new BlockfrostProvider('<BLOCKFROST_API_KEY>');
|
|
499
504
|
*
|
|
500
505
|
* const wallet = new MeshWallet({
|
|
501
506
|
* networkId: 0,
|
|
502
|
-
* fetcher:
|
|
503
|
-
* submitter:
|
|
507
|
+
* fetcher: provider,
|
|
508
|
+
* submitter: provider,
|
|
504
509
|
* key: {
|
|
505
510
|
* type: 'mnemonic',
|
|
506
511
|
* words: ["solution","solution","solution","solution","solution",","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution"],
|
|
507
512
|
* },
|
|
508
513
|
* });
|
|
509
514
|
* ```
|
|
515
|
+
*
|
|
516
|
+
* Please call `await wallet.init()` after creating the wallet to fetch the addresses from the wallet.
|
|
510
517
|
*/
|
|
511
518
|
declare class MeshWallet implements IWallet {
|
|
519
|
+
private readonly _keyType;
|
|
512
520
|
private readonly _wallet;
|
|
513
521
|
private readonly _accountIndex;
|
|
514
522
|
private readonly _keyIndex;
|
|
@@ -525,8 +533,14 @@ declare class MeshWallet implements IWallet {
|
|
|
525
533
|
pubDRepKey?: string;
|
|
526
534
|
dRepIDBech32?: DRepID;
|
|
527
535
|
dRepIDHash?: Ed25519KeyHashHex;
|
|
536
|
+
dRepIDCip105?: string;
|
|
528
537
|
};
|
|
529
538
|
constructor(options: CreateMeshWalletOptions);
|
|
539
|
+
/**
|
|
540
|
+
* Initializes the wallet. This is a required call as fetching addresses from the wallet is an async operation.
|
|
541
|
+
* @returns void
|
|
542
|
+
*/
|
|
543
|
+
init(): Promise<void>;
|
|
530
544
|
/**
|
|
531
545
|
* Returns all derived addresses from the wallet.
|
|
532
546
|
* @returns a list of addresses
|
|
@@ -541,6 +555,7 @@ declare class MeshWallet implements IWallet {
|
|
|
541
555
|
pubDRepKey?: string;
|
|
542
556
|
dRepIDBech32?: DRepID;
|
|
543
557
|
dRepIDHash?: Ed25519KeyHashHex;
|
|
558
|
+
dRepIDCip105?: string;
|
|
544
559
|
};
|
|
545
560
|
/**
|
|
546
561
|
* 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:
|
|
@@ -555,7 +570,7 @@ declare class MeshWallet implements IWallet {
|
|
|
555
570
|
*
|
|
556
571
|
* @returns an address
|
|
557
572
|
*/
|
|
558
|
-
getChangeAddress(): string
|
|
573
|
+
getChangeAddress(addressType?: GetAddressType): Promise<string>;
|
|
559
574
|
/**
|
|
560
575
|
* This function shall return a list of one or more UTXOs (unspent transaction outputs) controlled by the wallet that are required to reach AT LEAST the combined ADA value target specified in amount AND the best suitable to be used as collateral inputs for transactions with plutus script inputs (pure ADA-only UTXOs).
|
|
561
576
|
*
|
|
@@ -584,7 +599,7 @@ declare class MeshWallet implements IWallet {
|
|
|
584
599
|
* The connected wallet account provides the account's public DRep Key, derivation as described in CIP-0105.
|
|
585
600
|
* These are used by the client to identify the user's on-chain CIP-1694 interactions, i.e. if a user has registered to be a DRep.
|
|
586
601
|
*
|
|
587
|
-
* @returns
|
|
602
|
+
* @returns DRep object
|
|
588
603
|
*/
|
|
589
604
|
getDRep(): Promise<{
|
|
590
605
|
publicKey: string;
|
|
@@ -658,7 +673,7 @@ declare class MeshWallet implements IWallet {
|
|
|
658
673
|
/**
|
|
659
674
|
* Submits the signed transaction to the blockchain network.
|
|
660
675
|
*
|
|
661
|
-
* As wallets should already have this ability to submit transaction, we allow
|
|
676
|
+
* As wallets should already have this ability to submit transaction, we allow apps to request that a transaction be sent through it. If the wallet accepts the transaction and tries to send it, it shall return the transaction ID for the app to track. The wallet can return error messages or failure if there was an error in sending it.
|
|
662
677
|
*
|
|
663
678
|
* @param tx - a signed transaction in CBOR
|
|
664
679
|
* @returns a transaction hash
|
|
@@ -725,6 +740,7 @@ declare class MeshWallet implements IWallet {
|
|
|
725
740
|
pubDRepKey: string | undefined;
|
|
726
741
|
dRepIDBech32: string | undefined;
|
|
727
742
|
dRepIDHash: string | undefined;
|
|
743
|
+
dRepIDCip105: string | undefined;
|
|
728
744
|
};
|
|
729
745
|
/**
|
|
730
746
|
* Generate mnemonic or private key
|