Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPipelineSearchFromParsedVaa ¶
func BuildPipelineSearchFromParsedVaa(query OperationQuery) mongo.Pipeline
Types ¶
type AttributeDoc ¶
type AttributeDoc struct { Type string `bson:"type" json:"type"` Value map[string]any `bson:"value" json:"value"` }
AttributeDoc represents a custom attribute for a origin transaction.
type DestinationTx ¶
type DestinationTx struct { ChainID sdk.ChainID `bson:"chainId" json:"chainId"` Status string `bson:"status" json:"status"` Method string `bson:"method" json:"method"` TxHash string `bson:"txHash" json:"txHash"` From string `bson:"from" json:"from"` To string `bson:"to" json:"to"` BlockNumber string `bson:"blockNumber" json:"blockNumber"` Timestamp *time.Time `bson:"timestamp" json:"timestamp"` Fee *FeeDoc `bson:"feeDetail" json:"feeDetail"` UpdatedAt *time.Time `bson:"updatedAt" json:"updatedAt"` }
DestinationTx represents a destination transaction.
type GlobalTransactionDoc ¶
type GlobalTransactionDoc struct { ID string `bson:"_id" json:"id"` OriginTx *OriginTx `bson:"originTx" json:"originTx"` DestinationTx *DestinationTx `bson:"destinationTx" json:"destinationTx"` }
GlobalTransactionDoc definitions.
type OperationDto ¶
type OperationDto struct { ID string `bson:"_id"` TxHash string `bson:"txHash"` Symbol string `bson:"symbol"` UsdAmount string `bson:"usdAmount"` TokenAmount string `bson:"tokenAmount"` Vaa *VaaDto `bson:"vaa"` SourceTx *OriginTx `bson:"originTx" json:"originTx"` DestinationTx *DestinationTx `bson:"destinationTx" json:"destinationTx"` Payload map[string]any `bson:"payload"` StandardizedProperties *StandardizedProperties `bson:"standardizedProperties"` }
OperationDto operation data transfer object.
type OperationFilter ¶
type OperationQuery ¶
type OriginTx ¶
type OriginTx struct { TxHash string `bson:"nativeTxHash" json:"txHash"` From string `bson:"from" json:"from"` Status string `bson:"status" json:"status"` Timestamp *time.Time `bson:"timestamp" json:"timestamp"` Attribute *AttributeDoc `bson:"attribute" json:"attribute"` Fee *FeeDoc `bson:"feeDetail" json:"feeDetail"` }
OriginTx represents a origin transaction.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository definition
func NewRepository ¶
func NewRepository(db *mongo.Database, logger *zap.Logger) *Repository
NewRepository create a new Repository.
func (*Repository) FindAll ¶
func (r *Repository) FindAll(ctx context.Context, query OperationQuery) ([]*OperationDto, error)
FindAll returns all operations filtered by q.
func (*Repository) FindById ¶
func (r *Repository) FindById(ctx context.Context, id string) (*OperationDto, error)
FindById returns the operations for the given chainID/emitter/seq.
func (*Repository) FindFromParsedVaa ¶
func (r *Repository) FindFromParsedVaa(ctx context.Context, query OperationQuery) ([]*OperationDto, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *Repository, logger *zap.Logger) *Service
NewService create a new Service.
func (*Service) FindAll ¶
func (s *Service) FindAll(ctx context.Context, filter OperationFilter) ([]*OperationDto, error)
FindAll returns all operations filtered by q.
type StandardizedProperties ¶
type StandardizedProperties struct { AppIds []string `json:"appIds" bson:"appIds"` FromChain sdk.ChainID `json:"fromChain" bson:"fromChain"` FromAddress string `json:"fromAddress" bson:"fromAddress"` ToChain sdk.ChainID `json:"toChain" bson:"toChain"` ToAddress string `json:"toAddress" bson:"toAddress"` TokenChain sdk.ChainID `json:"tokenChain" bson:"tokenChain"` TokenAddress string `json:"tokenAddress" bson:"tokenAddress"` Amount string `json:"amount" bson:"amount"` FeeAddress string `json:"feeAddress" bson:"feeAddress"` FeeChain sdk.ChainID `json:"feeChain" bson:"feeChain"` Fee string `json:"fee" bson:"fee"` }
StandardizedProperties represents the standardized properties of a operation.
type VaaDto ¶
type VaaDto struct { ID string `bson:"_id" json:"id"` Version uint8 `bson:"version" json:"version"` EmitterChain sdk.ChainID `bson:"emitterChain" json:"emitterChain"` EmitterAddr string `bson:"emitterAddr" json:"emitterAddr"` EmitterNativeAddr string `json:"emitterNativeAddr,omitempty"` Sequence string `bson:"sequence" json:"-"` GuardianSetIndex uint32 `bson:"guardianSetIndex" json:"guardianSetIndex"` Vaa []byte `bson:"vaas" json:"vaa"` Timestamp *time.Time `bson:"timestamp" json:"timestamp"` UpdatedAt *time.Time `bson:"updatedAt" json:"updatedAt"` IndexedAt *time.Time `bson:"indexedAt" json:"indexedAt"` Hash []byte `bson:"hash" json:"hash"` IsDuplicated bool `bson:"isDuplicated" json:"isDuplicated"` }
VaaDto vaa data transfer object.
Click to show internal directories.
Click to hide internal directories.