xdr

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT, Apache-2.0 Imports: 19 Imported by: 0

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.

Index

Constants

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;

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 LedgerEntryTypeMap = ledgerEntryTypeMap
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}$")

Functions

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(d *xdr.Decoder) (uint32, error)

ReadFrameLength returns a length of a framed XDR object.

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 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 Unmarshal

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

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

func UnmarshalWithOptions

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

UnmarshalWithOptions works like Unmarshal but uses decoding options.

Types

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 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 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 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 Asset

type Asset struct {
	Type       AssetType
	AlphaNum4  *AlphaNum4
	AlphaNum12 *AlphaNum12
}

Asset is an XDR Union defines as:

union Asset switch (AssetType type)
 {
 case ASSET_TYPE_NATIVE: // Not credit
     void;

 case ASSET_TYPE_CREDIT_ALPHANUM4:
     AlphaNum4 alphaNum4;

 case ASSET_TYPE_CREDIT_ALPHANUM12:
     AlphaNum12 alphaNum12;

     // add other asset types here in the future
 };

func BuildAsset

func BuildAsset(assetType, issuer, code string) (Asset, error)

BuildAsset creates a new asset from a given `assetType`, `code`, and `issuer`.

Valid assetTypes are:

  • `native`
  • `credit_alphanum4`
  • `credit_alphanum12`

func BuildAssets

func BuildAssets(s string) ([]Asset, error)

BuildAssets parses a list of assets from a given string. The string is expected to be a comma separated list of assets encoded in the format (Code:Issuer or "native") defined by SEP-0011 https://github.com/stellar/stellar-protocol/pull/313 If the string is empty, BuildAssets will return an empty list of assets

func MustNewCreditAsset

func MustNewCreditAsset(code string, issuer string) Asset

MustNewCreditAsset returns a new general asset, panicking if it can't.

func MustNewNativeAsset

func MustNewNativeAsset() Asset

MustNewNativeAsset returns a new native asset, panicking if it can't.

func NewAsset

func NewAsset(aType AssetType, value interface{}) (result Asset, err error)

NewAsset creates a new Asset.

func NewCreditAsset

func NewCreditAsset(code string, issuer string) (Asset, error)

NewCreditAsset returns a new general asset, returning an error if it can't.

func (Asset) ArmForSwitch

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

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

func (*Asset) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (Asset) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Asset) Equals

func (a Asset) Equals(other Asset) bool

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

func (Asset) Extract

func (a Asset) Extract(typ interface{}, code interface{}, issuer interface{}) error

Extract is a helper function to extract information from an xdr.Asset structure. It extracts the asset's type to the `typ` input parameter (which must be either a *string or *xdr.AssetType). It also extracts the asset's code and issuer to `code` and `issuer` respectively if they are of type *string and the asset is non-native

func (Asset) GetAlphaNum12

func (u Asset) GetAlphaNum12() (result AlphaNum12, ok bool)

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

func (Asset) GetAlphaNum4

func (u Asset) GetAlphaNum4() (result AlphaNum4, ok bool)

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

func (*Asset) GetCode

func (a *Asset) GetCode() string

func (*Asset) GetIssuer

func (a *Asset) GetIssuer() string

func (Asset) GoString

func (a Asset) GoString() string

GoString implements fmt.GoStringer.

func (*Asset) LessThan

func (a *Asset) LessThan(b Asset) bool

func (Asset) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (Asset) MustAlphaNum12

func (u Asset) MustAlphaNum12() AlphaNum12

MustAlphaNum12 retrieves the AlphaNum12 value from the union, panicing if the value is not set.

func (Asset) MustAlphaNum4

func (u Asset) MustAlphaNum4() AlphaNum4

MustAlphaNum4 retrieves the AlphaNum4 value from the union, panicing if the value is not set.

func (Asset) MustExtract

func (a Asset) MustExtract(typ interface{}, code interface{}, issuer interface{})

MustExtract behaves as Extract, but panics if an error occurs.

func (*Asset) SetCredit

func (a *Asset) SetCredit(code string, issuer AccountId) error

SetCredit overwrites `a` with a credit asset using `code` and `issuer`. The asset type (CreditAlphanum4 or CreditAlphanum12) is chosen automatically based upon the length of `code`.

func (*Asset) SetNative

func (a *Asset) SetNative() error

SetNative overwrites `a` with the native asset type

func (Asset) String

func (a Asset) String() string

String returns a display friendly form of the asset

func (Asset) StringCanonical

func (a Asset) StringCanonical() string

StringCanonical returns a display friendly form of the asset following its canonical representation

func (Asset) SwitchFieldName

func (u Asset) SwitchFieldName() string

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

func (*Asset) ToAssetCode

func (a *Asset) ToAssetCode(code string) (AssetCode, error)

ToAssetCode for Asset converts the Asset to a corresponding XDR "allow trust" asset, used by the XDR allow trust operation.

func (Asset) ToChangeTrustAsset

func (a Asset) ToChangeTrustAsset() ChangeTrustAsset

ToChangeTrustAsset converts Asset to ChangeTrustAsset.

func (Asset) ToTrustLineAsset

func (a Asset) ToTrustLineAsset() TrustLineAsset

ToTrustLineAsset converts Asset to TrustLineAsset.

func (*Asset) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AssetCode

type AssetCode struct {
	Type        AssetType
	AssetCode4  *AssetCode4
	AssetCode12 *AssetCode12
}

AssetCode is an XDR Union defines as:

union AssetCode switch (AssetType type)
 {
 case ASSET_TYPE_CREDIT_ALPHANUM4:
     AssetCode4 assetCode4;

 case ASSET_TYPE_CREDIT_ALPHANUM12:
     AssetCode12 assetCode12;

     // add other asset types here in the future
 };

func MustNewAssetCodeFromString

func MustNewAssetCodeFromString(code string) AssetCode

MustNewAssetCodeFromString returns a new allow trust asset, panicking if it can't.

func NewAssetCode

func NewAssetCode(aType AssetType, value interface{}) (result AssetCode, err error)

NewAssetCode creates a new AssetCode.

func NewAssetCodeFromString

func NewAssetCodeFromString(code string) (AssetCode, error)

NewAssetCodeFromString returns a new credit asset, erroring if it can't.

func (AssetCode) ArmForSwitch

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

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

func (*AssetCode) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (AssetCode) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (AssetCode) GetAssetCode12

func (u AssetCode) GetAssetCode12() (result AssetCode12, ok bool)

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

func (AssetCode) GetAssetCode4

func (u AssetCode) GetAssetCode4() (result AssetCode4, ok bool)

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

func (AssetCode) GoString

func (s AssetCode) GoString() string

GoString implements fmt.GoStringer.

func (AssetCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AssetCode) MustAssetCode12

func (u AssetCode) MustAssetCode12() AssetCode12

MustAssetCode12 retrieves the AssetCode12 value from the union, panicing if the value is not set.

func (AssetCode) MustAssetCode4

func (u AssetCode) MustAssetCode4() AssetCode4

MustAssetCode4 retrieves the AssetCode4 value from the union, panicing if the value is not set.

func (AssetCode) SwitchFieldName

func (u AssetCode) SwitchFieldName() string

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

func (AssetCode) ToAsset

func (a AssetCode) ToAsset(issuer AccountId) (asset Asset)

ToAsset for AssetCode converts the xdr.AssetCode to a standard xdr.Asset.

func (*AssetCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AssetCode12

type AssetCode12 [12]byte

AssetCode12 is an XDR Typedef defines as:

typedef opaque AssetCode12[12];

func (*AssetCode12) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*AssetCode12) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (AssetCode12) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetCode12) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AssetCode12) XDRMaxSize

func (e AssetCode12) XDRMaxSize() int

XDRMaxSize implements the Sized interface for AssetCode12

type AssetCode4

type AssetCode4 [4]byte

AssetCode4 is an XDR Typedef defines as:

typedef opaque AssetCode4[4];

func (*AssetCode4) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*AssetCode4) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (AssetCode4) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetCode4) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AssetCode4) XDRMaxSize

func (e AssetCode4) XDRMaxSize() int

XDRMaxSize implements the Sized interface for AssetCode4

type AssetType

type AssetType int32
const (
	AssetTypeAssetTypeNative           AssetType = 0
	AssetTypeAssetTypeCreditAlphanum4  AssetType = 1
	AssetTypeAssetTypeCreditAlphanum12 AssetType = 2
	AssetTypeAssetTypePoolShare        AssetType = 3
)

func (*AssetType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (AssetType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (AssetType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AssetType) String

func (e AssetType) String() string

String returns the name of `e`

func (*AssetType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AssetType) ValidEnum

func (e AssetType) ValidEnum(v int32) bool

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

type BytesDecoder

type BytesDecoder struct {
	// contains filtered or unexported fields
}

BytesDecoder efficiently manages a byte reader and an xdr decoder so that they don't need to be allocated in every decoding call.

func NewBytesDecoder

func NewBytesDecoder() *BytesDecoder

func (*BytesDecoder) DecodeBytes

func (d *BytesDecoder) DecodeBytes(v DecoderFrom, b []byte) (int, error)

type ChangeTrustAsset

type ChangeTrustAsset struct {
	Type       AssetType
	AlphaNum4  *AlphaNum4
	AlphaNum12 *AlphaNum12
}

func NewChangeTrustAsset

func NewChangeTrustAsset(aType AssetType, value interface{}) (result ChangeTrustAsset, err error)

NewChangeTrustAsset creates a new ChangeTrustAsset.

func (ChangeTrustAsset) ArmForSwitch

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

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

func (*ChangeTrustAsset) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (ChangeTrustAsset) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (ChangeTrustAsset) GetAlphaNum12

func (u ChangeTrustAsset) GetAlphaNum12() (result AlphaNum12, ok bool)

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

func (ChangeTrustAsset) GetAlphaNum4

func (u ChangeTrustAsset) GetAlphaNum4() (result AlphaNum4, ok bool)

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

func (ChangeTrustAsset) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ChangeTrustAsset) MustAlphaNum12

func (u ChangeTrustAsset) MustAlphaNum12() AlphaNum12

MustAlphaNum12 retrieves the AlphaNum12 value from the union, panicing if the value is not set.

func (ChangeTrustAsset) MustAlphaNum4

func (u ChangeTrustAsset) MustAlphaNum4() AlphaNum4

MustAlphaNum4 retrieves the AlphaNum4 value from the union, panicing if the value is not set.

func (ChangeTrustAsset) SwitchFieldName

func (u ChangeTrustAsset) SwitchFieldName() string

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

func (ChangeTrustAsset) ToAsset

func (tla ChangeTrustAsset) ToAsset() Asset

ToAsset converts ChangeTrustAsset to Asset. Panics on type other than AssetTypeAssetTypeNative, AssetTypeAssetTypeCreditAlphanum4 or AssetTypeAssetTypeCreditAlphanum12.

func (*ChangeTrustAsset) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ChangeTrustOp

type ChangeTrustOp struct {
	Line  ChangeTrustAsset
	Limit Int64
}

ChangeTrustOp is an XDR Struct defines as:

struct ChangeTrustOp
 {
     ChangeTrustAsset line;

     // if limit is set to 0, deletes the trust line
     int64 limit;
 };

func (*ChangeTrustOp) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*ChangeTrustOp) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (ChangeTrustOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ChangeTrustOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type CryptoKeyType

type CryptoKeyType int32
const (
	CryptoKeyTypeKeyTypeEd25519              CryptoKeyType = 0
	CryptoKeyTypeKeyTypePreAuthTx            CryptoKeyType = 1
	CryptoKeyTypeKeyTypeHashX                CryptoKeyType = 2
	CryptoKeyTypeKeyTypeEd25519SignedPayload CryptoKeyType = 3
	CryptoKeyTypeKeyTypeMuxedEd25519         CryptoKeyType = 256
)

func (*CryptoKeyType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (CryptoKeyType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (CryptoKeyType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (CryptoKeyType) String

func (e CryptoKeyType) String() string

String returns the name of `e`

func (*CryptoKeyType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (CryptoKeyType) ValidEnum

func (e CryptoKeyType) ValidEnum(v int32) bool

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

type DecoderFrom

type DecoderFrom interface {
	// contains filtered or unexported methods
}

type DecoratedSignature

type DecoratedSignature struct {
	Hint      SignatureHint
	Signature Signature
}

func NewDecoratedSignature

func NewDecoratedSignature(sig []byte, hint [4]byte) DecoratedSignature

NewDecoratedSignature constructs a decorated signature structure directly from the given signature and hint. Note that the hint should correspond to the signer that created the signature, but this helper cannot ensure that.

func NewDecoratedSignatureForPayload

func NewDecoratedSignatureForPayload(
	sig []byte, keyHint [4]byte, payload []byte,
) DecoratedSignature

NewDecoratedSignatureForPayload creates a decorated signature with a hint that uses the key hint, the last four bytes of signature, and the last four bytes of the input that got signed. Note that the signature should be the signature of the payload via the key being hinted, but this construction method cannot ensure that.

func (*DecoratedSignature) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*DecoratedSignature) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (DecoratedSignature) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*DecoratedSignature) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Duration

type Duration Uint64

Duration is an XDR Typedef defines as:

typedef uint64 Duration;

func (*Duration) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (Duration) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Duration) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Duration) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type EncoderTo

type EncoderTo interface {
	EncodeTo(e *xdr.Encoder) error
}

type EncodingBuffer

type EncodingBuffer struct {
	// contains filtered or unexported fields
}

EncodingBuffer reuses internal buffers between invocations to minimize allocations. For that reason, it is not thread-safe. It intentionally only allows EncodeTo method arguments, to guarantee high performance encoding.

func NewEncodingBuffer

func NewEncodingBuffer() *EncodingBuffer

func (*EncodingBuffer) LedgerKeyUnsafeMarshalBinaryCompress

func (e *EncodingBuffer) LedgerKeyUnsafeMarshalBinaryCompress(key LedgerKey) ([]byte, error)

LedgerKeyUnsafeMarshalBinaryCompress marshals LedgerKey to []byte but unlike MarshalBinary() it removes all unnecessary bytes, exploting the fact that XDR is padding data to 4 bytes in union discriminants etc. It's primary use is in ingest/io.StateReader that keep LedgerKeys in memory so this function decrease memory requirements.

Warning, do not use UnmarshalBinary() on data encoded using this method!

Optimizations: - Writes a single byte for union discriminants vs 4 bytes. - Removes type and code padding for Asset. - Removes padding for AccountIds

func (*EncodingBuffer) MarshalBase64

func (e *EncodingBuffer) MarshalBase64(encodable EncoderTo) (string, error)

func (*EncodingBuffer) MarshalBinary

func (e *EncodingBuffer) MarshalBinary(encodable EncoderTo) ([]byte, error)

func (*EncodingBuffer) MarshalHex

func (e *EncodingBuffer) MarshalHex(encodable EncoderTo) (string, error)

func (*EncodingBuffer) UnsafeMarshalBase64

func (e *EncodingBuffer) UnsafeMarshalBase64(encodable EncoderTo) ([]byte, error)

UnsafeMarshalBase64 is the base64 version of UnsafeMarshalBinary

func (*EncodingBuffer) UnsafeMarshalBinary

func (e *EncodingBuffer) UnsafeMarshalBinary(encodable EncoderTo) ([]byte, error)

UnsafeMarshalBinary marshals the input XDR binary, returning a slice pointing to the internal buffer. Handled with care this improveds performance since copying is not required. Subsequent calls to marshaling methods will overwrite the returned buffer.

func (*EncodingBuffer) UnsafeMarshalHex

func (e *EncodingBuffer) UnsafeMarshalHex(encodable EncoderTo) ([]byte, error)

UnsafeMarshalHex is the hex version of UnsafeMarshalBinary

type EnvelopeType

type EnvelopeType int32
const (
	EnvelopeTypeEnvelopeTypeTxV0                 EnvelopeType = 0
	EnvelopeTypeEnvelopeTypeScp                  EnvelopeType = 1
	EnvelopeTypeEnvelopeTypeTx                   EnvelopeType = 2
	EnvelopeTypeEnvelopeTypeAuth                 EnvelopeType = 3
	EnvelopeTypeEnvelopeTypeScpvalue             EnvelopeType = 4
	EnvelopeTypeEnvelopeTypeTxFeeBump            EnvelopeType = 5
	EnvelopeTypeEnvelopeTypeOpId                 EnvelopeType = 6
	EnvelopeTypeEnvelopeTypePoolRevokeOpId       EnvelopeType = 7
	EnvelopeTypeEnvelopeTypeContractId           EnvelopeType = 8
	EnvelopeTypeEnvelopeTypeSorobanAuthorization EnvelopeType = 9
)

func (*EnvelopeType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (EnvelopeType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (EnvelopeType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (EnvelopeType) String

func (e EnvelopeType) String() string

String returns the name of `e`

func (*EnvelopeType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (EnvelopeType) ValidEnum

func (e EnvelopeType) ValidEnum(v int32) bool

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

type ExtensionPoint

type ExtensionPoint struct {
	V int32
}

ExtensionPoint is an XDR Union defines as:

union ExtensionPoint switch (int v)
 {
 case 0:
     void;
 };

func NewExtensionPoint

func NewExtensionPoint(v int32, value interface{}) (result ExtensionPoint, err error)

NewExtensionPoint creates a new ExtensionPoint.

func (ExtensionPoint) ArmForSwitch

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

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

func (*ExtensionPoint) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (ExtensionPoint) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (ExtensionPoint) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ExtensionPoint) SwitchFieldName

func (u ExtensionPoint) SwitchFieldName() string

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

func (*ExtensionPoint) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type FeeBumpTransaction

type FeeBumpTransaction struct {
	FeeSource MuxedAccount
	Fee       Int64
	InnerTx   FeeBumpTransactionInnerTx
	Ext       FeeBumpTransactionExt
}

func (*FeeBumpTransaction) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*FeeBumpTransaction) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (FeeBumpTransaction) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*FeeBumpTransaction) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type FeeBumpTransactionEnvelope

type FeeBumpTransactionEnvelope struct {
	Tx         FeeBumpTransaction
	Signatures []DecoratedSignature `xdrmaxsize:"20"`
}

func (*FeeBumpTransactionEnvelope) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*FeeBumpTransactionEnvelope) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (FeeBumpTransactionEnvelope) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*FeeBumpTransactionEnvelope) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type FeeBumpTransactionExt

