xdr

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0, Apache-2.0 Imports: 29 Imported by: 152

README

xdr

The xdr package contains encoding/decoding of Stellar XDR types.

Code Generate

Most of the code this package is generated.

To download new XDR for code generation:

docker run --platform linux/amd64 -it --rm -v $PWD:/wd -w /wd ruby /bin/bash -c 'bundle install && bundle exec rake xdr:download'

To regenerate the code from the local XDR:

docker run --platform linux/amd64 -it --rm -v $PWD:/wd -w /wd ruby /bin/bash -c 'bundle install && bundle exec rake xdr:generate' && go fmt ./xdr

To download XDR for a different branch of stellar-core, modify Rakefile in the root.

Documentation

Overview

Package xdr contains the generated code for parsing the xdr structures used for stellar.

Package xdr is generated from:

xdr/Stellar-SCP.x
xdr/Stellar-contract-config-setting.x
xdr/Stellar-contract-env-meta.x
xdr/Stellar-contract-meta.x
xdr/Stellar-contract-spec.x
xdr/Stellar-contract.x
xdr/Stellar-exporter.x
xdr/Stellar-internal.x
xdr/Stellar-ledger-entries.x
xdr/Stellar-ledger.x
xdr/Stellar-overlay.x
xdr/Stellar-transaction.x
xdr/Stellar-types.x

DO NOT EDIT or your changes may be overwritten

Code generated by xdrgen. DO NOT EDIT.

Index

Examples

Constants

View Source
const AuthMsgFlagFlowControlBytesRequested = 200

AuthMsgFlagFlowControlBytesRequested is an XDR Const defines as:

const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED = 200;
View Source
const ContractCostCountLimit = 1024

ContractCostCountLimit is an XDR Const defines as:

const CONTRACT_COST_COUNT_LIMIT = 1024;
View Source
const DefaultMaxXDRStreamRecordSize = 64 * 1024 * 1024 // 64 MB
View Source
const LiquidityPoolFeeV18 = 30

LiquidityPoolFeeV18 is an XDR Const defines as:

const LIQUIDITY_POOL_FEE_V18 = 30;
View Source
const MaskAccountFlags = 0x7

MaskAccountFlags is an XDR Const defines as:

const MASK_ACCOUNT_FLAGS = 0x7;
View Source
const MaskAccountFlagsV17 = 0xF

MaskAccountFlagsV17 is an XDR Const defines as:

const MASK_ACCOUNT_FLAGS_V17 = 0xF;
View Source
const MaskClaimableBalanceFlags = 0x1

MaskClaimableBalanceFlags is an XDR Const defines as:

const MASK_CLAIMABLE_BALANCE_FLAGS = 0x1;
View Source
const MaskLedgerHeaderFlags = 0x7

MaskLedgerHeaderFlags is an XDR Const defines as:

const MASK_LEDGER_HEADER_FLAGS = 0x7;
View Source
const MaskOfferentryFlags = 1

MaskOfferentryFlags is an XDR Const defines as:

const MASK_OFFERENTRY_FLAGS = 1;
View Source
const MaskTrustlineFlags = 1

MaskTrustlineFlags is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS = 1;
View Source
const MaskTrustlineFlagsV13 = 3

MaskTrustlineFlagsV13 is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS_V13 = 3;
View Source
const MaskTrustlineFlagsV17 = 7

MaskTrustlineFlagsV17 is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS_V17 = 7;
View Source
const MaxOpsPerTx = 100

MaxOpsPerTx is an XDR Const defines as:

const MAX_OPS_PER_TX = 100;
View Source
const MaxSigners = 20

MaxSigners is an XDR Const defines as:

const MAX_SIGNERS = 20;
View Source
const ScSpecDocLimit = 1024

ScSpecDocLimit is an XDR Const defines as:

const SC_SPEC_DOC_LIMIT = 1024;
View Source
const ScsymbolLimit = 32

ScsymbolLimit is an XDR Const defines as:

const SCSYMBOL_LIMIT = 32;
View Source
const TxAdvertVectorMaxSize = 1000

TxAdvertVectorMaxSize is an XDR Const defines as:

const TX_ADVERT_VECTOR_MAX_SIZE = 1000;
View Source
const TxDemandVectorMaxSize = 1000

TxDemandVectorMaxSize is an XDR Const defines as:

const TX_DEMAND_VECTOR_MAX_SIZE = 1000;

Variables

View Source
var AssetTypeToString = map[AssetType]string{
	AssetTypeAssetTypeNative:           "native",
	AssetTypeAssetTypeCreditAlphanum4:  "credit_alphanum4",
	AssetTypeAssetTypeCreditAlphanum12: "credit_alphanum12",
}

AssetTypeToString maps an xdr.AssetType to its string representation

View Source
var CommitHash string

CommitHash is the commit hash that was used to generate the xdr in this folder. During the process of updating the XDR, the text file below is being updated. Then, during compile time, the file content are being embedded into the given string.

View Source
var ErrMaxDecodingDepthReached = errors.New("maximum decoding depth reached")
View Source
var ErrRecordTooLarge = errors.New("xdr record too large")
View Source
var LedgerEntryTypeMap = ledgerEntryTypeMap
View Source
var LiquidityPoolTypeToString = map[LiquidityPoolType]string{
	LiquidityPoolTypeLiquidityPoolConstantProduct: "constant_product",
}

LiquidityPoolTypeToString maps an xdr.LiquidityPoolType to its string representation

View Source
var OperationTypeToStringMap = operationTypeMap
View Source
var StringToAssetType = map[string]AssetType{
	"native":            AssetTypeAssetTypeNative,
	"credit_alphanum4":  AssetTypeAssetTypeCreditAlphanum4,
	"credit_alphanum12": AssetTypeAssetTypeCreditAlphanum12,
}

StringToAssetType maps an strings to its xdr.AssetType representation

View Source
var ValidAssetCode = regexp.MustCompile("^[[:alnum:]]{1,12}$")
View Source
var XdrFilesSHA256 = map[string]string{
	"xdr/Stellar-SCP.x":                     "6aed428fb6c2d000f5bc1eef0ba685d6108f3faa96208ffa588c0e2990813939",
	"xdr/Stellar-contract-config-setting.x": "a034a3eb4d8b94f5c4c573fe14a1afc548aa316e1e897aa70e5a1688aada3c77",
	"xdr/Stellar-contract-env-meta.x":       "75a271414d852096fea3283c63b7f2a702f2905f78fc28eb60ec7d7bd366a780",
	"xdr/Stellar-contract-meta.x":           "f01532c11ca044e19d9f9f16fe373e9af64835da473be556b9a807ee3319ae0d",
	"xdr/Stellar-contract-spec.x":           "7d99679155f6ce029f4f2bd8e1bf09524ef2f3e4ca8973265085cfcfdbdae987",
	"xdr/Stellar-contract.x":                "a59c25f38b4705ae149a8f049eb686f6018712d792b9207318a644ea5b5f52b5",
	"xdr/Stellar-exporter.x":                "a00c83d02e8c8382e06f79a191f1fb5abd097a4bbcab8481c67467e3270e0529",
	"xdr/Stellar-internal.x":                "227835866c1b2122d1eaf28839ba85ea7289d1cb681dda4ca619c2da3d71fe00",
	"xdr/Stellar-ledger-entries.x":          "65a24350a69f0d1c74c0dce61a68db2a657611ad9318cb2736860fd99a2db020",
	"xdr/Stellar-ledger.x":                  "6bce772b73dba183dae8f87da2a5d97fb0d36ad3695aec5edd21b1d4e5c0dc55",
	"xdr/Stellar-overlay.x":                 "8c9b9c13c86fa4672f03d741705b41e7221be0fc48e1ea6eeb1ba07d31ec0723",
	"xdr/Stellar-transaction.x":             "8f7accb9d9e0c077e6c5b43fc32eb06badb1cd3e6e10733387836dd8804ce89f",
	"xdr/Stellar-types.x":                   "3ba2eb53dad5c7f4f10441d1af7a95778bf31bbbbe2a802ddc3b981910d7c397",
}

