stellar-base 0.0.12 → 0.0.13
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/examples/offer.rb +1 -1
- data/generated/stellar/account_flags.rb +6 -1
- data/generated/stellar/allow_trust_result_code.rb +4 -4
- data/generated/stellar/create_passive_offer_op.rb +24 -0
- data/generated/stellar/ledger_header.rb +5 -1
- data/generated/stellar/manage_offer_effect.rb +24 -0
- data/generated/stellar/{create_offer_op.rb → manage_offer_op.rb} +3 -3
- data/generated/stellar/manage_offer_result.rb +26 -0
- data/generated/stellar/manage_offer_result_code.rb +44 -0
- data/generated/stellar/{create_offer_success_result → manage_offer_success_result}/offer.rb +8 -8
- data/generated/stellar/{create_offer_success_result.rb → manage_offer_success_result.rb} +6 -6
- data/generated/stellar/offer_entry.rb +3 -1
- data/generated/stellar/offer_entry_flags.rb +21 -0
- data/generated/stellar/operation/body.rb +23 -19
- data/generated/stellar/operation.rb +5 -3
- data/generated/stellar/operation_result/tr.rb +25 -21
- data/generated/stellar/operation_result.rb +5 -3
- data/generated/stellar/operation_type.rb +18 -16
- data/generated/stellar/scp_quorum_set.rb +4 -2
- data/generated/stellar/set_options_result_code.rb +4 -2
- data/generated/stellar/trust_line_flags.rb +3 -2
- data/generated/stellar-base-generated.rb +10 -11
- data/lib/stellar/base/version.rb +1 -1
- data/lib/stellar/operation.rb +21 -3
- data/lib/stellar/transaction.rb +8 -2
- data/xdr/SCPXDR.x +7 -1
- data/xdr/Stellar-ledger-entries.x +15 -1
- data/xdr/Stellar-ledger.x +3 -0
- data/xdr/Stellar-transaction.x +63 -39
- data/xdr/Stellar-types.x +0 -5
- metadata +9 -7
- data/generated/stellar/create_offer_effect.rb +0 -24
- data/generated/stellar/create_offer_result.rb +0 -26
- data/generated/stellar/create_offer_result_code.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f51401d7010310f5feb34a26a2a20542ad106eb
|
4
|
+
data.tar.gz: 76596cf728cf008b6fd9756dc50e68c3dc2843ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba86a0c9b6acec0cd7b54f5bc83daf48627eee8bf88bea61820a861a3f22b0d49352a54dd836dcf5874df77107548016e0be7d9be02bed2b3b72a12c48a7d95d
|
7
|
+
data.tar.gz: 9dd22660277d073d5a52f7f3738f74facba9a521ded608155714bc623fe687b6fbd6a4b4abfc3fd82cc08618390ed403f976ad341a57326f55f398163500376a
|
data/examples/offer.rb
CHANGED
@@ -65,7 +65,7 @@ submit master, Stellar::Transaction.payment({
|
|
65
65
|
amount: [:alphanum, "USD\x00", master, 1000]
|
66
66
|
})
|
67
67
|
|
68
|
-
submit master, Stellar::Transaction.
|
68
|
+
submit master, Stellar::Transaction.manage_offer({
|
69
69
|
account: destination,
|
70
70
|
sequence: destination_sequence + 3
|
71
71
|
taker_gets: [:alphanum, "USD\x00", usd_gateway],
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -7,7 +7,12 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# enum AccountFlags
|
9
9
|
# { // masks for each flag
|
10
|
+
#
|
11
|
+
# // if set, TrustLines are created with authorized set to "false"
|
12
|
+
# // requiring the issuer to set it for each TrustLine
|
10
13
|
# AUTH_REQUIRED_FLAG = 0x1,
|
14
|
+
# // if set, the authorized flag in TrustTines can be cleared
|
15
|
+
# // otherwise, authorization cannot be revoked
|
11
16
|
# AUTH_REVOCABLE_FLAG = 0x2
|
12
17
|
# };
|
13
18
|
#
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -12,9 +12,9 @@ require 'xdr'
|
|
12
12
|
# // codes considered as "failure" for the operation
|
13
13
|
# ALLOW_TRUST_MALFORMED = -1, // currency is not CURRENCY_TYPE_ALPHANUM
|
14
14
|
# ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline
|
15
|
-
#
|
16
|
-
#
|
17
|
-
# ALLOW_TRUST_CANT_REVOKE = -4
|
15
|
+
# // source account does not require trust
|
16
|
+
# ALLOW_TRUST_TRUST_NOT_REQUIRED = -3,
|
17
|
+
# ALLOW_TRUST_CANT_REVOKE = -4 // source account can't revoke trust
|
18
18
|
# };
|
19
19
|
#
|
20
20
|
# ===========================================================================
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct CreatePassiveOfferOp
|
9
|
+
# {
|
10
|
+
# Currency takerGets;
|
11
|
+
# Currency takerPays;
|
12
|
+
# int64 amount; // amount taker gets. if set to 0, delete the offer
|
13
|
+
# Price price; // =takerPaysAmount/takerGetsAmount
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class CreatePassiveOfferOp < XDR::Struct
|
19
|
+
attribute :taker_gets, Currency
|
20
|
+
attribute :taker_pays, Currency
|
21
|
+
attribute :amount, Int64
|
22
|
+
attribute :price, Price
|
23
|
+
end
|
24
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -24,6 +24,9 @@ require 'xdr'
|
|
24
24
|
#
|
25
25
|
# int32 baseFee; // base fee per operation in stroops
|
26
26
|
# int32 baseReserve; // account base reserve in stroops
|
27
|
+
#
|
28
|
+
# Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back
|
29
|
+
# // in time without walking the chain back ledger by ledger
|
27
30
|
# };
|
28
31
|
#
|
29
32
|
# ===========================================================================
|
@@ -41,5 +44,6 @@ module Stellar
|
|
41
44
|
attribute :id_pool, Uint64
|
42
45
|
attribute :base_fee, Int32
|
43
46
|
attribute :base_reserve, Int32
|
47
|
+
attribute :skip_list, XDR::Array[Hash, 4]
|
44
48
|
end
|
45
49
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum ManageOfferEffect
|
9
|
+
# {
|
10
|
+
# MANAGE_OFFER_CREATED = 0,
|
11
|
+
# MANAGE_OFFER_UPDATED = 1,
|
12
|
+
# MANAGE_OFFER_DELETED = 2
|
13
|
+
# };
|
14
|
+
#
|
15
|
+
# ===========================================================================
|
16
|
+
module Stellar
|
17
|
+
class ManageOfferEffect < XDR::Enum
|
18
|
+
member :manage_offer_created, 0
|
19
|
+
member :manage_offer_updated, 1
|
20
|
+
member :manage_offer_deleted, 2
|
21
|
+
|
22
|
+
seal
|
23
|
+
end
|
24
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-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
|
-
# struct
|
8
|
+
# struct ManageOfferOp
|
9
9
|
# {
|
10
10
|
# Currency takerGets;
|
11
11
|
# Currency takerPays;
|
@@ -18,7 +18,7 @@ require 'xdr'
|
|
18
18
|
#
|
19
19
|
# ===========================================================================
|
20
20
|
module Stellar
|
21
|
-
class
|
21
|
+
class ManageOfferOp < XDR::Struct
|
22
22
|
attribute :taker_gets, Currency
|
23
23
|
attribute :taker_pays, Currency
|
24
24
|
attribute :amount, Int64
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union ManageOfferResult switch (ManageOfferResultCode code)
|
9
|
+
# {
|
10
|
+
# case MANAGE_OFFER_SUCCESS:
|
11
|
+
# ManageOfferSuccessResult success;
|
12
|
+
# default:
|
13
|
+
# void;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class ManageOfferResult < XDR::Union
|
19
|
+
switch_on ManageOfferResultCode, :code
|
20
|
+
|
21
|
+
switch :manage_offer_success, :success
|
22
|
+
switch :default
|
23
|
+
|
24
|
+
attribute :success, ManageOfferSuccessResult
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum ManageOfferResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# MANAGE_OFFER_SUCCESS = 0,
|
12
|
+
#
|
13
|
+
# // codes considered as "failure" for the operation
|
14
|
+
# MANAGE_OFFER_MALFORMED = -1, // generated offer would be invalid
|
15
|
+
# MANAGE_OFFER_NO_TRUST = -2, // can't hold what it's buying
|
16
|
+
# MANAGE_OFFER_NOT_AUTHORIZED = -3, // not authorized to sell or buy
|
17
|
+
# MANAGE_OFFER_LINE_FULL = -4, // can't receive more of what it's buying
|
18
|
+
# MANAGE_OFFER_UNDERFUNDED = -5, // doesn't hold what it's trying to sell
|
19
|
+
# MANAGE_OFFER_CROSS_SELF = -6, // would cross an offer from the same user
|
20
|
+
#
|
21
|
+
# // update errors
|
22
|
+
# MANAGE_OFFER_NOT_FOUND = -7, // offerID does not match an existing offer
|
23
|
+
# MANAGE_OFFER_MISMATCH = -8, // currencies don't match offer
|
24
|
+
#
|
25
|
+
# MANAGE_OFFER_LOW_RESERVE = -9 // not enough funds to create a new Offer
|
26
|
+
# };
|
27
|
+
#
|
28
|
+
# ===========================================================================
|
29
|
+
module Stellar
|
30
|
+
class ManageOfferResultCode < XDR::Enum
|
31
|
+
member :manage_offer_success, 0
|
32
|
+
member :manage_offer_malformed, -1
|
33
|
+
member :manage_offer_no_trust, -2
|
34
|
+
member :manage_offer_not_authorized, -3
|
35
|
+
member :manage_offer_line_full, -4
|
36
|
+
member :manage_offer_underfunded, -5
|
37
|
+
member :manage_offer_cross_self, -6
|
38
|
+
member :manage_offer_not_found, -7
|
39
|
+
member :manage_offer_mismatch, -8
|
40
|
+
member :manage_offer_low_reserve, -9
|
41
|
+
|
42
|
+
seal
|
43
|
+
end
|
44
|
+
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-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
|
-
# union switch (
|
8
|
+
# union switch (ManageOfferEffect effect)
|
9
9
|
# {
|
10
|
-
# case
|
11
|
-
# case
|
10
|
+
# case MANAGE_OFFER_CREATED:
|
11
|
+
# case MANAGE_OFFER_UPDATED:
|
12
12
|
# OfferEntry offer;
|
13
13
|
# default:
|
14
14
|
# void;
|
@@ -16,12 +16,12 @@ require 'xdr'
|
|
16
16
|
#
|
17
17
|
# ===========================================================================
|
18
18
|
module Stellar
|
19
|
-
class
|
19
|
+
class ManageOfferSuccessResult
|
20
20
|
class Offer < XDR::Union
|
21
|
-
switch_on
|
21
|
+
switch_on ManageOfferEffect, :effect
|
22
22
|
|
23
|
-
switch :
|
24
|
-
switch :
|
23
|
+
switch :manage_offer_created, :offer
|
24
|
+
switch :manage_offer_updated, :offer
|
25
25
|
switch :default
|
26
26
|
|
27
27
|
attribute :offer, OfferEntry
|
@@ -1,19 +1,19 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-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
|
-
# struct
|
8
|
+
# struct ManageOfferSuccessResult
|
9
9
|
# {
|
10
10
|
# // offers that got claimed while creating this offer
|
11
11
|
# ClaimOfferAtom offersClaimed<>;
|
12
12
|
#
|
13
|
-
# union switch (
|
13
|
+
# union switch (ManageOfferEffect effect)
|
14
14
|
# {
|
15
|
-
# case
|
16
|
-
# case
|
15
|
+
# case MANAGE_OFFER_CREATED:
|
16
|
+
# case MANAGE_OFFER_UPDATED:
|
17
17
|
# OfferEntry offer;
|
18
18
|
# default:
|
19
19
|
# void;
|
@@ -23,7 +23,7 @@ require 'xdr'
|
|
23
23
|
#
|
24
24
|
# ===========================================================================
|
25
25
|
module Stellar
|
26
|
-
class
|
26
|
+
class ManageOfferSuccessResult < XDR::Struct
|
27
27
|
include XDR::Namespace
|
28
28
|
|
29
29
|
autoload :Offer
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -19,6 +19,7 @@ require 'xdr'
|
|
19
19
|
# price is after fees
|
20
20
|
# */
|
21
21
|
# Price price;
|
22
|
+
# uint32 flags; // see OfferEntryFlags
|
22
23
|
# };
|
23
24
|
#
|
24
25
|
# ===========================================================================
|
@@ -30,5 +31,6 @@ module Stellar
|
|
30
31
|
attribute :taker_pays, Currency
|
31
32
|
attribute :amount, Int64
|
32
33
|
attribute :price, Price
|
34
|
+
attribute :flags, Uint32
|
33
35
|
end
|
34
36
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-07:00
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum OfferEntryFlags
|
9
|
+
# {
|
10
|
+
# // issuer has authorized account to perform transactions with its credit
|
11
|
+
# PASSIVE_FLAG = 1
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class OfferEntryFlags < XDR::Enum
|
17
|
+
member :passive_flag, 1
|
18
|
+
|
19
|
+
seal
|
20
|
+
end
|
21
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -13,8 +13,10 @@ require 'xdr'
|
|
13
13
|
# PaymentOp paymentOp;
|
14
14
|
# case PATH_PAYMENT:
|
15
15
|
# PathPaymentOp pathPaymentOp;
|
16
|
-
# case
|
17
|
-
#
|
16
|
+
# case MANAGE_OFFER:
|
17
|
+
# ManageOfferOp manageOfferOp;
|
18
|
+
# case CREATE_PASSIVE_OFFER:
|
19
|
+
# CreatePassiveOfferOp createPassiveOfferOp;
|
18
20
|
# case SET_OPTIONS:
|
19
21
|
# SetOptionsOp setOptionsOp;
|
20
22
|
# case CHANGE_TRUST:
|
@@ -33,24 +35,26 @@ module Stellar
|
|
33
35
|
class Body < XDR::Union
|
34
36
|
switch_on OperationType, :type
|
35
37
|
|
36
|
-
switch :create_account,
|
37
|
-
switch :payment,
|
38
|
-
switch :path_payment,
|
39
|
-
switch :
|
40
|
-
switch :
|
41
|
-
switch :
|
42
|
-
switch :
|
43
|
-
switch :
|
38
|
+
switch :create_account, :create_account_op
|
39
|
+
switch :payment, :payment_op
|
40
|
+
switch :path_payment, :path_payment_op
|
41
|
+
switch :manage_offer, :manage_offer_op
|
42
|
+
switch :create_passive_offer, :create_passive_offer_op
|
43
|
+
switch :set_options, :set_options_op
|
44
|
+
switch :change_trust, :change_trust_op
|
45
|
+
switch :allow_trust, :allow_trust_op
|
46
|
+
switch :account_merge, :destination
|
44
47
|
switch :inflation
|
45
48
|
|
46
|
-
attribute :create_account_op,
|
47
|
-
attribute :payment_op,
|
48
|
-
attribute :path_payment_op,
|
49
|
-
attribute :
|
50
|
-
attribute :
|
51
|
-
attribute :
|
52
|
-
attribute :
|
53
|
-
attribute :
|
49
|
+
attribute :create_account_op, CreateAccountOp
|
50
|
+
attribute :payment_op, PaymentOp
|
51
|
+
attribute :path_payment_op, PathPaymentOp
|
52
|
+
attribute :manage_offer_op, ManageOfferOp
|
53
|
+
attribute :create_passive_offer_op, CreatePassiveOfferOp
|
54
|
+
attribute :set_options_op, SetOptionsOp
|
55
|
+
attribute :change_trust_op, ChangeTrustOp
|
56
|
+
attribute :allow_trust_op, AllowTrustOp
|
57
|
+
attribute :destination, Uint256
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -20,8 +20,10 @@ require 'xdr'
|
|
20
20
|
# PaymentOp paymentOp;
|
21
21
|
# case PATH_PAYMENT:
|
22
22
|
# PathPaymentOp pathPaymentOp;
|
23
|
-
# case
|
24
|
-
#
|
23
|
+
# case MANAGE_OFFER:
|
24
|
+
# ManageOfferOp manageOfferOp;
|
25
|
+
# case CREATE_PASSIVE_OFFER:
|
26
|
+
# CreatePassiveOfferOp createPassiveOfferOp;
|
25
27
|
# case SET_OPTIONS:
|
26
28
|
# SetOptionsOp setOptionsOp;
|
27
29
|
# case CHANGE_TRUST:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -13,8 +13,10 @@ require 'xdr'
|
|
13
13
|
# PaymentResult paymentResult;
|
14
14
|
# case PATH_PAYMENT:
|
15
15
|
# PathPaymentResult pathPaymentResult;
|
16
|
-
# case
|
17
|
-
#
|
16
|
+
# case MANAGE_OFFER:
|
17
|
+
# ManageOfferResult manageOfferResult;
|
18
|
+
# case CREATE_PASSIVE_OFFER:
|
19
|
+
# ManageOfferResult createPassiveOfferResult;
|
18
20
|
# case SET_OPTIONS:
|
19
21
|
# SetOptionsResult setOptionsResult;
|
20
22
|
# case CHANGE_TRUST:
|
@@ -33,25 +35,27 @@ module Stellar
|
|
33
35
|
class Tr < XDR::Union
|
34
36
|
switch_on OperationType, :type
|
35
37
|
|
36
|
-
switch :create_account,
|
37
|
-
switch :payment,
|
38
|
-
switch :path_payment,
|
39
|
-
switch :
|
40
|
-
switch :
|
41
|
-
switch :
|
42
|
-
switch :
|
43
|
-
switch :
|
44
|
-
switch :
|
38
|
+
switch :create_account, :create_account_result
|
39
|
+
switch :payment, :payment_result
|
40
|
+
switch :path_payment, :path_payment_result
|
41
|
+
switch :manage_offer, :manage_offer_result
|
42
|
+
switch :create_passive_offer, :create_passive_offer_result
|
43
|
+
switch :set_options, :set_options_result
|
44
|
+
switch :change_trust, :change_trust_result
|
45
|
+
switch :allow_trust, :allow_trust_result
|
46
|
+
switch :account_merge, :account_merge_result
|
47
|
+
switch :inflation, :inflation_result
|
45
48
|
|
46
|
-
attribute :create_account_result,
|
47
|
-
attribute :payment_result,
|
48
|
-
attribute :path_payment_result,
|
49
|
-
attribute :
|
50
|
-
attribute :
|
51
|
-
attribute :
|
52
|
-
attribute :
|
53
|
-
attribute :
|
54
|
-
attribute :
|
49
|
+
attribute :create_account_result, CreateAccountResult
|
50
|
+
attribute :payment_result, PaymentResult
|
51
|
+
attribute :path_payment_result, PathPaymentResult
|
52
|
+
attribute :manage_offer_result, ManageOfferResult
|
53
|
+
attribute :create_passive_offer_result, ManageOfferResult
|
54
|
+
attribute :set_options_result, SetOptionsResult
|
55
|
+
attribute :change_trust_result, ChangeTrustResult
|
56
|
+
attribute :allow_trust_result, AllowTrustResult
|
57
|
+
attribute :account_merge_result, AccountMergeResult
|
58
|
+
attribute :inflation_result, InflationResult
|
55
59
|
end
|
56
60
|
end
|
57
61
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -16,8 +16,10 @@ require 'xdr'
|
|
16
16
|
# PaymentResult paymentResult;
|
17
17
|
# case PATH_PAYMENT:
|
18
18
|
# PathPaymentResult pathPaymentResult;
|
19
|
-
# case
|
20
|
-
#
|
19
|
+
# case MANAGE_OFFER:
|
20
|
+
# ManageOfferResult manageOfferResult;
|
21
|
+
# case CREATE_PASSIVE_OFFER:
|
22
|
+
# ManageOfferResult createPassiveOfferResult;
|
21
23
|
# case SET_OPTIONS:
|
22
24
|
# SetOptionsResult setOptionsResult;
|
23
25
|
# case CHANGE_TRUST:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -10,26 +10,28 @@ require 'xdr'
|
|
10
10
|
# CREATE_ACCOUNT = 0,
|
11
11
|
# PAYMENT = 1,
|
12
12
|
# PATH_PAYMENT = 2,
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
13
|
+
# MANAGE_OFFER = 3,
|
14
|
+
# CREATE_PASSIVE_OFFER = 4,
|
15
|
+
# SET_OPTIONS = 5,
|
16
|
+
# CHANGE_TRUST = 6,
|
17
|
+
# ALLOW_TRUST = 7,
|
18
|
+
# ACCOUNT_MERGE = 8,
|
19
|
+
# INFLATION = 9
|
19
20
|
# };
|
20
21
|
#
|
21
22
|
# ===========================================================================
|
22
23
|
module Stellar
|
23
24
|
class OperationType < XDR::Enum
|
24
|
-
member :create_account,
|
25
|
-
member :payment,
|
26
|
-
member :path_payment,
|
27
|
-
member :
|
28
|
-
member :
|
29
|
-
member :
|
30
|
-
member :
|
31
|
-
member :
|
32
|
-
member :
|
25
|
+
member :create_account, 0
|
26
|
+
member :payment, 1
|
27
|
+
member :path_payment, 2
|
28
|
+
member :manage_offer, 3
|
29
|
+
member :create_passive_offer, 4
|
30
|
+
member :set_options, 5
|
31
|
+
member :change_trust, 6
|
32
|
+
member :allow_trust, 7
|
33
|
+
member :account_merge, 8
|
34
|
+
member :inflation, 9
|
33
35
|
|
34
36
|
seal
|
35
37
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -8,7 +8,8 @@ require 'xdr'
|
|
8
8
|
# struct SCPQuorumSet
|
9
9
|
# {
|
10
10
|
# uint32 threshold;
|
11
|
-
#
|
11
|
+
# Hash validators<>;
|
12
|
+
# SCPQuorumSet innerSets<>;
|
12
13
|
# };
|
13
14
|
#
|
14
15
|
# ===========================================================================
|
@@ -16,5 +17,6 @@ module Stellar
|
|
16
17
|
class SCPQuorumSet < XDR::Struct
|
17
18
|
attribute :threshold, Uint32
|
18
19
|
attribute :validators, XDR::VarArray[Hash]
|
20
|
+
attribute :inner_sets, XDR::VarArray[SCPQuorumSet]
|
19
21
|
end
|
20
22
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:15-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -14,7 +14,8 @@ require 'xdr'
|
|
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
16
|
# SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist
|
17
|
-
# SET_OPTIONS_CANT_CHANGE = -5
|
17
|
+
# SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option
|
18
|
+
# SET_OPTIONS_UNKNOWN_FLAG = -6 // can't set an unknown flag
|
18
19
|
# };
|
19
20
|
#
|
20
21
|
# ===========================================================================
|
@@ -26,6 +27,7 @@ module Stellar
|
|
26
27
|
member :set_options_bad_flags, -3
|
27
28
|
member :set_options_invalid_inflation, -4
|
28
29
|
member :set_options_cant_change, -5
|
30
|
+
member :set_options_unknown_flag, -6
|
29
31
|
|
30
32
|
seal
|
31
33
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -7,7 +7,8 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# enum TrustLineFlags
|
9
9
|
# {
|
10
|
-
#
|
10
|
+
# // issuer has authorized account to perform transactions with its credit
|
11
|
+
# AUTHORIZED_FLAG = 1
|
11
12
|
# };
|
12
13
|
#
|
13
14
|
# ===========================================================================
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-
|
1
|
+
# Automatically generated on 2015-06-08T11:39:14-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -36,6 +36,9 @@ module Stellar
|
|
36
36
|
autoload :TrustLineFlags
|
37
37
|
|
38
38
|
autoload :TrustLineEntry
|
39
|
+
|
40
|
+
autoload :OfferEntryFlags
|
41
|
+
|
39
42
|
autoload :OfferEntry
|
40
43
|
|
41
44
|
autoload :LedgerEntry
|
@@ -89,7 +92,8 @@ module Stellar
|
|
89
92
|
autoload :CreateAccountOp
|
90
93
|
autoload :PaymentOp
|
91
94
|
autoload :PathPaymentOp
|
92
|
-
autoload :
|
95
|
+
autoload :ManageOfferOp
|
96
|
+
autoload :CreatePassiveOfferOp
|
93
97
|
autoload :SetOptionsOp
|
94
98
|
autoload :ChangeTrustOp
|
95
99
|
autoload :AllowTrustOp
|
@@ -118,12 +122,12 @@ module Stellar
|
|
118
122
|
|
119
123
|
autoload :PathPaymentResult
|
120
124
|
|
121
|
-
autoload :
|
122
|
-
autoload :
|
125
|
+
autoload :ManageOfferResultCode
|
126
|
+
autoload :ManageOfferEffect
|
123
127
|
|
124
|
-
autoload :
|
128
|
+
autoload :ManageOfferSuccessResult
|
125
129
|
|
126
|
-
autoload :
|
130
|
+
autoload :ManageOfferResult
|
127
131
|
|
128
132
|
autoload :SetOptionsResultCode
|
129
133
|
|
@@ -159,14 +163,9 @@ module Stellar
|
|
159
163
|
include XDR::Namespace
|
160
164
|
|
161
165
|
Uint512 = XDR::Opaque[64]
|
162
|
-
Uint256 = XDR::Opaque[32]
|
163
|
-
Uint64 = XDR::UnsignedHyper
|
164
166
|
Int64 = XDR::Hyper
|
165
|
-
Uint32 = XDR::UnsignedInt
|
166
167
|
Int32 = XDR::Int
|
167
168
|
AccountID = XDR::Opaque[32]
|
168
|
-
Signature = XDR::Opaque[64]
|
169
|
-
Hash = XDR::Opaque[32]
|
170
169
|
Thresholds = XDR::Opaque[4]
|
171
170
|
String32 = XDR::String[32]
|
172
171
|
SequenceNumber = Uint64
|
data/lib/stellar/base/version.rb
CHANGED
data/lib/stellar/operation.rb
CHANGED
@@ -130,14 +130,14 @@ module Stellar
|
|
130
130
|
}))
|
131
131
|
end
|
132
132
|
|
133
|
-
def self.
|
133
|
+
def self.manage_offer(attributes={})
|
134
134
|
taker_pays = Currency.send(*attributes[:taker_pays])
|
135
135
|
taker_gets = Currency.send(*attributes[:taker_gets])
|
136
136
|
amount = attributes[:amount]
|
137
137
|
offer_id = attributes[:offer_id] || 0
|
138
138
|
price = Price.from_f(attributes[:price])
|
139
139
|
|
140
|
-
op =
|
140
|
+
op = ManageOfferOp.new({
|
141
141
|
taker_pays: taker_pays,
|
142
142
|
taker_gets: taker_gets,
|
143
143
|
amount: amount,
|
@@ -146,7 +146,25 @@ module Stellar
|
|
146
146
|
})
|
147
147
|
|
148
148
|
return make(attributes.merge({
|
149
|
-
body:[:
|
149
|
+
body:[:manage_offer, op]
|
150
|
+
}))
|
151
|
+
end
|
152
|
+
|
153
|
+
def self.create_passive_offer(attributes={})
|
154
|
+
taker_pays = Currency.send(*attributes[:taker_pays])
|
155
|
+
taker_gets = Currency.send(*attributes[:taker_gets])
|
156
|
+
amount = attributes[:amount]
|
157
|
+
price = Price.from_f(attributes[:price])
|
158
|
+
|
159
|
+
op = CreatePassiveOfferOp.new({
|
160
|
+
taker_pays: taker_pays,
|
161
|
+
taker_gets: taker_gets,
|
162
|
+
amount: amount,
|
163
|
+
price: price,
|
164
|
+
})
|
165
|
+
|
166
|
+
return make(attributes.merge({
|
167
|
+
body:[:create_passive_offer, op]
|
150
168
|
}))
|
151
169
|
end
|
152
170
|
|
data/lib/stellar/transaction.rb
CHANGED
@@ -27,8 +27,14 @@ module Stellar
|
|
27
27
|
|
28
28
|
#
|
29
29
|
# @see Stellar::Operation.create_offer
|
30
|
-
def self.
|
31
|
-
make :
|
30
|
+
def self.manage_offer(attributes={})
|
31
|
+
make :manage_offer, attributes
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# @see Stellar::Operation.create_passive_offer
|
36
|
+
def self.create_passive_offer(attributes={})
|
37
|
+
make :create_passive_offer, attributes
|
32
38
|
end
|
33
39
|
|
34
40
|
#
|
data/xdr/SCPXDR.x
CHANGED
@@ -53,9 +53,15 @@ struct SCPEnvelope
|
|
53
53
|
Signature signature;
|
54
54
|
};
|
55
55
|
|
56
|
+
|
57
|
+
// supports things like: A,B,C,(D,E,F),(G,H,(I,J,K,L))
|
58
|
+
// only allows 2 levels of nesting
|
56
59
|
struct SCPQuorumSet
|
57
60
|
{
|
58
61
|
uint32 threshold;
|
59
|
-
|
62
|
+
Hash validators<>;
|
63
|
+
SCPQuorumSet innerSets<>;
|
60
64
|
};
|
65
|
+
|
66
|
+
|
61
67
|
}
|
@@ -22,7 +22,12 @@ struct Signer
|
|
22
22
|
|
23
23
|
enum AccountFlags
|
24
24
|
{ // masks for each flag
|
25
|
+
|
26
|
+
// if set, TrustLines are created with authorized set to "false"
|
27
|
+
// requiring the issuer to set it for each TrustLine
|
25
28
|
AUTH_REQUIRED_FLAG = 0x1,
|
29
|
+
// if set, the authorized flag in TrustTines can be cleared
|
30
|
+
// otherwise, authorization cannot be revoked
|
26
31
|
AUTH_REVOCABLE_FLAG = 0x2
|
27
32
|
};
|
28
33
|
|
@@ -62,7 +67,8 @@ struct AccountEntry
|
|
62
67
|
|
63
68
|
enum TrustLineFlags
|
64
69
|
{
|
65
|
-
|
70
|
+
// issuer has authorized account to perform transactions with its credit
|
71
|
+
AUTHORIZED_FLAG = 1
|
66
72
|
};
|
67
73
|
|
68
74
|
struct TrustLineEntry
|
@@ -76,6 +82,13 @@ struct TrustLineEntry
|
|
76
82
|
uint32 flags; // see TrustLineFlags
|
77
83
|
};
|
78
84
|
|
85
|
+
|
86
|
+
enum OfferEntryFlags
|
87
|
+
{
|
88
|
+
// issuer has authorized account to perform transactions with its credit
|
89
|
+
PASSIVE_FLAG = 1
|
90
|
+
};
|
91
|
+
|
79
92
|
/* OfferEntry
|
80
93
|
An offer is the building block of the offer book, they are automatically
|
81
94
|
claimed by payments when the price set by the owner is met.
|
@@ -97,6 +110,7 @@ struct OfferEntry
|
|
97
110
|
price is after fees
|
98
111
|
*/
|
99
112
|
Price price;
|
113
|
+
uint32 flags; // see OfferEntryFlags
|
100
114
|
};
|
101
115
|
|
102
116
|
union LedgerEntry switch (LedgerEntryType type)
|
data/xdr/Stellar-ledger.x
CHANGED
@@ -29,6 +29,9 @@ struct LedgerHeader
|
|
29
29
|
|
30
30
|
int32 baseFee; // base fee per operation in stroops
|
31
31
|
int32 baseReserve; // account base reserve in stroops
|
32
|
+
|
33
|
+
Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back
|
34
|
+
// in time without walking the chain back ledger by ledger
|
32
35
|
};
|
33
36
|
|
34
37
|
/* Entries used to define the bucket list */
|
data/xdr/Stellar-transaction.x
CHANGED
@@ -18,12 +18,13 @@ enum OperationType
|
|
18
18
|
CREATE_ACCOUNT = 0,
|
19
19
|
PAYMENT = 1,
|
20
20
|
PATH_PAYMENT = 2,
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
MANAGE_OFFER = 3,
|
22
|
+
CREATE_PASSIVE_OFFER = 4,
|
23
|
+
SET_OPTIONS = 5,
|
24
|
+
CHANGE_TRUST = 6,
|
25
|
+
ALLOW_TRUST = 7,
|
26
|
+
ACCOUNT_MERGE = 8,
|
27
|
+
INFLATION = 9
|
27
28
|
};
|
28
29
|
|
29
30
|
/* CreateAccount
|
@@ -85,10 +86,10 @@ struct PathPaymentOp
|
|
85
86
|
|
86
87
|
Threshold: med
|
87
88
|
|
88
|
-
Result:
|
89
|
+
Result: ManageOfferResult
|
89
90
|
|
90
91
|
*/
|
91
|
-
struct
|
92
|
+
struct ManageOfferOp
|
92
93
|
{
|
93
94
|
Currency takerGets;
|
94
95
|
Currency takerPays;
|
@@ -99,6 +100,21 @@ struct CreateOfferOp
|
|
99
100
|
uint64 offerID;
|
100
101
|
};
|
101
102
|
|
103
|
+
/* Creates an offer that doesn't take offers of the same price
|
104
|
+
|
105
|
+
Threshold: med
|
106
|
+
|
107
|
+
Result: CreatePassiveOfferResult
|
108
|
+
|
109
|
+
*/
|
110
|
+
struct CreatePassiveOfferOp
|
111
|
+
{
|
112
|
+
Currency takerGets;
|
113
|
+
Currency takerPays;
|
114
|
+
int64 amount; // amount taker gets. if set to 0, delete the offer
|
115
|
+
Price price; // =takerPaysAmount/takerGetsAmount
|
116
|
+
};
|
117
|
+
|
102
118
|
/* Set Account Options
|
103
119
|
|
104
120
|
updates "AccountEntry" fields.
|
@@ -143,6 +159,8 @@ struct ChangeTrustOp
|
|
143
159
|
/* Updates the "authorized" flag of an existing trust line
|
144
160
|
this is called by the issuer of the related currency.
|
145
161
|
|
162
|
+
note that authorize can only be set (and not cleared) if
|
163
|
+
the issuer account does not have the AUTH_REVOCABLE_FLAG set
|
146
164
|
Threshold: low
|
147
165
|
|
148
166
|
Result: AllowTrustResult
|
@@ -196,8 +214,10 @@ struct Operation
|
|
196
214
|
PaymentOp paymentOp;
|
197
215
|
case PATH_PAYMENT:
|
198
216
|
PathPaymentOp pathPaymentOp;
|
199
|
-
case
|
200
|
-
|
217
|
+
case MANAGE_OFFER:
|
218
|
+
ManageOfferOp manageOfferOp;
|
219
|
+
case CREATE_PASSIVE_OFFER:
|
220
|
+
CreatePassiveOfferOp createPassiveOfferOp;
|
201
221
|
case SET_OPTIONS:
|
202
222
|
SetOptionsOp setOptionsOp;
|
203
223
|
case CHANGE_TRUST:
|
@@ -376,44 +396,45 @@ default:
|
|
376
396
|
void;
|
377
397
|
};
|
378
398
|
|
379
|
-
/*******
|
399
|
+
/******* ManageOffer Result ********/
|
380
400
|
|
381
|
-
enum
|
401
|
+
enum ManageOfferResultCode
|
382
402
|
{
|
383
403
|
// codes considered as "success" for the operation
|
384
|
-
|
404
|
+
MANAGE_OFFER_SUCCESS = 0,
|
385
405
|
|
386
406
|
// codes considered as "failure" for the operation
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
407
|
+
MANAGE_OFFER_MALFORMED = -1, // generated offer would be invalid
|
408
|
+
MANAGE_OFFER_NO_TRUST = -2, // can't hold what it's buying
|
409
|
+
MANAGE_OFFER_NOT_AUTHORIZED = -3, // not authorized to sell or buy
|
410
|
+
MANAGE_OFFER_LINE_FULL = -4, // can't receive more of what it's buying
|
411
|
+
MANAGE_OFFER_UNDERFUNDED = -5, // doesn't hold what it's trying to sell
|
412
|
+
MANAGE_OFFER_CROSS_SELF = -6, // would cross an offer from the same user
|
393
413
|
|
394
414
|
// update errors
|
395
|
-
|
396
|
-
|
415
|
+
MANAGE_OFFER_NOT_FOUND = -7, // offerID does not match an existing offer
|
416
|
+
MANAGE_OFFER_MISMATCH = -8, // currencies don't match offer
|
397
417
|
|
398
|
-
|
418
|
+
MANAGE_OFFER_LOW_RESERVE = -9 // not enough funds to create a new Offer
|
399
419
|
};
|
400
420
|
|
401
|
-
|
421
|
+
|
422
|
+
enum ManageOfferEffect
|
402
423
|
{
|
403
|
-
|
404
|
-
|
405
|
-
|
424
|
+
MANAGE_OFFER_CREATED = 0,
|
425
|
+
MANAGE_OFFER_UPDATED = 1,
|
426
|
+
MANAGE_OFFER_DELETED = 2
|
406
427
|
};
|
407
428
|
|
408
|
-
struct
|
429
|
+
struct ManageOfferSuccessResult
|
409
430
|
{
|
410
431
|
// offers that got claimed while creating this offer
|
411
432
|
ClaimOfferAtom offersClaimed<>;
|
412
433
|
|
413
|
-
union switch (
|
434
|
+
union switch (ManageOfferEffect effect)
|
414
435
|
{
|
415
|
-
case
|
416
|
-
case
|
436
|
+
case MANAGE_OFFER_CREATED:
|
437
|
+
case MANAGE_OFFER_UPDATED:
|
417
438
|
OfferEntry offer;
|
418
439
|
default:
|
419
440
|
void;
|
@@ -421,10 +442,10 @@ struct CreateOfferSuccessResult
|
|
421
442
|
offer;
|
422
443
|
};
|
423
444
|
|
424
|
-
union
|
445
|
+
union ManageOfferResult switch (ManageOfferResultCode code)
|
425
446
|
{
|
426
|
-
case
|
427
|
-
|
447
|
+
case MANAGE_OFFER_SUCCESS:
|
448
|
+
ManageOfferSuccessResult success;
|
428
449
|
default:
|
429
450
|
void;
|
430
451
|
};
|
@@ -440,7 +461,8 @@ enum SetOptionsResultCode
|
|
440
461
|
SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached
|
441
462
|
SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags
|
442
463
|
SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist
|
443
|
-
SET_OPTIONS_CANT_CHANGE = -5
|
464
|
+
SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option
|
465
|
+
SET_OPTIONS_UNKNOWN_FLAG = -6 // can't set an unknown flag
|
444
466
|
};
|
445
467
|
|
446
468
|
union SetOptionsResult switch (SetOptionsResultCode code)
|
@@ -481,9 +503,9 @@ enum AllowTrustResultCode
|
|
481
503
|
// codes considered as "failure" for the operation
|
482
504
|
ALLOW_TRUST_MALFORMED = -1, // currency is not CURRENCY_TYPE_ALPHANUM
|
483
505
|
ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline
|
484
|
-
|
485
|
-
|
486
|
-
ALLOW_TRUST_CANT_REVOKE = -4
|
506
|
+
// source account does not require trust
|
507
|
+
ALLOW_TRUST_TRUST_NOT_REQUIRED = -3,
|
508
|
+
ALLOW_TRUST_CANT_REVOKE = -4 // source account can't revoke trust
|
487
509
|
};
|
488
510
|
|
489
511
|
union AllowTrustResult switch (AllowTrustResultCode code)
|
@@ -560,8 +582,10 @@ case opINNER:
|
|
560
582
|
PaymentResult paymentResult;
|
561
583
|
case PATH_PAYMENT:
|
562
584
|
PathPaymentResult pathPaymentResult;
|
563
|
-
case
|
564
|
-
|
585
|
+
case MANAGE_OFFER:
|
586
|
+
ManageOfferResult manageOfferResult;
|
587
|
+
case CREATE_PASSIVE_OFFER:
|
588
|
+
ManageOfferResult createPassiveOfferResult;
|
565
589
|
case SET_OPTIONS:
|
566
590
|
SetOptionsResult setOptionsResult;
|
567
591
|
case CHANGE_TRUST:
|
data/xdr/Stellar-types.x
CHANGED
@@ -9,14 +9,9 @@ namespace stellar
|
|
9
9
|
|
10
10
|
// messages
|
11
11
|
typedef opaque uint512[64];
|
12
|
-
typedef opaque uint256[32];
|
13
|
-
typedef unsigned hyper uint64;
|
14
12
|
typedef hyper int64;
|
15
|
-
typedef unsigned int uint32;
|
16
13
|
typedef int int32;
|
17
14
|
typedef opaque AccountID[32];
|
18
|
-
typedef opaque Signature[64];
|
19
|
-
typedef opaque Hash[32];
|
20
15
|
typedef opaque Thresholds[4];
|
21
16
|
typedef string string32<32>;
|
22
17
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Fleckenstein
|
@@ -232,12 +232,7 @@ files:
|
|
232
232
|
- generated/stellar/create_account_op.rb
|
233
233
|
- generated/stellar/create_account_result.rb
|
234
234
|
- generated/stellar/create_account_result_code.rb
|
235
|
-
- generated/stellar/
|
236
|
-
- generated/stellar/create_offer_op.rb
|
237
|
-
- generated/stellar/create_offer_result.rb
|
238
|
-
- generated/stellar/create_offer_result_code.rb
|
239
|
-
- generated/stellar/create_offer_success_result.rb
|
240
|
-
- generated/stellar/create_offer_success_result/offer.rb
|
235
|
+
- generated/stellar/create_passive_offer_op.rb
|
241
236
|
- generated/stellar/currency.rb
|
242
237
|
- generated/stellar/currency/alpha_num.rb
|
243
238
|
- generated/stellar/currency_type.rb
|
@@ -258,10 +253,17 @@ files:
|
|
258
253
|
- generated/stellar/ledger_key/account.rb
|
259
254
|
- generated/stellar/ledger_key/offer.rb
|
260
255
|
- generated/stellar/ledger_key/trust_line.rb
|
256
|
+
- generated/stellar/manage_offer_effect.rb
|
257
|
+
- generated/stellar/manage_offer_op.rb
|
258
|
+
- generated/stellar/manage_offer_result.rb
|
259
|
+
- generated/stellar/manage_offer_result_code.rb
|
260
|
+
- generated/stellar/manage_offer_success_result.rb
|
261
|
+
- generated/stellar/manage_offer_success_result/offer.rb
|
261
262
|
- generated/stellar/memo.rb
|
262
263
|
- generated/stellar/memo_type.rb
|
263
264
|
- generated/stellar/message_type.rb
|
264
265
|
- generated/stellar/offer_entry.rb
|
266
|
+
- generated/stellar/offer_entry_flags.rb
|
265
267
|
- generated/stellar/operation.rb
|
266
268
|
- generated/stellar/operation/body.rb
|
267
269
|
- generated/stellar/operation_result.rb
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# Automatically generated on 2015-05-13T15:00:04-07:00
|
2
|
-
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
4
|
-
require 'xdr'
|
5
|
-
|
6
|
-
# === xdr source ============================================================
|
7
|
-
#
|
8
|
-
# enum CreateOfferEffect
|
9
|
-
# {
|
10
|
-
# CREATE_OFFER_CREATED = 0,
|
11
|
-
# CREATE_OFFER_UPDATED = 1,
|
12
|
-
# CREATE_OFFER_DELETED = 2
|
13
|
-
# };
|
14
|
-
#
|
15
|
-
# ===========================================================================
|
16
|
-
module Stellar
|
17
|
-
class CreateOfferEffect < XDR::Enum
|
18
|
-
member :create_offer_created, 0
|
19
|
-
member :create_offer_updated, 1
|
20
|
-
member :create_offer_deleted, 2
|
21
|
-
|
22
|
-
seal
|
23
|
-
end
|
24
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# Automatically generated on 2015-05-13T15:00:04-07:00
|
2
|
-
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
4
|
-
require 'xdr'
|
5
|
-
|
6
|
-
# === xdr source ============================================================
|
7
|
-
#
|
8
|
-
# union CreateOfferResult switch (CreateOfferResultCode code)
|
9
|
-
# {
|
10
|
-
# case CREATE_OFFER_SUCCESS:
|
11
|
-
# CreateOfferSuccessResult success;
|
12
|
-
# default:
|
13
|
-
# void;
|
14
|
-
# };
|
15
|
-
#
|
16
|
-
# ===========================================================================
|
17
|
-
module Stellar
|
18
|
-
class CreateOfferResult < XDR::Union
|
19
|
-
switch_on CreateOfferResultCode, :code
|
20
|
-
|
21
|
-
switch :create_offer_success, :success
|
22
|
-
switch :default
|
23
|
-
|
24
|
-
attribute :success, CreateOfferSuccessResult
|
25
|
-
end
|
26
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# Automatically generated on 2015-05-13T15:00:04-07:00
|
2
|
-
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
4
|
-
require 'xdr'
|
5
|
-
|
6
|
-
# === xdr source ============================================================
|
7
|
-
#
|
8
|
-
# enum CreateOfferResultCode
|
9
|
-
# {
|
10
|
-
# // codes considered as "success" for the operation
|
11
|
-
# CREATE_OFFER_SUCCESS = 0,
|
12
|
-
#
|
13
|
-
# // codes considered as "failure" for the operation
|
14
|
-
# CREATE_OFFER_MALFORMED = -1, // generated offer would be invalid
|
15
|
-
# CREATE_OFFER_NO_TRUST = -2, // can't hold what it's buying
|
16
|
-
# CREATE_OFFER_NOT_AUTHORIZED = -3, // not authorized to hold what it's buying
|
17
|
-
# CREATE_OFFER_LINE_FULL = -4, // can't receive more of what it's buying
|
18
|
-
# CREATE_OFFER_UNDERFUNDED = -5, // doesn't hold what it's trying to sell
|
19
|
-
# CREATE_OFFER_CROSS_SELF = -6, // would cross an offer from the same user
|
20
|
-
#
|
21
|
-
# // update errors
|
22
|
-
# CREATE_OFFER_NOT_FOUND = -7, // offerID does not match an existing offer
|
23
|
-
# CREATE_OFFER_MISMATCH = -8, // currencies don't match offer
|
24
|
-
#
|
25
|
-
# CREATE_OFFER_LOW_RESERVE = -9 // not enough funds to create a new Offer
|
26
|
-
# };
|
27
|
-
#
|
28
|
-
# ===========================================================================
|
29
|
-
module Stellar
|
30
|
-
class CreateOfferResultCode < XDR::Enum
|
31
|
-
member :create_offer_success, 0
|
32
|
-
member :create_offer_malformed, -1
|
33
|
-
member :create_offer_no_trust, -2
|
34
|
-
member :create_offer_not_authorized, -3
|
35
|
-
member :create_offer_line_full, -4
|
36
|
-
member :create_offer_underfunded, -5
|
37
|
-
member :create_offer_cross_self, -6
|
38
|
-
member :create_offer_not_found, -7
|
39
|
-
member :create_offer_mismatch, -8
|
40
|
-
member :create_offer_low_reserve, -9
|
41
|
-
|
42
|
-
seal
|
43
|
-
end
|
44
|
-
end
|