Class: TEALrb::Global
- Inherits:
-
Object
- Object
- TEALrb::Global
- Defined in:
- lib/tealrb/global.rb
Instance Method Summary collapse
- #[](_key) ⇒ Object
- #[]=(_key, _value) ⇒ Object
-
#caller_application_address(*args) ⇒ []byte
The application address of the application that called this application.
-
#caller_application_id(*args) ⇒ Application
The application ID of the application that called this application.
-
#creator_address(*args) ⇒ []byte
Address of the creator of the current application.
-
#current_application_address(*args) ⇒ Account
Address that the current application controls.
-
#current_application_id(*args) ⇒ uint64
ID of current application executing.
-
#group_id(*args) ⇒ []byte
ID of the transaction group.
-
#group_size(*args) ⇒ uint64
Number of transactions in this atomic transaction group.
-
#initialize(contract) ⇒ Global
constructor
A new instance of Global.
-
#latest_timestamp(*args) ⇒ uint64
Last confirmed block UNIX timestamp.
-
#logic_sig_version(*args) ⇒ uint64
Maximum supported version (v2).
-
#max_txn_life(*args) ⇒ uint64
Rounds (v1).
-
#min_balance(*args) ⇒ uint64
Microalgos (v1).
-
#min_txn_fee(*args) ⇒ uint64
Microalgos (v1).
-
#opcode_budget(*args) ⇒ uint64
The remaining cost that can be spent by opcodes in this program.
-
#round(*args) ⇒ uint64
Current round number.
-
#zero_address(*args) ⇒ []byte
32 byte address of all zero bytes (v1).
Constructor Details
#initialize(contract) ⇒ Global
Returns a new instance of Global.
5 6 7 |
# File 'lib/tealrb/global.rb', line 5 def initialize(contract) @contract = contract end |
Instance Method Details
#[](_key) ⇒ Object
9 10 11 |
# File 'lib/tealrb/global.rb', line 9 def [](_key) @contract.app_global_get end |
#[]=(_key, _value) ⇒ Object
13 14 15 |
# File 'lib/tealrb/global.rb', line 13 def []=(_key, _value) @contract.app_global_put end |
#caller_application_address(*args) ⇒ []byte
Returns The application address of the application that called this application. ZeroAddress if this application is at the top-level. Application mode only. (v6).
90 91 92 |
# File 'lib/tealrb/global.rb', line 90 def caller_application_address(*args) @contract.global_opcode('CallerApplicationAddress', *args) end |
#caller_application_id(*args) ⇒ Application
Returns The application ID of the application that called this application. 0 if this application is at the top-level. Application mode only. (v6).
84 85 86 |
# File 'lib/tealrb/global.rb', line 84 def caller_application_id(*args) @contract.app @contract.global_opcode('CallerApplicationID', *args) end |
#creator_address(*args) ⇒ []byte
Returns Address of the creator of the current application. Application mode only. (v3).
63 64 65 |
# File 'lib/tealrb/global.rb', line 63 def creator_address(*args) @contract.global_opcode('CreatorAddress', *args) end |
#current_application_address(*args) ⇒ Account
Returns Address that the current application controls. Application mode only. (v5).
68 69 70 |
# File 'lib/tealrb/global.rb', line 68 def current_application_address(*args) @contract.account @contract.global_opcode('CurrentApplicationAddress', *args) end |
#current_application_id(*args) ⇒ uint64
Returns ID of current application executing. Application mode only. (v2).
58 59 60 |
# File 'lib/tealrb/global.rb', line 58 def current_application_id(*args) @contract.global_opcode('CurrentApplicationID', *args) end |
#group_id(*args) ⇒ []byte
Returns ID of the transaction group. 32 zero bytes if the transaction is not part of a group. (v5).
73 74 75 |
# File 'lib/tealrb/global.rb', line 73 def group_id(*args) @contract.global_opcode('GroupID', *args) end |
#group_size(*args) ⇒ uint64
Returns Number of transactions in this atomic transaction group. At least 1 (v1).
38 39 40 |
# File 'lib/tealrb/global.rb', line 38 def group_size(*args) @contract.global_opcode('GroupSize', *args) end |
#latest_timestamp(*args) ⇒ uint64
Returns Last confirmed block UNIX timestamp. Fails if negative. Application mode only. (v2).
53 54 55 |
# File 'lib/tealrb/global.rb', line 53 def (*args) @contract.global_opcode('LatestTimestamp', *args) end |
#logic_sig_version(*args) ⇒ uint64
Returns Maximum supported version (v2).
43 44 45 |
# File 'lib/tealrb/global.rb', line 43 def logic_sig_version(*args) @contract.global_opcode('LogicSigVersion', *args) end |
#max_txn_life(*args) ⇒ uint64
Returns rounds (v1).
28 29 30 |
# File 'lib/tealrb/global.rb', line 28 def max_txn_life(*args) @contract.global_opcode('MaxTxnLife', *args) end |
#min_balance(*args) ⇒ uint64
Returns microalgos (v1).
23 24 25 |
# File 'lib/tealrb/global.rb', line 23 def min_balance(*args) @contract.global_opcode('MinBalance', *args) end |
#min_txn_fee(*args) ⇒ uint64
Returns microalgos (v1).
18 19 20 |
# File 'lib/tealrb/global.rb', line 18 def min_txn_fee(*args) @contract.global_opcode('MinTxnFee', *args) end |
#opcode_budget(*args) ⇒ uint64
Returns The remaining cost that can be spent by opcodes in this program. (v6).
78 79 80 |
# File 'lib/tealrb/global.rb', line 78 def opcode_budget(*args) @contract.global_opcode('OpcodeBudget', *args) end |
#round(*args) ⇒ uint64
Returns Current round number. Application mode only. (v2).
48 49 50 |
# File 'lib/tealrb/global.rb', line 48 def round(*args) @contract.global_opcode('Round', *args) end |
#zero_address(*args) ⇒ []byte
Returns 32 byte address of all zero bytes (v1).
33 34 35 |
# File 'lib/tealrb/global.rb', line 33 def zero_address(*args) @contract.global_opcode('ZeroAddress', *args) end |