Utils¶
Bytom Utils.
-
shuttle.providers.bytom.utils.
contract_arguments
(amount, address)¶ Get contract arguments.
- Parameters
amount (int) – bytom amount.
address (str) – bytom address.
- Returns
list – bytom contract arguments.
>>> from shuttle.providers.bytom.utils import contract_arguments >>> contract_arguments(bytom_amount, bytom_address) [...]
-
shuttle.providers.bytom.utils.
control_address_action
(amount, asset, address)¶ Get control address action.
- Parameters
amount (int) – bytom amount.
asset (str) – bytom asset.
address (str) – bytom address.
- Returns
dict – bytom control address action.
>>> from shuttle.providers.bytom.utils import control_address_action >>> control_address_action(bytom_amount, bytom_asset, bytom_address) {...}
-
shuttle.providers.bytom.utils.
control_program_action
(amount, asset, control_program)¶ Get control program action.
- Parameters
amount (int) – bytom amount.
asset (str) – bytom asset.
control_program (str) – bytom control program.
- Returns
dict – bytom control program action.
>>> from shuttle.providers.bytom.utils import control_program_action >>> control_program_action(bytom_amount, bytom_asset, bytom_control_program) {...}
-
shuttle.providers.bytom.utils.
decode_transaction_raw
(tx_raw)¶ Decode bytom transaction raw.
- Parameters
tx_raw (str) – bytom transaction raw.
- Returns
dict – decoded bytom transaction.
>>> from shuttle.providers.bytom.utils import decode_transaction_raw >>> decode_transaction_raw(transaction_raw) {...}
-
shuttle.providers.bytom.utils.
find_contract_utxo_id
(tx_id, network)¶ Find smart contract UTXO id.
- Parameters
tx_id (str) – bytom transaction id or hash.
network (str) – bytom network.
- Returns
str – UTXO id.
>>> from shuttle.providers.bytom.utils import find_contract_utxo_id >>> find_contract_utxo_id(bytom_transaction_id, "mainnet") "9059cd0d03e4d4fab70a415169a45be47583f7240115c36cf298d6f261c0a1ac"
-
shuttle.providers.bytom.utils.
spend_account_action
(account, amount, asset)¶ Get spend account action.
- Parameters
account (str) – bytom account.
amount (int) – bytom amount.
asset (str) – bytom asset.
- Returns
dict – bytom spend account action.
>>> from shuttle.providers.bytom.utils import spend_account_action >>> spend_account_action(bytom_account, bytom_amount, bytom_asset) {...}
-
shuttle.providers.bytom.utils.
spend_utxo_action
(utxo)¶ Get spend UTXO action
- Parameters
utxo (str) – bytom butxo id.
- Returns
dict – bytom spend utxo action.
>>> from shuttle.providers.bytom.utils import spend_utxo_action >>> spend_utxo_action(bytom_utxo_id) {...}
-
shuttle.providers.bytom.utils.
spend_wallet_action
(amount, asset)¶ Get spend wallet action.
- Parameters
amount (int) – bytom amount.
asset (str) – bytom asset.
- Returns
dict – bytom spend wallet action.
>>> from shuttle.providers.bytom.utils import spend_wallet_action >>> spend_wallet_action(bytom_amount, bytom_asset) {...}
-
shuttle.providers.bytom.utils.
submit_transaction_raw
(tx_raw)¶ Submit transaction raw to Bytom blockchain.
- Parameters
tx_raw (str) – bytom transaction raw.
- Returns
dict – bytom transaction id, fee, type and date.
>>> from shuttle.providers.bytom.utils import submit_transaction_raw >>> submit_transaction_raw(transaction_raw) {...}