Skip to content

Commit 4bf3929

Browse files
authored
Merge pull request #18 from TransposeData/feat/fuzzy-parameter
feat: add fuzzy parameter to NFT & Token endpoints
2 parents 0316e36 + e451c6c commit 4bf3929

18 files changed

+49
-39
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ This returns a list of [ENS Records](https://github.com/TransposeData/transpose-
227227
"ens_node":"9BFFC8C1EDE1E51E4BAE137FA37A81CC0379FC08123C4AA00A931D0D983956B7",
228228
"contract_address":"0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
229229
"token_id":75929000750162030430773866845127925090084516346841580577625168871716954805188,
230-
"seq_id":407909,
230+
"meta_block_number":407909,
231231
"owner":"0x2aC92629c4E0E5e4868588f87DC4356606a590b6",
232232
"resolver":"0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41",
233233
"resolved_address":"0x2aC92629c4E0E5e4868588f87DC4356606a590b6",

docs/ens.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The **ENS Record Model** contains the full set of information for a single ENS n
3636
| ens_node | The unique ENS nodehash which points to the ENS name. | `string` |
3737
| contract_address | The contract address of the ENS collection. | `string` |
3838
| token_id | The token ID of the ENS name. | `integer` |
39-
| seq_id | Unique sequential ID of the ENS name used by the Transpose backend. | `integer` |
39+
| meta_block_number | Unique sequential ID of the ENS name used by the Transpose backend. | `integer` |
4040
| owner | The owner of the ENS name. | `string` |
4141
| resolver | The resolver contract address of the ENS name. | `string` |
4242
| resolved_address | The address which has this ENS name set to be their primary name. | `string` |

docs/nft.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ The **NFT API** supports the following groups of endpoints:
2424
| ---------------------------------------------------------------------------------------- | --------------------------------------------- | ------------------ |
2525
| `nft.collections_by_date_created(created_after, created_before, standard, order, limit)` | `GET /v0/nft/collections-by-date-created` | `List[Collection]` |
2626
| `nft.collections_by_contract_address(contract_addresses)` | `GET /v0/nft/collections-by-contract-address` | `List[Collection]` |
27-
| `nft.collections_by_name(name, limit)` | `GET /v0/nft/collections-by-name` | `List[Collection]` |
28-
| `nft.collections_by_symbol(symbol, limit)` | `GET /v0/nft/collections-by-symbol` | `List[Collection]` |
27+
| `nft.collections_by_name(name, limit, fuzzy)` | `GET /v0/nft/collections-by-name` | `List[Collection]` |
28+
| `nft.collections_by_symbol(symbol, limit, fuzzy)` | `GET /v0/nft/collections-by-symbol` | `List[Collection]` |
2929

3030
### Collection Model
3131
<details>
@@ -61,7 +61,7 @@ The **Collection Model** represents a single NFT collection. The **Collection Mo
6161
| `nft.nfts_by_date_minted(minted_after, minted_before, contract_address, include_burned_nfts, order, limit)` | `GET /v0/nft/nfts-by-date-minted` | `List[NFT]` |
6262
| `nft.nfts_by_contract_address(contract_addresses, include_burned_nfts, limit)` | `GET /v0/nft/nfts-by-contract-address` | `List[NFT]` |
6363
| `nft.nfts_by_token_id(contract_addresses, token_ids, include_burned_nfts, limit)` | `GET /v0/nft/nfts-by-token-id` | `List[NFT]` |
64-
| `nft.nfts_by_name(name, include_burned_nfts, limit)` | `GET /v0/nft/nfts-by-name` | `List[NFT]` |
64+
| `nft.nfts_by_name(name, include_burned_nfts, limit, fuzzy)` | `GET /v0/nft/nfts-by-name` | `List[NFT]` |
6565
| `nft.nfts_by_owner(owner_address, contract_address, limit)` | `GET /v0/nft/nfts-by-owner` | `List[NFTWithOwner]` |
6666
| `nft.nfts_by_approved_account(approved_address, contract_address, limit)` | `GET /v0/nft/nfts-by-approved-account` | `List[NFT]` |
6767

docs/token.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ The **Token API** supports the following groups of endpoints:
2222
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------ | ---------------------- |
2323
| `token.tokens_by_date_created(created_after, created_before, standard, order, limit)` | `GET /v0/token/tokens-by-date-created` | `List[Token]` |
2424
| `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]` |
25+
| `token.tokens_by_name(name, limit, fuzzy)` | `GET /v0/token/tokens-by-name` | `List[Token]` |
26+
| `token.tokens_by_symbol(symbol, limit, fuzzy)` | `GET /v0/token/tokens-by-symbol` | `List[Token]` |
2727
| `token.tokens_by_owner(owner_address, contract_address, limit)` | `GET /v0/token/tokens-by-owner` | `List[TokenWithOwner]` |
2828

2929
### Token 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.1',
11+
version='1.3.2',
1212

1313
# project meta
1414
long_description = long_description,

tests/test_nft_collections_by_name.py

Lines changed: 2 additions & 2 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-
collections = api.nft.collections_by_name(name='ape')
7+
collections = api.nft.collections_by_name(name='ape', fuzzy=True)
88

99
assert len(collections) >= 1
1010
assert all(collection.contract_address != None for collection in collections)
@@ -16,7 +16,7 @@ def test_cursor():
1616
try:
1717
api = Transpose(api_key)
1818

19-
collections = api.nft.collections_by_name(name='ape')
19+
collections = api.nft.collections_by_name(name='ape', fuzzy=True)
2020

2121
assert len(collections) >= 10
2222
assert all(collection.contract_address != None for collection in collections)

tests/test_nft_collections_by_symbol.py

Lines changed: 2 additions & 2 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-
collections = api.nft.collections_by_symbol(symbol='ayc')
7+
collections = api.nft.collections_by_symbol(symbol='ayc', fuzzy=True)
88

99
assert len(collections) >= 1
1010
assert all(collection.contract_address != None for collection in collections)
@@ -16,7 +16,7 @@ def test_cursor():
1616
try:
1717
api = Transpose(api_key)
1818

19-
collections = api.nft.collections_by_symbol(symbol='ayc')
19+
collections = api.nft.collections_by_symbol(symbol='ayc', fuzzy=True)
2020

2121
assert len(collections) >= 10
2222
assert all(collection.contract_address != None for collection in collections)

tests/test_nft_nfts_by_name.py

Lines changed: 2 additions & 2 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-
tokens = api.nft.nfts_by_name(name='ape')
7+
tokens = api.nft.nfts_by_name(name='ape', fuzzy=True)
88

99
assert len(tokens) >= 1
1010
assert all(token.contract_address != None for token in tokens)
@@ -16,7 +16,7 @@ def test_cursor():
1616
try:
1717
api = Transpose(api_key)
1818

19-
tokens = api.nft.nfts_by_name(name='ape')
19+
tokens = api.nft.nfts_by_name(name='ape', fuzzy=True)
2020

2121
assert len(tokens) >= 10
2222
assert all(token.contract_address != None for token in tokens)

tests/test_token_tokens_by_name.py

Lines changed: 2 additions & 2 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-
collections = api.token.tokens_by_name(name='ape')
7+
collections = api.token.tokens_by_name(name='ape', fuzzy=True)
88

99
assert len(collections) >= 1
1010
assert all(collection.contract_address != None for collection in collections)
@@ -16,7 +16,7 @@ def test_cursor():
1616
try:
1717
api = Transpose(api_key)
1818

19-
collections = api.token.tokens_by_name(name='ape')
19+
collections = api.token.tokens_by_name(name='ape', fuzzy=True)
2020

2121
assert len(collections) >= 10
2222
assert all(collection.contract_address != None for collection in collections)

tests/test_token_tokens_by_symbol.py

Lines changed: 2 additions & 2 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-
collections = api.token.tokens_by_symbol(symbol='usd')
7+
collections = api.token.tokens_by_symbol(symbol='usd', fuzzy=True)
88

99
assert len(collections) >= 1
1010
assert all(collection.contract_address != None for collection in collections)
@@ -16,7 +16,7 @@ def test_cursor():
1616
try:
1717
api = Transpose(api_key)
1818

19-
collections = api.token.tokens_by_symbol(symbol='usd')
19+
collections = api.token.tokens_by_symbol(symbol='usd', fuzzy=True)
2020

2121
assert len(collections) >= 10
2222
assert all(collection.contract_address != None for collection in collections)

0 commit comments

Comments
 (0)