type FeeBumpTransactionExt struct {
	V int32
}

func NewFeeBumpTransactionExt

func NewFeeBumpTransactionExt(v int32, value interface{}) (result FeeBumpTransactionExt, err error)

NewFeeBumpTransactionExt creates a new FeeBumpTransactionExt.

func (FeeBumpTransactionExt) ArmForSwitch

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

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

func (*FeeBumpTransactionExt) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (FeeBumpTransactionExt) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (FeeBumpTransactionExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (FeeBumpTransactionExt) SwitchFieldName

func (u FeeBumpTransactionExt) SwitchFieldName() string

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

func (*FeeBumpTransactionExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type FeeBumpTransactionInnerTx

type FeeBumpTransactionInnerTx struct {
	Type EnvelopeType
	V1   *TransactionV1Envelope
}

func NewFeeBumpTransactionInnerTx

func NewFeeBumpTransactionInnerTx(aType EnvelopeType, value interface{}) (result FeeBumpTransactionInnerTx, err error)

NewFeeBumpTransactionInnerTx creates a new FeeBumpTransactionInnerTx.

func (FeeBumpTransactionInnerTx) ArmForSwitch

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

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

func (*FeeBumpTransactionInnerTx) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (FeeBumpTransactionInnerTx) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (FeeBumpTransactionInnerTx) GetV1

func (u FeeBumpTransactionInnerTx) GetV1() (result TransactionV1Envelope, ok bool)

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

func (FeeBumpTransactionInnerTx) GoString

func (e FeeBumpTransactionInnerTx) GoString() string

GoString implements fmt.GoStringer.

func (FeeBumpTransactionInnerTx) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (FeeBumpTransactionInnerTx) MustV1

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

func (FeeBumpTransactionInnerTx) SwitchFieldName

func (u FeeBumpTransactionInnerTx) SwitchFieldName() string

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

func (*FeeBumpTransactionInnerTx) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Hash

type Hash [32]byte

func (*Hash) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*Hash) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Hash) Equals

func (s Hash) Equals(o Hash) bool

func (Hash) HexString

func (h Hash) HexString() string

func (Hash) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Hash) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (Hash) XDRMaxSize

func (e Hash) XDRMaxSize() int

XDRMaxSize implements the Sized interface for Hash

type Int128Parts

type Int128Parts struct {
	Hi Int64
	Lo Uint64
}

func (*Int128Parts) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*Int128Parts) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Int128Parts) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Int128Parts) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Int32

type Int32 int32

Int32 is an XDR Typedef defines as:

typedef int int32;

func (*Int32) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (Int32) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Int32) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Int32) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Int64

type Int64 int64

Int64 is an XDR Typedef defines as:

typedef hyper int64;

func (*Int64) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (Int64) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Int64) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Int64) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Keyer

type Keyer interface {
	LedgerKey() (LedgerKey, error)
}

Keyer represents a type that can be converted into a LedgerKey

type LedgerBounds

type LedgerBounds struct {
	MinLedger Uint32
	MaxLedger Uint32
}

func (*LedgerBounds) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*LedgerBounds) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerBounds) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerBounds) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntry

type LedgerEntry struct {
	LastModifiedLedgerSeq Uint32
	Data                  LedgerEntryData
	Ext                   LedgerEntryExt
}

func (*LedgerEntry) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*LedgerEntry) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerEntry) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerEntry) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryData

type LedgerEntryData struct {
	Type      LedgerEntryType
	TrustLine *TrustLineEntry
}

func NewLedgerEntryData

func NewLedgerEntryData(aType LedgerEntryType, value interface{}) (result LedgerEntryData, err error)

NewLedgerEntryData creates a new LedgerEntryData.

func (LedgerEntryData) ArmForSwitch

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

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

func (*LedgerEntryData) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (LedgerEntryData) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerEntryData) GetTrustLine

func (u LedgerEntryData) GetTrustLine() (result TrustLineEntry, ok bool)

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

func (LedgerEntryData) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryData) MustTrustLine

func (u LedgerEntryData) MustTrustLine() TrustLineEntry

MustTrustLine retrieves the TrustLine value from the union, panicing if the value is not set.

func (LedgerEntryData) SwitchFieldName

func (u LedgerEntryData) SwitchFieldName() string

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

func (*LedgerEntryData) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryExt

type LedgerEntryExt struct {
	V  int32
	V1 *LedgerEntryExtensionV1
}

func NewLedgerEntryExt

func NewLedgerEntryExt(v int32, value interface{}) (result LedgerEntryExt, err error)

NewLedgerEntryExt creates a new LedgerEntryExt.

func (LedgerEntryExt) ArmForSwitch

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

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

func (*LedgerEntryExt) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (LedgerEntryExt) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerEntryExt) GetV1

func (u LedgerEntryExt) GetV1() (result LedgerEntryExtensionV1, ok bool)

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

func (LedgerEntryExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryExt) MustV1

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

func (LedgerEntryExt) SwitchFieldName

func (u LedgerEntryExt) SwitchFieldName() string

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

func (*LedgerEntryExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryExtensionV1

type LedgerEntryExtensionV1 struct {
	SponsoringId SponsorshipDescriptor
	Ext          LedgerEntryExtensionV1Ext
}

func (*LedgerEntryExtensionV1) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*LedgerEntryExtensionV1) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerEntryExtensionV1) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerEntryExtensionV1) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryExtensionV1Ext

type LedgerEntryExtensionV1Ext struct {
	V int32
}

func NewLedgerEntryExtensionV1Ext

func NewLedgerEntryExtensionV1Ext(v int32, value interface{}) (result LedgerEntryExtensionV1Ext, err error)

NewLedgerEntryExtensionV1Ext creates a new LedgerEntryExtensionV1Ext.

func (LedgerEntryExtensionV1Ext) ArmForSwitch

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

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

func (*LedgerEntryExtensionV1Ext) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (LedgerEntryExtensionV1Ext) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerEntryExtensionV1Ext) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryExtensionV1Ext) SwitchFieldName

func (u LedgerEntryExtensionV1Ext) SwitchFieldName() string

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

func (*LedgerEntryExtensionV1Ext) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryType

type LedgerEntryType int32
const (
	LedgerEntryTypeAccount   LedgerEntryType = 0
	LedgerEntryTypeTrustline LedgerEntryType = 1
	LedgerEntryTypeOffer     LedgerEntryType = 2
	LedgerEntryTypeData      LedgerEntryType = 3
)

func GetBinaryCompressedLedgerKeyType

func GetBinaryCompressedLedgerKeyType(compressedKey []byte) (LedgerEntryType, error)

GetBinaryCompressedLedgerKeyType gets the key type from the result of LedgerKeyUnsafeMarshalBinaryCompress

func (*LedgerEntryType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (LedgerEntryType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerEntryType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryType) String

func (e LedgerEntryType) String() string

String returns the name of `e`

func (*LedgerEntryType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (LedgerEntryType) ValidEnum

func (e LedgerEntryType) ValidEnum(v int32) bool

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

type LedgerKey

type LedgerKey struct {
	Type      LedgerEntryType
	Account   *LedgerKeyAccount
	TrustLine *LedgerKeyTrustLine
}

func NewLedgerKey

func NewLedgerKey(aType LedgerEntryType, value interface{}) (result LedgerKey, err error)

NewLedgerKey creates a new LedgerKey.

func (LedgerKey) ArmForSwitch

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

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

func (*LedgerKey) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (LedgerKey) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerKey) GetAccount

func (u LedgerKey) GetAccount() (result LedgerKeyAccount, ok bool)

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

func (LedgerKey) GetTrustLine

func (u LedgerKey) GetTrustLine() (result LedgerKeyTrustLine, ok bool)

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

func (LedgerKey) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerKey) MustAccount

