tagion_wallet_get_current_pkey

Get the wallets current public key

version(none)
extern (C)
int
tagion_wallet_get_current_pkey
(,
uint8_t** pubkey
,
size_t* pubkey_len
)

Parameters

wallet_instance const(WalletT*)

pointer to the wallet instance

pubkey uint8_t**

pointer to the returned pubkey

pubkey_len size_t*

length of the returned pubkey

Return Value

Type: int

Examples

WalletT w;
int rt = tagion_wallet_create_instance(&w);
const passphrase = "some passphrase";
const pincode = "1234";
rt = tagion_wallet_create_wallet(&w, &passphrase[0], passphrase.length, &pincode[0], pincode.length);

uint8_t* pubkey_buf;
size_t pubkey_len;

rt = tagion_wallet_get_current_pkey(&w, &pubkey_buf, &pubkey_len);
assert(rt == ErrorCode.none);
assert(pubkey_len == PUBKEYSIZE);
const pkey = cast(Pubkey) pubkey_buf[0..pubkey_len].idup;

rt = tagion_wallet_get_current_pkey(&w, &pubkey_buf, &pubkey_len);
assert(rt == ErrorCode.none);
assert(pubkey_len == PUBKEYSIZE);
const _pkey = cast(Pubkey) pubkey_buf[0..pubkey_len].idup;
assert(pkey == _pkey, "should not have changed");