blockchain.accounts #
would be good idea to abstract, basically as account for specific blockchain, then have only one way how to list assets, send money, do multisig, ... and depending of the blockchain have different implementation
IMPORTANT
- there is duplication now, asset & model
fn db_get #
fn db_get(path0 string) !MoneyDB
fn deserialize #
fn deserialize(data []u8) !Position
fn keysafe_get #
fn keysafe_get(path0 string, secret string) !PrivKeysSafe
struct Account #
struct Account {
pub mut:
uid u32
pubkey ed25519.PublicKey
positions []Position
}
struct Asset #
struct Asset {
pub mut:
uid u16
name string
maxinstances u32
maxparts u16 // how many max parts per instance e.g. an art piece can be owned 1/8, so 8 parts.
}
struct Position #
struct Position {
pub mut:
asset u16
instance u32
part u16
}
fn (Position) serialize #
fn (p Position) serialize() []u8
struct PrivKey #
struct PrivKey {
pub:
id u16
name string
privkey libsodium.PrivateKey
signkey ed25519.PrivateKey
}
fn (PrivKey) serialize #
fn (pk PrivKey) serialize() []u8
struct PrivKeysSafe #
struct PrivKeysSafe {
pub mut:
path pathlib.Path
secret string
privatekeys map[int]PrivKey
}
fn (PrivKeysSafe) generate #
fn (mut ks PrivKeysSafe) generate(count int)
fn (PrivKeysSafe) serialize #
fn (mut ks PrivKeysSafe) serialize() []u8