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 APINet
- 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) GetCurrentSupply(ctx context.Context, chainID ids.ID, options ...rpc.Option) (uint64, uint64, error)
- func (c *Client) GetCurrentValidators(ctx context.Context, chainID ids.ID, nodeIDs []ids.NodeID, ...) ([]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 *api.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, chainID 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 ClientDelegator
- type ClientL1Validator
- type ClientNet
- type ClientOwner
- type ClientPermissionlessValidator
- type ClientStaker
- type GetBalanceRequest
- type GetBalanceResponse
- type GetBlockchainStatusArgs
- type GetBlockchainStatusReply
- type GetBlockchainsReply
- type GetBlockchainsResponse
- 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 L1Validator
- type L1ValidatorOwner
- type SampleValidatorsArgs
- type SampleValidatorsReply
- type ValidatedByArgs
- type ValidatedByResponse
- type ValidatesArgs
- type ValidatesResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AwaitTxAccepted ¶
func GetDeactivationOwners ¶
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 {
ID ids.ID `json:"id"`
Name string `json:"name"`
ChainID ids.ID `json:"chainID"`
VMID ids.ID `json:"vmID"`
FxIDs []ids.ID `json:"fxIDs,omitempty"`
Metadata string `json:"metadata,omitempty"`
}
APIBlockchain represents a blockchain in the API response
type APINet ¶
type APINet struct {
ID ids.ID `json:"id"`
ControlKeys []string `json:"controlKeys"`
Threshold json.Uint32 `json:"threshold"`
}
APINet represents a net in the API
type Client ¶
type Client struct {
Requester rpc.EndpointRequester
// contains filtered or unexported fields
}
func NewClientWithNetworkID ¶
NewClientWithNetworkID returns a new platformvm.Client with the network ID set for proper bech32 address formatting
func (*Client) GetAtomicUTXOs ¶
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
func (*Client) GetBlock ¶
func (c *Client) GetBlock(ctx context.Context, blockID ids.ID, options ...rpc.Option) ([]byte, error)
GetBlock returns blockID.
func (*Client) GetBlockByHeight ¶
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 ¶
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
func (*Client) GetCurrentSupply ¶
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 ¶
func (c *Client) GetCurrentValidators( ctx context.Context, chainID ids.ID, nodeIDs []ids.NodeID, options ...rpc.Option, ) ([]ClientPermissionlessValidator, error)
GetCurrentValidators returns the list of current validators for chainID.
func (*Client) GetFeeConfig ¶
GetFeeConfig returns the dynamic fee config.
func (*Client) GetFeeState ¶
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 ¶
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 ¶
func (c *Client) GetMinStake(ctx context.Context, chainID ids.ID, options ...rpc.Option) (uint64, uint64, error)
GetMinStake returns the minimum staking amount in nLUX for validators and delegators respectively.
func (*Client) GetNet ¶
func (c *Client) GetNet(ctx context.Context, chainID ids.ID, options ...rpc.Option) (GetNetClientResponse, error)
GetNet returns information about the specified chain.
func (*Client) GetProposedHeight ¶
GetProposedHeight returns the current height of this node's proposer VM.
func (*Client) GetStake
deprecated
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 nLUX that addrs have cumulatively staked on the Primary Network.
Deprecated: Stake should be calculated using GetTx and GetCurrentValidators.
func (*Client) GetStakingAssetID ¶
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 ¶
GetTimestamp returns the current chain timestamp.
func (*Client) GetTotalStake ¶
func (c *Client) GetTotalStake(ctx context.Context, chainID ids.ID, options ...rpc.Option) (uint64, error)
GetTotalStake returns the total amount (in nLUX) staked on the network.
func (*Client) GetTxStatus ¶
func (c *Client) GetTxStatus(ctx context.Context, txID ids.ID, options ...rpc.Option) (*GetTxStatusResponse, error)
GetTxStatus returns the status of txID.
func (*Client) GetUTXOs ¶
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 ¶
func (c *Client) GetValidatorFeeConfig(ctx context.Context, options ...rpc.Option) (*fee.Config, error)
GetValidatorFeeConfig returns the validator fee config.
func (*Client) GetValidatorFeeState ¶
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 ¶
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 ¶
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 ¶
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 ¶
SetNetworkID sets the network ID for address formatting
type ClientDelegator ¶
type ClientDelegator struct {
ClientStaker
RewardOwner *ClientOwner
PotentialReward *uint64
}
ClientDelegator is the repr. of a delegator sent over client
type ClientL1Validator ¶
type ClientL1Validator struct {
ValidationID *ids.ID
RemainingBalanceOwner *ClientOwner
DeactivationOwner *ClientOwner
MinNonce *uint64
Balance *uint64
}
type ClientNet ¶
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 ¶
ClientOwner is the repr. of a reward owner sent over client
type ClientPermissionlessValidator ¶
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 ¶
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 GetBalanceRequest ¶
type GetBalanceRequest struct {
Addresses []string `json:"addresses"`
}
GetBalanceRequest is the request for GetBalance
type GetBalanceResponse ¶
type GetBalanceResponse struct {
Balance json.Uint64 `json:"balance"`
Unlocked json.Uint64 `json:"unlocked"`
LockedStakeable json.Uint64 `json:"lockedStakeable"`
LockedNotStakeable json.Uint64 `json:"lockedNotStakeable"`
UTXOIDs []ids.ID `json:"utxoIDs"`
}
GetBalanceResponse is the response from GetBalance
type GetBlockchainStatusArgs ¶
type GetBlockchainStatusArgs struct {
BlockchainID string `json:"blockchainID"`
}
GetBlockchainStatusArgs is the request for GetBlockchainStatus
type GetBlockchainStatusReply ¶
type GetBlockchainStatusReply struct {
Status status.BlockchainStatus `json:"status"`
}
GetBlockchainStatusReply is the response from GetBlockchainStatus
type GetBlockchainsReply ¶
type GetBlockchainsReply struct {
Blockchains []APIBlockchain `json:"blockchains"`
}
GetBlockchainsReply is the response from GetBlockchains
type GetBlockchainsResponse ¶
type GetBlockchainsResponse struct {
Blockchains []APIBlockchain `json:"blockchains"`
}
GetBlockchainsResponse is the response from GetBlockchains
type GetCurrentSupplyArgs ¶
GetCurrentSupplyArgs is the request for GetCurrentSupply
type GetCurrentSupplyReply ¶
type GetCurrentSupplyReply struct {
Supply json.Uint64 `json:"supply"`
Height json.Uint64 `json:"height"`
}
GetCurrentSupplyReply is the response from GetCurrentSupply
type GetCurrentValidatorsArgs ¶
type GetCurrentValidatorsArgs struct {
ChainID ids.ID `json:"chainID"`
NodeIDs []ids.NodeID `json:"nodeIDs"`
}
GetCurrentValidatorsArgs is the request for GetCurrentValidators
type GetCurrentValidatorsReply ¶
type GetCurrentValidatorsReply struct {
Validators []interface{} `json:"validators"`
}
GetCurrentValidatorsReply is the response from GetCurrentValidators
type GetFeeConfigReply ¶
type GetFeeConfigReply struct {
GasConfig interface{} `json:"gasConfig"`
GasPrice interface{} `json:"gasPrice"`
Timestamp time.Time `json:"timestamp"`
}
GetFeeConfigReply is the response from GetFeeConfig
type GetFeeStateReply ¶
type GetFeeStateReply struct {
gas.State
Price gas.Price `json:"price"`
Time time.Time `json:"timestamp"`
}
GetFeeStateReply is the response from GetFeeState
type GetL1ValidatorArgs ¶
GetL1ValidatorArgs is the request for GetL1Validator
type GetL1ValidatorReply ¶
type GetL1ValidatorReply struct {
ChainID ids.ID `json:"chainID"`
NodeID ids.NodeID `json:"nodeID"`
PublicKey *[]byte `json:"publicKey,omitempty"`
RemainingBalanceOwner L1ValidatorOwner `json:"remainingBalanceOwner"`
DeactivationOwner L1ValidatorOwner `json:"deactivationOwner"`
StartTime json.Uint64 `json:"startTime"`
Weight json.Uint64 `json:"weight"`
MinNonce *json.Uint64 `json:"minNonce,omitempty"`
Balance *json.Uint64 `json:"balance,omitempty"`
Height json.Uint64 `json:"height"`
}
GetL1ValidatorReply is the response from GetL1Validator
type GetMinStakeArgs ¶
GetMinStakeArgs is the request for GetMinStake
type GetMinStakeReply ¶
type GetMinStakeReply struct {
MinValidatorStake json.Uint64 `json:"minValidatorStake"`
MinDelegatorStake json.Uint64 `json:"minDelegatorStake"`
}
GetMinStakeReply is the response from GetMinStake
type GetNetArgs ¶
GetNetArgs is the request for GetNet
type GetNetClientResponse ¶
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 ¶
type GetNetResponse struct {
IsPermissioned bool `json:"isPermissioned"`
ControlKeys []string `json:"controlKeys"`
Threshold json.Uint32 `json:"threshold"`
Locktime json.Uint64 `json:"locktime"`
NetTransformationTxID ids.ID `json:"netTransformationTxID"`
ConversionID ids.ID `json:"conversionID"`
ManagerChainID ids.ID `json:"managerChainID"`
ManagerAddress []byte `json:"managerAddress"`
}
GetNetResponse is the response from GetNet
type GetNetsArgs ¶
GetNetsArgs is the request for GetNets
type GetNetsResponse ¶
type GetNetsResponse struct {
Nets []APINet `json:"nets"`
}
GetNetsResponse is the response from GetNets
type GetRewardUTXOsReply ¶
type GetRewardUTXOsReply struct {
UTXOs []string `json:"utxos"`
Encoding formatting.Encoding `json:"encoding"`
}
GetRewardUTXOsReply is the response from GetRewardUTXOs
type GetStakeArgs ¶
type GetStakeArgs struct {
JSONAddresses interface{} `json:"addresses"`
ValidatorsOnly bool `json:"validatorsOnly"`
Encoding formatting.Encoding `json:"encoding"`
}
GetStakeArgs is the request for GetStake
type GetStakeReply ¶
type GetStakeReply struct {
Stakeds map[ids.ID]json.Uint64 `json:"stakeds"`
Outputs []string `json:"stakedOutputs"`
Encoding formatting.Encoding `json:"encoding"`
}
GetStakeReply is the response from GetStake
type GetStakingAssetIDArgs ¶
GetStakingAssetIDArgs is the request for GetStakingAssetID
type GetStakingAssetIDResponse ¶
GetStakingAssetIDResponse is the response from GetStakingAssetID
type GetTimestampReply ¶
GetTimestampReply is the response from GetTimestamp
type GetTotalStakeArgs ¶
GetTotalStakeArgs is the request for GetTotalStake
type GetTotalStakeReply ¶
type GetTotalStakeReply struct {
Stake json.Uint64 `json:"stake,omitempty"`
Weight json.Uint64 `json:"weight,omitempty"`
}
GetTotalStakeReply is the response from GetTotalStake
type GetTxStatusArgs ¶
GetTxStatusArgs is the request for GetTxStatus
type GetTxStatusResponse ¶
type GetTxStatusResponse struct {
Status status.Status `json:"status"`
Reason string `json:"reason,omitempty"`
}
GetTxStatusResponse is the response from GetTxStatus
type GetValidatorFeeStateReply ¶
type GetValidatorFeeStateReply struct {
Excess gas.Gas `json:"excess"`
Price gas.Price `json:"price"`
Time time.Time `json:"timestamp"`
}
GetValidatorFeeStateReply is the response from GetValidatorFeeState
type GetValidatorsAtArgs ¶
type GetValidatorsAtArgs struct {
Height interface{} `json:"height"`
ChainID ids.ID `json:"chainID"`
}
GetValidatorsAtArgs is the request for GetValidatorsAt
type GetValidatorsAtReply ¶
type GetValidatorsAtReply struct {
Validators map[ids.NodeID]*validators.GetValidatorOutput `json:"validators"`
}
GetValidatorsAtReply is the response from GetValidatorsAt
type L1Validator ¶
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 L1ValidatorOwner ¶
type L1ValidatorOwner struct {
Locktime json.Uint64 `json:"locktime"`
Threshold json.Uint32 `json:"threshold"`
Addresses []string `json:"addresses"`
}
L1ValidatorOwner represents an owner in an L1 validator response
type SampleValidatorsArgs ¶
SampleValidatorsArgs is the request for SampleValidators
type SampleValidatorsReply ¶
SampleValidatorsReply is the response from SampleValidators
type ValidatedByArgs ¶
ValidatedByArgs is the request for ValidatedBy
type ValidatedByResponse ¶
ValidatedByResponse is the response from ValidatedBy
type ValidatesArgs ¶
ValidatesArgs is the request for Validates
type ValidatesResponse ¶
ValidatesResponse is the response from Validates