Back to godoc.org
github.com/stellar/go / xdr

package xdr

v0.0.0 (9568094)
Latest Go to latest
Published: 0 hours ago | License: Apache-2.0 | Module: github.com/stellar/go

Overview

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

lint:file-ignore S1005 The issue should be fixed in xdrgen. Unfortunately, there's no way to ignore a single file in staticcheck. lint:file-ignore U1000 fmtTest is not needed anywhere, should be removed in xdrgen. 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

Package Files

Constants

const MaskAccountFlags = 0x7

MaskAccountFlags is an XDR Const defines as:

const MASK_ACCOUNT_FLAGS = 0x7;
const MaskOfferentryFlags = 1

MaskOfferentryFlags is an XDR Const defines as:

const MASK_OFFERENTRY_FLAGS = 1;
const MaskTrustlineFlags = 1

MaskTrustlineFlags is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS = 1;
const MaskTrustlineFlagsV13 = 3

MaskTrustlineFlagsV13 is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS_V13 = 3;
const MaxOpsPerTx = 100

MaxOpsPerTx is an XDR Const defines as:

const MAX_OPS_PER_TX = 100;

Variables

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

AssetTypeToString maps an xdr.AssetType to its string representation

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

StringToAssetType maps an strings to its xdr.AssetType representation

var ValidAssetCode = regexp.MustCompile("^[[:alnum:]]{1,12}$")

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

Code:

package xdr

import (
	"encoding/base64"
	"fmt"
	"log"
	"strings"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

// ExampleUnmarshal shows the lowest-level process to decode a base64
// envelope encoded in base64.
func ExampleUnmarshal() {
	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
}

var _ = Describe("xdr.SafeUnmarshal", func() {
	var (
		result int32
		data   []byte
		err    error
	)

	JustBeforeEach(func() {
		err = SafeUnmarshal(data, &result)
	})

	Context("input data is a single xdr value", func() {
		BeforeEach(func() {
			data = []byte{0x00, 0x00, 0x00, 0x01}
		})

		It("succeeds", func() {
			Expect(err).To(BeNil())
		})

		It("decodes the data correctly", func() {
			Expect(result).To(Equal(int32(1)))
		})
	})

	Context("when the input data contains more than one encoded struct", func() {
		BeforeEach(func() {
			data = []byte{
				0x00, 0x00, 0x00, 0x01,
				0x00, 0x00, 0x00, 0x01,
			}
		})
		It("errors", func() {
			Expect(err).ToNot(BeNil())
		})
	})
})

var _ = Describe("xdr.SafeUnmarshalBase64", func() {
	var (
		result int32
		data   string
		err    error
	)

	JustBeforeEach(func() {
		err = SafeUnmarshalBase64(data, &result)
	})

	Context("input data is a single xdr value", func() {
		BeforeEach(func() {
			data = "AAAAAQ=="
		})

		It("succeeds", func() {
			Expect(err).To(BeNil())
		})

		It("decodes the data correctly", func() {
			Expect(result).To(Equal(int32(1)))
		})
	})

	Context("when the input data contains more than one encoded struct", func() {
		BeforeEach(func() {
			data = "AAAAAQAAAAI="
		})
		It("errors", func() {
			Expect(err).ToNot(BeNil())
		})
	})
})

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.

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<20>; // possible signers for this account

     // reserved for future use
     union switch (int v)
     {
     case 0:
         void;
     case 1:
         struct
         {
             Liabilities liabilities;

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

func (AccountEntry) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntry) MasterKeyWeight

func (a *AccountEntry) MasterKeyWeight() byte

func (*AccountEntry) SignerSummary

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

func (*AccountEntry) ThresholdHigh

func (a *AccountEntry) ThresholdHigh() byte

func (*AccountEntry) ThresholdLow

func (a *AccountEntry) ThresholdLow() byte

func (*AccountEntry) ThresholdMedium

func (a *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 *AccountEntryV1
}

AccountEntryExt is an XDR NestedUnion defines as:

union switch (int v)
     {
     case 0:
         void;
     case 1:
         struct
         {
             Liabilities liabilities;

             union switch (int v)
             {
             case 0:
                 void;
             }
             ext;
         } 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 AccountEntryV1, 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

func (u AccountEntryExt) MustV1() AccountEntryV1

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 AccountEntryV1

type AccountEntryV1 struct {
	Liabilities Liabilities
	Ext         AccountEntryV1Ext
}

AccountEntryV1 is an XDR NestedStruct defines as:

struct
         {
             Liabilities liabilities;

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

func (AccountEntryV1) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntryV1) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryV1Ext

type AccountEntryV1Ext struct {
	V int32
}

AccountEntryV1Ext is an XDR NestedUnion defines as:

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

func NewAccountEntryV1Ext

func NewAccountEntryV1Ext(v int32, value interface{}) (result AccountEntryV1Ext, err error)

NewAccountEntryV1Ext creates a new AccountEntryV1Ext.

func (AccountEntryV1Ext) ArmForSwitch

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

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

func (AccountEntryV1Ext) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountEntryV1Ext) SwitchFieldName

func (u AccountEntryV1Ext) SwitchFieldName() string

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

func (*AccountEntryV1Ext) UnmarshalBinary

func (s *AccountEntryV1Ext) 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
 };
const (
	AccountFlagsAuthRequiredFlag  AccountFlags = 1
	AccountFlagsAuthRevocableFlag AccountFlags = 2
	AccountFlagsAuthImmutableFlag AccountFlags = 4
)

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 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) 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 transfered 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
 };
const (
	AccountMergeResultCodeAccountMergeSuccess       AccountMergeResultCode = 0
	AccountMergeResultCodeAccountMergeMalformed     AccountMergeResultCode = -1
	AccountMergeResultCodeAccountMergeNoAccount     AccountMergeResultCode = -2
	AccountMergeResultCodeAccountMergeImmutableSet  AccountMergeResultCode = -3
	AccountMergeResultCodeAccountMergeHasSubEntries AccountMergeResultCode = -4
	AccountMergeResultCodeAccountMergeSeqnumTooFar  AccountMergeResultCode = -5
	AccountMergeResultCodeAccountMergeDestFull      AccountMergeResultCode = -6
)

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     AllowTrustOpAsset
	Authorize Uint32
}

AllowTrustOp is an XDR Struct defines as:

struct AllowTrustOp
 {
     AccountID trustor;
     union switch (AssetType type)
     {
     // ASSET_TYPE_NATIVE is not allowed
     case ASSET_TYPE_CREDIT_ALPHANUM4:
         AssetCode4 assetCode4;

     case ASSET_TYPE_CREDIT_ALPHANUM12:
         AssetCode12 assetCode12;

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

     // 0, or any bitwise combination of TrustLineFlags
     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 AllowTrustOpAsset

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

AllowTrustOpAsset is an XDR NestedUnion defines as:

union switch (AssetType type)
     {
     // ASSET_TYPE_NATIVE is not allowed
     case ASSET_TYPE_CREDIT_ALPHANUM4:
         AssetCode4 assetCode4;

     case ASSET_TYPE_CREDIT_ALPHANUM12:
         AssetCode12 assetCode12;

         // add other asset types here in the future
     }

func NewAllowTrustOpAsset

func NewAllowTrustOpAsset(aType AssetType, value interface{}) (result AllowTrustOpAsset, err error)

NewAllowTrustOpAsset creates a new AllowTrustOpAsset.

func (AllowTrustOpAsset) ArmForSwitch

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

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

func (AllowTrustOpAsset) GetAssetCode12

func (u AllowTrustOpAsset) 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 (AllowTrustOpAsset) GetAssetCode4

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

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AllowTrustOpAsset) MustAssetCode12

func (u AllowTrustOpAsset) MustAssetCode12() AssetCode12

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

func (AllowTrustOpAsset) MustAssetCode4

func (u AllowTrustOpAsset) MustAssetCode4() AssetCode4

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

func (AllowTrustOpAsset) SwitchFieldName

func (u AllowTrustOpAsset) SwitchFieldName() string

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

func (AllowTrustOpAsset) ToAsset

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

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

func (*AllowTrustOpAsset) UnmarshalBinary

func (s *AllowTrustOpAsset) 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 Asset

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

Asset is an XDR Union defines as:

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

 case ASSET_TYPE_CREDIT_ALPHANUM4:
     struct
     {
         AssetCode4 assetCode;
         AccountID issuer;
     } alphaNum4;

 case ASSET_TYPE_CREDIT_ALPHANUM12:
     struct
     {
         AssetCode12 assetCode;
         AccountID issuer;
     } 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 AssetAlphaNum12, 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 AssetAlphaNum4, ok bool)

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

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() AssetAlphaNum12

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

func (Asset) MustAlphaNum4

func (u Asset) MustAlphaNum4() AssetAlphaNum4

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

func (u Asset) SwitchFieldName() string

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

func (*Asset) ToAllowTrustOpAsset

func (a *Asset) ToAllowTrustOpAsset(code string) (AllowTrustOpAsset, error)

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

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 AssetAlphaNum12

type AssetAlphaNum12 struct {
	AssetCode AssetCode12
	Issuer    AccountId
}

AssetAlphaNum12 is an XDR NestedStruct defines as:

struct
     {
         AssetCode12 assetCode;
         AccountID issuer;
     }

func (AssetAlphaNum12) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetAlphaNum12) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AssetAlphaNum4

type AssetAlphaNum4 struct {
	AssetCode AssetCode4
	Issuer    AccountId
}

AssetAlphaNum4 is an XDR NestedStruct defines as:

struct
     {
         AssetCode4 assetCode;
         AccountID issuer;
     }

func (AssetAlphaNum4) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetAlphaNum4) UnmarshalBinary

func (s *AssetAlphaNum4) 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
 };
const (
	AssetTypeAssetTypeNative           AssetType = 0
	AssetTypeAssetTypeCreditAlphanum4  AssetType = 1
	AssetTypeAssetTypeCreditAlphanum12 AssetType = 2
)

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

func (u AuthenticatedMessage) MustV0() AuthenticatedMessageV0

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

type ChangeTrustOp struct {
	Line  Asset
	Limit Int64
}

ChangeTrustOp is an XDR Struct defines as:

struct ChangeTrustOp
 {
     Asset 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
 };
const (
	ChangeTrustResultCodeChangeTrustSuccess        ChangeTrustResultCode = 0
	ChangeTrustResultCodeChangeTrustMalformed      ChangeTrustResultCode = -1
	ChangeTrustResultCodeChangeTrustNoIssuer       ChangeTrustResultCode = -2
	ChangeTrustResultCodeChangeTrustInvalidLimit   ChangeTrustResultCode = -3
	ChangeTrustResultCodeChangeTrustLowReserve     ChangeTrustResultCode = -4
	ChangeTrustResultCodeChangeTrustSelfNotAllowed ChangeTrustResultCode = -5
)

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

type CreateAccountOp struct {
	Destination     AccountId
	StartingBalance Int64
}

CreateAccountOp is an XDR Struct defines as:

struct CreateAccountOp
 {
     AccountID destination; // account to create
     int64 startingBalance; // amount they end up with
 };

