gethlyleaddresses

package
v2.0.0-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBColumns = []string{
	"id",
	"uuid",
	"name",
	"alternate_name",
	"description",
	"address_str",
	"address_type_id",
	"created_by",
	"created_at",
	"updated_by",
	"updated_at",
}
View Source
var DBColumnsInsertGethAddressList = []string{
	"uuid",
	"name",
	"alternate_name",
	"description",
	"address_str",
	"address_type_id",
	"created_by",
	"created_at",
	"updated_by",
	"updated_at",
}
View Source
var TestAllData = []GethAddress{TestData1, TestData2}
View Source
var TestData1 = GethAddress{
	ID:            utils.Ptr[int](1),
	UUID:          "880607ab-2833-4ad7-a231-b983a61c7b39",
	Name:          "EOA: 0xFC3d170c29581E60861Ac2b500b098722d9861e9",
	AlternateName: "EOA: 0xFC3d170c29581E60861Ac2b500b098722d9861e9",
	Description:   "",
	AddressStr:    "0xFC3d170c29581E60861Ac2b500b098722d9861e9",
	AddressTypeID: utils.Ptr[int](utils.EOA_ADDRESS_TYPE_STRUCTURED_VALUE_ID),
	CreatedBy:     "SYSTEM",
	CreatedAt:     utils.SampleCreatedAtTime,
	UpdatedBy:     "SYSTEM",
	UpdatedAt:     utils.SampleCreatedAtTime,
}
View Source
var TestData2 = GethAddress{
	ID:            utils.Ptr[int](2),
	UUID:          "880607ab-2833-4ad7-a231-b983a61cad34",
	Name:          "Contract: 0x40762e9b87aa6457f069925a86352d13339cb68f",
	AlternateName: "Contract: 0x40762e9b87aa6457f069925a86352d13339cb68f",
	Description:   "",
	AddressStr:    "0x40762e9b87aa6457f069925a86352d13339cb68f",
	AddressTypeID: utils.Ptr[int](utils.CONTRACT_ADDRESS_TYPE_STRUCTURED_VALUE_ID),
	CreatedBy:     "SYSTEM",
	CreatedAt:     utils.SampleCreatedAtTime,
	UpdatedBy:     "SYSTEM",
	UpdatedAt:     utils.SampleCreatedAtTime,
}

Functions

func AddGethAddressToMockRows

func AddGethAddressToMockRows(mock pgxmock.PgxPoolIface, dataList []GethAddress) *pgxmock.Rows

func GetTotalGethAddressCount

func GetTotalGethAddressCount(dbConnPgx utils.PgxIface) (*int, error)

func InsertGethAddress

func InsertGethAddress(dbConnPgx utils.PgxIface, gethAddress *GethAddress) (int, error)

func InsertGethAddressList

func InsertGethAddressList(dbConnPgx utils.PgxIface, gethAddressList []GethAddress) error

func RemoveGethAddress

func RemoveGethAddress(dbConnPgx utils.PgxIface, gethAddressID *int) error

func UpdateGethAddress

func UpdateGethAddress(dbConnPgx utils.PgxIface, gethAddress *GethAddress) error

Types

type GethAddress

type GethAddress struct {
	ID            *int      `json:"id" db:"id"`                         //1
	UUID          string    `json:"uuid" db:"uuid"`                     //2
	Name          string    `json:"name" db:"name" db:"name"`           //3
	AlternateName string    `json:"alternateName" db:"alternate_name"`  //4
	Description   string    `json:"description" db:"description"`       //5
	AddressStr    string    `json:"addressStr" db:"address_str"`        //6
	AddressTypeID *int      `json:"addressTypeId" db:"address_type_id"` //7
	CreatedBy     string    `json:"createdBy" db:"created_by"`          //8
	CreatedAt     time.Time `json:"createdAt" db:"created_at"`          //9
	UpdatedBy     string    `json:"updatedBy" db:"updated_by"`          //10
	UpdatedAt     time.Time `json:"updatedAt" db:"updated_at"`          //11
}

func CreateEOAOrContractAddress

func CreateEOAOrContractAddress(dbConnPgx utils.PgxIface, addressStr string, cl *ethclient.Client) (*GethAddress, error)

TODO: skip test (need to mock ethclient)

func CreateGethAddress

func CreateGethAddress(addressStr string, isEOA bool) (*GethAddress, error)

func CreateOrGetAddress

func CreateOrGetAddress(dbConnPgx utils.PgxIface, gethAddress *GethAddress) (*GethAddress, error)

func CreateOrGetContractAddress

func CreateOrGetContractAddress(dbConnPgx utils.PgxIface, addressStr string) (*GethAddress, error)

func CreateOrGetContractAddressFromAsset

func CreateOrGetContractAddressFromAsset(dbConnPgx utils.PgxIface, asset *asset.Asset) (*GethAddress, error)

func CreateOrGetEOAAddress

func CreateOrGetEOAAddress(dbConnPgx utils.PgxIface, addressStr string) (*GethAddress, error)

func GetGethAddress

func GetGethAddress(dbConnPgx utils.PgxIface, gethAddressID *int) (*GethAddress, error)

func GetGethAddressByAddressStr

func GetGethAddressByAddressStr(dbConnPgx utils.PgxIface, addressStr string) (*GethAddress, error)

func GetGethAddressList

func GetGethAddressList(dbConnPgx utils.PgxIface) ([]GethAddress, error)

func GetGethAddressListByAddressStr

func GetGethAddressListByAddressStr(dbConnPgx utils.PgxIface, addressStrList []string) ([]GethAddress, error)

func GetGethAddressListByIds

func GetGethAddressListByIds(dbConnPgx utils.PgxIface, addressIDs []int) ([]GethAddress, error)

func GetGethAddressListByPagination

func GetGethAddressListByPagination(dbConnPgx utils.PgxIface, _start, _end *int, _order, _sort string, _filters []string) ([]GethAddress, error)

for refinedev

Jump to

Keyboard shortcuts

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