chains

package
v0.0.0-...-b6cb4ed Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandExecuted

type CommandExecuted struct {
	gorm.Model
	SourceChain string `gorm:"type:varchar(255)"`
	Address     string `gorm:"type:varchar(255)"`
	TxHash      string `gorm:"type:varchar(255)"`
	BlockNumber uint64
	LogIndex    uint
	CommandID   string `gorm:"uniqueIndex; type:varchar(255)"`
}

type ContractCall

type ContractCall struct {
	EventID            string `gorm:"primaryKey"`
	TxHash             string `gorm:"type:varchar(255)"`
	BlockNumber        uint64 `gorm:"default:0"`
	LogIndex           uint
	SourceChain        string             `gorm:"type:varchar(64)"`
	SourceAddress      string             `gorm:"type:varchar(255)"`
	DestinationChain   string             `gorm:"type:varchar(64)"`
	DestinationAddress string             `gorm:"type:varchar(255)"`
	Status             ContractCallStatus `gorm:"default:pending"`
	Payload            []byte
	PayloadHash        string    `gorm:"type:varchar(255)"`
	ExecuteHash        string    `gorm:"type:varchar(255)"`
	CreatedAt          time.Time `gorm:"type:timestamp(6);default:current_timestamp(6)"`
	UpdatedAt          time.Time `gorm:"type:timestamp(6);default:current_timestamp(6)"`
	DeletedAt          gorm.DeletedAt
}

type ContractCallStatus

type ContractCallStatus string

TokenSentStatus represents the status of a token transfer

const (
	// TokenSentStatusPending indicates the token is just received from the source chain
	ContractCallStatusPending ContractCallStatus = "pending"
	// TokenSentStatusVerifying indicates the transfer is broadcasting to the scalar for verification
	ContractCallStatusVerifying ContractCallStatus = "verifying"
	// TokenSentStatusApproved indicates the transfer is approved by the scalar network
	ContractCallStatusApproved ContractCallStatus = "approved"
	// TokenSentStatusSigning indicates the transfer is signing in the scalar network
	ContractCallStatusSigning ContractCallStatus = "signing"
	// TokenSentStatusExecuting indicates the transfer is executing on the destination chain
	ContractCallStatusExecuting ContractCallStatus = "executing"
	// TokenSentStatusSuccess indicates the transfer was successful executed on the destination chain
	ContractCallStatusSuccess ContractCallStatus = "success"
	// TokenSentStatusFailed indicates the transfer failed
	ContractCallStatusFailed ContractCallStatus = "failed"
	// TokenSentStatusCancelled indicates the transfer was cancelled
	ContractCallStatusCancelled ContractCallStatus = "cancelled"
)

type ContractCallWithToken

type ContractCallWithToken struct {
	ContractCall
	TokenContractAddress string `gorm:"type:varchar(255)"`
	Symbol               string `gorm:"type:varchar(255)"`
	Amount               uint64 `gorm:"type:bigint"`
}

type MintCommand

type MintCommand struct {
	gorm.Model
	TxHash           string `gorm:"type:varchar(64)"`
	SourceChain      string `gorm:"type:varchar(20);not null"`
	DestinationChain string `gorm:"type:varchar(20);not null"`
	TransferID       uint64 `gorm:"type:varchar(50);not null"`
	CommandID        string `gorm:"type:varchar(64);not null"`
	Amount           int64
	Symbol           string `gorm:"type:varchar(10);not null"`
	Recipient        string `gorm:"type:varchar(64);not null"`
}

type TokenDeployed

type TokenDeployed struct {
	gorm.Model
	Chain        string `gorm:"type:varchar(32)"`
	BlockNumber  uint64 `gorm:"type:bigint"`
	TxHash       string `gorm:"type:varchar(255)"`
	Symbol       string `gorm:"type:varchar(32)"`
	TokenAddress string `gorm:"type:varchar(255)"`
}

type TokenSent

type TokenSent struct {
	EventID   string    `gorm:"primaryKey;type:varchar(255)"`
	CreatedAt time.Time `gorm:"primaryKey;type:timestamp(6);default:current_timestamp(6)"`

	TxHash               string `gorm:"type:varchar(255)"`
	BlockNumber          uint64 `gorm:"default:0"`
	LogIndex             uint
	SourceChain          string          `gorm:"type:varchar(64)"`
	SourceAddress        string          `gorm:"type:varchar(255)"`
	DestinationChain     string          `gorm:"type:varchar(64)"`
	DestinationAddress   string          `gorm:"type:varchar(255)"`
	TokenContractAddress string          `gorm:"type:varchar(255)"`
	Amount               uint64          `gorm:"type:bigint"`
	Symbol               string          `gorm:"type:varchar(255)"`
	Status               TokenSentStatus `gorm:"default:pending"`
	UpdatedAt            time.Time       `gorm:"type:timestamp(6);default:current_timestamp(6)"`
	DeletedAt            gorm.DeletedAt
}

type TokenSentStatus

type TokenSentStatus string

TokenSentStatus represents the status of a token transfer

const (
	// TokenSentStatusPending indicates the token is just received from the source chain
	TokenSentStatusPending TokenSentStatus = "pending"
	// TokenSentStatusVerifying indicates the transfer is broadcasting to the scalar for verification
	TokenSentStatusVerifying TokenSentStatus = "verifying"
	// TokenSentStatusApproved indicates the transfer is approved by the scalar network
	TokenSentStatusApproved TokenSentStatus = "approved"
	// TokenSentStatusSigning indicates the transfer is signing in the scalar network
	TokenSentStatusSigning TokenSentStatus = "signing"
	// TokenSentStatusExecuting indicates the transfer is executing on the destination chain
	TokenSentStatusExecuting TokenSentStatus = "executing"
	// TokenSentStatusSuccess indicates the transfer was successful executed on the destination chain
	TokenSentStatusSuccess TokenSentStatus = "success"
	// TokenSentStatusFailed indicates the transfer failed
	TokenSentStatusFailed TokenSentStatus = "failed"
	// TokenSentStatusCancelled indicates the transfer was cancelled
	TokenSentStatusCancelled TokenSentStatus = "cancelled"

	TokenSentStatusDeleted TokenSentStatus = "deleted"
)

Jump to

Keyboard shortcuts

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