This function will return a new set of mnemonic phrases as a space separated words, which is used for generating key pairs for tezos account.
The mnemonic must encode entropy in a multiple of 32 bits. With more entropy security is improved but the sentence length increases. We refer to the initial entropy length as strength. The allowed size of strength is 128-256 bits. (The default value of strength is 256)
The generateMnemonic function follows implementations of .
String mnemonic = Dartez.generateMnemonic();
// mnemonic = sustain laugh capital ..... hundred same brave
String mnemonic = Dartez.generateMnemonic(strength: 128);
// mnemonic = sustain laugh capital ….. hundred same brave
Generate Keys From Mnemonics
This function will generate a new set of keys using mnemonic & passphrase, which can be used for interacting with tezos blockchain.
This function reveal an account's publicKey, which is required before performing any transaction on tezos blockchain.
var server = '';
var keyStore = KeyStoreModel(
publicKeyHash: 'tz1U.....W5MHgi',
secretKey: 'edskRp......bL2B6g',
publicKey: 'edpktt.....U1gYJu2',
);
var signer = await Dartez.createSigner(
Dartez.writeKeyWithHint(keyStore.secretKey, 'edsk'));
var result =
await Dartez.sendKeyRevealOperation(server, signer, keyStore);
print('${result['operationGroupID']}');
Unlock Fundraiser Identity
This function will generate a new set of keys using mnemonic, email & passphrase, which can be used for interacting with tezos blockchain.
This function delegate the account to the baker account address, This is a means for non-"baker" (non-validator) accounts to participate in the on-chain governance process and receive staking rewards.
var server = '';
var keyStore = KeyStoreModel(
publicKey: 'edpk.....rrj',
secretKey: 'edsk.....yHH',
publicKeyHash: 'tz1.....hxy',
);
var signer = await Dartez.createSigner(
Dartez.writeKeyWithHint(keyStore.secretKey, 'edsk'));
var result = await Dartez.sendDelegationOperation(
server,
signer,
keyStore,
'tz1.....Lnc',
10000,
);
print("Applied operation ===> $result['appliedOp']");
print("Operation groupID ===> $result['operationGroupID']");
Transfer Balance
This function used for transfer of value between two accounts, In this example we have the account: tz1.....hxy and some random testnet address to test with: tz1.....Lnc. Note all amounts are in µtz, as in micro-tez, hence 0.5tz is represented as 500000. The fee of 1500 was chosen arbitrarily, but some operations have minimum fee requirements.
var server = '';
var keyStore = KeyStoreModel(
publicKey: 'edpk.....rrj',
secretKey: 'edsk.....yHH',
publicKeyHash: 'tz1.....hxy',
);
var signer = await Dartez.createSigner(
Dartez.writeKeyWithHint(keyStore.secretKey, 'edsk'));
var result = await Dartez.sendTransactionOperation(
server,
signer,
keyStore,
'tz1.....Lnc',
500000,
1500,
);
print("Applied operation ===> $result['appliedOp']");
print("Operation groupID ===> $result['operationGroupID']");