WALLET API

WALLET API overview

from uuoskit import wallet

create

Creates a new wallet with the given name

wallet.create('mywallet')

If the creation is successful, it returns the wallet’s password string. If the creation fails, for example, the wallet already exists, etc., it returns an empty string.

open

Opens an existing wallet of the given name

wallet.open('mywallet')

unlock

Unlocks a wallet with the given name and password

psw = 'password return from wallet.create'
wallet.unlock('mywallet', psw)

lock

Locks an existing wallet of the given name

wallet.lock('mywallet')

set_timeout

Sets wallet auto lock timeout (in seconds)

wallet.set_timeout(60)

save

Saves wallet

wallet.save('mywallet')

set_dir

Sets the directory where the wallet is located

list_keys

Lists all key pairs across all wallets

wallet.list_keys('mywallet', psw)

list_wallets()

Lists all wallets in the directory

get_public_keys

Lists all public keys across all opened wallets

wallet.get_public_keys()

lock_all

Locks all opened wallets

wallet.lock_all()

import_key

Imports a private key to the wallet of the given name

wallet.import_key('mywallet', priv_key)

sign_transaction

Signs a transaction