XdrFilesSHA256 is the SHA256 hashes of source files.

Functions

func Equals

func Equals(a, b encoding.BinaryMarshaler) (bool, error)

func Marshal

func Marshal(w io.Writer, v interface{}) (int, error)

Marshal writes an xdr element `v` into `w`.

func MarshalBase64

func MarshalBase64(v interface{}) (string, error)

func MarshalFramed

func MarshalFramed(w io.Writer, v interface{}) error

func MarshalHex

func MarshalHex(v interface{}) (string, error)

func ReadFrameLength

func ReadFrameLength(r io.Reader) (uint32, error)

ReadFrameLength reads and returns the payload length from a framed XDR stream.

func SafeUnmarshal

func SafeUnmarshal(data []byte, dest interface{}) error

SafeUnmarshal decodes the provided reader into the destination and verifies that provided bytes are all consumed by the unmarshaling process.

func SafeUnmarshalBase64

func SafeUnmarshalBase64(data string, dest interface{}) error

SafeUnmarshalBase64 first decodes the provided reader from base64 before decoding the xdr into the provided destination. Also ensures that the reader is fully consumed.

func SafeUnmarshalBase64WithOptions added in v0.3.0

func SafeUnmarshalBase64WithOptions(data string, dest interface{}, opts DecodeOptions) error

SafeUnmarshalBase64WithOptions is like SafeUnmarshalBase64 but accepts additional decode options (e.g. MaxMemoryBytes). MaxInputLen is always overridden to match the input size. If MaxDepth is zero, it defaults to DecodeDefaultMaxDepth.

func SafeUnmarshalHex

func SafeUnmarshalHex(data string, dest interface{}) error

SafeUnmarshalHex first decodes the provided reader from hex before decoding the xdr into the provided destination. Also ensures that the reader is fully consumed.

func Try added in v0.6.0

func Try[T any](fn func() T) (result T, err error)

Try calls fn and recovers any *ViewError panic as an error return. Non-ViewError panics are re-panicked. Must methods must be called in the same goroutine as Try — panics in spawned goroutines are not caught.

func TryVoid added in v0.6.0

func TryVoid(fn func()) (err error)

TryVoid calls fn and recovers any *ViewError panic as an error return.

func Unmarshal

func Unmarshal(r io.Reader, v interface{}) (int, error)

Unmarshal reads an xdr element from `r` into `v`.

Example

ExampleUnmarshal shows the lowest-level process to decode a base64 envelope encoded in base64.

data := "AAAAAgAAAABi/B0L0JGythwN1lY0aypo19NHxvLCyO5tBEcCVvwF9wAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAK6jei3jmoI8TGlD/egc37PXtHKKzWV8wViZBaCu5L5MAAAAADuaygAAAAAAAAAAAVb8BfcAAABACmeyD4/+Oj7llOmTrcjKLHLTQJF0TV/VggCOUZ30ZPgMsQy6A2T//Zdzb7MULVo/Y7kDrqAZRS51rvIp7YMUAA=="

rawr := strings.NewReader(data)
b64r := base64.NewDecoder(base64.StdEncoding, rawr)

var tx TransactionEnvelope
bytesRead, err := Unmarshal(b64r, &tx)

fmt.Printf("read %d bytes\n", bytesRead)

if err != nil {
	log.Fatal(err)
}

operations := tx.Operations()
fmt.Printf("This tx has %d operations\n", len(operations))
Output:
read 196 bytes
This tx has 1 operations

func UnmarshalWithOptions

func UnmarshalWithOptions(r io.Reader, v interface{}, options xdr.DecodeOptions) (int, error)

UnmarshalWithOptions works like Unmarshal but uses decoding options.

Types

type AccountEntry

type AccountEntry struct {
	AccountId     AccountId
	Balance       Int64
	SeqNum        SequenceNumber
	NumSubEntries Uint32
	InflationDest *AccountId
	Flags         Uint32
	HomeDomain    String32
	Thresholds    Thresholds
	Signers       []Signer `xdrmaxsize:"20"`
	Ext           AccountEntryExt
}

AccountEntry is an XDR Struct defines as:

struct AccountEntry
 {
     AccountID accountID;      // master public key for this account
     int64 balance;            // in stroops
     SequenceNumber seqNum;    // last sequence number used for this account
     uint32 numSubEntries;     // number of sub-entries this account has
                               // drives the reserve
     AccountID* inflationDest; // Account to vote for during inflation
     uint32 flags;             // see AccountFlags

     string32 homeDomain; // can be used for reverse federation and memo lookup

     // fields used for signatures
     // thresholds stores unsigned bytes: [weight of master|low|medium|high]
     Thresholds thresholds;

     Signer signers<MAX_SIGNERS>; // possible signers for this account

     // reserved for future use
     union switch (int v)
     {
     case 0:
         void;
     case 1:
         AccountEntryExtensionV1 v1;
     }
     ext;
 };

func (*AccountEntry) DecodeFrom

func (s *AccountEntry) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (*AccountEntry) EncodeTo

func (s *AccountEntry) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (*AccountEntry) Liabilities

func (account *AccountEntry) Liabilities() Liabilities

Liabilities returns AccountEntry's liabilities

func (AccountEntry) MarshalBinary

func (s AccountEntry) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntry) MasterKeyWeight

func (account *AccountEntry) MasterKeyWeight() byte

func (*AccountEntry) NumSponsored

func (account *AccountEntry) NumSponsored() Uint32

NumSponsored returns NumSponsored value for account.

func (*AccountEntry) NumSponsoring

func (account *AccountEntry) NumSponsoring() Uint32

NumSponsoring returns NumSponsoring value for account.

func (*AccountEntry) SeqLedger

func (account *AccountEntry) SeqLedger() Uint32

func (*AccountEntry) SeqTime

func (account *AccountEntry) SeqTime() TimePoint

func (*AccountEntry) SignerSponsoringIDs

func (account *AccountEntry) SignerSponsoringIDs() []SponsorshipDescriptor

SignerSponsoringIDs returns SignerSponsoringIDs value for account. This will return a slice of nil values if V2 extension does not exist.

func (*AccountEntry) SignerSummary

func (account *AccountEntry) SignerSummary() map[string]int32

func (*AccountEntry) SponsorPerSigner

func (account *AccountEntry) SponsorPerSigner() map[string]AccountId

SponsorPerSigner returns a mapping of signer to its sponsor

func (*AccountEntry) ThresholdHigh

func (account *AccountEntry) ThresholdHigh() byte

func (*AccountEntry) ThresholdLow

func (account *AccountEntry) ThresholdLow() byte

func (*AccountEntry) ThresholdMedium

func (account *AccountEntry) ThresholdMedium() byte

func (*AccountEntry) UnmarshalBinary

func (s *AccountEntry) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExt

type AccountEntryExt struct {
	V  int32
	V1 *AccountEntryExtensionV1
}

AccountEntryExt is an XDR NestedUnion defines as:

union switch (int v)
     {
     case 0:
         void;
     case 1:
         AccountEntryExtensionV1 v1;
     }

func NewAccountEntryExt

func NewAccountEntryExt(v int32, value interface{}) (result AccountEntryExt, err error)

NewAccountEntryExt creates a new AccountEntryExt.