func (CreateAccountOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*CreateAccountOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type CreateAccountResult

type CreateAccountResult struct {
	Code CreateAccountResultCode
}

CreateAccountResult is an XDR Union defines as:

union CreateAccountResult switch (CreateAccountResultCode code)
 {
 case CREATE_ACCOUNT_SUCCESS:
     void;
 default:
     void;
 };

func NewCreateAccountResult

func NewCreateAccountResult(code CreateAccountResultCode, value interface{}) (result CreateAccountResult, err error)

NewCreateAccountResult creates a new CreateAccountResult.

func (CreateAccountResult) ArmForSwitch

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

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

func (CreateAccountResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (CreateAccountResult) SwitchFieldName

func (u CreateAccountResult) SwitchFieldName() string

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

func (*CreateAccountResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type CreateAccountResultCode

type CreateAccountResultCode int32

CreateAccountResultCode is an XDR Enum defines as:

enum CreateAccountResultCode
 {
     // codes considered as "success" for the operation
     CREATE_ACCOUNT_SUCCESS = 0, // account was created

     // codes considered as "failure" for the operation
     CREATE_ACCOUNT_MALFORMED = -1,   // invalid destination
     CREATE_ACCOUNT_UNDERFUNDED = -2, // not enough funds in source account
     CREATE_ACCOUNT_LOW_RESERVE =
         -3, // would create an account below the min reserve
     CREATE_ACCOUNT_ALREADY_EXIST = -4 // account already exists
 };
const (
	CreateAccountResultCodeCreateAccountSuccess      CreateAccountResultCode = 0
	CreateAccountResultCodeCreateAccountMalformed    CreateAccountResultCode = -1
	CreateAccountResultCodeCreateAccountUnderfunded  CreateAccountResultCode = -2
	CreateAccountResultCodeCreateAccountLowReserve   CreateAccountResultCode = -3
	CreateAccountResultCodeCreateAccountAlreadyExist CreateAccountResultCode = -4
)

func (CreateAccountResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (CreateAccountResultCode) String

func (e CreateAccountResultCode) String() string

String returns the name of `e`

func (*CreateAccountResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (CreateAccountResultCode) ValidEnum

func (e CreateAccountResultCode) ValidEnum(v int32) bool

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

type CreatePassiveSellOfferOp

type CreatePassiveSellOfferOp struct {
	Selling Asset
	Buying  Asset
	Amount  Int64
	Price   Price
}

CreatePassiveSellOfferOp is an XDR Struct defines as:

struct CreatePassiveSellOfferOp
 {
     Asset selling; // A
     Asset buying;  // B
     int64 amount;  // amount taker gets. if set to 0, delete the offer
     Price price;   // cost of A in terms of B
 };

func (CreatePassiveSellOfferOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*CreatePassiveSellOfferOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type CryptoKeyType

type CryptoKeyType int32

CryptoKeyType is an XDR Enum defines as:

enum CryptoKeyType
 {
     KEY_TYPE_ED25519 = 0,
     KEY_TYPE_PRE_AUTH_TX = 1,
     KEY_TYPE_HASH_X = 2,
     // MUXED enum values for supported type are derived from the enum values
     // above by ORing them with 0x100
     KEY_TYPE_MUXED_ED25519 = 0x100
 };
const (
	CryptoKeyTypeKeyTypeEd25519      CryptoKeyType = 0
	CryptoKeyTypeKeyTypePreAuthTx    CryptoKeyType = 1
	CryptoKeyTypeKeyTypeHashX        CryptoKeyType = 2
	CryptoKeyTypeKeyTypeMuxedEd25519 CryptoKeyType = 256
)

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 Curve25519Public

type Curve25519Public struct {
	Key [32]byte `xdrmaxsize:"32"`
}

Curve25519Public is an XDR Struct defines as:

struct Curve25519Public
 {
     opaque key[32];
 };

func (Curve25519Public) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Curve25519Public) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Curve25519Secret

type Curve25519Secret struct {
	Key [32]byte `xdrmaxsize:"32"`
}

Curve25519Secret is an XDR Struct defines as:

struct Curve25519Secret
 {
     opaque key[32];
 };

func (Curve25519Secret) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Curve25519Secret) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type DataEntry

type DataEntry struct {
	AccountId AccountId
	DataName  String64
	DataValue DataValue
	Ext       DataEntryExt
}

DataEntry is an XDR Struct defines as:

struct DataEntry
 {
     AccountID accountID; // account this data belongs to
     string64 dataName;
     DataValue dataValue;

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

func (DataEntry) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*DataEntry) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type DataEntryExt

type DataEntryExt struct {
	V int32
}

DataEntryExt is an XDR NestedUnion defines as:

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

func NewDataEntryExt

func NewDataEntryExt(v int32, value interface{}) (result DataEntryExt, err error)

NewDataEntryExt creates a new DataEntryExt.

func (DataEntryExt) ArmForSwitch

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

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

func (DataEntryExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (DataEntryExt) SwitchFieldName

func (u DataEntryExt) SwitchFieldName() string

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

func (*DataEntryExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type DataValue

type DataValue []byte

DataValue is an XDR Typedef defines as:

typedef opaque DataValue<64>;

func (DataValue) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*DataValue) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (DataValue) XDRMaxSize

func (e DataValue) XDRMaxSize() int

XDRMaxSize implements the Sized interface for DataValue

type DecoratedSignature

type DecoratedSignature struct {
	Hint      SignatureHint
	Signature Signature
}

DecoratedSignature is an XDR Struct defines as:

struct DecoratedSignature
 {
     SignatureHint hint;  // last 4 bytes of the public key, used as a hint
     Signature signature; // actual signature
 };

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 DontHave

type DontHave struct {
	Type    MessageType
	ReqHash Uint256
}

DontHave is an XDR Struct defines as:

struct DontHave
 {
     MessageType type;
     uint256 reqHash;
 };

func (DontHave) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*DontHave) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type EncryptedBody

type EncryptedBody []byte

EncryptedBody is an XDR Typedef defines as:

typedef opaque EncryptedBody<64000>;

func (EncryptedBody) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*EncryptedBody) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (EncryptedBody) XDRMaxSize

func (e EncryptedBody) XDRMaxSize() int

XDRMaxSize implements the Sized interface for EncryptedBody

type EnvelopeType

type EnvelopeType int32

EnvelopeType is an XDR Enum defines as:

enum EnvelopeType
 {
     ENVELOPE_TYPE_TX_V0 = 0,
     ENVELOPE_TYPE_SCP = 1,
     ENVELOPE_TYPE_TX = 2,
     ENVELOPE_TYPE_AUTH = 3,
     ENVELOPE_TYPE_SCPVALUE = 4,
     ENVELOPE_TYPE_TX_FEE_BUMP = 5
 };
const (
	EnvelopeTypeEnvelopeTypeTxV0      EnvelopeType = 0
	EnvelopeTypeEnvelopeTypeScp       EnvelopeType = 1
	EnvelopeTypeEnvelopeTypeTx        EnvelopeType = 2
	EnvelopeTypeEnvelopeTypeAuth      EnvelopeType = 3
	EnvelopeTypeEnvelopeTypeScpvalue  EnvelopeType = 4
	EnvelopeTypeEnvelopeTypeTxFeeBump EnvelopeType = 5
)

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 Error

type Error struct {
	Code ErrorCode
	Msg  string `xdrmaxsize:"100"`
}

Error is an XDR Struct defines as:

struct Error
 {
     ErrorCode code;
     string msg<100>;
 };

func (Error) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Error) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ErrorCode

type ErrorCode int32

ErrorCode is an XDR Enum defines as:

enum ErrorCode
 {
     ERR_MISC = 0, // Unspecific error
     ERR_DATA = 1, // Malformed data
     ERR_CONF = 2, // Misconfiguration error
     ERR_AUTH = 3, // Authentication failure
     ERR_LOAD = 4  // System overloaded
 };
const (
	ErrorCodeErrMisc ErrorCode = 0
	ErrorCodeErrData ErrorCode = 1
	ErrorCodeErrConf ErrorCode = 2
	ErrorCodeErrAuth ErrorCode = 3
	ErrorCodeErrLoad ErrorCode = 4
)

func (ErrorCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ErrorCode) String

func (e ErrorCode) String() string

String returns the name of `e`

func (*ErrorCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ErrorCode) ValidEnum

func (e ErrorCode) ValidEnum(v int32) bool

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

type FeeBumpTransaction

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

FeeBumpTransaction is an XDR Struct defines as:

struct FeeBumpTransaction
 {
     MuxedAccount feeSource;
     int64 fee;
     union switch (EnvelopeType type)
     {
     case ENVELOPE_TYPE_TX:
         TransactionV1Envelope v1;
     }
     innerTx;
     union switch (int v)
     {
     case 0:
         void;
     }
     ext;
 };

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"`
}

FeeBumpTransactionEnvelope is an XDR Struct defines as:

struct FeeBumpTransactionEnvelope
 {
     FeeBumpTransaction tx;
     /* Each decorated signature is a signature over the SHA256 hash of
      * a TransactionSignaturePayload */
     DecoratedSignature signatures<20>;
 };

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
}

FeeBumpTransactionExt is an XDR NestedUnion defines as:

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

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

FeeBumpTransactionInnerTx is an XDR NestedUnion defines as:

union switch (EnvelopeType type)
     {
     case ENVELOPE_TYPE_TX:
         TransactionV1Envelope v1;
     }

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

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

MarshalBinary implements encoding.BinaryMarshaler.

func (FeeBumpTransactionInnerTx) MustV1

func (u FeeBumpTransactionInnerTx) MustV1() TransactionV1Envelope

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

Hash is an XDR Typedef defines as:

typedef opaque Hash[32];

func (Hash) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Hash) Scan

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

Scan reads from a src into an xdr.Hash

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 Hello

type Hello struct {
	LedgerVersion     Uint32
	OverlayVersion    Uint32
	OverlayMinVersion Uint32
	NetworkId         Hash
	VersionStr        string `xdrmaxsize:"100"`
	ListeningPort     int32
	PeerId            NodeId
	Cert              AuthCert
	Nonce             Uint256
}

Hello is an XDR Struct defines as:

struct Hello
 {
     uint32 ledgerVersion;
     uint32 overlayVersion;
     uint32 overlayMinVersion;
     Hash networkID;
     string versionStr<100>;
     int listeningPort;
     NodeID peerID;
     AuthCert cert;
     uint256 nonce;
 };

func (Hello) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Hello) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type HmacSha256Key

type HmacSha256Key struct {
	Key [32]byte `xdrmaxsize:"32"`
}

HmacSha256Key is an XDR Struct defines as:

struct HmacSha256Key
 {
     opaque key[32];
 };

func (HmacSha256Key) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*HmacSha256Key) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type HmacSha256Mac

type HmacSha256Mac struct {
	Mac [32]byte `xdrmaxsize:"32"`
}

HmacSha256Mac is an XDR Struct defines as:

struct HmacSha256Mac
 {
     opaque mac[32];
 };

func (HmacSha256Mac) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*HmacSha256Mac) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type InflationPayout

type InflationPayout struct {
	Destination AccountId
	Amount      Int64
}

InflationPayout is an XDR Struct defines as:

struct InflationPayout // or use PaymentResultAtom to limit types?
 {
     AccountID destination;
     int64 amount;
 };

func (InflationPayout) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*InflationPayout) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type InflationResult

type InflationResult struct {
	Code    InflationResultCode
	Payouts *[]InflationPayout
}

InflationResult is an XDR Union defines as:

union InflationResult switch (InflationResultCode code)
 {
 case INFLATION_SUCCESS:
     InflationPayout payouts<>;
 default:
     void;
 };

func NewInflationResult

func NewInflationResult(code InflationResultCode, value interface{}) (result InflationResult, err error)

NewInflationResult creates a new InflationResult.

func (InflationResult) ArmForSwitch

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

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

func (InflationResult) GetPayouts

func (u InflationResult) GetPayouts() (result []InflationPayout, ok bool)

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

