Skip to content

Commit 0316e36

Browse files
authored
Merge pull request #17 from TransposeData/1.3.1
1.3.1
2 parents 34126d9 + eb50354 commit 0316e36

File tree

12 files changed

+74
-65
lines changed

12 files changed

+74
-65
lines changed

docs/token.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ The **Token API** supports the following groups of endpoints:
1818
# Endpoint Specifications
1919

2020
## Token Info Endpoints
21-
| SDK Method | Endpoint URL | Returns |
22-
| ---------- | ------------ | ------- |
23-
| `token.tokens_by_date_created(created_after, created_before, standard, order, limit)` | `GET /v0/token/tokens-by-date-created` | `List[Token]` |
24-
| `token.tokens_by_contract_address(contract_address, created_after, created_before, standard, order, limit)` | `GET /v0/token/tokens-by-contract-address` | `List[Token]` |
25-
| `token.tokens_by_name(name, limit)` | `GET /v0/token/tokens-by-name` | `List[Token]` |
26-
| `token.tokens_by_symbol(symbol, limit)` | `GET /v0/token/tokens-by-symbol` | `List[Token]` |
27-
| `token.tokens_by_owner(owner_address, contract_address, limit)` | `GET /v0/token/tokens-by-owner` | `List[TokenWithOwner]` |
21+
| SDK Method | Endpoint URL | Returns |
22+
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------ | ---------------------- |
23+
| `token.tokens_by_date_created(created_after, created_before, standard, order, limit)` | `GET /v0/token/tokens-by-date-created` | `List[Token]` |
24+
| `token.tokens_by_contract_address(contract_address, created_after, created_before, standard, order, limit)` | `GET /v0/token/tokens-by-contract-address` | `List[Token]` |
25+
| `token.tokens_by_name(name, limit)` | `GET /v0/token/tokens-by-name` | `List[Token]` |
26+
| `token.tokens_by_symbol(symbol, limit)` | `GET /v0/token/tokens-by-symbol` | `List[Token]` |
27+
| `token.tokens_by_owner(owner_address, contract_address, limit)` | `GET /v0/token/tokens-by-owner` | `List[TokenWithOwner]` |
2828

2929
### Token Model
3030
<details>
@@ -80,8 +80,8 @@ The **Token With Owner Model** represents a single token with included ownership
8080

8181

8282
## Owner Endpoints
83-
| SDK Method | Endpoint URL | Returns |
84-
| ---------- | ------------ | ------- |
83+
| SDK Method | Endpoint URL | Returns |
84+
| ----------------------------------------------------------- | ------------------------------------------ | ------------------ |
8585
| `token.owners_by_contract_address(contract_address, limit)` | `GET /v0/token/owners-by-contract-address` | `List[TokenOwner]` |
8686

8787
### Token Owner Model
@@ -100,10 +100,10 @@ The **Token Owner Model** represents a single token owner. The **Token Owner Mod
100100

101101

102102
## Operator Endpoints
103-
| SDK Method | Endpoint URL | Returns |
104-
| ---------- | ------------ | ------- |
105-
| `token.operators_by_contract_address(contract_address, limit)` | `GET /v0/token/operators-by-contract-address` | `List[Operator]` |
106-
| `token.operators_by_account(owner_address, contract_address, limit)` | `GET /v0/token/operators-by-account` | `List[Operator]` |
103+
| SDK Method | Endpoint URL | Returns |
104+
| -------------------------------------------------------------------- | --------------------------------------------- | ---------------- |
105+
| `token.operators_by_contract_address(contract_address, limit)` | `GET /v0/token/operators-by-contract-address` | `List[Operator]` |
106+
| `token.operators_by_account(owner_address, contract_address, limit)` | `GET /v0/token/operators-by-account` | `List[Operator]` |
107107

108108
### Operator Model
109109
<details>
@@ -123,11 +123,11 @@ The **Operator Model** represents a single authorized operator for an owner's to
123123

124124

