Fireblocks.Evm.Contract.Call (Fireblocks v0.1.0)

Copy Markdown View Source

Represents an encoded ABI function call ready to be sent to the Fireblocks API.

Each function generated by Fireblocks.Evm.Contract returns one of these structs. Pass it to Fireblocks.Evm.Contract.read/2 or Fireblocks.Evm.Contract.write/2.

Fields

  • :function – the Solidity function name (e.g. "transfer").
  • :inputs – list of %{name: String.t(), type: String.t(), value: any()} maps.
  • :state_mutability – one of :pure, :view, :non_payable, :payable (or nil).
  • :selector – the parsed %ABI.FunctionSelector{} used for encoding (internal).

Summary

Functions

Converts a %Fireblocks.Evm.Contract.Call{} into the abiFunction map expected by the Fireblocks API.

Types

input()

@type input() :: %{name: String.t(), type: String.t(), value: any()}

t()

@type t() :: %Fireblocks.Evm.Contract.Call{
  function: String.t(),
  inputs: [input()],
  selector: ABI.FunctionSelector.t(),
  state_mutability: :pure | :view | :non_payable | :payable | nil
}

Functions

to_abi_function(call)

@spec to_abi_function(t()) :: map()

Converts a %Fireblocks.Evm.Contract.Call{} into the abiFunction map expected by the Fireblocks API.

The Fireblocks API expects:

%{
  "name" => "transfer",
  "inputs" => [
    %{"name" => "to", "type" => "address", "value" => "0x..."},
    %{"name" => "amount", "type" => "uint256", "value" => 1000}
  ]
}