Mavryk_client_001_PtAtLas.Client_proto_fa12
Client_proto_fa12
implements built-in support for the FA1.2 standard. This module features functions to check whether a contract implements the standard interface and to interact with such contracts using high-level actions
that model the entrypoint calls.
This module also provides functions to unwrap Micheline
values into actions
, which can be useful for indexers or applications using this module to interpret transactions on FA1.2 contracts as FA1.2 operations.
type callback_contract =
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t * string option
A callback contract is represented by an address and a possible entrypoint on which the transaction is done.
type action =
| Transfer of Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t
* Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t
* Z.t
| Approve of Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t * Z.t
| Get_allowance of Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t
* Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t
* callback_contract
| Get_balance of Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t
* callback_contract
| Get_total_supply of callback_contract
val print_action : Stdlib.Format.formatter -> action -> unit
val action_encoding : action Mavryk_base.TzPervasives.Data_encoding.encoding
val action_to_expr :
loc:'loc ->
action ->
('loc, Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Script.prim)
Mavryk_micheline.Micheline.node
val action_of_expr :
entrypoint:string ->
(_, Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Script.prim)
Mavryk_micheline.Micheline.node ->
action Mavryk_base.TzPervasives.tzresult
val convert_wrapped_parameter_into_action :
Protocol_client_context.full ->
chain:Mavryk_shell_services.Shell_services.chain ->
block:Mavryk_shell_services.Shell_services.block ->
Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.t ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Script.node ->
action Mavryk_base.TzPervasives.tzresult Lwt.t
convert_wrapped_parameter_into_action cctxt ~chain ~block
~contract parameter
converts a wrapped FA1.2 contract parameter
into the corresponding FA1.2 action
.
That is, it takes a contract parameter on the form C_1 .. (C_n
... <entrypoint argument> ))
where C_1 ... C_n
is a sequence of Left
/Right
constructors. It finds the entrypoint corresponding to that path in contract
's interface. The result of the function is the <entrypoint arguments>
applied to the action
corresponding to that entrypoint.
val contract_has_fa12_interface :
Protocol_client_context.full ->
chain:Mavryk_shell_services.Shell_services.chain ->
block:Mavryk_shell_services.Shell_services.block ->
contract:Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.t ->
unit ->
unit Mavryk_base.TzPervasives.tzresult Lwt.t
Check whether a contract has an FA1.2 interface.
val call_contract :
Protocol_client_context.full ->
chain:Mavryk_shell_services.Shell_services.chain ->
block:Mavryk_shell_services.Shell_services.block ->
?confirmations:int ->
?dry_run:bool ->
?verbose_signing:bool ->
?branch:int ->
source:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash ->
src_pk:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key ->
src_sk:Mavryk_client_base.Client_keys.sk_uri ->
contract:Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.t ->
action:action ->
tez_amount:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Tez.t ->
?fee:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Tez.t ->
?gas_limit:
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Gas.Arith.integral ->
?safety_guard:
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Gas.Arith.integral ->
?storage_limit:Z.t ->
?counter:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Manager_counter.t ->
fee_parameter:Injection.fee_parameter ->
unit ->
(Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.transaction
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.manager
Injection.result
* Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.t list)
Mavryk_base.TzPervasives.tzresult
Lwt.t
type token_transfer = {
token_contract : string;
destination : string;
amount : Z.t;
tez_amount : string option;
fee : string option;
gas_limit : Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Gas.Arith.integral
option;
storage_limit : Z.t option;
}
Single transfer operation.
val token_transfer_encoding :
token_transfer Mavryk_base.TzPervasives.Data_encoding.t
val inject_token_transfer_batch :
Protocol_client_context.full ->
chain:Mavryk_shell_services.Chain_services.chain ->
block:Mavryk_shell_services.Block_services.block ->
?confirmations:int ->
?dry_run:bool ->
?verbose_signing:bool ->
sender:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t ->
source:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash ->
src_pk:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key ->
src_sk:Mavryk_client_base.Client_keys.sk_uri ->
token_transfers:token_transfer list ->
fee_parameter:Injection.fee_parameter ->
?counter:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Manager_counter.t ->
?default_fee:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Tez.t ->
?default_gas_limit:
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Gas.Arith.integral ->
?default_storage_limit:Z.t ->
?safety_guard:
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Gas.Arith.integral ->
unit ->
unit Mavryk_base.TzPervasives.tzresult Lwt.t
Inject a batch of token transfers.
val run_view_action :
Protocol_client_context.full ->
chain:Mavryk_shell_services.Shell_services.chain ->
block:Mavryk_shell_services.Shell_services.block ->
sender:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t option ->
contract:Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.t ->
action:action ->
payer:Mavryk_base.TzPervasives.Signature.public_key_hash option ->
gas:
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Gas.Arith.integral
option ->
unparsing_mode:
Mavryk_protocol_001_PtAtLas.Protocol.Script_ir_unparser.unparsing_mode ->
unit ->
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Script.expr
Mavryk_base.TzPervasives.tzresult
Lwt.t
Run the action without injecting it. Only for views.