-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
606 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from typing import Any | ||
|
||
|
||
class ABIReferenceType: | ||
# Account reference type | ||
ACCOUNT = "account" | ||
|
||
# Application reference type | ||
APPLICATION = "application" | ||
|
||
# Asset reference type | ||
ASSET = "asset" | ||
|
||
|
||
def is_abi_reference_type(t: Any) -> bool: | ||
return t in ( | ||
ABIReferenceType.ACCOUNT, | ||
ABIReferenceType.APPLICATION, | ||
ABIReferenceType.ASSET, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from typing import Any | ||
|
||
from algosdk import constants | ||
from algosdk.future.transaction import Transaction | ||
|
||
|
||
class ABITransactionType: | ||
# Any transaction type | ||
ANY = "txn" | ||
|
||
# Payment transaction type | ||
PAY = constants.PAYMENT_TXN | ||
|
||
# Key registration transaction type | ||
KEYREG = constants.KEYREG_TXN | ||
|
||
# Asset configuration transaction type | ||
ACFG = constants.ASSETCONFIG_TXN | ||
|
||
# Asset transfer transaction type | ||
AXFER = constants.ASSETTRANSFER_TXN | ||
|
||
# Asset freeze transaction type | ||
AFRZ = constants.ASSETFREEZE_TXN | ||
|
||
# Application transaction type | ||
APPL = constants.APPCALL_TXN | ||
|
||
|
||
def is_abi_transaction_type(t: Any) -> bool: | ||
return t in ( | ||
ABITransactionType.ANY, | ||
ABITransactionType.PAY, | ||
ABITransactionType.KEYREG, | ||
ABITransactionType.ACFG, | ||
ABITransactionType.AXFER, | ||
ABITransactionType.AFRZ, | ||
ABITransactionType.APPL, | ||
) | ||
|
||
|
||
def check_abi_transaction_type(t: Any, txn: Transaction) -> bool: | ||
if t == ABITransactionType.ANY: | ||
return True | ||
return txn.type and txn.type == t |
Oops, something went wrong.