forked from GaloyMoney/blink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
288 lines (237 loc) · 5.09 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
type Account {
"""
GPS coordinates for the account that can be used to place the related business on a map
"""
coordinates: Coordinates
createdAt: Timestamp!
id: ID!
level: AccountLevel!
owner: User!
status: AccountStatus!
title: String
username: Username
}
type AccountDetailPayload {
accountDetails: Account
errors: [Error!]!
}
enum AccountLevel {
ONE
TWO
}
enum AccountStatus {
ACTIVE
LOCKED
}
input AccountUpdateLevelInput {
level: AccountLevel!
uid: ID!
}
input AccountUpdateStatusInput {
status: AccountStatus!
uid: ID!
}
"""
An authentication code valid for a single use
"""
scalar AuthToken
type AuthTokenPayload {
authToken: AuthToken
errors: [Error!]!
}
input BusinessUpdateMapInfoInput {
latitude: Float!
longitude: Float!
title: String!
username: Username!
}
type Coordinates {
latitude: Float!
longitude: Float!
}
interface Error {
message: String!
path: [String]
}
enum ExchangeCurrencyUnit {
BTCSAT
USDCENT
}
union InitiationVia = InitiationViaIntraLedger | InitiationViaLn | InitiationViaOnChain
type InitiationViaIntraLedger {
counterPartyUsername: Username
counterPartyWalletId: WalletId
}
type InitiationViaLn {
paymentHash: PaymentHash!
}
type InitiationViaOnChain {
address: OnChainAddress!
}
scalar Language
type LightningInvoice {
confirmedAt: Timestamp
createdAt: Timestamp!
description: String!
expiresAt: Timestamp
isSettled: Boolean!
received: SatAmount!
request: LnPaymentRequest
secret: LnPaymentSecret!
}
type LightningPayment {
amount: SatAmount
confirmedAt: Timestamp
createdAt: Timestamp
destination: LnPubkey
request: LnPaymentRequest
roundedUpFee: SatAmount
secret: LnPaymentSecret
status: LnPaymentStatus
}
"""
BOLT11 lightning invoice payment request with the amount included
"""
scalar LnPaymentRequest
scalar LnPaymentSecret
enum LnPaymentStatus {
FAILED
PENDING
SETTLED
}
scalar LnPubkey
"""
Text field in a lightning payment transaction
"""
scalar Memo
type Mutation {
accountUpdateLevel(input: AccountUpdateLevelInput!): AccountDetailPayload!
accountUpdateStatus(input: AccountUpdateStatusInput!): AccountDetailPayload!
businessUpdateMapInfo(input: BusinessUpdateMapInfoInput!): AccountDetailPayload!
userLogin(input: UserLoginInput!): AuthTokenPayload!
userRequestAuthCode(input: UserRequestAuthCodeInput!): SuccessPayload!
}
"""
An address for an on-chain bitcoin destination
"""
scalar OnChainAddress
scalar OnChainTxHash
"""
An authentication code valid for a single use
"""
scalar OneTimeAuthCode
scalar PaymentHash
"""
Phone number which includes country code
"""
scalar Phone
"""
Price amount expressed in base/offset. To calculate, use: `base / 10^offset`
"""
type Price {
base: SafeInt!
currencyUnit: ExchangeCurrencyUnit!
formattedAmount: String!
offset: Int!
}
type Query {
accountDetailsByUserPhone(phone: Phone!): Account!
accountDetailsByUsername(username: Username!): Account!
allLevels: [AccountLevel!]!
lightningInvoice(hash: PaymentHash!): LightningInvoice!
lightningPayment(hash: PaymentHash!): LightningPayment!
transactionById(id: ID!): Transaction
transactionsByHash(hash: PaymentHash!): [Transaction]
}
"""
Non-fractional signed whole numeric value between -(2^53) + 1 and 2^53 - 1
"""
scalar SafeInt
"""
(Positive) Satoshi amount (i.g. quiz earning)
"""
scalar SatAmount
union SettlementVia = SettlementViaIntraLedger | SettlementViaLn | SettlementViaOnChain
type SettlementViaIntraLedger {
"""
Settlement destination: Could be null if the payee does not have a username
"""
counterPartyUsername: Username
counterPartyWalletId: WalletId
}
type SettlementViaLn {
paymentSecret: LnPaymentSecret
}
type SettlementViaOnChain {
transactionHash: OnChainTxHash!
}
type SuccessPayload {
errors: [Error!]!
success: Boolean
}
"""
Timestamp field, serialized as Unix time (the number of seconds since the Unix epoch)
"""
scalar Timestamp
"""
Give details about an individual transaction.
Galoy have a smart routing system which is automatically
settling intraledger when both the payer and payee use the same wallet
therefore it's possible the transactions is being initiated onchain
or with lightning but settled intraledger.
"""
type Transaction {
createdAt: Timestamp!
direction: TxDirection!
id: ID!
"""
From which protocol the payment has been initiated.
"""
initiationVia: InitiationVia!
memo: Memo
"""
Amount of sats sent or received.
"""
settlementAmount: SatAmount!
settlementFee: SatAmount!
"""
Price in USDCENT/SATS at time of settlement.
"""
settlementPrice: Price!
"""
To which protocol the payment has settled on.
"""
settlementVia: SettlementVia!
status: TxStatus!
}
enum TxDirection {
RECEIVE
SEND
}
enum TxStatus {
FAILURE
PENDING
SUCCESS
}
type User {
createdAt: Timestamp!
defaultAccount: Account!
id: ID!
language: Language!
phone: Phone!
}
input UserLoginInput {
code: OneTimeAuthCode!
phone: Phone!
}
input UserRequestAuthCodeInput {
phone: Phone!
}
"""
Unique identifier of a user
"""
scalar Username
"""
Unique identifier of a wallet
"""
scalar WalletId