func (u LedgerKey) MustAccount() LedgerKeyAccount

MustAccount retrieves the Account value from the union, panicing if the value is not set.

func (LedgerKey) MustTrustLine

func (u LedgerKey) MustTrustLine() LedgerKeyTrustLine

MustTrustLine retrieves the TrustLine value from the union, panicing if the value is not set.

func (LedgerKey) SwitchFieldName

func (u LedgerKey) SwitchFieldName() string

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

func (*LedgerKey) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKeyAccount

type LedgerKeyAccount struct {
	AccountId AccountId
}

func (*LedgerKeyAccount) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*LedgerKeyAccount) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerKeyAccount) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerKeyAccount) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKeyTrustLine

type LedgerKeyTrustLine struct {
	AccountId AccountId
	Asset     TrustLineAsset
}

func (*LedgerKeyTrustLine) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*LedgerKeyTrustLine) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LedgerKeyTrustLine) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerKeyTrustLine) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Liabilities

type Liabilities struct {
	Buying  Int64
	Selling Int64
}

Liabilities is an XDR Struct defines as:

struct Liabilities
 {
     int64 buying;
     int64 selling;
 };

func (*Liabilities) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*Liabilities) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Liabilities) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Liabilities) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LiquidityPoolType

type LiquidityPoolType int32

LiquidityPoolType is an XDR Enum defines as:

enum LiquidityPoolType
 {
     LIQUIDITY_POOL_CONSTANT_PRODUCT = 0
 };
const (
	LiquidityPoolTypeLiquidityPoolConstantProduct LiquidityPoolType = 0
)

func (*LiquidityPoolType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (LiquidityPoolType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (LiquidityPoolType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LiquidityPoolType) String

func (e LiquidityPoolType) String() string

String returns the name of `e`

func (*LiquidityPoolType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (LiquidityPoolType) ValidEnum

func (e LiquidityPoolType) ValidEnum(v int32) bool

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

type Memo

type Memo struct {
	Type    MemoType
	Text    *string `xdrmaxsize:"28"`
	Id      *Uint64
	Hash    *Hash
	RetHash *Hash
}

func MemoHash

func MemoHash(hash Hash) Memo

func MemoID

func MemoID(id uint64) Memo

func MemoRetHash

func MemoRetHash(hash Hash) Memo

func MemoText

func MemoText(text string) Memo

func NewMemo

func NewMemo(aType MemoType, value interface{}) (result Memo, err error)

NewMemo creates a new Memo.

func (Memo) ArmForSwitch

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

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

func (*Memo) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (Memo) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Memo) GetHash

func (u Memo) GetHash() (result Hash, ok bool)

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

func (Memo) GetId

func (u Memo) GetId() (result Uint64, ok bool)

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

func (Memo) GetRetHash

func (u Memo) GetRetHash() (result Hash, ok bool)

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

func (Memo) GetText

func (u Memo) GetText() (result string, ok bool)

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

func (Memo) GoString

func (m Memo) GoString() string

GoString implements fmt.GoStringer.

func (Memo) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (Memo) MustHash

func (u Memo) MustHash() Hash

MustHash retrieves the Hash value from the union, panicing if the value is not set.

func (Memo) MustId

func (u Memo) MustId() Uint64

MustId retrieves the Id value from the union, panicing if the value is not set.

func (Memo) MustRetHash

func (u Memo) MustRetHash() Hash

MustRetHash retrieves the RetHash value from the union, panicing if the value is not set.

func (Memo) MustText

func (u Memo) MustText() string

MustText retrieves the Text value from the union, panicing if the value is not set.

func (Memo) SwitchFieldName

func (u Memo) SwitchFieldName() string

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

func (*Memo) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type MemoType

type MemoType int32
const (
	MemoTypeMemoNone   MemoType = 0
	MemoTypeMemoText   MemoType = 1
	MemoTypeMemoId     MemoType = 2
	MemoTypeMemoHash   MemoType = 3
	MemoTypeMemoReturn MemoType = 4
)

func (*MemoType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (MemoType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (MemoType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (MemoType) String

func (e MemoType) String() string

String returns the name of `e`

func (*MemoType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (MemoType) ValidEnum

func (e MemoType) ValidEnum(v int32) bool

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

type MuxedAccount

type MuxedAccount struct {
	Type     CryptoKeyType
	Ed25519  *Uint256
	Med25519 *MuxedAccountMed25519
}

func AddressToMuxedAccount

func AddressToMuxedAccount(address string) (MuxedAccount, error)

AddressToMuxedAccount returns an MuxedAccount for a given address string or SEP23 M-address. If the address is not valid the error returned will not be nil

func MustMuxedAddress

func MustMuxedAddress(address string) MuxedAccount

func MustMuxedAddressPtr

func MustMuxedAddressPtr(address string) *MuxedAccount

func MuxedAccountFromAccountId

func MuxedAccountFromAccountId(gAddress string, id uint64) (MuxedAccount, error)

func NewMuxedAccount

func NewMuxedAccount(aType CryptoKeyType, value interface{}) (result MuxedAccount, err error)

NewMuxedAccount creates a new MuxedAccount.

func (*MuxedAccount) Address

func (m *MuxedAccount) Address() string

Address returns the strkey-encoded form of this MuxedAccount. In particular, it will return an M- strkey representation for CryptoKeyTypeKeyTypeMuxedEd25519 variants of the account (according to SEP23). This method will panic if the MuxedAccount is backed by a public key of an unknown type.

func (MuxedAccount) ArmForSwitch

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

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

func (*MuxedAccount) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (MuxedAccount) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (*MuxedAccount) GetAddress

func (m *MuxedAccount) GetAddress() (string, error)

GetAddress returns the strkey-encoded form of this MuxedAccount. In particular, it will return an M-strkey representation for CryptoKeyTypeKeyTypeMuxedEd25519 variants of the account (according to SEP23). In addition it will return an error if the MuxedAccount is backed by a public key of an unknown type.

func (MuxedAccount) GetEd25519

func (u MuxedAccount) 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 (*MuxedAccount) GetId

func (m *MuxedAccount) GetId() (uint64, error)

GetId retrieves the underlying memo ID if this is a fully muxed account. It will return an error if the muxed account does not have a memo ID (i.e it's of the key type Ed25519).

func (MuxedAccount) GetMed25519

func (u MuxedAccount) GetMed25519() (result MuxedAccountMed25519, ok bool)

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

func (MuxedAccount) GoString

func (m MuxedAccount) GoString() string

GoString implements fmt.GoStringer.

func (MuxedAccount) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (MuxedAccount) MustEd25519

func (u MuxedAccount) MustEd25519() Uint256

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

func (MuxedAccount) MustMed25519

func (u MuxedAccount) MustMed25519() MuxedAccountMed25519

MustMed25519 retrieves the Med25519 value from the union, panicing if the value is not set.

func (*MuxedAccount) SetAddress

func (m *MuxedAccount) SetAddress(address string) error

SetAddress modifies the receiver, setting it's value to the MuxedAccount form of the provided strkey G-address or M-address, as described in SEP23.

func (*MuxedAccount) SetEd25519Address

func (m *MuxedAccount) SetEd25519Address(address string) error

SetEd25519Address modifies the receiver, setting it's value to the MuxedAccount form of the provided G-address. Unlike SetAddress(), it only supports G-addresses.

func (MuxedAccount) SwitchFieldName

func (u MuxedAccount) SwitchFieldName() string

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

func (MuxedAccount) ToAccountId

func (m MuxedAccount) ToAccountId() AccountId

ToAccountId transforms a MuxedAccount to an AccountId, dropping the memo Id if necessary

func (*MuxedAccount) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type MuxedAccountMed25519

type MuxedAccountMed25519 struct {
	Id      Uint64
	Ed25519 Uint256
}

func (*MuxedAccountMed25519) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*MuxedAccountMed25519) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (MuxedAccountMed25519) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*MuxedAccountMed25519) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Operation

type Operation struct {
	SourceAccount *MuxedAccount
	Body          OperationBody
}

func (*Operation) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*Operation) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Operation) GoString

func (o Operation) GoString() string

GoString implements fmt.GoStringer.

func (Operation) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Operation) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationBody

type OperationBody struct {
	Type          OperationType
	PaymentOp     *PaymentOp
	ChangeTrustOp *ChangeTrustOp
	AllowTrustOp  *AllowTrustOp
	Destination   *MuxedAccount
}

func NewOperationBody

func NewOperationBody(aType OperationType, value interface{}) (result OperationBody, err error)

NewOperationBody creates a new OperationBody.

func (OperationBody) ArmForSwitch

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

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

func (*OperationBody) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (OperationBody) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (OperationBody) GetAllowTrustOp

func (u OperationBody) GetAllowTrustOp() (result AllowTrustOp, ok bool)

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

func (OperationBody) GetChangeTrustOp

func (u OperationBody) GetChangeTrustOp() (result ChangeTrustOp, ok bool)

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

func (OperationBody) GetDestination

func (u OperationBody) GetDestination() (result MuxedAccount, ok bool)

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

func (OperationBody) GetPaymentOp

func (u OperationBody) GetPaymentOp() (result PaymentOp, ok bool)

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

func (OperationBody) GoString

func (o OperationBody) GoString() string

GoString implements fmt.GoStringer.

func (OperationBody) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationBody) MustAllowTrustOp

func (u OperationBody) MustAllowTrustOp() AllowTrustOp

MustAllowTrustOp retrieves the AllowTrustOp value from the union, panicing if the value is not set.

func (OperationBody) MustChangeTrustOp

func (u OperationBody) MustChangeTrustOp() ChangeTrustOp

MustChangeTrustOp retrieves the ChangeTrustOp value from the union, panicing if the value is not set.

func (OperationBody) MustDestination

func (u OperationBody) MustDestination() MuxedAccount

MustDestination retrieves the Destination value from the union, panicing if the value is not set.

func (OperationBody) MustPaymentOp

func (u OperationBody) MustPaymentOp() PaymentOp

MustPaymentOp retrieves the PaymentOp value from the union, panicing if the value is not set.

func (OperationBody) SwitchFieldName

func (u OperationBody) SwitchFieldName() string

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

func (*OperationBody) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationType

type OperationType int32
const (
	OperationTypePayment                  OperationType = 1
	OperationTypePathPaymentStrictReceive OperationType = 2
	OperationTypeManageSellOffer          OperationType = 3
	OperationTypeCreatePassiveSellOffer   OperationType = 4
	OperationTypeSetOptions               OperationType = 5
	OperationTypeChangeTrust              OperationType = 6
	OperationTypeAllowTrust               OperationType = 7
	OperationTypeAccountMerge             OperationType = 8
	OperationTypeInflation                OperationType = 9
)

func (*OperationType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (OperationType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (OperationType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationType) String

func (e OperationType) String() string

String returns the name of `e`

func (*OperationType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (OperationType) ValidEnum

func (e OperationType) ValidEnum(v int32) bool

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

type PaymentOp

type PaymentOp struct {
	Destination MuxedAccount
	Asset       Asset
	Amount      Int64
}

func (*PaymentOp) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*PaymentOp) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (PaymentOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PaymentOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PoolId

type PoolId Hash

PoolId is an XDR Typedef defines as:

typedef Hash PoolID;

func (*PoolId) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*PoolId) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (PoolId) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PoolId) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PreconditionType

type PreconditionType int32
const (
	PreconditionTypePrecondNone PreconditionType = 0
	PreconditionTypePrecondTime PreconditionType = 1
	PreconditionTypePrecondV2   PreconditionType = 2
)

func (*PreconditionType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (PreconditionType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (PreconditionType) GoString

func (pt PreconditionType) GoString() string

GoString implements fmt.GoStringer.

func (PreconditionType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PreconditionType) String

func (e PreconditionType) String() string

String returns the name of `e`

func (*PreconditionType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PreconditionType) ValidEnum

func (e PreconditionType) ValidEnum(v int32) bool

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

type Preconditions

type Preconditions struct {
	Type       PreconditionType
	TimeBounds *TimeBounds
	V2         *PreconditionsV2
}

func NewPreconditions

func NewPreconditions(aType PreconditionType, value interface{}) (result Preconditions, err error)

NewPreconditions creates a new Preconditions.

func NewPreconditionsWithTimeBounds

func NewPreconditionsWithTimeBounds(timebounds *TimeBounds) Preconditions

NewPreconditionsWithTimebounds constructs the simplest possible `Preconditions` instance given the (possibly empty) timebounds.

func (Preconditions) ArmForSwitch

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

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

func (*Preconditions) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (Preconditions) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Preconditions) GetTimeBounds

func (u Preconditions) GetTimeBounds() (result TimeBounds, ok bool)

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

func (Preconditions) GetV2

func (u Preconditions) GetV2() (result PreconditionsV2, ok bool)

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

func (Preconditions) GoString

func (p Preconditions) GoString() string

GoString implements fmt.GoStringer.

func (Preconditions) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (Preconditions) MustTimeBounds

func (u Preconditions) MustTimeBounds() TimeBounds

MustTimeBounds retrieves the TimeBounds value from the union, panicing if the value is not set.

func (Preconditions) MustV2

func (u Preconditions) MustV2() PreconditionsV2

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

func (Preconditions) SwitchFieldName

func (u Preconditions) SwitchFieldName() string

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

func (*Preconditions) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PreconditionsV2

type PreconditionsV2 struct {
	TimeBounds      *TimeBounds
	LedgerBounds    *LedgerBounds
	MinSeqNum       *SequenceNumber
	MinSeqAge       Duration
	MinSeqLedgerGap Uint32
	ExtraSigners    []SignerKey `xdrmaxsize:"2"`
}

func (*PreconditionsV2) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*PreconditionsV2) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (PreconditionsV2) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PreconditionsV2) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PublicKey

type PublicKey struct {
	Type    PublicKeyType
	Ed25519 *Uint256
}

PublicKey is an XDR Union defines as:

union PublicKey switch (PublicKeyType type)
 {
 case PUBLIC_KEY_TYPE_ED25519:
     uint256 ed25519;
 };

func NewPublicKey

func NewPublicKey(aType PublicKeyType, value interface{}) (result PublicKey, err error)

NewPublicKey creates a new PublicKey.

func (PublicKey) ArmForSwitch

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

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

func (*PublicKey) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (PublicKey) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (PublicKey) GetEd25519

func (u PublicKey) 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 (PublicKey) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PublicKey) MustEd25519

