api

package
v1.7.17 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: BSD-3-Clause Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildGenesisArgs

type BuildGenesisArgs struct {
	AvaxAssetID   ids.ID              `json:"avaxAssetID"`
	NetworkID     json.Uint32         `json:"networkID"`
	UTXOs         []UTXO              `json:"utxos"`
	Validators    []PrimaryValidator  `json:"validators"`
	Chains        []Chain             `json:"chains"`
	Time          json.Uint64         `json:"time"`
	InitialSupply json.Uint64         `json:"initialSupply"`
	Message       string              `json:"message"`
	Encoding      formatting.Encoding `json:"encoding"`
}

BuildGenesisArgs are the arguments used to create the genesis data of the Platform Chain. [NetworkID] is the ID of the network [UTXOs] are the UTXOs on the Platform Chain that exist at genesis. [Validators] are the validators of the primary network at genesis. [Chains] are the chains that exist at genesis. [Time] is the Platform Chain's time at network genesis.

type BuildGenesisReply

type BuildGenesisReply struct {
	Bytes    string              `json:"bytes"`
	Encoding formatting.Encoding `json:"encoding"`
}

BuildGenesisReply is the reply from BuildGenesis

type Chain

type Chain struct {
	GenesisData string   `json:"genesisData"`
	VMID        ids.ID   `json:"vmID"`
	FxIDs       []ids.ID `json:"fxIDs"`
	Name        string   `json:"name"`
	SubnetID    ids.ID   `json:"subnetID"`
}

Chain defines a chain that exists at the network's genesis. [GenesisData] is the initial state of the chain. [VMID] is the ID of the VM this chain runs. [FxIDs] are the IDs of the Fxs the chain supports. [Name] is a human-readable, non-unique name for the chain. [SubnetID] is the ID of the subnet that validates the chain

type Owner

type Owner struct {
	Locktime  json.Uint64 `json:"locktime"`
	Threshold json.Uint32 `json:"threshold"`
	Addresses []string    `json:"addresses"`
}

Owner is the repr. of a reward owner sent over APIs.

type PrimaryDelegator

type PrimaryDelegator struct {
	Staker
	RewardOwner     *Owner       `json:"rewardOwner,omitempty"`
	PotentialReward *json.Uint64 `json:"potentialReward,omitempty"`
}

PrimaryDelegator is the repr. of a primary network delegator sent over APIs.

type PrimaryValidator

type PrimaryValidator struct {
	Staker
	// The owner the staking reward, if applicable, will go to
	RewardOwner        *Owner        `json:"rewardOwner,omitempty"`
	PotentialReward    *json.Uint64  `json:"potentialReward,omitempty"`
	DelegationFee      json.Float32  `json:"delegationFee"`
	ExactDelegationFee *json.Uint32  `json:"exactDelegationFee,omitempty"`
	Uptime             *json.Float32 `json:"uptime,omitempty"`
	Connected          bool          `json:"connected"`
	Staked             []UTXO        `json:"staked,omitempty"`
	// The delegators delegating to this validator
	Delegators []PrimaryDelegator `json:"delegators"`
}

PrimaryValidator is the repr. of a primary network validator sent over APIs.

type Staker

type Staker struct {
	TxID        ids.ID       `json:"txID"`
	StartTime   json.Uint64  `json:"startTime"`
	EndTime     json.Uint64  `json:"endTime"`
	Weight      *json.Uint64 `json:"weight,omitempty"`
	StakeAmount *json.Uint64 `json:"stakeAmount,omitempty"`
	NodeID      ids.NodeID   `json:"nodeID"`
}

APIStaker is the representation of a staker sent via APIs. [TxID] is the txID of the transaction that added this staker. [Amount] is the amount of tokens being staked. [StartTime] is the Unix time when they start staking [Endtime] is the Unix time repr. of when they are done staking [NodeID] is the node ID of the staker

func (*Staker) GetWeight

func (v *Staker) GetWeight() uint64

type StaticClient

type StaticClient interface {
	BuildGenesis(
		ctx context.Context,
		args *BuildGenesisArgs,
		options ...rpc.Option,
	) (*BuildGenesisReply, error)
}

StaticClient for interacting with the platformvm static api

func NewStaticClient

func NewStaticClient(uri string) StaticClient

NewClient returns a platformvm client for interacting with the platformvm static api

type StaticService

type StaticService struct{}

StaticService defines the static API methods exposed by the platform VM

func (*StaticService) BuildGenesis

func (ss *StaticService) BuildGenesis(_ *http.Request, args *BuildGenesisArgs, reply *BuildGenesisReply) error

BuildGenesis build the genesis state of the Platform Chain (and thereby the Avalanche network.)

type SubnetValidator

type SubnetValidator struct {
	Staker
	// The owner the staking reward, if applicable, will go to
	Connected bool `json:"connected"`
}

APISubnetValidator is the repr. of a subnet validator sent over APIs.

type UTXO

type UTXO struct {
	Locktime json.Uint64 `json:"locktime"`
	Amount   json.Uint64 `json:"amount"`
	Address  string      `json:"address"`
	Message  string      `json:"message"`
}

UTXO is a UTXO on the Platform Chain that exists at the chain's genesis.

Jump to

Keyboard shortcuts

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