tagion.api.wallet

API for using a wallet

Members

Functions

tagion_decrypt_devicepin
int tagion_decrypt_devicepin(const(char*) pin_ptr, const(size_t) pin_len, uint8_t* devicepin_ptr, size_t devicepin_len, securenet_t* out_securenet)

Decrypt and create a securenet from a devicepin and pincode

tagion_generate_keypair
int tagion_generate_keypair(const(char)* passphrase_ptr, const(size_t) passphrase_len, const(char)* salt_ptr, const(size_t) salt_len, securenet_t* out_securenet, const(char*) pin_ptr, const(size_t) pin_len, uint8_t** out_device_doc_ptr, size_t* out_device_doc_len)

Generate a keypair used from a password / menmonic The function does **NOT** validate the menmonic and should therefore be validated by another function.

tagion_sign_message
int tagion_sign_message(const(securenet_t*) root_net, const(uint8_t*) message_ptr, const(size_t) message_len, uint8_t** signature_ptr, size_t* signature_len)

Sign a message

tagion_wallet_create_bill
int tagion_wallet_create_bill(double amount, uint8_t* pubkey, size_t pubkey_len, const(int64_t) time, uint8_t** bill_buf, size_t* bill_buf_len)

Create bill from wallet information

tagion_wallet_create_instance
int tagion_wallet_create_instance(WalletT* wallet_instance)

Create a new wallet instance

tagion_wallet_create_wallet
int tagion_wallet_create_wallet(const(WalletT*) wallet_instance, char* passphrase, size_t passphrase_len, char* pincode, size_t pincode_len)

Create new wallet. Note requires post save of Account, RecoverGenerator and DevicePIN

tagion_wallet_force_bill
int tagion_wallet_force_bill(const(WalletT*) wallet_instance, double amount)

Forces an amount in the wallet. Note. should only be used for testing

tagion_wallet_get_account
int tagion_wallet_get_account(const(WalletT*) wallet_instance, uint8_t** account_buf, size_t* account_buf_len)

Get the AccountDetails

tagion_wallet_get_current_pkey
int tagion_wallet_get_current_pkey(const(WalletT*) wallet_instance, uint8_t** pubkey, size_t* pubkey_len)

Get the wallets current public key

tagion_wallet_get_device_pin
int tagion_wallet_get_device_pin(const(WalletT*) wallet_instance, uint8_t** device_pin_buf, size_t* device_pin_buf_len)

Get the DevicePIN

tagion_wallet_get_recover_generator
int tagion_wallet_get_recover_generator(const(WalletT*) wallet_instance, uint8_t** recover_generator_buf, size_t* recover_generator_buf_len)

Get the recovergenerator

tagion_wallet_login
int tagion_wallet_login(const(WalletT*) wallet_instance, char* pincode, size_t pincode_len)

Login to a wallet. Note the wallet must already have been read.

tagion_wallet_make_trtread
int tagion_wallet_make_trtread(const(WalletT*) wallet_instance, uint8_t** doc_buf, size_t* doc_buf_len)

Make TRT request (serialized, ready to send)

tagion_wallet_pay_bill
int tagion_wallet_pay_bill(const(WalletT*) wallet_instance, uint8_t* bill_buf, size_t bill_buf_len, double* fees)

Pay to a bill

tagion_wallet_read_wallet
int tagion_wallet_read_wallet(const(WalletT*) wallet_instance, uint8_t* device_pin_buf, size_t device_pin_buf_len, uint8_t* recover_generator_buf, size_t recover_generator_buf_length, uint8_t* account_buf, size_t account_buf_len)

Read an already existing wallet based on wallet file buffers

Manifest constants

PUBKEYSIZE
enum PUBKEYSIZE;

Size of a public key

Structs

WalletT
struct WalletT

Wallet Type

securenet_t
struct securenet_t

Pointer to securenet