client

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvmBalance added in v0.2.0

type AvmBalance struct {
	Asset   string `json:"asset"`
	Balance string `json:"balance"`
}

type AvmClient

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

AvmClient talks to the X chain

func NewAvmClient

func NewAvmClient(endpoint string) AvmClient

func (AvmClient) GetAllBalances added in v0.2.0

func (c AvmClient) GetAllBalances(address string) (result GetAllBalancesResponse, err error)

GetAllBalances returns all assets balances for a given address

type Balance

type Balance struct {
	Balance            string `json:"balance"`
	Unlocked           string `json:"unlocked"`
	LockedStakeable    string `json:"lockedStakeable"`
	LockedNotStakeable string `json:"lockedNotStakeable"`
}

type Blockchain

type Blockchain struct {
	ID       string `json:"id"`
	SubnetID string `json:"subnetID"`
	Name     string `json:"name"`
	VMID     string `json:"vmId"`
}

type BlockchainsResponse

type BlockchainsResponse struct {
	Blockchains []Blockchain `json:"blockchains"`
}

type Client

type Client struct {
	Avm      AvmClient
	Platform PlatformClient
	Info     InfoClient
	Ipc      IpcClient
}

func New

func New(endpoint string) *Client

type Delegator

type Delegator struct {
	StartTime       string      `json:"startTime"`
	EndTime         string      `json:"endTime"`
	StakeAmount     string      `json:"stakeAmount"`
	NodeID          string      `json:"nodeID"`
	RewardOwner     RewardOwner `json:"rewardOwner"`
	PotentialReward string      `json:"potentialReward"`
	DelegationFee   string      `json:"delegationFee"`
	Uptime          string      `json:"uptime"`
	Connected       bool        `json:"connected"`
}

type GetAllBalancesResponse added in v0.2.0

type GetAllBalancesResponse struct {
	Balances []AvmBalance `json:"balances"`
}

type InfoClient

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

func NewInfoClient

func NewInfoClient(endpoint string) InfoClient

func (InfoClient) BlockchainID

func (c InfoClient) BlockchainID(alias string) (string, error)

func (InfoClient) NetworkID

func (c InfoClient) NetworkID() (string, error)

func (InfoClient) NetworkName

func (c InfoClient) NetworkName() (string, error)

func (InfoClient) NodeID

func (c InfoClient) NodeID() (string, error)

func (InfoClient) NodeVersion

func (c InfoClient) NodeVersion() (string, error)

func (InfoClient) Peers

func (c InfoClient) Peers() ([]Peer, error)

func (InfoClient) TxFee

func (c InfoClient) TxFee() (*TxFeeResponse, error)

type IpcClient

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

func NewIpcClient

func NewIpcClient(endpoint string) IpcClient

type MinStakeResponse

type MinStakeResponse struct {
	MinValidatorStake string `json:"minValidatorStake"`
	MinDelegatorStake string `json:"minDelegatorStake"`
}

type Peer

type Peer struct {
	ID           string `json:"nodeID"`
	IP           string `json:"ip"`
	PublicIP     string `json:"publicIP"`
	Version      string `json:"version"`
	LastSent     string `json:"lastSent"`
	LastReceived string `json:"lastReceived"`
}

func (Peer) Metadata

func (p Peer) Metadata() map[string]interface{}

type PlatformClient

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

PlatformClient talks to the P chain

func NewPlatformClient

func NewPlatformClient(endpoint string) PlatformClient

func (PlatformClient) GetBalance

func (c PlatformClient) GetBalance(address string) (resp *Balance, err error)

func (PlatformClient) GetBlockchains

func (c PlatformClient) GetBlockchains() (resp *BlockchainsResponse, err error)

func (PlatformClient) GetCurrentHeight

func (c PlatformClient) GetCurrentHeight() (int64, error)

func (PlatformClient) GetCurrentValidators

func (c PlatformClient) GetCurrentValidators() (resp *ValidatorsResponse, err error)

func (PlatformClient) GetMinStake

func (c PlatformClient) GetMinStake() (resp *MinStakeResponse, err error)

func (PlatformClient) GetPendingValidators

func (c PlatformClient) GetPendingValidators() (resp *ValidatorsResponse, err error)

type RewardOwner

type RewardOwner struct {
	Locktime  string   `json:"locktime"`
	Threshold string   `json:"threshold"`
	Addresses []string `json:"addresses"`
}

type TxFeeResponse

type TxFeeResponse struct {
	CreationTxFee string `json:"creationTxFee"`
	TxFee         string `json:"txFee"`
}

type Validator

type Validator struct {
	StartTime       string      `json:"startTime"`
	EndTime         string      `json:"endTime"`
	StakeAmount     string      `json:"stakeAmount"`
	NodeID          string      `json:"nodeID"`
	RewardOwner     RewardOwner `json:"rewardOwner"`
	PotentialReward string      `json:"potentialReward"`
	DelegationFee   string      `json:"delegationFee"`
	Uptime          string      `json:"uptime"`
	Connected       bool        `json:"connected"`
	Delegators      []Delegator `json:"delegators"`
}

type ValidatorsResponse

type ValidatorsResponse struct {
	Validators []Validator `json:"validators"`
	Delegators []Delegator `json:"delegators"`
}

Jump to

Keyboard shortcuts

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