Wallet
Interfaces for managing the Mystiko wallet, including creating, checking, updating, and exporting operations.
Data Structure
Wallet
data structure is as follows:
Property | Type | Description |
---|---|---|
id | String | The wallet ID. |
createdAt | Int64 | The creation time of the wallet. |
updatedAt | Int64 | The last update time of the wallet. |
encryptedEntropy | String | The encrypted entropy of the wallet. |
hashedPassword | String | The hashed password of the wallet. |
accountNonce | int | The account nonce of the wallet. |
Create
Create a Mystiko Wallet.
import 'package:mystiko_flutter/mystiko_flutter.dart';
MystikoWalletApi api = await Mystiko.mystikoWalletApi();
Response<Wallet, WalletError> response = await api.create(CreateWalletOptions(password: 'wAllet@123!'));
The parameter list for CreateWalletOptions
:
Parameter | Required | Description |
---|---|---|
password | true | The password for the wallet. |
mnemonicPhrase | false | The mnemonic phrase for the wallet. |
Check
CheckCurrent
Check current wallet.
import 'package:mystiko_flutter/mystiko_flutter.dart';
MystikoWalletApi api = await Mystiko.mystikoWalletApi();
Response<Wallet, WalletError> response = await api.checkCurrent();
CheckPassword
Check the password of the wallet.
import 'package:mystiko_flutter/mystiko_flutter.dart';
MystikoWalletApi api = await Mystiko.mystikoWalletApi();
Response<Wallet, WalletError> response = await api.checkPassword('wAllet@123!');
UpdatePassword
Update the password of the wallet.
import 'package:mystiko_flutter/mystiko_flutter.dart';
MystikoWalletApi api = await Mystiko.mystikoWalletApi();
Response<Wallet, WalletError> response = await api.updatePassword('oldPassword', 'newPassword');
ExportMnemonicPhrase
Export the mnemonic phrase of the wallet.
import 'package:mystiko_flutter/mystiko_flutter.dart';
MystikoWalletApi api = await Mystiko.mystikoWalletApi();
Response<String, WalletError> response = await api.exportMnemonicPhrase('password');