125125
## Transfer Endpoints
126-
| SDK Method | Endpoint URL | Returns |
127-
| ---------- | ------------ | ------- |
128-
| `token.transfers(transferred_after, transferred_before, transfer_category, order, limit)` | `GET /v0/token/transfers` | `List[TokenTransfer]` |
126+
| SDK Method | Endpoint URL | Returns |
127+
| ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | --------------------- |
128+
| `token.transfers(transferred_after, transferred_before, transfer_category, order, limit)` | `GET /v0/token/transfers` | `List[TokenTransfer]` |
129129
| `token.transfers_by_contract_address(contract_address, transferred_after, transferred_before, transfer_category, order, limit)` | `GET /v0/token/transfers-by-contract-address` | `List[TokenTransfer]` |
130-
| `token.transfers_by_account(account_address, transferred_after, transferred_before, transfer_category, order, limit)` | `GET /v0/token/transfers-by-account` | `List[TokenTransfer]` |
130+
| `token.transfers_by_account(account_address, transferred_after, transferred_before, transfer_category, order, limit)` | `GET /v0/token/transfers-by-account` | `List[TokenTransfer]` |
131131

132132
### Token Transfer Model
133133
<details>
@@ -152,11 +152,11 @@ The **Token Transfer Model** represents a single token transfer. The **Token Tra
152152

153153

154154
## Approval Endpoints
155-
| SDK Method | Endpoint URL | Returns |
156-
| ---------- | ------------ | ------- |
157-
| `token.operator_approvals(approved_after, approved_before, order, limit)` | `GET /v0/token/operator-approvals` | `List[OperatorApproval]` |
155+
| SDK Method | Endpoint URL | Returns |
156+
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ------------------------ |
157+
| `token.operator_approvals(approved_after, approved_before, order, limit)` | `GET /v0/token/operator-approvals` | `List[OperatorApproval]` |
158158
| `token.operator_approvals_by_contract_address(contract_address, approved_after, approved_before, order, limit)` | `GET /v0/token/operator-approvals-by-contract-address` | `List[OperatorApproval]` |
159-
| `token.operator_approvals_by_account_address(account_address, approved_after, approved_before, order, limit)` | `GET /v0/token/operator-approvals-by-account-address` | `List[OperatorApproval]` |
159+
| `token.operator_approvals_by_account_address(account_address, approved_after, approved_before, order, limit)` | `GET /v0/token/operator-approvals-by-account-address` | `List[OperatorApproval]` |
160160

161161
### Operator Approval Model
162162
<details>
@@ -180,12 +180,12 @@ The **Operator Approval Model** represents a single operator approval. The **Ope
180180

181181

182182
## Swap Activity Endpoints
183-
| SDK Method | Endpoint URL | Returns |
184-
| ---------- | ------------ | ------- |
185-
| `token.swaps(occurred_after, occurred_before, order, limit)` | `GET /v0/token/swaps` | `List[Swap]` |
186-
| `token.swaps_by_account(account_address, occurred_after, occurred_before, order, limit)` | `GET /v0/token/swaps-by-account` | `List[Swap]` |
187-
| `token.swaps_by_token(token_address, direction, occurred_after, occurred_before, order, limit)` | `GET /v0/token/swaps-by-token` | `List[Swap]` |
188-
| `token.swaps_by_pair(token_one, token_two occurred_after, occurred_before, order, limit)` | `GET /v0/token/swaps-by-pair` | `List[Swap]` |
183+
| SDK Method | Endpoint URL | Returns |
184+
| ---------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------ |
185+
| `token.swaps(occurred_after, occurred_before, confirmed, order, limit)` | `GET /v0/token/swaps` | `List[Swap]` |
186+
| `token.swaps_by_account(account_address, occurred_after, occurred_before, confirmed, order, limit)` | `GET /v0/token/swaps-by-account` | `List[Swap]` |
187+
| `token.swaps_by_token(token_address, direction, occurred_after, occurred_before, confirmed, order, limit)` | `GET /v0/token/swaps-by-token` | `List[Swap]` |
188+
| `token.swaps_by_pair(token_one, token_two occurred_after, occurred_before, confirmed, order, limit)` | `GET /v0/token/swaps-by-pair` | `List[Swap]` |
189189

190190

191191
### Token Swap Model
@@ -194,31 +194,31 @@ The **Operator Approval Model** represents a single operator approval. The **Ope
194194

195195
The **Token Swap Model** represents a single token swap. The **Token Swap Model** follows the following structure:
196196