func (InflationResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (InflationResult) MustPayouts

func (u InflationResult) MustPayouts() []InflationPayout

MustPayouts retrieves the Payouts value from the union, panicing if the value is not set.

func (InflationResult) SwitchFieldName

func (u InflationResult) SwitchFieldName() string

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

func (*InflationResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type InflationResultCode

type InflationResultCode int32

InflationResultCode is an XDR Enum defines as:

enum InflationResultCode
 {
     // codes considered as "success" for the operation
     INFLATION_SUCCESS = 0,
     // codes considered as "failure" for the operation
     INFLATION_NOT_TIME = -1
 };
const (
	InflationResultCodeInflationSuccess InflationResultCode = 0
	InflationResultCodeInflationNotTime InflationResultCode = -1
)

func (InflationResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (InflationResultCode) String

func (e InflationResultCode) String() string

String returns the name of `e`

func (*InflationResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (InflationResultCode) ValidEnum

func (e InflationResultCode) ValidEnum(v int32) bool

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

type InnerTransactionResult

type InnerTransactionResult struct {
	FeeCharged Int64
	Result     InnerTransactionResultResult
	Ext        InnerTransactionResultExt
}

InnerTransactionResult is an XDR Struct defines as:

struct InnerTransactionResult
 {
     // Always 0. Here for binary compatibility.
     int64 feeCharged;

     union switch (TransactionResultCode code)
     {
     // txFEE_BUMP_INNER_SUCCESS is not included
     case txSUCCESS:
     case txFAILED:
         OperationResult results<>;
     case txTOO_EARLY:
     case txTOO_LATE:
     case txMISSING_OPERATION:
     case txBAD_SEQ:
     case txBAD_AUTH:
     case txINSUFFICIENT_BALANCE:
     case txNO_ACCOUNT:
     case txINSUFFICIENT_FEE:
     case txBAD_AUTH_EXTRA:
     case txINTERNAL_ERROR:
     case txNOT_SUPPORTED:
         // txFEE_BUMP_INNER_FAILED is not included
         void;
     }
     result;

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

func (InnerTransactionResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*InnerTransactionResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type InnerTransactionResultExt

type InnerTransactionResultExt struct {
	V int32
}

InnerTransactionResultExt is an XDR NestedUnion defines as:

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

func NewInnerTransactionResultExt

func NewInnerTransactionResultExt(v int32, value interface{}) (result InnerTransactionResultExt, err error)

NewInnerTransactionResultExt creates a new InnerTransactionResultExt.

func (InnerTransactionResultExt) ArmForSwitch

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

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

func (InnerTransactionResultExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (InnerTransactionResultExt) SwitchFieldName

func (u InnerTransactionResultExt) SwitchFieldName() string

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

func (*InnerTransactionResultExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type InnerTransactionResultPair

type InnerTransactionResultPair struct {
	TransactionHash Hash
	Result          InnerTransactionResult
}

InnerTransactionResultPair is an XDR Struct defines as:

struct InnerTransactionResultPair
 {
     Hash transactionHash;          // hash of the inner transaction
     InnerTransactionResult result; // result for the inner transaction
 };

func (InnerTransactionResultPair) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*InnerTransactionResultPair) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type InnerTransactionResultResult

type InnerTransactionResultResult struct {
	Code    TransactionResultCode
	Results *[]OperationResult
}

InnerTransactionResultResult is an XDR NestedUnion defines as:

union switch (TransactionResultCode code)
     {
     // txFEE_BUMP_INNER_SUCCESS is not included
     case txSUCCESS:
     case txFAILED:
         OperationResult results<>;
     case txTOO_EARLY:
     case txTOO_LATE:
     case txMISSING_OPERATION:
     case txBAD_SEQ:
     case txBAD_AUTH:
     case txINSUFFICIENT_BALANCE:
     case txNO_ACCOUNT:
     case txINSUFFICIENT_FEE:
     case txBAD_AUTH_EXTRA:
     case txINTERNAL_ERROR:
     case txNOT_SUPPORTED:
         // txFEE_BUMP_INNER_FAILED is not included
         void;
     }

func NewInnerTransactionResultResult

func NewInnerTransactionResultResult(code TransactionResultCode, value interface{}) (result InnerTransactionResultResult, err error)

NewInnerTransactionResultResult creates a new InnerTransactionResultResult.

func (InnerTransactionResultResult) ArmForSwitch

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

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

func (InnerTransactionResultResult) GetResults

func (u InnerTransactionResultResult) GetResults() (result []OperationResult, ok bool)

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

func (InnerTransactionResultResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (InnerTransactionResultResult) MustResults

func (u InnerTransactionResultResult) MustResults() []OperationResult

MustResults retrieves the Results value from the union, panicing if the value is not set.

func (InnerTransactionResultResult) SwitchFieldName

func (u InnerTransactionResultResult) SwitchFieldName() string

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

func (*InnerTransactionResultResult) UnmarshalBinary

func (s *InnerTransactionResultResult) 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) 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) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Int64) Scan

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

Scan reads from src into an Int64

func (*Int64) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type IpAddrType

type IpAddrType int32

IpAddrType is an XDR Enum defines as:

enum IPAddrType
 {
     IPv4 = 0,
     IPv6 = 1
 };
const (
	IpAddrTypeIPv4 IpAddrType = 0
	IpAddrTypeIPv6 IpAddrType = 1
)

func (IpAddrType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (IpAddrType) String

func (e IpAddrType) String() string

String returns the name of `e`

func (*IpAddrType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (IpAddrType) ValidEnum

func (e IpAddrType) ValidEnum(v int32) bool

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

type Keyer

type Keyer interface {
	LedgerKey() LedgerKey
}

Keyer represents a type that can be converted into a LedgerKey

type LedgerCloseMeta

type LedgerCloseMeta struct {
	V  int32
	V0 *LedgerCloseMetaV0
}

LedgerCloseMeta is an XDR Union defines as:

union LedgerCloseMeta switch (int v)
 {
 case 0:
     LedgerCloseMetaV0 v0;
 };

func NewLedgerCloseMeta

func NewLedgerCloseMeta(v int32, value interface{}) (result LedgerCloseMeta, err error)

NewLedgerCloseMeta creates a new LedgerCloseMeta.

func (LedgerCloseMeta) ArmForSwitch

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

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

func (LedgerCloseMeta) GetV0

func (u LedgerCloseMeta) GetV0() (result LedgerCloseMetaV0, ok bool)

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

func (LedgerCloseMeta) LedgerSequence

func (l LedgerCloseMeta) LedgerSequence() uint32

func (LedgerCloseMeta) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerCloseMeta) MustV0

func (u LedgerCloseMeta) MustV0() LedgerCloseMetaV0

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

func (LedgerCloseMeta) SwitchFieldName

func (u LedgerCloseMeta) SwitchFieldName() string

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

func (*LedgerCloseMeta) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerCloseMetaV0

type LedgerCloseMetaV0 struct {
	LedgerHeader       LedgerHeaderHistoryEntry
	TxSet              TransactionSet
	TxProcessing       []TransactionResultMeta
	UpgradesProcessing []UpgradeEntryMeta
	ScpInfo            []ScpHistoryEntry
}

LedgerCloseMetaV0 is an XDR Struct defines as:

struct LedgerCloseMetaV0
 {
     LedgerHeaderHistoryEntry ledgerHeader;
     // NB: txSet is sorted in "Hash order"
     TransactionSet txSet;

     // NB: transactions are sorted in apply order here
     // fees for all transactions are processed first
     // followed by applying transactions
     TransactionResultMeta txProcessing<>;

     // upgrades are applied last
     UpgradeEntryMeta upgradesProcessing<>;

     // other misc information attached to the ledger close
     SCPHistoryEntry scpInfo<>;
 };

func (LedgerCloseMetaV0) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerCloseMetaV0) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerCloseValueSignature

type LedgerCloseValueSignature struct {
	NodeId    NodeId
	Signature Signature
}

LedgerCloseValueSignature is an XDR Struct defines as:

struct LedgerCloseValueSignature
 {
     NodeID nodeID;       // which node introduced the value
     Signature signature; // nodeID's signature
 };

func (LedgerCloseValueSignature) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerCloseValueSignature) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntry

type LedgerEntry struct {
	LastModifiedLedgerSeq Uint32
	Data                  LedgerEntryData
	Ext                   LedgerEntryExt
}

LedgerEntry is an XDR Struct defines as:

struct LedgerEntry
 {
     uint32 lastModifiedLedgerSeq; // ledger the LedgerEntry was last changed

     union switch (LedgerEntryType type)
     {
     case ACCOUNT:
         AccountEntry account;
     case TRUSTLINE:
         TrustLineEntry trustLine;
     case OFFER:
         OfferEntry offer;
     case DATA:
         DataEntry data;
     }
     data;

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

func (*LedgerEntry) LedgerKey

func (entry *LedgerEntry) LedgerKey() LedgerKey

LedgerKey implements the `Keyer` interface

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 LedgerEntryChange

type LedgerEntryChange struct {
	Type    LedgerEntryChangeType
	Created *LedgerEntry
	Updated *LedgerEntry
	Removed *LedgerKey
	State   *LedgerEntry
}

LedgerEntryChange is an XDR Union defines as:

union LedgerEntryChange switch (LedgerEntryChangeType type)
 {
 case LEDGER_ENTRY_CREATED:
     LedgerEntry created;
 case LEDGER_ENTRY_UPDATED:
     LedgerEntry updated;
 case LEDGER_ENTRY_REMOVED:
     LedgerKey removed;
 case LEDGER_ENTRY_STATE:
     LedgerEntry state;
 };

func NewLedgerEntryChange

func NewLedgerEntryChange(aType LedgerEntryChangeType, value interface{}) (result LedgerEntryChange, err error)

NewLedgerEntryChange creates a new LedgerEntryChange.

func (LedgerEntryChange) ArmForSwitch

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

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

func (*LedgerEntryChange) EntryType

func (change *LedgerEntryChange) EntryType() LedgerEntryType

EntryType is a helper to get at the entry type for a change.

func (LedgerEntryChange) GetCreated

func (u LedgerEntryChange) GetCreated() (result LedgerEntry, ok bool)

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

func (*LedgerEntryChange) GetLedgerEntry

func (change *LedgerEntryChange) GetLedgerEntry() (LedgerEntry, bool)

GetLedgerEntry returns the ledger entry that was changed in `change`, along with a boolean indicating whether the entry value was valid.

func (LedgerEntryChange) GetRemoved

func (u LedgerEntryChange) GetRemoved() (result LedgerKey, ok bool)

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

func (LedgerEntryChange) GetState

func (u LedgerEntryChange) GetState() (result LedgerEntry, ok bool)

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

func (LedgerEntryChange) GetUpdated

func (u LedgerEntryChange) GetUpdated() (result LedgerEntry, ok bool)

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

func (*LedgerEntryChange) LedgerKey

func (change *LedgerEntryChange) LedgerKey() LedgerKey

LedgerKey returns the key for the ledger entry that was changed in `change`.

func (LedgerEntryChange) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryChange) MarshalBinaryBase64

func (change LedgerEntryChange) MarshalBinaryBase64() (string, error)

MarshalBinaryBase64 marshals XDR into a binary form and then encodes it using base64.

func (LedgerEntryChange) MustCreated

func (u LedgerEntryChange) MustCreated() LedgerEntry

MustCreated retrieves the Created value from the union, panicing if the value is not set.

func (LedgerEntryChange) MustRemoved

func (u LedgerEntryChange) MustRemoved() LedgerKey

MustRemoved retrieves the Removed value from the union, panicing if the value is not set.

func (LedgerEntryChange) MustState

func (u LedgerEntryChange) MustState() LedgerEntry

MustState retrieves the State value from the union, panicing if the value is not set.

func (LedgerEntryChange) MustUpdated

func (u LedgerEntryChange) MustUpdated() LedgerEntry

MustUpdated retrieves the Updated value from the union, panicing if the value is not set.

func (LedgerEntryChange) SwitchFieldName

func (u LedgerEntryChange) SwitchFieldName() string

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

func (*LedgerEntryChange) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryChangeType

type LedgerEntryChangeType int32

LedgerEntryChangeType is an XDR Enum defines as:

enum LedgerEntryChangeType
 {
     LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger
     LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger
     LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger
     LEDGER_ENTRY_STATE = 3    // value of the entry
 };
const (
	LedgerEntryChangeTypeLedgerEntryCreated LedgerEntryChangeType = 0
	LedgerEntryChangeTypeLedgerEntryUpdated LedgerEntryChangeType = 1
	LedgerEntryChangeTypeLedgerEntryRemoved LedgerEntryChangeType = 2
	LedgerEntryChangeTypeLedgerEntryState   LedgerEntryChangeType = 3
)

func (LedgerEntryChangeType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryChangeType) String

func (e LedgerEntryChangeType) String() string

String returns the name of `e`

func (*LedgerEntryChangeType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (LedgerEntryChangeType) ValidEnum

func (e LedgerEntryChangeType) ValidEnum(v int32) bool

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

type LedgerEntryChanges

type LedgerEntryChanges []LedgerEntryChange

LedgerEntryChanges is an XDR Typedef defines as:

typedef LedgerEntryChange LedgerEntryChanges<>;

func (LedgerEntryChanges) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerEntryChanges) Scan

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

Scan reads from src into an LedgerEntryChanges struct

func (*LedgerEntryChanges) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryData

type LedgerEntryData struct {
	Type      LedgerEntryType
	Account   *AccountEntry
	TrustLine *TrustLineEntry
	Offer     *OfferEntry
	Data      *DataEntry
}

LedgerEntryData is an XDR NestedUnion defines as:

union switch (LedgerEntryType type)
     {
     case ACCOUNT:
         AccountEntry account;
     case TRUSTLINE:
         TrustLineEntry trustLine;
     case OFFER:
         OfferEntry offer;
     case DATA:
         DataEntry data;
     }

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

func (u LedgerEntryData) GetAccount() (result AccountEntry, ok bool)

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

func (LedgerEntryData) GetData

func (u LedgerEntryData) GetData() (result DataEntry, ok bool)

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

func (LedgerEntryData) GetOffer

func (u LedgerEntryData) GetOffer() (result OfferEntry, ok bool)

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

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

func (u LedgerEntryData) MustAccount() AccountEntry

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

func (LedgerEntryData) MustData

func (u LedgerEntryData) MustData() DataEntry

MustData retrieves the Data value from the union, panicing if the value is not set.

func (LedgerEntryData) MustOffer

func (u LedgerEntryData) MustOffer() OfferEntry

MustOffer retrieves the Offer value from the union, panicing if the value is not set.

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
}

LedgerEntryExt is an XDR NestedUnion defines as:

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

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

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

MarshalBinary implements encoding.BinaryMarshaler.

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 LedgerEntryType

type LedgerEntryType int32

LedgerEntryType is an XDR Enum defines as:

enum LedgerEntryType
 {
     ACCOUNT = 0,
     TRUSTLINE = 1,
     OFFER = 2,
     DATA = 3
 };
const (
	LedgerEntryTypeAccount   LedgerEntryType = 0
	LedgerEntryTypeTrustline LedgerEntryType = 1
	LedgerEntryTypeOffer     LedgerEntryType = 2
	LedgerEntryTypeData      LedgerEntryType = 3
)

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 LedgerHeader

type LedgerHeader struct {
	LedgerVersion      Uint32
	PreviousLedgerHash Hash
	ScpValue           StellarValue
	TxSetResultHash    Hash
	BucketListHash     Hash
	LedgerSeq          Uint32
	TotalCoins         Int64
	FeePool            Int64
	InflationSeq       Uint32
	IdPool             Uint64
	BaseFee            Uint32
	BaseReserve        Uint32
	MaxTxSetSize       Uint32
	SkipList           [4]Hash
	Ext                LedgerHeaderExt
}

LedgerHeader is an XDR Struct defines as:

struct LedgerHeader
 {
     uint32 ledgerVersion;    // the protocol version of the ledger
     Hash previousLedgerHash; // hash of the previous ledger header
     StellarValue scpValue;   // what consensus agreed to
     Hash txSetResultHash;    // the TransactionResultSet that led to this ledger
     Hash bucketListHash;     // hash of the ledger state

     uint32 ledgerSeq; // sequence number of this ledger

     int64 totalCoins; // total number of stroops in existence.
                       // 10,000,000 stroops in 1 XLM

     int64 feePool;       // fees burned since last inflation run
     uint32 inflationSeq; // inflation sequence number

     uint64 idPool; // last used global ID, used for generating objects

     uint32 baseFee;     // base fee per operation in stroops
     uint32 baseReserve; // account base reserve in stroops

     uint32 maxTxSetSize; // maximum size a transaction set can be

     Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back
                       // in time without walking the chain back ledger by ledger
                       // each slot contains the oldest ledger that is mod of
                       // either 50  5000  50000 or 500000 depending on index
                       // skipList[0] mod(50), skipList[1] mod(5000), etc

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

func (LedgerHeader) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerHeader) Scan

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

Scan reads from src into an LedgerHeader struct

func (*LedgerHeader) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerHeaderExt

type LedgerHeaderExt struct {
	V int32
}

LedgerHeaderExt is an XDR NestedUnion defines as:

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

func NewLedgerHeaderExt

func NewLedgerHeaderExt(v int32, value interface{}) (result LedgerHeaderExt, err error)

NewLedgerHeaderExt creates a new LedgerHeaderExt.

func (LedgerHeaderExt) ArmForSwitch

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

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

func (LedgerHeaderExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerHeaderExt) SwitchFieldName

func (u LedgerHeaderExt) SwitchFieldName() string

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

func (*LedgerHeaderExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerHeaderHistoryEntry

type LedgerHeaderHistoryEntry struct {
	Hash   Hash
	Header LedgerHeader
	Ext    LedgerHeaderHistoryEntryExt
}

LedgerHeaderHistoryEntry is an XDR Struct defines as:

struct LedgerHeaderHistoryEntry
 {
     Hash hash;
     LedgerHeader header;

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

func (LedgerHeaderHistoryEntry) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerHeaderHistoryEntry) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerHeaderHistoryEntryExt

type LedgerHeaderHistoryEntryExt struct {
	V int32
}

LedgerHeaderHistoryEntryExt is an XDR NestedUnion defines as:

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

func NewLedgerHeaderHistoryEntryExt

func NewLedgerHeaderHistoryEntryExt(v int32, value interface{}) (result LedgerHeaderHistoryEntryExt, err error)

NewLedgerHeaderHistoryEntryExt creates a new LedgerHeaderHistoryEntryExt.

func (LedgerHeaderHistoryEntryExt) ArmForSwitch

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

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

func (LedgerHeaderHistoryEntryExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerHeaderHistoryEntryExt) SwitchFieldName

func (u LedgerHeaderHistoryEntryExt) SwitchFieldName() string

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

func (*LedgerHeaderHistoryEntryExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKey

type LedgerKey struct {
	Type      LedgerEntryType
	Account   *LedgerKeyAccount
	TrustLine *LedgerKeyTrustLine
	Offer     *LedgerKeyOffer
	Data      *LedgerKeyData
}

LedgerKey is an XDR Union defines as:

union LedgerKey switch (LedgerEntryType type)
 {
 case ACCOUNT:
     struct
     {
         AccountID accountID;
     } account;

 case TRUSTLINE:
     struct
     {
         AccountID accountID;
         Asset asset;
     } trustLine;

 case OFFER:
     struct
     {
         AccountID sellerID;
         int64 offerID;
     } offer;

 case DATA:
     struct
     {
         AccountID accountID;
         string64 dataName;
     } data;
 };

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

func (key *LedgerKey) Equals(other LedgerKey) bool

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

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

func (u LedgerKey) GetData() (result LedgerKeyData, ok bool)

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

func (LedgerKey) GetOffer

func (u LedgerKey) GetOffer() (result LedgerKeyOffer, ok bool)

GetOffer retrieves the Offer 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) LedgerKey

func (key *LedgerKey) LedgerKey() LedgerKey

LedgerKey implements the `Keyer` interface

func (LedgerKey) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerKey) MarshalBinaryBase64

func (key LedgerKey) MarshalBinaryBase64() (string, error)

MarshalBinaryBase64 marshals XDR into a binary form and then encodes it using base64.

func (LedgerKey) MarshalBinaryCompress

func (key LedgerKey) MarshalBinaryCompress() ([]byte, error)

MarshalBinaryCompress 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.

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

func (u LedgerKey) MustData() LedgerKeyData

MustData retrieves the Data value from the union, panicing if the value is not set.

func (LedgerKey) MustOffer

func (u LedgerKey) MustOffer() LedgerKeyOffer

MustOffer retrieves the Offer 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) SetAccount

func (key *LedgerKey) SetAccount(account AccountId) error

SetAccount mutates `key` such that it represents the identity of `account`

func (*LedgerKey) SetData

func (key *LedgerKey) SetData(account AccountId, name string) error

SetData mutates `key` such that it represents the identity of the data entry owned by `account` and for `name`.

func (*LedgerKey) SetOffer

func (key *LedgerKey) SetOffer(account AccountId, id uint64) error

SetOffer mutates `key` such that it represents the identity of the data entry owned by `account` and for offer `id`.

func (*LedgerKey) SetTrustline

func (key *LedgerKey) SetTrustline(account AccountId, line Asset) error

SetTrustline mutates `key` such that it represents the identity of the trustline owned by `account` and for `asset`.

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
}

LedgerKeyAccount is an XDR NestedStruct defines as:

struct
     {
         AccountID accountID;
     }

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 LedgerKeyData

type LedgerKeyData struct {
	AccountId AccountId
	DataName  String64
}

LedgerKeyData is an XDR NestedStruct defines as:

struct
     {
         AccountID accountID;
         string64 dataName;
     }

func (LedgerKeyData) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerKeyData) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKeyOffer

type LedgerKeyOffer struct {
	SellerId AccountId
	OfferId  Int64
}

LedgerKeyOffer is an XDR NestedStruct defines as:

struct
     {
         AccountID sellerID;
         int64 offerID;
     }

func (LedgerKeyOffer) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerKeyOffer) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKeyTrustLine

type LedgerKeyTrustLine struct {
	AccountId AccountId
	Asset     Asset
}

LedgerKeyTrustLine is an XDR NestedStruct defines as:

struct
     {
         AccountID accountID;
         Asset asset;
     }

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 LedgerScpMessages

