Skip to content

Commit 72b1777

Browse files
committed
fix: rename token_address to contract_address
1 parent 970d933 commit 72b1777

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/test_token_swaps_by_contract_address.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def test_basic():
44
try:
55
api = Transpose(api_key)
66

7-
swaps = api.token.swaps_by_contract_address(token_address='0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')
7+
swaps = api.token.swaps_by_contract_address(contract_address='0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')
88

99
assert len(swaps) >= 1
1010

@@ -15,7 +15,7 @@ def test_cursor():
1515
try:
1616
api = Transpose(api_key)
1717

18-
swaps = api.token.swaps_by_contract_address(token_address='0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', occurred_after='2019-01-01 00:00:00')
18+
swaps = api.token.swaps_by_contract_address(contract_address='0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', occurred_after='2019-01-01 00:00:00')
1919

2020
assert len(swaps) >= 1
2121
assert api._next != None
@@ -31,7 +31,7 @@ def test_range():
3131
try:
3232
api = Transpose(api_key)
3333

34-
swaps = api.token.swaps_by_contract_address(token_address='0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', occurred_after='2019-01-01 00:00:00', occurred_before='2023-01-01 00:00:00')
34+
swaps = api.token.swaps_by_contract_address(contract_address='0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', occurred_after='2019-01-01 00:00:00', occurred_before='2023-01-01 00:00:00')
3535

3636
assert len(swaps) >= 1
3737
assert all(swap.from_token == '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' or swap.to_token == '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' for swap in swaps)

transpose/src/api/token/_swaps_by_contract_address.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from ..constants import TOKEN_API_ENDPOINTS
22

3-
def _swaps_by_contract_address (token_address: str,
3+
def _swaps_by_contract_address (contract_address: str,
44
direction: str='all',
55
occurred_after: int or str='1970-01-01T00:00:00',
66
occurred_before: int or str='2050-01-01T00:00:00',

transpose/src/api/token/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ def swaps_by_account(self,
154154
# Get Swaps by Contract Address
155155
# https://api.transpose.io/v0/token/swaps-by-contract-address
156156
def swaps_by_contract_address (self,
157-
token_address: str = None,
157+
contract_address: str = None,
158158
direction: str = 'all',
159159
occurred_after: int or str='1970-01-01T00:00:00',
160160
occurred_before: int or str='2050-01-01T00:00:00',
161161
order: str='asc',
162162
limit: int=10) -> List[Swap]:
163-
return self.super.perform_authorized_request(Swap, _swaps_by_contract_address(token_address, direction, occurred_after, occurred_before, order, limit))
163+
return self.super.perform_authorized_request(Swap, _swaps_by_contract_address(contract_address, direction, occurred_after, occurred_before, order, limit))
164164

165165
# Get Swaps by Pair
166166
# https://api.transpose.io/v0/token/swaps-by-pair

0 commit comments

Comments
 (0)