func (u PublicKey) MustEd25519() Uint256

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

func (PublicKey) SwitchFieldName

func (u PublicKey) SwitchFieldName() string

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

func (*PublicKey) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PublicKeyType

type PublicKeyType int32
const (
	PublicKeyTypePublicKeyTypeEd25519 PublicKeyType = 0
)

func (*PublicKeyType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (PublicKeyType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (PublicKeyType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PublicKeyType) String

func (e PublicKeyType) String() string

String returns the name of `e`

func (*PublicKeyType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PublicKeyType) ValidEnum

func (e PublicKeyType) ValidEnum(v int32) bool

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

type SequenceNumber

type SequenceNumber Int64

func (*SequenceNumber) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (SequenceNumber) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (SequenceNumber) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*SequenceNumber) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Signature

type Signature []byte

Signature is an XDR Typedef defines as:

typedef opaque Signature<64>;

func (*Signature) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (Signature) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Signature) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Signature) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (Signature) XDRMaxSize

func (e Signature) XDRMaxSize() int

XDRMaxSize implements the Sized interface for Signature

type SignatureHint

type SignatureHint [4]byte

SignatureHint is an XDR Typedef defines as:

typedef opaque SignatureHint[4];

func (*SignatureHint) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*SignatureHint) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (SignatureHint) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*SignatureHint) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (SignatureHint) XDRMaxSize

func (e SignatureHint) XDRMaxSize() int

XDRMaxSize implements the Sized interface for SignatureHint

type Signer

type Signer struct {
	Key    SignerKey
	Weight Uint32
}

func SortSignersByKey

func SortSignersByKey(signers []Signer) []Signer

SortSignersByKey returns a new []Signer array sorted by signer key.

func (*Signer) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*Signer) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Signer) GoString

func (s Signer) GoString() string

GoString implements fmt.GoStringer.

func (Signer) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Signer) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type SignerKey

type SignerKey struct {
	Type                 SignerKeyType
	Ed25519              *Uint256
	PreAuthTx            *Uint256
	HashX                *Uint256
	Ed25519SignedPayload *SignerKeyEd25519SignedPayload
}

SignerKey is an XDR Union defines as:

union SignerKey switch (SignerKeyType type)
 {
 case SIGNER_KEY_TYPE_ED25519:
     uint256 ed25519;
 case SIGNER_KEY_TYPE_PRE_AUTH_TX:
     /* SHA-256 Hash of TransactionSignaturePayload structure */
     uint256 preAuthTx;
 case SIGNER_KEY_TYPE_HASH_X:
     /* Hash of random 256 bit preimage X */
     uint256 hashX;
 case SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD:
     struct
     {
         /* Public key that must sign the payload. */
         uint256 ed25519;
         /* Payload to be raw signed by ed25519. */
         opaque payload<64>;
     } ed25519SignedPayload;
 };

