WIP
This commit is contained in:
+75
-11
@@ -1,9 +1,60 @@
|
||||
-record(ak,
|
||||
{name = "" :: string(),
|
||||
id = <<>> :: clutch:id(),
|
||||
balance = 0 :: non_neg_integer(),
|
||||
history = [] :: [clutch:tx()],
|
||||
checked = never :: never | clutch:ts()}).
|
||||
% Node, Chain and Net represent the physical network.
|
||||
|
||||
-record(node,
|
||||
{ip = {161,97,102,143} :: inet:ip_address(),
|
||||
external = 3013 :: inet:port_number(), % 3013
|
||||
internal = none :: none | inet:port_number(), % 3113
|
||||
rosetta = none :: none | inet:port_number(), % 8080
|
||||
channel = none :: none | inet:port_number(), % 3014
|
||||
mdw = none :: none | inet:port_number()}). % 4000
|
||||
|
||||
|
||||
-record(chain,
|
||||
{id = "mint.devnet" :: string(),
|
||||
coins = ["gaju"] :: [string()],
|
||||
nodes = [#node{}] :: [#node{}]}).
|
||||
|
||||
|
||||
-record(net,
|
||||
{id = "devnet" :: string(),
|
||||
chains = [#chain{}] :: [#chain{}]}).
|
||||
|
||||
|
||||
|
||||
% AC and Coin represent the financial authority graph for a given coin.
|
||||
|
||||
-record(ac,
|
||||
{id = none :: string(),
|
||||
acs = [] :: [#ac{}]}).
|
||||
|
||||
|
||||
-record(coin,
|
||||
{id = "gaju" :: string(),
|
||||
mint = "mint.devnet" :: string(),
|
||||
acs = [#ac{}] :: [#ac{}]}).
|
||||
|
||||
|
||||
|
||||
% Balance, POA, Key, TXs, all culminate in capturing a complete Wallet view.
|
||||
-record(balance,
|
||||
{coin = "gaju" :: string(),
|
||||
total = 0 :: non_neg_integer(),
|
||||
dist = [{"mint.devnet", 0}] :: [{Chain :: string(), non_neg_integer()}]}).
|
||||
|
||||
|
||||
-record(poa,
|
||||
{name = "" :: string(),
|
||||
id = <<>> :: clutch:id(),
|
||||
balances = [#balance{}] :: [#balance{}],
|
||||
history = [] :: [clutch:tx()],
|
||||
checked = never :: never | clutch:ts()}).
|
||||
|
||||
|
||||
-record(key,
|
||||
{name = "" :: string(),
|
||||
id = <<>> :: clutch:id(),
|
||||
pair = #{} :: #{public := binary(), secret := binary()},
|
||||
type = {{eddsa, ed25519}, 256} :: {Cipher :: term(), Size :: pos_integer()}}).
|
||||
|
||||
|
||||
-record(tx,
|
||||
@@ -12,8 +63,21 @@
|
||||
type = spend :: spend | atom()}).
|
||||
|
||||
|
||||
-record(key,
|
||||
{name = "" :: string(),
|
||||
id = <<>> :: clutch:id(),
|
||||
pair = #{} :: #{public := binary(), secret := binary()},
|
||||
type = {{eddsa, ed25519}, 256} :: {Cipher :: term(), Size :: pos_integer()}}).
|
||||
-record(spend_tx,
|
||||
{sender_id = <<>> :: clutch:id(),
|
||||
recipient_id = <<>> :: clutch:id(),
|
||||
amount = 0 :: non_neg_integer(),
|
||||
gas_price = 0 :: non_neg_integer(),
|
||||
gas = 0 :: non_neg_integer(),
|
||||
ttl = 1 :: pos_integer(),
|
||||
nonce = 0 :: non_neg_integer(),
|
||||
payload = <<>> :: binary()}).
|
||||
|
||||
|
||||
-record(wallet,
|
||||
{version = 1 :: integer(),
|
||||
poas = [] :: [#poa{}],
|
||||
keys = [] :: [#key{}],
|
||||
pass = none :: none | binary(),
|
||||
network_id = <<"mint.devnet">> :: binary(),
|
||||
chains = [#chain{}] :: [#chain{}]}).
|
||||
|
||||
Reference in New Issue
Block a user