View Source Dpos.Tx behaviour (DPoS v0.4.0)
Define behaviour and implement functions to work with transactions.
Summary
Functions
Builds a new transaction.
Ensure transaction has a correct timestamp value.
Signs the transaction with the sender private key.
Types
Callbacks
@callback type_id() :: integer()
Functions
Builds a new transaction.
Ensure transaction has a correct timestamp value.
Check if timestamp is present and not negative,
otherwise it will be set to Dpos.Time.now/0
.
@spec normalize(t()) :: Dpos.Tx.Normalized.t()
@spec sign(t(), wallet_or_secret(), binary() | nil) :: t()
Signs the transaction with the sender private key.
It accepts either a Dpos.Wallet
or a {"secret", "L"}
tuple as second argument
where the first element is the secret and the second element is the address suffix
(i.e. "L"
for Lisk).
A secondary private_key can also be provided as third argument.