Skip to content

Commit

Permalink
api: add nft num_transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed Dec 15, 2023
1 parent 468e5ed commit c57f3bc
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/spec/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2725,6 +2725,11 @@ components:
type: string
description: The Ethereum address of this NFT instance's owner.
example: "0xDEF1009df2d6872C214cd9148c6883893B7c4D91"
num_transfers:
type: integer
format: int64
description: |
The total number of transfers of this NFT instance.
metadata_uri:
type: string
metadata_accessed:
Expand Down
1 change: 1 addition & 0 deletions storage/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,7 @@ func (c *StorageClient) RuntimeEVMNFTs(ctx context.Context, limit *uint64, offse
&ownerAddrContextIdentifier,
&ownerAddrContextVersion,
&ownerAddrData,
&nft.NumTransfers,
&nft.MetadataUri,
&metadataAccessedN,
&nft.Metadata,
Expand Down
1 change: 1 addition & 0 deletions storage/client/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ const (
owner_preimage.context_identifier,
owner_preimage.context_version,
owner_preimage.address_data,
chain.evm_nfts.num_transfers,
chain.evm_nfts.metadata_uri,
chain.evm_nfts.metadata_accessed,
chain.evm_nfts.metadata,
Expand Down
11 changes: 11 additions & 0 deletions tests/e2e_regression/expected/emerald_account_nfts.body
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmY256sTBaZ9beGAfuc7tM9P4ZagNHbB9HvkudZ5u5zvDT/661",
"name": "Swarm Teddies",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -103,6 +104,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/227.json",
"name": " Oasis Apes #227",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -184,6 +186,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/466.json",
"name": " Oasis Apes #466",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -265,6 +268,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1087.json",
"name": " Oasis Apes #1087",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -346,6 +350,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1297.json",
"name": " Oasis Apes #1297",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -427,6 +432,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1602.json",
"name": " Oasis Apes #1602",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -508,6 +514,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1636.json",
"name": " Oasis Apes #1636",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -589,6 +596,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1670.json",
"name": " Oasis Apes #1670",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -670,6 +678,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1708.json",
"name": " Oasis Apes #1708",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -739,6 +748,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmTymciMsxGjGbG24oVigctR87oDFfZugwKutpP3p5HSGc/181.json",
"name": "ROSEAPE#181",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand All @@ -758,6 +768,7 @@
"id": "862",
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "https://airose.mypinata.cloud/ipfs/QmSEfuX5f33Pxet1HHq536aDwAE6eMFR5kLtBqPDxz9XRH/862",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down
8 changes: 8 additions & 0 deletions tests/e2e_regression/expected/emerald_account_nfts_token.body
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/227.json",
"name": " Oasis Apes #227",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -147,6 +148,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/466.json",
"name": " Oasis Apes #466",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -228,6 +230,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1087.json",
"name": " Oasis Apes #1087",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -309,6 +312,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1297.json",
"name": " Oasis Apes #1297",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -390,6 +394,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1602.json",
"name": " Oasis Apes #1602",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -471,6 +476,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1636.json",
"name": " Oasis Apes #1636",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -552,6 +558,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1670.json",
"name": " Oasis Apes #1670",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -633,6 +640,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1708.json",
"name": " Oasis Apes #1708",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down
1 change: 1 addition & 0 deletions tests/e2e_regression/expected/emerald_token_nft.body
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/227.json",
"name": " Oasis Apes #227",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down
12 changes: 12 additions & 0 deletions tests/e2e_regression/expected/emerald_token_nfts.body
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/227.json",
"name": " Oasis Apes #227",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -147,6 +148,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/466.json",
"name": " Oasis Apes #466",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -228,6 +230,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/753.json",
"name": " Oasis Apes #753",
"num_transfers": 1,
"owner": "oasis1qqqy6augy6gkpfr5jqj28sjfrntre5s8uv9ptgc7",
"owner_eth": "0x8Eac280619b17277AdF5258296Fea04C926730a7",
"token": {
Expand Down Expand Up @@ -309,6 +312,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1087.json",
"name": " Oasis Apes #1087",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -390,6 +394,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1297.json",
"name": " Oasis Apes #1297",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -471,6 +476,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1336.json",
"name": " Oasis Apes #1336",
"num_transfers": 1,
"owner": "oasis1qp4ywl467lsydhuzea4d2nj7647grygd6y4znhk7",
"owner_eth": "0x428F07067F7422c736afcA2735556897620Fa899",
"token": {
Expand Down Expand Up @@ -552,6 +558,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1427.json",
"name": " Oasis Apes #1427",
"num_transfers": 1,
"owner": "oasis1qr5m6rdnrz67uwxf783ct3v0ql32ry8kmsl0ukv4",
"owner_eth": "0x3A843a550e02C6D9CBea11fC2775e24B85751406",
"token": {
Expand Down Expand Up @@ -633,6 +640,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1602.json",
"name": " Oasis Apes #1602",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -714,6 +722,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1636.json",
"name": " Oasis Apes #1636",
"num_transfers": 2,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -795,6 +804,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1670.json",
"name": " Oasis Apes #1670",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -876,6 +886,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/1708.json",
"name": " Oasis Apes #1708",
"num_transfers": 1,
"owner": "oasis1qq92lk7kpqmvllhjvhlc282zp6v2e2t2rqrwuq2u",
"owner_eth": "0x5cC0791892B04c6280F3a2aA64929bf6357544Bc",
"token": {
Expand Down Expand Up @@ -957,6 +968,7 @@
"metadata_accessed": "UNINTERESTING",
"metadata_uri": "ipfs://QmPKAuGQnJCM2FVSxkNcyqf1TyDusKuwuD9VnWJN9CF4xA/2546.json",
"name": " Oasis Apes #2546",
"num_transfers": 1,
"owner": "oasis1qr5m6rdnrz67uwxf783ct3v0ql32ry8kmsl0ukv4",
"owner_eth": "0x3A843a550e02C6D9CBea11fC2775e24B85751406",
"token": {
Expand Down

0 comments on commit c57f3bc

Please sign in to comment.