xdr/Stellar-transaction.x in stellar-base-0.0.20 vs xdr/Stellar-transaction.x in stellar-base-0.1.0
- old
+ new
@@ -1,10 +1,10 @@
// 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 "generated/Stellar-ledger-entries.h"
+%#include "xdr/Stellar-ledger-entries.h"
namespace stellar
{
struct DecoratedSignature
@@ -26,11 +26,11 @@
ACCOUNT_MERGE = 8,
INFLATION = 9
};
/* CreateAccount
-Funds a new account with the specified starting balance
+Creates and funds a new account with the specified starting balance.
Threshold: med
Result: CreateAccountResult
@@ -42,46 +42,46 @@
int64 startingBalance; // amount they end up with
};
/* Payment
- send an amount to a destination account.
+ Send an amount in specified asset to a destination account.
Threshold: med
Result: PaymentResult
*/
struct PaymentOp
{
AccountID destination; // recipient of the payment
- Currency currency; // what they end up with
+ Asset asset; // what they end up with
int64 amount; // amount they end up with
};
/* PathPayment
send an amount to a destination account through a path.
-(up to sendMax, sendCurrency)
+(up to sendMax, sendAsset)
(X0, Path[0]) .. (Xn, Path[n])
-(destAmount, destCurrency)
+(destAmount, destAsset)
Threshold: med
Result: PathPaymentResult
*/
struct PathPaymentOp
{
- Currency sendCurrency; // currency we pay with
- int64 sendMax; // the maximum amount of sendCurrency to
+ Asset sendAsset; // asset we pay with
+ int64 sendMax; // the maximum amount of sendAsset to
// send (excluding fees).
// The operation will fail if can't be met
AccountID destination; // recipient of the payment
- Currency destCurrency; // what they end up with
+ Asset destAsset; // what they end up with
int64 destAmount; // amount they end up with
- Currency path<5>; // additional hops it must go through to get there
+ Asset path<5>; // additional hops it must go through to get there
};
/* Creates, updates or deletes an offer
Threshold: med
@@ -89,14 +89,14 @@
Result: ManageOfferResult
*/
struct ManageOfferOp
{
- Currency takerGets;
- Currency takerPays;
- int64 amount; // amount taker gets. if set to 0, delete the offer
- Price price; // =takerPaysAmount/takerGetsAmount
+ Asset selling;
+ Asset buying;
+ int64 amount; // amount being sold. if set to 0, delete the offer
+ Price price; // price of thing being sold in terms of what you are buying
// 0=create a new offer, otherwise edit an existing offer
uint64 offerID;
};
@@ -107,14 +107,14 @@
Result: CreatePassiveOfferResult
*/
struct CreatePassiveOfferOp
{
- Currency takerGets;
- Currency takerPays;
- int64 amount; // amount taker gets. if set to 0, delete the offer
- Price price; // =takerPaysAmount/takerGetsAmount
+ Asset selling; // A
+ Asset buying; // B
+ int64 amount; // amount taker gets. if set to 0, delete the offer
+ Price price; // cost of A in terms of B
};
/* Set Account Options
updates "AccountEntry" fields.
@@ -152,37 +152,40 @@
Result: ChangeTrustResult
*/
struct ChangeTrustOp
{
- Currency line;
+ Asset line;
// if limit is set to 0, deletes the trust line
int64 limit;
};
/* Updates the "authorized" flag of an existing trust line
- this is called by the issuer of the related currency.
+ this is called by the issuer of the related asset.
note that authorize can only be set (and not cleared) if
the issuer account does not have the AUTH_REVOCABLE_FLAG set
Threshold: low
Result: AllowTrustResult
*/
struct AllowTrustOp
{
AccountID trustor;
- union switch (CurrencyType type)
+ union switch (AssetType type)
{
- // CURRENCY_TYPE_NATIVE is not allowed
- case CURRENCY_TYPE_ALPHANUM:
- opaque currencyCode[4];
+ // ASSET_TYPE_NATIVE is not allowed
+ case ASSET_TYPE_CREDIT_ALPHANUM4:
+ opaque assetCode4[4];
- // add other currency types here in the future
+ case ASSET_TYPE_CREDIT_ALPHANUM12:
+ opaque assetCode12[12];
+
+ // add other asset types here in the future
}
- currency;
+ asset;
bool authorize;
};
/* Inflation
@@ -314,16 +317,16 @@
{
// emited to identify the offer
AccountID offerOwner; // Account that owns the offer
uint64 offerID;
- // amount and currency taken from the owner
- Currency currencyClaimed;
+ // amount and asset taken from the owner
+ Asset assetClaimed;
int64 amountClaimed;
- // amount and currencysent to the owner
- Currency currencySend;
+ // amount and assetsent to the owner
+ Asset assetSend;
int64 amountSend;
};
/******* CreateAccount Result ********/
@@ -359,12 +362,12 @@
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_NO_TRUST = -6, // destination missing a trust line for asset
+ PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset
PAYMENT_LINE_FULL = -8 // destination would go above their limit
};
union PaymentResult switch (PaymentResultCode code)
{
@@ -385,21 +388,21 @@
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_NO_TRUST = -6, // dest missing a trust line for asset
+ PATH_PAYMENT_NOT_AUTHORIZED = -7, // dest not authorized to hold asset
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;
- Currency currency;
+ Asset asset;
int64 amount;
};
union PathPaymentResult switch (PathPaymentResultCode code)
{
@@ -519,10 +522,10 @@
enum AllowTrustResultCode
{
// codes considered as "success" for the operation
ALLOW_TRUST_SUCCESS = 0,
// codes considered as "failure" for the operation
- ALLOW_TRUST_MALFORMED = -1, // currency is not CURRENCY_TYPE_ALPHANUM
+ ALLOW_TRUST_MALFORMED = -1, // asset is not ASSET_TYPE_ALPHANUM
ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline
// source account does not require trust
ALLOW_TRUST_TRUST_NOT_REQUIRED = -3,
ALLOW_TRUST_CANT_REVOKE = -4 // source account can't revoke trust
};