Skip to main content

Wallet

Interfaces for managing the Mystiko wallet, including creating, checking, updating, and exporting operations.

Data Structure​

Wallet data structure is as follows:

PropertyTypeDescription
idString
The wallet ID.
createdAtInt64
The creation time of the wallet.
updatedAtInt64
The last update time of the wallet.
encryptedEntropyString
The encrypted entropy of the wallet.
hashedPasswordString
The hashed password of the wallet.
accountNonceint
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:

ParameterRequiredDescription
passwordtrue
The password for the wallet.
mnemonicPhrasefalse
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');