package
0.0.0-20250213232608-c453f8b35c75
Repository: https://github.com/stellar/go.git
Documentation: pkg.go.dev
# Functions
Convert serializes the given goxdr value into another destination value which supports binary unmarshaling.
Dump serializes the given goxdr value into binary.
# Constants
can't add source balance to.
account has trust lines/offers.
source account has AUTH_IMMUTABLE set.
destination balance.
can't merge onto itself.
destination does not exist.
sequence number is over max allowed.
codes considered as "success" for the operation.
source account can't revoke trust,.
claimable balances can't be created.
asset is not ASSET_TYPE_ALPHANUM.
trustor does not have a trustline.
trusting self is not allowed.
codes considered as "success" for the operation.
source account does not require trust.
Trustlines are created with clawback enabled set to "true", and claimable balances created from those trustlines are created with clawback enabled set to "true".
Once set, causes all AUTH_* flags to be read-only.
During the roll-out phrase, nodes can disable flow control in bytes.
Flags set on issuer accounts TrustLines are created with authorized set to "false" requiring the issuer to set it for each TrustLine.
If set, the authorized flag in TrustLines can be cleared otherwise, authorization cannot be revoked.
issuer has authorized account to perform transactions with its credit.
issuer has authorized account to maintain and reduce liabilities for its credit.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
Cost of decoding a BLS12-381 Fp (base field element).
Cost of encoding a BLS12-381 Fp (base field element).
Cost of performing BLS12-381 scalar element addition/subtraction.
Cost of converting a BLS12-381 scalar element from U256.
Cost of performing BLS12-381 scalar element inversion.
Cost of performing BLS12-381 scalar element multiplication.
Cost of performing BLS12-381 scalar element exponentiation.
Cost of converting a BLS12-381 scalar element to U256.
Cost of performing BLS12-381 G1 point addition.
Cost of checking a G1 point belongs to the correct subgroup.
Cost of checking a G1 point lies on the curve.
Cost of performing BLS12-381 G1 multi-scalar multiplication (MSM).
Cost of performing BLS12-381 G1 scalar multiplication.
Cost of converting a BLS12-381 G1 point from projective to affine coordinates.
Cost of performing BLS12-381 G2 point addition.
Cost of checking a G2 point belongs to the correct subgroup.
Cost of checking a G2 point lies on the curve.
Cost of performing BLS12-381 G2 multi-scalar multiplication (MSM).
Cost of performing BLS12-381 G2 scalar multiplication.
Cost of converting a BLS12-381 G2 point from projective to affine coordinates.
Cost of hashing to a BLS12-381 G1 point.
Cost of hashing to a BLS12-381 G2 point.
Cost of mapping a BLS12-381 Fp2 field element to a G2 point.
Cost of mapping a BLS12-381 Fp field element to a G1 point.
Cost of performing BLS12-381 pairing operation.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
Cost of drawing random bytes using a ChaCha20 PRNG.
Asset trustline is still referenced in a pool.
cannot drop limit below balance.
not enough funds to create a new trust line,.
bad input.
could not find issuer.
Asset trustline is deauthorized.
trusting self is not allowed.
codes considered as "success" for the operation.
Asset trustline is missing for pool.
If set, the issuer account of the asset held by the claimable balance may clawback the claimable balance.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
Full LedgerEntry that was archived during the epoch.
Dummy leaf representing low/high bound.
LedgerKey that was deleted during the epoch.
Intermediary Merkle hash entry.
Bucket metadata, should come first.
Cost of computing the ed25519 pubkey from bytes.
Cost of computing a keccak256 hash from bytes.
Cost of computing the sha256 hash from bytes.
limits the ContractCostParams size to 20kB.
account already exists.
would create an account below the min reserve.
invalid destination.
account was created.
not enough funds in source account.
At-and-after protocol 11: only updated.
Cost of decoding an ECDSA signature computed from a 256-bit prime modulus curve (e.g.
Cost of a host function dispatch, not including the actual work done by the function nor the cost of VM invocation machinary.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
Authentication failure.
Misconfiguration error.
Malformed data.
System overloaded.
Unspecific error.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
gets a list of peers this guy knows about.
SCP.
gets a particular txset by hash.
new messages.
Entry is Archived.
has been added back to the live BucketList.
Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but.
Bucket metadata, should come first.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
At-and-after protocol 11: only created.
Cost of instantiating a known number of data segment bytes.
Cost of instantiating a known number of wasm data segments.
Cost of instantiating a known number of wasm element segments.
Cost of instantiating a known number of wasm exports.
Cost of instantiating a known number of wasm functions.
Cost of instantiating a known number of wasm globals.
Cost of instantiating a known number of wasm imports.
Cost of instantiating wasm bytes that only encode instructions.
Cost of instantiating a known number of wasm table entries.
Cost of instantiating a known number of wasm types.
Cost of int256 addition (`+`) and subtraction (`-`) operations.
Cost of int256 division (`/`) operation.
Cost of int256 multiplication (`*`) operation.
Cost of int256 power (`exp`) operation.
Cost of int256 shift (`shl`, `shr`) operation.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
Cost of invoking a function on the VM.
MUXED enum values for supported type are derived from the enum values above by ORing them with 0x100.
entry was added to the ledger.
entry was removed from the ledger.
value of the entry.
entry was modified in the ledger.
deposit price outside bounds.
pool share trust line doesn't.
bad input.
no trust line for one of the.
not authorized for one of the.
pool reserves are full.
codes considered as "success" for the operation.
not enough balance for one of.
would go above limit for one.
bad input.
no trust line for one of the.
codes considered as "success" for the operation.
of the assets.
not enough balance of the.
Before protocol 11: created-or-updated;.
no issuer for what we're buying.
no trust line for what we're buying.
not authorized to buy.
would cross an offer from the same user.
can't receive more of what it's buying.
not enough funds to create a new Offer.
generated offer would be invalid.
offerID does not match an existing offer.
no issuer for what we're selling.
no trust line for what we're selling.
not authorized to sell.
codes considered as "success" for the operation.
doesn't hold what it's trying to sell.
Name not a valid string.
not enough funds to create a new Data Entry.
Trying to remove a Data Entry that isn't there.
The network hasn't moved to this protocol change yet.
codes considered as "success" for the operation.
no issuer for what we're buying.
no trust line for what we're buying.
not authorized to buy.
would cross an offer from the same user.
can't receive more of what it's buying.
not enough funds to create a new Offer.
generated offer would be invalid.
offerID does not match an existing offer.
no issuer for what we're selling.
no trust line for what we're selling.
not authorized to sell.
codes considered as "success" for the operation.
doesn't hold what it's trying to sell.
mask for all valid flags.
Mask for OfferEntry flags.
mask for all trustline flags.
maximum number of operations per transaction.
maximum number of signers.
Cost of allocating a slice of memory (in bytes).
Cost of comparing two slices of memory.
Cost of copying a slice of bytes into a pre-allocated memory.
At-and-after protocol 11: bucket metadata, should come first.
too few valid signatures / wrong network.
operation did too much work.
inner object result is valid.
source account was not found.
operation not supported at this time.
account is sponsoring too many entries.
max number of subentries already reached.
Cost of parsing a known number of data segment bytes.
Cost of parsing a known number of wasm data segments.
Cost of parsing a known number of wasm element segments.
Cost of parsing a known number of wasm exports.
Cost of parsing a known number of wasm functions.
Cost of parsing a known number of wasm globals.
Cost of parsing a known number of wasm imports.
Cost of parsing wasm bytes that only encode instructions.
Cost of parsing a known number of wasm table entries.
Cost of parsing a known number of wasm types.
an offer with this flag will not act on and take a reverse offer of equal price.
dest would go above their limit.
bad input.
destination account does not exist.
missing issuer on one asset.
dest missing a trust line for asset.
dest not authorized to hold asset.
would cross one of its own offers.
could not satisfy sendmax.
no trust line on source account.
source not authorized to transfer.
success.
not enough offers to satisfy path.
not enough funds in source account.
dest would go above their limit.
bad input.
destination account does not exist.
missing issuer on one asset.
dest missing a trust line for asset.
dest not authorized to hold asset.
would cross one of its own offers.
no trust line on source account.
source not authorized to transfer.
success.
not enough offers to satisfy path.
could not satisfy destMin.
not enough funds in source account.
destination would go above their limit.
bad input.
destination account does not exist.
missing issuer on asset.
destination missing a trust line for asset.
destination not authorized to hold asset.
no trust line on source account.
source not authorized to transfer.
payment successfully completed.
not enough funds in source account.
Cost of recovering an ECDSA secp256k1 key from a signature.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
Types with no parameters.
Types with parameters.
User defined types.
Errors from the authentication subsystem.
Errors relating to budget limits.
Errors in the contract's host context.
Contract-specific, user-defined codes.
Errors in cryptographic operations.
Errors while emitting events.
Errors working with host objects.
Errors accessing host storage.
Errors working with host values or SCVals.
Errors while interpreting WASM bytecode.
Some arithmetic was undefined (overflow, divide-by-zero).
Some arbitrary limit -- gas or otherwise -- was hit.
Some value was provided where not allowed.
Something was indexed beyond its bounds.
The host detected an error in its own logic.
Data was valid but action requested was not.
User provided some otherwise-bad data.
Some value was required but not provided.
Something's size wasn't as expected.
Some type wasn't as expected.
Address is the universal identifier for contracts and classic accounts.
Bytes come in 3 flavors, 2 of which have meaningfully different formatting and validity-checking / domain-restriction.
The following are the internal SCVal variants that are not exposed to the contracts.
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.
Time-related u64 subtypes with their own functions and formatting.
128 bits is naturally supported by Rust and we use it for Soroban fixed-point arithmetic prices / balances / similar "quantities".
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.
32 bits is the smallest type in WASM or XDR; no need for u8/u16.
64 bits is naturally supported by both WASM and XDR also.
Vecs and maps are just polymorphic containers of other ScVals.
Cost of decoding a bytes array representing an uncompressed SEC-1 encoded point on a 256-bit elliptic curve.
auth revocable is required for clawback.
invalid combination of clear/set flags.
signer cannot be masterkey.
can no longer change this option.
malformed home domain.
inflation account does not exist.
not enough funds to add a signer.
codes considered as "success" for the operation.
bad value for weight/threshold.
max number of signers already reached.
can't set an unknown flag.
claimable balances can't be created.
codes considered as "failure" for the operation.
codes considered as "success" for the operation.
pass on a tx you have heard about.
issuer has specified that it may clawback its credit, and that claimable balances created with its credit may also be clawed back.
too few valid signatures / wrong network.
unused signatures attached to transaction.
minSeqAge or minSeqLedgerGap conditions not met.
sequence number does not match source account.
sponsorship not confirmed.
one of the operations failed (none were applied).
fee bump inner transaction failed.
fee bump inner transaction succeeded.
fee would bring account below reserve.
fee is too small.
an unknown error occurred.
precondition is invalid.
no operation was specified.
source account not found.
transaction type not supported.
txs with effective fee <= bid derived from a base fee (if any).
soroban-specific preconditions were not met.
all operations succeeded.
ledger closeTime before minTime.
ledger closeTime after maxTime.
Cost of deserializing an xdr object from bytes.
Cost of serializing an xdr object to bytes.
Cost of verifying an ECDSA Secp256r1 signature.
Cost of verifying ed25519 signature of a payload.
Cost of visiting a host object from the host object storage.
Cost of instantiation a VM from a cached state.
Cost of instantiation a VM from wasm bytes code.
Cost of running 1 wasm instruction.
# Structs
AccountEntry
Main entry representing a user in Stellar.
Updates the "authorized" flag of an existing trust line
this is called by the issuer of the related asset.
BeginSponsoringFutureReserves
Establishes the is-sponsoring-future-reserves-for relationship between
the source account and sponsoredID
Threshold: med
Result: BeginSponsoringFutureReservesResult
*/.
Bump Sequence
increases the sequence to a given level
Threshold: low
Result: BumpSequenceResult
*/.
Creates, updates or deletes a trust line
Threshold: med
Result: ChangeTrustResult
*/.
This result is used when offers are taken or liquidity is exchanged with a
liquidity pool during an operation
*/.
Claims a claimable balance entry
Threshold: low
Result: ClaimClaimableBalanceResult
*/.
ClaimOfferAtomV0 is a ClaimOfferAtom with the AccountID discriminant stripped off, leaving a raw ed25519 public key to identify the source account.
Claws back a claimable balance
Threshold: med
Result: ClawbackClaimableBalanceResult
*/.
Claws back an amount of an asset from an account
Threshold: med
Result: ClawbackResult
*/.
Bandwidth related data settings for contracts.
"Compute" settings for contracts (instructions and memory).
Contract event-related settings.
General “Soroban execution lane” settings.
Historical data (pushed to core archives) settings for contracts.
Ledger access settings for contracts.
CreateAccount
Creates and funds a new account with the specified starting balance.
Creates a claimable balance entry
Threshold: med
Result: CreateClaimableBalanceResult
*/.
Creates an offer that doesn't take offers of the same price
Threshold: med
Result: CreatePassiveSellOfferResult
*/.
DataEntry
Data can be attached to accounts.
Extend the TTL of the entries specified in the readOnly footprint
so they will live at least extendTo ledgers from lcl.
An ExtensionPoint is always marshaled as a 32-bit 0 value.
InnerTransactionResult must be binary compatible with TransactionResult because it is be used to represent the result of a Transaction.
A signed int128 has a high sign bit and 127 value bits.
A signed int256 has a high sign bit and 255 value bits.
Upload Wasm, create, and invoke contracts in Soroban.
This is in Stellar-ledger.x to due to a circular dependency.
Batch of ledgers along with their transaction metadata.
Ledger key sets touched by a smart contract transaction.
The LedgerHeader is the highest level structure representing the
* state of a ledger, cryptographically linked to previous ledgers.
Deposit assets into a liquidity pool
Threshold: med
Result: LiquidityPoolDepositResult
*/.
Withdraw assets from a liquidity pool
Threshold: med
Result: LiquidityPoolWithdrawResult
*/.
Creates, updates or deletes an offer with amount in terms of buying asset
Threshold: med
Result: ManageBuyOfferResult
*/.
ManageData
Adds, Updates, or Deletes a key value pair associated with a particular
account.
Creates, updates or deletes an offer
Threshold: med
Result: ManageSellOfferResult
*/.
Source or destination of a payment operation.
OfferEntry
An offer is the building block of the offer book, they are automatically
claimed by payments when the price set by the owner is met.
An operation is the lowest unit of work that a transaction does */.
PathPaymentStrictReceive
send an amount to a destination account through a path.
PathPaymentStrictSend
send an amount to a destination account through a path.
Payment
Send an amount in specified asset to a destination account.
price in fractional representation.
Restore the archived entries specified in the readWrite footprint.
SCP history file is an array of these.
note: ledgerMessages may refer to any quorumSets encountered in the file so far, not just the one from this entry.
supports things like: A,B,C,(D,E,F),(G,H,(I,J,K,L)) only allows 2 levels of nesting.
Set Account Options
updates "AccountEntry" fields.
SetTrustLineFlagsOp
Updates the flags of an existing trust line.
Unit of authorization data for Soroban.
Resource limits for a Soroban transaction.
The transaction extension for Soroban.
StellarValue is the value used by SCP to reach consensus on a given ledger
*/.
a transaction is a container for a set of operations
- is executed by an account
- fees are collected from the account
- operations are executed in order as one ACID transaction
either all operations are applied or none are
if any returns a failing code
*/.
A TransactionEnvelope wraps a transaction with signatures.
this is the meta produced when applying transactions it does not include pre-apply updates such as fees.
This struct groups together changes on a per transaction basis note however that fees and transaction application are done in separate phases.
TransactionResultSet is used to recover results between ledgers.
Transaction sets are the unit used by SCP to decide on transitions between ledgers.
TransactionV0 is a transaction with the AccountID discriminant stripped off, leaving a raw ed25519 public key to identify the source account.
this represents a single upgrade that was performed as part of a ledger upgrade.
reserved for future use.
reserved for future use.
reserved for future use.
reserved for future use.
reserved for future use.
reserved for future use.
reserved for future use.
reserved for future use.
reserved for future use.
reserved for future use.
reserved for future use.
when v != 0, txSet must be empty.
reserved for future use.
reserved for future use.
reserved for future use.
# Type aliases
5-12 alphanumeric characters right-padded with 0 bytes.
1-4 alphanumeric characters right-padded with 0 bytes.
Entries used to define the bucket list */.
Identifiers of all the network settings.
list of all envelope types used in the application those are prefixes used when building signatures for the respective envelopes.
Ledger upgrades
note that the `upgrades` field from StellarValue is normalized such that
it only contains one entry per LedgerUpgradeType, and entries are sorted
in ascending order
*/.
Next ID: 21.
High level Operation Result */.
SHA256(LiquidityPoolParameters).
RevokeSponsorship
If source account is not sponsored or is sponsored by the owner of the
specified entry or sub-entry, then attempt to revoke the sponsorship.
variable size as the size depends on the signature scheme used.
the 'Thresholds' type is packed uint8_t values defined by these indexes.