Skip to content

Commit

Permalink
Merge pull request #84 from ultraio/BLOCK-1819-3rd-party-doc-query-NF…
Browse files Browse the repository at this point in the history
…Ts-with-nodeos-APIs

add endpoints doc, add nodeos api doc for query nft and factory
  • Loading branch information
keisuke-kanao authored Sep 28, 2023
2 parents 73e5498 + dc02bce commit c7b94ff
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 2 deletions.
92 changes: 92 additions & 0 deletions docs/api/REST/get-table-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,98 @@ If the response has "more" with an account name that means there are more entrie
```
:::

### How to fetch the NFTs of a given account

- *code* is eosio.nft.ft, where NFT smart contract is deployed.
- *table* is token.b.
- *scope* is the owner account, in this case: *fy1rp2kk3np4*.

::: details NFT query
```shell
curl -s -X POST http://ultra.api.eosnation.io/v1/chain/get_table_rows -H 'Content-Type: application/json' --data '{"table":"token.b","scope":"fy1rp2kk3np4","code":"eosio.nft.ft","limit":1,"json":true}'

# output example
{
"rows": [
{
"id": 189,
"token_factory_id": 2,
"mint_date": "2021-11-26T07:21:01",
"serial_number": 37,
"uos_payment": 0,
"uri": null,
"hash": null
}
],
"more": true,
"next_key": "272"
}

```
:::


### How to fetch the info of a given factory

- *code* is eosio.nft.ft, where NFT smart contract is deployed.
- *table* is factory.b.
- *scope* is eosio.nft.ft.
- *lower_bound* is the factory id from the above NFT query result: 2

::: details factory query
```shell
curl -s -X POST http://ultra.api.eosnation.io/v1/chain/get_table_rows -H 'Content-Type: application/json' --data '{"table":"factory.b","scope":"eosio.nft.ft","code":"eosio.nft.ft","lower_bound":2,"limit":1,"json":true}'

# example output
{
"rows": [
{
"id": 2,
"asset_manager": "ultra.nft.ft",
"asset_creator": "ultra.nft.ft",
"minimum_resell_price": "0.00000000 UOS",
"resale_shares": [
{
"receiver": "gg1kf2or3vt4",
"basis_point": 500
},
{
"receiver": "mc1lh2wu3wx4",
"basis_point": 500
}
],
"mintable_window_start": null,
"mintable_window_end": null,
"trading_window_start": null,
"trading_window_end": null,
"recall_window_start": 0,
"recall_window_end": null,
"lockup_time": 0,
"conditionless_receivers": [
"ultra.nft.ft"
],
"stat": 0,
"factory_uri": "https://s3.us-east-1.wasabisys.com/ultraio-uniq-prod/3844d9f938db8144895407e198492a2b7a670e975c2224f880815f38c18f7e11.zip",
"factory_hash": "3844d9f938db8144895407e198492a2b7a670e975c2224f880815f38c18f7e11",
"max_mintable_tokens": 80,
"minted_tokens_no": 80,
"existing_tokens_no": 80,
"authorized_tokens_no": null,
"account_minting_limit": null,
"transfer_window_start": null,
"transfer_window_end": null,
"default_token_uri": "https://s3.us-east-1.wasabisys.com/ultraio-uniq-prod/3844d9f938db8144895407e198492a2b7a670e975c2224f880815f38c18f7e11.zip",
"default_token_hash": "3844d9f938db8144895407e198492a2b7a670e975c2224f880815f38c18f7e11",
"lock_hash": 0
}
],
"more": true,
"next_key": "3"
}

```
:::

## Try It

<DemoApi
Expand Down
4 changes: 2 additions & 2 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ _It is recommended to use a package such as [enf-eosjs](https://github.com/eosne
- https://ultra.eosrio.io
- https://api.ultra.cryptolions.io/
- https://ultra-api.eoseoul.io/
- https://uos.eosusa.news
- https://ultra.eosusa.io
- https://api.ultra.eossweden.org

**Test Network (Staging)**

- https://ultratest-api.eoseoul.io/
- http://ultratest.api.eosnation.io
- https://testnet.ultra.eosrio.io
- https://test.uos.eosusa.news
- https://test.ultra.eosusa.io
- https://api.ultra-testnet.cryptolions.io
- https://api.testnet.ultra.eossweden.org

Expand Down

0 comments on commit c7b94ff

Please sign in to comment.