197-
| Name | Description | Type |
198-
| ---------------- | --------------------------------------------------------------------------- | ----------- |
199-
| pair_contract_address | Contract address of the token pair, if applicable. | `string` |
200-
| from_token | Contract address of the token swapped from. | `string` |
201-
| to_token | Contract address of the token swapped to. | `string` |
202-
| block_number | The block number at which the swap occurred. | `integer` |
203-
| log_index | The log index at which the swap occurred. | `integer` |
204-
| transaction_hash | The transaction hash at which the swap occurred. | `string` |
205-
| timestamp | The timestamp of the swap (in ISO-8601 format). | `date-time` |
206-
| confirmed | Whether the swap is confirmed (i.e 10 blocks have been mined since the swap occurred). | `boolean` |
207-
| exchange_name | The name of the exchange that hosted the token swap. | `string` |
208-
| contract_version | The version of the exchange contract that hosted the token swap. | `string` |
209-
| amount_in | The amount of tokens the swapper put into the swap. | `integer` |
210-
| amount_out | The amount of tokens that the swapper received from the swap | `integer` |
211-
| effective_price | The effective price of `to_token` denominated in `from_token` (`amount_out` / `amount_in`). | `number` |
212-
| sender | The address of the sender (may be a router contract address). | `string` |
213-
| origin |The address of the originator of the swap transaction. | `string` |
197+
| Name | Description | Type |
198+
| --------------------- | ------------------------------------------------------------------------------------------- | ----------- |
199+
| pair_contract_address | Contract address of the token pair, if applicable. | `string` |
200+
| from_token | Contract address of the token swapped from. | `string` |
201+
| to_token | Contract address of the token swapped to. | `string` |
202+
| block_number | The block number at which the swap occurred. | `integer` |
203+
| log_index | The log index at which the swap occurred. | `integer` |
204+
| transaction_hash | The transaction hash at which the swap occurred. | `string` |
205+
| timestamp | The timestamp of the swap (in ISO-8601 format). | `date-time` |
206+
| confirmed | Whether the swap is confirmed (i.e 10 blocks have been mined since the swap occurred). | `boolean` |
207+
| exchange_name | The name of the exchange that hosted the token swap. | `string` |
208+
| contract_version | The version of the exchange contract that hosted the token swap. | `string` |
209+
| quantity_in | The amount of tokens the swapper put into the swap. | `integer` |
210+
| quantity_out | The amount of tokens that the swapper received from the swap | `integer` |
211+
| effective_price | The effective price of `to_token` denominated in `from_token` (`quantity_out` / `quantity_in`). | `number` |
212+
| sender | The address of the sender (may be a router contract address). | `string` |
213+
| origin | The address of the originator of the swap transaction. | `string` |
214214
</details>
215215

216216
## Native Token Endpoints
217-
| SDK Method | Endpoint URL | Returns |
218-
| ---------- | ------------ | ------- |
219-
| `token.native_token_transfers(transferred_after, transferred_before, order, limit)` | `GET /v0/token/native-token-transfers` | `List[NativeTokenTransfer]` |
217+
| SDK Method | Endpoint URL | Returns |
218+
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | --------------------------- |
219+
| `token.native_token_transfers(transferred_after, transferred_before, order, limit)` | `GET /v0/token/native-token-transfers` | `List[NativeTokenTransfer]` |
220220
| `token.native_token_transfers_by_account(account_address, transferred_after, transferred_before, order, limit)` | `GET /v0/token/native-token-transfers-by-account` | `List[NativeTokenTransfer]` |
221-
| `token.native_token_balances_by_account(account_addresses)` | `GET /v0/token/native-token-balances-by-account` | `List[NativeTokenBalance]` |
221+
| `token.native_token_balances_by_account(account_addresses)` | `GET /v0/token/native-token-balances-by-account` | `List[NativeTokenBalance]` |
222222

223223

224224
### Native Token Transfer Model

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# version compliant with PEP440
1010
# https://peps.python.org/pep-0440/
11-
version='1.3.0',
11+
version='1.3.1',
1212

1313
# project meta
1414
long_description = long_description,

transpose/src/api/block/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from ._contract_executions_by_contract_method import _contract_executions_by_method
1717
from ._internal_transactions_by_transaction import _internal_transactions_by_transaction
1818

19-
from transpose.models import *
19+
from ...util.models import *
2020
from typing import List
2121

