oklink

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const ChainExplorerName = "oklink"

Variables

This section is empty.

Functions

func StringToUint64

func StringToUint64(s string, defaultValue uint64) uint64

Types

type AddressBalanceMultiBalance

type AddressBalanceMultiBalance struct {
	Address string `json:"address"`
	Balance string `json:"balance"`
}

AddressBalanceMultiBalance The BalanceList field within the Data field within the Response structure of Fundamental blockchain data -> Address data -> Get native token balance in batches

type AddressBalanceMultiData

type AddressBalanceMultiData struct {
	Symbol      string                       `json:"symbol"`
	BalanceList []AddressBalanceMultiBalance `json:"balanceList"`
}

AddressBalanceMultiData The Data field within the Response structure of Fundamental blockchain data -> Address data -> Get native token balance in batches

type AddressSummaryData

type AddressSummaryData struct {
	ChainFullName                 string `json:"chainFullName"`
	ChainShortName                string `json:"chainShortName"`
	Address                       string `json:"address"`
	ContractAddress               string `json:"contractAddress"`
	Balance                       string `json:"balance"`
	BalanceSymbol                 string `json:"balanceSymbol"`
	TransactionCount              string `json:"transactionCount"`
	Verifying                     string `json:"verifying"`
	SendAmount                    string `json:"sendAmount"`
	ReceiveAmount                 string `json:"receiveAmount"`
	TokenAmount                   string `json:"tokenAmount"`
	TotalTokenValue               string `json:"totalTokenValue"`
	CreateContractAddress         string `json:"createContractAddress"`
	CreateContractTransactionHash string `json:"createContractTransactionHash"`
	FirstTransactionTime          string `json:"firstTransactionTime"`
	LastTransactionTime           string `json:"lastTransactionTime"`
	Token                         string `json:"token"`
	Bandwidth                     string `json:"bandwidth"`
	Energy                        string `json:"energy"`
	VotingRights                  string `json:"votingRights"`
	UnclaimedVotingRewards        string `json:"unclaimedVotingRewards"`
	IsAaAddress                   bool   `json:"isAaAddress"`
}

AddressSummaryData The Data field within the Response structure of Fundamental blockchain data -> Address Data -> Get basic address details

type AddressTokenBalanceData

type AddressTokenBalanceData struct {
	Limit     string                     `json:"limit"`
	Page      string                     `json:"page"`
	TotalPage string                     `json:"totalPage"`
	TokenList []AddressTokenBalanceToken `json:"tokenList"`
}

AddressTokenBalanceData The Data field within the Response structure of Fundamental blockchain data -> Address data -> Get token balance details by address

type AddressTokenBalanceMultiBalance

type AddressTokenBalanceMultiBalance struct {
	Address              string `json:"address"`
	HoldingAmount        string `json:"holdingAmount"`
	TokenContractAddress string `json:"tokenContractAddress"`
}

AddressTokenBalanceMultiBalance The BalanceList field within the Data field within the Response structure of Fundamental blockchain data -> Address data -> Get token balance in batches

type AddressTokenBalanceMultiData

type AddressTokenBalanceMultiData struct {
	Page        string                            `json:"page"`
	Limit       string                            `json:"limit"`
	TotalPage   string                            `json:"totalPage"`
	BalanceList []AddressTokenBalanceMultiBalance `json:"balanceList"`
}

AddressTokenBalanceMultiData The Data field within the Response structure of Fundamental blockchain data -> Address data -> Get token balance in batches

type AddressTokenBalanceToken

type AddressTokenBalanceToken struct {
	Symbol               string `json:"symbol"`
	TokenContractAddress string `json:"tokenContractAddress"`
	HoldingAmount        string `json:"holdingAmount"`
	PriceUsd             string `json:"priceUsd"`
	ValueUsd             string `json:"valueUsd"`
	TokenId              string `json:"tokenId"`
}

AddressTokenBalanceToken The TokenList field within the Data field within the Response structure of Fundamental blockchain data -> Address data -> Get token balance details by address

type AddressUtxoData

type AddressUtxoData struct {
	Page      string            `json:"page"`
	Limit     string            `json:"limit"`
	TotalPage string            `json:"totalPage"`
	UtxoList  []AddressUtxoUtxo `json:"utxoList"`
}

AddressUtxoData The Data field within the Response structure of UTXO-specific data -> Get remaining UTXO addresses

type AddressUtxoUtxo

type AddressUtxoUtxo struct {
	TxId          string `json:"txid"`
	Height        string `json:"height"`
	BlockTime     string `json:"blockTime"`
	Address       string `json:"address"`
	UnspentAmount string `json:"unspentAmount"`
	Index         string `json:"index"`
}

AddressUtxoUtxo The UtxoList field within the Data field within the Response structure of UTXO-specific data -> Get remaining UTXO addresses

type ApiResponse

type ApiResponse[T any] struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Data T      `json:"data"`
}

type ChainExplorerAdaptor

type ChainExplorerAdaptor struct {
	explorer.ChainExplorerAdaptor
	// contains filtered or unexported fields
}

func NewChainExplorerAdaptor

func NewChainExplorerAdaptor(key string, baseURL string, verbose bool, timeout time.Duration) (*ChainExplorerAdaptor, error)

func (*ChainExplorerAdaptor) GetAccountBalance

GET /api/v5/explorer/address/address-summary?chainShortName=eth&address=0x85c6627c4ed773cb7c32644b041f58a058b00d30

func (*ChainExplorerAdaptor) GetAccountUtxo

func (*ChainExplorerAdaptor) GetEstimateGasFee

func (*ChainExplorerAdaptor) GetMultiAccountBalance

func (cea *ChainExplorerAdaptor) GetMultiAccountBalance(request *account.AccountBalanceRequest) ([]*account.AccountBalanceResponse, error)

func (*ChainExplorerAdaptor) GetTokenList

func (cea *ChainExplorerAdaptor) GetTokenList(request *token.TokenRequest) ([]token.TokenResponse, error)

GET /api/v5/explorer/token/token-list

func (*ChainExplorerAdaptor) GetTxByAddress

func (*ChainExplorerAdaptor) GetTxByHash

func (cea *ChainExplorerAdaptor) GetTxByHash(request *transaction.TxRequest) (*transaction.TxResponse, error)

type TokenListData

type TokenListData struct {
	Limit     string          `json:"limit"`
	Page      string          `json:"page"`
	TotalPage string          `json:"totalPage"`
	TokenList []TokenListInfo `json:"tokenList"`
}

type TokenListInfo

type TokenListInfo struct {
	Symbol               string `json:"symbol"`
	Token                string `json:"token"`         // 代币名字简称:USDC
	TokenId              string `json:"tokenId"`       // 默认为0
	TotalSupply          string `json:"totalSupply"`   // 最大供应量
	TokenFullName        string `json:"tokenFullName"` // 代币名字全称:USDCoin
	Precision            string `json:"precision"`     // 精度 默认为1
	TokenContractAddress string `json:"tokenContractAddress"`
	TokenInscriptionId   string `json:"tokenInscriptionId"` // 铭文代币的铭文ID
}

Jump to

Keyboard shortcuts

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