model

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// b2 rollup status
	DepositB2TxStatusSuccess                    = iota // success
	DepositB2TxStatusPending                           // pending
	DepositB2TxStatusFailed                            // deposit invoke failed
	DepositB2TxStatusWaitMinedFailed                   // deposit wait mined failed
	DepositB2TxStatusTxHashExist                       // tx hash exist, deposit have been called
	DepositB2TxStatusWaitMinedStatusFailed             // deposit wait mined status failed, status != 1
	DepositB2TxStatusInsufficientBalance               // deposit insufficient balance
	DepositB2TxStatusContextDeadlineExceeded           // deposit client context deadline exceeded, Chain transaction is stuck
	DepositB2TxStatusFromAccountGasInsufficient        // deposit evm from account gas insufficient
	DepositB2TxStatusWaitMined                         // deposit wait mined
	DepositB2TxStatusAAAddressNotFound                 // aa address not found,  Start process processing separately
	DepositB2TxStatusIsPending
	DepositB2TxStatusNonceToLow
	DepositB2TxStatusWhitelistBtcAddress
)
View Source
const (
	DepositB2EoaTxStatusSuccess         = iota // eoa transfer success
	DepositB2EoaTxStatusPending                // eoa transfer pending
	DepositB2EoaTxStatusFailed                 // eoa transfer failed
	DepositB2EoaTxStatusWaitMinedFailed        // eoa transfer wait mined failed
	DepositB2EoaTxStatusWaitMined

	DepositB2EoaTxStatusContextDeadlineExceeded // eoa transfer client context deadline exceeded
	DepositB2EoaTxStatusUnknown
	DepositB2EoaTxStatusNonceToLow

	DepositB2EoaStatusWhitelistBtcAddress
)
View Source
const (
	CallbackStatusSuccess = iota
	CallbackStatusPending
)
View Source
const (
	ListenerStatusSuccess = iota
	ListenerStatusPending
)
View Source
const (
	B2CheckStatusSuccess = iota
	B2CheckStatusPending
	B2CheckStatusFailed
)
View Source
const (
	EspStatus        = 1
	EspStatusSuccess = 2 // success
)
View Source
const (
	BtcTxWithdrawSubmit             = "submit"
	BtcTxWithdrawPending            = "pending"
	BtcTxWithdrawSinohopeSuccess    = "sinohope_success"
	BtcTxWithdrawSuccess            = "success"
	BtcTxWithdrawFailed             = "failed"
	BtcTxWithdrawCheckAddressFailed = "check_address_failed"
)

tx status sequence 1.1 BtcTxWithdrawSubmit 1.2 BtcTxWithdrawPending 1.3 BtcTxWithdrawSuccess/BtcTxWithdrawFailed

View Source
const (
	BtcTxWithdrawSinohopeCallback = iota + 1
	BtcTxWithdrawMPCCallback
)

btc tx check status sequence

View Source
const (
	WithdrawAuditStatusPending = iota + 1
	WithdrawAuditStatusApprove
	WithdrawAuditStatusReject
)

first audit

View Source
const (
	WithdrawAuditMPCStatusWait = iota + 1
	WithdrawAuditMPCStatusApprove
	WithdrawAuditMPCStatusReject
)

second audit

View Source
const (
	ResetTypeReset   = 0
	ResetTypeSpeedup = 1
)
View Source
const (
	BtcTxTypeTransfer = iota // transfer
)

Variables

This section is empty.

Functions

This section is empty.

Types

type B2Node

type B2Node struct {
	Base
	Height              int64  `json:"height" gorm:"column:height"`
	BridgeModuleTxIndex int    `json:"bridge_module_tx_index" gorm:"column:bridge_module_tx_index"`
	TxHash              string `json:"tx_hash" gorm:"column:tx_hash;type:varchar(66);not null;default:''"`
	EventType           string `json:"event_type" gorm:"column:event_type;type:varchar(60);not null;default:''"`
	Messages            string `json:"messages" gorm:"column:messages;not null;default:''"`
	RawLog              string `json:"raw_log" gorm:"column:raw_log;not null;default:''"`
	TxCode              int    `json:"tx_code" gorm:"column:tx_code"`
	TxData              string `json:"tx_data" gorm:"column:tx_data;not null;default:''"`
	BridgeEventID       string `json:"bridge_event_id" gorm:"column:bridge_event_id;type:varchar(66);not null;default:''"`
	Status              int    `json:"status" gorm:"column:status;type:smallint;default:1"`
}

func (B2Node) Column

func (B2Node) Column() B2NodeColumns

func (B2Node) TableName

func (B2Node) TableName() string

type B2NodeColumns

type B2NodeColumns struct {
	Height              string
	BridgeModuleTxIndex string
	TxHash              string
	EventType           string
	Messages            string
	RawLog              string
	TxCode              string
	TxData              string
	BridgeEventID       string
	Status              string
}

type B2NodeIndex

type B2NodeIndex struct {
	Base
	IndexBlock int64 `json:"index_block" gorm:"comment:b2node index block"`
	IndexTx    int64 `json:"index_tx" gorm:"comment:b2node index tx"`
}

func (B2NodeIndex) TableName

func (B2NodeIndex) TableName() string

type Base

type Base struct {
	ID        int64          `json:"id"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`
}

type BtcIndex

type BtcIndex struct {
	Base
	BtcIndexBlock int64 `json:"btc_index_block" gorm:"comment:bitcoin index block"`
	BtcIndexTx    int64 `json:"btc_index_tx" gorm:"comment:bitcoin index tx"`
}

func (BtcIndex) TableName

func (BtcIndex) TableName() string

type Deposit

type Deposit struct {
	Base
	BtcBlockNumber   int64     `json:"btc_block_number" gorm:"index;comment:bitcoin block number"`
	BtcTxIndex       int64     `json:"btc_tx_index" gorm:"comment:bitcoin tx index"`
	BtcTxHash        string    `json:"btc_tx_hash" gorm:"type:varchar(64);not null;default:'';uniqueIndex;comment:bitcoin tx hash"`
	BtcTxType        int       `json:"btc_tx_type" gorm:"type:SMALLINT;default:0;comment:btc tx type"`
	BtcFroms         string    `json:"btc_froms" gorm:"type:jsonb;comment:bitcoin transfer, from may be multiple"`
	BtcFrom          string    `json:"btc_from" gorm:"type:varchar(64);not null;default:'';index"`
	BtcTos           string    `json:"btc_tos" gorm:"type:jsonb;comment:bitcoin transfer, to may be multiple"`
	BtcTo            string    `json:"btc_to" gorm:"type:varchar(64);not null;default:'';index"`
	BtcFromAAAddress string    `json:"btc_from_aa_address" gorm:"type:varchar(42);default:'';comment:from aa address"`
	BtcValue         int64     `json:"btc_value" gorm:"default:0;comment:bitcoin transfer value"`
	B2TxFrom         string    `json:"b2_tx_from" gorm:"type:varchar(42);default:'';comment:from address"`
	B2TxHash         string    `json:"b2_tx_hash" gorm:"type:varchar(66);not null;default:'';index;comment:b2 network tx hash"`
	B2TxNonce        uint64    `json:"b2_tx_nonce" gorm:"default:0"`
	B2TxStatus       int       `json:"b2_tx_status" gorm:"type:SMALLINT;default:1"`
	B2TxRetry        int       `json:"b2_tx_retry" gorm:"type:SMALLINT;default:0"`
	B2EoaTxFrom      string    `json:"b2_eoa_tx_from" gorm:"type:varchar(42);default:'';comment:from address"`
	B2EoaTxNonce     uint64    `json:"b2_eoa_tx_nonce" gorm:"default:0"`
	B2EoaTxHash      string    `json:"b2_eoa_tx_hash" gorm:"type:varchar(66);not null;default:'';comment:b2 network eoa tx hash"`
	B2EoaTxStatus    int       `json:"b2_eoa_tx_status" gorm:"type:SMALLINT;default:1"`
	BtcBlockTime     time.Time `json:"btc_block_time"`
	CallbackStatus   int       `json:"callback_status" gorm:"type:SMALLINT;default:0"`
	ListenerStatus   int       `json:"listener_status" gorm:"type:SMALLINT;default:0"`
	B2TxCheck        int       `json:"b2_tx_check" gorm:"type:SMALLINT;default:1"`
}

func (Deposit) Column

func (Deposit) Column() DepositColumns

func (Deposit) TableName

func (Deposit) TableName() string

type DepositColumns

type DepositColumns struct {
	BtcBlockNumber   string
	BtcTxIndex       string
	BtcTxHash        string
	BtcTxType        string
	BtcFroms         string
	BtcFrom          string
	BtcTos           string
	BtcTo            string
	BtcFromAAAddress string
	BtcValue         string
	B2TxFrom         string
	B2TxHash         string
	B2TxNonce        string
	B2TxStatus       string
	B2TxRetry        string
	B2EoaTxFrom      string
	B2EoaTxNonce     string
	B2EoaTxHash      string
	B2EoaTxStatus    string
	BtcBlockTime     string
	CallbackStatus   string
	ListenerStatus   string
	B2TxCheck        string
}

type Eps

type Eps struct {
	Base
	DepositID          int64     `json:"deposit_id" gorm:"index;comment:deposit_history id"`
	B2From             string    `json:"b2_from" gorm:"type:varchar(64);not null;default:'';index;commit:b2 from"`
	B2To               string    `json:"b2_to" gorm:"type:varchar(64);not null;default:'';index;commit:b2 to"`
	BtcValue           int64     `json:"btc_value" gorm:"default:0;comment:btc transfer value"`
	B2TxHash           string    `json:"b2_tx_hash" gorm:"type:varchar(66);not null;default:'';index;comment:b2 network tx hash"`
	B2TxTime           time.Time `json:"b2_tx_time" gorm:"type:timestamp;comment:btc tx time"`
	B2BlockNumber      int64     `json:"b2_block_number" gorm:"index;comment:b2 block number"`
	B2TransactionIndex int64     `json:"b2_transaction_index" gorm:"index;comment:b2 transaction index"`
	Status             int       `json:"status" gorm:"type:SMALLINT;default:1"`
}

func (Eps) Column

func (Eps) Column() EpsColumns

func (Eps) TableName

func (Eps) TableName() string

type EpsColumns

type EpsColumns struct {
	ID                 string
	DepositID          string
	B2From             string
	B2To               string
	BtcValue           string
	B2TxHash           string
	B2TxTime           string
	B2BlockNumber      string
	B2TransactionIndex string
	Status             string
}

type FeeRates

type FeeRates struct {
	FastestFee  int `json:"fastestFee"`
	HalfHourFee int `json:"halfHourFee"`
	HourFee     int `json:"hourFee"`
	EconomyFee  int `json:"economyFee"`
	MinimumFee  int `json:"minimumFee"`
}

type RollupDeposit

type RollupDeposit struct {
	Base
	BtcTxHash        string `json:"btc_tx_hash" gorm:"type:varchar(64);not null;default:'';comment:bitcoin tx hash"`
	BtcFromAAAddress string `json:"btc_from_aa_address" gorm:"type:varchar(42);default:'';comment:from aa address"`
	BtcValue         int64  `json:"btc_value" gorm:"type:bigint;default:0;comment:bitcoin transfer value"`
	B2BlockNumber    uint64 `json:"b2_block_number" gorm:"type:bigint;comment:b2 block number"`
	B2BlockHash      string `json:"b2_block_hash" gorm:"type:varchar(256);comment:b2 block hash"`
	B2TxFrom         string `json:"b2_tx_from" gorm:"type:varchar(42);default:'';comment:from address"`
	B2TxHash         string `json:"b2_tx_hash" gorm:"type:varchar(256);default:'';uniqueIndex;comment:b2 network tx hash"`
	B2TxIndex        uint   `json:"b2_tx_index" gorm:"type:bigint;comment:b2 tx index"`
	B2LogIndex       uint   `json:"b2_log_index" gorm:"type:int;comment:b2 log index"`
	Status           int    `json:"status" gorm:"type:smallint;default:1"`
}