func (AccountEntryExt) ArmForSwitch

func (u AccountEntryExt) ArmForSwitch(sw int32) (string, bool)

ArmForSwitch returns which field name should be used for storing the value for an instance of AccountEntryExt

func (*AccountEntryExt) DecodeFrom

func (u *AccountEntryExt) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (AccountEntryExt) EncodeTo

func (u AccountEntryExt) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AccountEntryExt) GetV1

func (u AccountEntryExt) GetV1() (result AccountEntryExtensionV1, ok bool)

GetV1 retrieves the V1 value from the union, returning ok if the union's switch indicated the value is valid.

func (AccountEntryExt) MarshalBinary

func (s AccountEntryExt) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountEntryExt) MustV1

MustV1 retrieves the V1 value from the union, panicing if the value is not set.

func (AccountEntryExt) SwitchFieldName

func (u AccountEntryExt) SwitchFieldName() string

SwitchFieldName returns the field name in which this union's discriminant is stored

func (*AccountEntryExt) UnmarshalBinary

func (s *AccountEntryExt) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtView added in v0.6.0

type AccountEntryExtView []byte

func (AccountEntryExtView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntryExtView) MustCopy added in v0.6.0

func (AccountEntryExtView) MustRaw added in v0.6.0

func (v AccountEntryExtView) MustRaw() []byte

func (AccountEntryExtView) MustV added in v0.6.0

func (v AccountEntryExtView) MustV() int32

func (AccountEntryExtView) MustV1 added in v0.6.0

func (AccountEntryExtView) Raw added in v0.6.0

func (v AccountEntryExtView) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntryExtView) V added in v0.6.0

func (v AccountEntryExtView) V() (int32, error)

func (AccountEntryExtView) V1 added in v0.6.0

func (AccountEntryExtView) ValidateFull added in v0.6.0

func (v AccountEntryExtView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountEntryExtensionV1

type AccountEntryExtensionV1 struct {
	Liabilities Liabilities
	Ext         AccountEntryExtensionV1Ext
}

AccountEntryExtensionV1 is an XDR Struct defines as:

struct AccountEntryExtensionV1
 {
     Liabilities liabilities;

     union switch (int v)
     {
     case 0:
         void;
     case 2:
         AccountEntryExtensionV2 v2;
     }
     ext;
 };

func (*AccountEntryExtensionV1) DecodeFrom

func (s *AccountEntryExtensionV1) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (*AccountEntryExtensionV1) EncodeTo

func (s *AccountEntryExtensionV1) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AccountEntryExtensionV1) MarshalBinary

func (s AccountEntryExtensionV1) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntryExtensionV1) UnmarshalBinary

func (s *AccountEntryExtensionV1) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtensionV1Ext

type AccountEntryExtensionV1Ext struct {
	V  int32
	V2 *AccountEntryExtensionV2
}

AccountEntryExtensionV1Ext is an XDR NestedUnion defines as:

union switch (int v)
     {
     case 0:
         void;
     case 2:
         AccountEntryExtensionV2 v2;
     }

func NewAccountEntryExtensionV1Ext

func NewAccountEntryExtensionV1Ext(v int32, value interface{}) (result AccountEntryExtensionV1Ext, err error)

NewAccountEntryExtensionV1Ext creates a new AccountEntryExtensionV1Ext.

func (AccountEntryExtensionV1Ext) ArmForSwitch

func (u AccountEntryExtensionV1Ext) ArmForSwitch(sw int32) (string, bool)

ArmForSwitch returns which field name should be used for storing the value for an instance of AccountEntryExtensionV1Ext

func (*AccountEntryExtensionV1Ext) DecodeFrom

func (u *AccountEntryExtensionV1Ext) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (AccountEntryExtensionV1Ext) EncodeTo

func (u AccountEntryExtensionV1Ext) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AccountEntryExtensionV1Ext) GetV2

GetV2 retrieves the V2 value from the union, returning ok if the union's switch indicated the value is valid.

func (AccountEntryExtensionV1Ext) MarshalBinary

func (s AccountEntryExtensionV1Ext) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountEntryExtensionV1Ext) MustV2

MustV2 retrieves the V2 value from the union, panicing if the value is not set.

func (AccountEntryExtensionV1Ext) SwitchFieldName

func (u AccountEntryExtensionV1Ext) SwitchFieldName() string

SwitchFieldName returns the field name in which this union's discriminant is stored

func (*AccountEntryExtensionV1Ext) UnmarshalBinary

func (s *AccountEntryExtensionV1Ext) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtensionV1ExtView added in v0.6.0

type AccountEntryExtensionV1ExtView []byte

func (AccountEntryExtensionV1ExtView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntryExtensionV1ExtView) MustCopy added in v0.6.0

func (AccountEntryExtensionV1ExtView) MustRaw added in v0.6.0

func (v AccountEntryExtensionV1ExtView) MustRaw() []byte

func (AccountEntryExtensionV1ExtView) MustV added in v0.6.0

func (AccountEntryExtensionV1ExtView) MustV2 added in v0.6.0

func (AccountEntryExtensionV1ExtView) Raw added in v0.6.0

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntryExtensionV1ExtView) V added in v0.6.0

func (AccountEntryExtensionV1ExtView) V2 added in v0.6.0

func (AccountEntryExtensionV1ExtView) ValidateFull added in v0.6.0

func (v AccountEntryExtensionV1ExtView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountEntryExtensionV1Fields added in v0.7.0

type AccountEntryExtensionV1Fields struct {
	View        AccountEntryExtensionV1View
	Liabilities LiabilitiesView
	Ext         AccountEntryExtensionV1ExtView
}

AccountEntryExtensionV1Fields is the located form of AccountEntryExtensionV1View: every field trimmed to its exact wire extent, all found in one walk.

type AccountEntryExtensionV1View added in v0.6.0

type AccountEntryExtensionV1View []byte

func (AccountEntryExtensionV1View) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntryExtensionV1View) Ext added in v0.6.0

func (AccountEntryExtensionV1View) Fields added in v0.7.0

Fields locates every field of this node in a single walk, each trimmed to its exact wire extent.

func (AccountEntryExtensionV1View) Liabilities added in v0.6.0

func (AccountEntryExtensionV1View) MustCopy added in v0.6.0

func (AccountEntryExtensionV1View) MustExt added in v0.6.0

func (AccountEntryExtensionV1View) MustLiabilities added in v0.6.0

func (v AccountEntryExtensionV1View) MustLiabilities() LiabilitiesView

func (AccountEntryExtensionV1View) MustRaw added in v0.6.0

func (v AccountEntryExtensionV1View) MustRaw() []byte

func (AccountEntryExtensionV1View) Raw added in v0.6.0

func (v AccountEntryExtensionV1View) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntryExtensionV1View) ValidateFull added in v0.6.0

func (v AccountEntryExtensionV1View) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountEntryExtensionV2

type AccountEntryExtensionV2 struct {
	NumSponsored        Uint32
	NumSponsoring       Uint32
	SignerSponsoringIDs []SponsorshipDescriptor `xdrmaxsize:"20"`
	Ext                 AccountEntryExtensionV2Ext
}

AccountEntryExtensionV2 is an XDR Struct defines as:

struct AccountEntryExtensionV2
 {
     uint32 numSponsored;
     uint32 numSponsoring;
     SponsorshipDescriptor signerSponsoringIDs<MAX_SIGNERS>;

     union switch (int v)
     {
     case 0:
         void;
     case 3:
         AccountEntryExtensionV3 v3;
     }
     ext;
 };

func (*AccountEntryExtensionV2) DecodeFrom

