go: github.com/stellar/go/xdr Index | Examples | Files

package xdr

import "github.com/stellar/go/xdr"

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

lint:file-ignore S1005 The issue should be fixed in xdrgen. Unfortunately, there's no way to ignore a single file in staticcheck. lint:file-ignore U1000 fmtTest is not needed anywhere, should be removed in xdrgen. Package xdr is generated from:

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

DO NOT EDIT or your changes may be overwritten

Index

Examples

Package Files

account_entry.go account_id.go allow_trust_op_asset.go asset.go db.go ledger_entry.go ledger_entry_change.go ledger_key.go main.go path_payment_result.go price.go signer_key.go signers.go transaction_meta.go xdr_generated.go

Constants

const MaskAccountFlags = 0x7

MaskAccountFlags is an XDR Const defines as:

const MASK_ACCOUNT_FLAGS = 0x7;
const MaskOfferentryFlags = 1

MaskOfferentryFlags is an XDR Const defines as:

const MASK_OFFERENTRY_FLAGS = 1;
const MaskTrustlineFlags = 1

MaskTrustlineFlags is an XDR Const defines as:

const MASK_TRUSTLINE_FLAGS = 1;
const MaxOpsPerTx = 100

MaxOpsPerTx is an XDR Const defines as:

const MAX_OPS_PER_TX = 100;

func Marshal Uses

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

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

func MarshalBase64 Uses

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

func SafeUnmarshal Uses

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 Uses

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 Uses

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

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

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

Code:

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

type AccountEntry Uses

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

AccountEntry is an XDR Struct defines as:

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

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

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

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

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

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

func (AccountEntry) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntry) MasterKeyWeight Uses

func (a *AccountEntry) MasterKeyWeight() byte

func (*AccountEntry) SignerSummary Uses

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

func (*AccountEntry) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryExt Uses

type AccountEntryExt struct {
    V   int32
    V1  *AccountEntryV1
}

AccountEntryExt is an XDR NestedUnion defines as:

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

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

func NewAccountEntryExt Uses

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

NewAccountEntryExt creates a new AccountEntryExt.

func (AccountEntryExt) ArmForSwitch Uses

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

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

func (AccountEntryExt) GetV1 Uses

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

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

func (AccountEntryExt) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountEntryExt) MustV1 Uses

func (u AccountEntryExt) MustV1() AccountEntryV1

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

func (AccountEntryExt) SwitchFieldName Uses

func (u AccountEntryExt) SwitchFieldName() string

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

func (*AccountEntryExt) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryV1 Uses

type AccountEntryV1 struct {
    Liabilities Liabilities
    Ext         AccountEntryV1Ext
}

AccountEntryV1 is an XDR NestedStruct defines as:

struct
         {
             Liabilities liabilities;

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

func (AccountEntryV1) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountEntryV1) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountEntryV1Ext Uses

type AccountEntryV1Ext struct {
    V int32
}

AccountEntryV1Ext is an XDR NestedUnion defines as:

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

func NewAccountEntryV1Ext Uses

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

NewAccountEntryV1Ext creates a new AccountEntryV1Ext.

func (AccountEntryV1Ext) ArmForSwitch Uses

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

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

func (AccountEntryV1Ext) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountEntryV1Ext) SwitchFieldName Uses

func (u AccountEntryV1Ext) SwitchFieldName() string

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

func (*AccountEntryV1Ext) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountFlags Uses

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

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AccountFlags) Scan Uses

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

Scan reads from src into an AccountFlags

func (AccountFlags) String Uses

func (e AccountFlags) String() string

String returns the name of `e`

func (*AccountFlags) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AccountFlags) ValidEnum Uses

func (e AccountFlags) ValidEnum(v int32) bool

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

type AccountId Uses

type AccountId PublicKey

AccountId is an XDR Typedef defines as:

typedef PublicKey AccountID;

func MustAddress Uses

func MustAddress(address string) AccountId

func NewAccountId Uses

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

NewAccountId creates a new AccountId.

func (*AccountId) Address Uses

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 Uses

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 Uses

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

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

func (AccountId) GetEd25519 Uses

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 Uses

func (aid *AccountId) LedgerKey() (ret LedgerKey)

LedgerKey implements the `Keyer` interface

func (AccountId) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountId) MarshalBinaryCompress Uses

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

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

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

func (AccountId) MustEd25519 Uses

func (u AccountId) MustEd25519() Uint256

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

func (*AccountId) SetAddress Uses

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 Uses

func (u AccountId) SwitchFieldName() string

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

func (*AccountId) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountMergeResult Uses

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 Uses

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

NewAccountMergeResult creates a new AccountMergeResult.

func (AccountMergeResult) ArmForSwitch Uses

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 Uses

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

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

func (AccountMergeResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountMergeResult) MustSourceAccountBalance Uses

func (u AccountMergeResult) MustSourceAccountBalance() Int64

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

func (AccountMergeResult) SwitchFieldName Uses

func (u AccountMergeResult) SwitchFieldName() string

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

func (*AccountMergeResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AccountMergeResultCode Uses

type AccountMergeResultCode int32

AccountMergeResultCode is an XDR Enum defines as:

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

func (AccountMergeResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AccountMergeResultCode) String Uses

func (e AccountMergeResultCode) String() string

String returns the name of `e`

func (*AccountMergeResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AccountMergeResultCode) ValidEnum Uses

func (e AccountMergeResultCode) ValidEnum(v int32) bool

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

type AllowTrustOp Uses

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:
         AssetCode4 assetCode4;

     case ASSET_TYPE_CREDIT_ALPHANUM12:
         AssetCode12 assetCode12;

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

     bool authorize;
 };

func (AllowTrustOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AllowTrustOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AllowTrustOpAsset Uses

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

AllowTrustOpAsset is an XDR NestedUnion defines as:

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

     case ASSET_TYPE_CREDIT_ALPHANUM12:
         AssetCode12 assetCode12;

         // add other asset types here in the future
     }

func NewAllowTrustOpAsset Uses

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

NewAllowTrustOpAsset creates a new AllowTrustOpAsset.

func (AllowTrustOpAsset) ArmForSwitch Uses

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 Uses

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

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

func (AllowTrustOpAsset) GetAssetCode4 Uses

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

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

func (AllowTrustOpAsset) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AllowTrustOpAsset) MustAssetCode12 Uses

func (u AllowTrustOpAsset) MustAssetCode12() AssetCode12

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

func (AllowTrustOpAsset) MustAssetCode4 Uses

func (u AllowTrustOpAsset) MustAssetCode4() AssetCode4

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

func (AllowTrustOpAsset) SwitchFieldName Uses

func (u AllowTrustOpAsset) SwitchFieldName() string

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

func (AllowTrustOpAsset) ToAsset Uses

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

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

func (*AllowTrustOpAsset) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AllowTrustResult Uses

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 Uses

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

NewAllowTrustResult creates a new AllowTrustResult.

func (AllowTrustResult) ArmForSwitch Uses

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

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

func (AllowTrustResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AllowTrustResult) SwitchFieldName Uses

func (u AllowTrustResult) SwitchFieldName() string

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

func (*AllowTrustResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AllowTrustResultCode Uses

type AllowTrustResultCode int32

AllowTrustResultCode is an XDR Enum defines as:

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

func (AllowTrustResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AllowTrustResultCode) String Uses

func (e AllowTrustResultCode) String() string

String returns the name of `e`

func (*AllowTrustResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AllowTrustResultCode) ValidEnum Uses

func (e AllowTrustResultCode) ValidEnum(v int32) bool

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

type Asset Uses

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

Asset is an XDR Union defines as:

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

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

 case ASSET_TYPE_CREDIT_ALPHANUM12:
     struct
     {
         AssetCode12 assetCode;
         AccountID issuer;
     } alphaNum12;

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

func MustNewCreditAsset Uses

func MustNewCreditAsset(code string, issuer string) Asset

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

func MustNewNativeAsset Uses

func MustNewNativeAsset() Asset

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

func NewAsset Uses

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

NewAsset creates a new Asset.

func (Asset) ArmForSwitch Uses

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 Uses

func (a Asset) Equals(other Asset) bool

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

func (Asset) Extract Uses

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 Uses

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 Uses

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

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

func (Asset) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (Asset) MarshalBinaryCompress Uses

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

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

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

func (Asset) MustAlphaNum12 Uses

func (u Asset) MustAlphaNum12() AssetAlphaNum12

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

func (Asset) MustAlphaNum4 Uses

func (u Asset) MustAlphaNum4() AssetAlphaNum4

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

func (Asset) MustExtract Uses

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

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

func (*Asset) Scan Uses

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

Scan reads from src into an Asset

func (*Asset) SetCredit Uses

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 Uses

func (a *Asset) SetNative() error

SetNative overwrites `a` with the native asset type

func (Asset) String Uses

func (a Asset) String() string

String returns a display friendly form of the asset

func (Asset) SwitchFieldName Uses

func (u Asset) SwitchFieldName() string

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

func (*Asset) ToAllowTrustOpAsset Uses

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

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

func (*Asset) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AssetAlphaNum12 Uses

type AssetAlphaNum12 struct {
    AssetCode AssetCode12
    Issuer    AccountId
}

AssetAlphaNum12 is an XDR NestedStruct defines as:

struct
     {
         AssetCode12 assetCode;
         AccountID issuer;
     }

func (AssetAlphaNum12) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetAlphaNum12) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AssetAlphaNum4 Uses

type AssetAlphaNum4 struct {
    AssetCode AssetCode4
    Issuer    AccountId
}

AssetAlphaNum4 is an XDR NestedStruct defines as:

struct
     {
         AssetCode4 assetCode;
         AccountID issuer;
     }

func (AssetAlphaNum4) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetAlphaNum4) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AssetCode12 Uses

type AssetCode12 [12]byte

