Queries
Create a query into Axiom with the Axiom SDK
Creating a query
newQueryBuilder
Construct a new query instance.
append
Appends a QueryRow
to the current QueryBuilder
instance. If the QueryBuilder
has reached its maximum size, or if validation for that QueryRow
fails, then an error will be thrown.
appendWithoutValidation
Appends a QueryRow
to the current QueryBuilder
instance without validating the values first. If there are invalid values (such as the account address being an empty account at the specified block number), then the proof generation of the query will fail after submitting the transaction, making it impossible to fulfill the query onchain.
build
Builds the query response and query data to be sent to the Axiom contract.
Returns an object with the following values:
keccackQueryResponse
:an identifier associated with the query onchain.
queryHash
: an identifier associated with the query offchain.
query
:
getCurrentSize
Returns the current number of QueryRow
s appended to the instance of QueryBuilder
.
getRemainingSize
Returns the number of QueryRow
s that can still be appended
getMaxSize
Returns the maximum number of QueryRows
that the current instance of QueryBuilder
supports.
getResponseTree
Returns the ResponseTree
for the current set of queries if build()
has been called.
sortQueries
Sorts queries in order of blockNumber
, address
, and slot.
formatQueries
Formats queries into a pretty-printable string.
asFormattedString
Returns the current QueryRow
values as a formatted string in the order that they were appended.
buildQueryResponse
Builds a queryResponse
from the sorted queries.
Returns a queryResponse
.
Last updated