Skip to main content
When using stellar contract invoke, each --arg-name <value> flag is parsed according to the contract’s type spec. This guide shows the correct format for each supported type.

Integers (u32, i32, u64, i64)

Pass bare numeric literals directly on the command line.
cookbooktest.ignore

Large Integers (u128, i128, u256, i256)

Pass bare numeric literals, just like small integers. The CLI reads the raw value as a string internally, bypassing JSON number precision limits entirely.
cookbooktest.ignore

Boolean

Pass true or false as unquoted literals.
cookbooktest.ignore

String

Bare words work for simple strings. Numbers and booleans are also accepted and are automatically converted to their string representation, so you do not need to add extra quoting. Explicit JSON quoting is also accepted.
cookbooktest.ignore

Symbol

Symbols follow the same rules as String: bare words, numbers, and booleans are all accepted, and non-string JSON values are auto-converted.
cookbooktest.ignore

Address

You can pass either a locally known identity name (e.g. alice) or a raw Stellar strkey (G… for accounts, C… for contracts).
cookbooktest.ignore

Bytes / BytesN

Pass a hex-encoded string representing the byte sequence.
cookbooktest.ignore

Optional Arguments

Simply omit the flag. The CLI will supply a void / null value for any Option<T> parameter that is not provided.
cookbooktest.ignore

Vec

Pass a JSON array, quoting the whole value so the shell does not split it.
cookbooktest.ignore

Map

Pass a JSON object with string keys.
cookbooktest.ignore

Tuple

Pass a JSON array whose elements match the tuple’s field order.
cookbooktest.ignore

Struct (User-Defined Type)

Pass a JSON object with the struct’s named fields.
cookbooktest.ignore

Enum / Union (User-Defined Type)

For unit variants, pass the variant name as a plain string. For variants that carry a value, pass a JSON object with the variant name as the key.
cookbooktest.ignore

File-Based Arguments

For long or complex JSON values, use the --arg-file-path flag variant to load the value from a file instead of inlining it on the command line. The flag name is derived from the argument name by appending -file-path.
cookbooktest.ignore
For Bytes and BytesN parameters, the file’s raw binary content is read directly — no hex encoding is required.
cookbooktest.ignore