Enum Class SCValType

java.lang.Object
java.lang.Enum<SCValType>
org.stellar.sdk.xdr.SCValType
All Implemented Interfaces:
Serializable, Comparable<SCValType>, Constable

public enum SCValType extends Enum<SCValType>
SCValType's original definition in the XDR file is:
 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 Constant Details

    • SCV_BOOL

      public static final SCValType SCV_BOOL
    • SCV_VOID

      public static final SCValType SCV_VOID
    • SCV_ERROR

      public static final SCValType SCV_ERROR
    • SCV_U32

      public static final SCValType SCV_U32
    • SCV_I32

      public static final SCValType SCV_I32
    • SCV_U64

      public static final SCValType SCV_U64
    • SCV_I64

      public static final SCValType SCV_I64
    • SCV_TIMEPOINT

      public static final SCValType SCV_TIMEPOINT
    • SCV_DURATION

      public static final SCValType SCV_DURATION
    • SCV_U128

      public static final SCValType SCV_U128
    • SCV_I128

      public static final SCValType SCV_I128
    • SCV_U256

      public static final SCValType SCV_U256
    • SCV_I256

      public static final SCValType SCV_I256
    • SCV_BYTES

      public static final SCValType SCV_BYTES
    • SCV_STRING

      public static final SCValType SCV_STRING
    • SCV_SYMBOL

      public static final SCValType SCV_SYMBOL
    • SCV_VEC

      public static final SCValType SCV_VEC
    • SCV_MAP

      public static final SCValType SCV_MAP
    • SCV_ADDRESS

      public static final SCValType SCV_ADDRESS
    • SCV_CONTRACT_INSTANCE

      public static final SCValType SCV_CONTRACT_INSTANCE
    • SCV_LEDGER_KEY_CONTRACT_INSTANCE

      public static final SCValType SCV_LEDGER_KEY_CONTRACT_INSTANCE
    • SCV_LEDGER_KEY_NONCE

      public static final SCValType SCV_LEDGER_KEY_NONCE
  • Method Details

    • values

      public static SCValType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SCValType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
    • decode

      public static SCValType decode(XdrDataInputStream stream) throws IOException
      Throws:
      IOException
    • encode

      public void encode(XdrDataOutputStream stream) throws IOException
      Throws:
      IOException
    • fromXdrBase64

      public static SCValType fromXdrBase64(String xdr) throws IOException
      Throws:
      IOException
    • fromXdrByteArray

      public static SCValType fromXdrByteArray(byte[] xdr) throws IOException
      Throws:
      IOException
    • toXdrBase64

      default String toXdrBase64() throws IOException
      Throws:
      IOException
    • toXdrByteArray

      default byte[] toXdrByteArray() throws IOException
      Throws:
      IOException