-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoperation-create-close-deferred-payment-request.x
94 lines (74 loc) · 1.98 KB
/
operation-create-close-deferred-payment-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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
%#include "xdr/ledger-entries.h"
%#include "xdr/reviewable-request-close-deferred-payment.h"
namespace stellar
{
//: CreateCloseDeferredPaymentRequestOp is used to create `CLOSE_DEFERRED_PAYMENT` request
struct CreateCloseDeferredPaymentRequestOp
{
uint64 requestID;
//: Body of request which will be created
CloseDeferredPaymentRequest request;
uint32* allTasks;
//: reserved for the future use
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
}
ext;
};
//: Result codes of CreateAtomicSwapBidRequestOp
enum CreateCloseDeferredPaymentRequestResultCode
{
//: `CLOSE_DEFERRED_PAYMENT` request has either been successfully created
//: or auto approved
SUCCESS = 0,
UNDERFUNDED = -1,
INVALID_CREATOR_DETAILS = -2,
NOT_AUTHORIZED = -3,
DESTINATION_ACCOUNT_NOT_FOUND = -4,
INCORRECT_PRECISION = -5,
ASSET_MISMATCH = -6,
LINE_FULL = -7,
TASKS_NOT_FOUND = -8,
INVALID_AMOUNT = -9,
DESTINATION_BALANCE_NOT_FOUND = -10,
REQUEST_NOT_FOUND = -11
};
enum CloseDeferredPaymentEffect
{
CHARGED = 0,
DELETED = 1
};
struct CloseDeferredPaymentResult
{
uint64 deferredPaymentID;
AccountID destination;
BalanceID destinationBalance;
CloseDeferredPaymentEffect effect;
EmptyExt ext;
};
//: Success result of CreateASwapAskCreationRequestOp application
struct CreateCloseDeferredPaymentRequestSuccess
{
uint64 requestID;
bool fulfilled;
uint64 deferredPaymentID;
CloseDeferredPaymentResult* extendedResult;
//: reserved for the future use
union switch (LedgerVersion v)
{
case EMPTY_VERSION:
void;
} ext;
};
//: Result of CreateCloseDeferredPaymentRequestOp application
union CreateCloseDeferredPaymentRequestResult switch (CreateCloseDeferredPaymentRequestResultCode code)
{
case SUCCESS:
//: is used to pass useful fields after successful operation applying
CreateCloseDeferredPaymentRequestSuccess success;
default:
void;
};
}