-
Notifications
You must be signed in to change notification settings - Fork 1
/
Stellar-operation-direct-debit.x
66 lines (57 loc) · 1.6 KB
/
Stellar-operation-direct-debit.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
// 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"
%#include "xdr/Stellar-operation-payment.h"
namespace stellar
{
struct DirectDebitOp
{
AccountID from;
PaymentOp paymentOp;
// reserved for future use
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
/******* Payment Result ********/
enum DirectDebitResultCode
{
// codes considered as "success" for the operation
SUCCESS = 0, // payment successfuly completed
// codes considered as "failure" for the operation
MALFORMED = -1, // bad input
UNDERFUNDED = -2, // not enough funds in source account
LINE_FULL = -3, // destination would go above their limit
FEE_MISMATCHED = -4, // fee is not equal to expected fee
BALANCE_NOT_FOUND = -5, // destination balance not found
BALANCE_ACCOUNT_MISMATCHED = -6,
BALANCE_ASSETS_MISMATCHED = -7,
SRC_BALANCE_NOT_FOUND = -8, // source balance not found
REFERENCE_DUPLICATION = -9,
STATS_OVERFLOW = -10,
LIMITS_EXCEEDED = -11,
NOT_ALLOWED_BY_ASSET_POLICY = -12,
NO_TRUST = -13
};
struct DirectDebitSuccess {
PaymentResponse paymentResponse;
// reserved for future use
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
union DirectDebitResult switch (DirectDebitResultCode code)
{
case SUCCESS:
DirectDebitSuccess success;
default:
void;
};
}