-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add decode data method in Tx Service Api #1007
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ac08c74
Add decode data method in tx service api
falvaradorodriguez 3f4f8be
Update param doc
falvaradorodriguez 6b92856
Merge branch 'main' into add_decode_data_method
falvaradorodriguez f8a8ffc
Add type to response and improve tests
falvaradorodriguez f8658c6
Add missing types to Tx Service API
falvaradorodriguez 65f5875
Merge branch 'main' into add_decode_data_method
falvaradorodriguez 3252441
Merge branch 'main' into add_decode_data_method
falvaradorodriguez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
from typing import Any, List, Optional, TypedDict | ||
|
||
from eth_typing import AnyAddress, HexStr | ||
|
||
|
||
class ParameterDecoded(TypedDict): | ||
name: str | ||
type: str | ||
value: Any | ||
|
||
|
||
class DataDecoded(TypedDict): | ||
method: str | ||
parameters: List[ParameterDecoded] | ||
|
||
|
||
class Erc20Info(TypedDict): | ||
name: str | ||
symbol: str | ||
decimals: int | ||
logo_uri: str | ||
|
||
|
||
class Balance(TypedDict): | ||
token_address: Optional[AnyAddress] | ||
token: Optional[Erc20Info] | ||
balance: int | ||
|
||
|
||
class DelegateUser(TypedDict): | ||
safe: Optional[AnyAddress] | ||
delegate: AnyAddress | ||
delegator: AnyAddress | ||
label: str | ||
|
||
|
||
class MessageConfirmation(TypedDict): | ||
created: str | ||
modified: str | ||
owner: AnyAddress | ||
signature: HexStr | ||
signatureType: str | ||
|
||
|
||
class Message(TypedDict): | ||
created: str | ||
modified: str | ||
safe: AnyAddress | ||
messageHash: HexStr | ||
message: Any | ||
proposedBy: AnyAddress | ||
safeAppId: int | ||
confirmations: Optional[List[MessageConfirmation]] | ||
preparedSignature: Optional[HexStr] | ||
|
||
|
||
class TransactionConfirmation(TypedDict): | ||
owner: AnyAddress | ||
submissionDate: str | ||
transactionHash: HexStr | ||
signature: HexStr | ||
signatureType: str | ||
|
||
|
||
class Transaction(TypedDict): | ||
safe: AnyAddress | ||
to: AnyAddress | ||
value: str | ||
data: Optional[HexStr] | ||
operation: int | ||
gasToken: Optional[AnyAddress] | ||
safeTxGas: int | ||
baseGas: int | ||
gasPrice: str | ||
refundReceiver: Optional[AnyAddress] | ||
nonce: int | ||
execution_date: str | ||
submission_date: str | ||
modified: str | ||
blockNumber: Optional[int] | ||
transactionHash: HexStr | ||
safeTxHash: HexStr | ||
proposer: AnyAddress | ||
executor: Optional[AnyAddress] | ||
isExecuted: bool | ||
isSuccessful: Optional[bool] | ||
ethGasPrice: Optional[str] | ||
maxFeePerGas: Optional[str] | ||
maxPriorityFeePerGas: Optional[str] | ||
gasUsed: Optional[int] | ||
fee: Optional[int] | ||
origin: Optional[str] | ||
dataDecoded: Optional[List[DataDecoded]] | ||
confirmationsRequired: int | ||
confirmations: Optional[List[TransactionConfirmation]] | ||
trusted: bool | ||
signatures: Optional[HexStr] |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you returning? Maybe you can define a TypedDict (inside a file
entities.py
on thetransaction_service_api/
folder) to make clear what's the return value. And we should do the same for other functionsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I did this by looking at the other methods, but it is not the right thing to do. I will try to update the other method signatures.