Skip to main content

Argument

Argument Objects​

class Argument(ArgumentProtocol)

An argument to a programmable transaction command

BCS

The BCS serialized form of this type is specified in bcs-schema.abnf.

from_bcs​

@classmethod
def from_bcs(cls, bcs: bytes) -> Argument

Create this type from BCS encoded bytes.

from_json​

@classmethod
def from_json(cls, json: str) -> Argument

Create this type from a JSON encoded string.

new_gas​

@classmethod
def new_gas(cls) -> Argument

The gas coin. The gas coin can only be used by-ref, except for with TransferObjects, which can use it by-value.

new_input​

@classmethod
def new_input(cls, input: int) -> Argument

One of the input objects or primitive values (from ProgrammableTransaction inputs)

new_nested_result​

@classmethod
def new_nested_result(cls, command_index: int,
subresult_index: int) -> Argument

Like a Result but it accesses a nested result. Currently, the only usage of this is to access a value from a Move call with multiple return values.

new_result​

@classmethod
def new_result(cls, result: int) -> Argument

The result of another command (from ProgrammableTransaction commands)

nested_result​

def nested_result(ix: int) -> typing.Optional[Argument]

Get the nested result for this result at the given index. Returns None if this is not a Result.

to_bcs​

def to_bcs() -> bytes

Convert this type to BCS encoded bytes.

to_display_string​

def to_display_string() -> str

Render this type as human-readable text.

Some types also print this through the binding's native string conversion; this method is the spelling every object type has.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

to_json​

def to_json() -> str

Convert this type to a JSON encoded string.