type LedgerScpMessages struct {
	LedgerSeq Uint32
	Messages  []ScpEnvelope
}

LedgerScpMessages is an XDR Struct defines as:

struct LedgerSCPMessages
 {
     uint32 ledgerSeq;
     SCPEnvelope messages<>;
 };

func (LedgerScpMessages) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerScpMessages) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerUpgrade

type LedgerUpgrade struct {
	Type             LedgerUpgradeType
	NewLedgerVersion *Uint32
	NewBaseFee       *Uint32
	NewMaxTxSetSize  *Uint32
	NewBaseReserve   *Uint32
}

LedgerUpgrade is an XDR Union defines as:

union LedgerUpgrade switch (LedgerUpgradeType type)
 {
 case LEDGER_UPGRADE_VERSION:
     uint32 newLedgerVersion; // update ledgerVersion
 case LEDGER_UPGRADE_BASE_FEE:
     uint32 newBaseFee; // update baseFee
 case LEDGER_UPGRADE_MAX_TX_SET_SIZE:
     uint32 newMaxTxSetSize; // update maxTxSetSize
 case LEDGER_UPGRADE_BASE_RESERVE:
     uint32 newBaseReserve; // update baseReserve
 };

func NewLedgerUpgrade

func NewLedgerUpgrade(aType LedgerUpgradeType, value interface{}) (result LedgerUpgrade, err error)

NewLedgerUpgrade creates a new LedgerUpgrade.

func (LedgerUpgrade) ArmForSwitch

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

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

func (LedgerUpgrade) GetNewBaseFee

func (u LedgerUpgrade) GetNewBaseFee() (result Uint32, ok bool)

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

func (LedgerUpgrade) GetNewBaseReserve

func (u LedgerUpgrade) GetNewBaseReserve() (result Uint32, ok bool)

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

func (LedgerUpgrade) GetNewLedgerVersion

func (u LedgerUpgrade) GetNewLedgerVersion() (result Uint32, ok bool)

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

func (LedgerUpgrade) GetNewMaxTxSetSize

func (u LedgerUpgrade) GetNewMaxTxSetSize() (result Uint32, ok bool)

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

func (LedgerUpgrade) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerUpgrade) MustNewBaseFee

func (u LedgerUpgrade) MustNewBaseFee() Uint32

MustNewBaseFee retrieves the NewBaseFee value from the union, panicing if the value is not set.

func (LedgerUpgrade) MustNewBaseReserve

func (u LedgerUpgrade) MustNewBaseReserve() Uint32

MustNewBaseReserve retrieves the NewBaseReserve value from the union, panicing if the value is not set.

func (LedgerUpgrade) MustNewLedgerVersion

func (u LedgerUpgrade) MustNewLedgerVersion() Uint32

MustNewLedgerVersion retrieves the NewLedgerVersion value from the union, panicing if the value is not set.

func (LedgerUpgrade) MustNewMaxTxSetSize

func (u LedgerUpgrade) MustNewMaxTxSetSize() Uint32

MustNewMaxTxSetSize retrieves the NewMaxTxSetSize value from the union, panicing if the value is not set.

func (*LedgerUpgrade) Scan

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

Scan reads from src into an LedgerUpgrade struct

func (LedgerUpgrade) SwitchFieldName

func (u LedgerUpgrade) SwitchFieldName() string

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

func (*LedgerUpgrade) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerUpgradeType

type LedgerUpgradeType int32

LedgerUpgradeType is an XDR Enum defines as:

enum LedgerUpgradeType
 {
     LEDGER_UPGRADE_VERSION = 1,
     LEDGER_UPGRADE_BASE_FEE = 2,
     LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3,
     LEDGER_UPGRADE_BASE_RESERVE = 4
 };
const (
	LedgerUpgradeTypeLedgerUpgradeVersion      LedgerUpgradeType = 1
	LedgerUpgradeTypeLedgerUpgradeBaseFee      LedgerUpgradeType = 2
	LedgerUpgradeTypeLedgerUpgradeMaxTxSetSize LedgerUpgradeType = 3
	LedgerUpgradeTypeLedgerUpgradeBaseReserve  LedgerUpgradeType = 4
)

func (LedgerUpgradeType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerUpgradeType) String

func (e LedgerUpgradeType) String() string

String returns the name of `e`

