Getting application arguments as ints in TEAL - Algorand
Getting application arguments as ints in TEAL
post by xonack on Aug 25, 2021
Hi all,
I’m calling my application as follows
goal app call --app-arg "int:5".....
I seem to only be able to get a byteslices from invoking
txna ApplicationArgs 0
even though the argument is declared as an int in the goal call. Is there a way to retrieve the argument as an int instead of a byteslice?
post by cusma on Aug 26, 2021
Hi @xonack,
You should convert your argument using the btoi opcode. It does exactly what you want: converts bytes passed as big endian through app call arguments to uint64.