diff --git a/.codeclimate.yml b/.codeclimate.yml
index ba3b076f..36f0aba6 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -7,6 +7,8 @@ plugins:
markdownlint:
enabled: true
exclude_patterns:
+- "**/*.x"
+- "**/LICENSE"
- "**/generated/"
- "**/examples/"
- "**/spec/"
diff --git a/.editorconfig b/.editorconfig
index 0e449941..a2a12188 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -7,10 +7,10 @@ root = true
[*]
end_of_line = lf
trim_trailing_whitespace = true
+indent_size = 2
+indent_style = space
insert_final_newline = true
-[*.{rb,js,yml,yaml}]
+[*.{rb,rake,js,json,yml,yaml,md}]
charset = utf-8
-indent_style = space
-indent_size = 2
max_line_length = 120
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2c5dd926..85bf0f21 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,9 +25,9 @@ ask contributors to follow so that we can merge your changes quickly.
* Sign the Contributor License Agreement
* Push your changes to a topic branch in your fork of the repository.
* Submit a pull request to the corresponding repository in the Stellar organization.
- * Include a descriptive [commit message](https://github.com/erlang/otp/wiki/Writing-good-commit-messages).
- * Changes contributed via pull request should focus on a single issue at a time.
- * Rebase your local changes against the master branch. Resolve any conflicts that arise.
+ * Include a descriptive [commit message](https://github.com/erlang/otp/wiki/Writing-good-commit-messages).
+ * Changes contributed via pull request should focus on a single issue at a time.
+ * Rebase your local changes against the master branch. Resolve any conflicts that arise.
At this point you're waiting on us. We like to at least comment on pull requests within three
business days. We may suggest some changes or improvements or alternatives.
diff --git a/Gemfile.lock b/Gemfile.lock
index 2653ba47..ee8a9c14 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -285,4 +285,4 @@ DEPENDENCIES
yard-junk
BUNDLED WITH
- 2.4.15
+ 2.5.5
diff --git a/base/Stellar.x b/base/Stellar.x
index 2529b266..e853cb68 100644
--- a/base/Stellar.x
+++ b/base/Stellar.x
@@ -14,6 +14,9 @@ typedef int int32;
typedef unsigned hyper uint64;
typedef hyper int64;
+typedef uint64 TimePoint;
+typedef uint64 Duration;
+
// An ExtensionPoint is always marshaled as a 32-bit 0 value. At a
// later point, it can be replaced by a different union so as to
// extend a structure.
@@ -79,6 +82,7 @@ typedef opaque Signature<64>;
typedef opaque SignatureHint[4];
typedef PublicKey NodeID;
+typedef PublicKey AccountID;
struct Curve25519Secret
{
@@ -101,22 +105,838 @@ struct HmacSha256Mac
};
}
+// Copyright 2022 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 "xdr/Stellar-types.h"
+namespace stellar
+{
+
+// We fix a maximum of 128 value types in the system for two reasons: we want to
+// keep the codes relatively small (<= 8 bits) when bit-packing values into a
+// u64 at the environment interface level, so that we keep many bits for
+// payloads (small strings, small numeric values, object handles); and then we
+// actually want to go one step further and ensure (for code-size) that our
+// codes fit in a single ULEB128-code byte, which means we can only use 7 bits.
+//
+// We also reserve several type codes from this space because we want to _reuse_
+// the SCValType codes at the environment interface level (or at least not
+// exceed its number-space) but there are more types at that level, assigned to
+// optimizations/special case representations of values abstract at this level.
+
+enum SCValType
+{
+ SCV_BOOL = 0,
+ SCV_VOID = 1,
+ SCV_ERROR = 2,
+
+ // 32 bits is the smallest type in WASM or XDR; no need for u8/u16.
+ SCV_U32 = 3,
+ SCV_I32 = 4,
+
+ // 64 bits is naturally supported by both WASM and XDR also.
+ SCV_U64 = 5,
+ SCV_I64 = 6,
+
+ // Time-related u64 subtypes with their own functions and formatting.
+ SCV_TIMEPOINT = 7,
+ SCV_DURATION = 8,
+
+ // 128 bits is naturally supported by Rust and we use it for Soroban
+ // fixed-point arithmetic prices / balances / similar "quantities". These
+ // are represented in XDR as a pair of 2 u64s.
+ SCV_U128 = 9,
+ SCV_I128 = 10,
+
+ // 256 bits is the size of sha256 output, ed25519 keys, and the EVM machine
+ // word, so for interop use we include this even though it requires a small
+ // amount of Rust guest and/or host library code.
+ SCV_U256 = 11,
+ SCV_I256 = 12,
+
+ // Bytes come in 3 flavors, 2 of which have meaningfully different
+ // formatting and validity-checking / domain-restriction.
+ SCV_BYTES = 13,
+ SCV_STRING = 14,
+ SCV_SYMBOL = 15,
+
+ // Vecs and maps are just polymorphic containers of other ScVals.
+ SCV_VEC = 16,
+ SCV_MAP = 17,
+
+ // Address is the universal identifier for contracts and classic
+ // accounts.
+ SCV_ADDRESS = 18,
+
+ // The following are the internal SCVal variants that are not
+ // exposed to the contracts.
+ SCV_CONTRACT_INSTANCE = 19,
+
+ // SCV_LEDGER_KEY_CONTRACT_INSTANCE and SCV_LEDGER_KEY_NONCE are unique
+ // symbolic SCVals used as the key for ledger entries for a contract's
+ // instance and an address' nonce, respectively.
+ SCV_LEDGER_KEY_CONTRACT_INSTANCE = 20,
+ SCV_LEDGER_KEY_NONCE = 21
+};
+
+enum SCErrorType
+{
+ SCE_CONTRACT = 0, // Contract-specific, user-defined codes.
+ SCE_WASM_VM = 1, // Errors while interpreting WASM bytecode.
+ SCE_CONTEXT = 2, // Errors in the contract's host context.
+ SCE_STORAGE = 3, // Errors accessing host storage.
+ SCE_OBJECT = 4, // Errors working with host objects.
+ SCE_CRYPTO = 5, // Errors in cryptographic operations.
+ SCE_EVENTS = 6, // Errors while emitting events.
+ SCE_BUDGET = 7, // Errors relating to budget limits.
+ SCE_VALUE = 8, // Errors working with host values or SCVals.
+ SCE_AUTH = 9 // Errors from the authentication subsystem.
+};
+
+enum SCErrorCode
+{
+ SCEC_ARITH_DOMAIN = 0, // Some arithmetic was undefined (overflow, divide-by-zero).
+ SCEC_INDEX_BOUNDS = 1, // Something was indexed beyond its bounds.
+ SCEC_INVALID_INPUT = 2, // User provided some otherwise-bad data.
+ SCEC_MISSING_VALUE = 3, // Some value was required but not provided.
+ SCEC_EXISTING_VALUE = 4, // Some value was provided where not allowed.
+ SCEC_EXCEEDED_LIMIT = 5, // Some arbitrary limit -- gas or otherwise -- was hit.
+ SCEC_INVALID_ACTION = 6, // Data was valid but action requested was not.
+ SCEC_INTERNAL_ERROR = 7, // The host detected an error in its own logic.
+ SCEC_UNEXPECTED_TYPE = 8, // Some type wasn't as expected.
+ SCEC_UNEXPECTED_SIZE = 9 // Something's size wasn't as expected.
+};
+
+// Smart contract errors are split into a type (SCErrorType) and a code. When an
+// error is of type SCE_CONTRACT it carries a user-defined uint32 code that
+// Soroban assigns no specific meaning to. In all other cases, the type
+// specifies a subsystem of the Soroban host where the error originated, and the
+// accompanying code is an SCErrorCode, each of which specifies a slightly more
+// precise class of errors within that subsystem.
+//
+// Error types and codes are not maximally precise; there is a tradeoff between
+// precision and flexibility in the implementation, and the granularity here is
+// chosen to be adequate for most purposes while not placing a burden on future
+// system evolution and maintenance. When additional precision is needed for
+// debugging, Soroban can be run with diagnostic events enabled.
+
+union SCError switch (SCErrorType type)
+{
+case SCE_CONTRACT:
+ uint32 contractCode;
+case SCE_WASM_VM:
+case SCE_CONTEXT:
+case SCE_STORAGE:
+case SCE_OBJECT:
+case SCE_CRYPTO:
+case SCE_EVENTS:
+case SCE_BUDGET:
+case SCE_VALUE:
+case SCE_AUTH:
+ SCErrorCode code;
+};
+
+struct UInt128Parts {
+ uint64 hi;
+ uint64 lo;
+};
+
+// A signed int128 has a high sign bit and 127 value bits. We break it into a
+// signed high int64 (that carries the sign bit and the high 63 value bits) and
+// a low unsigned uint64 that carries the low 64 bits. This will sort in
+// generated code in the same order the underlying int128 sorts.
+struct Int128Parts {
+ int64 hi;
+ uint64 lo;
+};
+
+struct UInt256Parts {
+ uint64 hi_hi;
+ uint64 hi_lo;
+ uint64 lo_hi;
+ uint64 lo_lo;
+};
+
+// A signed int256 has a high sign bit and 255 value bits. We break it into a
+// signed high int64 (that carries the sign bit and the high 63 value bits) and
+// three low unsigned `uint64`s that carry the lower bits. This will sort in
+// generated code in the same order the underlying int256 sorts.
+struct Int256Parts {
+ int64 hi_hi;
+ uint64 hi_lo;
+ uint64 lo_hi;
+ uint64 lo_lo;
+};
+
+enum ContractExecutableType
+{
+ CONTRACT_EXECUTABLE_WASM = 0,
+ CONTRACT_EXECUTABLE_STELLAR_ASSET = 1
+};
+
+union ContractExecutable switch (ContractExecutableType type)
+{
+case CONTRACT_EXECUTABLE_WASM:
+ Hash wasm_hash;
+case CONTRACT_EXECUTABLE_STELLAR_ASSET:
+ void;
+};
+
+enum SCAddressType
+{
+ SC_ADDRESS_TYPE_ACCOUNT = 0,
+ SC_ADDRESS_TYPE_CONTRACT = 1
+};
+
+union SCAddress switch (SCAddressType type)
+{
+case SC_ADDRESS_TYPE_ACCOUNT:
+ AccountID accountId;
+case SC_ADDRESS_TYPE_CONTRACT:
+ Hash contractId;
+};
+
+%struct SCVal;
+%struct SCMapEntry;
+
+const SCSYMBOL_LIMIT = 32;
+
+typedef SCVal SCVec<>;
+typedef SCMapEntry SCMap<>;
+
+typedef opaque SCBytes<>;
+typedef string SCString<>;
+typedef string SCSymbol;
+
+struct SCNonceKey {
+ int64 nonce;
+};
+
+struct SCContractInstance {
+ ContractExecutable executable;
+ SCMap* storage;
+};
+
+union SCVal switch (SCValType type)
+{
+
+case SCV_BOOL:
+ bool b;
+case SCV_VOID:
+ void;
+case SCV_ERROR:
+ SCError error;
+
+case SCV_U32:
+ uint32 u32;
+case SCV_I32:
+ int32 i32;
+
+case SCV_U64:
+ uint64 u64;
+case SCV_I64:
+ int64 i64;
+case SCV_TIMEPOINT:
+ TimePoint timepoint;
+case SCV_DURATION:
+ Duration duration;
+
+case SCV_U128:
+ UInt128Parts u128;
+case SCV_I128:
+ Int128Parts i128;
+
+case SCV_U256:
+ UInt256Parts u256;
+case SCV_I256:
+ Int256Parts i256;
+
+case SCV_BYTES:
+ SCBytes bytes;
+case SCV_STRING:
+ SCString str;
+case SCV_SYMBOL:
+ SCSymbol sym;
+
+// Vec and Map are recursive so need to live
+// behind an option, due to xdrpp limitations.
+case SCV_VEC:
+ SCVec *vec;
+case SCV_MAP:
+ SCMap *map;
+
+case SCV_ADDRESS:
+ SCAddress address;
+
+// Special SCVals reserved for system-constructed contract-data
+// ledger keys, not generally usable elsewhere.
+case SCV_LEDGER_KEY_CONTRACT_INSTANCE:
+ void;
+case SCV_LEDGER_KEY_NONCE:
+ SCNonceKey nonce_key;
+
+case SCV_CONTRACT_INSTANCE:
+ SCContractInstance instance;
+};
+
+struct SCMapEntry
+{
+ SCVal key;
+ SCVal val;
+};
+
+}
+
+%#include "xdr/Stellar-types.h"
+
+namespace stellar {
+// General “Soroban execution lane” settings
+struct ConfigSettingContractExecutionLanesV0
+{
+ // maximum number of Soroban transactions per ledger
+ uint32 ledgerMaxTxCount;
+};
+
+// "Compute" settings for contracts (instructions and memory).
+struct ConfigSettingContractComputeV0
+{
+ // Maximum instructions per ledger
+ int64 ledgerMaxInstructions;
+ // Maximum instructions per transaction
+ int64 txMaxInstructions;
+ // Cost of 10000 instructions
+ int64 feeRatePerInstructionsIncrement;
+
+ // Memory limit per transaction. Unlike instructions, there is no fee
+ // for memory, just the limit.
+ uint32 txMemoryLimit;
+};
+
+// Ledger access settings for contracts.
+struct ConfigSettingContractLedgerCostV0
+{
+ // Maximum number of ledger entry read operations per ledger
+ uint32 ledgerMaxReadLedgerEntries;
+ // Maximum number of bytes that can be read per ledger
+ uint32 ledgerMaxReadBytes;
+ // Maximum number of ledger entry write operations per ledger
+ uint32 ledgerMaxWriteLedgerEntries;
+ // Maximum number of bytes that can be written per ledger
+ uint32 ledgerMaxWriteBytes;
+
+ // Maximum number of ledger entry read operations per transaction
+ uint32 txMaxReadLedgerEntries;
+ // Maximum number of bytes that can be read per transaction
+ uint32 txMaxReadBytes;
+ // Maximum number of ledger entry write operations per transaction
+ uint32 txMaxWriteLedgerEntries;
+ // Maximum number of bytes that can be written per transaction
+ uint32 txMaxWriteBytes;
+
+ int64 feeReadLedgerEntry; // Fee per ledger entry read
+ int64 feeWriteLedgerEntry; // Fee per ledger entry write
+
+ int64 feeRead1KB; // Fee for reading 1KB
+
+ // The following parameters determine the write fee per 1KB.
+ // Write fee grows linearly until bucket list reaches this size
+ int64 bucketListTargetSizeBytes;
+ // Fee per 1KB write when the bucket list is empty
+ int64 writeFee1KBBucketListLow;
+ // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes`
+ int64 writeFee1KBBucketListHigh;
+ // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes`
+ uint32 bucketListWriteFeeGrowthFactor;
+};
+
+// Historical data (pushed to core archives) settings for contracts.
+struct ConfigSettingContractHistoricalDataV0
+{
+ int64 feeHistorical1KB; // Fee for storing 1KB in archives
+};
+
+// Contract event-related settings.
+struct ConfigSettingContractEventsV0
+{
+ // Maximum size of events that a contract call can emit.
+ uint32 txMaxContractEventsSizeBytes;
+ // Fee for generating 1KB of contract events.
+ int64 feeContractEvents1KB;
+};
+
+// Bandwidth related data settings for contracts.
+// We consider bandwidth to only be consumed by the transaction envelopes, hence
+// this concerns only transaction sizes.
+struct ConfigSettingContractBandwidthV0
+{
+ // Maximum sum of all transaction sizes in the ledger in bytes
+ uint32 ledgerMaxTxsSizeBytes;
+ // Maximum size in bytes for a transaction
+ uint32 txMaxSizeBytes;
+
+ // Fee for 1 KB of transaction size
+ int64 feeTxSize1KB;
+};
+
+enum ContractCostType {
+ // Cost of running 1 wasm instruction
+ WasmInsnExec = 0,
+ // Cost of allocating a slice of memory (in bytes)
+ MemAlloc = 1,
+ // Cost of copying a slice of bytes into a pre-allocated memory
+ MemCpy = 2,
+ // Cost of comparing two slices of memory
+ MemCmp = 3,
+ // Cost of a host function dispatch, not including the actual work done by
+ // the function nor the cost of VM invocation machinary
+ DispatchHostFunction = 4,
+ // Cost of visiting a host object from the host object storage. Exists to
+ // make sure some baseline cost coverage, i.e. repeatly visiting objects
+ // by the guest will always incur some charges.
+ VisitObject = 5,
+ // Cost of serializing an xdr object to bytes
+ ValSer = 6,
+ // Cost of deserializing an xdr object from bytes
+ ValDeser = 7,
+ // Cost of computing the sha256 hash from bytes
+ ComputeSha256Hash = 8,
+ // Cost of computing the ed25519 pubkey from bytes
+ ComputeEd25519PubKey = 9,
+ // Cost of verifying ed25519 signature of a payload.
+ VerifyEd25519Sig = 10,
+ // Cost of instantiation a VM from wasm bytes code.
+ VmInstantiation = 11,
+ // Cost of instantiation a VM from a cached state.
+ VmCachedInstantiation = 12,
+ // Cost of invoking a function on the VM. If the function is a host function,
+ // additional cost will be covered by `DispatchHostFunction`.
+ InvokeVmFunction = 13,
+ // Cost of computing a keccak256 hash from bytes.
+ ComputeKeccak256Hash = 14,
+ // Cost of computing an ECDSA secp256k1 signature from bytes.
+ ComputeEcdsaSecp256k1Sig = 15,
+ // Cost of recovering an ECDSA secp256k1 key from a signature.
+ RecoverEcdsaSecp256k1Key = 16,
+ // Cost of int256 addition (`+`) and subtraction (`-`) operations
+ Int256AddSub = 17,
+ // Cost of int256 multiplication (`*`) operation
+ Int256Mul = 18,
+ // Cost of int256 division (`/`) operation
+ Int256Div = 19,
+ // Cost of int256 power (`exp`) operation
+ Int256Pow = 20,
+ // Cost of int256 shift (`shl`, `shr`) operation
+ Int256Shift = 21,
+ // Cost of drawing random bytes using a ChaCha20 PRNG
+ ChaCha20DrawBytes = 22
+};
+
+struct ContractCostParamEntry {
+ // use `ext` to add more terms (e.g. higher order polynomials) in the future
+ ExtensionPoint ext;
+
+ int64 constTerm;
+ int64 linearTerm;
+};
+
+struct StateArchivalSettings {
+ uint32 maxEntryTTL;
+ uint32 minTemporaryTTL;
+ uint32 minPersistentTTL;
+
+ // rent_fee = wfee_rate_average / rent_rate_denominator_for_type
+ int64 persistentRentRateDenominator;
+ int64 tempRentRateDenominator;
+
+ // max number of entries that emit archival meta in a single ledger
+ uint32 maxEntriesToArchive;
+
+ // Number of snapshots to use when calculating average BucketList size
+ uint32 bucketListSizeWindowSampleSize;
+
+ // Maximum number of bytes that we scan for eviction per ledger
+ uint64 evictionScanSize;
+
+ // Lowest BucketList level to be scanned to evict entries
+ uint32 startingEvictionScanLevel;
+};
+
+struct EvictionIterator {
+ uint32 bucketListLevel;
+ bool isCurrBucket;
+ uint64 bucketFileOffset;
+};
+
+// limits the ContractCostParams size to 20kB
+const CONTRACT_COST_COUNT_LIMIT = 1024;
+
+typedef ContractCostParamEntry ContractCostParams;
+
+// Identifiers of all the network settings.
+enum ConfigSettingID
+{
+ CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0,
+ CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1,
+ CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2,
+ CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3,
+ CONFIG_SETTING_CONTRACT_EVENTS_V0 = 4,
+ CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5,
+ CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS = 6,
+ CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7,
+ CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8,
+ CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9,
+ CONFIG_SETTING_STATE_ARCHIVAL = 10,
+ CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11,
+ CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12,
+ CONFIG_SETTING_EVICTION_ITERATOR = 13
+};
+
+union ConfigSettingEntry switch (ConfigSettingID configSettingID)
+{
+case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES:
+ uint32 contractMaxSizeBytes;
+case CONFIG_SETTING_CONTRACT_COMPUTE_V0:
+ ConfigSettingContractComputeV0 contractCompute;
+case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0:
+ ConfigSettingContractLedgerCostV0 contractLedgerCost;
+case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0:
+ ConfigSettingContractHistoricalDataV0 contractHistoricalData;
+case CONFIG_SETTING_CONTRACT_EVENTS_V0:
+ ConfigSettingContractEventsV0 contractEvents;
+case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0:
+ ConfigSettingContractBandwidthV0 contractBandwidth;
+case CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS:
+ ContractCostParams contractCostParamsCpuInsns;
+case CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES:
+ ContractCostParams contractCostParamsMemBytes;
+case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES:
+ uint32 contractDataKeySizeBytes;
+case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES:
+ uint32 contractDataEntrySizeBytes;
+case CONFIG_SETTING_STATE_ARCHIVAL:
+ StateArchivalSettings stateArchivalSettings;
+case CONFIG_SETTING_CONTRACT_EXECUTION_LANES:
+ ConfigSettingContractExecutionLanesV0 contractExecutionLanes;
+case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW:
+ uint64 bucketListSizeWindow<>;
+case CONFIG_SETTING_EVICTION_ITERATOR:
+ EvictionIterator evictionIterator;
+};
+}
+
+// Copyright 2022 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
+
+// The contract spec XDR is highly experimental, incomplete, and still being
+// iterated on. Breaking changes expected.
+
+% #include "xdr/Stellar-types.h"
+namespace stellar
+{
+
+enum SCEnvMetaKind
+{
+ SC_ENV_META_KIND_INTERFACE_VERSION = 0
+};
+
+union SCEnvMetaEntry switch (SCEnvMetaKind kind)
+{
+case SC_ENV_META_KIND_INTERFACE_VERSION:
+ uint64 interfaceVersion;
+};
+
+}
+
+// Copyright 2022 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
+
+// The contract meta XDR is highly experimental, incomplete, and still being
+// iterated on. Breaking changes expected.
+
+% #include "xdr/Stellar-types.h"
+namespace stellar
+{
+
+struct SCMetaV0
+{
+ string key<>;
+ string val<>;
+};
+
+enum SCMetaKind
+{
+ SC_META_V0 = 0
+};
+
+union SCMetaEntry switch (SCMetaKind kind)
+{
+case SC_META_V0:
+ SCMetaV0 v0;
+};
+
+}
+
+// Copyright 2022 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
+
+// The contract Contractspec XDR is highly experimental, incomplete, and still being
+// iterated on. Breaking changes expected.
+
+% #include "xdr/Stellar-types.h"
+% #include "xdr/Stellar-contract.h"
+namespace stellar
+{
+
+const SC_SPEC_DOC_LIMIT = 1024;
+
+enum SCSpecType
+{
+ SC_SPEC_TYPE_VAL = 0,
+
+ // Types with no parameters.
+ SC_SPEC_TYPE_BOOL = 1,
+ SC_SPEC_TYPE_VOID = 2,
+ SC_SPEC_TYPE_ERROR = 3,
+ SC_SPEC_TYPE_U32 = 4,
+ SC_SPEC_TYPE_I32 = 5,
+ SC_SPEC_TYPE_U64 = 6,
+ SC_SPEC_TYPE_I64 = 7,
+ SC_SPEC_TYPE_TIMEPOINT = 8,
+ SC_SPEC_TYPE_DURATION = 9,
+ SC_SPEC_TYPE_U128 = 10,
+ SC_SPEC_TYPE_I128 = 11,
+ SC_SPEC_TYPE_U256 = 12,
+ SC_SPEC_TYPE_I256 = 13,
+ SC_SPEC_TYPE_BYTES = 14,
+ SC_SPEC_TYPE_STRING = 16,
+ SC_SPEC_TYPE_SYMBOL = 17,
+ SC_SPEC_TYPE_ADDRESS = 19,
+
+ // Types with parameters.
+ SC_SPEC_TYPE_OPTION = 1000,
+ SC_SPEC_TYPE_RESULT = 1001,
+ SC_SPEC_TYPE_VEC = 1002,
+ SC_SPEC_TYPE_MAP = 1004,
+ SC_SPEC_TYPE_TUPLE = 1005,
+ SC_SPEC_TYPE_BYTES_N = 1006,
+
+ // User defined types.
+ SC_SPEC_TYPE_UDT = 2000
+};
+
+struct SCSpecTypeOption
+{
+ SCSpecTypeDef valueType;
+};
+
+struct SCSpecTypeResult
+{
+ SCSpecTypeDef okType;
+ SCSpecTypeDef errorType;
+};
+
+struct SCSpecTypeVec
+{
+ SCSpecTypeDef elementType;
+};
+
+struct SCSpecTypeMap
+{
+ SCSpecTypeDef keyType;
+ SCSpecTypeDef valueType;
+};
+
+struct SCSpecTypeTuple
+{
+ SCSpecTypeDef valueTypes<12>;
+};
+
+struct SCSpecTypeBytesN
+{
+ uint32 n;
+};
+
+struct SCSpecTypeUDT
+{
+ string name<60>;
+};
+
+union SCSpecTypeDef switch (SCSpecType type)
+{
+case SC_SPEC_TYPE_VAL:
+case SC_SPEC_TYPE_BOOL:
+case SC_SPEC_TYPE_VOID:
+case SC_SPEC_TYPE_ERROR:
+case SC_SPEC_TYPE_U32:
+case SC_SPEC_TYPE_I32:
+case SC_SPEC_TYPE_U64:
+case SC_SPEC_TYPE_I64:
+case SC_SPEC_TYPE_TIMEPOINT:
+case SC_SPEC_TYPE_DURATION:
+case SC_SPEC_TYPE_U128:
+case SC_SPEC_TYPE_I128:
+case SC_SPEC_TYPE_U256:
+case SC_SPEC_TYPE_I256:
+case SC_SPEC_TYPE_BYTES:
+case SC_SPEC_TYPE_STRING:
+case SC_SPEC_TYPE_SYMBOL:
+case SC_SPEC_TYPE_ADDRESS:
+ void;
+case SC_SPEC_TYPE_OPTION:
+ SCSpecTypeOption option;
+case SC_SPEC_TYPE_RESULT:
+ SCSpecTypeResult result;
+case SC_SPEC_TYPE_VEC:
+ SCSpecTypeVec vec;
+case SC_SPEC_TYPE_MAP:
+ SCSpecTypeMap map;
+case SC_SPEC_TYPE_TUPLE:
+ SCSpecTypeTuple tuple;
+case SC_SPEC_TYPE_BYTES_N:
+ SCSpecTypeBytesN bytesN;
+case SC_SPEC_TYPE_UDT:
+ SCSpecTypeUDT udt;
+};
+
+struct SCSpecUDTStructFieldV0
+{
+ string doc;
+ string name<30>;
+ SCSpecTypeDef type;
+};
+
+struct SCSpecUDTStructV0
+{
+ string doc;
+ string lib<80>;
+ string name<60>;
+ SCSpecUDTStructFieldV0 fields<40>;
+};
+
+struct SCSpecUDTUnionCaseVoidV0
+{
+ string doc;
+ string name<60>;
+};
+
+struct SCSpecUDTUnionCaseTupleV0
+{
+ string doc;
+ string name<60>;
+ SCSpecTypeDef type<12>;
+};
+
+enum SCSpecUDTUnionCaseV0Kind
+{
+ SC_SPEC_UDT_UNION_CASE_VOID_V0 = 0,
+ SC_SPEC_UDT_UNION_CASE_TUPLE_V0 = 1
+};
+
+union SCSpecUDTUnionCaseV0 switch (SCSpecUDTUnionCaseV0Kind kind)
+{
+case SC_SPEC_UDT_UNION_CASE_VOID_V0:
+ SCSpecUDTUnionCaseVoidV0 voidCase;
+case SC_SPEC_UDT_UNION_CASE_TUPLE_V0:
+ SCSpecUDTUnionCaseTupleV0 tupleCase;
+};
+
+struct SCSpecUDTUnionV0
+{
+ string doc;
+ string lib<80>;
+ string name<60>;
+ SCSpecUDTUnionCaseV0 cases<50>;
+};
+
+struct SCSpecUDTEnumCaseV0
+{
+ string doc;
+ string name<60>;
+ uint32 value;
+};
+
+struct SCSpecUDTEnumV0
+{
+ string doc;
+ string lib<80>;
+ string name<60>;
+ SCSpecUDTEnumCaseV0 cases<50>;
+};
+
+struct SCSpecUDTErrorEnumCaseV0
+{
+ string doc;
+ string name<60>;
+ uint32 value;
+};
+
+struct SCSpecUDTErrorEnumV0
+{
+ string doc;
+ string lib<80>;
+ string name<60>;
+ SCSpecUDTErrorEnumCaseV0 cases<50>;
+};
+
+struct SCSpecFunctionInputV0
+{
+ string doc;
+ string name<30>;
+ SCSpecTypeDef type;
+};
+
+struct SCSpecFunctionV0
+{
+ string doc;
+ SCSymbol name;
+ SCSpecFunctionInputV0 inputs<10>;
+ SCSpecTypeDef outputs<1>;
+};
+
+enum SCSpecEntryKind
+{
+ SC_SPEC_ENTRY_FUNCTION_V0 = 0,
+ SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1,
+ SC_SPEC_ENTRY_UDT_UNION_V0 = 2,
+ SC_SPEC_ENTRY_UDT_ENUM_V0 = 3,
+ SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4
+};
+
+union SCSpecEntry switch (SCSpecEntryKind kind)
+{
+case SC_SPEC_ENTRY_FUNCTION_V0:
+ SCSpecFunctionV0 functionV0;
+case SC_SPEC_ENTRY_UDT_STRUCT_V0:
+ SCSpecUDTStructV0 udtStructV0;
+case SC_SPEC_ENTRY_UDT_UNION_V0:
+ SCSpecUDTUnionV0 udtUnionV0;
+case SC_SPEC_ENTRY_UDT_ENUM_V0:
+ SCSpecUDTEnumV0 udtEnumV0;
+case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0:
+ SCSpecUDTErrorEnumV0 udtErrorEnumV0;
+};
+
+}
+
// 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 "xdr/Stellar-types.h"
+%#include "xdr/Stellar-contract.h"
+%#include "xdr/Stellar-contract-config-setting.h"
namespace stellar
{
-typedef PublicKey AccountID;
typedef opaque Thresholds[4];
typedef string string32<32>;
typedef string string64<64>;
typedef int64 SequenceNumber;
-typedef uint64 TimePoint;
-typedef uint64 Duration;
typedef opaque DataValue<64>;
typedef Hash PoolID; // SHA256(LiquidityPoolParameters)
@@ -201,7 +1021,11 @@ enum LedgerEntryType
OFFER = 2,
DATA = 3,
CLAIMABLE_BALANCE = 4,
- LIQUIDITY_POOL = 5
+ LIQUIDITY_POOL = 5,
+ CONTRACT_DATA = 6,
+ CONTRACT_CODE = 7,
+ CONFIG_SETTING = 8,
+ TTL = 9
};
struct Signer
@@ -594,6 +1418,33 @@ struct LiquidityPoolEntry
body;
};
+enum ContractDataDurability {
+ TEMPORARY = 0,
+ PERSISTENT = 1
+};
+
+struct ContractDataEntry {
+ ExtensionPoint ext;
+
+ SCAddress contract;
+ SCVal key;
+ ContractDataDurability durability;
+ SCVal val;
+};
+
+struct ContractCodeEntry {
+ ExtensionPoint ext;
+
+ Hash hash;
+ opaque code<>;
+};
+
+struct TTLEntry {
+ // Hash of the LedgerKey that is associated with this TTLEntry
+ Hash keyHash;
+ uint32 liveUntilLedgerSeq;
+};
+
struct LedgerEntryExtensionV1
{
SponsorshipDescriptor sponsoringID;
@@ -624,6 +1475,14 @@ struct LedgerEntry
ClaimableBalanceEntry claimableBalance;
case LIQUIDITY_POOL:
LiquidityPoolEntry liquidityPool;
+ case CONTRACT_DATA:
+ ContractDataEntry contractData;
+ case CONTRACT_CODE:
+ ContractCodeEntry contractCode;
+ case CONFIG_SETTING:
+ ConfigSettingEntry configSetting;
+ case TTL:
+ TTLEntry ttl;
}
data;
@@ -678,6 +1537,29 @@ case LIQUIDITY_POOL:
{
PoolID liquidityPoolID;
} liquidityPool;
+case CONTRACT_DATA:
+ struct
+ {
+ SCAddress contract;
+ SCVal key;
+ ContractDataDurability durability;
+ } contractData;
+case CONTRACT_CODE:
+ struct
+ {
+ Hash hash;
+ } contractCode;
+case CONFIG_SETTING:
+ struct
+ {
+ ConfigSettingID configSettingID;
+ } configSetting;
+case TTL:
+ struct
+ {
+ // Hash of the LedgerKey that is associated with this TTLEntry
+ Hash keyHash;
+ } ttl;
};
// list of all envelope types used in the application
@@ -692,7 +1574,9 @@ enum EnvelopeType
ENVELOPE_TYPE_SCPVALUE = 4,
ENVELOPE_TYPE_TX_FEE_BUMP = 5,
ENVELOPE_TYPE_OP_ID = 6,
- ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7
+ ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7,
+ ENVELOPE_TYPE_CONTRACT_ID = 8,
+ ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9
};
}
@@ -700,11 +1584,15 @@ enum EnvelopeType
// 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 "xdr/Stellar-contract.h"
%#include "xdr/Stellar-ledger-entries.h"
namespace stellar
{
+// maximum number of operations per transaction
+const MAX_OPS_PER_TX = 100;
+
union LiquidityPoolParameters switch (LiquidityPoolType type)
{
case LIQUIDITY_POOL_CONSTANT_PRODUCT:
@@ -755,7 +1643,10 @@ enum OperationType
CLAWBACK_CLAIMABLE_BALANCE = 20,
SET_TRUST_LINE_FLAGS = 21,
LIQUIDITY_POOL_DEPOSIT = 22,
- LIQUIDITY_POOL_WITHDRAW = 23
+ LIQUIDITY_POOL_WITHDRAW = 23,
+ INVOKE_HOST_FUNCTION = 24,
+ EXTEND_FOOTPRINT_TTL = 25,
+ RESTORE_FOOTPRINT = 26
};
/* CreateAccount
@@ -1163,6 +2054,141 @@ struct LiquidityPoolWithdrawOp
int64 minAmountB; // minimum amount of second asset to withdraw
};
+enum HostFunctionType
+{
+ HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0,
+ HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1,
+ HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2
+};
+
+enum ContractIDPreimageType
+{
+ CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0,
+ CONTRACT_ID_PREIMAGE_FROM_ASSET = 1
+};
+
+union ContractIDPreimage switch (ContractIDPreimageType type)
+{
+case CONTRACT_ID_PREIMAGE_FROM_ADDRESS:
+ struct
+ {
+ SCAddress address;
+ uint256 salt;
+ } fromAddress;
+case CONTRACT_ID_PREIMAGE_FROM_ASSET:
+ Asset fromAsset;
+};
+
+struct CreateContractArgs
+{
+ ContractIDPreimage contractIDPreimage;
+ ContractExecutable executable;
+};
+
+struct InvokeContractArgs {
+ SCAddress contractAddress;
+ SCSymbol functionName;
+ SCVal args<>;
+};
+
+union HostFunction switch (HostFunctionType type)
+{
+case HOST_FUNCTION_TYPE_INVOKE_CONTRACT:
+ InvokeContractArgs invokeContract;
+case HOST_FUNCTION_TYPE_CREATE_CONTRACT:
+ CreateContractArgs createContract;
+case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM:
+ opaque wasm<>;
+};
+
+enum SorobanAuthorizedFunctionType
+{
+ SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0,
+ SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1
+};
+
+union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type)
+{
+case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN:
+ InvokeContractArgs contractFn;
+case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN:
+ CreateContractArgs createContractHostFn;
+};
+
+struct SorobanAuthorizedInvocation
+{
+ SorobanAuthorizedFunction function;
+ SorobanAuthorizedInvocation subInvocations<>;
+};
+
+struct SorobanAddressCredentials
+{
+ SCAddress address;
+ int64 nonce;
+ uint32 signatureExpirationLedger;
+ SCVal signature;
+};
+
+enum SorobanCredentialsType
+{
+ SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0,
+ SOROBAN_CREDENTIALS_ADDRESS = 1
+};
+
+union SorobanCredentials switch (SorobanCredentialsType type)
+{
+case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT:
+ void;
+case SOROBAN_CREDENTIALS_ADDRESS:
+ SorobanAddressCredentials address;
+};
+
+/* Unit of authorization data for Soroban.
+
+ Represents an authorization for executing the tree of authorized contract
+ and/or host function calls by the user defined by `credentials`.
+*/
+struct SorobanAuthorizationEntry
+{
+ SorobanCredentials credentials;
+ SorobanAuthorizedInvocation rootInvocation;
+};
+
+/* Upload WASM, create, and invoke contracts in Soroban.
+
+ Threshold: med
+ Result: InvokeHostFunctionResult
+*/
+struct InvokeHostFunctionOp
+{
+ // Host function to invoke.
+ HostFunction hostFunction;
+ // Per-address authorizations for this host function.
+ SorobanAuthorizationEntry auth<>;
+};
+
+/* Extend the TTL of the entries specified in the readOnly footprint
+ so they will live at least extendTo ledgers from lcl.
+
+ Threshold: med
+ Result: ExtendFootprintTTLResult
+*/
+struct ExtendFootprintTTLOp
+{
+ ExtensionPoint ext;
+ uint32 extendTo;
+};
+
+/* Restore the archived entries specified in the readWrite footprint.
+
+ Threshold: med
+ Result: RestoreFootprintOp
+*/
+struct RestoreFootprintOp
+{
+ ExtensionPoint ext;
+};
+
/* An operation is the lowest unit of work that a transaction does */
struct Operation
{
@@ -1221,6 +2247,12 @@ struct Operation
LiquidityPoolDepositOp liquidityPoolDepositOp;
case LIQUIDITY_POOL_WITHDRAW:
LiquidityPoolWithdrawOp liquidityPoolWithdrawOp;
+ case INVOKE_HOST_FUNCTION:
+ InvokeHostFunctionOp invokeHostFunctionOp;
+ case EXTEND_FOOTPRINT_TTL:
+ ExtendFootprintTTLOp extendFootprintTTLOp;
+ case RESTORE_FOOTPRINT:
+ RestoreFootprintOp restoreFootprintOp;
}
body;
};
@@ -1238,11 +2270,25 @@ case ENVELOPE_TYPE_POOL_REVOKE_OP_ID:
struct
{
AccountID sourceAccount;
- SequenceNumber seqNum;
+ SequenceNumber seqNum;
uint32 opNum;
PoolID liquidityPoolID;
Asset asset;
} revokeID;
+case ENVELOPE_TYPE_CONTRACT_ID:
+ struct
+ {
+ Hash networkID;
+ ContractIDPreimage contractIDPreimage;
+ } contractID;
+case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION:
+ struct
+ {
+ Hash networkID;
+ int64 nonce;
+ uint32 signatureExpirationLedger;
+ SorobanAuthorizedInvocation invocation;
+ } sorobanAuthorization;
};
enum MemoType
@@ -1330,8 +2376,44 @@ case PRECOND_V2:
PreconditionsV2 v2;
};
-// maximum number of operations per transaction
-const MAX_OPS_PER_TX = 100;
+// Ledger key sets touched by a smart contract transaction.
+struct LedgerFootprint
+{
+ LedgerKey readOnly<>;
+ LedgerKey readWrite<>;
+};
+
+// Resource limits for a Soroban transaction.
+// The transaction will fail if it exceeds any of these limits.
+struct SorobanResources
+{
+ // The ledger footprint of the transaction.
+ LedgerFootprint footprint;
+ // The maximum number of instructions this transaction can use
+ uint32 instructions;
+
+ // The maximum number of bytes this transaction can read from ledger
+ uint32 readBytes;
+ // The maximum number of bytes this transaction can write to ledger
+ uint32 writeBytes;
+};
+
+// The transaction extension for Soroban.
+struct SorobanTransactionData
+{
+ ExtensionPoint ext;
+ SorobanResources resources;
+ // Amount of the transaction `fee` allocated to the Soroban resource fees.
+ // The fraction of `resourceFee` corresponding to `resources` specified
+ // above is *not* refundable (i.e. fees for instructions, ledger I/O), as
+ // well as fees for the transaction size.
+ // The remaining part of the fee is refundable and the charged value is
+ // based on the actual consumption of refundable resources (events, ledger
+ // rent bumps).
+ // The `inclusionFee` used for prioritization of the transaction is defined
+ // as `tx.fee - resourceFee`.
+ int64 resourceFee;
+};
// TransactionV0 is a transaction with the AccountID discriminant stripped off,
// leaving a raw ed25519 public key to identify the source account. This is used
@@ -1393,6 +2475,8 @@ struct Transaction
{
case 0:
void;
+ case 1:
+ SorobanTransactionData sorobanData;
}
ext;
};
@@ -1545,7 +2629,10 @@ union CreateAccountResult switch (CreateAccountResultCode code)
{
case CREATE_ACCOUNT_SUCCESS:
void;
-default:
+case CREATE_ACCOUNT_MALFORMED:
+case CREATE_ACCOUNT_UNDERFUNDED:
+case CREATE_ACCOUNT_LOW_RESERVE:
+case CREATE_ACCOUNT_ALREADY_EXIST:
void;
};
@@ -1572,7 +2659,15 @@ union PaymentResult switch (PaymentResultCode code)
{
case PAYMENT_SUCCESS:
void;
-default:
+case PAYMENT_MALFORMED:
+case PAYMENT_UNDERFUNDED:
+case PAYMENT_SRC_NO_TRUST:
+case PAYMENT_SRC_NOT_AUTHORIZED:
+case PAYMENT_NO_DESTINATION:
+case PAYMENT_NO_TRUST:
+case PAYMENT_NOT_AUTHORIZED:
+case PAYMENT_LINE_FULL:
+case PAYMENT_NO_ISSUER:
void;
};
@@ -1623,9 +2718,20 @@ case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS:
ClaimAtom offers<>;
SimplePaymentResult last;
} success;
+case PATH_PAYMENT_STRICT_RECEIVE_MALFORMED:
+case PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED:
+case PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST:
+case PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED:
+case PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION:
+case PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST:
+case PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED:
+case PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL:
+ void;
case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER:
Asset noIssuer; // the asset that caused the error
-default:
+case PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS:
+case PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF:
+case PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX:
void;
};
@@ -1667,9 +2773,20 @@ case PATH_PAYMENT_STRICT_SEND_SUCCESS:
ClaimAtom offers<>;
SimplePaymentResult last;
} success;
+case PATH_PAYMENT_STRICT_SEND_MALFORMED:
+case PATH_PAYMENT_STRICT_SEND_UNDERFUNDED:
+case PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST:
+case PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED:
+case PATH_PAYMENT_STRICT_SEND_NO_DESTINATION:
+case PATH_PAYMENT_STRICT_SEND_NO_TRUST:
+case PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED:
+case PATH_PAYMENT_STRICT_SEND_LINE_FULL:
+ void;
case PATH_PAYMENT_STRICT_SEND_NO_ISSUER:
Asset noIssuer; // the asset that caused the error
-default:
+case PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS:
+case PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF:
+case PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN:
void;
};
@@ -1719,7 +2836,7 @@ struct ManageOfferSuccessResult
case MANAGE_OFFER_CREATED:
case MANAGE_OFFER_UPDATED:
OfferEntry offer;
- default:
+ case MANAGE_OFFER_DELETED:
void;
}
offer;
@@ -1729,7 +2846,18 @@ union ManageSellOfferResult switch (ManageSellOfferResultCode code)
{
case MANAGE_SELL_OFFER_SUCCESS:
ManageOfferSuccessResult success;
-default:
+case MANAGE_SELL_OFFER_MALFORMED:
+case MANAGE_SELL_OFFER_SELL_NO_TRUST:
+case MANAGE_SELL_OFFER_BUY_NO_TRUST:
+case MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED:
+case MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED:
+case MANAGE_SELL_OFFER_LINE_FULL:
+case MANAGE_SELL_OFFER_UNDERFUNDED:
+case MANAGE_SELL_OFFER_CROSS_SELF:
+case MANAGE_SELL_OFFER_SELL_NO_ISSUER:
+case MANAGE_SELL_OFFER_BUY_NO_ISSUER:
+case MANAGE_SELL_OFFER_NOT_FOUND:
+case MANAGE_SELL_OFFER_LOW_RESERVE:
void;
};
@@ -1763,7 +2891,18 @@ union ManageBuyOfferResult switch (ManageBuyOfferResultCode code)
{
case MANAGE_BUY_OFFER_SUCCESS:
ManageOfferSuccessResult success;
-default:
+case MANAGE_BUY_OFFER_MALFORMED:
+case MANAGE_BUY_OFFER_SELL_NO_TRUST:
+case MANAGE_BUY_OFFER_BUY_NO_TRUST:
+case MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED:
+case MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED:
+case MANAGE_BUY_OFFER_LINE_FULL:
+case MANAGE_BUY_OFFER_UNDERFUNDED:
+case MANAGE_BUY_OFFER_CROSS_SELF:
+case MANAGE_BUY_OFFER_SELL_NO_ISSUER:
+case MANAGE_BUY_OFFER_BUY_NO_ISSUER:
+case MANAGE_BUY_OFFER_NOT_FOUND:
+case MANAGE_BUY_OFFER_LOW_RESERVE:
void;
};
@@ -1791,7 +2930,16 @@ union SetOptionsResult switch (SetOptionsResultCode code)
{
case SET_OPTIONS_SUCCESS:
void;
-default:
+case SET_OPTIONS_LOW_RESERVE:
+case SET_OPTIONS_TOO_MANY_SIGNERS:
+case SET_OPTIONS_BAD_FLAGS:
+case SET_OPTIONS_INVALID_INFLATION:
+case SET_OPTIONS_CANT_CHANGE:
+case SET_OPTIONS_UNKNOWN_FLAG:
+case SET_OPTIONS_THRESHOLD_OUT_OF_RANGE:
+case SET_OPTIONS_BAD_SIGNER:
+case SET_OPTIONS_INVALID_HOME_DOMAIN:
+case SET_OPTIONS_AUTH_REVOCABLE_REQUIRED:
void;
};
@@ -1820,7 +2968,14 @@ union ChangeTrustResult switch (ChangeTrustResultCode code)
{
case CHANGE_TRUST_SUCCESS:
void;
-default:
+case CHANGE_TRUST_MALFORMED:
+case CHANGE_TRUST_NO_ISSUER:
+case CHANGE_TRUST_INVALID_LIMIT:
+case CHANGE_TRUST_LOW_RESERVE:
+case CHANGE_TRUST_SELF_NOT_ALLOWED:
+case CHANGE_TRUST_TRUST_LINE_MISSING:
+case CHANGE_TRUST_CANNOT_DELETE:
+case CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES:
void;
};
@@ -1845,7 +3000,12 @@ union AllowTrustResult switch (AllowTrustResultCode code)
{
case ALLOW_TRUST_SUCCESS:
void;
-default:
+case ALLOW_TRUST_MALFORMED:
+case ALLOW_TRUST_NO_TRUST_LINE:
+case ALLOW_TRUST_TRUST_NOT_REQUIRED:
+case ALLOW_TRUST_CANT_REVOKE:
+case ALLOW_TRUST_SELF_NOT_ALLOWED:
+case ALLOW_TRUST_LOW_RESERVE:
void;
};
@@ -1870,7 +3030,13 @@ union AccountMergeResult switch (AccountMergeResultCode code)
{
case ACCOUNT_MERGE_SUCCESS:
int64 sourceAccountBalance; // how much got transferred from source account
-default:
+case ACCOUNT_MERGE_MALFORMED:
+case ACCOUNT_MERGE_NO_ACCOUNT:
+case ACCOUNT_MERGE_IMMUTABLE_SET:
+case ACCOUNT_MERGE_HAS_SUB_ENTRIES:
+case ACCOUNT_MERGE_SEQNUM_TOO_FAR:
+case ACCOUNT_MERGE_DEST_FULL:
+case ACCOUNT_MERGE_IS_SPONSOR:
void;
};
@@ -1894,7 +3060,7 @@ union InflationResult switch (InflationResultCode code)
{
case INFLATION_SUCCESS:
InflationPayout payouts<>;
-default:
+case INFLATION_NOT_TIME:
void;
};
@@ -1917,7 +3083,10 @@ union ManageDataResult switch (ManageDataResultCode code)
{
case MANAGE_DATA_SUCCESS:
void;
-default:
+case MANAGE_DATA_NOT_SUPPORTED_YET:
+case MANAGE_DATA_NAME_NOT_FOUND:
+case MANAGE_DATA_LOW_RESERVE:
+case MANAGE_DATA_INVALID_NAME:
void;
};
@@ -1935,7 +3104,7 @@ union BumpSequenceResult switch (BumpSequenceResultCode code)
{
case BUMP_SEQUENCE_SUCCESS:
void;
-default:
+case BUMP_SEQUENCE_BAD_SEQ:
void;
};
@@ -1956,7 +3125,11 @@ union CreateClaimableBalanceResult switch (
{
case CREATE_CLAIMABLE_BALANCE_SUCCESS:
ClaimableBalanceID balanceID;
-default:
+case CREATE_CLAIMABLE_BALANCE_MALFORMED:
+case CREATE_CLAIMABLE_BALANCE_LOW_RESERVE:
+case CREATE_CLAIMABLE_BALANCE_NO_TRUST:
+case CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED:
+case CREATE_CLAIMABLE_BALANCE_UNDERFUNDED:
void;
};
@@ -1970,14 +3143,17 @@ enum ClaimClaimableBalanceResultCode
CLAIM_CLAIMABLE_BALANCE_LINE_FULL = -3,
CLAIM_CLAIMABLE_BALANCE_NO_TRUST = -4,
CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -5
-
};
union ClaimClaimableBalanceResult switch (ClaimClaimableBalanceResultCode code)
{
case CLAIM_CLAIMABLE_BALANCE_SUCCESS:
void;
-default:
+case CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST:
+case CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM:
+case CLAIM_CLAIMABLE_BALANCE_LINE_FULL:
+case CLAIM_CLAIMABLE_BALANCE_NO_TRUST:
+case CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED:
void;
};
@@ -1999,7 +3175,9 @@ union BeginSponsoringFutureReservesResult switch (
{
case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS:
void;
-default:
+case BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED:
+case BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED:
+case BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE:
void;
};
@@ -2019,7 +3197,7 @@ union EndSponsoringFutureReservesResult switch (
{
case END_SPONSORING_FUTURE_RESERVES_SUCCESS:
void;
-default:
+case END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED:
void;
};
@@ -2042,7 +3220,11 @@ union RevokeSponsorshipResult switch (RevokeSponsorshipResultCode code)
{
case REVOKE_SPONSORSHIP_SUCCESS:
void;
-default:
+case REVOKE_SPONSORSHIP_DOES_NOT_EXIST:
+case REVOKE_SPONSORSHIP_NOT_SPONSOR:
+case REVOKE_SPONSORSHIP_LOW_RESERVE:
+case REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE:
+case REVOKE_SPONSORSHIP_MALFORMED:
void;
};
@@ -2064,7 +3246,10 @@ union ClawbackResult switch (ClawbackResultCode code)
{
case CLAWBACK_SUCCESS:
void;
-default:
+case CLAWBACK_MALFORMED:
+case CLAWBACK_NOT_CLAWBACK_ENABLED:
+case CLAWBACK_NO_TRUST:
+case CLAWBACK_UNDERFUNDED:
void;
};
@@ -2086,7 +3271,9 @@ union ClawbackClaimableBalanceResult switch (
{
case CLAWBACK_CLAIMABLE_BALANCE_SUCCESS:
void;
-default:
+case CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST:
+case CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER:
+case CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED:
void;
};
@@ -2110,7 +3297,11 @@ union SetTrustLineFlagsResult switch (SetTrustLineFlagsResultCode code)
{
case SET_TRUST_LINE_FLAGS_SUCCESS:
void;
-default:
+case SET_TRUST_LINE_FLAGS_MALFORMED:
+case SET_TRUST_LINE_FLAGS_NO_TRUST_LINE:
+case SET_TRUST_LINE_FLAGS_CANT_REVOKE:
+case SET_TRUST_LINE_FLAGS_INVALID_STATE:
+case SET_TRUST_LINE_FLAGS_LOW_RESERVE:
void;
};
@@ -2139,7 +3330,13 @@ union LiquidityPoolDepositResult switch (LiquidityPoolDepositResultCode code)
{
case LIQUIDITY_POOL_DEPOSIT_SUCCESS:
void;
-default:
+case LIQUIDITY_POOL_DEPOSIT_MALFORMED:
+case LIQUIDITY_POOL_DEPOSIT_NO_TRUST:
+case LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED:
+case LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED:
+case LIQUIDITY_POOL_DEPOSIT_LINE_FULL:
+case LIQUIDITY_POOL_DEPOSIT_BAD_PRICE:
+case LIQUIDITY_POOL_DEPOSIT_POOL_FULL:
void;
};
@@ -2165,7 +3362,78 @@ union LiquidityPoolWithdrawResult switch (LiquidityPoolWithdrawResultCode code)
{
case LIQUIDITY_POOL_WITHDRAW_SUCCESS:
void;
-default:
+case LIQUIDITY_POOL_WITHDRAW_MALFORMED:
+case LIQUIDITY_POOL_WITHDRAW_NO_TRUST:
+case LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED:
+case LIQUIDITY_POOL_WITHDRAW_LINE_FULL:
+case LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM:
+ void;
+};
+
+enum InvokeHostFunctionResultCode
+{
+ // codes considered as "success" for the operation
+ INVOKE_HOST_FUNCTION_SUCCESS = 0,
+
+ // codes considered as "failure" for the operation
+ INVOKE_HOST_FUNCTION_MALFORMED = -1,
+ INVOKE_HOST_FUNCTION_TRAPPED = -2,
+ INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3,
+ INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED = -4,
+ INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5
+};
+
+union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code)
+{
+case INVOKE_HOST_FUNCTION_SUCCESS:
+ Hash success; // sha256(InvokeHostFunctionSuccessPreImage)
+case INVOKE_HOST_FUNCTION_MALFORMED:
+case INVOKE_HOST_FUNCTION_TRAPPED:
+case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED:
+case INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED:
+case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE:
+ void;
+};
+
+enum ExtendFootprintTTLResultCode
+{
+ // codes considered as "success" for the operation
+ EXTEND_FOOTPRINT_TTL_SUCCESS = 0,
+
+ // codes considered as "failure" for the operation
+ EXTEND_FOOTPRINT_TTL_MALFORMED = -1,
+ EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED = -2,
+ EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE = -3
+};
+
+union ExtendFootprintTTLResult switch (ExtendFootprintTTLResultCode code)
+{
+case EXTEND_FOOTPRINT_TTL_SUCCESS:
+ void;
+case EXTEND_FOOTPRINT_TTL_MALFORMED:
+case EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED:
+case EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE:
+ void;
+};
+
+enum RestoreFootprintResultCode
+{
+ // codes considered as "success" for the operation
+ RESTORE_FOOTPRINT_SUCCESS = 0,
+
+ // codes considered as "failure" for the operation
+ RESTORE_FOOTPRINT_MALFORMED = -1,
+ RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED = -2,
+ RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3
+};
+
+union RestoreFootprintResult switch (RestoreFootprintResultCode code)
+{
+case RESTORE_FOOTPRINT_SUCCESS:
+ void;
+case RESTORE_FOOTPRINT_MALFORMED:
+case RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED:
+case RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE:
void;
};
@@ -2235,9 +3503,20 @@ case opINNER:
LiquidityPoolDepositResult liquidityPoolDepositResult;
case LIQUIDITY_POOL_WITHDRAW:
LiquidityPoolWithdrawResult liquidityPoolWithdrawResult;
+ case INVOKE_HOST_FUNCTION:
+ InvokeHostFunctionResult invokeHostFunctionResult;
+ case EXTEND_FOOTPRINT_TTL:
+ ExtendFootprintTTLResult extendFootprintTTLResult;
+ case RESTORE_FOOTPRINT:
+ RestoreFootprintResult restoreFootprintResult;
}
tr;
-default:
+case opBAD_AUTH:
+case opNO_ACCOUNT:
+case opNOT_SUPPORTED:
+case opTOO_MANY_SUBENTRIES:
+case opEXCEEDED_WORK_LIMIT:
+case opTOO_MANY_SPONSORING:
void;
};
@@ -2260,12 +3539,12 @@ enum TransactionResultCode
txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction
txINTERNAL_ERROR = -11, // an unknown error occurred
- txNOT_SUPPORTED = -12, // transaction type not supported
- txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed
- txBAD_SPONSORSHIP = -14, // sponsorship not confirmed
- txBAD_MIN_SEQ_AGE_OR_GAP =
- -15, // minSeqAge or minSeqLedgerGap conditions not met
- txMALFORMED = -16 // precondition is invalid
+ txNOT_SUPPORTED = -12, // transaction type not supported
+ txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed
+ txBAD_SPONSORSHIP = -14, // sponsorship not confirmed
+ txBAD_MIN_SEQ_AGE_OR_GAP = -15, // minSeqAge or minSeqLedgerGap conditions not met
+ txMALFORMED = -16, // precondition is invalid
+ txSOROBAN_INVALID = -17 // soroban-specific preconditions were not met
};
// InnerTransactionResult must be binary compatible with TransactionResult
@@ -2296,6 +3575,7 @@ struct InnerTransactionResult
case txBAD_SPONSORSHIP:
case txBAD_MIN_SEQ_AGE_OR_GAP:
case txMALFORMED:
+ case txSOROBAN_INVALID:
void;
}
result;
@@ -2327,7 +3607,22 @@ struct TransactionResult
case txSUCCESS:
case txFAILED:
OperationResult results<>;
- default:
+ case txTOO_EARLY:
+ case txTOO_LATE:
+ case txMISSING_OPERATION:
+ case txBAD_SEQ:
+ case txBAD_AUTH:
+ case txINSUFFICIENT_BALANCE:
+ case txNO_ACCOUNT:
+ case txINSUFFICIENT_FEE:
+ case txBAD_AUTH_EXTRA:
+ case txINTERNAL_ERROR:
+ case txNOT_SUPPORTED:
+ // case txFEE_BUMP_INNER_FAILED: handled above
+ case txBAD_SPONSORSHIP:
+ case txBAD_MIN_SEQ_AGE_OR_GAP:
+ case txMALFORMED:
+ case txSOROBAN_INVALID:
void;
}
result;
@@ -2466,7 +3761,14 @@ enum LedgerUpgradeType
LEDGER_UPGRADE_BASE_FEE = 2,
LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3,
LEDGER_UPGRADE_BASE_RESERVE = 4,
- LEDGER_UPGRADE_FLAGS = 5
+ LEDGER_UPGRADE_FLAGS = 5,
+ LEDGER_UPGRADE_CONFIG = 6,
+ LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7
+};
+
+struct ConfigUpgradeSetKey {
+ Hash contractID;
+ Hash contentHash;
};
union LedgerUpgrade switch (LedgerUpgradeType type)
@@ -2481,6 +3783,17 @@ case LEDGER_UPGRADE_BASE_RESERVE:
uint32 newBaseReserve; // update baseReserve
case LEDGER_UPGRADE_FLAGS:
uint32 newFlags; // update flags
+case LEDGER_UPGRADE_CONFIG:
+ // Update arbitrary `ConfigSetting` entries identified by the key.
+ ConfigUpgradeSetKey newConfig;
+case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE:
+ // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without
+ // using `LEDGER_UPGRADE_CONFIG`.
+ uint32 newMaxSorobanTxSetSize;
+};
+
+struct ConfigUpgradeSet {
+ ConfigSettingEntry updatedEntry<>;
};
/* Entries used to define the bucket list */
@@ -2520,6 +3833,29 @@ case METAENTRY:
BucketMetadata metaEntry;
};
+enum TxSetComponentType
+{
+ // txs with effective fee <= bid derived from a base fee (if any).
+ // If base fee is not specified, no discount is applied.
+ TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0
+};
+
+union TxSetComponent switch (TxSetComponentType type)
+{
+case TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE:
+ struct
+ {
+ int64* baseFee;
+ TransactionEnvelope txs<>;
+ } txsMaybeDiscountedFee;
+};
+
+union TransactionPhase switch (int v)
+{
+case 0:
+ TxSetComponent v0Components<>;
+};
+
// Transaction sets are the unit used by SCP to decide on transitions
// between ledgers
struct TransactionSet
@@ -2528,6 +3864,19 @@ struct TransactionSet
TransactionEnvelope txs<>;
};
+struct TransactionSetV1
+{
+ Hash previousLedgerHash;
+ TransactionPhase phases<>;
+};
+
+union GeneralizedTransactionSet switch (int v)
+{
+// We consider the legacy TransactionSet to be v0.
+case 1:
+ TransactionSetV1 v1TxSet;
+};
+
struct TransactionResultPair
{
Hash transactionHash;
@@ -2547,11 +3896,13 @@ struct TransactionHistoryEntry
uint32 ledgerSeq;
TransactionSet txSet;
- // reserved for future use
+ // when v != 0, txSet must be empty
union switch (int v)
{
case 0:
void;
+ case 1:
+ GeneralizedTransactionSet generalizedTxSet;
}
ext;
};
@@ -2654,6 +4005,74 @@ struct TransactionMetaV2
// applied if any
};
+enum ContractEventType
+{
+ SYSTEM = 0,
+ CONTRACT = 1,
+ DIAGNOSTIC = 2
+};
+
+struct ContractEvent
+{
+ // We can use this to add more fields, or because it
+ // is first, to change ContractEvent into a union.
+ ExtensionPoint ext;
+
+ Hash* contractID;
+ ContractEventType type;
+
+ union switch (int v)
+ {
+ case 0:
+ struct
+ {
+ SCVal topics<>;
+ SCVal data;
+ } v0;
+ }
+ body;
+};
+
+struct DiagnosticEvent
+{
+ bool inSuccessfulContractCall;
+ ContractEvent event;
+};
+
+struct SorobanTransactionMeta
+{
+ ExtensionPoint ext;
+
+ ContractEvent events<>; // custom events populated by the
+ // contracts themselves.
+ SCVal returnValue; // return value of the host fn invocation
+
+ // Diagnostics events that are not hashed.
+ // This will contain all contract and diagnostic events. Even ones
+ // that were emitted in a failed contract call.
+ DiagnosticEvent diagnosticEvents<>;
+};
+
+struct TransactionMetaV3
+{
+ ExtensionPoint ext;
+
+ LedgerEntryChanges txChangesBefore; // tx level changes before operations
+ // are applied if any
+ OperationMeta operations<>; // meta for each operation
+ LedgerEntryChanges txChangesAfter; // tx level changes after operations are
+ // applied if any
+ SorobanTransactionMeta* sorobanMeta; // Soroban-specific meta (only for
+ // Soroban transactions).
+};
+
+// This is in Stellar-ledger.x to due to a circular dependency
+struct InvokeHostFunctionSuccessPreImage
+{
+ SCVal returnValue;
+ ContractEvent events<>;
+};
+
// this is the meta produced when applying transactions
// it does not include pre-apply updates such as fees
union TransactionMeta switch (int v)
@@ -2664,6 +4083,8 @@ case 1:
TransactionMetaV1 v1;
case 2:
TransactionMetaV2 v2;
+case 3:
+ TransactionMetaV3 v3;
};
// This struct groups together changes on a per transaction basis
@@ -2702,10 +4123,45 @@ struct LedgerCloseMetaV0
SCPHistoryEntry scpInfo<>;
};
+struct LedgerCloseMetaV1
+{
+ // We forgot to add an ExtensionPoint in v0 but at least
+ // we can add one now in v1.
+ ExtensionPoint ext;
+
+ LedgerHeaderHistoryEntry ledgerHeader;
+
+ GeneralizedTransactionSet txSet;
+
+ // NB: transactions are sorted in apply order here
+ // fees for all transactions are processed first
+ // followed by applying transactions
+ TransactionResultMeta txProcessing<>;
+
+ // upgrades are applied last
+ UpgradeEntryMeta upgradesProcessing<>;
+
+ // other misc information attached to the ledger close
+ SCPHistoryEntry scpInfo<>;
+
+ // Size in bytes of BucketList, to support downstream
+ // systems calculating storage fees correctly.
+ uint64 totalByteSizeOfBucketList;
+
+ // Temp keys that are being evicted at this ledger.
+ LedgerKey evictedTemporaryLedgerKeys<>;
+
+ // Archived restorable ledger entries that are being
+ // evicted at this ledger.
+ LedgerEntry evictedPersistentLedgerEntries<>;
+};
+
union LedgerCloseMeta switch (int v)
{
case 0:
LedgerCloseMetaV0 v0;
+case 1:
+ LedgerCloseMetaV1 v1;
};
}
@@ -2738,6 +4194,12 @@ struct SendMore
uint32 numMessages;
};
+struct SendMoreExtended
+{
+ uint32 numMessages;
+ uint32 numBytes;
+};
+
struct AuthCert
{
Curve25519Public pubkey;
@@ -2758,11 +4220,18 @@ struct Hello
uint256 nonce;
};
+// During the roll-out phrase, nodes can disable flow control in bytes.
+// Therefore, we need a way to communicate with other nodes
+// that we want/don't want flow control in bytes.
+// We use the `flags` field in the Auth message with a special value
+// set to communicate this. Note that AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED != 0
+// AND AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED != 100 (as previously
+// that value was used for other purposes).
+const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED = 200;
+
struct Auth
{
- // Empty message, just to confirm
- // establishment of MAC keys.
- int unused;
+ int flags;
};
enum IPAddrType
@@ -2785,6 +4254,7 @@ struct PeerAddress
uint32 numFailures;
};
+// Next ID: 21
enum MessageType
{
ERROR_MSG = 0,
@@ -2796,6 +4266,7 @@ enum MessageType
GET_TX_SET = 6, // gets a particular txset by hash
TX_SET = 7,
+ GENERALIZED_TX_SET = 17,
TRANSACTION = 8, // pass on a tx you have heard about
@@ -2811,7 +4282,11 @@ enum MessageType
SURVEY_REQUEST = 14,
SURVEY_RESPONSE = 15,
- SEND_MORE = 16
+ SEND_MORE = 16,
+ SEND_MORE_EXTENDED = 20,
+
+ FLOOD_ADVERT = 18,
+ FLOOD_DEMAND = 19
};
struct DontHave
@@ -2825,6 +4300,12 @@ enum SurveyMessageCommandType
SURVEY_TOPOLOGY = 0
};
+enum SurveyMessageResponseType
+{
+ SURVEY_TOPOLOGY_RESPONSE_V0 = 0,
+ SURVEY_TOPOLOGY_RESPONSE_V1 = 1
+};
+
struct SurveyRequestMessage
{
NodeID surveyorPeerID;
@@ -2879,19 +4360,49 @@ struct PeerStats
typedef PeerStats PeerStatList<25>;
-struct TopologyResponseBody
+struct TopologyResponseBodyV0
+{
+ PeerStatList inboundPeers;
+ PeerStatList outboundPeers;
+
+ uint32 totalInboundPeerCount;
+ uint32 totalOutboundPeerCount;
+};
+
+struct TopologyResponseBodyV1
{
PeerStatList inboundPeers;
PeerStatList outboundPeers;
uint32 totalInboundPeerCount;
uint32 totalOutboundPeerCount;
+
+ uint32 maxInboundPeerCount;
+ uint32 maxOutboundPeerCount;
+};
+
+union SurveyResponseBody switch (SurveyMessageResponseType type)
+{
+case SURVEY_TOPOLOGY_RESPONSE_V0:
+ TopologyResponseBodyV0 topologyResponseBodyV0;
+case SURVEY_TOPOLOGY_RESPONSE_V1:
+ TopologyResponseBodyV1 topologyResponseBodyV1;
+};
+
+const TX_ADVERT_VECTOR_MAX_SIZE = 1000;
+typedef Hash TxAdvertVector;
+
+struct FloodAdvert
+{
+ TxAdvertVector txHashes;
};
-union SurveyResponseBody switch (SurveyMessageCommandType type)
+const TX_DEMAND_VECTOR_MAX_SIZE = 1000;
+typedef Hash TxDemandVector;
+
+struct FloodDemand
{
-case SURVEY_TOPOLOGY:
- TopologyResponseBody topologyResponseBody;
+ TxDemandVector txHashes;
};
union StellarMessage switch (MessageType type)
@@ -2913,6 +4424,8 @@ case GET_TX_SET:
uint256 txSetHash;
case TX_SET:
TransactionSet txSet;
+case GENERALIZED_TX_SET:
+ GeneralizedTransactionSet generalizedTxSet;
case TRANSACTION:
TransactionEnvelope transaction;
@@ -2934,6 +4447,13 @@ case GET_SCP_STATE:
uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest
case SEND_MORE:
SendMore sendMoreMessage;
+case SEND_MORE_EXTENDED:
+ SendMoreExtended sendMoreExtendedMessage;
+// Pull mode
+case FLOOD_ADVERT:
+ FloodAdvert floodAdvert;
+case FLOOD_DEMAND:
+ FloodDemand floodDemand;
};
union AuthenticatedMessage switch (uint32 v)
@@ -3034,3 +4554,52 @@ struct SCPQuorumSet
SCPQuorumSet innerSets<>;
};
}
+
+// Copyright 2022 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
+
+// This is for 'internal'-only messages that are not meant to be read/written
+// by any other binaries besides a single Core instance.
+%#include "xdr/Stellar-ledger.h"
+%#include "xdr/Stellar-SCP.h"
+
+namespace stellar
+{
+union StoredTransactionSet switch (int v)
+{
+case 0:
+ TransactionSet txSet;
+case 1:
+ GeneralizedTransactionSet generalizedTxSet;
+};
+
+struct StoredDebugTransactionSet
+{
+ StoredTransactionSet txSet;
+ uint32 ledgerSeq;
+ StellarValue scpValue;
+};
+
+struct PersistedSCPStateV0
+{
+ SCPEnvelope scpEnvelopes<>;
+ SCPQuorumSet quorumSets<>;
+ StoredTransactionSet txSets<>;
+};
+
+struct PersistedSCPStateV1
+{
+ // Tx sets are saved separately
+ SCPEnvelope scpEnvelopes<>;
+ SCPQuorumSet quorumSets<>;
+};
+
+union PersistedSCPState switch (int v)
+{
+case 0:
+ PersistedSCPStateV0 v0;
+case 1:
+ PersistedSCPStateV1 v1;
+};
+}
\ No newline at end of file
diff --git a/base/generated/stellar-base-generated.rb b/base/generated/stellar-base-generated.rb
index 0fcea9ce..b60d665a 100644
--- a/base/generated/stellar-base-generated.rb
+++ b/base/generated/stellar-base-generated.rb
@@ -12,6 +12,8 @@ module Stellar
Int32 = XDR::Int
Uint64 = XDR::UnsignedHyper
Int64 = XDR::Hyper
+ TimePoint = Uint64
+ Duration = Uint64
autoload :ExtensionPoint
autoload :CryptoKeyType
autoload :PublicKeyType
@@ -21,6 +23,7 @@ module Stellar
Signature = XDR::VarOpaque[64]
SignatureHint = XDR::Opaque[4]
NodeID = PublicKey
+ AccountID = PublicKey
autoload :Curve25519Secret
autoload :Curve25519Public
autoload :HmacSha256Key
@@ -29,13 +32,97 @@ module Stellar
module Stellar
include XDR::Namespace
- AccountID = PublicKey
+ autoload :SCValType
+ autoload :SCErrorType
+ autoload :SCErrorCode
+ autoload :SCError
+ autoload :UInt128Parts
+ autoload :Int128Parts
+ autoload :UInt256Parts
+ autoload :Int256Parts
+ autoload :ContractExecutableType
+ autoload :ContractExecutable
+ autoload :SCAddressType
+ autoload :SCAddress
+ SCSYMBOL_LIMIT = 32
+ SCBytes = XDR::VarOpaque[]
+ SCString = XDR::String[]
+ SCSymbol = XDR::String[SCSYMBOL_LIMIT]
+ class SCVal < XDR::Union; end
+ SCVec = XDR::VarArray[SCVal]
+ autoload :SCMapEntry
+ SCMap = XDR::VarArray[SCMapEntry]
+ autoload :SCNonceKey
+ autoload :SCContractInstance
+ require_relative "stellar/sc_val"
+end
+module Stellar
+ include XDR::Namespace
+
+ autoload :ConfigSettingContractExecutionLanesV0
+ autoload :ConfigSettingContractComputeV0
+ autoload :ConfigSettingContractLedgerCostV0
+ autoload :ConfigSettingContractHistoricalDataV0
+ autoload :ConfigSettingContractEventsV0
+ autoload :ConfigSettingContractBandwidthV0
+ autoload :ContractCostType
+ autoload :ContractCostParamEntry
+ autoload :StateArchivalSettings
+ autoload :EvictionIterator
+ CONTRACT_COST_COUNT_LIMIT = 1024
+ ContractCostParams = XDR::VarArray[ContractCostParamEntry, CONTRACT_COST_COUNT_LIMIT]
+ autoload :ConfigSettingID
+ autoload :ConfigSettingEntry
+end
+module Stellar
+ include XDR::Namespace
+
+ autoload :SCEnvMetaKind
+ autoload :SCEnvMetaEntry
+end
+module Stellar
+ include XDR::Namespace
+
+ autoload :SCMetaV0
+ autoload :SCMetaKind
+ autoload :SCMetaEntry
+end
+module Stellar
+ include XDR::Namespace
+
+ SC_SPEC_DOC_LIMIT = 1024
+ autoload :SCSpecType
+ autoload :SCSpecTypeOption
+ autoload :SCSpecTypeResult
+ autoload :SCSpecTypeVec
+ autoload :SCSpecTypeMap
+ autoload :SCSpecTypeTuple
+ autoload :SCSpecTypeBytesN
+ autoload :SCSpecTypeUDT
+ autoload :SCSpecTypeDef
+ autoload :SCSpecUDTStructFieldV0
+ autoload :SCSpecUDTStructV0
+ autoload :SCSpecUDTUnionCaseVoidV0
+ autoload :SCSpecUDTUnionCaseTupleV0
+ autoload :SCSpecUDTUnionCaseV0Kind
+ autoload :SCSpecUDTUnionCaseV0
+ autoload :SCSpecUDTUnionV0
+ autoload :SCSpecUDTEnumCaseV0
+ autoload :SCSpecUDTEnumV0
+ autoload :SCSpecUDTErrorEnumCaseV0
+ autoload :SCSpecUDTErrorEnumV0
+ autoload :SCSpecFunctionInputV0
+ autoload :SCSpecFunctionV0
+ autoload :SCSpecEntryKind
+ autoload :SCSpecEntry
+end
+module Stellar
+ include XDR::Namespace
+
Thresholds = XDR::Opaque[4]
String32 = XDR::String[32]
String64 = XDR::String[64]
SequenceNumber = Int64
- TimePoint = Uint64
- Duration = Uint64
DataValue = XDR::VarOpaque[64]
PoolID = Hash
AssetCode4 = XDR::Opaque[4]
@@ -83,6 +170,10 @@ module Stellar
autoload :ClaimableBalanceEntry
autoload :LiquidityPoolConstantProductParameters
autoload :LiquidityPoolEntry
+ autoload :ContractDataDurability
+ autoload :ContractDataEntry
+ autoload :ContractCodeEntry
+ autoload :TTLEntry
autoload :LedgerEntryExtensionV1
autoload :LedgerEntry
autoload :LedgerKey
@@ -91,6 +182,7 @@ module Stellar
module Stellar
include XDR::Namespace
+ MAX_OPS_PER_TX = 100
autoload :LiquidityPoolParameters
autoload :MuxedAccount
autoload :DecoratedSignature
@@ -119,6 +211,22 @@ module Stellar
LIQUIDITY_POOL_FEE_V18 = 30
autoload :LiquidityPoolDepositOp
autoload :LiquidityPoolWithdrawOp
+ autoload :HostFunctionType
+ autoload :ContractIDPreimageType
+ autoload :ContractIDPreimage
+ autoload :CreateContractArgs
+ autoload :InvokeContractArgs
+ autoload :HostFunction
+ autoload :SorobanAuthorizedFunctionType
+ autoload :SorobanAuthorizedFunction
+ autoload :SorobanAuthorizedInvocation
+ autoload :SorobanAddressCredentials
+ autoload :SorobanCredentialsType
+ autoload :SorobanCredentials
+ autoload :SorobanAuthorizationEntry
+ autoload :InvokeHostFunctionOp
+ autoload :ExtendFootprintTTLOp
+ autoload :RestoreFootprintOp
autoload :Operation
autoload :HashIDPreimage
autoload :MemoType
@@ -128,7 +236,9 @@ module Stellar
autoload :PreconditionsV2
autoload :PreconditionType
autoload :Preconditions
- MAX_OPS_PER_TX = 100
+ autoload :LedgerFootprint
+ autoload :SorobanResources
+ autoload :SorobanTransactionData
autoload :TransactionV0
autoload :TransactionV0Envelope
autoload :Transaction
@@ -192,6 +302,12 @@ module Stellar
autoload :LiquidityPoolDepositResult
autoload :LiquidityPoolWithdrawResultCode
autoload :LiquidityPoolWithdrawResult
+ autoload :InvokeHostFunctionResultCode
+ autoload :InvokeHostFunctionResult
+ autoload :ExtendFootprintTTLResultCode
+ autoload :ExtendFootprintTTLResult
+ autoload :RestoreFootprintResultCode
+ autoload :RestoreFootprintResult
autoload :OperationResultCode
autoload :OperationResult
autoload :TransactionResultCode
@@ -211,11 +327,18 @@ module Stellar
autoload :LedgerHeaderExtensionV1
autoload :LedgerHeader
autoload :LedgerUpgradeType
+ autoload :ConfigUpgradeSetKey
autoload :LedgerUpgrade
+ autoload :ConfigUpgradeSet
autoload :BucketEntryType
autoload :BucketMetadata
autoload :BucketEntry
+ autoload :TxSetComponentType
+ autoload :TxSetComponent
+ autoload :TransactionPhase
autoload :TransactionSet
+ autoload :TransactionSetV1
+ autoload :GeneralizedTransactionSet
autoload :TransactionResultPair
autoload :TransactionResultSet
autoload :TransactionHistoryEntry
@@ -230,10 +353,17 @@ module Stellar
autoload :OperationMeta
autoload :TransactionMetaV1
autoload :TransactionMetaV2
+ autoload :ContractEventType
+ autoload :ContractEvent
+ autoload :DiagnosticEvent
+ autoload :SorobanTransactionMeta
+ autoload :TransactionMetaV3
+ autoload :InvokeHostFunctionSuccessPreImage
autoload :TransactionMeta
autoload :TransactionResultMeta
autoload :UpgradeEntryMeta
autoload :LedgerCloseMetaV0
+ autoload :LedgerCloseMetaV1
autoload :LedgerCloseMeta
end
module Stellar
@@ -242,14 +372,17 @@ module Stellar
autoload :ErrorCode
autoload :Error
autoload :SendMore
+ autoload :SendMoreExtended
autoload :AuthCert
autoload :Hello
+ AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED = 200
autoload :Auth
autoload :IPAddrType
autoload :PeerAddress
autoload :MessageType
autoload :DontHave
autoload :SurveyMessageCommandType
+ autoload :SurveyMessageResponseType
autoload :SurveyRequestMessage
autoload :SignedSurveyRequestMessage
EncryptedBody = XDR::VarOpaque[64000]
@@ -257,8 +390,15 @@ module Stellar
autoload :SignedSurveyResponseMessage
autoload :PeerStats
PeerStatList = XDR::VarArray[PeerStats, 25]
- autoload :TopologyResponseBody
+ autoload :TopologyResponseBodyV0
+ autoload :TopologyResponseBodyV1
autoload :SurveyResponseBody
+ TX_ADVERT_VECTOR_MAX_SIZE = 1000
+ TxAdvertVector = XDR::VarArray[Hash, TX_ADVERT_VECTOR_MAX_SIZE]
+ autoload :FloodAdvert
+ TX_DEMAND_VECTOR_MAX_SIZE = 1000
+ TxDemandVector = XDR::VarArray[Hash, TX_DEMAND_VECTOR_MAX_SIZE]
+ autoload :FloodDemand
autoload :StellarMessage
autoload :AuthenticatedMessage
end
@@ -273,3 +413,12 @@ module Stellar
autoload :SCPEnvelope
autoload :SCPQuorumSet
end
+module Stellar
+ include XDR::Namespace
+
+ autoload :StoredTransactionSet
+ autoload :StoredDebugTransactionSet
+ autoload :PersistedSCPStateV0
+ autoload :PersistedSCPStateV1
+ autoload :PersistedSCPState
+end
diff --git a/base/generated/stellar/account_merge_result.rb b/base/generated/stellar/account_merge_result.rb
index 31718ad4..2e158d93 100644
--- a/base/generated/stellar/account_merge_result.rb
+++ b/base/generated/stellar/account_merge_result.rb
@@ -9,7 +9,13 @@
# {
# case ACCOUNT_MERGE_SUCCESS:
# int64 sourceAccountBalance; // how much got transferred from source account
-# default:
+# case ACCOUNT_MERGE_MALFORMED:
+# case ACCOUNT_MERGE_NO_ACCOUNT:
+# case ACCOUNT_MERGE_IMMUTABLE_SET:
+# case ACCOUNT_MERGE_HAS_SUB_ENTRIES:
+# case ACCOUNT_MERGE_SEQNUM_TOO_FAR:
+# case ACCOUNT_MERGE_DEST_FULL:
+# case ACCOUNT_MERGE_IS_SPONSOR:
# void;
# };
#
@@ -18,8 +24,14 @@ module Stellar
class AccountMergeResult < XDR::Union
switch_on AccountMergeResultCode, :code
- switch :account_merge_success, :source_account_balance
- switch :default
+ switch :account_merge_success, :source_account_balance
+ switch :account_merge_malformed
+ switch :account_merge_no_account
+ switch :account_merge_immutable_set
+ switch :account_merge_has_sub_entries
+ switch :account_merge_seqnum_too_far
+ switch :account_merge_dest_full
+ switch :account_merge_is_sponsor
attribute :source_account_balance, Int64
end
diff --git a/base/generated/stellar/allow_trust_result.rb b/base/generated/stellar/allow_trust_result.rb
index 95410997..8f758e61 100644
--- a/base/generated/stellar/allow_trust_result.rb
+++ b/base/generated/stellar/allow_trust_result.rb
@@ -9,7 +9,12 @@
# {
# case ALLOW_TRUST_SUCCESS:
# void;
-# default:
+# case ALLOW_TRUST_MALFORMED:
+# case ALLOW_TRUST_NO_TRUST_LINE:
+# case ALLOW_TRUST_TRUST_NOT_REQUIRED:
+# case ALLOW_TRUST_CANT_REVOKE:
+# case ALLOW_TRUST_SELF_NOT_ALLOWED:
+# case ALLOW_TRUST_LOW_RESERVE:
# void;
# };
#
@@ -19,7 +24,12 @@ class AllowTrustResult < XDR::Union
switch_on AllowTrustResultCode, :code
switch :allow_trust_success
- switch :default
+ switch :allow_trust_malformed
+ switch :allow_trust_no_trust_line
+ switch :allow_trust_trust_not_required
+ switch :allow_trust_cant_revoke
+ switch :allow_trust_self_not_allowed
+ switch :allow_trust_low_reserve
end
end
diff --git a/base/generated/stellar/auth.rb b/base/generated/stellar/auth.rb
index b801aef8..70f359a2 100644
--- a/base/generated/stellar/auth.rb
+++ b/base/generated/stellar/auth.rb
@@ -7,14 +7,12 @@
#
# struct Auth
# {
-# // Empty message, just to confirm
-# // establishment of MAC keys.
-# int unused;
+# int flags;
# };
#
# ===========================================================================
module Stellar
class Auth < XDR::Struct
- attribute :unused, XDR::Int
+ attribute :flags, XDR::Int
end
end
diff --git a/base/generated/stellar/begin_sponsoring_future_reserves_result.rb b/base/generated/stellar/begin_sponsoring_future_reserves_result.rb
index a0c61cf9..1f50ba19 100644
--- a/base/generated/stellar/begin_sponsoring_future_reserves_result.rb
+++ b/base/generated/stellar/begin_sponsoring_future_reserves_result.rb
@@ -10,7 +10,9 @@
# {
# case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS:
# void;
-# default:
+# case BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED:
+# case BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED:
+# case BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE:
# void;
# };
#
@@ -20,7 +22,9 @@ class BeginSponsoringFutureReservesResult < XDR::Union
switch_on BeginSponsoringFutureReservesResultCode, :code
switch :begin_sponsoring_future_reserves_success
- switch :default
+ switch :begin_sponsoring_future_reserves_malformed
+ switch :begin_sponsoring_future_reserves_already_sponsored
+ switch :begin_sponsoring_future_reserves_recursive
end
end
diff --git a/base/generated/stellar/bump_sequence_result.rb b/base/generated/stellar/bump_sequence_result.rb
index 3d5d8f65..63e05b3d 100644
--- a/base/generated/stellar/bump_sequence_result.rb
+++ b/base/generated/stellar/bump_sequence_result.rb
@@ -9,7 +9,7 @@
# {
# case BUMP_SEQUENCE_SUCCESS:
# void;
-# default:
+# case BUMP_SEQUENCE_BAD_SEQ:
# void;
# };
#
@@ -19,7 +19,7 @@ class BumpSequenceResult < XDR::Union
switch_on BumpSequenceResultCode, :code
switch :bump_sequence_success
- switch :default
+ switch :bump_sequence_bad_seq
end
end
diff --git a/base/generated/stellar/change_trust_result.rb b/base/generated/stellar/change_trust_result.rb
index de551bdd..17671b43 100644
--- a/base/generated/stellar/change_trust_result.rb
+++ b/base/generated/stellar/change_trust_result.rb
@@ -9,7 +9,14 @@
# {
# case CHANGE_TRUST_SUCCESS:
# void;
-# default:
+# case CHANGE_TRUST_MALFORMED:
+# case CHANGE_TRUST_NO_ISSUER:
+# case CHANGE_TRUST_INVALID_LIMIT:
+# case CHANGE_TRUST_LOW_RESERVE:
+# case CHANGE_TRUST_SELF_NOT_ALLOWED:
+# case CHANGE_TRUST_TRUST_LINE_MISSING:
+# case CHANGE_TRUST_CANNOT_DELETE:
+# case CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES:
# void;
# };
#
@@ -19,7 +26,14 @@ class ChangeTrustResult < XDR::Union
switch_on ChangeTrustResultCode, :code
switch :change_trust_success
- switch :default
+ switch :change_trust_malformed
+ switch :change_trust_no_issuer
+ switch :change_trust_invalid_limit
+ switch :change_trust_low_reserve
+ switch :change_trust_self_not_allowed
+ switch :change_trust_trust_line_missing
+ switch :change_trust_cannot_delete
+ switch :change_trust_not_auth_maintain_liabilities
end
end
diff --git a/base/generated/stellar/claim_claimable_balance_result.rb b/base/generated/stellar/claim_claimable_balance_result.rb
index c6660160..7bafa883 100644
--- a/base/generated/stellar/claim_claimable_balance_result.rb
+++ b/base/generated/stellar/claim_claimable_balance_result.rb
@@ -9,7 +9,11 @@
# {
# case CLAIM_CLAIMABLE_BALANCE_SUCCESS:
# void;
-# default:
+# case CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST:
+# case CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM:
+# case CLAIM_CLAIMABLE_BALANCE_LINE_FULL:
+# case CLAIM_CLAIMABLE_BALANCE_NO_TRUST:
+# case CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED:
# void;
# };
#
@@ -19,7 +23,11 @@ class ClaimClaimableBalanceResult < XDR::Union
switch_on ClaimClaimableBalanceResultCode, :code
switch :claim_claimable_balance_success
- switch :default
+ switch :claim_claimable_balance_does_not_exist
+ switch :claim_claimable_balance_cannot_claim
+ switch :claim_claimable_balance_line_full
+ switch :claim_claimable_balance_no_trust
+ switch :claim_claimable_balance_not_authorized
end
end
diff --git a/base/generated/stellar/claim_claimable_balance_result_code.rb b/base/generated/stellar/claim_claimable_balance_result_code.rb
index fc63a969..759fe73c 100644
--- a/base/generated/stellar/claim_claimable_balance_result_code.rb
+++ b/base/generated/stellar/claim_claimable_balance_result_code.rb
@@ -13,7 +13,6 @@
# CLAIM_CLAIMABLE_BALANCE_LINE_FULL = -3,
# CLAIM_CLAIMABLE_BALANCE_NO_TRUST = -4,
# CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -5
-#
# };
#
# ===========================================================================
diff --git a/base/generated/stellar/clawback_claimable_balance_result.rb b/base/generated/stellar/clawback_claimable_balance_result.rb
index 24daf53f..51da4d79 100644
--- a/base/generated/stellar/clawback_claimable_balance_result.rb
+++ b/base/generated/stellar/clawback_claimable_balance_result.rb
@@ -10,7 +10,9 @@
# {
# case CLAWBACK_CLAIMABLE_BALANCE_SUCCESS:
# void;
-# default:
+# case CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST:
+# case CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER:
+# case CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED:
# void;
# };
#
@@ -20,7 +22,9 @@ class ClawbackClaimableBalanceResult < XDR::Union
switch_on ClawbackClaimableBalanceResultCode, :code
switch :clawback_claimable_balance_success
- switch :default
+ switch :clawback_claimable_balance_does_not_exist
+ switch :clawback_claimable_balance_not_issuer
+ switch :clawback_claimable_balance_not_clawback_enabled
end
end
diff --git a/base/generated/stellar/clawback_result.rb b/base/generated/stellar/clawback_result.rb
index 39805f72..523ea1c9 100644
--- a/base/generated/stellar/clawback_result.rb
+++ b/base/generated/stellar/clawback_result.rb
@@ -9,7 +9,10 @@
# {
# case CLAWBACK_SUCCESS:
# void;
-# default:
+# case CLAWBACK_MALFORMED:
+# case CLAWBACK_NOT_CLAWBACK_ENABLED:
+# case CLAWBACK_NO_TRUST:
+# case CLAWBACK_UNDERFUNDED:
# void;
# };
#
@@ -19,7 +22,10 @@ class ClawbackResult < XDR::Union
switch_on ClawbackResultCode, :code
switch :clawback_success
- switch :default
+ switch :clawback_malformed
+ switch :clawback_not_clawback_enabled
+ switch :clawback_no_trust
+ switch :clawback_underfunded
end
end
diff --git a/base/generated/stellar/config_setting_contract_bandwidth_v0.rb b/base/generated/stellar/config_setting_contract_bandwidth_v0.rb
new file mode 100644
index 00000000..daa7f238
--- /dev/null
+++ b/base/generated/stellar/config_setting_contract_bandwidth_v0.rb
@@ -0,0 +1,26 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ConfigSettingContractBandwidthV0
+# {
+# // Maximum sum of all transaction sizes in the ledger in bytes
+# uint32 ledgerMaxTxsSizeBytes;
+# // Maximum size in bytes for a transaction
+# uint32 txMaxSizeBytes;
+#
+# // Fee for 1 KB of transaction size
+# int64 feeTxSize1KB;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigSettingContractBandwidthV0 < XDR::Struct
+ attribute :ledger_max_txs_size_bytes, Uint32
+ attribute :tx_max_size_bytes, Uint32
+ attribute :fee_tx_size1_kb, Int64
+ end
+end
diff --git a/base/generated/stellar/config_setting_contract_compute_v0.rb b/base/generated/stellar/config_setting_contract_compute_v0.rb
new file mode 100644
index 00000000..e1bab7cb
--- /dev/null
+++ b/base/generated/stellar/config_setting_contract_compute_v0.rb
@@ -0,0 +1,30 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ConfigSettingContractComputeV0
+# {
+# // Maximum instructions per ledger
+# int64 ledgerMaxInstructions;
+# // Maximum instructions per transaction
+# int64 txMaxInstructions;
+# // Cost of 10000 instructions
+# int64 feeRatePerInstructionsIncrement;
+#
+# // Memory limit per transaction. Unlike instructions, there is no fee
+# // for memory, just the limit.
+# uint32 txMemoryLimit;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigSettingContractComputeV0 < XDR::Struct
+ attribute :ledger_max_instructions, Int64
+ attribute :tx_max_instructions, Int64
+ attribute :fee_rate_per_instructions_increment, Int64
+ attribute :tx_memory_limit, Uint32
+ end
+end
diff --git a/base/generated/stellar/config_setting_contract_events_v0.rb b/base/generated/stellar/config_setting_contract_events_v0.rb
new file mode 100644
index 00000000..a1e92450
--- /dev/null
+++ b/base/generated/stellar/config_setting_contract_events_v0.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ConfigSettingContractEventsV0
+# {
+# // Maximum size of events that a contract call can emit.
+# uint32 txMaxContractEventsSizeBytes;
+# // Fee for generating 1KB of contract events.
+# int64 feeContractEvents1KB;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigSettingContractEventsV0 < XDR::Struct
+ attribute :tx_max_contract_events_size_bytes, Uint32
+ attribute :fee_contract_events1_kb, Int64
+ end
+end
diff --git a/base/generated/stellar/config_setting_contract_execution_lanes_v0.rb b/base/generated/stellar/config_setting_contract_execution_lanes_v0.rb
new file mode 100644
index 00000000..40d03ba3
--- /dev/null
+++ b/base/generated/stellar/config_setting_contract_execution_lanes_v0.rb
@@ -0,0 +1,19 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ConfigSettingContractExecutionLanesV0
+# {
+# // maximum number of Soroban transactions per ledger
+# uint32 ledgerMaxTxCount;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigSettingContractExecutionLanesV0 < XDR::Struct
+ attribute :ledger_max_tx_count, Uint32
+ end
+end
diff --git a/base/generated/stellar/config_setting_contract_historical_data_v0.rb b/base/generated/stellar/config_setting_contract_historical_data_v0.rb
new file mode 100644
index 00000000..efe8f419
--- /dev/null
+++ b/base/generated/stellar/config_setting_contract_historical_data_v0.rb
@@ -0,0 +1,18 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ConfigSettingContractHistoricalDataV0
+# {
+# int64 feeHistorical1KB; // Fee for storing 1KB in archives
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigSettingContractHistoricalDataV0 < XDR::Struct
+ attribute :fee_historical1_kb, Int64
+ end
+end
diff --git a/base/generated/stellar/config_setting_contract_ledger_cost_v0.rb b/base/generated/stellar/config_setting_contract_ledger_cost_v0.rb
new file mode 100644
index 00000000..2fd7297e
--- /dev/null
+++ b/base/generated/stellar/config_setting_contract_ledger_cost_v0.rb
@@ -0,0 +1,63 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ConfigSettingContractLedgerCostV0
+# {
+# // Maximum number of ledger entry read operations per ledger
+# uint32 ledgerMaxReadLedgerEntries;
+# // Maximum number of bytes that can be read per ledger
+# uint32 ledgerMaxReadBytes;
+# // Maximum number of ledger entry write operations per ledger
+# uint32 ledgerMaxWriteLedgerEntries;
+# // Maximum number of bytes that can be written per ledger
+# uint32 ledgerMaxWriteBytes;
+#
+# // Maximum number of ledger entry read operations per transaction
+# uint32 txMaxReadLedgerEntries;
+# // Maximum number of bytes that can be read per transaction
+# uint32 txMaxReadBytes;
+# // Maximum number of ledger entry write operations per transaction
+# uint32 txMaxWriteLedgerEntries;
+# // Maximum number of bytes that can be written per transaction
+# uint32 txMaxWriteBytes;
+#
+# int64 feeReadLedgerEntry; // Fee per ledger entry read
+# int64 feeWriteLedgerEntry; // Fee per ledger entry write
+#
+# int64 feeRead1KB; // Fee for reading 1KB
+#
+# // The following parameters determine the write fee per 1KB.
+# // Write fee grows linearly until bucket list reaches this size
+# int64 bucketListTargetSizeBytes;
+# // Fee per 1KB write when the bucket list is empty
+# int64 writeFee1KBBucketListLow;
+# // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes`
+# int64 writeFee1KBBucketListHigh;
+# // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes`
+# uint32 bucketListWriteFeeGrowthFactor;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigSettingContractLedgerCostV0 < XDR::Struct
+ attribute :ledger_max_read_ledger_entries, Uint32
+ attribute :ledger_max_read_bytes, Uint32
+ attribute :ledger_max_write_ledger_entries, Uint32
+ attribute :ledger_max_write_bytes, Uint32
+ attribute :tx_max_read_ledger_entries, Uint32
+ attribute :tx_max_read_bytes, Uint32
+ attribute :tx_max_write_ledger_entries, Uint32
+ attribute :tx_max_write_bytes, Uint32
+ attribute :fee_read_ledger_entry, Int64
+ attribute :fee_write_ledger_entry, Int64
+ attribute :fee_read1_kb, Int64
+ attribute :bucket_list_target_size_bytes, Int64
+ attribute :write_fee1_kb_bucket_list_low, Int64
+ attribute :write_fee1_kb_bucket_list_high, Int64
+ attribute :bucket_list_write_fee_growth_factor, Uint32
+ end
+end
diff --git a/base/generated/stellar/config_setting_entry.rb b/base/generated/stellar/config_setting_entry.rb
new file mode 100644
index 00000000..91dae95a
--- /dev/null
+++ b/base/generated/stellar/config_setting_entry.rb
@@ -0,0 +1,75 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union ConfigSettingEntry switch (ConfigSettingID configSettingID)
+# {
+# case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES:
+# uint32 contractMaxSizeBytes;
+# case CONFIG_SETTING_CONTRACT_COMPUTE_V0:
+# ConfigSettingContractComputeV0 contractCompute;
+# case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0:
+# ConfigSettingContractLedgerCostV0 contractLedgerCost;
+# case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0:
+# ConfigSettingContractHistoricalDataV0 contractHistoricalData;
+# case CONFIG_SETTING_CONTRACT_EVENTS_V0:
+# ConfigSettingContractEventsV0 contractEvents;
+# case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0:
+# ConfigSettingContractBandwidthV0 contractBandwidth;
+# case CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS:
+# ContractCostParams contractCostParamsCpuInsns;
+# case CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES:
+# ContractCostParams contractCostParamsMemBytes;
+# case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES:
+# uint32 contractDataKeySizeBytes;
+# case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES:
+# uint32 contractDataEntrySizeBytes;
+# case CONFIG_SETTING_STATE_ARCHIVAL:
+# StateArchivalSettings stateArchivalSettings;
+# case CONFIG_SETTING_CONTRACT_EXECUTION_LANES:
+# ConfigSettingContractExecutionLanesV0 contractExecutionLanes;
+# case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW:
+# uint64 bucketListSizeWindow<>;
+# case CONFIG_SETTING_EVICTION_ITERATOR:
+# EvictionIterator evictionIterator;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigSettingEntry < XDR::Union
+ switch_on ConfigSettingID, :configSettingID
+
+ switch :config_setting_contract_max_size_bytes, :contract_max_size_bytes
+ switch :config_setting_contract_compute_v0, :contract_compute
+ switch :config_setting_contract_ledger_cost_v0, :contract_ledger_cost
+ switch :config_setting_contract_historical_data_v0, :contract_historical_data
+ switch :config_setting_contract_events_v0, :contract_events
+ switch :config_setting_contract_bandwidth_v0, :contract_bandwidth
+ switch :config_setting_contract_cost_params_cpu_instructions, :contract_cost_params_cpu_insns
+ switch :config_setting_contract_cost_params_memory_bytes, :contract_cost_params_mem_bytes
+ switch :config_setting_contract_data_key_size_bytes, :contract_data_key_size_bytes
+ switch :config_setting_contract_data_entry_size_bytes, :contract_data_entry_size_bytes
+ switch :config_setting_state_archival, :state_archival_settings
+ switch :config_setting_contract_execution_lanes, :contract_execution_lanes
+ switch :config_setting_bucketlist_size_window, :bucket_list_size_window
+ switch :config_setting_eviction_iterator, :eviction_iterator
+
+ attribute :contract_max_size_bytes, Uint32
+ attribute :contract_compute, ConfigSettingContractComputeV0
+ attribute :contract_ledger_cost, ConfigSettingContractLedgerCostV0
+ attribute :contract_historical_data, ConfigSettingContractHistoricalDataV0
+ attribute :contract_events, ConfigSettingContractEventsV0
+ attribute :contract_bandwidth, ConfigSettingContractBandwidthV0
+ attribute :contract_cost_params_cpu_insns, ContractCostParams
+ attribute :contract_cost_params_mem_bytes, ContractCostParams
+ attribute :contract_data_key_size_bytes, Uint32
+ attribute :contract_data_entry_size_bytes, Uint32
+ attribute :state_archival_settings, StateArchivalSettings
+ attribute :contract_execution_lanes, ConfigSettingContractExecutionLanesV0
+ attribute :bucket_list_size_window, XDR::VarArray[Uint64]
+ attribute :eviction_iterator, EvictionIterator
+ end
+end
diff --git a/base/generated/stellar/config_setting_id.rb b/base/generated/stellar/config_setting_id.rb
new file mode 100644
index 00000000..954fdae0
--- /dev/null
+++ b/base/generated/stellar/config_setting_id.rb
@@ -0,0 +1,46 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum ConfigSettingID
+# {
+# CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0,
+# CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1,
+# CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2,
+# CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3,
+# CONFIG_SETTING_CONTRACT_EVENTS_V0 = 4,
+# CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5,
+# CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS = 6,
+# CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7,
+# CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8,
+# CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9,
+# CONFIG_SETTING_STATE_ARCHIVAL = 10,
+# CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11,
+# CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12,
+# CONFIG_SETTING_EVICTION_ITERATOR = 13
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigSettingID < XDR::Enum
+ member :config_setting_contract_max_size_bytes, 0
+ member :config_setting_contract_compute_v0, 1
+ member :config_setting_contract_ledger_cost_v0, 2
+ member :config_setting_contract_historical_data_v0, 3
+ member :config_setting_contract_events_v0, 4
+ member :config_setting_contract_bandwidth_v0, 5
+ member :config_setting_contract_cost_params_cpu_instructions, 6
+ member :config_setting_contract_cost_params_memory_bytes, 7
+ member :config_setting_contract_data_key_size_bytes, 8
+ member :config_setting_contract_data_entry_size_bytes, 9
+ member :config_setting_state_archival, 10
+ member :config_setting_contract_execution_lanes, 11
+ member :config_setting_bucketlist_size_window, 12
+ member :config_setting_eviction_iterator, 13
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/config_upgrade_set.rb b/base/generated/stellar/config_upgrade_set.rb
new file mode 100644
index 00000000..2d1bf4f3
--- /dev/null
+++ b/base/generated/stellar/config_upgrade_set.rb
@@ -0,0 +1,17 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ConfigUpgradeSet {
+# ConfigSettingEntry updatedEntry<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigUpgradeSet < XDR::Struct
+ attribute :updated_entry, XDR::VarArray[ConfigSettingEntry]
+ end
+end
diff --git a/base/generated/stellar/config_upgrade_set_key.rb b/base/generated/stellar/config_upgrade_set_key.rb
new file mode 100644
index 00000000..0233f873
--- /dev/null
+++ b/base/generated/stellar/config_upgrade_set_key.rb
@@ -0,0 +1,19 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ConfigUpgradeSetKey {
+# Hash contractID;
+# Hash contentHash;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ConfigUpgradeSetKey < XDR::Struct
+ attribute :contract_id, Hash
+ attribute :content_hash, Hash
+ end
+end
diff --git a/base/generated/stellar/contract_code_entry.rb b/base/generated/stellar/contract_code_entry.rb
new file mode 100644
index 00000000..b25d5a62
--- /dev/null
+++ b/base/generated/stellar/contract_code_entry.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ContractCodeEntry {
+# ExtensionPoint ext;
+#
+# Hash hash;
+# opaque code<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractCodeEntry < XDR::Struct
+ attribute :ext, ExtensionPoint
+ attribute :hash, Hash
+ attribute :code, XDR::VarOpaque[]
+ end
+end
diff --git a/base/generated/stellar/contract_cost_param_entry.rb b/base/generated/stellar/contract_cost_param_entry.rb
new file mode 100644
index 00000000..9abbb89a
--- /dev/null
+++ b/base/generated/stellar/contract_cost_param_entry.rb
@@ -0,0 +1,23 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ContractCostParamEntry {
+# // use `ext` to add more terms (e.g. higher order polynomials) in the future
+# ExtensionPoint ext;
+#
+# int64 constTerm;
+# int64 linearTerm;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractCostParamEntry < XDR::Struct
+ attribute :ext, ExtensionPoint
+ attribute :const_term, Int64
+ attribute :linear_term, Int64
+ end
+end
diff --git a/base/generated/stellar/contract_cost_type.rb b/base/generated/stellar/contract_cost_type.rb
new file mode 100644
index 00000000..823c7f1b
--- /dev/null
+++ b/base/generated/stellar/contract_cost_type.rb
@@ -0,0 +1,90 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum ContractCostType {
+# // Cost of running 1 wasm instruction
+# WasmInsnExec = 0,
+# // Cost of allocating a slice of memory (in bytes)
+# MemAlloc = 1,
+# // Cost of copying a slice of bytes into a pre-allocated memory
+# MemCpy = 2,
+# // Cost of comparing two slices of memory
+# MemCmp = 3,
+# // Cost of a host function dispatch, not including the actual work done by
+# // the function nor the cost of VM invocation machinary
+# DispatchHostFunction = 4,
+# // Cost of visiting a host object from the host object storage. Exists to
+# // make sure some baseline cost coverage, i.e. repeatly visiting objects
+# // by the guest will always incur some charges.
+# VisitObject = 5,
+# // Cost of serializing an xdr object to bytes
+# ValSer = 6,
+# // Cost of deserializing an xdr object from bytes
+# ValDeser = 7,
+# // Cost of computing the sha256 hash from bytes
+# ComputeSha256Hash = 8,
+# // Cost of computing the ed25519 pubkey from bytes
+# ComputeEd25519PubKey = 9,
+# // Cost of verifying ed25519 signature of a payload.
+# VerifyEd25519Sig = 10,
+# // Cost of instantiation a VM from wasm bytes code.
+# VmInstantiation = 11,
+# // Cost of instantiation a VM from a cached state.
+# VmCachedInstantiation = 12,
+# // Cost of invoking a function on the VM. If the function is a host function,
+# // additional cost will be covered by `DispatchHostFunction`.
+# InvokeVmFunction = 13,
+# // Cost of computing a keccak256 hash from bytes.
+# ComputeKeccak256Hash = 14,
+# // Cost of computing an ECDSA secp256k1 signature from bytes.
+# ComputeEcdsaSecp256k1Sig = 15,
+# // Cost of recovering an ECDSA secp256k1 key from a signature.
+# RecoverEcdsaSecp256k1Key = 16,
+# // Cost of int256 addition (`+`) and subtraction (`-`) operations
+# Int256AddSub = 17,
+# // Cost of int256 multiplication (`*`) operation
+# Int256Mul = 18,
+# // Cost of int256 division (`/`) operation
+# Int256Div = 19,
+# // Cost of int256 power (`exp`) operation
+# Int256Pow = 20,
+# // Cost of int256 shift (`shl`, `shr`) operation
+# Int256Shift = 21,
+# // Cost of drawing random bytes using a ChaCha20 PRNG
+# ChaCha20DrawBytes = 22
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractCostType < XDR::Enum
+ member :wasm_insn_exec, 0
+ member :mem_alloc, 1
+ member :mem_cpy, 2
+ member :mem_cmp, 3
+ member :dispatch_host_function, 4
+ member :visit_object, 5
+ member :val_ser, 6
+ member :val_deser, 7
+ member :compute_sha256_hash, 8
+ member :compute_ed25519_pub_key, 9
+ member :verify_ed25519_sig, 10
+ member :vm_instantiation, 11
+ member :vm_cached_instantiation, 12
+ member :invoke_vm_function, 13
+ member :compute_keccak256_hash, 14
+ member :compute_ecdsa_secp256k1_sig, 15
+ member :recover_ecdsa_secp256k1_key, 16
+ member :int256_add_sub, 17
+ member :int256_mul, 18
+ member :int256_div, 19
+ member :int256_pow, 20
+ member :int256_shift, 21
+ member :cha_cha20_draw_bytes, 22
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/contract_data_durability.rb b/base/generated/stellar/contract_data_durability.rb
new file mode 100644
index 00000000..f47ee542
--- /dev/null
+++ b/base/generated/stellar/contract_data_durability.rb
@@ -0,0 +1,21 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum ContractDataDurability {
+# TEMPORARY = 0,
+# PERSISTENT = 1
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractDataDurability < XDR::Enum
+ member :temporary, 0
+ member :persistent, 1
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/contract_data_entry.rb b/base/generated/stellar/contract_data_entry.rb
new file mode 100644
index 00000000..d21433c2
--- /dev/null
+++ b/base/generated/stellar/contract_data_entry.rb
@@ -0,0 +1,26 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ContractDataEntry {
+# ExtensionPoint ext;
+#
+# SCAddress contract;
+# SCVal key;
+# ContractDataDurability durability;
+# SCVal val;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractDataEntry < XDR::Struct
+ attribute :ext, ExtensionPoint
+ attribute :contract, SCAddress
+ attribute :key, SCVal
+ attribute :durability, ContractDataDurability
+ attribute :val, SCVal
+ end
+end
diff --git a/base/generated/stellar/contract_event.rb b/base/generated/stellar/contract_event.rb
new file mode 100644
index 00000000..222f1ed9
--- /dev/null
+++ b/base/generated/stellar/contract_event.rb
@@ -0,0 +1,41 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ContractEvent
+# {
+# // We can use this to add more fields, or because it
+# // is first, to change ContractEvent into a union.
+# ExtensionPoint ext;
+#
+# Hash* contractID;
+# ContractEventType type;
+#
+# union switch (int v)
+# {
+# case 0:
+# struct
+# {
+# SCVal topics<>;
+# SCVal data;
+# } v0;
+# }
+# body;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractEvent < XDR::Struct
+ include XDR::Namespace
+
+ autoload :Body
+
+ attribute :ext, ExtensionPoint
+ attribute :contract_id, XDR::Option[Hash]
+ attribute :type, ContractEventType
+ attribute :body, Body
+ end
+end
diff --git a/base/generated/stellar/contract_event/body.rb b/base/generated/stellar/contract_event/body.rb
new file mode 100644
index 00000000..f06349bd
--- /dev/null
+++ b/base/generated/stellar/contract_event/body.rb
@@ -0,0 +1,33 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union switch (int v)
+# {
+# case 0:
+# struct
+# {
+# SCVal topics<>;
+# SCVal data;
+# } v0;
+# }
+#
+# ===========================================================================
+module Stellar
+ class ContractEvent
+ class Body < XDR::Union
+ include XDR::Namespace
+
+ autoload :V0
+
+ switch_on XDR::Int, :v
+
+ switch 0, :v0
+
+ attribute :v0, V0
+ end
+ end
+end
diff --git a/base/generated/stellar/contract_event/body/v0.rb b/base/generated/stellar/contract_event/body/v0.rb
new file mode 100644
index 00000000..faf96fe3
--- /dev/null
+++ b/base/generated/stellar/contract_event/body/v0.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct
+# {
+# SCVal topics<>;
+# SCVal data;
+# }
+#
+# ===========================================================================
+module Stellar
+ class ContractEvent
+ class Body
+ class V0 < XDR::Struct
+ attribute :topics, XDR::VarArray[SCVal]
+ attribute :data, SCVal
+ end
+ end
+ end
+end
diff --git a/base/generated/stellar/contract_event_type.rb b/base/generated/stellar/contract_event_type.rb
new file mode 100644
index 00000000..9fed7a37
--- /dev/null
+++ b/base/generated/stellar/contract_event_type.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum ContractEventType
+# {
+# SYSTEM = 0,
+# CONTRACT = 1,
+# DIAGNOSTIC = 2
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractEventType < XDR::Enum
+ member :system, 0
+ member :contract, 1
+ member :diagnostic, 2
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/contract_executable.rb b/base/generated/stellar/contract_executable.rb
new file mode 100644
index 00000000..1e001245
--- /dev/null
+++ b/base/generated/stellar/contract_executable.rb
@@ -0,0 +1,26 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union ContractExecutable switch (ContractExecutableType type)
+# {
+# case CONTRACT_EXECUTABLE_WASM:
+# Hash wasm_hash;
+# case CONTRACT_EXECUTABLE_STELLAR_ASSET:
+# void;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractExecutable < XDR::Union
+ switch_on ContractExecutableType, :type
+
+ switch :contract_executable_wasm, :wasm_hash
+ switch :contract_executable_stellar_asset
+
+ attribute :wasm_hash, Hash
+ end
+end
diff --git a/base/generated/stellar/contract_executable_type.rb b/base/generated/stellar/contract_executable_type.rb
new file mode 100644
index 00000000..fd198e1b
--- /dev/null
+++ b/base/generated/stellar/contract_executable_type.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum ContractExecutableType
+# {
+# CONTRACT_EXECUTABLE_WASM = 0,
+# CONTRACT_EXECUTABLE_STELLAR_ASSET = 1
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractExecutableType < XDR::Enum
+ member :contract_executable_wasm, 0
+ member :contract_executable_stellar_asset, 1
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/contract_id_preimage.rb b/base/generated/stellar/contract_id_preimage.rb
new file mode 100644
index 00000000..2fa23d1a
--- /dev/null
+++ b/base/generated/stellar/contract_id_preimage.rb
@@ -0,0 +1,35 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union ContractIDPreimage switch (ContractIDPreimageType type)
+# {
+# case CONTRACT_ID_PREIMAGE_FROM_ADDRESS:
+# struct
+# {
+# SCAddress address;
+# uint256 salt;
+# } fromAddress;
+# case CONTRACT_ID_PREIMAGE_FROM_ASSET:
+# Asset fromAsset;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractIDPreimage < XDR::Union
+ include XDR::Namespace
+
+ autoload :FromAddress
+
+ switch_on ContractIDPreimageType, :type
+
+ switch :contract_id_preimage_from_address, :from_address
+ switch :contract_id_preimage_from_asset, :from_asset
+
+ attribute :from_address, FromAddress
+ attribute :from_asset, Asset
+ end
+end
diff --git a/base/generated/stellar/contract_id_preimage/from_address.rb b/base/generated/stellar/contract_id_preimage/from_address.rb
new file mode 100644
index 00000000..2590e87d
--- /dev/null
+++ b/base/generated/stellar/contract_id_preimage/from_address.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct
+# {
+# SCAddress address;
+# uint256 salt;
+# }
+#
+# ===========================================================================
+module Stellar
+ class ContractIDPreimage
+ class FromAddress < XDR::Struct
+ attribute :address, SCAddress
+ attribute :salt, Uint256
+ end
+ end
+end
diff --git a/base/generated/stellar/contract_id_preimage_type.rb b/base/generated/stellar/contract_id_preimage_type.rb
new file mode 100644
index 00000000..108d435f
--- /dev/null
+++ b/base/generated/stellar/contract_id_preimage_type.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum ContractIDPreimageType
+# {
+# CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0,
+# CONTRACT_ID_PREIMAGE_FROM_ASSET = 1
+# };
+#
+# ===========================================================================
+module Stellar
+ class ContractIDPreimageType < XDR::Enum
+ member :contract_id_preimage_from_address, 0
+ member :contract_id_preimage_from_asset, 1
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/create_account_result.rb b/base/generated/stellar/create_account_result.rb
index a86cf27a..65b2d176 100644
--- a/base/generated/stellar/create_account_result.rb
+++ b/base/generated/stellar/create_account_result.rb
@@ -9,7 +9,10 @@
# {
# case CREATE_ACCOUNT_SUCCESS:
# void;
-# default:
+# case CREATE_ACCOUNT_MALFORMED:
+# case CREATE_ACCOUNT_UNDERFUNDED:
+# case CREATE_ACCOUNT_LOW_RESERVE:
+# case CREATE_ACCOUNT_ALREADY_EXIST:
# void;
# };
#
@@ -19,7 +22,10 @@ class CreateAccountResult < XDR::Union
switch_on CreateAccountResultCode, :code
switch :create_account_success
- switch :default
+ switch :create_account_malformed
+ switch :create_account_underfunded
+ switch :create_account_low_reserve
+ switch :create_account_already_exist
end
end
diff --git a/base/generated/stellar/create_claimable_balance_result.rb b/base/generated/stellar/create_claimable_balance_result.rb
index d4ef68db..338e983a 100644
--- a/base/generated/stellar/create_claimable_balance_result.rb
+++ b/base/generated/stellar/create_claimable_balance_result.rb
@@ -10,7 +10,11 @@
# {
# case CREATE_CLAIMABLE_BALANCE_SUCCESS:
# ClaimableBalanceID balanceID;
-# default:
+# case CREATE_CLAIMABLE_BALANCE_MALFORMED:
+# case CREATE_CLAIMABLE_BALANCE_LOW_RESERVE:
+# case CREATE_CLAIMABLE_BALANCE_NO_TRUST:
+# case CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED:
+# case CREATE_CLAIMABLE_BALANCE_UNDERFUNDED:
# void;
# };
#
@@ -19,8 +23,12 @@ module Stellar
class CreateClaimableBalanceResult < XDR::Union
switch_on CreateClaimableBalanceResultCode, :code
- switch :create_claimable_balance_success, :balance_id
- switch :default
+ switch :create_claimable_balance_success, :balance_id
+ switch :create_claimable_balance_malformed
+ switch :create_claimable_balance_low_reserve
+ switch :create_claimable_balance_no_trust
+ switch :create_claimable_balance_not_authorized
+ switch :create_claimable_balance_underfunded
attribute :balance_id, ClaimableBalanceID
end
diff --git a/base/generated/stellar/create_contract_args.rb b/base/generated/stellar/create_contract_args.rb
new file mode 100644
index 00000000..9def9e17
--- /dev/null
+++ b/base/generated/stellar/create_contract_args.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct CreateContractArgs
+# {
+# ContractIDPreimage contractIDPreimage;
+# ContractExecutable executable;
+# };
+#
+# ===========================================================================
+module Stellar
+ class CreateContractArgs < XDR::Struct
+ attribute :contract_id_preimage, ContractIDPreimage
+ attribute :executable, ContractExecutable
+ end
+end
diff --git a/base/generated/stellar/diagnostic_event.rb b/base/generated/stellar/diagnostic_event.rb
new file mode 100644
index 00000000..f14d7266
--- /dev/null
+++ b/base/generated/stellar/diagnostic_event.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct DiagnosticEvent
+# {
+# bool inSuccessfulContractCall;
+# ContractEvent event;
+# };
+#
+# ===========================================================================
+module Stellar
+ class DiagnosticEvent < XDR::Struct
+ attribute :in_successful_contract_call, XDR::Bool
+ attribute :event, ContractEvent
+ end
+end
diff --git a/base/generated/stellar/end_sponsoring_future_reserves_result.rb b/base/generated/stellar/end_sponsoring_future_reserves_result.rb
index be33c124..89b68440 100644
--- a/base/generated/stellar/end_sponsoring_future_reserves_result.rb
+++ b/base/generated/stellar/end_sponsoring_future_reserves_result.rb
@@ -10,7 +10,7 @@
# {
# case END_SPONSORING_FUTURE_RESERVES_SUCCESS:
# void;
-# default:
+# case END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED:
# void;
# };
#
@@ -20,7 +20,7 @@ class EndSponsoringFutureReservesResult < XDR::Union
switch_on EndSponsoringFutureReservesResultCode, :code
switch :end_sponsoring_future_reserves_success
- switch :default
+ switch :end_sponsoring_future_reserves_not_sponsored
end
end
diff --git a/base/generated/stellar/envelope_type.rb b/base/generated/stellar/envelope_type.rb
index 80640131..19a2e566 100644
--- a/base/generated/stellar/envelope_type.rb
+++ b/base/generated/stellar/envelope_type.rb
@@ -14,20 +14,24 @@
# ENVELOPE_TYPE_SCPVALUE = 4,
# ENVELOPE_TYPE_TX_FEE_BUMP = 5,
# ENVELOPE_TYPE_OP_ID = 6,
-# ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7
+# ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7,
+# ENVELOPE_TYPE_CONTRACT_ID = 8,
+# ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9
# };
#
# ===========================================================================
module Stellar
class EnvelopeType < XDR::Enum
- member :envelope_type_tx_v0, 0
- member :envelope_type_scp, 1
- member :envelope_type_tx, 2
- member :envelope_type_auth, 3
- member :envelope_type_scpvalue, 4
- member :envelope_type_tx_fee_bump, 5
- member :envelope_type_op_id, 6
- member :envelope_type_pool_revoke_op_id, 7
+ member :envelope_type_tx_v0, 0
+ member :envelope_type_scp, 1
+ member :envelope_type_tx, 2
+ member :envelope_type_auth, 3
+ member :envelope_type_scpvalue, 4
+ member :envelope_type_tx_fee_bump, 5
+ member :envelope_type_op_id, 6
+ member :envelope_type_pool_revoke_op_id, 7
+ member :envelope_type_contract_id, 8
+ member :envelope_type_soroban_authorization, 9
seal
end
diff --git a/base/generated/stellar/eviction_iterator.rb b/base/generated/stellar/eviction_iterator.rb
new file mode 100644
index 00000000..51ebec0c
--- /dev/null
+++ b/base/generated/stellar/eviction_iterator.rb
@@ -0,0 +1,21 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct EvictionIterator {
+# uint32 bucketListLevel;
+# bool isCurrBucket;
+# uint64 bucketFileOffset;
+# };
+#
+# ===========================================================================
+module Stellar
+ class EvictionIterator < XDR::Struct
+ attribute :bucket_list_level, Uint32
+ attribute :is_curr_bucket, XDR::Bool
+ attribute :bucket_file_offset, Uint64
+ end
+end
diff --git a/base/generated/stellar/extend_footprint_ttl_op.rb b/base/generated/stellar/extend_footprint_ttl_op.rb
new file mode 100644
index 00000000..bae0d522
--- /dev/null
+++ b/base/generated/stellar/extend_footprint_ttl_op.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct ExtendFootprintTTLOp
+# {
+# ExtensionPoint ext;
+# uint32 extendTo;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ExtendFootprintTTLOp < XDR::Struct
+ attribute :ext, ExtensionPoint
+ attribute :extend_to, Uint32
+ end
+end
diff --git a/base/generated/stellar/extend_footprint_ttl_result.rb b/base/generated/stellar/extend_footprint_ttl_result.rb
new file mode 100644
index 00000000..a4838d02
--- /dev/null
+++ b/base/generated/stellar/extend_footprint_ttl_result.rb
@@ -0,0 +1,29 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union ExtendFootprintTTLResult switch (ExtendFootprintTTLResultCode code)
+# {
+# case EXTEND_FOOTPRINT_TTL_SUCCESS:
+# void;
+# case EXTEND_FOOTPRINT_TTL_MALFORMED:
+# case EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED:
+# case EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE:
+# void;
+# };
+#
+# ===========================================================================
+module Stellar
+ class ExtendFootprintTTLResult < XDR::Union
+ switch_on ExtendFootprintTTLResultCode, :code
+
+ switch :extend_footprint_ttl_success
+ switch :extend_footprint_ttl_malformed
+ switch :extend_footprint_ttl_resource_limit_exceeded
+ switch :extend_footprint_ttl_insufficient_refundable_fee
+
+ end
+end
diff --git a/base/generated/stellar/extend_footprint_ttl_result_code.rb b/base/generated/stellar/extend_footprint_ttl_result_code.rb
new file mode 100644
index 00000000..a3363273
--- /dev/null
+++ b/base/generated/stellar/extend_footprint_ttl_result_code.rb
@@ -0,0 +1,29 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum ExtendFootprintTTLResultCode
+# {
+# // codes considered as "success" for the operation
+# EXTEND_FOOTPRINT_TTL_SUCCESS = 0,
+#
+# // codes considered as "failure" for the operation
+# EXTEND_FOOTPRINT_TTL_MALFORMED = -1,
+# EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED = -2,
+# EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE = -3
+# };
+#
+# ===========================================================================
+module Stellar
+ class ExtendFootprintTTLResultCode < XDR::Enum
+ member :extend_footprint_ttl_success, 0
+ member :extend_footprint_ttl_malformed, -1
+ member :extend_footprint_ttl_resource_limit_exceeded, -2
+ member :extend_footprint_ttl_insufficient_refundable_fee, -3
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/flood_advert.rb b/base/generated/stellar/flood_advert.rb
new file mode 100644
index 00000000..36492980
--- /dev/null
+++ b/base/generated/stellar/flood_advert.rb
@@ -0,0 +1,18 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct FloodAdvert
+# {
+# TxAdvertVector txHashes;
+# };
+#
+# ===========================================================================
+module Stellar
+ class FloodAdvert < XDR::Struct
+ attribute :tx_hashes, TxAdvertVector
+ end
+end
diff --git a/base/generated/stellar/flood_demand.rb b/base/generated/stellar/flood_demand.rb
new file mode 100644
index 00000000..396a65e5
--- /dev/null
+++ b/base/generated/stellar/flood_demand.rb
@@ -0,0 +1,18 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct FloodDemand
+# {
+# TxDemandVector txHashes;
+# };
+#
+# ===========================================================================
+module Stellar
+ class FloodDemand < XDR::Struct
+ attribute :tx_hashes, TxDemandVector
+ end
+end
diff --git a/base/generated/stellar/generalized_transaction_set.rb b/base/generated/stellar/generalized_transaction_set.rb
new file mode 100644
index 00000000..99e6d1f7
--- /dev/null
+++ b/base/generated/stellar/generalized_transaction_set.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union GeneralizedTransactionSet switch (int v)
+# {
+# // We consider the legacy TransactionSet to be v0.
+# case 1:
+# TransactionSetV1 v1TxSet;
+# };
+#
+# ===========================================================================
+module Stellar
+ class GeneralizedTransactionSet < XDR::Union
+ switch_on XDR::Int, :v
+
+ switch 1, :v1_tx_set
+
+ attribute :v1_tx_set, TransactionSetV1
+ end
+end
diff --git a/base/generated/stellar/hash_id_preimage.rb b/base/generated/stellar/hash_id_preimage.rb
index cb3cea34..c2db71a6 100644
--- a/base/generated/stellar/hash_id_preimage.rb
+++ b/base/generated/stellar/hash_id_preimage.rb
@@ -18,11 +18,25 @@
# struct
# {
# AccountID sourceAccount;
-# SequenceNumber seqNum;
+# SequenceNumber seqNum;
# uint32 opNum;
# PoolID liquidityPoolID;
# Asset asset;
# } revokeID;
+# case ENVELOPE_TYPE_CONTRACT_ID:
+# struct
+# {
+# Hash networkID;
+# ContractIDPreimage contractIDPreimage;
+# } contractID;
+# case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION:
+# struct
+# {
+# Hash networkID;
+# int64 nonce;
+# uint32 signatureExpirationLedger;
+# SorobanAuthorizedInvocation invocation;
+# } sorobanAuthorization;
# };
#
# ===========================================================================
@@ -32,13 +46,19 @@ class HashIDPreimage < XDR::Union
autoload :OperationID
autoload :RevokeID
+ autoload :ContractID
+ autoload :SorobanAuthorization
switch_on EnvelopeType, :type
- switch :envelope_type_op_id, :operation_id
- switch :envelope_type_pool_revoke_op_id, :revoke_id
+ switch :envelope_type_op_id, :operation_id
+ switch :envelope_type_pool_revoke_op_id, :revoke_id
+ switch :envelope_type_contract_id, :contract_id
+ switch :envelope_type_soroban_authorization, :soroban_authorization
- attribute :operation_id, OperationID
- attribute :revoke_id, RevokeID
+ attribute :operation_id, OperationID
+ attribute :revoke_id, RevokeID
+ attribute :contract_id, ContractID
+ attribute :soroban_authorization, SorobanAuthorization
end
end
diff --git a/base/generated/stellar/hash_id_preimage/contract_id.rb b/base/generated/stellar/hash_id_preimage/contract_id.rb
new file mode 100644
index 00000000..170ee101
--- /dev/null
+++ b/base/generated/stellar/hash_id_preimage/contract_id.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct
+# {
+# Hash networkID;
+# ContractIDPreimage contractIDPreimage;
+# }
+#
+# ===========================================================================
+module Stellar
+ class HashIDPreimage
+ class ContractID < XDR::Struct
+ attribute :network_id, Hash
+ attribute :contract_id_preimage, ContractIDPreimage
+ end
+ end
+end
diff --git a/base/generated/stellar/hash_id_preimage/revoke_id.rb b/base/generated/stellar/hash_id_preimage/revoke_id.rb
index ceef84ba..b8b27a0d 100644
--- a/base/generated/stellar/hash_id_preimage/revoke_id.rb
+++ b/base/generated/stellar/hash_id_preimage/revoke_id.rb
@@ -8,7 +8,7 @@
# struct
# {
# AccountID sourceAccount;
-# SequenceNumber seqNum;
+# SequenceNumber seqNum;
# uint32 opNum;
# PoolID liquidityPoolID;
# Asset asset;
diff --git a/base/generated/stellar/hash_id_preimage/soroban_authorization.rb b/base/generated/stellar/hash_id_preimage/soroban_authorization.rb
new file mode 100644
index 00000000..55a71aa8
--- /dev/null
+++ b/base/generated/stellar/hash_id_preimage/soroban_authorization.rb
@@ -0,0 +1,26 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct
+# {
+# Hash networkID;
+# int64 nonce;
+# uint32 signatureExpirationLedger;
+# SorobanAuthorizedInvocation invocation;
+# }
+#
+# ===========================================================================
+module Stellar
+ class HashIDPreimage
+ class SorobanAuthorization < XDR::Struct
+ attribute :network_id, Hash
+ attribute :nonce, Int64
+ attribute :signature_expiration_ledger, Uint32
+ attribute :invocation, SorobanAuthorizedInvocation
+ end
+ end
+end
diff --git a/base/generated/stellar/host_function.rb b/base/generated/stellar/host_function.rb
new file mode 100644
index 00000000..65b4b1b4
--- /dev/null
+++ b/base/generated/stellar/host_function.rb
@@ -0,0 +1,31 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union HostFunction switch (HostFunctionType type)
+# {
+# case HOST_FUNCTION_TYPE_INVOKE_CONTRACT:
+# InvokeContractArgs invokeContract;
+# case HOST_FUNCTION_TYPE_CREATE_CONTRACT:
+# CreateContractArgs createContract;
+# case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM:
+# opaque wasm<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class HostFunction < XDR::Union
+ switch_on HostFunctionType, :type
+
+ switch :host_function_type_invoke_contract, :invoke_contract
+ switch :host_function_type_create_contract, :create_contract
+ switch :host_function_type_upload_contract_wasm, :wasm
+
+ attribute :invoke_contract, InvokeContractArgs
+ attribute :create_contract, CreateContractArgs
+ attribute :wasm, XDR::VarOpaque[]
+ end
+end
diff --git a/base/generated/stellar/host_function_type.rb b/base/generated/stellar/host_function_type.rb
new file mode 100644
index 00000000..9d828774
--- /dev/null
+++ b/base/generated/stellar/host_function_type.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum HostFunctionType
+# {
+# HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0,
+# HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1,
+# HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2
+# };
+#
+# ===========================================================================
+module Stellar
+ class HostFunctionType < XDR::Enum
+ member :host_function_type_invoke_contract, 0
+ member :host_function_type_create_contract, 1
+ member :host_function_type_upload_contract_wasm, 2
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/inflation_result.rb b/base/generated/stellar/inflation_result.rb
index 803d2d54..3744f151 100644
--- a/base/generated/stellar/inflation_result.rb
+++ b/base/generated/stellar/inflation_result.rb
@@ -9,7 +9,7 @@
# {
# case INFLATION_SUCCESS:
# InflationPayout payouts<>;
-# default:
+# case INFLATION_NOT_TIME:
# void;
# };
#
@@ -19,7 +19,7 @@ class InflationResult < XDR::Union
switch_on InflationResultCode, :code
switch :inflation_success, :payouts
- switch :default
+ switch :inflation_not_time
attribute :payouts, XDR::VarArray[InflationPayout]
end
diff --git a/base/generated/stellar/inner_transaction_result.rb b/base/generated/stellar/inner_transaction_result.rb
index 8fbc1c52..a9ff1a9b 100644
--- a/base/generated/stellar/inner_transaction_result.rb
+++ b/base/generated/stellar/inner_transaction_result.rb
@@ -31,6 +31,7 @@
# case txBAD_SPONSORSHIP:
# case txBAD_MIN_SEQ_AGE_OR_GAP:
# case txMALFORMED:
+# case txSOROBAN_INVALID:
# void;
# }
# result;
diff --git a/base/generated/stellar/inner_transaction_result/result.rb b/base/generated/stellar/inner_transaction_result/result.rb
index 48397ded..df69b436 100644
--- a/base/generated/stellar/inner_transaction_result/result.rb
+++ b/base/generated/stellar/inner_transaction_result/result.rb
@@ -26,6 +26,7 @@
# case txBAD_SPONSORSHIP:
# case txBAD_MIN_SEQ_AGE_OR_GAP:
# case txMALFORMED:
+# case txSOROBAN_INVALID:
# void;
# }
#
@@ -51,6 +52,7 @@ class Result < XDR::Union
switch :tx_bad_sponsorship
switch :tx_bad_min_seq_age_or_gap
switch :tx_malformed
+ switch :tx_soroban_invalid
attribute :results, XDR::VarArray[OperationResult]
end
diff --git a/base/generated/stellar/int128_parts.rb b/base/generated/stellar/int128_parts.rb
new file mode 100644
index 00000000..dad05ff5
--- /dev/null
+++ b/base/generated/stellar/int128_parts.rb
@@ -0,0 +1,19 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct Int128Parts {
+# int64 hi;
+# uint64 lo;
+# };
+#
+# ===========================================================================
+module Stellar
+ class Int128Parts < XDR::Struct
+ attribute :hi, Int64
+ attribute :lo, Uint64
+ end
+end
diff --git a/base/generated/stellar/int256_parts.rb b/base/generated/stellar/int256_parts.rb
new file mode 100644
index 00000000..fe0cfcdc
--- /dev/null
+++ b/base/generated/stellar/int256_parts.rb
@@ -0,0 +1,23 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct Int256Parts {
+# int64 hi_hi;
+# uint64 hi_lo;
+# uint64 lo_hi;
+# uint64 lo_lo;
+# };
+#
+# ===========================================================================
+module Stellar
+ class Int256Parts < XDR::Struct
+ attribute :hi_hi, Int64
+ attribute :hi_lo, Uint64
+ attribute :lo_hi, Uint64
+ attribute :lo_lo, Uint64
+ end
+end
diff --git a/base/generated/stellar/invoke_contract_args.rb b/base/generated/stellar/invoke_contract_args.rb
new file mode 100644
index 00000000..f99d7feb
--- /dev/null
+++ b/base/generated/stellar/invoke_contract_args.rb
@@ -0,0 +1,21 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct InvokeContractArgs {
+# SCAddress contractAddress;
+# SCSymbol functionName;
+# SCVal args<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class InvokeContractArgs < XDR::Struct
+ attribute :contract_address, SCAddress
+ attribute :function_name, SCSymbol
+ attribute :args, XDR::VarArray[SCVal]
+ end
+end
diff --git a/base/generated/stellar/invoke_host_function_op.rb b/base/generated/stellar/invoke_host_function_op.rb
new file mode 100644
index 00000000..8b62b46c
--- /dev/null
+++ b/base/generated/stellar/invoke_host_function_op.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct InvokeHostFunctionOp
+# {
+# // Host function to invoke.
+# HostFunction hostFunction;
+# // Per-address authorizations for this host function.
+# SorobanAuthorizationEntry auth<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class InvokeHostFunctionOp < XDR::Struct
+ attribute :host_function, HostFunction
+ attribute :auth, XDR::VarArray[SorobanAuthorizationEntry]
+ end
+end
diff --git a/base/generated/stellar/invoke_host_function_result.rb b/base/generated/stellar/invoke_host_function_result.rb
new file mode 100644
index 00000000..4152f8e8
--- /dev/null
+++ b/base/generated/stellar/invoke_host_function_result.rb
@@ -0,0 +1,34 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code)
+# {
+# case INVOKE_HOST_FUNCTION_SUCCESS:
+# Hash success; // sha256(InvokeHostFunctionSuccessPreImage)
+# case INVOKE_HOST_FUNCTION_MALFORMED:
+# case INVOKE_HOST_FUNCTION_TRAPPED:
+# case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED:
+# case INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED:
+# case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE:
+# void;
+# };
+#
+# ===========================================================================
+module Stellar
+ class InvokeHostFunctionResult < XDR::Union
+ switch_on InvokeHostFunctionResultCode, :code
+
+ switch :invoke_host_function_success, :success
+ switch :invoke_host_function_malformed
+ switch :invoke_host_function_trapped
+ switch :invoke_host_function_resource_limit_exceeded
+ switch :invoke_host_function_entry_archived
+ switch :invoke_host_function_insufficient_refundable_fee
+
+ attribute :success, Hash
+ end
+end
diff --git a/base/generated/stellar/invoke_host_function_result_code.rb b/base/generated/stellar/invoke_host_function_result_code.rb
new file mode 100644
index 00000000..5701d333
--- /dev/null
+++ b/base/generated/stellar/invoke_host_function_result_code.rb
@@ -0,0 +1,33 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum InvokeHostFunctionResultCode
+# {
+# // codes considered as "success" for the operation
+# INVOKE_HOST_FUNCTION_SUCCESS = 0,
+#
+# // codes considered as "failure" for the operation
+# INVOKE_HOST_FUNCTION_MALFORMED = -1,
+# INVOKE_HOST_FUNCTION_TRAPPED = -2,
+# INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3,
+# INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED = -4,
+# INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5
+# };
+#
+# ===========================================================================
+module Stellar
+ class InvokeHostFunctionResultCode < XDR::Enum
+ member :invoke_host_function_success, 0
+ member :invoke_host_function_malformed, -1
+ member :invoke_host_function_trapped, -2
+ member :invoke_host_function_resource_limit_exceeded, -3
+ member :invoke_host_function_entry_archived, -4
+ member :invoke_host_function_insufficient_refundable_fee, -5
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/invoke_host_function_success_pre_image.rb b/base/generated/stellar/invoke_host_function_success_pre_image.rb
new file mode 100644
index 00000000..d04dbacf
--- /dev/null
+++ b/base/generated/stellar/invoke_host_function_success_pre_image.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct InvokeHostFunctionSuccessPreImage
+# {
+# SCVal returnValue;
+# ContractEvent events<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class InvokeHostFunctionSuccessPreImage < XDR::Struct
+ attribute :return_value, SCVal
+ attribute :events, XDR::VarArray[ContractEvent]
+ end
+end
diff --git a/base/generated/stellar/ledger_close_meta.rb b/base/generated/stellar/ledger_close_meta.rb
index 280bceb8..e7a77ec3 100644
--- a/base/generated/stellar/ledger_close_meta.rb
+++ b/base/generated/stellar/ledger_close_meta.rb
@@ -9,6 +9,8 @@
# {
# case 0:
# LedgerCloseMetaV0 v0;
+# case 1:
+# LedgerCloseMetaV1 v1;
# };
#
# ===========================================================================
@@ -17,7 +19,9 @@ class LedgerCloseMeta < XDR::Union
switch_on XDR::Int, :v
switch 0, :v0
+ switch 1, :v1
attribute :v0, LedgerCloseMetaV0
+ attribute :v1, LedgerCloseMetaV1
end
end
diff --git a/base/generated/stellar/ledger_close_meta_v1.rb b/base/generated/stellar/ledger_close_meta_v1.rb
new file mode 100644
index 00000000..42a4494d
--- /dev/null
+++ b/base/generated/stellar/ledger_close_meta_v1.rb
@@ -0,0 +1,54 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct LedgerCloseMetaV1
+# {
+# // We forgot to add an ExtensionPoint in v0 but at least
+# // we can add one now in v1.
+# ExtensionPoint ext;
+#
+# LedgerHeaderHistoryEntry ledgerHeader;
+#
+# GeneralizedTransactionSet txSet;
+#
+# // NB: transactions are sorted in apply order here
+# // fees for all transactions are processed first
+# // followed by applying transactions
+# TransactionResultMeta txProcessing<>;
+#
+# // upgrades are applied last
+# UpgradeEntryMeta upgradesProcessing<>;
+#
+# // other misc information attached to the ledger close
+# SCPHistoryEntry scpInfo<>;
+#
+# // Size in bytes of BucketList, to support downstream
+# // systems calculating storage fees correctly.
+# uint64 totalByteSizeOfBucketList;
+#
+# // Temp keys that are being evicted at this ledger.
+# LedgerKey evictedTemporaryLedgerKeys<>;
+#
+# // Archived restorable ledger entries that are being
+# // evicted at this ledger.
+# LedgerEntry evictedPersistentLedgerEntries<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class LedgerCloseMetaV1 < XDR::Struct
+ attribute :ext, ExtensionPoint
+ attribute :ledger_header, LedgerHeaderHistoryEntry
+ attribute :tx_set, GeneralizedTransactionSet
+ attribute :tx_processing, XDR::VarArray[TransactionResultMeta]
+ attribute :upgrades_processing, XDR::VarArray[UpgradeEntryMeta]
+ attribute :scp_info, XDR::VarArray[SCPHistoryEntry]
+ attribute :total_byte_size_of_bucket_list, Uint64
+ attribute :evicted_temporary_ledger_keys, XDR::VarArray[LedgerKey]
+ attribute :evicted_persistent_ledger_entries, XDR::VarArray[LedgerEntry]
+ end
+end
diff --git a/base/generated/stellar/ledger_entry.rb b/base/generated/stellar/ledger_entry.rb
index 201a49cc..6e47dd8f 100644
--- a/base/generated/stellar/ledger_entry.rb
+++ b/base/generated/stellar/ledger_entry.rb
@@ -23,6 +23,14 @@
# ClaimableBalanceEntry claimableBalance;
# case LIQUIDITY_POOL:
# LiquidityPoolEntry liquidityPool;
+# case CONTRACT_DATA:
+# ContractDataEntry contractData;
+# case CONTRACT_CODE:
+# ContractCodeEntry contractCode;
+# case CONFIG_SETTING:
+# ConfigSettingEntry configSetting;
+# case TTL:
+# TTLEntry ttl;
# }
# data;
#
diff --git a/base/generated/stellar/ledger_entry/data.rb b/base/generated/stellar/ledger_entry/data.rb
index d5148f34..d6d10f96 100644
--- a/base/generated/stellar/ledger_entry/data.rb
+++ b/base/generated/stellar/ledger_entry/data.rb
@@ -19,6 +19,14 @@
# ClaimableBalanceEntry claimableBalance;
# case LIQUIDITY_POOL:
# LiquidityPoolEntry liquidityPool;
+# case CONTRACT_DATA:
+# ContractDataEntry contractData;
+# case CONTRACT_CODE:
+# ContractCodeEntry contractCode;
+# case CONFIG_SETTING:
+# ConfigSettingEntry configSetting;
+# case TTL:
+# TTLEntry ttl;
# }
#
# ===========================================================================
@@ -33,6 +41,10 @@ class Data < XDR::Union
switch :data, :data
switch :claimable_balance, :claimable_balance
switch :liquidity_pool, :liquidity_pool
+ switch :contract_data, :contract_data
+ switch :contract_code, :contract_code
+ switch :config_setting, :config_setting
+ switch :ttl, :ttl
attribute :account, AccountEntry
attribute :trust_line, TrustLineEntry
@@ -40,6 +52,10 @@ class Data < XDR::Union
attribute :data, DataEntry
attribute :claimable_balance, ClaimableBalanceEntry
attribute :liquidity_pool, LiquidityPoolEntry
+ attribute :contract_data, ContractDataEntry
+ attribute :contract_code, ContractCodeEntry
+ attribute :config_setting, ConfigSettingEntry
+ attribute :ttl, TTLEntry
end
end
end
diff --git a/base/generated/stellar/ledger_entry_type.rb b/base/generated/stellar/ledger_entry_type.rb
index c556ebf2..d2b55835 100644
--- a/base/generated/stellar/ledger_entry_type.rb
+++ b/base/generated/stellar/ledger_entry_type.rb
@@ -12,7 +12,11 @@
# OFFER = 2,
# DATA = 3,
# CLAIMABLE_BALANCE = 4,
-# LIQUIDITY_POOL = 5
+# LIQUIDITY_POOL = 5,
+# CONTRACT_DATA = 6,
+# CONTRACT_CODE = 7,
+# CONFIG_SETTING = 8,
+# TTL = 9
# };
#
# ===========================================================================
@@ -24,6 +28,10 @@ class LedgerEntryType < XDR::Enum
member :data, 3
member :claimable_balance, 4
member :liquidity_pool, 5
+ member :contract_data, 6
+ member :contract_code, 7
+ member :config_setting, 8
+ member :ttl, 9
seal
end
diff --git a/base/generated/stellar/ledger_footprint.rb b/base/generated/stellar/ledger_footprint.rb
new file mode 100644
index 00000000..a611416c
--- /dev/null
+++ b/base/generated/stellar/ledger_footprint.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct LedgerFootprint
+# {
+# LedgerKey readOnly<>;
+# LedgerKey readWrite<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class LedgerFootprint < XDR::Struct
+ attribute :read_only, XDR::VarArray[LedgerKey]
+ attribute :read_write, XDR::VarArray[LedgerKey]
+ end
+end
diff --git a/base/generated/stellar/ledger_key.rb b/base/generated/stellar/ledger_key.rb
index c2c64088..d38b6a85 100644
--- a/base/generated/stellar/ledger_key.rb
+++ b/base/generated/stellar/ledger_key.rb
@@ -45,6 +45,29 @@
# {
# PoolID liquidityPoolID;
# } liquidityPool;
+# case CONTRACT_DATA:
+# struct
+# {
+# SCAddress contract;
+# SCVal key;
+# ContractDataDurability durability;
+# } contractData;
+# case CONTRACT_CODE:
+# struct
+# {
+# Hash hash;
+# } contractCode;
+# case CONFIG_SETTING:
+# struct
+# {
+# ConfigSettingID configSettingID;
+# } configSetting;
+# case TTL:
+# struct
+# {
+# // Hash of the LedgerKey that is associated with this TTLEntry
+# Hash keyHash;
+# } ttl;
# };
#
# ===========================================================================
@@ -58,6 +81,10 @@ class LedgerKey < XDR::Union
autoload :Data
autoload :ClaimableBalance
autoload :LiquidityPool
+ autoload :ContractData
+ autoload :ContractCode
+ autoload :ConfigSetting
+ autoload :Ttl
switch_on LedgerEntryType, :type
@@ -67,6 +94,10 @@ class LedgerKey < XDR::Union
switch :data, :data
switch :claimable_balance, :claimable_balance
switch :liquidity_pool, :liquidity_pool
+ switch :contract_data, :contract_data
+ switch :contract_code, :contract_code
+ switch :config_setting, :config_setting
+ switch :ttl, :ttl
attribute :account, Account
attribute :trust_line, TrustLine
@@ -74,5 +105,9 @@ class LedgerKey < XDR::Union
attribute :data, Data
attribute :claimable_balance, ClaimableBalance
attribute :liquidity_pool, LiquidityPool
+ attribute :contract_data, ContractData
+ attribute :contract_code, ContractCode
+ attribute :config_setting, ConfigSetting
+ attribute :ttl, Ttl
end
end
diff --git a/base/generated/stellar/ledger_key/config_setting.rb b/base/generated/stellar/ledger_key/config_setting.rb
new file mode 100644
index 00000000..3575dc0a
--- /dev/null
+++ b/base/generated/stellar/ledger_key/config_setting.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct
+# {
+# ConfigSettingID configSettingID;
+# }
+#
+# ===========================================================================
+module Stellar
+ class LedgerKey
+ class ConfigSetting < XDR::Struct
+ attribute :config_setting_id, ConfigSettingID
+ end
+ end
+end
diff --git a/base/generated/stellar/ledger_key/contract_code.rb b/base/generated/stellar/ledger_key/contract_code.rb
new file mode 100644
index 00000000..5f3d800c
--- /dev/null
+++ b/base/generated/stellar/ledger_key/contract_code.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct
+# {
+# Hash hash;
+# }
+#
+# ===========================================================================
+module Stellar
+ class LedgerKey
+ class ContractCode < XDR::Struct
+ attribute :hash, Hash
+ end
+ end
+end
diff --git a/base/generated/stellar/ledger_key/contract_data.rb b/base/generated/stellar/ledger_key/contract_data.rb
new file mode 100644
index 00000000..a3d710b3
--- /dev/null
+++ b/base/generated/stellar/ledger_key/contract_data.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct
+# {
+# SCAddress contract;
+# SCVal key;
+# ContractDataDurability durability;
+# }
+#
+# ===========================================================================
+module Stellar
+ class LedgerKey
+ class ContractData < XDR::Struct
+ attribute :contract, SCAddress
+ attribute :key, SCVal
+ attribute :durability, ContractDataDurability
+ end
+ end
+end
diff --git a/base/generated/stellar/ledger_key/ttl.rb b/base/generated/stellar/ledger_key/ttl.rb
new file mode 100644
index 00000000..f97a0b60
--- /dev/null
+++ b/base/generated/stellar/ledger_key/ttl.rb
@@ -0,0 +1,21 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct
+# {
+# // Hash of the LedgerKey that is associated with this TTLEntry
+# Hash keyHash;
+# }
+#
+# ===========================================================================
+module Stellar
+ class LedgerKey
+ class Ttl < XDR::Struct
+ attribute :key_hash, Hash
+ end
+ end
+end
diff --git a/base/generated/stellar/ledger_upgrade.rb b/base/generated/stellar/ledger_upgrade.rb
index e208145c..0b5b5cd1 100644
--- a/base/generated/stellar/ledger_upgrade.rb
+++ b/base/generated/stellar/ledger_upgrade.rb
@@ -17,6 +17,13 @@
# uint32 newBaseReserve; // update baseReserve
# case LEDGER_UPGRADE_FLAGS:
# uint32 newFlags; // update flags
+# case LEDGER_UPGRADE_CONFIG:
+# // Update arbitrary `ConfigSetting` entries identified by the key.
+# ConfigUpgradeSetKey newConfig;
+# case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE:
+# // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without
+# // using `LEDGER_UPGRADE_CONFIG`.
+# uint32 newMaxSorobanTxSetSize;
# };
#
# ===========================================================================
@@ -24,16 +31,20 @@ module Stellar
class LedgerUpgrade < XDR::Union
switch_on LedgerUpgradeType, :type
- switch :ledger_upgrade_version, :new_ledger_version
- switch :ledger_upgrade_base_fee, :new_base_fee
- switch :ledger_upgrade_max_tx_set_size, :new_max_tx_set_size
- switch :ledger_upgrade_base_reserve, :new_base_reserve
- switch :ledger_upgrade_flags, :new_flags
+ switch :ledger_upgrade_version, :new_ledger_version
+ switch :ledger_upgrade_base_fee, :new_base_fee
+ switch :ledger_upgrade_max_tx_set_size, :new_max_tx_set_size
+ switch :ledger_upgrade_base_reserve, :new_base_reserve
+ switch :ledger_upgrade_flags, :new_flags
+ switch :ledger_upgrade_config, :new_config
+ switch :ledger_upgrade_max_soroban_tx_set_size, :new_max_soroban_tx_set_size
- attribute :new_ledger_version, Uint32
- attribute :new_base_fee, Uint32
- attribute :new_max_tx_set_size, Uint32
- attribute :new_base_reserve, Uint32
- attribute :new_flags, Uint32
+ attribute :new_ledger_version, Uint32
+ attribute :new_base_fee, Uint32
+ attribute :new_max_tx_set_size, Uint32
+ attribute :new_base_reserve, Uint32
+ attribute :new_flags, Uint32
+ attribute :new_config, ConfigUpgradeSetKey
+ attribute :new_max_soroban_tx_set_size, Uint32
end
end
diff --git a/base/generated/stellar/ledger_upgrade_type.rb b/base/generated/stellar/ledger_upgrade_type.rb
index fe8f3d50..552aaf37 100644
--- a/base/generated/stellar/ledger_upgrade_type.rb
+++ b/base/generated/stellar/ledger_upgrade_type.rb
@@ -11,17 +11,21 @@
# LEDGER_UPGRADE_BASE_FEE = 2,
# LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3,
# LEDGER_UPGRADE_BASE_RESERVE = 4,
-# LEDGER_UPGRADE_FLAGS = 5
+# LEDGER_UPGRADE_FLAGS = 5,
+# LEDGER_UPGRADE_CONFIG = 6,
+# LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7
# };
#
# ===========================================================================
module Stellar
class LedgerUpgradeType < XDR::Enum
- member :ledger_upgrade_version, 1
- member :ledger_upgrade_base_fee, 2
- member :ledger_upgrade_max_tx_set_size, 3
- member :ledger_upgrade_base_reserve, 4
- member :ledger_upgrade_flags, 5
+ member :ledger_upgrade_version, 1
+ member :ledger_upgrade_base_fee, 2
+ member :ledger_upgrade_max_tx_set_size, 3
+ member :ledger_upgrade_base_reserve, 4
+ member :ledger_upgrade_flags, 5
+ member :ledger_upgrade_config, 6
+ member :ledger_upgrade_max_soroban_tx_set_size, 7
seal
end
diff --git a/base/generated/stellar/liquidity_pool_deposit_result.rb b/base/generated/stellar/liquidity_pool_deposit_result.rb
index 9881994a..df7cc7f2 100644
--- a/base/generated/stellar/liquidity_pool_deposit_result.rb
+++ b/base/generated/stellar/liquidity_pool_deposit_result.rb
@@ -9,7 +9,13 @@
# {
# case LIQUIDITY_POOL_DEPOSIT_SUCCESS:
# void;
-# default:
+# case LIQUIDITY_POOL_DEPOSIT_MALFORMED:
+# case LIQUIDITY_POOL_DEPOSIT_NO_TRUST:
+# case LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED:
+# case LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED:
+# case LIQUIDITY_POOL_DEPOSIT_LINE_FULL:
+# case LIQUIDITY_POOL_DEPOSIT_BAD_PRICE:
+# case LIQUIDITY_POOL_DEPOSIT_POOL_FULL:
# void;
# };
#
@@ -19,7 +25,13 @@ class LiquidityPoolDepositResult < XDR::Union
switch_on LiquidityPoolDepositResultCode, :code
switch :liquidity_pool_deposit_success
- switch :default
+ switch :liquidity_pool_deposit_malformed
+ switch :liquidity_pool_deposit_no_trust
+ switch :liquidity_pool_deposit_not_authorized
+ switch :liquidity_pool_deposit_underfunded
+ switch :liquidity_pool_deposit_line_full
+ switch :liquidity_pool_deposit_bad_price
+ switch :liquidity_pool_deposit_pool_full
end
end
diff --git a/base/generated/stellar/liquidity_pool_withdraw_result.rb b/base/generated/stellar/liquidity_pool_withdraw_result.rb
index 65520cf5..7d2247e2 100644
--- a/base/generated/stellar/liquidity_pool_withdraw_result.rb
+++ b/base/generated/stellar/liquidity_pool_withdraw_result.rb
@@ -9,7 +9,11 @@
# {
# case LIQUIDITY_POOL_WITHDRAW_SUCCESS:
# void;
-# default:
+# case LIQUIDITY_POOL_WITHDRAW_MALFORMED:
+# case LIQUIDITY_POOL_WITHDRAW_NO_TRUST:
+# case LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED:
+# case LIQUIDITY_POOL_WITHDRAW_LINE_FULL:
+# case LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM:
# void;
# };
#
@@ -19,7 +23,11 @@ class LiquidityPoolWithdrawResult < XDR::Union
switch_on LiquidityPoolWithdrawResultCode, :code
switch :liquidity_pool_withdraw_success
- switch :default
+ switch :liquidity_pool_withdraw_malformed
+ switch :liquidity_pool_withdraw_no_trust
+ switch :liquidity_pool_withdraw_underfunded
+ switch :liquidity_pool_withdraw_line_full
+ switch :liquidity_pool_withdraw_under_minimum
end
end
diff --git a/base/generated/stellar/manage_buy_offer_result.rb b/base/generated/stellar/manage_buy_offer_result.rb
index ac480a13..cad5e812 100644
--- a/base/generated/stellar/manage_buy_offer_result.rb
+++ b/base/generated/stellar/manage_buy_offer_result.rb
@@ -9,7 +9,18 @@
# {
# case MANAGE_BUY_OFFER_SUCCESS:
# ManageOfferSuccessResult success;
-# default:
+# case MANAGE_BUY_OFFER_MALFORMED:
+# case MANAGE_BUY_OFFER_SELL_NO_TRUST:
+# case MANAGE_BUY_OFFER_BUY_NO_TRUST:
+# case MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED:
+# case MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED:
+# case MANAGE_BUY_OFFER_LINE_FULL:
+# case MANAGE_BUY_OFFER_UNDERFUNDED:
+# case MANAGE_BUY_OFFER_CROSS_SELF:
+# case MANAGE_BUY_OFFER_SELL_NO_ISSUER:
+# case MANAGE_BUY_OFFER_BUY_NO_ISSUER:
+# case MANAGE_BUY_OFFER_NOT_FOUND:
+# case MANAGE_BUY_OFFER_LOW_RESERVE:
# void;
# };
#
@@ -18,8 +29,19 @@ module Stellar
class ManageBuyOfferResult < XDR::Union
switch_on ManageBuyOfferResultCode, :code
- switch :manage_buy_offer_success, :success
- switch :default
+ switch :manage_buy_offer_success, :success
+ switch :manage_buy_offer_malformed
+ switch :manage_buy_offer_sell_no_trust
+ switch :manage_buy_offer_buy_no_trust
+ switch :manage_buy_offer_sell_not_authorized
+ switch :manage_buy_offer_buy_not_authorized
+ switch :manage_buy_offer_line_full
+ switch :manage_buy_offer_underfunded
+ switch :manage_buy_offer_cross_self
+ switch :manage_buy_offer_sell_no_issuer
+ switch :manage_buy_offer_buy_no_issuer
+ switch :manage_buy_offer_not_found
+ switch :manage_buy_offer_low_reserve
attribute :success, ManageOfferSuccessResult
end
diff --git a/base/generated/stellar/manage_data_result.rb b/base/generated/stellar/manage_data_result.rb
index 904cad9c..8a1843eb 100644
--- a/base/generated/stellar/manage_data_result.rb
+++ b/base/generated/stellar/manage_data_result.rb
@@ -9,7 +9,10 @@
# {
# case MANAGE_DATA_SUCCESS:
# void;
-# default:
+# case MANAGE_DATA_NOT_SUPPORTED_YET:
+# case MANAGE_DATA_NAME_NOT_FOUND:
+# case MANAGE_DATA_LOW_RESERVE:
+# case MANAGE_DATA_INVALID_NAME:
# void;
# };
#
@@ -19,7 +22,10 @@ class ManageDataResult < XDR::Union
switch_on ManageDataResultCode, :code
switch :manage_data_success
- switch :default
+ switch :manage_data_not_supported_yet
+ switch :manage_data_name_not_found
+ switch :manage_data_low_reserve
+ switch :manage_data_invalid_name
end
end
diff --git a/base/generated/stellar/manage_offer_success_result.rb b/base/generated/stellar/manage_offer_success_result.rb
index 0e32d188..debe99c2 100644
--- a/base/generated/stellar/manage_offer_success_result.rb
+++ b/base/generated/stellar/manage_offer_success_result.rb
@@ -15,7 +15,7 @@
# case MANAGE_OFFER_CREATED:
# case MANAGE_OFFER_UPDATED:
# OfferEntry offer;
-# default:
+# case MANAGE_OFFER_DELETED:
# void;
# }
# offer;
diff --git a/base/generated/stellar/manage_offer_success_result/offer.rb b/base/generated/stellar/manage_offer_success_result/offer.rb
index 2cd18457..f981c4da 100644
--- a/base/generated/stellar/manage_offer_success_result/offer.rb
+++ b/base/generated/stellar/manage_offer_success_result/offer.rb
@@ -10,7 +10,7 @@
# case MANAGE_OFFER_CREATED:
# case MANAGE_OFFER_UPDATED:
# OfferEntry offer;
-# default:
+# case MANAGE_OFFER_DELETED:
# void;
# }
#
@@ -22,7 +22,7 @@ class Offer < XDR::Union
switch :manage_offer_created, :offer
switch :manage_offer_updated, :offer
- switch :default
+ switch :manage_offer_deleted
attribute :offer, OfferEntry
end
diff --git a/base/generated/stellar/manage_sell_offer_result.rb b/base/generated/stellar/manage_sell_offer_result.rb
index 65d45a29..ba0454d4 100644
--- a/base/generated/stellar/manage_sell_offer_result.rb
+++ b/base/generated/stellar/manage_sell_offer_result.rb
@@ -9,7 +9,18 @@
# {
# case MANAGE_SELL_OFFER_SUCCESS:
# ManageOfferSuccessResult success;
-# default:
+# case MANAGE_SELL_OFFER_MALFORMED:
+# case MANAGE_SELL_OFFER_SELL_NO_TRUST:
+# case MANAGE_SELL_OFFER_BUY_NO_TRUST:
+# case MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED:
+# case MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED:
+# case MANAGE_SELL_OFFER_LINE_FULL:
+# case MANAGE_SELL_OFFER_UNDERFUNDED:
+# case MANAGE_SELL_OFFER_CROSS_SELF:
+# case MANAGE_SELL_OFFER_SELL_NO_ISSUER:
+# case MANAGE_SELL_OFFER_BUY_NO_ISSUER:
+# case MANAGE_SELL_OFFER_NOT_FOUND:
+# case MANAGE_SELL_OFFER_LOW_RESERVE:
# void;
# };
#
@@ -18,8 +29,19 @@ module Stellar
class ManageSellOfferResult < XDR::Union
switch_on ManageSellOfferResultCode, :code
- switch :manage_sell_offer_success, :success
- switch :default
+ switch :manage_sell_offer_success, :success
+ switch :manage_sell_offer_malformed
+ switch :manage_sell_offer_sell_no_trust
+ switch :manage_sell_offer_buy_no_trust
+ switch :manage_sell_offer_sell_not_authorized
+ switch :manage_sell_offer_buy_not_authorized
+ switch :manage_sell_offer_line_full
+ switch :manage_sell_offer_underfunded
+ switch :manage_sell_offer_cross_self
+ switch :manage_sell_offer_sell_no_issuer
+ switch :manage_sell_offer_buy_no_issuer
+ switch :manage_sell_offer_not_found
+ switch :manage_sell_offer_low_reserve
attribute :success, ManageOfferSuccessResult
end
diff --git a/base/generated/stellar/message_type.rb b/base/generated/stellar/message_type.rb
index 448dd15d..9cc6d7fc 100644
--- a/base/generated/stellar/message_type.rb
+++ b/base/generated/stellar/message_type.rb
@@ -16,6 +16,7 @@
#
# GET_TX_SET = 6, // gets a particular txset by hash
# TX_SET = 7,
+# GENERALIZED_TX_SET = 17,
#
# TRANSACTION = 8, // pass on a tx you have heard about
#
@@ -31,28 +32,36 @@
# SURVEY_REQUEST = 14,
# SURVEY_RESPONSE = 15,
#
-# SEND_MORE = 16
+# SEND_MORE = 16,
+# SEND_MORE_EXTENDED = 20,
+#
+# FLOOD_ADVERT = 18,
+# FLOOD_DEMAND = 19
# };
#
# ===========================================================================
module Stellar
class MessageType < XDR::Enum
- member :error_msg, 0
- member :auth, 2
- member :dont_have, 3
- member :get_peers, 4
- member :peers, 5
- member :get_tx_set, 6
- member :tx_set, 7
- member :transaction, 8
- member :get_scp_quorumset, 9
- member :scp_quorumset, 10
- member :scp_message, 11
- member :get_scp_state, 12
- member :hello, 13
- member :survey_request, 14
- member :survey_response, 15
- member :send_more, 16
+ member :error_msg, 0
+ member :auth, 2
+ member :dont_have, 3
+ member :get_peers, 4
+ member :peers, 5
+ member :get_tx_set, 6
+ member :tx_set, 7
+ member :generalized_tx_set, 17
+ member :transaction, 8
+ member :get_scp_quorumset, 9
+ member :scp_quorumset, 10
+ member :scp_message, 11
+ member :get_scp_state, 12
+ member :hello, 13
+ member :survey_request, 14
+ member :survey_response, 15
+ member :send_more, 16
+ member :send_more_extended, 20
+ member :flood_advert, 18
+ member :flood_demand, 19
seal
end
diff --git a/base/generated/stellar/operation.rb b/base/generated/stellar/operation.rb
index ab557196..16755110 100644
--- a/base/generated/stellar/operation.rb
+++ b/base/generated/stellar/operation.rb
@@ -62,6 +62,12 @@
# LiquidityPoolDepositOp liquidityPoolDepositOp;
# case LIQUIDITY_POOL_WITHDRAW:
# LiquidityPoolWithdrawOp liquidityPoolWithdrawOp;
+# case INVOKE_HOST_FUNCTION:
+# InvokeHostFunctionOp invokeHostFunctionOp;
+# case EXTEND_FOOTPRINT_TTL:
+# ExtendFootprintTTLOp extendFootprintTTLOp;
+# case RESTORE_FOOTPRINT:
+# RestoreFootprintOp restoreFootprintOp;
# }
# body;
# };
diff --git a/base/generated/stellar/operation/body.rb b/base/generated/stellar/operation/body.rb
index 8cafe88e..1f3d6ce4 100644
--- a/base/generated/stellar/operation/body.rb
+++ b/base/generated/stellar/operation/body.rb
@@ -55,6 +55,12 @@
# LiquidityPoolDepositOp liquidityPoolDepositOp;
# case LIQUIDITY_POOL_WITHDRAW:
# LiquidityPoolWithdrawOp liquidityPoolWithdrawOp;
+# case INVOKE_HOST_FUNCTION:
+# InvokeHostFunctionOp invokeHostFunctionOp;
+# case EXTEND_FOOTPRINT_TTL:
+# ExtendFootprintTTLOp extendFootprintTTLOp;
+# case RESTORE_FOOTPRINT:
+# RestoreFootprintOp restoreFootprintOp;
# }
#
# ===========================================================================
@@ -87,6 +93,9 @@ class Body < XDR::Union
switch :set_trust_line_flags, :set_trust_line_flags_op
switch :liquidity_pool_deposit, :liquidity_pool_deposit_op
switch :liquidity_pool_withdraw, :liquidity_pool_withdraw_op
+ switch :invoke_host_function, :invoke_host_function_op
+ switch :extend_footprint_ttl, :extend_footprint_ttl_op
+ switch :restore_footprint, :restore_footprint_op
attribute :create_account_op, CreateAccountOp
attribute :payment_op, PaymentOp
@@ -110,6 +119,9 @@ class Body < XDR::Union
attribute :set_trust_line_flags_op, SetTrustLineFlagsOp
attribute :liquidity_pool_deposit_op, LiquidityPoolDepositOp
attribute :liquidity_pool_withdraw_op, LiquidityPoolWithdrawOp
+ attribute :invoke_host_function_op, InvokeHostFunctionOp
+ attribute :extend_footprint_ttl_op, ExtendFootprintTTLOp
+ attribute :restore_footprint_op, RestoreFootprintOp
end
end
end
diff --git a/base/generated/stellar/operation_result.rb b/base/generated/stellar/operation_result.rb
index b1f755d8..f0ad096a 100644
--- a/base/generated/stellar/operation_result.rb
+++ b/base/generated/stellar/operation_result.rb
@@ -58,9 +58,20 @@
# LiquidityPoolDepositResult liquidityPoolDepositResult;
# case LIQUIDITY_POOL_WITHDRAW:
# LiquidityPoolWithdrawResult liquidityPoolWithdrawResult;
+# case INVOKE_HOST_FUNCTION:
+# InvokeHostFunctionResult invokeHostFunctionResult;
+# case EXTEND_FOOTPRINT_TTL:
+# ExtendFootprintTTLResult extendFootprintTTLResult;
+# case RESTORE_FOOTPRINT:
+# RestoreFootprintResult restoreFootprintResult;
# }
# tr;
-# default:
+# case opBAD_AUTH:
+# case opNO_ACCOUNT:
+# case opNOT_SUPPORTED:
+# case opTOO_MANY_SUBENTRIES:
+# case opEXCEEDED_WORK_LIMIT:
+# case opTOO_MANY_SPONSORING:
# void;
# };
#
@@ -73,8 +84,13 @@ class OperationResult < XDR::Union
switch_on OperationResultCode, :code
- switch :op_inner, :tr
- switch :default
+ switch :op_inner, :tr
+ switch :op_bad_auth
+ switch :op_no_account
+ switch :op_not_supported
+ switch :op_too_many_subentries
+ switch :op_exceeded_work_limit
+ switch :op_too_many_sponsoring
attribute :tr, Tr
end
diff --git a/base/generated/stellar/operation_result/tr.rb b/base/generated/stellar/operation_result/tr.rb
index 024a90eb..0a549252 100644
--- a/base/generated/stellar/operation_result/tr.rb
+++ b/base/generated/stellar/operation_result/tr.rb
@@ -55,6 +55,12 @@
# LiquidityPoolDepositResult liquidityPoolDepositResult;
# case LIQUIDITY_POOL_WITHDRAW:
# LiquidityPoolWithdrawResult liquidityPoolWithdrawResult;
+# case INVOKE_HOST_FUNCTION:
+# InvokeHostFunctionResult invokeHostFunctionResult;
+# case EXTEND_FOOTPRINT_TTL:
+# ExtendFootprintTTLResult extendFootprintTTLResult;
+# case RESTORE_FOOTPRINT:
+# RestoreFootprintResult restoreFootprintResult;
# }
#
# ===========================================================================
@@ -87,6 +93,9 @@ class Tr < XDR::Union
switch :set_trust_line_flags, :set_trust_line_flags_result
switch :liquidity_pool_deposit, :liquidity_pool_deposit_result
switch :liquidity_pool_withdraw, :liquidity_pool_withdraw_result
+ switch :invoke_host_function, :invoke_host_function_result
+ switch :extend_footprint_ttl, :extend_footprint_ttl_result
+ switch :restore_footprint, :restore_footprint_result
attribute :create_account_result, CreateAccountResult
attribute :payment_result, PaymentResult
@@ -112,6 +121,9 @@ class Tr < XDR::Union
attribute :set_trust_line_flags_result, SetTrustLineFlagsResult
attribute :liquidity_pool_deposit_result, LiquidityPoolDepositResult
attribute :liquidity_pool_withdraw_result, LiquidityPoolWithdrawResult
+ attribute :invoke_host_function_result, InvokeHostFunctionResult
+ attribute :extend_footprint_ttl_result, ExtendFootprintTTLResult
+ attribute :restore_footprint_result, RestoreFootprintResult
end
end
end
diff --git a/base/generated/stellar/operation_type.rb b/base/generated/stellar/operation_type.rb
index 720690d0..e1da3940 100644
--- a/base/generated/stellar/operation_type.rb
+++ b/base/generated/stellar/operation_type.rb
@@ -30,7 +30,10 @@
# CLAWBACK_CLAIMABLE_BALANCE = 20,
# SET_TRUST_LINE_FLAGS = 21,
# LIQUIDITY_POOL_DEPOSIT = 22,
-# LIQUIDITY_POOL_WITHDRAW = 23
+# LIQUIDITY_POOL_WITHDRAW = 23,
+# INVOKE_HOST_FUNCTION = 24,
+# EXTEND_FOOTPRINT_TTL = 25,
+# RESTORE_FOOTPRINT = 26
# };
#
# ===========================================================================
@@ -60,6 +63,9 @@ class OperationType < XDR::Enum
member :set_trust_line_flags, 21
member :liquidity_pool_deposit, 22
member :liquidity_pool_withdraw, 23
+ member :invoke_host_function, 24
+ member :extend_footprint_ttl, 25
+ member :restore_footprint, 26
seal
end
diff --git a/base/generated/stellar/path_payment_strict_receive_result.rb b/base/generated/stellar/path_payment_strict_receive_result.rb
index 0002c023..c032dde5 100644
--- a/base/generated/stellar/path_payment_strict_receive_result.rb
+++ b/base/generated/stellar/path_payment_strict_receive_result.rb
@@ -14,9 +14,20 @@
# ClaimAtom offers<>;
# SimplePaymentResult last;
# } success;
+# case PATH_PAYMENT_STRICT_RECEIVE_MALFORMED:
+# case PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED:
+# case PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST:
+# case PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED:
+# case PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION:
+# case PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST:
+# case PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED:
+# case PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL:
+# void;
# case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER:
# Asset noIssuer; // the asset that caused the error
-# default:
+# case PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS:
+# case PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF:
+# case PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX:
# void;
# };
#
@@ -29,9 +40,19 @@ class PathPaymentStrictReceiveResult < XDR::Union
switch_on PathPaymentStrictReceiveResultCode, :code
- switch :path_payment_strict_receive_success, :success
- switch :path_payment_strict_receive_no_issuer, :no_issuer
- switch :default
+ switch :path_payment_strict_receive_success, :success
+ switch :path_payment_strict_receive_malformed
+ switch :path_payment_strict_receive_underfunded
+ switch :path_payment_strict_receive_src_no_trust
+ switch :path_payment_strict_receive_src_not_authorized
+ switch :path_payment_strict_receive_no_destination
+ switch :path_payment_strict_receive_no_trust
+ switch :path_payment_strict_receive_not_authorized
+ switch :path_payment_strict_receive_line_full
+ switch :path_payment_strict_receive_no_issuer, :no_issuer
+ switch :path_payment_strict_receive_too_few_offers
+ switch :path_payment_strict_receive_offer_cross_self
+ switch :path_payment_strict_receive_over_sendmax
attribute :success, Success
attribute :no_issuer, Asset
diff --git a/base/generated/stellar/path_payment_strict_send_result.rb b/base/generated/stellar/path_payment_strict_send_result.rb
index 50caae7c..983292d9 100644
--- a/base/generated/stellar/path_payment_strict_send_result.rb
+++ b/base/generated/stellar/path_payment_strict_send_result.rb
@@ -13,9 +13,20 @@
# ClaimAtom offers<>;
# SimplePaymentResult last;
# } success;
+# case PATH_PAYMENT_STRICT_SEND_MALFORMED:
+# case PATH_PAYMENT_STRICT_SEND_UNDERFUNDED:
+# case PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST:
+# case PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED:
+# case PATH_PAYMENT_STRICT_SEND_NO_DESTINATION:
+# case PATH_PAYMENT_STRICT_SEND_NO_TRUST:
+# case PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED:
+# case PATH_PAYMENT_STRICT_SEND_LINE_FULL:
+# void;
# case PATH_PAYMENT_STRICT_SEND_NO_ISSUER:
# Asset noIssuer; // the asset that caused the error
-# default:
+# case PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS:
+# case PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF:
+# case PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN:
# void;
# };
#
@@ -28,9 +39,19 @@ class PathPaymentStrictSendResult < XDR::Union
switch_on PathPaymentStrictSendResultCode, :code
- switch :path_payment_strict_send_success, :success
- switch :path_payment_strict_send_no_issuer, :no_issuer
- switch :default
+ switch :path_payment_strict_send_success, :success
+ switch :path_payment_strict_send_malformed
+ switch :path_payment_strict_send_underfunded
+ switch :path_payment_strict_send_src_no_trust
+ switch :path_payment_strict_send_src_not_authorized
+ switch :path_payment_strict_send_no_destination
+ switch :path_payment_strict_send_no_trust
+ switch :path_payment_strict_send_not_authorized
+ switch :path_payment_strict_send_line_full
+ switch :path_payment_strict_send_no_issuer, :no_issuer
+ switch :path_payment_strict_send_too_few_offers
+ switch :path_payment_strict_send_offer_cross_self
+ switch :path_payment_strict_send_under_destmin
attribute :success, Success
attribute :no_issuer, Asset
diff --git a/base/generated/stellar/payment_result.rb b/base/generated/stellar/payment_result.rb
index 52f71f8c..a7b2b19a 100644
--- a/base/generated/stellar/payment_result.rb
+++ b/base/generated/stellar/payment_result.rb
@@ -9,7 +9,15 @@
# {
# case PAYMENT_SUCCESS:
# void;
-# default:
+# case PAYMENT_MALFORMED:
+# case PAYMENT_UNDERFUNDED:
+# case PAYMENT_SRC_NO_TRUST:
+# case PAYMENT_SRC_NOT_AUTHORIZED:
+# case PAYMENT_NO_DESTINATION:
+# case PAYMENT_NO_TRUST:
+# case PAYMENT_NOT_AUTHORIZED:
+# case PAYMENT_LINE_FULL:
+# case PAYMENT_NO_ISSUER:
# void;
# };
#
@@ -19,7 +27,15 @@ class PaymentResult < XDR::Union
switch_on PaymentResultCode, :code
switch :payment_success
- switch :default
+ switch :payment_malformed
+ switch :payment_underfunded
+ switch :payment_src_no_trust
+ switch :payment_src_not_authorized
+ switch :payment_no_destination
+ switch :payment_no_trust
+ switch :payment_not_authorized
+ switch :payment_line_full
+ switch :payment_no_issuer
end
end
diff --git a/base/generated/stellar/persisted_scp_state.rb b/base/generated/stellar/persisted_scp_state.rb
new file mode 100644
index 00000000..d07745f3
--- /dev/null
+++ b/base/generated/stellar/persisted_scp_state.rb
@@ -0,0 +1,27 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union PersistedSCPState switch (int v)
+# {
+# case 0:
+# PersistedSCPStateV0 v0;
+# case 1:
+# PersistedSCPStateV1 v1;
+# };
+#
+# ===========================================================================
+module Stellar
+ class PersistedSCPState < XDR::Union
+ switch_on XDR::Int, :v
+
+ switch 0, :v0
+ switch 1, :v1
+
+ attribute :v0, PersistedSCPStateV0
+ attribute :v1, PersistedSCPStateV1
+ end
+end
diff --git a/base/generated/stellar/persisted_scp_state_v0.rb b/base/generated/stellar/persisted_scp_state_v0.rb
new file mode 100644
index 00000000..28cceb79
--- /dev/null
+++ b/base/generated/stellar/persisted_scp_state_v0.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct PersistedSCPStateV0
+# {
+# SCPEnvelope scpEnvelopes<>;
+# SCPQuorumSet quorumSets<>;
+# StoredTransactionSet txSets<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class PersistedSCPStateV0 < XDR::Struct
+ attribute :scp_envelopes, XDR::VarArray[SCPEnvelope]
+ attribute :quorum_sets, XDR::VarArray[SCPQuorumSet]
+ attribute :tx_sets, XDR::VarArray[StoredTransactionSet]
+ end
+end
diff --git a/base/generated/stellar/persisted_scp_state_v1.rb b/base/generated/stellar/persisted_scp_state_v1.rb
new file mode 100644
index 00000000..689000b9
--- /dev/null
+++ b/base/generated/stellar/persisted_scp_state_v1.rb
@@ -0,0 +1,21 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct PersistedSCPStateV1
+# {
+# // Tx sets are saved separately
+# SCPEnvelope scpEnvelopes<>;
+# SCPQuorumSet quorumSets<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class PersistedSCPStateV1 < XDR::Struct
+ attribute :scp_envelopes, XDR::VarArray[SCPEnvelope]
+ attribute :quorum_sets, XDR::VarArray[SCPQuorumSet]
+ end
+end
diff --git a/base/generated/stellar/restore_footprint_op.rb b/base/generated/stellar/restore_footprint_op.rb
new file mode 100644
index 00000000..35fd4bd7
--- /dev/null
+++ b/base/generated/stellar/restore_footprint_op.rb
@@ -0,0 +1,18 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct RestoreFootprintOp
+# {
+# ExtensionPoint ext;
+# };
+#
+# ===========================================================================
+module Stellar
+ class RestoreFootprintOp < XDR::Struct
+ attribute :ext, ExtensionPoint
+ end
+end
diff --git a/base/generated/stellar/restore_footprint_result.rb b/base/generated/stellar/restore_footprint_result.rb
new file mode 100644
index 00000000..3636fd3e
--- /dev/null
+++ b/base/generated/stellar/restore_footprint_result.rb
@@ -0,0 +1,29 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union RestoreFootprintResult switch (RestoreFootprintResultCode code)
+# {
+# case RESTORE_FOOTPRINT_SUCCESS:
+# void;
+# case RESTORE_FOOTPRINT_MALFORMED:
+# case RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED:
+# case RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE:
+# void;
+# };
+#
+# ===========================================================================
+module Stellar
+ class RestoreFootprintResult < XDR::Union
+ switch_on RestoreFootprintResultCode, :code
+
+ switch :restore_footprint_success
+ switch :restore_footprint_malformed
+ switch :restore_footprint_resource_limit_exceeded
+ switch :restore_footprint_insufficient_refundable_fee
+
+ end
+end
diff --git a/base/generated/stellar/restore_footprint_result_code.rb b/base/generated/stellar/restore_footprint_result_code.rb
new file mode 100644
index 00000000..178c026e
--- /dev/null
+++ b/base/generated/stellar/restore_footprint_result_code.rb
@@ -0,0 +1,29 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum RestoreFootprintResultCode
+# {
+# // codes considered as "success" for the operation
+# RESTORE_FOOTPRINT_SUCCESS = 0,
+#
+# // codes considered as "failure" for the operation
+# RESTORE_FOOTPRINT_MALFORMED = -1,
+# RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED = -2,
+# RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3
+# };
+#
+# ===========================================================================
+module Stellar
+ class RestoreFootprintResultCode < XDR::Enum
+ member :restore_footprint_success, 0
+ member :restore_footprint_malformed, -1
+ member :restore_footprint_resource_limit_exceeded, -2
+ member :restore_footprint_insufficient_refundable_fee, -3
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/revoke_sponsorship_result.rb b/base/generated/stellar/revoke_sponsorship_result.rb
index 8a705239..7147ce3e 100644
--- a/base/generated/stellar/revoke_sponsorship_result.rb
+++ b/base/generated/stellar/revoke_sponsorship_result.rb
@@ -9,7 +9,11 @@
# {
# case REVOKE_SPONSORSHIP_SUCCESS:
# void;
-# default:
+# case REVOKE_SPONSORSHIP_DOES_NOT_EXIST:
+# case REVOKE_SPONSORSHIP_NOT_SPONSOR:
+# case REVOKE_SPONSORSHIP_LOW_RESERVE:
+# case REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE:
+# case REVOKE_SPONSORSHIP_MALFORMED:
# void;
# };
#
@@ -19,7 +23,11 @@ class RevokeSponsorshipResult < XDR::Union
switch_on RevokeSponsorshipResultCode, :code
switch :revoke_sponsorship_success
- switch :default
+ switch :revoke_sponsorship_does_not_exist
+ switch :revoke_sponsorship_not_sponsor
+ switch :revoke_sponsorship_low_reserve
+ switch :revoke_sponsorship_only_transferable
+ switch :revoke_sponsorship_malformed
end
end
diff --git a/base/generated/stellar/sc_address.rb b/base/generated/stellar/sc_address.rb
new file mode 100644
index 00000000..57d61679
--- /dev/null
+++ b/base/generated/stellar/sc_address.rb
@@ -0,0 +1,27 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SCAddress switch (SCAddressType type)
+# {
+# case SC_ADDRESS_TYPE_ACCOUNT:
+# AccountID accountId;
+# case SC_ADDRESS_TYPE_CONTRACT:
+# Hash contractId;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCAddress < XDR::Union
+ switch_on SCAddressType, :type
+
+ switch :sc_address_type_account, :account_id
+ switch :sc_address_type_contract, :contract_id
+
+ attribute :account_id, AccountID
+ attribute :contract_id, Hash
+ end
+end
diff --git a/base/generated/stellar/sc_address_type.rb b/base/generated/stellar/sc_address_type.rb
new file mode 100644
index 00000000..0eb68b60
--- /dev/null
+++ b/base/generated/stellar/sc_address_type.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SCAddressType
+# {
+# SC_ADDRESS_TYPE_ACCOUNT = 0,
+# SC_ADDRESS_TYPE_CONTRACT = 1
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCAddressType < XDR::Enum
+ member :sc_address_type_account, 0
+ member :sc_address_type_contract, 1
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/sc_contract_instance.rb b/base/generated/stellar/sc_contract_instance.rb
new file mode 100644
index 00000000..e87fbce7
--- /dev/null
+++ b/base/generated/stellar/sc_contract_instance.rb
@@ -0,0 +1,19 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCContractInstance {
+# ContractExecutable executable;
+# SCMap* storage;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCContractInstance < XDR::Struct
+ attribute :executable, ContractExecutable
+ attribute :storage, XDR::Option[SCMap]
+ end
+end
diff --git a/base/generated/stellar/sc_env_meta_entry.rb b/base/generated/stellar/sc_env_meta_entry.rb
new file mode 100644
index 00000000..3da105e8
--- /dev/null
+++ b/base/generated/stellar/sc_env_meta_entry.rb
@@ -0,0 +1,23 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SCEnvMetaEntry switch (SCEnvMetaKind kind)
+# {
+# case SC_ENV_META_KIND_INTERFACE_VERSION:
+# uint64 interfaceVersion;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCEnvMetaEntry < XDR::Union
+ switch_on SCEnvMetaKind, :kind
+
+ switch :sc_env_meta_kind_interface_version, :interface_version
+
+ attribute :interface_version, Uint64
+ end
+end
diff --git a/base/generated/stellar/sc_env_meta_kind.rb b/base/generated/stellar/sc_env_meta_kind.rb
new file mode 100644
index 00000000..c40761a6
--- /dev/null
+++ b/base/generated/stellar/sc_env_meta_kind.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SCEnvMetaKind
+# {
+# SC_ENV_META_KIND_INTERFACE_VERSION = 0
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCEnvMetaKind < XDR::Enum
+ member :sc_env_meta_kind_interface_version, 0
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/sc_error.rb b/base/generated/stellar/sc_error.rb
new file mode 100644
index 00000000..73b9463f
--- /dev/null
+++ b/base/generated/stellar/sc_error.rb
@@ -0,0 +1,43 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SCError switch (SCErrorType type)
+# {
+# case SCE_CONTRACT:
+# uint32 contractCode;
+# case SCE_WASM_VM:
+# case SCE_CONTEXT:
+# case SCE_STORAGE:
+# case SCE_OBJECT:
+# case SCE_CRYPTO:
+# case SCE_EVENTS:
+# case SCE_BUDGET:
+# case SCE_VALUE:
+# case SCE_AUTH:
+# SCErrorCode code;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCError < XDR::Union
+ switch_on SCErrorType, :type
+
+ switch :sce_contract, :contract_code
+ switch :sce_wasm_vm, :code
+ switch :sce_context, :code
+ switch :sce_storage, :code
+ switch :sce_object, :code
+ switch :sce_crypto, :code
+ switch :sce_events, :code
+ switch :sce_budget, :code
+ switch :sce_value, :code
+ switch :sce_auth, :code
+
+ attribute :contract_code, Uint32
+ attribute :code, SCErrorCode
+ end
+end
diff --git a/base/generated/stellar/sc_error_code.rb b/base/generated/stellar/sc_error_code.rb
new file mode 100644
index 00000000..b4df955c
--- /dev/null
+++ b/base/generated/stellar/sc_error_code.rb
@@ -0,0 +1,38 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SCErrorCode
+# {
+# SCEC_ARITH_DOMAIN = 0, // Some arithmetic was undefined (overflow, divide-by-zero).
+# SCEC_INDEX_BOUNDS = 1, // Something was indexed beyond its bounds.
+# SCEC_INVALID_INPUT = 2, // User provided some otherwise-bad data.
+# SCEC_MISSING_VALUE = 3, // Some value was required but not provided.
+# SCEC_EXISTING_VALUE = 4, // Some value was provided where not allowed.
+# SCEC_EXCEEDED_LIMIT = 5, // Some arbitrary limit -- gas or otherwise -- was hit.
+# SCEC_INVALID_ACTION = 6, // Data was valid but action requested was not.
+# SCEC_INTERNAL_ERROR = 7, // The host detected an error in its own logic.
+# SCEC_UNEXPECTED_TYPE = 8, // Some type wasn't as expected.
+# SCEC_UNEXPECTED_SIZE = 9 // Something's size wasn't as expected.
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCErrorCode < XDR::Enum
+ member :scec_arith_domain, 0
+ member :scec_index_bounds, 1
+ member :scec_invalid_input, 2
+ member :scec_missing_value, 3
+ member :scec_existing_value, 4
+ member :scec_exceeded_limit, 5
+ member :scec_invalid_action, 6
+ member :scec_internal_error, 7
+ member :scec_unexpected_type, 8
+ member :scec_unexpected_size, 9
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/sc_error_type.rb b/base/generated/stellar/sc_error_type.rb
new file mode 100644
index 00000000..ef453e0d
--- /dev/null
+++ b/base/generated/stellar/sc_error_type.rb
@@ -0,0 +1,38 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SCErrorType
+# {
+# SCE_CONTRACT = 0, // Contract-specific, user-defined codes.
+# SCE_WASM_VM = 1, // Errors while interpreting WASM bytecode.
+# SCE_CONTEXT = 2, // Errors in the contract's host context.
+# SCE_STORAGE = 3, // Errors accessing host storage.
+# SCE_OBJECT = 4, // Errors working with host objects.
+# SCE_CRYPTO = 5, // Errors in cryptographic operations.
+# SCE_EVENTS = 6, // Errors while emitting events.
+# SCE_BUDGET = 7, // Errors relating to budget limits.
+# SCE_VALUE = 8, // Errors working with host values or SCVals.
+# SCE_AUTH = 9 // Errors from the authentication subsystem.
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCErrorType < XDR::Enum
+ member :sce_contract, 0
+ member :sce_wasm_vm, 1
+ member :sce_context, 2
+ member :sce_storage, 3
+ member :sce_object, 4
+ member :sce_crypto, 5
+ member :sce_events, 6
+ member :sce_budget, 7
+ member :sce_value, 8
+ member :sce_auth, 9
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/sc_map_entry.rb b/base/generated/stellar/sc_map_entry.rb
new file mode 100644
index 00000000..7c514c88
--- /dev/null
+++ b/base/generated/stellar/sc_map_entry.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCMapEntry
+# {
+# SCVal key;
+# SCVal val;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCMapEntry < XDR::Struct
+ attribute :key, SCVal
+ attribute :val, SCVal
+ end
+end
diff --git a/base/generated/stellar/sc_meta_entry.rb b/base/generated/stellar/sc_meta_entry.rb
new file mode 100644
index 00000000..ce3fd411
--- /dev/null
+++ b/base/generated/stellar/sc_meta_entry.rb
@@ -0,0 +1,23 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SCMetaEntry switch (SCMetaKind kind)
+# {
+# case SC_META_V0:
+# SCMetaV0 v0;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCMetaEntry < XDR::Union
+ switch_on SCMetaKind, :kind
+
+ switch :sc_meta_v0, :v0
+
+ attribute :v0, SCMetaV0
+ end
+end
diff --git a/base/generated/stellar/sc_meta_kind.rb b/base/generated/stellar/sc_meta_kind.rb
new file mode 100644
index 00000000..7ca44217
--- /dev/null
+++ b/base/generated/stellar/sc_meta_kind.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SCMetaKind
+# {
+# SC_META_V0 = 0
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCMetaKind < XDR::Enum
+ member :sc_meta_v0, 0
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/sc_meta_v0.rb b/base/generated/stellar/sc_meta_v0.rb
new file mode 100644
index 00000000..6f03fbc2
--- /dev/null
+++ b/base/generated/stellar/sc_meta_v0.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCMetaV0
+# {
+# string key<>;
+# string val<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCMetaV0 < XDR::Struct
+ attribute :key, XDR::String[]
+ attribute :val, XDR::String[]
+ end
+end
diff --git a/base/generated/stellar/sc_nonce_key.rb b/base/generated/stellar/sc_nonce_key.rb
new file mode 100644
index 00000000..ea67f722
--- /dev/null
+++ b/base/generated/stellar/sc_nonce_key.rb
@@ -0,0 +1,17 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCNonceKey {
+# int64 nonce;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCNonceKey < XDR::Struct
+ attribute :nonce, Int64
+ end
+end
diff --git a/base/generated/stellar/sc_spec_entry.rb b/base/generated/stellar/sc_spec_entry.rb
new file mode 100644
index 00000000..bf366331
--- /dev/null
+++ b/base/generated/stellar/sc_spec_entry.rb
@@ -0,0 +1,39 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SCSpecEntry switch (SCSpecEntryKind kind)
+# {
+# case SC_SPEC_ENTRY_FUNCTION_V0:
+# SCSpecFunctionV0 functionV0;
+# case SC_SPEC_ENTRY_UDT_STRUCT_V0:
+# SCSpecUDTStructV0 udtStructV0;
+# case SC_SPEC_ENTRY_UDT_UNION_V0:
+# SCSpecUDTUnionV0 udtUnionV0;
+# case SC_SPEC_ENTRY_UDT_ENUM_V0:
+# SCSpecUDTEnumV0 udtEnumV0;
+# case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0:
+# SCSpecUDTErrorEnumV0 udtErrorEnumV0;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecEntry < XDR::Union
+ switch_on SCSpecEntryKind, :kind
+
+ switch :sc_spec_entry_function_v0, :function_v0
+ switch :sc_spec_entry_udt_struct_v0, :udt_struct_v0
+ switch :sc_spec_entry_udt_union_v0, :udt_union_v0
+ switch :sc_spec_entry_udt_enum_v0, :udt_enum_v0
+ switch :sc_spec_entry_udt_error_enum_v0, :udt_error_enum_v0
+
+ attribute :function_v0, SCSpecFunctionV0
+ attribute :udt_struct_v0, SCSpecUDTStructV0
+ attribute :udt_union_v0, SCSpecUDTUnionV0
+ attribute :udt_enum_v0, SCSpecUDTEnumV0
+ attribute :udt_error_enum_v0, SCSpecUDTErrorEnumV0
+ end
+end
diff --git a/base/generated/stellar/sc_spec_entry_kind.rb b/base/generated/stellar/sc_spec_entry_kind.rb
new file mode 100644
index 00000000..1e7e1166
--- /dev/null
+++ b/base/generated/stellar/sc_spec_entry_kind.rb
@@ -0,0 +1,28 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SCSpecEntryKind
+# {
+# SC_SPEC_ENTRY_FUNCTION_V0 = 0,
+# SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1,
+# SC_SPEC_ENTRY_UDT_UNION_V0 = 2,
+# SC_SPEC_ENTRY_UDT_ENUM_V0 = 3,
+# SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecEntryKind < XDR::Enum
+ member :sc_spec_entry_function_v0, 0
+ member :sc_spec_entry_udt_struct_v0, 1
+ member :sc_spec_entry_udt_union_v0, 2
+ member :sc_spec_entry_udt_enum_v0, 3
+ member :sc_spec_entry_udt_error_enum_v0, 4
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/sc_spec_function_input_v0.rb b/base/generated/stellar/sc_spec_function_input_v0.rb
new file mode 100644
index 00000000..561cccb4
--- /dev/null
+++ b/base/generated/stellar/sc_spec_function_input_v0.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecFunctionInputV0
+# {
+# string doc;
+# string name<30>;
+# SCSpecTypeDef type;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecFunctionInputV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :name, XDR::String[30]
+ attribute :type, SCSpecTypeDef
+ end
+end
diff --git a/base/generated/stellar/sc_spec_function_v0.rb b/base/generated/stellar/sc_spec_function_v0.rb
new file mode 100644
index 00000000..25e1804d
--- /dev/null
+++ b/base/generated/stellar/sc_spec_function_v0.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecFunctionV0
+# {
+# string doc;
+# SCSymbol name;
+# SCSpecFunctionInputV0 inputs<10>;
+# SCSpecTypeDef outputs<1>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecFunctionV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :name, SCSymbol
+ attribute :inputs, XDR::VarArray[SCSpecFunctionInputV0, 10]
+ attribute :outputs, XDR::VarArray[SCSpecTypeDef, 1]
+ end
+end
diff --git a/base/generated/stellar/sc_spec_type.rb b/base/generated/stellar/sc_spec_type.rb
new file mode 100644
index 00000000..e5869305
--- /dev/null
+++ b/base/generated/stellar/sc_spec_type.rb
@@ -0,0 +1,74 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SCSpecType
+# {
+# SC_SPEC_TYPE_VAL = 0,
+#
+# // Types with no parameters.
+# SC_SPEC_TYPE_BOOL = 1,
+# SC_SPEC_TYPE_VOID = 2,
+# SC_SPEC_TYPE_ERROR = 3,
+# SC_SPEC_TYPE_U32 = 4,
+# SC_SPEC_TYPE_I32 = 5,
+# SC_SPEC_TYPE_U64 = 6,
+# SC_SPEC_TYPE_I64 = 7,
+# SC_SPEC_TYPE_TIMEPOINT = 8,
+# SC_SPEC_TYPE_DURATION = 9,
+# SC_SPEC_TYPE_U128 = 10,
+# SC_SPEC_TYPE_I128 = 11,
+# SC_SPEC_TYPE_U256 = 12,
+# SC_SPEC_TYPE_I256 = 13,
+# SC_SPEC_TYPE_BYTES = 14,
+# SC_SPEC_TYPE_STRING = 16,
+# SC_SPEC_TYPE_SYMBOL = 17,
+# SC_SPEC_TYPE_ADDRESS = 19,
+#
+# // Types with parameters.
+# SC_SPEC_TYPE_OPTION = 1000,
+# SC_SPEC_TYPE_RESULT = 1001,
+# SC_SPEC_TYPE_VEC = 1002,
+# SC_SPEC_TYPE_MAP = 1004,
+# SC_SPEC_TYPE_TUPLE = 1005,
+# SC_SPEC_TYPE_BYTES_N = 1006,
+#
+# // User defined types.
+# SC_SPEC_TYPE_UDT = 2000
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecType < XDR::Enum
+ member :sc_spec_type_val, 0
+ member :sc_spec_type_bool, 1
+ member :sc_spec_type_void, 2
+ member :sc_spec_type_error, 3
+ member :sc_spec_type_u32, 4
+ member :sc_spec_type_i32, 5
+ member :sc_spec_type_u64, 6
+ member :sc_spec_type_i64, 7
+ member :sc_spec_type_timepoint, 8
+ member :sc_spec_type_duration, 9
+ member :sc_spec_type_u128, 10
+ member :sc_spec_type_i128, 11
+ member :sc_spec_type_u256, 12
+ member :sc_spec_type_i256, 13
+ member :sc_spec_type_bytes, 14
+ member :sc_spec_type_string, 16
+ member :sc_spec_type_symbol, 17
+ member :sc_spec_type_address, 19
+ member :sc_spec_type_option, 1000
+ member :sc_spec_type_result, 1001
+ member :sc_spec_type_vec, 1002
+ member :sc_spec_type_map, 1004
+ member :sc_spec_type_tuple, 1005
+ member :sc_spec_type_bytes_n, 1006
+ member :sc_spec_type_udt, 2000
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/sc_spec_type_bytes_n.rb b/base/generated/stellar/sc_spec_type_bytes_n.rb
new file mode 100644
index 00000000..f0f55a2f
--- /dev/null
+++ b/base/generated/stellar/sc_spec_type_bytes_n.rb
@@ -0,0 +1,18 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecTypeBytesN
+# {
+# uint32 n;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecTypeBytesN < XDR::Struct
+ attribute :n, Uint32
+ end
+end
diff --git a/base/generated/stellar/sc_spec_type_def.rb b/base/generated/stellar/sc_spec_type_def.rb
new file mode 100644
index 00000000..86b8c6fd
--- /dev/null
+++ b/base/generated/stellar/sc_spec_type_def.rb
@@ -0,0 +1,84 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SCSpecTypeDef switch (SCSpecType type)
+# {
+# case SC_SPEC_TYPE_VAL:
+# case SC_SPEC_TYPE_BOOL:
+# case SC_SPEC_TYPE_VOID:
+# case SC_SPEC_TYPE_ERROR:
+# case SC_SPEC_TYPE_U32:
+# case SC_SPEC_TYPE_I32:
+# case SC_SPEC_TYPE_U64:
+# case SC_SPEC_TYPE_I64:
+# case SC_SPEC_TYPE_TIMEPOINT:
+# case SC_SPEC_TYPE_DURATION:
+# case SC_SPEC_TYPE_U128:
+# case SC_SPEC_TYPE_I128:
+# case SC_SPEC_TYPE_U256:
+# case SC_SPEC_TYPE_I256:
+# case SC_SPEC_TYPE_BYTES:
+# case SC_SPEC_TYPE_STRING:
+# case SC_SPEC_TYPE_SYMBOL:
+# case SC_SPEC_TYPE_ADDRESS:
+# void;
+# case SC_SPEC_TYPE_OPTION:
+# SCSpecTypeOption option;
+# case SC_SPEC_TYPE_RESULT:
+# SCSpecTypeResult result;
+# case SC_SPEC_TYPE_VEC:
+# SCSpecTypeVec vec;
+# case SC_SPEC_TYPE_MAP:
+# SCSpecTypeMap map;
+# case SC_SPEC_TYPE_TUPLE:
+# SCSpecTypeTuple tuple;
+# case SC_SPEC_TYPE_BYTES_N:
+# SCSpecTypeBytesN bytesN;
+# case SC_SPEC_TYPE_UDT:
+# SCSpecTypeUDT udt;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecTypeDef < XDR::Union
+ switch_on SCSpecType, :type
+
+ switch :sc_spec_type_val
+ switch :sc_spec_type_bool
+ switch :sc_spec_type_void
+ switch :sc_spec_type_error
+ switch :sc_spec_type_u32
+ switch :sc_spec_type_i32
+ switch :sc_spec_type_u64
+ switch :sc_spec_type_i64
+ switch :sc_spec_type_timepoint
+ switch :sc_spec_type_duration
+ switch :sc_spec_type_u128
+ switch :sc_spec_type_i128
+ switch :sc_spec_type_u256
+ switch :sc_spec_type_i256
+ switch :sc_spec_type_bytes
+ switch :sc_spec_type_string
+ switch :sc_spec_type_symbol
+ switch :sc_spec_type_address
+ switch :sc_spec_type_option, :option
+ switch :sc_spec_type_result, :result
+ switch :sc_spec_type_vec, :vec
+ switch :sc_spec_type_map, :map
+ switch :sc_spec_type_tuple, :tuple
+ switch :sc_spec_type_bytes_n, :bytes_n
+ switch :sc_spec_type_udt, :udt
+
+ attribute :option, SCSpecTypeOption
+ attribute :result, SCSpecTypeResult
+ attribute :vec, SCSpecTypeVec
+ attribute :map, SCSpecTypeMap
+ attribute :tuple, SCSpecTypeTuple
+ attribute :bytes_n, SCSpecTypeBytesN
+ attribute :udt, SCSpecTypeUDT
+ end
+end
diff --git a/base/generated/stellar/sc_spec_type_map.rb b/base/generated/stellar/sc_spec_type_map.rb
new file mode 100644
index 00000000..a7d9dec7
--- /dev/null
+++ b/base/generated/stellar/sc_spec_type_map.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecTypeMap
+# {
+# SCSpecTypeDef keyType;
+# SCSpecTypeDef valueType;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecTypeMap < XDR::Struct
+ attribute :key_type, SCSpecTypeDef
+ attribute :value_type, SCSpecTypeDef
+ end
+end
diff --git a/base/generated/stellar/sc_spec_type_option.rb b/base/generated/stellar/sc_spec_type_option.rb
new file mode 100644
index 00000000..8b7e4d4b
--- /dev/null
+++ b/base/generated/stellar/sc_spec_type_option.rb
@@ -0,0 +1,18 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecTypeOption
+# {
+# SCSpecTypeDef valueType;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecTypeOption < XDR::Struct
+ attribute :value_type, SCSpecTypeDef
+ end
+end
diff --git a/base/generated/stellar/sc_spec_type_result.rb b/base/generated/stellar/sc_spec_type_result.rb
new file mode 100644
index 00000000..36ec139c
--- /dev/null
+++ b/base/generated/stellar/sc_spec_type_result.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecTypeResult
+# {
+# SCSpecTypeDef okType;
+# SCSpecTypeDef errorType;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecTypeResult < XDR::Struct
+ attribute :ok_type, SCSpecTypeDef
+ attribute :error_type, SCSpecTypeDef
+ end
+end
diff --git a/base/generated/stellar/sc_spec_type_tuple.rb b/base/generated/stellar/sc_spec_type_tuple.rb
new file mode 100644
index 00000000..beade687
--- /dev/null
+++ b/base/generated/stellar/sc_spec_type_tuple.rb
@@ -0,0 +1,18 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecTypeTuple
+# {
+# SCSpecTypeDef valueTypes<12>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecTypeTuple < XDR::Struct
+ attribute :value_types, XDR::VarArray[SCSpecTypeDef, 12]
+ end
+end
diff --git a/base/generated/stellar/sc_spec_type_udt.rb b/base/generated/stellar/sc_spec_type_udt.rb
new file mode 100644
index 00000000..0ec15fc4
--- /dev/null
+++ b/base/generated/stellar/sc_spec_type_udt.rb
@@ -0,0 +1,18 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecTypeUDT
+# {
+# string name<60>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecTypeUDT < XDR::Struct
+ attribute :name, XDR::String[60]
+ end
+end
diff --git a/base/generated/stellar/sc_spec_type_vec.rb b/base/generated/stellar/sc_spec_type_vec.rb
new file mode 100644
index 00000000..4866ef90
--- /dev/null
+++ b/base/generated/stellar/sc_spec_type_vec.rb
@@ -0,0 +1,18 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecTypeVec
+# {
+# SCSpecTypeDef elementType;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecTypeVec < XDR::Struct
+ attribute :element_type, SCSpecTypeDef
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_enum_case_v0.rb b/base/generated/stellar/sc_spec_udt_enum_case_v0.rb
new file mode 100644
index 00000000..f1992bcb
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_enum_case_v0.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecUDTEnumCaseV0
+# {
+# string doc;
+# string name<60>;
+# uint32 value;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTEnumCaseV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :name, XDR::String[60]
+ attribute :value, Uint32
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_enum_v0.rb b/base/generated/stellar/sc_spec_udt_enum_v0.rb
new file mode 100644
index 00000000..b6058f79
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_enum_v0.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecUDTEnumV0
+# {
+# string doc;
+# string lib<80>;
+# string name<60>;
+# SCSpecUDTEnumCaseV0 cases<50>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTEnumV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :lib, XDR::String[80]
+ attribute :name, XDR::String[60]
+ attribute :cases, XDR::VarArray[SCSpecUDTEnumCaseV0, 50]
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_error_enum_case_v0.rb b/base/generated/stellar/sc_spec_udt_error_enum_case_v0.rb
new file mode 100644
index 00000000..f54509a8
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_error_enum_case_v0.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecUDTErrorEnumCaseV0
+# {
+# string doc;
+# string name<60>;
+# uint32 value;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTErrorEnumCaseV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :name, XDR::String[60]
+ attribute :value, Uint32
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_error_enum_v0.rb b/base/generated/stellar/sc_spec_udt_error_enum_v0.rb
new file mode 100644
index 00000000..73df88c6
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_error_enum_v0.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecUDTErrorEnumV0
+# {
+# string doc;
+# string lib<80>;
+# string name<60>;
+# SCSpecUDTErrorEnumCaseV0 cases<50>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTErrorEnumV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :lib, XDR::String[80]
+ attribute :name, XDR::String[60]
+ attribute :cases, XDR::VarArray[SCSpecUDTErrorEnumCaseV0, 50]
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_struct_field_v0.rb b/base/generated/stellar/sc_spec_udt_struct_field_v0.rb
new file mode 100644
index 00000000..64cb8803
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_struct_field_v0.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecUDTStructFieldV0
+# {
+# string doc;
+# string name<30>;
+# SCSpecTypeDef type;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTStructFieldV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :name, XDR::String[30]
+ attribute :type, SCSpecTypeDef
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_struct_v0.rb b/base/generated/stellar/sc_spec_udt_struct_v0.rb
new file mode 100644
index 00000000..05fe1946
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_struct_v0.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecUDTStructV0
+# {
+# string doc;
+# string lib<80>;
+# string name<60>;
+# SCSpecUDTStructFieldV0 fields<40>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTStructV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :lib, XDR::String[80]
+ attribute :name, XDR::String[60]
+ attribute :fields, XDR::VarArray[SCSpecUDTStructFieldV0, 40]
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_union_case_tuple_v0.rb b/base/generated/stellar/sc_spec_udt_union_case_tuple_v0.rb
new file mode 100644
index 00000000..45540e92
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_union_case_tuple_v0.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecUDTUnionCaseTupleV0
+# {
+# string doc;
+# string name<60>;
+# SCSpecTypeDef type<12>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTUnionCaseTupleV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :name, XDR::String[60]
+ attribute :type, XDR::VarArray[SCSpecTypeDef, 12]
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_union_case_v0.rb b/base/generated/stellar/sc_spec_udt_union_case_v0.rb
new file mode 100644
index 00000000..1a496cee
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_union_case_v0.rb
@@ -0,0 +1,27 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SCSpecUDTUnionCaseV0 switch (SCSpecUDTUnionCaseV0Kind kind)
+# {
+# case SC_SPEC_UDT_UNION_CASE_VOID_V0:
+# SCSpecUDTUnionCaseVoidV0 voidCase;
+# case SC_SPEC_UDT_UNION_CASE_TUPLE_V0:
+# SCSpecUDTUnionCaseTupleV0 tupleCase;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTUnionCaseV0 < XDR::Union
+ switch_on SCSpecUDTUnionCaseV0Kind, :kind
+
+ switch :sc_spec_udt_union_case_void_v0, :void_case
+ switch :sc_spec_udt_union_case_tuple_v0, :tuple_case
+
+ attribute :void_case, SCSpecUDTUnionCaseVoidV0
+ attribute :tuple_case, SCSpecUDTUnionCaseTupleV0
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_union_case_v0_kind.rb b/base/generated/stellar/sc_spec_udt_union_case_v0_kind.rb
new file mode 100644
index 00000000..dd16f242
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_union_case_v0_kind.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SCSpecUDTUnionCaseV0Kind
+# {
+# SC_SPEC_UDT_UNION_CASE_VOID_V0 = 0,
+# SC_SPEC_UDT_UNION_CASE_TUPLE_V0 = 1
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTUnionCaseV0Kind < XDR::Enum
+ member :sc_spec_udt_union_case_void_v0, 0
+ member :sc_spec_udt_union_case_tuple_v0, 1
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_union_case_void_v0.rb b/base/generated/stellar/sc_spec_udt_union_case_void_v0.rb
new file mode 100644
index 00000000..267ee3a6
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_union_case_void_v0.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecUDTUnionCaseVoidV0
+# {
+# string doc;
+# string name<60>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTUnionCaseVoidV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :name, XDR::String[60]
+ end
+end
diff --git a/base/generated/stellar/sc_spec_udt_union_v0.rb b/base/generated/stellar/sc_spec_udt_union_v0.rb
new file mode 100644
index 00000000..0904b958
--- /dev/null
+++ b/base/generated/stellar/sc_spec_udt_union_v0.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SCSpecUDTUnionV0
+# {
+# string doc;
+# string lib<80>;
+# string name<60>;
+# SCSpecUDTUnionCaseV0 cases<50>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCSpecUDTUnionV0 < XDR::Struct
+ attribute :doc, XDR::String[SC_SPEC_DOC_LIMIT]
+ attribute :lib, XDR::String[80]
+ attribute :name, XDR::String[60]
+ attribute :cases, XDR::VarArray[SCSpecUDTUnionCaseV0, 50]
+ end
+end
diff --git a/base/generated/stellar/sc_val.rb b/base/generated/stellar/sc_val.rb
new file mode 100644
index 00000000..061b953e
--- /dev/null
+++ b/base/generated/stellar/sc_val.rb
@@ -0,0 +1,119 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SCVal switch (SCValType type)
+# {
+#
+# case SCV_BOOL:
+# bool b;
+# case SCV_VOID:
+# void;
+# case SCV_ERROR:
+# SCError error;
+#
+# case SCV_U32:
+# uint32 u32;
+# case SCV_I32:
+# int32 i32;
+#
+# case SCV_U64:
+# uint64 u64;
+# case SCV_I64:
+# int64 i64;
+# case SCV_TIMEPOINT:
+# TimePoint timepoint;
+# case SCV_DURATION:
+# Duration duration;
+#
+# case SCV_U128:
+# UInt128Parts u128;
+# case SCV_I128:
+# Int128Parts i128;
+#
+# case SCV_U256:
+# UInt256Parts u256;
+# case SCV_I256:
+# Int256Parts i256;
+#
+# case SCV_BYTES:
+# SCBytes bytes;
+# case SCV_STRING:
+# SCString str;
+# case SCV_SYMBOL:
+# SCSymbol sym;
+#
+# // Vec and Map are recursive so need to live
+# // behind an option, due to xdrpp limitations.
+# case SCV_VEC:
+# SCVec *vec;
+# case SCV_MAP:
+# SCMap *map;
+#
+# case SCV_ADDRESS:
+# SCAddress address;
+#
+# // Special SCVals reserved for system-constructed contract-data
+# // ledger keys, not generally usable elsewhere.
+# case SCV_LEDGER_KEY_CONTRACT_INSTANCE:
+# void;
+# case SCV_LEDGER_KEY_NONCE:
+# SCNonceKey nonce_key;
+#
+# case SCV_CONTRACT_INSTANCE:
+# SCContractInstance instance;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCVal < XDR::Union
+ switch_on SCValType, :type
+
+ switch :scv_bool, :b
+ switch :scv_void
+ switch :scv_error, :error
+ switch :scv_u32, :u32
+ switch :scv_i32, :i32
+ switch :scv_u64, :u64
+ switch :scv_i64, :i64
+ switch :scv_timepoint, :timepoint
+ switch :scv_duration, :duration
+ switch :scv_u128, :u128
+ switch :scv_i128, :i128
+ switch :scv_u256, :u256
+ switch :scv_i256, :i256
+ switch :scv_bytes, :bytes
+ switch :scv_string, :str
+ switch :scv_symbol, :sym
+ switch :scv_vec, :vec
+ switch :scv_map, :map
+ switch :scv_address, :address
+ switch :scv_ledger_key_contract_instance
+ switch :scv_ledger_key_nonce, :nonce_key
+ switch :scv_contract_instance, :instance
+
+ attribute :b, XDR::Bool
+ attribute :error, SCError
+ attribute :u32, Uint32
+ attribute :i32, Int32
+ attribute :u64, Uint64
+ attribute :i64, Int64
+ attribute :timepoint, TimePoint
+ attribute :duration, Duration
+ attribute :u128, UInt128Parts
+ attribute :i128, Int128Parts
+ attribute :u256, UInt256Parts
+ attribute :i256, Int256Parts
+ attribute :bytes, SCBytes
+ attribute :str, SCString
+ attribute :sym, SCSymbol
+ attribute :vec, XDR::Option[SCVec]
+ attribute :map, XDR::Option[SCMap]
+ attribute :address, SCAddress
+ attribute :nonce_key, SCNonceKey
+ attribute :instance, SCContractInstance
+ end
+end
diff --git a/base/generated/stellar/sc_val_type.rb b/base/generated/stellar/sc_val_type.rb
new file mode 100644
index 00000000..e4790ef7
--- /dev/null
+++ b/base/generated/stellar/sc_val_type.rb
@@ -0,0 +1,91 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SCValType
+# {
+# SCV_BOOL = 0,
+# SCV_VOID = 1,
+# SCV_ERROR = 2,
+#
+# // 32 bits is the smallest type in WASM or XDR; no need for u8/u16.
+# SCV_U32 = 3,
+# SCV_I32 = 4,
+#
+# // 64 bits is naturally supported by both WASM and XDR also.
+# SCV_U64 = 5,
+# SCV_I64 = 6,
+#
+# // Time-related u64 subtypes with their own functions and formatting.
+# SCV_TIMEPOINT = 7,
+# SCV_DURATION = 8,
+#
+# // 128 bits is naturally supported by Rust and we use it for Soroban
+# // fixed-point arithmetic prices / balances / similar "quantities". These
+# // are represented in XDR as a pair of 2 u64s.
+# SCV_U128 = 9,
+# SCV_I128 = 10,
+#
+# // 256 bits is the size of sha256 output, ed25519 keys, and the EVM machine
+# // word, so for interop use we include this even though it requires a small
+# // amount of Rust guest and/or host library code.
+# SCV_U256 = 11,
+# SCV_I256 = 12,
+#
+# // Bytes come in 3 flavors, 2 of which have meaningfully different
+# // formatting and validity-checking / domain-restriction.
+# SCV_BYTES = 13,
+# SCV_STRING = 14,
+# SCV_SYMBOL = 15,
+#
+# // Vecs and maps are just polymorphic containers of other ScVals.
+# SCV_VEC = 16,
+# SCV_MAP = 17,
+#
+# // Address is the universal identifier for contracts and classic
+# // accounts.
+# SCV_ADDRESS = 18,
+#
+# // The following are the internal SCVal variants that are not
+# // exposed to the contracts.
+# SCV_CONTRACT_INSTANCE = 19,
+#
+# // SCV_LEDGER_KEY_CONTRACT_INSTANCE and SCV_LEDGER_KEY_NONCE are unique
+# // symbolic SCVals used as the key for ledger entries for a contract's
+# // instance and an address' nonce, respectively.
+# SCV_LEDGER_KEY_CONTRACT_INSTANCE = 20,
+# SCV_LEDGER_KEY_NONCE = 21
+# };
+#
+# ===========================================================================
+module Stellar
+ class SCValType < XDR::Enum
+ member :scv_bool, 0
+ member :scv_void, 1
+ member :scv_error, 2
+ member :scv_u32, 3
+ member :scv_i32, 4
+ member :scv_u64, 5
+ member :scv_i64, 6
+ member :scv_timepoint, 7
+ member :scv_duration, 8
+ member :scv_u128, 9
+ member :scv_i128, 10
+ member :scv_u256, 11
+ member :scv_i256, 12
+ member :scv_bytes, 13
+ member :scv_string, 14
+ member :scv_symbol, 15
+ member :scv_vec, 16
+ member :scv_map, 17
+ member :scv_address, 18
+ member :scv_contract_instance, 19
+ member :scv_ledger_key_contract_instance, 20
+ member :scv_ledger_key_nonce, 21
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/send_more_extended.rb b/base/generated/stellar/send_more_extended.rb
new file mode 100644
index 00000000..7bb581b2
--- /dev/null
+++ b/base/generated/stellar/send_more_extended.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SendMoreExtended
+# {
+# uint32 numMessages;
+# uint32 numBytes;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SendMoreExtended < XDR::Struct
+ attribute :num_messages, Uint32
+ attribute :num_bytes, Uint32
+ end
+end
diff --git a/base/generated/stellar/set_options_result.rb b/base/generated/stellar/set_options_result.rb
index 5cc488b8..0f90813d 100644
--- a/base/generated/stellar/set_options_result.rb
+++ b/base/generated/stellar/set_options_result.rb
@@ -9,7 +9,16 @@
# {
# case SET_OPTIONS_SUCCESS:
# void;
-# default:
+# case SET_OPTIONS_LOW_RESERVE:
+# case SET_OPTIONS_TOO_MANY_SIGNERS:
+# case SET_OPTIONS_BAD_FLAGS:
+# case SET_OPTIONS_INVALID_INFLATION:
+# case SET_OPTIONS_CANT_CHANGE:
+# case SET_OPTIONS_UNKNOWN_FLAG:
+# case SET_OPTIONS_THRESHOLD_OUT_OF_RANGE:
+# case SET_OPTIONS_BAD_SIGNER:
+# case SET_OPTIONS_INVALID_HOME_DOMAIN:
+# case SET_OPTIONS_AUTH_REVOCABLE_REQUIRED:
# void;
# };
#
@@ -19,7 +28,16 @@ class SetOptionsResult < XDR::Union
switch_on SetOptionsResultCode, :code
switch :set_options_success
- switch :default
+ switch :set_options_low_reserve
+ switch :set_options_too_many_signers
+ switch :set_options_bad_flags
+ switch :set_options_invalid_inflation
+ switch :set_options_cant_change
+ switch :set_options_unknown_flag
+ switch :set_options_threshold_out_of_range
+ switch :set_options_bad_signer
+ switch :set_options_invalid_home_domain
+ switch :set_options_auth_revocable_required
end
end
diff --git a/base/generated/stellar/set_trust_line_flags_result.rb b/base/generated/stellar/set_trust_line_flags_result.rb
index af753aca..77b90a6b 100644
--- a/base/generated/stellar/set_trust_line_flags_result.rb
+++ b/base/generated/stellar/set_trust_line_flags_result.rb
@@ -9,7 +9,11 @@
# {
# case SET_TRUST_LINE_FLAGS_SUCCESS:
# void;
-# default:
+# case SET_TRUST_LINE_FLAGS_MALFORMED:
+# case SET_TRUST_LINE_FLAGS_NO_TRUST_LINE:
+# case SET_TRUST_LINE_FLAGS_CANT_REVOKE:
+# case SET_TRUST_LINE_FLAGS_INVALID_STATE:
+# case SET_TRUST_LINE_FLAGS_LOW_RESERVE:
# void;
# };
#
@@ -19,7 +23,11 @@ class SetTrustLineFlagsResult < XDR::Union
switch_on SetTrustLineFlagsResultCode, :code
switch :set_trust_line_flags_success
- switch :default
+ switch :set_trust_line_flags_malformed
+ switch :set_trust_line_flags_no_trust_line
+ switch :set_trust_line_flags_cant_revoke
+ switch :set_trust_line_flags_invalid_state
+ switch :set_trust_line_flags_low_reserve
end
end
diff --git a/base/generated/stellar/soroban_address_credentials.rb b/base/generated/stellar/soroban_address_credentials.rb
new file mode 100644
index 00000000..42824097
--- /dev/null
+++ b/base/generated/stellar/soroban_address_credentials.rb
@@ -0,0 +1,24 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SorobanAddressCredentials
+# {
+# SCAddress address;
+# int64 nonce;
+# uint32 signatureExpirationLedger;
+# SCVal signature;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanAddressCredentials < XDR::Struct
+ attribute :address, SCAddress
+ attribute :nonce, Int64
+ attribute :signature_expiration_ledger, Uint32
+ attribute :signature, SCVal
+ end
+end
diff --git a/base/generated/stellar/soroban_authorization_entry.rb b/base/generated/stellar/soroban_authorization_entry.rb
new file mode 100644
index 00000000..4ab4056c
--- /dev/null
+++ b/base/generated/stellar/soroban_authorization_entry.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SorobanAuthorizationEntry
+# {
+# SorobanCredentials credentials;
+# SorobanAuthorizedInvocation rootInvocation;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanAuthorizationEntry < XDR::Struct
+ attribute :credentials, SorobanCredentials
+ attribute :root_invocation, SorobanAuthorizedInvocation
+ end
+end
diff --git a/base/generated/stellar/soroban_authorized_function.rb b/base/generated/stellar/soroban_authorized_function.rb
new file mode 100644
index 00000000..a45ea420
--- /dev/null
+++ b/base/generated/stellar/soroban_authorized_function.rb
@@ -0,0 +1,27 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type)
+# {
+# case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN:
+# InvokeContractArgs contractFn;
+# case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN:
+# CreateContractArgs createContractHostFn;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanAuthorizedFunction < XDR::Union
+ switch_on SorobanAuthorizedFunctionType, :type
+
+ switch :soroban_authorized_function_type_contract_fn, :contract_fn
+ switch :soroban_authorized_function_type_create_contract_host_fn, :create_contract_host_fn
+
+ attribute :contract_fn, InvokeContractArgs
+ attribute :create_contract_host_fn, CreateContractArgs
+ end
+end
diff --git a/base/generated/stellar/soroban_authorized_function_type.rb b/base/generated/stellar/soroban_authorized_function_type.rb
new file mode 100644
index 00000000..a7d46607
--- /dev/null
+++ b/base/generated/stellar/soroban_authorized_function_type.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SorobanAuthorizedFunctionType
+# {
+# SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0,
+# SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanAuthorizedFunctionType < XDR::Enum
+ member :soroban_authorized_function_type_contract_fn, 0
+ member :soroban_authorized_function_type_create_contract_host_fn, 1
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/soroban_authorized_invocation.rb b/base/generated/stellar/soroban_authorized_invocation.rb
new file mode 100644
index 00000000..99a1b241
--- /dev/null
+++ b/base/generated/stellar/soroban_authorized_invocation.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SorobanAuthorizedInvocation
+# {
+# SorobanAuthorizedFunction function;
+# SorobanAuthorizedInvocation subInvocations<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanAuthorizedInvocation < XDR::Struct
+ attribute :function, SorobanAuthorizedFunction
+ attribute :sub_invocations, XDR::VarArray[SorobanAuthorizedInvocation]
+ end
+end
diff --git a/base/generated/stellar/soroban_credentials.rb b/base/generated/stellar/soroban_credentials.rb
new file mode 100644
index 00000000..60f0abac
--- /dev/null
+++ b/base/generated/stellar/soroban_credentials.rb
@@ -0,0 +1,26 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union SorobanCredentials switch (SorobanCredentialsType type)
+# {
+# case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT:
+# void;
+# case SOROBAN_CREDENTIALS_ADDRESS:
+# SorobanAddressCredentials address;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanCredentials < XDR::Union
+ switch_on SorobanCredentialsType, :type
+
+ switch :soroban_credentials_source_account
+ switch :soroban_credentials_address, :address
+
+ attribute :address, SorobanAddressCredentials
+ end
+end
diff --git a/base/generated/stellar/soroban_credentials_type.rb b/base/generated/stellar/soroban_credentials_type.rb
new file mode 100644
index 00000000..8018f699
--- /dev/null
+++ b/base/generated/stellar/soroban_credentials_type.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SorobanCredentialsType
+# {
+# SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0,
+# SOROBAN_CREDENTIALS_ADDRESS = 1
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanCredentialsType < XDR::Enum
+ member :soroban_credentials_source_account, 0
+ member :soroban_credentials_address, 1
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/soroban_resources.rb b/base/generated/stellar/soroban_resources.rb
new file mode 100644
index 00000000..3546d611
--- /dev/null
+++ b/base/generated/stellar/soroban_resources.rb
@@ -0,0 +1,29 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SorobanResources
+# {
+# // The ledger footprint of the transaction.
+# LedgerFootprint footprint;
+# // The maximum number of instructions this transaction can use
+# uint32 instructions;
+#
+# // The maximum number of bytes this transaction can read from ledger
+# uint32 readBytes;
+# // The maximum number of bytes this transaction can write to ledger
+# uint32 writeBytes;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanResources < XDR::Struct
+ attribute :footprint, LedgerFootprint
+ attribute :instructions, Uint32
+ attribute :read_bytes, Uint32
+ attribute :write_bytes, Uint32
+ end
+end
diff --git a/base/generated/stellar/soroban_transaction_data.rb b/base/generated/stellar/soroban_transaction_data.rb
new file mode 100644
index 00000000..481b3035
--- /dev/null
+++ b/base/generated/stellar/soroban_transaction_data.rb
@@ -0,0 +1,31 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SorobanTransactionData
+# {
+# ExtensionPoint ext;
+# SorobanResources resources;
+# // Amount of the transaction `fee` allocated to the Soroban resource fees.
+# // The fraction of `resourceFee` corresponding to `resources` specified
+# // above is *not* refundable (i.e. fees for instructions, ledger I/O), as
+# // well as fees for the transaction size.
+# // The remaining part of the fee is refundable and the charged value is
+# // based on the actual consumption of refundable resources (events, ledger
+# // rent bumps).
+# // The `inclusionFee` used for prioritization of the transaction is defined
+# // as `tx.fee - resourceFee`.
+# int64 resourceFee;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanTransactionData < XDR::Struct
+ attribute :ext, ExtensionPoint
+ attribute :resources, SorobanResources
+ attribute :resource_fee, Int64
+ end
+end
diff --git a/base/generated/stellar/soroban_transaction_meta.rb b/base/generated/stellar/soroban_transaction_meta.rb
new file mode 100644
index 00000000..8d997fb6
--- /dev/null
+++ b/base/generated/stellar/soroban_transaction_meta.rb
@@ -0,0 +1,30 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct SorobanTransactionMeta
+# {
+# ExtensionPoint ext;
+#
+# ContractEvent events<>; // custom events populated by the
+# // contracts themselves.
+# SCVal returnValue; // return value of the host fn invocation
+#
+# // Diagnostics events that are not hashed.
+# // This will contain all contract and diagnostic events. Even ones
+# // that were emitted in a failed contract call.
+# DiagnosticEvent diagnosticEvents<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class SorobanTransactionMeta < XDR::Struct
+ attribute :ext, ExtensionPoint
+ attribute :events, XDR::VarArray[ContractEvent]
+ attribute :return_value, SCVal
+ attribute :diagnostic_events, XDR::VarArray[DiagnosticEvent]
+ end
+end
diff --git a/base/generated/stellar/state_archival_settings.rb b/base/generated/stellar/state_archival_settings.rb
new file mode 100644
index 00000000..f846e8eb
--- /dev/null
+++ b/base/generated/stellar/state_archival_settings.rb
@@ -0,0 +1,43 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct StateArchivalSettings {
+# uint32 maxEntryTTL;
+# uint32 minTemporaryTTL;
+# uint32 minPersistentTTL;
+#
+# // rent_fee = wfee_rate_average / rent_rate_denominator_for_type
+# int64 persistentRentRateDenominator;
+# int64 tempRentRateDenominator;
+#
+# // max number of entries that emit archival meta in a single ledger
+# uint32 maxEntriesToArchive;
+#
+# // Number of snapshots to use when calculating average BucketList size
+# uint32 bucketListSizeWindowSampleSize;
+#
+# // Maximum number of bytes that we scan for eviction per ledger
+# uint64 evictionScanSize;
+#
+# // Lowest BucketList level to be scanned to evict entries
+# uint32 startingEvictionScanLevel;
+# };
+#
+# ===========================================================================
+module Stellar
+ class StateArchivalSettings < XDR::Struct
+ attribute :max_entry_ttl, Uint32
+ attribute :min_temporary_ttl, Uint32
+ attribute :min_persistent_ttl, Uint32
+ attribute :persistent_rent_rate_denominator, Int64
+ attribute :temp_rent_rate_denominator, Int64
+ attribute :max_entries_to_archive, Uint32
+ attribute :bucket_list_size_window_sample_size, Uint32
+ attribute :eviction_scan_size, Uint64
+ attribute :starting_eviction_scan_level, Uint32
+ end
+end
diff --git a/base/generated/stellar/stellar_message.rb b/base/generated/stellar/stellar_message.rb
index e91013c4..9e724d4d 100644
--- a/base/generated/stellar/stellar_message.rb
+++ b/base/generated/stellar/stellar_message.rb
@@ -24,6 +24,8 @@
# uint256 txSetHash;
# case TX_SET:
# TransactionSet txSet;
+# case GENERALIZED_TX_SET:
+# GeneralizedTransactionSet generalizedTxSet;
#
# case TRANSACTION:
# TransactionEnvelope transaction;
@@ -45,6 +47,13 @@
# uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest
# case SEND_MORE:
# SendMore sendMoreMessage;
+# case SEND_MORE_EXTENDED:
+# SendMoreExtended sendMoreExtendedMessage;
+# // Pull mode
+# case FLOOD_ADVERT:
+# FloodAdvert floodAdvert;
+# case FLOOD_DEMAND:
+# FloodDemand floodDemand;
# };
#
# ===========================================================================
@@ -52,22 +61,26 @@ module Stellar
class StellarMessage < XDR::Union
switch_on MessageType, :type
- switch :error_msg, :error
- switch :hello, :hello
- switch :auth, :auth
- switch :dont_have, :dont_have
+ switch :error_msg, :error
+ switch :hello, :hello
+ switch :auth, :auth
+ switch :dont_have, :dont_have
switch :get_peers
- switch :peers, :peers
- switch :get_tx_set, :tx_set_hash
- switch :tx_set, :tx_set
- switch :transaction, :transaction
- switch :survey_request, :signed_survey_request_message
- switch :survey_response, :signed_survey_response_message
- switch :get_scp_quorumset, :q_set_hash
- switch :scp_quorumset, :q_set
- switch :scp_message, :envelope
- switch :get_scp_state, :get_scp_ledger_seq
- switch :send_more, :send_more_message
+ switch :peers, :peers
+ switch :get_tx_set, :tx_set_hash
+ switch :tx_set, :tx_set
+ switch :generalized_tx_set, :generalized_tx_set
+ switch :transaction, :transaction
+ switch :survey_request, :signed_survey_request_message
+ switch :survey_response, :signed_survey_response_message
+ switch :get_scp_quorumset, :q_set_hash
+ switch :scp_quorumset, :q_set
+ switch :scp_message, :envelope
+ switch :get_scp_state, :get_scp_ledger_seq
+ switch :send_more, :send_more_message
+ switch :send_more_extended, :send_more_extended_message
+ switch :flood_advert, :flood_advert
+ switch :flood_demand, :flood_demand
attribute :error, Error
attribute :hello, Hello
@@ -76,6 +89,7 @@ class StellarMessage < XDR::Union
attribute :peers, XDR::VarArray[PeerAddress, 100]
attribute :tx_set_hash, Uint256
attribute :tx_set, TransactionSet
+ attribute :generalized_tx_set, GeneralizedTransactionSet
attribute :transaction, TransactionEnvelope
attribute :signed_survey_request_message, SignedSurveyRequestMessage
attribute :signed_survey_response_message, SignedSurveyResponseMessage
@@ -84,5 +98,8 @@ class StellarMessage < XDR::Union
attribute :envelope, SCPEnvelope
attribute :get_scp_ledger_seq, Uint32
attribute :send_more_message, SendMore
+ attribute :send_more_extended_message, SendMoreExtended
+ attribute :flood_advert, FloodAdvert
+ attribute :flood_demand, FloodDemand
end
end
diff --git a/base/generated/stellar/stored_debug_transaction_set.rb b/base/generated/stellar/stored_debug_transaction_set.rb
new file mode 100644
index 00000000..88fbb277
--- /dev/null
+++ b/base/generated/stellar/stored_debug_transaction_set.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct StoredDebugTransactionSet
+# {
+# StoredTransactionSet txSet;
+# uint32 ledgerSeq;
+# StellarValue scpValue;
+# };
+#
+# ===========================================================================
+module Stellar
+ class StoredDebugTransactionSet < XDR::Struct
+ attribute :tx_set, StoredTransactionSet
+ attribute :ledger_seq, Uint32
+ attribute :scp_value, StellarValue
+ end
+end
diff --git a/base/generated/stellar/stored_transaction_set.rb b/base/generated/stellar/stored_transaction_set.rb
new file mode 100644
index 00000000..7504fbe2
--- /dev/null
+++ b/base/generated/stellar/stored_transaction_set.rb
@@ -0,0 +1,27 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union StoredTransactionSet switch (int v)
+# {
+# case 0:
+# TransactionSet txSet;
+# case 1:
+# GeneralizedTransactionSet generalizedTxSet;
+# };
+#
+# ===========================================================================
+module Stellar
+ class StoredTransactionSet < XDR::Union
+ switch_on XDR::Int, :v
+
+ switch 0, :tx_set
+ switch 1, :generalized_tx_set
+
+ attribute :tx_set, TransactionSet
+ attribute :generalized_tx_set, GeneralizedTransactionSet
+ end
+end
diff --git a/base/generated/stellar/survey_message_response_type.rb b/base/generated/stellar/survey_message_response_type.rb
new file mode 100644
index 00000000..c8450fba
--- /dev/null
+++ b/base/generated/stellar/survey_message_response_type.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum SurveyMessageResponseType
+# {
+# SURVEY_TOPOLOGY_RESPONSE_V0 = 0,
+# SURVEY_TOPOLOGY_RESPONSE_V1 = 1
+# };
+#
+# ===========================================================================
+module Stellar
+ class SurveyMessageResponseType < XDR::Enum
+ member :survey_topology_response_v0, 0
+ member :survey_topology_response_v1, 1
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/survey_response_body.rb b/base/generated/stellar/survey_response_body.rb
index 6829e1d1..dbcef690 100644
--- a/base/generated/stellar/survey_response_body.rb
+++ b/base/generated/stellar/survey_response_body.rb
@@ -5,19 +5,23 @@
# === xdr source ============================================================
#
-# union SurveyResponseBody switch (SurveyMessageCommandType type)
+# union SurveyResponseBody switch (SurveyMessageResponseType type)
# {
-# case SURVEY_TOPOLOGY:
-# TopologyResponseBody topologyResponseBody;
+# case SURVEY_TOPOLOGY_RESPONSE_V0:
+# TopologyResponseBodyV0 topologyResponseBodyV0;
+# case SURVEY_TOPOLOGY_RESPONSE_V1:
+# TopologyResponseBodyV1 topologyResponseBodyV1;
# };
#
# ===========================================================================
module Stellar
class SurveyResponseBody < XDR::Union
- switch_on SurveyMessageCommandType, :type
+ switch_on SurveyMessageResponseType, :type
- switch :survey_topology, :topology_response_body
+ switch :survey_topology_response_v0, :topology_response_body_v0
+ switch :survey_topology_response_v1, :topology_response_body_v1
- attribute :topology_response_body, TopologyResponseBody
+ attribute :topology_response_body_v0, TopologyResponseBodyV0
+ attribute :topology_response_body_v1, TopologyResponseBodyV1
end
end
diff --git a/base/generated/stellar/topology_response_body.rb b/base/generated/stellar/topology_response_body_v0.rb
similarity index 89%
rename from base/generated/stellar/topology_response_body.rb
rename to base/generated/stellar/topology_response_body_v0.rb
index 30f9c4b2..5c51c248 100644
--- a/base/generated/stellar/topology_response_body.rb
+++ b/base/generated/stellar/topology_response_body_v0.rb
@@ -5,7 +5,7 @@
# === xdr source ============================================================
#
-# struct TopologyResponseBody
+# struct TopologyResponseBodyV0
# {
# PeerStatList inboundPeers;
# PeerStatList outboundPeers;
@@ -16,7 +16,7 @@
#
# ===========================================================================
module Stellar
- class TopologyResponseBody < XDR::Struct
+ class TopologyResponseBodyV0 < XDR::Struct
attribute :inbound_peers, PeerStatList
attribute :outbound_peers, PeerStatList
attribute :total_inbound_peer_count, Uint32
diff --git a/base/generated/stellar/topology_response_body_v1.rb b/base/generated/stellar/topology_response_body_v1.rb
new file mode 100644
index 00000000..9333cab7
--- /dev/null
+++ b/base/generated/stellar/topology_response_body_v1.rb
@@ -0,0 +1,30 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct TopologyResponseBodyV1
+# {
+# PeerStatList inboundPeers;
+# PeerStatList outboundPeers;
+#
+# uint32 totalInboundPeerCount;
+# uint32 totalOutboundPeerCount;
+#
+# uint32 maxInboundPeerCount;
+# uint32 maxOutboundPeerCount;
+# };
+#
+# ===========================================================================
+module Stellar
+ class TopologyResponseBodyV1 < XDR::Struct
+ attribute :inbound_peers, PeerStatList
+ attribute :outbound_peers, PeerStatList
+ attribute :total_inbound_peer_count, Uint32
+ attribute :total_outbound_peer_count, Uint32
+ attribute :max_inbound_peer_count, Uint32
+ attribute :max_outbound_peer_count, Uint32
+ end
+end
diff --git a/base/generated/stellar/transaction.rb b/base/generated/stellar/transaction.rb
index caec3d4f..9245adf7 100644
--- a/base/generated/stellar/transaction.rb
+++ b/base/generated/stellar/transaction.rb
@@ -28,6 +28,8 @@
# {
# case 0:
# void;
+# case 1:
+# SorobanTransactionData sorobanData;
# }
# ext;
# };
diff --git a/base/generated/stellar/transaction/ext.rb b/base/generated/stellar/transaction/ext.rb
index d09c1ca6..3b9258e9 100644
--- a/base/generated/stellar/transaction/ext.rb
+++ b/base/generated/stellar/transaction/ext.rb
@@ -9,6 +9,8 @@
# {
# case 0:
# void;
+# case 1:
+# SorobanTransactionData sorobanData;
# }
#
# ===========================================================================
@@ -18,7 +20,9 @@ class Ext < XDR::Union
switch_on XDR::Int, :v
switch 0
+ switch 1, :soroban_data
+ attribute :soroban_data, SorobanTransactionData
end
end
end
diff --git a/base/generated/stellar/transaction_history_entry.rb b/base/generated/stellar/transaction_history_entry.rb
index 9efef2dd..85af9cf0 100644
--- a/base/generated/stellar/transaction_history_entry.rb
+++ b/base/generated/stellar/transaction_history_entry.rb
@@ -10,11 +10,13 @@
# uint32 ledgerSeq;
# TransactionSet txSet;
#
-# // reserved for future use
+# // when v != 0, txSet must be empty
# union switch (int v)
# {
# case 0:
# void;
+# case 1:
+# GeneralizedTransactionSet generalizedTxSet;
# }
# ext;
# };
diff --git a/base/generated/stellar/transaction_history_entry/ext.rb b/base/generated/stellar/transaction_history_entry/ext.rb
index d7ebe32b..33fb6c05 100644
--- a/base/generated/stellar/transaction_history_entry/ext.rb
+++ b/base/generated/stellar/transaction_history_entry/ext.rb
@@ -9,6 +9,8 @@
# {
# case 0:
# void;
+# case 1:
+# GeneralizedTransactionSet generalizedTxSet;
# }
#
# ===========================================================================
@@ -18,7 +20,9 @@ class Ext < XDR::Union
switch_on XDR::Int, :v
switch 0
+ switch 1, :generalized_tx_set
+ attribute :generalized_tx_set, GeneralizedTransactionSet
end
end
end
diff --git a/base/generated/stellar/transaction_meta.rb b/base/generated/stellar/transaction_meta.rb
index e05a84c3..390f8cac 100644
--- a/base/generated/stellar/transaction_meta.rb
+++ b/base/generated/stellar/transaction_meta.rb
@@ -13,6 +13,8 @@
# TransactionMetaV1 v1;
# case 2:
# TransactionMetaV2 v2;
+# case 3:
+# TransactionMetaV3 v3;
# };
#
# ===========================================================================
@@ -23,9 +25,11 @@ class TransactionMeta < XDR::Union
switch 0, :operations
switch 1, :v1
switch 2, :v2
+ switch 3, :v3
attribute :operations, XDR::VarArray[OperationMeta]
attribute :v1, TransactionMetaV1
attribute :v2, TransactionMetaV2
+ attribute :v3, TransactionMetaV3
end
end
diff --git a/base/generated/stellar/transaction_meta_v3.rb b/base/generated/stellar/transaction_meta_v3.rb
new file mode 100644
index 00000000..356e1abd
--- /dev/null
+++ b/base/generated/stellar/transaction_meta_v3.rb
@@ -0,0 +1,30 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct TransactionMetaV3
+# {
+# ExtensionPoint ext;
+#
+# LedgerEntryChanges txChangesBefore; // tx level changes before operations
+# // are applied if any
+# OperationMeta operations<>; // meta for each operation
+# LedgerEntryChanges txChangesAfter; // tx level changes after operations are
+# // applied if any
+# SorobanTransactionMeta* sorobanMeta; // Soroban-specific meta (only for
+# // Soroban transactions).
+# };
+#
+# ===========================================================================
+module Stellar
+ class TransactionMetaV3 < XDR::Struct
+ attribute :ext, ExtensionPoint
+ attribute :tx_changes_before, LedgerEntryChanges
+ attribute :operations, XDR::VarArray[OperationMeta]
+ attribute :tx_changes_after, LedgerEntryChanges
+ attribute :soroban_meta, XDR::Option[SorobanTransactionMeta]
+ end
+end
diff --git a/base/generated/stellar/transaction_phase.rb b/base/generated/stellar/transaction_phase.rb
new file mode 100644
index 00000000..633c5dad
--- /dev/null
+++ b/base/generated/stellar/transaction_phase.rb
@@ -0,0 +1,23 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union TransactionPhase switch (int v)
+# {
+# case 0:
+# TxSetComponent v0Components<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class TransactionPhase < XDR::Union
+ switch_on XDR::Int, :v
+
+ switch 0, :v0_components
+
+ attribute :v0_components, XDR::VarArray[TxSetComponent]
+ end
+end
diff --git a/base/generated/stellar/transaction_result.rb b/base/generated/stellar/transaction_result.rb
index cca24472..654da2e3 100644
--- a/base/generated/stellar/transaction_result.rb
+++ b/base/generated/stellar/transaction_result.rb
@@ -17,7 +17,22 @@
# case txSUCCESS:
# case txFAILED:
# OperationResult results<>;
-# default:
+# case txTOO_EARLY:
+# case txTOO_LATE:
+# case txMISSING_OPERATION:
+# case txBAD_SEQ:
+# case txBAD_AUTH:
+# case txINSUFFICIENT_BALANCE:
+# case txNO_ACCOUNT:
+# case txINSUFFICIENT_FEE:
+# case txBAD_AUTH_EXTRA:
+# case txINTERNAL_ERROR:
+# case txNOT_SUPPORTED:
+# // case txFEE_BUMP_INNER_FAILED: handled above
+# case txBAD_SPONSORSHIP:
+# case txBAD_MIN_SEQ_AGE_OR_GAP:
+# case txMALFORMED:
+# case txSOROBAN_INVALID:
# void;
# }
# result;
diff --git a/base/generated/stellar/transaction_result/result.rb b/base/generated/stellar/transaction_result/result.rb
index c1bc453d..9a5ea7dc 100644
--- a/base/generated/stellar/transaction_result/result.rb
+++ b/base/generated/stellar/transaction_result/result.rb
@@ -13,7 +13,22 @@
# case txSUCCESS:
# case txFAILED:
# OperationResult results<>;
-# default:
+# case txTOO_EARLY:
+# case txTOO_LATE:
+# case txMISSING_OPERATION:
+# case txBAD_SEQ:
+# case txBAD_AUTH:
+# case txINSUFFICIENT_BALANCE:
+# case txNO_ACCOUNT:
+# case txINSUFFICIENT_FEE:
+# case txBAD_AUTH_EXTRA:
+# case txINTERNAL_ERROR:
+# case txNOT_SUPPORTED:
+# // case txFEE_BUMP_INNER_FAILED: handled above
+# case txBAD_SPONSORSHIP:
+# case txBAD_MIN_SEQ_AGE_OR_GAP:
+# case txMALFORMED:
+# case txSOROBAN_INVALID:
# void;
# }
#
@@ -27,7 +42,21 @@ class Result < XDR::Union
switch :tx_fee_bump_inner_failed, :inner_result_pair
switch :tx_success, :results
switch :tx_failed, :results
- switch :default
+ switch :tx_too_early
+ switch :tx_too_late
+ switch :tx_missing_operation
+ switch :tx_bad_seq
+ switch :tx_bad_auth
+ switch :tx_insufficient_balance
+ switch :tx_no_account
+ switch :tx_insufficient_fee
+ switch :tx_bad_auth_extra
+ switch :tx_internal_error
+ switch :tx_not_supported
+ switch :tx_bad_sponsorship
+ switch :tx_bad_min_seq_age_or_gap
+ switch :tx_malformed
+ switch :tx_soroban_invalid
attribute :inner_result_pair, InnerTransactionResultPair
attribute :results, XDR::VarArray[OperationResult]
diff --git a/base/generated/stellar/transaction_result_code.rb b/base/generated/stellar/transaction_result_code.rb
index 83c2da50..968eb2bf 100644
--- a/base/generated/stellar/transaction_result_code.rb
+++ b/base/generated/stellar/transaction_result_code.rb
@@ -24,12 +24,12 @@
# txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction
# txINTERNAL_ERROR = -11, // an unknown error occurred
#
-# txNOT_SUPPORTED = -12, // transaction type not supported
-# txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed
-# txBAD_SPONSORSHIP = -14, // sponsorship not confirmed
-# txBAD_MIN_SEQ_AGE_OR_GAP =
-# -15, // minSeqAge or minSeqLedgerGap conditions not met
-# txMALFORMED = -16 // precondition is invalid
+# txNOT_SUPPORTED = -12, // transaction type not supported
+# txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed
+# txBAD_SPONSORSHIP = -14, // sponsorship not confirmed
+# txBAD_MIN_SEQ_AGE_OR_GAP = -15, // minSeqAge or minSeqLedgerGap conditions not met
+# txMALFORMED = -16, // precondition is invalid
+# txSOROBAN_INVALID = -17 // soroban-specific preconditions were not met
# };
#
# ===========================================================================
@@ -53,6 +53,7 @@ class TransactionResultCode < XDR::Enum
member :tx_bad_sponsorship, -14
member :tx_bad_min_seq_age_or_gap, -15
member :tx_malformed, -16
+ member :tx_soroban_invalid, -17
seal
end
diff --git a/base/generated/stellar/transaction_set_v1.rb b/base/generated/stellar/transaction_set_v1.rb
new file mode 100644
index 00000000..84c856cd
--- /dev/null
+++ b/base/generated/stellar/transaction_set_v1.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct TransactionSetV1
+# {
+# Hash previousLedgerHash;
+# TransactionPhase phases<>;
+# };
+#
+# ===========================================================================
+module Stellar
+ class TransactionSetV1 < XDR::Struct
+ attribute :previous_ledger_hash, Hash
+ attribute :phases, XDR::VarArray[TransactionPhase]
+ end
+end
diff --git a/base/generated/stellar/ttl_entry.rb b/base/generated/stellar/ttl_entry.rb
new file mode 100644
index 00000000..700c19f7
--- /dev/null
+++ b/base/generated/stellar/ttl_entry.rb
@@ -0,0 +1,20 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct TTLEntry {
+# // Hash of the LedgerKey that is associated with this TTLEntry
+# Hash keyHash;
+# uint32 liveUntilLedgerSeq;
+# };
+#
+# ===========================================================================
+module Stellar
+ class TTLEntry < XDR::Struct
+ attribute :key_hash, Hash
+ attribute :live_until_ledger_seq, Uint32
+ end
+end
diff --git a/base/generated/stellar/tx_set_component.rb b/base/generated/stellar/tx_set_component.rb
new file mode 100644
index 00000000..0b792bf1
--- /dev/null
+++ b/base/generated/stellar/tx_set_component.rb
@@ -0,0 +1,31 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# union TxSetComponent switch (TxSetComponentType type)
+# {
+# case TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE:
+# struct
+# {
+# int64* baseFee;
+# TransactionEnvelope txs<>;
+# } txsMaybeDiscountedFee;
+# };
+#
+# ===========================================================================
+module Stellar
+ class TxSetComponent < XDR::Union
+ include XDR::Namespace
+
+ autoload :TxsMaybeDiscountedFee
+
+ switch_on TxSetComponentType, :type
+
+ switch :txset_comp_txs_maybe_discounted_fee, :txs_maybe_discounted_fee
+
+ attribute :txs_maybe_discounted_fee, TxsMaybeDiscountedFee
+ end
+end
diff --git a/base/generated/stellar/tx_set_component/txs_maybe_discounted_fee.rb b/base/generated/stellar/tx_set_component/txs_maybe_discounted_fee.rb
new file mode 100644
index 00000000..b0ebfffb
--- /dev/null
+++ b/base/generated/stellar/tx_set_component/txs_maybe_discounted_fee.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct
+# {
+# int64* baseFee;
+# TransactionEnvelope txs<>;
+# }
+#
+# ===========================================================================
+module Stellar
+ class TxSetComponent
+ class TxsMaybeDiscountedFee < XDR::Struct
+ attribute :base_fee, XDR::Option[Int64]
+ attribute :txs, XDR::VarArray[TransactionEnvelope]
+ end
+ end
+end
diff --git a/base/generated/stellar/tx_set_component_type.rb b/base/generated/stellar/tx_set_component_type.rb
new file mode 100644
index 00000000..c2bd4335
--- /dev/null
+++ b/base/generated/stellar/tx_set_component_type.rb
@@ -0,0 +1,22 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# enum TxSetComponentType
+# {
+# // txs with effective fee <= bid derived from a base fee (if any).
+# // If base fee is not specified, no discount is applied.
+# TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0
+# };
+#
+# ===========================================================================
+module Stellar
+ class TxSetComponentType < XDR::Enum
+ member :txset_comp_txs_maybe_discounted_fee, 0
+
+ seal
+ end
+end
diff --git a/base/generated/stellar/u_int128_parts.rb b/base/generated/stellar/u_int128_parts.rb
new file mode 100644
index 00000000..cb5ca7ad
--- /dev/null
+++ b/base/generated/stellar/u_int128_parts.rb
@@ -0,0 +1,19 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct UInt128Parts {
+# uint64 hi;
+# uint64 lo;
+# };
+#
+# ===========================================================================
+module Stellar
+ class UInt128Parts < XDR::Struct
+ attribute :hi, Uint64
+ attribute :lo, Uint64
+ end
+end
diff --git a/base/generated/stellar/u_int256_parts.rb b/base/generated/stellar/u_int256_parts.rb
new file mode 100644
index 00000000..f80ec22e
--- /dev/null
+++ b/base/generated/stellar/u_int256_parts.rb
@@ -0,0 +1,23 @@
+# This code was automatically generated using xdrgen
+# DO NOT EDIT or your changes may be overwritten
+
+require 'xdr'
+
+# === xdr source ============================================================
+#
+# struct UInt256Parts {
+# uint64 hi_hi;
+# uint64 hi_lo;
+# uint64 lo_hi;
+# uint64 lo_lo;
+# };
+#
+# ===========================================================================
+module Stellar
+ class UInt256Parts < XDR::Struct
+ attribute :hi_hi, Uint64
+ attribute :hi_lo, Uint64
+ attribute :lo_hi, Uint64
+ attribute :lo_lo, Uint64
+ end
+end
diff --git a/base/lib/stellar/operation.rb b/base/lib/stellar/operation.rb
index 15305965..054b8a98 100644
--- a/base/lib/stellar/operation.rb
+++ b/base/lib/stellar/operation.rb
@@ -2,6 +2,7 @@
module Stellar
class Operation
+ MAX_UINT32 = 2**32 - 1
MAX_INT64 = 2**63 - 1
TRUST_LINE_FLAGS_MAPPING = {
full: Stellar::TrustLineFlags.authorized_flag,
@@ -483,6 +484,38 @@ def inflation(source_account: nil)
make(source_account: source_account, body: [:inflation])
end
+ # Bump footprint expiration operation builder.
+ #
+ # @param source_account [KeyPair, nil] the source account for the operation
+ # @param extend_to [Integer, #to_i] the number of ledgers to expire (uint32)
+ #
+ # @return [Operation] the built operation
+ def extend_footprint_ttl(extend_to:, source_account: nil)
+ extend_to = extend_to.to_i
+ raise ArgumentError, ":extend_to must be positive" if extend_to < 0
+ raise ArgumentError, ":extend_to is too big" unless extend_to <= MAX_UINT32
+
+ op = ExtendFootprintTTLOp.new(
+ extend_to: extend_to,
+ ext: Stellar::ExtensionPoint.new(0)
+ )
+
+ make(source_account: source_account, body: [:extend_footprint_ttl, op])
+ end
+
+ # Restore footprint operation builder.
+ #
+ # @param source_account [KeyPair, nil] the source account for the operation
+ #
+ # @return [Operation] the built operation
+ def restore_footprint(source_account: nil)
+ op = RestoreFootprintOp.new(
+ ext: Stellar::ExtensionPoint.new(0)
+ )
+
+ make(source_account: source_account, body: [:restore_footprint, op])
+ end
+
private
def get_asset_amount(values)
diff --git a/base/lib/stellar/util/strkey.rb b/base/lib/stellar/util/strkey.rb
index 1f787c61..e71fbdfe 100644
--- a/base/lib/stellar/util/strkey.rb
+++ b/base/lib/stellar/util/strkey.rb
@@ -3,8 +3,9 @@ module Util
require "base32"
require "digest/crc16_xmodem"
- class StrKey
+ module StrKey
VERSION_BYTES = {
+ contract: [2 << 3].pack("C"), # Base32-encodes to 'C...'
account_id: [6 << 3].pack("C"), # Base32-encodes to 'G...'
seed: [18 << 3].pack("C"), # Base32-encodes to 'S...'
pre_auth_tx: [19 << 3].pack("C"), # Base32-encodes to 'T...'
@@ -13,9 +14,12 @@ class StrKey
signed_payload: [15 << 3].pack("C") # Base32-encodes to 'P...'
}
- def self.check_encode(version, byte_str)
+ module_function
+
+ def check_encode(version, byte_str)
version_byte = VERSION_BYTES[version]
raise ArgumentError, "Invalid version: #{version}" if version_byte.blank?
+
payload = version_byte + byte_str.dup.force_encoding("BINARY")
check = checksum(payload)
# TODO: sort out, is it 100% safe to remove padding
@@ -23,10 +27,23 @@ def self.check_encode(version, byte_str)
Base32.encode(payload + check).tr("=", "")
end
+ def check_decode(expected_version, str)
+ decoded = Base32.decode(str)
+ version_byte = decoded[0]
+ payload = decoded[1...-2]
+ check = decoded[-2..-1]
+ version = VERSION_BYTES.key(version_byte)
+
+ raise ArgumentError, "Invalid base32 string" if str != Base32.encode(decoded).tr("=", "")
+ raise ArgumentError, "Unexpected version: #{version.inspect}" if version != expected_version
+ raise ArgumentError, "Invalid checksum" if check != checksum(decoded[0...-2])
+ payload
+ end
+
# Converts an Stellar::MuxedAccount to its string representation, forcing the ed25519 representation.
# @param muxed_account [Stellar::MuxedAccount] account
- # @return [String] "G.."-like address
- def self.encode_muxed_account(muxed_account)
+ # @return [String] "M.."-like address
+ def encode_muxed_account(muxed_account)
if muxed_account.ed25519
check_encode(:account_id, muxed_account.ed25519)
else
@@ -38,7 +55,7 @@ def self.encode_muxed_account(muxed_account)
#
# @param strkey [String] address string to decode
# @return [Stellar::MuxedAccount] MuxedAccount with ed25519 discriminant
- def self.decode_muxed_account(strkey)
+ def decode_muxed_account(strkey)
case strkey
when /^G[0-9A-Z]{55}$/
ed25519 = check_decode(:account_id, strkey)
@@ -53,37 +70,20 @@ def self.decode_muxed_account(strkey)
# @param payload [Stellar::SignerKey::Ed25519SignedPayload]
# @return [String] "P.."-like address
- def self.encode_signed_payload(payload)
+ def encode_signed_payload(payload)
check_encode(:signed_payload, payload.to_xdr)
end
# @param strkey [String] address string to decode
# @return [Stellar::SignerKey::Ed25519SignedPayload]
- def self.decode_signed_payload(strkey)
+ def decode_signed_payload(strkey)
raw = check_decode(:signed_payload, strkey)
Stellar::SignerKey::Ed25519SignedPayload.from_xdr(raw, :raw)
end
- def self.check_decode(expected_version, str)
- decoded = begin
- Base32.decode(str)
- rescue
- raise ArgumentError, "Invalid base32 string"
- end
- version_byte = decoded[0]
- payload = decoded[1...-2]
- check = decoded[-2..-1]
- version = VERSION_BYTES.key(version_byte)
-
- raise ArgumentError, "invalid encoded string" if str != Base32.encode(decoded).tr("=", "")
- raise ArgumentError, "Unexpected version: #{version.inspect}" if version != expected_version
- raise ArgumentError, "Invalid checksum" if check != checksum(decoded[0...-2])
- payload
- end
-
# return the "XModem CRC16" (CCITT-like, but with 0-init and MSB first)
# packed into a string in little-endian order
- def self.checksum(bytes)
+ def checksum(bytes)
crc = Digest::CRC16XModem.checksum(bytes)
[crc].pack("S<")
end
diff --git a/base/spec/lib/stellar/operation_spec.rb b/base/spec/lib/stellar/operation_spec.rb
index c01cd14e..90b05235 100644
--- a/base/spec/lib/stellar/operation_spec.rb
+++ b/base/spec/lib/stellar/operation_spec.rb
@@ -407,6 +407,7 @@
it_behaves_like "XDR serializable"
+ its("source_account") { is_expected.to eq(account.muxed_account) }
its("body.value") { is_expected.to be_a(Stellar::ClawbackClaimableBalanceOp) }
its("body.value.balance_id") { is_expected.to be_a(Stellar::ClaimableBalanceID) }
@@ -416,8 +417,6 @@
expect(hex_balance_id).to eq(balance_id)
end
- its("source_account") { is_expected.to eq(account.muxed_account) }
-
context "when invalid balance id is provided" do
let(:balance_id) { "someinvalidstring" }
@@ -426,4 +425,41 @@
end
end
end
+
+ describe ".extend_footprint_ttl" do
+ let(:extend_to) { 100 }
+ let(:attrs) { {source_account: account, extend_to: extend_to} }
+ subject(:operation) { described_class.extend_footprint_ttl(**attrs) }
+
+ include_context "XDR serializable"
+ its("source_account") { is_expected.to eq(account.muxed_account) }
+ its("body.value") { is_expected.to be_a(Stellar::ExtendFootprintTTLOp) }
+ its("body.value.extend_to") { is_expected.to be_an(Integer) }
+ its("body.value.extend_to") { is_expected.to eq(100) }
+
+ context "when negative ledgers to expire is provided" do
+ let(:extend_to) { -100 }
+
+ it "raises error" do
+ expect { operation }.to raise_error(ArgumentError, ":extend_to must be positive")
+ end
+ end
+
+ context "when ledgers to expire is too large" do
+ let(:extend_to) { 2**32 }
+
+ it "raises error" do
+ expect { operation }.to raise_error(ArgumentError, ":extend_to is too big")
+ end
+ end
+ end
+
+ describe ".restore_footprint" do
+ let(:attrs) { {source_account: account} }
+ subject(:operation) { described_class.restore_footprint(**attrs) }
+
+ include_context "XDR serializable"
+ its("source_account") { is_expected.to eq(account.muxed_account) }
+ its("body.value") { is_expected.to be_a(Stellar::RestoreFootprintOp) }
+ end
end
diff --git a/base/spec/lib/stellar/util/strkey_spec.rb b/base/spec/lib/stellar/util/strkey_spec.rb
index 7c47229c..4cfc7686 100644
--- a/base/spec/lib/stellar/util/strkey_spec.rb
+++ b/base/spec/lib/stellar/util/strkey_spec.rb
@@ -11,11 +11,22 @@ def decode(version, bytes)
describe "#check_decode" do
it "properly decodes" do
- expect(decode(:seed, "SAAAAAAAAAADST3H")).to eq_bytes("\x00\x00\x00\x00\x00\x00\x39")
- expect(decode(:account_id, "GD777777777764TU")).to eq_bytes("\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
- expect(decode(:account_id, "GBQWWBFLRP3BXZD5")).to eq_bytes("\x61\x6b\x04\xab\x8b\xf6\x1b")
- expect(decode(:pre_auth_tx, "TBU2RRGLXH3E4VON")).to eq_bytes("\x69\xa8\xc4\xcb\xb9\xf6\x4e")
- expect(decode(:hash_x, "XBU2RRGLXH3E4PNW")).to eq_bytes("\x69\xa8\xc4\xcb\xb9\xf6\x4e")
+ expect(decode(:seed, "SAAAAAAAAAADST3H"))
+ .to eq_bytes("\x00\x00\x00\x00\x00\x00\x39")
+ expect(decode(:account_id, "GD777777777764TU"))
+ .to eq_bytes("\xFF\xFF\xFF\xFF\xFF\xFF\xFF")
+ expect(decode(:account_id, "GBQWWBFLRP3BXZD5"))
+ .to eq_bytes("\x61\x6b\x04\xab\x8b\xf6\x1b")
+ expect(decode(:pre_auth_tx, "TBU2RRGLXH3E4VON"))
+ .to eq_bytes("\x69\xa8\xc4\xcb\xb9\xf6\x4e")
+ expect(decode(:hash_x, "XBU2RRGLXH3E4PNW"))
+ .to eq_bytes("\x69\xa8\xc4\xcb\xb9\xf6\x4e")
+ expect(decode(:account_id, "GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ"))
+ .to eq_bytes("\x3f\x0c\x34\xbf\x93\xad\x0d\x99\x71\xd0\x4c\xcc\x90\xf7\x05\x51\x1c\x83\x8a\xad\x97\x34\xa4\xa2\xfb\x0d\x7a\x03\xfc\x7f\xe8\x9a")
+ expect(decode(:muxed, "MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ"))
+ .to eq_bytes("\x3f\x0c\x34\xbf\x93\xad\x0d\x99\x71\xd0\x4c\xcc\x90\xf7\x05\x51\x1c\x83\x8a\xad\x97\x34\xa4\xa2\xfb\x0d\x7a\x03\xfc\x7f\xe8\x9a\x00\x00\x00\x00\x00\x00\x00\x00")
+ expect(decode(:contract, "CA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUWDA"))
+ .to eq_bytes("\x3f\x0c\x34\xbf\x93\xad\x0d\x99\x71\xd0\x4c\xcc\x90\xf7\x05\x51\x1c\x83\x8a\xad\x97\x34\xa4\xa2\xfb\x0d\x7a\x03\xfc\x7f\xe8\x9a")
end
it "raises an ArgumentError when an invalid version is provided" do
@@ -34,11 +45,22 @@ def decode(version, bytes)
describe "#check_encode" do
it "properly encodes" do
- expect(encode(:seed, "\x00\x00\x00\x00\x00\x00\x39")).to eq("SAAAAAAAAAADST3H")
- expect(encode(:account_id, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF")).to eq("GD777777777764TU")
- expect(encode(:account_id, "\x61\x6b\x04\xab\x8b\xf6\x1b")).to eq("GBQWWBFLRP3BXZD5")
- expect(encode(:pre_auth_tx, "\x69\xa8\xc4\xcb\xb9\xf6\x4e")).to eq_bytes("TBU2RRGLXH3E4VON")
- expect(encode(:hash_x, "\x69\xa8\xc4\xcb\xb9\xf6\x4e")).to eq_bytes("XBU2RRGLXH3E4PNW")
+ expect(encode(:seed, "\x00\x00\x00\x00\x00\x00\x39"))
+ .to eq("SAAAAAAAAAADST3H")
+ expect(encode(:account_id, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF"))
+ .to eq("GD777777777764TU")
+ expect(encode(:account_id, "\x61\x6b\x04\xab\x8b\xf6\x1b"))
+ .to eq("GBQWWBFLRP3BXZD5")
+ expect(encode(:pre_auth_tx, "\x69\xa8\xc4\xcb\xb9\xf6\x4e"))
+ .to eq("TBU2RRGLXH3E4VON")
+ expect(encode(:hash_x, "\x69\xa8\xc4\xcb\xb9\xf6\x4e"))
+ .to eq("XBU2RRGLXH3E4PNW")
+ expect(encode(:account_id, "\x3f\x0c\x34\xbf\x93\xad\x0d\x99\x71\xd0\x4c\xcc\x90\xf7\x05\x51\x1c\x83\x8a\xad\x97\x34\xa4\xa2\xfb\x0d\x7a\x03\xfc\x7f\xe8\x9a"))
+ .to eq("GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ")
+ expect(encode(:muxed, "\x3f\x0c\x34\xbf\x93\xad\x0d\x99\x71\xd0\x4c\xcc\x90\xf7\x05\x51\x1c\x83\x8a\xad\x97\x34\xa4\xa2\xfb\x0d\x7a\x03\xfc\x7f\xe8\x9a\x00\x00\x00\x00\x00\x00\x00\x00"))
+ .to eq("MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAACJUQ")
+ expect(encode(:contract, "\x3f\x0c\x34\xbf\x93\xad\x0d\x99\x71\xd0\x4c\xcc\x90\xf7\x05\x51\x1c\x83\x8a\xad\x97\x34\xa4\xa2\xfb\x0d\x7a\x03\xfc\x7f\xe8\x9a"))
+ .to eq("CA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUWDA")
end
it "raises an ArgumentError when an invalid version is provided" do
diff --git a/base/tasks/xdr.rake b/base/tasks/xdr.rake
index 14a43577..29ebcfa0 100644
--- a/base/tasks/xdr.rake
+++ b/base/tasks/xdr.rake
@@ -1,11 +1,17 @@
namespace :xdr do
xdr_defs = FileList[
- "xdr/Stellar-types.x",
- "xdr/Stellar-ledger-entries.x",
- "xdr/Stellar-transaction.x",
- "xdr/Stellar-ledger.x",
- "xdr/Stellar-overlay.x",
- "xdr/Stellar-SCP.x",
+ "Stellar-types.x",
+ "Stellar-contract.x",
+ "Stellar-contract-config-setting.x",
+ "Stellar-contract-env-meta.x",
+ "Stellar-contract-meta.x",
+ "Stellar-contract-spec.x",
+ "Stellar-ledger-entries.x",
+ "Stellar-transaction.x",
+ "Stellar-ledger.x",
+ "Stellar-overlay.x",
+ "Stellar-SCP.x",
+ "Stellar-internal.x",
]
task :update, [:ref] => [:clean, :generate]
@@ -18,7 +24,7 @@ namespace :xdr do
require "xdrgen"
compilation = Xdrgen::Compilation.new(
- t.sources,
+ t.sources.map { "xdr/#{_1}" },
output_dir: "generated",
namespace: "stellar-base-generated",
language: :ruby
@@ -28,11 +34,12 @@ namespace :xdr do
end
rule ".x", [:ref] => ["xdr"] do |t, args|
- args.with_defaults(ref: :master)
- core_file = github_client.contents("stellar/stellar-core", path: "src/#{t.name}", ref: args.ref)
- IO.write(t.name, core_file.rels[:download].get.data)
+ args.with_defaults(ref: :curr)
+ core_file = github_client.contents("stellar/stellar-xdr", path: t.name, ref: args.ref)
+ IO.write("xdr/#{t.name}", core_file.rels[:download].get.data)
end
+ # https://github.com/stellar/stellar-xdr/archive/refs/heads/curr.zip
task :clean do
rm_rf "xdr"
rm_rf "generated"
diff --git a/base/xdr/Stellar-contract-config-setting.x b/base/xdr/Stellar-contract-config-setting.x
new file mode 100644
index 00000000..b187a18c
--- /dev/null
+++ b/base/xdr/Stellar-contract-config-setting.x
@@ -0,0 +1,236 @@
+%#include "xdr/Stellar-types.h"
+
+namespace stellar {
+// General “Soroban execution lane” settings
+struct ConfigSettingContractExecutionLanesV0
+{
+ // maximum number of Soroban transactions per ledger
+ uint32 ledgerMaxTxCount;
+};
+
+// "Compute" settings for contracts (instructions and memory).
+struct ConfigSettingContractComputeV0
+{
+ // Maximum instructions per ledger
+ int64 ledgerMaxInstructions;
+ // Maximum instructions per transaction
+ int64 txMaxInstructions;
+ // Cost of 10000 instructions
+ int64 feeRatePerInstructionsIncrement;
+
+ // Memory limit per transaction. Unlike instructions, there is no fee
+ // for memory, just the limit.
+ uint32 txMemoryLimit;
+};
+
+// Ledger access settings for contracts.
+struct ConfigSettingContractLedgerCostV0
+{
+ // Maximum number of ledger entry read operations per ledger
+ uint32 ledgerMaxReadLedgerEntries;
+ // Maximum number of bytes that can be read per ledger
+ uint32 ledgerMaxReadBytes;
+ // Maximum number of ledger entry write operations per ledger
+ uint32 ledgerMaxWriteLedgerEntries;
+ // Maximum number of bytes that can be written per ledger
+ uint32 ledgerMaxWriteBytes;
+
+ // Maximum number of ledger entry read operations per transaction
+ uint32 txMaxReadLedgerEntries;
+ // Maximum number of bytes that can be read per transaction
+ uint32 txMaxReadBytes;
+ // Maximum number of ledger entry write operations per transaction
+ uint32 txMaxWriteLedgerEntries;
+ // Maximum number of bytes that can be written per transaction
+ uint32 txMaxWriteBytes;
+
+ int64 feeReadLedgerEntry; // Fee per ledger entry read
+ int64 feeWriteLedgerEntry; // Fee per ledger entry write
+
+ int64 feeRead1KB; // Fee for reading 1KB
+
+ // The following parameters determine the write fee per 1KB.
+ // Write fee grows linearly until bucket list reaches this size
+ int64 bucketListTargetSizeBytes;
+ // Fee per 1KB write when the bucket list is empty
+ int64 writeFee1KBBucketListLow;
+ // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes`
+ int64 writeFee1KBBucketListHigh;
+ // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes`
+ uint32 bucketListWriteFeeGrowthFactor;
+};
+
+// Historical data (pushed to core archives) settings for contracts.
+struct ConfigSettingContractHistoricalDataV0
+{
+ int64 feeHistorical1KB; // Fee for storing 1KB in archives
+};
+
+// Contract event-related settings.
+struct ConfigSettingContractEventsV0
+{
+ // Maximum size of events that a contract call can emit.
+ uint32 txMaxContractEventsSizeBytes;
+ // Fee for generating 1KB of contract events.
+ int64 feeContractEvents1KB;
+};
+
+// Bandwidth related data settings for contracts.
+// We consider bandwidth to only be consumed by the transaction envelopes, hence
+// this concerns only transaction sizes.
+struct ConfigSettingContractBandwidthV0
+{
+ // Maximum sum of all transaction sizes in the ledger in bytes
+ uint32 ledgerMaxTxsSizeBytes;
+ // Maximum size in bytes for a transaction
+ uint32 txMaxSizeBytes;
+
+ // Fee for 1 KB of transaction size
+ int64 feeTxSize1KB;
+};
+
+enum ContractCostType {
+ // Cost of running 1 wasm instruction
+ WasmInsnExec = 0,
+ // Cost of allocating a slice of memory (in bytes)
+ MemAlloc = 1,
+ // Cost of copying a slice of bytes into a pre-allocated memory
+ MemCpy = 2,
+ // Cost of comparing two slices of memory
+ MemCmp = 3,
+ // Cost of a host function dispatch, not including the actual work done by
+ // the function nor the cost of VM invocation machinary
+ DispatchHostFunction = 4,
+ // Cost of visiting a host object from the host object storage. Exists to
+ // make sure some baseline cost coverage, i.e. repeatly visiting objects
+ // by the guest will always incur some charges.
+ VisitObject = 5,
+ // Cost of serializing an xdr object to bytes
+ ValSer = 6,
+ // Cost of deserializing an xdr object from bytes
+ ValDeser = 7,
+ // Cost of computing the sha256 hash from bytes
+ ComputeSha256Hash = 8,
+ // Cost of computing the ed25519 pubkey from bytes
+ ComputeEd25519PubKey = 9,
+ // Cost of verifying ed25519 signature of a payload.
+ VerifyEd25519Sig = 10,
+ // Cost of instantiation a VM from wasm bytes code.
+ VmInstantiation = 11,
+ // Cost of instantiation a VM from a cached state.
+ VmCachedInstantiation = 12,
+ // Cost of invoking a function on the VM. If the function is a host function,
+ // additional cost will be covered by `DispatchHostFunction`.
+ InvokeVmFunction = 13,
+ // Cost of computing a keccak256 hash from bytes.
+ ComputeKeccak256Hash = 14,
+ // Cost of computing an ECDSA secp256k1 signature from bytes.
+ ComputeEcdsaSecp256k1Sig = 15,
+ // Cost of recovering an ECDSA secp256k1 key from a signature.
+ RecoverEcdsaSecp256k1Key = 16,
+ // Cost of int256 addition (`+`) and subtraction (`-`) operations
+ Int256AddSub = 17,
+ // Cost of int256 multiplication (`*`) operation
+ Int256Mul = 18,
+ // Cost of int256 division (`/`) operation
+ Int256Div = 19,
+ // Cost of int256 power (`exp`) operation
+ Int256Pow = 20,
+ // Cost of int256 shift (`shl`, `shr`) operation
+ Int256Shift = 21,
+ // Cost of drawing random bytes using a ChaCha20 PRNG
+ ChaCha20DrawBytes = 22
+};
+
+struct ContractCostParamEntry {
+ // use `ext` to add more terms (e.g. higher order polynomials) in the future
+ ExtensionPoint ext;
+
+ int64 constTerm;
+ int64 linearTerm;
+};
+
+struct StateArchivalSettings {
+ uint32 maxEntryTTL;
+ uint32 minTemporaryTTL;
+ uint32 minPersistentTTL;
+
+ // rent_fee = wfee_rate_average / rent_rate_denominator_for_type
+ int64 persistentRentRateDenominator;
+ int64 tempRentRateDenominator;
+
+ // max number of entries that emit archival meta in a single ledger
+ uint32 maxEntriesToArchive;
+
+ // Number of snapshots to use when calculating average BucketList size
+ uint32 bucketListSizeWindowSampleSize;
+
+ // Maximum number of bytes that we scan for eviction per ledger
+ uint64 evictionScanSize;
+
+ // Lowest BucketList level to be scanned to evict entries
+ uint32 startingEvictionScanLevel;
+};
+
+struct EvictionIterator {
+ uint32 bucketListLevel;
+ bool isCurrBucket;
+ uint64 bucketFileOffset;
+};
+
+// limits the ContractCostParams size to 20kB
+const CONTRACT_COST_COUNT_LIMIT = 1024;
+
+typedef ContractCostParamEntry ContractCostParams;
+
+// Identifiers of all the network settings.
+enum ConfigSettingID
+{
+ CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0,
+ CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1,
+ CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2,
+ CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3,
+ CONFIG_SETTING_CONTRACT_EVENTS_V0 = 4,
+ CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5,
+ CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS = 6,
+ CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7,
+ CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8,
+ CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9,
+ CONFIG_SETTING_STATE_ARCHIVAL = 10,
+ CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11,
+ CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12,
+ CONFIG_SETTING_EVICTION_ITERATOR = 13
+};
+
+union ConfigSettingEntry switch (ConfigSettingID configSettingID)
+{
+case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES:
+ uint32 contractMaxSizeBytes;
+case CONFIG_SETTING_CONTRACT_COMPUTE_V0:
+ ConfigSettingContractComputeV0 contractCompute;
+case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0:
+ ConfigSettingContractLedgerCostV0 contractLedgerCost;
+case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0:
+ ConfigSettingContractHistoricalDataV0 contractHistoricalData;
+case CONFIG_SETTING_CONTRACT_EVENTS_V0:
+ ConfigSettingContractEventsV0 contractEvents;
+case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0:
+ ConfigSettingContractBandwidthV0 contractBandwidth;
+case CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS:
+ ContractCostParams contractCostParamsCpuInsns;
+case CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES:
+ ContractCostParams contractCostParamsMemBytes;
+case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES:
+ uint32 contractDataKeySizeBytes;
+case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES:
+ uint32 contractDataEntrySizeBytes;
+case CONFIG_SETTING_STATE_ARCHIVAL:
+ StateArchivalSettings stateArchivalSettings;
+case CONFIG_SETTING_CONTRACT_EXECUTION_LANES:
+ ConfigSettingContractExecutionLanesV0 contractExecutionLanes;
+case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW:
+ uint64 bucketListSizeWindow<>;
+case CONFIG_SETTING_EVICTION_ITERATOR:
+ EvictionIterator evictionIterator;
+};
+}
diff --git a/base/xdr/Stellar-contract-env-meta.x b/base/xdr/Stellar-contract-env-meta.x
new file mode 100644
index 00000000..330726de
--- /dev/null
+++ b/base/xdr/Stellar-contract-env-meta.x
@@ -0,0 +1,23 @@
+// Copyright 2022 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
+
+// The contract spec XDR is highly experimental, incomplete, and still being
+// iterated on. Breaking changes expected.
+
+% #include "xdr/Stellar-types.h"
+namespace stellar
+{
+
+enum SCEnvMetaKind
+{
+ SC_ENV_META_KIND_INTERFACE_VERSION = 0
+};
+
+union SCEnvMetaEntry switch (SCEnvMetaKind kind)
+{
+case SC_ENV_META_KIND_INTERFACE_VERSION:
+ uint64 interfaceVersion;
+};
+
+}
diff --git a/base/xdr/Stellar-contract-meta.x b/base/xdr/Stellar-contract-meta.x
new file mode 100644
index 00000000..16eb5f9e
--- /dev/null
+++ b/base/xdr/Stellar-contract-meta.x
@@ -0,0 +1,29 @@
+// Copyright 2022 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
+
+// The contract meta XDR is highly experimental, incomplete, and still being
+// iterated on. Breaking changes expected.
+
+% #include "xdr/Stellar-types.h"
+namespace stellar
+{
+
+struct SCMetaV0
+{
+ string key<>;
+ string val<>;
+};
+
+enum SCMetaKind
+{
+ SC_META_V0 = 0
+};
+
+union SCMetaEntry switch (SCMetaKind kind)
+{
+case SC_META_V0:
+ SCMetaV0 v0;
+};
+
+}
diff --git a/base/xdr/Stellar-contract-spec.x b/base/xdr/Stellar-contract-spec.x
new file mode 100644
index 00000000..6988a633
--- /dev/null
+++ b/base/xdr/Stellar-contract-spec.x
@@ -0,0 +1,242 @@
+// Copyright 2022 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
+
+// The contract Contractspec XDR is highly experimental, incomplete, and still being
+// iterated on. Breaking changes expected.
+
+% #include "xdr/Stellar-types.h"
+% #include "xdr/Stellar-contract.h"
+namespace stellar
+{
+
+const SC_SPEC_DOC_LIMIT = 1024;
+
+enum SCSpecType
+{
+ SC_SPEC_TYPE_VAL = 0,
+
+ // Types with no parameters.
+ SC_SPEC_TYPE_BOOL = 1,
+ SC_SPEC_TYPE_VOID = 2,
+ SC_SPEC_TYPE_ERROR = 3,
+ SC_SPEC_TYPE_U32 = 4,
+ SC_SPEC_TYPE_I32 = 5,
+ SC_SPEC_TYPE_U64 = 6,
+ SC_SPEC_TYPE_I64 = 7,
+ SC_SPEC_TYPE_TIMEPOINT = 8,
+ SC_SPEC_TYPE_DURATION = 9,
+ SC_SPEC_TYPE_U128 = 10,
+ SC_SPEC_TYPE_I128 = 11,
+ SC_SPEC_TYPE_U256 = 12,
+ SC_SPEC_TYPE_I256 = 13,
+ SC_SPEC_TYPE_BYTES = 14,
+ SC_SPEC_TYPE_STRING = 16,
+ SC_SPEC_TYPE_SYMBOL = 17,
+ SC_SPEC_TYPE_ADDRESS = 19,
+
+ // Types with parameters.
+ SC_SPEC_TYPE_OPTION = 1000,
+ SC_SPEC_TYPE_RESULT = 1001,
+ SC_SPEC_TYPE_VEC = 1002,
+ SC_SPEC_TYPE_MAP = 1004,
+ SC_SPEC_TYPE_TUPLE = 1005,
+ SC_SPEC_TYPE_BYTES_N = 1006,
+
+ // User defined types.
+ SC_SPEC_TYPE_UDT = 2000
+};
+
+struct SCSpecTypeOption
+{
+ SCSpecTypeDef valueType;
+};
+
+struct SCSpecTypeResult
+{
+ SCSpecTypeDef okType;
+ SCSpecTypeDef errorType;
+};
+
+struct SCSpecTypeVec
+{
+ SCSpecTypeDef elementType;
+};
+
+struct SCSpecTypeMap
+{
+ SCSpecTypeDef keyType;
+ SCSpecTypeDef valueType;
+};
+
+struct SCSpecTypeTuple
+{
+ SCSpecTypeDef valueTypes<12>;
+};
+
+struct SCSpecTypeBytesN
+{
+ uint32 n;
+};
+
+struct SCSpecTypeUDT
+{
+ string name<60>;
+};
+
+union SCSpecTypeDef switch (SCSpecType type)
+{
+case SC_SPEC_TYPE_VAL:
+case SC_SPEC_TYPE_BOOL:
+case SC_SPEC_TYPE_VOID:
+case SC_SPEC_TYPE_ERROR:
+case SC_SPEC_TYPE_U32:
+case SC_SPEC_TYPE_I32:
+case SC_SPEC_TYPE_U64:
+case SC_SPEC_TYPE_I64:
+case SC_SPEC_TYPE_TIMEPOINT:
+case SC_SPEC_TYPE_DURATION:
+case SC_SPEC_TYPE_U128:
+case SC_SPEC_TYPE_I128:
+case SC_SPEC_TYPE_U256:
+case SC_SPEC_TYPE_I256:
+case SC_SPEC_TYPE_BYTES:
+case SC_SPEC_TYPE_STRING:
+case SC_SPEC_TYPE_SYMBOL:
+case SC_SPEC_TYPE_ADDRESS:
+ void;
+case SC_SPEC_TYPE_OPTION:
+ SCSpecTypeOption option;
+case SC_SPEC_TYPE_RESULT:
+ SCSpecTypeResult result;
+case SC_SPEC_TYPE_VEC:
+ SCSpecTypeVec vec;
+case SC_SPEC_TYPE_MAP:
+ SCSpecTypeMap map;
+case SC_SPEC_TYPE_TUPLE:
+ SCSpecTypeTuple tuple;
+case SC_SPEC_TYPE_BYTES_N:
+ SCSpecTypeBytesN bytesN;
+case SC_SPEC_TYPE_UDT:
+ SCSpecTypeUDT udt;
+};
+
+struct SCSpecUDTStructFieldV0
+{
+ string doc;
+ string name<30>;
+ SCSpecTypeDef type;
+};
+
+struct SCSpecUDTStructV0
+{
+ string doc;
+ string lib<80>;
+ string name<60>;
+ SCSpecUDTStructFieldV0 fields<40>;
+};
+
+struct SCSpecUDTUnionCaseVoidV0
+{
+ string doc;
+ string name<60>;
+};
+
+struct SCSpecUDTUnionCaseTupleV0
+{
+ string doc;
+ string name<60>;
+ SCSpecTypeDef type<12>;
+};
+
+enum SCSpecUDTUnionCaseV0Kind
+{
+ SC_SPEC_UDT_UNION_CASE_VOID_V0 = 0,
+ SC_SPEC_UDT_UNION_CASE_TUPLE_V0 = 1
+};
+
+union SCSpecUDTUnionCaseV0 switch (SCSpecUDTUnionCaseV0Kind kind)
+{
+case SC_SPEC_UDT_UNION_CASE_VOID_V0:
+ SCSpecUDTUnionCaseVoidV0 voidCase;
+case SC_SPEC_UDT_UNION_CASE_TUPLE_V0:
+ SCSpecUDTUnionCaseTupleV0 tupleCase;
+};
+
+struct SCSpecUDTUnionV0
+{
+ string doc;
+ string lib<80>;
+ string name<60>;
+ SCSpecUDTUnionCaseV0 cases<50>;
+};
+
+struct SCSpecUDTEnumCaseV0
+{
+ string doc;
+ string name<60>;
+ uint32 value;
+};
+
+struct SCSpecUDTEnumV0
+{
+ string doc;
+ string lib<80>;
+ string name<60>;
+ SCSpecUDTEnumCaseV0 cases<50>;
+};
+
+struct SCSpecUDTErrorEnumCaseV0
+{
+ string doc;
+ string name<60>;
+ uint32 value;
+};
+
+struct SCSpecUDTErrorEnumV0
+{
+ string doc;
+ string lib<80>;
+ string name<60>;
+ SCSpecUDTErrorEnumCaseV0 cases<50>;
+};
+
+struct SCSpecFunctionInputV0
+{
+ string doc;
+ string name<30>;
+ SCSpecTypeDef type;
+};
+
+struct SCSpecFunctionV0
+{
+ string doc;
+ SCSymbol name;
+ SCSpecFunctionInputV0 inputs<10>;
+ SCSpecTypeDef outputs<1>;
+};
+
+enum SCSpecEntryKind
+{
+ SC_SPEC_ENTRY_FUNCTION_V0 = 0,
+ SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1,
+ SC_SPEC_ENTRY_UDT_UNION_V0 = 2,
+ SC_SPEC_ENTRY_UDT_ENUM_V0 = 3,
+ SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4
+};
+
+union SCSpecEntry switch (SCSpecEntryKind kind)
+{
+case SC_SPEC_ENTRY_FUNCTION_V0:
+ SCSpecFunctionV0 functionV0;
+case SC_SPEC_ENTRY_UDT_STRUCT_V0:
+ SCSpecUDTStructV0 udtStructV0;
+case SC_SPEC_ENTRY_UDT_UNION_V0:
+ SCSpecUDTUnionV0 udtUnionV0;
+case SC_SPEC_ENTRY_UDT_ENUM_V0:
+ SCSpecUDTEnumV0 udtEnumV0;
+case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0:
+ SCSpecUDTErrorEnumV0 udtErrorEnumV0;
+};
+
+}
diff --git a/base/xdr/Stellar-contract.x b/base/xdr/Stellar-contract.x
new file mode 100644
index 00000000..51130056
--- /dev/null
+++ b/base/xdr/Stellar-contract.x
@@ -0,0 +1,282 @@
+// Copyright 2022 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 "xdr/Stellar-types.h"
+namespace stellar
+{
+
+// We fix a maximum of 128 value types in the system for two reasons: we want to
+// keep the codes relatively small (<= 8 bits) when bit-packing values into a
+// u64 at the environment interface level, so that we keep many bits for
+// payloads (small strings, small numeric values, object handles); and then we
+// actually want to go one step further and ensure (for code-size) that our
+// codes fit in a single ULEB128-code byte, which means we can only use 7 bits.
+//
+// We also reserve several type codes from this space because we want to _reuse_
+// the SCValType codes at the environment interface level (or at least not
+// exceed its number-space) but there are more types at that level, assigned to
+// optimizations/special case representations of values abstract at this level.
+
+enum SCValType
+{
+ SCV_BOOL = 0,
+ SCV_VOID = 1,
+ SCV_ERROR = 2,
+
+ // 32 bits is the smallest type in WASM or XDR; no need for u8/u16.
+ SCV_U32 = 3,
+ SCV_I32 = 4,
+
+ // 64 bits is naturally supported by both WASM and XDR also.
+ SCV_U64 = 5,
+ SCV_I64 = 6,
+
+ // Time-related u64 subtypes with their own functions and formatting.
+ SCV_TIMEPOINT = 7,
+ SCV_DURATION = 8,
+
+ // 128 bits is naturally supported by Rust and we use it for Soroban
+ // fixed-point arithmetic prices / balances / similar "quantities". These
+ // are represented in XDR as a pair of 2 u64s.
+ SCV_U128 = 9,
+ SCV_I128 = 10,
+
+ // 256 bits is the size of sha256 output, ed25519 keys, and the EVM machine
+ // word, so for interop use we include this even though it requires a small
+ // amount of Rust guest and/or host library code.
+ SCV_U256 = 11,
+ SCV_I256 = 12,
+
+ // Bytes come in 3 flavors, 2 of which have meaningfully different
+ // formatting and validity-checking / domain-restriction.
+ SCV_BYTES = 13,
+ SCV_STRING = 14,
+ SCV_SYMBOL = 15,
+
+ // Vecs and maps are just polymorphic containers of other ScVals.
+ SCV_VEC = 16,
+ SCV_MAP = 17,
+
+ // Address is the universal identifier for contracts and classic
+ // accounts.
+ SCV_ADDRESS = 18,
+
+ // The following are the internal SCVal variants that are not
+ // exposed to the contracts.
+ SCV_CONTRACT_INSTANCE = 19,
+
+ // SCV_LEDGER_KEY_CONTRACT_INSTANCE and SCV_LEDGER_KEY_NONCE are unique
+ // symbolic SCVals used as the key for ledger entries for a contract's
+ // instance and an address' nonce, respectively.
+ SCV_LEDGER_KEY_CONTRACT_INSTANCE = 20,
+ SCV_LEDGER_KEY_NONCE = 21
+};
+
+enum SCErrorType
+{
+ SCE_CONTRACT = 0, // Contract-specific, user-defined codes.
+ SCE_WASM_VM = 1, // Errors while interpreting WASM bytecode.
+ SCE_CONTEXT = 2, // Errors in the contract's host context.
+ SCE_STORAGE = 3, // Errors accessing host storage.
+ SCE_OBJECT = 4, // Errors working with host objects.
+ SCE_CRYPTO = 5, // Errors in cryptographic operations.
+ SCE_EVENTS = 6, // Errors while emitting events.
+ SCE_BUDGET = 7, // Errors relating to budget limits.
+ SCE_VALUE = 8, // Errors working with host values or SCVals.
+ SCE_AUTH = 9 // Errors from the authentication subsystem.
+};
+
+enum SCErrorCode
+{
+ SCEC_ARITH_DOMAIN = 0, // Some arithmetic was undefined (overflow, divide-by-zero).
+ SCEC_INDEX_BOUNDS = 1, // Something was indexed beyond its bounds.
+ SCEC_INVALID_INPUT = 2, // User provided some otherwise-bad data.
+ SCEC_MISSING_VALUE = 3, // Some value was required but not provided.
+ SCEC_EXISTING_VALUE = 4, // Some value was provided where not allowed.
+ SCEC_EXCEEDED_LIMIT = 5, // Some arbitrary limit -- gas or otherwise -- was hit.
+ SCEC_INVALID_ACTION = 6, // Data was valid but action requested was not.
+ SCEC_INTERNAL_ERROR = 7, // The host detected an error in its own logic.
+ SCEC_UNEXPECTED_TYPE = 8, // Some type wasn't as expected.
+ SCEC_UNEXPECTED_SIZE = 9 // Something's size wasn't as expected.
+};
+
+// Smart contract errors are split into a type (SCErrorType) and a code. When an
+// error is of type SCE_CONTRACT it carries a user-defined uint32 code that
+// Soroban assigns no specific meaning to. In all other cases, the type
+// specifies a subsystem of the Soroban host where the error originated, and the
+// accompanying code is an SCErrorCode, each of which specifies a slightly more
+// precise class of errors within that subsystem.
+//
+// Error types and codes are not maximally precise; there is a tradeoff between
+// precision and flexibility in the implementation, and the granularity here is
+// chosen to be adequate for most purposes while not placing a burden on future
+// system evolution and maintenance. When additional precision is needed for
+// debugging, Soroban can be run with diagnostic events enabled.
+
+union SCError switch (SCErrorType type)
+{
+case SCE_CONTRACT:
+ uint32 contractCode;
+case SCE_WASM_VM:
+case SCE_CONTEXT:
+case SCE_STORAGE:
+case SCE_OBJECT:
+case SCE_CRYPTO:
+case SCE_EVENTS:
+case SCE_BUDGET:
+case SCE_VALUE:
+case SCE_AUTH:
+ SCErrorCode code;
+};
+
+struct UInt128Parts {
+ uint64 hi;
+ uint64 lo;
+};
+
+// A signed int128 has a high sign bit and 127 value bits. We break it into a
+// signed high int64 (that carries the sign bit and the high 63 value bits) and
+// a low unsigned uint64 that carries the low 64 bits. This will sort in
+// generated code in the same order the underlying int128 sorts.
+struct Int128Parts {
+ int64 hi;
+ uint64 lo;
+};
+
+struct UInt256Parts {
+ uint64 hi_hi;
+ uint64 hi_lo;
+ uint64 lo_hi;
+ uint64 lo_lo;
+};
+
+// A signed int256 has a high sign bit and 255 value bits. We break it into a
+// signed high int64 (that carries the sign bit and the high 63 value bits) and
+// three low unsigned `uint64`s that carry the lower bits. This will sort in
+// generated code in the same order the underlying int256 sorts.
+struct Int256Parts {
+ int64 hi_hi;
+ uint64 hi_lo;
+ uint64 lo_hi;
+ uint64 lo_lo;
+};
+
+enum ContractExecutableType
+{
+ CONTRACT_EXECUTABLE_WASM = 0,
+ CONTRACT_EXECUTABLE_STELLAR_ASSET = 1
+};
+
+union ContractExecutable switch (ContractExecutableType type)
+{
+case CONTRACT_EXECUTABLE_WASM:
+ Hash wasm_hash;
+case CONTRACT_EXECUTABLE_STELLAR_ASSET:
+ void;
+};
+
+enum SCAddressType
+{
+ SC_ADDRESS_TYPE_ACCOUNT = 0,
+ SC_ADDRESS_TYPE_CONTRACT = 1
+};
+
+union SCAddress switch (SCAddressType type)
+{
+case SC_ADDRESS_TYPE_ACCOUNT:
+ AccountID accountId;
+case SC_ADDRESS_TYPE_CONTRACT:
+ Hash contractId;
+};
+
+%struct SCVal;
+%struct SCMapEntry;
+
+const SCSYMBOL_LIMIT = 32;
+
+typedef SCVal SCVec<>;
+typedef SCMapEntry SCMap<>;
+
+typedef opaque SCBytes<>;
+typedef string SCString<>;
+typedef string SCSymbol;
+
+struct SCNonceKey {
+ int64 nonce;
+};
+
+struct SCContractInstance {
+ ContractExecutable executable;
+ SCMap* storage;
+};
+
+union SCVal switch (SCValType type)
+{
+
+case SCV_BOOL:
+ bool b;
+case SCV_VOID:
+ void;
+case SCV_ERROR:
+ SCError error;
+
+case SCV_U32:
+ uint32 u32;
+case SCV_I32:
+ int32 i32;
+
+case SCV_U64:
+ uint64 u64;
+case SCV_I64:
+ int64 i64;
+case SCV_TIMEPOINT:
+ TimePoint timepoint;
+case SCV_DURATION:
+ Duration duration;
+
+case SCV_U128:
+ UInt128Parts u128;
+case SCV_I128:
+ Int128Parts i128;
+
+case SCV_U256:
+ UInt256Parts u256;
+case SCV_I256:
+ Int256Parts i256;
+
+case SCV_BYTES:
+ SCBytes bytes;
+case SCV_STRING:
+ SCString str;
+case SCV_SYMBOL:
+ SCSymbol sym;
+
+// Vec and Map are recursive so need to live
+// behind an option, due to xdrpp limitations.
+case SCV_VEC:
+ SCVec *vec;
+case SCV_MAP:
+ SCMap *map;
+
+case SCV_ADDRESS:
+ SCAddress address;
+
+// Special SCVals reserved for system-constructed contract-data
+// ledger keys, not generally usable elsewhere.
+case SCV_LEDGER_KEY_CONTRACT_INSTANCE:
+ void;
+case SCV_LEDGER_KEY_NONCE:
+ SCNonceKey nonce_key;
+
+case SCV_CONTRACT_INSTANCE:
+ SCContractInstance instance;
+};
+
+struct SCMapEntry
+{
+ SCVal key;
+ SCVal val;
+};
+
+}
diff --git a/base/xdr/Stellar-internal.x b/base/xdr/Stellar-internal.x
new file mode 100644
index 00000000..02f1b81e
--- /dev/null
+++ b/base/xdr/Stellar-internal.x
@@ -0,0 +1,48 @@
+// Copyright 2022 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
+
+// This is for 'internal'-only messages that are not meant to be read/written
+// by any other binaries besides a single Core instance.
+%#include "xdr/Stellar-ledger.h"
+%#include "xdr/Stellar-SCP.h"
+
+namespace stellar
+{
+union StoredTransactionSet switch (int v)
+{
+case 0:
+ TransactionSet txSet;
+case 1:
+ GeneralizedTransactionSet generalizedTxSet;
+};
+
+struct StoredDebugTransactionSet
+{
+ StoredTransactionSet txSet;
+ uint32 ledgerSeq;
+ StellarValue scpValue;
+};
+
+struct PersistedSCPStateV0
+{
+ SCPEnvelope scpEnvelopes<>;
+ SCPQuorumSet quorumSets<>;
+ StoredTransactionSet txSets<>;
+};
+
+struct PersistedSCPStateV1
+{
+ // Tx sets are saved separately
+ SCPEnvelope scpEnvelopes<>;
+ SCPQuorumSet quorumSets<>;
+};
+
+union PersistedSCPState switch (int v)
+{
+case 0:
+ PersistedSCPStateV0 v0;
+case 1:
+ PersistedSCPStateV1 v1;
+};
+}
\ No newline at end of file
diff --git a/base/xdr/Stellar-ledger-entries.x b/base/xdr/Stellar-ledger-entries.x
index 3eb578f1..8a8784e2 100644
--- a/base/xdr/Stellar-ledger-entries.x
+++ b/base/xdr/Stellar-ledger-entries.x
@@ -3,17 +3,16 @@
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
%#include "xdr/Stellar-types.h"
+%#include "xdr/Stellar-contract.h"
+%#include "xdr/Stellar-contract-config-setting.h"
namespace stellar
{
-typedef PublicKey AccountID;
typedef opaque Thresholds[4];
typedef string string32<32>;
typedef string string64<64>;
typedef int64 SequenceNumber;
-typedef uint64 TimePoint;
-typedef uint64 Duration;
typedef opaque DataValue<64>;
typedef Hash PoolID; // SHA256(LiquidityPoolParameters)
@@ -98,7 +97,11 @@ enum LedgerEntryType
OFFER = 2,
DATA = 3,
CLAIMABLE_BALANCE = 4,
- LIQUIDITY_POOL = 5
+ LIQUIDITY_POOL = 5,
+ CONTRACT_DATA = 6,
+ CONTRACT_CODE = 7,
+ CONFIG_SETTING = 8,
+ TTL = 9
};
struct Signer
@@ -491,6 +494,33 @@ struct LiquidityPoolEntry
body;
};
+enum ContractDataDurability {
+ TEMPORARY = 0,
+ PERSISTENT = 1
+};
+
+struct ContractDataEntry {
+ ExtensionPoint ext;
+
+ SCAddress contract;
+ SCVal key;
+ ContractDataDurability durability;
+ SCVal val;
+};
+
+struct ContractCodeEntry {
+ ExtensionPoint ext;
+
+ Hash hash;
+ opaque code<>;
+};
+
+struct TTLEntry {
+ // Hash of the LedgerKey that is associated with this TTLEntry
+ Hash keyHash;
+ uint32 liveUntilLedgerSeq;
+};
+
struct LedgerEntryExtensionV1
{
SponsorshipDescriptor sponsoringID;
@@ -521,6 +551,14 @@ struct LedgerEntry
ClaimableBalanceEntry claimableBalance;
case LIQUIDITY_POOL:
LiquidityPoolEntry liquidityPool;
+ case CONTRACT_DATA:
+ ContractDataEntry contractData;
+ case CONTRACT_CODE:
+ ContractCodeEntry contractCode;
+ case CONFIG_SETTING:
+ ConfigSettingEntry configSetting;
+ case TTL:
+ TTLEntry ttl;
}
data;
@@ -575,6 +613,29 @@ case LIQUIDITY_POOL:
{
PoolID liquidityPoolID;
} liquidityPool;
+case CONTRACT_DATA:
+ struct
+ {
+ SCAddress contract;
+ SCVal key;
+ ContractDataDurability durability;
+ } contractData;
+case CONTRACT_CODE:
+ struct
+ {
+ Hash hash;
+ } contractCode;
+case CONFIG_SETTING:
+ struct
+ {
+ ConfigSettingID configSettingID;
+ } configSetting;
+case TTL:
+ struct
+ {
+ // Hash of the LedgerKey that is associated with this TTLEntry
+ Hash keyHash;
+ } ttl;
};
// list of all envelope types used in the application
@@ -589,6 +650,8 @@ enum EnvelopeType
ENVELOPE_TYPE_SCPVALUE = 4,
ENVELOPE_TYPE_TX_FEE_BUMP = 5,
ENVELOPE_TYPE_OP_ID = 6,
- ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7
+ ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7,
+ ENVELOPE_TYPE_CONTRACT_ID = 8,
+ ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9
};
}
diff --git a/base/xdr/Stellar-ledger.x b/base/xdr/Stellar-ledger.x
index 84b84cbf..b18a3a0d 100644
--- a/base/xdr/Stellar-ledger.x
+++ b/base/xdr/Stellar-ledger.x
@@ -122,7 +122,14 @@ enum LedgerUpgradeType
LEDGER_UPGRADE_BASE_FEE = 2,
LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3,
LEDGER_UPGRADE_BASE_RESERVE = 4,
- LEDGER_UPGRADE_FLAGS = 5
+ LEDGER_UPGRADE_FLAGS = 5,
+ LEDGER_UPGRADE_CONFIG = 6,
+ LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7
+};
+
+struct ConfigUpgradeSetKey {
+ Hash contractID;
+ Hash contentHash;
};
union LedgerUpgrade switch (LedgerUpgradeType type)
@@ -137,6 +144,17 @@ case LEDGER_UPGRADE_BASE_RESERVE:
uint32 newBaseReserve; // update baseReserve
case LEDGER_UPGRADE_FLAGS:
uint32 newFlags; // update flags
+case LEDGER_UPGRADE_CONFIG:
+ // Update arbitrary `ConfigSetting` entries identified by the key.
+ ConfigUpgradeSetKey newConfig;
+case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE:
+ // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without
+ // using `LEDGER_UPGRADE_CONFIG`.
+ uint32 newMaxSorobanTxSetSize;
+};
+
+struct ConfigUpgradeSet {
+ ConfigSettingEntry updatedEntry<>;
};
/* Entries used to define the bucket list */
@@ -176,6 +194,29 @@ case METAENTRY:
BucketMetadata metaEntry;
};
+enum TxSetComponentType
+{
+ // txs with effective fee <= bid derived from a base fee (if any).
+ // If base fee is not specified, no discount is applied.
+ TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0
+};
+
+union TxSetComponent switch (TxSetComponentType type)
+{
+case TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE:
+ struct
+ {
+ int64* baseFee;
+ TransactionEnvelope txs<>;
+ } txsMaybeDiscountedFee;
+};
+
+union TransactionPhase switch (int v)
+{
+case 0:
+ TxSetComponent v0Components<>;
+};
+
// Transaction sets are the unit used by SCP to decide on transitions
// between ledgers
struct TransactionSet
@@ -184,6 +225,19 @@ struct TransactionSet
TransactionEnvelope txs<>;
};
+struct TransactionSetV1
+{
+ Hash previousLedgerHash;
+ TransactionPhase phases<>;
+};
+
+union GeneralizedTransactionSet switch (int v)
+{
+// We consider the legacy TransactionSet to be v0.
+case 1:
+ TransactionSetV1 v1TxSet;
+};
+
struct TransactionResultPair
{
Hash transactionHash;
@@ -203,11 +257,13 @@ struct TransactionHistoryEntry
uint32 ledgerSeq;
TransactionSet txSet;
- // reserved for future use
+ // when v != 0, txSet must be empty
union switch (int v)
{
case 0:
void;
+ case 1:
+ GeneralizedTransactionSet generalizedTxSet;
}
ext;
};
@@ -310,6 +366,74 @@ struct TransactionMetaV2
// applied if any
};
+enum ContractEventType
+{
+ SYSTEM = 0,
+ CONTRACT = 1,
+ DIAGNOSTIC = 2
+};
+
+struct ContractEvent
+{
+ // We can use this to add more fields, or because it
+ // is first, to change ContractEvent into a union.
+ ExtensionPoint ext;
+
+ Hash* contractID;
+ ContractEventType type;
+
+ union switch (int v)
+ {
+ case 0:
+ struct
+ {
+ SCVal topics<>;
+ SCVal data;
+ } v0;
+ }
+ body;
+};
+
+struct DiagnosticEvent
+{
+ bool inSuccessfulContractCall;
+ ContractEvent event;
+};
+
+struct SorobanTransactionMeta
+{
+ ExtensionPoint ext;
+
+ ContractEvent events<>; // custom events populated by the
+ // contracts themselves.
+ SCVal returnValue; // return value of the host fn invocation
+
+ // Diagnostics events that are not hashed.
+ // This will contain all contract and diagnostic events. Even ones
+ // that were emitted in a failed contract call.
+ DiagnosticEvent diagnosticEvents<>;
+};
+
+struct TransactionMetaV3
+{
+ ExtensionPoint ext;
+
+ LedgerEntryChanges txChangesBefore; // tx level changes before operations
+ // are applied if any
+ OperationMeta operations<>; // meta for each operation
+ LedgerEntryChanges txChangesAfter; // tx level changes after operations are
+ // applied if any
+ SorobanTransactionMeta* sorobanMeta; // Soroban-specific meta (only for
+ // Soroban transactions).
+};
+
+// This is in Stellar-ledger.x to due to a circular dependency
+struct InvokeHostFunctionSuccessPreImage
+{
+ SCVal returnValue;
+ ContractEvent events<>;
+};
+
// this is the meta produced when applying transactions
// it does not include pre-apply updates such as fees
union TransactionMeta switch (int v)
@@ -320,6 +444,8 @@ case 1:
TransactionMetaV1 v1;
case 2:
TransactionMetaV2 v2;
+case 3:
+ TransactionMetaV3 v3;
};
// This struct groups together changes on a per transaction basis
@@ -358,9 +484,44 @@ struct LedgerCloseMetaV0
SCPHistoryEntry scpInfo<>;
};
+struct LedgerCloseMetaV1
+{
+ // We forgot to add an ExtensionPoint in v0 but at least
+ // we can add one now in v1.
+ ExtensionPoint ext;
+
+ LedgerHeaderHistoryEntry ledgerHeader;
+
+ GeneralizedTransactionSet txSet;
+
+ // NB: transactions are sorted in apply order here
+ // fees for all transactions are processed first
+ // followed by applying transactions
+ TransactionResultMeta txProcessing<>;
+
+ // upgrades are applied last
+ UpgradeEntryMeta upgradesProcessing<>;
+
+ // other misc information attached to the ledger close
+ SCPHistoryEntry scpInfo<>;
+
+ // Size in bytes of BucketList, to support downstream
+ // systems calculating storage fees correctly.
+ uint64 totalByteSizeOfBucketList;
+
+ // Temp keys that are being evicted at this ledger.
+ LedgerKey evictedTemporaryLedgerKeys<>;
+
+ // Archived restorable ledger entries that are being
+ // evicted at this ledger.
+ LedgerEntry evictedPersistentLedgerEntries<>;
+};
+
union LedgerCloseMeta switch (int v)
{
case 0:
LedgerCloseMetaV0 v0;
+case 1:
+ LedgerCloseMetaV1 v1;
};
}
diff --git a/base/xdr/Stellar-overlay.x b/base/xdr/Stellar-overlay.x
index 9e3a083d..4c964736 100644
--- a/base/xdr/Stellar-overlay.x
+++ b/base/xdr/Stellar-overlay.x
@@ -27,6 +27,12 @@ struct SendMore
uint32 numMessages;
};
+struct SendMoreExtended
+{
+ uint32 numMessages;
+ uint32 numBytes;
+};
+
struct AuthCert
{
Curve25519Public pubkey;
@@ -47,11 +53,18 @@ struct Hello
uint256 nonce;
};
+// During the roll-out phrase, nodes can disable flow control in bytes.
+// Therefore, we need a way to communicate with other nodes
+// that we want/don't want flow control in bytes.
+// We use the `flags` field in the Auth message with a special value
+// set to communicate this. Note that AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED != 0
+// AND AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED != 100 (as previously
+// that value was used for other purposes).
+const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED = 200;
+
struct Auth
{
- // Empty message, just to confirm
- // establishment of MAC keys.
- int unused;
+ int flags;
};
enum IPAddrType
@@ -74,6 +87,7 @@ struct PeerAddress
uint32 numFailures;
};
+// Next ID: 21
enum MessageType
{
ERROR_MSG = 0,
@@ -85,6 +99,7 @@ enum MessageType
GET_TX_SET = 6, // gets a particular txset by hash
TX_SET = 7,
+ GENERALIZED_TX_SET = 17,
TRANSACTION = 8, // pass on a tx you have heard about
@@ -100,7 +115,11 @@ enum MessageType
SURVEY_REQUEST = 14,
SURVEY_RESPONSE = 15,
- SEND_MORE = 16
+ SEND_MORE = 16,
+ SEND_MORE_EXTENDED = 20,
+
+ FLOOD_ADVERT = 18,
+ FLOOD_DEMAND = 19
};
struct DontHave
@@ -114,6 +133,12 @@ enum SurveyMessageCommandType
SURVEY_TOPOLOGY = 0
};
+enum SurveyMessageResponseType
+{
+ SURVEY_TOPOLOGY_RESPONSE_V0 = 0,
+ SURVEY_TOPOLOGY_RESPONSE_V1 = 1
+};
+
struct SurveyRequestMessage
{
NodeID surveyorPeerID;
@@ -168,19 +193,49 @@ struct PeerStats
typedef PeerStats PeerStatList<25>;
-struct TopologyResponseBody
+struct TopologyResponseBodyV0
+{
+ PeerStatList inboundPeers;
+ PeerStatList outboundPeers;
+
+ uint32 totalInboundPeerCount;
+ uint32 totalOutboundPeerCount;
+};
+
+struct TopologyResponseBodyV1
{
PeerStatList inboundPeers;
PeerStatList outboundPeers;
uint32 totalInboundPeerCount;
uint32 totalOutboundPeerCount;
+
+ uint32 maxInboundPeerCount;
+ uint32 maxOutboundPeerCount;
};
-union SurveyResponseBody switch (SurveyMessageCommandType type)
+union SurveyResponseBody switch (SurveyMessageResponseType type)
+{
+case SURVEY_TOPOLOGY_RESPONSE_V0:
+ TopologyResponseBodyV0 topologyResponseBodyV0;
+case SURVEY_TOPOLOGY_RESPONSE_V1:
+ TopologyResponseBodyV1 topologyResponseBodyV1;
+};
+
+const TX_ADVERT_VECTOR_MAX_SIZE = 1000;
+typedef Hash TxAdvertVector;
+
+struct FloodAdvert
+{
+ TxAdvertVector txHashes;
+};
+
+const TX_DEMAND_VECTOR_MAX_SIZE = 1000;
+typedef Hash TxDemandVector;
+
+struct FloodDemand
{
-case SURVEY_TOPOLOGY:
- TopologyResponseBody topologyResponseBody;
+ TxDemandVector txHashes;
};
union StellarMessage switch (MessageType type)
@@ -202,6 +257,8 @@ case GET_TX_SET:
uint256 txSetHash;
case TX_SET:
TransactionSet txSet;
+case GENERALIZED_TX_SET:
+ GeneralizedTransactionSet generalizedTxSet;
case TRANSACTION:
TransactionEnvelope transaction;
@@ -223,6 +280,13 @@ case GET_SCP_STATE:
uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest
case SEND_MORE:
SendMore sendMoreMessage;
+case SEND_MORE_EXTENDED:
+ SendMoreExtended sendMoreExtendedMessage;
+// Pull mode
+case FLOOD_ADVERT:
+ FloodAdvert floodAdvert;
+case FLOOD_DEMAND:
+ FloodDemand floodDemand;
};
union AuthenticatedMessage switch (uint32 v)
diff --git a/base/xdr/Stellar-transaction.x b/base/xdr/Stellar-transaction.x
index f2f593c2..c7f0f5e2 100644
--- a/base/xdr/Stellar-transaction.x
+++ b/base/xdr/Stellar-transaction.x
@@ -2,11 +2,15 @@
// 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 "xdr/Stellar-contract.h"
%#include "xdr/Stellar-ledger-entries.h"
namespace stellar
{
+// maximum number of operations per transaction
+const MAX_OPS_PER_TX = 100;
+
union LiquidityPoolParameters switch (LiquidityPoolType type)
{
case LIQUIDITY_POOL_CONSTANT_PRODUCT:
@@ -57,7 +61,10 @@ enum OperationType
CLAWBACK_CLAIMABLE_BALANCE = 20,
SET_TRUST_LINE_FLAGS = 21,
LIQUIDITY_POOL_DEPOSIT = 22,
- LIQUIDITY_POOL_WITHDRAW = 23
+ LIQUIDITY_POOL_WITHDRAW = 23,
+ INVOKE_HOST_FUNCTION = 24,
+ EXTEND_FOOTPRINT_TTL = 25,
+ RESTORE_FOOTPRINT = 26
};
/* CreateAccount
@@ -465,6 +472,141 @@ struct LiquidityPoolWithdrawOp
int64 minAmountB; // minimum amount of second asset to withdraw
};
+enum HostFunctionType
+{
+ HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0,
+ HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1,
+ HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2
+};
+
+enum ContractIDPreimageType
+{
+ CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0,
+ CONTRACT_ID_PREIMAGE_FROM_ASSET = 1
+};
+
+union ContractIDPreimage switch (ContractIDPreimageType type)
+{
+case CONTRACT_ID_PREIMAGE_FROM_ADDRESS:
+ struct
+ {
+ SCAddress address;
+ uint256 salt;
+ } fromAddress;
+case CONTRACT_ID_PREIMAGE_FROM_ASSET:
+ Asset fromAsset;
+};
+
+struct CreateContractArgs
+{
+ ContractIDPreimage contractIDPreimage;
+ ContractExecutable executable;
+};
+
+struct InvokeContractArgs {
+ SCAddress contractAddress;
+ SCSymbol functionName;
+ SCVal args<>;
+};
+
+union HostFunction switch (HostFunctionType type)
+{
+case HOST_FUNCTION_TYPE_INVOKE_CONTRACT:
+ InvokeContractArgs invokeContract;
+case HOST_FUNCTION_TYPE_CREATE_CONTRACT:
+ CreateContractArgs createContract;
+case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM:
+ opaque wasm<>;
+};
+
+enum SorobanAuthorizedFunctionType
+{
+ SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0,
+ SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1
+};
+
+union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type)
+{
+case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN:
+ InvokeContractArgs contractFn;
+case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN:
+ CreateContractArgs createContractHostFn;
+};
+
+struct SorobanAuthorizedInvocation
+{
+ SorobanAuthorizedFunction function;
+ SorobanAuthorizedInvocation subInvocations<>;
+};
+
+struct SorobanAddressCredentials
+{
+ SCAddress address;
+ int64 nonce;
+ uint32 signatureExpirationLedger;
+ SCVal signature;
+};
+
+enum SorobanCredentialsType
+{
+ SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0,
+ SOROBAN_CREDENTIALS_ADDRESS = 1
+};
+
+union SorobanCredentials switch (SorobanCredentialsType type)
+{
+case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT:
+ void;
+case SOROBAN_CREDENTIALS_ADDRESS:
+ SorobanAddressCredentials address;
+};
+
+/* Unit of authorization data for Soroban.
+
+ Represents an authorization for executing the tree of authorized contract
+ and/or host function calls by the user defined by `credentials`.
+*/
+struct SorobanAuthorizationEntry
+{
+ SorobanCredentials credentials;
+ SorobanAuthorizedInvocation rootInvocation;
+};
+
+/* Upload WASM, create, and invoke contracts in Soroban.
+
+ Threshold: med
+ Result: InvokeHostFunctionResult
+*/
+struct InvokeHostFunctionOp
+{
+ // Host function to invoke.
+ HostFunction hostFunction;
+ // Per-address authorizations for this host function.
+ SorobanAuthorizationEntry auth<>;
+};
+
+/* Extend the TTL of the entries specified in the readOnly footprint
+ so they will live at least extendTo ledgers from lcl.
+
+ Threshold: med
+ Result: ExtendFootprintTTLResult
+*/
+struct ExtendFootprintTTLOp
+{
+ ExtensionPoint ext;
+ uint32 extendTo;
+};
+
+/* Restore the archived entries specified in the readWrite footprint.
+
+ Threshold: med
+ Result: RestoreFootprintOp
+*/
+struct RestoreFootprintOp
+{
+ ExtensionPoint ext;
+};
+
/* An operation is the lowest unit of work that a transaction does */
struct Operation
{
@@ -523,6 +665,12 @@ struct Operation
LiquidityPoolDepositOp liquidityPoolDepositOp;
case LIQUIDITY_POOL_WITHDRAW:
LiquidityPoolWithdrawOp liquidityPoolWithdrawOp;
+ case INVOKE_HOST_FUNCTION:
+ InvokeHostFunctionOp invokeHostFunctionOp;
+ case EXTEND_FOOTPRINT_TTL:
+ ExtendFootprintTTLOp extendFootprintTTLOp;
+ case RESTORE_FOOTPRINT:
+ RestoreFootprintOp restoreFootprintOp;
}
body;
};
@@ -540,11 +688,25 @@ case ENVELOPE_TYPE_POOL_REVOKE_OP_ID:
struct
{
AccountID sourceAccount;
- SequenceNumber seqNum;
+ SequenceNumber seqNum;
uint32 opNum;
PoolID liquidityPoolID;
Asset asset;
} revokeID;
+case ENVELOPE_TYPE_CONTRACT_ID:
+ struct
+ {
+ Hash networkID;
+ ContractIDPreimage contractIDPreimage;
+ } contractID;
+case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION:
+ struct
+ {
+ Hash networkID;
+ int64 nonce;
+ uint32 signatureExpirationLedger;
+ SorobanAuthorizedInvocation invocation;
+ } sorobanAuthorization;
};
enum MemoType
@@ -632,8 +794,44 @@ case PRECOND_V2:
PreconditionsV2 v2;
};
-// maximum number of operations per transaction
-const MAX_OPS_PER_TX = 100;
+// Ledger key sets touched by a smart contract transaction.
+struct LedgerFootprint
+{
+ LedgerKey readOnly<>;
+ LedgerKey readWrite<>;
+};
+
+// Resource limits for a Soroban transaction.
+// The transaction will fail if it exceeds any of these limits.
+struct SorobanResources
+{
+ // The ledger footprint of the transaction.
+ LedgerFootprint footprint;
+ // The maximum number of instructions this transaction can use
+ uint32 instructions;
+
+ // The maximum number of bytes this transaction can read from ledger
+ uint32 readBytes;
+ // The maximum number of bytes this transaction can write to ledger
+ uint32 writeBytes;
+};
+
+// The transaction extension for Soroban.
+struct SorobanTransactionData
+{
+ ExtensionPoint ext;
+ SorobanResources resources;
+ // Amount of the transaction `fee` allocated to the Soroban resource fees.
+ // The fraction of `resourceFee` corresponding to `resources` specified
+ // above is *not* refundable (i.e. fees for instructions, ledger I/O), as
+ // well as fees for the transaction size.
+ // The remaining part of the fee is refundable and the charged value is
+ // based on the actual consumption of refundable resources (events, ledger
+ // rent bumps).
+ // The `inclusionFee` used for prioritization of the transaction is defined
+ // as `tx.fee - resourceFee`.
+ int64 resourceFee;
+};
// TransactionV0 is a transaction with the AccountID discriminant stripped off,
// leaving a raw ed25519 public key to identify the source account. This is used
@@ -695,6 +893,8 @@ struct Transaction
{
case 0:
void;
+ case 1:
+ SorobanTransactionData sorobanData;
}
ext;
};
@@ -847,7 +1047,10 @@ union CreateAccountResult switch (CreateAccountResultCode code)
{
case CREATE_ACCOUNT_SUCCESS:
void;
-default:
+case CREATE_ACCOUNT_MALFORMED:
+case CREATE_ACCOUNT_UNDERFUNDED:
+case CREATE_ACCOUNT_LOW_RESERVE:
+case CREATE_ACCOUNT_ALREADY_EXIST:
void;
};
@@ -874,7 +1077,15 @@ union PaymentResult switch (PaymentResultCode code)
{
case PAYMENT_SUCCESS:
void;
-default:
+case PAYMENT_MALFORMED:
+case PAYMENT_UNDERFUNDED:
+case PAYMENT_SRC_NO_TRUST:
+case PAYMENT_SRC_NOT_AUTHORIZED:
+case PAYMENT_NO_DESTINATION:
+case PAYMENT_NO_TRUST:
+case PAYMENT_NOT_AUTHORIZED:
+case PAYMENT_LINE_FULL:
+case PAYMENT_NO_ISSUER:
void;
};
@@ -925,9 +1136,20 @@ case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS:
ClaimAtom offers<>;
SimplePaymentResult last;
} success;
+case PATH_PAYMENT_STRICT_RECEIVE_MALFORMED:
+case PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED:
+case PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST:
+case PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED:
+case PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION:
+case PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST:
+case PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED:
+case PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL:
+ void;
case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER:
Asset noIssuer; // the asset that caused the error
-default:
+case PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS:
+case PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF:
+case PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX:
void;
};
@@ -969,9 +1191,20 @@ case PATH_PAYMENT_STRICT_SEND_SUCCESS:
ClaimAtom offers<>;
SimplePaymentResult last;
} success;
+case PATH_PAYMENT_STRICT_SEND_MALFORMED:
+case PATH_PAYMENT_STRICT_SEND_UNDERFUNDED:
+case PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST:
+case PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED:
+case PATH_PAYMENT_STRICT_SEND_NO_DESTINATION:
+case PATH_PAYMENT_STRICT_SEND_NO_TRUST:
+case PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED:
+case PATH_PAYMENT_STRICT_SEND_LINE_FULL:
+ void;
case PATH_PAYMENT_STRICT_SEND_NO_ISSUER:
Asset noIssuer; // the asset that caused the error
-default:
+case PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS:
+case PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF:
+case PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN:
void;
};
@@ -1021,7 +1254,7 @@ struct ManageOfferSuccessResult
case MANAGE_OFFER_CREATED:
case MANAGE_OFFER_UPDATED:
OfferEntry offer;
- default:
+ case MANAGE_OFFER_DELETED:
void;
}
offer;
@@ -1031,7 +1264,18 @@ union ManageSellOfferResult switch (ManageSellOfferResultCode code)
{
case MANAGE_SELL_OFFER_SUCCESS:
ManageOfferSuccessResult success;
-default:
+case MANAGE_SELL_OFFER_MALFORMED:
+case MANAGE_SELL_OFFER_SELL_NO_TRUST:
+case MANAGE_SELL_OFFER_BUY_NO_TRUST:
+case MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED:
+case MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED:
+case MANAGE_SELL_OFFER_LINE_FULL:
+case MANAGE_SELL_OFFER_UNDERFUNDED:
+case MANAGE_SELL_OFFER_CROSS_SELF:
+case MANAGE_SELL_OFFER_SELL_NO_ISSUER:
+case MANAGE_SELL_OFFER_BUY_NO_ISSUER:
+case MANAGE_SELL_OFFER_NOT_FOUND:
+case MANAGE_SELL_OFFER_LOW_RESERVE:
void;
};
@@ -1065,7 +1309,18 @@ union ManageBuyOfferResult switch (ManageBuyOfferResultCode code)
{
case MANAGE_BUY_OFFER_SUCCESS:
ManageOfferSuccessResult success;
-default:
+case MANAGE_BUY_OFFER_MALFORMED:
+case MANAGE_BUY_OFFER_SELL_NO_TRUST:
+case MANAGE_BUY_OFFER_BUY_NO_TRUST:
+case MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED:
+case MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED:
+case MANAGE_BUY_OFFER_LINE_FULL:
+case MANAGE_BUY_OFFER_UNDERFUNDED:
+case MANAGE_BUY_OFFER_CROSS_SELF:
+case MANAGE_BUY_OFFER_SELL_NO_ISSUER:
+case MANAGE_BUY_OFFER_BUY_NO_ISSUER:
+case MANAGE_BUY_OFFER_NOT_FOUND:
+case MANAGE_BUY_OFFER_LOW_RESERVE:
void;
};
@@ -1093,7 +1348,16 @@ union SetOptionsResult switch (SetOptionsResultCode code)
{
case SET_OPTIONS_SUCCESS:
void;
-default:
+case SET_OPTIONS_LOW_RESERVE:
+case SET_OPTIONS_TOO_MANY_SIGNERS:
+case SET_OPTIONS_BAD_FLAGS:
+case SET_OPTIONS_INVALID_INFLATION:
+case SET_OPTIONS_CANT_CHANGE:
+case SET_OPTIONS_UNKNOWN_FLAG:
+case SET_OPTIONS_THRESHOLD_OUT_OF_RANGE:
+case SET_OPTIONS_BAD_SIGNER:
+case SET_OPTIONS_INVALID_HOME_DOMAIN:
+case SET_OPTIONS_AUTH_REVOCABLE_REQUIRED:
void;
};
@@ -1122,7 +1386,14 @@ union ChangeTrustResult switch (ChangeTrustResultCode code)
{
case CHANGE_TRUST_SUCCESS:
void;
-default:
+case CHANGE_TRUST_MALFORMED:
+case CHANGE_TRUST_NO_ISSUER:
+case CHANGE_TRUST_INVALID_LIMIT:
+case CHANGE_TRUST_LOW_RESERVE:
+case CHANGE_TRUST_SELF_NOT_ALLOWED:
+case CHANGE_TRUST_TRUST_LINE_MISSING:
+case CHANGE_TRUST_CANNOT_DELETE:
+case CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES:
void;
};
@@ -1147,7 +1418,12 @@ union AllowTrustResult switch (AllowTrustResultCode code)
{
case ALLOW_TRUST_SUCCESS:
void;
-default:
+case ALLOW_TRUST_MALFORMED:
+case ALLOW_TRUST_NO_TRUST_LINE:
+case ALLOW_TRUST_TRUST_NOT_REQUIRED:
+case ALLOW_TRUST_CANT_REVOKE:
+case ALLOW_TRUST_SELF_NOT_ALLOWED:
+case ALLOW_TRUST_LOW_RESERVE:
void;
};
@@ -1172,7 +1448,13 @@ union AccountMergeResult switch (AccountMergeResultCode code)
{
case ACCOUNT_MERGE_SUCCESS:
int64 sourceAccountBalance; // how much got transferred from source account
-default:
+case ACCOUNT_MERGE_MALFORMED:
+case ACCOUNT_MERGE_NO_ACCOUNT:
+case ACCOUNT_MERGE_IMMUTABLE_SET:
+case ACCOUNT_MERGE_HAS_SUB_ENTRIES:
+case ACCOUNT_MERGE_SEQNUM_TOO_FAR:
+case ACCOUNT_MERGE_DEST_FULL:
+case ACCOUNT_MERGE_IS_SPONSOR:
void;
};
@@ -1196,7 +1478,7 @@ union InflationResult switch (InflationResultCode code)
{
case INFLATION_SUCCESS:
InflationPayout payouts<>;
-default:
+case INFLATION_NOT_TIME:
void;
};
@@ -1219,7 +1501,10 @@ union ManageDataResult switch (ManageDataResultCode code)
{
case MANAGE_DATA_SUCCESS:
void;
-default:
+case MANAGE_DATA_NOT_SUPPORTED_YET:
+case MANAGE_DATA_NAME_NOT_FOUND:
+case MANAGE_DATA_LOW_RESERVE:
+case MANAGE_DATA_INVALID_NAME:
void;
};
@@ -1237,7 +1522,7 @@ union BumpSequenceResult switch (BumpSequenceResultCode code)
{
case BUMP_SEQUENCE_SUCCESS:
void;
-default:
+case BUMP_SEQUENCE_BAD_SEQ:
void;
};
@@ -1258,7 +1543,11 @@ union CreateClaimableBalanceResult switch (
{
case CREATE_CLAIMABLE_BALANCE_SUCCESS:
ClaimableBalanceID balanceID;
-default:
+case CREATE_CLAIMABLE_BALANCE_MALFORMED:
+case CREATE_CLAIMABLE_BALANCE_LOW_RESERVE:
+case CREATE_CLAIMABLE_BALANCE_NO_TRUST:
+case CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED:
+case CREATE_CLAIMABLE_BALANCE_UNDERFUNDED:
void;
};
@@ -1272,14 +1561,17 @@ enum ClaimClaimableBalanceResultCode
CLAIM_CLAIMABLE_BALANCE_LINE_FULL = -3,
CLAIM_CLAIMABLE_BALANCE_NO_TRUST = -4,
CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -5
-
};
union ClaimClaimableBalanceResult switch (ClaimClaimableBalanceResultCode code)
{
case CLAIM_CLAIMABLE_BALANCE_SUCCESS:
void;
-default:
+case CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST:
+case CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM:
+case CLAIM_CLAIMABLE_BALANCE_LINE_FULL:
+case CLAIM_CLAIMABLE_BALANCE_NO_TRUST:
+case CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED:
void;
};
@@ -1301,7 +1593,9 @@ union BeginSponsoringFutureReservesResult switch (
{
case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS:
void;
-default:
+case BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED:
+case BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED:
+case BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE:
void;
};
@@ -1321,7 +1615,7 @@ union EndSponsoringFutureReservesResult switch (
{
case END_SPONSORING_FUTURE_RESERVES_SUCCESS:
void;
-default:
+case END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED:
void;
};
@@ -1344,7 +1638,11 @@ union RevokeSponsorshipResult switch (RevokeSponsorshipResultCode code)
{
case REVOKE_SPONSORSHIP_SUCCESS:
void;
-default:
+case REVOKE_SPONSORSHIP_DOES_NOT_EXIST:
+case REVOKE_SPONSORSHIP_NOT_SPONSOR:
+case REVOKE_SPONSORSHIP_LOW_RESERVE:
+case REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE:
+case REVOKE_SPONSORSHIP_MALFORMED:
void;
};
@@ -1366,7 +1664,10 @@ union ClawbackResult switch (ClawbackResultCode code)
{
case CLAWBACK_SUCCESS:
void;
-default:
+case CLAWBACK_MALFORMED:
+case CLAWBACK_NOT_CLAWBACK_ENABLED:
+case CLAWBACK_NO_TRUST:
+case CLAWBACK_UNDERFUNDED:
void;
};
@@ -1388,7 +1689,9 @@ union ClawbackClaimableBalanceResult switch (
{
case CLAWBACK_CLAIMABLE_BALANCE_SUCCESS:
void;
-default:
+case CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST:
+case CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER:
+case CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED:
void;
};
@@ -1412,7 +1715,11 @@ union SetTrustLineFlagsResult switch (SetTrustLineFlagsResultCode code)
{
case SET_TRUST_LINE_FLAGS_SUCCESS:
void;
-default:
+case SET_TRUST_LINE_FLAGS_MALFORMED:
+case SET_TRUST_LINE_FLAGS_NO_TRUST_LINE:
+case SET_TRUST_LINE_FLAGS_CANT_REVOKE:
+case SET_TRUST_LINE_FLAGS_INVALID_STATE:
+case SET_TRUST_LINE_FLAGS_LOW_RESERVE:
void;
};
@@ -1441,7 +1748,13 @@ union LiquidityPoolDepositResult switch (LiquidityPoolDepositResultCode code)
{
case LIQUIDITY_POOL_DEPOSIT_SUCCESS:
void;
-default:
+case LIQUIDITY_POOL_DEPOSIT_MALFORMED:
+case LIQUIDITY_POOL_DEPOSIT_NO_TRUST:
+case LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED:
+case LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED:
+case LIQUIDITY_POOL_DEPOSIT_LINE_FULL:
+case LIQUIDITY_POOL_DEPOSIT_BAD_PRICE:
+case LIQUIDITY_POOL_DEPOSIT_POOL_FULL:
void;
};
@@ -1467,7 +1780,78 @@ union LiquidityPoolWithdrawResult switch (LiquidityPoolWithdrawResultCode code)
{
case LIQUIDITY_POOL_WITHDRAW_SUCCESS:
void;
-default:
+case LIQUIDITY_POOL_WITHDRAW_MALFORMED:
+case LIQUIDITY_POOL_WITHDRAW_NO_TRUST:
+case LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED:
+case LIQUIDITY_POOL_WITHDRAW_LINE_FULL:
+case LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM:
+ void;
+};
+
+enum InvokeHostFunctionResultCode
+{
+ // codes considered as "success" for the operation
+ INVOKE_HOST_FUNCTION_SUCCESS = 0,
+
+ // codes considered as "failure" for the operation
+ INVOKE_HOST_FUNCTION_MALFORMED = -1,
+ INVOKE_HOST_FUNCTION_TRAPPED = -2,
+ INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3,
+ INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED = -4,
+ INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5
+};
+
+union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code)
+{
+case INVOKE_HOST_FUNCTION_SUCCESS:
+ Hash success; // sha256(InvokeHostFunctionSuccessPreImage)
+case INVOKE_HOST_FUNCTION_MALFORMED:
+case INVOKE_HOST_FUNCTION_TRAPPED:
+case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED:
+case INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED:
+case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE:
+ void;
+};
+
+enum ExtendFootprintTTLResultCode
+{
+ // codes considered as "success" for the operation
+ EXTEND_FOOTPRINT_TTL_SUCCESS = 0,
+
+ // codes considered as "failure" for the operation
+ EXTEND_FOOTPRINT_TTL_MALFORMED = -1,
+ EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED = -2,
+ EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE = -3
+};
+
+union ExtendFootprintTTLResult switch (ExtendFootprintTTLResultCode code)
+{
+case EXTEND_FOOTPRINT_TTL_SUCCESS:
+ void;
+case EXTEND_FOOTPRINT_TTL_MALFORMED:
+case EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED:
+case EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE:
+ void;
+};
+
+enum RestoreFootprintResultCode
+{
+ // codes considered as "success" for the operation
+ RESTORE_FOOTPRINT_SUCCESS = 0,
+
+ // codes considered as "failure" for the operation
+ RESTORE_FOOTPRINT_MALFORMED = -1,
+ RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED = -2,
+ RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3
+};
+
+union RestoreFootprintResult switch (RestoreFootprintResultCode code)
+{
+case RESTORE_FOOTPRINT_SUCCESS:
+ void;
+case RESTORE_FOOTPRINT_MALFORMED:
+case RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED:
+case RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE:
void;
};
@@ -1537,9 +1921,20 @@ case opINNER:
LiquidityPoolDepositResult liquidityPoolDepositResult;
case LIQUIDITY_POOL_WITHDRAW:
LiquidityPoolWithdrawResult liquidityPoolWithdrawResult;
+ case INVOKE_HOST_FUNCTION:
+ InvokeHostFunctionResult invokeHostFunctionResult;
+ case EXTEND_FOOTPRINT_TTL:
+ ExtendFootprintTTLResult extendFootprintTTLResult;
+ case RESTORE_FOOTPRINT:
+ RestoreFootprintResult restoreFootprintResult;
}
tr;
-default:
+case opBAD_AUTH:
+case opNO_ACCOUNT:
+case opNOT_SUPPORTED:
+case opTOO_MANY_SUBENTRIES:
+case opEXCEEDED_WORK_LIMIT:
+case opTOO_MANY_SPONSORING:
void;
};
@@ -1562,12 +1957,12 @@ enum TransactionResultCode
txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction
txINTERNAL_ERROR = -11, // an unknown error occurred
- txNOT_SUPPORTED = -12, // transaction type not supported
- txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed
- txBAD_SPONSORSHIP = -14, // sponsorship not confirmed
- txBAD_MIN_SEQ_AGE_OR_GAP =
- -15, // minSeqAge or minSeqLedgerGap conditions not met
- txMALFORMED = -16 // precondition is invalid
+ txNOT_SUPPORTED = -12, // transaction type not supported
+ txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed
+ txBAD_SPONSORSHIP = -14, // sponsorship not confirmed
+ txBAD_MIN_SEQ_AGE_OR_GAP = -15, // minSeqAge or minSeqLedgerGap conditions not met
+ txMALFORMED = -16, // precondition is invalid
+ txSOROBAN_INVALID = -17 // soroban-specific preconditions were not met
};
// InnerTransactionResult must be binary compatible with TransactionResult
@@ -1598,6 +1993,7 @@ struct InnerTransactionResult
case txBAD_SPONSORSHIP:
case txBAD_MIN_SEQ_AGE_OR_GAP:
case txMALFORMED:
+ case txSOROBAN_INVALID:
void;
}
result;
@@ -1629,7 +2025,22 @@ struct TransactionResult
case txSUCCESS:
case txFAILED:
OperationResult results<>;
- default:
+ case txTOO_EARLY:
+ case txTOO_LATE:
+ case txMISSING_OPERATION:
+ case txBAD_SEQ:
+ case txBAD_AUTH:
+ case txINSUFFICIENT_BALANCE:
+ case txNO_ACCOUNT:
+ case txINSUFFICIENT_FEE:
+ case txBAD_AUTH_EXTRA:
+ case txINTERNAL_ERROR:
+ case txNOT_SUPPORTED:
+ // case txFEE_BUMP_INNER_FAILED: handled above
+ case txBAD_SPONSORSHIP:
+ case txBAD_MIN_SEQ_AGE_OR_GAP:
+ case txMALFORMED:
+ case txSOROBAN_INVALID:
void;
}
result;
diff --git a/base/xdr/Stellar-types.x b/base/xdr/Stellar-types.x
index c3a1ebe2..d71bf0d4 100644
--- a/base/xdr/Stellar-types.x
+++ b/base/xdr/Stellar-types.x
@@ -14,6 +14,9 @@ typedef int int32;
typedef unsigned hyper uint64;
typedef hyper int64;
+typedef uint64 TimePoint;
+typedef uint64 Duration;
+
// An ExtensionPoint is always marshaled as a 32-bit 0 value. At a
// later point, it can be replaced by a different union so as to
// extend a structure.
@@ -79,6 +82,7 @@ typedef opaque Signature<64>;
typedef opaque SignatureHint[4];
typedef PublicKey NodeID;
+typedef PublicKey AccountID;
struct Curve25519Secret
{