Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Accounts ¶
type Accounts struct { BaseModel ProjectID uint64 `gorm:"column:project_id;type:bigint(20) unsigned;default:0;comment:项目 ID;NOT NULL" json:"project_id"` ChainType string `gorm:"column:chain_type;type:char(3);NOT NULL" json:"chain_type"` Name string `gorm:"column:name;type:varchar(255);comment:链账户名称" json:"name"` NativeAddress string `gorm:"column:native_address;type:char(42);comment:地址;NOT NULL" json:"native_address"` HexAddress string `gorm:"column:hex_address;type:char(46);comment:地址;NOT NULL" json:"hex_address"` PubKey string `gorm:"column:pub_key;type:char(172);comment:公钥;NOT NULL" json:"pub_key"` PriKey string `gorm:"column:pri_key;type:char(216);comment:私钥;NOT NULL" json:"pri_key"` AccIndex uint64 `gorm:"column:acc_index;type:bigint(20) unsigned;default:0;comment:链地址偏移下标;NOT NULL" json:"acc_index"` Status uint `` /* 126-byte string literal not displayed */ TxID uint64 `gorm:"column:tx_id;type:bigint(20) unsigned;default:0;comment:交易 ID;NOT NULL" json:"tx_id"` Algo uint64 `gorm:"column:algo;type:bigint(20) unsigned;default:0;comment:加密算法, 1:secp256k1, 2:eth_secp256k1;NOT NULL" json:"algo"` OperationID string `gorm:"column:operation_id;type:varchar(100);comment:操作 ID;NOT NULL" json:"operation_id"` }
Accounts is the table of accounts.
func (Accounts) AddressPageQuery ¶
AddressPageQuery retrieves a page of addresses from the Accounts table.
It takes in two parameters:
- limit: an integer representing the maximum number of addresses to retrieve.
- offset: an integer representing the starting position of the addresses to retrieve.
It returns two values:
- addrs: a slice of strings containing the retrieved addresses.
- err: an error, if any occurred during the retrieval process.
type BaseModel ¶
type BaseModel struct { ID uint64 `gorm:"column:id;type:bigint(20) unsigned;primary_key;AUTO_INCREMENT;comment:ID" json:"id"` CreatedAt JSONTime `gorm:"<-:false" json:"-"` UpdatedAt JSONTime `gorm:"<-:false" json:"-"` }
BaseModel is the base model for all models.
type EthAddress ¶
EthAddress is a common.Address wrapper
func (*EthAddress) Scan ¶
func (a *EthAddress) Scan(value interface{}) error
Scan scans the given value and assigns it to the EthAddress.
The value parameter should be a string. It returns an error if the value cannot be assigned to the Address. The Address is assigned the value of the common.HexToAddress(str) after unmarshaling the JSONB value.
It returns an error if the value cannot be assigned to the Address, otherwise it returns nil.
type JSONTime ¶
JSONTime for serialize time to json
func (JSONTime) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface