Documentation ¶
Overview ¶
Package data contains generated code for schema 'public'.
Index ¶
- func DecodeAccountID(raw AccountID) (string, []byte, error)
- func DecodePublicKey(raw PublicKey) (string, []byte, error)
- func DecodeSorting(rawSort *string, columns map[string]string) (string, bool, error)
- func GetOrDefaultStr(str string, def string) string
- func GetOrDefaultStrPtr(str *string, def *string) *string
- func GetOrDefaultUint64Ptr(value *uint64, def *uint64) *uint64
- func MustDBHash(in string) []byte
- func NotNilStrPtr(str *string) bool
- type AccountID
- type Approval
- type ApprovalQ
- type Chain
- type ChainsQ
- type Collection
- type CollectionChainMapping
- type CollectionChainMappingQ
- type CollectionQ
- type Confirmation
- type ConfirmationQ
- type Cursor
- type GorpMigration
- type GorpMigrationQ
- type IndexConfig
- type Int256
- type Item
- type ItemChainMapping
- type ItemChainMappingQ
- type ItemQ
- type ItemsSelector
- type KeyValue
- type KeyValueQ
- type Nft
- type NftAttribute
- type NftMetadata
- type PublicKey
- type Rejection
- type RejectionQ
- type SeedQ
- type Storage
- type StringSlice
- type Token
- type TokenChain
- type Transaction
- type TransactionQ
- type Transfer
- type TransferQ
- type TransferSelector
- type Vote
- type VoteQ
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeSorting ¶
DecodeSorting - transforms sorting attribute specified by user into sorting column
func GetOrDefaultStr ¶
func GetOrDefaultStrPtr ¶
func GetOrDefaultUint64Ptr ¶
func MustDBHash ¶
func NotNilStrPtr ¶
Types ¶
type Approval ¶
type Approval struct { ID int64 `db:"id" json:"id" structs:"-"` // id TransferIndex []byte `db:"transfer_index" json:"transfer_index" structs:"transfer_index"` // transfer_index RarimoTransaction []byte `db:"rarimo_transaction" json:"rarimo_transaction" structs:"rarimo_transaction"` // rarimo_transaction CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at }
type Chain ¶
type Chain struct { ID int `fig:"id,required"` Name string `fig:"name,required"` Rpc string `fig:"rpc,required"` Type tokenmanager.NetworkType `fig:"type,required"` Icon *string `fig:"icon"` ChainParams json.RawMessage `fig:"chain_params"` }
type Collection ¶
type Collection struct { ID int64 `db:"id" json:"id" structs:"-"` // id Index []byte `db:"index" json:"index" structs:"index"` // index Metadata xo.Jsonb `db:"metadata" json:"metadata" structs:"metadata"` // metadata CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at UpdatedAt time.Time `db:"updated_at" json:"updated_at" structs:"updated_at"` // updated_at }
Collection represents a row from 'public.collections'.
type CollectionChainMapping ¶
type CollectionChainMapping struct { Collection int64 `db:"collection" json:"collection" structs:"-"` // collection Network int `db:"network" json:"network" structs:"-"` // network Address []byte `db:"address" json:"address" structs:"address"` // address TokenType sql.NullInt64 `db:"token_type" json:"token_type" structs:"token_type"` // token_type Wrapped sql.NullBool `db:"wrapped" json:"wrapped" structs:"wrapped"` // wrapped Decimals sql.NullInt64 `db:"decimals" json:"decimals" structs:"decimals"` // decimals CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at UpdatedAt time.Time `db:"updated_at" json:"updated_at" structs:"updated_at"` // updated_at }
CollectionChainMapping represents a row from 'public.collection_chain_mappings'.
type CollectionChainMappingQ ¶
type CollectionChainMappingQ interface { InsertBatchCtx(ctx context.Context, chainMappings ...CollectionChainMapping) error InsertCtx(ctx context.Context, ccm *CollectionChainMapping) error CollectionChainMappingByCollectionNetworkCtx(ctx context.Context, collection int64, network int, isForUpdate bool) (*CollectionChainMapping, error) UpsertCtx(ctx context.Context, ccm *CollectionChainMapping) error DeleteByCollectionCtx(ctx context.Context, collection int64) error DeleteCtx(ctx context.Context, ccm *CollectionChainMapping) error }
type CollectionQ ¶
type CollectionQ interface { InsertCtx(ctx context.Context, c *Collection) error CollectionByIndexCtx(ctx context.Context, index []byte, isForUpdate bool) (*Collection, error) DeleteCtx(ctx context.Context, c *Collection) error }
type Confirmation ¶
type Confirmation struct { ID int64 `db:"id" json:"id" structs:"-"` // id TransferIndex []byte `db:"transfer_index" json:"transfer_index" structs:"transfer_index"` // transfer_index RarimoTransaction []byte `db:"rarimo_transaction" json:"rarimo_transaction" structs:"rarimo_transaction"` // rarimo_transaction CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at }
Confirmation represents a row from 'public.confirmations'.
type ConfirmationQ ¶
type ConfirmationQ interface { InsertBatchCtx(ctx context.Context, confirmations ...Confirmation) error ConfirmationsByTransferIndexCtx(ctx context.Context, transferIndex []byte, isForUpdate bool) ([]Confirmation, error) }
type Cursor ¶
func DecodeCursor ¶
type GorpMigration ¶
type GorpMigration struct { ID string `db:"id" json:"id" structs:"-"` // id AppliedAt sql.NullTime `db:"applied_at" json:"applied_at" structs:"applied_at"` // applied_at }
GorpMigration represents a row from 'public.gorp_migrations'.
type GorpMigrationQ ¶
type GorpMigrationQ interface { }
type IndexConfig ¶
type IndexConfig struct {
TransfersIndexSuffix string `fig:"transfers_index_suffix"`
}
type Int256 ¶
Int256 - represents
func (Int256) MarshalMsgpack ¶
func (*Int256) UnmarshalMsgpack ¶
type Item ¶
type Item struct { ID int64 `db:"id" json:"id" structs:"-"` // id Index []byte `db:"index" json:"index" structs:"index"` // index Collection sql.NullInt64 `db:"collection" json:"collection" structs:"collection"` // collection Metadata xo.Jsonb `db:"metadata" json:"metadata" structs:"metadata"` // metadata CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at UpdatedAt time.Time `db:"updated_at" json:"updated_at" structs:"updated_at"` // updated_at }
Item represents a row from 'public.items'.
type ItemChainMapping ¶
type ItemChainMapping struct { Item int64 `db:"item" json:"item" structs:"-"` // item Network int `db:"network" json:"network" structs:"-"` // network Address []byte `db:"address" json:"address" structs:"address"` // address TokenID []byte `db:"token_id" json:"token_id" structs:"token_id"` // token_id CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at UpdatedAt time.Time `db:"updated_at" json:"updated_at" structs:"updated_at"` // updated_at }
ItemChainMapping represents a row from 'public.item_chain_mappings'.
type ItemChainMappingQ ¶
type ItemChainMappingQ interface { InsertBatchCtx(ctx context.Context, chainMappings ...ItemChainMapping) error InsertCtx(ctx context.Context, icm *ItemChainMapping) error ItemChainMappingByItemNetworkCtx(ctx context.Context, item int64, network int, isForUpdate bool) (*ItemChainMapping, error) ItemChainMappingsByNetworkCtx(ctx context.Context, network int, isForUpdate bool) ([]ItemChainMapping, error) DeleteByItemCtx(ctx context.Context, item int64) error DeleteCtx(ctx context.Context, icm *ItemChainMapping) error }
type ItemQ ¶
type ItemQ interface { InsertCtx(ctx context.Context, i *Item) error ItemByIndexCtx(ctx context.Context, index []byte, isForUpdate bool) (*Item, error) ItemByIDCtx(ctx context.Context, id int64, isForUpdate bool) (*Item, error) UpdateCtx(ctx context.Context, i *Item) error DeleteCtx(ctx context.Context, i *Item) error }
type ItemsSelector ¶
type Nft ¶
type Nft struct { ID string `json:"id"` Name string `json:"name"` Description *string `json:"description"` ImageURL string `json:"image_url"` CollectionName string `json:"collection_name,omitempty"` Attributes []NftAttribute `json:"attributes,omitempty"` }
DEPRECATED TODO use aggregated Items instead of Nft and make new endpoints
type NftAttribute ¶
type NftMetadata ¶
type NftMetadata struct { Name string `json:"name"` ImageURL string `json:"image_url"` MetadataUrl *string `json:"metadata_url,omitempty"` Description *string `json:"description,omitempty"` AnimationUrl *string `json:"animation_url,omitempty"` ExternalUrl *string `json:"external_url,omitempty"` Attributes []NftAttribute `json:"attributes,omitempty"` }
func (*NftMetadata) Merge ¶
func (m *NftMetadata) Merge(metadata *NftMetadata)
type Rejection ¶
type Rejection struct { ID int64 `db:"id" json:"id" structs:"-"` // id TransferIndex []byte `db:"transfer_index" json:"transfer_index" structs:"transfer_index"` // transfer_index RarimoTransaction []byte `db:"rarimo_transaction" json:"rarimo_transaction" structs:"rarimo_transaction"` // rarimo_transaction CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at }
Rejection represents a row from 'public.rejections'.
type RejectionQ ¶
type Storage ¶
type Storage interface { Transaction(func() error) error TransferQ() TransferQ ConfirmationQ() ConfirmationQ TransactionQ() TransactionQ VoteQ() VoteQ ApprovalQ() ApprovalQ RejectionQ() RejectionQ CollectionQ() CollectionQ CollectionChainMappingQ() CollectionChainMappingQ ItemQ() ItemQ ItemChainMappingQ() ItemChainMappingQ }
type StringSlice ¶
type StringSlice []string
StringSlice is a slice of strings.
func (*StringSlice) Scan ¶
func (ss *StringSlice) Scan(src interface{}) error
Scan satisfies the sql.Scanner interface for StringSlice.
type Token ¶
type Token struct { ID string `fig:"id,required"` Name string `fig:"name,required"` Symbol string `fig:"symbol,required"` Icon *string `fig:"icon"` // Relation Chains []TokenChain `fig:"chains,required"` }
type TokenChain ¶
type Transaction ¶
type Transaction struct { Hash []byte `db:"hash" json:"hash" structs:"-"` // hash BlockHeight sql.NullInt64 `db:"block_height" json:"block_height" structs:"block_height"` // block_height Index sql.NullInt64 `db:"index" json:"index" structs:"index"` // index RawTx []byte `db:"raw_tx" json:"raw_tx" structs:"raw_tx"` // raw_tx TxResult xo.NullJsonb `db:"tx_result" json:"tx_result" structs:"tx_result"` // tx_result TxTimestamp time.Time `db:"tx_timestamp" json:"tx_timestamp" structs:"tx_timestamp"` // tx_timestamp CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at }
Transaction represents a row from 'public.transactions'.
type TransactionQ ¶
type TransactionQ interface {
InsertBatchCtx(ctx context.Context, transactions ...Transaction) error
}
type Transfer ¶
type Transfer struct { ID int64 `db:"id" json:"id" structs:"-"` // id Index []byte `db:"index" json:"index" structs:"index"` // index Status int `db:"status" json:"status" structs:"status"` // status CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at UpdatedAt time.Time `db:"updated_at" json:"updated_at" structs:"updated_at"` // updated_at Creator sql.NullString `db:"creator" json:"creator" structs:"creator"` // creator RarimoTx []byte `db:"rarimo_tx" json:"rarimo_tx" structs:"rarimo_tx"` // rarimo_tx RarimoTxTimestamp time.Time `db:"rarimo_tx_timestamp" json:"rarimo_tx_timestamp" structs:"rarimo_tx_timestamp"` // rarimo_tx_timestamp Origin string `db:"origin" json:"origin" structs:"origin"` // origin Tx []byte `db:"tx" json:"tx" structs:"tx"` // tx EventID int64 `db:"event_id" json:"event_id" structs:"event_id"` // event_id FromChain string `db:"from_chain" json:"from_chain" structs:"from_chain"` // from_chain ToChain string `db:"to_chain" json:"to_chain" structs:"to_chain"` // to_chain Receiver string `db:"receiver" json:"receiver" structs:"receiver"` // receiver Amount Int256 `db:"amount" json:"amount" structs:"amount"` // amount BundleData []byte `db:"bundle_data" json:"bundle_data" structs:"bundle_data"` // bundle_data BundleSalt []byte `db:"bundle_salt" json:"bundle_salt" structs:"bundle_salt"` // bundle_salt TokenIndex string `db:"token_index" json:"token_index" structs:"token_index"` // token_index }
Transfer represents a row from 'public.transfers'.
func (Transfer) RarimoTxHash ¶
type TransferQ ¶
type TransferQ interface { SelectCtx(ctx context.Context, selector TransferSelector) ([]Transfer, error) UpsertBatchCtx(ctx context.Context, transfers ...Transfer) error TransferByIndexCtx(ctx context.Context, index []byte, isForUpdate bool) (*Transfer, error) SetStatusByIndexCtx(ctx context.Context, status int, indexes ...string) error }
type TransferSelector ¶
type TransferSelector struct { Origin *string `json:"origin,omitempty"` RarimoTx *string `json:"bridge_tx,omitempty"` ChainTx *string `json:"original_tx,omitempty"` SourceChain *string `json:"src_chain,omitempty"` DestinationChain *string `json:"dst_chain,omitempty"` Receiver *string `json:"receiver,omitempty"` Status *int `json:"signed,omitempty"` Creator *string `json:"creator,omitempty"` Before *time.Time `json:"bridged_before,omitempty"` After *time.Time `json:"bridged_after,omitempty"` TokenIndex *string `json:"token_index,omitempty"` PageCursor uint64 `json:"page_number,omitempty"` PageSize uint64 `json:"page_size,omitempty"` Sort pgdb.Sorts `json:"sort"` }
func (TransferSelector) MustCacheKey ¶
func (s TransferSelector) MustCacheKey() string
type Vote ¶
type Vote struct { ID int64 `db:"id" json:"id" structs:"-"` // id TransferIndex []byte `db:"transfer_index" json:"transfer_index" structs:"transfer_index"` // transfer_index Choice int `db:"choice" json:"choice" structs:"choice"` // choice RarimoTransaction []byte `db:"rarimo_transaction" json:"rarimo_transaction" structs:"rarimo_transaction"` // rarimo_transaction CreatedAt time.Time `db:"created_at" json:"created_at" structs:"created_at"` // created_at }
Vote represents a row from 'public.votes'.