Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions blockapi/test/v2/api/data/unisat/collection_stats.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"code": 0,
"msg": "OK",
"data": {
"collectionId": "6fb976ab49dcec017f1e2015b625126c5c4d6b71174f5bc5af4f39b274a4b6b5i0",
"name": "Ordinal Punks",
"desc": "The first 10,000 Punks inscribed on Bitcoin",
"icon": "https://ordinals.com/content/6fb976ab49dcec017f1e2015b625126c5c4d6b71174f5bc5af4f39b274a4b6b5i0",
"iconContentType": "image/png",
"btcValue": 1.5,
"floorPrice": 0.1,
"pricePercent": 10.5,
"listed": 50,
"total": 1000,
"supply": 10000,
"twitter": "https://twitter.com/ordinalpunks",
"discord": "https://discord.gg/ordinalpunks",
"website": "https://ordinalpunks.com",
"verification": true
}
"code": 0,
"msg": "ok",
"data": {
"collectionId": "pixel-pepes",
"name": "Pixel Pepes",
"desc": "The first ever airdrop on the Bitcoin network. 1563 rare Pixel Pepes airdropped to users who had made a transaction on ordinalswallet.com before block 777888.",
"icon": "47c1d21c508f6d49dfde64d958f14acd041244e1bb616f9b78114b8d9dc7b945i0",
"iconContentType": "image/png",
"btcValue": 39900000,
"btcValuePercent": 1,
"floorPrice": 990000,
"listed": 20,
"total": 1563,
"supply": null,
"attrs": [],
"twitter": "https://twitter.com/PepesPixel",
"discord": "https://discord.gg/ordinalswallet",
"website": "",
"pricePercent": 1,
"verification": false
}
}
10 changes: 5 additions & 5 deletions blockapi/test/v2/api/nft/test_unisat.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ def test_parse_nfts_edge_cases(
assert nft.asset_type == AssetType.AVAILABLE


def test_fetch_collection(requests_mock, unisat_client, collection_stats_v4):
def test_fetch_collection(requests_mock, unisat_client, collection_stats):
requests_mock.post(
f"{unisat_client.api_options.base_url}market-v4/collection/auction/collection_statistic",
text=collection_stats_v4,
f"{unisat_client.api_options.base_url}v3/market/collection/auction/collection_statistic",
text=collection_stats,
)

test_collection = "pixel-pepes"
Expand Down Expand Up @@ -268,5 +268,5 @@ def offers_data():


@pytest.fixture
def collection_stats_v4():
return read_file('data/unisat/collection_stats_v4.json')
def collection_stats():
return read_file('data/unisat/collection_stats.json')
2 changes: 1 addition & 1 deletion blockapi/v2/api/nft/unisat.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class UnisatApi(BlockchainApi, INftParser, INftProvider):
'get_nfts': 'v1/indexer/address/{address}/inscription-data',
'get_listings': 'v3/market/collection/auction/list',
'get_offers': 'v3/market/collection/auction/actions',
'get_collection_stats': 'market-v4/collection/auction/collection_statistic',
'get_collection_stats': 'v3/market/collection/auction/collection_statistic',
}

def __init__(self, api_key: str, sleep_provider: Optional[ISleepProvider] = None):
Expand Down