Skip to content

Latest commit

 

History

History
98 lines (70 loc) · 2.15 KB

wallet.md

File metadata and controls

98 lines (70 loc) · 2.15 KB

Wallet

Introduction

Wallet can be thought of as a group of user accounts. Each wallet has its own seed. A private key that represents an account can be generated by hashing the seed and a nonce.

Usage with Python SDK

In Python SDK we have a Wallet class that represents a wallet on the VSYS blockchain.

Properties

Seed

The seed of the wallet.

import py_vsys as pv

# wal: pv.Wallet

print(wal.seed)

Example output

Seed(choose icon security demise fashion robot file dune green play social define clump hedgehog issue)

Actions

Register a new Wallet

Register a new wallet(i.e. generate a new seed)

import py_vsys as pv

wal = pv.Wallet.register()
print(wal)

Example output

<py_vsys.account.Wallet object at 0x10650bc40>

Instantiate from an Existing Seed

Instantiate Wallet from an existing seed.

import py_vsys as pv

seed_str = "choose icon security demise fashion robot file dune green play social define clump hedgehog issue"

wal = pv.Wallet.from_seed_str(seed_str)
print(wal.seed)

seed = pv.Seed(seed_str)
wal = pv.Wallet(seed)
print(wal.seed)

Example output

Seed(choose icon security demise fashion robot file dune green play social define clump hedgehog issue)
Seed(choose icon security demise fashion robot file dune green play social define clump hedgehog issue)

Get Account Object for a Certain Nonce

Get the Account object for a certain nonce.

import py_vsys as pv

# ch: pv.Chain

wal = pv.Wallet.register()
acnt0 = wal.get_account(chain=ch, nonce=0)
print(acnt0.addr)
acnt1 = wal.get_account(chain=ch, nonce=1)
print(acnt1.addr)

Example output

Addr(ATraTqyhkHfbMAJawsyZeikkgS3nxy2iM5A)
Addr(AUCkJmLvAYsHjS9vV9NZ32XJ5BBYGPvvatJ)