From 36869692485262bf0279f3166d21e74c7d438c8a Mon Sep 17 00:00:00 2001 From: michaeldiamant Date: Fri, 18 Feb 2022 15:02:48 -0500 Subject: [PATCH 1/8] Update docs to group transaction field tables like go-algorand --- docs/accessing_transaction_field.rst | 101 ++++++++++++++++++++------- 1 file changed, 75 insertions(+), 26 deletions(-) diff --git a/docs/accessing_transaction_field.rst b/docs/accessing_transaction_field.rst index 47839b553..e1cf8fd37 100644 --- a/docs/accessing_transaction_field.rst +++ b/docs/accessing_transaction_field.rst @@ -7,43 +7,60 @@ PyTeal smart contracts can access properties of the current transaction and the blockchain when they are running. Transaction Fields ------------------- +################## + +Information about the current transaction being evaluated can be obtained using the :any:`Txn` object using the PyTeal expressions shown below. + +Since numerous transaction fields are available, the fields are logically organized into tables matching the structure of `go-algorand's Transaction struct definition `_. -Information about the current transaction being evaluated can be obtained using the :any:`Txn` -object. Below are the PyTeal expressions that refer to transaction fields: +Transaction Fields: Common Fields +********************************** ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ +:any:`Txn.type() ` :code:`TealType.bytes` 2 +:any:`Txn.type_enum() ` :code:`TealType.uint64` 2 see table below :any:`Txn.sender() ` :code:`TealType.bytes` 2 32 byte address :any:`Txn.fee() ` :code:`TealType.uint64` 2 in microAlgos -:any:`Txn.first_valid() ` :code:`TealType.uint64` 2 round number +:any:`Txn.first_valid() ` :code:`TealType.uint64` 2 round number :any:`Txn.last_valid() ` :code:`TealType.uint64` 2 round number :any:`Txn.note() ` :code:`TealType.bytes` 2 transaction note in bytes :any:`Txn.lease() ` :code:`TealType.bytes` 2 transaction lease in bytes -:any:`Txn.receiver() ` :code:`TealType.bytes` 2 32 byte address -:any:`Txn.amount() ` :code:`TealType.uint64` 2 in microAlgos -:any:`Txn.close_remainder_to() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.group_index() ` :code:`TealType.uint64` 2 position of this transaction within a transaction group, starting at 0 +:any:`Txn.tx_id() ` :code:`TealType.bytes` 2 the computed ID for this transaction, 32 bytes +:any:`Txn.rekey_to() ` :code:`TealType.bytes` 2 32 byte address +================================================================================ ========================= ================ ============================================================================ + +Transaction Fields: Key Registration +************************************* +================================================================================ ========================= ================ ============================================================================ +Operator Type Min TEAL Version Notes +================================================================================ ========================= ================ ============================================================================ :any:`Txn.vote_pk() ` :code:`TealType.bytes` 2 32 byte address :any:`Txn.selection_pk() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.state_proof_pk ` :code:`TealType.bytes[]` 6 64 byte state proof public key commitment. :any:`Txn.vote_first() ` :code:`TealType.uint64` 2 :any:`Txn.vote_last() ` :code:`TealType.uint64` 2 :any:`Txn.vote_key_dilution() ` :code:`TealType.uint64` 2 :any:`Txn.nonparticipation() ` :code:`TealType.uint64` 5 Marks an account nonparticipating for rewards -:any:`Txn.type() ` :code:`TealType.bytes` 2 -:any:`Txn.type_enum() ` :code:`TealType.uint64` 2 see table below -:any:`Txn.xfer_asset() ` :code:`TealType.uint64` 2 ID of asset being transferred -:any:`Txn.asset_amount() ` :code:`TealType.uint64` 2 value in Asset's units -:any:`Txn.asset_sender() ` :code:`TealType.bytes` 2 32 byte address, causes clawback of all value if sender is the clawback -:any:`Txn.asset_receiver() ` :code:`TealType.bytes` 2 32 byte address -:any:`Txn.asset_close_to() ` :code:`TealType.bytes` 2 32 byte address -:any:`Txn.group_index() ` :code:`TealType.uint64` 2 position of this transaction within a transaction group, starting at 0 -:any:`Txn.tx_id() ` :code:`TealType.bytes` 2 the computed ID for this transaction, 32 bytes -:any:`Txn.application_id() ` :code:`TealType.uint64` 2 -:any:`Txn.on_completion() ` :code:`TealType.uint64` 2 -:any:`Txn.approval_program() ` :code:`TealType.bytes` 2 -:any:`Txn.clear_state_program() ` :code:`TealType.bytes` 2 -:any:`Txn.rekey_to() ` :code:`TealType.bytes` 2 32 byte address +================================================================================ ========================= ================ ============================================================================ + +Transaction Fields: Payment +***************************** +================================================================================ ========================= ================ ============================================================================ +Operator Type Min TEAL Version Notes +================================================================================ ========================= ================ ============================================================================ +:any:`Txn.receiver() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.amount() ` :code:`TealType.uint64` 2 in microAlgos +:any:`Txn.close_remainder_to() ` :code:`TealType.bytes` 2 32 byte address +================================================================================ ========================= ================ ============================================================================ + +Transaction Fields: Asset Config +********************************* +================================================================================ ========================= ================ ============================================================================ +Operator Type Min TEAL Version Notes +================================================================================ ========================= ================ ============================================================================ :any:`Txn.config_asset() ` :code:`TealType.uint64` 2 ID of asset being configured :any:`Txn.config_asset_total() ` :code:`TealType.uint64` 2 :any:`Txn.config_asset_decimals() ` :code:`TealType.uint64` 2 @@ -56,21 +73,53 @@ Operator :any:`Txn.config_asset_reserve() ` :code:`TealType.bytes` 2 32 byte address :any:`Txn.config_asset_freeze() ` :code:`TealType.bytes` 2 32 byte address :any:`Txn.config_asset_clawback() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.created_asset_id() ` :code:`TealType.uint64` 5 The ID of the newly created asset in this transaction. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. +================================================================================ ========================= ================ ============================================================================ + +Transaction Fields: Asset Transfer +*********************************** +================================================================================ ========================= ================ ============================================================================ +Operator Type Min TEAL Version Notes +================================================================================ ========================= ================ ============================================================================ +:any:`Txn.xfer_asset() ` :code:`TealType.uint64` 2 ID of asset being transferred +:any:`Txn.asset_amount() ` :code:`TealType.uint64` 2 value in Asset's units +:any:`Txn.asset_sender() ` :code:`TealType.bytes` 2 32 byte address, causes clawback of all value if sender is the clawback +:any:`Txn.asset_receiver() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.asset_close_to() ` :code:`TealType.bytes` 2 32 byte address +================================================================================ ========================= ================ ============================================================================ + +Transaction Fields: Asset Freeze +********************************* +================================================================================ ========================= ================ ============================================================================ +Operator Type Min TEAL Version Notes +================================================================================ ========================= ================ ============================================================================ :any:`Txn.freeze_asset() ` :code:`TealType.uint64` 2 :any:`Txn.freeze_asset_account() ` :code:`TealType.bytes` 2 32 byte address :any:`Txn.freeze_asset_frozen() ` :code:`TealType.uint64` 2 +================================================================================ ========================= ================ ============================================================================ + +Transaction Fields: Application Call +************************************* +================================================================================ ========================= ================ ============================================================================ +Operator Type Min TEAL Version Notes +================================================================================ ========================= ================ ============================================================================ +:any:`Txn.application_id() ` :code:`TealType.uint64` 2 +:any:`Txn.on_completion() ` :code:`TealType.uint64` 2 +:any:`Txn.approval_program() ` :code:`TealType.bytes` 2 :any:`Txn.global_num_uints() ` :code:`TealType.uint64` 3 Maximum global integers in app schema :any:`Txn.global_num_byte_slices() ` :code:`TealType.uint64` 3 Maximum global byte strings in app schema :any:`Txn.local_num_uints() ` :code:`TealType.uint64` 3 Maximum local integers in app schema :any:`Txn.local_num_byte_slices() ` :code:`TealType.uint64` 3 Maximum local byte strings in app schema -:any:`Txn.extra_program_pages() ` :code:`TealType.uint64` 4 Number of extra program pages for app -:any:`Txn.application_args ` :code:`TealType.bytes[]` 2 Array of application arguments :any:`Txn.accounts ` :code:`TealType.bytes[]` 2 Array of application accounts :any:`Txn.assets ` :code:`TealType.uint64[]` 3 Array of application assets :any:`Txn.applications ` :code:`TealType.uint64[]` 3 Array of applications -:any:`InnerTxn.created_asset_id() ` :code:`TealType.uint64` 5 The ID of the newly created asset in this transaction. This is only valid on inner transactions. -:any:`InnerTxn.created_application_id() ` :code:`TealType.uint64` 5 The ID of the newly created application in this transaction. This is only valid on inner transactions. -:any:`InnerTxn.logs ` :code:`TealType.bytes[]` 5 Array of application logged items. This is only valid on inner transactions. +:any:`Txn.clear_state_program() ` :code:`TealType.bytes` 2 +:any:`Txn.extra_program_pages() ` :code:`TealType.uint64` 4 Number of extra program pages for app +:any:`Txn.application_args ` :code:`TealType.bytes[]` 2 Array of application arguments +:any:`Txn.created_application_id() ` :code:`TealType.uint64` 5 The ID of the newly created application in this transaction. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. +:any:`Txn.logs ` :code:`TealType.bytes[]` 5 Array of application logged items. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. +:any:`Txn.num_logs ` :code:`TealType.uint64` 5 Number of log messages emitted by an application call. +:any:`Txn.last_log ` :code:`TealType.bytes[]` 6 The last message emitted. Empty bytes if none were emitted. Application mode only. ================================================================================ ========================= ================ ============================================================================ Transaction Type From f7616ab188e6ae2c1b2a5c9eebd1b4579520ebd5 Mon Sep 17 00:00:00 2001 From: michaeldiamant Date: Tue, 22 Feb 2022 16:40:52 -0500 Subject: [PATCH 2/8] Update docs to fix state_proof_pk data type --- docs/accessing_transaction_field.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/accessing_transaction_field.rst b/docs/accessing_transaction_field.rst index e1cf8fd37..65d11eb2e 100644 --- a/docs/accessing_transaction_field.rst +++ b/docs/accessing_transaction_field.rst @@ -39,7 +39,7 @@ Operator ================================================================================ ========================= ================ ============================================================================ :any:`Txn.vote_pk() ` :code:`TealType.bytes` 2 32 byte address :any:`Txn.selection_pk() ` :code:`TealType.bytes` 2 32 byte address -:any:`Txn.state_proof_pk ` :code:`TealType.bytes[]` 6 64 byte state proof public key commitment. +:any:`Txn.state_proof_pk ` :code:`TealType.bytes` 6 64 byte state proof public key commitment. :any:`Txn.vote_first() ` :code:`TealType.uint64` 2 :any:`Txn.vote_last() ` :code:`TealType.uint64` 2 :any:`Txn.vote_key_dilution() ` :code:`TealType.uint64` 2 From d7b5738a8dfc8dbdcb90fe943e464f934dd2e82a Mon Sep 17 00:00:00 2001 From: michaeldiamant Date: Tue, 22 Feb 2022 16:56:29 -0500 Subject: [PATCH 3/8] Update docs to fix application call field listing --- docs/accessing_transaction_field.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/accessing_transaction_field.rst b/docs/accessing_transaction_field.rst index 65d11eb2e..2b498aad3 100644 --- a/docs/accessing_transaction_field.rst +++ b/docs/accessing_transaction_field.rst @@ -118,8 +118,7 @@ Operator :any:`Txn.application_args ` :code:`TealType.bytes[]` 2 Array of application arguments :any:`Txn.created_application_id() ` :code:`TealType.uint64` 5 The ID of the newly created application in this transaction. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. :any:`Txn.logs ` :code:`TealType.bytes[]` 5 Array of application logged items. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. -:any:`Txn.num_logs ` :code:`TealType.uint64` 5 Number of log messages emitted by an application call. -:any:`Txn.last_log ` :code:`TealType.bytes[]` 6 The last message emitted. Empty bytes if none were emitted. Application mode only. +:any:`Txn.last_log() ` :code:`TealType.bytes[]` 6 The last message emitted. Empty bytes if none were emitted. Application mode only. ================================================================================ ========================= ================ ============================================================================ Transaction Type From 86a036781943cbb3155ba24740c1b3f24d524437 Mon Sep 17 00:00:00 2001 From: michaeldiamant Date: Tue, 22 Feb 2022 16:58:10 -0500 Subject: [PATCH 4/8] Update docs to remove transaction link per PR feedback --- docs/accessing_transaction_field.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/accessing_transaction_field.rst b/docs/accessing_transaction_field.rst index 2b498aad3..5830513d3 100644 --- a/docs/accessing_transaction_field.rst +++ b/docs/accessing_transaction_field.rst @@ -11,7 +11,7 @@ Transaction Fields Information about the current transaction being evaluated can be obtained using the :any:`Txn` object using the PyTeal expressions shown below. -Since numerous transaction fields are available, the fields are logically organized into tables matching the structure of `go-algorand's Transaction struct definition `_. +Since numerous transaction fields exist, the fields are logically organized into tables by transaction type. Transaction Fields: Common Fields ********************************** From 580cce6d8de98e43cae4298540c147c254883670 Mon Sep 17 00:00:00 2001 From: michaeldiamant Date: Tue, 22 Feb 2022 17:05:54 -0500 Subject: [PATCH 5/8] Fix rst doc formatting --- docs/accessing_transaction_field.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/accessing_transaction_field.rst b/docs/accessing_transaction_field.rst index 5830513d3..1157a4fc3 100644 --- a/docs/accessing_transaction_field.rst +++ b/docs/accessing_transaction_field.rst @@ -118,7 +118,7 @@ Operator :any:`Txn.application_args ` :code:`TealType.bytes[]` 2 Array of application arguments :any:`Txn.created_application_id() ` :code:`TealType.uint64` 5 The ID of the newly created application in this transaction. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. :any:`Txn.logs ` :code:`TealType.bytes[]` 5 Array of application logged items. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. -:any:`Txn.last_log() ` :code:`TealType.bytes[]` 6 The last message emitted. Empty bytes if none were emitted. Application mode only. +:any:`Txn.last_log() ` :code:`TealType.bytes[]` 6 The last message emitted. Empty bytes if none were emitted. Application mode only. ================================================================================ ========================= ================ ============================================================================ Transaction Type @@ -126,7 +126,7 @@ Transaction Type The :any:`Txn.type_enum() ` values can be checked using the :any:`TxnType` enum: -============================== =============== ============ ========================= +============================== =============== ============ ========================= Value Numerical Value Type String Description ============================== =============== ============ ========================= :any:`TxnType.Unknown` :code:`0` unkown unknown type, invalid @@ -219,7 +219,7 @@ Information about the current state of the blockchain can be obtained using the =========================================== ======================= ================ ============================================================= Operator Type Min TEAL Version Notes =========================================== ======================= ================ ============================================================= -:any:`Global.min_txn_fee()` :code:`TealType.uint64` 2 in microAlgos +:any:`Global.min_txn_fee()` :code:`TealType.uint64` 2 in microAlgos :any:`Global.min_balance()` :code:`TealType.uint64` 2 in mircoAlgos :any:`Global.max_txn_life()` :code:`TealType.uint64` 2 number of rounds :any:`Global.zero_address()` :code:`TealType.bytes` 2 32 byte address of all zero bytes From 3d242e74aa7f9d61540a21e1376580c38013a586 Mon Sep 17 00:00:00 2001 From: michaeldiamant Date: Tue, 22 Feb 2022 17:22:57 -0500 Subject: [PATCH 6/8] Update docs to remove superfluous header --- docs/accessing_transaction_field.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/accessing_transaction_field.rst b/docs/accessing_transaction_field.rst index 1157a4fc3..85d104432 100644 --- a/docs/accessing_transaction_field.rst +++ b/docs/accessing_transaction_field.rst @@ -13,7 +13,7 @@ Information about the current transaction being evaluated can be obtained using Since numerous transaction fields exist, the fields are logically organized into tables by transaction type. -Transaction Fields: Common Fields +Common Fields ********************************** ================================================================================ ========================= ================ ============================================================================ @@ -32,7 +32,7 @@ Operator :any:`Txn.rekey_to() ` :code:`TealType.bytes` 2 32 byte address ================================================================================ ========================= ================ ============================================================================ -Transaction Fields: Key Registration +Key Registration ************************************* ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes @@ -46,7 +46,7 @@ Operator :any:`Txn.nonparticipation() ` :code:`TealType.uint64` 5 Marks an account nonparticipating for rewards ================================================================================ ========================= ================ ============================================================================ -Transaction Fields: Payment +Payment ***************************** ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes @@ -56,7 +56,7 @@ Operator :any:`Txn.close_remainder_to() ` :code:`TealType.bytes` 2 32 byte address ================================================================================ ========================= ================ ============================================================================ -Transaction Fields: Asset Config +Asset Config ********************************* ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes @@ -76,7 +76,7 @@ Operator :any:`Txn.created_asset_id() ` :code:`TealType.uint64` 5 The ID of the newly created asset in this transaction. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. ================================================================================ ========================= ================ ============================================================================ -Transaction Fields: Asset Transfer +Asset Transfer *********************************** ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes @@ -88,7 +88,7 @@ Operator :any:`Txn.asset_close_to() ` :code:`TealType.bytes` 2 32 byte address ================================================================================ ========================= ================ ============================================================================ -Transaction Fields: Asset Freeze +Asset Freeze ********************************* ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes @@ -98,7 +98,7 @@ Operator :any:`Txn.freeze_asset_frozen() ` :code:`TealType.uint64` 2 ================================================================================ ========================= ================ ============================================================================ -Transaction Fields: Application Call +Application Call ************************************* ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes From 4631bba0e3cf8d5d3440e77d97dc30f96fe2256c Mon Sep 17 00:00:00 2001 From: michaeldiamant Date: Tue, 22 Feb 2022 18:03:49 -0500 Subject: [PATCH 7/8] Update docs to fix header levels --- docs/accessing_transaction_field.rst | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/accessing_transaction_field.rst b/docs/accessing_transaction_field.rst index 85d104432..45fc216d8 100644 --- a/docs/accessing_transaction_field.rst +++ b/docs/accessing_transaction_field.rst @@ -7,14 +7,17 @@ PyTeal smart contracts can access properties of the current transaction and the blockchain when they are running. Transaction Fields -################## +-------------------------------------------- Information about the current transaction being evaluated can be obtained using the :any:`Txn` object using the PyTeal expressions shown below. Since numerous transaction fields exist, the fields are logically organized into tables by transaction type. +Fields by Transaction Type +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Common Fields -********************************** +....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes @@ -33,7 +36,7 @@ Operator ================================================================================ ========================= ================ ============================================================================ Key Registration -************************************* +....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ @@ -47,7 +50,7 @@ Operator ================================================================================ ========================= ================ ============================================================================ Payment -***************************** +....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ @@ -57,7 +60,7 @@ Operator ================================================================================ ========================= ================ ============================================================================ Asset Config -********************************* +....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ @@ -77,7 +80,7 @@ Operator ================================================================================ ========================= ================ ============================================================================ Asset Transfer -*********************************** +....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ @@ -89,7 +92,7 @@ Operator ================================================================================ ========================= ================ ============================================================================ Asset Freeze -********************************* +....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ @@ -99,7 +102,7 @@ Operator ================================================================================ ========================= ================ ============================================================================ Application Call -************************************* +....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ @@ -121,8 +124,8 @@ Operator :any:`Txn.last_log() ` :code:`TealType.bytes[]` 6 The last message emitted. Empty bytes if none were emitted. Application mode only. ================================================================================ ========================= ================ ============================================================================ -Transaction Type -~~~~~~~~~~~~~~~~ +Transaction Types +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The :any:`Txn.type_enum() ` values can be checked using the :any:`TxnType` enum: @@ -139,7 +142,7 @@ Value Numerical Value Type String Description ============================== =============== ============ ========================= Transaction Array Fields -~~~~~~~~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Some of the exposed transaction fields are arrays with the type :code:`TealType.uint64[]` or :code:`TealType.bytes[]`. These fields are :code:`Txn.application_args`, :code:`Txn.assets`, :code:`Txn.accounts`, :code:`Txn.applications`, @@ -160,7 +163,7 @@ items can be accessed using bracket notation. For example: .. _txn_special_case_arrays: Special case: :code:`Txn.accounts` and :code:`Txn.applications` -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +................................................................ The :code:`Txn.accounts` and :code:`Txn.applications` arrays are special cases. Normal arrays in PyTeal are :code:`0`-indexed, but these are :code:`1`-indexed with special values at index :code:`0`. From 673675bfe4abf1931622e31dff5f208f4e32af89 Mon Sep 17 00:00:00 2001 From: michaeldiamant Date: Tue, 22 Feb 2022 18:07:20 -0500 Subject: [PATCH 8/8] Update docs to alphabetize transaction type field tables --- docs/accessing_transaction_field.rst | 78 ++++++++++++++-------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/accessing_transaction_field.rst b/docs/accessing_transaction_field.rst index 45fc216d8..e8ec3dfa4 100644 --- a/docs/accessing_transaction_field.rst +++ b/docs/accessing_transaction_field.rst @@ -35,28 +35,27 @@ Operator :any:`Txn.rekey_to() ` :code:`TealType.bytes` 2 32 byte address ================================================================================ ========================= ================ ============================================================================ -Key Registration -....................................................... -================================================================================ ========================= ================ ============================================================================ -Operator Type Min TEAL Version Notes -================================================================================ ========================= ================ ============================================================================ -:any:`Txn.vote_pk() ` :code:`TealType.bytes` 2 32 byte address -:any:`Txn.selection_pk() ` :code:`TealType.bytes` 2 32 byte address -:any:`Txn.state_proof_pk ` :code:`TealType.bytes` 6 64 byte state proof public key commitment. -:any:`Txn.vote_first() ` :code:`TealType.uint64` 2 -:any:`Txn.vote_last() ` :code:`TealType.uint64` 2 -:any:`Txn.vote_key_dilution() ` :code:`TealType.uint64` 2 -:any:`Txn.nonparticipation() ` :code:`TealType.uint64` 5 Marks an account nonparticipating for rewards -================================================================================ ========================= ================ ============================================================================ - -Payment +Application Call ....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ -:any:`Txn.receiver() ` :code:`TealType.bytes` 2 32 byte address -:any:`Txn.amount() ` :code:`TealType.uint64` 2 in microAlgos -:any:`Txn.close_remainder_to() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.application_id() ` :code:`TealType.uint64` 2 +:any:`Txn.on_completion() ` :code:`TealType.uint64` 2 +:any:`Txn.approval_program() ` :code:`TealType.bytes` 2 +:any:`Txn.global_num_uints() ` :code:`TealType.uint64` 3 Maximum global integers in app schema +:any:`Txn.global_num_byte_slices() ` :code:`TealType.uint64` 3 Maximum global byte strings in app schema +:any:`Txn.local_num_uints() ` :code:`TealType.uint64` 3 Maximum local integers in app schema +:any:`Txn.local_num_byte_slices() ` :code:`TealType.uint64` 3 Maximum local byte strings in app schema +:any:`Txn.accounts ` :code:`TealType.bytes[]` 2 Array of application accounts +:any:`Txn.assets ` :code:`TealType.uint64[]` 3 Array of application assets +:any:`Txn.applications ` :code:`TealType.uint64[]` 3 Array of applications +:any:`Txn.clear_state_program() ` :code:`TealType.bytes` 2 +:any:`Txn.extra_program_pages() ` :code:`TealType.uint64` 4 Number of extra program pages for app +:any:`Txn.application_args ` :code:`TealType.bytes[]` 2 Array of application arguments +:any:`Txn.created_application_id() ` :code:`TealType.uint64` 5 The ID of the newly created application in this transaction. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. +:any:`Txn.logs ` :code:`TealType.bytes[]` 5 Array of application logged items. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. +:any:`Txn.last_log() ` :code:`TealType.bytes[]` 6 The last message emitted. Empty bytes if none were emitted. Application mode only. ================================================================================ ========================= ================ ============================================================================ Asset Config @@ -79,6 +78,16 @@ Operator :any:`Txn.created_asset_id() ` :code:`TealType.uint64` 5 The ID of the newly created asset in this transaction. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. ================================================================================ ========================= ================ ============================================================================ +Asset Freeze +....................................................... +================================================================================ ========================= ================ ============================================================================ +Operator Type Min TEAL Version Notes +================================================================================ ========================= ================ ============================================================================ +:any:`Txn.freeze_asset() ` :code:`TealType.uint64` 2 +:any:`Txn.freeze_asset_account() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.freeze_asset_frozen() ` :code:`TealType.uint64` 2 +================================================================================ ========================= ================ ============================================================================ + Asset Transfer ....................................................... ================================================================================ ========================= ================ ============================================================================ @@ -91,37 +100,28 @@ Operator :any:`Txn.asset_close_to() ` :code:`TealType.bytes` 2 32 byte address ================================================================================ ========================= ================ ============================================================================ -Asset Freeze +Key Registration ....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ -:any:`Txn.freeze_asset() ` :code:`TealType.uint64` 2 -:any:`Txn.freeze_asset_account() ` :code:`TealType.bytes` 2 32 byte address -:any:`Txn.freeze_asset_frozen() ` :code:`TealType.uint64` 2 +:any:`Txn.vote_pk() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.selection_pk() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.state_proof_pk ` :code:`TealType.bytes` 6 64 byte state proof public key commitment. +:any:`Txn.vote_first() ` :code:`TealType.uint64` 2 +:any:`Txn.vote_last() ` :code:`TealType.uint64` 2 +:any:`Txn.vote_key_dilution() ` :code:`TealType.uint64` 2 +:any:`Txn.nonparticipation() ` :code:`TealType.uint64` 5 Marks an account nonparticipating for rewards ================================================================================ ========================= ================ ============================================================================ -Application Call +Payment ....................................................... ================================================================================ ========================= ================ ============================================================================ Operator Type Min TEAL Version Notes ================================================================================ ========================= ================ ============================================================================ -:any:`Txn.application_id() ` :code:`TealType.uint64` 2 -:any:`Txn.on_completion() ` :code:`TealType.uint64` 2 -:any:`Txn.approval_program() ` :code:`TealType.bytes` 2 -:any:`Txn.global_num_uints() ` :code:`TealType.uint64` 3 Maximum global integers in app schema -:any:`Txn.global_num_byte_slices() ` :code:`TealType.uint64` 3 Maximum global byte strings in app schema -:any:`Txn.local_num_uints() ` :code:`TealType.uint64` 3 Maximum local integers in app schema -:any:`Txn.local_num_byte_slices() ` :code:`TealType.uint64` 3 Maximum local byte strings in app schema -:any:`Txn.accounts ` :code:`TealType.bytes[]` 2 Array of application accounts -:any:`Txn.assets ` :code:`TealType.uint64[]` 3 Array of application assets -:any:`Txn.applications ` :code:`TealType.uint64[]` 3 Array of applications -:any:`Txn.clear_state_program() ` :code:`TealType.bytes` 2 -:any:`Txn.extra_program_pages() ` :code:`TealType.uint64` 4 Number of extra program pages for app -:any:`Txn.application_args ` :code:`TealType.bytes[]` 2 Array of application arguments -:any:`Txn.created_application_id() ` :code:`TealType.uint64` 5 The ID of the newly created application in this transaction. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. -:any:`Txn.logs ` :code:`TealType.bytes[]` 5 Array of application logged items. In v5, only valid on inner transactions. >= v6 works with top-level and inner transactions. -:any:`Txn.last_log() ` :code:`TealType.bytes[]` 6 The last message emitted. Empty bytes if none were emitted. Application mode only. +:any:`Txn.receiver() ` :code:`TealType.bytes` 2 32 byte address +:any:`Txn.amount() ` :code:`TealType.uint64` 2 in microAlgos +:any:`Txn.close_remainder_to() ` :code:`TealType.bytes` 2 32 byte address ================================================================================ ========================= ================ ============================================================================ Transaction Types