forked from polywrap/wrap-integrations
-
Notifications
You must be signed in to change notification settings - Fork 1
/
specMutationSchema.graphql
167 lines (141 loc) · 3.83 KB
/
specMutationSchema.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
#import { Query, Transaction, Action, PublicKey, Signature } into Near from "w3://ens/nearPlugin.web3api.eth"
type Mutation {
"""
JsonRpcProvider Mutation Functions (Implemented, Tested)
"""
# send a JSON RPC to Near node
sendJsonRpc(
method: String!
params: JSON!
): JSON!
"""
Generic Mutation Functions (Implemented, Tested)
"""
# send one or more transactions to NEAR wallet to be signed and executed
requestSignTransactions(
# list of transactions to sign
transactions: [Near_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!
# creates, signs, and sends a transaction without wallet and awaits execution
signAndSendTransaction(
receiverId: String!
actions: [Near_Action!]!
signerId: String!
): FinalExecutionOutcome!
# creates, signs, and sends a transaction without wallet and immediately returns transaction hash
signAndSendTransactionAsync(
receiverId: String!
actions: [Near_Action!]!
signerId: String!
): String!
"""
Convenience Mutation Functions (Not Implemented)
"""
# create a new Near account
createAccount(
newAccountId: String!
publicKey: Near_PublicKey! # | String
amount: BigInt
signerId: String!
): FinalExecutionOutcome!
# delete Near account and transfer remaining funds to beneficiary
deleteAccount(
accountId: String!
beneficiaryId: String!
signerId: String!
): FinalExecutionOutcome!
# deploy a contract
deployContract(
data: Bytes!
contractId: String!
signerId: String!
): FinalExecutionOutcome!
# transfer Near from signer to receiver
sendMoney(
amount: BigInt!
receiverId: String!,
signerId: String!
): FinalExecutionOutcome!
# call a contract function
functionCall(
contractId: String!
methodName: String!
args: JSON
gas: BigInt
deposit: BigInt
walletMeta: String
walletCallbackUrl: String
SignerId: String
): FinalExecutionOutcome!
# add access key to account
addKey(
publicKey: Near_PublicKey! # | String
contractId: String
methodNames: [String!],
amount: BigInt
signerId: String!
): FinalExecutionOutcome!
# delete access key associated with public key
deleteKey(
publicKey: Near_PublicKey! # | String
signerId: String!
): FinalExecutionOutcome!
# Create a new account and deploy a contract to it
createAndDeployContract(
contractId: String!
publicKey: (String | Near_PublicKey)!
data: Bytes!
amount: BigInt!
): Boolean!
}
"""
Common Types
"""
type SignedTransaction {
transaction: Transaction!
signature: Near_Signature!
}
# Return value of Mutation.signTransaction(...); contains transaction hash and signed transaction
type SignTransactionResult {
hash: Bytes!
signedTx: SignedTransaction!
}
type FinalExecutionStatus {
successValue: String
failure: JSON
}
type ExecutionStatus {
successValue: String
successReceiptId: String
failure: JSON
}
type ExecutionOutcomeWithId {
id: String!
outcome: ExecutionOutcome!
}
# Execution status of a sent transaction
type ExecutionOutcome {
logs: [String!]!
receiptIds: [String!]!
gasBurnt: BigInt!
status: ExecutionStatus!
}
# Final outcome of a sent transaction
type FinalExecutionOutcome {
status: FinalExecutionStatus!
transaction: Transaction!
transaction_outcome: ExecutionOutcomeWithId!
receipts_outcome: [ExecutionOutcomeWithId!]!
}