func (s *AccountEntryExtensionV2) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (*AccountEntryExtensionV2) EncodeTo

func (s *AccountEntryExtensionV2) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AccountEntryExtensionV2) MarshalBinary

func (s AccountEntryExtensionV2) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntryExtensionV2) UnmarshalBinary

func (s *AccountEntryExtensionV2) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtensionV2Ext

type AccountEntryExtensionV2Ext struct {
	V  int32
	V3 *AccountEntryExtensionV3
}

AccountEntryExtensionV2Ext is an XDR NestedUnion defines as:

union switch (int v)
     {
     case 0:
         void;
     case 3:
         AccountEntryExtensionV3 v3;
     }

func NewAccountEntryExtensionV2Ext

func NewAccountEntryExtensionV2Ext(v int32, value interface{}) (result AccountEntryExtensionV2Ext, err error)

NewAccountEntryExtensionV2Ext creates a new AccountEntryExtensionV2Ext.

func (AccountEntryExtensionV2Ext) ArmForSwitch

func (u AccountEntryExtensionV2Ext) ArmForSwitch(sw int32) (string, bool)

ArmForSwitch returns which field name should be used for storing the value for an instance of AccountEntryExtensionV2Ext

func (*AccountEntryExtensionV2Ext) DecodeFrom

func (u *AccountEntryExtensionV2Ext) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (AccountEntryExtensionV2Ext) EncodeTo

func (u AccountEntryExtensionV2Ext) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AccountEntryExtensionV2Ext) GetV3

GetV3 retrieves the V3 value from the union, returning ok if the union's switch indicated the value is valid.

func (AccountEntryExtensionV2Ext) MarshalBinary

func (s AccountEntryExtensionV2Ext) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountEntryExtensionV2Ext) MustV3

MustV3 retrieves the V3 value from the union, panicing if the value is not set.

func (AccountEntryExtensionV2Ext) SwitchFieldName

func (u AccountEntryExtensionV2Ext) SwitchFieldName() string

SwitchFieldName returns the field name in which this union's discriminant is stored

func (*AccountEntryExtensionV2Ext) UnmarshalBinary

func (s *AccountEntryExtensionV2Ext) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtensionV2ExtView added in v0.6.0

type AccountEntryExtensionV2ExtView []byte

func (AccountEntryExtensionV2ExtView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntryExtensionV2ExtView) MustCopy added in v0.6.0

func (AccountEntryExtensionV2ExtView) MustRaw added in v0.6.0

func (v AccountEntryExtensionV2ExtView) MustRaw() []byte

func (AccountEntryExtensionV2ExtView) MustV added in v0.6.0

func (AccountEntryExtensionV2ExtView) MustV3 added in v0.6.0

func (AccountEntryExtensionV2ExtView) Raw added in v0.6.0

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntryExtensionV2ExtView) V added in v0.6.0

func (AccountEntryExtensionV2ExtView) V3 added in v0.6.0

func (AccountEntryExtensionV2ExtView) ValidateFull added in v0.6.0

func (v AccountEntryExtensionV2ExtView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountEntryExtensionV2Fields added in v0.7.0

type AccountEntryExtensionV2Fields struct {
	View                AccountEntryExtensionV2View
	NumSponsored        Uint32View
	NumSponsoring       Uint32View
	SignerSponsoringIDs AccountEntryExtensionV2SignerSponsoringIDsView
	Ext                 AccountEntryExtensionV2ExtView
}

AccountEntryExtensionV2Fields is the located form of AccountEntryExtensionV2View: every field trimmed to its exact wire extent, all found in one walk.

type AccountEntryExtensionV2SignerSponsoringIDsView added in v0.6.0

type AccountEntryExtensionV2SignerSponsoringIDsView []byte

func (AccountEntryExtensionV2SignerSponsoringIDsView) All added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) At added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntryExtensionV2SignerSponsoringIDsView) Count added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) Iter added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) MustAll added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) MustAt added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) MustCopy added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) MustCount added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) MustIter added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) MustRaw added in v0.6.0

func (AccountEntryExtensionV2SignerSponsoringIDsView) Raw added in v0.6.0

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntryExtensionV2SignerSponsoringIDsView) ValidateFull added in v0.6.0

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountEntryExtensionV2View added in v0.6.0

type AccountEntryExtensionV2View []byte

func (AccountEntryExtensionV2View) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntryExtensionV2View) Ext added in v0.6.0

func (AccountEntryExtensionV2View) Fields added in v0.7.0

Fields locates every field of this node in a single walk, each trimmed to its exact wire extent.

func (AccountEntryExtensionV2View) MustCopy added in v0.6.0

func (AccountEntryExtensionV2View) MustExt added in v0.6.0

func (AccountEntryExtensionV2View) MustNumSponsored added in v0.6.0

func (v AccountEntryExtensionV2View) MustNumSponsored() Uint32View

func (AccountEntryExtensionV2View) MustNumSponsoring added in v0.6.0

func (v AccountEntryExtensionV2View) MustNumSponsoring() Uint32View

func (AccountEntryExtensionV2View) MustRaw added in v0.6.0

func (v AccountEntryExtensionV2View) MustRaw() []byte

func (AccountEntryExtensionV2View) MustSignerSponsoringIDs added in v0.6.0

func (AccountEntryExtensionV2View) NumSponsored added in v0.6.0

func (v AccountEntryExtensionV2View) NumSponsored() (Uint32View, error)

func (AccountEntryExtensionV2View) NumSponsoring added in v0.6.0

func (v AccountEntryExtensionV2View) NumSponsoring() (Uint32View, error)

func (AccountEntryExtensionV2View) Raw added in v0.6.0

func (v AccountEntryExtensionV2View) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntryExtensionV2View) SignerSponsoringIDs added in v0.6.0

func (AccountEntryExtensionV2View) ValidateFull added in v0.6.0

func (v AccountEntryExtensionV2View) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountEntryExtensionV3

type AccountEntryExtensionV3 struct {
	Ext       ExtensionPoint
	SeqLedger Uint32
	SeqTime   TimePoint
}

AccountEntryExtensionV3 is an XDR Struct defines as:

struct AccountEntryExtensionV3
 {
     // We can use this to add more fields, or because it is first, to
     // change AccountEntryExtensionV3 into a union.
     ExtensionPoint ext;

     // Ledger number at which `seqNum` took on its present value.
     uint32 seqLedger;

     // Time at which `seqNum` took on its present value.
     TimePoint seqTime;
 };

func (*AccountEntryExtensionV3) DecodeFrom

func (s *AccountEntryExtensionV3) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (*AccountEntryExtensionV3) EncodeTo

func (s *AccountEntryExtensionV3) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AccountEntryExtensionV3) MarshalBinary

func (s AccountEntryExtensionV3) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntryExtensionV3) UnmarshalBinary

func (s *AccountEntryExtensionV3) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtensionV3Fields added in v0.7.0

type AccountEntryExtensionV3Fields struct {
	View      AccountEntryExtensionV3View
	Ext       ExtensionPointView
	SeqLedger Uint32View
	SeqTime   TimePointView
}

AccountEntryExtensionV3Fields is the located form of AccountEntryExtensionV3View: every field trimmed to its exact wire extent, all found in one walk.

type AccountEntryExtensionV3View added in v0.6.0

type AccountEntryExtensionV3View []byte

func (AccountEntryExtensionV3View) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntryExtensionV3View) Ext added in v0.6.0

func (AccountEntryExtensionV3View) Fields added in v0.7.0

Fields locates every field of this node in a single walk, each trimmed to its exact wire extent.

func (AccountEntryExtensionV3View) MustCopy added in v0.6.0

