xdr

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

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

Package xdr is generated from:

Stellar-SCP.x
Stellar-ledger-entries.x
Stellar-ledger.x
Stellar-overlay.x
Stellar-transaction.x
Stellar-types.x

DO NOT EDIT or your changes may be overwritten

Index

Examples

Constants

View Source
const LiquidityPoolFeeV18 = 30

LiquidityPoolFeeV18 is an XDR Const defines as:

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

MaskAccountFlags is an XDR Const defines as:

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

MaskAccountFlagsV17 is an XDR Const defines as:

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

MaskClaimableBalanceFlags is an XDR Const defines as:

const MASK_CLAIMABLE_BALANCE_FLAGS = 0x1;
View Source
const MaskOfferentryFlags = 1

MaskOfferentryFlags is an XDR Const defines as:

const MASK_OFFERENTRY_FLAGS = 1;
View Source
const MaskTrustlineFlags = 1

MaskTrustlineFlags is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS = 1;
View Source
const MaskTrustlineFlagsV13 = 3

MaskTrustlineFlagsV13 is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS_V13 = 3;
View Source
const MaskTrustlineFlagsV17 = 7

MaskTrustlineFlagsV17 is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS_V17 = 7;
View Source
const MaxOpsPerTx = 100

MaxOpsPerTx is an XDR Const defines as:

const MAX_OPS_PER_TX = 100;
View Source
const MaxSigners = 20

MaxSigners is an XDR Const defines as:

const MAX_SIGNERS = 20;

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 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(r io.Reader) (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 unmarshalling 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`.

Example

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

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

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

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

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

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

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

read 196 bytes
This tx has 1 operations

func UnmarshalFramed

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

XDR and RPC define a (minimal) framing format which our metadata arrives in: a 4-byte big-endian length header that has the high bit set, followed by that length worth of XDR data. Decoding this involves just a little more work than xdr.Unmarshal.

Types

type AccountEntry

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

AccountEntry is an XDR Struct defines as:

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

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

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

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

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

func (*AccountEntry) Liabilities

func (account *AccountEntry) Liabilities() Liabilities

Liabilities returns AccountEntry's liabilities

func (AccountEntry) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntry) MasterKeyWeight

func (account *AccountEntry) MasterKeyWeight() byte

func (*AccountEntry) NumSponsored

func (account *AccountEntry) NumSponsored() Uint32

NumSponsored returns NumSponsored value for account.

func (*AccountEntry) NumSponsoring

func (account *AccountEntry) NumSponsoring() Uint32

NumSponsoring returns NumSponsoring value for account.

func (*AccountEntry) SignerSponsoringIDs

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

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

func (*AccountEntry) SignerSummary

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

func (*AccountEntry) SponsorPerSigner

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

SponsorPerSigner returns a mapping of signer to its sponsor

func (*AccountEntry) ThresholdHigh

func (account *AccountEntry) ThresholdHigh() byte

func (*AccountEntry) ThresholdLow

func (account *AccountEntry) ThresholdLow() byte

func (*AccountEntry) ThresholdMedium

func (account *AccountEntry) ThresholdMedium() byte

func (*AccountEntry) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExt

type AccountEntryExt struct {
	V  int32
	V1 *AccountEntryExtensionV1
}

AccountEntryExt is an XDR NestedUnion defines as:

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

func NewAccountEntryExt

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

NewAccountEntryExt creates a new AccountEntryExt.

func (AccountEntryExt) ArmForSwitch

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

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

func (AccountEntryExt) GetV1

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

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

func (AccountEntryExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountEntryExt) MustV1

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

func (AccountEntryExt) SwitchFieldName

func (u AccountEntryExt) SwitchFieldName() string

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

func (*AccountEntryExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtensionV1

type AccountEntryExtensionV1 struct {
	Liabilities Liabilities
	Ext         AccountEntryExtensionV1Ext
}

AccountEntryExtensionV1 is an XDR Struct defines as:

struct AccountEntryExtensionV1
 {
     Liabilities liabilities;

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

func (AccountEntryExtensionV1) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntryExtensionV1) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtensionV1Ext

type AccountEntryExtensionV1Ext struct {
	V  int32
	V2 *AccountEntryExtensionV2
}

AccountEntryExtensionV1Ext is an XDR NestedUnion defines as:

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

func NewAccountEntryExtensionV1Ext

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

NewAccountEntryExtensionV1Ext creates a new AccountEntryExtensionV1Ext.

func (AccountEntryExtensionV1Ext) ArmForSwitch

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

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

func (AccountEntryExtensionV1Ext) GetV2

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

func (AccountEntryExtensionV1Ext) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountEntryExtensionV1Ext) MustV2

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

func (AccountEntryExtensionV1Ext) SwitchFieldName

func (u AccountEntryExtensionV1Ext) SwitchFieldName() string

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

func (*AccountEntryExtensionV1Ext) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtensionV2

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

AccountEntryExtensionV2 is an XDR Struct defines as:

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

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

func (AccountEntryExtensionV2) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntryExtensionV2) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExtensionV2Ext

type AccountEntryExtensionV2Ext struct {
	V int32
}

AccountEntryExtensionV2Ext is an XDR NestedUnion defines as:

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

func NewAccountEntryExtensionV2Ext

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

NewAccountEntryExtensionV2Ext creates a new AccountEntryExtensionV2Ext.

func (AccountEntryExtensionV2Ext) ArmForSwitch

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

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

func (AccountEntryExtensionV2Ext) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountEntryExtensionV2Ext) SwitchFieldName

func (u AccountEntryExtensionV2Ext) SwitchFieldName() string

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

func (*AccountEntryExtensionV2Ext) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountFlags

type AccountFlags int32

AccountFlags is an XDR Enum defines as:

enum AccountFlags
 { // masks for each flag

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

func (AccountFlags) IsAuthClawbackEnabled

func (accountFlags AccountFlags) IsAuthClawbackEnabled() bool

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

func (AccountFlags) IsAuthImmutable

func (accountFlags AccountFlags) IsAuthImmutable() bool

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

func (AccountFlags) IsAuthRequired

func (accountFlags AccountFlags) IsAuthRequired() bool

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

func (AccountFlags) IsAuthRevocable

func (accountFlags AccountFlags) IsAuthRevocable() bool

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

func (AccountFlags) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountFlags) Scan

func (t *AccountFlags) Scan(src interface{}) error

Scan reads from src into an AccountFlags

func (AccountFlags) String

func (e AccountFlags) String() string

String returns the name of `e`

func (*AccountFlags) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AccountFlags) ValidEnum

func (e AccountFlags) ValidEnum(v int32) bool

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

type 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) 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() (ret LedgerKey)

LedgerKey implements the `Keyer` interface

func (AccountId) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountId) MarshalBinaryCompress

func (aid AccountId) MarshalBinaryCompress() ([]byte, error)

MarshalBinaryCompress marshals AccountId 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!

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 AccountMergeResult

type AccountMergeResult struct {
	Code                 AccountMergeResultCode
	SourceAccountBalance *Int64
}

AccountMergeResult is an XDR Union defines as:

union AccountMergeResult switch (AccountMergeResultCode code)
 {
 case ACCOUNT_MERGE_SUCCESS:
     int64 sourceAccountBalance; // how much got transferred from source account
 default:
     void;
 };

func NewAccountMergeResult

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

NewAccountMergeResult creates a new AccountMergeResult.

func (AccountMergeResult) ArmForSwitch

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

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

func (AccountMergeResult) GetSourceAccountBalance

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

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

func (AccountMergeResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountMergeResult) MustSourceAccountBalance

func (u AccountMergeResult) MustSourceAccountBalance() Int64

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

func (AccountMergeResult) SwitchFieldName

func (u AccountMergeResult) SwitchFieldName() string

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

func (*AccountMergeResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountMergeResultCode

type AccountMergeResultCode int32

AccountMergeResultCode is an XDR Enum defines as:

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

func (AccountMergeResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountMergeResultCode) String

func (e AccountMergeResultCode) String() string

String returns the name of `e`

func (*AccountMergeResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AccountMergeResultCode) ValidEnum

func (e AccountMergeResultCode) ValidEnum(v int32) bool

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

type 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) 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 AllowTrustResult

type AllowTrustResult struct {
	Code AllowTrustResultCode
}

AllowTrustResult is an XDR Union defines as:

union AllowTrustResult switch (AllowTrustResultCode code)
 {
 case ALLOW_TRUST_SUCCESS:
     void;
 default:
     void;
 };

func NewAllowTrustResult

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

NewAllowTrustResult creates a new AllowTrustResult.

func (AllowTrustResult) ArmForSwitch

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

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

func (AllowTrustResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AllowTrustResult) SwitchFieldName

func (u AllowTrustResult) SwitchFieldName() string

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

func (*AllowTrustResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AllowTrustResultCode

type AllowTrustResultCode int32

AllowTrustResultCode is an XDR Enum defines as:

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

func (AllowTrustResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AllowTrustResultCode) String

func (e AllowTrustResultCode) String() string

String returns the name of `e`

func (*AllowTrustResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AllowTrustResultCode) ValidEnum

func (e AllowTrustResultCode) ValidEnum(v int32) bool

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

type AlphaNum12

type AlphaNum12 struct {
	AssetCode AssetCode12
	Issuer    AccountId
}

AlphaNum12 is an XDR Struct defines as:

struct AlphaNum12
 {
     AssetCode12 assetCode;
     AccountID issuer;
 };

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) 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) 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) GoString

func (a Asset) GoString() string

GoString implements fmt.GoStringer.

func (Asset) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (Asset) MarshalBinaryCompress

func (a Asset) MarshalBinaryCompress() ([]byte, error)

MarshalBinaryCompress marshals Asset 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!

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) Scan

func (t *Asset) Scan(src interface{}) error

Scan reads from src into an Asset

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.

func (Asset) Value

func (t Asset) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

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 allow trust asset, panicking 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) 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) 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) 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

AssetType is an XDR Enum defines as:

enum AssetType
 {
     ASSET_TYPE_NATIVE = 0,
     ASSET_TYPE_CREDIT_ALPHANUM4 = 1,
     ASSET_TYPE_CREDIT_ALPHANUM12 = 2,
     ASSET_TYPE_POOL_SHARE = 3
 };
const (
	AssetTypeAssetTypeNative           AssetType = 0
	AssetTypeAssetTypeCreditAlphanum4  AssetType = 1
	AssetTypeAssetTypeCreditAlphanum12 AssetType = 2
	AssetTypeAssetTypePoolShare        AssetType = 3
)

func (AssetType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetType) Scan

func (t *AssetType) Scan(src interface{}) error

Scan reads from src into an AssetType

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 Auth

type Auth struct {
	Unused int32
}

Auth is an XDR Struct defines as:

struct Auth
 {
     // Empty message, just to confirm
     // establishment of MAC keys.
     int unused;
 };

func (Auth) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Auth) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AuthCert

type AuthCert struct {
	Pubkey     Curve25519Public
	Expiration Uint64
	Sig        Signature
}

AuthCert is an XDR Struct defines as:

struct AuthCert
 {
     Curve25519Public pubkey;
     uint64 expiration;
     Signature sig;
 };

func (AuthCert) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AuthCert) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AuthenticatedMessage

type AuthenticatedMessage struct {
	V  Uint32
	V0 *AuthenticatedMessageV0
}

AuthenticatedMessage is an XDR Union defines as:

union AuthenticatedMessage switch (uint32 v)
 {
 case 0:
     struct
     {
         uint64 sequence;
         StellarMessage message;
         HmacSha256Mac mac;
     } v0;
 };

func NewAuthenticatedMessage

func NewAuthenticatedMessage(v Uint32, value interface{}) (result AuthenticatedMessage, err error)

NewAuthenticatedMessage creates a new AuthenticatedMessage.

func (AuthenticatedMessage) ArmForSwitch

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

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

func (AuthenticatedMessage) GetV0

func (u AuthenticatedMessage) GetV0() (result AuthenticatedMessageV0, ok bool)

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

func (AuthenticatedMessage) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AuthenticatedMessage) MustV0

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

func (AuthenticatedMessage) SwitchFieldName

func (u AuthenticatedMessage) SwitchFieldName() string

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

func (*AuthenticatedMessage) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AuthenticatedMessageV0

type AuthenticatedMessageV0 struct {
	Sequence Uint64
	Message  StellarMessage
	Mac      HmacSha256Mac
}

AuthenticatedMessageV0 is an XDR NestedStruct defines as:

struct
     {
         uint64 sequence;
         StellarMessage message;
         HmacSha256Mac mac;
     }

func (AuthenticatedMessageV0) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AuthenticatedMessageV0) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BeginSponsoringFutureReservesOp

type BeginSponsoringFutureReservesOp struct {
	SponsoredId AccountId
}

BeginSponsoringFutureReservesOp is an XDR Struct defines as:

struct BeginSponsoringFutureReservesOp
 {
     AccountID sponsoredID;
 };

func (BeginSponsoringFutureReservesOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*BeginSponsoringFutureReservesOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BeginSponsoringFutureReservesResult

type BeginSponsoringFutureReservesResult struct {
	Code BeginSponsoringFutureReservesResultCode
}

BeginSponsoringFutureReservesResult is an XDR Union defines as:

union BeginSponsoringFutureReservesResult switch (BeginSponsoringFutureReservesResultCode code)
 {
 case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS:
     void;
 default:
     void;
 };

func NewBeginSponsoringFutureReservesResult

func NewBeginSponsoringFutureReservesResult(code BeginSponsoringFutureReservesResultCode, value interface{}) (result BeginSponsoringFutureReservesResult, err error)

NewBeginSponsoringFutureReservesResult creates a new BeginSponsoringFutureReservesResult.

func (BeginSponsoringFutureReservesResult) ArmForSwitch

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

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

func (BeginSponsoringFutureReservesResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BeginSponsoringFutureReservesResult) SwitchFieldName

func (u BeginSponsoringFutureReservesResult) SwitchFieldName() string

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

func (*BeginSponsoringFutureReservesResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BeginSponsoringFutureReservesResultCode

type BeginSponsoringFutureReservesResultCode int32

BeginSponsoringFutureReservesResultCode is an XDR Enum defines as:

enum BeginSponsoringFutureReservesResultCode
 {
     // codes considered as "success" for the operation
     BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS = 0,

     // codes considered as "failure" for the operation
     BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED = -1,
     BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED = -2,
     BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE = -3
 };
const (
	BeginSponsoringFutureReservesResultCodeBeginSponsoringFutureReservesSuccess          BeginSponsoringFutureReservesResultCode = 0
	BeginSponsoringFutureReservesResultCodeBeginSponsoringFutureReservesMalformed        BeginSponsoringFutureReservesResultCode = -1
	BeginSponsoringFutureReservesResultCodeBeginSponsoringFutureReservesAlreadySponsored BeginSponsoringFutureReservesResultCode = -2
	BeginSponsoringFutureReservesResultCodeBeginSponsoringFutureReservesRecursive        BeginSponsoringFutureReservesResultCode = -3
)

func (BeginSponsoringFutureReservesResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BeginSponsoringFutureReservesResultCode) String

String returns the name of `e`

func (*BeginSponsoringFutureReservesResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (BeginSponsoringFutureReservesResultCode) ValidEnum

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

type BucketEntry

type BucketEntry struct {
	Type      BucketEntryType
	LiveEntry *LedgerEntry
	DeadEntry *LedgerKey
	MetaEntry *BucketMetadata
}

BucketEntry is an XDR Union defines as:

union BucketEntry switch (BucketEntryType type)
 {
 case LIVEENTRY:
 case INITENTRY:
     LedgerEntry liveEntry;

 case DEADENTRY:
     LedgerKey deadEntry;
 case METAENTRY:
     BucketMetadata metaEntry;
 };

func NewBucketEntry

func NewBucketEntry(aType BucketEntryType, value interface{}) (result BucketEntry, err error)

NewBucketEntry creates a new BucketEntry.

func (BucketEntry) ArmForSwitch

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

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

func (BucketEntry) GetDeadEntry

func (u BucketEntry) GetDeadEntry() (result LedgerKey, ok bool)

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

func (BucketEntry) GetLiveEntry

func (u BucketEntry) GetLiveEntry() (result LedgerEntry, ok bool)

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

func (BucketEntry) GetMetaEntry

func (u BucketEntry) GetMetaEntry() (result BucketMetadata, ok bool)

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

func (BucketEntry) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BucketEntry) MustDeadEntry

func (u BucketEntry) MustDeadEntry() LedgerKey

MustDeadEntry retrieves the DeadEntry value from the union, panicing if the value is not set.

func (BucketEntry) MustLiveEntry

func (u BucketEntry) MustLiveEntry() LedgerEntry

MustLiveEntry retrieves the LiveEntry value from the union, panicing if the value is not set.

func (BucketEntry) MustMetaEntry

func (u BucketEntry) MustMetaEntry() BucketMetadata

MustMetaEntry retrieves the MetaEntry value from the union, panicing if the value is not set.

func (BucketEntry) SwitchFieldName

func (u BucketEntry) SwitchFieldName() string

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

func (*BucketEntry) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BucketEntryType

type BucketEntryType int32

BucketEntryType is an XDR Enum defines as:

enum BucketEntryType
 {
     METAENTRY =
         -1, // At-and-after protocol 11: bucket metadata, should come first.
     LIVEENTRY = 0, // Before protocol 11: created-or-updated;
                    // At-and-after protocol 11: only updated.
     DEADENTRY = 1,
     INITENTRY = 2 // At-and-after protocol 11: only created.
 };
const (
	BucketEntryTypeMetaentry BucketEntryType = -1
	BucketEntryTypeLiveentry BucketEntryType = 0
	BucketEntryTypeDeadentry BucketEntryType = 1
	BucketEntryTypeInitentry BucketEntryType = 2
)

func (BucketEntryType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BucketEntryType) String

func (e BucketEntryType) String() string

String returns the name of `e`

func (*BucketEntryType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (BucketEntryType) ValidEnum

func (e BucketEntryType) ValidEnum(v int32) bool

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

type BucketMetadata

type BucketMetadata struct {
	LedgerVersion Uint32
	Ext           BucketMetadataExt
}

BucketMetadata is an XDR Struct defines as:

struct BucketMetadata
 {
     // Indicates the protocol version used to create / merge this bucket.
     uint32 ledgerVersion;

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

func (BucketMetadata) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*BucketMetadata) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BucketMetadataExt

type BucketMetadataExt struct {
	V int32
}

BucketMetadataExt is an XDR NestedUnion defines as:

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

func NewBucketMetadataExt

func NewBucketMetadataExt(v int32, value interface{}) (result BucketMetadataExt, err error)

NewBucketMetadataExt creates a new BucketMetadataExt.

func (BucketMetadataExt) ArmForSwitch

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

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

func (BucketMetadataExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BucketMetadataExt) SwitchFieldName

func (u BucketMetadataExt) SwitchFieldName() string

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

func (*BucketMetadataExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BumpSequenceOp

type BumpSequenceOp struct {
	BumpTo SequenceNumber
}

BumpSequenceOp is an XDR Struct defines as:

struct BumpSequenceOp
 {
     SequenceNumber bumpTo;
 };

func (BumpSequenceOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*BumpSequenceOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BumpSequenceResult

type BumpSequenceResult struct {
	Code BumpSequenceResultCode
}

BumpSequenceResult is an XDR Union defines as:

union BumpSequenceResult switch (BumpSequenceResultCode code)
 {
 case BUMP_SEQUENCE_SUCCESS:
     void;
 default:
     void;
 };

func NewBumpSequenceResult

func NewBumpSequenceResult(code BumpSequenceResultCode, value interface{}) (result BumpSequenceResult, err error)

NewBumpSequenceResult creates a new BumpSequenceResult.

func (BumpSequenceResult) ArmForSwitch

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

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

func (BumpSequenceResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BumpSequenceResult) SwitchFieldName

func (u BumpSequenceResult) SwitchFieldName() string

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

func (*BumpSequenceResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BumpSequenceResultCode

type BumpSequenceResultCode int32

BumpSequenceResultCode is an XDR Enum defines as:

enum BumpSequenceResultCode
 {
     // codes considered as "success" for the operation
     BUMP_SEQUENCE_SUCCESS = 0,
     // codes considered as "failure" for the operation
     BUMP_SEQUENCE_BAD_SEQ = -1 // `bumpTo` is not within bounds
 };
const (
	BumpSequenceResultCodeBumpSequenceSuccess BumpSequenceResultCode = 0
	BumpSequenceResultCodeBumpSequenceBadSeq  BumpSequenceResultCode = -1
)

func (BumpSequenceResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BumpSequenceResultCode) String

func (e BumpSequenceResultCode) String() string

String returns the name of `e`

func (*BumpSequenceResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (BumpSequenceResultCode) ValidEnum

func (e BumpSequenceResultCode) ValidEnum(v int32) bool

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

type ChangeTrustAsset

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

ChangeTrustAsset is an XDR Union defines as:

union ChangeTrustAsset 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:
     LiquidityPoolParameters liquidityPool;

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

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) 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) GetLiquidityPool

func (u ChangeTrustAsset) GetLiquidityPool() (result LiquidityPoolParameters, ok bool)

GetLiquidityPool retrieves the LiquidityPool 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) MustLiquidityPool

func (u ChangeTrustAsset) MustLiquidityPool() LiquidityPoolParameters

MustLiquidityPool retrieves the LiquidityPool 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) 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 ChangeTrustResult

type ChangeTrustResult struct {
	Code ChangeTrustResultCode
}

ChangeTrustResult is an XDR Union defines as:

union ChangeTrustResult switch (ChangeTrustResultCode code)
 {
 case CHANGE_TRUST_SUCCESS:
     void;
 default:
     void;
 };

func NewChangeTrustResult

func NewChangeTrustResult(code ChangeTrustResultCode, value interface{}) (result ChangeTrustResult, err error)

NewChangeTrustResult creates a new ChangeTrustResult.

func (ChangeTrustResult) ArmForSwitch

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

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

func (ChangeTrustResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ChangeTrustResult) SwitchFieldName

func (u ChangeTrustResult) SwitchFieldName() string

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

func (*ChangeTrustResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ChangeTrustResultCode

type ChangeTrustResultCode int32

ChangeTrustResultCode is an XDR Enum defines as:

enum ChangeTrustResultCode
 {
     // codes considered as "success" for the operation
     CHANGE_TRUST_SUCCESS = 0,
     // codes considered as "failure" for the operation
     CHANGE_TRUST_MALFORMED = -1,     // bad input
     CHANGE_TRUST_NO_ISSUER = -2,     // could not find issuer
     CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance
                                      // cannot create with a limit of 0
     CHANGE_TRUST_LOW_RESERVE =
         -4, // not enough funds to create a new trust line,
     CHANGE_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed
     CHANGE_TRUST_TRUST_LINE_MISSING = -6, // Asset trustline is missing for pool
     CHANGE_TRUST_CANNOT_DELETE = -7, // Asset trustline is still referenced in a pool
     CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES = -8 // Asset trustline is deauthorized
 };
const (
	ChangeTrustResultCodeChangeTrustSuccess                    ChangeTrustResultCode = 0
	ChangeTrustResultCodeChangeTrustMalformed                  ChangeTrustResultCode = -1
	ChangeTrustResultCodeChangeTrustNoIssuer                   ChangeTrustResultCode = -2
	ChangeTrustResultCodeChangeTrustInvalidLimit               ChangeTrustResultCode = -3
	ChangeTrustResultCodeChangeTrustLowReserve                 ChangeTrustResultCode = -4
	ChangeTrustResultCodeChangeTrustSelfNotAllowed             ChangeTrustResultCode = -5
	ChangeTrustResultCodeChangeTrustTrustLineMissing           ChangeTrustResultCode = -6
	ChangeTrustResultCodeChangeTrustCannotDelete               ChangeTrustResultCode = -7
	ChangeTrustResultCodeChangeTrustNotAuthMaintainLiabilities ChangeTrustResultCode = -8
)

func (ChangeTrustResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ChangeTrustResultCode) String

func (e ChangeTrustResultCode) String() string

String returns the name of `e`

func (*ChangeTrustResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ChangeTrustResultCode) ValidEnum

func (e ChangeTrustResultCode) ValidEnum(v int32) bool

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

type ClaimAtom

type ClaimAtom struct {
	Type      ClaimAtomType
	V0        *ClaimOfferAtomV0
	OrderBook *ClaimOfferAtom
}

ClaimAtom is an XDR Union defines as:

union ClaimAtom switch (ClaimAtomType type)
 {
 case CLAIM_ATOM_TYPE_V0:
     ClaimOfferAtomV0 v0;
 case CLAIM_ATOM_TYPE_ORDER_BOOK:
     ClaimOfferAtom orderBook;
 };

func NewClaimAtom

func NewClaimAtom(aType ClaimAtomType, value interface{}) (result ClaimAtom, err error)

NewClaimAtom creates a new ClaimAtom.

func (ClaimAtom) AmountBought

func (a ClaimAtom) AmountBought() Int64

func (ClaimAtom) AmountSold

func (a ClaimAtom) AmountSold() Int64

func (ClaimAtom) ArmForSwitch

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

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

func (ClaimAtom) AssetBought

func (a ClaimAtom) AssetBought() Asset

func (ClaimAtom) AssetSold

func (a ClaimAtom) AssetSold() Asset

func (ClaimAtom) GetOrderBook

func (u ClaimAtom) GetOrderBook() (result ClaimOfferAtom, ok bool)

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

func (ClaimAtom) GetV0

func (u ClaimAtom) GetV0() (result ClaimOfferAtomV0, ok bool)

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

func (ClaimAtom) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ClaimAtom) MustOrderBook

func (u ClaimAtom) MustOrderBook() ClaimOfferAtom

MustOrderBook retrieves the OrderBook value from the union, panicing if the value is not set.

func (ClaimAtom) MustV0

func (u ClaimAtom) MustV0() ClaimOfferAtomV0

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

func (ClaimAtom) OfferId

func (a ClaimAtom) OfferId() Int64

func (ClaimAtom) SellerId

func (a ClaimAtom) SellerId() AccountId

func (ClaimAtom) SwitchFieldName

func (u ClaimAtom) SwitchFieldName() string

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

func (*ClaimAtom) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ClaimAtomType

type ClaimAtomType int32

ClaimAtomType is an XDR Enum defines as:

enum ClaimAtomType
 {
     CLAIM_ATOM_TYPE_V0 = 0,
     CLAIM_ATOM_TYPE_ORDER_BOOK = 1
 };
const (
	ClaimAtomTypeClaimAtomTypeV0        ClaimAtomType = 0
	ClaimAtomTypeClaimAtomTypeOrderBook ClaimAtomType = 1
)

func (ClaimAtomType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ClaimAtomType) String

func (e ClaimAtomType) String() string

String returns the name of `e`

func (*ClaimAtomType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ClaimAtomType) ValidEnum

func (e ClaimAtomType) ValidEnum(v int32) bool

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

type ClaimClaimableBalanceOp

type ClaimClaimableBalanceOp struct {
	BalanceId ClaimableBalanceId
}

ClaimClaimableBalanceOp is an XDR Struct defines as:

struct ClaimClaimableBalanceOp
 {
     ClaimableBalanceID balanceID;
 };

func (ClaimClaimableBalanceOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ClaimClaimableBalanceOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ClaimClaimableBalanceResult

type ClaimClaimableBalanceResult struct {
	Code ClaimClaimableBalanceResultCode
}

ClaimClaimableBalanceResult is an XDR Union defines as:

union ClaimClaimableBalanceResult switch (ClaimClaimableBalanceResultCode code)
 {
 case CLAIM_CLAIMABLE_BALANCE_SUCCESS:
     void;
 default:
     void;
 };

func NewClaimClaimableBalanceResult

func NewClaimClaimableBalanceResult(code ClaimClaimableBalanceResultCode, value interface{}) (result ClaimClaimableBalanceResult, err error)

NewClaimClaimableBalanceResult creates a new ClaimClaimableBalanceResult.

func (ClaimClaimableBalanceResult) ArmForSwitch

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

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

func (ClaimClaimableBalanceResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ClaimClaimableBalanceResult) SwitchFieldName

func (u ClaimClaimableBalanceResult) SwitchFieldName() string

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

func (*ClaimClaimableBalanceResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ClaimClaimableBalanceResultCode

type ClaimClaimableBalanceResultCode int32

ClaimClaimableBalanceResultCode is an XDR Enum defines as:

enum ClaimClaimableBalanceResultCode
 {
     CLAIM_CLAIMABLE_BALANCE_SUCCESS = 0,
     CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1,
     CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM = -2,
     CLAIM_CLAIMABLE_BALANCE_LINE_FULL = -3,
     CLAIM_CLAIMABLE_BALANCE_NO_TRUST = -4,
     CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -5

 };
const (
	ClaimClaimableBalanceResultCodeClaimClaimableBalanceSuccess       ClaimClaimableBalanceResultCode = 0
	ClaimClaimableBalanceResultCodeClaimClaimableBalanceDoesNotExist  ClaimClaimableBalanceResultCode = -1
	ClaimClaimableBalanceResultCodeClaimClaimableBalanceCannotClaim   ClaimClaimableBalanceResultCode = -2
	ClaimClaimableBalanceResultCodeClaimClaimableBalanceLineFull      ClaimClaimableBalanceResultCode = -3
	ClaimClaimableBalanceResultCodeClaimClaimableBalanceNoTrust       ClaimClaimableBalanceResultCode = -4
	ClaimClaimableBalanceResultCodeClaimClaimableBalanceNotAuthorized ClaimClaimableBalanceResultCode = -5
)

func (ClaimClaimableBalanceResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ClaimClaimableBalanceResultCode) String

String returns the name of `e`

func (*ClaimClaimableBalanceResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ClaimClaimableBalanceResultCode) ValidEnum

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

type ClaimOfferAtom

type ClaimOfferAtom struct {
	SellerId     AccountId
	OfferId      Int64
	AssetSold    Asset
	AmountSold   Int64
	AssetBought  Asset
	AmountBought Int64
}

ClaimOfferAtom is an XDR Struct defines as:

struct ClaimOfferAtom
 {
     // emitted to identify the offer
     AccountID sellerID; // Account that owns the offer
     int64 offerID;

     // amount and asset taken from the owner
     Asset assetSold;
     int64 amountSold;

     // amount and asset sent to the owner
     Asset assetBought;
     int64 amountBought;
 };

func (ClaimOfferAtom) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ClaimOfferAtom) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ClaimOfferAtomV0

type ClaimOfferAtomV0 struct {
	SellerEd25519 Uint256
	OfferId       Int64
	AssetSold     Asset
	AmountSold    Int64
	AssetBought   Asset
	AmountBought  Int64
}

ClaimOfferAtomV0 is an XDR Struct defines as:

struct ClaimOfferAtomV0
 {
     // emitted to identify the offer
     uint256 sellerEd25519; // Account that owns the offer
     int64 offerID;

     // amount and asset taken from the owner
     Asset assetSold;
     int64 amountSold;

     // amount and asset sent to the owner
     Asset assetBought;
     int64 amountBought;
 };

func (ClaimOfferAtomV0) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ClaimOfferAtomV0) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ClaimPredicate

type ClaimPredicate struct {
	Type          ClaimPredicateType
	AndPredicates *[]ClaimPredicate `xdrmaxsize:"2"`
	OrPredicates  *[]ClaimPredicate `xdrmaxsize:"2"`
	NotPredicate  **ClaimPredicate
	AbsBefore     *Int64
	RelBefore     *Int64
}

ClaimPredicate is an XDR Union defines as:

union ClaimPredicate switch (ClaimPredicateType type)
 {
 case CLAIM_PREDICATE_UNCONDITIONAL:
     void;
 case CLAIM_PREDICATE_AND:
     ClaimPredicate andPredicates<2>;
 case CLAIM_PREDICATE_OR:
     ClaimPredicate orPredicates<2>;
 case CLAIM_PREDICATE_NOT:
     ClaimPredicate* notPredicate;
 case CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME:
     int64 absBefore; // Predicate will be true if closeTime < absBefore
 case CLAIM_PREDICATE_BEFORE_RELATIVE_TIME:
     int64 relBefore; // Seconds since closeTime of the ledger in which the
                      // ClaimableBalanceEntry was created
 };

func NewClaimPredicate

func NewClaimPredicate(aType ClaimPredicateType, value interface{}) (result ClaimPredicate, err error)

NewClaimPredicate creates a new ClaimPredicate.

func (ClaimPredicate) ArmForSwitch

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

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

func (ClaimPredicate) GetAbsBefore

func (u ClaimPredicate) GetAbsBefore() (result Int64, ok bool)

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

func (ClaimPredicate) GetAndPredicates

func (u ClaimPredicate) GetAndPredicates() (result []ClaimPredicate, ok bool)

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

func (ClaimPredicate) GetNotPredicate

func (u ClaimPredicate) GetNotPredicate() (result *ClaimPredicate, ok bool)

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

func (ClaimPredicate) GetOrPredicates

func (u ClaimPredicate) GetOrPredicates() (result []ClaimPredicate, ok bool)

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

func (ClaimPredicate) GetRelBefore

func (u ClaimPredicate) GetRelBefore() (result Int64, ok bool)

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

func (ClaimPredicate) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ClaimPredicate) MarshalJSON

func (c ClaimPredicate) MarshalJSON() ([]byte, error)

func (ClaimPredicate) MustAbsBefore

func (u ClaimPredicate) MustAbsBefore() Int64

MustAbsBefore retrieves the AbsBefore value from the union, panicing if the value is not set.

func (ClaimPredicate) MustAndPredicates

func (u ClaimPredicate) MustAndPredicates() []ClaimPredicate

MustAndPredicates retrieves the AndPredicates value from the union, panicing if the value is not set.

func (ClaimPredicate) MustNotPredicate

func (u ClaimPredicate) MustNotPredicate() *ClaimPredicate

MustNotPredicate retrieves the NotPredicate value from the union, panicing if the value is not set.

func (ClaimPredicate) MustOrPredicates

func (u ClaimPredicate) MustOrPredicates() []ClaimPredicate

MustOrPredicates retrieves the OrPredicates value from the union, panicing if the value is not set.

func (ClaimPredicate) MustRelBefore

func (u ClaimPredicate) MustRelBefore() Int64

MustRelBefore retrieves the RelBefore value from the union, panicing if the value is not set.

func (*ClaimPredicate) Scan

func (c *ClaimPredicate) Scan(src interface{}) error

Scan reads from src into a ClaimPredicate

func (ClaimPredicate) SwitchFieldName

func (u ClaimPredicate) SwitchFieldName() string

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

func (*ClaimPredicate) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (*ClaimPredicate) UnmarshalJSON

func (c *ClaimPredicate) UnmarshalJSON(b []byte) error

func (ClaimPredicate) Value

func (c ClaimPredicate) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.