forked from polywrap/wrap-integrations
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
202 lines (172 loc) · 5 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
type Query {
requestSignIn(
contractId: String
methodNames: [String!]
successUrl: String
failureUrl: String
): Boolean!
signOut: Boolean!
isSignedIn: Boolean!
getAccountId: String
getPublicKey(
accountId: String!
): PublicKey
"""
Creates a transaction.
If signerId is provided, the transaction will be signed using data from the KeyStore in the plugin config.
Otherwise, wallet authorization is expected.
"""
createTransactionWithWallet(
receiverId: String!
actions: [Action!]!
): Transaction!
# signs a transaction without wallet
signTransaction(
transaction: Transaction!
): SignTransactionResult!
}
type Mutation {
sendJsonRpc(
method: String!
params: JSON!
): JSON!
# send one or more transactions to NEAR wallet to be signed and executed
requestSignTransactions(
# list of transactions to sign
transactions: [Transaction!]!
# url NEAR Wallet will redirect to after transaction signing is complete
callbackUrl: String
# meta information NEAR Wallet will send back to the application. `meta` will be attached to the `callbackUrl` as a url search param
meta: String
): Boolean!
# sends a signed transaction and awaits execution
sendTransaction(
signedTx: SignedTransaction!
): FinalExecutionOutcome!
# sends a signed transaction and immediately returns transaction hash
sendTransactionAsync(
signedTx: SignedTransaction!
): String!
}
# Account public key data
type PublicKey {
keyType: KeyType!
data: Bytes!
}
# Supported public key types
enum KeyType {
ed25519
}
# Access key permissions determine how an account is allow to interact with a contract
type AccessKeyPermission {
_: String
}
# Full access permission allows an account to call all public contract functions
type FullAccessPermission implements AccessKeyPermission {}
# Function call permissions describe which contract functions an account can call
type FunctionCallPermission implements AccessKeyPermission {
receiverId: String!
methodNames: [String!]!
allowance: BigInt
}
type AccessKey {
nonce: BigInt!
permission: AccessKeyPermission!
}
# Access keys contain access key permissions, which determine how an account is allowed to interact with a contract
type AccessKeyInfo {
publicKey: PublicKey!
accessKey: AccessKey!
}
# Action types define the data necessary to complete a type of action in a transaction
type Action {
code: Bytes
methodName: String
args: Bytes
gas: BigInt
deposit: BigInt
stake: BigInt
publicKey: PublicKey
accessKey: AccessKey
beneficiaryId: String
}
## holds content necessary to create an account
#type CreateAccount implements Action {}
## holds content necessary to send a transaction that deploys a contract
#type DeployContract implements Action { code: Bytes! }
## holds content necessary to send a transaction that calls a contract function
## TODO: accept "args" property as JSON object
#type FunctionCall implements Action { methodName: String! args: Bytes! gas: BigInt! deposit: BigInt! }
## holds content necessary to send a transaction that transfers NEAR?
#type Transfer implements Action { deposit: BigInt! }
## holds content necessary to send a transaction that stakes NEAR
#type Stake implements Action { stake: BigInt! publicKey: PublicKey! }
## holds content necessary to send a transaction that adds an access key
#type AddKey implements Action { publicKey: PublicKey! accessKey: AccessKey! }
## holds content necessary to send a transaction that deletes an access key
#type DeleteKey implements Action { publicKey: PublicKey! }
## holds content necessary to send a transaction that creates a NEAR account
#type DeleteAccount implements Action { beneficiaryId: String! }
type Transaction {
signerId: String!
publicKey: PublicKey!
nonce: BigInt!
receiverId: String!
actions: [Action!]!
blockHash: Bytes
hash: String
}
type Signature {
keyType: KeyType!
data: Bytes!
}
type SignedTransaction {
transaction: Transaction!
signature: Signature!
}
# Return value of Mutation.signTransaction(...); contains transaction hash and signed transaction
type SignTransactionResult {
hash: Bytes!
signedTx: SignedTransaction!
}
type ExecutionStatus {
successValue: String
successReceiptId: String
failure: JSON
}
type ExecutionOutcomeWithId {
block_hash: String
id: String!
outcome: ExecutionOutcome!
proof: [ExecutionProof!]
}
type ExecutionProof {
direction: String!
hash: String!
}
# Execution status of a sent transaction
type ExecutionOutcome {
executor_id: String
gas_burnt: BigInt!
logs: [String!]
metadata: OutcomeMetaData
receipt_ids: [String!]!
status: ExecutionStatus!
tokens_burnt: String
}
type OutcomeMetaData {
gas_profile: [GasProfile]!
version: UInt!
}
type GasProfile {
cost: String!
cost_category: String!
gas_used: String!
}
# Final outcome of a sent transaction
type FinalExecutionOutcome {
status: ExecutionStatus!
transaction: Transaction!
transaction_outcome: ExecutionOutcomeWithId!
receipts_outcome: [ExecutionOutcomeWithId!]!
}