func (AccountEntryExtensionV3View) MustExt added in v0.6.0

func (AccountEntryExtensionV3View) MustRaw added in v0.6.0

func (v AccountEntryExtensionV3View) MustRaw() []byte

func (AccountEntryExtensionV3View) MustSeqLedger added in v0.6.0

func (v AccountEntryExtensionV3View) MustSeqLedger() Uint32View

func (AccountEntryExtensionV3View) MustSeqTime added in v0.6.0

func (AccountEntryExtensionV3View) Raw added in v0.6.0

func (v AccountEntryExtensionV3View) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntryExtensionV3View) SeqLedger added in v0.6.0

func (v AccountEntryExtensionV3View) SeqLedger() (Uint32View, error)

func (AccountEntryExtensionV3View) SeqTime added in v0.6.0

func (AccountEntryExtensionV3View) ValidateFull added in v0.6.0

func (v AccountEntryExtensionV3View) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountEntryFields added in v0.7.0

type AccountEntryFields struct {
	View          AccountEntryView
	AccountId     AccountIdView
	Balance       Int64View
	SeqNum        SequenceNumberView
	NumSubEntries Uint32View
	InflationDest AccountEntryInflationDestOptView
	Flags         Uint32View
	HomeDomain    String32View
	Thresholds    ThresholdsView
	Signers       AccountEntrySignersView
	Ext           AccountEntryExtView
}

AccountEntryFields is the located form of AccountEntryView: every field trimmed to its exact wire extent, all found in one walk.

type AccountEntryInflationDestOptView added in v0.6.0

type AccountEntryInflationDestOptView []byte

func (AccountEntryInflationDestOptView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntryInflationDestOptView) MustCopy added in v0.6.0

func (AccountEntryInflationDestOptView) MustRaw added in v0.6.0

func (v AccountEntryInflationDestOptView) MustRaw() []byte

func (AccountEntryInflationDestOptView) MustUnwrap added in v0.6.0

func (AccountEntryInflationDestOptView) Raw added in v0.6.0

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntryInflationDestOptView) Unwrap added in v0.6.0

func (AccountEntryInflationDestOptView) ValidateFull added in v0.6.0

func (v AccountEntryInflationDestOptView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountEntrySignersView added in v0.6.0

type AccountEntrySignersView []byte

func (AccountEntrySignersView) All added in v0.6.0

func (AccountEntrySignersView) At added in v0.6.0

func (AccountEntrySignersView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntrySignersView) Count added in v0.6.0

func (v AccountEntrySignersView) Count() (int, error)

func (AccountEntrySignersView) Iter added in v0.6.0

func (AccountEntrySignersView) MustAll added in v0.6.0

func (v AccountEntrySignersView) MustAll() []SignerView

func (AccountEntrySignersView) MustAt added in v0.6.0

func (AccountEntrySignersView) MustCopy added in v0.6.0

func (AccountEntrySignersView) MustCount added in v0.6.0

func (v AccountEntrySignersView) MustCount() int

func (AccountEntrySignersView) MustIter added in v0.6.0

func (AccountEntrySignersView) MustRaw added in v0.6.0

func (v AccountEntrySignersView) MustRaw() []byte

func (AccountEntrySignersView) Raw added in v0.6.0

func (v AccountEntrySignersView) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntrySignersView) ValidateFull added in v0.6.0

func (v AccountEntrySignersView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountEntryView added in v0.6.0

type AccountEntryView []byte

func (AccountEntryView) AccountId added in v0.6.0

func (v AccountEntryView) AccountId() (AccountIdView, error)

func (AccountEntryView) Balance added in v0.6.0

func (v AccountEntryView) Balance() (Int64View, error)

func (AccountEntryView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountEntryView) Ext added in v0.6.0

func (AccountEntryView) Fields added in v0.7.0

Fields locates every field of this node in a single walk, each trimmed to its exact wire extent.

func (AccountEntryView) Flags added in v0.6.0

func (v AccountEntryView) Flags() (Uint32View, error)

func (AccountEntryView) HomeDomain added in v0.6.0

func (v AccountEntryView) HomeDomain() (String32View, error)

func (AccountEntryView) InflationDest added in v0.6.0

func (AccountEntryView) MustAccountId added in v0.6.0

func (v AccountEntryView) MustAccountId() AccountIdView

func (AccountEntryView) MustBalance added in v0.6.0

func (v AccountEntryView) MustBalance() Int64View

func (AccountEntryView) MustCopy added in v0.6.0

func (v AccountEntryView) MustCopy() AccountEntryView

func (AccountEntryView) MustExt added in v0.6.0

func (AccountEntryView) MustFlags added in v0.6.0

func (v AccountEntryView) MustFlags() Uint32View

func (AccountEntryView) MustHomeDomain added in v0.6.0

func (v AccountEntryView) MustHomeDomain() String32View

func (AccountEntryView) MustInflationDest added in v0.6.0

func (v AccountEntryView) MustInflationDest() AccountEntryInflationDestOptView

func (AccountEntryView) MustNumSubEntries added in v0.6.0

func (v AccountEntryView) MustNumSubEntries() Uint32View

func (AccountEntryView) MustRaw added in v0.6.0

func (v AccountEntryView) MustRaw() []byte

func (AccountEntryView) MustSeqNum added in v0.6.0

func (v AccountEntryView) MustSeqNum() SequenceNumberView

func (AccountEntryView) MustSigners added in v0.6.0

func (v AccountEntryView) MustSigners() AccountEntrySignersView

func (AccountEntryView) MustThresholds added in v0.6.0

func (v AccountEntryView) MustThresholds() ThresholdsView

func (AccountEntryView) NumSubEntries added in v0.6.0

func (v AccountEntryView) NumSubEntries() (Uint32View, error)

func (AccountEntryView) Raw added in v0.6.0

func (v AccountEntryView) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountEntryView) SeqNum added in v0.6.0

func (AccountEntryView) Signers added in v0.6.0

func (AccountEntryView) Thresholds added in v0.6.0

func (v AccountEntryView) Thresholds() (ThresholdsView, error)

func (AccountEntryView) ValidateFull added in v0.6.0

func (v AccountEntryView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AccountFlags

type AccountFlags int32

AccountFlags is an XDR Enum defines as:

enum AccountFlags
 { // masks for each flag

     // Flags set on issuer accounts
     // TrustLines are created with authorized set to "false" requiring
     // the issuer to set it for each TrustLine
     AUTH_REQUIRED_FLAG = 0x1,
     // If set, the authorized flag in TrustLines can be cleared
     // otherwise, authorization cannot be revoked
     AUTH_REVOCABLE_FLAG = 0x2,
     // Once set, causes all AUTH_* flags to be read-only
     AUTH_IMMUTABLE_FLAG = 0x4,
     // Trustlines are created with clawback enabled set to "true",
     // and claimable balances created from those trustlines are created
     // with clawback enabled set to "true"
     AUTH_CLAWBACK_ENABLED_FLAG = 0x8
 };
const (
	AccountFlagsAuthRequiredFlag        AccountFlags = 1
	AccountFlagsAuthRevocableFlag       AccountFlags = 2
	AccountFlagsAuthImmutableFlag       AccountFlags = 4
	AccountFlagsAuthClawbackEnabledFlag AccountFlags = 8
)

func (*AccountFlags) DecodeFrom

func (e *AccountFlags) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (AccountFlags) EncodeTo

func (e AccountFlags) EncodeTo(enc *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AccountFlags) IsAuthClawbackEnabled

func (accountFlags AccountFlags) IsAuthClawbackEnabled() bool

IsAuthClawbackEnabled returns true if the account has the "AUTH_CLAWBACK_ENABLED" option turned on.

func (AccountFlags) IsAuthImmutable

func (accountFlags AccountFlags) IsAuthImmutable() bool

IsAuthImmutable returns true if the account has the "AUTH_IMMUTABLE" option turned on.

func (AccountFlags) IsAuthRequired

func (accountFlags AccountFlags) IsAuthRequired() bool

IsAuthRequired returns true if the account has the "AUTH_REQUIRED" option turned on.

func (AccountFlags) IsAuthRevocable

func (accountFlags AccountFlags) IsAuthRevocable() bool

IsAuthRevocable returns true if the account has the "AUTH_REVOCABLE" option turned on.

func (AccountFlags) MarshalBinary

func (s AccountFlags) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountFlags) Scan