2222
class Block():

transpose/src/api/cdn/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import time
22
from typing import List
3-
from transpose.models import CDNResponse
43
import multiprocessing.pool as multiprocessing
54

5+
from ...util.models import CDNResponse
6+
67

78
class CDN():
89
def __init__(self, base_class) -> None:

transpose/src/api/ens/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from ._transfers_by_token_id import _transfers_by_token_id
1010
from ._primary_ens_records_by_account import _primary_ens_records_by_account
1111

12-
from transpose.models import *
12+
from ...util.models import *
1313
from typing import List
1414

1515
class ENS():

transpose/src/api/nft/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from ._nft_approvals_by_contract_address import _nft_approvals_by_contract_address
2929
from ._operator_approvals_by_contract_address import _operator_approvals_by_contract_address
3030

31-
from transpose.models import *
31+
from ...util.models import *
3232
from typing import List
3333

3434
class NFT():

transpose/src/api/token/_swaps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
def _swaps(occurred_after: int or str='1970-01-01T00:00:00',
44
occurred_before: int or str='2050-01-01T00:00:00',
5+
confirmed: bool=True,
56
order: str='asc',
67
limit: int=10) -> str:
78

8-
base_url = '{}?occurred_after={}&occurred_before={}&order={}&limit={}'.format(TOKEN_API_ENDPOINTS['swaps'], occurred_after, occurred_before, order, limit)
9+
base_url = '{}?occurred_after={}&occurred_before={}&confirmed={}&order={}&limit={}'.format(TOKEN_API_ENDPOINTS['swaps'], occurred_after, occurred_before, confirmed, order, limit)
910

1011
return base_url

transpose/src/api/token/_swaps_by_account.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
def _swaps_by_account(account_address: str,
44
occurred_after: int or str='1970-01-01T00:00:00',
55
occurred_before: int or str='2050-01-01T00:00:00',
6+
confirmed: bool=True,
67
order: str='asc',
78
limit: int=10) -> str:
89

9-
base_url = '{}?account_address={}&occurred_after={}&occurred_before={}&order={}&limit={}'.format(TOKEN_API_ENDPOINTS['swaps_by_account'], account_address, occurred_after, occurred_before, order, limit)
10+
base_url = '{}?account_address={}&occurred_after={}&occurred_before={}&confirmed={}&order={}&limit={}'.format(TOKEN_API_ENDPOINTS['swaps_by_account'], account_address, occurred_after, occurred_before, confirmed, order, limit)
1011

1112
return base_url

transpose/src/api/token/_swaps_by_pair.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ def _swaps_by_pair(token_one: str,
44
token_two: str,
55
occurred_after: int or str='1970-01-01T00:00:00',
66
occurred_before: int or str='2050-01-01T00:00:00',
7+
confirmed: bool=True,
78
order: str='asc',
89
limit: int=10) -> str:
910

10-
base_url = '{}?token_one={}&token_two={}&occurred_after={}&occurred_before={}&order={}&limit={}'.format(TOKEN_API_ENDPOINTS['swaps_by_pair'], token_one, token_two, occurred_after, occurred_before, order, limit)
11+
base_url = '{}?token_one={}&token_two={}&occurred_after={}&occurred_before={}&confirmed={}&order={}&limit={}'.format(TOKEN_API_ENDPOINTS['swaps_by_pair'], token_one, token_two, occurred_after, occurred_before, confirmed, order, limit)
1112

1213
return base_url

transpose/src/api/token/_swaps_by_token.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ def _swaps_by_token (token_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',
7+
confirmed: bool=True,
78
order: str='asc',
89
limit: int=10) -> str:
910

10-
base_url = '{}?token_address={}&direction={}&occurred_after={}&occurred_before={}&order={}&limit={}'.format(TOKEN_API_ENDPOINTS['swaps_by_token'], token_address, direction, occurred_after, occurred_before, order, limit)
11+
base_url = '{}?token_address={}&direction={}&occurred_after={}&occurred_before={}&confirmed={}&order={}&limit={}'.format(TOKEN_API_ENDPOINTS['swaps_by_token'], token_address, direction, occurred_after, occurred_before, confirmed, order, limit)
1112

1213
return base_url

0 commit comments

Comments
 (0)