AssetCode12 is an XDR Typedef defines as:

typedef opaque AssetCode12[12];

func (AssetCode12) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetCode12) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AssetCode12) XDRMaxSize Uses

func (e AssetCode12) XDRMaxSize() int

XDRMaxSize implements the Sized interface for AssetCode12

type AssetCode4 Uses

type AssetCode4 [4]byte

AssetCode4 is an XDR Typedef defines as:

typedef opaque AssetCode4[4];

func (AssetCode4) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetCode4) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AssetCode4) XDRMaxSize Uses

func (e AssetCode4) XDRMaxSize() int

XDRMaxSize implements the Sized interface for AssetCode4

type AssetType Uses

type AssetType int32

AssetType is an XDR Enum defines as:

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

func (AssetType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AssetType) Scan Uses

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

Scan reads from src into an AssetType

func (AssetType) String Uses

func (e AssetType) String() string

String returns the name of `e`

func (*AssetType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (AssetType) ValidEnum Uses

func (e AssetType) ValidEnum(v int32) bool

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

type Auth Uses

type Auth struct {
    Unused int32
}

Auth is an XDR Struct defines as:

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

func (Auth) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Auth) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AuthCert Uses

type AuthCert struct {
    Pubkey     Curve25519Public
    Expiration Uint64
    Sig        Signature
}

AuthCert is an XDR Struct defines as:

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

func (AuthCert) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AuthCert) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AuthenticatedMessage Uses

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 Uses

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

NewAuthenticatedMessage creates a new AuthenticatedMessage.

func (AuthenticatedMessage) ArmForSwitch Uses

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 Uses

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

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

func (AuthenticatedMessage) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (AuthenticatedMessage) MustV0 Uses

func (u AuthenticatedMessage) MustV0() AuthenticatedMessageV0

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

func (AuthenticatedMessage) SwitchFieldName Uses

func (u AuthenticatedMessage) SwitchFieldName() string

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

func (*AuthenticatedMessage) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type AuthenticatedMessageV0 Uses

type AuthenticatedMessageV0 struct {
    Sequence Uint64
    Message  StellarMessage
    Mac      HmacSha256Mac
}

AuthenticatedMessageV0 is an XDR NestedStruct defines as:

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

func (AuthenticatedMessageV0) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*AuthenticatedMessageV0) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BucketEntry Uses

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

BucketEntry is an XDR Union defines as:

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

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

func NewBucketEntry Uses

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

NewBucketEntry creates a new BucketEntry.

func (BucketEntry) ArmForSwitch Uses

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 Uses

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 Uses

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

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

func (BucketEntry) GetMetaEntry Uses

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

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

func (BucketEntry) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BucketEntry) MustDeadEntry Uses

func (u BucketEntry) MustDeadEntry() LedgerKey

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

func (BucketEntry) MustLiveEntry Uses

func (u BucketEntry) MustLiveEntry() LedgerEntry

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

func (BucketEntry) MustMetaEntry Uses

func (u BucketEntry) MustMetaEntry() BucketMetadata

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

func (BucketEntry) SwitchFieldName Uses

func (u BucketEntry) SwitchFieldName() string

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

func (*BucketEntry) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BucketEntryType Uses

type BucketEntryType int32

BucketEntryType is an XDR Enum defines as:

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

func (BucketEntryType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BucketEntryType) String Uses

func (e BucketEntryType) String() string

String returns the name of `e`

func (*BucketEntryType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (BucketEntryType) ValidEnum Uses

func (e BucketEntryType) ValidEnum(v int32) bool

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

type BucketMetadata Uses

type BucketMetadata struct {
    LedgerVersion Uint32
    Ext           BucketMetadataExt
}

BucketMetadata is an XDR Struct defines as:

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

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

func (BucketMetadata) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*BucketMetadata) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BucketMetadataExt Uses

type BucketMetadataExt struct {
    V int32
}

BucketMetadataExt is an XDR NestedUnion defines as:

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

func NewBucketMetadataExt Uses

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

NewBucketMetadataExt creates a new BucketMetadataExt.

func (BucketMetadataExt) ArmForSwitch Uses

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

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

func (BucketMetadataExt) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BucketMetadataExt) SwitchFieldName Uses

func (u BucketMetadataExt) SwitchFieldName() string

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

func (*BucketMetadataExt) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BumpSequenceOp Uses

type BumpSequenceOp struct {
    BumpTo SequenceNumber
}

BumpSequenceOp is an XDR Struct defines as:

struct BumpSequenceOp
 {
     SequenceNumber bumpTo;
 };

func (BumpSequenceOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*BumpSequenceOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BumpSequenceResult Uses

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 Uses

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

NewBumpSequenceResult creates a new BumpSequenceResult.

func (BumpSequenceResult) ArmForSwitch Uses

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

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

func (BumpSequenceResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BumpSequenceResult) SwitchFieldName Uses

func (u BumpSequenceResult) SwitchFieldName() string

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

func (*BumpSequenceResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type BumpSequenceResultCode Uses

type BumpSequenceResultCode int32

BumpSequenceResultCode is an XDR Enum defines as:

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

func (BumpSequenceResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (BumpSequenceResultCode) String Uses

func (e BumpSequenceResultCode) String() string

String returns the name of `e`

func (*BumpSequenceResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (BumpSequenceResultCode) ValidEnum Uses

func (e BumpSequenceResultCode) ValidEnum(v int32) bool

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

type ChangeTrustOp Uses

type ChangeTrustOp struct {
    Line  Asset
    Limit Int64
}

ChangeTrustOp is an XDR Struct defines as:

struct ChangeTrustOp
 {
     Asset line;

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

func (ChangeTrustOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ChangeTrustOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ChangeTrustResult Uses

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 Uses

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

NewChangeTrustResult creates a new ChangeTrustResult.

func (ChangeTrustResult) ArmForSwitch Uses

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

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

func (ChangeTrustResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ChangeTrustResult) SwitchFieldName Uses

func (u ChangeTrustResult) SwitchFieldName() string

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

func (*ChangeTrustResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ChangeTrustResultCode Uses

type ChangeTrustResultCode int32

ChangeTrustResultCode is an XDR Enum defines as:

enum ChangeTrustResultCode
 {
     // codes considered as "success" for the operation
     CHANGE_TRUST_SUCCESS = 0,
     // codes considered as "failure" for the operation
     CHANGE_TRUST_MALFORMED = -1,     // bad input
     CHANGE_TRUST_NO_ISSUER = -2,     // could not find issuer
     CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance
                                      // cannot create with a limit of 0
     CHANGE_TRUST_LOW_RESERVE =
         -4, // not enough funds to create a new trust line,
     CHANGE_TRUST_SELF_NOT_ALLOWED = -5  // trusting self is not allowed
 };
const (
    ChangeTrustResultCodeChangeTrustSuccess        ChangeTrustResultCode = 0
    ChangeTrustResultCodeChangeTrustMalformed      ChangeTrustResultCode = -1
    ChangeTrustResultCodeChangeTrustNoIssuer       ChangeTrustResultCode = -2
    ChangeTrustResultCodeChangeTrustInvalidLimit   ChangeTrustResultCode = -3
    ChangeTrustResultCodeChangeTrustLowReserve     ChangeTrustResultCode = -4
    ChangeTrustResultCodeChangeTrustSelfNotAllowed ChangeTrustResultCode = -5
)

func (ChangeTrustResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ChangeTrustResultCode) String Uses

func (e ChangeTrustResultCode) String() string

String returns the name of `e`

func (*ChangeTrustResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ChangeTrustResultCode) ValidEnum Uses

func (e ChangeTrustResultCode) ValidEnum(v int32) bool

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

type ClaimOfferAtom Uses

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

ClaimOfferAtom is an XDR Struct defines as:

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

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

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

func (ClaimOfferAtom) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ClaimOfferAtom) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type CreateAccountOp Uses

type CreateAccountOp struct {
    Destination     AccountId
    StartingBalance Int64
}

CreateAccountOp is an XDR Struct defines as:

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

func (CreateAccountOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*CreateAccountOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type CreateAccountResult Uses

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 Uses

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

NewCreateAccountResult creates a new CreateAccountResult.

func (CreateAccountResult) ArmForSwitch Uses

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

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

func (CreateAccountResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (CreateAccountResult) SwitchFieldName Uses

func (u CreateAccountResult) SwitchFieldName() string

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

func (*CreateAccountResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type CreateAccountResultCode Uses

type CreateAccountResultCode int32

CreateAccountResultCode is an XDR Enum defines as:

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

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

func (CreateAccountResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (CreateAccountResultCode) String Uses

func (e CreateAccountResultCode) String() string

String returns the name of `e`

func (*CreateAccountResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (CreateAccountResultCode) ValidEnum Uses

func (e CreateAccountResultCode) ValidEnum(v int32) bool

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

type CreatePassiveSellOfferOp Uses

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

CreatePassiveSellOfferOp is an XDR Struct defines as:

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

func (CreatePassiveSellOfferOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*CreatePassiveSellOfferOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type CryptoKeyType Uses

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

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

MarshalBinary implements encoding.BinaryMarshaler.

func (CryptoKeyType) String Uses

func (e CryptoKeyType) String() string

String returns the name of `e`

func (*CryptoKeyType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (CryptoKeyType) ValidEnum Uses

func (e CryptoKeyType) ValidEnum(v int32) bool

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

type Curve25519Public Uses

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

Curve25519Public is an XDR Struct defines as:

struct Curve25519Public
 {
         opaque key[32];
 };

func (Curve25519Public) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Curve25519Public) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Curve25519Secret Uses

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

Curve25519Secret is an XDR Struct defines as:

struct Curve25519Secret
 {
         opaque key[32];
 };

func (Curve25519Secret) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Curve25519Secret) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type DataEntry Uses

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

DataEntry is an XDR Struct defines as:

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

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

func (DataEntry) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*DataEntry) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type DataEntryExt Uses

type DataEntryExt struct {
    V int32
}

DataEntryExt is an XDR NestedUnion defines as:

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

func NewDataEntryExt Uses

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

NewDataEntryExt creates a new DataEntryExt.

func (DataEntryExt) ArmForSwitch Uses

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

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

func (DataEntryExt) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (DataEntryExt) SwitchFieldName Uses

func (u DataEntryExt) SwitchFieldName() string

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

func (*DataEntryExt) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type DataValue Uses

type DataValue []byte

DataValue is an XDR Typedef defines as:

typedef opaque DataValue<64>;

func (DataValue) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*DataValue) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (DataValue) XDRMaxSize Uses

func (e DataValue) XDRMaxSize() int

XDRMaxSize implements the Sized interface for DataValue

type DecoratedSignature Uses

type DecoratedSignature struct {
    Hint      SignatureHint
    Signature Signature
}

DecoratedSignature is an XDR Struct defines as:

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

func (DecoratedSignature) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*DecoratedSignature) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type DontHave Uses

type DontHave struct {
    Type    MessageType
    ReqHash Uint256
}

DontHave is an XDR Struct defines as:

struct DontHave
 {
     MessageType type;
     uint256 reqHash;
 };

func (DontHave) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*DontHave) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type EnvelopeType Uses

type EnvelopeType int32

EnvelopeType is an XDR Enum defines as:

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

func (EnvelopeType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (EnvelopeType) String Uses

func (e EnvelopeType) String() string

String returns the name of `e`

func (*EnvelopeType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (EnvelopeType) ValidEnum Uses

func (e EnvelopeType) ValidEnum(v int32) bool

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

type Error Uses

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

Error is an XDR Struct defines as:

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

func (Error) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Error) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ErrorCode Uses

type ErrorCode int32

ErrorCode is an XDR Enum defines as:

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

func (ErrorCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ErrorCode) String Uses

func (e ErrorCode) String() string

String returns the name of `e`

func (*ErrorCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ErrorCode) ValidEnum Uses

func (e ErrorCode) ValidEnum(v int32) bool

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

type Hash Uses

type Hash [32]byte

Hash is an XDR Typedef defines as:

typedef opaque Hash[32];

func (Hash) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Hash) Scan Uses

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

Scan reads from a src into an xdr.Hash

func (*Hash) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (Hash) XDRMaxSize Uses

func (e Hash) XDRMaxSize() int

XDRMaxSize implements the Sized interface for Hash

type Hello Uses

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

Hello is an XDR Struct defines as:

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

func (Hello) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Hello) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type HmacSha256Key Uses

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

HmacSha256Key is an XDR Struct defines as:

struct HmacSha256Key
 {
         opaque key[32];
 };

func (HmacSha256Key) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*HmacSha256Key) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type HmacSha256Mac Uses

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

HmacSha256Mac is an XDR Struct defines as:

struct HmacSha256Mac
 {
         opaque mac[32];
 };

func (HmacSha256Mac) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*HmacSha256Mac) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type InflationPayout Uses

type InflationPayout struct {
    Destination AccountId
    Amount      Int64
}

InflationPayout is an XDR Struct defines as:

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

func (InflationPayout) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*InflationPayout) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type InflationResult Uses

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 Uses

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

NewInflationResult creates a new InflationResult.

func (InflationResult) ArmForSwitch Uses

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 Uses

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

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

func (InflationResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (InflationResult) MustPayouts Uses

func (u InflationResult) MustPayouts() []InflationPayout

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

func (InflationResult) SwitchFieldName Uses

func (u InflationResult) SwitchFieldName() string

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

func (*InflationResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type InflationResultCode Uses

type InflationResultCode int32

InflationResultCode is an XDR Enum defines as:

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

func (InflationResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (InflationResultCode) String Uses

func (e InflationResultCode) String() string

String returns the name of `e`

func (*InflationResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (InflationResultCode) ValidEnum Uses

func (e InflationResultCode) ValidEnum(v int32) bool

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

type Int32 Uses

type Int32 int32

Int32 is an XDR Typedef defines as:

typedef int int32;

func (Int32) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Int32) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Int64 Uses

type Int64 int64

Int64 is an XDR Typedef defines as:

typedef hyper int64;

func (Int64) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Int64) Scan Uses

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

Scan reads from src into an Int64

func (*Int64) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type IpAddrType Uses

type IpAddrType int32

IpAddrType is an XDR Enum defines as:

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

func (IpAddrType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (IpAddrType) String Uses

func (e IpAddrType) String() string

String returns the name of `e`

func (*IpAddrType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (IpAddrType) ValidEnum Uses

func (e IpAddrType) ValidEnum(v int32) bool

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

type Keyer Uses

type Keyer interface {
    LedgerKey() LedgerKey
}

Keyer represents a type that can be converted into a LedgerKey

type LedgerCloseValueSignature Uses

type LedgerCloseValueSignature struct {
    NodeId    NodeId
    Signature Signature
}

LedgerCloseValueSignature is an XDR Struct defines as:

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

func (LedgerCloseValueSignature) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerCloseValueSignature) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntry Uses

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 Uses

func (entry *LedgerEntry) LedgerKey() LedgerKey

LedgerKey implements the `Keyer` interface

func (LedgerEntry) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerEntry) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryChange Uses

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 Uses

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

NewLedgerEntryChange creates a new LedgerEntryChange.

func (LedgerEntryChange) ArmForSwitch Uses

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 Uses

func (change *LedgerEntryChange) EntryType() LedgerEntryType

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

func (LedgerEntryChange) GetCreated Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (change *LedgerEntryChange) LedgerKey() LedgerKey

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

func (LedgerEntryChange) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryChange) MustCreated Uses

func (u LedgerEntryChange) MustCreated() LedgerEntry

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

func (LedgerEntryChange) MustRemoved Uses

func (u LedgerEntryChange) MustRemoved() LedgerKey

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

func (LedgerEntryChange) MustState Uses

func (u LedgerEntryChange) MustState() LedgerEntry

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

func (LedgerEntryChange) MustUpdated Uses

func (u LedgerEntryChange) MustUpdated() LedgerEntry

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

func (LedgerEntryChange) SwitchFieldName Uses

func (u LedgerEntryChange) SwitchFieldName() string

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

func (*LedgerEntryChange) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryChangeType Uses

type LedgerEntryChangeType int32

LedgerEntryChangeType is an XDR Enum defines as:

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

func (LedgerEntryChangeType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryChangeType) String Uses

func (e LedgerEntryChangeType) String() string

String returns the name of `e`

func (*LedgerEntryChangeType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (LedgerEntryChangeType) ValidEnum Uses

func (e LedgerEntryChangeType) ValidEnum(v int32) bool

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

type LedgerEntryChanges Uses

type LedgerEntryChanges []LedgerEntryChange

LedgerEntryChanges is an XDR Typedef defines as:

typedef LedgerEntryChange LedgerEntryChanges<>;

func (LedgerEntryChanges) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerEntryChanges) Scan Uses

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

Scan reads from src into an LedgerEntryChanges struct

func (*LedgerEntryChanges) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryData Uses

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 Uses

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

NewLedgerEntryData creates a new LedgerEntryData.

func (LedgerEntryData) ArmForSwitch Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (LedgerEntryData) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryData) MustAccount Uses

func (u LedgerEntryData) MustAccount() AccountEntry

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

func (LedgerEntryData) MustData Uses

func (u LedgerEntryData) MustData() DataEntry

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

func (LedgerEntryData) MustOffer Uses

func (u LedgerEntryData) MustOffer() OfferEntry

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

func (LedgerEntryData) MustTrustLine Uses

func (u LedgerEntryData) MustTrustLine() TrustLineEntry

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

func (LedgerEntryData) SwitchFieldName Uses

func (u LedgerEntryData) SwitchFieldName() string

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

func (*LedgerEntryData) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryExt Uses

type LedgerEntryExt struct {
    V int32
}

LedgerEntryExt is an XDR NestedUnion defines as:

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

func NewLedgerEntryExt Uses

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

NewLedgerEntryExt creates a new LedgerEntryExt.

func (LedgerEntryExt) ArmForSwitch Uses

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

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

func (LedgerEntryExt) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryExt) SwitchFieldName Uses

func (u LedgerEntryExt) SwitchFieldName() string

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

func (*LedgerEntryExt) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerEntryType Uses

type LedgerEntryType int32

LedgerEntryType is an XDR Enum defines as:

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

func (LedgerEntryType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerEntryType) String Uses

func (e LedgerEntryType) String() string

String returns the name of `e`

func (*LedgerEntryType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (LedgerEntryType) ValidEnum Uses

func (e LedgerEntryType) ValidEnum(v int32) bool

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

type LedgerHeader Uses

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

LedgerHeader is an XDR Struct defines as:

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

     uint32 ledgerSeq; // sequence number of this ledger

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

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

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

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

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

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

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

func (LedgerHeader) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerHeader) Scan Uses

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

Scan reads from src into an LedgerHeader struct

func (*LedgerHeader) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerHeaderExt Uses

type LedgerHeaderExt struct {
    V int32
}

LedgerHeaderExt is an XDR NestedUnion defines as:

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

func NewLedgerHeaderExt Uses

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

NewLedgerHeaderExt creates a new LedgerHeaderExt.

func (LedgerHeaderExt) ArmForSwitch Uses

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

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

func (LedgerHeaderExt) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerHeaderExt) SwitchFieldName Uses

func (u LedgerHeaderExt) SwitchFieldName() string

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

func (*LedgerHeaderExt) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerHeaderHistoryEntry Uses

type LedgerHeaderHistoryEntry struct {
    Hash   Hash
    Header LedgerHeader
    Ext    LedgerHeaderHistoryEntryExt
}

LedgerHeaderHistoryEntry is an XDR Struct defines as:

struct LedgerHeaderHistoryEntry
 {
     Hash hash;
     LedgerHeader header;

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

func (LedgerHeaderHistoryEntry) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerHeaderHistoryEntry) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerHeaderHistoryEntryExt Uses

type LedgerHeaderHistoryEntryExt struct {
    V int32
}

LedgerHeaderHistoryEntryExt is an XDR NestedUnion defines as:

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

func NewLedgerHeaderHistoryEntryExt Uses

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

NewLedgerHeaderHistoryEntryExt creates a new LedgerHeaderHistoryEntryExt.

func (LedgerHeaderHistoryEntryExt) ArmForSwitch Uses

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

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

func (LedgerHeaderHistoryEntryExt) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerHeaderHistoryEntryExt) SwitchFieldName Uses

func (u LedgerHeaderHistoryEntryExt) SwitchFieldName() string

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

func (*LedgerHeaderHistoryEntryExt) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKey Uses

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

LedgerKey is an XDR Union defines as:

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

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

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

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

func NewLedgerKey Uses

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

NewLedgerKey creates a new LedgerKey.

func (LedgerKey) ArmForSwitch Uses

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 Uses

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

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

func (LedgerKey) GetAccount Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (key *LedgerKey) LedgerKey() LedgerKey

LedgerKey implements the `Keyer` interface

func (LedgerKey) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerKey) MarshalBinaryCompress Uses

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

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

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

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

func (LedgerKey) MustAccount Uses

func (u LedgerKey) MustAccount() LedgerKeyAccount

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

func (LedgerKey) MustData Uses

func (u LedgerKey) MustData() LedgerKeyData

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

func (LedgerKey) MustOffer Uses

func (u LedgerKey) MustOffer() LedgerKeyOffer

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

func (LedgerKey) MustTrustLine Uses

func (u LedgerKey) MustTrustLine() LedgerKeyTrustLine

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

func (*LedgerKey) SetAccount Uses

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

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

func (*LedgerKey) SetData Uses

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 Uses

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 Uses

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 Uses

func (u LedgerKey) SwitchFieldName() string

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

func (*LedgerKey) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKeyAccount Uses

type LedgerKeyAccount struct {
    AccountId AccountId
}

LedgerKeyAccount is an XDR NestedStruct defines as:

struct
     {
         AccountID accountID;
     }

func (LedgerKeyAccount) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerKeyAccount) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKeyData Uses

type LedgerKeyData struct {
    AccountId AccountId
    DataName  String64
}

LedgerKeyData is an XDR NestedStruct defines as:

struct
     {
         AccountID accountID;
         string64 dataName;
     }

func (LedgerKeyData) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerKeyData) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKeyOffer Uses

type LedgerKeyOffer struct {
    SellerId AccountId
    OfferId  Int64
}

LedgerKeyOffer is an XDR NestedStruct defines as:

struct
     {
         AccountID sellerID;
         int64 offerID;
     }

func (LedgerKeyOffer) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerKeyOffer) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerKeyTrustLine Uses

type LedgerKeyTrustLine struct {
    AccountId AccountId
    Asset     Asset
}

LedgerKeyTrustLine is an XDR NestedStruct defines as:

struct
     {
         AccountID accountID;
         Asset asset;
     }

func (LedgerKeyTrustLine) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerKeyTrustLine) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerScpMessages Uses

type LedgerScpMessages struct {
    LedgerSeq Uint32
    Messages  []ScpEnvelope
}

LedgerScpMessages is an XDR Struct defines as:

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

func (LedgerScpMessages) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*LedgerScpMessages) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerUpgrade Uses

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 Uses

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

NewLedgerUpgrade creates a new LedgerUpgrade.

func (LedgerUpgrade) ArmForSwitch Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (LedgerUpgrade) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerUpgrade) MustNewBaseFee Uses

func (u LedgerUpgrade) MustNewBaseFee() Uint32

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

func (LedgerUpgrade) MustNewBaseReserve Uses

func (u LedgerUpgrade) MustNewBaseReserve() Uint32

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

func (LedgerUpgrade) MustNewLedgerVersion Uses

func (u LedgerUpgrade) MustNewLedgerVersion() Uint32

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

func (LedgerUpgrade) MustNewMaxTxSetSize Uses

func (u LedgerUpgrade) MustNewMaxTxSetSize() Uint32

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

func (LedgerUpgrade) SwitchFieldName Uses

func (u LedgerUpgrade) SwitchFieldName() string

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

func (*LedgerUpgrade) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type LedgerUpgradeType Uses

type LedgerUpgradeType int32

LedgerUpgradeType is an XDR Enum defines as:

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

func (LedgerUpgradeType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (LedgerUpgradeType) String Uses

func (e LedgerUpgradeType) String() string

String returns the name of `e`

func (*LedgerUpgradeType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (LedgerUpgradeType) ValidEnum Uses

func (e LedgerUpgradeType) ValidEnum(v int32) bool

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

type Liabilities Uses

type Liabilities struct {
    Buying  Int64
    Selling Int64
}

Liabilities is an XDR Struct defines as:

struct Liabilities
 {
     int64 buying;
     int64 selling;
 };

func (Liabilities) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Liabilities) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageBuyOfferOp Uses

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

ManageBuyOfferOp is an XDR Struct defines as:

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

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

func (ManageBuyOfferOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ManageBuyOfferOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageBuyOfferResult Uses

type ManageBuyOfferResult struct {
    Code    ManageBuyOfferResultCode
    Success *ManageOfferSuccessResult
}

ManageBuyOfferResult is an XDR Union defines as:

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

func NewManageBuyOfferResult Uses

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

NewManageBuyOfferResult creates a new ManageBuyOfferResult.

func (ManageBuyOfferResult) ArmForSwitch Uses

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

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

func (ManageBuyOfferResult) GetSuccess Uses

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

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

func (ManageBuyOfferResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageBuyOfferResult) MustSuccess Uses

func (u ManageBuyOfferResult) MustSuccess() ManageOfferSuccessResult

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

func (ManageBuyOfferResult) SwitchFieldName Uses

func (u ManageBuyOfferResult) SwitchFieldName() string

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

func (*ManageBuyOfferResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageBuyOfferResultCode Uses

type ManageBuyOfferResultCode int32

ManageBuyOfferResultCode is an XDR Enum defines as:

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

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

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

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

func (ManageBuyOfferResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageBuyOfferResultCode) String Uses

func (e ManageBuyOfferResultCode) String() string

String returns the name of `e`

func (*ManageBuyOfferResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ManageBuyOfferResultCode) ValidEnum Uses

func (e ManageBuyOfferResultCode) ValidEnum(v int32) bool

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

type ManageDataOp Uses

type ManageDataOp struct {
    DataName  String64
    DataValue *DataValue
}

ManageDataOp is an XDR Struct defines as:

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

func (ManageDataOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ManageDataOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageDataResult Uses

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 Uses

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

NewManageDataResult creates a new ManageDataResult.

func (ManageDataResult) ArmForSwitch Uses

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

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

func (ManageDataResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageDataResult) SwitchFieldName Uses

func (u ManageDataResult) SwitchFieldName() string

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

func (*ManageDataResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageDataResultCode Uses

type ManageDataResultCode int32

ManageDataResultCode is an XDR Enum defines as:

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

func (ManageDataResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageDataResultCode) String Uses

func (e ManageDataResultCode) String() string

String returns the name of `e`

func (*ManageDataResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ManageDataResultCode) ValidEnum Uses

func (e ManageDataResultCode) ValidEnum(v int32) bool

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

type ManageOfferEffect Uses

type ManageOfferEffect int32

ManageOfferEffect is an XDR Enum defines as:

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

func (ManageOfferEffect) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageOfferEffect) String Uses

func (e ManageOfferEffect) String() string

String returns the name of `e`

func (*ManageOfferEffect) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ManageOfferEffect) ValidEnum Uses

func (e ManageOfferEffect) ValidEnum(v int32) bool

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

type ManageOfferSuccessResult Uses

type ManageOfferSuccessResult struct {
    OffersClaimed []ClaimOfferAtom
    Offer         ManageOfferSuccessResultOffer
}

ManageOfferSuccessResult is an XDR Struct defines as:

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

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

func (ManageOfferSuccessResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ManageOfferSuccessResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageOfferSuccessResultOffer Uses

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 Uses

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

NewManageOfferSuccessResultOffer creates a new ManageOfferSuccessResultOffer.

func (ManageOfferSuccessResultOffer) ArmForSwitch Uses

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 Uses

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

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

func (ManageOfferSuccessResultOffer) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageOfferSuccessResultOffer) MustOffer Uses

func (u ManageOfferSuccessResultOffer) MustOffer() OfferEntry

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

func (ManageOfferSuccessResultOffer) SwitchFieldName Uses

func (u ManageOfferSuccessResultOffer) SwitchFieldName() string

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

func (*ManageOfferSuccessResultOffer) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageSellOfferOp Uses

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

ManageSellOfferOp is an XDR Struct defines as:

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

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

func (ManageSellOfferOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ManageSellOfferOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageSellOfferResult Uses

type ManageSellOfferResult struct {
    Code    ManageSellOfferResultCode
    Success *ManageOfferSuccessResult
}

ManageSellOfferResult is an XDR Union defines as:

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

func NewManageSellOfferResult Uses

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

NewManageSellOfferResult creates a new ManageSellOfferResult.

func (ManageSellOfferResult) ArmForSwitch Uses

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

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

func (ManageSellOfferResult) GetSuccess Uses

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

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

func (ManageSellOfferResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageSellOfferResult) MustSuccess Uses

func (u ManageSellOfferResult) MustSuccess() ManageOfferSuccessResult

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

func (ManageSellOfferResult) SwitchFieldName Uses

func (u ManageSellOfferResult) SwitchFieldName() string

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

func (*ManageSellOfferResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ManageSellOfferResultCode Uses

type ManageSellOfferResultCode int32

ManageSellOfferResultCode is an XDR Enum defines as:

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

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

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

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

func (ManageSellOfferResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ManageSellOfferResultCode) String Uses

func (e ManageSellOfferResultCode) String() string

String returns the name of `e`

func (*ManageSellOfferResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ManageSellOfferResultCode) ValidEnum Uses

func (e ManageSellOfferResultCode) ValidEnum(v int32) bool

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

type Memo Uses

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 Uses

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

NewMemo creates a new Memo.

func (Memo) ArmForSwitch Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (Memo) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (Memo) MustHash Uses

func (u Memo) MustHash() Hash

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

func (Memo) MustId Uses

func (u Memo) MustId() Uint64

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

func (Memo) MustRetHash Uses

func (u Memo) MustRetHash() Hash

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

func (Memo) MustText Uses

func (u Memo) MustText() string

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

func (Memo) SwitchFieldName Uses

func (u Memo) SwitchFieldName() string

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

func (*Memo) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type MemoType Uses

type MemoType int32

MemoType is an XDR Enum defines as:

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

func (MemoType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (MemoType) String Uses

func (e MemoType) String() string

String returns the name of `e`

func (*MemoType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (MemoType) ValidEnum Uses

func (e MemoType) ValidEnum(v int32) bool

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

type MessageType Uses

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

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

MarshalBinary implements encoding.BinaryMarshaler.

func (MessageType) String Uses

func (e MessageType) String() string

String returns the name of `e`

func (*MessageType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (MessageType) ValidEnum Uses

func (e MessageType) ValidEnum(v int32) bool

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

type NodeId Uses

type NodeId PublicKey

NodeId is an XDR Typedef defines as:

typedef PublicKey NodeID;

func NewNodeId Uses

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

NewNodeId creates a new NodeId.

func (NodeId) ArmForSwitch Uses

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 Uses

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

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

func (NodeId) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (NodeId) MustEd25519 Uses

func (u NodeId) MustEd25519() Uint256

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

func (NodeId) SwitchFieldName Uses

func (u NodeId) SwitchFieldName() string

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

func (*NodeId) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OfferEntry Uses

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

OfferEntry is an XDR Struct defines as:

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

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

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

func (OfferEntry) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*OfferEntry) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OfferEntryExt Uses

type OfferEntryExt struct {
    V int32
}

OfferEntryExt is an XDR NestedUnion defines as:

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

func NewOfferEntryExt Uses

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

NewOfferEntryExt creates a new OfferEntryExt.

func (OfferEntryExt) ArmForSwitch Uses

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

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

func (OfferEntryExt) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OfferEntryExt) SwitchFieldName Uses

func (u OfferEntryExt) SwitchFieldName() string

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

func (*OfferEntryExt) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OfferEntryFlags Uses

type OfferEntryFlags int32

OfferEntryFlags is an XDR Enum defines as:

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

func (OfferEntryFlags) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OfferEntryFlags) String Uses

func (e OfferEntryFlags) String() string

String returns the name of `e`

func (*OfferEntryFlags) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (OfferEntryFlags) ValidEnum Uses

func (e OfferEntryFlags) ValidEnum(v int32) bool

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

type Operation Uses

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_STRICT_RECEIVE:
         PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp;
     case MANAGE_SELL_OFFER:
         ManageSellOfferOp manageSellOfferOp;
     case CREATE_PASSIVE_SELL_OFFER:
         CreatePassiveSellOfferOp createPassiveSellOfferOp;
     case SET_OPTIONS:
         SetOptionsOp setOptionsOp;
     case CHANGE_TRUST:
         ChangeTrustOp changeTrustOp;
     case ALLOW_TRUST:
         AllowTrustOp allowTrustOp;
     case ACCOUNT_MERGE:
         AccountID destination;
     case INFLATION:
         void;
     case MANAGE_DATA:
         ManageDataOp manageDataOp;
     case BUMP_SEQUENCE:
         BumpSequenceOp bumpSequenceOp;
     case MANAGE_BUY_OFFER:
         ManageBuyOfferOp manageBuyOfferOp;
     case PATH_PAYMENT_STRICT_SEND:
         PathPaymentStrictSendOp pathPaymentStrictSendOp;
     }
     body;
 };

func (Operation) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Operation) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationBody Uses

type OperationBody struct {
    Type                       OperationType
    CreateAccountOp            *CreateAccountOp
    PaymentOp                  *PaymentOp
    PathPaymentStrictReceiveOp *PathPaymentStrictReceiveOp
    ManageSellOfferOp          *ManageSellOfferOp
    CreatePassiveSellOfferOp   *CreatePassiveSellOfferOp
    SetOptionsOp               *SetOptionsOp
    ChangeTrustOp              *ChangeTrustOp
    AllowTrustOp               *AllowTrustOp
    Destination                *AccountId
    ManageDataOp               *ManageDataOp
    BumpSequenceOp             *BumpSequenceOp
    ManageBuyOfferOp           *ManageBuyOfferOp
    PathPaymentStrictSendOp    *PathPaymentStrictSendOp
}

OperationBody is an XDR NestedUnion defines as:

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

func NewOperationBody Uses

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

NewOperationBody creates a new OperationBody.

func (OperationBody) ArmForSwitch Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (OperationBody) GetCreatePassiveSellOfferOp Uses

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

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

func (OperationBody) GetDestination Uses

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

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

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

func (OperationBody) GetManageDataOp Uses

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

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

func (OperationBody) GetManageSellOfferOp Uses

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

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

func (OperationBody) GetPathPaymentStrictReceiveOp Uses

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

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

func (OperationBody) GetPathPaymentStrictSendOp Uses

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

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

func (OperationBody) GetPaymentOp Uses

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 Uses

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

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

func (OperationBody) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationBody) MustAllowTrustOp Uses

func (u OperationBody) MustAllowTrustOp() AllowTrustOp

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

func (OperationBody) MustBumpSequenceOp Uses

func (u OperationBody) MustBumpSequenceOp() BumpSequenceOp

MustBumpSequenceOp retrieves the BumpSequenceOp value from the union, panicing if the value is not set.

func (OperationBody) MustChangeTrustOp Uses

func (u OperationBody) MustChangeTrustOp() ChangeTrustOp

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

func (OperationBody) MustCreateAccountOp Uses

func (u OperationBody) MustCreateAccountOp() CreateAccountOp

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

func (OperationBody) MustCreatePassiveSellOfferOp Uses

func (u OperationBody) MustCreatePassiveSellOfferOp() CreatePassiveSellOfferOp

MustCreatePassiveSellOfferOp retrieves the CreatePassiveSellOfferOp value from the union, panicing if the value is not set.

func (OperationBody) MustDestination Uses

func (u OperationBody) MustDestination() AccountId

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

func (OperationBody) MustManageBuyOfferOp Uses

func (u OperationBody) MustManageBuyOfferOp() ManageBuyOfferOp

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

func (OperationBody) MustManageDataOp Uses

func (u OperationBody) MustManageDataOp() ManageDataOp

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

func (OperationBody) MustManageSellOfferOp Uses

func (u OperationBody) MustManageSellOfferOp() ManageSellOfferOp

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

func (OperationBody) MustPathPaymentStrictReceiveOp Uses

func (u OperationBody) MustPathPaymentStrictReceiveOp() PathPaymentStrictReceiveOp

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

func (OperationBody) MustPathPaymentStrictSendOp Uses

func (u OperationBody) MustPathPaymentStrictSendOp() PathPaymentStrictSendOp

MustPathPaymentStrictSendOp retrieves the PathPaymentStrictSendOp value from the union, panicing if the value is not set.

func (OperationBody) MustPaymentOp Uses

func (u OperationBody) MustPaymentOp() PaymentOp

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

func (OperationBody) MustSetOptionsOp Uses

func (u OperationBody) MustSetOptionsOp() SetOptionsOp

MustSetOptionsOp retrieves the SetOptionsOp value from the union, panicing if the value is not set.

func (OperationBody) SwitchFieldName Uses

func (u OperationBody) SwitchFieldName() string

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

func (*OperationBody) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationMeta Uses

type OperationMeta struct {
    Changes LedgerEntryChanges
}

OperationMeta is an XDR Struct defines as:

struct OperationMeta
 {
     LedgerEntryChanges changes;
 };

func (OperationMeta) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*OperationMeta) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationResult Uses

type OperationResult struct {
    Code OperationResultCode
    Tr   *OperationResultTr
}

OperationResult is an XDR Union defines as:

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

func NewOperationResult Uses

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

NewOperationResult creates a new OperationResult.

func (OperationResult) ArmForSwitch Uses

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 Uses

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

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

func (OperationResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationResult) MustTr Uses

func (u OperationResult) MustTr() OperationResultTr

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

func (OperationResult) SwitchFieldName Uses

func (u OperationResult) SwitchFieldName() string

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

func (*OperationResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationResultCode Uses

type OperationResultCode int32

OperationResultCode is an XDR Enum defines as:

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

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

func (OperationResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationResultCode) String Uses

func (e OperationResultCode) String() string

String returns the name of `e`

func (*OperationResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (OperationResultCode) ValidEnum Uses

func (e OperationResultCode) ValidEnum(v int32) bool

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

type OperationResultTr Uses

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

OperationResultTr is an XDR NestedUnion defines as:

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

func NewOperationResultTr Uses

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

NewOperationResultTr creates a new OperationResultTr.

func (OperationResultTr) ArmForSwitch Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (OperationResultTr) GetCreatePassiveSellOfferResult Uses

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

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

func (OperationResultTr) GetInflationResult Uses

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

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

func (OperationResultTr) GetManageBuyOfferResult Uses

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

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

func (OperationResultTr) GetManageDataResult Uses

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

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

func (OperationResultTr) GetManageSellOfferResult Uses

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

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

func (OperationResultTr) GetPathPaymentStrictReceiveResult Uses

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

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

func (OperationResultTr) GetPathPaymentStrictSendResult Uses

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

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

func (OperationResultTr) GetPaymentResult Uses

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 Uses

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

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

func (OperationResultTr) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationResultTr) MustAccountMergeResult Uses

func (u OperationResultTr) MustAccountMergeResult() AccountMergeResult

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

func (OperationResultTr) MustAllowTrustResult Uses

func (u OperationResultTr) MustAllowTrustResult() AllowTrustResult

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

func (OperationResultTr) MustBumpSeqResult Uses

func (u OperationResultTr) MustBumpSeqResult() BumpSequenceResult

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

func (OperationResultTr) MustChangeTrustResult Uses

func (u OperationResultTr) MustChangeTrustResult() ChangeTrustResult

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

func (OperationResultTr) MustCreateAccountResult Uses

func (u OperationResultTr) MustCreateAccountResult() CreateAccountResult

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

func (OperationResultTr) MustCreatePassiveSellOfferResult Uses

func (u OperationResultTr) MustCreatePassiveSellOfferResult() ManageSellOfferResult

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

func (OperationResultTr) MustInflationResult Uses

func (u OperationResultTr) MustInflationResult() InflationResult

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

func (OperationResultTr) MustManageBuyOfferResult Uses

func (u OperationResultTr) MustManageBuyOfferResult() ManageBuyOfferResult

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

func (OperationResultTr) MustManageDataResult Uses

func (u OperationResultTr) MustManageDataResult() ManageDataResult

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

func (OperationResultTr) MustManageSellOfferResult Uses

func (u OperationResultTr) MustManageSellOfferResult() ManageSellOfferResult

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

func (OperationResultTr) MustPathPaymentStrictReceiveResult Uses

func (u OperationResultTr) MustPathPaymentStrictReceiveResult() PathPaymentStrictReceiveResult

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

func (OperationResultTr) MustPathPaymentStrictSendResult Uses

func (u OperationResultTr) MustPathPaymentStrictSendResult() PathPaymentStrictSendResult

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

func (OperationResultTr) MustPaymentResult Uses

func (u OperationResultTr) MustPaymentResult() PaymentResult

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

func (OperationResultTr) MustSetOptionsResult Uses

func (u OperationResultTr) MustSetOptionsResult() SetOptionsResult

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

func (OperationResultTr) SwitchFieldName Uses

func (u OperationResultTr) SwitchFieldName() string

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

func (*OperationResultTr) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type OperationType Uses

type OperationType int32

OperationType is an XDR Enum defines as:

enum OperationType
 {
     CREATE_ACCOUNT = 0,
     PAYMENT = 1,
     PATH_PAYMENT_STRICT_RECEIVE = 2,
     MANAGE_SELL_OFFER = 3,
     CREATE_PASSIVE_SELL_OFFER = 4,
     SET_OPTIONS = 5,
     CHANGE_TRUST = 6,
     ALLOW_TRUST = 7,
     ACCOUNT_MERGE = 8,
     INFLATION = 9,
     MANAGE_DATA = 10,
     BUMP_SEQUENCE = 11,
     MANAGE_BUY_OFFER = 12,
     PATH_PAYMENT_STRICT_SEND = 13
 };
const (
    OperationTypeCreateAccount            OperationType = 0
    OperationTypePayment                  OperationType = 1
    OperationTypePathPaymentStrictReceive OperationType = 2
    OperationTypeManageSellOffer          OperationType = 3
    OperationTypeCreatePassiveSellOffer   OperationType = 4
    OperationTypeSetOptions               OperationType = 5
    OperationTypeChangeTrust              OperationType = 6
    OperationTypeAllowTrust               OperationType = 7
    OperationTypeAccountMerge             OperationType = 8
    OperationTypeInflation                OperationType = 9
    OperationTypeManageData               OperationType = 10
    OperationTypeBumpSequence             OperationType = 11
    OperationTypeManageBuyOffer           OperationType = 12
    OperationTypePathPaymentStrictSend    OperationType = 13
)

func (OperationType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (OperationType) String Uses

func (e OperationType) String() string

String returns the name of `e`

func (*OperationType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (OperationType) ValidEnum Uses

func (e OperationType) ValidEnum(v int32) bool

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

type PathPaymentStrictReceiveOp Uses

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

PathPaymentStrictReceiveOp is an XDR Struct defines as:

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

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

func (PathPaymentStrictReceiveOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PathPaymentStrictReceiveOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictReceiveResult Uses

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

PathPaymentStrictReceiveResult is an XDR Union defines as:

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

func NewPathPaymentStrictReceiveResult Uses

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

NewPathPaymentStrictReceiveResult creates a new PathPaymentStrictReceiveResult.

func (PathPaymentStrictReceiveResult) ArmForSwitch Uses

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

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

func (PathPaymentStrictReceiveResult) GetNoIssuer Uses

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

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

func (PathPaymentStrictReceiveResult) GetSuccess Uses

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

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

func (PathPaymentStrictReceiveResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PathPaymentStrictReceiveResult) MustNoIssuer Uses

func (u PathPaymentStrictReceiveResult) MustNoIssuer() Asset

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

func (PathPaymentStrictReceiveResult) MustSuccess Uses

func (u PathPaymentStrictReceiveResult) MustSuccess() PathPaymentStrictReceiveResultSuccess

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

func (*PathPaymentStrictReceiveResult) SendAmount Uses

func (pr *PathPaymentStrictReceiveResult) SendAmount() Int64

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

func (PathPaymentStrictReceiveResult) SwitchFieldName Uses

func (u PathPaymentStrictReceiveResult) SwitchFieldName() string

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

func (*PathPaymentStrictReceiveResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictReceiveResultCode Uses

type PathPaymentStrictReceiveResultCode int32

PathPaymentStrictReceiveResultCode is an XDR Enum defines as:

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

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

func (PathPaymentStrictReceiveResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PathPaymentStrictReceiveResultCode) String Uses

func (e PathPaymentStrictReceiveResultCode) String() string

String returns the name of `e`

func (*PathPaymentStrictReceiveResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PathPaymentStrictReceiveResultCode) ValidEnum Uses

func (e PathPaymentStrictReceiveResultCode) ValidEnum(v int32) bool

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

type PathPaymentStrictReceiveResultSuccess Uses

type PathPaymentStrictReceiveResultSuccess struct {
    Offers []ClaimOfferAtom
    Last   SimplePaymentResult
}

PathPaymentStrictReceiveResultSuccess is an XDR NestedStruct defines as:

struct
     {
         ClaimOfferAtom offers<>;
         SimplePaymentResult last;
     }

func (PathPaymentStrictReceiveResultSuccess) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PathPaymentStrictReceiveResultSuccess) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictSendOp Uses

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

PathPaymentStrictSendOp is an XDR Struct defines as:

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

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

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

func (PathPaymentStrictSendOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PathPaymentStrictSendOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictSendResult Uses

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

PathPaymentStrictSendResult is an XDR Union defines as:

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

func NewPathPaymentStrictSendResult Uses

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

NewPathPaymentStrictSendResult creates a new PathPaymentStrictSendResult.

func (PathPaymentStrictSendResult) ArmForSwitch Uses

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

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

func (*PathPaymentStrictSendResult) DestAmount Uses

func (pr *PathPaymentStrictSendResult) DestAmount() Int64

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

func (PathPaymentStrictSendResult) GetNoIssuer Uses

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

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

func (PathPaymentStrictSendResult) GetSuccess Uses

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

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

func (PathPaymentStrictSendResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PathPaymentStrictSendResult) MustNoIssuer Uses

func (u PathPaymentStrictSendResult) MustNoIssuer() Asset

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

func (PathPaymentStrictSendResult) MustSuccess Uses

func (u PathPaymentStrictSendResult) MustSuccess() PathPaymentStrictSendResultSuccess

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

func (PathPaymentStrictSendResult) SwitchFieldName Uses

func (u PathPaymentStrictSendResult) SwitchFieldName() string

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

func (*PathPaymentStrictSendResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PathPaymentStrictSendResultCode Uses

type PathPaymentStrictSendResultCode int32

PathPaymentStrictSendResultCode is an XDR Enum defines as:

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

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

func (PathPaymentStrictSendResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PathPaymentStrictSendResultCode) String Uses

func (e PathPaymentStrictSendResultCode) String() string

String returns the name of `e`

func (*PathPaymentStrictSendResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PathPaymentStrictSendResultCode) ValidEnum Uses

func (e PathPaymentStrictSendResultCode) ValidEnum(v int32) bool

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

type PathPaymentStrictSendResultSuccess Uses

type PathPaymentStrictSendResultSuccess struct {
    Offers []ClaimOfferAtom
    Last   SimplePaymentResult
}

PathPaymentStrictSendResultSuccess is an XDR NestedStruct defines as:

struct
     {
         ClaimOfferAtom offers<>;
         SimplePaymentResult last;
     }

func (PathPaymentStrictSendResultSuccess) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PathPaymentStrictSendResultSuccess) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PaymentOp Uses

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

func (PaymentOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PaymentOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PaymentResult Uses

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 Uses

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

NewPaymentResult creates a new PaymentResult.

func (PaymentResult) ArmForSwitch Uses

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

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

func (PaymentResult) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PaymentResult) SwitchFieldName Uses

func (u PaymentResult) SwitchFieldName() string

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

func (*PaymentResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PaymentResultCode Uses

type PaymentResultCode int32

PaymentResultCode is an XDR Enum defines as:

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

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

func (PaymentResultCode) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PaymentResultCode) String Uses

func (e PaymentResultCode) String() string

String returns the name of `e`

func (*PaymentResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PaymentResultCode) ValidEnum Uses

func (e PaymentResultCode) ValidEnum(v int32) bool

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

type PeerAddress Uses

type PeerAddress struct {
    Ip          PeerAddressIp
    Port        Uint32
    NumFailures Uint32
}

PeerAddress is an XDR Struct defines as:

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

func (PeerAddress) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*PeerAddress) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PeerAddressIp Uses

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 Uses

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

NewPeerAddressIp creates a new PeerAddressIp.

func (PeerAddressIp) ArmForSwitch Uses

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 Uses

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 Uses

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

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

func (PeerAddressIp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PeerAddressIp) MustIpv4 Uses

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

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

func (PeerAddressIp) MustIpv6 Uses

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

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

func (PeerAddressIp) SwitchFieldName Uses

func (u PeerAddressIp) SwitchFieldName() string

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

func (*PeerAddressIp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Price Uses

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 Uses

func (p *Price) Invert()

Invert inverts Price.

func (Price) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Price) Scan Uses

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

Scan reads from a src into an xdr.Price

func (*Price) String Uses

func (p *Price) String() string

String returns a string represenation of `p`

func (*Price) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PublicKey Uses

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 Uses

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

NewPublicKey creates a new PublicKey.

func (PublicKey) ArmForSwitch Uses

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 Uses

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

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

func (PublicKey) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PublicKey) MustEd25519 Uses

func (u PublicKey) MustEd25519() Uint256

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

func (PublicKey) SwitchFieldName Uses

func (u PublicKey) SwitchFieldName() string

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

func (*PublicKey) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type PublicKeyType Uses

type PublicKeyType int32

PublicKeyType is an XDR Enum defines as:

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

func (PublicKeyType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (PublicKeyType) String Uses

func (e PublicKeyType) String() string

String returns the name of `e`

func (*PublicKeyType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (PublicKeyType) ValidEnum Uses

func (e PublicKeyType) ValidEnum(v int32) bool

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

type ScpBallot Uses

type ScpBallot struct {
    Counter Uint32
    Value   Value
}

ScpBallot is an XDR Struct defines as:

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

func (ScpBallot) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpBallot) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpEnvelope Uses

type ScpEnvelope struct {
    Statement ScpStatement
    Signature Signature
}

ScpEnvelope is an XDR Struct defines as:

struct SCPEnvelope
 {
     SCPStatement statement;
     Signature signature;
 };

func (ScpEnvelope) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpEnvelope) Scan Uses

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

Scan reads from src into an ScpEnvelope struct

func (*ScpEnvelope) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpHistoryEntry Uses

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 Uses

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

NewScpHistoryEntry creates a new ScpHistoryEntry.

func (ScpHistoryEntry) ArmForSwitch Uses

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 Uses

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

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

func (ScpHistoryEntry) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ScpHistoryEntry) MustV0 Uses

func (u ScpHistoryEntry) MustV0() ScpHistoryEntryV0

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

func (ScpHistoryEntry) SwitchFieldName Uses

func (u ScpHistoryEntry) SwitchFieldName() string

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

func (*ScpHistoryEntry) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpHistoryEntryV0 Uses

type ScpHistoryEntryV0 struct {
    QuorumSets     []ScpQuorumSet
    LedgerMessages LedgerScpMessages
}

ScpHistoryEntryV0 is an XDR Struct defines as:

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

func (ScpHistoryEntryV0) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpHistoryEntryV0) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpNomination Uses

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

ScpNomination is an XDR Struct defines as:

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

func (ScpNomination) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpNomination) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpQuorumSet Uses

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

ScpQuorumSet is an XDR Struct defines as:

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

func (ScpQuorumSet) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpQuorumSet) Scan Uses

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

Scan reads from src into an ScpEnvelope struct

func (*ScpQuorumSet) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatement Uses

type ScpStatement struct {
    NodeId    NodeId
    SlotIndex Uint64
    Pledges   ScpStatementPledges
}

ScpStatement is an XDR Struct defines as:

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

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

func (ScpStatement) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpStatement) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementConfirm Uses

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

ScpStatementConfirm is an XDR NestedStruct defines as:

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

func (ScpStatementConfirm) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpStatementConfirm) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementExternalize Uses

type ScpStatementExternalize struct {
    Commit              ScpBallot
    NH                  Uint32
    CommitQuorumSetHash Hash
}

ScpStatementExternalize is an XDR NestedStruct defines as:

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

func (ScpStatementExternalize) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpStatementExternalize) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementPledges Uses

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 Uses

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

NewScpStatementPledges creates a new ScpStatementPledges.

func (ScpStatementPledges) ArmForSwitch Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

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

func (ScpStatementPledges) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ScpStatementPledges) MustConfirm Uses

func (u ScpStatementPledges) MustConfirm() ScpStatementConfirm

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

func (ScpStatementPledges) MustExternalize Uses

func (u ScpStatementPledges) MustExternalize() ScpStatementExternalize

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

func (ScpStatementPledges) MustNominate Uses

func (u ScpStatementPledges) MustNominate() ScpNomination

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

func (ScpStatementPledges) MustPrepare Uses

func (u ScpStatementPledges) MustPrepare() ScpStatementPrepare

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

func (ScpStatementPledges) SwitchFieldName Uses

func (u ScpStatementPledges) SwitchFieldName() string

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

func (*ScpStatementPledges) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementPrepare Uses

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

ScpStatementPrepare is an XDR NestedStruct defines as:

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

func (ScpStatementPrepare) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*ScpStatementPrepare) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type ScpStatementType Uses

type ScpStatementType int32

ScpStatementType is an XDR Enum defines as:

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

func (ScpStatementType) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (ScpStatementType) String Uses

func (e ScpStatementType) String() string

String returns the name of `e`

func (*ScpStatementType) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ScpStatementType) ValidEnum Uses

func (e ScpStatementType) ValidEnum(v int32) bool

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

type SequenceNumber Uses

type SequenceNumber Int64

SequenceNumber is an XDR Typedef defines as:

typedef int64 SequenceNumber;

func (SequenceNumber) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*SequenceNumber) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type SetOptionsOp Uses

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

SetOptionsOp is an XDR Struct defines as:

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

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

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

     string32* homeDomain; // sets the home domain

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

func (SetOptionsOp) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*SetOptionsOp) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type SetOptionsResult Uses

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 Uses

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

NewSetOptionsResult creates a new SetOptionsResult.

func (SetOptionsResult) ArmForSwitch Uses

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

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

MarshalBinary implements encoding.BinaryMarshaler.

func (SetOptionsResult) SwitchFieldName Uses

func (u SetOptionsResult) SwitchFieldName() string

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

func (*SetOptionsResult) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type SetOptionsResultCode Uses

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

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

MarshalBinary implements encoding.BinaryMarshaler.

func (SetOptionsResultCode) String Uses

func (e SetOptionsResultCode) String() string

String returns the name of `e`

func (*SetOptionsResultCode) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (SetOptionsResultCode) ValidEnum Uses

func (e SetOptionsResultCode) ValidEnum(v int32) bool

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

type Signature Uses

type Signature []byte

Signature is an XDR Typedef defines as:

typedef opaque Signature<64>;

func (Signature) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Signature) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (Signature) XDRMaxSize Uses

func (e Signature) XDRMaxSize() int

XDRMaxSize implements the Sized interface for Signature

type SignatureHint Uses

type SignatureHint [4]byte

SignatureHint is an XDR Typedef defines as:

typedef opaque SignatureHint[4];

func (SignatureHint) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*SignatureHint) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (SignatureHint) XDRMaxSize Uses

func (e SignatureHint) XDRMaxSize() int

XDRMaxSize implements the Sized interface for SignatureHint

type Signer Uses

type Signer struct {
    Key    SignerKey
    Weight Uint32
}

Signer is an XDR Struct defines as:

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

func SortSignersByKey Uses

func SortSignersByKey(signers []Signer) []Signer

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

func (Signer) MarshalBinary Uses

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

MarshalBinary implements encoding.BinaryMarshaler.

func (*Signer) UnmarshalBinary Uses

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

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type SignerKey Uses

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:
     /* SHA-256 Hash of TransactionSignaturePayload structure */
     uint256 preAuthTx;
 case SIGNER_KEY_TYPE_HASH_X:
     /* Hash of random 256 bit preimage X */
     uint256 hashX;
 };

func MustSigner Uses

func MustSigner(address string) SignerKey

func NewSignerKey Uses

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

NewSignerKey creates a new SignerKey.

func (*SignerKey) Address Uses

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 Uses

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 Uses

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

Equals returns true if `other` is equivalent to `skey`

func (SignerKey) GetEd25519 Uses

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 Uses

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 Uses

func (u SignerKey) GetPreAuthTx() (result Uint256, ok bool)

GetPreAuthTx retrieves the PreAuthTx value from the union, returning ok if the union's switch indicated the value is valid.

func (SignerKey) MarshalBinary Uses

func (s SignerKey) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (SignerKey) MustEd25519 Uses

func (u SignerKey) MustEd25519() Uint256

MustEd25519 retrieves the Ed25519 value from the union, panicing if the value is not set.

func (SignerKey) MustHashX Uses

func (u SignerKey) MustHashX() Uint256

MustHashX retrieves the HashX value from the union, panicing if the value is not set.

func (SignerKey) MustPreAuthTx Uses

func (u SignerKey) MustPreAuthTx() Uint256

MustPreAuthTx retrieves the PreAuthTx value from the union, panicing if the value is not set.

func (*SignerKey) SetAddress Uses

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 Uses

func (u SignerKey) SwitchFieldName() string

SwitchFieldName returns the field name in which this union's discriminant is stored

func (*SignerKey) UnmarshalBinary Uses

func (s *SignerKey) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type SignerKeyType Uses

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) MarshalBinary Uses

func (s SignerKeyType) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (SignerKeyType) String Uses

func (e SignerKeyType) String() string

String returns the name of `e`

func (*SignerKeyType) UnmarshalBinary Uses

func (s *SignerKeyType) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (SignerKeyType) ValidEnum Uses

func (e SignerKeyType) ValidEnum(v int32) bool

ValidEnum validates a proposed value for this enum. Implements the Enum interface for SignerKeyType

type SimplePaymentResult Uses

type SimplePaymentResult struct {
    Destination AccountId
    Asset       Asset
    Amount      Int64
}

SimplePaymentResult is an XDR Struct defines as:

struct SimplePaymentResult
 {
     AccountID destination;
     Asset asset;
     int64 amount;
 };

func (SimplePaymentResult) MarshalBinary Uses

func (s SimplePaymentResult) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*SimplePaymentResult) UnmarshalBinary Uses

func (s *SimplePaymentResult) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type StellarMessage Uses

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 Uses

func NewStellarMessage(aType MessageType, value interface{}) (result StellarMessage, err error)

NewStellarMessage creates a new StellarMessage.

func (StellarMessage) ArmForSwitch Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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) MarshalBinary Uses

func (s StellarMessage) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (StellarMessage) MustAuth Uses

func (u StellarMessage) MustAuth() Auth

MustAuth retrieves the Auth value from the union, panicing if the value is not set.

func (StellarMessage) MustDontHave Uses

func (u StellarMessage) MustDontHave() DontHave

MustDontHave retrieves the DontHave value from the union, panicing if the value is not set.

func (StellarMessage) MustEnvelope Uses

func (u StellarMessage) MustEnvelope() ScpEnvelope

MustEnvelope retrieves the Envelope value from the union, panicing if the value is not set.

func (StellarMessage) MustError Uses

func (u StellarMessage) MustError() Error

MustError retrieves the Error value from the union, panicing if the value is not set.

func (StellarMessage) MustGetScpLedgerSeq Uses

func (u StellarMessage) MustGetScpLedgerSeq() Uint32

MustGetScpLedgerSeq retrieves the GetScpLedgerSeq value from the union, panicing if the value is not set.

func (StellarMessage) MustHello Uses

func (u StellarMessage) MustHello() Hello

MustHello retrieves the Hello value from the union, panicing if the value is not set.

func (StellarMessage) MustPeers Uses

func (u StellarMessage) MustPeers() []PeerAddress

MustPeers retrieves the Peers value from the union, panicing if the value is not set.

func (StellarMessage) MustQSet Uses

func (u StellarMessage) MustQSet() ScpQuorumSet

MustQSet retrieves the QSet value from the union, panicing if the value is not set.

func (StellarMessage) MustQSetHash Uses

func (u StellarMessage) MustQSetHash() Uint256

MustQSetHash retrieves the QSetHash value from the union, panicing if the value is not set.

func (StellarMessage) MustTransaction Uses

func (u StellarMessage) MustTransaction() TransactionEnvelope

MustTransaction retrieves the Transaction value from the union, panicing if the value is not set.

func (StellarMessage) MustTxSet Uses

func (u StellarMessage) MustTxSet() TransactionSet

MustTxSet retrieves the TxSet value from the union, panicing if the value is not set.

func (StellarMessage) MustTxSetHash Uses

func (u StellarMessage) MustTxSetHash() Uint256

MustTxSetHash retrieves the TxSetHash value from the union, panicing if the value is not set.

func (StellarMessage) SwitchFieldName Uses

func (u StellarMessage) SwitchFieldName() string

SwitchFieldName returns the field name in which this union's discriminant is stored

func (*StellarMessage) UnmarshalBinary Uses

func (s *StellarMessage) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type StellarValue Uses

type StellarValue struct {
    TxSetHash Hash
    CloseTime TimePoint
    Upgrades  []UpgradeType `xdrmaxsize:"6"`
    Ext       StellarValueExt
}

StellarValue is an XDR Struct defines as:

struct StellarValue
 {
     Hash txSetHash;      // transaction set to apply to previous ledger
     TimePoint 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 (StellarValueType v)
     {
     case STELLAR_VALUE_BASIC:
         void;
     case STELLAR_VALUE_SIGNED:
         LedgerCloseValueSignature lcValueSignature;
     }
     ext;
 };

func (StellarValue) MarshalBinary Uses

func (s StellarValue) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*StellarValue) UnmarshalBinary Uses

func (s *StellarValue) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type StellarValueExt Uses

type StellarValueExt struct {
    V                StellarValueType
    LcValueSignature *LedgerCloseValueSignature
}

StellarValueExt is an XDR NestedUnion defines as:

union switch (StellarValueType v)
     {
     case STELLAR_VALUE_BASIC:
         void;
     case STELLAR_VALUE_SIGNED:
         LedgerCloseValueSignature lcValueSignature;
     }

func NewStellarValueExt Uses

func NewStellarValueExt(v StellarValueType, value interface{}) (result StellarValueExt, err error)

NewStellarValueExt creates a new StellarValueExt.

func (StellarValueExt) ArmForSwitch Uses

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) GetLcValueSignature Uses

func (u StellarValueExt) GetLcValueSignature() (result LedgerCloseValueSignature, ok bool)

GetLcValueSignature retrieves the LcValueSignature value from the union, returning ok if the union's switch indicated the value is valid.

func (StellarValueExt) MarshalBinary Uses

func (s StellarValueExt) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (StellarValueExt) MustLcValueSignature Uses

func (u StellarValueExt) MustLcValueSignature() LedgerCloseValueSignature

MustLcValueSignature retrieves the LcValueSignature value from the union, panicing if the value is not set.

func (StellarValueExt) SwitchFieldName Uses

func (u StellarValueExt) SwitchFieldName() string

SwitchFieldName returns the field name in which this union's discriminant is stored

func (*StellarValueExt) UnmarshalBinary Uses

func (s *StellarValueExt) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type StellarValueType Uses

type StellarValueType int32

StellarValueType is an XDR Enum defines as:

enum StellarValueType
 {
     STELLAR_VALUE_BASIC = 0,
     STELLAR_VALUE_SIGNED = 1
 };
const (
    StellarValueTypeStellarValueBasic  StellarValueType = 0
    StellarValueTypeStellarValueSigned StellarValueType = 1
)

func (StellarValueType) MarshalBinary Uses

func (s StellarValueType) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (StellarValueType) String Uses

func (e StellarValueType) String() string

String returns the name of `e`

func (*StellarValueType) UnmarshalBinary Uses

func (s *StellarValueType) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (StellarValueType) ValidEnum Uses

func (e StellarValueType) ValidEnum(v int32) bool

ValidEnum validates a proposed value for this enum. Implements the Enum interface for StellarValueType

type String32 Uses

type String32 string

String32 is an XDR Typedef defines as:

typedef string string32<32>;

func (String32) MarshalBinary Uses

func (s String32) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*String32) UnmarshalBinary Uses

func (s *String32) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (String32) XDRMaxSize Uses

func (e String32) XDRMaxSize() int

XDRMaxSize implements the Sized interface for String32

type String64 Uses

type String64 string

String64 is an XDR Typedef defines as:

typedef string string64<64>;

func (String64) MarshalBinary Uses

func (s String64) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*String64) UnmarshalBinary Uses

func (s *String64) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (String64) XDRMaxSize Uses

func (e String64) XDRMaxSize() int

XDRMaxSize implements the Sized interface for String64

type ThresholdIndexes Uses

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) MarshalBinary Uses

func (s ThresholdIndexes) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (ThresholdIndexes) String Uses

func (e ThresholdIndexes) String() string

String returns the name of `e`

func (*ThresholdIndexes) UnmarshalBinary Uses

func (s *ThresholdIndexes) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (ThresholdIndexes) ValidEnum Uses

func (e ThresholdIndexes) ValidEnum(v int32) bool

ValidEnum validates a proposed value for this enum. Implements the Enum interface for ThresholdIndexes

type Thresholds Uses

type Thresholds [4]byte

Thresholds is an XDR Typedef defines as:

typedef opaque Thresholds[4];

func (Thresholds) MarshalBinary Uses

func (s Thresholds) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*Thresholds) Scan Uses

func (t *Thresholds) Scan(src interface{}) error

Scan reads from src into an Thresholds struct

func (*Thresholds) UnmarshalBinary Uses

func (s *Thresholds) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (Thresholds) XDRMaxSize Uses

func (e Thresholds) XDRMaxSize() int

XDRMaxSize implements the Sized interface for Thresholds

type TimeBounds Uses

type TimeBounds struct {
    MinTime TimePoint
    MaxTime TimePoint
}

TimeBounds is an XDR Struct defines as:

struct TimeBounds
 {
     TimePoint minTime;
     TimePoint maxTime; // 0 here means no maxTime
 };

func (TimeBounds) MarshalBinary Uses

func (s TimeBounds) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*TimeBounds) UnmarshalBinary Uses

func (s *TimeBounds) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TimePoint Uses

type TimePoint Uint64

TimePoint is an XDR Typedef defines as:

typedef uint64 TimePoint;

func (TimePoint) MarshalBinary Uses

func (s TimePoint) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*TimePoint) UnmarshalBinary Uses

func (s *TimePoint) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type Transaction Uses

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<MAX_OPS_PER_TX>;

     // reserved for future use
     union switch (int v)
     {
     case 0:
         void;
     }
     ext;
 };

func (Transaction) MarshalBinary Uses

func (s Transaction) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*Transaction) UnmarshalBinary Uses

func (s *Transaction) UnmarshalBinary(inp []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

type TransactionEnvelope Uses

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) MarshalBinary Uses

func (s TransactionEnvelope) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler.

func (*TransactionEnvelope) Scan Uses