-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwithdrawal.graphql
More file actions
68 lines (62 loc) · 1.7 KB
/
withdrawal.graphql
File metadata and controls
68 lines (62 loc) · 1.7 KB
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
# Full withdrawal flow — 3 steps
# Requires: x-access-token header
#
# Step 1: Get available currencies and networks with fees
# Step 2: Request email confirmation code
# Step 3: Execute withdrawal with OTP code
#
# IMPORTANT: withdrawal requires email OTP confirmation.
# The OTP is sent to the email registered on your Stake account.
# Without the OTP, createWithdrawal will return an error.
# ── Step 1: Get withdrawal settings (currencies + chains + fees) ──────────────
query GetWithdrawalSettings {
getCurrencySettings {
currency
chains {
name
withdrawalFee
minWithdrawal
maxWithdrawal
}
}
}
# ── Step 2: Send email OTP ────────────────────────────────────────────────────
# Call this before createWithdrawal to trigger the email.
# Use the address and currency/chain you plan to withdraw to.
mutation SendWithdrawalEmail(
$currency: CurrencyEnum!
$chain: String!
$address: String!
$amount: Float!
) {
sendWalletWithdrawalEmail(
currency: $currency
chain: $chain
address: $address
amount: $amount
) {
success
}
}
# ── Step 3: Create withdrawal ─────────────────────────────────────────────────
mutation CreateWithdrawal(
$amount: Float!
$currency: CurrencyEnum!
$address: String!
$chain: String!
$otp: String!
) {
createWithdrawal(
amount: $amount
currency: $currency
address: $address
chain: $chain
otp: $otp
) {
id
hash
amount
currency
createdAt
}
}