Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pinax-network/subgraph-template

Subgraph Template
https://github.com/pinax-network/subgraph-template

Last synced: about 2 months ago
JSON representation

Subgraph Template

Awesome Lists containing this project

README

        

# Subgraph: `TEMPLATE`

> Transactions, Decoded Actions & Database Operations
>
> [`sf.antelope.type.v1.Block`](https://buf.build/pinax/firehose-antelope/docs/main:sf.antelope.type.v1)

- [x] **Blocks**
- [x] **Transactions**
- [x] **DatabaseOperations**
- [x] **Actions**
- [x] **Authorization**
- [x] **Receiver**

## Smart Contracts

- `eosio.token`

## Subgraph

- **API Key**:
- **Base URL**:
- **Subgraph ID**: ``
- **Query URL format**: `{base_url}`/api/`{api-key}`/subgraphs/id/`{subgraph_id}`

## GraphQL

```graphql
{
actions(
orderBy: block_number
orderDirection: desc
) {
block_number
timestamp
transaction {
id
}
account
name
jsonData
dbOps {
code
tableName
primaryKey
newDataJson
}
}
}
```

### Example queries

- `code:mycontract`
- `code:tethertether && action:issue`
- `code:eosio.token && action:transfer && (data.to:myaccount || data.from:myaccount)`
- `auth:myaccount@active`
- `code:atomicassets && action:logmint`

### Available query fields

These are the expressions that can be used in queries:

- `action:` - action name
- `code:` - smart contract account name
- `receiver:` - action receiver account
- `auth:` - account which authority was used to sign the action, i.e.
- `auth:` - account with any permission
- `auth:@` - account with a specific permission
- `input:true` - will match only the top-level actions
- `notif:true` - will match only notifications, excluding input action or other inline actions.
- `data.:` - will decode and match action parameters (doesn't support nested objects). Some examples:
- `data.from:myaccount`
- `data.memo:"your daily staking rewards"`
- `db.table:`
- `db.table:/`

Queries can include `&&` and `||` logical operands, as well as `(` and `)` parenthesis.