func (*LedgerUpgradeType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (LedgerUpgradeType) ValidEnum

func (e LedgerUpgradeType) ValidEnum(v int32) bool

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

type Liabilities

type Liabilities struct {
	Buying  Int64
	Selling Int64
}

Liabilities is an XDR Struct defines as:

struct Liabilities
 {
     int64 buying;
     int64 selling;
 };

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 ManageBuyOfferOp

type ManageBuyOfferOp struct {
	Selling   Asset
	Buying    Asset
	BuyAmount Int64
	Price     Price
	OfferId   Int64
}

ManageBuyOfferOp is an XDR Struct defines as:

struct ManageBuyOfferOp
 {
     Asset selling;
     Asset buying;
     int64 buyAmount; // amount being bought. if set to 0, delete the offer
     Price price;     // price of thing being bought in terms of what you are
                      // selling

     // 0=create a new offer, otherwise edit an existing offer
     int64 offerID;
 };

func (ManageBuyOfferOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ManageBuyOfferOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageBuyOfferResult

type ManageBuyOfferResult struct {
	Code    ManageBuyOfferResultCode
	Success *ManageOfferSuccessResult
}

ManageBuyOfferResult is an XDR Union defines as:

union ManageBuyOfferResult switch (ManageBuyOfferResultCode code)
 {
 case MANAGE_BUY_OFFER_SUCCESS:
     ManageOfferSuccessResult success;
 default:
     void;
 };

func NewManageBuyOfferResult

func NewManageBuyOfferResult(code ManageBuyOfferResultCode, value interface{}) (result ManageBuyOfferResult, err error)

NewManageBuyOfferResult creates a new ManageBuyOfferResult.

func (ManageBuyOfferResult) ArmForSwitch

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

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

func (ManageBuyOfferResult) GetSuccess

func (u ManageBuyOfferResult) GetSuccess() (result ManageOfferSuccessResult, ok bool)

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

func (ManageBuyOfferResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageBuyOfferResult) MustSuccess

func (u ManageBuyOfferResult) MustSuccess() ManageOfferSuccessResult

MustSuccess retrieves the Success value from the union, panicing if the value is not set.

func (ManageBuyOfferResult) SwitchFieldName

func (u ManageBuyOfferResult) SwitchFieldName() string

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

func (*ManageBuyOfferResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageBuyOfferResultCode

type ManageBuyOfferResultCode int32

ManageBuyOfferResultCode is an XDR Enum defines as:

enum ManageBuyOfferResultCode
 {
     // codes considered as "success" for the operation
     MANAGE_BUY_OFFER_SUCCESS = 0,

     // codes considered as "failure" for the operation
     MANAGE_BUY_OFFER_MALFORMED = -1,     // generated offer would be invalid
     MANAGE_BUY_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling
     MANAGE_BUY_OFFER_BUY_NO_TRUST = -3,  // no trust line for what we're buying
     MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell
     MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED = -5,  // not authorized to buy
     MANAGE_BUY_OFFER_LINE_FULL = -6,   // can't receive more of what it's buying
     MANAGE_BUY_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
     MANAGE_BUY_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
     MANAGE_BUY_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling
     MANAGE_BUY_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying

     // update errors
     MANAGE_BUY_OFFER_NOT_FOUND =
         -11, // offerID does not match an existing offer

     MANAGE_BUY_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer
 };
const (
	ManageBuyOfferResultCodeManageBuyOfferSuccess           ManageBuyOfferResultCode = 0
	ManageBuyOfferResultCodeManageBuyOfferMalformed         ManageBuyOfferResultCode = -1
	ManageBuyOfferResultCodeManageBuyOfferSellNoTrust       ManageBuyOfferResultCode = -2
	ManageBuyOfferResultCodeManageBuyOfferBuyNoTrust        ManageBuyOfferResultCode = -3
	ManageBuyOfferResultCodeManageBuyOfferSellNotAuthorized ManageBuyOfferResultCode = -4
	ManageBuyOfferResultCodeManageBuyOfferBuyNotAuthorized  ManageBuyOfferResultCode = -5
	ManageBuyOfferResultCodeManageBuyOfferLineFull          ManageBuyOfferResultCode = -6
	ManageBuyOfferResultCodeManageBuyOfferUnderfunded       ManageBuyOfferResultCode = -7
	ManageBuyOfferResultCodeManageBuyOfferCrossSelf         ManageBuyOfferResultCode = -8
	ManageBuyOfferResultCodeManageBuyOfferSellNoIssuer      ManageBuyOfferResultCode = -9
	ManageBuyOfferResultCodeManageBuyOfferBuyNoIssuer       ManageBuyOfferResultCode = -10
	ManageBuyOfferResultCodeManageBuyOfferNotFound          ManageBuyOfferResultCode = -11
	ManageBuyOfferResultCodeManageBuyOfferLowReserve        ManageBuyOfferResultCode = -12
)

func (ManageBuyOfferResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageBuyOfferResultCode) String

func (e ManageBuyOfferResultCode) String() string

String returns the name of `e`

func (*ManageBuyOfferResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ManageBuyOfferResultCode) ValidEnum

func (e ManageBuyOfferResultCode) ValidEnum(v int32) bool

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

type ManageDataOp

type ManageDataOp struct {
	DataName  String64
	DataValue *DataValue
}

ManageDataOp is an XDR Struct defines as:

struct ManageDataOp
 {
     string64 dataName;
     DataValue* dataValue; // set to null to clear
 };

func (ManageDataOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ManageDataOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageDataResult

type ManageDataResult struct {
	Code ManageDataResultCode
}

ManageDataResult is an XDR Union defines as:

union ManageDataResult switch (ManageDataResultCode code)
 {
 case MANAGE_DATA_SUCCESS:
     void;
 default:
     void;
 };

func NewManageDataResult

func NewManageDataResult(code ManageDataResultCode, value interface{}) (result ManageDataResult, err error)

NewManageDataResult creates a new ManageDataResult.

func (ManageDataResult) ArmForSwitch

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

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

func (ManageDataResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageDataResult) SwitchFieldName

func (u ManageDataResult) SwitchFieldName() string

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

func (*ManageDataResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageDataResultCode

type ManageDataResultCode int32

ManageDataResultCode is an XDR Enum defines as:

enum ManageDataResultCode
 {
     // codes considered as "success" for the operation
     MANAGE_DATA_SUCCESS = 0,
     // codes considered as "failure" for the operation
     MANAGE_DATA_NOT_SUPPORTED_YET =
         -1, // The network hasn't moved to this protocol change yet
     MANAGE_DATA_NAME_NOT_FOUND =
         -2, // Trying to remove a Data Entry that isn't there
     MANAGE_DATA_LOW_RESERVE = -3, // not enough funds to create a new Data Entry
     MANAGE_DATA_INVALID_NAME = -4 // Name not a valid string
 };
const (
	ManageDataResultCodeManageDataSuccess         ManageDataResultCode = 0
	ManageDataResultCodeManageDataNotSupportedYet ManageDataResultCode = -1
	ManageDataResultCodeManageDataNameNotFound    ManageDataResultCode = -2
	ManageDataResultCodeManageDataLowReserve      ManageDataResultCode = -3
	ManageDataResultCodeManageDataInvalidName     ManageDataResultCode = -4
)

func (ManageDataResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageDataResultCode) String

func (e ManageDataResultCode) String() string

String returns the name of `e`

func (*ManageDataResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ManageDataResultCode) ValidEnum

func (e ManageDataResultCode) ValidEnum(v int32) bool

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

type ManageOfferEffect

type ManageOfferEffect int32

ManageOfferEffect is an XDR Enum defines as:

enum ManageOfferEffect
 {
     MANAGE_OFFER_CREATED = 0,
     MANAGE_OFFER_UPDATED = 1,
     MANAGE_OFFER_DELETED = 2
 };
const (
	ManageOfferEffectManageOfferCreated ManageOfferEffect = 0
	ManageOfferEffectManageOfferUpdated ManageOfferEffect = 1
	ManageOfferEffectManageOfferDeleted ManageOfferEffect = 2
)

func (ManageOfferEffect) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageOfferEffect) String

func (e ManageOfferEffect) String() string

String returns the name of `e`

func (*ManageOfferEffect) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ManageOfferEffect) ValidEnum

func (e ManageOfferEffect) ValidEnum(v int32) bool

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

type ManageOfferSuccessResult

type ManageOfferSuccessResult struct {
	OffersClaimed []ClaimOfferAtom
	Offer         ManageOfferSuccessResultOffer
}

ManageOfferSuccessResult is an XDR Struct defines as:

struct ManageOfferSuccessResult
 {
     // offers that got claimed while creating this offer
     ClaimOfferAtom offersClaimed<>;

     union switch (ManageOfferEffect effect)
     {
     case MANAGE_OFFER_CREATED:
     case MANAGE_OFFER_UPDATED:
         OfferEntry offer;
     default:
         void;
     }
     offer;
 };

func (ManageOfferSuccessResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ManageOfferSuccessResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageOfferSuccessResultOffer

type ManageOfferSuccessResultOffer struct {
	Effect ManageOfferEffect
	Offer  *OfferEntry
}

ManageOfferSuccessResultOffer is an XDR NestedUnion defines as:

union switch (ManageOfferEffect effect)
     {
     case MANAGE_OFFER_CREATED:
     case MANAGE_OFFER_UPDATED:
         OfferEntry offer;
     default:
         void;
     }

func NewManageOfferSuccessResultOffer

func NewManageOfferSuccessResultOffer(effect ManageOfferEffect, value interface{}) (result ManageOfferSuccessResultOffer, err error)

NewManageOfferSuccessResultOffer creates a new ManageOfferSuccessResultOffer.

func (ManageOfferSuccessResultOffer) ArmForSwitch

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

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

func (ManageOfferSuccessResultOffer) GetOffer

func (u ManageOfferSuccessResultOffer) GetOffer() (result OfferEntry, ok bool)

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

func (ManageOfferSuccessResultOffer) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageOfferSuccessResultOffer) MustOffer

func (u ManageOfferSuccessResultOffer) MustOffer() OfferEntry

MustOffer retrieves the Offer value from the union, panicing if the value is not set.

func (ManageOfferSuccessResultOffer) SwitchFieldName

func (u ManageOfferSuccessResultOffer) SwitchFieldName() string

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

func (*ManageOfferSuccessResultOffer) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageSellOfferOp

type ManageSellOfferOp struct {
	Selling Asset
	Buying  Asset
	Amount  Int64
	Price   Price
	OfferId Int64
}

ManageSellOfferOp is an XDR Struct defines as:

struct ManageSellOfferOp
 {
     Asset selling;
     Asset buying;
     int64 amount; // amount being sold. if set to 0, delete the offer
     Price price;  // price of thing being sold in terms of what you are buying

     // 0=create a new offer, otherwise edit an existing offer
     int64 offerID;
 };

func (ManageSellOfferOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ManageSellOfferOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageSellOfferResult

type ManageSellOfferResult struct {
	Code    ManageSellOfferResultCode
	Success *ManageOfferSuccessResult
}

ManageSellOfferResult is an XDR Union defines as:

union ManageSellOfferResult switch (ManageSellOfferResultCode code)
 {
 case MANAGE_SELL_OFFER_SUCCESS:
     ManageOfferSuccessResult success;
 default:
     void;
 };

func NewManageSellOfferResult

func NewManageSellOfferResult(code ManageSellOfferResultCode, value interface{}) (result ManageSellOfferResult, err error)

NewManageSellOfferResult creates a new ManageSellOfferResult.

func (ManageSellOfferResult) ArmForSwitch

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

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

func (ManageSellOfferResult) GetSuccess

func (u ManageSellOfferResult) GetSuccess() (result ManageOfferSuccessResult, ok bool)

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

func (ManageSellOfferResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageSellOfferResult) MustSuccess

func (u ManageSellOfferResult) MustSuccess() ManageOfferSuccessResult

MustSuccess retrieves the Success value from the union, panicing if the value is not set.

func (ManageSellOfferResult) SwitchFieldName

func (u ManageSellOfferResult) SwitchFieldName() string

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

func (*ManageSellOfferResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageSellOfferResultCode

type ManageSellOfferResultCode int32

ManageSellOfferResultCode is an XDR Enum defines as:

enum ManageSellOfferResultCode
 {
     // codes considered as "success" for the operation
     MANAGE_SELL_OFFER_SUCCESS = 0,

     // codes considered as "failure" for the operation
     MANAGE_SELL_OFFER_MALFORMED = -1, // generated offer would be invalid
     MANAGE_SELL_OFFER_SELL_NO_TRUST =
         -2,                              // no trust line for what we're selling
     MANAGE_SELL_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying
     MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell
     MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED = -5,  // not authorized to buy
     MANAGE_SELL_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
     MANAGE_SELL_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
     MANAGE_SELL_OFFER_CROSS_SELF =
         -8, // would cross an offer from the same user
     MANAGE_SELL_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling
     MANAGE_SELL_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying

     // update errors
     MANAGE_SELL_OFFER_NOT_FOUND =
         -11, // offerID does not match an existing offer

     MANAGE_SELL_OFFER_LOW_RESERVE =
         -12 // not enough funds to create a new Offer
 };
const (
	ManageSellOfferResultCodeManageSellOfferSuccess           ManageSellOfferResultCode = 0
	ManageSellOfferResultCodeManageSellOfferMalformed         ManageSellOfferResultCode = -1
	ManageSellOfferResultCodeManageSellOfferSellNoTrust       ManageSellOfferResultCode = -2
	ManageSellOfferResultCodeManageSellOfferBuyNoTrust        ManageSellOfferResultCode = -3
	ManageSellOfferResultCodeManageSellOfferSellNotAuthorized ManageSellOfferResultCode = -4
	ManageSellOfferResultCodeManageSellOfferBuyNotAuthorized  ManageSellOfferResultCode = -5
	ManageSellOfferResultCodeManageSellOfferLineFull          ManageSellOfferResultCode = -6
	ManageSellOfferResultCodeManageSellOfferUnderfunded       ManageSellOfferResultCode = -7
	ManageSellOfferResultCodeManageSellOfferCrossSelf         ManageSellOfferResultCode = -8
	ManageSellOfferResultCodeManageSellOfferSellNoIssuer      ManageSellOfferResultCode = -9
	ManageSellOfferResultCodeManageSellOfferBuyNoIssuer       ManageSellOfferResultCode = -10
	ManageSellOfferResultCodeManageSellOfferNotFound          ManageSellOfferResultCode = -11
	ManageSellOfferResultCodeManageSellOfferLowReserve        ManageSellOfferResultCode = -12
)

func (ManageSellOfferResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageSellOfferResultCode) String

func (e ManageSellOfferResultCode) String() string

String returns the name of `e`

func (*ManageSellOfferResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ManageSellOfferResultCode) ValidEnum

func (e ManageSellOfferResultCode) ValidEnum(v int32) bool

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

type Memo

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

Memo is an XDR Union defines as:

union Memo switch (MemoType type)
 {
 case MEMO_NONE:
     void;
 case MEMO_TEXT:
     string text<28>;
 case MEMO_ID:
     uint64 id;
 case MEMO_HASH:
     Hash hash; // the hash of what to pull from the content server
 case MEMO_RETURN:
     Hash retHash; // the hash of the tx you are rejecting
 };

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

MemoType is an XDR Enum defines as:

enum MemoType
 {
     MEMO_NONE = 0,
     MEMO_TEXT = 1,
     MEMO_ID = 2,
     MEMO_HASH = 3,
     MEMO_RETURN = 4
 };
const (
	MemoTypeMemoNone   MemoType = 0
	MemoTypeMemoText   MemoType = 1
	MemoTypeMemoId     MemoType = 2
	MemoTypeMemoHash   MemoType = 3
	MemoTypeMemoReturn MemoType = 4
)

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 MessageType

type MessageType int32

MessageType is an XDR Enum defines as:

enum MessageType
 {
     ERROR_MSG = 0,
     AUTH = 2,
     DONT_HAVE = 3,

     GET_PEERS = 4, // gets a list of peers this guy knows about
     PEERS = 5,

     GET_TX_SET = 6, // gets a particular txset by hash
     TX_SET = 7,

     TRANSACTION = 8, // pass on a tx you have heard about

     // SCP
     GET_SCP_QUORUMSET = 9,
     SCP_QUORUMSET = 10,
     SCP_MESSAGE = 11,
     GET_SCP_STATE = 12,

     // new messages
     HELLO = 13,

     SURVEY_REQUEST = 14,
     SURVEY_RESPONSE = 15
 };
const (
	MessageTypeErrorMsg        MessageType = 0
	MessageTypeAuth            MessageType = 2
	MessageTypeDontHave        MessageType = 3
	MessageTypeGetPeers        MessageType = 4
	MessageTypePeers           MessageType = 5
	MessageTypeGetTxSet        MessageType = 6
	MessageTypeTxSet           MessageType = 7
	MessageTypeTransaction     MessageType = 8
	MessageTypeGetScpQuorumset MessageType = 9
	MessageTypeScpQuorumset    MessageType = 10
	MessageTypeScpMessage      MessageType = 11
	MessageTypeGetScpState     MessageType = 12
	MessageTypeHello           MessageType = 13
	MessageTypeSurveyRequest   MessageType = 14
	MessageTypeSurveyResponse  MessageType = 15
)

func (MessageType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (MessageType) String

func (e MessageType) String() string

String returns the name of `e`

func (*MessageType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (MessageType) ValidEnum

func (e MessageType) ValidEnum(v int32) bool

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

type MuxedAccount

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

MuxedAccount is an XDR Union defines as:

union MuxedAccount switch (CryptoKeyType type)
 {
 case KEY_TYPE_ED25519:
     uint256 ed25519;
 case KEY_TYPE_MUXED_ED25519:
     struct
     {
         uint64 id;
         uint256 ed25519;
     } med25519;
 };

func NewMuxedAccount

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

NewMuxedAccount creates a new MuxedAccount.

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) 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) 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) 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 address.

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
}

MuxedAccountMed25519 is an XDR NestedStruct defines as:

struct
     {
         uint64 id;
         uint256 ed25519;
     }

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 NodeId

type NodeId PublicKey

NodeId is an XDR Typedef defines as:

typedef PublicKey NodeID;

func NewNodeId

func NewNodeId(aType PublicKeyType, value interface{}) (result NodeId, err error)

NewNodeId creates a new NodeId.

func (NodeId) ArmForSwitch

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

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

func (NodeId) GetEd25519

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

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

MarshalBinary implements encoding.BinaryMarshaler.

func (NodeId) MustEd25519

func (u NodeId) MustEd25519() Uint256

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

func (NodeId) SwitchFieldName

func (u NodeId) SwitchFieldName() string

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

func (*NodeId) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OfferEntry

type OfferEntry struct {
	SellerId AccountId
	OfferId  Int64
	Selling  Asset
	Buying   Asset
	Amount   Int64
	Price    Price
	Flags    Uint32
	Ext      OfferEntryExt
}

OfferEntry is an XDR Struct defines as:

struct OfferEntry
 {
     AccountID sellerID;
     int64 offerID;
     Asset selling; // A
     Asset buying;  // B
     int64 amount;  // amount of A

     /* price for this offer:
         price of A in terms of B
         price=AmountB/AmountA=priceNumerator/priceDenominator
         price is after fees
     */
     Price price;
     uint32 flags; // see OfferEntryFlags

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

func (OfferEntry) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*OfferEntry) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OfferEntryExt

type OfferEntryExt struct {
	V int32
}

OfferEntryExt is an XDR NestedUnion defines as:

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

func NewOfferEntryExt

func NewOfferEntryExt(v int32, value interface{}) (result OfferEntryExt, err error)

NewOfferEntryExt creates a new OfferEntryExt.

func (OfferEntryExt) ArmForSwitch

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

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

func (OfferEntryExt) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OfferEntryExt) SwitchFieldName

func (u OfferEntryExt) SwitchFieldName() string

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

func (*OfferEntryExt) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OfferEntryFlags

type OfferEntryFlags int32

OfferEntryFlags is an XDR Enum defines as:

enum OfferEntryFlags
 {
     // issuer has authorized account to perform transactions with its credit
     PASSIVE_FLAG = 1
 };
const (
	OfferEntryFlagsPassiveFlag OfferEntryFlags = 1
)

func (OfferEntryFlags) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OfferEntryFlags) String

func (e OfferEntryFlags) String() string

String returns the name of `e`

func (*OfferEntryFlags) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (OfferEntryFlags) ValidEnum

func (e OfferEntryFlags) ValidEnum(v int32) bool

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

type Operation

type Operation struct {
	SourceAccount *MuxedAccount
	Body          OperationBody
}

Operation is an XDR Struct defines as:

struct Operation
 {
     // sourceAccount is the account used to run the operation
     // if not set, the runtime defaults to "sourceAccount" specified at
     // the transaction level
     MuxedAccount* sourceAccount;

     union switch (OperationType type)
     {
     case CREATE_ACCOUNT:
         CreateAccountOp createAccountOp;
     case PAYMENT:
         PaymentOp paymentOp;
     case PATH_PAYMENT_STRICT_RECEIVE:
         PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp;
     case MANAGE_SELL_OFFER:
         ManageSellOfferOp manageSellOfferOp;
     case CREATE_PASSIVE_SELL_OFFER:
         CreatePassiveSellOfferOp createPassiveSellOfferOp;
     case SET_OPTIONS:
         SetOptionsOp setOptionsOp;
     case CHANGE_TRUST:
         ChangeTrustOp changeTrustOp;
     case ALLOW_TRUST:
         AllowTrustOp allowTrustOp;
     case ACCOUNT_MERGE:
         MuxedAccount destination;
     case INFLATION:
         void;
     case MANAGE_DATA:
         ManageDataOp manageDataOp;
     case BUMP_SEQUENCE:
         BumpSequenceOp bumpSequenceOp;
     case MANAGE_BUY_OFFER:
         ManageBuyOfferOp manageBuyOfferOp;
     case PATH_PAYMENT_STRICT_SEND:
         PathPaymentStrictSendOp pathPaymentStrictSendOp;
     }
     body;
 };

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
	CreateAccountOp            *CreateAccountOp
	PaymentOp                  *PaymentOp
	PathPaymentStrictReceiveOp *PathPaymentStrictReceiveOp
	ManageSellOfferOp          *ManageSellOfferOp
	CreatePassiveSellOfferOp   *CreatePassiveSellOfferOp
	SetOptionsOp               *SetOptionsOp
	ChangeTrustOp              *ChangeTrustOp
	AllowTrustOp               *AllowTrustOp
	Destination                *MuxedAccount
	ManageDataOp               *ManageDataOp
	BumpSequenceOp             *BumpSequenceOp
	ManageBuyOfferOp           *ManageBuyOfferOp
	PathPaymentStrictSendOp    *PathPaymentStrictSendOp
}

OperationBody is an XDR NestedUnion defines as:

union switch (OperationType type)
     {
     case CREATE_ACCOUNT:
         CreateAccountOp createAccountOp;
     case PAYMENT:
         PaymentOp paymentOp;
     case PATH_PAYMENT_STRICT_RECEIVE:
         PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp;
     case MANAGE_SELL_OFFER:
         ManageSellOfferOp manageSellOfferOp;
     case CREATE_PASSIVE_SELL_OFFER:
         CreatePassiveSellOfferOp createPassiveSellOfferOp;
     case SET_OPTIONS:
         SetOptionsOp setOptionsOp;
     case CHANGE_TRUST:
         ChangeTrustOp changeTrustOp;
     case ALLOW_TRUST:
         AllowTrustOp allowTrustOp;
     case ACCOUNT_MERGE:
         MuxedAccount destination;
     case INFLATION:
         void;
     case MANAGE_DATA:
         ManageDataOp manageDataOp;
     case BUMP_SEQUENCE:
         BumpSequenceOp bumpSequenceOp;
     case MANAGE_BUY_OFFER:
         ManageBuyOfferOp manageBuyOfferOp;
     case PATH_PAYMENT_STRICT_SEND:
         PathPaymentStrictSendOp pathPaymentStrictSendOp;
     }

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

func (u OperationBody) GetBumpSequenceOp() (result BumpSequenceOp, ok bool)

GetBumpSequenceOp retrieves the BumpSequenceOp 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) GetCreateAccountOp

func (u OperationBody) GetCreateAccountOp() (result CreateAccountOp, ok bool)

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

func (OperationBody) GetCreatePassiveSellOfferOp

func (u OperationBody) GetCreatePassiveSellOfferOp() (result CreatePassiveSellOfferOp, ok bool)

GetCreatePassiveSellOfferOp retrieves the CreatePassiveSellOfferOp 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) GetManageBuyOfferOp

func (u OperationBody) GetManageBuyOfferOp() (result ManageBuyOfferOp, ok bool)

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

func (OperationBody) GetManageDataOp

func (u OperationBody) GetManageDataOp() (result ManageDataOp, ok bool)

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

func (OperationBody) GetManageSellOfferOp

func (u OperationBody) GetManageSellOfferOp() (result ManageSellOfferOp, ok bool)

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

func (OperationBody) GetPathPaymentStrictReceiveOp

func (u OperationBody) GetPathPaymentStrictReceiveOp() (result PathPaymentStrictReceiveOp, ok bool)

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

func (OperationBody) GetPathPaymentStrictSendOp

func (u OperationBody) GetPathPaymentStrictSendOp() (result PathPaymentStrictSendOp, ok bool)

GetPathPaymentStrictSendOp retrieves the PathPaymentStrictSendOp 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) GetSetOptionsOp

func (u OperationBody) GetSetOptionsOp() (result SetOptionsOp, ok bool)

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

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

func (u OperationBody) MustBumpSequenceOp() BumpSequenceOp

MustBumpSequenceOp retrieves the BumpSequenceOp 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) MustCreateAccountOp

func (u OperationBody) MustCreateAccountOp() CreateAccountOp

MustCreateAccountOp retrieves the CreateAccountOp value from the union, panicing if the value is not set.

