stellar-base 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/generated/stellar/account_entry.rb +1 -1
- data/generated/stellar/account_flags.rb +1 -1
- data/generated/stellar/account_merge_result.rb +1 -1
- data/generated/stellar/account_merge_result_code.rb +1 -1
- data/generated/stellar/allow_trust_op/currency.rb +4 -4
- data/generated/stellar/allow_trust_op.rb +3 -3
- data/generated/stellar/allow_trust_result.rb +1 -1
- data/generated/stellar/allow_trust_result_code.rb +5 -4
- data/generated/stellar/bucket_entry.rb +1 -1
- data/generated/stellar/bucket_entry_type.rb +1 -1
- data/generated/stellar/change_trust_op.rb +1 -1
- data/generated/stellar/change_trust_result.rb +1 -1
- data/generated/stellar/change_trust_result_code.rb +1 -1
- data/generated/stellar/claim_offer_atom.rb +1 -1
- data/generated/stellar/create_offer_effect.rb +1 -1
- data/generated/stellar/create_offer_op.rb +1 -1
- data/generated/stellar/create_offer_result.rb +1 -1
- data/generated/stellar/create_offer_result_code.rb +1 -1
- data/generated/stellar/create_offer_success_result/offer.rb +1 -1
- data/generated/stellar/create_offer_success_result.rb +1 -1
- data/generated/stellar/currency/alpha_num.rb +22 -0
- data/generated/stellar/currency.rb +15 -7
- data/generated/stellar/currency_type.rb +5 -5
- data/generated/stellar/decorated_signature.rb +1 -1
- data/generated/stellar/dont_have.rb +1 -1
- data/generated/stellar/error.rb +1 -1
- data/generated/stellar/hello.rb +1 -1
- data/generated/stellar/inflation_payout.rb +1 -1
- data/generated/stellar/inflation_result.rb +1 -1
- data/generated/stellar/inflation_result_code.rb +1 -1
- data/generated/stellar/ledger_entry.rb +1 -1
- data/generated/stellar/ledger_entry_type.rb +1 -1
- data/generated/stellar/ledger_header.rb +1 -1
- data/generated/stellar/ledger_header_history_entry.rb +1 -1
- data/generated/stellar/ledger_key/account.rb +1 -1
- data/generated/stellar/ledger_key/offer.rb +1 -1
- data/generated/stellar/ledger_key/trust_line.rb +1 -1
- data/generated/stellar/ledger_key.rb +1 -1
- data/generated/stellar/memo.rb +11 -11
- data/generated/stellar/memo_type.rb +3 -3
- data/generated/stellar/message_type.rb +1 -1
- data/generated/stellar/offer_entry.rb +1 -1
- data/generated/stellar/operation/body.rb +1 -1
- data/generated/stellar/operation.rb +1 -1
- data/generated/stellar/operation_result/tr.rb +1 -1
- data/generated/stellar/operation_result.rb +1 -1
- data/generated/stellar/operation_result_code.rb +1 -1
- data/generated/stellar/operation_type.rb +1 -1
- data/generated/stellar/payment_op.rb +1 -1
- data/generated/stellar/payment_result.rb +1 -1
- data/generated/stellar/payment_result_code.rb +1 -1
- data/generated/stellar/payment_success_multi_result.rb +1 -1
- data/generated/stellar/peer_address.rb +1 -1
- data/generated/stellar/price.rb +1 -1
- data/generated/stellar/scp_ballot.rb +1 -1
- data/generated/stellar/scp_envelope.rb +1 -1
- data/generated/stellar/scp_quorum_set.rb +1 -1
- data/generated/stellar/scp_statement/pledges/prepare.rb +1 -1
- data/generated/stellar/scp_statement/pledges.rb +1 -1
- data/generated/stellar/scp_statement.rb +1 -1
- data/generated/stellar/scp_statement_type.rb +1 -1
- data/generated/stellar/set_options_op.rb +2 -2
- data/generated/stellar/set_options_result.rb +1 -1
- data/generated/stellar/set_options_result_code.rb +3 -3
- data/generated/stellar/signer.rb +1 -1
- data/generated/stellar/simple_payment_result.rb +1 -1
- data/generated/stellar/stellar_ballot.rb +1 -1
- data/generated/stellar/stellar_ballot_value.rb +1 -1
- data/generated/stellar/stellar_message.rb +1 -1
- data/generated/stellar/transaction.rb +2 -2
- data/generated/stellar/transaction_envelope.rb +1 -1
- data/generated/stellar/transaction_history_entry.rb +1 -1
- data/generated/stellar/transaction_history_result_entry.rb +1 -1
- data/generated/stellar/transaction_meta.rb +1 -1
- data/generated/stellar/transaction_result/result.rb +1 -1
- data/generated/stellar/transaction_result.rb +1 -1
- data/generated/stellar/transaction_result_code.rb +1 -1
- data/generated/stellar/transaction_result_pair.rb +1 -1
- data/generated/stellar/transaction_result_set.rb +1 -1
- data/generated/stellar/transaction_set.rb +1 -1
- data/generated/stellar/trust_line_entry.rb +4 -4
- data/generated/stellar/{iso_currency_issuer.rb → trust_line_flags.rb} +7 -7
- data/generated/stellar-base-generated.rb +4 -3
- data/lib/stellar/base/version.rb +1 -1
- data/lib/stellar/currency.rb +7 -7
- data/lib/stellar/payment_op.rb +1 -1
- data/xdr/Stellar-ledger-entries.x +9 -4
- data/xdr/Stellar-transaction.x +22 -21
- data/xdr/Stellar-types.x +9 -11
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9698e9734a6385fd6a52e3d8a4c9208c8f7c702b
|
|
4
|
+
data.tar.gz: 2355dd45c7a31c97f29b775f6ee58f25872faada
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d455190a25adb9e2c31982b60e0fd663c6ee3b724b832c8104a9c0de9127ac1ddb3e88e6a5b9676750b95c34dff8fad35477e3b58162fe749f2b8ef6bb0556c
|
|
7
|
+
data.tar.gz: 18608bceb72184220f144e928b4fd2b7a6febfa79ddb07f9cdbc8473d7ffe9a988685d10d1b4fc362241a70b882c69ec5ad1122d4d880ef6be03063757d5c98d
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -7,8 +7,8 @@ require 'xdr'
|
|
|
7
7
|
#
|
|
8
8
|
# union switch (CurrencyType type)
|
|
9
9
|
# {
|
|
10
|
-
# //
|
|
11
|
-
# case
|
|
10
|
+
# // CURRENCY_TYPE_NATIVE is not allowed
|
|
11
|
+
# case CURRENCY_TYPE_ALPHANUM:
|
|
12
12
|
# opaque currencyCode[4];
|
|
13
13
|
#
|
|
14
14
|
# // add other currency types here in the future
|
|
@@ -20,7 +20,7 @@ module Stellar
|
|
|
20
20
|
class Currency < XDR::Union
|
|
21
21
|
switch_on CurrencyType, :type
|
|
22
22
|
|
|
23
|
-
switch :
|
|
23
|
+
switch :currency_type_alphanum, :currency_code
|
|
24
24
|
|
|
25
25
|
attribute :currency_code, XDR::Opaque[4]
|
|
26
26
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -10,8 +10,8 @@ require 'xdr'
|
|
|
10
10
|
# AccountID trustor;
|
|
11
11
|
# union switch (CurrencyType type)
|
|
12
12
|
# {
|
|
13
|
-
# //
|
|
14
|
-
# case
|
|
13
|
+
# // CURRENCY_TYPE_NATIVE is not allowed
|
|
14
|
+
# case CURRENCY_TYPE_ALPHANUM:
|
|
15
15
|
# opaque currencyCode[4];
|
|
16
16
|
#
|
|
17
17
|
# // add other currency types here in the future
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -10,9 +10,10 @@ require 'xdr'
|
|
|
10
10
|
# // codes considered as "success" for the operation
|
|
11
11
|
# ALLOW_TRUST_SUCCESS = 0,
|
|
12
12
|
# // codes considered as "failure" for the operation
|
|
13
|
-
# ALLOW_TRUST_MALFORMED = -1,
|
|
14
|
-
# ALLOW_TRUST_NO_TRUST_LINE = -2,
|
|
15
|
-
# ALLOW_TRUST_TRUST_NOT_REQUIRED =
|
|
13
|
+
# ALLOW_TRUST_MALFORMED = -1, // currency is not CURRENCY_TYPE_ALPHANUM
|
|
14
|
+
# ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline
|
|
15
|
+
# ALLOW_TRUST_TRUST_NOT_REQUIRED =
|
|
16
|
+
# -3, // source account does not require trust
|
|
16
17
|
# ALLOW_TRUST_CANT_REVOKE = -4 // source account can't revoke trust
|
|
17
18
|
# };
|
|
18
19
|
#
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
|
3
|
+
|
|
4
|
+
require 'xdr'
|
|
5
|
+
|
|
6
|
+
# === xdr source ============================================================
|
|
7
|
+
#
|
|
8
|
+
# struct
|
|
9
|
+
# {
|
|
10
|
+
# opaque currencyCode[4];
|
|
11
|
+
# AccountID issuer;
|
|
12
|
+
# }
|
|
13
|
+
#
|
|
14
|
+
# ===========================================================================
|
|
15
|
+
module Stellar
|
|
16
|
+
class Currency
|
|
17
|
+
class AlphaNum < XDR::Struct
|
|
18
|
+
attribute :currency_code, XDR::Opaque[4]
|
|
19
|
+
attribute :issuer, AccountID
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -7,11 +7,15 @@ require 'xdr'
|
|
|
7
7
|
#
|
|
8
8
|
# union Currency switch (CurrencyType type)
|
|
9
9
|
# {
|
|
10
|
-
# case
|
|
10
|
+
# case CURRENCY_TYPE_NATIVE:
|
|
11
11
|
# void;
|
|
12
12
|
#
|
|
13
|
-
# case
|
|
14
|
-
#
|
|
13
|
+
# case CURRENCY_TYPE_ALPHANUM:
|
|
14
|
+
# struct
|
|
15
|
+
# {
|
|
16
|
+
# opaque currencyCode[4];
|
|
17
|
+
# AccountID issuer;
|
|
18
|
+
# } alphaNum;
|
|
15
19
|
#
|
|
16
20
|
# // add other currency types here in the future
|
|
17
21
|
# };
|
|
@@ -19,11 +23,15 @@ require 'xdr'
|
|
|
19
23
|
# ===========================================================================
|
|
20
24
|
module Stellar
|
|
21
25
|
class Currency < XDR::Union
|
|
26
|
+
include XDR::Namespace
|
|
27
|
+
|
|
28
|
+
autoload :AlphaNum
|
|
29
|
+
|
|
22
30
|
switch_on CurrencyType, :type
|
|
23
31
|
|
|
24
|
-
switch :
|
|
25
|
-
switch :
|
|
32
|
+
switch :currency_type_native
|
|
33
|
+
switch :currency_type_alphanum, :alpha_num
|
|
26
34
|
|
|
27
|
-
attribute :
|
|
35
|
+
attribute :alpha_num, AlphaNum
|
|
28
36
|
end
|
|
29
37
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -7,15 +7,15 @@ require 'xdr'
|
|
|
7
7
|
#
|
|
8
8
|
# enum CurrencyType
|
|
9
9
|
# {
|
|
10
|
-
#
|
|
11
|
-
#
|
|
10
|
+
# CURRENCY_TYPE_NATIVE = 0,
|
|
11
|
+
# CURRENCY_TYPE_ALPHANUM = 1
|
|
12
12
|
# };
|
|
13
13
|
#
|
|
14
14
|
# ===========================================================================
|
|
15
15
|
module Stellar
|
|
16
16
|
class CurrencyType < XDR::Enum
|
|
17
|
-
member :
|
|
18
|
-
member :
|
|
17
|
+
member :currency_type_native, 0
|
|
18
|
+
member :currency_type_alphanum, 1
|
|
19
19
|
|
|
20
20
|
seal
|
|
21
21
|
end
|
data/generated/stellar/error.rb
CHANGED
data/generated/stellar/hello.rb
CHANGED
data/generated/stellar/memo.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -7,16 +7,16 @@ require 'xdr'
|
|
|
7
7
|
#
|
|
8
8
|
# union Memo switch (MemoType type)
|
|
9
9
|
# {
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
10
|
+
# case MEMO_TYPE_NONE:
|
|
11
|
+
# void;
|
|
12
|
+
# case MEMO_TYPE_TEXT:
|
|
13
|
+
# string text<28>;
|
|
14
|
+
# case MEMO_TYPE_ID:
|
|
15
|
+
# uint64 id;
|
|
16
|
+
# case MEMO_TYPE_HASH:
|
|
17
|
+
# Hash hash; // the hash of what to pull from the content server
|
|
18
|
+
# case MEMO_TYPE_RETURN:
|
|
19
|
+
# Hash retHash; // the hash of the tx you are rejecting
|
|
20
20
|
# };
|
|
21
21
|
#
|
|
22
22
|
# ===========================================================================
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -9,9 +9,9 @@ require 'xdr'
|
|
|
9
9
|
# {
|
|
10
10
|
# MEMO_TYPE_NONE = 0,
|
|
11
11
|
# MEMO_TYPE_TEXT = 1,
|
|
12
|
-
#
|
|
12
|
+
# MEMO_TYPE_ID = 2,
|
|
13
13
|
# MEMO_TYPE_HASH = 3,
|
|
14
|
-
#
|
|
14
|
+
# MEMO_TYPE_RETURN = 4
|
|
15
15
|
# };
|
|
16
16
|
#
|
|
17
17
|
# ===========================================================================
|
data/generated/stellar/price.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -14,7 +14,7 @@ require 'xdr'
|
|
|
14
14
|
#
|
|
15
15
|
# Thresholds* thresholds; // update the thresholds for the account
|
|
16
16
|
#
|
|
17
|
-
#
|
|
17
|
+
# string32* homeDomain; // sets the home domain
|
|
18
18
|
#
|
|
19
19
|
# // Add, update or remove a signer for the account
|
|
20
20
|
# // signer is deleted if the weight is 0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -13,8 +13,8 @@ require 'xdr'
|
|
|
13
13
|
# SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer
|
|
14
14
|
# SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached
|
|
15
15
|
# SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags
|
|
16
|
-
# SET_OPTIONS_INVALID_INFLATION = -4
|
|
17
|
-
# SET_OPTIONS_CANT_CHANGE = -5
|
|
16
|
+
# SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist
|
|
17
|
+
# SET_OPTIONS_CANT_CHANGE = -5 // can no longer change this option
|
|
18
18
|
# };
|
|
19
19
|
#
|
|
20
20
|
# ===========================================================================
|
data/generated/stellar/signer.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -21,7 +21,7 @@ require 'xdr'
|
|
|
21
21
|
# uint32 minLedger;
|
|
22
22
|
# uint32 maxLedger;
|
|
23
23
|
#
|
|
24
|
-
#
|
|
24
|
+
# Memo memo;
|
|
25
25
|
#
|
|
26
26
|
# Operation operations<100>;
|
|
27
27
|
# };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -12,8 +12,8 @@ require 'xdr'
|
|
|
12
12
|
# int64 balance; // how much of this currency the user has.
|
|
13
13
|
# // Currency defines the unit for this;
|
|
14
14
|
#
|
|
15
|
-
# int64 limit;
|
|
16
|
-
#
|
|
15
|
+
# int64 limit; // balance cannot be above this
|
|
16
|
+
# uint32 flags; // see TrustLineFlags
|
|
17
17
|
# };
|
|
18
18
|
#
|
|
19
19
|
# ===========================================================================
|
|
@@ -23,6 +23,6 @@ module Stellar
|
|
|
23
23
|
attribute :currency, Currency
|
|
24
24
|
attribute :balance, Int64
|
|
25
25
|
attribute :limit, Int64
|
|
26
|
-
attribute :
|
|
26
|
+
attribute :flags, Uint32
|
|
27
27
|
end
|
|
28
28
|
end
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
5
5
|
|
|
6
6
|
# === xdr source ============================================================
|
|
7
7
|
#
|
|
8
|
-
#
|
|
8
|
+
# enum TrustLineFlags
|
|
9
9
|
# {
|
|
10
|
-
#
|
|
11
|
-
# AccountID issuer;
|
|
10
|
+
# AUTHORIZED_FLAG = 1 // issuer has authorized account to hold its credit
|
|
12
11
|
# };
|
|
13
12
|
#
|
|
14
13
|
# ===========================================================================
|
|
15
14
|
module Stellar
|
|
16
|
-
class
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
class TrustLineFlags < XDR::Enum
|
|
16
|
+
member :authorized_flag, 1
|
|
17
|
+
|
|
18
|
+
seal
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Automatically generated on 2015-05-
|
|
1
|
+
# Automatically generated on 2015-05-12T09:08:23-07:00
|
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
|
3
3
|
|
|
4
4
|
require 'xdr'
|
|
@@ -32,6 +32,9 @@ module Stellar
|
|
|
32
32
|
autoload :AccountFlags
|
|
33
33
|
|
|
34
34
|
autoload :AccountEntry
|
|
35
|
+
|
|
36
|
+
autoload :TrustLineFlags
|
|
37
|
+
|
|
35
38
|
autoload :TrustLineEntry
|
|
36
39
|
autoload :OfferEntry
|
|
37
40
|
|
|
@@ -155,8 +158,6 @@ module Stellar
|
|
|
155
158
|
|
|
156
159
|
autoload :CurrencyType
|
|
157
160
|
|
|
158
|
-
autoload :ISOCurrencyIssuer
|
|
159
|
-
|
|
160
161
|
autoload :Currency
|
|
161
162
|
|
|
162
163
|
autoload :Price
|
data/lib/stellar/base/version.rb
CHANGED
data/lib/stellar/currency.rb
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
module Stellar
|
|
2
2
|
class Currency
|
|
3
3
|
def self.native
|
|
4
|
-
new(:
|
|
4
|
+
new(:currency_type_native)
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
def self.iso4217(code, issuer)
|
|
8
8
|
raise ArgumentError, "Bad :issuer" unless issuer.is_a?(KeyPair)
|
|
9
|
-
|
|
10
|
-
new(:
|
|
9
|
+
an = AlphaNum.new({currency_code:code, issuer:issuer.public_key})
|
|
10
|
+
new(:currency_type_alphanum, an)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def to_s
|
|
14
|
-
if switch == CurrencyType.
|
|
14
|
+
if switch == CurrencyType.currency_type_native
|
|
15
15
|
"native"
|
|
16
16
|
else
|
|
17
17
|
encoder = Stellar::Util::Base58.stellar
|
|
18
|
-
issuer_address = encoder.check_encode(:account_id,
|
|
19
|
-
"#{
|
|
18
|
+
issuer_address = encoder.check_encode(:account_id,alpha_num.issuer)
|
|
19
|
+
"#{alpha_num.currency_code}/#{issuer_address}"
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ module Stellar
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def code
|
|
29
|
-
self.
|
|
29
|
+
self.alpha_num!.currency_code
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
end
|
data/lib/stellar/payment_op.rb
CHANGED
|
@@ -28,8 +28,8 @@ enum AccountFlags
|
|
|
28
28
|
|
|
29
29
|
/* AccountEntry
|
|
30
30
|
|
|
31
|
-
Main entry representing a user in Stellar. All transactions are
|
|
32
|
-
using an account.
|
|
31
|
+
Main entry representing a user in Stellar. All transactions are
|
|
32
|
+
performed using an account.
|
|
33
33
|
|
|
34
34
|
Other ledger entries created require an account.
|
|
35
35
|
|
|
@@ -60,6 +60,11 @@ struct AccountEntry
|
|
|
60
60
|
as well as the balance.
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
|
+
enum TrustLineFlags
|
|
64
|
+
{
|
|
65
|
+
AUTHORIZED_FLAG = 1 // issuer has authorized account to hold its credit
|
|
66
|
+
};
|
|
67
|
+
|
|
63
68
|
struct TrustLineEntry
|
|
64
69
|
{
|
|
65
70
|
AccountID accountID; // account this trustline belongs to
|
|
@@ -67,8 +72,8 @@ struct TrustLineEntry
|
|
|
67
72
|
int64 balance; // how much of this currency the user has.
|
|
68
73
|
// Currency defines the unit for this;
|
|
69
74
|
|
|
70
|
-
int64 limit;
|
|
71
|
-
|
|
75
|
+
int64 limit; // balance cannot be above this
|
|
76
|
+
uint32 flags; // see TrustLineFlags
|
|
72
77
|
};
|
|
73
78
|
|
|
74
79
|
/* OfferEntry
|
data/xdr/Stellar-transaction.x
CHANGED
|
@@ -86,7 +86,7 @@ struct SetOptionsOp
|
|
|
86
86
|
|
|
87
87
|
Thresholds* thresholds; // update the thresholds for the account
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
string32* homeDomain; // sets the home domain
|
|
90
90
|
|
|
91
91
|
// Add, update or remove a signer for the account
|
|
92
92
|
// signer is deleted if the weight is 0
|
|
@@ -120,8 +120,8 @@ struct AllowTrustOp
|
|
|
120
120
|
AccountID trustor;
|
|
121
121
|
union switch (CurrencyType type)
|
|
122
122
|
{
|
|
123
|
-
//
|
|
124
|
-
case
|
|
123
|
+
// CURRENCY_TYPE_NATIVE is not allowed
|
|
124
|
+
case CURRENCY_TYPE_ALPHANUM:
|
|
125
125
|
opaque currencyCode[4];
|
|
126
126
|
|
|
127
127
|
// add other currency types here in the future
|
|
@@ -180,23 +180,23 @@ enum MemoType
|
|
|
180
180
|
{
|
|
181
181
|
MEMO_TYPE_NONE = 0,
|
|
182
182
|
MEMO_TYPE_TEXT = 1,
|
|
183
|
-
|
|
183
|
+
MEMO_TYPE_ID = 2,
|
|
184
184
|
MEMO_TYPE_HASH = 3,
|
|
185
|
-
|
|
185
|
+
MEMO_TYPE_RETURN = 4
|
|
186
186
|
};
|
|
187
187
|
|
|
188
188
|
union Memo switch (MemoType type)
|
|
189
189
|
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
190
|
+
case MEMO_TYPE_NONE:
|
|
191
|
+
void;
|
|
192
|
+
case MEMO_TYPE_TEXT:
|
|
193
|
+
string text<28>;
|
|
194
|
+
case MEMO_TYPE_ID:
|
|
195
|
+
uint64 id;
|
|
196
|
+
case MEMO_TYPE_HASH:
|
|
197
|
+
Hash hash; // the hash of what to pull from the content server
|
|
198
|
+
case MEMO_TYPE_RETURN:
|
|
199
|
+
Hash retHash; // the hash of the tx you are rejecting
|
|
200
200
|
};
|
|
201
201
|
|
|
202
202
|
/* a transaction is a container for a set of operations
|
|
@@ -223,7 +223,7 @@ struct Transaction
|
|
|
223
223
|
uint32 minLedger;
|
|
224
224
|
uint32 maxLedger;
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
Memo memo;
|
|
227
227
|
|
|
228
228
|
Operation operations<100>;
|
|
229
229
|
};
|
|
@@ -357,8 +357,8 @@ enum SetOptionsResultCode
|
|
|
357
357
|
SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer
|
|
358
358
|
SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached
|
|
359
359
|
SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags
|
|
360
|
-
SET_OPTIONS_INVALID_INFLATION = -4
|
|
361
|
-
SET_OPTIONS_CANT_CHANGE = -5
|
|
360
|
+
SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist
|
|
361
|
+
SET_OPTIONS_CANT_CHANGE = -5 // can no longer change this option
|
|
362
362
|
};
|
|
363
363
|
|
|
364
364
|
union SetOptionsResult switch (SetOptionsResultCode code)
|
|
@@ -397,9 +397,10 @@ enum AllowTrustResultCode
|
|
|
397
397
|
// codes considered as "success" for the operation
|
|
398
398
|
ALLOW_TRUST_SUCCESS = 0,
|
|
399
399
|
// codes considered as "failure" for the operation
|
|
400
|
-
ALLOW_TRUST_MALFORMED = -1,
|
|
401
|
-
ALLOW_TRUST_NO_TRUST_LINE = -2,
|
|
402
|
-
ALLOW_TRUST_TRUST_NOT_REQUIRED =
|
|
400
|
+
ALLOW_TRUST_MALFORMED = -1, // currency is not CURRENCY_TYPE_ALPHANUM
|
|
401
|
+
ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline
|
|
402
|
+
ALLOW_TRUST_TRUST_NOT_REQUIRED =
|
|
403
|
+
-3, // source account does not require trust
|
|
403
404
|
ALLOW_TRUST_CANT_REVOKE = -4 // source account can't revoke trust
|
|
404
405
|
};
|
|
405
406
|
|
data/xdr/Stellar-types.x
CHANGED
|
@@ -24,23 +24,21 @@ typedef uint64 SequenceNumber;
|
|
|
24
24
|
|
|
25
25
|
enum CurrencyType
|
|
26
26
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
struct ISOCurrencyIssuer
|
|
32
|
-
{
|
|
33
|
-
opaque currencyCode[4];
|
|
34
|
-
AccountID issuer;
|
|
27
|
+
CURRENCY_TYPE_NATIVE = 0,
|
|
28
|
+
CURRENCY_TYPE_ALPHANUM = 1
|
|
35
29
|
};
|
|
36
30
|
|
|
37
31
|
union Currency switch (CurrencyType type)
|
|
38
32
|
{
|
|
39
|
-
case
|
|
33
|
+
case CURRENCY_TYPE_NATIVE:
|
|
40
34
|
void;
|
|
41
35
|
|
|
42
|
-
case
|
|
43
|
-
|
|
36
|
+
case CURRENCY_TYPE_ALPHANUM:
|
|
37
|
+
struct
|
|
38
|
+
{
|
|
39
|
+
opaque currencyCode[4];
|
|
40
|
+
AccountID issuer;
|
|
41
|
+
} alphaNum;
|
|
44
42
|
|
|
45
43
|
// add other currency types here in the future
|
|
46
44
|
};
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stellar-base
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Scott Fleckenstein
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-05-
|
|
11
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: xdr
|
|
@@ -221,6 +221,7 @@ files:
|
|
|
221
221
|
- generated/stellar/create_offer_success_result.rb
|
|
222
222
|
- generated/stellar/create_offer_success_result/offer.rb
|
|
223
223
|
- generated/stellar/currency.rb
|
|
224
|
+
- generated/stellar/currency/alpha_num.rb
|
|
224
225
|
- generated/stellar/currency_type.rb
|
|
225
226
|
- generated/stellar/decorated_signature.rb
|
|
226
227
|
- generated/stellar/dont_have.rb
|
|
@@ -229,7 +230,6 @@ files:
|
|
|
229
230
|
- generated/stellar/inflation_payout.rb
|
|
230
231
|
- generated/stellar/inflation_result.rb
|
|
231
232
|
- generated/stellar/inflation_result_code.rb
|
|
232
|
-
- generated/stellar/iso_currency_issuer.rb
|
|
233
233
|
- generated/stellar/ledger_entry.rb
|
|
234
234
|
- generated/stellar/ledger_entry_type.rb
|
|
235
235
|
- generated/stellar/ledger_header.rb
|
|
@@ -281,6 +281,7 @@ files:
|
|
|
281
281
|
- generated/stellar/transaction_result_set.rb
|
|
282
282
|
- generated/stellar/transaction_set.rb
|
|
283
283
|
- generated/stellar/trust_line_entry.rb
|
|
284
|
+
- generated/stellar/trust_line_flags.rb
|
|
284
285
|
- lib/stellar-base.rb
|
|
285
286
|
- lib/stellar/account_flags.rb
|
|
286
287
|
- lib/stellar/base.rb
|