GraphQL API 1.0 migration
Described changes are to be introduced in the end of August 2023. Learn how to make the transition seamless for your applications.
Last updated
Was this helpful?
Described changes are to be introduced in the end of August 2023. Learn how to make the transition seamless for your applications.
Last updated
Was this helpful?
There will be several announcements prior to the actual API transition, which is planned for approximately the end of August 2023.
The transition will first happen on Venom testnet network, later followed by other supported networks.
To stay updated on the transition, you can monitor page or join channel for announcements.
As TVM blockchains adoption grows, and with it blockchain load, so does the load on GraphQL API. To be able to cope with large amounts of data, GraphQL API is being refactored.
The Collections API for blocks, transactions and messages in the new version will only provide data from the last 7 days. To retrieve older (archive) data of blocks, transactions end messages, you need to use the blockchain{...}
API with archive: true
mode on.
☝ The access to archive data will have rps limits, so make sure you don’t implement many requests per second if you specify archive: true
. Limit yourself with maximum of 5 requests of archive data per second from one ip address. If you need higher rate contact @EkaterinaPantaz
The Accounts collection will not provide account boc, code and data anymore. Use blockchain{account(address:"address"){info{boc}}
} for that.
Take a look at the updated API. Read comments carefully.
To prepare for the transition from current functionality to the new one, and make sure it happens seamlessly, developers should migrate their queries as soon as possible - before the actual release of the new API, which will happen in the end of August 2023.
We have released a flag called 'archive
' for this purpose. Currently, this flag has no functionality (the API works the same way whether archive=true
or false
), but it helps in migrating to the new API. When you migrate, the switch from the old API to the new one will be under the hood and invisible to your application.
Be sure to specify the archive=true
flag only in places where you need to retrieve blocks, transactions end messages data older than 7 days. If you do not require old data, do not include the flag.
The Evercloud team has collected and analyzed API usage statistics and developed an updated blockchain API that covers over 95% of use cases involving archive data. If your use case falls within the <5% where the new API is or seems entirely inapplicable, please also contact @Ekaterina Pantaz, and we will work together to adapt your use case to the API or vice versa.
Get account information
Old query:
New query:
Retrieve the last 2 external outbound messages from src_address
to the “:external address
”
Old query:
New query:
Get the last 2 src_address
' s ExtOut
messages filtered by ":external_address
" counterparty and save the last message cursor for the next reads.
Get 100 messages of account $p3 of type $p2 created after timestamp $p1 with value>0 sorted by creation timestamp ASC.
Old query
Pagination is implemented by created_at field. To get the next 50 messages one needs to get pass the created_at value $p1 of the last message into the created_at:{gt:$p1} filter.
New query
Now query first page (one page is 50 messages) messages of needed types starting from $start with min value=1 nanotoken.
Available message types are
ExtIn
(External inbound),
ExtOut
(External outbound),
IntIn
(Internal inbound),
IntOut
(Internal outbound).
And now the second page after endCursor
= “59e5c7c0059f9522070001”
Get last 100 account transactions in descending order
Old query
New query
☝ Note that sorting order in blockchain
api is always in ascending order, so if you need to process the data in descending order on the client, sort it by cursor field in descending order on the client side
Here we get last 50 transactions of account
and now in the second query we get last 50 transactions before the startCursor
from the result of the previous query
Old queries
New queries:
☝ Make sure to specify archive
flag according to your use-case
Detailed documentation of Blockchain API is available .
Note: If you could not find a suitable query for your use case in the blockchain API, please message in Telegram, and we will see what we can do to prepare for migration in your individual case.