func (OperationBody) MustCreatePassiveSellOfferOp

func (u OperationBody) MustCreatePassiveSellOfferOp() CreatePassiveSellOfferOp

MustCreatePassiveSellOfferOp retrieves the CreatePassiveSellOfferOp 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) MustManageBuyOfferOp

func (u OperationBody) MustManageBuyOfferOp() ManageBuyOfferOp

MustManageBuyOfferOp retrieves the ManageBuyOfferOp value from the union, panicing if the value is not set.

func (OperationBody) MustManageDataOp

func (u OperationBody) MustManageDataOp() ManageDataOp

MustManageDataOp retrieves the ManageDataOp value from the union, panicing if the value is not set.

func (OperationBody) MustManageSellOfferOp

func (u OperationBody) MustManageSellOfferOp() ManageSellOfferOp

MustManageSellOfferOp retrieves the ManageSellOfferOp value from the union, panicing if the value is not set.

func (OperationBody) MustPathPaymentStrictReceiveOp

func (u OperationBody) MustPathPaymentStrictReceiveOp() PathPaymentStrictReceiveOp

MustPathPaymentStrictReceiveOp retrieves the PathPaymentStrictReceiveOp value from the union, panicing if the value is not set.

func (OperationBody) MustPathPaymentStrictSendOp

func (u OperationBody) MustPathPaymentStrictSendOp() PathPaymentStrictSendOp

MustPathPaymentStrictSendOp retrieves the PathPaymentStrictSendOp 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) MustSetOptionsOp

func (u OperationBody) MustSetOptionsOp() SetOptionsOp

MustSetOptionsOp retrieves the SetOptionsOp 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 OperationMeta

type OperationMeta struct {
	Changes LedgerEntryChanges
}

OperationMeta is an XDR Struct defines as:

struct OperationMeta
 {
     LedgerEntryChanges changes;
 };

func (OperationMeta) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*OperationMeta) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationResult

type OperationResult struct {
	Code OperationResultCode
	Tr   *OperationResultTr
}

OperationResult is an XDR Union defines as:

union OperationResult switch (OperationResultCode code)
 {
 case opINNER:
     union switch (OperationType type)
     {
     case CREATE_ACCOUNT:
         CreateAccountResult createAccountResult;
     case PAYMENT:
         PaymentResult paymentResult;
     case PATH_PAYMENT_STRICT_RECEIVE:
         PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult;
     case MANAGE_SELL_OFFER:
         ManageSellOfferResult manageSellOfferResult;
     case CREATE_PASSIVE_SELL_OFFER:
         ManageSellOfferResult createPassiveSellOfferResult;
     case SET_OPTIONS:
         SetOptionsResult setOptionsResult;
     case CHANGE_TRUST:
         ChangeTrustResult changeTrustResult;
     case ALLOW_TRUST:
         AllowTrustResult allowTrustResult;
     case ACCOUNT_MERGE:
         AccountMergeResult accountMergeResult;
     case INFLATION:
         InflationResult inflationResult;
     case MANAGE_DATA:
         ManageDataResult manageDataResult;
     case BUMP_SEQUENCE:
         BumpSequenceResult bumpSeqResult;
     case MANAGE_BUY_OFFER:
         ManageBuyOfferResult manageBuyOfferResult;
     case PATH_PAYMENT_STRICT_SEND:
         PathPaymentStrictSendResult pathPaymentStrictSendResult;
     }
     tr;
 default:
     void;
 };

func NewOperationResult

func NewOperationResult(code OperationResultCode, value interface{}) (result OperationResult, err error)

NewOperationResult creates a new OperationResult.

func (OperationResult) ArmForSwitch

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

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

func (OperationResult) GetTr

func (u OperationResult) GetTr() (result OperationResultTr, ok bool)

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

func (OperationResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationResult) MustTr

func (u OperationResult) MustTr() OperationResultTr

MustTr retrieves the Tr value from the union, panicing if the value is not set.

func (OperationResult) SwitchFieldName

func (u OperationResult) SwitchFieldName() string

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