func MustSigner

func MustSigner(address string) SignerKey

func NewSignerKey

func NewSignerKey(aType SignerKeyType, value interface{}) (result SignerKey, err error)

NewSignerKey creates a new SignerKey.

func (*SignerKey) Address

func (skey *SignerKey) Address() string

Address returns the strkey encoded form of this signer key. This method will panic if the SignerKey is of an unknown type.

func (SignerKey) ArmForSwitch

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

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

func (*SignerKey) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (SignerKey) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (*SignerKey) Equals

func (skey *SignerKey) Equals(other SignerKey) bool

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

func (*SignerKey) GetAddress

func (skey *SignerKey) GetAddress() (string, error)

GetAddress returns the strkey encoded form of this signer key, and an error if the SignerKey is of an unknown type.

func (SignerKey) GetEd25519

func (u SignerKey) 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 (SignerKey) GetEd25519SignedPayload

func (u SignerKey) GetEd25519SignedPayload() (result SignerKeyEd25519SignedPayload, ok bool)

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

func (SignerKey) GetHashX

func (u SignerKey) GetHashX() (result Uint256, ok bool)

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

func (SignerKey) GetPreAuthTx

func (u SignerKey) GetPreAuthTx() (result Uint256, ok bool)

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

func (SignerKey) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (SignerKey) MustEd25519

func (u SignerKey) MustEd25519() Uint256

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

func (SignerKey) MustEd25519SignedPayload

func (u SignerKey) MustEd25519SignedPayload() SignerKeyEd25519SignedPayload

MustEd25519SignedPayload retrieves the Ed25519SignedPayload value from the union, panicing if the value is not set.

func (SignerKey) MustHashX

func (u SignerKey) MustHashX() Uint256

MustHashX retrieves the HashX value from the union, panicing if the value is not set.

func (SignerKey) MustPreAuthTx

func (u SignerKey) MustPreAuthTx() Uint256

MustPreAuthTx retrieves the PreAuthTx value from the union, panicing if the value is not set.

func (*SignerKey) SetAddress

func (skey *SignerKey) SetAddress(address string) error

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

func (SignerKey) SwitchFieldName

func (u SignerKey) SwitchFieldName() string

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

func (*SignerKey) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type SignerKeyEd25519SignedPayload

type SignerKeyEd25519SignedPayload struct {
	Ed25519 Uint256
	Payload []byte `xdrmaxsize:"64"`
}

SignerKeyEd25519SignedPayload is an XDR NestedStruct defines as:

struct
     {
         /* Public key that must sign the payload. */
         uint256 ed25519;
         /* Payload to be raw signed by ed25519. */
         opaque payload<64>;
     }

func (*SignerKeyEd25519SignedPayload) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*SignerKeyEd25519SignedPayload) EncodeTo

EncodeTo encodes this value using the Encoder.

func (SignerKeyEd25519SignedPayload) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*SignerKeyEd25519SignedPayload) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type SignerKeyType

type SignerKeyType int32

SignerKeyType is an XDR Enum defines as:

enum SignerKeyType
 {
     SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519,
     SIGNER_KEY_TYPE_PRE_AUTH_TX = KEY_TYPE_PRE_AUTH_TX,
     SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X,
     SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD = KEY_TYPE_ED25519_SIGNED_PAYLOAD
 };
const (
	SignerKeyTypeSignerKeyTypeEd25519              SignerKeyType = 0
	SignerKeyTypeSignerKeyTypePreAuthTx            SignerKeyType = 1
	SignerKeyTypeSignerKeyTypeHashX                SignerKeyType = 2
	SignerKeyTypeSignerKeyTypeEd25519SignedPayload SignerKeyType = 3
)

func (*SignerKeyType) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (SignerKeyType) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (SignerKeyType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (SignerKeyType) String

func (e SignerKeyType) String() string

String returns the name of `e`

func (*SignerKeyType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (SignerKeyType) ValidEnum

func (e SignerKeyType) ValidEnum(v int32) bool

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

type SponsorshipDescriptor

type SponsorshipDescriptor = *AccountId

type String32

type String32 string

func String32Ptr

func String32Ptr(val string) *String32

func (*String32) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (String32) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (String32) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*String32) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (String32) XDRMaxSize

func (e String32) XDRMaxSize() int

XDRMaxSize implements the Sized interface for String32

type String64

type String64 string

String64 is an XDR Typedef defines as:

typedef string string64<64>;

func (*String64) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (String64) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (String64) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*String64) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (String64) XDRMaxSize

func (e String64) XDRMaxSize() int

XDRMaxSize implements the Sized interface for String64

type TimeBounds

type TimeBounds struct {
	MinTime TimePoint
	MaxTime TimePoint
}

func (*TimeBounds) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*TimeBounds) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (*TimeBounds) GoString

func (t *TimeBounds) GoString() string

GoString implements fmt.GoStringer.

func (TimeBounds) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*TimeBounds) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TimePoint

type TimePoint Uint64

TimePoint is an XDR Typedef defines as:

typedef uint64 TimePoint;

func (*TimePoint) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TimePoint) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TimePoint) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*TimePoint) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Transaction

type Transaction struct {
	SourceAccount MuxedAccount
	Fee           Uint32
	SeqNum        SequenceNumber
	Cond          Preconditions
	Memo          Memo
	Operations    []Operation `xdrmaxsize:"100"`
	Ext           TransactionExt
}

func (*Transaction) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*Transaction) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (*Transaction) ExtraSigners

func (tx *Transaction) ExtraSigners() []SignerKey

ExtraSigners extracts the extra signers (if any) from the transaction's Preconditions.

func (*Transaction) LedgerBounds

func (tx *Transaction) LedgerBounds() *LedgerBounds

LedgerBounds extracts the ledgerbounds (if any) from the transaction's Preconditions.

func (Transaction) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Transaction) MinSeqAge

func (tx *Transaction) MinSeqAge() *Duration

MinSeqAge extracts the min seq age (if any) from the transaction's Preconditions.

func (*Transaction) MinSeqLedgerGap

func (tx *Transaction) MinSeqLedgerGap() *Uint32

MinSeqLedgerGap extracts the min seq ledger gap (if any) from the transaction's Preconditions.

func (*Transaction) MinSeqNum

func (tx *Transaction) MinSeqNum() *SequenceNumber

MinSeqNum extracts the min seq number (if any) from the transaction's Preconditions.

func (*Transaction) TimeBounds

func (tx *Transaction) TimeBounds() *TimeBounds

TimeBounds extracts the timebounds (if any) from the transaction's Preconditions.

func (*Transaction) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransactionEnvelope

type TransactionEnvelope struct {
	Type    EnvelopeType
	V0      *TransactionV0Envelope
	V1      *TransactionV1Envelope
	FeeBump *FeeBumpTransactionEnvelope
}

func NewTransactionEnvelope

func NewTransactionEnvelope(aType EnvelopeType, value interface{}) (result TransactionEnvelope, err error)

NewTransactionEnvelope creates a new TransactionEnvelope.

func (TransactionEnvelope) ArmForSwitch

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

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

func (*TransactionEnvelope) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TransactionEnvelope) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TransactionEnvelope) ExtraSigners

func (e TransactionEnvelope) ExtraSigners() []SignerKey

ExtraSigners returns the extra signers set in the transaction envelope. Note for fee bump transactions, ExtraSigners() returns the field from the inner transaction

func (TransactionEnvelope) Fee

func (e TransactionEnvelope) Fee() uint32

Fee returns the fee defined for the transaction envelope If the transaction envelope is for a fee bump transaction, Fee() returns the fee defined in the inner transaction

func (TransactionEnvelope) FeeBumpAccount

func (e TransactionEnvelope) FeeBumpAccount() MuxedAccount

FeeBumpAccount returns the account paying for the fee bump transaction

func (TransactionEnvelope) FeeBumpFee

func (e TransactionEnvelope) FeeBumpFee() int64

FeeBumpFee returns the fee defined for the fee bump transaction

func (TransactionEnvelope) FeeBumpSignatures

func (e TransactionEnvelope) FeeBumpSignatures() []DecoratedSignature

FeeBumpSignatures returns the list of signatures for the fee bump transaction

func (TransactionEnvelope) GetFeeBump

func (u TransactionEnvelope) GetFeeBump() (result FeeBumpTransactionEnvelope, ok bool)

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

func (TransactionEnvelope) GetV0

func (u TransactionEnvelope) GetV0() (result TransactionV0Envelope, ok bool)

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

func (TransactionEnvelope) GetV1

func (u TransactionEnvelope) GetV1() (result TransactionV1Envelope, ok bool)

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

func (TransactionEnvelope) GoString

func (e TransactionEnvelope) GoString() string

GoString implements fmt.GoStringer.

func (TransactionEnvelope) IsFeeBump

func (e TransactionEnvelope) IsFeeBump() bool

IsFeeBump returns true if the transaction envelope is a fee bump transaction

func (TransactionEnvelope) LedgerBounds

func (e TransactionEnvelope) LedgerBounds() *LedgerBounds

LedgerBounds returns the ledger bounds set in the transaction envelope. Note for fee bump transactions, LedgerBounds() returns the ledger bounds of the inner transaction

func (TransactionEnvelope) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (TransactionEnvelope) Memo

func (e TransactionEnvelope) Memo() Memo

Memo returns the memo set in the transaction envelope Note for fee bump transactions, Memo() returns the memo of the inner transaction

func (TransactionEnvelope) MinSeqAge

func (e TransactionEnvelope) MinSeqAge() *Duration

MinSeqAge returns the min seq age set in the transaction envelope. Note for fee bump transactions, MinSeqAge() returns the field from the inner transaction

func (TransactionEnvelope) MinSeqLedgerGap

func (e TransactionEnvelope) MinSeqLedgerGap() *Uint32

MinSeqLedgerGap returns the min seq ledger gap set in the transaction. envelope. Note for fee bump transactions, MinSeqLedgerGap() returns the field from the inner transaction

func (TransactionEnvelope) MinSeqNum

func (e TransactionEnvelope) MinSeqNum() *int64

MinSeqNum returns the minimum sequence number set in the transaction envelope

Note for fee bump transactions, MinSeqNum() returns the sequence number of the inner transaction

func (TransactionEnvelope) MustFeeBump

MustFeeBump retrieves the FeeBump value from the union, panicing if the value is not set.

func (TransactionEnvelope) MustV0

MustV0 retrieves the V0 value from the union, panicing if the value is not set.

func (TransactionEnvelope) MustV1

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

func (TransactionEnvelope) Operations

func (e TransactionEnvelope) Operations() []Operation

Operations returns the operations set in the transaction envelope Note for fee bump transactions, Operations() returns the operations of the inner transaction

func (TransactionEnvelope) Preconditions

func (e TransactionEnvelope) Preconditions() Preconditions

Preconditions returns the preconditions on the transaction. If the transaction is a V0 envelope (aka before preconditions existed), this returns a new precondition (timebound if present, empty otherwise). If the transaction is a fee bump, it returns the preconditions of the *inner* transaction.

func (TransactionEnvelope) SeqNum

func (e TransactionEnvelope) SeqNum() int64

SeqNum returns the sequence number set in the transaction envelope Note for fee bump transactions, SeqNum() returns the sequence number of the inner transaction

func (TransactionEnvelope) Signatures

func (e TransactionEnvelope) Signatures() []DecoratedSignature

Signatures returns the list of signatures included in the transaction envelope If the transaction envelope is for a fee bump transaction, Signatures() returns the signatures for the inner transaction

func (TransactionEnvelope) SourceAccount

func (e TransactionEnvelope) SourceAccount() MuxedAccount

SourceAccount returns the source account for the transaction If the transaction envelope is for a fee bump transaction, SourceAccount() returns the source account of the inner transaction

func (TransactionEnvelope) SwitchFieldName

func (u TransactionEnvelope) SwitchFieldName() string

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

func (TransactionEnvelope) TimeBounds

func (e TransactionEnvelope) TimeBounds() *TimeBounds

TimeBounds returns the time bounds set in the transaction envelope Note for fee bump transactions, TimeBounds() returns the time bounds of the inner transaction

func (*TransactionEnvelope) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransactionExt

type TransactionExt struct {
	V int32
}

func NewTransactionExt

func NewTransactionExt(v int32, value interface{}) (result TransactionExt, err error)

NewTransactionExt creates a new TransactionExt.

func (TransactionExt) ArmForSwitch

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

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

func (*TransactionExt) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TransactionExt) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TransactionExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (TransactionExt) SwitchFieldName

func (u TransactionExt) SwitchFieldName() string

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

func (*TransactionExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransactionSignaturePayload

type TransactionSignaturePayload struct {
	NetworkId         Hash
	TaggedTransaction TransactionSignaturePayloadTaggedTransaction
}

func (*TransactionSignaturePayload) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*TransactionSignaturePayload) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TransactionSignaturePayload) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*TransactionSignaturePayload) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransactionSignaturePayloadTaggedTransaction

type TransactionSignaturePayloadTaggedTransaction struct {
	Type    EnvelopeType
	Tx      *Transaction
	FeeBump *FeeBumpTransaction
}

func NewTransactionSignaturePayloadTaggedTransaction

func NewTransactionSignaturePayloadTaggedTransaction(aType EnvelopeType, value interface{}) (result TransactionSignaturePayloadTaggedTransaction, err error)

NewTransactionSignaturePayloadTaggedTransaction creates a new TransactionSignaturePayloadTaggedTransaction.

func (TransactionSignaturePayloadTaggedTransaction) ArmForSwitch

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

func (*TransactionSignaturePayloadTaggedTransaction) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TransactionSignaturePayloadTaggedTransaction) EncodeTo

EncodeTo encodes this value using the Encoder.

func (TransactionSignaturePayloadTaggedTransaction) GetFeeBump

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

func (TransactionSignaturePayloadTaggedTransaction) GetTx

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

func (TransactionSignaturePayloadTaggedTransaction) MarshalBinary

MarshalBinary implements encoding.BinaryMarshaler.

func (TransactionSignaturePayloadTaggedTransaction) MustFeeBump

MustFeeBump retrieves the FeeBump value from the union, panicing if the value is not set.

func (TransactionSignaturePayloadTaggedTransaction) MustTx

MustTx retrieves the Tx value from the union, panicing if the value is not set.

func (TransactionSignaturePayloadTaggedTransaction) SwitchFieldName

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

func (*TransactionSignaturePayloadTaggedTransaction) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransactionV0

type TransactionV0 struct {
	SourceAccountEd25519 Uint256
	Fee                  Uint32
	SeqNum               SequenceNumber
	TimeBounds           *TimeBounds
	Memo                 Memo
	Operations           []Operation `xdrmaxsize:"100"`
	Ext                  TransactionV0Ext
}

func (*TransactionV0) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*TransactionV0) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TransactionV0) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*TransactionV0) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransactionV0Envelope

type TransactionV0Envelope struct {
	Tx         TransactionV0
	Signatures []DecoratedSignature `xdrmaxsize:"20"`
}

func (*TransactionV0Envelope) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*TransactionV0Envelope) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TransactionV0Envelope) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*TransactionV0Envelope) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransactionV0Ext

type TransactionV0Ext struct {
	V int32
}

func NewTransactionV0Ext

func NewTransactionV0Ext(v int32, value interface{}) (result TransactionV0Ext, err error)

NewTransactionV0Ext creates a new TransactionV0Ext.

func (TransactionV0Ext) ArmForSwitch

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

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

func (*TransactionV0Ext) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TransactionV0Ext) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TransactionV0Ext) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (TransactionV0Ext) SwitchFieldName

func (u TransactionV0Ext) SwitchFieldName() string

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

func (*TransactionV0Ext) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransactionV1Envelope

type TransactionV1Envelope struct {
	Tx         Transaction
	Signatures []DecoratedSignature `xdrmaxsize:"20"`
}

func (*TransactionV1Envelope) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*TransactionV1Envelope) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TransactionV1Envelope) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*TransactionV1Envelope) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TrustLineAsset

type TrustLineAsset struct {
	Type            AssetType
	AlphaNum4       *AlphaNum4
	AlphaNum12      *AlphaNum12
	LiquidityPoolId *PoolId
}

TrustLineAsset is an XDR Union defines as:

union TrustLineAsset switch (AssetType type)
 {
 case ASSET_TYPE_NATIVE: // Not credit
     void;

 case ASSET_TYPE_CREDIT_ALPHANUM4:
     AlphaNum4 alphaNum4;

 case ASSET_TYPE_CREDIT_ALPHANUM12:
     AlphaNum12 alphaNum12;

 case ASSET_TYPE_POOL_SHARE:
     PoolID liquidityPoolID;

     // add other asset types here in the future
 };

func NewTrustLineAsset

func NewTrustLineAsset(aType AssetType, value interface{}) (result TrustLineAsset, err error)

NewTrustLineAsset creates a new TrustLineAsset.

func (TrustLineAsset) ArmForSwitch

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

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

func (*TrustLineAsset) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TrustLineAsset) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TrustLineAsset) Equals

func (a TrustLineAsset) Equals(other TrustLineAsset) bool

func (TrustLineAsset) Extract

func (a TrustLineAsset) Extract(typ interface{}, code interface{}, issuer interface{}) error

