client

package
v0.0.0-...-bd3dd7f Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNetworkNotSupport error = errors.New("network not supported")

Functions

This section is empty.

Types

type AaveV2RPC

type AaveV2RPC interface {
	AaveV2UnClaimedRewards(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV2StakedReward(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV2StakedTokenBalance(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

	AaveV2AbptStakedReward(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV2AbptStakedTokenBalance(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

	AaveV2AccountData(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*model.AaveV2AccountData, error)
	AaveV2AccountHealthRate(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV2AccountActiveAssets(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (deposits, borrows []common.Address, err error)

	AaveV2AccountATokenBalance(ctx context.Context, network constant.Network, account, assetAddress common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV2AccountDebt(ctx context.Context, network constant.Network, account common.Address, asset common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV2RewardToken(ctx context.Context, network constant.Network, blockNumber *big.Int) (*common.Address, error)
}

type AaveV3RPC

type AaveV3RPC interface {
	AaveV3AllReservesTokens(ctx context.Context, blockNumber *big.Int) ([]model.ERC20Token, error)
	AaveV3AssetBalance(ctx context.Context, account common.Address, asset common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV3LiquidationThreshold(ctx context.Context, asset common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV3UserRewards(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
}

type AuraRPC

type AuraRPC interface {
	AaveV3AuraLockedPosition(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV3AuraLockedReward(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	AaveV3AuraFarmingPool(ctx context.Context, contractAddress common.Address, blockNumber *big.Int) (common.Address, error)
	AaveV3AuraFarmingPoolID(ctx context.Context, contractAddress common.Address, blockNumber *big.Int) (*big.Int, error)
	AaveV3AuraFarmingBalanceEarned(ctx context.Context, account common.Address, contractAddress common.Address, blockNumber *big.Int) (farm, earned *decimal.Decimal, err error)
}

type AuraTokenRPC

type AuraTokenRPC interface {
	ReductionPerCliff(ctx context.Context, blockNumber *big.Int) (*big.Int, error)
	TotalSupply(ctx context.Context, blockNumber *big.Int) (*big.Int, error)
	EmissionsMaxSupply(ctx context.Context, blockNumber *big.Int) (*big.Int, error)
	TotalCliffs(ctx context.Context, blockNumber *big.Int) (*big.Int, error)
}

type BancorRPC

type BancorRPC interface {
	BancorV3GetStakedProgramIds(ctx context.Context, account common.Address, blockNumber *big.Int) ([]*big.Int, error)
}

type CallParam

type CallParam struct {
	To          common.Address `json:"to"`
	CallData    string         `json:"data"`
	BlockNumber *big.Int       `json:"blockNumber"`
}

type GMXRPC

type GMXRPC interface {
	StakeEthReward(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	StakeEsGmxReward(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	StakeGlp(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	StakeGlpRewardEth(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	StakeGmx(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	StakeEsGmx(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	GmxVesterYield(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, *decimal.Decimal, error)
	GlpVesterYield(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, *decimal.Decimal, error)
}

type NetworkSupport

type NetworkSupport interface {
	SupportNetwork(network constant.Network) bool
	SupportNetworks() []constant.Network
}

type NodeClient

type NodeClient struct {
	// contains filtered or unexported fields
}

func NewNodeClientsWithEndpoints

func NewNodeClientsWithEndpoints(endpoints []string) (*NodeClient, error)

func (*NodeClient) AaveV2AbptStakedReward

func (n *NodeClient) AaveV2AbptStakedReward(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) AaveV2AbptStakedTokenBalance

func (n *NodeClient) AaveV2AbptStakedTokenBalance(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) AaveV2AccountATokenBalance

func (n *NodeClient) AaveV2AccountATokenBalance(ctx context.Context, network constant.Network, account common.Address, assetAddress common.Address,
	blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) AaveV2AccountActiveAssets

func (n *NodeClient) AaveV2AccountActiveAssets(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (deposits, borrows []common.Address, err error)

func (*NodeClient) AaveV2AccountData

func (n *NodeClient) AaveV2AccountData(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*model.AaveV2AccountData, error)

func (*NodeClient) AaveV2AccountDebt

func (n *NodeClient) AaveV2AccountDebt(ctx context.Context, network constant.Network, account common.Address, asset common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) AaveV2AccountHealthRate

func (n *NodeClient) AaveV2AccountHealthRate(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) AaveV2RewardToken

func (n *NodeClient) AaveV2RewardToken(ctx context.Context, network constant.Network, blockNumber *big.Int) (*common.Address, error)

func (*NodeClient) AaveV2StakedReward

func (n *NodeClient) AaveV2StakedReward(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) AaveV2StakedTokenBalance

func (n *NodeClient) AaveV2StakedTokenBalance(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) AaveV2UnClaimedRewards

func (n *NodeClient) AaveV2UnClaimedRewards(ctx context.Context, network constant.Network, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) AggregatedCalls

func (n *NodeClient) AggregatedCalls(ctx context.Context, calls []multicall.Multicall3Call3, blockNumber *big.Int) ([]multicall.Multicall3Result, error)

func (*NodeClient) AggregatedERC20Token

func (n *NodeClient) AggregatedERC20Token(ctx context.Context, address common.Address, blockNumber *big.Int) (*model.ERC20Token, error)

func (*NodeClient) Call

func (n *NodeClient) Call(ctx context.Context, callParam CallParam) ([]byte, error)

func (*NodeClient) ERC20Balance

func (n *NodeClient) ERC20Balance(ctx context.Context, tokenAddress, accountAddress common.Address) (*big.Int, error)

func (*NodeClient) ERC20Decimals

func (n *NodeClient) ERC20Decimals(ctx context.Context, address common.Address) (uint8, error)

func (*NodeClient) ERC20Meta

func (n *NodeClient) ERC20Meta(ctx context.Context, address common.Address) (*model.ERC20Token, error)

func (*NodeClient) ERC20Symbol

func (n *NodeClient) ERC20Symbol(ctx context.Context, address common.Address) (string, error)

func (*NodeClient) ERC20TotalSupply

func (n *NodeClient) ERC20TotalSupply(ctx context.Context, address common.Address) (*big.Int, error)

func (*NodeClient) ETHClient

func (n *NodeClient) ETHClient() *ethclient.Client

func (*NodeClient) GlpVesterYield

func (n *NodeClient) GlpVesterYield(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, *decimal.Decimal, error)

func (*NodeClient) GmxVesterYield

func (n *NodeClient) GmxVesterYield(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, *decimal.Decimal, error)

func (*NodeClient) IsContract

func (n *NodeClient) IsContract(ctx context.Context, address common.Address) (bool, error)

func (*NodeClient) IsERC1155

func (n *NodeClient) IsERC1155(ctx context.Context, address common.Address) (bool, error)

func (*NodeClient) IsERC20

func (n *NodeClient) IsERC20(ctx context.Context, address common.Address) (bool, error)

func (*NodeClient) IsERC721

func (n *NodeClient) IsERC721(ctx context.Context, address common.Address) (bool, error)

func (*NodeClient) LatestClient

func (n *NodeClient) LatestClient() *ethclient.Client

Latest Client returns the client with the latest block number. It only works on specific node, like 'http://192.xxx.xxx.xx:8045'. It will NOT work when connected to a gateway like 'https://ankr.com/eth', because the request itself will be sent to one of the nodes randomly.

func (*NodeClient) StakeEsGmx

func (n *NodeClient) StakeEsGmx(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) StakeEsGmxReward

func (n *NodeClient) StakeEsGmxReward(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) StakeEthReward

func (n *NodeClient) StakeEthReward(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) StakeGlp

func (n *NodeClient) StakeGlp(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) StakeGlpRewardEth

func (n *NodeClient) StakeGlpRewardEth(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) StakeGmx

func (n *NodeClient) StakeGmx(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) SynthetixGetCollateral

func (n *NodeClient) SynthetixGetCollateral(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) SynthetixGetSethDebtBalance

func (n *NodeClient) SynthetixGetSethDebtBalance(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) SynthetixGetSusdDebtBalance

func (n *NodeClient) SynthetixGetSusdDebtBalance(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) SynthetixGetVestingDetails

func (n *NodeClient) SynthetixGetVestingDetails(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, uint64, *decimal.Decimal, error)

func (*NodeClient) SynthetixLiquidatorRewards

func (n *NodeClient) SynthetixLiquidatorRewards(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

func (*NodeClient) SynthetixRewards

func (n *NodeClient) SynthetixRewards(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, *decimal.Decimal, error)

func (*NodeClient) TokenPrice

func (n *NodeClient) TokenPrice(ctx context.Context, network constant.Network, tokenAddress common.Address, blockNumber *big.Int) (*decimal.Decimal, error)

type OneInchRPC

type OneInchRPC interface {
	TokenPrice(ctx context.Context, network constant.Network, tokenAddress common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
}

type SynthetixRPC

type SynthetixRPC interface {
	SynthetixGetSusdDebtBalance(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	SynthetixGetSethDebtBalance(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	SynthetixGetCollateral(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
	SynthetixRewards(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, *decimal.Decimal, error)
	SynthetixGetVestingDetails(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, uint64, *decimal.Decimal, error)
	SynthetixLiquidatorRewards(ctx context.Context, account common.Address, blockNumber *big.Int) (*decimal.Decimal, error)
}

Jump to

Keyboard shortcuts

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