Documentation
¶
Index ¶
- Constants
- Variables
- func CreateBurnRuleFinder() (eventlog.LogFinder, error)
- func CreatePairInitialProvideRuleFinder(pairs map[string]bool) (eventlog.LogFinder, error)
- func QueryToBase64Str[T ContractQueryRequest](query T) (string, error)
- func QueryToJsonStr[T ContractQueryRequest](query T) (string, error)
- type Asset
- type AssetCWToken
- type AssetInfo
- type AssetNativeToken
- type ContractQueryRequest
- type DexType
- type FactoryPairsReq
- type FactoryPairsRes
- type MapperMixin
- type Pair
- type PoolInfoReq
- type PoolInfoRes
Constants ¶
View Source
const ( FactoryAddrIdx = iota FactoryActionIdx FactoryPairIdx FactoryPairAddrIdx FactoryLpAddrIdx )
View Source
const ( TransferAmountKey = "amount" TransferRecipientKey = "recipient" TransferSenderKey = "sender" )
View Source
const ( WasmTransferAction = "transfer" WasmTransferFromAction = "transfer_from" )
View Source
const ( WasmTransferLegacyCw20AddrKey = "contract_address" WasmTransferCw20AddrKey = "_contract_address" WasmTransferActionKey = "action" WasmTransferAmountKey = "amount" WasmTransferFromKey = "from" WasmTransferToKey = "to" WasmTransferTaxFlagPatternKey = "tax" )
View Source
const ( PairInitialProvideAddrIdx = iota PairInitialProvideActionIdx PairInitialProvideAmountIdx PairInitialProvideToIdx PairInitialProvideMatchedLen )
View Source
const ( PairInitialProvideAddrKey = "_contract_address" PairInitialProvideActionKey = "action" PairInitialProvideAmountKey = "amount" PairInitialProvideToKey = "to" )
View Source
const ( PairTaxPaymentReverseChargeIdx = iota PairTaxPaymentTaxAmountIdx PairTaxPaymentTaxMatchedLen )
View Source
const ( PairTaxPaymentReverseChargeKey = "reverse_charge" PairTaxPaymentTaxAmountKey = "tax_amount" )
View Source
const ( BurnAddrIdx = iota BurnActionIdx BurnAmountIdx BurnFromIdx BurnMatchedLen )
View Source
const ( BurnAddrKey = "_contract_address" BurnActionKey = "action" BurnAmountKey = "amount" BurnFromKey = "from" )
View Source
const ( PairSwapAskAssetKey = "ask_asset" PairSwapCommissionAmountKey = "commission_amount" PairSwapOfferAmountKey = "offer_amount" PairSwapOfferAssetKey = "offer_asset" PairSwapReceiverKey = "receiver" PairSwapReturnAmountKey = "return_amount" PairSwapTaxAmountKey = "tax_amount" // columbus-5 PairSwapSenderKey = "sender" PairSwapSpreadAmountKey = "spread_amount" )
View Source
const (
CreatePairMatchedLen = FactoryLpAddrIdx + 1
)
Variables ¶
View Source
var (
PAIR_QUERY_POOL_STRING, _ = QueryToJsonStr[PoolInfoReq](PoolInfoReq{})
PAIR_QUERY_POOL_BASE64_STRING, _ = QueryToBase64Str[PoolInfoReq](PoolInfoReq{})
)
View Source
var ( ErrQueryDifferentHeight = errors.New("query different height") ErrEmptyEventValue = errors.New("empty event value") )
View Source
var ParsableRules = map[string]bool{ string(eventlog.TransferType): true, string(eventlog.FromContract): true, string(eventlog.WasmType): true, string(eventlog.TaxPaymentType): true, }
Functions ¶
func CreateBurnRuleFinder ¶ added in v0.1.2
func QueryToBase64Str ¶
func QueryToBase64Str[T ContractQueryRequest](query T) (string, error)
func QueryToJsonStr ¶
func QueryToJsonStr[T ContractQueryRequest](query T) (string, error)
Types ¶
type AssetCWToken ¶
type AssetCWToken struct {
ContractAddr string `json:"contract_addr,omitempty"`
}
type AssetInfo ¶
type AssetInfo struct {
Token *AssetCWToken `json:"token,omitempty"`
NativeToken *AssetNativeToken `json:"native_token,omitempty"`
}
type AssetNativeToken ¶
type AssetNativeToken struct {
Denom string `json:"denom,omitempty"`
}
type ContractQueryRequest ¶
type ContractQueryRequest interface {
FactoryPairsReq | PoolInfoReq
}
type FactoryPairsReq ¶
type FactoryPairsRes ¶
type FactoryPairsRes struct {
Pairs []Pair `json:"pairs"`
}
type MapperMixin ¶
type MapperMixin struct {
}
func (*MapperMixin) CheckResult ¶
func (m *MapperMixin) CheckResult(res eventlog.MatchedResult, minLen int) error
func (*MapperMixin) SortResult ¶
func (*MapperMixin) SortResult(res eventlog.MatchedResult)
SortResult sorts the result by key split by "_contract_address" @param res will be sorted
type PoolInfoReq ¶
type PoolInfoReq struct {
Pool struct{} `json:"pool"`
}
type PoolInfoRes ¶
type PoolInfoRes struct {
Assets []Asset `json:"assets"`
}
Click to show internal directories.
Click to hide internal directories.