xdr/Stellar-transaction.x in stellar-base-0.0.18 vs xdr/Stellar-transaction.x in stellar-base-0.0.19
- old
+ new
@@ -7,12 +7,12 @@
namespace stellar
{
struct DecoratedSignature
{
- opaque hint[4]; // first 4 bytes of the public key, used as a hint
- uint512 signature; // actual signature
+ SignatureHint hint; // first 4 bytes of the public key, used as a hint
+ Signature signature; // actual signature
};
enum OperationType
{
CREATE_ACCOUNT = 0,
@@ -130,11 +130,15 @@
AccountID* inflationDest; // sets the inflation destination
uint32* clearFlags; // which flags to clear
uint32* setFlags; // which flags to set
- Thresholds* thresholds; // update the thresholds for the account
+ // account threshold manipulation
+ uint32* masterWeight; // weight of the master account
+ uint32* lowThreshold;
+ uint32* medThreshold;
+ uint32* highThreshold;
string32* homeDomain; // sets the home domain
// Add, update or remove a signer for the account
// signer is deleted if the weight is 0
@@ -200,11 +204,11 @@
/* An operation is the lowest unit of work that a transaction does */
struct Operation
{
// sourceAccount is the account used to run the operation
- // if not set, the runtime defaults to "account" specified at
+ // if not set, the runtime defaults to "sourceAccount" specified at
// the transaction level
AccountID* sourceAccount;
union switch (OperationType type)
{
@@ -223,11 +227,11 @@
case CHANGE_TRUST:
ChangeTrustOp changeTrustOp;
case ALLOW_TRUST:
AllowTrustOp allowTrustOp;
case ACCOUNT_MERGE:
- uint256 destination;
+ AccountID destination;
case INFLATION:
void;
}
body;
};
@@ -273,21 +277,29 @@
{
// account used to run the transaction
AccountID sourceAccount;
// the fee the sourceAccount will pay
- int32 fee;
+ uint32 fee;
// sequence number to consume in the account
SequenceNumber seqNum;
// validity range (inclusive) for the last ledger close time
TimeBounds* timeBounds;
Memo memo;
Operation operations<100>;
+
+ // reserved for future use
+ union switch (int v)
+ {
+ case 0:
+ void;
+ }
+ ext;
};
/* A TransactionEnvelope wraps a transaction with signatures. */
struct TransactionEnvelope
{
@@ -319,15 +331,15 @@
{
// codes considered as "success" for the operation
CREATE_ACCOUNT_SUCCESS = 0, // account was created
// codes considered as "failure" for the operation
- CREATE_ACCOUNT_MALFORMED = 1, // invalid destination
- CREATE_ACCOUNT_UNDERFUNDED = 2, // not enough funds in source account
+ CREATE_ACCOUNT_MALFORMED = -1, // invalid destination
+ CREATE_ACCOUNT_UNDERFUNDED = -2, // not enough funds in source account
CREATE_ACCOUNT_LOW_RESERVE =
- 3, // would create an account below the min reserve
- CREATE_ACCOUNT_ALREADY_EXIST = 4 // account already exists
+ -3, // would create an account below the min reserve
+ CREATE_ACCOUNT_ALREADY_EXIST = -4 // account already exists
};
union CreateAccountResult switch (CreateAccountResultCode code)
{
case CREATE_ACCOUNT_SUCCESS:
@@ -342,16 +354,18 @@
{
// codes considered as "success" for the operation
PAYMENT_SUCCESS = 0, // payment successfuly completed
// codes considered as "failure" for the operation
- PAYMENT_MALFORMED = -1, // bad input
- PAYMENT_UNDERFUNDED = -2, // not enough funds in source account
- PAYMENT_NO_DESTINATION = -3, // destination account does not exist
- PAYMENT_NO_TRUST = -4, // destination missing a trust line for currency
- PAYMENT_NOT_AUTHORIZED = -5, // destination not authorized to hold currency
- PAYMENT_LINE_FULL = -6 // destination would go above their limit
+ PAYMENT_MALFORMED = -1, // bad input
+ PAYMENT_UNDERFUNDED = -2, // not enough funds in source account
+ PAYMENT_SRC_NO_TRUST = -3, // no trust line on source account
+ PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer
+ PAYMENT_NO_DESTINATION = -5, // destination account does not exist
+ PAYMENT_NO_TRUST = -6, // destination missing a trust line for currency
+ PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold currency
+ PAYMENT_LINE_FULL = -8 // destination would go above their limit
};
union PaymentResult switch (PaymentResultCode code)
{
case PAYMENT_SUCCESS:
@@ -366,19 +380,20 @@
{
// codes considered as "success" for the operation
PATH_PAYMENT_SUCCESS = 0, // success
// codes considered as "failure" for the operation
- PATH_PAYMENT_MALFORMED = -1, // bad input
- PATH_PAYMENT_UNDERFUNDED = -2, // not enough funds in source account
- PATH_PAYMENT_NO_DESTINATION = -3, // destination account does not exist
- PATH_PAYMENT_NO_TRUST = -4, // destination missing a trust line for currency
- PATH_PAYMENT_NOT_AUTHORIZED =
- -5, // destination not authorized to hold currency
- PATH_PAYMENT_LINE_FULL = -6, // destination would go above their limit
- PATH_PAYMENT_TOO_FEW_OFFERS = -7, // not enough offers to satisfy path
- PATH_PAYMENT_OVER_SENDMAX = -8 // could not satisfy sendmax
+ PATH_PAYMENT_MALFORMED = -1, // bad input
+ PATH_PAYMENT_UNDERFUNDED = -2, // not enough funds in source account
+ PATH_PAYMENT_SRC_NO_TRUST = -3, // no trust line on source account
+ PATH_PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer
+ PATH_PAYMENT_NO_DESTINATION = -5, // destination account does not exist
+ PATH_PAYMENT_NO_TRUST = -6, // dest missing a trust line for currency
+ PATH_PAYMENT_NOT_AUTHORIZED = -7, // dest not authorized to hold currency
+ PATH_PAYMENT_LINE_FULL = -8, // dest would go above their limit
+ PATH_PAYMENT_TOO_FEW_OFFERS = -9, // not enough offers to satisfy path
+ PATH_PAYMENT_OVER_SENDMAX = -10 // could not satisfy sendmax
};
struct SimplePaymentResult
{
AccountID destination;
@@ -404,22 +419,24 @@
{
// codes considered as "success" for the operation
MANAGE_OFFER_SUCCESS = 0,
// codes considered as "failure" for the operation
- MANAGE_OFFER_MALFORMED = -1, // generated offer would be invalid
- MANAGE_OFFER_NO_TRUST = -2, // can't hold what it's buying
- MANAGE_OFFER_NOT_AUTHORIZED = -3, // not authorized to sell or buy
- MANAGE_OFFER_LINE_FULL = -4, // can't receive more of what it's buying
- MANAGE_OFFER_UNDERFUNDED = -5, // doesn't hold what it's trying to sell
- MANAGE_OFFER_CROSS_SELF = -6, // would cross an offer from the same user
+ MANAGE_OFFER_MALFORMED = -1, // generated offer would be invalid
+ MANAGE_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling
+ MANAGE_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying
+ MANAGE_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell
+ MANAGE_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy
+ MANAGE_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
+ MANAGE_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
+ MANAGE_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
// update errors
- MANAGE_OFFER_NOT_FOUND = -7, // offerID does not match an existing offer
- MANAGE_OFFER_MISMATCH = -8, // currencies don't match offer
+ MANAGE_OFFER_NOT_FOUND = -9, // offerID does not match an existing offer
+ MANAGE_OFFER_MISMATCH = -10, // currencies don't match offer
- MANAGE_OFFER_LOW_RESERVE = -9 // not enough funds to create a new Offer
+ MANAGE_OFFER_LOW_RESERVE = -11 // not enough funds to create a new Offer
};
enum ManageOfferEffect
{
MANAGE_OFFER_CREATED = 0,
@@ -459,13 +476,15 @@
SET_OPTIONS_SUCCESS = 0,
// codes considered as "failure" for the operation
SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer
SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached
SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags
- SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist
- SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option
- SET_OPTIONS_UNKNOWN_FLAG = -6 // can't set an unknown flag
+ SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist
+ SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option
+ SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag
+ SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold
+ SET_OPTIONS_BAD_SIGNER = -8 // signer cannot be masterkey
};
union SetOptionsResult switch (SetOptionsResultCode code)
{
case SET_OPTIONS_SUCCESS:
@@ -546,20 +565,20 @@
INFLATION_SUCCESS = 0,
// codes considered as "failure" for the operation
INFLATION_NOT_TIME = -1
};
-struct inflationPayout // or use PaymentResultAtom to limit types?
+struct InflationPayout // or use PaymentResultAtom to limit types?
{
AccountID destination;
int64 amount;
};
union InflationResult switch (InflationResultCode code)
{
case INFLATION_SUCCESS:
- inflationPayout payouts<>;
+ InflationPayout payouts<>;
default:
void;
};
/* High level Operation Result */
@@ -633,7 +652,15 @@
OperationResult results<>;
default:
void;
}
result;
+
+ // reserved for future use
+ union switch (int v)
+ {
+ case 0:
+ void;
+ }
+ ext;
};
}