Skip to content

Commit

Permalink
Merge pull request #18 from jsvisa/fix-typo
Browse files Browse the repository at this point in the history
fix: some typo and readme document
  • Loading branch information
jsvisa authored Oct 24, 2024
2 parents 309dd78 + 3635ce3 commit 2e54442
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 13 deletions.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,39 @@ The output should be like this :
Transaction: 0x2c744e19638b8dd14dafd03552a390f750e65dc7b0646585cf0ea40ef7a98743
Blocktime: 2023-08-26 10:29:47 UTC
From: 0x7F65...5446
To: 0xE592...1564
To: Uniswap V3: Router [dex]
Value: 0.8088 Ether
GasUsed: 194490
Gas Price: 14.034892345 Gwei
Status: Success
Actions:
Method: multicall(data=...)
Actions
------
- Swap 0.8088 Wrapped Ether [wrapped-token] for 1333.428458 Tether USD (USDT) [bitfinex, stablecoin] on 0x11b8...97F6
- Swap 1333.428458 Tether USD (USDT) [bitfinex, stablecoin] for 0.8079914030453189 Wrapped Ether [wrapped-token] on 0x11b8...97F6

Account: 0xe592427a0aece92de3edee1f18e0157c05861564 (Uniswap V3: Router) [dex]
+----------------------------------------------------------------------------+------------------+
| Asset | Balance Change |
+============================================================================+==================+
| 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 (Wrapped Ether) [wrapped-token] | -0.000808597 |
+----------------------------------------------------------------------------+------------------+

Account: 0x11b815efb8f581194ae79006d24e0d814b7697f6
+----------------------------------------------------------------------------+------------------+
| Asset | Balance Change |
+============================================================================+==================+
| 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 (Wrapped Ether) [wrapped-token] | 0.000808597 |
+----------------------------------------------------------------------------+------------------+

Account: 0x7f65394e8208cd9ef2d411443bd99c57e3e75446
+-----------------------------------------------------------------------------------------------------+------------------+
| Asset | Balance Change |
+=====================================================================================================+==================+
| 0x0000000000000000000000000000000000000000 (Platform Token (ETH Transfer)) [blocked, burn, genesis] | -0.8088 |
+-----------------------------------------------------------------------------------------------------+------------------+
| 0xffffffffffffffffffffffffffffffffffffffff (Platform Token (Gas Fee)) [burn] | -0.00272965 |
+-----------------------------------------------------------------------------------------------------+------------------+
```

### Explain 2 : Swap Exact ETH For Tokens
Expand Down
3 changes: 1 addition & 2 deletions decodex/constant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

__all__ = [
"NULL_ADDRESS_0x0",
"NULL_ADDRESS_0xF"
#
"NULL_ADDRESS_0xF",
"DECODEX_DIR",
]
3 changes: 2 additions & 1 deletion decodex/search/searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Literal
from typing import Tuple
from typing import Union
from typing import Optional

import requests
from web3 import Web3
Expand Down Expand Up @@ -68,7 +69,7 @@ def simluate_tx(


class Web3Searcher(BaseSearcher):
def __init__(self, provider: str = None) -> None:
def __init__(self, provider: Optional[str] = None) -> None:
"""
Initialize a Web3Searcher with a Web3 instance or a Web3 http provider URI.
Expand Down
2 changes: 0 additions & 2 deletions decodex/translate/events/dex.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union

from multicall import Call
from multicall import Multicall
Expand Down
1 change: 0 additions & 1 deletion decodex/translate/translate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import json
import traceback
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
from logging import Logger
Expand Down
1 change: 0 additions & 1 deletion decodex/type/rpc_type.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from typing import Any
from typing import List
from typing import Literal
from typing import Optional
Expand Down
1 change: 0 additions & 1 deletion decodex/type/tx_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import Any
from typing import Dict
from typing import List
from typing import Literal
from typing import Optional
from typing import TypedDict

Expand Down
1 change: 0 additions & 1 deletion decodex/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
"fmt_gas",
"fmt_value",
"fmt_status",
"fmt_actions",
]
3 changes: 1 addition & 2 deletions decodex/utils/fmt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import datetime
from typing import Dict
from typing import Optional

from .utils import trunc_addr

Expand All @@ -12,7 +11,7 @@ def fmt_blktime(blktime: datetime) -> str:
def fmt_addr(ta: Dict, truncate: bool = True) -> str:
addr = ta["address"]
name = ta["name"]
labels = ", ".join(l for l in ta["labels"] if l)
labels = ", ".join(lbl for lbl in ta["labels"] if lbl)

if truncate:
rtn = name if name else trunc_addr(addr)
Expand Down

0 comments on commit 2e54442

Please sign in to comment.