-
Notifications
You must be signed in to change notification settings - Fork 1
/
Stellar-operation-create-withdrawal-request.x
77 lines (60 loc) · 2.05 KB
/
Stellar-operation-create-withdrawal-request.x
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
// Copyright 2015 Stellar Development Foundation and contributors. Licensed
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
%#include "xdr/Stellar-ledger-entries.h"
namespace stellar
{
/* CreateWithdrawalRequestOp
Creates withdrawal request
Threshold: high
Result: CreateWithdrawalRequestResult
*/
struct CreateWithdrawalRequestOp
{
WithdrawalRequest request;
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
/******* CreateWithdrawalRequest Result ********/
enum CreateWithdrawalRequestResultCode
{
// codes considered as "success" for the operation
SUCCESS = 0,
// codes considered as "failure" for the operation
INVALID_AMOUNT = -1, // amount is 0
INVALID_EXTERNAL_DETAILS = -2, // external details size exceeds max allowed
BALANCE_NOT_FOUND = -3, // balance not found
ASSET_IS_NOT_WITHDRAWABLE = -4, // asset is not withdrawable
CONVERSION_PRICE_IS_NOT_AVAILABLE = -5, // failed to find conversion price - conversion is not allowed
FEE_MISMATCHED = -6, // expected fee does not match calculated fee
CONVERSION_OVERFLOW = -7, // overflow during converting source asset to dest asset
CONVERTED_AMOUNT_MISMATCHED = -8, // expected converted amount passed by user, does not match calculated
BALANCE_LOCK_OVERFLOW = -9, // overflow while tried to lock amount
UNDERFUNDED = -10, // insufficient balance to perform operation
INVALID_UNIVERSAL_AMOUNT = -11, // non-zero universal amount
STATS_OVERFLOW = -12, // statistics overflowed by the operation
LIMITS_EXCEEDED = -13, // withdraw exceeds limits for source account
INVALID_PRE_CONFIRMATION_DETAILS = -14, // it's not allowed to pass pre confirmation details
LOWER_BOUND_NOT_EXCEEDED = -15
};
struct CreateWithdrawalSuccess {
uint64 requestID;
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
union CreateWithdrawalRequestResult switch (CreateWithdrawalRequestResultCode code)
{
case SUCCESS:
CreateWithdrawalSuccess success;
default:
void;
};
}