open-core 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.travis.yml +15 -0
- data/.yardopts +8 -0
- data/CONTRIBUTING.md +48 -0
- data/Gemfile +15 -0
- data/Guardfile +5 -0
- data/LICENSE.txt +202 -0
- data/README.md +83 -0
- data/Rakefile +4 -0
- data/examples/create_account.rb +26 -0
- data/examples/low_level_transaction_post.rb +46 -0
- data/examples/mid_level_transaction_post.rb +33 -0
- data/examples/non_native_payment.rb +60 -0
- data/examples/offer.rb +75 -0
- data/examples/transaction_merge.rb +23 -0
- data/generated/stellar-base-generated.rb +134 -0
- data/generated/stellar/account_entry.rb +53 -0
- data/generated/stellar/account_entry/ext.rb +24 -0
- data/generated/stellar/account_flags.rb +27 -0
- data/generated/stellar/account_merge_result.rb +26 -0
- data/generated/stellar/account_merge_result_code.rb +30 -0
- data/generated/stellar/allow_trust_op.rb +38 -0
- data/generated/stellar/allow_trust_op/asset.rb +33 -0
- data/generated/stellar/allow_trust_result.rb +25 -0
- data/generated/stellar/allow_trust_result_code.rb +31 -0
- data/generated/stellar/asset.rb +47 -0
- data/generated/stellar/asset/alpha_num12.rb +22 -0
- data/generated/stellar/asset/alpha_num4.rb +22 -0
- data/generated/stellar/asset_type.rb +24 -0
- data/generated/stellar/bucket_entry.rb +28 -0
- data/generated/stellar/bucket_entry_type.rb +22 -0
- data/generated/stellar/change_trust_op.rb +22 -0
- data/generated/stellar/change_trust_result.rb +25 -0
- data/generated/stellar/change_trust_result_code.rb +30 -0
- data/generated/stellar/claim_offer_atom.rb +33 -0
- data/generated/stellar/create_account_op.rb +20 -0
- data/generated/stellar/create_account_result.rb +25 -0
- data/generated/stellar/create_account_result_code.rb +32 -0
- data/generated/stellar/create_passive_offer_op.rb +24 -0
- data/generated/stellar/crypto_key_type.rb +20 -0
- data/generated/stellar/decorated_signature.rb +20 -0
- data/generated/stellar/dont_have.rb +20 -0
- data/generated/stellar/envelope_type.rb +22 -0
- data/generated/stellar/error.rb +20 -0
- data/generated/stellar/hello.rb +26 -0
- data/generated/stellar/inflation_payout.rb +20 -0
- data/generated/stellar/inflation_result.rb +26 -0
- data/generated/stellar/inflation_result_code.rb +24 -0
- data/generated/stellar/ledger_entry.rb +44 -0
- data/generated/stellar/ledger_entry/data.rb +33 -0
- data/generated/stellar/ledger_entry/ext.rb +24 -0
- data/generated/stellar/ledger_entry_change.rb +31 -0
- data/generated/stellar/ledger_entry_change_type.rb +24 -0
- data/generated/stellar/ledger_entry_type.rb +24 -0
- data/generated/stellar/ledger_header.rb +65 -0
- data/generated/stellar/ledger_header/ext.rb +24 -0
- data/generated/stellar/ledger_header_history_entry.rb +33 -0
- data/generated/stellar/ledger_header_history_entry/ext.rb +24 -0
- data/generated/stellar/ledger_key.rb +50 -0
- data/generated/stellar/ledger_key/account.rb +20 -0
- data/generated/stellar/ledger_key/offer.rb +22 -0
- data/generated/stellar/ledger_key/trust_line.rb +22 -0
- data/generated/stellar/ledger_upgrade.rb +27 -0
- data/generated/stellar/ledger_upgrade_type.rb +22 -0
- data/generated/stellar/manage_offer_effect.rb +24 -0
- data/generated/stellar/manage_offer_op.rb +28 -0
- data/generated/stellar/manage_offer_result.rb +26 -0
- data/generated/stellar/manage_offer_result_code.rb +48 -0
- data/generated/stellar/manage_offer_success_result.rb +34 -0
- data/generated/stellar/manage_offer_success_result/offer.rb +30 -0
- data/generated/stellar/memo.rb +38 -0
- data/generated/stellar/memo_type.rb +28 -0
- data/generated/stellar/message_type.rb +45 -0
- data/generated/stellar/offer_entry.rb +49 -0
- data/generated/stellar/offer_entry/ext.rb +24 -0
- data/generated/stellar/offer_entry_flags.rb +21 -0
- data/generated/stellar/operation.rb +51 -0
- data/generated/stellar/operation/body.rb +60 -0
- data/generated/stellar/operation_meta.rb +18 -0
- data/generated/stellar/operation_result.rb +53 -0
- data/generated/stellar/operation_result/tr.rb +61 -0
- data/generated/stellar/operation_result_code.rb +25 -0
- data/generated/stellar/operation_type.rb +38 -0
- data/generated/stellar/path_payment_op.rb +32 -0
- data/generated/stellar/path_payment_result.rb +34 -0
- data/generated/stellar/path_payment_result/success.rb +22 -0
- data/generated/stellar/path_payment_result_code.rb +45 -0
- data/generated/stellar/payment_op.rb +22 -0
- data/generated/stellar/payment_result.rb +25 -0
- data/generated/stellar/payment_result_code.rb +39 -0
- data/generated/stellar/peer_address.rb +22 -0
- data/generated/stellar/price.rb +20 -0
- data/generated/stellar/public_key.rb +23 -0
- data/generated/stellar/scp_ballot.rb +20 -0
- data/generated/stellar/scp_envelope.rb +20 -0
- data/generated/stellar/scp_nomination.rb +22 -0
- data/generated/stellar/scp_quorum_set.rb +22 -0
- data/generated/stellar/scp_statement.rb +59 -0
- data/generated/stellar/scp_statement/pledges.rb +64 -0
- data/generated/stellar/scp_statement/pledges/confirm.rb +28 -0
- data/generated/stellar/scp_statement/pledges/externalize.rb +28 -0
- data/generated/stellar/scp_statement/pledges/prepare.rb +32 -0
- data/generated/stellar/scp_statement_type.rb +26 -0
- data/generated/stellar/set_options_op.rb +41 -0
- data/generated/stellar/set_options_result.rb +25 -0
- data/generated/stellar/set_options_result_code.rb +38 -0
- data/generated/stellar/signer.rb +20 -0
- data/generated/stellar/simple_payment_result.rb +22 -0
- data/generated/stellar/stellar_message.rb +66 -0
- data/generated/stellar/stellar_value.rb +40 -0
- data/generated/stellar/stellar_value/ext.rb +24 -0
- data/generated/stellar/threshold_indexes.rb +26 -0
- data/generated/stellar/time_bounds.rb +20 -0
- data/generated/stellar/transaction.rb +50 -0
- data/generated/stellar/transaction/ext.rb +24 -0
- data/generated/stellar/transaction_envelope.rb +20 -0
- data/generated/stellar/transaction_history_entry.rb +33 -0
- data/generated/stellar/transaction_history_entry/ext.rb +24 -0
- data/generated/stellar/transaction_history_result_entry.rb +33 -0
- data/generated/stellar/transaction_history_result_entry/ext.rb +24 -0
- data/generated/stellar/transaction_meta.rb +31 -0
- data/generated/stellar/transaction_meta/v0.rb +22 -0
- data/generated/stellar/transaction_result.rb +43 -0
- data/generated/stellar/transaction_result/ext.rb +24 -0
- data/generated/stellar/transaction_result/result.rb +30 -0
- data/generated/stellar/transaction_result_code.rb +45 -0
- data/generated/stellar/transaction_result_pair.rb +20 -0
- data/generated/stellar/transaction_result_set.rb +18 -0
- data/generated/stellar/transaction_set.rb +20 -0
- data/generated/stellar/trust_line_entry.rb +41 -0
- data/generated/stellar/trust_line_entry/ext.rb +24 -0
- data/generated/stellar/trust_line_flags.rb +21 -0
- data/lib/stellar-base.rb +32 -0
- data/lib/stellar/account_flags.rb +28 -0
- data/lib/stellar/asset.rb +69 -0
- data/lib/stellar/base.rb +1 -0
- data/lib/stellar/base/version.rb +5 -0
- data/lib/stellar/convert.rb +32 -0
- data/lib/stellar/key_pair.rb +112 -0
- data/lib/stellar/networks.rb +45 -0
- data/lib/stellar/operation.rb +304 -0
- data/lib/stellar/path_payment_result.rb +17 -0
- data/lib/stellar/price.rb +32 -0
- data/lib/stellar/thresholds.rb +39 -0
- data/lib/stellar/transaction.rb +170 -0
- data/lib/stellar/transaction_envelope.rb +32 -0
- data/lib/stellar/util/continued_fraction.rb +96 -0
- data/lib/stellar/util/strkey.rb +43 -0
- data/open-core.gemspec +37 -0
- data/spec/lib/stellar/account_flags_spec.rb +19 -0
- data/spec/lib/stellar/asset_spec.rb +45 -0
- data/spec/lib/stellar/convert_spec.rb +61 -0
- data/spec/lib/stellar/key_pair_spec.rb +238 -0
- data/spec/lib/stellar/networks_spec.rb +77 -0
- data/spec/lib/stellar/path_payment_result_spec.rb +95 -0
- data/spec/lib/stellar/price_spec.rb +34 -0
- data/spec/lib/stellar/thresholds_spec.rb +62 -0
- data/spec/lib/stellar/transaction_envelope_spec.rb +93 -0
- data/spec/lib/stellar/transaction_spec.rb +54 -0
- data/spec/lib/stellar/util/strkey_spec.rb +46 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/support/matchers/be_strkey.rb +9 -0
- data/spec/support/matchers/eq_bytes.rb +5 -0
- data/spec/support/matchers/have_length.rb +5 -0
- data/tasks/rspec.rake +6 -0
- data/tasks/travis.rake +1 -0
- data/tasks/xdr.rake +50 -0
- data/xdr/Stellar-SCP.x +87 -0
- data/xdr/Stellar-ledger-entries.x +222 -0
- data/xdr/Stellar-ledger.x +231 -0
- data/xdr/Stellar-overlay.x +87 -0
- data/xdr/Stellar-transaction.x +670 -0
- data/xdr/Stellar-types.x +34 -0
- metadata +444 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum AccountMergeResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# ACCOUNT_MERGE_SUCCESS = 0,
|
12
|
+
# // codes considered as "failure" for the operation
|
13
|
+
# ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself
|
14
|
+
# ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist
|
15
|
+
# ACCOUNT_MERGE_HAS_CREDIT = -3, // account has active trust lines
|
16
|
+
# ACCOUNT_MERGE_CREDIT_HELD = -4 // an issuer cannot be merged if used
|
17
|
+
# };
|
18
|
+
#
|
19
|
+
# ===========================================================================
|
20
|
+
module Stellar
|
21
|
+
class AccountMergeResultCode < XDR::Enum
|
22
|
+
member :account_merge_success, 0
|
23
|
+
member :account_merge_malformed, -1
|
24
|
+
member :account_merge_no_account, -2
|
25
|
+
member :account_merge_has_credit, -3
|
26
|
+
member :account_merge_credit_held, -4
|
27
|
+
|
28
|
+
seal
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct AllowTrustOp
|
9
|
+
# {
|
10
|
+
# AccountID trustor;
|
11
|
+
# union switch (AssetType type)
|
12
|
+
# {
|
13
|
+
# // ASSET_TYPE_NATIVE is not allowed
|
14
|
+
# case ASSET_TYPE_CREDIT_ALPHANUM4:
|
15
|
+
# opaque assetCode4[4];
|
16
|
+
#
|
17
|
+
# case ASSET_TYPE_CREDIT_ALPHANUM12:
|
18
|
+
# opaque assetCode12[12];
|
19
|
+
#
|
20
|
+
# // add other asset types here in the future
|
21
|
+
# }
|
22
|
+
# asset;
|
23
|
+
#
|
24
|
+
# bool authorize;
|
25
|
+
# };
|
26
|
+
#
|
27
|
+
# ===========================================================================
|
28
|
+
module Stellar
|
29
|
+
class AllowTrustOp < XDR::Struct
|
30
|
+
include XDR::Namespace
|
31
|
+
|
32
|
+
autoload :Asset
|
33
|
+
|
34
|
+
attribute :trustor, AccountID
|
35
|
+
attribute :asset, Asset
|
36
|
+
attribute :authorize, XDR::Bool
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union switch (AssetType type)
|
9
|
+
# {
|
10
|
+
# // ASSET_TYPE_NATIVE is not allowed
|
11
|
+
# case ASSET_TYPE_CREDIT_ALPHANUM4:
|
12
|
+
# opaque assetCode4[4];
|
13
|
+
#
|
14
|
+
# case ASSET_TYPE_CREDIT_ALPHANUM12:
|
15
|
+
# opaque assetCode12[12];
|
16
|
+
#
|
17
|
+
# // add other asset types here in the future
|
18
|
+
# }
|
19
|
+
#
|
20
|
+
# ===========================================================================
|
21
|
+
module Stellar
|
22
|
+
class AllowTrustOp
|
23
|
+
class Asset < XDR::Union
|
24
|
+
switch_on AssetType, :type
|
25
|
+
|
26
|
+
switch :asset_type_credit_alphanum4, :asset_code4
|
27
|
+
switch :asset_type_credit_alphanum12, :asset_code12
|
28
|
+
|
29
|
+
attribute :asset_code4, XDR::Opaque[4]
|
30
|
+
attribute :asset_code12, XDR::Opaque[12]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union AllowTrustResult switch (AllowTrustResultCode code)
|
9
|
+
# {
|
10
|
+
# case ALLOW_TRUST_SUCCESS:
|
11
|
+
# void;
|
12
|
+
# default:
|
13
|
+
# void;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class AllowTrustResult < XDR::Union
|
19
|
+
switch_on AllowTrustResultCode, :code
|
20
|
+
|
21
|
+
switch :allow_trust_success
|
22
|
+
switch :default
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum AllowTrustResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# ALLOW_TRUST_SUCCESS = 0,
|
12
|
+
# // codes considered as "failure" for the operation
|
13
|
+
# ALLOW_TRUST_MALFORMED = -1, // asset is not ASSET_TYPE_ALPHANUM
|
14
|
+
# ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline
|
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
|
+
# };
|
19
|
+
#
|
20
|
+
# ===========================================================================
|
21
|
+
module Stellar
|
22
|
+
class AllowTrustResultCode < XDR::Enum
|
23
|
+
member :allow_trust_success, 0
|
24
|
+
member :allow_trust_malformed, -1
|
25
|
+
member :allow_trust_no_trust_line, -2
|
26
|
+
member :allow_trust_trust_not_required, -3
|
27
|
+
member :allow_trust_cant_revoke, -4
|
28
|
+
|
29
|
+
seal
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union Asset switch (AssetType type)
|
9
|
+
# {
|
10
|
+
# case ASSET_TYPE_NATIVE: // Not credit
|
11
|
+
# void;
|
12
|
+
#
|
13
|
+
# case ASSET_TYPE_CREDIT_ALPHANUM4:
|
14
|
+
# struct
|
15
|
+
# {
|
16
|
+
# opaque assetCode[4];
|
17
|
+
# AccountID issuer;
|
18
|
+
# } alphaNum4;
|
19
|
+
#
|
20
|
+
# case ASSET_TYPE_CREDIT_ALPHANUM12:
|
21
|
+
# struct
|
22
|
+
# {
|
23
|
+
# opaque assetCode[12];
|
24
|
+
# AccountID issuer;
|
25
|
+
# } alphaNum12;
|
26
|
+
#
|
27
|
+
# // add other asset types here in the future
|
28
|
+
# };
|
29
|
+
#
|
30
|
+
# ===========================================================================
|
31
|
+
module Stellar
|
32
|
+
class Asset < XDR::Union
|
33
|
+
include XDR::Namespace
|
34
|
+
|
35
|
+
autoload :AlphaNum4
|
36
|
+
autoload :AlphaNum12
|
37
|
+
|
38
|
+
switch_on AssetType, :type
|
39
|
+
|
40
|
+
switch :asset_type_native
|
41
|
+
switch :asset_type_credit_alphanum4, :alpha_num4
|
42
|
+
switch :asset_type_credit_alphanum12, :alpha_num12
|
43
|
+
|
44
|
+
attribute :alpha_num4, AlphaNum4
|
45
|
+
attribute :alpha_num12, AlphaNum12
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct
|
9
|
+
# {
|
10
|
+
# opaque assetCode[12];
|
11
|
+
# AccountID issuer;
|
12
|
+
# }
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class Asset
|
17
|
+
class AlphaNum12 < XDR::Struct
|
18
|
+
attribute :asset_code, XDR::Opaque[12]
|
19
|
+
attribute :issuer, AccountID
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct
|
9
|
+
# {
|
10
|
+
# opaque assetCode[4];
|
11
|
+
# AccountID issuer;
|
12
|
+
# }
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class Asset
|
17
|
+
class AlphaNum4 < XDR::Struct
|
18
|
+
attribute :asset_code, XDR::Opaque[4]
|
19
|
+
attribute :issuer, AccountID
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum AssetType
|
9
|
+
# {
|
10
|
+
# ASSET_TYPE_NATIVE = 0,
|
11
|
+
# ASSET_TYPE_CREDIT_ALPHANUM4 = 1,
|
12
|
+
# ASSET_TYPE_CREDIT_ALPHANUM12 = 2
|
13
|
+
# };
|
14
|
+
#
|
15
|
+
# ===========================================================================
|
16
|
+
module Stellar
|
17
|
+
class AssetType < XDR::Enum
|
18
|
+
member :asset_type_native, 0
|
19
|
+
member :asset_type_credit_alphanum4, 1
|
20
|
+
member :asset_type_credit_alphanum12, 2
|
21
|
+
|
22
|
+
seal
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union BucketEntry switch (BucketEntryType type)
|
9
|
+
# {
|
10
|
+
# case LIVEENTRY:
|
11
|
+
# LedgerEntry liveEntry;
|
12
|
+
#
|
13
|
+
# case DEADENTRY:
|
14
|
+
# LedgerKey deadEntry;
|
15
|
+
# };
|
16
|
+
#
|
17
|
+
# ===========================================================================
|
18
|
+
module Stellar
|
19
|
+
class BucketEntry < XDR::Union
|
20
|
+
switch_on BucketEntryType, :type
|
21
|
+
|
22
|
+
switch :liveentry, :live_entry
|
23
|
+
switch :deadentry, :dead_entry
|
24
|
+
|
25
|
+
attribute :live_entry, LedgerEntry
|
26
|
+
attribute :dead_entry, LedgerKey
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum BucketEntryType
|
9
|
+
# {
|
10
|
+
# LIVEENTRY = 0,
|
11
|
+
# DEADENTRY = 1
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class BucketEntryType < XDR::Enum
|
17
|
+
member :liveentry, 0
|
18
|
+
member :deadentry, 1
|
19
|
+
|
20
|
+
seal
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct ChangeTrustOp
|
9
|
+
# {
|
10
|
+
# Asset line;
|
11
|
+
#
|
12
|
+
# // if limit is set to 0, deletes the trust line
|
13
|
+
# int64 limit;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class ChangeTrustOp < XDR::Struct
|
19
|
+
attribute :line, Asset
|
20
|
+
attribute :limit, Int64
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union ChangeTrustResult switch (ChangeTrustResultCode code)
|
9
|
+
# {
|
10
|
+
# case CHANGE_TRUST_SUCCESS:
|
11
|
+
# void;
|
12
|
+
# default:
|
13
|
+
# void;
|
14
|
+
# };
|
15
|
+
#
|
16
|
+
# ===========================================================================
|
17
|
+
module Stellar
|
18
|
+
class ChangeTrustResult < XDR::Union
|
19
|
+
switch_on ChangeTrustResultCode, :code
|
20
|
+
|
21
|
+
switch :change_trust_success
|
22
|
+
switch :default
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum ChangeTrustResultCode
|
9
|
+
# {
|
10
|
+
# // codes considered as "success" for the operation
|
11
|
+
# CHANGE_TRUST_SUCCESS = 0,
|
12
|
+
# // codes considered as "failure" for the operation
|
13
|
+
# CHANGE_TRUST_MALFORMED = -1, // bad input
|
14
|
+
# CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer
|
15
|
+
# CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance
|
16
|
+
# CHANGE_TRUST_LOW_RESERVE = -4 // not enough funds to create a new trust line
|
17
|
+
# };
|
18
|
+
#
|
19
|
+
# ===========================================================================
|
20
|
+
module Stellar
|
21
|
+
class ChangeTrustResultCode < XDR::Enum
|
22
|
+
member :change_trust_success, 0
|
23
|
+
member :change_trust_malformed, -1
|
24
|
+
member :change_trust_no_issuer, -2
|
25
|
+
member :change_trust_invalid_limit, -3
|
26
|
+
member :change_trust_low_reserve, -4
|
27
|
+
|
28
|
+
seal
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct ClaimOfferAtom
|
9
|
+
# {
|
10
|
+
# // emited to identify the offer
|
11
|
+
# AccountID sellerID; // Account that owns the offer
|
12
|
+
# uint64 offerID;
|
13
|
+
#
|
14
|
+
# // amount and asset taken from the owner
|
15
|
+
# Asset assetSold;
|
16
|
+
# int64 amountSold;
|
17
|
+
#
|
18
|
+
# // amount and asset sent to the owner
|
19
|
+
# Asset assetBought;
|
20
|
+
# int64 amountBought;
|
21
|
+
# };
|
22
|
+
#
|
23
|
+
# ===========================================================================
|
24
|
+
module Stellar
|
25
|
+
class ClaimOfferAtom < XDR::Struct
|
26
|
+
attribute :seller_id, AccountID
|
27
|
+
attribute :offer_id, Uint64
|
28
|
+
attribute :asset_sold, Asset
|
29
|
+
attribute :amount_sold, Int64
|
30
|
+
attribute :asset_bought, Asset
|
31
|
+
attribute :amount_bought, Int64
|
32
|
+
end
|
33
|
+
end
|