Documentation
¶
Index ¶
- func AwaitTxAccepted(c *Client, ctx context.Context, txID ids.ID, freq time.Duration, ...) error
- func GetDeactivationOwners(c *Client, ctx context.Context, validationIDs ...ids.ID) (map[ids.ID]fx.Owner, error)
- func GetNetOwners(c *Client, ctx context.Context, chainIDs ...ids.ID) (map[ids.ID]fx.Owner, error)
- func GetOwners(c *Client, ctx context.Context, chainIDs []ids.ID, validationIDs []ids.ID) (map[ids.ID]fx.Owner, error)
- type APIBlockchain
- type APIChain
- type APINet
- type Amount
- type Amounts
- type ChainValidatorSet
- type Client
- func (c *Client) GetAtomicUTXOs(ctx context.Context, addrs []ids.ShortID, sourceChain string, limit uint32, ...) ([][]byte, ids.ShortID, ids.ID, error)
- func (c *Client) GetBalance(ctx context.Context, addrs []ids.ShortID, options ...rpc.Option) (*GetBalanceResponse, error)deprecated
- func (c *Client) GetBlock(ctx context.Context, blockID ids.ID, options ...rpc.Option) ([]byte, error)
- func (c *Client) GetBlockByHeight(ctx context.Context, height uint64, options ...rpc.Option) ([]byte, error)
- func (c *Client) GetBlockchainStatus(ctx context.Context, blockchainID string, options ...rpc.Option) (status.BlockchainStatus, error)
- func (c *Client) GetBlockchains(ctx context.Context, options ...rpc.Option) ([]APIBlockchain, error)deprecated
- func (c *Client) GetChains(ctx context.Context, ids []ids.ID, options ...rpc.Option) ([]ClientChain, error)
- func (c *Client) GetCurrentSupply(ctx context.Context, chainID ids.ID, options ...rpc.Option) (uint64, uint64, error)
- func (c *Client) GetCurrentValidators(ctx context.Context, netID ids.ID, nodeIDs []ids.NodeID, options ...rpc.Option) ([]ClientPermissionlessValidator, error)
- func (c *Client) GetFeeConfig(ctx context.Context, options ...rpc.Option) (*gas.Config, error)
- func (c *Client) GetFeeState(ctx context.Context, options ...rpc.Option) (gas.State, gas.Price, time.Time, error)
- func (c *Client) GetHeight(ctx context.Context, options ...rpc.Option) (uint64, error)
- func (c *Client) GetL1Validator(ctx context.Context, validationID ids.ID, options ...rpc.Option) (L1Validator, uint64, error)
- func (c *Client) GetMinStake(ctx context.Context, chainID ids.ID, options ...rpc.Option) (uint64, uint64, error)
- func (c *Client) GetNet(ctx context.Context, chainID ids.ID, options ...rpc.Option) (GetNetClientResponse, error)
- func (c *Client) GetNets(ctx context.Context, ids []ids.ID, options ...rpc.Option) ([]ClientNet, error)deprecated
- func (c *Client) GetProposedHeight(ctx context.Context, options ...rpc.Option) (uint64, error)
- func (c *Client) GetRewardUTXOs(ctx context.Context, args *apitypes.GetTxArgs, options ...rpc.Option) ([][]byte, error)deprecated
- func (c *Client) GetStake(ctx context.Context, addrs []ids.ShortID, validatorsOnly bool, ...) (map[ids.ID]uint64, [][]byte, error)deprecated
- func (c *Client) GetStakingAssetID(ctx context.Context, chainID ids.ID, options ...rpc.Option) (ids.ID, error)
- func (c *Client) GetTimestamp(ctx context.Context, options ...rpc.Option) (time.Time, error)
- func (c *Client) GetTotalStake(ctx context.Context, netID ids.ID, options ...rpc.Option) (uint64, error)
- func (c *Client) GetTx(ctx context.Context, txID ids.ID, options ...rpc.Option) ([]byte, error)
- func (c *Client) GetTxStatus(ctx context.Context, txID ids.ID, options ...rpc.Option) (*GetTxStatusResponse, error)
- func (c *Client) GetUTXOs(ctx context.Context, addrs []ids.ShortID, limit uint32, ...) ([][]byte, ids.ShortID, ids.ID, error)
- func (c *Client) GetValidatorFeeConfig(ctx context.Context, options ...rpc.Option) (*fee.Config, error)
- func (c *Client) GetValidatorFeeState(ctx context.Context, options ...rpc.Option) (gas.Gas, gas.Price, time.Time, error)
- func (c *Client) GetValidatorsAt(ctx context.Context, chainID ids.ID, height platformapi.Height, ...) (map[ids.NodeID]*validators.GetValidatorOutput, error)
- func (c *Client) IssueTx(ctx context.Context, txBytes []byte, options ...rpc.Option) (ids.ID, error)
- func (c *Client) SampleValidators(ctx context.Context, chainID ids.ID, sampleSize uint16, options ...rpc.Option) ([]ids.NodeID, error)
- func (c *Client) SetNetworkID(networkID uint32)
- func (c *Client) ValidatedBy(ctx context.Context, blockchainID ids.ID, options ...rpc.Option) (ids.ID, error)
- func (c *Client) Validates(ctx context.Context, chainID ids.ID, options ...rpc.Option) ([]ids.ID, error)
- type ClientChain
- type ClientDelegator
- type ClientL1Validator
- type ClientNet
- type ClientOwner
- type ClientPermissionlessValidator
- type ClientStaker
- type CurrentValidator
- type Factory
- type GetAllValidatorsAtArgs
- type GetAllValidatorsAtReply
- type GetBalanceRequest
- type GetBalanceResponse
- type GetBlockchainStatusArgs
- type GetBlockchainStatusReply
- type GetBlockchainsResponse
- type GetChainsArgs
- type GetChainsResponse
- type GetCurrentSupplyArgs
- type GetCurrentSupplyReply
- type GetCurrentValidatorsArgs
- type GetCurrentValidatorsReply
- type GetFeeConfigReply
- type GetFeeStateReply
- type GetL1ValidatorArgs
- type GetL1ValidatorReply
- type GetMinStakeArgs
- type GetMinStakeReply
- type GetNetArgs
- type GetNetClientResponse
- type GetNetResponse
- type GetNetsArgs
- type GetNetsResponse
- type GetRewardUTXOsReply
- type GetStakeArgs
- type GetStakeReply
- type GetStakingAssetIDArgs
- type GetStakingAssetIDResponse
- type GetTimestampReply
- type GetTotalStakeArgs
- type GetTotalStakeReply
- type GetTxStatusArgs
- type GetTxStatusResponse
- type GetValidatorFeeStateReply
- type GetValidatorsAtArgs
- type GetValidatorsAtReply
- type Index
- type L1Validator
- type SampleValidatorsArgs
- type SampleValidatorsReply
- type Service
- func (s *Service) GetAllValidatorsAt(r *http.Request, args *GetAllValidatorsAtArgs, reply *GetAllValidatorsAtReply) error
- func (s *Service) GetBalance(_ *http.Request, args *GetBalanceRequest, response *GetBalanceResponse) error
- func (s *Service) GetBlock(_ *http.Request, args *apitypes.GetBlockArgs, ...) error
- func (s *Service) GetBlockByHeight(_ *http.Request, args *apitypes.GetBlockByHeightArgs, ...) error
- func (s *Service) GetBlockchainStatus(r *http.Request, args *GetBlockchainStatusArgs, ...) error
- func (s *Service) GetBlockchains(_ *http.Request, _ *struct{}, response *GetBlockchainsResponse) error
- func (s *Service) GetChains(r *http.Request, args *GetChainsArgs, response *GetChainsResponse) error
- func (s *Service) GetCurrentSupply(r *http.Request, args *GetCurrentSupplyArgs, reply *GetCurrentSupplyReply) error
- func (s *Service) GetCurrentValidators(request *http.Request, args *GetCurrentValidatorsArgs, ...) error
- func (s *Service) GetFeeConfig(_ *http.Request, _ *struct{}, reply *GetFeeConfigReply) error
- func (s *Service) GetFeeState(_ *http.Request, _ *struct{}, reply *GetFeeStateReply) error
- func (s *Service) GetHeight(r *http.Request, _ *struct{}, response *apitypes.GetHeightResponse) error
- func (s *Service) GetL1Validator(r *http.Request, args *GetL1ValidatorArgs, reply *GetL1ValidatorReply) error
- func (s *Service) GetMinStake(_ *http.Request, args *GetMinStakeArgs, reply *GetMinStakeReply) error
- func (s *Service) GetNet(_ *http.Request, args *GetNetArgs, response *GetNetResponse) error
- func (s *Service) GetNets(_ *http.Request, args *GetNetsArgs, response *GetNetsResponse) error
- func (s *Service) GetProposedHeight(r *http.Request, _ *struct{}, reply *apitypes.GetHeightResponse) error
- func (s *Service) GetRewardUTXOs(_ *http.Request, args *apitypes.GetTxArgs, reply *GetRewardUTXOsReply) error
- func (s *Service) GetStake(_ *http.Request, args *GetStakeArgs, response *GetStakeReply) error
- func (s *Service) GetStakingAssetID(_ *http.Request, args *GetStakingAssetIDArgs, ...) error
- func (s *Service) GetTimestamp(_ *http.Request, _ *struct{}, reply *GetTimestampReply) error
- func (s *Service) GetTotalStake(_ *http.Request, args *GetTotalStakeArgs, reply *GetTotalStakeReply) error
- func (s *Service) GetTx(_ *http.Request, args *apitypes.GetTxArgs, response *apitypes.GetTxReply) error
- func (s *Service) GetTxStatus(_ *http.Request, args *GetTxStatusArgs, response *GetTxStatusResponse) error
- func (s *Service) GetUTXOs(_ *http.Request, args *apitypes.GetUTXOsArgs, response *apitypes.GetUTXOsReply) error
- func (s *Service) GetValidatorFeeConfig(_ *http.Request, _ *struct{}, reply *fee.Config) error
- func (s *Service) GetValidatorFeeState(_ *http.Request, _ *struct{}, reply *GetValidatorFeeStateReply) error
- func (s *Service) GetValidatorsAt(r *http.Request, args *GetValidatorsAtArgs, reply *GetValidatorsAtReply) error
- func (s *Service) IssueTx(_ *http.Request, args *apitypes.FormattedTx, response *apitypes.JSONTxID) error
- func (s *Service) SampleValidators(_ *http.Request, args *SampleValidatorsArgs, reply *SampleValidatorsReply) error
- func (s *Service) ValidatedBy(r *http.Request, args *ValidatedByArgs, response *ValidatedByResponse) error
- func (s *Service) Validates(_ *http.Request, args *ValidatesArgs, response *ValidatesResponse) error
- type VM
- func (vm *VM) BuildBlock(ctx context.Context) (chain.Block, error)
- func (vm *VM) Clock() *mockable.Clock
- func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *chain.VersionInfo) error
- func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error)
- func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (vm *VM) GetBlock(_ context.Context, blkID ids.ID) (chain.Block, error)
- func (vm *VM) GetBlockIDAtHeight(_ context.Context, height uint64) (ids.ID, error)
- func (vm *VM) GetChainID(netID ids.ID) (ids.ID, error)
- func (vm *VM) GetNetworkID(chainID ids.ID) (ids.ID, error)
- func (vm *VM) HealthCheck(context.Context) (chain.HealthResult, error)
- func (vm *VM) Initialize(ctx context.Context, init vmcore.Init) error
- func (vm *VM) LastAccepted(context.Context) (ids.ID, error)
- func (vm *VM) Logger() log.Logger
- func (vm *VM) NewHTTPHandler(ctx context.Context) (http.Handler, error)
- func (vm *VM) ParseBlock(_ context.Context, b []byte) (chain.Block, error)
- func (vm *VM) SetPreference(_ context.Context, blkID ids.ID) error
- func (vm *VM) SetState(_ context.Context, stateNum uint32) error
- func (vm *VM) Shutdown(context.Context) error
- func (*VM) Version(context.Context) (string, error)
- func (vm *VM) WaitForEvent(ctx context.Context) (vmcore.Message, error)
- type ValidatedByArgs
- type ValidatedByResponse
- type ValidatesArgs
- type ValidatesResponse
- type Validator
- type ValidatorSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AwaitTxAccepted ¶ added in v0.1.1
func GetDeactivationOwners ¶ added in v0.1.1
func GetDeactivationOwners( c *Client, ctx context.Context, validationIDs ...ids.ID, ) (map[ids.ID]fx.Owner, error)
GetDeactivationOwners returns a map of validation ID to deactivation owners
Types ¶
type APIBlockchain ¶
type APIBlockchain struct {
// Blockchain's ID
ID ids.ID `json:"id"`
// Blockchain's (non-unique) human-readable name
Name string `json:"name"`
// Net that validates the blockchain
ChainID ids.ID `json:"netID"`
// Virtual Machine the blockchain runs
VMID ids.ID `json:"vmID"`
}
APIBlockchain is the representation of a blockchain used in API calls
func (*APIBlockchain) MarshalZAP ¶ added in v1.36.178
func (x *APIBlockchain) MarshalZAP() ([]byte, error)
MarshalZAP writes APIBlockchain from constant offsets.
func (*APIBlockchain) UnmarshalZAP ¶ added in v1.36.178
func (x *APIBlockchain) UnmarshalZAP(data []byte) error
UnmarshalZAP reads APIBlockchain out of the buffer that arrived.
type APIChain ¶
type APIChain struct {
ID ids.ID `json:"id"`
ControlKeys []string `json:"controlKeys"`
Threshold avajson.Uint32 `json:"threshold"`
}
APIChain is the canonical wire-shape for a chain registered on the platform via CreateNetworkTx. Replaces APINet — same fields, named after the user-facing concept ("chain") rather than the internal canonical naming. The wire encoding is byte-identical so a deserializer that targets APIChain reads APINet responses and vice versa; no proxies need to translate.
func (*APIChain) MarshalZAP ¶ added in v1.36.178
MarshalZAP writes APIChain from constant offsets.
func (*APIChain) UnmarshalZAP ¶ added in v1.36.178
UnmarshalZAP reads APIChain out of the buffer that arrived.
type APINet ¶ added in v1.16.16
type APINet struct {
// ID of the net
ID ids.ID `json:"id"`
// Each element of [ControlKeys] the address of a public key.
// A transaction to add a validator to this net requires
// signatures from [Threshold] of these keys to be valid.
ControlKeys []string `json:"controlKeys"`
Threshold avajson.Uint32 `json:"threshold"`
}
APINet is a representation of a net used in API calls
func (*APINet) MarshalZAP ¶ added in v1.36.178
MarshalZAP writes APINet from constant offsets.
func (*APINet) UnmarshalZAP ¶ added in v1.36.178
UnmarshalZAP reads APINet out of the buffer that arrived.
type Amount ¶ added in v1.36.178
Amount is a quantity of one asset.
func (*Amount) MarshalZAP ¶ added in v1.36.178
MarshalZAP writes Amount from constant offsets.
func (*Amount) UnmarshalZAP ¶ added in v1.36.178
UnmarshalZAP reads Amount out of the buffer that arrived.
type Amounts ¶ added in v1.36.178
type Amounts []Amount
Amounts is a quantity per asset. The wire spells it as an object keyed by asset id, which is what MarshalJSON writes and UnmarshalJSON reads; the list is what has a layout.
func (Amounts) MarshalJSON ¶ added in v1.36.178
func (*Amounts) UnmarshalJSON ¶ added in v1.36.178
type ChainValidatorSet ¶ added in v1.36.178
type ChainValidatorSet struct {
ChainID ids.ID
Validators []*validators.GetValidatorOutput
}
ChainValidatorSet is one chain's validator set, in the full shape getAllValidatorsAt answers with. That method reports the state read verbatim, under the field names Go gave it, and this keeps that exactly.
func (*ChainValidatorSet) MarshalZAP ¶ added in v1.36.178
func (x *ChainValidatorSet) MarshalZAP() ([]byte, error)
MarshalZAP writes ChainValidatorSet from constant offsets.
func (*ChainValidatorSet) UnmarshalZAP ¶ added in v1.36.178
func (x *ChainValidatorSet) UnmarshalZAP(data []byte) error
UnmarshalZAP reads ChainValidatorSet out of the buffer that arrived.
type Client ¶ added in v0.1.1
type Client struct {
Requester rpc.EndpointRequester
// contains filtered or unexported fields
}
func NewClientWithNetworkID ¶ added in v1.22.22
NewClientWithNetworkID returns a new platformvm.Client with the network ID set for proper bech32 address formatting
func (*Client) GetAtomicUTXOs ¶ added in v0.1.1
func (c *Client) GetAtomicUTXOs( ctx context.Context, addrs []ids.ShortID, sourceChain string, limit uint32, startAddress ids.ShortID, startUTXOID ids.ID, options ...rpc.Option, ) ([][]byte, ids.ShortID, ids.ID, error)
GetAtomicUTXOs returns the byte representation of the atomic UTXOs controlled by addrs from sourceChain.
func (*Client) GetBalance
deprecated
added in
v0.1.1
func (*Client) GetBlock ¶ added in v0.1.1
func (c *Client) GetBlock(ctx context.Context, blockID ids.ID, options ...rpc.Option) ([]byte, error)
GetBlock returns blockID.
func (*Client) GetBlockByHeight ¶ added in v0.1.1
func (c *Client) GetBlockByHeight(ctx context.Context, height uint64, options ...rpc.Option) ([]byte, error)
GetBlockByHeight returns the block at the given height.
func (*Client) GetBlockchainStatus ¶ added in v0.1.1
func (c *Client) GetBlockchainStatus(ctx context.Context, blockchainID string, options ...rpc.Option) (status.BlockchainStatus, error)
GetBlockchainStatus returns the current status of blockchainID.
func (*Client) GetBlockchains
deprecated
added in
v0.1.1
func (*Client) GetChains ¶ added in v1.26.10
func (c *Client) GetChains(ctx context.Context, ids []ids.ID, options ...rpc.Option) ([]ClientChain, error)
GetChains returns information about the specified chains. Empty `ids` returns every chain on the platform (including the primary network). This is the canonical RPC; new code should use it. The older GetNets is kept indefinitely for wire-protocol compatibility but logs every call as deprecated server-side.
func (*Client) GetCurrentSupply ¶ added in v0.1.1
func (c *Client) GetCurrentSupply(ctx context.Context, chainID ids.ID, options ...rpc.Option) (uint64, uint64, error)
GetCurrentSupply returns an upper bound on the supply of LUX in the system along with the chain height.
func (*Client) GetCurrentValidators ¶ added in v0.1.1
func (c *Client) GetCurrentValidators( ctx context.Context, netID ids.ID, nodeIDs []ids.NodeID, options ...rpc.Option, ) ([]ClientPermissionlessValidator, error)
GetCurrentValidators returns the list of current validators for chainID.
func (*Client) GetFeeConfig ¶ added in v0.1.1
GetFeeConfig returns the dynamic fee config.
func (*Client) GetFeeState ¶ added in v0.1.1
func (c *Client) GetFeeState(ctx context.Context, options ...rpc.Option) ( gas.State, gas.Price, time.Time, error, )
GetFeeState returns the current fee state.
func (*Client) GetL1Validator ¶ added in v0.1.1
func (c *Client) GetL1Validator( ctx context.Context, validationID ids.ID, options ...rpc.Option, ) (L1Validator, uint64, error)
GetL1Validator returns the requested L1 validator with validationID and the height at which it was calculated.
func (*Client) GetMinStake ¶ added in v0.1.1
func (c *Client) GetMinStake(ctx context.Context, chainID ids.ID, options ...rpc.Option) (uint64, uint64, error)
GetMinStake returns the minimum staking amount in µLUX for validators and delegators respectively.
func (*Client) GetNet ¶ added in v1.16.56
func (c *Client) GetNet(ctx context.Context, chainID ids.ID, options ...rpc.Option) (GetNetClientResponse, error)
GetNet returns information about the specified chain.
func (*Client) GetNets
deprecated
added in
v1.16.56
func (c *Client) GetNets(ctx context.Context, ids []ids.ID, options ...rpc.Option) ([]ClientNet, error)
GetNets returns information about the specified chains.
Deprecated: use GetChains. Same wire shape, same behavior, name matches the user-facing concept. This stays available indefinitely for callers still on the old name.
func (*Client) GetProposedHeight ¶ added in v0.1.1
GetProposedHeight returns the current height of this node's proposer VM.
func (*Client) GetRewardUTXOs
deprecated
added in
v0.1.1
func (*Client) GetStake
deprecated
added in
v0.1.1
func (c *Client) GetStake( ctx context.Context, addrs []ids.ShortID, validatorsOnly bool, options ...rpc.Option, ) (map[ids.ID]uint64, [][]byte, error)
GetStake returns the amount of µLUX that addrs have cumulatively staked on the Primary Network.
Deprecated: Stake should be calculated using GetTx and GetCurrentValidators.
func (*Client) GetStakingAssetID ¶ added in v0.1.1
func (c *Client) GetStakingAssetID(ctx context.Context, chainID ids.ID, options ...rpc.Option) (ids.ID, error)
GetStakingAssetID returns the assetID of the asset used for staking on the chain corresponding to chainID.
func (*Client) GetTimestamp ¶ added in v0.1.1
GetTimestamp returns the current chain timestamp.
func (*Client) GetTotalStake ¶ added in v0.1.1
func (c *Client) GetTotalStake(ctx context.Context, netID ids.ID, options ...rpc.Option) (uint64, error)
GetTotalStake returns the total amount (in µLUX) staked on the network.
func (*Client) GetTxStatus ¶ added in v0.1.1
func (c *Client) GetTxStatus(ctx context.Context, txID ids.ID, options ...rpc.Option) (*GetTxStatusResponse, error)
GetTxStatus returns the status of txID.
func (*Client) GetUTXOs ¶ added in v0.1.1
func (c *Client) GetUTXOs( ctx context.Context, addrs []ids.ShortID, limit uint32, startAddress ids.ShortID, startUTXOID ids.ID, options ...rpc.Option, ) ([][]byte, ids.ShortID, ids.ID, error)
GetUTXOs returns the byte representation of the UTXOs controlled by addrs.
func (*Client) GetValidatorFeeConfig ¶ added in v0.1.1
func (c *Client) GetValidatorFeeConfig(ctx context.Context, options ...rpc.Option) (*fee.Config, error)
GetValidatorFeeConfig returns the validator fee config.
func (*Client) GetValidatorFeeState ¶ added in v0.1.1
func (c *Client) GetValidatorFeeState(ctx context.Context, options ...rpc.Option) ( gas.Gas, gas.Price, time.Time, error, )
GetValidatorFeeState returns the current validator fee state.
func (*Client) GetValidatorsAt ¶ added in v0.1.1
func (c *Client) GetValidatorsAt( ctx context.Context, chainID ids.ID, height platformapi.Height, options ...rpc.Option, ) (map[ids.NodeID]*validators.GetValidatorOutput, error)
GetValidatorsAt returns the weights of the validator set of a provided chain at the specified height or at proposerVM height if set to platformapi.ProposedHeight.
func (*Client) IssueTx ¶ added in v0.1.1
func (c *Client) IssueTx(ctx context.Context, txBytes []byte, options ...rpc.Option) (ids.ID, error)
IssueTx issues the transaction and returns its txID.
func (*Client) SampleValidators ¶ added in v0.1.1
func (c *Client) SampleValidators(ctx context.Context, chainID ids.ID, sampleSize uint16, options ...rpc.Option) ([]ids.NodeID, error)
SampleValidators returns the nodeIDs of a sample of sampleSize validators from the current validator set for chainID.
func (*Client) SetNetworkID ¶ added in v1.22.22
SetNetworkID sets the network ID for address formatting
type ClientChain ¶ added in v1.26.10
type ClientChain = ClientNet
ClientChain is the canonical client-side view of a chain registered on the platform. Replaces ClientNet with field naming that matches the user-facing concept ("chain") rather than the internal "net" / canonical naming.
type ClientDelegator ¶ added in v0.1.1
type ClientDelegator struct {
ClientStaker
RewardOwner *ClientOwner
PotentialReward *uint64
}
ClientDelegator is the repr. of a delegator sent over client
type ClientL1Validator ¶ added in v0.1.1
type ClientL1Validator struct {
ValidationID *ids.ID
RemainingBalanceOwner *ClientOwner
DeactivationOwner *ClientOwner
MinNonce *uint64
Balance *uint64
}
type ClientNet ¶ added in v1.16.16
type ClientNet struct {
// ID of the chain
ID ids.ID
// Each element of [ControlKeys] the address of a public key.
// A transaction to add a validator to this net requires
// signatures from [Threshold] of these keys to be valid.
ControlKeys []ids.ShortID
Threshold uint32
}
ClientNet is a representation of a net used in client methods
type ClientOwner ¶ added in v0.1.1
ClientOwner is the repr. of a reward owner sent over client
type ClientPermissionlessValidator ¶ added in v0.1.1
type ClientPermissionlessValidator struct {
ClientStaker
ClientL1Validator
ValidationRewardOwner *ClientOwner
DelegationRewardOwner *ClientOwner
PotentialReward *uint64
AccruedDelegateeReward *uint64
DelegationFee float32
// Uptime is deprecated for Net Validators.
// It will be available only for Primary Network Validators.
Uptime *float32
// Connected is deprecated for Net Validators.
// It will be available only for Primary Network Validators.
Connected *bool
Signer *signer.ProofOfPossession
// The delegators delegating to this validator
DelegatorCount *uint64
DelegatorWeight *uint64
Delegators []ClientDelegator
}
ClientPermissionlessValidator is the repr. of a permissionless validator sent over client
type ClientStaker ¶ added in v0.1.1
type ClientStaker struct {
// the txID of the transaction that added this staker.
TxID ids.ID
// the Unix time when they start staking
StartTime uint64
// the Unix time when they are done staking
EndTime uint64
// the validator weight when sampling validators
Weight uint64
// the node ID of the staker
NodeID ids.NodeID
}
ClientStaker is the representation of a staker sent via client.
type CurrentValidator ¶ added in v1.36.178
type CurrentValidator struct {
Permissionless *api.PermissionlessValidator
Permissioned *api.Staker
L1 *api.APIL1Validator
}
CurrentValidator is one entry of the list getCurrentValidators answers with.
That list is heterogeneous on the wire because what a validator IS depends on the chain asked about: the primary network and a permissionless net answer with a permissionless validator, a permissioned net with a bare staker, and an L1 with an L1 validator. Those are three different objects — a staker has a txID and an endTime that an L1 validator does not, and a permissionless validator always carries a delegationFee that neither of the others does — so folding them into one struct would add keys to two of the three answers.
It is therefore a sum: exactly one arm is set, and it marshals as itself.
The list also changes width with the request — asking about specific nodes adds `delegators` to each entry — but that is one omitempty pointer being set rather than nil. It is data, not a second shape, and the layout is the same either way.
func (CurrentValidator) MarshalJSON ¶ added in v1.36.178
func (v CurrentValidator) MarshalJSON() ([]byte, error)
func (*CurrentValidator) MarshalZAP ¶ added in v1.36.178
func (x *CurrentValidator) MarshalZAP() ([]byte, error)
MarshalZAP writes CurrentValidator from constant offsets.
func (*CurrentValidator) UnmarshalJSON ¶ added in v1.36.178
func (v *CurrentValidator) UnmarshalJSON(b []byte) error
UnmarshalJSON picks the arm from what the object carries. delegationFee is on every permissionless validator and on neither of the others; txID is on every staker and not on an L1 validator. Two keys tell the three apart.
func (*CurrentValidator) UnmarshalZAP ¶ added in v1.36.178
func (x *CurrentValidator) UnmarshalZAP(data []byte) error
UnmarshalZAP reads CurrentValidator out of the buffer that arrived.
type GetAllValidatorsAtArgs ¶ added in v1.16.56
type GetAllValidatorsAtArgs struct {
Height platformapitypes.Height `json:"height"`
}
GetAllValidatorsAtArgs are the arguments to GetAllValidatorsAt
func (*GetAllValidatorsAtArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetAllValidatorsAtArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetAllValidatorsAtArgs from constant offsets.
func (*GetAllValidatorsAtArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetAllValidatorsAtArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetAllValidatorsAtArgs out of the buffer that arrived.
type GetAllValidatorsAtReply ¶ added in v1.16.56
type GetAllValidatorsAtReply struct {
ValidatorSets []ChainValidatorSet `json:"validatorSets"`
}
GetAllValidatorsAtReply is the response from GetAllValidatorsAt.
One entry per chain, each carrying its own set. The wire is an object keyed by chain id whose values are objects keyed by node id, and MarshalJSON writes exactly that.
func (GetAllValidatorsAtReply) MarshalJSON ¶ added in v1.36.178
func (v GetAllValidatorsAtReply) MarshalJSON() ([]byte, error)
func (*GetAllValidatorsAtReply) MarshalZAP ¶ added in v1.36.178
func (x *GetAllValidatorsAtReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetAllValidatorsAtReply from constant offsets.
func (*GetAllValidatorsAtReply) UnmarshalJSON ¶ added in v1.36.178
func (v *GetAllValidatorsAtReply) UnmarshalJSON(b []byte) error
func (*GetAllValidatorsAtReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetAllValidatorsAtReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetAllValidatorsAtReply out of the buffer that arrived.
type GetBalanceRequest ¶ added in v0.1.1
type GetBalanceRequest struct {
Addresses []string `json:"addresses"`
}
func (*GetBalanceRequest) MarshalZAP ¶ added in v1.36.178
func (x *GetBalanceRequest) MarshalZAP() ([]byte, error)
MarshalZAP writes GetBalanceRequest from constant offsets.
func (*GetBalanceRequest) UnmarshalZAP ¶ added in v1.36.178
func (x *GetBalanceRequest) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetBalanceRequest out of the buffer that arrived.
type GetBalanceResponse ¶ added in v0.1.1
type GetBalanceResponse struct {
// Balance, in µLUX, of the address
Balance avajson.Uint64 `json:"balance"`
Unlocked avajson.Uint64 `json:"unlocked"`
LockedStakeable avajson.Uint64 `json:"lockedStakeable"`
LockedNotStakeable avajson.Uint64 `json:"lockedNotStakeable"`
Balances Amounts `json:"balances"`
Unlockeds Amounts `json:"unlockeds"`
LockedStakeables Amounts `json:"lockedStakeables"`
LockedNotStakeables Amounts `json:"lockedNotStakeables"`
UTXOIDs []*lux.UTXOID `json:"utxoIDs"`
}
Note: We explicitly duplicate LUX out of the maps to ensure backwards compatibility.
func (*GetBalanceResponse) MarshalZAP ¶ added in v1.36.178
func (x *GetBalanceResponse) MarshalZAP() ([]byte, error)
MarshalZAP writes GetBalanceResponse from constant offsets.
func (*GetBalanceResponse) UnmarshalZAP ¶ added in v1.36.178
func (x *GetBalanceResponse) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetBalanceResponse out of the buffer that arrived.
type GetBlockchainStatusArgs ¶
type GetBlockchainStatusArgs struct {
BlockchainID string `json:"blockchainID"`
}
GetBlockchainStatusArgs is the arguments for calling GetBlockchainStatus [BlockchainID] is the ID of or an alias of the blockchain to get the status of.
func (*GetBlockchainStatusArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetBlockchainStatusArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetBlockchainStatusArgs from constant offsets.
func (*GetBlockchainStatusArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetBlockchainStatusArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetBlockchainStatusArgs out of the buffer that arrived.
type GetBlockchainStatusReply ¶
type GetBlockchainStatusReply struct {
Status status.BlockchainStatus `json:"status"`
}
GetBlockchainStatusReply is the reply from calling GetBlockchainStatus [Status] is the blockchain's status.
func (*GetBlockchainStatusReply) MarshalZAP ¶ added in v1.36.178
func (x *GetBlockchainStatusReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetBlockchainStatusReply from constant offsets.
func (*GetBlockchainStatusReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetBlockchainStatusReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetBlockchainStatusReply out of the buffer that arrived.
type GetBlockchainsResponse ¶
type GetBlockchainsResponse struct {
// blockchains that exist
Blockchains []APIBlockchain `json:"blockchains"`
}
GetBlockchainsResponse is the response from a call to GetBlockchains
func (*GetBlockchainsResponse) MarshalZAP ¶ added in v1.36.178
func (x *GetBlockchainsResponse) MarshalZAP() ([]byte, error)
MarshalZAP writes GetBlockchainsResponse from constant offsets.
func (*GetBlockchainsResponse) UnmarshalZAP ¶ added in v1.36.178
func (x *GetBlockchainsResponse) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetBlockchainsResponse out of the buffer that arrived.
type GetChainsArgs ¶ added in v1.26.10
GetChainsArgs are the arguments to GetChains. IDs is the optional allowlist filter — empty list returns every chain (including the primary network). Same shape as GetNetsArgs.
func (*GetChainsArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetChainsArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetChainsArgs from constant offsets.
func (*GetChainsArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetChainsArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetChainsArgs out of the buffer that arrived.
type GetChainsResponse ¶ added in v1.26.10
type GetChainsResponse struct {
Chains []APIChain `json:"chains"`
}
GetChainsResponse is the response from GetChains. Same shape as GetNetsResponse — `Chains` instead of `Nets`. Field names are canonical going forward; downstream parsers should target this struct.
func (*GetChainsResponse) MarshalZAP ¶ added in v1.36.178
func (x *GetChainsResponse) MarshalZAP() ([]byte, error)
MarshalZAP writes GetChainsResponse from constant offsets.
func (*GetChainsResponse) UnmarshalZAP ¶ added in v1.36.178
func (x *GetChainsResponse) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetChainsResponse out of the buffer that arrived.
type GetCurrentSupplyArgs ¶ added in v0.1.1
GetCurrentSupplyArgs are the arguments for calling GetCurrentSupply
func (*GetCurrentSupplyArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetCurrentSupplyArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetCurrentSupplyArgs from constant offsets.
func (*GetCurrentSupplyArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetCurrentSupplyArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetCurrentSupplyArgs out of the buffer that arrived.
type GetCurrentSupplyReply ¶ added in v0.1.1
type GetCurrentSupplyReply struct {
Supply avajson.Uint64 `json:"supply"`
Height avajson.Uint64 `json:"height"`
}
GetCurrentSupplyReply are the results from calling GetCurrentSupply
func (*GetCurrentSupplyReply) MarshalZAP ¶ added in v1.36.178
func (x *GetCurrentSupplyReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetCurrentSupplyReply from constant offsets.
func (*GetCurrentSupplyReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetCurrentSupplyReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetCurrentSupplyReply out of the buffer that arrived.
type GetCurrentValidatorsArgs ¶
type GetCurrentValidatorsArgs struct {
// Net we're listing the validators of
// If omitted, defaults to primary network
ChainID ids.ID `json:"netID"`
// NodeIDs of validators to request. If [NodeIDs]
// is empty, it fetches all current validators. If
// some nodeIDs are not currently validators, they
// will be omitted from the response.
NodeIDs []ids.NodeID `json:"nodeIDs"`
}
GetCurrentValidatorsArgs are the arguments for calling GetCurrentValidators
func (*GetCurrentValidatorsArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetCurrentValidatorsArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetCurrentValidatorsArgs from constant offsets.
func (*GetCurrentValidatorsArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetCurrentValidatorsArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetCurrentValidatorsArgs out of the buffer that arrived.
type GetCurrentValidatorsReply ¶
type GetCurrentValidatorsReply struct {
Validators []CurrentValidator `json:"validators"`
}
GetCurrentValidatorsReply are the results from calling GetCurrentValidators. Each validator contains a list of delegators to itself.
func (*GetCurrentValidatorsReply) MarshalZAP ¶ added in v1.36.178
func (x *GetCurrentValidatorsReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetCurrentValidatorsReply from constant offsets.
func (*GetCurrentValidatorsReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetCurrentValidatorsReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetCurrentValidatorsReply out of the buffer that arrived.
type GetFeeConfigReply ¶ added in v1.36.178
type GetFeeConfigReply struct {
Weights []uint64 `json:"weights"`
MaxCapacity gas.Gas `json:"maxCapacity"`
MaxPerSecond gas.Gas `json:"maxPerSecond"`
TargetPerSecond gas.Gas `json:"targetPerSecond"`
MinPrice gas.Price `json:"minPrice"`
ExcessConversionConstant gas.Gas `json:"excessConversionConstant"`
}
GetFeeConfigReply is the chain's dynamic-fee configuration.
It restates gas.Config rather than answering with it because gas.Dimensions is a fixed array and an array of anything but bytes has no wire form on the plane. The same four weights cross as a list, in the same order, and the JSON is the array it has always been.
func (*GetFeeConfigReply) MarshalZAP ¶ added in v1.36.178
func (x *GetFeeConfigReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetFeeConfigReply from constant offsets.
func (*GetFeeConfigReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetFeeConfigReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetFeeConfigReply out of the buffer that arrived.
type GetFeeStateReply ¶ added in v0.1.1
type GetFeeStateReply struct {
gas.State
Price gas.Price `json:"price"`
Time avajson.Time `json:"timestamp"`
}
func (*GetFeeStateReply) MarshalZAP ¶ added in v1.36.178
func (x *GetFeeStateReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetFeeStateReply from constant offsets.
func (*GetFeeStateReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetFeeStateReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetFeeStateReply out of the buffer that arrived.
type GetL1ValidatorArgs ¶ added in v0.1.1
func (*GetL1ValidatorArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetL1ValidatorArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetL1ValidatorArgs from constant offsets.
func (*GetL1ValidatorArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetL1ValidatorArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetL1ValidatorArgs out of the buffer that arrived.
type GetL1ValidatorReply ¶ added in v0.1.1
type GetL1ValidatorReply struct {
platformapitypes.APIL1Validator
ChainID ids.ID `json:"netID"`
// Height is the height of the last accepted block
Height avajson.Uint64 `json:"height"`
}
func (*GetL1ValidatorReply) MarshalZAP ¶ added in v1.36.178
func (x *GetL1ValidatorReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetL1ValidatorReply from constant offsets.
func (*GetL1ValidatorReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetL1ValidatorReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetL1ValidatorReply out of the buffer that arrived.
type GetMinStakeArgs ¶ added in v0.1.1
GetMinStakeArgs are the arguments for calling GetMinStake.
func (*GetMinStakeArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetMinStakeArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetMinStakeArgs from constant offsets.
func (*GetMinStakeArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetMinStakeArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetMinStakeArgs out of the buffer that arrived.
type GetMinStakeReply ¶ added in v0.1.1
type GetMinStakeReply struct {
// The minimum amount of tokens one must bond to be a validator
MinValidatorStake avajson.Uint64 `json:"minValidatorStake"`
// Minimum stake, in µLUX, that can be delegated on the primary network
MinDelegatorStake avajson.Uint64 `json:"minDelegatorStake"`
}
GetMinStakeReply is the response from calling GetMinStake.
func (*GetMinStakeReply) MarshalZAP ¶ added in v1.36.178
func (x *GetMinStakeReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetMinStakeReply from constant offsets.
func (*GetMinStakeReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetMinStakeReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetMinStakeReply out of the buffer that arrived.
type GetNetArgs ¶ added in v1.16.56
type GetNetArgs struct {
// ID of the net to retrieve information about
ChainID ids.ID `json:"netID"`
}
GetNetArgs are the arguments to GetNet
func (*GetNetArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetNetArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetNetArgs from constant offsets.
func (*GetNetArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetNetArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetNetArgs out of the buffer that arrived.
type GetNetClientResponse ¶ added in v1.16.56
type GetNetClientResponse struct {
// whether it is permissioned or not
IsPermissioned bool
// net auth information for a permissioned chain
ControlKeys []ids.ShortID
Threshold uint32
Locktime uint64
// net transformation tx ID for a permissionless chain
NetTransformationTxID ids.ID
// chain conversion information for an L1
ConversionID ids.ID
ManagerChainID ids.ID
ManagerAddress []byte
}
GetNetClientResponse is the response from calling GetNet on the client
type GetNetResponse ¶ added in v1.16.56
type GetNetResponse struct {
// whether it is permissioned or not
IsPermissioned bool `json:"isPermissioned"`
// net auth information for a permissioned net
ControlKeys []string `json:"controlKeys"`
Threshold avajson.Uint32 `json:"threshold"`
Locktime avajson.Uint64 `json:"locktime"`
// net transformation tx ID for an elastic net
NetTransformationTxID ids.ID `json:"netTransformationTxID"`
// net conversion information for an L1
ConversionID ids.ID `json:"conversionID"`
ManagerChainID ids.ID `json:"managerChainID"`
ManagerAddress types.JSONByteSlice `json:"managerAddress"`
}
GetNetResponse is the response from calling GetNet
func (*GetNetResponse) MarshalZAP ¶ added in v1.36.178
func (x *GetNetResponse) MarshalZAP() ([]byte, error)
MarshalZAP writes GetNetResponse from constant offsets.
func (*GetNetResponse) UnmarshalZAP ¶ added in v1.36.178
func (x *GetNetResponse) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetNetResponse out of the buffer that arrived.
type GetNetsArgs ¶ added in v1.16.56
type GetNetsArgs struct {
// IDs of the nets to retrieve information about
// If omitted, gets all nets
IDs []ids.ID `json:"ids"`
}
GetNetsArgs are the arguments to GetNets
func (*GetNetsArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetNetsArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetNetsArgs from constant offsets.
func (*GetNetsArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetNetsArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetNetsArgs out of the buffer that arrived.
type GetNetsResponse ¶ added in v1.16.56
type GetNetsResponse struct {
// Each element is a net that exists
// Null if there are no nets other than the primary network
Nets []APINet `json:"nets"`
}
GetNetsResponse is the response from calling GetNets
func (*GetNetsResponse) MarshalZAP ¶ added in v1.36.178
func (x *GetNetsResponse) MarshalZAP() ([]byte, error)
MarshalZAP writes GetNetsResponse from constant offsets.
func (*GetNetsResponse) UnmarshalZAP ¶ added in v1.36.178
func (x *GetNetsResponse) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetNetsResponse out of the buffer that arrived.
type GetRewardUTXOsReply ¶ added in v0.1.1
type GetRewardUTXOsReply struct {
// Number of UTXOs returned
NumFetched avajson.Uint64 `json:"numFetched"`
// The UTXOs
UTXOs []string `json:"utxos"`
// Encoding specifies the encoding format the UTXOs are returned in
Encoding formatting.Encoding `json:"encoding"`
}
GetRewardUTXOsReply defines the GetRewardUTXOs replies returned from the API
func (*GetRewardUTXOsReply) MarshalZAP ¶ added in v1.36.178
func (x *GetRewardUTXOsReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetRewardUTXOsReply from constant offsets.
func (*GetRewardUTXOsReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetRewardUTXOsReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetRewardUTXOsReply out of the buffer that arrived.
type GetStakeArgs ¶ added in v0.1.1
type GetStakeArgs struct {
apitypes.JSONAddresses
ValidatorsOnly bool `json:"validatorsOnly"`
Encoding formatting.Encoding `json:"encoding"`
}
func (*GetStakeArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetStakeArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetStakeArgs from constant offsets.
func (*GetStakeArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetStakeArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetStakeArgs out of the buffer that arrived.
type GetStakeReply ¶ added in v0.1.1
type GetStakeReply struct {
Staked avajson.Uint64 `json:"staked"`
Stakeds Amounts `json:"stakeds"`
// String representation of staked outputs
// Each is of type lux.TransferableOutput
Outputs []string `json:"stakedOutputs"`
// Encoding of [Outputs]
Encoding formatting.Encoding `json:"encoding"`
}
GetStakeReply is the response from calling GetStake.
func (*GetStakeReply) MarshalZAP ¶ added in v1.36.178
func (x *GetStakeReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetStakeReply from constant offsets.
func (*GetStakeReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetStakeReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetStakeReply out of the buffer that arrived.
type GetStakingAssetIDArgs ¶ added in v0.1.1
GetStakingAssetIDArgs are the arguments to GetStakingAssetID
func (*GetStakingAssetIDArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetStakingAssetIDArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetStakingAssetIDArgs from constant offsets.
func (*GetStakingAssetIDArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetStakingAssetIDArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetStakingAssetIDArgs out of the buffer that arrived.
type GetStakingAssetIDResponse ¶ added in v0.1.1
GetStakingAssetIDResponse is the response from calling GetStakingAssetID
func (*GetStakingAssetIDResponse) MarshalZAP ¶ added in v1.36.178
func (x *GetStakingAssetIDResponse) MarshalZAP() ([]byte, error)
MarshalZAP writes GetStakingAssetIDResponse from constant offsets.
func (*GetStakingAssetIDResponse) UnmarshalZAP ¶ added in v1.36.178
func (x *GetStakingAssetIDResponse) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetStakingAssetIDResponse out of the buffer that arrived.
type GetTimestampReply ¶ added in v0.1.1
GetTimestampReply is the response from GetTimestamp
func (*GetTimestampReply) MarshalZAP ¶ added in v1.36.178
func (x *GetTimestampReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetTimestampReply from constant offsets.
func (*GetTimestampReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetTimestampReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetTimestampReply out of the buffer that arrived.
type GetTotalStakeArgs ¶ added in v0.1.1
type GetTotalStakeArgs struct {
// Net we're getting the total stake
// If omitted returns Primary network weight
ChainID ids.ID `json:"netID"`
}
GetTotalStakeArgs are the arguments for calling GetTotalStake
func (*GetTotalStakeArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetTotalStakeArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetTotalStakeArgs from constant offsets.
func (*GetTotalStakeArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetTotalStakeArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetTotalStakeArgs out of the buffer that arrived.
type GetTotalStakeReply ¶ added in v0.1.1
type GetTotalStakeReply struct {
// Deprecated: Use Weight instead.
Stake avajson.Uint64 `json:"stake"`
Weight avajson.Uint64 `json:"weight"`
}
GetTotalStakeReply is the response from calling GetTotalStake.
func (*GetTotalStakeReply) MarshalZAP ¶ added in v1.36.178
func (x *GetTotalStakeReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetTotalStakeReply from constant offsets.
func (*GetTotalStakeReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetTotalStakeReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetTotalStakeReply out of the buffer that arrived.
type GetTxStatusArgs ¶ added in v0.1.1
func (*GetTxStatusArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetTxStatusArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetTxStatusArgs from constant offsets.
func (*GetTxStatusArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetTxStatusArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetTxStatusArgs out of the buffer that arrived.
type GetTxStatusResponse ¶ added in v0.1.1
type GetTxStatusResponse struct {
Status status.Status `json:"status"`
// Reason this tx was dropped.
// Only non-empty if Status is dropped
Reason string `json:"reason,omitempty"`
}
func (*GetTxStatusResponse) MarshalZAP ¶ added in v1.36.178
func (x *GetTxStatusResponse) MarshalZAP() ([]byte, error)
MarshalZAP writes GetTxStatusResponse from constant offsets.
func (*GetTxStatusResponse) UnmarshalZAP ¶ added in v1.36.178
func (x *GetTxStatusResponse) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetTxStatusResponse out of the buffer that arrived.
type GetValidatorFeeStateReply ¶ added in v0.1.1
type GetValidatorFeeStateReply struct {
Excess gas.Gas `json:"excess"`
Price gas.Price `json:"price"`
Time avajson.Time `json:"timestamp"`
}
func (*GetValidatorFeeStateReply) MarshalZAP ¶ added in v1.36.178
func (x *GetValidatorFeeStateReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetValidatorFeeStateReply from constant offsets.
func (*GetValidatorFeeStateReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetValidatorFeeStateReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetValidatorFeeStateReply out of the buffer that arrived.
type GetValidatorsAtArgs ¶ added in v0.1.1
type GetValidatorsAtArgs struct {
Height platformapitypes.Height `json:"height"`
ChainID ids.ID `json:"netID"`
}
GetValidatorsAtArgs is the response from GetValidatorsAt
func (*GetValidatorsAtArgs) MarshalZAP ¶ added in v1.36.178
func (x *GetValidatorsAtArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes GetValidatorsAtArgs from constant offsets.
func (*GetValidatorsAtArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *GetValidatorsAtArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetValidatorsAtArgs out of the buffer that arrived.
type GetValidatorsAtReply ¶ added in v0.1.1
type GetValidatorsAtReply struct {
Validators ValidatorSet
}
GetValidatorsAtReply is the response from GetValidatorsAt.
The wire carries a node id, a public key and a weight per validator, and that is what this holds. The read behind it answers with more — a corona key, a light weight, the tx that added the validator — and none of it has ever been on the wire, so a reply that held it would state a contract the answer does not keep.
func (*GetValidatorsAtReply) MarshalJSON ¶ added in v0.1.1
func (v *GetValidatorsAtReply) MarshalJSON() ([]byte, error)
func (*GetValidatorsAtReply) MarshalZAP ¶ added in v1.36.178
func (x *GetValidatorsAtReply) MarshalZAP() ([]byte, error)
MarshalZAP writes GetValidatorsAtReply from constant offsets.
func (*GetValidatorsAtReply) UnmarshalJSON ¶ added in v0.1.1
func (v *GetValidatorsAtReply) UnmarshalJSON(b []byte) error
func (*GetValidatorsAtReply) UnmarshalZAP ¶ added in v1.36.178
func (x *GetValidatorsAtReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads GetValidatorsAtReply out of the buffer that arrived.
type Index ¶ added in v0.1.1
type Index struct {
Address string `json:"address"` // The address as a string
UTXO string `json:"utxo"` // The UTXO ID as a string
}
Index is an address and an associated UTXO. Marks a starting or stopping point when fetching UTXOs. Used for pagination.
type L1Validator ¶ added in v0.1.1
type L1Validator struct {
ChainID ids.ID
NodeID ids.NodeID
PublicKey *bls.PublicKey
RemainingBalanceOwner *secp256k1fx.OutputOwners
DeactivationOwner *secp256k1fx.OutputOwners
StartTime uint64
Weight uint64
MinNonce uint64
// Balance is the remaining amount of LUX this L1 validator has for paying
// the continuous fee.
Balance uint64
}
L1Validator is the response from calling GetL1Validator on the API client.
type SampleValidatorsArgs ¶
type SampleValidatorsArgs struct {
// Number of validators in the sample
Size avajson.Uint16 `json:"size"`
// ID of net to sample validators from
// If omitted, defaults to the primary network
ChainID ids.ID `json:"netID"`
}
SampleValidatorsArgs are the arguments for calling SampleValidators
func (*SampleValidatorsArgs) MarshalZAP ¶ added in v1.36.178
func (x *SampleValidatorsArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes SampleValidatorsArgs from constant offsets.
func (*SampleValidatorsArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *SampleValidatorsArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads SampleValidatorsArgs out of the buffer that arrived.
type SampleValidatorsReply ¶
SampleValidatorsReply are the results from calling Sample
func (*SampleValidatorsReply) MarshalZAP ¶ added in v1.36.178
func (x *SampleValidatorsReply) MarshalZAP() ([]byte, error)
MarshalZAP writes SampleValidatorsReply from constant offsets.
func (*SampleValidatorsReply) UnmarshalZAP ¶ added in v1.36.178
func (x *SampleValidatorsReply) UnmarshalZAP(data []byte) error
UnmarshalZAP reads SampleValidatorsReply out of the buffer that arrived.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service defines the API calls that can be made to the platform chain
func (*Service) GetAllValidatorsAt ¶ added in v1.16.56
func (s *Service) GetAllValidatorsAt(r *http.Request, args *GetAllValidatorsAtArgs, reply *GetAllValidatorsAtReply) error
GetAllValidatorsAt returns the validator sets of all nets (including primary network) at the specified height. Height is a u64 whose reserved value MaxUint64 asks for the height the next proposal will be built at; the JSON edge spells that value "proposed".
func (*Service) GetBalance ¶ added in v0.1.1
func (s *Service) GetBalance(_ *http.Request, args *GetBalanceRequest, response *GetBalanceResponse) error
GetBalance gets the balance of an address
func (*Service) GetBlock ¶ added in v0.1.1
func (s *Service) GetBlock(_ *http.Request, args *apitypes.GetBlockArgs, response *apitypes.GetBlockResponse) error
func (*Service) GetBlockByHeight ¶ added in v0.1.1
func (s *Service) GetBlockByHeight(_ *http.Request, args *apitypes.GetBlockByHeightArgs, response *apitypes.GetBlockResponse) error
GetBlockByHeight returns the block at the given height.
func (*Service) GetBlockchainStatus ¶
func (s *Service) GetBlockchainStatus(r *http.Request, args *GetBlockchainStatusArgs, reply *GetBlockchainStatusReply) error
GetBlockchainStatus gets the status of a blockchain with the ID [args.BlockchainID].
func (*Service) GetBlockchains ¶
func (s *Service) GetBlockchains(_ *http.Request, _ *struct{}, response *GetBlockchainsResponse) error
GetBlockchains returns all of the blockchains that exist
func (*Service) GetChains ¶ added in v1.26.10
func (s *Service) GetChains(r *http.Request, args *GetChainsArgs, response *GetChainsResponse) error
GetChains is the canonical RPC for listing chains registered on the platform. Behaviorally identical to GetNets (which it supersedes): returns every chain when IDs is empty, otherwise filters to the listed IDs, including the primary network sentinel (constants.PrimaryNetworkID) regardless of filter — callers deciding whether a chain is the primary network should compare the returned ID rather than relying on omission.
Use this in new code; GetNets stays available indefinitely for wire-protocol compatibility but logs every call as deprecated.
func (*Service) GetCurrentSupply ¶ added in v0.1.1
func (s *Service) GetCurrentSupply(r *http.Request, args *GetCurrentSupplyArgs, reply *GetCurrentSupplyReply) error
GetCurrentSupply returns an upper bound on the supply of LUX in the system
func (*Service) GetCurrentValidators ¶
func (s *Service) GetCurrentValidators(request *http.Request, args *GetCurrentValidatorsArgs, reply *GetCurrentValidatorsReply) error
GetCurrentValidators returns the current validators. If a single nodeID is provided, full delegators information is also returned. Otherwise only delegators' number and total weight is returned.
func (*Service) GetFeeConfig ¶ added in v0.1.1
func (s *Service) GetFeeConfig(_ *http.Request, _ *struct{}, reply *GetFeeConfigReply) error
GetFeeConfig returns the dynamic fee config of the chain.
func (*Service) GetFeeState ¶ added in v0.1.1
func (s *Service) GetFeeState(_ *http.Request, _ *struct{}, reply *GetFeeStateReply) error
GetFeeState returns the current fee state of the chain.
func (*Service) GetHeight ¶ added in v0.1.1
func (s *Service) GetHeight(r *http.Request, _ *struct{}, response *apitypes.GetHeightResponse) error
GetHeight returns the height of the last accepted block
func (*Service) GetL1Validator ¶ added in v0.1.1
func (s *Service) GetL1Validator(r *http.Request, args *GetL1ValidatorArgs, reply *GetL1ValidatorReply) error
GetL1Validator returns the L1 validator if it exists
func (*Service) GetMinStake ¶ added in v0.1.1
func (s *Service) GetMinStake(_ *http.Request, args *GetMinStakeArgs, reply *GetMinStakeReply) error
GetMinStake returns the minimum staking amount in µLUX.
func (*Service) GetNet ¶ added in v1.16.56
func (s *Service) GetNet(_ *http.Request, args *GetNetArgs, response *GetNetResponse) error
func (*Service) GetNets ¶ added in v1.16.56
func (s *Service) GetNets(_ *http.Request, args *GetNetsArgs, response *GetNetsResponse) error
GetNets returns the nets whose ID are in [args.IDs] The response will include the primary network
func (*Service) GetProposedHeight ¶ added in v0.1.1
func (s *Service) GetProposedHeight(r *http.Request, _ *struct{}, reply *apitypes.GetHeightResponse) error
GetProposedHeight returns the current ProposerVM height
func (*Service) GetRewardUTXOs ¶ added in v0.1.1
func (s *Service) GetRewardUTXOs(_ *http.Request, args *apitypes.GetTxArgs, reply *GetRewardUTXOsReply) error
GetRewardUTXOs returns the UTXOs that were rewarded after the provided transaction's staking period ended.
func (*Service) GetStake ¶ added in v0.1.1
func (s *Service) GetStake(_ *http.Request, args *GetStakeArgs, response *GetStakeReply) error
GetStake returns the amount of µLUX that [args.Addresses] have cumulatively staked on the Primary Network.
This method assumes that each stake output has only owner This method assumes only LUX can be staked This method only concerns itself with the Primary Network, not nets in a data structure rather than re-calculating it by iterating over stakers
func (*Service) GetStakingAssetID ¶ added in v0.1.1
func (s *Service) GetStakingAssetID(_ *http.Request, args *GetStakingAssetIDArgs, response *GetStakingAssetIDResponse) error
GetStakingAssetID returns the assetID of the token used to stake on the provided net
func (*Service) GetTimestamp ¶ added in v0.1.1
func (s *Service) GetTimestamp(_ *http.Request, _ *struct{}, reply *GetTimestampReply) error
GetTimestamp returns the current timestamp on chain.
func (*Service) GetTotalStake ¶ added in v0.1.1
func (s *Service) GetTotalStake(_ *http.Request, args *GetTotalStakeArgs, reply *GetTotalStakeReply) error
GetTotalStake returns the total amount staked on the Primary Network
func (*Service) GetTxStatus ¶ added in v0.1.1
func (s *Service) GetTxStatus(_ *http.Request, args *GetTxStatusArgs, response *GetTxStatusResponse) error
GetTxStatus gets a tx's status
func (*Service) GetUTXOs ¶ added in v0.1.1
func (s *Service) GetUTXOs(_ *http.Request, args *apitypes.GetUTXOsArgs, response *apitypes.GetUTXOsReply) error
GetUTXOs returns the UTXOs controlled by the given addresses
func (*Service) GetValidatorFeeConfig ¶ added in v0.1.1
GetValidatorFeeConfig returns the validator fee config of the chain.
func (*Service) GetValidatorFeeState ¶ added in v0.1.1
func (s *Service) GetValidatorFeeState(_ *http.Request, _ *struct{}, reply *GetValidatorFeeStateReply) error
GetValidatorFeeState returns the current validator fee state of the chain.
func (*Service) GetValidatorsAt ¶ added in v0.1.1
func (s *Service) GetValidatorsAt(r *http.Request, args *GetValidatorsAtArgs, reply *GetValidatorsAtReply) error
GetValidatorsAt returns the weights of the validator set of a provided net at the specified height. Height is a u64 whose reserved value MaxUint64 asks for the height the next proposal will be built at; the JSON edge spells that value "proposed".
func (*Service) SampleValidators ¶
func (s *Service) SampleValidators(_ *http.Request, args *SampleValidatorsArgs, reply *SampleValidatorsReply) error
SampleValidators returns a sampling of the list of current validators
func (*Service) ValidatedBy ¶
func (s *Service) ValidatedBy(r *http.Request, args *ValidatedByArgs, response *ValidatedByResponse) error
ValidatedBy returns the ID of the Net that validates [args.BlockchainID]
func (*Service) Validates ¶
func (s *Service) Validates(_ *http.Request, args *ValidatesArgs, response *ValidatesResponse) error
Validates returns the IDs of the blockchains validated by [args.ChainID]
type VM ¶
type VM struct {
config.Internal
blockbuilder.Builder
*network.Network
validators.State
// contains filtered or unexported fields
}
func (*VM) BuildBlock ¶
BuildBlock implements chainengine.BlockBuilder for consensus engine integration. This method is required for the consensus engine to be able to build new P-chain blocks. It delegates to the embedded Builder which handles the actual block construction.
func (*VM) CreateHandlers ¶
CreateHandlers returns a map where: * keys are API endpoint extensions * values are API handlers This now uses lazy initialization to avoid race conditions during VM startup
func (*VM) Disconnected ¶ added in v0.1.1
func (*VM) GetBlockIDAtHeight ¶ added in v0.1.1
func (*VM) GetChainID ¶ added in v1.16.16
GetChainID returns the chain ID for a given network ID
func (*VM) GetNetworkID ¶ added in v1.22.86
GetNetworkID returns the network ID for a given chain ID
func (*VM) HealthCheck ¶ added in v0.1.1
func (*VM) Initialize ¶
Initialize this blockchain. [vm.ChainManager] and [vm.vdrMgr] must be set before this function is called.
func (*VM) LastAccepted ¶ added in v0.1.1
LastAccepted returns the block most recently accepted
func (*VM) NewHTTPHandler ¶ added in v0.1.1
NewHTTPHandler returns a new HTTP handler that can handle API calls This is required by the chain.ChainVM interface
func (*VM) SetPreference ¶
SetPreference sets the preferred block to be the one with ID [blkID]
type ValidatedByArgs ¶
type ValidatedByArgs struct {
// ValidatedBy returns the ID of the Net validating the blockchain with this ID
BlockchainID ids.ID `json:"blockchainID"`
}
ValidatedByArgs is the arguments for calling ValidatedBy
func (*ValidatedByArgs) MarshalZAP ¶ added in v1.36.178
func (x *ValidatedByArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes ValidatedByArgs from constant offsets.
func (*ValidatedByArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *ValidatedByArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads ValidatedByArgs out of the buffer that arrived.
type ValidatedByResponse ¶
type ValidatedByResponse struct {
// ID of the Net validating the specified blockchain
ChainID ids.ID `json:"netID"`
}
ValidatedByResponse is the reply from calling ValidatedBy
func (*ValidatedByResponse) MarshalZAP ¶ added in v1.36.178
func (x *ValidatedByResponse) MarshalZAP() ([]byte, error)
MarshalZAP writes ValidatedByResponse from constant offsets.
func (*ValidatedByResponse) UnmarshalZAP ¶ added in v1.36.178
func (x *ValidatedByResponse) UnmarshalZAP(data []byte) error
UnmarshalZAP reads ValidatedByResponse out of the buffer that arrived.
type ValidatesArgs ¶
ValidatesArgs are the arguments to Validates
func (*ValidatesArgs) MarshalZAP ¶ added in v1.36.178
func (x *ValidatesArgs) MarshalZAP() ([]byte, error)
MarshalZAP writes ValidatesArgs from constant offsets.
func (*ValidatesArgs) UnmarshalZAP ¶ added in v1.36.178
func (x *ValidatesArgs) UnmarshalZAP(data []byte) error
UnmarshalZAP reads ValidatesArgs out of the buffer that arrived.
type ValidatesResponse ¶
ValidatesResponse is the response from calling Validates
func (*ValidatesResponse) MarshalZAP ¶ added in v1.36.178
func (x *ValidatesResponse) MarshalZAP() ([]byte, error)
MarshalZAP writes ValidatesResponse from constant offsets.
func (*ValidatesResponse) UnmarshalZAP ¶ added in v1.36.178
func (x *ValidatesResponse) UnmarshalZAP(data []byte) error
UnmarshalZAP reads ValidatesResponse out of the buffer that arrived.
type Validator ¶
type Validator struct {
NodeID ids.NodeID `json:"-"`
PublicKey []byte `json:"publicKey"`
Weight avajson.Uint64 `json:"weight"`
}
Validator is one entry of the set getValidatorsAt answers with: the node, the BLS public key it signs with when it has one, and its weight. That is all that reply has ever carried — the read behind it knows more about each validator and the wire has never said it, so neither does this.
The node id is the object's KEY on the wire, not one of its fields, which is what `json:"-"` says here; ValidatorSet supplies it.
func (*Validator) MarshalZAP ¶ added in v1.36.178
MarshalZAP writes Validator from constant offsets.
func (*Validator) UnmarshalZAP ¶ added in v1.36.178
UnmarshalZAP reads Validator out of the buffer that arrived.
type ValidatorSet ¶ added in v1.36.178
type ValidatorSet []Validator
ValidatorSet is a validator set read at a height. The wire spells it as an object keyed by node id; GetValidatorsAtReply writes and reads that spelling.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package adopt is the register of networks Lux did not create.
|
Package adopt is the register of networks Lux did not create. |
|
Package block is a generated GoMock package.
|
Package block is a generated GoMock package. |
|
executor
Package executor is a generated GoMock package.
|
Package executor is a generated GoMock package. |
|
executor/executormock
Package executormock is a generated GoMock package.
|
Package executormock is a generated GoMock package. |
|
Package fx is a generated GoMock package.
|
Package fx is a generated GoMock package. |
|
fxmock
Package fxmock is a generated GoMock package.
|
Package fxmock is a generated GoMock package. |
|
Package security is the network security model for Lux L1/L2 networks (LP-018 §"Network security modes").
|
Package security is the network security model for Lux L1/L2 networks (LP-018 §"Network security modes"). |
|
signermock
Package signermock is a generated GoMock package.
|
Package signermock is a generated GoMock package. |
|
Package stakingparams is the node-policy the validator set governs, plus the pure rule that decides whether a proposed change is admissible.
|
Package stakingparams is the node-policy the validator set governs, plus the pure rule that decides whether a proposed change is admissible. |
|
Package state is a generated GoMock package.
|
Package state is a generated GoMock package. |
|
Package txs is a generated GoMock package.
|
Package txs is a generated GoMock package. |
|
bench
Package bench holds the reflection codec-vs-native-ZAP benchmark harness for the platformvm txs.
|
Package bench holds the reflection codec-vs-native-ZAP benchmark harness for the platformvm txs. |
|
fee
Package fee implements gas complexity calculations for platform transactions.
|
Package fee implements gas complexity calculations for platform transactions. |
|
mempool
Package mempool is a generated GoMock package.
|
Package mempool is a generated GoMock package. |
|
Package utxo is a generated GoMock package.
|
Package utxo is a generated GoMock package. |
|
utxomock
Package utxomock is a generated GoMock package.
|
Package utxomock is a generated GoMock package. |
|
zwarp
Package zwarp provides ZAP transport for warp messaging.
|
Package zwarp provides ZAP transport for warp messaging. |