MustExtract behaves as Extract, but panics if an error occurs.

func (TrustLineAsset) GetAlphaNum12

func (u TrustLineAsset) GetAlphaNum12() (result AlphaNum12, ok bool)

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

func (TrustLineAsset) GetAlphaNum4

func (u TrustLineAsset) GetAlphaNum4() (result AlphaNum4, ok bool)

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

func (TrustLineAsset) GetLiquidityPoolId

func (u TrustLineAsset) GetLiquidityPoolId() (result PoolId, ok bool)

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

func (TrustLineAsset) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (TrustLineAsset) MustAlphaNum12

func (u TrustLineAsset) MustAlphaNum12() AlphaNum12

MustAlphaNum12 retrieves the AlphaNum12 value from the union, panicing if the value is not set.

func (TrustLineAsset) MustAlphaNum4

func (u TrustLineAsset) MustAlphaNum4() AlphaNum4

MustAlphaNum4 retrieves the AlphaNum4 value from the union, panicing if the value is not set.

func (TrustLineAsset) MustExtract

func (a TrustLineAsset) MustExtract(typ interface{}, code interface{}, issuer interface{})

MustExtract behaves as Extract, but panics if an error occurs.

func (TrustLineAsset) MustLiquidityPoolId

func (u TrustLineAsset) MustLiquidityPoolId() PoolId

MustLiquidityPoolId retrieves the LiquidityPoolId value from the union, panicing if the value is not set.

func (TrustLineAsset) SwitchFieldName

func (u TrustLineAsset) SwitchFieldName() string

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

func (TrustLineAsset) ToAsset

func (tla TrustLineAsset) ToAsset() Asset

ToAsset converts TrustLineAsset to Asset. Panics on type other than AssetTypeAssetTypeNative, AssetTypeAssetTypeCreditAlphanum4 or AssetTypeAssetTypeCreditAlphanum12.

func (*TrustLineAsset) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TrustLineEntry

type TrustLineEntry struct {
	AccountId AccountId
	Asset     TrustLineAsset
	Balance   Int64
	Limit     Int64
	Flags     Uint32
	Ext       TrustLineEntryExt
}

func (*TrustLineEntry) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*TrustLineEntry) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (*TrustLineEntry) Liabilities

func (trustLine *TrustLineEntry) Liabilities() Liabilities

Liabilities returns TrustLineEntry's liabilities

func (TrustLineEntry) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*TrustLineEntry) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TrustLineEntryExt

type TrustLineEntryExt struct {
	V  int32
	V1 *TrustLineEntryV1
}

func NewTrustLineEntryExt

func NewTrustLineEntryExt(v int32, value interface{}) (result TrustLineEntryExt, err error)

NewTrustLineEntryExt creates a new TrustLineEntryExt.

func (TrustLineEntryExt) ArmForSwitch

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

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

func (*TrustLineEntryExt) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TrustLineEntryExt) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TrustLineEntryExt) GetV1

func (u TrustLineEntryExt) GetV1() (result TrustLineEntryV1, ok bool)

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

func (TrustLineEntryExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (TrustLineEntryExt) MustV1

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

func (TrustLineEntryExt) SwitchFieldName

func (u TrustLineEntryExt) SwitchFieldName() string

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

func (*TrustLineEntryExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TrustLineEntryExtensionV2

type TrustLineEntryExtensionV2 struct {
	LiquidityPoolUseCount Int32
	Ext                   TrustLineEntryExtensionV2Ext
}

TrustLineEntryExtensionV2 is an XDR Struct defines as:

struct TrustLineEntryExtensionV2
 {
     int32 liquidityPoolUseCount;

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

func (*TrustLineEntryExtensionV2) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*TrustLineEntryExtensionV2) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TrustLineEntryExtensionV2) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*TrustLineEntryExtensionV2) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TrustLineEntryExtensionV2Ext

type TrustLineEntryExtensionV2Ext struct {
	V int32
}

TrustLineEntryExtensionV2Ext is an XDR NestedUnion defines as:

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

func NewTrustLineEntryExtensionV2Ext

func NewTrustLineEntryExtensionV2Ext(v int32, value interface{}) (result TrustLineEntryExtensionV2Ext, err error)

NewTrustLineEntryExtensionV2Ext creates a new TrustLineEntryExtensionV2Ext.

func (TrustLineEntryExtensionV2Ext) ArmForSwitch

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

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

func (*TrustLineEntryExtensionV2Ext) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TrustLineEntryExtensionV2Ext) EncodeTo

EncodeTo encodes this value using the Encoder.

func (TrustLineEntryExtensionV2Ext) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (TrustLineEntryExtensionV2Ext) SwitchFieldName

func (u TrustLineEntryExtensionV2Ext) SwitchFieldName() string

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

func (*TrustLineEntryExtensionV2Ext) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TrustLineEntryV1

type TrustLineEntryV1 struct {
	Liabilities Liabilities
	Ext         TrustLineEntryV1Ext
}

TrustLineEntryV1 is an XDR NestedStruct defines as:

struct
         {
             Liabilities liabilities;

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

func (*TrustLineEntryV1) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*TrustLineEntryV1) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TrustLineEntryV1) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*TrustLineEntryV1) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TrustLineEntryV1Ext

type TrustLineEntryV1Ext struct {
	V  int32
	V2 *TrustLineEntryExtensionV2
}

TrustLineEntryV1Ext is an XDR NestedUnion defines as:

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

func NewTrustLineEntryV1Ext

func NewTrustLineEntryV1Ext(v int32, value interface{}) (result TrustLineEntryV1Ext, err error)

NewTrustLineEntryV1Ext creates a new TrustLineEntryV1Ext.

func (TrustLineEntryV1Ext) ArmForSwitch

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

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

func (*TrustLineEntryV1Ext) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TrustLineEntryV1Ext) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TrustLineEntryV1Ext) GetV2

func (u TrustLineEntryV1Ext) GetV2() (result TrustLineEntryExtensionV2, ok bool)

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

func (TrustLineEntryV1Ext) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (TrustLineEntryV1Ext) MustV2

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

func (TrustLineEntryV1Ext) SwitchFieldName

func (u TrustLineEntryV1Ext) SwitchFieldName() string

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

func (*TrustLineEntryV1Ext) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TrustLineFlags

type TrustLineFlags int32
const (
	TrustLineFlagsAuthorizedFlag                      TrustLineFlags = 1
	TrustLineFlagsAuthorizedToMaintainLiabilitiesFlag TrustLineFlags = 2
	TrustLineFlagsTrustlineClawbackEnabledFlag        TrustLineFlags = 4
)

func (*TrustLineFlags) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (TrustLineFlags) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (TrustLineFlags) IsAuthorized

func (e TrustLineFlags) IsAuthorized() bool

IsAuthorized returns true if issuer has authorized account to perform transactions with its credit

func (TrustLineFlags) IsAuthorizedToMaintainLiabilitiesFlag

func (e TrustLineFlags) IsAuthorizedToMaintainLiabilitiesFlag() bool

IsAuthorizedToMaintainLiabilitiesFlag returns true if the issuer has authorized the account to maintain and reduce liabilities for its credit

func (TrustLineFlags) IsClawbackEnabledFlag

func (e TrustLineFlags) IsClawbackEnabledFlag() bool

IsClawbackEnabledFlag returns true if the issuer has authorized the account to claw assets back

func (TrustLineFlags) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (TrustLineFlags) String

func (e TrustLineFlags) String() string

String returns the name of `e`

func (*TrustLineFlags) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (TrustLineFlags) ValidEnum

func (e TrustLineFlags) ValidEnum(v int32) bool

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

type Uint256

type Uint256 [32]byte

Uint256 is an XDR Typedef defines as:

typedef opaque uint256[32];

func (*Uint256) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (*Uint256) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Uint256) Equals

func (s Uint256) Equals(o Uint256) bool

func (Uint256) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (Uint256) String

func (u Uint256) String() string

String returns a display friendly form of the uint256

func (*Uint256) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (Uint256) XDRMaxSize

func (e Uint256) XDRMaxSize() int

XDRMaxSize implements the Sized interface for Uint256

type Uint32

type Uint32 uint32

Uint32 is an XDR Typedef defines as:

typedef unsigned int uint32;

func (*Uint32) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (Uint32) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Uint32) GoString

func (u Uint32) GoString() string

GoString prints Uint32 as decimal instead of hexadecimal numbers.

func (Uint32) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Uint32) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Uint64

type Uint64 uint64

Uint64 is an XDR Typedef defines as:

typedef unsigned hyper uint64;

func (*Uint64) DecodeFrom

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

DecodeFrom decodes this value using the Decoder.

func (Uint64) EncodeTo

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

EncodeTo encodes this value using the Encoder.

func (Uint64) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Uint64) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL