xdr

package
v0.0.0-...-5c63435 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

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

Package xdr is generated from:

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

DO NOT EDIT or your changes may be overwritten

Index

Examples

Constants

View Source
const MaskAccountFlags = 0x7

MaskAccountFlags is an XDR Const defines as:

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

MaskOfferentryFlags is an XDR Const defines as:

const MASK_OFFERENTRY_FLAGS = 1;
View Source
const MaskTrustlineFlags = 1

MaskTrustlineFlags is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS = 1;

Variables

This section is empty.

Functions

func Marshal

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

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

func MarshalBase64

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

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

package main

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 main() {
	data := "AAAAAGL8HQvQkbK2HA3WVjRrKmjX00fG8sLI7m0ERwJW/AX3AAAACgAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAArqN6LeOagjxMaUP96Bzfs9e0corNZXzBWJkFoK7kvkwAAAAAO5rKAAAAAAAAAAABVvwF9wAAAEAKZ7IPj/46PuWU6ZOtyMosctNAkXRNX9WCAI5RnfRk+AyxDLoDZP/9l3NvsxQtWj9juQOuoBlFLnWu8intgxQA"

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

	fmt.Printf("This tx has %d operations\n", len(tx.Tx.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 192 bytes
This tx has 1 operations

Types

type AccountEntry

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

AccountEntry is an XDR Struct defines as:

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

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

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

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

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

func (*AccountEntry) SignerSummary

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

type AccountEntryExt

type AccountEntryExt struct {
	V int32
}

AccountEntryExt is an XDR NestedUnion defines as:

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

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

func (u AccountEntryExt) SwitchFieldName() string

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

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

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

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

func (AccountMergeResultCode) String

func (e AccountMergeResultCode) String() string

String returns the name of `e`

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

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:
         opaque assetCode4[4];

     case ASSET_TYPE_CREDIT_ALPHANUM12:
         opaque assetCode12[12];

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

     bool authorize;
 };

type AllowTrustOpAsset

type AllowTrustOpAsset struct {
	Type        AssetType
	AssetCode4  *[4]byte  `xdrmaxsize:"4"`
	AssetCode12 *[12]byte `xdrmaxsize:"12"`
}

AllowTrustOpAsset is an XDR NestedUnion defines as:

union switch (AssetType type)
     {
     // ASSET_TYPE_NATIVE is not allowed
     case ASSET_TYPE_CREDIT_ALPHANUM4:
         opaque assetCode4[4];

     case ASSET_TYPE_CREDIT_ALPHANUM12:
         opaque assetCode12[12];

         // 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 [12]byte, 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 [4]byte, ok bool)

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

func (AllowTrustOpAsset) MustAssetCode12

func (u AllowTrustOpAsset) MustAssetCode12() [12]byte

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

func (AllowTrustOpAsset) MustAssetCode4

func (u AllowTrustOpAsset) MustAssetCode4() [4]byte

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) (ret Asset)

ToAsset converts `a` to a proper xdr.Asset

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

func (u AllowTrustResult) SwitchFieldName() string

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

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

func (e AllowTrustResultCode) String() string

String returns the name of `e`

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
     {
         opaque assetCode[4]; // 1 to 4 characters
         AccountID issuer;
     } alphaNum4;

 case ASSET_TYPE_CREDIT_ALPHANUM12:
     struct
     {
         opaque assetCode[12]; // 5 to 12 characters
         AccountID issuer;
     } alphaNum12;

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

func NewAsset

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

NewAsset creates a new Asset.

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

type AssetAlphaNum12

type AssetAlphaNum12 struct {
	AssetCode [12]byte `xdrmaxsize:"12"`
	Issuer    AccountId
}

AssetAlphaNum12 is an XDR NestedStruct defines as:

struct
     {
         opaque assetCode[12]; // 5 to 12 characters
         AccountID issuer;
     }

type AssetAlphaNum4

type AssetAlphaNum4 struct {
	AssetCode [4]byte `xdrmaxsize:"4"`
	Issuer    AccountId
}

AssetAlphaNum4 is an XDR NestedStruct defines as:

struct
     {
         opaque assetCode[4]; // 1 to 4 characters
         AccountID issuer;
     }

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

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

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

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

func (AuthenticatedMessage) SwitchFieldName

func (u AuthenticatedMessage) SwitchFieldName() string

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

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

type BucketEntry

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

BucketEntry is an XDR Union defines as:

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

 case DEADENTRY:
     LedgerKey deadEntry;
 };

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

func (u BucketEntry) SwitchFieldName() string

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

type BucketEntryType

type BucketEntryType int32

BucketEntryType is an XDR Enum defines as:

enum BucketEntryType
 {
     LIVEENTRY = 0,
     DEADENTRY = 1
 };
const (
	BucketEntryTypeLiveentry BucketEntryType = 0
	BucketEntryTypeDeadentry BucketEntryType = 1
)

func (BucketEntryType) String

func (e BucketEntryType) String() string

String returns the name of `e`

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 BumpSequenceOp

type BumpSequenceOp struct {
	BumpTo SequenceNumber
}

BumpSequenceOp is an XDR Struct defines as:

struct BumpSequenceOp
 {
     SequenceNumber bumpTo;
 };

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

func (u BumpSequenceResult) SwitchFieldName() string

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

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

func (e BumpSequenceResultCode) String() string

String returns the name of `e`

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

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

func (u ChangeTrustResult) SwitchFieldName() string

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

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

func (e ChangeTrustResultCode) String() string

String returns the name of `e`

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      Uint64
	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
     uint64 offerID;

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

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

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

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

func (u CreateAccountResult) SwitchFieldName() string

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

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

func (e CreateAccountResultCode) String() string

String returns the name of `e`

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 CreatePassiveOfferOp

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

CreatePassiveOfferOp is an XDR Struct defines as:

struct CreatePassiveOfferOp
 {
     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
 };

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
 };
const (
	CryptoKeyTypeKeyTypeEd25519   CryptoKeyType = 0
	CryptoKeyTypeKeyTypePreAuthTx CryptoKeyType = 1
	CryptoKeyTypeKeyTypeHashX     CryptoKeyType = 2
)

func (CryptoKeyType) String

func (e CryptoKeyType) String() string

String returns the name of `e`

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];
 };

type Curve25519Secret

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

Curve25519Secret is an XDR Struct defines as:

struct Curve25519Secret
 {
         opaque key[32];
 };

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

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

func (u DataEntryExt) SwitchFieldName() string

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

type DataValue

type DataValue []byte

DataValue is an XDR Typedef defines as:

typedef opaque DataValue<64>;

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

type DontHave

type DontHave struct {
	Type    MessageType
	ReqHash Uint256
}

DontHave is an XDR Struct defines as:

struct DontHave
 {
     MessageType type;
     uint256 reqHash;
 };

type EnvelopeType

type EnvelopeType int32

EnvelopeType is an XDR Enum defines as:

enum EnvelopeType
 {
     ENVELOPE_TYPE_SCP = 1,
     ENVELOPE_TYPE_TX = 2,
     ENVELOPE_TYPE_AUTH = 3
 };
const (
	EnvelopeTypeEnvelopeTypeScp  EnvelopeType = 1
	EnvelopeTypeEnvelopeTypeTx   EnvelopeType = 2
	EnvelopeTypeEnvelopeTypeAuth EnvelopeType = 3
)

func (EnvelopeType) String

func (e EnvelopeType) String() string

String returns the name of `e`

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

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

func (e ErrorCode) String() string

String returns the name of `e`

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 Hash

type Hash [32]byte

Hash is an XDR Typedef defines as:

typedef opaque Hash[32];

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

type HmacSha256Key

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

HmacSha256Key is an XDR Struct defines as:

struct HmacSha256Key
 {
         opaque key[32];
 };

type HmacSha256Mac

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

HmacSha256Mac is an XDR Struct defines as:

struct HmacSha256Mac
 {
         opaque mac[32];
 };

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

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

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

func (e InflationResultCode) String() string

String returns the name of `e`

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 Int32

type Int32 int32

Int32 is an XDR Typedef defines as:

typedef int int32;

type Int64

type Int64 int64

Int64 is an XDR Typedef defines as:

typedef hyper int64;

func (*Int64) Scan

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

Scan reads from src into an Int64

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

func (e IpAddrType) String() string

String returns the name of `e`

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

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

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

func (e LedgerEntryChangeType) String() string

String returns the name of `e`

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

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

Scan reads from src into an LedgerEntryChanges struct

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

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

func (u LedgerEntryExt) SwitchFieldName() string

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

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

func (e LedgerEntryType) String() string

String returns the name of `e`

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

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

Scan reads from src into an LedgerHeader struct

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

func (u LedgerHeaderExt) SwitchFieldName() string

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

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

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

func (u LedgerHeaderHistoryEntryExt) SwitchFieldName() string

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

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

type LedgerKeyAccount

type LedgerKeyAccount struct {
	AccountId AccountId
}

LedgerKeyAccount is an XDR NestedStruct defines as:

struct
     {
         AccountID accountID;
     }

type LedgerKeyData

type LedgerKeyData struct {
	AccountId AccountId
	DataName  String64
}

LedgerKeyData is an XDR NestedStruct defines as:

struct
     {
         AccountID accountID;
         string64 dataName;
     }

type LedgerKeyOffer

type LedgerKeyOffer struct {
	SellerId AccountId
	OfferId  Uint64
}

LedgerKeyOffer is an XDR NestedStruct defines as:

struct
     {
         AccountID sellerID;
         uint64 offerID;
     }

type LedgerKeyTrustLine

type LedgerKeyTrustLine struct {
	AccountId AccountId
	Asset     Asset
}

LedgerKeyTrustLine is an XDR NestedStruct defines as:

struct
     {
         AccountID accountID;
         Asset asset;
     }

type LedgerScpMessages

type LedgerScpMessages struct {
	LedgerSeq Uint32
	Messages  []ScpEnvelope
}

LedgerScpMessages is an XDR Struct defines as:

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

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

func (u LedgerUpgrade) SwitchFieldName() string

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

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

func (e LedgerUpgradeType) String() string

String returns the name of `e`

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

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

func (u ManageDataResult) SwitchFieldName() string

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

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

func (e ManageDataResultCode) String() string

String returns the name of `e`

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

func (e ManageOfferEffect) String() string

String returns the name of `e`

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 ManageOfferOp

type ManageOfferOp struct {
	Selling Asset
	Buying  Asset
	Amount  Int64
	Price   Price
	OfferId Uint64
}

ManageOfferOp is an XDR Struct defines as:

struct ManageOfferOp
 {
     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
     uint64 offerID;
 };

type ManageOfferResult

type ManageOfferResult struct {
	Code    ManageOfferResultCode
	Success *ManageOfferSuccessResult
}

ManageOfferResult is an XDR Union defines as:

union ManageOfferResult switch (ManageOfferResultCode code)
 {
 case MANAGE_OFFER_SUCCESS:
     ManageOfferSuccessResult success;
 default:
     void;
 };

func NewManageOfferResult

func NewManageOfferResult(code ManageOfferResultCode, value interface{}) (result ManageOfferResult, err error)

NewManageOfferResult creates a new ManageOfferResult.

func (ManageOfferResult) ArmForSwitch

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

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

func (ManageOfferResult) GetSuccess

func (u ManageOfferResult) 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 (ManageOfferResult) MustSuccess

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

func (ManageOfferResult) SwitchFieldName

func (u ManageOfferResult) SwitchFieldName() string

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

type ManageOfferResultCode

type ManageOfferResultCode int32

ManageOfferResultCode is an XDR Enum defines as:

enum ManageOfferResultCode
 {
     // codes considered as "success" for the operation
     MANAGE_OFFER_SUCCESS = 0,

     // codes considered as "failure" for the operation
     MANAGE_OFFER_MALFORMED = -1,     // generated offer would be invalid
     MANAGE_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling
     MANAGE_OFFER_BUY_NO_TRUST = -3,  // no trust line for what we're buying
     MANAGE_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell
     MANAGE_OFFER_BUY_NOT_AUTHORIZED = -5,  // not authorized to buy
     MANAGE_OFFER_LINE_FULL = -6,      // can't receive more of what it's buying
     MANAGE_OFFER_UNDERFUNDED = -7,    // doesn't hold what it's trying to sell
     MANAGE_OFFER_CROSS_SELF = -8,     // would cross an offer from the same user
     MANAGE_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling
     MANAGE_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying

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

     MANAGE_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer
 };
const (
	ManageOfferResultCodeManageOfferSuccess           ManageOfferResultCode = 0
	ManageOfferResultCodeManageOfferMalformed         ManageOfferResultCode = -1
	ManageOfferResultCodeManageOfferSellNoTrust       ManageOfferResultCode = -2
	ManageOfferResultCodeManageOfferBuyNoTrust        ManageOfferResultCode = -3
	ManageOfferResultCodeManageOfferSellNotAuthorized ManageOfferResultCode = -4
	ManageOfferResultCodeManageOfferBuyNotAuthorized  ManageOfferResultCode = -5
	ManageOfferResultCodeManageOfferLineFull          ManageOfferResultCode = -6
	ManageOfferResultCodeManageOfferUnderfunded       ManageOfferResultCode = -7
	ManageOfferResultCodeManageOfferCrossSelf         ManageOfferResultCode = -8
	ManageOfferResultCodeManageOfferSellNoIssuer      ManageOfferResultCode = -9
	ManageOfferResultCodeManageOfferBuyNoIssuer       ManageOfferResultCode = -10
	ManageOfferResultCodeManageOfferNotFound          ManageOfferResultCode = -11
	ManageOfferResultCodeManageOfferLowReserve        ManageOfferResultCode = -12
)

func (ManageOfferResultCode) String

func (e ManageOfferResultCode) String() string

String returns the name of `e`

func (ManageOfferResultCode) ValidEnum

func (e ManageOfferResultCode) ValidEnum(v int32) bool

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

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

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

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

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

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

func (e MemoType) String() string

String returns the name of `e`

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

func (MessageType) String

func (e MessageType) String() string

String returns the name of `e`

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

type OfferEntry

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

OfferEntry is an XDR Struct defines as:

struct OfferEntry
 {
     AccountID sellerID;
     uint64 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;
 };

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

func (u OfferEntryExt) SwitchFieldName() string

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

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

func (e OfferEntryFlags) String() string

String returns the name of `e`

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 *AccountId
	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
     AccountID* sourceAccount;

     union switch (OperationType type)
     {
     case CREATE_ACCOUNT:
         CreateAccountOp createAccountOp;
     case PAYMENT:
         PaymentOp paymentOp;
     case PATH_PAYMENT:
         PathPaymentOp pathPaymentOp;
     case MANAGE_OFFER:
         ManageOfferOp manageOfferOp;
     case CREATE_PASSIVE_OFFER:
         CreatePassiveOfferOp createPassiveOfferOp;
     case SET_OPTIONS:
         SetOptionsOp setOptionsOp;
     case CHANGE_TRUST:
         ChangeTrustOp changeTrustOp;
     case ALLOW_TRUST:
         AllowTrustOp allowTrustOp;
     case ACCOUNT_MERGE:
         AccountID destination;
     case INFLATION:
         void;
     case MANAGE_DATA:
         ManageDataOp manageDataOp;
     case BUMP_SEQUENCE:
         BumpSequenceOp bumpSequenceOp;
     }
     body;
 };

type OperationBody

type OperationBody struct {
	Type                 OperationType
	CreateAccountOp      *CreateAccountOp
	PaymentOp            *PaymentOp
	PathPaymentOp        *PathPaymentOp
	ManageOfferOp        *ManageOfferOp
	CreatePassiveOfferOp *CreatePassiveOfferOp
	SetOptionsOp         *SetOptionsOp
	ChangeTrustOp        *ChangeTrustOp
	AllowTrustOp         *AllowTrustOp
	Destination          *AccountId
	ManageDataOp         *ManageDataOp
	BumpSequenceOp       *BumpSequenceOp
}

OperationBody is an XDR NestedUnion defines as:

union switch (OperationType type)
     {
     case CREATE_ACCOUNT:
         CreateAccountOp createAccountOp;
     case PAYMENT:
         PaymentOp paymentOp;
     case PATH_PAYMENT:
         PathPaymentOp pathPaymentOp;
     case MANAGE_OFFER:
         ManageOfferOp manageOfferOp;
     case CREATE_PASSIVE_OFFER:
         CreatePassiveOfferOp createPassiveOfferOp;
     case SET_OPTIONS:
         SetOptionsOp setOptionsOp;
     case CHANGE_TRUST:
         ChangeTrustOp changeTrustOp;
     case ALLOW_TRUST:
         AllowTrustOp allowTrustOp;
     case ACCOUNT_MERGE:
         AccountID destination;
     case INFLATION:
         void;
     case MANAGE_DATA:
         ManageDataOp manageDataOp;
     case BUMP_SEQUENCE:
         BumpSequenceOp bumpSequenceOp;
     }

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

func (u OperationBody) GetCreatePassiveOfferOp() (result CreatePassiveOfferOp, ok bool)

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

func (OperationBody) GetDestination

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

GetDestination retrieves the Destination 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) GetManageOfferOp

func (u OperationBody) GetManageOfferOp() (result ManageOfferOp, ok bool)

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

func (OperationBody) GetPathPaymentOp

func (u OperationBody) GetPathPaymentOp() (result PathPaymentOp, ok bool)

GetPathPaymentOp retrieves the PathPaymentOp 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) 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) MustCreatePassiveOfferOp

func (u OperationBody) MustCreatePassiveOfferOp() CreatePassiveOfferOp

MustCreatePassiveOfferOp retrieves the CreatePassiveOfferOp value from the union, panicing if the value is not set.

func (OperationBody) MustDestination

func (u OperationBody) MustDestination() AccountId

MustDestination retrieves the Destination 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) MustManageOfferOp

func (u OperationBody) MustManageOfferOp() ManageOfferOp

MustManageOfferOp retrieves the ManageOfferOp value from the union, panicing if the value is not set.

func (OperationBody) MustPathPaymentOp

func (u OperationBody) MustPathPaymentOp() PathPaymentOp

MustPathPaymentOp retrieves the PathPaymentOp 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

type OperationMeta

type OperationMeta struct {
	Changes LedgerEntryChanges
}

OperationMeta is an XDR Struct defines as:

struct OperationMeta
 {
     LedgerEntryChanges changes;
 };

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:
         PathPaymentResult pathPaymentResult;
     case MANAGE_OFFER:
         ManageOfferResult manageOfferResult;
     case CREATE_PASSIVE_OFFER:
         ManageOfferResult createPassiveOfferResult;
     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;
     }
     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) MustTr

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

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
 };
const (
	OperationResultCodeOpInner        OperationResultCode = 0
	OperationResultCodeOpBadAuth      OperationResultCode = -1
	OperationResultCodeOpNoAccount    OperationResultCode = -2
	OperationResultCodeOpNotSupported OperationResultCode = -3
)

func (OperationResultCode) String

func (e OperationResultCode) String() string

String returns the name of `e`

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
	PathPaymentResult        *PathPaymentResult
	ManageOfferResult        *ManageOfferResult
	CreatePassiveOfferResult *ManageOfferResult
	SetOptionsResult         *SetOptionsResult
	ChangeTrustResult        *ChangeTrustResult
	AllowTrustResult         *AllowTrustResult
	AccountMergeResult       *AccountMergeResult
	InflationResult          *InflationResult
	ManageDataResult         *ManageDataResult
	BumpSeqResult            *BumpSequenceResult
}

OperationResultTr is an XDR NestedUnion defines as:

union switch (OperationType type)
     {
     case CREATE_ACCOUNT:
         CreateAccountResult createAccountResult;
     case PAYMENT:
         PaymentResult paymentResult;
     case PATH_PAYMENT:
         PathPaymentResult pathPaymentResult;
     case MANAGE_OFFER:
         ManageOfferResult manageOfferResult;
     case CREATE_PASSIVE_OFFER:
         ManageOfferResult createPassiveOfferResult;
     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;
     }

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

func (u OperationResultTr) GetCreatePassiveOfferResult() (result ManageOfferResult, ok bool)

GetCreatePassiveOfferResult retrieves the CreatePassiveOfferResult 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) 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) GetManageOfferResult

func (u OperationResultTr) GetManageOfferResult() (result ManageOfferResult, ok bool)

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

func (OperationResultTr) GetPathPaymentResult

func (u OperationResultTr) GetPathPaymentResult() (result PathPaymentResult, ok bool)

GetPathPaymentResult retrieves the PathPaymentResult 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) 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) MustCreatePassiveOfferResult

func (u OperationResultTr) MustCreatePassiveOfferResult() ManageOfferResult

MustCreatePassiveOfferResult retrieves the CreatePassiveOfferResult 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) MustManageDataResult

func (u OperationResultTr) MustManageDataResult() ManageDataResult

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

func (OperationResultTr) MustManageOfferResult

func (u OperationResultTr) MustManageOfferResult() ManageOfferResult

MustManageOfferResult retrieves the ManageOfferResult value from the union, panicing if the value is not set.

func (OperationResultTr) MustPathPaymentResult

func (u OperationResultTr) MustPathPaymentResult() PathPaymentResult

MustPathPaymentResult retrieves the PathPaymentResult 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

type OperationType

type OperationType int32

OperationType is an XDR Enum defines as:

enum OperationType
 {
     CREATE_ACCOUNT = 0,
     PAYMENT = 1,
     PATH_PAYMENT = 2,
     MANAGE_OFFER = 3,
     CREATE_PASSIVE_OFFER = 4,
     SET_OPTIONS = 5,
     CHANGE_TRUST = 6,
     ALLOW_TRUST = 7,
     ACCOUNT_MERGE = 8,
     INFLATION = 9,
     MANAGE_DATA = 10,
     BUMP_SEQUENCE = 11
 };
const (
	OperationTypeCreateAccount      OperationType = 0
	OperationTypePayment            OperationType = 1
	OperationTypePathPayment        OperationType = 2
	OperationTypeManageOffer        OperationType = 3
	OperationTypeCreatePassiveOffer OperationType = 4
	OperationTypeSetOptions         OperationType = 5
	OperationTypeChangeTrust        OperationType = 6
	OperationTypeAllowTrust         OperationType = 7
	OperationTypeAccountMerge       OperationType = 8
	OperationTypeInflation          OperationType = 9
	OperationTypeManageData         OperationType = 10
	OperationTypeBumpSequence       OperationType = 11
)

func (OperationType) String

func (e OperationType) String() string

String returns the name of `e`

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 PathPaymentOp

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

PathPaymentOp is an XDR Struct defines as:

struct PathPaymentOp
 {
     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

     AccountID 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
 };

type PathPaymentResult

type PathPaymentResult struct {
	Code     PathPaymentResultCode
	Success  *PathPaymentResultSuccess
	NoIssuer *Asset
}

PathPaymentResult is an XDR Union defines as:

union PathPaymentResult switch (PathPaymentResultCode code)
 {
 case PATH_PAYMENT_SUCCESS:
     struct
     {
         ClaimOfferAtom offers<>;
         SimplePaymentResult last;
     } success;
 case PATH_PAYMENT_NO_ISSUER:
     Asset noIssuer; // the asset that caused the error
 default:
     void;
 };

func NewPathPaymentResult

func NewPathPaymentResult(code PathPaymentResultCode, value interface{}) (result PathPaymentResult, err error)

NewPathPaymentResult creates a new PathPaymentResult.

func (PathPaymentResult) ArmForSwitch

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

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

func (PathPaymentResult) GetNoIssuer

func (u PathPaymentResult) 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 (PathPaymentResult) GetSuccess

func (u PathPaymentResult) GetSuccess() (result PathPaymentResultSuccess, ok bool)

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

func (PathPaymentResult) MustNoIssuer

func (u PathPaymentResult) MustNoIssuer() Asset

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

func (PathPaymentResult) MustSuccess

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

func (*PathPaymentResult) SendAmount

func (pr *PathPaymentResult) SendAmount() Int64

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

func (PathPaymentResult) SwitchFieldName

func (u PathPaymentResult) SwitchFieldName() string

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

type PathPaymentResultCode

type PathPaymentResultCode int32

PathPaymentResultCode is an XDR Enum defines as:

enum PathPaymentResultCode
 {
     // codes considered as "success" for the operation
     PATH_PAYMENT_SUCCESS = 0, // success

     // codes considered as "failure" for the operation
     PATH_PAYMENT_MALFORMED = -1,          // bad input
     PATH_PAYMENT_UNDERFUNDED = -2,        // not enough funds in source account
     PATH_PAYMENT_SRC_NO_TRUST = -3,       // no trust line on source account
     PATH_PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer
     PATH_PAYMENT_NO_DESTINATION = -5,     // destination account does not exist
     PATH_PAYMENT_NO_TRUST = -6,           // dest missing a trust line for asset
     PATH_PAYMENT_NOT_AUTHORIZED = -7,     // dest not authorized to hold asset
     PATH_PAYMENT_LINE_FULL = -8,          // dest would go above their limit
     PATH_PAYMENT_NO_ISSUER = -9,          // missing issuer on one asset
     PATH_PAYMENT_TOO_FEW_OFFERS = -10,    // not enough offers to satisfy path
     PATH_PAYMENT_OFFER_CROSS_SELF = -11,  // would cross one of its own offers
     PATH_PAYMENT_OVER_SENDMAX = -12       // could not satisfy sendmax
 };
const (
	PathPaymentResultCodePathPaymentSuccess          PathPaymentResultCode = 0
	PathPaymentResultCodePathPaymentMalformed        PathPaymentResultCode = -1
	PathPaymentResultCodePathPaymentUnderfunded      PathPaymentResultCode = -2
	PathPaymentResultCodePathPaymentSrcNoTrust       PathPaymentResultCode = -3
	PathPaymentResultCodePathPaymentSrcNotAuthorized PathPaymentResultCode = -4
	PathPaymentResultCodePathPaymentNoDestination    PathPaymentResultCode = -5
	PathPaymentResultCodePathPaymentNoTrust          PathPaymentResultCode = -6
	PathPaymentResultCodePathPaymentNotAuthorized    PathPaymentResultCode = -7
	PathPaymentResultCodePathPaymentLineFull         PathPaymentResultCode = -8
	PathPaymentResultCodePathPaymentNoIssuer         PathPaymentResultCode = -9
	PathPaymentResultCodePathPaymentTooFewOffers     PathPaymentResultCode = -10
	PathPaymentResultCodePathPaymentOfferCrossSelf   PathPaymentResultCode = -11
	PathPaymentResultCodePathPaymentOverSendmax      PathPaymentResultCode = -12
)

func (PathPaymentResultCode) String

func (e PathPaymentResultCode) String() string

String returns the name of `e`

func (PathPaymentResultCode) ValidEnum

func (e PathPaymentResultCode) ValidEnum(v int32) bool

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

type PathPaymentResultSuccess

type PathPaymentResultSuccess struct {
	Offers []ClaimOfferAtom
	Last   SimplePaymentResult
}

PathPaymentResultSuccess is an XDR NestedStruct defines as:

struct
     {
         ClaimOfferAtom offers<>;
         SimplePaymentResult last;
     }

type PaymentOp

type PaymentOp struct {
	Destination AccountId
	Asset       Asset
	Amount      Int64
}

PaymentOp is an XDR Struct defines as:

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

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

func (u PaymentResult) SwitchFieldName() string

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

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

func (e PaymentResultCode) String() string

String returns the name of `e`

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

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

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

func (p *Price) Invert()

Invert inverts Price.

func (*Price) Scan

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

Scan reads from a src an xdr.Price

func (*Price) String

func (p *Price) String() string

String returns a string represenation of `p`

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

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

func (e PublicKeyType) String() string

String returns the name of `e`

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

type ScpEnvelope

type ScpEnvelope struct {
	Statement ScpStatement
	Signature Signature
}

ScpEnvelope is an XDR Struct defines as:

struct SCPEnvelope
 {
     SCPStatement statement;
     Signature signature;
 };

func (*ScpEnvelope) Scan

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

Scan reads from src into an ScpEnvelope struct

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

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

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

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

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

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

Scan reads from src into an ScpEnvelope struct

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

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
         }

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
         }

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

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
         }

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

func (e ScpStatementType) String() string

String returns the name of `e`

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;

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

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.

func (SetOptionsResult) ArmForSwitch

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

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

func (SetOptionsResult) SwitchFieldName

func (u SetOptionsResult) SwitchFieldName() string

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

type SetOptionsResultCode

type SetOptionsResultCode int32

SetOptionsResultCode is an XDR Enum defines as:

enum SetOptionsResultCode
 {
     // codes considered as "success" for the operation
     SET_OPTIONS_SUCCESS = 0,
     // codes considered as "failure" for the operation
     SET_OPTIONS_LOW_RESERVE = -1,      // not enough funds to add a signer
     SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached
     SET_OPTIONS_BAD_FLAGS = -3,        // invalid combination of clear/set flags
     SET_OPTIONS_INVALID_INFLATION = -4,      // inflation account does not exist
     SET_OPTIONS_CANT_CHANGE = -5,            // can no longer change this option
     SET_OPTIONS_UNKNOWN_FLAG = -6,           // can't set an unknown flag
     SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold
     SET_OPTIONS_BAD_SIGNER = -8,             // signer cannot be masterkey
     SET_OPTIONS_INVALID_HOME_DOMAIN = -9     // malformed home domain
 };
const (
	SetOptionsResultCodeSetOptionsSuccess             SetOptionsResultCode = 0
	SetOptionsResultCodeSetOptionsLowReserve          SetOptionsResultCode = -1
	SetOptionsResultCodeSetOptionsTooManySigners      SetOptionsResultCode = -2
	SetOptionsResultCodeSetOptionsBadFlags            SetOptionsResultCode = -3
	SetOptionsResultCodeSetOptionsInvalidInflation    SetOptionsResultCode = -4
	SetOptionsResultCodeSetOptionsCantChange          SetOptionsResultCode = -5
	SetOptionsResultCodeSetOptionsUnknownFlag         SetOptionsResultCode = -6
	SetOptionsResultCodeSetOptionsThresholdOutOfRange SetOptionsResultCode = -7
	SetOptionsResultCodeSetOptionsBadSigner           SetOptionsResultCode = -8
	SetOptionsResultCodeSetOptionsInvalidHomeDomain   SetOptionsResultCode = -9
)

func (SetOptionsResultCode) String

func (e SetOptionsResultCode) String() string

String returns the name of `e`

func (SetOptionsResultCode) ValidEnum

func (e SetOptionsResultCode) ValidEnum(v int32) bool

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

type Signature

type Signature []byte

Signature is an XDR Typedef defines as:

typedef opaque Signature<64>;

func (Signature) XDRMaxSize

func (e Signature) XDRMaxSize() int

XDRMaxSize implements the Sized interface for Signature

type SignatureHint

type SignatureHint [4]byte

SignatureHint is an XDR Typedef defines as:

typedef opaque SignatureHint[4];

func (SignatureHint) XDRMaxSize

func (e SignatureHint) XDRMaxSize() int

XDRMaxSize implements the Sized interface for SignatureHint

type Signer

type Signer struct {
	Key    SignerKey
	Weight Uint32
}

Signer is an XDR Struct defines as:

struct Signer
 {
     SignerKey key;
     uint32 weight; // really only need 1byte
 };

type SignerKey

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

SignerKey is an XDR Union defines as:

union SignerKey switch (SignerKeyType type)
 {
 case SIGNER_KEY_TYPE_ED25519:
     uint256 ed25519;
 case SIGNER_KEY_TYPE_PRE_AUTH_TX:
     /* Hash of Transaction structure */
     uint256 preAuthTx;
 case SIGNER_KEY_TYPE_HASH_X:
     /* Hash of random 256 bit preimage X */
     uint256 hashX;
 };

func NewSignerKey

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

NewSignerKey creates a new SignerKey.

func (*SignerKey) Address

func (skey *SignerKey) Address() string

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

func (SignerKey) ArmForSwitch

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

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

func (*SignerKey) Equals

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

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

func (SignerKey) GetEd25519

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

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

func (SignerKey) GetHashX

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

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

func (SignerKey) GetPreAuthTx

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

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

func (SignerKey) MustEd25519

func (u SignerKey) MustEd25519() Uint256

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

func (SignerKey) MustHashX

func (u SignerKey) MustHashX() Uint256

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

func (SignerKey) MustPreAuthTx

func (u SignerKey) MustPreAuthTx() Uint256

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

func (*SignerKey) SetAddress

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

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

func (SignerKey) SwitchFieldName

func (u SignerKey) SwitchFieldName() string

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

type SignerKeyType

type SignerKeyType int32

SignerKeyType is an XDR Enum defines as:

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

func (SignerKeyType) String

func (e SignerKeyType) String() string

String returns the name of `e`

func (SignerKeyType) ValidEnum

func (e SignerKeyType) ValidEnum(v int32) bool

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

type SimplePaymentResult

type SimplePaymentResult struct {
	Destination AccountId
	Asset       Asset
	Amount      Int64
}

SimplePaymentResult is an XDR Struct defines as:

struct SimplePaymentResult
 {
     AccountID destination;
     Asset asset;
     int64 amount;
 };

type StellarMessage

type StellarMessage struct {
	Type            MessageType
	Error           *Error
	Hello           *Hello
	Auth            *Auth
	DontHave        *DontHave
	Peers           *[]PeerAddress `xdrmaxsize:"100"`
	TxSetHash       *Uint256
	TxSet           *TransactionSet
	Transaction     *TransactionEnvelope
	QSetHash        *Uint256
	QSet            *ScpQuorumSet
	Envelope        *ScpEnvelope
	GetScpLedgerSeq *Uint32
}

StellarMessage is an XDR Union defines as:

union StellarMessage switch (MessageType type)
 {
 case ERROR_MSG:
     Error error;
 case HELLO:
     Hello hello;
 case AUTH:
     Auth auth;
 case DONT_HAVE:
     DontHave dontHave;
 case GET_PEERS:
     void;
 case PEERS:
     PeerAddress peers<100>;

 case GET_TX_SET:
     uint256 txSetHash;
 case TX_SET:
     TransactionSet txSet;

 case TRANSACTION:
     TransactionEnvelope transaction;

 // SCP
 case GET_SCP_QUORUMSET:
     uint256 qSetHash;
 case SCP_QUORUMSET:
     SCPQuorumSet qSet;
 case SCP_MESSAGE:
     SCPEnvelope envelope;
 case GET_SCP_STATE:
     uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest
 };

func NewStellarMessage

func NewStellarMessage(aType MessageType, value interface{}) (result StellarMessage, err error)

NewStellarMessage creates a new StellarMessage.

func (StellarMessage) ArmForSwitch

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

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

func (StellarMessage) GetAuth

func (u StellarMessage) GetAuth() (result Auth, ok bool)

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

func (StellarMessage) GetDontHave

func (u StellarMessage) GetDontHave() (result DontHave, ok bool)

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

func (StellarMessage) GetEnvelope

func (u StellarMessage) GetEnvelope() (result ScpEnvelope, ok bool)

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

func (StellarMessage) GetError

func (u StellarMessage) GetError() (result Error, ok bool)

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

func (StellarMessage) GetGetScpLedgerSeq

func (u StellarMessage) GetGetScpLedgerSeq() (result Uint32, ok bool)

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

func (StellarMessage) GetHello

func (u StellarMessage) GetHello() (result Hello, ok bool)

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

func (StellarMessage) GetPeers

func (u StellarMessage) GetPeers() (result []PeerAddress, ok bool)

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

func (StellarMessage) GetQSet

func (u StellarMessage) GetQSet() (result ScpQuorumSet, ok bool)

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

func (StellarMessage) GetQSetHash

func (u StellarMessage) GetQSetHash() (result Uint256, ok bool)

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

func (StellarMessage) GetTransaction

func (u StellarMessage) GetTransaction() (result TransactionEnvelope, ok bool)

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

func (StellarMessage) GetTxSet

func (u StellarMessage) GetTxSet() (result TransactionSet, ok bool)

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

func (StellarMessage) GetTxSetHash

func (u StellarMessage) GetTxSetHash() (result Uint256, ok bool)

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

func (StellarMessage) MustAuth

func (u StellarMessage) MustAuth() Auth

MustAuth retrieves the Auth value from the union, panicing if the value is not set.

func (StellarMessage) MustDontHave

func (u StellarMessage) MustDontHave() DontHave

MustDontHave retrieves the DontHave value from the union, panicing if the value is not set.

func (StellarMessage) MustEnvelope

func (u StellarMessage) MustEnvelope() ScpEnvelope

MustEnvelope retrieves the Envelope value from the union, panicing if the value is not set.

func (StellarMessage) MustError

func (u StellarMessage) MustError() Error

MustError retrieves the Error value from the union, panicing if the value is not set.

func (StellarMessage) MustGetScpLedgerSeq

func (u StellarMessage) MustGetScpLedgerSeq() Uint32

MustGetScpLedgerSeq retrieves the GetScpLedgerSeq value from the union, panicing if the value is not set.

func (StellarMessage) MustHello

func (u StellarMessage) MustHello() Hello

MustHello retrieves the Hello value from the union, panicing if the value is not set.

func (StellarMessage) MustPeers

func (u StellarMessage) MustPeers() []PeerAddress

MustPeers retrieves the Peers value from the union, panicing if the value is not set.

func (StellarMessage) MustQSet

func (u StellarMessage) MustQSet() ScpQuorumSet

MustQSet retrieves the QSet value from the union, panicing if the value is not set.

func (StellarMessage) MustQSetHash

func (u StellarMessage) MustQSetHash() Uint256

MustQSetHash retrieves the QSetHash value from the union, panicing if the value is not set.

func (StellarMessage) MustTransaction

func (u StellarMessage) MustTransaction() TransactionEnvelope

MustTransaction retrieves the Transaction value from the union, panicing if the value is not set.

func (StellarMessage) MustTxSet

func (u StellarMessage) MustTxSet() TransactionSet

MustTxSet retrieves the TxSet value from the union, panicing if the value is not set.

func (StellarMessage) MustTxSetHash

func (u StellarMessage) MustTxSetHash() Uint256

MustTxSetHash retrieves the TxSetHash value from the union, panicing if the value is not set.

func (StellarMessage) SwitchFieldName

func (u StellarMessage) SwitchFieldName() string

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

type StellarValue

type StellarValue struct {
	TxSetHash Hash
	CloseTime Uint64
	Upgrades  []UpgradeType `xdrmaxsize:"6"`
	Ext       StellarValueExt
}

StellarValue is an XDR Struct defines as:

struct StellarValue
 {
     Hash txSetHash;   // transaction set to apply to previous ledger
     uint64 closeTime; // network close time

     // upgrades to apply to the previous ledger (usually empty)
     // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop
     // unknown steps during consensus if needed.
     // see notes below on 'LedgerUpgrade' for more detail
     // max size is dictated by number of upgrade types (+ room for future)
     UpgradeType upgrades<6>;

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

type StellarValueExt

type StellarValueExt struct {
	V int32
}

StellarValueExt is an XDR NestedUnion defines as:

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

func NewStellarValueExt

func NewStellarValueExt(v int32, value interface{}) (result StellarValueExt, err error)

NewStellarValueExt creates a new StellarValueExt.

func (StellarValueExt) ArmForSwitch

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

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

func (StellarValueExt) SwitchFieldName

func (u StellarValueExt) SwitchFieldName() string

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

type String32

type String32 string

String32 is an XDR Typedef defines as:

typedef string string32<32>;

func (String32) XDRMaxSize

func (e String32) XDRMaxSize() int

XDRMaxSize implements the Sized interface for String32

type String64

type String64 string

String64 is an XDR Typedef defines as:

typedef string string64<64>;

func (String64) XDRMaxSize

func (e String64) XDRMaxSize() int

XDRMaxSize implements the Sized interface for String64

type ThresholdIndexes

type ThresholdIndexes int32

ThresholdIndexes is an XDR Enum defines as:

enum ThresholdIndexes
 {
     THRESHOLD_MASTER_WEIGHT = 0,
     THRESHOLD_LOW = 1,
     THRESHOLD_MED = 2,
     THRESHOLD_HIGH = 3
 };
const (
	ThresholdIndexesThresholdMasterWeight ThresholdIndexes = 0
	ThresholdIndexesThresholdLow          ThresholdIndexes = 1
	ThresholdIndexesThresholdMed          ThresholdIndexes = 2
	ThresholdIndexesThresholdHigh         ThresholdIndexes = 3
)

func (ThresholdIndexes) String

func (e ThresholdIndexes) String() string

String returns the name of `e`

func (ThresholdIndexes) ValidEnum

func (e ThresholdIndexes) ValidEnum(v int32) bool

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

type Thresholds

type Thresholds [4]byte

Thresholds is an XDR Typedef defines as:

typedef opaque Thresholds[4];

func (*Thresholds) Scan

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

Scan reads from src into an Thresholds struct

func (Thresholds) XDRMaxSize

func (e Thresholds) XDRMaxSize() int

XDRMaxSize implements the Sized interface for Thresholds

type TimeBounds

type TimeBounds struct {
	MinTime Uint64
	MaxTime Uint64
}

TimeBounds is an XDR Struct defines as:

struct TimeBounds
 {
     uint64 minTime;
     uint64 maxTime; // 0 here means no maxTime
 };

type Transaction

type Transaction struct {
	SourceAccount AccountId
	Fee           Uint32
	SeqNum        SequenceNumber
	TimeBounds    *TimeBounds
	Memo          Memo
	Operations    []Operation `xdrmaxsize:"100"`
	Ext           TransactionExt
}

Transaction is an XDR Struct defines as:

struct Transaction
 {
     // account used to run the transaction
     AccountID sourceAccount;

     // the fee the sourceAccount will pay
     uint32 fee;

     // sequence number to consume in the account
     SequenceNumber seqNum;

     // validity range (inclusive) for the last ledger close time
     TimeBounds* timeBounds;

     Memo memo;

     Operation operations<100>;

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

type TransactionEnvelope

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

TransactionEnvelope is an XDR Struct defines as:

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

func (*TransactionEnvelope) Scan

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

Scan reads from src into an TransactionEnvelope struct

type TransactionExt

type TransactionExt struct {
	V int32
}

TransactionExt is an XDR NestedUnion defines as:

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

func NewTransactionExt

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

NewTransactionExt creates a new TransactionExt.

func (TransactionExt) ArmForSwitch

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

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

func (TransactionExt) SwitchFieldName

func (u TransactionExt) SwitchFieldName() string

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

type TransactionHistoryEntry

type TransactionHistoryEntry struct {
	LedgerSeq Uint32
	TxSet     TransactionSet
	Ext       TransactionHistoryEntryExt
}

TransactionHistoryEntry is an XDR Struct defines as:

struct TransactionHistoryEntry
 {
     uint32 ledgerSeq;
     TransactionSet txSet;

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

type TransactionHistoryEntryExt

type TransactionHistoryEntryExt struct {
	V int32
}

TransactionHistoryEntryExt is an XDR NestedUnion defines as:

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

func NewTransactionHistoryEntryExt

func NewTransactionHistoryEntryExt(v int32, value interface{}) (result TransactionHistoryEntryExt, err error)

NewTransactionHistoryEntryExt creates a new TransactionHistoryEntryExt.

func (TransactionHistoryEntryExt) ArmForSwitch

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

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

func (TransactionHistoryEntryExt) SwitchFieldName

func (u TransactionHistoryEntryExt) SwitchFieldName() string

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

type TransactionHistoryResultEntry

type TransactionHistoryResultEntry struct {
	LedgerSeq   Uint32
	TxResultSet TransactionResultSet
	Ext         TransactionHistoryResultEntryExt
}

TransactionHistoryResultEntry is an XDR Struct defines as:

struct TransactionHistoryResultEntry
 {
     uint32 ledgerSeq;
     TransactionResultSet txResultSet;

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

type TransactionHistoryResultEntryExt

type TransactionHistoryResultEntryExt struct {
	V int32
}

TransactionHistoryResultEntryExt is an XDR NestedUnion defines as:

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

func NewTransactionHistoryResultEntryExt

func NewTransactionHistoryResultEntryExt(v int32, value interface{}) (result TransactionHistoryResultEntryExt, err error)

NewTransactionHistoryResultEntryExt creates a new TransactionHistoryResultEntryExt.

func (TransactionHistoryResultEntryExt) ArmForSwitch

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

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

func (TransactionHistoryResultEntryExt) SwitchFieldName

func (u TransactionHistoryResultEntryExt) SwitchFieldName() string

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

type TransactionMeta

type TransactionMeta struct {
	V          int32
	Operations *[]OperationMeta
	V1         *TransactionMetaV1
}

TransactionMeta is an XDR Union defines as:

union TransactionMeta switch (int v)
 {
 case 0:
     OperationMeta operations<>;
 case 1:
     TransactionMetaV1 v1;
 };

func NewTransactionMeta

func NewTransactionMeta(v int32, value interface{}) (result TransactionMeta, err error)

NewTransactionMeta creates a new TransactionMeta.

func (TransactionMeta) ArmForSwitch

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

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

func (TransactionMeta) GetOperations

func (u TransactionMeta) GetOperations() (result []OperationMeta, ok bool)

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

func (TransactionMeta) GetV1

func (u TransactionMeta) GetV1() (result TransactionMetaV1, ok bool)

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

func (TransactionMeta) MustOperations

func (u TransactionMeta) MustOperations() []OperationMeta

MustOperations retrieves the Operations value from the union, panicing if the value is not set.

func (TransactionMeta) MustV1

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

func (*TransactionMeta) Scan

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

Scan reads from src into an TransactionMeta struct

func (TransactionMeta) SwitchFieldName

func (u TransactionMeta) SwitchFieldName() string

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

type TransactionMetaV1

type TransactionMetaV1 struct {
	TxChanges  LedgerEntryChanges
	Operations []OperationMeta
}

TransactionMetaV1 is an XDR Struct defines as:

struct TransactionMetaV1
 {
     LedgerEntryChanges txChanges; // tx level changes if any
     OperationMeta operations<>; // meta for each operation
 };

type TransactionResult

type TransactionResult struct {
	FeeCharged Int64
	Result     TransactionResultResult
	Ext        TransactionResultExt
}

TransactionResult is an XDR Struct defines as:

struct TransactionResult
 {
     int64 feeCharged; // actual fee charged for the transaction

     union switch (TransactionResultCode code)
     {
     case txSUCCESS:
     case txFAILED:
         OperationResult results<>;
     default:
         void;
     }
     result;

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

func (*TransactionResult) Scan

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

Scan reads from src into an TransactionResult struct

type TransactionResultCode

type TransactionResultCode int32

TransactionResultCode is an XDR Enum defines as:

enum TransactionResultCode
 {
     txSUCCESS = 0, // all operations succeeded

     txFAILED = -1, // one of the operations failed (none were applied)

     txTOO_EARLY = -2,         // ledger closeTime before minTime
     txTOO_LATE = -3,          // ledger closeTime after maxTime
     txMISSING_OPERATION = -4, // no operation was specified
     txBAD_SEQ = -5,           // sequence number does not match source account

     txBAD_AUTH = -6,             // too few valid signatures / wrong network
     txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve
     txNO_ACCOUNT = -8,           // source account not found
     txINSUFFICIENT_FEE = -9,     // fee is too small
     txBAD_AUTH_EXTRA = -10,      // unused signatures attached to transaction
     txINTERNAL_ERROR = -11       // an unknown error occured
 };
const (
	TransactionResultCodeTxSuccess             TransactionResultCode = 0
	TransactionResultCodeTxFailed              TransactionResultCode = -1
	TransactionResultCodeTxTooEarly            TransactionResultCode = -2
	TransactionResultCodeTxTooLate             TransactionResultCode = -3
	TransactionResultCodeTxMissingOperation    TransactionResultCode = -4
	TransactionResultCodeTxBadSeq              TransactionResultCode = -5
	TransactionResultCodeTxBadAuth             TransactionResultCode = -6
	TransactionResultCodeTxInsufficientBalance TransactionResultCode = -7
	TransactionResultCodeTxNoAccount           TransactionResultCode = -8
	TransactionResultCodeTxInsufficientFee     TransactionResultCode = -9
	TransactionResultCodeTxBadAuthExtra        TransactionResultCode = -10
	TransactionResultCodeTxInternalError       TransactionResultCode = -11
)

func (TransactionResultCode) String

func (e TransactionResultCode) String() string

String returns the name of `e`

func (TransactionResultCode) ValidEnum

func (e TransactionResultCode) ValidEnum(v int32) bool

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

type TransactionResultExt

type TransactionResultExt struct {
	V int32
}

TransactionResultExt is an XDR NestedUnion defines as:

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

func NewTransactionResultExt

func NewTransactionResultExt(v int32, value interface{}) (result TransactionResultExt, err error)

NewTransactionResultExt creates a new TransactionResultExt.

func (TransactionResultExt) ArmForSwitch

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

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

func (TransactionResultExt) SwitchFieldName

func (u TransactionResultExt) SwitchFieldName() string

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

type TransactionResultPair

type TransactionResultPair struct {
	TransactionHash Hash
	Result          TransactionResult
}

TransactionResultPair is an XDR Struct defines as:

struct TransactionResultPair
 {
     Hash transactionHash;
     TransactionResult result; // result for the transaction
 };

func (*TransactionResultPair) Scan

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

Scan reads from src into an TransactionResultPair struct

type TransactionResultResult

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

TransactionResultResult is an XDR NestedUnion defines as:

union switch (TransactionResultCode code)
     {
     case txSUCCESS:
     case txFAILED:
         OperationResult results<>;
     default:
         void;
     }

func NewTransactionResultResult

func NewTransactionResultResult(code TransactionResultCode, value interface{}) (result TransactionResultResult, err error)

NewTransactionResultResult creates a new TransactionResultResult.

func (TransactionResultResult) ArmForSwitch

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

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

func (TransactionResultResult) GetResults

func (u TransactionResultResult) 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 (TransactionResultResult) MustResults

func (u TransactionResultResult) MustResults() []OperationResult

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

func (TransactionResultResult) SwitchFieldName

func (u TransactionResultResult) SwitchFieldName() string

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

type TransactionResultSet

type TransactionResultSet struct {
	Results []TransactionResultPair
}

TransactionResultSet is an XDR Struct defines as:

struct TransactionResultSet
 {
     TransactionResultPair results<>;
 };

type TransactionSet

type TransactionSet struct {
	PreviousLedgerHash Hash
	Txs                []TransactionEnvelope
}

TransactionSet is an XDR Struct defines as:

struct TransactionSet
 {
     Hash previousLedgerHash;
     TransactionEnvelope txs<>;
 };

type TransactionSignaturePayload

type TransactionSignaturePayload struct {
	NetworkId         Hash
	TaggedTransaction TransactionSignaturePayloadTaggedTransaction
}

TransactionSignaturePayload is an XDR Struct defines as:

struct TransactionSignaturePayload
 {
     Hash networkId;
     union switch (EnvelopeType type)
     {
     case ENVELOPE_TYPE_TX:
         Transaction tx;
         /* All other values of type are invalid */
     }
     taggedTransaction;
 };

type TransactionSignaturePayloadTaggedTransaction

type TransactionSignaturePayloadTaggedTransaction struct {
	Type EnvelopeType
	Tx   *Transaction
}

TransactionSignaturePayloadTaggedTransaction is an XDR NestedUnion defines as:

union switch (EnvelopeType type)
     {
     case ENVELOPE_TYPE_TX:
         Transaction tx;
         /* All other values of type are invalid */
     }

func NewTransactionSignaturePayloadTaggedTransaction

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

NewTransactionSignaturePayloadTaggedTransaction creates a new TransactionSignaturePayloadTaggedTransaction.

func (TransactionSignaturePayloadTaggedTransaction) ArmForSwitch

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

func (TransactionSignaturePayloadTaggedTransaction) GetTx

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

func (TransactionSignaturePayloadTaggedTransaction) MustTx

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

func (TransactionSignaturePayloadTaggedTransaction) SwitchFieldName

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

type TrustLineEntry

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

TrustLineEntry is an XDR Struct defines as:

struct TrustLineEntry
 {
     AccountID accountID; // account this trustline belongs to
     Asset asset;         // type of asset (with issuer)
     int64 balance;       // how much of this asset the user has.
                          // Asset defines the unit for this;

     int64 limit;  // balance cannot be above this
     uint32 flags; // see TrustLineFlags

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

type TrustLineEntryExt

type TrustLineEntryExt struct {
	V int32
}

TrustLineEntryExt is an XDR NestedUnion defines as:

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

func NewTrustLineEntryExt

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

NewTrustLineEntryExt creates a new TrustLineEntryExt.

func (TrustLineEntryExt) ArmForSwitch

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

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

func (TrustLineEntryExt) SwitchFieldName

func (u TrustLineEntryExt) SwitchFieldName() string

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

type TrustLineFlags

type TrustLineFlags int32

TrustLineFlags is an XDR Enum defines as:

enum TrustLineFlags
 {
     // issuer has authorized account to perform transactions with its credit
     AUTHORIZED_FLAG = 1
 };
const (
	TrustLineFlagsAuthorizedFlag TrustLineFlags = 1
)

func (TrustLineFlags) String

func (e TrustLineFlags) String() string

String returns the name of `e`

func (TrustLineFlags) ValidEnum

func (e TrustLineFlags) ValidEnum(v int32) bool

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

type Uint256

type Uint256 [32]byte

Uint256 is an XDR Typedef defines as:

typedef opaque uint256[32];

func (Uint256) XDRMaxSize

func (e Uint256) XDRMaxSize() int

XDRMaxSize implements the Sized interface for Uint256

type Uint32

type Uint32 uint32

Uint32 is an XDR Typedef defines as:

typedef unsigned int uint32;

type Uint64

type Uint64 uint64

Uint64 is an XDR Typedef defines as:

typedef unsigned hyper uint64;

type UpgradeType

type UpgradeType []byte

UpgradeType is an XDR Typedef defines as:

typedef opaque UpgradeType<128>;

func (UpgradeType) XDRMaxSize

func (e UpgradeType) XDRMaxSize() int

XDRMaxSize implements the Sized interface for UpgradeType

type Value

type Value []byte

Value is an XDR Typedef defines as:

typedef opaque Value<>;

Jump to

Keyboard shortcuts

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