0

How to call a getter entrypoint in contract using completium-cli? For example if it is declared like this:

variable bar : nat = 0
variable msg : string = ""

getter getBar(s : string) : nat {
  msg := s;
  return (bar + length(s))
}

1 Answer 1

0

if you are using TS binding, it is quite straightforward as shown for example in the FA1.2: https://github.com/completium/archetype-fa1/blob/main/tests/00-fa1.ts#L133

from the CLI, there is the run_getter command:

completium-cli run getter <GETTER_ID> on <CONTRACT_ALIAS|CONTRACT_ADDRESS> [--arg <MICHELSON_DATA>] [--as <CALLER_ADDRESS>]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.