func (*OperationResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationResultCode

type OperationResultCode int32

OperationResultCode is an XDR Enum defines as:

enum OperationResultCode
 {
     opINNER = 0, // inner object result is valid

     opBAD_AUTH = -1,            // too few valid signatures / wrong network
     opNO_ACCOUNT = -2,          // source account was not found
     opNOT_SUPPORTED = -3,       // operation not supported at this time
     opTOO_MANY_SUBENTRIES = -4, // max number of subentries already reached
     opEXCEEDED_WORK_LIMIT = -5  // operation did too much work
 };
const (
	OperationResultCodeOpInner             OperationResultCode = 0
	OperationResultCodeOpBadAuth           OperationResultCode = -1
	OperationResultCodeOpNoAccount         OperationResultCode = -2
	OperationResultCodeOpNotSupported      OperationResultCode = -3
	OperationResultCodeOpTooManySubentries OperationResultCode = -4
	OperationResultCodeOpExceededWorkLimit OperationResultCode = -5
)

func (OperationResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationResultCode) String

func (e OperationResultCode) String() string

String returns the name of `e`

func (*OperationResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (OperationResultCode) ValidEnum

func (e OperationResultCode) ValidEnum(v int32) bool

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

type OperationResultTr

type OperationResultTr struct {
	Type                           OperationType
	CreateAccountResult            *CreateAccountResult
	PaymentResult                  *PaymentResult
	PathPaymentStrictReceiveResult *PathPaymentStrictReceiveResult
	ManageSellOfferResult          *ManageSellOfferResult
	CreatePassiveSellOfferResult   *ManageSellOfferResult
	SetOptionsResult               *SetOptionsResult
	ChangeTrustResult              *ChangeTrustResult
	AllowTrustResult               *AllowTrustResult
	AccountMergeResult             *AccountMergeResult
	InflationResult                *InflationResult
	ManageDataResult               *ManageDataResult
	BumpSeqResult                  *BumpSequenceResult
	ManageBuyOfferResult           *ManageBuyOfferResult
	PathPaymentStrictSendResult    *PathPaymentStrictSendResult
}

OperationResultTr is an XDR NestedUnion defines as:

union switch (OperationType type)
     {
     case CREATE_ACCOUNT:
         CreateAccountResult createAccountResult;
     case PAYMENT:
         PaymentResult paymentResult;
     case PATH_PAYMENT_STRICT_RECEIVE:
         PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult;
     case MANAGE_SELL_OFFER:
         ManageSellOfferResult manageSellOfferResult;
     case CREATE_PASSIVE_SELL_OFFER:
         ManageSellOfferResult createPassiveSellOfferResult;
     case SET_OPTIONS:
         SetOptionsResult setOptionsResult;
     case CHANGE_TRUST:
         ChangeTrustResult changeTrustResult;
     case ALLOW_TRUST:
         AllowTrustResult allowTrustResult;
     case ACCOUNT_MERGE:
         AccountMergeResult accountMergeResult;
     case INFLATION:
         InflationResult inflationResult;
     case MANAGE_DATA:
         ManageDataResult manageDataResult;
     case BUMP_SEQUENCE:
         BumpSequenceResult bumpSeqResult;
     case MANAGE_BUY_OFFER:
         ManageBuyOfferResult manageBuyOfferResult;
     case PATH_PAYMENT_STRICT_SEND:
         PathPaymentStrictSendResult pathPaymentStrictSendResult;
     }

func NewOperationResultTr

func NewOperationResultTr(aType OperationType, value interface{}) (result OperationResultTr, err error)

NewOperationResultTr creates a new OperationResultTr.

func (OperationResultTr) ArmForSwitch

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

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

func (OperationResultTr) GetAccountMergeResult

func (u OperationResultTr) GetAccountMergeResult() (result AccountMergeResult, ok bool)

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

func (OperationResultTr) GetAllowTrustResult

func (u OperationResultTr) GetAllowTrustResult() (result AllowTrustResult, ok bool)

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

func (OperationResultTr) GetBumpSeqResult

func (u OperationResultTr) GetBumpSeqResult() (result BumpSequenceResult, ok bool)

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

func (OperationResultTr) GetChangeTrustResult

func (u OperationResultTr) GetChangeTrustResult() (result ChangeTrustResult, ok bool)

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

func (OperationResultTr) GetCreateAccountResult

func (u OperationResultTr) GetCreateAccountResult() (result CreateAccountResult, ok bool)

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

func (OperationResultTr) GetCreatePassiveSellOfferResult

func (u OperationResultTr) GetCreatePassiveSellOfferResult() (result ManageSellOfferResult, ok bool)

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

func (OperationResultTr) GetInflationResult

func (u OperationResultTr) GetInflationResult() (result InflationResult, ok bool)

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

func (OperationResultTr) GetManageBuyOfferResult

func (u OperationResultTr) GetManageBuyOfferResult() (result ManageBuyOfferResult, ok bool)

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

func (OperationResultTr) GetManageDataResult

func (u OperationResultTr) GetManageDataResult() (result ManageDataResult, ok bool)

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

func (OperationResultTr) GetManageSellOfferResult

func (u OperationResultTr) GetManageSellOfferResult() (result ManageSellOfferResult, ok bool)

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

func (OperationResultTr) GetPathPaymentStrictReceiveResult

func (u OperationResultTr) GetPathPaymentStrictReceiveResult() (result PathPaymentStrictReceiveResult, ok bool)

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

func (OperationResultTr) GetPathPaymentStrictSendResult

func (u OperationResultTr) GetPathPaymentStrictSendResult() (result PathPaymentStrictSendResult, ok bool)

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

func (OperationResultTr) GetPaymentResult

func (u OperationResultTr) GetPaymentResult() (result PaymentResult, ok bool)

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

func (OperationResultTr) GetSetOptionsResult

func (u OperationResultTr) GetSetOptionsResult() (result SetOptionsResult, ok bool)

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

func (OperationResultTr) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationResultTr) MustAccountMergeResult

func (u OperationResultTr) MustAccountMergeResult() AccountMergeResult

MustAccountMergeResult retrieves the AccountMergeResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustAllowTrustResult

func (u OperationResultTr) MustAllowTrustResult() AllowTrustResult

MustAllowTrustResult retrieves the AllowTrustResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustBumpSeqResult

func (u OperationResultTr) MustBumpSeqResult() BumpSequenceResult

MustBumpSeqResult retrieves the BumpSeqResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustChangeTrustResult

func (u OperationResultTr) MustChangeTrustResult() ChangeTrustResult

MustChangeTrustResult retrieves the ChangeTrustResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustCreateAccountResult

func (u OperationResultTr) MustCreateAccountResult() CreateAccountResult

MustCreateAccountResult retrieves the CreateAccountResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustCreatePassiveSellOfferResult

func (u OperationResultTr) MustCreatePassiveSellOfferResult() ManageSellOfferResult

MustCreatePassiveSellOfferResult retrieves the CreatePassiveSellOfferResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustInflationResult

func (u OperationResultTr) MustInflationResult() InflationResult

MustInflationResult retrieves the InflationResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustManageBuyOfferResult

func (u OperationResultTr) MustManageBuyOfferResult() ManageBuyOfferResult

MustManageBuyOfferResult retrieves the ManageBuyOfferResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustManageDataResult

func (u OperationResultTr) MustManageDataResult() ManageDataResult

MustManageDataResult retrieves the ManageDataResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustManageSellOfferResult

func (u OperationResultTr) MustManageSellOfferResult() ManageSellOfferResult

MustManageSellOfferResult retrieves the ManageSellOfferResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustPathPaymentStrictReceiveResult

func (u OperationResultTr) MustPathPaymentStrictReceiveResult() PathPaymentStrictReceiveResult

MustPathPaymentStrictReceiveResult retrieves the PathPaymentStrictReceiveResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustPathPaymentStrictSendResult

func (u OperationResultTr) MustPathPaymentStrictSendResult() PathPaymentStrictSendResult

MustPathPaymentStrictSendResult retrieves the PathPaymentStrictSendResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustPaymentResult

func (u OperationResultTr) MustPaymentResult() PaymentResult

MustPaymentResult retrieves the PaymentResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustSetOptionsResult

func (u OperationResultTr) MustSetOptionsResult() SetOptionsResult

MustSetOptionsResult retrieves the SetOptionsResult value from the union, panicing if the value is not set.

func (OperationResultTr) SwitchFieldName

func (u OperationResultTr) SwitchFieldName() string

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

func (*OperationResultTr) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationType

type OperationType int32

OperationType is an XDR Enum defines as:

enum OperationType
 {
     CREATE_ACCOUNT = 0,
     PAYMENT = 1,
     PATH_PAYMENT_STRICT_RECEIVE = 2,
     MANAGE_SELL_OFFER = 3,
     CREATE_PASSIVE_SELL_OFFER = 4,
     SET_OPTIONS = 5,
     CHANGE_TRUST = 6,
     ALLOW_TRUST = 7,
     ACCOUNT_MERGE = 8,
     INFLATION = 9,
     MANAGE_DATA = 10,
     BUMP_SEQUENCE = 11,
     MANAGE_BUY_OFFER = 12,
     PATH_PAYMENT_STRICT_SEND = 13
 };
const (
	OperationTypeCreateAccount            OperationType = 0
	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
	OperationTypeManageData               OperationType = 10
	OperationTypeBumpSequence             OperationType = 11
	OperationTypeManageBuyOffer           OperationType = 12
	OperationTypePathPaymentStrictSend    OperationType = 13
)

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 PathPaymentStrictReceiveOp

type PathPaymentStrictReceiveOp struct {
	SendAsset   Asset
	SendMax     Int64
	Destination MuxedAccount
	DestAsset   Asset
	DestAmount  Int64
	Path        []Asset `xdrmaxsize:"5"`
}

PathPaymentStrictReceiveOp is an XDR Struct defines as:

struct PathPaymentStrictReceiveOp
 {
     Asset sendAsset; // asset we pay with
     int64 sendMax;   // the maximum amount of sendAsset to
                      // send (excluding fees).
                      // The operation will fail if can't be met

     MuxedAccount destination; // recipient of the payment
     Asset destAsset;          // what they end up with
     int64 destAmount;         // amount they end up with

     Asset path<5>; // additional hops it must go through to get there
 };

func (PathPaymentStrictReceiveOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PathPaymentStrictReceiveOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictReceiveResult

type PathPaymentStrictReceiveResult struct {
	Code     PathPaymentStrictReceiveResultCode
	Success  *PathPaymentStrictReceiveResultSuccess
	NoIssuer *Asset
}

PathPaymentStrictReceiveResult is an XDR Union defines as:

union PathPaymentStrictReceiveResult switch (PathPaymentStrictReceiveResultCode code)
 {
 case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS:
     struct
     {
         ClaimOfferAtom offers<>;
         SimplePaymentResult last;
     } success;
 case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER:
     Asset noIssuer; // the asset that caused the error
 default:
     void;
 };

func NewPathPaymentStrictReceiveResult

func NewPathPaymentStrictReceiveResult(code PathPaymentStrictReceiveResultCode, value interface{}) (result PathPaymentStrictReceiveResult, err error)

NewPathPaymentStrictReceiveResult creates a new PathPaymentStrictReceiveResult.

func (PathPaymentStrictReceiveResult) ArmForSwitch

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

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

func (PathPaymentStrictReceiveResult) GetNoIssuer

func (u PathPaymentStrictReceiveResult) GetNoIssuer() (result Asset, ok bool)

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

func (PathPaymentStrictReceiveResult) GetSuccess

func (u PathPaymentStrictReceiveResult) GetSuccess() (result PathPaymentStrictReceiveResultSuccess, ok bool)

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

func (PathPaymentStrictReceiveResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PathPaymentStrictReceiveResult) MustNoIssuer

func (u PathPaymentStrictReceiveResult) MustNoIssuer() Asset

MustNoIssuer retrieves the NoIssuer value from the union, panicing if the value is not set.

func (PathPaymentStrictReceiveResult) MustSuccess

func (u PathPaymentStrictReceiveResult) MustSuccess() PathPaymentStrictReceiveResultSuccess

MustSuccess retrieves the Success value from the union, panicing if the value is not set.

func (*PathPaymentStrictReceiveResult) SendAmount

func (pr *PathPaymentStrictReceiveResult) SendAmount() Int64

SendAmount returns the amount spent, denominated in the source asset, in the course of this path payment

func (PathPaymentStrictReceiveResult) SwitchFieldName

func (u PathPaymentStrictReceiveResult) SwitchFieldName() string

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

func (*PathPaymentStrictReceiveResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictReceiveResultCode

type PathPaymentStrictReceiveResultCode int32

PathPaymentStrictReceiveResultCode is an XDR Enum defines as:

enum PathPaymentStrictReceiveResultCode
 {
     // codes considered as "success" for the operation
     PATH_PAYMENT_STRICT_RECEIVE_SUCCESS = 0, // success

     // codes considered as "failure" for the operation
     PATH_PAYMENT_STRICT_RECEIVE_MALFORMED = -1, // bad input
     PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED =
         -2, // not enough funds in source account
     PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST =
         -3, // no trust line on source account
     PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED =
         -4, // source not authorized to transfer
     PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION =
         -5, // destination account does not exist
     PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST =
         -6, // dest missing a trust line for asset
     PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED =
         -7, // dest not authorized to hold asset
     PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL =
         -8, // dest would go above their limit
     PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER = -9, // missing issuer on one asset
     PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS =
         -10, // not enough offers to satisfy path
     PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF =
         -11, // would cross one of its own offers
     PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX = -12 // could not satisfy sendmax
 };
const (
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveSuccess          PathPaymentStrictReceiveResultCode = 0
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveMalformed        PathPaymentStrictReceiveResultCode = -1
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveUnderfunded      PathPaymentStrictReceiveResultCode = -2
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveSrcNoTrust       PathPaymentStrictReceiveResultCode = -3
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveSrcNotAuthorized PathPaymentStrictReceiveResultCode = -4
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveNoDestination    PathPaymentStrictReceiveResultCode = -5
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveNoTrust          PathPaymentStrictReceiveResultCode = -6
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveNotAuthorized    PathPaymentStrictReceiveResultCode = -7
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveLineFull         PathPaymentStrictReceiveResultCode = -8
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveNoIssuer         PathPaymentStrictReceiveResultCode = -9
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveTooFewOffers     PathPaymentStrictReceiveResultCode = -10
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveOfferCrossSelf   PathPaymentStrictReceiveResultCode = -11
	PathPaymentStrictReceiveResultCodePathPaymentStrictReceiveOverSendmax      PathPaymentStrictReceiveResultCode = -12
)

func (PathPaymentStrictReceiveResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PathPaymentStrictReceiveResultCode) String

func (e PathPaymentStrictReceiveResultCode) String() string

String returns the name of `e`

func (*PathPaymentStrictReceiveResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PathPaymentStrictReceiveResultCode) ValidEnum

func (e PathPaymentStrictReceiveResultCode) ValidEnum(v int32) bool

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

type PathPaymentStrictReceiveResultSuccess

type PathPaymentStrictReceiveResultSuccess struct {
	Offers []ClaimOfferAtom
	Last   SimplePaymentResult
}

PathPaymentStrictReceiveResultSuccess is an XDR NestedStruct defines as:

struct
     {
         ClaimOfferAtom offers<>;
         SimplePaymentResult last;
     }

func (PathPaymentStrictReceiveResultSuccess) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PathPaymentStrictReceiveResultSuccess) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictSendOp

type PathPaymentStrictSendOp struct {
	SendAsset   Asset
	SendAmount  Int64
	Destination MuxedAccount
	DestAsset   Asset
	DestMin     Int64
	Path        []Asset `xdrmaxsize:"5"`
}

PathPaymentStrictSendOp is an XDR Struct defines as:

struct PathPaymentStrictSendOp
 {
     Asset sendAsset;  // asset we pay with
     int64 sendAmount; // amount of sendAsset to send (excluding fees)

     MuxedAccount destination; // recipient of the payment
     Asset destAsset;          // what they end up with
     int64 destMin;            // the minimum amount of dest asset to
                               // be received
                               // The operation will fail if it can't be met

     Asset path<5>; // additional hops it must go through to get there
 };

func (PathPaymentStrictSendOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PathPaymentStrictSendOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictSendResult

type PathPaymentStrictSendResult struct {
	Code     PathPaymentStrictSendResultCode
	Success  *PathPaymentStrictSendResultSuccess
	NoIssuer *Asset
}

PathPaymentStrictSendResult is an XDR Union defines as:

union PathPaymentStrictSendResult switch (PathPaymentStrictSendResultCode code)
 {
 case PATH_PAYMENT_STRICT_SEND_SUCCESS:
     struct
     {
         ClaimOfferAtom offers<>;
         SimplePaymentResult last;
     } success;
 case PATH_PAYMENT_STRICT_SEND_NO_ISSUER:
     Asset noIssuer; // the asset that caused the error
 default:
     void;
 };

func NewPathPaymentStrictSendResult

func NewPathPaymentStrictSendResult(code PathPaymentStrictSendResultCode, value interface{}) (result PathPaymentStrictSendResult, err error)

NewPathPaymentStrictSendResult creates a new PathPaymentStrictSendResult.

func (PathPaymentStrictSendResult) ArmForSwitch

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

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

func (*PathPaymentStrictSendResult) DestAmount

func (pr *PathPaymentStrictSendResult) DestAmount() Int64

DestAmount returns the amount received, denominated in the destination asset, in the course of this path payment

func (PathPaymentStrictSendResult) GetNoIssuer

func (u PathPaymentStrictSendResult) GetNoIssuer() (result Asset, ok bool)

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

func (PathPaymentStrictSendResult) GetSuccess

func (u PathPaymentStrictSendResult) GetSuccess() (result PathPaymentStrictSendResultSuccess, ok bool)

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

func (PathPaymentStrictSendResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PathPaymentStrictSendResult) MustNoIssuer

func (u PathPaymentStrictSendResult) MustNoIssuer() Asset

MustNoIssuer retrieves the NoIssuer value from the union, panicing if the value is not set.

func (PathPaymentStrictSendResult) MustSuccess

func (u PathPaymentStrictSendResult) MustSuccess() PathPaymentStrictSendResultSuccess

MustSuccess retrieves the Success value from the union, panicing if the value is not set.

func (PathPaymentStrictSendResult) SwitchFieldName

func (u PathPaymentStrictSendResult) SwitchFieldName() string

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

func (*PathPaymentStrictSendResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictSendResultCode

type PathPaymentStrictSendResultCode int32

PathPaymentStrictSendResultCode is an XDR Enum defines as:

enum PathPaymentStrictSendResultCode
 {
     // codes considered as "success" for the operation
     PATH_PAYMENT_STRICT_SEND_SUCCESS = 0, // success

     // codes considered as "failure" for the operation
     PATH_PAYMENT_STRICT_SEND_MALFORMED = -1, // bad input
     PATH_PAYMENT_STRICT_SEND_UNDERFUNDED =
         -2, // not enough funds in source account
     PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST =
         -3, // no trust line on source account
     PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED =
         -4, // source not authorized to transfer
     PATH_PAYMENT_STRICT_SEND_NO_DESTINATION =
         -5, // destination account does not exist
     PATH_PAYMENT_STRICT_SEND_NO_TRUST =
         -6, // dest missing a trust line for asset
     PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED =
         -7, // dest not authorized to hold asset
     PATH_PAYMENT_STRICT_SEND_LINE_FULL = -8, // dest would go above their limit
     PATH_PAYMENT_STRICT_SEND_NO_ISSUER = -9, // missing issuer on one asset
     PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS =
         -10, // not enough offers to satisfy path
     PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF =
         -11, // would cross one of its own offers
     PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN = -12 // could not satisfy destMin
 };
const (
	PathPaymentStrictSendResultCodePathPaymentStrictSendSuccess          PathPaymentStrictSendResultCode = 0
	PathPaymentStrictSendResultCodePathPaymentStrictSendMalformed        PathPaymentStrictSendResultCode = -1
	PathPaymentStrictSendResultCodePathPaymentStrictSendUnderfunded      PathPaymentStrictSendResultCode = -2
	PathPaymentStrictSendResultCodePathPaymentStrictSendSrcNoTrust       PathPaymentStrictSendResultCode = -3
	PathPaymentStrictSendResultCodePathPaymentStrictSendSrcNotAuthorized PathPaymentStrictSendResultCode = -4
	PathPaymentStrictSendResultCodePathPaymentStrictSendNoDestination    PathPaymentStrictSendResultCode = -5
	PathPaymentStrictSendResultCodePathPaymentStrictSendNoTrust          PathPaymentStrictSendResultCode = -6
	PathPaymentStrictSendResultCodePathPaymentStrictSendNotAuthorized    PathPaymentStrictSendResultCode = -7
	PathPaymentStrictSendResultCodePathPaymentStrictSendLineFull         PathPaymentStrictSendResultCode = -8
	PathPaymentStrictSendResultCodePathPaymentStrictSendNoIssuer         PathPaymentStrictSendResultCode = -9
	PathPaymentStrictSendResultCodePathPaymentStrictSendTooFewOffers     PathPaymentStrictSendResultCode = -10
	PathPaymentStrictSendResultCodePathPaymentStrictSendOfferCrossSelf   PathPaymentStrictSendResultCode = -11
	PathPaymentStrictSendResultCodePathPaymentStrictSendUnderDestmin     PathPaymentStrictSendResultCode = -12
)

func (PathPaymentStrictSendResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PathPaymentStrictSendResultCode) String

func (e PathPaymentStrictSendResultCode) String() string

String returns the name of `e`

func (*PathPaymentStrictSendResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PathPaymentStrictSendResultCode) ValidEnum

func (e PathPaymentStrictSendResultCode) ValidEnum(v int32) bool

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

type PathPaymentStrictSendResultSuccess

type PathPaymentStrictSendResultSuccess struct {
	Offers []ClaimOfferAtom
	Last   SimplePaymentResult
}

PathPaymentStrictSendResultSuccess is an XDR NestedStruct defines as:

struct
     {
         ClaimOfferAtom offers<>;
         SimplePaymentResult last;
     }

func (PathPaymentStrictSendResultSuccess) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PathPaymentStrictSendResultSuccess) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PaymentOp

type PaymentOp struct {
	Destination MuxedAccount
	Asset       Asset
	Amount      Int64
}

PaymentOp is an XDR Struct defines as:

struct PaymentOp
 {
     MuxedAccount destination; // recipient of the payment
     Asset asset;              // what they end up with
     int64 amount;             // amount they end up with
 };

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 PaymentResult

type PaymentResult struct {
	Code PaymentResultCode
}

PaymentResult is an XDR Union defines as:

union PaymentResult switch (PaymentResultCode code)
 {
 case PAYMENT_SUCCESS:
     void;
 default:
     void;
 };

func NewPaymentResult

func NewPaymentResult(code PaymentResultCode, value interface{}) (result PaymentResult, err error)

NewPaymentResult creates a new PaymentResult.

func (PaymentResult) ArmForSwitch

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

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

func (PaymentResult) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PaymentResult) SwitchFieldName

func (u PaymentResult) SwitchFieldName() string

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

func (*PaymentResult) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PaymentResultCode

type PaymentResultCode int32

PaymentResultCode is an XDR Enum defines as:

enum PaymentResultCode
 {
     // codes considered as "success" for the operation
     PAYMENT_SUCCESS = 0, // payment successfuly completed

     // codes considered as "failure" for the operation
     PAYMENT_MALFORMED = -1,          // bad input
     PAYMENT_UNDERFUNDED = -2,        // not enough funds in source account
     PAYMENT_SRC_NO_TRUST = -3,       // no trust line on source account
     PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer
     PAYMENT_NO_DESTINATION = -5,     // destination account does not exist
     PAYMENT_NO_TRUST = -6,       // destination missing a trust line for asset
     PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset
     PAYMENT_LINE_FULL = -8,      // destination would go above their limit
     PAYMENT_NO_ISSUER = -9       // missing issuer on asset
 };
const (
	PaymentResultCodePaymentSuccess          PaymentResultCode = 0
	PaymentResultCodePaymentMalformed        PaymentResultCode = -1
	PaymentResultCodePaymentUnderfunded      PaymentResultCode = -2
	PaymentResultCodePaymentSrcNoTrust       PaymentResultCode = -3
	PaymentResultCodePaymentSrcNotAuthorized PaymentResultCode = -4
	PaymentResultCodePaymentNoDestination    PaymentResultCode = -5
	PaymentResultCodePaymentNoTrust          PaymentResultCode = -6
	PaymentResultCodePaymentNotAuthorized    PaymentResultCode = -7
	PaymentResultCodePaymentLineFull         PaymentResultCode = -8
	PaymentResultCodePaymentNoIssuer         PaymentResultCode = -9
)

func (PaymentResultCode) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PaymentResultCode) String

func (e PaymentResultCode) String() string

String returns the name of `e`

func (*PaymentResultCode) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PaymentResultCode) ValidEnum

func (e PaymentResultCode) ValidEnum(v int32) bool

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

type PeerAddress

type PeerAddress struct {
	Ip          PeerAddressIp
	Port        Uint32
	NumFailures Uint32
}

PeerAddress is an XDR Struct defines as:

struct PeerAddress
 {
     union switch (IPAddrType type)
     {
     case IPv4:
         opaque ipv4[4];
     case IPv6:
         opaque ipv6[16];
     }
     ip;
     uint32 port;
     uint32 numFailures;
 };

func (PeerAddress) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PeerAddress) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PeerAddressIp

type PeerAddressIp struct {
	Type IpAddrType
	Ipv4 *[4]byte  `xdrmaxsize:"4"`
	Ipv6 *[16]byte `xdrmaxsize:"16"`
}

PeerAddressIp is an XDR NestedUnion defines as:

union switch (IPAddrType type)
     {
     case IPv4:
         opaque ipv4[4];
     case IPv6:
         opaque ipv6[16];
     }

func NewPeerAddressIp

func NewPeerAddressIp(aType IpAddrType, value interface{}) (result PeerAddressIp, err error)

NewPeerAddressIp creates a new PeerAddressIp.

