diff --git a/OLD_README.md b/OLD_README.md new file mode 100644 index 00000000..024b3d54 --- /dev/null +++ b/OLD_README.md @@ -0,0 +1,77 @@ +# Zilliqa Developer Portal + +[![Discord chat](https://img.shields.io/discord/370992535725932544.svg)](https://discord.gg/XMRE9tt) + +This repository holds the source files for Zilliqa's developer portal website. + +### Installation + +``` +$ yarn +``` + +### Local Development + +``` +$ yarn start +``` + +This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. + +### Local Deployment via Docker container + +To build the docker container + +``` +./build_container.sh +``` + +To run the container + +``` +./run_container.sh +``` + +You can then access the site via + +``` +http://localhost:8080 +``` + +To stop and remove the container + +``` +./stop_container.sh +``` + +### Build + +``` +$ yarn build +``` + +This command generates static content into the `build` directory and can be served using any static contents hosting service. + +### Deployment + +This is done via github actions. + +Docusaurus takes its `baseUrl` from the `BASE_URL` environment variable, which is taken from the `BASE_URL` secret for the `github-pages` environment. +You will need to explicitly whitelist `master` in the allowed branches protection rules for `github-pages`, or deployment will fail with `Invalid deployment branch and no branch protection rules set in the environment`. + +If you don't specify a secret, we'll build for the root - suitable for a production deploying with a custom URL, but best to explicitly set a root as `/`, just in case. + +The staging site is held in a separate repository; push to it with `-f` and deploy to "ordinary" pages. +If you do, we'll use that as the base URL - for the staging repo, set the `BASE_URL` secret to `//`. + +You can then issue a PR to the production repo against your staging repo with (hopefully!) the security that it will deploy correctly. + + +### Utilities + +#### Check all links return HTTP status 200 + +``` +cd docs +find */*.md -exec npx markdown-link-check {} \; +``` diff --git a/README.md b/README.md index 024b3d54..51910e45 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,3 @@ -# Zilliqa Developer Portal +# Deprecation Notice -[![Discord chat](https://img.shields.io/discord/370992535725932544.svg)](https://discord.gg/XMRE9tt) - -This repository holds the source files for Zilliqa's developer portal website. - -### Installation - -``` -$ yarn -``` - -### Local Development - -``` -$ yarn start -``` - -This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. - -### Local Deployment via Docker container - -To build the docker container - -``` -./build_container.sh -``` - -To run the container - -``` -./run_container.sh -``` - -You can then access the site via - -``` -http://localhost:8080 -``` - -To stop and remove the container - -``` -./stop_container.sh -``` - -### Build - -``` -$ yarn build -``` - -This command generates static content into the `build` directory and can be served using any static contents hosting service. - -### Deployment - -This is done via github actions. - -Docusaurus takes its `baseUrl` from the `BASE_URL` environment variable, which is taken from the `BASE_URL` secret for the `github-pages` environment. -You will need to explicitly whitelist `master` in the allowed branches protection rules for `github-pages`, or deployment will fail with `Invalid deployment branch and no branch protection rules set in the environment`. - -If you don't specify a secret, we'll build for the root - suitable for a production deploying with a custom URL, but best to explicitly set a root as `/`, just in case. - -The staging site is held in a separate repository; push to it with `-f` and deploy to "ordinary" pages. -If you do, we'll use that as the base URL - for the staging repo, set the `BASE_URL` secret to `//`. - -You can then issue a PR to the production repo against your staging repo with (hopefully!) the security that it will deploy correctly. - - -### Utilities - -#### Check all links return HTTP status 200 - -``` -cd docs -find */*.md -exec npx markdown-link-check {} \; -``` +This repository has been deprecated in favor of the [Zilliqa Developer Repo](https://github.com/Zilliqa/zilliqa-developer) diff --git a/docs/dev/dev-tools-neosavant.mdx b/docs/dev/dev-tools-neosavant.mdx index f46df452..7ee94059 100644 --- a/docs/dev/dev-tools-neosavant.mdx +++ b/docs/dev/dev-tools-neosavant.mdx @@ -9,7 +9,6 @@ keywords: - installation - vscode extension - emacs - - vim - zilliqa description: Zilliqa Online Smart Contract (Scilla) IDE --- @@ -64,34 +63,6 @@ ext install as1ndu.scilla - Type info for variables (Hover over dotted lines to see they type information of a variable) - Configuration via Vscode's UI -## Vim - -A vim plugin for editing Scilla contracts is provided. - -You can install the vim config files through Pathogen by: - -``` -git clone https://github.com/edisonljh/vim-scilla.git ~/.vim/bundle/vim-scilla -``` - -Or through Vundle by adding the following line to your `~/.vimrc`: - -``` -Plugin 'edisonljh/vim-scilla' -``` - -If you are using [ALE](https://github.com/w0rp/ale), you can enable [scilla-checker](https://scilla.readthedocs.io/en/latest/scilla-checker.html) to show errors right inside vim. - -Here is how to enable it: - -1. Install [ALE](https://github.com/w0rp/ale) vim plugin -2. Make `scilla-checker` executable available (https://github.com/Zilliqa/scilla#compiling-and-running) -3. Set STDLIB dir in vimrc: `let g:ale_scilla_checker_libdir = '/stdlib'` -4. Set CHECKER in vimrc: ` let g:ale_scilla_checker_executable='/scilla-checker'` -5. Enable the linter in vimrc: `autocmd FileType scilla let b:ale_linters = ['checker']` -6. Open any scilla file and ensure checker is working: `:ALEInfo` - Repo: [vim-scilla](https://github.com/edisonljh/vim-scilla). - ## Emacs An emacs major mode for editing Scilla contracts is [provided](https://github.com/Zilliqa/scilla/blob/master/misc/emacs-mode/scilla-mode.el). diff --git a/docs/indexer/indexer-introduction.mdx b/docs/indexer/indexer-introduction.mdx new file mode 100644 index 00000000..50193d65 --- /dev/null +++ b/docs/indexer/indexer-introduction.mdx @@ -0,0 +1,26 @@ +--- +id: indexer-introduction +title: Getting Started +keywords: + - api + - introduction +description: Zindexer API +--- + +--- + +The Zilliqa Indexer API service is still under development and is subject to changes. + + +## GraphQL Playground +The GraphQL API playground is available at + +| Chain(s) | URL(s) | +| --------------------- | ------------------------------------------------| +| **Zilliqa Mainnet** | https://gam-indexer-api.rialto.studio/zilliqa/prod
*Note: This is a pre-production environment. Please report bugs at support@zilliqa.com.* | +| **Developer Testnet** | https://stg-indexer-api.rialto.studio/zilliqa | + +Schema can be downloaded from the above GraphQL playground. + +Please contact support@zilliqa.com to request for an API key. + diff --git a/docs/indexer/marketplace-brand-collectible-assets.mdx b/docs/indexer/marketplace-brand-collectible-assets.mdx new file mode 100644 index 00000000..5fac998a --- /dev/null +++ b/docs/indexer/marketplace-brand-collectible-assets.mdx @@ -0,0 +1,102 @@ +--- +id: brand-collectible-asset +title: Brand Collectible NFTs +keywords: + - marketplace + - brand collectible +description: Assets in a brand collectible +--- + + +--- + +Get list of all NFTs in a brand collectible. + + + +### Parameters + +| Name | Type | Required |Description +| ----------------- | ------- | -------- | ---------------------------------- +| `collectionId` | String | Required | Id of a brand collectible + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query BrandCollectibleNFTs($input: BrandCollectiblesNFTInput) { + brandCollectiblesNFTs(input: $input) { + cursor + brandCollectiblesNFTList { + collectionId + createdAt + collectionContract + } + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "collectionId": "11" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "brandCollectiblesNFTs": { + "cursor": "100", + "brandCollectiblesNFTList": [ + { + "collectionId": "11", + "createdAt": "2022-11-25T07:30:49.313217+00:00", + "collectionContract": "0x2878928cadf313ef27b35f985ef3e57b2aac7f4d" + } + ] + } + } +} +``` + diff --git a/docs/indexer/marketplace-brand-collectible-details.mdx b/docs/indexer/marketplace-brand-collectible-details.mdx new file mode 100644 index 00000000..3cb10f1f --- /dev/null +++ b/docs/indexer/marketplace-brand-collectible-details.mdx @@ -0,0 +1,101 @@ +--- +id: brand-collectible-details +title: Brand Collectible Details +keywords: + - marketplace + - brand collectible +description: Brand collectible details of an NFT +--- + + +--- + +Get brand collectible details of an NFT. + + + +### Parameters +| Name | Type | Required |Description +| ----------------- | ------- | -------- | ---------------------------------- +| `contractAddress` | String | Required | Address of the ZRC6-contract +| `tokenId` | String | Required | ID of the token to be queried + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query BrandsAssetById($input: AssetInput) { + getBrandCollectibleByAssetId(input: $input) { + collectionId + createdAt + collectionContract + tokenId + tokenAddress + status + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "contractAddress": "0x084acc6bbbaeb09a6e276a426508765e53bf2459", + "tokenId": "8" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "getBrandCollectibleByAssetId": { + "collectionId": "11", + "createdAt": "2022-11-25T07:30:49.088615+00:00", + "collectionContract": "0x2878928cadf313ef27b35f985ef3e57b2aac7f4d", + "tokenId": "8", + "tokenAddress": "0x084acc6bbbaeb09a6e276a426508765e53bf2459", + "status": "2" + } + } +} +``` + diff --git a/docs/indexer/marketplace-brand-collectible-list.mdx b/docs/indexer/marketplace-brand-collectible-list.mdx new file mode 100644 index 00000000..257bec85 --- /dev/null +++ b/docs/indexer/marketplace-brand-collectible-list.mdx @@ -0,0 +1,108 @@ +--- +id: brand-collectible-list +title: Brand Collectible List +keywords: + - marketplace + - brand collectible +description: Brand collectible list +--- + + +--- + +Get list of all collectibles owned by a brand. + + + +### Parameters + +| Name | Type | Required |Description +| ----------------- | ------- | -------- | ---------------------------------- +| `brandOwner` | String | Required | Address of the brand account + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query BrandCollectibles($input: BrandCollectiblesInput) { + brandCollectibles(input: $input) { + cursor + brandCollectiblesList { + collectionId + brandOwner + createdAt + collectionContract + commissionFee + } + } +} + + +``` + +#### Query Variables + +```graphql +{ + "input": { + "brandOwner": "0x22b251cc155ac0a181a156aaec74e964a82011c1" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "brandCollectibles": { + "cursor": "100", + "brandCollectiblesList": [ + { + "collectionId": "11", + "brandOwner": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "createdAt": "2022-11-15T15:21:48.241312+00:00", + "collectionContract": "0x2878928cadf313ef27b35f985ef3e57b2aac7f4d", + "commissionFee": "250" + } + ] + } + } +} +``` + diff --git a/docs/indexer/marketplace-english-auction.mdx b/docs/indexer/marketplace-english-auction.mdx new file mode 100644 index 00000000..0ab8227b --- /dev/null +++ b/docs/indexer/marketplace-english-auction.mdx @@ -0,0 +1,157 @@ +--- +id: english-auction +title: English Auction +keywords: + - marketplace + - english auction +description: English Auction marketplace listing +--- + + +--- + +Get auction offers for an asset. + + + +### Parameters + +| Name | Type | Required |Description +| ----------------- | ------- | -------- | ---------------------------------- +| `contractAddress` | String | Required | Address of the ZRC6-contract +| `tokenId` | String | Required | ID of the token to be queried + + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query Query($input: AssetInput){ + asset: assetById(input: $input) { + listingData { + sourceId + data { + ZILLIQA_ENGLISH_AUCTION { + startingBid { + unit + amount + currency + } + winnerBid { + maker + unit + amount + } + bids { + maker + unit + amount + dest + } + maker + marketplaceContractAddress + } + fulfilled { + __typename + ... on FulfilledZilliqaEnglishAuctionV1 { + id + marketplaceContractAddress + amount + buyer + currency + seller + unit + assetRecipient + paymentTokensRecipient + royaltyRecipient + } + } + } + } + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "contractAddress": "0x084acc6bbbaeb09a6e276a426508765e53bf2459", + "tokenId": "1" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "asset": { + "listingData": [ + { + "sourceId": "zilliqamarketplace", + "data": { + "ZILLIQA_ENGLISH_AUCTION": { + "startingBid": { + "unit": "QA", + "amount": 100000000000000, + "currency": "ZIL" + }, + "winnerBid": null, + "bids": [ + { + "maker": "0x7be89f308ea48148d4f3539afe2dddaa03b807ae", + "unit": "QA", + "amount": 200000000000000, + "dest": "0x7be89f308ea48148d4f3539afe2dddaa03b807ae" + } + ], + "maker": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "marketplaceContractAddress": "0x35694bf3eeb91274ec54651c035a027c616f3b77" + }, + "fulfilled": [] + } + } + ] + } + } +} +``` + diff --git a/docs/indexer/marketplace-fixed-price.mdx b/docs/indexer/marketplace-fixed-price.mdx new file mode 100644 index 00000000..45bd636f --- /dev/null +++ b/docs/indexer/marketplace-fixed-price.mdx @@ -0,0 +1,133 @@ +--- +id: fixed-price +title: Fixed Price +keywords: + - marketplace + - fixed price +description: Fixed price marketplace listing +--- + + +--- + +Get fixed price offers for an asset. + + + +### Parameters + +| Name | Type | Required |Description +| ----------------- | ------- | -------- | ---------------------------------- +| `contractAddress` | String | Required | Address of the ZRC6-contract +| `tokenId` | String | Required | ID of the token to be queried + + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query Query($input: AssetInput){ + asset: assetById(input: $input) { + listingData { + sourceId + data { + ZILLIQA_FIXED_PRICE { + othersOffers { + maker + unit + amount + currency + expirationInBlockNumber + } + ownerOffers { + maker + unit + amount + currency + expirationInBlockNumber + } + marketplaceContractAddress + } + } + } + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "contractAddress": "0xa7bfba9919112883b137ecbad5139f537dff944d", + "tokenId": "3" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "asset": { + "listingData": [ + { + "sourceId": "zilliqamarketplace", + "data": { + "ZILLIQA_FIXED_PRICE": { + "othersOffers": [], + "ownerOffers": [ + { + "maker": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "unit": "QA", + "amount": 100000000000000, + "currency": "ZIL", + "expirationInBlockNumber": "5037675" + } + ], + "marketplaceContractAddress": "0xf52f2c87d1a9b0e9f818618b78e2009baf222b2f" + } + } + } + ] + } + } +} +``` + diff --git a/docs/indexer/zil-all-transactions.mdx b/docs/indexer/zil-all-transactions.mdx new file mode 100644 index 00000000..e39a4c9b --- /dev/null +++ b/docs/indexer/zil-all-transactions.mdx @@ -0,0 +1,144 @@ +--- +id: zil-all-transactions +title: ZIL Transactions +keywords: + - zil + - transactions +description: All native zil transactions +--- + + +--- + +Get native ZIL transactions + + +### Parameters + +| Name | Type | Required | Description | +| --------- | ------- | -------- | ---------------------------------- +| `tokenAddress` | String | Required | Use zero address for native zil transactions +| `toAddress` | String | Optional | Recipient of zil. If set to empty string `""`, this parameter is ignored. | +| `fromAddress` | String | Optional | Address where zil is from. If set to empty string `""`, this parameter is ignored. | +| `filter` | JSON | Optional | Filter is used for pagination, `after` is the offset and `limit` is the size of the list. | + +##### Notes + +- To get all native zil transactions + - Set `tokenAddress` to zero address + - Set both `toAddress` and `fromAddress` as empty +- To get all token transactions sent to a particular wallet + - set `tokenAddress` to zero address + - set `toAddress` to the desired wallet address + - set `fromAddress` as empty + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query TxDetails($input: TransactionDetailsInput) { + getTransactionDetails(input: $input) { + list { + blockID + TxId + toAddress + fromAddress + tokenAddress + amount + gasAmount + gasPrice + } + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "tokenAddress": "0x0000000000000000000000000000000000000000", + "filter": { + "limit":5 + } + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "getTransactionDetails": { + "list": [ + { + "blockID": "913150", + "TxId": "0x774b90ec3590d888a9b71f49bb067ada517942243f2171d0d95c7d705111fdd7", + "toAddress": "0x72fcaf6815a5b9c29f0457651c501da25560b0c0", + "fromAddress": "0x31b844db1fb3c97d5a2597730cca7eb8d5281a6c", + "tokenAddress": "0x0000000000000000000000000000000000000000", + "amount": "61758659441516", + "gasAmount": "1", + "gasPrice": "2000000000" + }, + { + "blockID": "913378", + "TxId": "0x2a7e91328420416869c42a67c057402565e1b9c33ab3643408789a6784cad8f1", + "toAddress": "0x873201b7eaddd65f32174a56fa7309fdc2eae411", + "fromAddress": "0x6e31e6ecede40299058a4a8444956c59159ba55a", + "tokenAddress": "0x0000000000000000000000000000000000000000", + "amount": "11067072104794", + "gasAmount": "1", + "gasPrice": "2000000000" + }, + { + "blockID": "913230", + "TxId": "0x4a130c1191c47f3c3aad4b89483352f1ae06207536127200540a0482dec6ef74", + "toAddress": "0x72fcaf6815a5b9c29f0457651c501da25560b0c0", + "fromAddress": "0xb9d6f37426a3dc48b1b7bc834df9efa2b168a187", + "tokenAddress": "0x0000000000000000000000000000000000000000", + "amount": "73653231337520", + "gasAmount": "1", + "gasPrice": "2000000000" + } + ] + } + } +} +``` + diff --git a/docs/indexer/zil-balance.mdx b/docs/indexer/zil-balance.mdx new file mode 100644 index 00000000..7c330ecf --- /dev/null +++ b/docs/indexer/zil-balance.mdx @@ -0,0 +1,100 @@ +--- +id: zil-balance +title: ZIL Balance +keywords: + - zil + - wallet + - balance +description: Native ZIL balance of a given wallet +--- + + +--- + +Get the ZIL balance oof a wallet. + + + +### Parameters + +| Name | Type | Required | Description | +| --------- | ------- | -------- | ---------------------------------- +| `wallet` | String | Required | Wallet address holding the token +| `token` | String | Required | Use zero address for native ZIL + + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query UserBalance($input: WalletBalanceInput) { + getUserBalanceByToken(input: $input) { + tokenAddress + walletAddress + lastBlockID + amount + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "wallet": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "token": "0x0000000000000000000000000000000000000000" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "getUserBalanceByToken": { + "tokenAddress": "0x0000000000000000000000000000000000000000", + "walletAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "lastBlockID": "2513226", + "amount": "2226027441580000" + } + } +} +``` + diff --git a/docs/indexer/zrc2-all-balances.mdx b/docs/indexer/zrc2-all-balances.mdx new file mode 100644 index 00000000..1502e663 --- /dev/null +++ b/docs/indexer/zrc2-all-balances.mdx @@ -0,0 +1,115 @@ +--- +id: zrc2-all-balances +title: User Balances +keywords: + - zrc2 + - wallet + - balances +description: All ZRC2 tokens for a given wallet +--- + + +--- + +Get all available ZR2 token balances for a given wallet. + + +### Parameters + +| Name | Type | Required | Description | +| --------- | ------- | -------- | ---------------------------------- +| `wallet` | String | Required | Wallet address to be queried + + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query UserBalances($input: WalletBalancesInput) { + getUserBalances(input: $input) { + list { + lastBlockID + amount + tokenAddress + walletAddress + } + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "wallet": "0x22b251cc155ac0a181a156aaec74e964a82011c1" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "getUserBalances": { + "list": [ + { + "lastBlockID": "4738797", + "amount": "30000000000", + "tokenAddress": "0xc5c5f8786574522e83242e5981482d63c9ac7101", + "walletAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1" + }, + { + "lastBlockID": "4738797", + "amount": "30000000000", + "tokenAddress": "0x94677f06ad3046bd7c793fcb179ca79c822e6dd5", + "walletAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1" + }, + { + "lastBlockID": "4734719", + "amount": "100000000000000", + "tokenAddress": "0x98a71b463a33bbff650d123bf04f1f32d1c8b508", + "walletAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1" + } + ] + } + } +} +``` + diff --git a/docs/indexer/zrc2-balance.mdx b/docs/indexer/zrc2-balance.mdx new file mode 100644 index 00000000..8db80d3a --- /dev/null +++ b/docs/indexer/zrc2-balance.mdx @@ -0,0 +1,100 @@ +--- +id: zrc2-balance +title: User Balance +keywords: + - zrc2 + - wallet + - balance +description: Balance for a given wallet +--- + + +--- + +Get the balance of a specific ZRC2 token for a given wallet. + + + +### Parameters + +| Name | Type | Required | Description | +| --------- | ------- | -------- | ---------------------------------- +| `wallet` | String | Required | Wallet address holding the token +| `token` | String | Required | Contract address of the ZRC2 token + + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query UserBalance($input: WalletBalanceInput) { + getUserBalanceByToken(input: $input) { + tokenAddress + walletAddress + lastBlockID + amount + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "wallet": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "token": "0x98a71b463a33bbff650d123bf04f1f32d1c8b508" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "getUserBalanceByToken": { + "tokenAddress": "0x98a71b463a33bbff650d123bf04f1f32d1c8b508", + "walletAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "lastBlockID": "4734719", + "amount": "100000000000000" + } + } +} +``` + diff --git a/docs/indexer/zrc2-contract-details.mdx b/docs/indexer/zrc2-contract-details.mdx new file mode 100644 index 00000000..195377db --- /dev/null +++ b/docs/indexer/zrc2-contract-details.mdx @@ -0,0 +1,102 @@ +--- +id: zrc2-contract-details +title: Token Detail +keywords: + - indexer + - zrc2 contract +description: Get ZRC2 contract details +--- + +--- + +Retrieve the details of a given ZRC-2 contract. + +### Parameters + +| Name | Type | Required | Description | +| -------- | ------ | -------- | ------------------------------------------------------------------------- | +| `token` | String | Required | The smart contract address of the token (leave empty when using `symbol`) | +| `symbol` | String | Required | The symbol of the token (leave empty when using `token`) | + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + +```graphql +query TokenDetail($input: TokenDetailInput) { + getTokenDetail(input: $input) { + contractAddress + tokenName + tokenSymbol + init_supply + totalSupply + standard + decimals + ownerAddress + type + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "token": "0x98a71b463a33bbff650d123bf04f1f32d1c8b508", + "symbol": "" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + +```curl + +``` + + + + +### Example Response + +```json +{ + "data": { + "getTokenDetail": { + "contractAddress": "0x98a71b463a33bbff650d123bf04f1f32d1c8b508", + "tokenName": "Wrapped ZIL Token", + "tokenSymbol": "wZIL", + "init_supply": "0", + "totalSupply": "41166677135704200", + "standard": "ZRC2", + "decimals": "12", + "ownerAddress": "0x7E30D1c942282784630EBfedba1FFbDE3647f472", + "type": "ASSET_CONTRACT" + } + } +} +``` diff --git a/docs/indexer/zrc2-contract-list.mdx b/docs/indexer/zrc2-contract-list.mdx new file mode 100644 index 00000000..035ab9ca --- /dev/null +++ b/docs/indexer/zrc2-contract-list.mdx @@ -0,0 +1,122 @@ +--- +id: zrc2-contract-list +title: Token List +keywords: + - indexer + - zrc2 contract +description: Get ZRC2 contract List +--- + +--- + +Get a list of of ZRC-2 contracts. + +### Parameters + +| Name | Type | Required | Description | +| -------- | ------ | -------- | ------------------------------------------------------------------------- | +| `filter` | JSON | Optional | Filter is used for pagination, `after` is the offset and `limit` is the size of the list. | + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + +```graphql +query TokensList($input: TokenDetailsInput) { + getTokenDetails(input: $input) { + cursor + list { + contractAddress + tokenName + tokenSymbol + init_supply + totalSupply + standard + decimals + ownerAddress + type + } + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "filter": { + "after": "1", + "limit": 5 + } + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + +```curl + +``` + + + + +### Example Response + +```json +{ + "data": { + "getTokenDetails": { + "cursor": "6", + "list": [ + { + "contractAddress": "0xd130598a0c19f07e411de9571b249e163ca650d8", + "tokenName": "ABCtoken", + "tokenSymbol": "ABC", + "init_supply": null, + "totalSupply": "10000000", + "standard": "ZRC2", + "decimals": "0", + "ownerAddress": "0x1fA770d35ac575Cff808540E084C2907d71Ef763", + "type": "ASSET_CONTRACT" + }, + { + "contractAddress": "0x17c81253b9de207c98381c0ca3c84f2d151928c7", + "tokenName": "XCAD Network Test Token", + "tokenSymbol": "XCAD", + "init_supply": null, + "totalSupply": "2000000000000", + "standard": "ZRC2", + "decimals": "6", + "ownerAddress": "0xa3f8c8bE2e3AD62c6fe7729Ef0aC402d3da8F9D9", + "type": "ASSET_CONTRACT" + } + ] + } + } +} +``` diff --git a/docs/indexer/zrc2-transaction-history.mdx b/docs/indexer/zrc2-transaction-history.mdx new file mode 100644 index 00000000..d85af29d --- /dev/null +++ b/docs/indexer/zrc2-transaction-history.mdx @@ -0,0 +1,138 @@ +--- +id: zrc2-transaction-history +title: Transaction History +keywords: + - indexer + - zrc2 contract + - transaction history +description: Get ZRC2 transaction history +--- + +--- + +Retrieve the details of transactions based on the given parameters. + +### Parameters + +| Name | Type | Required | Description | +| -------------- | ------ | -------- | ---------------------------------------------------------------------------------- | +| `tokenAddress` | String | Required | Contract address of the ZRC2 token | +| `sender` | String | Optional | Sender of the transaction. If set to empty string `""`, this parameter is ignored. | +| `toAddress` | String | Optional | Recipient of the token. If set to empty string `""`, this parameter is ignored. | +| `fromAddress` | String | Optional | From Address of the token. If set to empty string `""`, this parameter is ignored. | +| `filter` | JSON | Optional | Filter is used for pagination, `after` is the offset and `limit` is the size of the list. | + +##### Notes + +- To get all transactions for a given token + - Set `tokenAddress` to the ZRC2 contract address + - Set both `sender` and `toAddress` as empty +- To get all token transactions sent to a particular wallet + - set `tokenAddress` to the ZRC2 contract address + - set `sender` as empty + - set `toAddress` to the desired wallet address + - set `fromAddress` to the desired tx initiator + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + +```graphql +query TxDetails($input: TransactionDetailsInput) { + getTransactionDetails(input: $input) { + list { + blockID + TxId + sender + toAddress + fromAddress + isTransferFrom + tokenAddress + amount + } + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "tokenAddress": "0xc5c5f8786574522e83242e5981482d63c9ac7101", + "sender": "0x86f0875da311ee5332d5d4a8485c8d3db0f7f57b", + "toAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "fromAddress": "", + "filter": { + "limit": 15, + "after": "2" + } + } +} + +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + +```curl + +``` + + + + +### Example Response + +```json +{ + "data": { + "getTransactionDetails": { + "list": [ + { + "blockID": "4738791", + "TxId": "450c0936f9fee544ae646da30c6321e0d00dbeb3ebdb72662a99550b39a9e0f9", + "sender": "0x86f0875da311ee5332d5d4a8485c8d3db0f7f57b", + "toAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "fromAddress": null, + "isTransferFrom": false, + "tokenAddress": "0xc5c5f8786574522e83242e5981482d63c9ac7101", + "amount": "10000000000" + }, + { + "blockID": "4738797", + "TxId": "d14d02e620f9c0e0d8d9f8109237689c8da5ec8b8694df3e45fcdc8c1af85e95", + "sender": "0x86f0875da311ee5332d5d4a8485c8d3db0f7f57b", + "toAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "fromAddress": null, + "isTransferFrom": false, + "tokenAddress": "0xc5c5f8786574522e83242e5981482d63c9ac7101", + "amount": "10000000000" + } + ] + } + } +} +``` diff --git a/docs/indexer/zrc6-asset-details.mdx b/docs/indexer/zrc6-asset-details.mdx new file mode 100644 index 00000000..c80447e5 --- /dev/null +++ b/docs/indexer/zrc6-asset-details.mdx @@ -0,0 +1,102 @@ +--- +id: zrc6-asset-details +title: NFT Details +keywords: + - zrc6 + - asset +description: Get details of an nft +--- + + +--- + +Get the details of a particular NFT or asset + + +### Parameters + + +| Name | Type | Required |Description +| ----------------- | ------- | -------- | ---------------------------------- +| `contractAddress` | String | Required | Address of the ZRC6-contract +| `tokenId` | String | Required | ID of the token to be queried + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query Query($input: AssetInput) { + assetById(input: $input) { + contractAddress + tokenId + tokenUri + ownerAddress + spenderAddress + operatorAddress + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "contractAddress": "0xe9f34009d95b5c818fc6a81ca90a150f7564cdb8", + "tokenId": "1" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "assetById": { + "contractAddress": "0xe9f34009d95b5c818fc6a81ca90a150f7564cdb8", + "tokenId": "1", + "tokenUri": "https://bafkreiatphadr5dqqipxxcgb44faev3jqhbleebjzna6nxxlg53dmyqg3q.ipfs.nftstorage.link", + "ownerAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "spenderAddress": "0x20e3223bd23752403f32f2beb8d323119f3fd93a", + "operatorAddress": [] + } + } +} +``` + diff --git a/docs/indexer/zrc6-asset-metadata.mdx b/docs/indexer/zrc6-asset-metadata.mdx new file mode 100644 index 00000000..3ba3e847 --- /dev/null +++ b/docs/indexer/zrc6-asset-metadata.mdx @@ -0,0 +1,126 @@ +--- +id: zrc6-asset-metadata +title: Asset Metadata +keywords: + - zrc6 + - asset +description: Get the metadata of an asset +--- + + +--- +Get the metadata of an NFT or asset. This is the data stored in the `tokenURI`. + + +### Parameters + +| Name | Type | Required |Description +| ----------------- | ------- | -------- | ---------------------------------- +| `contractAddress` | String | Required | Address of the ZRC6-contract +| `tokenId` | String | Required | ID of the token to be queried + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query Query($input: AssetInput) { + asset1: assetById(input: $input) { + tokenId + tokenUri + name + description + externalUrl + ownerAddress + minterAddress + contractAddress + resource + resourceMimetype + attributes { + traitType + value + } + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "contractAddress": "0x084acc6bbbaeb09a6e276a426508765e53bf2459", + "tokenId": "1" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "asset1": { + "tokenId": "1", + "tokenUri": "https://cloudflare-ipfs.com/ipfs/bafyreifrcqnf7gxcedfzvfipjoe4l5cxxcksg6ynul3zluzulq57ylxmee/metadata.json", + "name": "Sea Lion", + "description": "Sea Lion", + "externalUrl": "https://nxotictzevvcsggsljca.supabase.co/storage/v1/object/public/assets/public/sealion.png-S66YmORf2OMDWj3IhXzIz", + "ownerAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "minterAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "contractAddress": "0x084acc6bbbaeb09a6e276a426508765e53bf2459", + "resource": "ipfs://bafybeidsvulplsgbv322vws53mhbrvbe5gdzgz6gdmbs73chpzo4www5ae/blob", + "resourceMimetype": "image/png", + "attributes": [ + { + "traitType": "animal", + "value": "sea lion" + }, + { + "traitType": "Physical Object Available", + "value": "true" + }, + { + "traitType": "Physical Item Id", + "value": "SZ12345" + } + ] + } + } +} + +``` + diff --git a/docs/indexer/zrc6-recently-minted.mdx b/docs/indexer/zrc6-recently-minted.mdx new file mode 100644 index 00000000..aac60942 --- /dev/null +++ b/docs/indexer/zrc6-recently-minted.mdx @@ -0,0 +1,124 @@ +--- +id: zrc6-recently-minted +title: Recently Minted NFTs +keywords: + - zrc6 +description: Recently minted NFTs +--- + + +--- + +Get the details of recently minted NFTs. + + +### Parameters + +None + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query Query { + assets { + cursor + assetsList { + contractAddress + tokenId + tokenUri + ownerAddress + spenderAddress + operatorAddress + } + } +} +``` + +#### Query Variables + +```graphql + +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "assets": { + "cursor": "100", + "assetsList": [ + { + "contractAddress": "0x4a8666cfbc819aa25a90e4fa9e25a88a4ea10979", + "tokenId": "477", + "tokenUri": "QmbNrf7UmUE4D4B9TVESTZ7Atq2BbKkvDAiEL5TaqzVxrQ", + "ownerAddress": "0xe2a0962bf516dfa72dca8602ce41c93ec686c668", + "spenderAddress": null, + "operatorAddress": [] + }, + { + "contractAddress": "0x4a8666cfbc819aa25a90e4fa9e25a88a4ea10979", + "tokenId": "476", + "tokenUri": "QmUogHQynSN4SzAPoXaV7xj2zLnkdoFYvKiAwa5ZKn2XkG", + "ownerAddress": "0xe2a0962bf516dfa72dca8602ce41c93ec686c668", + "spenderAddress": null, + "operatorAddress": [] + }, + { + "contractAddress": "0x4a8666cfbc819aa25a90e4fa9e25a88a4ea10979", + "tokenId": "475", + "tokenUri": "QmYNYpwFjvWQEmioBHN6v5xXrbP179qhvRSRMfb3RknmHt", + "ownerAddress": "0xe2a0962bf516dfa72dca8602ce41c93ec686c668", + "spenderAddress": null, + "operatorAddress": [] + }, + ... + { + "contractAddress": "0x4a8666cfbc819aa25a90e4fa9e25a88a4ea10979", + "tokenId": "378", + "tokenUri": "QmX6tErvsmoxy6iofSFfR7jFudHpxE7eAPqE4KvYDeqpZU", + "ownerAddress": "0xe2a0962bf516dfa72dca8602ce41c93ec686c668", + "spenderAddress": null, + "operatorAddress": [] + } + ] + } + } +} +``` + diff --git a/docs/indexer/zrc6-search-attribute.mdx b/docs/indexer/zrc6-search-attribute.mdx new file mode 100644 index 00000000..cc9cb703 --- /dev/null +++ b/docs/indexer/zrc6-search-attribute.mdx @@ -0,0 +1,146 @@ +--- +id: zrc6-search-attribute +title: Search NFT Attribute +keywords: + - zrc6 + - attribute +description: Find all NFTS with a given attribute +--- + + +--- +Find all NFTS with a given attribute. +This applies to NFTS which follow the ZRC-7 metadata standard + +### Parameters + + + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query getAssets($input: AssetsInput!) { + assets(input: $input) { + cursor + assetsList { + contractAddress + tokenId + tokenUri + minterAddress + ownerAddress + spenderAddress + operatorAddress + name + description + resource + resourceMimetype + externalUrl + externalDescription + attributes { + traitType + value + } + contractPaused + contractPaused + } + } +} +``` + +#### Query Variables + +```graphql +{ + "input": { + "filter": { + "after": "0", + "limit": 12, + "keyword": "", + "attributes": [{ "type": "Metaverse Id", "value": "metaverse1" }] + } + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "assets": { + "cursor": "12", + "assetsList": [ + { + "contractAddress": "0x4aba00e6039b4f9626b66098c4b499cc76c04536", + "tokenId": "4", + "tokenUri": "https://cloudflare-ipfs.com/ipfs/bafyreieor4llmsxqi4roph24fmunghjbtmegngsqqxk3py3owosmgwq4dq/metadata.json", + "minterAddress": "0xa8c22025ede0654d341942d07aedff54d2e52091", + "ownerAddress": "0x35694bf3eeb91274ec54651c035a027c616f3b77", + "spenderAddress": "0x35694bf3eeb91274ec54651c035a027c616f3b77", + "operatorAddress": [], + "name": "Leafy1", + "description": "calm like a leaf", + "resource": "ipfs://bafybeieasrloyldcwpbfnoxuoco3n5unncke67hot27pd5kreg37ftaca4/blob", + "resourceMimetype": "image/jpeg", + "externalUrl": "https://nxotictzevvcsggsljca.supabase.co/storage/v1/object/public/assets/public/peaceful.jpg-16z2sqxptk0kdSXr1FCE3", + "externalDescription": null, + "attributes": [ + { + "traitType": "Physical Object Available", + "value": "true" + }, + { + "traitType": "Physical Item Id", + "value": "leafy234" + }, + { + "traitType": "Metaverse Enabled", + "value": "true" + }, + { + "traitType": "Metaverse Id", + "value": "metaverse1" + } + ], + "contractPaused": false + } + ] + } + } +} +``` diff --git a/docs/indexer/zrc6-user-assets.mdx b/docs/indexer/zrc6-user-assets.mdx new file mode 100644 index 00000000..e332a802 --- /dev/null +++ b/docs/indexer/zrc6-user-assets.mdx @@ -0,0 +1,148 @@ +--- +id: zrc6-user-assets +title: User NFTs +keywords: + - zrc6 + - asset +description: Get all the NFTs of owned by a user +--- + + +--- +Get all the NFTs owned by a wallet address + +### Parameters + + +| Name | Type | Required |Description +| ----------------- | ------- | -------- | ---------------------------------- +| `address` | String | Required | Wallet address of the user + +### Example Request + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +#### Query + + +```graphql +query Query($userInput: UserInput) { + user(input: $userInput) { + address + ownedAssets { + assetsList { + contractAddress + tokenId + tokenUri + name + resource + minterAddress + spenderAddress + operatorAddress + } + } + mintedAssets { + assetsList { + contractAddress + tokenId + tokenUri + name + resource + description + ownerAddress + spenderAddress + operatorAddress + } + } + } +} +``` + +#### Query Variables + +```graphql +{ + "userInput": { + "address": "0x22b251cc155ac0a181a156aaec74e964a82011c1" + } +} +``` + +#### HTTP Headers + +```graphql +{ + "Authorization": "Bearer " +} +``` + + + + + + +```curl +``` + + + + +### Example Response + +```json +{ + "data": { + "user": { + "address": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "ownedAssets": { + "assetsList": [ + { + "contractAddress": "0x084acc6bbbaeb09a6e276a426508765e53bf2459", + "tokenId": "6", + "tokenUri": "https://cloudflare-ipfs.com/ipfs/bafyreiavttz6nnv6glnp6zwvdq3d7okcujy7zfkejax6nl72nzufel6usu/metadata.json", + "name": "Metaverse Lion", + "resource": "ipfs://bafybeidgcul36ba5pow45ddn3nyq6f5a77ymzlpibe7bvbfoez5m6itl4i/blob", + "minterAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "spenderAddress": null, + "operatorAddress": [] + }, + { + "contractAddress": "0x1fe88b9cf6107272c14c0f9471506eb33b58002d", + "tokenId": "1", + "tokenUri": "https://cloudflare-ipfs.com/ipfs/bafyreibe6pqjwgercgpc6xfei3sr36sknppjy7qv6ccrxijize3sqnbzme/metadata.json", + "name": "Blackhole", + "resource": "ipfs://bafybeif4eot5qj7czadhisn4f42folzdro6e72igd5wtbjzhfr2s44vlk4/blob", + "minterAddress": "0x22b251cc155ac0a181a156aaec74e964a82011c1", + "spenderAddress": "0x76de76c8ab407ef10e2da2f7ebd51fc6638c9d59", + "operatorAddress": [] + }, + ... + { + "contractAddress": "0x084acc6bbbaeb09a6e276a426508765e53bf2459", + "tokenId": "2", + "tokenUri": "https://cloudflare-ipfs.com/ipfs/bafyreibzeqitc6vtek5ywlaycagcvdgou6yf3ofbxv3id67i7dgkfrxste/metadata.json", + "name": "Asian Elephant", + "resource": "ipfs://bafybeifyffen2nkhjiyq4be3wkxlexobc43fnsff57opxuxg7s7fc57zlm/blob", + "description": "asian elephant", + "ownerAddress": "0x21abfbf9b66061a11183d933a9634754c3341752", + "spenderAddress": "0x21abfbf9b66061a11183d933a9634754c3341752", + "operatorAddress": [] + } + ] + } + } + } +} + +``` diff --git a/docusaurus.config.js b/docusaurus.config.js index 64d89d68..9d9f2698 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,8 +1,11 @@ module.exports = { title: 'Zilliqa Developer Portal', tagline: 'Technical documentation for participating in the Zilliqa network.', - url: 'https://dev.zilliqa.com', - baseUrl: (!process.env.BASE_URL || process.env.BASE_URL == "") ? '/' : process.env.BASE_URL, + url: 'https://stg-dev.zilliqa.com', + baseUrl: + !process.env.BASE_URL || process.env.BASE_URL == '' + ? '/' + : process.env.BASE_URL, favicon: 'img/favicon.png', organizationName: 'zilliqa', // Usually your GitHub org/user name. projectName: 'dev-portal', // Usually your repo name. @@ -54,6 +57,12 @@ module.exports = { label: 'Staking', position: 'right', }, + { + to: 'docs/indexer/indexer-introduction', + activeBasePath: 'docs/indexer', + label: 'Indexer (Experimental)', + position: 'right', + }, { to: 'docs/contributors/contribute-buildzil', activeBasePath: 'docs/contributors', @@ -75,7 +84,6 @@ module.exports = { label: 'Telegram', href: 'https://t.me/ZilliqaDevs', }, - ], }, { @@ -119,8 +127,7 @@ module.exports = { docs: { sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. - editUrl: - 'https://github.com/Zilliqa/dev-portal/tree/master/', + editUrl: 'https://github.com/Zilliqa/dev-portal/tree/master/', }, theme: { customCss: require.resolve('./src/css/custom.css'), diff --git a/sidebars.js b/sidebars.js index 7f784bc4..77f645d6 100644 --- a/sidebars.js +++ b/sidebars.js @@ -138,6 +138,34 @@ module.exports = { "staking/phase1/staking-error-codes", ], }, + IndexerSidebar: { + "Introduction": [ "indexer/indexer-introduction"], + "Zils" : [ + "indexer/zil-all-transactions", + "indexer/zil-balance" + ], + "ZRC-2" : [ + "indexer/zrc2-contract-details", + "indexer/zrc2-contract-list", + "indexer/zrc2-balance", + "indexer/zrc2-all-balances", + "indexer/zrc2-transaction-history" + ], + "ZRC-6" : [ + "indexer/zrc6-recently-minted", + "indexer/zrc6-asset-details", + "indexer/zrc6-user-assets", + "indexer/zrc6-asset-metadata", + "indexer/zrc6-search-attribute" + ], + "Marketplace" : [ + "indexer/fixed-price", + "indexer/english-auction", + "indexer/brand-collectible-list", + "indexer/brand-collectible-asset", + "indexer/brand-collectible-details" + ] + }, ContributorsSidebar: { "Contributors": ["contributors/contribute-buildzil", "contributors/contribute-guidelines", "contributors/contribute-standards", "contributors/contribute-bug-bounty"], diff --git a/src/theme/SiteMetadata/index.js b/src/theme/SiteMetadata/index.js new file mode 100644 index 00000000..50b39030 --- /dev/null +++ b/src/theme/SiteMetadata/index.js @@ -0,0 +1,110 @@ +import React from 'react'; +import Head from '@docusaurus/Head'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import useBaseUrl from '@docusaurus/useBaseUrl'; +import { PageMetadata, useThemeConfig } from '@docusaurus/theme-common'; +import { + DEFAULT_SEARCH_TAG, + useAlternatePageUtils, + keyboardFocusedClassName, +} from '@docusaurus/theme-common/internal'; +import { useLocation } from '@docusaurus/router'; +import SearchMetadata from '@theme/SearchMetadata'; +// TODO move to SiteMetadataDefaults or theme-common ? +// Useful for i18n/SEO +// See https://developers.google.com/search/docs/advanced/crawling/localized-versions +// See https://github.com/facebook/docusaurus/issues/3317 +function AlternateLangHeaders() { + const { + i18n: { defaultLocale, localeConfigs }, + } = useDocusaurusContext(); + const alternatePageUtils = useAlternatePageUtils(); + // Note: it is fine to use both "x-default" and "en" to target the same url + // See https://www.searchviu.com/en/multiple-hreflang-tags-one-url/ + return ( + + {Object.entries(localeConfigs).map(([locale, { htmlLang }]) => ( + + ))} + + + ); +} +// Default canonical url inferred from current page location pathname +function useDefaultCanonicalUrl() { + const { + siteConfig: { url: siteUrl }, + } = useDocusaurusContext(); + const { pathname } = useLocation(); + return siteUrl + useBaseUrl(pathname); +} +// TODO move to SiteMetadataDefaults or theme-common ? +function CanonicalUrlHeaders({ permalink }) { + const { + siteConfig: { url: siteUrl }, + } = useDocusaurusContext(); + const defaultCanonicalUrl = useDefaultCanonicalUrl(); + const canonicalUrl = permalink + ? `${siteUrl}${permalink}` + : defaultCanonicalUrl; + return ( + + + {/* */} + + ); +} +export default function SiteMetadata() { + const { + i18n: { currentLocale }, + } = useDocusaurusContext(); + // TODO maybe move these 2 themeConfig to siteConfig? + // These seems useful for other themes as well + const { metadata, image: defaultImage } = useThemeConfig(); + return ( + <> + + + {/* The keyboard focus class name need to be applied when SSR so links + are outlined when JS is disabled */} + + + + {defaultImage && } + + + + {/* */} + + + + {/* + It's important to have an additional element here, as it allows + react-helmet to override default metadata values set in previous + like "twitter:card". In same Head, the same meta would appear twice + instead of overriding. + */} + + {/* Yes, "metadatum" is the grammatically correct term */} + {metadata.map((metadatum, i) => ( + + ))} + + + ); +} diff --git a/yarn.lock b/yarn.lock index 4865b568..d456989b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2733,6 +2733,11 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001370: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001393.tgz#1aa161e24fe6af2e2ccda000fc2b94be0b0db356" integrity sha512-N/od11RX+Gsk+1qY/jbPa0R6zJupEa0lxeBG598EbrtblxVCTJsQwbRBm6+V+rxpc5lHKdsXb9RY83cZIPLseA== +caniuse-lite@^1.0.30001373: + version "1.0.30001412" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001412.tgz#30f67d55a865da43e0aeec003f073ea8764d5d7c" + integrity sha512-+TeEIee1gS5bYOiuf+PS/kp2mrXic37Hl66VY6EAfxasIk5fELTktK2oOezYed12H8w7jt3s512PpulQidPjwA== + ccount@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" @@ -3889,6 +3894,11 @@ forwarded@0.2.0: resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== +fraction.js@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950" + integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA== + fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" @@ -4430,11 +4440,6 @@ inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, i resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA== - inherits@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -5227,6 +5232,11 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== + normalize-url@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" @@ -7270,13 +7280,6 @@ util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ== - dependencies: - inherits "2.0.1" - utila@~0.4: version "0.4.0" resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c"