We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following GraphQL query gets the packages added by an account address (creator):
query { getTransactions( where: { messages: { value: { MsgAddPackage: {creator: { eq: "g1juz2yxmdsa6audkp6ep9vfv80c8p5u76e03vvh"}}}} success: { eq: true } } ) { messages { value { ... on MsgAddPackage { package{name}}}}} }
If there are no matches, the result is:
{ "data": { "getTransactions": null } }
If there is a match, the result is something like:
{ "data": { "getTransactions": [ { "messages": [ { "value": { "package": { "name": "deep2" } } } ] } ] } }
The following code uses this to query txIndexerRemote for the packages added by address:
txIndexerRemote
address
const txIndexerRemote = "https://txindexer.gno.berty.io/graphql/query" const address = "g1juz2yxmdsa6audkp6ep9vfv80c8p5u76e03vvh" const requestOptions = { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ 'query': `query { getTransactions(where: { messages: { value: { MsgAddPackage: {creator: { eq: "${address}"}}}} success: { eq: true }}) { messages { value { ... on MsgAddPackage { package{name}}}}}}` }), } const response = await fetch(txIndexerRemote, requestOptions) const result = await response.json()
If there are no packages, result.data.getTransactions is null. Otherwise result.data.getTransactions is something like:
result.data.getTransactions
[{"messages":[{"value":{"package":{"name":"mypackage"}}}]}]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following GraphQL query gets the packages added by an account address (creator):
If there are no matches, the result is:
If there is a match, the result is something like:
The following code uses this to query
txIndexerRemote
for the packages added byaddress
:If there are no packages,
result.data.getTransactions
is null. Otherwiseresult.data.getTransactions
is something like:The text was updated successfully, but these errors were encountered: