Documentation ¶
Index ¶
- Constants
- func GetBlockFolderPath(chainId string) []string
- func GetPairFolderPath(chainId string) []string
- func NewLcdClient(baseUrl string, c httpClient) lcdClient
- type AssetInfo
- type AssetInfoWithType
- type BlockTxsDTO
- type BlockTxsRaw
- type DataStore
- type PairListDTO
- type PairListResponse
- type PoolAssetInfo
- type PoolAssetInfoWithType
- type PoolInfo
- type PoolInfoDTO
- type PoolInfoList
- type ReadStore
- type ReadStoreMock
- type TxDTO
- type TxRaw
- type UnitPair
- type UnitPairDTO
Constants ¶
View Source
const ( BLOCK_SUFFIX = "block" PAIR_SUFFIX = "pair" )
View Source
const ( TOKEN = "token" NATIVE_TOKEN = "native_token" )
Variables ¶
This section is empty.
Functions ¶
func GetBlockFolderPath ¶
func GetPairFolderPath ¶
func NewLcdClient ¶
func NewLcdClient(baseUrl string, c httpClient) lcdClient
Types ¶
type AssetInfo ¶
type AssetInfo struct { Token *struct { ContractAddr string `json:"contract_addr"` } `json:"token,omitempty"` NativeToken *struct { Denom string `json:"denom"` } `json:"native_token,omitempty"` }
func (*AssetInfo) GetInfo ¶
func (assets *AssetInfo) GetInfo() *AssetInfoWithType
type AssetInfoWithType ¶
type BlockTxsDTO ¶
func FakeBlockDto ¶
func FakeBlockDto() BlockTxsDTO
type BlockTxsRaw ¶
type DataStore ¶
type DataStore interface { // testing purpose SetNewServiceClientFunc(func(cc grpc1.ClientConn) txtypes.ServiceClient) SetNewS3ClientFunc(func() (s3client.S3ClientInterface, error)) SetNewQueryClientFunc(func(cc grpc1.ClientConn) wasm.QueryClient) // additional wrapper for Collector module usage GetNodeSyncedHeight() (int64, error) GetChainId() string GetLatestProcessedBlockNumber(...string) (int64, error) ChangeLatestBlock(int64, ...string) error UploadBlockBinary(int64, []byte, ...string) error // exposed to public usage in actual AddCustomInterfaceRegistry(...func(codectypes.InterfaceRegistry)) GetBlockByHeight(int64) (*tendermintType.Block, error) GetBlockTxsFromHeight(int64) (*BlockTxsRaw, error) GetBlockTxsFromBlockData(*tendermintType.Block) (*BlockTxsRaw, error) GetCurrentPairsList(int64) (*PairListDTO, error) GetCurrentPoolStatusOfUnitPair(int64, string) (*PoolInfoDTO, error) GetCurrentPoolStatusOfAllPairs(int64) (*PoolInfoList, error) GetPoolStatusOfUnitPairByHeight(int64, string, ...string) (*PoolInfoDTO, error) GetPoolStatusOfAllPairsByHeight(int64, ...string) (*PoolInfoList, error) UploadPoolInfoBinary(int64, []byte, ...string) error }
type PairListDTO ¶
type PairListDTO struct {
Pairs map[string]UnitPairDTO `json:"pairs"`
}
type PairListResponse ¶
type PairListResponse struct {
Pairs []UnitPair `json:"pairs"`
}
type PoolAssetInfo ¶
func (*PoolAssetInfo) GetInfo ¶
func (pool *PoolAssetInfo) GetInfo() *PoolAssetInfoWithType
type PoolAssetInfoWithType ¶
type PoolAssetInfoWithType struct { Info *AssetInfoWithType `json:"info"` Amount *cosmossdk.Int `json:"amount"` }
type PoolInfo ¶
type PoolInfo struct { Assets [2]PoolAssetInfo `json:"assets"` }
func (*PoolInfo) Convert ¶
func (pool *PoolInfo) Convert() *PoolInfoDTO
type PoolInfoDTO ¶
type PoolInfoDTO struct { Assets [2]PoolAssetInfoWithType `json:"assets"` }
type PoolInfoList ¶
type PoolInfoList struct {
Pairs map[string]PoolInfoDTO `json:"pairs"`
}
func FakePoolInfoList ¶
func FakePoolInfoList() PoolInfoList
type ReadStore ¶
type ReadStore interface { GetLatestHeight() (uint64, error) GetBlockByHeight(height uint64) (*BlockTxsDTO, error) GetPoolStatusOfAllPairsByHeight(uint64) (*PoolInfoList, error) }
func NewReadStore ¶
func NewReadStore(chainId string, s3Client s3client.S3ClientInterface) ReadStore
func NewReadStoreWithGrpc ¶
type ReadStoreMock ¶
func (*ReadStoreMock) GetBlockByHeight ¶
func (m *ReadStoreMock) GetBlockByHeight(height uint64) (*BlockTxsDTO, error)
GetBlockByHeight implements ReadStore
func (*ReadStoreMock) GetLatestHeight ¶
func (m *ReadStoreMock) GetLatestHeight() (uint64, error)
GetLatestHeight implements ReadStore
func (*ReadStoreMock) GetPoolStatusOfAllPairsByHeight ¶
func (m *ReadStoreMock) GetPoolStatusOfAllPairsByHeight(uint64) (*PoolInfoList, error)
GetPoolStatusOfAllPairsByHeight implements ReadStore
type TxDTO ¶
type TxDTO struct { Height string `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` TxHash string `protobuf:"bytes,2,opt,name=txhash,proto3" json:"txhash,omitempty"` Codespace string `protobuf:"bytes,3,opt,name=codespace,proto3" json:"codespace,omitempty"` Code uint32 `protobuf:"varint,4,opt,name=code,proto3" json:"code,omitempty"` Data string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` RawLog string `protobuf:"bytes,6,opt,name=raw_log,json=rawLog,proto3" json:"raw_log,omitempty"` Logs cosmossdk.ABCIMessageLogs `protobuf:"bytes,7,rep,name=logs,proto3,castrepeated=ABCIMessageLogs" json:"logs"` Info string `protobuf:"bytes,8,opt,name=info,proto3" json:"info,omitempty"` GasWanted string `protobuf:"varint,9,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` GasUsed string `protobuf:"varint,10,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` // the type of Tx will be replace when we can find the appropriate type Tx *codectypes.Any `protobuf:"bytes,11,opt,name=tx,proto3" json:"tx,omitempty"` Timestamp string `protobuf:"bytes,12,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Events []abcitypes.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"` }
Copied from the type definition of Cosmos SDK and revised the stringed integer
type TxRaw ¶
type TxRaw struct { TxHash string TxContent *txtypes.GetTxResponse }
func (*TxRaw) MarshalJSON ¶
type UnitPair ¶
type UnitPair struct { AssetInfo [2]AssetInfo `json:"asset_infos"` ContractAddr string `json:"contract_addr"` LiquidityToken string `json:"liquidity_token"` AssetDecimals [2]uint `json:"asset_decimals"` }
func (*UnitPair) Convert ¶
func (pair *UnitPair) Convert() *UnitPairDTO
type UnitPairDTO ¶
type UnitPairDTO struct { AssetInfo [2]AssetInfoWithType `json:"asset_infos"` ContractAddr string `json:"contract_addr"` LiquidityToken string `json:"liquidity_token"` AssetDecimals [2]uint `json:"asset_decimals"` }
Click to show internal directories.
Click to hide internal directories.