text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
BlockHeader, | |
DataHandlerContext, | |
EvmBatchProcessor, | |
FieldSelection, | |
Log, | |
Transaction, | |
} from '@subsquid/evm-processor' | |
type GetSelector<K extends keyof FieldSelection> = Exclude<FieldSelection[K], undefined> |
export class SystemAccountStorage {
private readonly _chain: Chain
private readonly blockHash: string
constructor(ctx: BlockContext)
constructor(ctx: ChainContext, block: Block)
constructor(ctx: BlockContext, block?: Block) {
block = block || ctx.block
this.blockHash = block.hash
# account entity can be used to get info about current account state and absorb account actions
type Account @entity {
id: ID!
transfers: [AccountTransfer!] @derivedFrom(field: "account")
contributions: [Contribution!] @derivedFrom(field: "account")
crowdloans: [Contributor!] @derivedFrom(field: "account") # crowdloans there account get participation
- Last 10 succsessful trasnfers and total successful transfers count in network:
{
transfers(limit: 10, orderBy: blockNumber_DESC) {
fromId
toId
amount
timestamp
success
}
type Account @entity {
id: ID!
balances: Balances!
transfers: [AccountTransfer!] @derivedFrom(field: "account")
contributions: [Contribution!] @derivedFrom(field: "account")
rewards: [Reward!] @derivedFrom(field: "account")
slashes: [Slash!] @derivedFrom(field: "account")
bonds: [Bond!] @derivedFrom(field: "account")