-
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.
API: Support updated simulate endpoint (#466)
- Loading branch information
1 parent
44db7b2
commit c1120d5
Showing
5 changed files
with
66 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from typing import List, Dict, Any, TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from algosdk import transaction | ||
|
||
|
||
class SimulateRequestTransactionGroup(object): | ||
txns: "List[transaction.GenericSignedTransaction]" | ||
|
||
def __init__( | ||
self, *, txns: "List[transaction.GenericSignedTransaction]" | ||
) -> None: | ||
self.txns = txns | ||
|
||
def dictify(self) -> Dict[str, Any]: | ||
return {"txns": [txn.dictify() for txn in self.txns]} | ||
|
||
|
||
class SimulateRequest(object): | ||
txn_groups: List[SimulateRequestTransactionGroup] | ||
|
||
def __init__( | ||
self, *, txn_groups: List[SimulateRequestTransactionGroup] | ||
) -> None: | ||
self.txn_groups = txn_groups | ||
|
||
def dictify(self) -> Dict[str, Any]: | ||
return { | ||
"txn-groups": [ | ||
txn_group.dictify() for txn_group in self.txn_groups | ||
] | ||
} |
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