forked from polywrap/wrap-integrations
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspecSchema.graphql
125 lines (102 loc) · 2.97 KB
/
specSchema.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
type Query {
"""
Wallet Query Functions (Implemented, Not Tested)
"""
requestSignIn(
contractId: String
methodNames: [String!]
successUrl: String
failureUrl: String
): Boolean!
signOut: Boolean!
isSignedIn: Boolean!
getAccountId: String
createTransactionWithWallet(
receiverId: String!
actions: [Action!]!
): Transaction!
"""
KeyStore, KeyPair, and Signer Query Functions (Implemented, Tested)
"""
getPublicKey(
accountId: String!
): PublicKey
"""
KeyStore, KeyPair, and Signer Query Functions (Not Implemented)
"""
signMessage(
message: Bytes!
signerId: String!
): Signature!
}
type Mutation {
"""
Generic Functions (Implemented, Tested)
"""
sendJsonRpc(
method: String!
params: JSON!
): JSON!
"""
Wallet Mutation Functions (Implemented, Not Tested)
"""
# 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!
"""
KeyStore, KeyPair, and Signer Query Functions (Not Implemented)
"""
createKey(
accountId: String!
networkId: String!
): PublicKey!
}
"""
Plugin Types (can be imported by Polywrapper to prevent redundancy)
"""
# Supported public key types
enum KeyType {
ed25519
}
# Account public key data
type PublicKey {
keyType: KeyType!
data: Bytes!
}
# holds content necessary to create an account
type CreateAccount {}
# holds content necessary to send a transaction that deploys a contract
type DeployContract { code: Bytes! }
# holds content necessary to send a transaction that calls a contract function
type FunctionCall { methodName: String! args: JSON gas: BigInt! deposit: BigInt! }
# holds content necessary to send a transaction that transfers NEAR?
type Transfer { deposit: BigInt! }
# holds content necessary to send a transaction that stakes NEAR
type Stake { stake: BigInt! publicKey: PublicKey! }
# holds content necessary to send a transaction that adds an access key
type AddKey { publicKey: PublicKey! accessKey: AccessKey! }
# holds content necessary to send a transaction that deletes an access key
type DeleteKey { publicKey: PublicKey! }
# holds content necessary to send a transaction that creates a NEAR account
type DeleteAccount { beneficiaryId: String! }
# Action types define the data necessary to complete a type of action in a transaction
type Action = ( CreateAccount | DeployContract | FunctionCall | Transfer | Stake | AddKey | DeleteKey | DeleteAccount)!
type Transaction {
signerId: String!
publicKey: PublicKey!
nonce: BigInt!
receiverId: String!
actions: [Action!]!
blockHash: Bytes
hash: String
}
type Signature {
keyType: KeyType!
data: Bytes!
}