api

package
v1.19.8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: BSD-3-Clause Imports: 21 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ProposedHeightJSON = `"proposed"`
	ProposedHeight     = math.MaxUint64
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIL1Validator

type APIL1Validator struct {
	NodeID    ids.NodeID  `json:"nodeID"`
	Weight    json.Uint64 `json:"weight"`
	StartTime json.Uint64 `json:"startTime"`
	BaseL1Validator
}

APIL1Validator is the representation of a L1 validator sent over APIs.

type BaseL1Validator

type BaseL1Validator struct {
	ValidationID *ids.ID `json:"validationID,omitempty"`
	// PublicKey is the compressed BLS public key of the validator
	PublicKey             *types.JSONByteSlice `json:"publicKey,omitempty"`
	RemainingBalanceOwner *Owner               `json:"remainingBalanceOwner,omitempty"`
	DeactivationOwner     *Owner               `json:"deactivationOwner,omitempty"`
	MinNonce              *json.Uint64         `json:"minNonce,omitempty"`
	// Balance is the remaining amount of LUX this L1 validator has for paying
	// the continuous fee, according to the last accepted state. If the
	// validator is inactive, the balance will be 0.
	Balance *json.Uint64 `json:"balance,omitempty"`
}

BaseL1Validator is the representation of a base L1 validator without the common parts with a staker.

type BuildGenesisArgs added in v1.11.10

type BuildGenesisArgs struct {
	LuxAssetID    ids.ID                           `json:"luxAssetID"`
	NetworkID     json.Uint32                      `json:"networkID"`
	UTXOs         []UTXO                           `json:"utxos"`
	Validators    []GenesisPermissionlessValidator `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 added in v1.11.10

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

BuildGenesisReply is the reply from BuildGenesis

type Chain added in v1.11.10

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

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. [NetID] is the ID of the net that validates the chain

type GenesisPermissionlessValidator added in v1.11.10

type GenesisPermissionlessValidator struct {
	GenesisValidator
	RewardOwner        *Owner                    `json:"rewardOwner,omitempty"`
	DelegationFee      json.Float32              `json:"delegationFee"`
	ExactDelegationFee *json.Uint32              `json:"exactDelegationFee,omitempty"`
	Staked             []UTXO                    `json:"staked,omitempty"`
	Signer             *signer.ProofOfPossession `json:"signer,omitempty"`
}

GenesisPermissionlessValidator should to be used for genesis validators only.

type GenesisValidator added in v1.11.10

type GenesisValidator Staker

GenesisValidator should to be used for genesis validators only.

type Height

type Height json.Uint64

func (Height) IsProposed

func (h Height) IsProposed() bool

func (Height) MarshalJSON

func (h Height) MarshalJSON() ([]byte, error)

func (*Height) UnmarshalJSON

func (h *Height) UnmarshalJSON(b []byte) error

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 PermissionedValidator added in v1.11.10

type PermissionedValidator struct {
	Staker
	// The owner the staking reward, if applicable, will go to
	Connected bool          `json:"connected"`
	Uptime    *json.Float32 `json:"uptime,omitempty"`
}

PermissionedValidator is the repr. of a permissioned validator sent over APIs.

type PermissionlessValidator

type PermissionlessValidator struct {
	Staker
	// Deprecated: RewardOwner has been replaced by ValidationRewardOwner and
	//             DelegationRewardOwner.
	RewardOwner *Owner `json:"rewardOwner,omitempty"`
	// The owner of the rewards from the validation period, if applicable.
	ValidationRewardOwner *Owner `json:"validationRewardOwner,omitempty"`
	// The owner of the rewards from delegations during the validation period,
	// if applicable.
	DelegationRewardOwner  *Owner                    `json:"delegationRewardOwner,omitempty"`
	PotentialReward        *json.Uint64              `json:"potentialReward,omitempty"`
	AccruedDelegateeReward *json.Uint64              `json:"accruedDelegateeReward,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"`
	Signer                 *signer.ProofOfPossession `json:"signer,omitempty"`

	// The delegators delegating to this validator
	DelegatorCount  *json.Uint64        `json:"delegatorCount,omitempty"`
	DelegatorWeight *json.Uint64        `json:"delegatorWeight,omitempty"`
	Delegators      *[]PrimaryDelegator `json:"delegators,omitempty"`
}

PermissionlessValidator is the repr. of a permissionless validator 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 Staker

type Staker struct {
	TxID      ids.ID      `json:"txID"`
	StartTime json.Uint64 `json:"startTime"`
	EndTime   json.Uint64 `json:"endTime"`
	Weight    json.Uint64 `json:"weight"`
	NodeID    ids.NodeID  `json:"nodeID"`

	// Deprecated: Use Weight instead
	StakeAmount *json.Uint64 `json:"stakeAmount,omitempty"`
}

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 [Uptime] is the observed uptime of this staker

type StaticClient added in v1.11.10

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

StaticClient for interacting with the platformvm static api

func NewStaticClient added in v1.11.10

func NewStaticClient(uri string) StaticClient

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

type StaticService added in v1.11.10

type StaticService struct{}

StaticService defines the static API methods exposed by the platform VM

func (*StaticService) BuildGenesis added in v1.11.10

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

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

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.

func (UTXO) Compare added in v1.11.10

func (utxo UTXO) Compare(other UTXO) int

TODO can we define this on *UTXO?

Jump to

Keyboard shortcuts

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