ex_plasma v0.1.0 ExPlasma.Transaction.Payment
A Payment Transaction type. Used to send transactions from one party to another on the child chain.
Link to this section Summary
Functions
Creates a new Transaction struct, filling the inputs and outputs
to the default sizes (see @contract_input_count and @contract_output_count).
The associated value for the output type. It's a hard coded value you can find on the contracts
The associated value for the transaction type. It's a hard coded value you can find on the contracts
Link to this section Functions
new(payment)
new(map()) :: {:ok, ExPlasma.Transaction.t()} | ExPlasma.Utxo.validation_tuples()
Creates a new Transaction struct, filling the inputs and outputs
to the default sizes (see @contract_input_count and @contract_output_count).
Examples
iex> alias ExPlasma.Utxo iex> alias ExPlasma.Transaction.Payment iex> address = "0x1dF62f291b2E969fB0849d99D9Ce41e2F137006e" iex> currency = "0x2e262d291c2E969fB0849d99D9Ce41e2F137006e" iex> utxo = %Utxo{owner: address, currency: currency, amount: 1} iex> Payment.new(%{inputs: [], outputs: [utxo]}) {:ok, %ExPlasma.Transaction.Payment{ inputs: [], sigs: [], metadata: nil, outputs: [%ExPlasma.Utxo{
amount: 1,
blknum: nil,
currency: "0x2e262d291c2E969fB0849d99D9Ce41e2F137006e",
oindex: nil,
owner: "0x1dF62f291b2E969fB0849d99D9Ce41e2F137006e",
txindex: nil}]
}}
The associated value for the output type. It's a hard coded value you can find on the contracts
The associated value for the transaction type. It's a hard coded value you can find on the contracts