model

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KinVersion_name = map[int32]string{
	0: "UNKNOWN",
	1: "RESERVED",
	2: "KIN2",
	3: "KIN3",
	4: "KIN4",
}
View Source
var KinVersion_value = map[string]int32{
	"UNKNOWN":  0,
	"RESERVED": 1,
	"KIN2":     2,
	"KIN3":     3,
	"KIN4":     4,
}

Functions

func BlockFromOrderingKey added in v0.2.7

func BlockFromOrderingKey(k []byte) (uint64, error)

func GetAccountsFromEnvelope

func GetAccountsFromEnvelope(env xdr.TransactionEnvelope) (map[string]struct{}, error)

GetAccountsFromEnvelope returns the set of accounts involved in a transaction contained within a transaction envelope.

func GetAccountsFromTransaction added in v0.2.3

func GetAccountsFromTransaction(txn solana.Transaction) (map[string]struct{}, error)

func OrderingKeyFromBlock added in v0.2.6

func OrderingKeyFromBlock(block uint64, max bool) []byte

func OrderingKeyFromCursor

func OrderingKeyFromCursor(v KinVersion, cursor string) ([]byte, error)

Types

type Entry

type Entry struct {
	Version KinVersion `protobuf:"varint,1,opt,name=version,proto3,enum=KinVersion" json:"version,omitempty"`
	// Types that are valid to be assigned to Kind:
	//	*Entry_Stellar
	//	*Entry_Solana
	Kind                 isEntry_Kind `protobuf_oneof:"kind"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

Entry is a generalized history entry that contains a blockchain transaction, as well as the KinVersion the transaction is for.

This allows for the generalization of a history store, which allows for a continuous view of history across blockchains.

func (*Entry) Descriptor

func (*Entry) Descriptor() ([]byte, []int)

func (*Entry) GetAccounts

func (m *Entry) GetAccounts() ([]string, error)

func (*Entry) GetKind

func (m *Entry) GetKind() isEntry_Kind

func (*Entry) GetOrderingKey

func (m *Entry) GetOrderingKey() ([]byte, error)

func (*Entry) GetSolana added in v0.2.3

func (m *Entry) GetSolana() *SolanaEntry

func (*Entry) GetStellar

func (m *Entry) GetStellar() *StellarEntry

func (*Entry) GetTxID added in v0.2.3

func (m *Entry) GetTxID() ([]byte, error)

func (*Entry) GetVersion

func (m *Entry) GetVersion() KinVersion

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) Reset

func (m *Entry) Reset()

func (*Entry) String

func (m *Entry) String() string

func (*Entry) Validate

func (m *Entry) Validate() error

Validate checks the field values on Entry with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*Entry) XXX_DiscardUnknown

func (m *Entry) XXX_DiscardUnknown()

func (*Entry) XXX_Marshal

func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Entry) XXX_Merge

func (m *Entry) XXX_Merge(src proto.Message)

func (*Entry) XXX_OneofWrappers

func (*Entry) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Entry) XXX_Size

func (m *Entry) XXX_Size() int

func (*Entry) XXX_Unmarshal

func (m *Entry) XXX_Unmarshal(b []byte) error

type EntryValidationError

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

EntryValidationError is the validation error returned by Entry.Validate if the designated constraints aren't met.

func (EntryValidationError) Cause

func (e EntryValidationError) Cause() error

Cause function returns cause value.

func (EntryValidationError) Error

func (e EntryValidationError) Error() string

Error satisfies the builtin error interface

func (EntryValidationError) ErrorName

func (e EntryValidationError) ErrorName() string

ErrorName returns error name.

func (EntryValidationError) Field

func (e EntryValidationError) Field() string

Field function returns field value.

func (EntryValidationError) Key

func (e EntryValidationError) Key() bool

Key function returns key value.

func (EntryValidationError) Reason

func (e EntryValidationError) Reason() string

Reason function returns reason value.

type Entry_Solana added in v0.2.3

type Entry_Solana struct {
	Solana *SolanaEntry `protobuf:"bytes,3,opt,name=solana,proto3,oneof"`
}

type Entry_Stellar

type Entry_Stellar struct {
	Stellar *StellarEntry `protobuf:"bytes,2,opt,name=stellar,proto3,oneof"`
}

type KinVersion

type KinVersion int32
const (
	KinVersion_UNKNOWN  KinVersion = 0
	KinVersion_RESERVED KinVersion = 1
	KinVersion_KIN2     KinVersion = 2
	KinVersion_KIN3     KinVersion = 3
	KinVersion_KIN4     KinVersion = 4
)

func (KinVersion) EnumDescriptor

func (KinVersion) EnumDescriptor() ([]byte, []int)

func (KinVersion) String

func (x KinVersion) String() string

type SolanaEntry added in v0.2.3

type SolanaEntry struct {
	Slot      uint64 `protobuf:"varint,1,opt,name=slot,proto3" json:"slot,omitempty"`
	Confirmed bool   `protobuf:"varint,2,opt,name=confirmed,proto3" json:"confirmed,omitempty"`
	// Maximum size taken from: https://github.com/solana-labs/solana/blob/39b3ac6a8d29e14faa1de73d8b46d390ad41797b/sdk/src/packet.rs#L9-L13
	Transaction []byte `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"`
	// Optional value represented by 'TransactionError' type returned
	// from the Solana RPCs.
	TransactionError []byte `protobuf:"bytes,4,opt,name=transaction_error,json=transactionError,proto3" json:"transaction_error,omitempty"`
	// Optional estimated block time of the transaction.
	//
	// This isn't mandatory since we may not always have information
	// on the timestamp. Notably:
	//
	//   1. If the entry hasn't been confirmed yet, getBlockTime() won't work.
	//   2. If the block is older than the RPC node's timestamp history.
	//
	// In case (1), we expect that the block time will be updated once it is confirmed.
	// In case (2), it either means an ingestor has fallen extremely behind, or the RPC
	// node has had some issue loosing history. In the latter case, we'd want to try and
	// repair the timestamps from another node.
	//
	// Since we do _not_ want to prevent the ingestion of transactions (by requiring block_time),
	// we make it optional.
	BlockTime            *timestamp.Timestamp `protobuf:"bytes,5,opt,name=block_time,json=blockTime,proto3" json:"block_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*SolanaEntry) Descriptor added in v0.2.3

func (*SolanaEntry) Descriptor() ([]byte, []int)

func (*SolanaEntry) GetBlockTime added in v0.2.6

func (m *SolanaEntry) GetBlockTime() *timestamp.Timestamp

func (*SolanaEntry) GetConfirmed added in v0.2.3

func (m *SolanaEntry) GetConfirmed() bool

func (*SolanaEntry) GetSlot added in v0.2.3

func (m *SolanaEntry) GetSlot() uint64

func (*SolanaEntry) GetTransaction added in v0.2.3

func (m *SolanaEntry) GetTransaction() []byte

func (*SolanaEntry) GetTransactionError added in v0.2.3

func (m *SolanaEntry) GetTransactionError() []byte

func (*SolanaEntry) ProtoMessage added in v0.2.3

func (*SolanaEntry) ProtoMessage()

func (*SolanaEntry) Reset added in v0.2.3

func (m *SolanaEntry) Reset()

func (*SolanaEntry) String added in v0.2.3

func (m *SolanaEntry) String() string

func (*SolanaEntry) Validate added in v0.2.3

func (m *SolanaEntry) Validate() error

Validate checks the field values on SolanaEntry with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*SolanaEntry) XXX_DiscardUnknown added in v0.2.3

func (m *SolanaEntry) XXX_DiscardUnknown()

func (*SolanaEntry) XXX_Marshal added in v0.2.3

func (m *SolanaEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SolanaEntry) XXX_Merge added in v0.2.3

func (m *SolanaEntry) XXX_Merge(src proto.Message)

func (*SolanaEntry) XXX_Size added in v0.2.3

func (m *SolanaEntry) XXX_Size() int

func (*SolanaEntry) XXX_Unmarshal added in v0.2.3

func (m *SolanaEntry) XXX_Unmarshal(b []byte) error

type SolanaEntryValidationError added in v0.2.3

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

SolanaEntryValidationError is the validation error returned by SolanaEntry.Validate if the designated constraints aren't met.

func (SolanaEntryValidationError) Cause added in v0.2.3

Cause function returns cause value.

func (SolanaEntryValidationError) Error added in v0.2.3

Error satisfies the builtin error interface

func (SolanaEntryValidationError) ErrorName added in v0.2.3

func (e SolanaEntryValidationError) ErrorName() string

ErrorName returns error name.

func (SolanaEntryValidationError) Field added in v0.2.3

Field function returns field value.

func (SolanaEntryValidationError) Key added in v0.2.3

Key function returns key value.

func (SolanaEntryValidationError) Reason added in v0.2.3

Reason function returns reason value.

type SortableEntries added in v0.2.3

type SortableEntries []*Entry

func (SortableEntries) Len added in v0.2.3

func (s SortableEntries) Len() int

Len is the number of elements in the collection.

func (SortableEntries) Less added in v0.2.3

func (s SortableEntries) Less(i int, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (SortableEntries) Swap added in v0.2.3

func (s SortableEntries) Swap(i int, j int)

Swap swaps the elements with indexes i and j.

type StellarEntry

type StellarEntry struct {
	Ledger               uint64               `protobuf:"varint,1,opt,name=ledger,proto3" json:"ledger,omitempty"`
	PagingToken          uint64               `protobuf:"varint,2,opt,name=paging_token,json=pagingToken,proto3" json:"paging_token,omitempty"`
	LedgerCloseTime      *timestamp.Timestamp `protobuf:"bytes,3,opt,name=ledger_close_time,json=ledgerCloseTime,proto3" json:"ledger_close_time,omitempty"`
	NetworkPassphrase    string               `protobuf:"bytes,4,opt,name=network_passphrase,json=networkPassphrase,proto3" json:"network_passphrase,omitempty"`
	EnvelopeXdr          []byte               `protobuf:"bytes,5,opt,name=envelope_xdr,json=envelopeXdr,proto3" json:"envelope_xdr,omitempty"`
	ResultXdr            []byte               `protobuf:"bytes,6,opt,name=result_xdr,json=resultXdr,proto3" json:"result_xdr,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*StellarEntry) Descriptor

func (*StellarEntry) Descriptor() ([]byte, []int)

func (*StellarEntry) GetEnvelopeXdr

func (m *StellarEntry) GetEnvelopeXdr() []byte

func (*StellarEntry) GetLedger

func (m *StellarEntry) GetLedger() uint64

func (*StellarEntry) GetLedgerCloseTime

func (m *StellarEntry) GetLedgerCloseTime() *timestamp.Timestamp

func (*StellarEntry) GetNetworkPassphrase

func (m *StellarEntry) GetNetworkPassphrase() string

func (*StellarEntry) GetPagingToken

func (m *StellarEntry) GetPagingToken() uint64

func (*StellarEntry) GetResultXdr

func (m *StellarEntry) GetResultXdr() []byte

func (*StellarEntry) ProtoMessage

func (*StellarEntry) ProtoMessage()

func (*StellarEntry) Reset

func (m *StellarEntry) Reset()

func (*StellarEntry) String

func (m *StellarEntry) String() string

func (*StellarEntry) Validate

func (m *StellarEntry) Validate() error

Validate checks the field values on StellarEntry with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*StellarEntry) XXX_DiscardUnknown

func (m *StellarEntry) XXX_DiscardUnknown()

func (*StellarEntry) XXX_Marshal

func (m *StellarEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StellarEntry) XXX_Merge

func (m *StellarEntry) XXX_Merge(src proto.Message)

func (*StellarEntry) XXX_Size

func (m *StellarEntry) XXX_Size() int

func (*StellarEntry) XXX_Unmarshal

func (m *StellarEntry) XXX_Unmarshal(b []byte) error

type StellarEntryValidationError

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

StellarEntryValidationError is the validation error returned by StellarEntry.Validate if the designated constraints aren't met.

func (StellarEntryValidationError) Cause

Cause function returns cause value.

func (StellarEntryValidationError) Error

Error satisfies the builtin error interface

func (StellarEntryValidationError) ErrorName

func (e StellarEntryValidationError) ErrorName() string

ErrorName returns error name.

func (StellarEntryValidationError) Field

Field function returns field value.

func (StellarEntryValidationError) Key

Key function returns key value.

func (StellarEntryValidationError) Reason

Reason function returns reason value.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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