This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
schema.graphql
163 lines (144 loc) · 4.37 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# This file was generated based on ".graphqlconfig". Do not edit manually.
schema {
query: Query
mutation: Mutation
}
"Block is a single digital record created within a blockchain. Each block contains a record of the previous Block, and when linked together these become the âchainâ.A block is always composed of header and body."
type Block {
"Hash of the block"
hash: Hash!
"The header section of a block"
header: BlockHeader!
"The body section of a block"
orderedTxHashes: [Hash!]!
}
"A block header is like the metadata of a block."
type BlockHeader {
"Identifier of a chain in order to prevent replay attacks across channels "
chainId: Hash!
"The merkle roots of all the confirms"
confirmRoot: [Hash!]!
"The sum of all transactions costs"
cyclesUsed: [Uint64!]!
"The height to which the block has been executed"
execHeight: Uint64!
"block height"
height: Uint64!
"The merkle root of ordered transactions"
orderRoot: Hash!
"The hash of ordered signed transactions"
orderSignedTransactionsHash: Hash!
"The hash of the serialized previous block"
prevHash: Hash!
proof: Proof!
"The address descirbed who packed the block"
proposer: Address!
"The merkle roots of receipts"
receiptRoot: [Hash!]!
"The merkle root of state root"
stateRoot: Hash!
"A timestamp that records when the block was created"
timestamp: Uint64!
"The version of validator is designed for cross chain"
validatorVersion: Uint64!
validators: [Validator!]!
}
type Event {
data: String!
name: String!
service: String!
}
type Mutation {
"send transaction"
sendTransaction(inputEncryption: InputTransactionEncryption!, inputRaw: InputRawTransaction!): Hash!
unsafeSendTransaction(inputPrivkey: Bytes!, inputRaw: InputRawTransaction!): Hash! @deprecated(reason : "DON'T use it in production! This is just for development.")
}
"The verifier of the block header proved"
type Proof {
bitmap: Bytes!
blockHash: Hash!
height: Uint64!
round: Uint64!
signature: Bytes!
}
type Query {
"Get the block"
getBlock(height: Uint64): Block
"Get the receipt by transaction hash"
getReceipt(txHash: Hash!): Receipt
"Get the transaction by hash"
getTransaction(txHash: Hash!): SignedTransaction
"query service"
queryService(caller: Address!, cyclesLimit: Uint64, cyclesPrice: Uint64, height: Uint64, method: String!, payload: String!, serviceName: String!): ServiceResponse!
}
type Receipt {
cyclesUsed: Uint64!
events: [Event!]!
height: Uint64!
response: ReceiptResponse!
stateRoot: Hash!
txHash: Hash!
}
type ReceiptResponse {
method: String!
response: ServiceResponse!
serviceName: String!
}
type ServiceResponse {
code: Uint64!
errorMessage: String!
succeedData: String!
}
type SignedTransaction {
chainId: Hash!
cyclesLimit: Uint64!
cyclesPrice: Uint64!
method: String!
nonce: Hash!
payload: String!
pubkey: Bytes!
sender: Address!
serviceName: String!
signature: Bytes!
timeout: Uint64!
txHash: Hash!
}
"Validator address set"
type Validator {
proposeWeight: Int!
pubkey: Bytes!
voteWeight: Int!
}
"There was many types of transaction in Muta, A transaction often require computing resources or write data to chain,these resources are valuable so we need to pay some token for them.InputRawTransaction describes information above"
input InputRawTransaction {
"Identifier of the chain."
chainId: Hash!
"Mostly like the gas limit in Ethereum, describes the fee that you are willing to pay the highest price for the transaction"
cyclesLimit: Uint64!
cyclesPrice: Uint64!
method: String!
"Every transaction has its own id, unlike Ethereum's nonce,the nonce in Muta is an hash"
nonce: Hash!
payload: String!
sender: Address!
serviceName: String!
"For security and performance reasons, Muta will only deal with trade request over a period of time,the `timeout` should be `timeout > current_block_height` and `timeout < current_block_height + timeout_gap`,the `timeout_gap` generally equal to 20."
timeout: Uint64!
}
"Signature of the transaction"
input InputTransactionEncryption {
"The public key of transfer"
pubkey: Bytes!
"The signature of the transaction"
signature: Bytes!
"The digest of the transaction"
txHash: Hash!
}
"Bytes corresponding hex string."
scalar Bytes
"20 bytes of account address"
scalar Address
"Uint64"
scalar Uint64
"The output digest of Keccak hash function"
scalar Hash