diff --git a/docs/2.build/6.data-infrastructure/data-api.md b/docs/2.build/6.data-infrastructure/data-api.md index f8e00a814de..a26250285b5 100644 --- a/docs/2.build/6.data-infrastructure/data-api.md +++ b/docs/2.build/6.data-infrastructure/data-api.md @@ -122,6 +122,6 @@ curl https://api.fastnear.com/v1/account/root.near/full :::info More info -Find more information about the FastNear API in their [services page](https://fastnear.com/services) +Find more information about the FastNear API on their [documentation page](https://docs.fastnear.com/) -::: \ No newline at end of file +::: diff --git a/docs/4.tools/ecosystem-apis/fastnear-api.md b/docs/4.tools/ecosystem-apis/fastnear-api.md index c382d13a34e..9f9e03bb7f1 100644 --- a/docs/4.tools/ecosystem-apis/fastnear-api.md +++ b/docs/4.tools/ecosystem-apis/fastnear-api.md @@ -3,7 +3,7 @@ id: fastnear title: FastNEAR --- -[FastNEAR](https://fastnear.com/services) allows to easily query the NEAR blockchain to get an account's assets, map keys into account IDs, explore a block's transactions, etc. +[FastNEAR](https://fastnear.com/) allows to easily query the NEAR blockchain to get an account's assets, map keys into account IDs, explore a block's transactions, etc. Possible use cases include: - Querying all assets of an account (including fungible and non-fungible tokens) diff --git a/docs/5.api/rpc/providers.md b/docs/5.api/rpc/providers.md index 4b00449033e..e0cc1707879 100644 --- a/docs/5.api/rpc/providers.md +++ b/docs/5.api/rpc/providers.md @@ -19,7 +19,7 @@ If you want to use a custom RPC provider with NEAR Wallet Selector, [check this | -------------------------------------------------------------------------- | ------------------------------------------------------------ | | [NEAR.org (deprecated)](setup.md) | `https://rpc.mainnet.near.org` | | [1RPC](https://docs.1rpc.io/overview/about-1rpc) | `https://1rpc.io/near` | -| [All That Node](https://docs.allthatnode.com/protocols/near/) | `https://near-mainnet-rpc.allthatnode.com:3030` | +| [All That Node](https://www.allthatnode.com/protocol/near.dsrv) | `https://near-mainnet-rpc.allthatnode.com:3030` | | [ankr.com](https://www.ankr.com/docs/rpc-service/chains/chains-list/#near) | `https://rpc.ankr.com/near` | | [BlockPI Network](https://blockpi.io) | `https://near.blockpi.network/v1/rpc/public` | | [dRPC](https://drpc.org/) | `https://near.drpc.org` | diff --git a/docs/pagoda/alerts/intro.md b/docs/pagoda/alerts/intro.md deleted file mode 100644 index fbffa526853..00000000000 --- a/docs/pagoda/alerts/intro.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -sidebar_position: 1 -sidebar_label: "Introduction" ---- - -# Pagoda Alerts & Triggers - -:::warning - -Please be advised that these tools and services will be discontinued and stop serving traffic on December 9th, 2024. - -::: - -## What are Alerts & Triggers? - -Pagoda Alerts & Triggers are designed to notify, and automated responses to important events that occur on the NEAR blockchain. Behind the scenes, Alerts are powered by many mini-indexers, “Alertexers”, that stream blockchain data in real-time, enabling developers to know what’s happening to their dApp before their users do. - -Alerts are broken into three parts: -1. The NEAR address the alert should listen to (account or contract) -2. The event condition (success & failed actions, account drains, and more) -3. The alert destination ([e-mail](setup.md#setting-up-e-mail-alerts), [Telegram](setup.md#setting-up-telegram-alerts), [webhooks](webhooks.md)) - -Alerts can be set-up to listen for the following five conditions: -1. Successful Actions -2. Failed Actions -3. [Event Logged](https://nomicon.io/Standards/EventsFormat) -4. Function Called -5. Account Balance Change - -## Setup - -- [E-mail alerts](setup.md#setting-up-e-mail-alerts) -- [Telegram alerts](setup.md#setting-up-telegram-alerts) -- [Event Log Alerts](setup.md#setting-up-event-log-alerts) -- [Function Call Specific Alerts](setup.md#setting-up-function-call-specific-alerts) - -## Using Webhooks with Alerts & Triggers - -See an example on how to [set up alerts using webhooks](webhooks.md). diff --git a/docs/pagoda/alerts/setup.md b/docs/pagoda/alerts/setup.md deleted file mode 100644 index 83ed926be7d..00000000000 --- a/docs/pagoda/alerts/setup.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -sidebar_position: 1 -sidebar_label: "Setup" ---- - -# Setup Alerts & Triggers - -:::warning - -Please be advised that these tools and services will be discontinued soon. - -::: - -## Setting up E-mail alerts - -1. Navigate to [console.pagoda.co](https://console.pagoda.co) and log-in - -2. Navigate to the Alerts tab - - - -3. Select a target address for the alert to listen to - - -4. Select one of the following conditions to listen for - - -5. Select email as the destination to send alerts to and enter an email address to send the alert to - - -6. This email address will need to be verified before it can be used as a valid alert destination. - - -7. Be sure that the email destination is toggled on as shown below and click "Create Alert" to finish setting up your email alert - - -## Setting up Telegram alerts - -Follow the steps above to begin setting-up telegram alerts. When selecting the destination select Telegram and follow these steps to authorize Alerts - - - -### Private Message Alerts - -1. On the device that is logged into the telegram click "Open Telegram" or scan the QR code. - - - -2. by Telegram. Hit "Send Message" to continue - - - -3. Once inside the chat, hit "Start" to begin receiving alerts at this destination - - - -### Group message alerts - -For group chats, add `PagodaDevConsoleBot` and copy the message you see in your on-screen modal and send it in the chat that includes`PagodaDevConsoleBot` to authorize the group chat destination - - - -## Setting up Event Log Alerts - -You can listen to on-chain events occurring to contracts that follow NEPs standards like NEP-171 (NFTs), NEP-141 (fungible tokens), or NEP-145 (storage management). All NEAR NEPs can be found on the [Nomicon NEAR site](https://nomicon.io/Standards/). - -To set-up an alert for an event, for example `nft_transfer` from [NEP-171 version 1.1.0](https://nomicon.io/Standards/Tokens/NonFungibleToken/Core): - -1. Follow the steps above to begin setting up an alert. -2. Select the "Event Logged" condition, -3. Type the event name `nft_transfer`, -4. The standard `nep171`, and -5. Add the version `1.1.0` as seen below - - - -> Note that input fields are case sensitive, and the standards field must be written in the format `nep123` not `NEP-123` - -## Setting up Function Call Specific Alerts - -More generally, Pagoda Console makes it easy to generate alerts based on specific function calls. Simply follow the steps above, select the "Function Called" condition, and type the method name **exactly** as it appears in the contract code or the contract's [ABI](https://github.com/near/abi) - - diff --git a/docs/pagoda/alerts/webhooks.md b/docs/pagoda/alerts/webhooks.md deleted file mode 100644 index b854819f359..00000000000 --- a/docs/pagoda/alerts/webhooks.md +++ /dev/null @@ -1,215 +0,0 @@ ---- -sidebar_position: 2 -sidebar_label: "Webhooks Example" ---- - -# Turn on the (Hue) lights with NEAR NFTs and Pagoda Alerts & Triggers - -:::warning - -Please be advised that these tools and services will be discontinued soon. - -::: - -## Overview - -How cool would it be to have your lights turn on or your favorite song on spotify to play when someone bought your NFT on NEAR? - -With the Pagoda Console and IFTTT you can do both in minutes with zero code! - -## What will we be doing? - -Using a combination of the [Pagoda Console](https://console.pagoda.co) and [IFTTT](https://ifttt.com) we will turn on our lights when a successful transaction has been processed. - -We will be using the webhook trigger to allow the pagoda console to call an endpoint on IFTTT which will then turn on our HUE Lights - - -### What is IFTTT? - -IFTTT stands for "If This Then That". It's a platform (at ifttt.com) that provides a variety of services each with their own collection of applets within it that provide some unique functionality. - - - - -#### If This - -It starts with the "If This" Trigger. For example time could be your trigger, so if it's 10pm you can write your own script to turn off your lights. Or something more random like, liking a song on spotify could add the music video to a youtube playlist. - -There are a lot of triggers on this service, but just to name some examples - -- Time -- Temperature -- Webhooks (what we'll be using) - - -#### Then That - -Next comes the "Then That" action. An action is what happens when your trigger has been tripped. For example, turning out the lights at 10pm OR turning them on when you mint an NFT on NEAR. - - -## Step 1: Getting the webhook address - -We will be setting up a webhook trigger so after you make an account on ifttt.com You will see this page.... - - - -Go to the **Services** Tab and search for "webhook" - - - -Click on the webhooks icon and then you'll be sent to this page... - - - -Click on the "Documentation Button". This should open up a new tab.... - - - -Leave that page alone for now we'll come back to it. This is essentially where we get the webhook address we will call for our "IF". - -## Step 2: Setting up your Trigger - -Hit the **Create** Button on the upper right corner of the screen.. - - - -Next click on the "If This" Button... - - - -Again search for **webhooks** ... - - - -Select the **Receive a Web Request** trigger... - - - -let's call this "**on_transaction**" then select create trigger - - - -## Step 3: Select your Action -You for this tutorial you will need to have: -- Hue Account -- Hue Lights - -Next click on **Then That** ... - - - -Search for **Hue** - - - -Select Turn On Lights - - - -Select the lights of your choosing but I will simply do all lights. - -If you haven't already created and connected your Hue Account - - - -After you do this simply hit **Create Action** Then you'll be redirected here... - - - -As you can see you can add more than one trigger or action if you'd like. But for now we'll stick to the one. Hit **Continue** - -## Step 4: Setting up your endpoint - -Once you hit **Continue** you'll be redirected here... - - - -take note of the name "on_transaction" and copy it.. then hit the **Finish** button... - -Next go back to the documentation tab we opened up earlier - -Where it says `{event}` replace everything even the curly braces with "on_transaction" - - - -to - - - -copy that entire line and head on over to console.pagoda.co - -## Step 5: Integrating Webhook into Pagoda Console - -Once at console.pagoda.co, you should be greeted by the log-in page. Select the Non-fungible Token (NFT) project to start exploring the NFT contract - - - -Hit the "Deploy and Explore Contract" Button. This will create a dev account for you and deploy the pre written NFT smart contract onto that account for you. - - - - -Head to the Alerts section - - - -And select + New Alert - - - -You should see this page... - - - - -Select the suggested contract which should be dev account that was created. - - - -:::info -You can use any contract running on mainnet or testnet for an alert. We'll just use this NFT testnet example for this guide. -::: - -Under "Select Condition" hit "Successful Transaction". This means that for any successful transaction an alert will be sent. In this case for any successful method call the lights will turn on. If you want to, you can select "function call" for a specific method to be the trigger. - -But for now, we'll keep it easy and select any Successful Action. - - - - - -We're almost done! Under destination select webhooks. Now that webhook we created earlier go ahead and copy and paste it into here. Then hit "Create" - -:::tip -Don't forget to remove the `{}` around the name of your event! `ifttt.com/trigger/...`, not `ifttt.com/{trigger}/...` -::: - - - -Remember to hit the "+ Create Alert" button on this page... - - - - -Now head on over to the "Contracts" Section. - - - -Select the contract we just created and navigate to the "Interact" tab to connect your wallet. - - - - -Now here is the part we've all been waiting for... **Turn on the (hue) lights!** - -Select the `new_default_metadata` function (we are choosing this one because we have to initialize our contract, this is still a transaction which will trigger our new webhook). Fill in the `owner_id` field with your wallet account name and hit send transaction - - - -## Wrapping up - -And that's it! You've just triggered something in the real world with an event that happened on the NEAR Blockchain. Hopefully this inspires you to create your own webhook using IFTTT and the Pagoda Console. - -We'd love to see what you create! Tag [@PagodaPlatform](https://twitter.com/PagodaPlatform) on Twitter with a novel implementation of a webhook and trigger and we might retweet it. - -Happy hacking! diff --git a/docs/pagoda/rpc/api.md b/docs/pagoda/rpc/api.md deleted file mode 100644 index 078e0102df4..00000000000 --- a/docs/pagoda/rpc/api.md +++ /dev/null @@ -1,3127 +0,0 @@ ---- -title: NEAR Enhanced API -language_tabs: - - shell: Shell - - http: HTTP - - javascript: JavaScript - - ruby: Ruby - - python: Python - - php: PHP - - java: Java - - go: Go -toc_footers: [] -includes: [] -search: true -highlight_theme: darkula -headingLevel: 2 - ---- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - - - -:::warning - -Please be advised that these tools and services will be discontinued soon. - -::: - -> Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu. - -Try out our newly released Enhanced APIs - Balances (in Beta) and get what you need for all kinds of balances and token information at ease. -Call Enhanced APIs using the endpoint in the API URL box, varies by Network. - -- https://near-testnet.api.pagoda.co/eapi/v1 -- https://near-mainnet.api.pagoda.co/eapi/v1 - -Grab your API keys and give it a try! We will be adding more advanced Enhanced APIs in our offering, so stay tuned. Get the data you need without extra processing, NEAR Blockchain data query has never been easier! - -We would love to hear from you on the data APIs you need, please leave feedback using the widget in the lower-right corner. - -Base URLs: - -* https://near-testnet.api.pagoda.co/eapi/v1 - -## Authentication - -* API Key (apiKey) - - Parameter Name: **x-api-key**, in: header. Use Pagoda DevConsole API key here - -## Non Fungible Tokens - -### Get NFT - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id} \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id} HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /NFT/{contract_account_id}/{token_id}` - -*Get NFT* - -This endpoint returns detailed information on the NFT - for the given `token_id`, NFT `contract_id`, `timestamp`/`block_height`. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|contract_account_id|path|string|true|none| -|token_id|path|string|true|none| -|block_height|query|string|false|none| -|block_timestamp_nanos|query|string|false|none| - -> Example responses - -> 200 Response - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "contract_metadata": { - "base_uri": "string", - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - }, - "nft": { - "metadata": { - "copies": 0, - "description": "string", - "extra": "string", - "media": "string", - "media_hash": "string", - "reference": "string", - "reference_hash": "string", - "title": "string" - }, - "owner_account_id": "string", - "token_id": "string" - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[NftResponse](#nftresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - -### Get NFT history - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}/history \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}/history HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}/history', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}/history', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}/history', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}/history', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}/history"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/NFT/{contract_account_id}/{token_id}/history", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /NFT/{contract_account_id}/{token_id}/history` - -*Get NFT history* - -This endpoint returns the transaction history for the given NFT and `timestamp`/`block_height`. - **Note:** The result is centered around the history of the specific NFT and will return list of its passing owners and metadata. - - **Limitations** - * For now, we only support NFT contracts that implement the Events NEP standard. - * We currently provide the most recent 100 items. - Full-featured pagination will be provided in later phases. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|contract_account_id|path|string|true|none| -|token_id|path|string|true|none| -|limit|query|integer(int32)|false|none| - -> Example responses - -> 200 Response - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "history": [ - { - "block_height": "string", - "block_timestamp_nanos": "string", - "cause": "string", - "new_account_id": "string", - "old_account_id": "string", - "status": "string" - } - ], - "nft": { - "metadata": { - "copies": 0, - "description": "string", - "extra": "string", - "media": "string", - "media_hash": "string", - "reference": "string", - "reference_hash": "string", - "title": "string" - }, - "owner_account_id": "string", - "token_id": "string" - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[HistoryResponse](#historyresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - -### Get user's NFT collection overview - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /accounts/{account_id}/NFT` - -*Get user's NFT collection overview* - -For the given `account_id` and `timestamp` or `block_height`, this endpoint returns - the number of NFTs grouped by `contract_id`, together with the corresponding NFT contract metadata. - The NFT contract will be present in the response if the `account_id` has at least one NFT there. - - **Note:** `block_timestamp_nanos` helps you choose a moment in time, fixing the blockchain state at that time. - - **Limitations** - * We currently provide the most recent 100 items. - Full-featured pagination will be provided in later phases. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|account_id|path|string|true|none| -|block_height|query|string|false|none| -|block_timestamp_nanos|query|string|false|none| -|limit|query|integer(int32)|false|Maximum available limit 100| - -> Example responses - -> 200 Response - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "nft_counts": [ - { - "contract_account_id": "string", - "contract_metadata": { - "base_uri": "string", - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - }, - "last_updated_at_timestamp_nanos": "string", - "nft_count": 0 - } - ] -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[NftCountsResponse](#nftcountsresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - -### Get user's NFT collection by contract - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT/{contract_account_id} \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT/{contract_account_id} HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT/{contract_account_id}', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT/{contract_account_id}', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT/{contract_account_id}', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT/{contract_account_id}', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT/{contract_account_id}"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/NFT/{contract_account_id}", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /accounts/{account_id}/NFT/{contract_account_id}` - -*Get user's NFT collection by contract* - -This endpoint returns the list of NFTs with full details for the given `account_id`, NFT `contract_id`, `timestamp`/`block_height`. - You can use the `token_id` from this response and then request the NFT history for that token. - - **Limitations** - * We currently provide the most recent 100 items. - Full-featured pagination will be provided in later phases. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|account_id|path|string|true|none| -|contract_account_id|path|string|true|none| -|block_height|query|string|false|none| -|block_timestamp_nanos|query|string|false|none| -|limit|query|integer(int32)|false|Maximum available limit 100| - -> Example responses - -> 200 Response - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "contract_metadata": { - "base_uri": "string", - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - }, - "nfts": [ - { - "metadata": { - "copies": 0, - "description": "string", - "extra": "string", - "media": "string", - "media_hash": "string", - "reference": "string", - "reference_hash": "string", - "title": "string" - }, - "owner_account_id": "string", - "token_id": "string" - } - ] -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[NftsResponse](#nftsresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - -### Get NFT contract metadata - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/nep171/metadata/{contract_account_id} \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/nep171/metadata/{contract_account_id} HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/nep171/metadata/{contract_account_id}', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/nep171/metadata/{contract_account_id}', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/nep171/metadata/{contract_account_id}', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/nep171/metadata/{contract_account_id}', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/nep171/metadata/{contract_account_id}"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/nep171/metadata/{contract_account_id}", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /nep171/metadata/{contract_account_id}` - -*Get NFT contract metadata* - -This endpoint returns the metadata for a given NFT contract and `timestamp`/`block_height`. - **Note:** This is contract-wide metadata. Each NFT also has its own metadata. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|contract_account_id|path|string|true|none| -|block_height|query|string|false|none| -|block_timestamp_nanos|query|string|false|none| - -> Example responses - -> 200 Response - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "metadata": { - "base_uri": "string", - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[MetadataResponse](#metadataresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - ---- - -## NEAR - -### Get user's NEAR balance - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /accounts/{account_id}/coins/NEAR` - -*Get user's NEAR balance* - -This endpoint returns the NEAR balance of the given `account_id` - at the given `timestamp`/`block_height`. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|account_id|path|string|true|none| -|block_height|query|string|false|none| -|block_timestamp_nanos|query|string|false|none| - -> Example responses - -> 200 Response - -```json -{ - "balance": "string", - "block_height": "string", - "block_timestamp_nanos": "string", - "metadata": { - "decimals": 0, - "icon": "string", - "name": "string", - "symbol": "string" - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[NearBalanceResponse](#nearbalanceresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - -### Get user's NEAR history - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR/history \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR/history HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR/history', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR/history', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR/history', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR/history', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR/history"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/NEAR/history", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /accounts/{account_id}/coins/NEAR/history` - -*Get user's NEAR history* - -This endpoint returns the history of operations with NEAR coins - for the given `account_id`, `timestamp`/`block_height`. - - **Limitations** - * We currently provide the most recent 100 items. - Full-featured pagination will be provided in an upcoming update. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|account_id|path|string|true|none| -|limit|query|integer(int32)|false|none| - -> Example responses - -> 200 Response - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "history": [ - { - "block_height": "string", - "block_timestamp_nanos": "string", - "cause": "string", - "new_account_id": "string", - "old_account_id": "string", - "status": "string" - } - ], - "nft": { - "metadata": { - "copies": 0, - "description": "string", - "extra": "string", - "media": "string", - "media_hash": "string", - "reference": "string", - "reference_hash": "string", - "title": "string" - }, - "owner_account_id": "string", - "token_id": "string" - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[HistoryResponse](#historyresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - ---- - -## Fungible Tokens - -### Get user's coin balances - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /accounts/{account_id}/coins` - -*Get user's coin balances* - -This endpoint returns all the countable coin balances (including NEAR, fungible tokens, and _multi-tokens_) - of the given `account_id`, at the given `timestamp`/`block_height`. - - **Limitations** - * For now, we only support the balance for NEAR and FT contracts that implement the Events NEP standard. - We are working on a solution to support other FT contracts, including `wrap.near` and bridged tokens. - * We are in the process of supporting Multi Token balances. - * We currently provide the most recent 100 items. - Full-featured pagination will be provided in an upcoming update. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|account_id|path|string|true|none| -|block_height|query|string|false|none| -|block_timestamp_nanos|query|string|false|none| -|limit|query|integer(int32)|false|Maximum available limit 100| - -> Example responses - -> 200 Response - -```json -{ - "balances": [ - { - "balance": "string", - "contract_account_id": "string", - "metadata": { - "decimals": 0, - "icon": "string", - "name": "string", - "symbol": "string" - }, - "standard": "string" - } - ], - "block_height": "string", - "block_timestamp_nanos": "string" -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[CoinBalancesResponse](#coinbalancesresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - -### Get user's coin balances by contract - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id} \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id} HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /accounts/{account_id}/coins/{contract_account_id}` - -*Get user's coin balances by contract* - -This endpoint returns all the countable coin balances of the given `account_id`, - for the given contract and `timestamp`/`block_height`. - For FT contracts, the response has only 1 item in the list. - For MT contracts, there could be several balances (MT support is still under development). - - **Limitations** - * For now, we support only the balance for FT contracts that implement the Events NEP standard. - We are working on a solution to support other FT contracts, including `wrap.near` and bridged tokens. - * We are in the process of supporting Multi Token balances. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|account_id|path|string|true|none| -|contract_account_id|path|string|true|none| -|block_height|query|string|false|none| -|block_timestamp_nanos|query|string|false|none| - -> Example responses - -> 200 Response - -```json -{ - "balances": [ - { - "balance": "string", - "contract_account_id": "string", - "metadata": { - "decimals": 0, - "icon": "string", - "name": "string", - "symbol": "string" - }, - "standard": "string" - } - ], - "block_height": "string", - "block_timestamp_nanos": "string" -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[CoinBalancesResponse](#coinbalancesresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - -### Get user's coin history by contract - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}/history \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}/history HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}/history', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}/history', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}/history', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}/history', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}/history"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/accounts/{account_id}/coins/{contract_account_id}/history", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /accounts/{account_id}/coins/{contract_account_id}/history` - -*Get user's coin history by contract* - -This endpoint returns the history of coin operations (FT, other standards) - for the given `account_id`, `contract_id`, `timestamp`/`block_height`. - - **Limitations** - * For now, we support only FT contracts that implement the Events NEP standard. - We are working on a solution to support other FT contracts, including `wrap.near` and bridged tokens. - * We are in the process of supporting Multi Token history. - * We currently provide the most recent 100 items. - Full-featured pagination will be provided in an upcoming update. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|account_id|path|string|true|none| -|contract_account_id|path|string|true|none| -|limit|query|integer(int32)|false|none| - -> Example responses - -> 200 Response - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "history": [ - { - "block_height": "string", - "block_timestamp_nanos": "string", - "cause": "string", - "new_account_id": "string", - "old_account_id": "string", - "status": "string" - } - ], - "nft": { - "metadata": { - "copies": 0, - "description": "string", - "extra": "string", - "media": "string", - "media_hash": "string", - "reference": "string", - "reference_hash": "string", - "title": "string" - }, - "owner_account_id": "string", - "token_id": "string" - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[HistoryResponse](#historyresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - -### Get FT contract metadata - -> Code samples - - - - -```shell -# You can also use wget -curl -X GET https://near-testnet.api.pagoda.co/eapi/v1/nep141/metadata/{contract_account_id} \ - -H 'Accept: application/json' \ - -H 'x-api-key: API_KEY' - -``` - - - - - -```http -GET https://near-testnet.api.pagoda.co/eapi/v1/nep141/metadata/{contract_account_id} HTTP/1.1 -Host: near-testnet.api.pagoda.co -Accept: application/json - -``` - - - - - -```javascript - -const headers = { - 'Accept':'application/json', - 'x-api-key':'API_KEY' -}; - -fetch('https://near-testnet.api.pagoda.co/eapi/v1/nep141/metadata/{contract_account_id}', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - - - - - -```ruby -require 'rest-client' -require 'json' - -headers = { - 'Accept' => 'application/json', - 'x-api-key' => 'API_KEY' -} - -result = RestClient.get 'https://near-testnet.api.pagoda.co/eapi/v1/nep141/metadata/{contract_account_id}', - params: { - }, headers: headers - -p JSON.parse(result) - -``` - - - - - -```python -import requests -headers = { - 'Accept': 'application/json', - 'x-api-key': 'API_KEY' -} - -r = requests.get('https://near-testnet.api.pagoda.co/eapi/v1/nep141/metadata/{contract_account_id}', headers = headers) - -print(r.json()) - -``` - - - - - -```php - 'application/json', - 'x-api-key' => 'API_KEY', -); - -$client = new \GuzzleHttp\Client(); - -// Define array of request body. -$request_body = array(); - -try { - $response = $client->request('GET','https://near-testnet.api.pagoda.co/eapi/v1/nep141/metadata/{contract_account_id}', array( - 'headers' => $headers, - 'json' => $request_body, - ) - ); - print_r($response->getBody()->getContents()); - } - catch (\GuzzleHttp\Exception\BadResponseException $e) { - // handle exception or api errors. - print_r($e->getMessage()); - } - - // ... - -``` - - - - - -```java -URL obj = new URL("https://near-testnet.api.pagoda.co/eapi/v1/nep141/metadata/{contract_account_id}"); -HttpURLConnection con = (HttpURLConnection) obj.openConnection(); -con.setRequestMethod("GET"); -int responseCode = con.getResponseCode(); -BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); -String inputLine; -StringBuffer response = new StringBuffer(); -while ((inputLine = in.readLine()) != null) { - response.append(inputLine); -} -in.close(); -System.out.println(response.toString()); - -``` - - - - - - -```go -package main - -import ( - "bytes" - "net/http" -) - -func main() { - - headers := map[string][]string{ - "Accept": []string{"application/json"}, - "x-api-key": []string{"API_KEY"}, - } - - data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("GET", "https://near-testnet.api.pagoda.co/eapi/v1/nep141/metadata/{contract_account_id}", data) - req.Header = headers - - client := &http.Client{} - resp, err := client.Do(req) - // ... -} - -``` - - - - - - -`GET /nep141/metadata/{contract_account_id}` - -*Get FT contract metadata* - -This endpoint returns the metadata for a given FT contract and `timestamp`/`block_height`. - - **Limitations** - * For now, we support only FT contracts that implement the Events NEP standard. - We are working on a solution to support other FT contracts, including `wrap.near` and bridged tokens. - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|contract_account_id|path|string|true|none| -|block_height|query|string|false|none| -|block_timestamp_nanos|query|string|false|none| - -> Example responses - -> 200 Response - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "metadata": { - "decimals": 0, - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|[FtContractMetadataResponse](#ftcontractmetadataresponse)| -|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|See the inner `code` value to get more details|None| - - - ---- - -## Schemas - -### CoinBalancesResponse - - - - - - -```json -{ - "balances": [ - { - "balance": "string", - "contract_account_id": "string", - "metadata": { - "decimals": 0, - "icon": "string", - "name": "string", - "symbol": "string" - }, - "standard": "string" - } - ], - "block_height": "string", - "block_timestamp_nanos": "string" -} - -``` - -This response gives the information about all the available balances for the user. - The answer gives the list of NEAR, FT balances, could be used for Multi Tokens. - For MTs and other standards, balances could have multiple entries for one contract. - -##### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|balances|[object]|true|none|none| -|» balance|string|true|none|none| -|» contract_account_id|string|false|none|null for NEAR, not null otherwise| -|» metadata|object|true|none|This type describes general Metadata info, collecting the most important fields from different standards in the one format.
`decimals` may contain `0` if it's not applicable (e.g. if it's general MT metadata)| -|»» decimals|integer(int32)|true|none|none| -|»» icon|string|false|none|none| -|»» name|string|true|none|none| -|»» symbol|string|true|none|none| -|» standard|string|true|none|"nearprotocol" for NEAR, "nep141" for FT| -|block_height|string|true|none|none| -|block_timestamp_nanos|string|true|none|none| - -### FtContractMetadataResponse - - - - - - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "metadata": { - "decimals": 0, - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - } -} - -``` - -##### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|block_height|string|true|none|none| -|block_timestamp_nanos|string|true|none|none| -|metadata|object|true|none|The type for FT Contract Metadata. Inspired by
https://nomicon.io/Standards/Tokens/FungibleToken/Metadata| -|» decimals|integer(int32)|true|none|none| -|» icon|string|false|none|none| -|» name|string|true|none|none| -|» reference|string|false|none|none| -|» reference_hash|string|false|none|none| -|» spec|string|true|none|none| -|» symbol|string|true|none|none| - -### HistoryResponse - - - - - - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "history": [ - { - "block_height": "string", - "block_timestamp_nanos": "string", - "cause": "string", - "new_account_id": "string", - "old_account_id": "string", - "status": "string" - } - ], - "nft": { - "metadata": { - "copies": 0, - "description": "string", - "extra": "string", - "media": "string", - "media_hash": "string", - "reference": "string", - "reference_hash": "string", - "title": "string" - }, - "owner_account_id": "string", - "token_id": "string" - } -} - -``` - -##### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|block_height|string|true|none|none| -|block_timestamp_nanos|string|true|none|none| -|history|[object]|true|none|none| -|» block_height|string|true|none|none| -|» block_timestamp_nanos|string|true|none|none| -|» cause|string|true|none|none| -|» new_account_id|string|false|none|none| -|» old_account_id|string|false|none|none| -|» status|string|true|none|none| -|nft|object|true|none|The type for Non Fungible Token. Inspired by
https://nomicon.io/Standards/Tokens/NonFungibleToken/Metadata| -|» metadata|object|true|none|The type for Non Fungible Token Metadata. Inspired by
https://nomicon.io/Standards/Tokens/NonFungibleToken/Metadata| -|»» copies|integer(int64)|false|none|none| -|»» description|string|false|none|none| -|»» extra|string|false|none|none| -|»» media|string|false|none|none| -|»» media_hash|string|false|none|none| -|»» reference|string|false|none|none| -|»» reference_hash|string|false|none|none| -|»» title|string|false|none|none| -|» owner_account_id|string|true|none|none| -|» token_id|string|true|none|none| - -### MetadataResponse - - - - - - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "metadata": { - "base_uri": "string", - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - } -} - -``` - -##### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|block_height|string|true|none|none| -|block_timestamp_nanos|string|true|none|none| -|metadata|object|true|none|The type for Non Fungible Token Contract Metadata. Inspired by
https://nomicon.io/Standards/Tokens/NonFungibleToken/Metadata| -|» base_uri|string|false|none|none| -|» icon|string|false|none|none| -|» name|string|true|none|none| -|» reference|string|false|none|none| -|» reference_hash|string|false|none|none| -|» spec|string|true|none|none| -|» symbol|string|true|none|none| - -### NearBalanceResponse - - - - - - -```json -{ - "balance": "string", - "block_height": "string", - "block_timestamp_nanos": "string", - "metadata": { - "decimals": 0, - "icon": "string", - "name": "string", - "symbol": "string" - } -} - -``` - -##### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|balance|string|true|none|Sum of staked and nonstaked balances| -|block_height|string|true|none|none| -|block_timestamp_nanos|string|true|none|none| -|metadata|object|true|none|This type describes general Metadata info, collecting the most important fields from different standards in the one format.
`decimals` may contain `0` if it's not applicable (e.g. if it's general MT metadata)| -|» decimals|integer(int32)|true|none|none| -|» icon|string|false|none|none| -|» name|string|true|none|none| -|» symbol|string|true|none|none| - -### NftCountsResponse - - - - - - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "nft_counts": [ - { - "contract_account_id": "string", - "contract_metadata": { - "base_uri": "string", - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - }, - "last_updated_at_timestamp_nanos": "string", - "nft_count": 0 - } - ] -} - -``` - -##### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|block_height|string|true|none|none| -|block_timestamp_nanos|string|true|none|none| -|nft_counts|[object]|true|none|none| -|» contract_account_id|string|true|none|none| -|» contract_metadata|object|true|none|The type for Non Fungible Token Contract Metadata. Inspired by
https://nomicon.io/Standards/Tokens/NonFungibleToken/Metadata| -|»» base_uri|string|false|none|none| -|»» icon|string|false|none|none| -|»» name|string|true|none|none| -|»» reference|string|false|none|none| -|»» reference_hash|string|false|none|none| -|»» spec|string|true|none|none| -|»» symbol|string|true|none|none| -|» last_updated_at_timestamp_nanos|string|true|none|none| -|» nft_count|integer(int32)|true|none|none| - -### NftResponse - - - - - - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "contract_metadata": { - "base_uri": "string", - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - }, - "nft": { - "metadata": { - "copies": 0, - "description": "string", - "extra": "string", - "media": "string", - "media_hash": "string", - "reference": "string", - "reference_hash": "string", - "title": "string" - }, - "owner_account_id": "string", - "token_id": "string" - } -} - -``` - -##### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|block_height|string|true|none|none| -|block_timestamp_nanos|string|true|none|none| -|contract_metadata|object|true|none|The type for Non Fungible Token Contract Metadata. Inspired by
https://nomicon.io/Standards/Tokens/NonFungibleToken/Metadata| -|» base_uri|string|false|none|none| -|» icon|string|false|none|none| -|» name|string|true|none|none| -|» reference|string|false|none|none| -|» reference_hash|string|false|none|none| -|» spec|string|true|none|none| -|» symbol|string|true|none|none| -|nft|object|true|none|The type for Non Fungible Token. Inspired by
https://nomicon.io/Standards/Tokens/NonFungibleToken/Metadata| -|» metadata|object|true|none|The type for Non Fungible Token Metadata. Inspired by
https://nomicon.io/Standards/Tokens/NonFungibleToken/Metadata| -|»» copies|integer(int64)|false|none|none| -|»» description|string|false|none|none| -|»» extra|string|false|none|none| -|»» media|string|false|none|none| -|»» media_hash|string|false|none|none| -|»» reference|string|false|none|none| -|»» reference_hash|string|false|none|none| -|»» title|string|false|none|none| -|» owner_account_id|string|true|none|none| -|» token_id|string|true|none|none| - -### NftsResponse - - - - - - -```json -{ - "block_height": "string", - "block_timestamp_nanos": "string", - "contract_metadata": { - "base_uri": "string", - "icon": "string", - "name": "string", - "reference": "string", - "reference_hash": "string", - "spec": "string", - "symbol": "string" - }, - "nfts": [ - { - "metadata": { - "copies": 0, - "description": "string", - "extra": "string", - "media": "string", - "media_hash": "string", - "reference": "string", - "reference_hash": "string", - "title": "string" - }, - "owner_account_id": "string", - "token_id": "string" - } - ] -} - -``` - -##### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|block_height|string|true|none|none| -|block_timestamp_nanos|string|true|none|none| -|contract_metadata|object|true|none|The type for Non Fungible Token Contract Metadata. Inspired by
https://nomicon.io/Standards/Tokens/NonFungibleToken/Metadata| -|» base_uri|string|false|none|none| -|» icon|string|false|none|none| -|» name|string|true|none|none| -|» reference|string|false|none|none| -|» reference_hash|string|false|none|none| -|» spec|string|true|none|none| -|» symbol|string|true|none|none| -|nfts|[object]|true|none|none| -|» metadata|object|true|none|The type for Non Fungible Token Metadata. Inspired by
https://nomicon.io/Standards/Tokens/NonFungibleToken/Metadata| -|»» copies|integer(int64)|false|none|none| -|»» description|string|false|none|none| -|»» extra|string|false|none|none| -|»» media|string|false|none|none| -|»» media_hash|string|false|none|none| -|»» reference|string|false|none|none| -|»» reference_hash|string|false|none|none| -|»» title|string|false|none|none| -|» owner_account_id|string|true|none|none| -|» token_id|string|true|none|none| diff --git a/docs/pagoda/rpc/get-keys.md b/docs/pagoda/rpc/get-keys.md deleted file mode 100644 index e8f14827e8d..00000000000 --- a/docs/pagoda/rpc/get-keys.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -sidebar_position: 3 -sidebar_label: Get API Keys -title: Get Pagoda API Keys ---- - -:::warning - -Please be advised that these tools and services will be discontinued soon. - -::: - -1. Register an account on [Pagoda Console](https://console.pagoda.co/): - - ![](/docs/pagoda/getkey1.png) - -2. Create a blank project - - ![](/docs/pagoda/getkey2.png) - -3. Give your project a cool name - - ![](/docs/pagoda/getkey3.png) - -4. Grab your API Key - - Click the API Tab and you will see your API key already generated for you and ready to use, remember to switch networks for `MainNet` using the button on top, you can also navigate through your different projects there. - - ![](/docs/pagoda/getkey4.png) - -5. Connect to Pagoda RPC Node - - Follow the instructions on the screen to set up your Pagoda RPC Access, we have created a quick setup guide for all NEAR tools. - - `https://near-testnet.api.pagoda.co/rpc/v1/` - - `https://near-mainnet.api.pagoda.co/rpc/v1/` - - ![](/docs/pagoda/getkey5.png) - -6. You can use this line of code for a quick test - - ```sh - curl -X POST -H 'x-api-key:' -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "id":"dontcare","method":"status","params":[] }' https://near-testnet.api.pagoda.co/rpc/v1/ - ``` - - ![](/docs/pagoda/getkey6.png) - -Congrats! You are connected! diff --git a/docs/pagoda/rpc/intro.md b/docs/pagoda/rpc/intro.md deleted file mode 100644 index 726b399d5b7..00000000000 --- a/docs/pagoda/rpc/intro.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -sidebar_position: 1 -sidebar_label: Introduction -title: Pagoda RPC API ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -:::warning - -Please be advised that these tools and services will be discontinued and stop serving traffic on December 9th, 2024. - -::: - -## Overview - -The Pagoda RPC provides you with instant access to maintenance free, scalable NEAR infrastructure, powering you on the fastest path from ideas to launch. - -Developers can interact with on-chain data and send different types of transactions to the network by utilizing the RPC endpoints. - -In addition to the powerful node infrastructure, we also created the Pagoda RPC Stats page so that you can have visibility into your RPC usage and performances and take control of your project from the infrastructure level. What’s more? You can subscribe to the alerts from our Status page so that you can follow the health of Pagoda RPC real time. All accessible via [Pagoda Console](https://console.pagoda.co/). - -## Setup - -### API Keys - -- [Getting API keys](get-keys.md) -- [Testing your API keys](setup.md#test-your-api-keys) - -### Tools - -- [Postman](setup.md#postman-setup) setup -- [Command-line (CLI)](setup.md#command-line-setup) setup -- [JavaScript](setup.md#javascript-setup) setup -- [Rust](setup.md#rust-setup) setup - ---- - -## RPC Endpoints - Quick Links - -| API | Description | -| ------------------------------------------ | ---------------------------------------------------------------------------- | -| [Access Keys](/api/rpc/access-keys) | Retrieve information about an account's access keys. | -| [Accounts / Contracts](/api/rpc/contracts) | View details about accounts and contracts as well as perform contract calls. | -| [Block / Chunk](/api/rpc/block-chunk) | Query the network and get details about specific blocks or chunks. | -| [Gas](/api/rpc/gas) | Get gas price for a specific block or hash. | -| [Protocol](/api/rpc/protocol) | Retrieve current genesis and protocol configuration. | -| [Network](/api/rpc/network) | Return status information for nodes and validators. | -| [Transactions](/api/rpc/transactions) | Send transactions and query their status. | - -:::tip - -You can access the JSON RPC 2.0 endpoints using [Postman](setup.md#postman-setup), -[JavaScript](setup.md#javascript-setup), [Rust](setup.md#rust-setup), and [CLI](setup.md#command-line-setup). - -::: diff --git a/docs/pagoda/rpc/setup.md b/docs/pagoda/rpc/setup.md deleted file mode 100644 index f7ac2b0c6a2..00000000000 --- a/docs/pagoda/rpc/setup.md +++ /dev/null @@ -1,175 +0,0 @@ ---- -sidebar_position: 3 -sidebar_label: Setup -title: RPC Setup ---- - -:::warning - -Please be advised that these tools and services will be discontinued soon. - -::: - -In order to use the RPC API you will need to setup the correct RPC endpoints: - -- `POST` for all RPC methods -- `JSON RPC 2.0` -- `id: "dontcare"` -- Endpoint URL varies by network - - testnet: `https://near-testnet.api.pagoda.co/rpc/v1/` - - mainnet: `https://near-mainnet.api.pagoda.co/rpc/v1/` - -:::note - -We are working on supporting historical data access in the next phase. - -::: - -## API Keys - -When accessing the NEAR network via a node provider, API services like Pagoda require an API key, which allows developers to monitor personal apps and access usage metrics. - -:::tip -For the best development experience, we recommend that you [sign up for a free API key](get-keys.md). -::: - -With a dedicated API key, developers are able to: - -- Access higher request throughput and increased concurrent requests -- Query data from [Enhanced APIs](api.md), gaining access to free processed data for NFT, FT and NEAR balances, ownership, and metadata -- Utilize dedicated, individualized usage metrics - -### Test your API keys - -To quickly test your API keys and connection, try a simple request from your command line: - -```sh -curl -X POST -H 'x-api-key:' -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "id":"dontcare","method":"status","params":[] }' https://near-testnet.api.pagoda.co/rpc/v1/ -``` - -## Postman Setup - -An easy way to test the queries in this documentation page is to use an API request tool such as [Postman](https://www.postman.com/). -You only need to configure two things: - -1. Make sure you add a header with a key of `Content-Type` and value of `application/json`. - ![postman-setup-header](/docs/assets/postman-setup-headers.png) - -2. Then select the `Body` tab and choose the `raw` radio button and ensure `JSON` is the selected format. - ![postman-setup-header](/docs/assets/postman-setup-body.png) - -After that is set up, just copy/paste the `JSON object` example snippets below into the `body` of your request, on Postman, and click `send`. - - -## Command-line Setup - -### NEAR CLI - -1. If you don’t yet have `near-cli` installed on your machine, follow the [near-cli installation instructions](https://docs.near.org/tools/near-cli#installation). -2. Set your RPC URL: - ``` - export NEAR_CLI_TESTNET_RPC_SERVER_URL=https://near-testnet.api.pagoda.co/rpc/v1/ - ``` -3. Configure your API key: - ``` - near set-api-key $NEAR_CLI_TESTNET_RPC_SERVER_URL - ``` - -### HTTPie Setup {#httpie-setup} - -If you prefer to use a command line interface, we have provided RPC examples you can use with [HTTPie](https://httpie.org/). -Please note that params take either an object or array passed as a string. - -```bash -http post https://near-testnet.api.pagoda.co/rpc/v1/ jsonrpc=2.0 id=dontcare method=network_info params:='[]' -``` - -## JavaScript Setup - -All of the queries listed in this documentation page can be called using [`near-api-js`](https://github.com/near/near-api-js). - -:::tip -For `near-api-js` installation and setup please refer to `near-api-js` [quick reference documentation](../../4.tools/near-api.md). -::: - -Add the following code to get started: - -```js -const { connect, keyStores } = require("near-api-js"); - -// Can be an empty object if not signing transactions - -const keyStore = new keyStores.BrowserLocalStorageKeyStore(); - -const RPC_API_ENDPOINT = 'https://near-testnet.api.pagoda.co/rpc/v1/'; -const API_KEY = ''; - -const ACCOUNT_ID = 'account.near'; - -const config = { - networkId: 'testnet', - keyStore, - nodeUrl: RPC_API_ENDPOINT, - headers: { 'x-api-key': API_KEY }, -}; - -// Example: Fetching account status - -async function getState(accountId) { - const near = await connect(config); - const account = await near.account(accountId); - const state = await account.state(); - console.log(state); -} - -getState(ACCOUNT_ID); -``` - -:::info -All JavaScript code snippets require a `near` object. For examples of how to instantiate, [click here](../../4.tools/near-api.md#connect). -::: - -## Rust Setup - -You can use the [near-jsonrpc-client-rs](https://github.com/near/near-jsonrpc-client-rs) library to communicate with the Pagoda RPC endpoints via JSONRPC. - -Example of asynchronously fetching the latest block using `tokio`: - -```rust -use near_jsonrpc_client::{auth, methods, JsonRpcClient}; -use near_primitives::types::{BlockReference, Finality}; - -#[tokio::main] -async fn main() -> Result<(), Box> { - let client = JsonRpcClient::connect("https://near-testnet.api.pagoda.co/rpc/v1/") - .header(auth::ApiKey::new("")?); - - let request = methods::block::RpcBlockRequest { - block_reference: BlockReference::Finality(Finality::Final), - }; - - let response = client.call(request).await?; - - println!("{:?}", response); - - Ok(()) -} -``` - ---- - -## Using `block_id` param {#using-block_id-param} - -The `block_id` param can take either the block number (e.g. `27912554`) or the block hash (e.g. `'3Xz2wM9rigMXzA2c5vgCP8wTgFBaePucgUmVYPkMqhRL'` ) as an argument. - -:::caution -The block IDs of transactions shown in [NEAR Explorer](https://explorer.testnet.near.org) are not necessarily the block ID of the executed transaction. Transactions may execute a block or two after its recorded, and in some cases, can take place over several blocks. Due to this, it is important to check subsequent blocks to be sure all results related to the queried transaction are discovered. -::: - ---- - -## Using `finality` param {#using-finality-param} - -The `finality` param has two options: `optimistic` and `final`. -1. `optimistic` uses the latest block recorded on the node that responded to your query _(<1 second delay after the transaction is submitted)_ -2. `final` is for a block that has been validated on at least 66% of the nodes in the network _(usually takes 2 blocks / approx. 2 second delay)_ diff --git a/docs/pagoda/rpc/stats.md b/docs/pagoda/rpc/stats.md deleted file mode 100644 index e780bd9693a..00000000000 --- a/docs/pagoda/rpc/stats.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -sidebar_position: 3 -sidebar_label: Statistics Dashboard -title: RPC Statistics ---- - -:::warning - -Please be advised that these tools and services will be discontinued soon. - -::: - -Inspect your RPC Usage in the [Statistics Tab](https://console.pagoda.co/apis?tab=statistics): - -![](/docs/pagoda/stats1.png) - -:::info -Data defaults to the last 30 days. -Currently the statistics page show the usage data across all projects and API keys within an organization set on Pagoda Console. -::: - -Aggregated key metrics available at the top of the dashboard are - -- Total Request Volume -- Request Success Rate -- Total failed request -- Average Latency - -## Set a Time Period - -Data is sent with UTC time to the browser and the browser adjusts to the user’s timezone. - -- Last 15 Minutes is the last complete 15 minutes. This updates every few seconds. -- Last 1 Hour is the last fully completed hour; from 00 to 59 minutes and 59 seconds. -- Last 24 Hours is the last fully completed 24 consecutive hours. -- Last 7 Days is the previous 7 days from the current time. Each data point groups one hour’s worth of data. The most recent hour is partial data for the current hour and updates every few seconds. -- Last 30 Days is the previous 30 days from the current time. Each data point groups one hour’s worth of data. The most recent hour is partial data for the current hour and updates every few seconds. - -## Requests breakdowns - -Multiple breakdowns are available in the statistics page - -![](/docs/pagoda/stats2.png) - -Requests can be broken down by - -- Requests Methods -- Requests Status -- Aggregated status display breakdown by requests methods - -We are working to include more detailed breakdown by each requests and more interactive dashboard that enable clickthrough from the charts - -## Network Status - -Check the [Pagoda Status page](https://status.pagoda.co/) for the latest service information across all networks and subscribe to updates based on your service choice and needs. - -![](/docs/pagoda/stats3.png) diff --git a/website/linkinator.config.json b/website/linkinator.config.json index 9c3e9a592b7..90b43c635b7 100644 --- a/website/linkinator.config.json +++ b/website/linkinator.config.json @@ -9,6 +9,7 @@ "silent": true, "skip": [ "https://crates.io/*", + "https://jwt.io/*", "https://dappradar.com/*", "https://staking.dokia.cloud/staking/near/validators", "https://near.zavodil.ru/?pools=", diff --git a/website/mlc_config.json b/website/mlc_config.json deleted file mode 100644 index a98c5b5bafe..00000000000 --- a/website/mlc_config.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": "^/" - }, - { - "pattern": "^http://127.0.0.1" - }, - { - "pattern": "^https://near.events" - }, - { - "pattern": "^https://etherscan.io" - }, - { - "pattern": "^https://chainstack.com" - }, - { - "pattern": "^https://crates.io" - }, - { - "pattern": "^https://ropsten.etherscan.io" - }, - { - "pattern": "^https://support.ledger.com" - }, - { - "pattern": "^https://help.github.com" - }, - { - "pattern": "^https://hackenproof.com" - }, - { - "pattern": "^https://explorer.betanet.near.org" - }, - { - "pattern": "^https://rpc.betanet.near.org" - }, - { - "pattern": "^https://rpc.testnet.near.org" - } - ], - "timeout": "20s", - "retryOn429": true, - "retryCount": 5, - "fallbackRetryDelay": "30s", - "aliveStatusCodes": [200, 206] -} diff --git a/website/sidebars.js b/website/sidebars.js index 37a672d29da..df01c0a3b3c 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -566,36 +566,6 @@ const sidebar = { "api/rpc/transactions", "api/rpc/maintenance-windows", ], - "pagoda": [ - { - "type": "html", - "value": "
" - }, - { - "type": "html", - "value": " PAGODA CONSOLE " - }, - { - "Pagoda RPC": [ - "pagoda/rpc/intro", - "pagoda/rpc/get-keys", - "pagoda/rpc/setup", - "pagoda/rpc/stats", - ] - }, - { - "Enhanced API": [ - "pagoda/rpc/api", - ] - }, - { - "Alerts & Triggers": [ - "pagoda/alerts/intro", - "pagoda/alerts/setup", - "pagoda/alerts/webhooks", - ] - }, - ], "exchanges": [ { "Integration": [ diff --git a/website/src/theme/Footer/index.js b/website/src/theme/Footer/index.js index 57eac84eb5d..76417a45518 100644 --- a/website/src/theme/Footer/index.js +++ b/website/src/theme/Footer/index.js @@ -438,11 +438,6 @@ function Footer() { Startup Accelerator -
  • - - Wiki - -
  • Forum