Shapeshifter v0.1.1 Shapeshifter.BOB View Source

Module for converting to and from BOB structured maps.

Usually used internally, although can be used directly for specific use cases such as converting single inputs and outputs to and from BOB formatted maps.

Link to this section Summary

Functions

Converts the given input parameters to a BOB formatted input.

Converts the given output parameters to a BOB formatted output.

Creates a new BOB formatted map from the given Shapeshifter struct.

Converts the given BOB formatted transaction back to a BSV Transaction struct.

Converts the given BOB formatted input back to a BSV Input struct.

Converts the given BOB formatted output back to a BSV Output struct.

Link to this section Functions

Specs

cast_input({BSV.Transaction.Input.t() | map(), integer()}) :: map()

Converts the given input parameters to a BOB formatted input.

Accepts either a BSV Input struct or a TXO formatted input.

Specs

cast_output({BSV.Transaction.Output.t() | map(), integer()}) :: map()

Converts the given output parameters to a BOB formatted output.

Accepts either a BSV Output struct or a TXO formatted output.

Specs

new(Shapeshifter.t()) :: map()

Creates a new BOB formatted map from the given Shapeshifter struct.

Specs

to_tx(%Shapeshifter{format: :bob, src: map()}) :: BSV.Transaction.t()

Converts the given BOB formatted transaction back to a BSV Transaction struct.

Specs

to_tx_input(map()) :: BSV.Transaction.Input.t()

Converts the given BOB formatted input back to a BSV Input struct.

Specs

to_tx_output(map()) :: BSV.Transaction.Output.t()

Converts the given BOB formatted output back to a BSV Output struct.