Documentation
¶
Index ¶
- Constants
- type Account
- type ChainInfo
- type Client
- func (client *Client) GetAllTokenBalancesByAddress(ctx context.Context, chainIndex string, address string) ([]TokenBalance, error)
- func (client *Client) GetRealtimePrice(ctx context.Context, chainIndex string, tokenAddresses []string) (map[string]decimal.Decimal, error)
- func (client *Client) GetSupportedChains(ctx context.Context) ([]ChainInfo, error)
- func (client *Client) Quote(ctx context.Context, chainIndex string, ...) (*SwapInstruction, error)
- func (client *Client) SendSwapTransaction(ctx context.Context, svcCtx *svc.ServiceContext, wallet *solana.Wallet, ...) (string, error)
- type DexProtocol
- type DexRouter
- type Instruction
- type Quote
- type RealtimePrice
- type RouterResult
- type SubRouter
- type SwapInstruction
- type Token
- type TokenAssets
- type TokenBalance
- type Transaction
Constants ¶
View Source
const (
SolanaChainIndex = "501"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetAllTokenBalancesByAddress ¶
func (*Client) GetRealtimePrice ¶
func (*Client) GetSupportedChains ¶
func (*Client) SendSwapTransaction ¶
func (client *Client) SendSwapTransaction(ctx context.Context, svcCtx *svc.ServiceContext, wallet *solana.Wallet, swapInstruction *SwapInstruction, priorityLevel settings.PriorityLevel, maxRetries uint) (string, error)
type DexProtocol ¶
type Instruction ¶
type RealtimePrice ¶
type RouterResult ¶
type RouterResult struct {
ChainId string `json:"chainId"`
ChainIndex string `json:"chainIndex"`
DexRouterList []DexRouter `json:"dexRouterList"`
EstimateGasFee decimal.Decimal `json:"estimateGasFee"`
FromToken Token `json:"fromToken"`
FromTokenAmount decimal.Decimal `json:"fromTokenAmount"`
PriceImpactPercentage decimal.Decimal `json:"priceImpactPercentage"`
QuoteCompareList []Quote `json:"quoteCompareList"`
SwapMode string `json:"swapMode"`
ToToken Token `json:"toToken"`
ToTokenAmount decimal.Decimal `json:"toTokenAmount"`
TradeFee decimal.Decimal `json:"tradeFee"`
}
type SubRouter ¶
type SubRouter struct {
DexProtocol []DexProtocol `json:"dexProtocol"`
FromToken Token `json:"fromToken"`
ToToken Token `json:"toToken"`
}
type SwapInstruction ¶
type SwapInstruction struct {
AddressLookupTableAccount []string `json:"addressLookupTableAccount"`
InstructionLists []Instruction `json:"instructionLists"`
RouterResult RouterResult `json:"routerResult"`
Tx Transaction `json:"tx"`
}
type TokenAssets ¶
type TokenAssets struct {
TokenAssets []TokenBalance `json:"tokenAssets"`
}
type TokenBalance ¶
type TokenBalance struct {
ChainIndex string `json:"chainIndex"`
TokenContractAddress string `json:"tokenContractAddress"`
Symbol string `json:"symbol"`
Balance decimal.Decimal `json:"balance"`
TokenPrice decimal.Decimal `json:"tokenPrice"`
IsRiskToken bool `json:"isRiskToken"`
RawBalance string `json:"rawBalance"`
Address string `json:"address"`
}
Click to show internal directories.
Click to hide internal directories.