View Source Kadena.Pact.Command behaviour (Kadena v0.17.1)

Specifies contracts to build PACT command requests.

Link to this section Summary

Link to this section Types

@type chain_id() :: Kadena.Types.ChainID.t()
@type cmd() :: {:ok, Kadena.Types.Command.t()}
@type cmd_request() :: cont_request() | exec_request()
@type cont_request() :: Kadena.Pact.ContCommand.t()
@type error() :: {:error, Keyword.t()}
@type exec_request() :: Kadena.Pact.ExecCommand.t()
@type hash() :: String.t()
@type keypair() :: Kadena.Types.KeyPair.t()
@type keypairs_list() :: [keypair()]
@type meta_data() :: Kadena.Types.MetaData.t()
@type network_id() :: Kadena.Types.NetworkID.t()
@type signer() :: Kadena.Types.Signer.t()
@type signers_list() :: [signer()]
@type string_value() :: String.t()

Link to this section Callbacks

Link to this callback

add_keypair(cmd, keypair)

View Source
@callback add_keypair(cmd :: cmd_request(), keypair :: keypair()) :: cmd_request()
Link to this callback

add_keypairs(cmd, keypairs)

View Source
@callback add_keypairs(cmd :: cmd_request(), keypairs :: keypairs_list()) :: cmd_request()
@callback add_signer(cmd :: cmd_request(), signer :: signer()) :: cmd_request()
Link to this callback

add_signers(cmd, signers)

View Source
@callback add_signers(cmd :: cmd_request(), signers :: signers_list()) :: cmd_request()
@callback build(cmd :: cmd_request()) :: cmd() | error()
@callback new() :: cmd_request()
Link to this callback

set_code(cmd, code)

View Source (optional)
@callback set_code(cmd :: exec_request(), code :: string_value()) :: exec_request()
@callback set_data(cmd :: cmd_request(), data :: map()) :: cmd_request()
Link to this callback

set_metadata(cmd, meta_data)

View Source
@callback set_metadata(cmd :: cmd_request(), meta_data :: meta_data()) :: cmd_request()
Link to this callback

set_network(cmd, network)

View Source
@callback set_network(cmd :: cmd_request(), network :: atom()) :: cmd_request()
@callback set_nonce(cmd :: cmd_request(), nonce :: string_value()) :: cmd_request()
Link to this callback

set_pact_tx_hash(cmd, hash)

View Source (optional)
@callback set_pact_tx_hash(cmd :: cont_request(), hash :: hash()) :: cont_request()
Link to this callback

set_proof(cmd, proof)

View Source (optional)
@callback set_proof(cmd :: cont_request(), proof :: string_value()) :: cont_request()
Link to this callback

set_rollback(cmd, rollback)

View Source (optional)
@callback set_rollback(cmd :: cont_request(), rollback :: boolean()) :: cont_request()
Link to this callback

set_step(cmd, step)

View Source (optional)
@callback set_step(cmd :: cont_request(), step :: integer()) :: cont_request()