schema

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeFees

type BridgeFees struct {
	MintFee int64 `json:"mintFee" validate:"gte=0"`
	BurnFee int64 `json:"burnFee" validate:"gte=0"`
}

BridgeFees schema

type BurnEvent

type BurnEvent struct {
	EVMTxID      string `json:"evmTxID"`
	BlockHeight  int64  `json:"blockHeight"`
	TokenAddress string `json:"tokenAddress"`
	Amount       int64  `json:"amount"`
	Destination  string `json:"destination"`
	TokenURL     string `json:"-"`
	TxHash       string `json:"txHash"`
}

BurnEvent is an event of token burns on the EVM side

func ParseBurnEvent

func ParseBurnEvent(entry *accumulate.DataEntry) (*BurnEvent, error)

ParseBurnEvent parses accumulate data entry into burn event and validates it

type DepositEvent

type DepositEvent struct {
	TxID         string `json:"txid"`
	Source       string `json:"source"`
	TokenURL     string `json:"tokenURL"`
	Amount       int64  `json:"amount"`
	SeqNumber    int64  `json:"seqNumber"`
	Destination  string `json:"destination"`
	TokenAddress string `json:"-"`
	SafeTxHash   string `json:"safeTxHash"`
	SafeTxNonce  int64  `json:"safeTxNonce"`
}

DepositEvent is an event of token deposit into bridge token account

func ParseDepositEvent

func ParseDepositEvent(entry *accumulate.DataEntry) (*DepositEvent, error)

ParseDepositEvent parses accumulate data entry into minut event and validates it

type Token

type Token struct {
	URL           string  `json:"url"`
	Symbol        string  `json:"symbol"`
	Precision     int64   `json:"precision"`
	EVMAddress    string  `json:"evmAddress"`
	EVMSymbol     string  `json:"evmSymbol"`
	EVMDecimals   int64   `json:"evmDecimals"`
	EVMMintTxCost float64 `json:"evmMintTxCost" validate:"gte=0"`
}

Token is an item of Tokens{}

type TokenEntry

type TokenEntry struct {
	URL       string          `json:"url" validate:"required"`
	Enabled   bool            `json:"enabled"`
	Symbol    string          `json:"-"` // do not marshal symbol
	Precision int64           `json:"-"` // do not marshal precision
	Wrapped   []*WrappedToken `json:"wrapped" validate:"required"`
}

TokenEntry is token registry item schema

type Tokens

type Tokens struct {
	ChainID int64    `json:"chainId"`
	Items   []*Token `json:"items"`
}

Tokens is the list of active tokens, used by API

type WrappedToken

type WrappedToken struct {
	Address    string  `json:"address" validate:"required,eth_addr"`
	ChainID    int64   `json:"chainId" validate:"required,gt=0"`
	MintTxCost float64 `json:"mintTxCost" validate:"gte=0"`
}

Jump to

Keyboard shortcuts

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