tagion_wallet_get_recover_generator

Get the recovergenerator

version(none)
extern (C)
int
tagion_wallet_get_recover_generator

Parameters

wallet_instance const(WalletT*)

pointer to the wallet instance

recover_generator_buf uint8_t**

pointer to the returned buffer for the recovergenerator

recover_generator_buf_len size_t*

length of the returned buffer

Return Value

Type: int

ErrorCode

Examples

import tagion.wallet.AccountDetails;
import tagion.hibon.HiBONRecord;
import tagion.wallet.WalletRecords;
WalletT w;
int rt = tagion_wallet_create_instance(&w);
assert(rt == ErrorCode.none);

string passphrase = "some_passphrase";
string pincode = "some_pincode";

rt = tagion_wallet_create_wallet(&w, &passphrase[0], passphrase.length, &pincode[0], pincode.length);
assert(rt == ErrorCode.none);

uint8_t* account_buf;
size_t account_len;
rt = tagion_wallet_get_account(&w, &account_buf, &account_len); 
assert(rt == ErrorCode.none);
const _account_buf = account_buf[0..account_len].idup;
const _account_doc = Document(_account_buf);
assert(_account_doc.isRecord!AccountDetails == true, "doc was not of type AccountDetails");

uint8_t* device_pin_buf;
size_t device_pin_len;
rt = tagion_wallet_get_device_pin(&w, &device_pin_buf, &device_pin_len); 
assert(rt == ErrorCode.none);
const _device_pin_buf = device_pin_buf[0..device_pin_len].idup;
const _device_pin_doc = Document(_device_pin_buf);
assert(_device_pin_doc.isRecord!DevicePIN == true, "doc was not of type DevicePIN");

uint8_t* recover_generator_buf;
size_t recover_generator_len;
rt = tagion_wallet_get_recover_generator(&w, &recover_generator_buf, &recover_generator_len); 
assert(rt == ErrorCode.none);
const _recover_generator_buf = recover_generator_buf[0..recover_generator_len].idup;
const _recover_generator_doc = Document(_recover_generator_buf);
assert(_recover_generator_doc.isRecord!RecoverGenerator == true, "doc was not of type RecoverGenerator");