func (t *AccountFlags) Scan(src any) error

Scan reads from src into an AccountFlags

func (AccountFlags) String

func (e AccountFlags) String() string

String returns the name of `e`

func (*AccountFlags) UnmarshalBinary

func (s *AccountFlags) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AccountFlags) ValidEnum

func (e AccountFlags) ValidEnum(v int32) bool

ValidEnum validates a proposed value for this enum. Implements the Enum interface for AccountFlags

type AccountFlagsView added in v0.6.0

type AccountFlagsView []byte

func (AccountFlagsView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountFlagsView) MustCopy added in v0.6.0

func (v AccountFlagsView) MustCopy() AccountFlagsView

func (AccountFlagsView) MustRaw added in v0.6.0

func (v AccountFlagsView) MustRaw() []byte

func (AccountFlagsView) MustValue added in v0.6.0

func (v AccountFlagsView) MustValue() AccountFlags

func (AccountFlagsView) Raw added in v0.6.0

func (v AccountFlagsView) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountFlagsView) ValidateFull added in v0.6.0

func (v AccountFlagsView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

func (AccountFlagsView) Value added in v0.6.0

func (v AccountFlagsView) Value() (AccountFlags, error)

type AccountId

type AccountId PublicKey

AccountId is an XDR Typedef defines as:

typedef PublicKey AccountID;

func AddressToAccountId

func AddressToAccountId(address string) (AccountId, error)

AddressToAccountId returns an AccountId for a given address string. If the address is not valid the error returned will not be nil

func MustAddress

func MustAddress(address string) AccountId

func MustAddressPtr

func MustAddressPtr(address string) *AccountId

func NewAccountId

func NewAccountId(aType PublicKeyType, value interface{}) (result AccountId, err error)

NewAccountId creates a new AccountId.

func (AccountId) Address

func (aid AccountId) Address() string

Address returns the strkey encoded form of this AccountId. This method will panic if the accountid is backed by a public key of an unknown type.

func (AccountId) ArmForSwitch

func (u AccountId) ArmForSwitch(sw int32) (string, bool)

ArmForSwitch returns which field name should be used for storing the value for an instance of PublicKey

func (*AccountId) DecodeFrom

func (s *AccountId) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (AccountId) EncodeTo

func (s AccountId) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (*AccountId) Equals

func (aid *AccountId) Equals(other AccountId) bool

Equals returns true if `other` is equivalent to `aid`

func (*AccountId) GetAddress

func (aid *AccountId) GetAddress() (string, error)

GetAddress returns the strkey encoded form of this AccountId, and an error if the AccountId is backed by a public key of an unknown type.

func (AccountId) GetEd25519

func (u AccountId) GetEd25519() (result Uint256, ok bool)

GetEd25519 retrieves the Ed25519 value from the union, returning ok if the union's switch indicated the value is valid.

func (AccountId) GoString

func (a AccountId) GoString() string

GoString implements fmt.GoStringer.

func (*AccountId) LedgerKey

func (aid *AccountId) LedgerKey() (key LedgerKey, err error)

LedgerKey implements the `Keyer` interface

func (AccountId) MarshalBinary

func (s AccountId) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountId) MustEd25519

func (u AccountId) MustEd25519() Uint256

MustEd25519 retrieves the Ed25519 value from the union, panicing if the value is not set.

func (*AccountId) SetAddress

func (aid *AccountId) SetAddress(address string) error

SetAddress modifies the receiver, setting it's value to the AccountId form of the provided address.

func (AccountId) SwitchFieldName

func (u AccountId) SwitchFieldName() string

SwitchFieldName returns the field name in which this union's discriminant is stored

func (*AccountId) ToMuxedAccount

func (aid *AccountId) ToMuxedAccount() MuxedAccount

ToMuxedAccount transforms an AccountId into a MuxedAccount with a zero memo id

func (*AccountId) UnmarshalBinary

func (s *AccountId) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountIdView added in v0.6.0

type AccountIdView = PublicKeyView

type AccountMergeResult

type AccountMergeResult struct {
	Code                 AccountMergeResultCode
	SourceAccountBalance *Int64
}

AccountMergeResult is an XDR Union defines as:

union AccountMergeResult switch (AccountMergeResultCode code)
 {
 case ACCOUNT_MERGE_SUCCESS:
     int64 sourceAccountBalance; // how much got transferred from source account
 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;
 };

func NewAccountMergeResult

func NewAccountMergeResult(code AccountMergeResultCode, value interface{}) (result AccountMergeResult, err error)

NewAccountMergeResult creates a new AccountMergeResult.

func (AccountMergeResult) ArmForSwitch

func (u AccountMergeResult) ArmForSwitch(sw int32) (string, bool)

ArmForSwitch returns which field name should be used for storing the value for an instance of AccountMergeResult

func (*AccountMergeResult) DecodeFrom

func (u *AccountMergeResult) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (AccountMergeResult) EncodeTo

func (u AccountMergeResult) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AccountMergeResult) GetSourceAccountBalance

func (u AccountMergeResult) GetSourceAccountBalance() (result Int64, ok bool)

GetSourceAccountBalance retrieves the SourceAccountBalance value from the union, returning ok if the union's switch indicated the value is valid.

func (AccountMergeResult) MarshalBinary

func (s AccountMergeResult) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountMergeResult) MustSourceAccountBalance

func (u AccountMergeResult) MustSourceAccountBalance() Int64

MustSourceAccountBalance retrieves the SourceAccountBalance value from the union, panicing if the value is not set.

func (AccountMergeResult) SwitchFieldName

func (u AccountMergeResult) SwitchFieldName() string

SwitchFieldName returns the field name in which this union's discriminant is stored

func (*AccountMergeResult) UnmarshalBinary

func (s *AccountMergeResult) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountMergeResultCode

type AccountMergeResultCode int32

AccountMergeResultCode is an XDR Enum defines as:

enum AccountMergeResultCode
 {
     // codes considered as "success" for the operation
     ACCOUNT_MERGE_SUCCESS = 0,
     // codes considered as "failure" for the operation
     ACCOUNT_MERGE_MALFORMED = -1,       // can't merge onto itself
     ACCOUNT_MERGE_NO_ACCOUNT = -2,      // destination does not exist
     ACCOUNT_MERGE_IMMUTABLE_SET = -3,   // source account has AUTH_IMMUTABLE set
     ACCOUNT_MERGE_HAS_SUB_ENTRIES = -4, // account has trust lines/offers
     ACCOUNT_MERGE_SEQNUM_TOO_FAR = -5,  // sequence number is over max allowed
     ACCOUNT_MERGE_DEST_FULL = -6,       // can't add source balance to
                                         // destination balance
     ACCOUNT_MERGE_IS_SPONSOR = -7       // can't merge account that is a sponsor
 };