func (RollupDeposit) Column

func (RollupDeposit) TableName

func (RollupDeposit) TableName() string

type RollupDepositColumns

type RollupDepositColumns struct {
	BtcTxHash        string
	BtcFromAAAddress string
	BtcValue         string
	B2TxFrom         string
	B2BlockNumber    string
	B2BlockHash      string
	B2TxHash         string
	B2TxIndex        string
	B2LogIndex       string
	Status           string
}

type RollupIndex

type RollupIndex struct {
	Base
	B2IndexBlock uint64 `json:"b2_index_block" gorm:"comment:b2 index block"`
	B2IndexTx    uint   `json:"b2_index_tx" gorm:"comment:b2 tx index"`
	B2LogIndex   uint   `json:"b2_log_tx" gorm:"comment:b2 log index"`
}

func (RollupIndex) TableName

func (RollupIndex) TableName() string

type Sinohope

type Sinohope struct {
	Base
	RequestID     string `json:"request_id" gorm:"type:varchar(128);not null;default:'';uniqueIndex;comment:sinohope request id"`
	RequestType   int    `json:"request_type" gorm:"type:SMALLINT;default:0;comment:sinohope callback type"`
	RequestDetail string `json:"request_detail" gorm:"type:jsonb;comment:sinohope request detail"`
	ExtraInfo     string `json:"extra_info" gorm:"type:jsonb;comment:sinohope request extra_info"`
}

func (Sinohope) Column

func (Sinohope) Column() SinohopeColumns

func (Sinohope) TableName

func (Sinohope) TableName() string

type SinohopeColumns

type SinohopeColumns struct {
	RequestID     string
	RequestType   string
	RequestDetail string
	ExtraInfo     string
}

type Withdraw

type Withdraw struct {
	Base
	UUID          string `json:"uuid" gorm:"type:varchar(256);default:'';uniqueIndex;comment:b2 network withdraw_uuid"`
	RequestID     string `json:"request_id" gorm:"type:varchar(256);default:'';uniqueIndex;comment:b2 network request id"`
	Fee           int64  `json:"fee" gorm:"type:bigint;comment:fee"`
	BtcFrom       string `json:"btc_from" gorm:"type:varchar(256);default:'';index"`
	BtcTo         string `json:"btc_to" gorm:"type:varchar(256);default:'';index"`
	BtcValue      int64  `json:"btc_value" gorm:"type:bigint;default:0;comment:bitcoin transfer value"`
	BtcRealValue  int64  `json:"btc_real_value" gorm:"type:bigint;default:0;comment:bitcoin transfer real value"`
	BtcTxHash     string `json:"btc_tx_hash" gorm:"type:varchar(256);default:'';comment:bitcoin tx hash"`
	B2BlockNumber uint64 `json:"b2_block_number" gorm:"type:bigint;comment:b2 block number"`
	B2BlockHash   string `json:"b2_block_hash" gorm:"type:varchar(256);comment:b2 block hash"`
	B2TxFrom      string `json:"b2_tx_from" gorm:"type:varchar(256);comment:b2 tx from"`
	B2TxTo        string `json:"b2_tx_to" gorm:"type:varchar(256);comment:b2 tx to"`
	B2TxHash      string `json:"b2_tx_hash" gorm:"type:varchar(256);default:'';uniqueIndex;comment:b2 network tx hash"`
	B2TxIndex     uint   `json:"b2_tx_index" gorm:"type:bigint;comment:b2 tx index"`
	B2LogIndex    uint   `json:"b2_log_index" gorm:"type:int;comment:b2 log index"`
	RefundTxHash  string `json:"refund_tx_hash" gorm:"type:varchar(256);default:'';comment:bitcoin refund tx hash"`
	Status        string `json:"status" gorm:"type:varchar(64)"`
	AuditStatus   string `json:"audit_status" gorm:"type:varchar(64)"`
}

func (Withdraw) Column

func (Withdraw) Column() WithdrawColumns

func (Withdraw) TableName

func (Withdraw) TableName() string

type WithdrawAudit added in v1.1.0

type WithdrawAudit struct {
	Base
	APIRequestID string `json:"api_request_id" gorm:"type:varchar(256);comment:withdraw request id"`
	B2TxHash     string `json:"b2_tx_hash" gorm:"type:varchar(256);default:'';comment:b2 network tx hash"`
	BtcFrom      string `json:"btc_from" gorm:"type:varchar(256);default:'';index"`
	BtcTo        string `json:"btc_to" gorm:"type:varchar(256);default:'';index"`
	BtcValue     int64  `json:"btc_value" gorm:"type:bigint;default:0;comment:bitcoin transfer value"`
	BtcTxHash    string `json:"btc_tx_hash" gorm:"type:varchar(256);default:'';comment:bitcoin tx hash"`
	Status       int    `json:"status" gorm:"type:smallint;default:1"`
	MPCStatus    int    `json:"mpc_status" gorm:"type:smallint;default:1"`
}

func (WithdrawAudit) Column added in v1.1.0

func (WithdrawAudit) TableName added in v1.1.0

func (WithdrawAudit) TableName() string

type WithdrawAuditColumns added in v1.1.0

type WithdrawAuditColumns struct {
	B2TxHash  string
	BtcFrom   string
	BtcTo     string
	BtcValue  string
	BtcTxHash string
	Status    string
	MPCStatus string
}

type WithdrawColumns

type WithdrawColumns struct {
	BtcTxHash     string
	BtcFrom       string
	BtcTo         string
	BtcValue      string
	B2TxHash      string
	B2BlockNumber string
	B2LogIndex    string
	Status        string
	RefundTxHash  string
	AuditStatus   string
	B2TxFrom      string
	BtcRealValue  string
	UUID          string
	B2TxIndex     string
	B2BlockHash   string
	RequestID     string
	Fee           string
}

type WithdrawReset added in v1.1.0

type WithdrawReset struct {
	Base
	RequestID string `json:"request_id" gorm:"type:varchar(256);default:'';uniqueIndex;comment:b2 network request id"`
	ResetType int    `json:"reset_type" gorm:"type:SMALLINT;default:0"`
	B2TxHash  string `json:"b2_tx_hash" gorm:"type:varchar(256);default:'';comment:b2 network tx hash"`
	Withdraw  string `json:"withdraw" gorm:"type:jsonb;comment:withdraw history"`
	Sinohope  string `json:"sinohope" gorm:"type:jsonb;comment:sinohope history"`
}

func (WithdrawReset) Column added in v1.1.0

func (WithdrawReset) TableName added in v1.1.0

func (WithdrawReset) TableName() string

type WithdrawResetColumns added in v1.1.0

type WithdrawResetColumns struct {
	RequestID string
	ResetType string
	B2TxHash  string
	Withdraw  string
	Sinohope  string
}

type WithdrawSinohope added in v1.1.0

type WithdrawSinohope struct {
	Base
	APIRequestID      string `json:"api_request_id" gorm:"type:varchar(256);comment:withdraw request id"`
	B2TxHash          string `json:"b2_tx_hash" gorm:"type:varchar(256);default:'';comment:b2 network tx hash"`
	SinohopeID        string `json:"sinohope_id" gorm:"type:varchar(256)"`
	SinohopeRequestID string `json:"sinohope_request_id" gorm:"type:varchar(256)"`
	FeeRate           string `json:"fee_rate" gorm:"type:varchar(256)"`
	State             int    `json:"state" gorm:"type:smallint"`
}

func (WithdrawSinohope) Column added in v1.1.0

func (WithdrawSinohope) TableName added in v1.1.0

func (WithdrawSinohope) TableName() string

type WithdrawSinohopeColumns added in v1.1.0

type WithdrawSinohopeColumns struct {
	APIRequestID      string
	B2TxHash          string
	SinohopeID        string
	SinohopeRequestID string
	FeeRate           string
	State             string
}

Jump to

Keyboard shortcuts

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