"""
User information
"""
type Account {
"""
The user wallet
"""
wallet: String!
"""
The user Id
"""
id: Int!
}
type AliasResult {
status: String!
function: FunctionInfo
view: ViewInfo
}
"""
The result of collecting data for teh specified cycle
"""
type CollectResult {
"""
Collecting status
"""
status: String!
"""
Error information if failed to collect data
"""
error: String
"""
The task Id of collected data
"""
taskId: Int!
"""
The task update counter (execution cycle number) of collected data
"""
taskCycle: Int!
"""
The target network block of collected data
"""
targetBlock: Int!
"""
The timechain network block of collected data
"""
timechainBlock: Int!
}
"""
Collections in the current subgraph
"""
type Collection {
_count: Int!
}
"""
Contract Input/Output information
"""
type ContractInOutInfo {
"""
Data type
"""
type: String!
}
"""
Contract Input/Output specification
"""
input ContractInOutSpec {
"""
Data type
"""
type: String!
}
"""
Smart contract as a group of function
"""
type ContractInfo {
"""
Unique Identifier
"""
id: Int!
"""
The smart contract address
"""
address: String!
"""
The smart contract network
"""
network: String!
"""
The smart contract global identifier
"""
identifier: String
"""
The smart contract description
"""
description: String
"""
The wallet created the contract
"""
creator: String!
"""
The time when the smart contract group was created
"""
createdAt: String!
"""
Composed ABI from all functions grouped in the smart contract
"""
abi: [FunctionContractAbiInfo!]!
"""
Functions associated with the smart contract
"""
functions: [FunctionInfo!]!
"""
Feeds associated with the smart contract
"""
feeds: [FeedInfo!]!
"""
Views associated with the smart contract
"""
views: [ViewInfo!]!
}
type ContractMutationResult {
"""
mutation result - can be "Completed" or "Failed"
"""
status: String!
"""
error text if status is "Failed"
"""
error: String
"""
proposed or merged functions
"""
functions: [FunctionResult!]!
"""
proposed or merged contract
"""
contract: ContractResult!
}
type ContractResult {
"""
contract mutation result - can be "Failed", "Created", "Untouched"
"""
status: String!
"""
error text if status is "Failed"
"""
error: String
"""
contract address
"""
address: String!
"""
contract network
"""
network: String!
"""
unique identifier
"""
identifier: String
}
"""
Count of objects
"""
type Count {
"""
Count of collections
"""
collections: Int!
"""
Count of functions
"""
functions: Int!
"""
Count of views
"""
views: Int!
}
"""
Reference to bounded function used by view
"""
type FeedInfo {
hashId: String!
view: ViewInfo
function: FunctionInfo
args: [String!]
}
"""
Contract ABI information
"""
type FunctionContractAbiInfo {
"""
ABI entrypoint name
"""
name: String!
"""
Input information
"""
inputs: [ContractInOutInfo!]!
"""
Output information
"""
outputs: [ContractInOutInfo!]!
}
"""
Contract ABI specification
"""
input FunctionContractAbiSpec {
"""
ABI entrypoint name
"""
name: String!
"""
Input specification
"""
inputs: [ContractInOutSpec!]!
"""
Output specification
"""
outputs: [ContractInOutSpec!]!
}
"""
Contract information
"""
type FunctionContractInfo {
"""
Contract address
"""
address: String!
"""
Contract ABI
"""
abi: FunctionContractAbiInfo!
}
"""
Contract specification
"""
input FunctionContractSpec {
"""
Contract address
"""
address: String!
"""
Contract ABI
"""
abi: FunctionContractAbiSpec!
}
"""
Function information
"""
type FunctionInfo {
"""
Object hash id
"""
hashId: String!
"""
Target network
"""
network: String!
"""
Local name in the current subgraph
"""
name: String
"""
Global unique identifier
"""
identifier: String!
"""
Description
"""
description: String
"""
Function inputs
"""
inputs: [FunctionInputInfo!]!
"""
Function outputs
"""
outputs: [FunctionOutputInfo!]!
"""
Contract information
"""
contract: FunctionContractInfo
"""
Wallet created the function
"""
creator: String!
}
"""
Function input information
"""
type FunctionInputInfo {
"""
Type conversion
"""
value: String
"""
Nested array
"""
array: [FunctionInputInfo!]
"""
Predefined constant is used as argument
"""
constant: String
}
"""
Function input specification ( either input or constant or array )
"""
input FunctionInputSpec {
"""
Type conversion
"""
value: String
"""
Nested array
"""
array: [FunctionInputSpec!]
"""
Predefined constant is used as argument
"""
constant: String
}
"""
Function output information
"""
type FunctionOutputInfo {
"""
Nested array
"""
array: [FunctionOutputInfo!]
"""
Possible values:
numeric
string
integer
boolean
skip (skip value in result)
None (if array field isn't None)
"""
value: String
"""
Name to store in database
"""
name: String
}
"""
Function output specification (either output or array)
"""
input FunctionOutputSpec {
"""
Nested array
"""
array: [FunctionOutputSpec!]
"""
Type to store in the database
numeric
string
integer
boolean
data (use default from the ABI)
skip (skip value in results)
None (if the array field isn't None)
"""
value: String
"""
Name to store in database
"""
name: String
}
type FunctionResult {
"""
Merging status
can be Merged, Unchanged, Error
"""
status: String!
"""
Error message if error happens
"""
error: String
"""
Requested function name
"""
name: String
"""
The wallet created the function
"""
function: FunctionInfo
}
"""
Function specification
"""
input FunctionSpec {
"""
Function unique global name
"""
identifier: String
"""
Local name in the current subgraph
"""
name: String!
"""
Target network
"""
network: String!
"""
Function inputs
"""
inputs: [FunctionInputSpec!]!
"""
Function outputs
"""
outputs: [FunctionOutputSpec!]!
"""
Contract information
"""
contract: FunctionContractSpec
}
"""
Global objects view
"""
type Global {
"""
Count of accessible collections, functions, and views
"""
count: Count!
"""
List accessible subgraphs
@id: id of the subgraph to list only one
@limit: count of subgraphs to list"
@before: the subgraph id to list before it
@after: the subgraph id to list after it"
@user: user id to list only subgraphs created by the user
"""
subgraphs(id: Int, limit: Int, before: Int, after: Int, user: Int): [SubgraphInfo!]!
"""
List accessible feeds
@hash: the hash of the collection to list only one
@limit: max count of collections to list
@before: the hash to list collections before it
@after: the hash to list collections after it
"""
feeds(hash: String, limit: Int, before: String, after: String): [FeedInfo!]!
"""
List accessible functions
@hash: the hash of the function to list only one
@limit: max count of functions to list
@before: the hash to list functions before it
@after: the hash to list functions after it
"""
functions(hash: String, limit: Int, before: String, after: String): [FunctionInfo!]!
"""
List accessible views
@hash: the hash of the view to list only one
@limit: max count of views to list
@before: the hash to list views before it
@after: the hash to list views after it
"""
views(hash: String, limit: Int, before: String, after: String): [ViewInfo!]!
contracts(address: String, network: String, limit: Int, before: Int, after: Int): [ContractInfo!]!
query(view: String!, limit: Int, before: Int, after: Int): QueryResult!
}
"""
User API key information
"""
type KeyInfo {
"""
User id
"""
userId: Int!
"""
Public key
"""
key: String!
"""
Key role
"""
role: String!
"""
Key certificate
"""
cert: [Int!]!
"""
Status (enabled/disabled/revoked)
"""
status: String!
}
type MergeResult {
status: String!
views: [ViewResult!]!
functions: [FunctionResult!]!
}
type Mutation {
"""
Create new account
@wallet: Public key of the user wallet or Substrate wallet address
!user must be authenticated with as the wallet owner
"""
createAccount(wallet: String!): UserInfo!
"""
Add the ApiKey certification
@cert: the APIKEY certificate
!user must be authenticated with as the key owner
"""
certifyKey(cert: String!): KeyInfo!
"""
Disable APIkey temporally
@key: the public key of the APIKEY
!user must be authenticated with as the key owner
"""
enableKey(key: String!): KeyInfo!
"""
Enable temporally disabled APIkey
@key: the public key of the APIKEY
!user must be authenticated with as the key owner
"""
disableKey(key: String!): KeyInfo!
"""
Permanently revoke APIkey
@key: the public key of the APIKEY
!user must be authenticated with as the key owner
"""
revokeKey(key: String!): KeyInfo!
drop(name: String!): AliasResult!
alias(hash: String!, name: String!): AliasResult!
withdrawToken(amount: Int!): String!
sponsorView(viewId: Int!, amount: Int!): String!
"""
Merge object specifications
@functions: function specifications
@collections: collection specifications
@views: view specifications
"""
merge(functions: [FunctionSpec!], views: [ViewSpec!], scope: String, dryRun: Boolean): MergeResult!
"""
Add data into collection (user must have Collector role)
@feed: feed hashId
@taskCycle: task updating cycle
@targetBlock: target network block number
@timechainBlock: timechain block number
@taskId: task associated with data
@signature: TSS signature
@data: data to add into collection (the flat values list)
@eventId: unused
"""
collect(feed: String!, taskId: Int!, taskCycle: Int!, targetBlock: Int!, timechainBlock: Int!, shardId: Int!, signature: String!, data: [String!]!, eventId: Int): CollectResult!
"""
Automerge deployed smart contract
@address - extract contract with specified address
@network - extract contract from specified network
@chain - look into specified network chain instead of mainnet
@identifier - propose identifier for the smart contract functions group
@methods - look for specified methods only
@scope - merging scope: "global" or "subgraph"
@dry_run - do not merge, just propose mutations
"""
contract(address: String!, network: String!, identifier: String!, chain: String, methods: [String!], scope: String, dryRun: Boolean): ContractMutationResult!
}
"""
Query (readonly operations)
"""
type Query {
"""
Interface revision
"""
revision: String!
gitHash: String!
"""
Current subgraph collections
"""
collection: Collection!
"""
Binary representation of the collection spec
@hash: the collection hash to get bytes
"""
bytes(hash: String!): [Int!]!
"""
Subgraph view
@id: optional subgraph id
"""
subgraph(id: Int): Subgraph!
"""
Global view
"""
global: Global!
"""
Current user info
"""
userInfo: UserInfo!
"""
API keys information
@key: the key to list only one
@limit: max count of keys to list
@before: the key to list keys before it
@after: the key to list keys after it
"""
keys(key: String, limit: Int, before: String, after: String): [KeyInfo!]!
"""
List of users
@limit: max count of users to list
@before: the user id to list users before it
@after: the user id to list users after it
"""
users(limit: Int, before: Int, after: Int): [UserInfo!]!
}
type QueryResult {
header: [String!]!
data: [[String]!]!
schema: [String!]!
}
"""
User subgraph referencing objects like collections, functions and views
"""
type Subgraph {
id: Int!
info: SubgraphInfo!
"""
Count of collections, functions, views in the subgraph
"""
count: Count!
"""
List functions in the subgraph
@name: the function name in the subgraph to list only one
@hash: the hash of the function to list only one
@limit: max count of functions to list
@before: hash to list functions before it
@after: hash to list functions after it
"""
functions(name: String, hash: String, limit: Int, before: String, after: String): [FunctionInfo!]!
"""
List views in the subgraph
@name: the view name in the subgraph to list only one
@hash: the hash of the view to list only one
@limit: max count of views to list
@before: hash to list views before it
@after: hash to list views after it
"""
views(name: String, hash: String, limit: Int, before: String, after: String): [ViewInfo!]!
"""
Current subgraph collections
"""
collection: Collection!
}
"""
Subgraph Information
"""
type SubgraphInfo {
"""
The subgraph Id
"""
id: Int!
}
"""
Task Information
"""
type TaskInfo {
"""
timechain task identifier
"""
taskId: Int
"""
scheduling state
"""
state: String!
"""
scheduling error if failed
"""
error: String
"""
task owner
"""
sponsors: [Account!]!
"""
last updating cycle
"""
lastCycle: Int!
"""
seconds/minutes/hours passed from the last update
"""
validity(units: String): Int!
}
"""
User information
"""
type UserInfo {
"""
The unique user identifier
"""
userId: Int!
"""
The user role (can be limited by an APIKEY)
"""
userRole: String!
"""
The user subgraph identifier
"""
subgraph: Int!
"""
The user wallet
"""
wallet: String!
balance: String!
}
"""
Collection Information
"""
type ViewInfo {
"""
SQL query
"""
sql: String!
"""
Collection unique hash id
"""
hashId: String!
"""
Collection name in the user subgraph
"""
name: String
"""
Collection global identifier
"""
identifier: String
"""
Description
"""
description: String
"""
Feeds the View's SQL refers to
"""
references: [FeedInfo!]!
"""
Wallet created the view
"""
creator: String!
"""
The updating tasks
"""
tasks: [TaskInfo!]!
}
type ViewResult {
"""
Merging status
can be Merged, Unchanged, Error
"""
status: String!
"""
Error message if error happens
"""
error: String
"""
Requested view name
"""
name: String
"""
The wallet created the view
"""
view: ViewInfo
data: [[String]!]
header: [String!]
}
"""
View specification
"""
input ViewSpec {
"""
View unique name
"""
identifier: String
"""
Description
"""
description: String
"""
View name in the subgraph
"""
name: String
"""
Sql expression
"""
sql: String!
}
schema {
query: Query
mutation: Mutation
}