const (
	AccountMergeResultCodeAccountMergeSuccess       AccountMergeResultCode = 0
	AccountMergeResultCodeAccountMergeMalformed     AccountMergeResultCode = -1
	AccountMergeResultCodeAccountMergeNoAccount     AccountMergeResultCode = -2
	AccountMergeResultCodeAccountMergeImmutableSet  AccountMergeResultCode = -3
	AccountMergeResultCodeAccountMergeHasSubEntries AccountMergeResultCode = -4
	AccountMergeResultCodeAccountMergeSeqnumTooFar  AccountMergeResultCode = -5
	AccountMergeResultCodeAccountMergeDestFull      AccountMergeResultCode = -6
	AccountMergeResultCodeAccountMergeIsSponsor     AccountMergeResultCode = -7
)

func (*AccountMergeResultCode) DecodeFrom

func (e *AccountMergeResultCode) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (AccountMergeResultCode) EncodeTo

func (e AccountMergeResultCode) EncodeTo(enc *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AccountMergeResultCode) MarshalBinary

func (s AccountMergeResultCode) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountMergeResultCode) String

func (e AccountMergeResultCode) String() string

String returns the name of `e`

func (*AccountMergeResultCode) UnmarshalBinary

func (s *AccountMergeResultCode) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AccountMergeResultCode) ValidEnum

func (e AccountMergeResultCode) ValidEnum(v int32) bool

ValidEnum validates a proposed value for this enum. Implements the Enum interface for AccountMergeResultCode

type AccountMergeResultCodeView added in v0.6.0

type AccountMergeResultCodeView []byte

func (AccountMergeResultCodeView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountMergeResultCodeView) MustCopy added in v0.6.0

func (AccountMergeResultCodeView) MustRaw added in v0.6.0

func (v AccountMergeResultCodeView) MustRaw() []byte

func (AccountMergeResultCodeView) MustValue added in v0.6.0

func (AccountMergeResultCodeView) Raw added in v0.6.0

func (v AccountMergeResultCodeView) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountMergeResultCodeView) ValidateFull added in v0.6.0

func (v AccountMergeResultCodeView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

func (AccountMergeResultCodeView) Value added in v0.6.0

type AccountMergeResultView added in v0.6.0

type AccountMergeResultView []byte

func (AccountMergeResultView) Code added in v0.6.0

func (AccountMergeResultView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AccountMergeResultView) MustCode added in v0.6.0

func (AccountMergeResultView) MustCopy added in v0.6.0

func (AccountMergeResultView) MustRaw added in v0.6.0

func (v AccountMergeResultView) MustRaw() []byte

func (AccountMergeResultView) MustSourceAccountBalance added in v0.6.0

func (v AccountMergeResultView) MustSourceAccountBalance() Int64View

func (AccountMergeResultView) Raw added in v0.6.0

func (v AccountMergeResultView) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AccountMergeResultView) SourceAccountBalance added in v0.6.0

func (v AccountMergeResultView) SourceAccountBalance() (Int64View, error)

func (AccountMergeResultView) ValidateFull added in v0.6.0

func (v AccountMergeResultView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AllowTrustOp

type AllowTrustOp struct {
	Trustor   AccountId
	Asset     AssetCode
	Authorize Uint32
}

AllowTrustOp is an XDR Struct defines as:

struct AllowTrustOp
 {
     AccountID trustor;
     AssetCode asset;

     // One of 0, AUTHORIZED_FLAG, or AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG
     uint32 authorize;
 };

func (*AllowTrustOp) DecodeFrom

func (s *AllowTrustOp) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (*AllowTrustOp) EncodeTo

func (s *AllowTrustOp) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AllowTrustOp) MarshalBinary

func (s AllowTrustOp) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*AllowTrustOp) UnmarshalBinary

func (s *AllowTrustOp) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AllowTrustOpFields added in v0.7.0

type AllowTrustOpFields struct {
	View      AllowTrustOpView
	Trustor   AccountIdView
	Asset     AssetCodeView
	Authorize Uint32View
}

AllowTrustOpFields is the located form of AllowTrustOpView: every field trimmed to its exact wire extent, all found in one walk.

type AllowTrustOpView added in v0.6.0

type AllowTrustOpView []byte

func (AllowTrustOpView) Asset added in v0.6.0

func (v AllowTrustOpView) Asset() (AssetCodeView, error)

func (AllowTrustOpView) Authorize added in v0.6.0

func (v AllowTrustOpView) Authorize() (Uint32View, error)

func (AllowTrustOpView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AllowTrustOpView) Fields added in v0.7.0

Fields locates every field of this node in a single walk, each trimmed to its exact wire extent.

func (AllowTrustOpView) MustAsset added in v0.6.0

func (v AllowTrustOpView) MustAsset() AssetCodeView

func (AllowTrustOpView) MustAuthorize added in v0.6.0

func (v AllowTrustOpView) MustAuthorize() Uint32View

func (AllowTrustOpView) MustCopy added in v0.6.0

func (v AllowTrustOpView) MustCopy() AllowTrustOpView

func (AllowTrustOpView) MustRaw added in v0.6.0

func (v AllowTrustOpView) MustRaw() []byte

func (AllowTrustOpView) MustTrustor added in v0.6.0

func (v AllowTrustOpView) MustTrustor() AccountIdView

func (AllowTrustOpView) Raw added in v0.6.0

func (v AllowTrustOpView) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AllowTrustOpView) Trustor added in v0.6.0

func (v AllowTrustOpView) Trustor() (AccountIdView, error)

func (AllowTrustOpView) ValidateFull added in v0.6.0

func (v AllowTrustOpView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AllowTrustResult

type AllowTrustResult struct {
	Code AllowTrustResultCode
}

AllowTrustResult is an XDR Union defines as:

union AllowTrustResult switch (AllowTrustResultCode code)
 {
 case ALLOW_TRUST_SUCCESS:
     void;
 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;
 };

func NewAllowTrustResult

func NewAllowTrustResult(code AllowTrustResultCode, value interface{}) (result AllowTrustResult, err error)

NewAllowTrustResult creates a new AllowTrustResult.

func (AllowTrustResult) ArmForSwitch

func (u AllowTrustResult) ArmForSwitch(sw int32) (string, bool)

ArmForSwitch returns which field name should be used for storing the value for an instance of AllowTrustResult

func (*AllowTrustResult) DecodeFrom

func (u *AllowTrustResult) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (AllowTrustResult) EncodeTo

func (u AllowTrustResult) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AllowTrustResult) MarshalBinary

func (s AllowTrustResult) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (AllowTrustResult) SwitchFieldName

func (u AllowTrustResult) SwitchFieldName() string

SwitchFieldName returns the field name in which this union's discriminant is stored

func (*AllowTrustResult) UnmarshalBinary

func (s *AllowTrustResult) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AllowTrustResultCode

type AllowTrustResultCode int32

AllowTrustResultCode is an XDR Enum defines as:

enum AllowTrustResultCode
 {
     // codes considered as "success" for the operation
     ALLOW_TRUST_SUCCESS = 0,
     // codes considered as "failure" for the operation
     ALLOW_TRUST_MALFORMED = -1,     // asset is not ASSET_TYPE_ALPHANUM
     ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline
                                     // source account does not require trust
     ALLOW_TRUST_TRUST_NOT_REQUIRED = -3,
     ALLOW_TRUST_CANT_REVOKE = -4,      // source account can't revoke trust,
     ALLOW_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed
     ALLOW_TRUST_LOW_RESERVE = -6       // claimable balances can't be created
                                        // on revoke due to low reserves
 };
const (
	AllowTrustResultCodeAllowTrustSuccess          AllowTrustResultCode = 0
	AllowTrustResultCodeAllowTrustMalformed        AllowTrustResultCode = -1
	AllowTrustResultCodeAllowTrustNoTrustLine      AllowTrustResultCode = -2
	AllowTrustResultCodeAllowTrustTrustNotRequired AllowTrustResultCode = -3
	AllowTrustResultCodeAllowTrustCantRevoke       AllowTrustResultCode = -4
	AllowTrustResultCodeAllowTrustSelfNotAllowed   AllowTrustResultCode = -5
	AllowTrustResultCodeAllowTrustLowReserve       AllowTrustResultCode = -6
)

func (*AllowTrustResultCode) DecodeFrom

func (e *AllowTrustResultCode) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (AllowTrustResultCode) EncodeTo

func (e AllowTrustResultCode) EncodeTo(enc *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AllowTrustResultCode) MarshalBinary

func (s AllowTrustResultCode) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (AllowTrustResultCode) String

func (e AllowTrustResultCode) String() string

String returns the name of `e`

func (*AllowTrustResultCode) UnmarshalBinary

func (s *AllowTrustResultCode) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AllowTrustResultCode) ValidEnum

func (e AllowTrustResultCode) ValidEnum(v int32) bool

ValidEnum validates a proposed value for this enum. Implements the Enum interface for AllowTrustResultCode

type AllowTrustResultCodeView added in v0.6.0

type AllowTrustResultCodeView []byte

func (AllowTrustResultCodeView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AllowTrustResultCodeView) MustCopy added in v0.6.0

func (AllowTrustResultCodeView) MustRaw added in v0.6.0

func (v AllowTrustResultCodeView) MustRaw() []byte

func (AllowTrustResultCodeView) MustValue added in v0.6.0

func (AllowTrustResultCodeView) Raw added in v0.6.0

func (v AllowTrustResultCodeView) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AllowTrustResultCodeView) ValidateFull added in v0.6.0

func (v AllowTrustResultCodeView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

func (AllowTrustResultCodeView) Value added in v0.6.0

type AllowTrustResultView added in v0.6.0

type AllowTrustResultView []byte

func (AllowTrustResultView) Code added in v0.6.0

func (AllowTrustResultView) Copy added in v0.6.0

Copy returns an independent copy of this view that does not alias the original bytes.

func (AllowTrustResultView) MustCode added in v0.6.0

func (AllowTrustResultView) MustCopy added in v0.6.0

func (AllowTrustResultView) MustRaw added in v0.6.0

func (v AllowTrustResultView) MustRaw() []byte

func (AllowTrustResultView) Raw added in v0.6.0

func (v AllowTrustResultView) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AllowTrustResultView) ValidateFull added in v0.6.0

func (v AllowTrustResultView) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AlphaNum4

type AlphaNum4 struct {
	AssetCode AssetCode4
	Issuer    AccountId
}

AlphaNum4 is an XDR Struct defines as:

struct AlphaNum4
 {
     AssetCode4 assetCode;
     AccountID issuer;
 };

func (*AlphaNum4) DecodeFrom

func (s *AlphaNum4) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (*AlphaNum4) EncodeTo

func (s *AlphaNum4) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AlphaNum4) MarshalBinary

func (s AlphaNum4) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*AlphaNum4) UnmarshalBinary

func (s *AlphaNum4) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AlphaNum4Fields added in v0.7.0

type AlphaNum4Fields struct {
	View      AlphaNum4View
	AssetCode AssetCode4View
	Issuer    AccountIdView
}

AlphaNum4Fields is the located form of AlphaNum4View: every field trimmed to its exact wire extent, all found in one walk.

type AlphaNum4View added in v0.6.0

type AlphaNum4View []byte

func (AlphaNum4View) AssetCode added in v0.6.0

func (v AlphaNum4View) AssetCode() (AssetCode4View, error)

func (AlphaNum4View) Copy added in v0.6.0

func (v AlphaNum4View) Copy() (AlphaNum4View, error)

Copy returns an independent copy of this view that does not alias the original bytes.

func (AlphaNum4View) Fields added in v0.7.0

func (v AlphaNum4View) Fields() (AlphaNum4Fields, error)

Fields locates every field of this node in a single walk, each trimmed to its exact wire extent.

func (AlphaNum4View) Issuer added in v0.6.0

func (v AlphaNum4View) Issuer() (AccountIdView, error)

func (AlphaNum4View) MustAssetCode added in v0.6.0

func (v AlphaNum4View) MustAssetCode() AssetCode4View

func (AlphaNum4View) MustCopy added in v0.6.0

func (v AlphaNum4View) MustCopy() AlphaNum4View

func (AlphaNum4View) MustIssuer added in v0.6.0

func (v AlphaNum4View) MustIssuer() AccountIdView

func (AlphaNum4View) MustRaw added in v0.6.0

func (v AlphaNum4View) MustRaw() []byte

func (AlphaNum4View) Raw added in v0.6.0

func (v AlphaNum4View) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AlphaNum4View) ValidateFull added in v0.6.0

func (v AlphaNum4View) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.

type AlphaNum12

type AlphaNum12 struct {
	AssetCode AssetCode12
	Issuer    AccountId
}

AlphaNum12 is an XDR Struct defines as:

struct AlphaNum12
 {
     AssetCode12 assetCode;
     AccountID issuer;
 };

func (*AlphaNum12) DecodeFrom

func (s *AlphaNum12) DecodeFrom(d *xdr.Decoder, maxDepth uint) (int, error)

DecodeFrom decodes this value using the Decoder.

func (*AlphaNum12) EncodeTo

func (s *AlphaNum12) EncodeTo(e *xdr.Encoder) error

EncodeTo encodes this value using the Encoder.

func (AlphaNum12) MarshalBinary

func (s AlphaNum12) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*AlphaNum12) UnmarshalBinary

func (s *AlphaNum12) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AlphaNum12Fields added in v0.7.0

type AlphaNum12Fields struct {
	View      AlphaNum12View
	AssetCode AssetCode12View
	Issuer    AccountIdView
}

AlphaNum12Fields is the located form of AlphaNum12View: every field trimmed to its exact wire extent, all found in one walk.

type AlphaNum12View added in v0.6.0

type AlphaNum12View []byte

func (AlphaNum12View) AssetCode added in v0.6.0

func (v AlphaNum12View) AssetCode() (AssetCode12View, error)

func (AlphaNum12View) Copy added in v0.6.0

func (v AlphaNum12View) Copy() (AlphaNum12View, error)

Copy returns an independent copy of this view that does not alias the original bytes.

func (AlphaNum12View) Fields added in v0.7.0

func (v AlphaNum12View) Fields() (AlphaNum12Fields, error)

Fields locates every field of this node in a single walk, each trimmed to its exact wire extent.

func (AlphaNum12View) Issuer added in v0.6.0

func (v AlphaNum12View) Issuer() (AccountIdView, error)

func (AlphaNum12View) MustAssetCode added in v0.6.0

func (v AlphaNum12View) MustAssetCode() AssetCode12View

func (AlphaNum12View) MustCopy added in v0.6.0

func (v AlphaNum12View) MustCopy() AlphaNum12View

func (AlphaNum12View) MustIssuer added in v0.6.0

func (v AlphaNum12View) MustIssuer() AccountIdView

func (AlphaNum12View) MustRaw added in v0.6.0

func (v AlphaNum12View) MustRaw() []byte

func (AlphaNum12View) Raw added in v0.6.0

func (v AlphaNum12View) Raw() ([]byte, error)

Raw returns the exact wire bytes for this view, trimmed from the fat slice.

func (AlphaNum12View) ValidateFull added in v0.6.0

func (v AlphaNum12View) ValidateFull() error

ValidateFull checks that this view is well-formed: bounds, schema constraints, and depth limits.