func (PeerAddressIp) ArmForSwitch

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

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

func (PeerAddressIp) GetIpv4

func (u PeerAddressIp) GetIpv4() (result [4]byte, ok bool)

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

func (PeerAddressIp) GetIpv6

func (u PeerAddressIp) GetIpv6() (result [16]byte, ok bool)

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

func (PeerAddressIp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PeerAddressIp) MustIpv4

func (u PeerAddressIp) MustIpv4() [4]byte

MustIpv4 retrieves the Ipv4 value from the union, panicing if the value is not set.

func (PeerAddressIp) MustIpv6

func (u PeerAddressIp) MustIpv6() [16]byte

MustIpv6 retrieves the Ipv6 value from the union, panicing if the value is not set.

func (PeerAddressIp) SwitchFieldName

func (u PeerAddressIp) SwitchFieldName() string

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

func (*PeerAddressIp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PeerStatList

type PeerStatList []PeerStats

PeerStatList is an XDR Typedef defines as:

typedef PeerStats PeerStatList<25>;

func (PeerStatList) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PeerStatList) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PeerStatList) XDRMaxSize

func (e PeerStatList) XDRMaxSize() int

XDRMaxSize implements the Sized interface for PeerStatList

type PeerStats

type PeerStats struct {
	Id                        NodeId
	VersionStr                string `xdrmaxsize:"100"`
	MessagesRead              Uint64
	MessagesWritten           Uint64
	BytesRead                 Uint64
	BytesWritten              Uint64
	SecondsConnected          Uint64
	UniqueFloodBytesRecv      Uint64
	DuplicateFloodBytesRecv   Uint64
	UniqueFetchBytesRecv      Uint64
	DuplicateFetchBytesRecv   Uint64
	UniqueFloodMessageRecv    Uint64
	DuplicateFloodMessageRecv Uint64
	UniqueFetchMessageRecv    Uint64
	DuplicateFetchMessageRecv Uint64
}

PeerStats is an XDR Struct defines as:

struct PeerStats
 {
     NodeID id;
     string versionStr<100>;
     uint64 messagesRead;
     uint64 messagesWritten;
     uint64 bytesRead;
     uint64 bytesWritten;
     uint64 secondsConnected;

     uint64 uniqueFloodBytesRecv;
     uint64 duplicateFloodBytesRecv;
     uint64 uniqueFetchBytesRecv;
     uint64 duplicateFetchBytesRecv;

     uint64 uniqueFloodMessageRecv;
     uint64 duplicateFloodMessageRecv;
     uint64 uniqueFetchMessageRecv;
     uint64 duplicateFetchMessageRecv;
 };

func (PeerStats) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PeerStats) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Price

type Price struct {
	N Int32
	D Int32
}

Price is an XDR Struct defines as:

struct Price
 {
     int32 n; // numerator
     int32 d; // denominator
 };

func (Price) Cheaper

func (p Price) Cheaper(q Price) bool

Cheaper indicates if the Price's value is lower, taking into account denormalized representation (e.g. Price{1, 2}.Cheaper(Price{2,4}) == false )

func (Price) Equal

func (p Price) Equal(q Price) bool

Equal returns whether the price's value is the same, taking into account denormalized representation (e.g. Price{1, 2}.EqualValue(Price{2,4}) == true )

func (*Price) Invert

func (p *Price) Invert()

Invert inverts Price.

func (Price) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Price) Normalize

func (p *Price) Normalize()

Normalize sets Price to its rational canonical form

func (*Price) Scan

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

Scan reads from a src into an xdr.Price

func (Price) String

func (p Price) String() string

String returns a string represenation of `p`

func (*Price) UnmarshalBinary

func (s *Price) 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) 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

PublicKeyType is an XDR Enum defines as:

enum PublicKeyType
 {
     PUBLIC_KEY_TYPE_ED25519 = KEY_TYPE_ED25519
 };
const (
	PublicKeyTypePublicKeyTypeEd25519 PublicKeyType = 0
)

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 ScpBallot

type ScpBallot struct {
	Counter Uint32
	Value   Value
}

ScpBallot is an XDR Struct defines as:

struct SCPBallot
 {
     uint32 counter; // n
     Value value;    // x
 };

func (ScpBallot) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpBallot) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpEnvelope

type ScpEnvelope struct {
	Statement ScpStatement
	Signature Signature
}

ScpEnvelope is an XDR Struct defines as:

struct SCPEnvelope
 {
     SCPStatement statement;
     Signature signature;
 };

func (ScpEnvelope) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpEnvelope) Scan

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

Scan reads from src into an ScpEnvelope struct

func (*ScpEnvelope) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpHistoryEntry

type ScpHistoryEntry struct {
	V  int32
	V0 *ScpHistoryEntryV0
}

ScpHistoryEntry is an XDR Union defines as:

union SCPHistoryEntry switch (int v)
 {
 case 0:
     SCPHistoryEntryV0 v0;
 };

func NewScpHistoryEntry

func NewScpHistoryEntry(v int32, value interface{}) (result ScpHistoryEntry, err error)

NewScpHistoryEntry creates a new ScpHistoryEntry.

func (ScpHistoryEntry) ArmForSwitch

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

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

func (ScpHistoryEntry) GetV0

func (u ScpHistoryEntry) GetV0() (result ScpHistoryEntryV0, ok bool)

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

func (ScpHistoryEntry) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ScpHistoryEntry) MustV0

func (u ScpHistoryEntry) MustV0() ScpHistoryEntryV0

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

func (ScpHistoryEntry) SwitchFieldName

func (u ScpHistoryEntry) SwitchFieldName() string

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

func (*ScpHistoryEntry) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpHistoryEntryV0

type ScpHistoryEntryV0 struct {
	QuorumSets     []ScpQuorumSet
	LedgerMessages LedgerScpMessages
}

ScpHistoryEntryV0 is an XDR Struct defines as:

struct SCPHistoryEntryV0
 {
     SCPQuorumSet quorumSets<>; // additional quorum sets used by ledgerMessages
     LedgerSCPMessages ledgerMessages;
 };

func (ScpHistoryEntryV0) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpHistoryEntryV0) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpNomination

type ScpNomination struct {
	QuorumSetHash Hash
	Votes         []Value
	Accepted      []Value
}

ScpNomination is an XDR Struct defines as:

struct SCPNomination
 {
     Hash quorumSetHash; // D
     Value votes<>;      // X
     Value accepted<>;   // Y
 };

func (ScpNomination) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpNomination) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpQuorumSet

type ScpQuorumSet struct {
	Threshold  Uint32
	Validators []PublicKey
	InnerSets  []ScpQuorumSet
}

ScpQuorumSet is an XDR Struct defines as:

struct SCPQuorumSet
 {
     uint32 threshold;
     PublicKey validators<>;
     SCPQuorumSet innerSets<>;
 };

func (ScpQuorumSet) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpQuorumSet) Scan

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

Scan reads from src into an ScpEnvelope struct

func (*ScpQuorumSet) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatement

type ScpStatement struct {
	NodeId    NodeId
	SlotIndex Uint64
	Pledges   ScpStatementPledges
}

ScpStatement is an XDR Struct defines as:

struct SCPStatement
 {
     NodeID nodeID;    // v
     uint64 slotIndex; // i

     union switch (SCPStatementType type)
     {
     case SCP_ST_PREPARE:
         struct
         {
             Hash quorumSetHash;       // D
             SCPBallot ballot;         // b
             SCPBallot* prepared;      // p
             SCPBallot* preparedPrime; // p'
             uint32 nC;                // c.n
             uint32 nH;                // h.n
         } prepare;
     case SCP_ST_CONFIRM:
         struct
         {
             SCPBallot ballot;   // b
             uint32 nPrepared;   // p.n
             uint32 nCommit;     // c.n
             uint32 nH;          // h.n
             Hash quorumSetHash; // D
         } confirm;
     case SCP_ST_EXTERNALIZE:
         struct
         {
             SCPBallot commit;         // c
             uint32 nH;                // h.n
             Hash commitQuorumSetHash; // D used before EXTERNALIZE
         } externalize;
     case SCP_ST_NOMINATE:
         SCPNomination nominate;
     }
     pledges;
 };

func (ScpStatement) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpStatement) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementConfirm

type ScpStatementConfirm struct {
	Ballot        ScpBallot
	NPrepared     Uint32
	NCommit       Uint32
	NH            Uint32
	QuorumSetHash Hash
}

ScpStatementConfirm is an XDR NestedStruct defines as:

struct
         {
             SCPBallot ballot;   // b
             uint32 nPrepared;   // p.n
             uint32 nCommit;     // c.n
             uint32 nH;          // h.n
             Hash quorumSetHash; // D
         }

func (ScpStatementConfirm) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpStatementConfirm) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementExternalize

type ScpStatementExternalize struct {
	Commit              ScpBallot
	NH                  Uint32
	CommitQuorumSetHash Hash
}

ScpStatementExternalize is an XDR NestedStruct defines as:

struct
         {
             SCPBallot commit;         // c
             uint32 nH;                // h.n
             Hash commitQuorumSetHash; // D used before EXTERNALIZE
         }

func (ScpStatementExternalize) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpStatementExternalize) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementPledges

type ScpStatementPledges struct {
	Type        ScpStatementType
	Prepare     *ScpStatementPrepare
	Confirm     *ScpStatementConfirm
	Externalize *ScpStatementExternalize
	Nominate    *ScpNomination
}

ScpStatementPledges is an XDR NestedUnion defines as:

union switch (SCPStatementType type)
     {
     case SCP_ST_PREPARE:
         struct
         {
             Hash quorumSetHash;       // D
             SCPBallot ballot;         // b
             SCPBallot* prepared;      // p
             SCPBallot* preparedPrime; // p'
             uint32 nC;                // c.n
             uint32 nH;                // h.n
         } prepare;
     case SCP_ST_CONFIRM:
         struct
         {
             SCPBallot ballot;   // b
             uint32 nPrepared;   // p.n
             uint32 nCommit;     // c.n
             uint32 nH;          // h.n
             Hash quorumSetHash; // D
         } confirm;
     case SCP_ST_EXTERNALIZE:
         struct
         {
             SCPBallot commit;         // c
             uint32 nH;                // h.n
             Hash commitQuorumSetHash; // D used before EXTERNALIZE
         } externalize;
     case SCP_ST_NOMINATE:
         SCPNomination nominate;
     }

func NewScpStatementPledges

func NewScpStatementPledges(aType ScpStatementType, value interface{}) (result ScpStatementPledges, err error)

NewScpStatementPledges creates a new ScpStatementPledges.

func (ScpStatementPledges) ArmForSwitch

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

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

func (ScpStatementPledges) GetConfirm

func (u ScpStatementPledges) GetConfirm() (result ScpStatementConfirm, ok bool)

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

func (ScpStatementPledges) GetExternalize

func (u ScpStatementPledges) GetExternalize() (result ScpStatementExternalize, ok bool)

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

func (ScpStatementPledges) GetNominate

func (u ScpStatementPledges) GetNominate() (result ScpNomination, ok bool)

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

func (ScpStatementPledges) GetPrepare

func (u ScpStatementPledges) GetPrepare() (result ScpStatementPrepare, ok bool)

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

func (ScpStatementPledges) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ScpStatementPledges) MustConfirm

func (u ScpStatementPledges) MustConfirm() ScpStatementConfirm

MustConfirm retrieves the Confirm value from the union, panicing if the value is not set.

func (ScpStatementPledges) MustExternalize

func (u ScpStatementPledges) MustExternalize() ScpStatementExternalize

MustExternalize retrieves the Externalize value from the union, panicing if the value is not set.

func (ScpStatementPledges) MustNominate

func (u ScpStatementPledges) MustNominate() ScpNomination

MustNominate retrieves the Nominate value from the union, panicing if the value is not set.

func (ScpStatementPledges) MustPrepare

func (u ScpStatementPledges) MustPrepare() ScpStatementPrepare

MustPrepare retrieves the Prepare value from the union, panicing if the value is not set.

func (ScpStatementPledges) SwitchFieldName

func (u ScpStatementPledges) SwitchFieldName() string

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

func (*ScpStatementPledges) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementPrepare

type ScpStatementPrepare struct {
	QuorumSetHash Hash
	Ballot        ScpBallot
	Prepared      *ScpBallot
	PreparedPrime *ScpBallot
	NC            Uint32
	NH            Uint32
}

ScpStatementPrepare is an XDR NestedStruct defines as:

struct
         {
             Hash quorumSetHash;       // D
             SCPBallot ballot;         // b
             SCPBallot* prepared;      // p
             SCPBallot* preparedPrime; // p'
             uint32 nC;                // c.n
             uint32 nH;                // h.n
         }

func (ScpStatementPrepare) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpStatementPrepare) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementType

type ScpStatementType int32

ScpStatementType is an XDR Enum defines as:

enum SCPStatementType
 {
     SCP_ST_PREPARE = 0,
     SCP_ST_CONFIRM = 1,
     SCP_ST_EXTERNALIZE = 2,
     SCP_ST_NOMINATE = 3
 };
const (
	ScpStatementTypeScpStPrepare     ScpStatementType = 0
	ScpStatementTypeScpStConfirm     ScpStatementType = 1
	ScpStatementTypeScpStExternalize ScpStatementType = 2
	ScpStatementTypeScpStNominate    ScpStatementType = 3
)

func (ScpStatementType) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ScpStatementType) String

func (e ScpStatementType) String() string

String returns the name of `e`

func (*ScpStatementType) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ScpStatementType) ValidEnum

func (e ScpStatementType) ValidEnum(v int32) bool

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

type SequenceNumber

type SequenceNumber Int64

SequenceNumber is an XDR Typedef defines as:

typedef int64 SequenceNumber;

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 SetOptionsOp

type SetOptionsOp struct {
	InflationDest *AccountId
	ClearFlags    *Uint32
	SetFlags      *Uint32
	MasterWeight  *Uint32
	LowThreshold  *Uint32
	MedThreshold  *Uint32
	HighThreshold *Uint32
	HomeDomain    *String32
	Signer        *Signer
}

SetOptionsOp is an XDR Struct defines as:

struct SetOptionsOp
 {
     AccountID* inflationDest; // sets the inflation destination

     uint32* clearFlags; // which flags to clear
     uint32* setFlags;   // which flags to set

     // account threshold manipulation
     uint32* masterWeight; // weight of the master account
     uint32* lowThreshold;
     uint32* medThreshold;
     uint32* highThreshold;

     string32* homeDomain; // sets the home domain

     // Add, update or remove a signer for the account
     // signer is deleted if the weight is 0
     Signer* signer;
 };

func (SetOptionsOp) MarshalBinary

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*SetOptionsOp) UnmarshalBinary

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type SetOptionsResult

type SetOptionsResult struct {
	Code SetOptionsResultCode
}

SetOptionsResult is an XDR Union defines as:

union SetOptionsResult switch (SetOptionsResultCode code)
 {
 case SET_OPTIONS_SUCCESS:
     void;
 default:
     void;
 };

func NewSetOptionsResult

func NewSetOptionsResult(code SetOptionsResultCode, value interface{}) (result SetOptionsResult, err error)

NewSetOptionsResult creates a new SetOptionsResult.