Transaction Manifest Specifications
Grammar
Radix transaction manifest adopts a bash-like grammar. Each manifest consists of a sequence of instructions, each of which contains
-
A command for the type of operation;
-
A variable number of arguments;
-
A semicolon.
Instruction List
-
TAKE_FROM_WORKTOP
Takes the entirety of resource from the worktop and creates a bucket
TAKE_FROM_WORKTOP ResourceAddress("foo") Bucket("xrd_bucket");
-
TAKE_FROM_WORKTOP_BY_AMOUNT
Takes some amount of resource from the worktop and creates a bucket
TAKE_FROM_WORKTOP_BY_AMOUNT Decimal("1.0") ResourceAddress("foo") Bucket("xrd_bucket");
-
TAKE_FROM_WORKTOP_BY_IDS
Takes some non-fungibles from the worktop and creates a bucket
TAKE_FROM_WORKTOP_BY_IDS TreeSet<NonFungibleId>(NonFungibleId("11"), NonFungibleId("22")) ResourceAddress("foo") Bucket("xrd_bucket");
-
RETURN_TO_WORKTOP
Returns a bucket to the worktop
RETURN_TO_WORKTOP Bucket("xrd_bucket");
-
ASSERT_WORKTOP_CONTAINS
Verifies that the worktop contains non-zero amount of the resource, else aborts the transaction
ASSERT_WORKTOP_CONTAINS ResourceAddress("foo");
-
ASSERT_WORKTOP_CONTAINS_BY_AMOUNT
Verifies that the worktop contains at least the given amount of a resource, else aborts the transaction
ASSERT_WORKTOP_CONTAINS_BY_AMOUNT Decimal("1.0") ResourceAddress("foo");
-
ASSERT_WORKTOP_CONTAINS_BY_IDS
Verifies that the worktop contains the specified non-fungibles, else aborts the transaction
ASSERT_WORKTOP_CONTAINS_BY_IDS TreeSet<NonFungibleId>(NonFungibleId("11"), NonFungibleId("22")) ResourceAddress("foo");
-
POP_FROM_AUTH_ZONE
Pops the most recent proof from the auth zone
POP_FROM_AUTH_ZONE Proof("proof");
-
PUSH_TO_AUTH_ZONE
Pushes a proof to the auth zone
PUSH_TO_AUTH_ZONE Proof("proof");
-
CREATE_PROOF_FROM_AUTH_ZONE
Creates a proof of the entirety of resource from the auth zone
CREATE_PROOF_FROM_AUTH_ZONE ResourceAddress("foo") Proof("proof");
-
CREATE_PROOF_FROM_AUTH_ZONE_BY_AMOUNT
Creates a proof of some amount of resource from the auth zone
CREATE_PROOF_FROM_AUTH_ZONE_BY_AMOUNT Decimal("1.0") ResourceAddress("foo") Proof("proof");
-
CREATE_PROOF_FROM_AUTH_ZONE_BY_IDS
Creates a proof of some non-fungibles from the auth zone
CREATE_PROOF_FROM_AUTH_ZONE_BY_IDS TreeSet<NonFungibleId>(NonFungibleId("11"), NonFungibleId("22")) ResourceAddress("foo") Proof("proof");
-
CREATE_PROOF_FROM_BUCKET
Creates a proof from a bucket
CREATE_PROOF_FROM_BUCKET Bucket("special_token") Proof("proof");
-
CLONE_PROOF
Clones a proof
CLONE_PROOF Proof("proof") Proof("proof2");
-
DROP_PROOF
Drops (destroys) a proof
DROP_PROOF Proof("proof");
-
CALL_FUNCTION
Invokes a function on a blueprint
CALL_FUNCTION PackageAddress("my_package") "Airdrop" "new" 500u32 HashMap<String, U8>("key", 1u8);
-
CALL_METHOD
Invokes a method on a component
CALL_METHOD ComponentAddress("gumball_machine") "refill" Bucket("withdraw_xrd") Proof("admin_auth") "hello" Decimal("1.2");
-
CALL_METHOD_WITH_ALL_RESOURCES
Invokes a method with all resources owned by the transaction, whether in buckets or on the worktop
CALL_METHOD_WITH_ALL_RESOURCES Address("gumball_machine") "deposit_batch";
-
PUBLISH_PACKAGE
Packages a package (in hexadecimal).
PUBLISH_PACKAGE Bytes("deadbeef");
Value Representation
All values are strongly typed.
Type | Syntax | Example |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Named buckets and proofs
Buckets and proofs created in manifest can be referred by name.
To create a named bucket and use it for method call,
TAKE_FROM_WORKTOP_BY_AMOUNT
Decimal("1.0")
Address("030000000000000000000000000000000000000000000000000004")
Bucket("my_bucket");
CALL_METHOD
Address("025f87bc67e398f84077cee24378167018bc28c234953bf3c659be")
take_my_bucket
Bucket("my_bucket");
To create a named proof and pass it to a component,
CREATE_PROOF_FROM_BUCKET
Bucket("some_bucket")
Proof("my_proof");
CALL_METHOD
Address("025f87bc67e398f84077cee24378167018bc28c234953bf3c659be")
"protected_method"
Proof("my_proof");