Documentation
¶
Index ¶
- Variables
- func AssetIDFromGenesisBytes(genesisBytes []byte) (ids.ID, error)
- func AwaitTxAccepted(c *Client, ctx context.Context, txID ids.ID, freq time.Duration, ...) error
- func NewPubSubFilterer(tx *txs.Tx) pubsub.Filterer
- type AssetDefinition
- type AssetIDChangeAddr
- type AssetInitialState
- type BCLookup
- type Balance
- type BuildGenesisArgs
- type BuildGenesisReply
- type Client
- func (c *Client) GetAllBalances(ctx context.Context, addr ids.ShortID, includePartial bool, ...) ([]Balance, error)deprecated
- func (c *Client) GetAssetDescription(ctx context.Context, assetID string, options ...rpc.Option) (*GetAssetDescriptionReply, error)
- 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, addr ids.ShortID, assetID string, includePartial bool, ...) (*GetBalanceReply, error)deprecated
- func (c *Client) GetBlock(ctx context.Context, blkID ids.ID, options ...rpc.Option) ([]byte, error)
- func (c *Client) GetBlockByHeight(ctx context.Context, height uint64, options ...rpc.Option) ([]byte, error)
- func (c *Client) GetHeight(ctx context.Context, options ...rpc.Option) (uint64, error)
- func (c *Client) GetTx(ctx context.Context, txID ids.ID, options ...rpc.Option) ([]byte, error)
- func (c *Client) GetTxFee(ctx context.Context, options ...rpc.Option) (uint64, uint64, error)
- func (c *Client) GetTxStatus(ctx context.Context, txID ids.ID, options ...rpc.Option) (choices.Status, error)deprecated
- func (c *Client) GetUTXOs(ctx context.Context, addrs []ids.ShortID, limit uint32, ...) ([][]byte, ids.ShortID, ids.ID, error)
- func (c *Client) IssueTx(ctx context.Context, txBytes []byte, options ...rpc.Option) (ids.ID, error)
- type Config
- type CreateAssetArgs
- type CreateNFTAssetArgs
- type ExportArgs
- type ExportKeyArgs
- type ExportKeyReply
- type Factory
- type FormattedAssetID
- type Genesis
- type GenesisAsset
- type GenesisAssetDefinition
- type GenesisHolder
- type GenesisOwners
- type GetAddressTxsArgs
- type GetAddressTxsReply
- type GetAllBalancesArgs
- type GetAllBalancesReply
- type GetAssetDescriptionArgs
- type GetAssetDescriptionReply
- type GetBalanceArgs
- type GetBalanceReply
- type GetCurrentValidatorOutput
- type GetTxFeeReply
- type GetTxStatusReply
- type Holder
- type ImportArgs
- type ImportKeyArgs
- type ImportKeyReply
- type JSONChangeAddr
- type JSONFromAddrs
- type JSONSpendHeader
- type JSONTxIDChangeAddr
- type MintArgs
- type MintNFTArgs
- type Owners
- type SendArgs
- type SendMultipleArgs
- type SendNFTArgs
- type SendOutput
- type Service
- func (s *Service) CreateAddress(_ *http.Request, args *apitypes.UserPass, reply *apitypes.JSONAddress) error
- func (s *Service) CreateAsset(_ *http.Request, args *CreateAssetArgs, reply *AssetIDChangeAddr) error
- func (s *Service) CreateFixedCapAsset(r *http.Request, args *CreateAssetArgs, reply *AssetIDChangeAddr) error
- func (s *Service) CreateNFTAsset(_ *http.Request, args *CreateNFTAssetArgs, reply *AssetIDChangeAddr) error
- func (s *Service) CreateVariableCapAsset(r *http.Request, args *CreateAssetArgs, reply *AssetIDChangeAddr) error
- func (s *Service) Export(_ *http.Request, args *ExportArgs, reply *JSONTxIDChangeAddr) error
- func (s *Service) ExportKey(_ *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error
- func (s *Service) GetAddressTxs(_ *http.Request, args *GetAddressTxsArgs, reply *GetAddressTxsReply) error
- func (s *Service) GetAllBalances(_ *http.Request, args *GetAllBalancesArgs, reply *GetAllBalancesReply) error
- func (s *Service) GetAssetDescription(_ *http.Request, args *GetAssetDescriptionArgs, ...) error
- func (s *Service) GetBalance(_ *http.Request, args *GetBalanceArgs, reply *GetBalanceReply) error
- func (s *Service) GetBlock(_ *http.Request, args *apitypes.GetBlockArgs, reply *apitypes.GetBlockResponse) error
- func (s *Service) GetBlockByHeight(_ *http.Request, args *apitypes.GetBlockByHeightArgs, ...) error
- func (s *Service) GetHeight(_ *http.Request, _ *struct{}, reply *apitypes.GetHeightResponse) error
- func (s *Service) GetTx(_ *http.Request, args *apitypes.GetTxArgs, reply *apitypes.GetTxReply) error
- func (s *Service) GetTxStatus(_ *http.Request, args *apitypes.JSONTxID, reply *GetTxStatusReply) errordeprecated
- func (s *Service) GetUTXOs(_ *http.Request, args *apitypes.GetUTXOsArgs, reply *apitypes.GetUTXOsReply) error
- func (s *Service) Import(_ *http.Request, args *ImportArgs, reply *apitypes.JSONTxID) error
- func (s *Service) ImportKey(_ *http.Request, args *ImportKeyArgs, reply *apitypes.JSONAddress) error
- func (s *Service) IssueTx(_ *http.Request, args *apitypes.FormattedTx, reply *apitypes.JSONTxID) error
- func (s *Service) ListAddresses(_ *http.Request, args *apitypes.UserPass, response *apitypes.JSONAddresses) error
- func (s *Service) Mint(_ *http.Request, args *MintArgs, reply *JSONTxIDChangeAddr) error
- func (s *Service) MintNFT(_ *http.Request, args *MintNFTArgs, reply *JSONTxIDChangeAddr) error
- func (s *Service) Send(r *http.Request, args *SendArgs, reply *JSONTxIDChangeAddr) error
- func (s *Service) SendMultiple(_ *http.Request, args *SendMultipleArgs, reply *JSONTxIDChangeAddr) error
- func (s *Service) SendNFT(_ *http.Request, args *SendNFTArgs, reply *JSONTxIDChangeAddr) error
- type SharedMemory
- type StaticClient
- type StaticService
- type Tx
- func (tx *Tx) Accept(ctx context.Context) error
- func (tx *Tx) Bytes() []byte
- func (tx *Tx) Height() uint64
- func (tx *Tx) ID() ids.ID
- func (tx *Tx) MissingDependencies() (set.Set[ids.ID], error)
- func (tx *Tx) Parent() ids.ID
- func (tx *Tx) ParentIDs() []ids.ID
- func (*Tx) Reject(ctx context.Context) error
- func (tx *Tx) Status() choices.Status
- func (tx *Tx) Verify(ctx context.Context) error
- type VM
- func (vm *VM) BuildVertex(ctx context.Context) (dagvertex.Vertex, error)
- func (vm *VM) Clock() *mockable.Clock
- func (vm *VM) CodecRegistry() pcodecs.Registry
- func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, version *version.Application) error
- func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error)
- func (vm *VM) CreateStaticHandlers(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) GetEngine() dag.Engine
- func (vm *VM) GetTx(ctx context.Context, txID ids.ID) (dag.Transaction, error)
- func (vm *VM) GetUTXOs(addrs set.Set[ids.ShortID]) ([]*lux.UTXO, error)
- func (vm *VM) GetVertex(ctx context.Context, vtxID ids.ID) (dagvertex.Vertex, error)
- func (*VM) HealthCheck(context.Context) (interface{}, error)
- func (vm *VM) Initialize(ctx context.Context, init vmcore.Init) error
- func (vm *VM) LastAccepted(context.Context) (ids.ID, error)
- func (vm *VM) Linearize(ctx context.Context, stopVertexID ids.ID, toEngine chan<- vmcore.Message) error
- func (vm *VM) LoadUser(username string, password string, addresses set.Set[ids.ShortID]) ([]*lux.UTXO, *secp256k1fx.Keychain, error)
- func (vm *VM) Logger() log.Logger
- func (vm *VM) NewHTTPHandler(ctx context.Context) (http.Handler, error)
- func (vm *VM) ParseAddress(addrStr string) (ids.ID, ids.ShortID, error)
- func (vm *VM) ParseBlock(_ context.Context, blkBytes []byte) (chain.Block, error)
- func (vm *VM) ParseTx(_ context.Context, bytes []byte) (dag.Tx, error)
- func (vm *VM) ParseVertex(ctx context.Context, vtxBytes []byte) (dagvertex.Vertex, error)
- func (vm *VM) SetEngine(engine interface{})
- func (vm *VM) SetPreference(_ context.Context, blkID ids.ID) error
- func (vm *VM) SetState(_ context.Context, stateNum uint32) error
- func (vm *VM) Shutdown() error
- func (*VM) Version(context.Context) (string, error)
- func (vm *VM) WaitForEvent(ctx context.Context) (interface{}, error)
- type WalletClientdeprecated
- type WalletService
- func (w *WalletService) IssueTx(_ *http.Request, args *apitypes.FormattedTx, reply *apitypes.JSONTxID) error
- func (w *WalletService) Send(r *http.Request, args *SendArgs, reply *JSONTxIDChangeAddr) error
- func (w *WalletService) SendMultiple(_ *http.Request, args *SendMultipleArgs, reply *JSONTxIDChangeAddr) error
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{ Network: network.DefaultConfig, ChecksumsEnabled: true, Config: config.Config{ TxFee: 1000, CreateAssetTxFee: 10000, }, }
var ErrRejected = errors.New("rejected")
Functions ¶
func AssetIDFromGenesisBytes ¶ added in v1.26.40
AssetIDFromGenesisBytes returns the first genesis asset's runtime asset ID — the ID vm.initGenesis assigns to genesis.Txs[0]. This is the X-Chain native fee asset by convention (the same asset the platform-vm reports via platform.getStakingAssetID and the wallet builder context's UTXOAssetID).
Returns an error when genesisBytes is malformed or contains zero assets — both are unrecoverable on a primary-network bootstrap.
Types ¶
type AssetDefinition ¶
type AssetIDChangeAddr ¶ added in v1.1.11
type AssetIDChangeAddr struct {
FormattedAssetID
JSONChangeAddr
}
AssetIDChangeAddr is an asset ID and a change address
type AssetInitialState ¶
type AssetInitialState struct {
FixedCap []GenesisHolder
VariableCap []GenesisOwners
}
AssetInitialState describes the initial state of an asset
type BuildGenesisArgs ¶ added in v1.1.11
type BuildGenesisArgs struct {
NetworkID avajson.Uint32 `json:"networkID"`
GenesisData map[string]AssetDefinition `json:"genesisData"`
Encoding formatting.Encoding `json:"encoding"`
}
BuildGenesisArgs are arguments for BuildGenesis
type BuildGenesisReply ¶ added in v1.1.11
type BuildGenesisReply struct {
Bytes string `json:"bytes"`
Encoding formatting.Encoding `json:"encoding"`
}
BuildGenesisReply is the reply from BuildGenesis
type Client ¶
type Client struct {
Requester rpc.EndpointRequester
}
Client for interacting with the Exchange VM (X-Chain)
func (*Client) GetAssetDescription ¶
func (c *Client) GetAssetDescription(ctx context.Context, assetID string, options ...rpc.Option) (*GetAssetDescriptionReply, error)
GetAssetDescription returns a description of assetID.
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 (c *Client) GetBalance( ctx context.Context, addr ids.ShortID, assetID string, includePartial bool, options ...rpc.Option, ) (*GetBalanceReply, error)
GetBalance returns the balance of assetID held by addr.
If includePartial is set, balance includes partial owned (i.e. in a multisig) funds.
Deprecated: GetUTXOs should be used instead.
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) GetTxStatus
deprecated
type Config ¶
type Config struct {
Network network.Config `json:"network"`
ChecksumsEnabled bool `json:"checksumsEnabled"`
config.Config
}
func ParseConfig ¶
type CreateAssetArgs ¶ added in v1.1.11
type CreateAssetArgs struct {
JSONSpendHeader // User, password, from addrs, change addr
Name string `json:"name"`
Symbol string `json:"symbol"`
Denomination byte `json:"denomination"`
InitialHolders []*Holder `json:"initialHolders"`
MinterSets []Owners `json:"minterSets"`
}
CreateAssetArgs are arguments for passing into CreateAsset
type CreateNFTAssetArgs ¶ added in v1.1.11
type CreateNFTAssetArgs struct {
JSONSpendHeader // User, password, from addrs, change addr
Name string `json:"name"`
Symbol string `json:"symbol"`
MinterSets []Owners `json:"minterSets"`
}
CreateNFTAssetArgs are arguments for passing into CreateNFTAsset requests
type ExportArgs ¶ added in v1.1.11
type ExportArgs struct {
// User, password, from addrs, change addr
JSONSpendHeader
// Amount of nLUX to send
Amount avajson.Uint64 `json:"amount"`
// Chain the funds are going to. Optional. Used if To address does not include the chainID.
TargetChain string `json:"targetChain"`
// ID of the address that will receive the LUX. This address may include the
// chainID, which is used to determine what the destination chain is.
To string `json:"to"`
AssetID string `json:"assetID"`
}
ExportArgs are arguments for passing into ExportAVA requests
type ExportKeyArgs ¶ added in v1.1.11
ExportKeyArgs are arguments for ExportKey
type ExportKeyReply ¶ added in v1.1.11
type ExportKeyReply struct {
// The decrypted PrivateKey for the Address provided in the arguments
PrivateKey *secp256k1.PrivateKey `json:"privateKey"`
}
ExportKeyReply is the response for ExportKey
type Factory ¶
type Factory struct {
config.Config
// SecurityProfile pins the chain-wide credential-admission policy
// resolved at node bootstrap from the genesis SecurityProfile block
// (F102). The X-chain VM threads this into its mempool builder via
// SetAuthPolicy so strict-PQ chains refuse classical secp256k1
// credentials at gossip time. Nil for legacy (classical-compat)
// networks that pre-date the locked-profile pin.
SecurityProfile *consensusconfig.ChainSecurityProfile
// ClassicalCompatRegistry names the allow-list of legacy operators
// that may still post classical secp256k1 credentials under a
// classical-compat fork profile. Nil for strict-PQ.
ClassicalCompatRegistry auth.ClassicalCompatRegistry
}
type FormattedAssetID ¶
FormattedAssetID defines a JSON formatted struct containing an assetID as a string
type Genesis ¶
type Genesis struct {
Txs []*GenesisAsset `serialize:"true"`
}
Genesis represents the genesis state of the XVM
func NewGenesis ¶
func NewGenesis( networkID uint32, genesisData map[string]GenesisAssetDefinition, ) (*Genesis, error)
NewGenesis creates a new Genesis from genesis data
func ParseGenesisBytes ¶ added in v1.26.40
ParseGenesisBytes decodes the canonical XVM genesis bytes produced by (*Genesis).Bytes() back into a *Genesis with each GenesisAsset's embedded CreateAssetTx initialised against the genesis codec. After Initialize, each tx's deterministic ID (tx.ID()) is the runtime asset ID of that genesis-minted asset — i.e. the same value vm.initGenesis computes when bootstrapping the X-Chain.
Callers (genesis/builder, config/getGenesisData) use this to derive the X-Chain native asset ID from genesis content rather than the network-id-keyed constants.UTXOAssetIDFor(networkID). On sovereign L1s those two values DIFFER — the wallet builder context's UTXOAssetID must be the genesis-derived one or every fee-paying tx fails with "insufficient funds, needs N more nLUX".
type GenesisAsset ¶
type GenesisAsset struct {
Alias string `serialize:"true"`
txs.CreateAssetTx `serialize:"true"`
}
GenesisAsset represents an asset in the genesis block
func (*GenesisAsset) Compare ¶
func (g *GenesisAsset) Compare(other *GenesisAsset) int
Compare implements utils.Sortable for GenesisAsset
type GenesisAssetDefinition ¶ added in v1.24.12
type GenesisAssetDefinition struct {
Name string
Symbol string
Denomination byte
InitialState AssetInitialState
Memo []byte
}
GenesisAssetDefinition describes a genesis asset and its initial state
type GenesisHolder ¶ added in v1.24.12
GenesisHolder describes how much asset is owned by an address
type GenesisOwners ¶ added in v1.24.12
GenesisOwners describes who can perform an action
type GetAddressTxsArgs ¶ added in v1.1.11
type GetAddressTxsReply ¶ added in v1.1.11
type GetAllBalancesArgs ¶
type GetAllBalancesArgs struct {
apitypes.JSONAddress
IncludePartial bool `json:"includePartial"`
}
type GetAllBalancesReply ¶
type GetAllBalancesReply struct {
Balances []Balance `json:"balances"`
}
GetAllBalancesReply is the response from a call to GetAllBalances
type GetAssetDescriptionArgs ¶
type GetAssetDescriptionArgs struct {
AssetID string `json:"assetID"`
}
GetAssetDescriptionArgs are arguments for passing into GetAssetDescription requests
type GetAssetDescriptionReply ¶
type GetAssetDescriptionReply struct {
FormattedAssetID
Name string `json:"name"`
Symbol string `json:"symbol"`
Denomination avajson.Uint8 `json:"denomination"`
}
GetAssetDescriptionReply defines the GetAssetDescription replies returned from the API
type GetBalanceArgs ¶
type GetBalanceArgs struct {
Address string `json:"address"`
AssetID string `json:"assetID"`
IncludePartial bool `json:"includePartial"`
}
GetBalanceArgs are arguments for passing into GetBalance requests
type GetBalanceReply ¶
type GetBalanceReply struct {
Balance avajson.Uint64 `json:"balance"`
UTXOIDs []lux.UTXOID `json:"utxoIDs"`
}
GetBalanceReply defines the GetBalance replies returned from the API
type GetCurrentValidatorOutput ¶ added in v1.16.16
GetCurrentValidatorOutput represents current validator info
type GetTxFeeReply ¶
type GetTxFeeReply struct {
TxFee json.Uint64 `json:"txFee"`
CreateAssetTxFee json.Uint64 `json:"createAssetTxFee"`
}
GetTxFeeReply is the response from a GetTxFee call
type GetTxStatusReply ¶
GetTxStatusReply defines the GetTxStatus replies returned from the API
type ImportArgs ¶ added in v1.1.11
type ImportArgs struct {
// User that controls To
apitypes.UserPass
// Chain the funds are coming from
SourceChain string `json:"sourceChain"`
// Address receiving the imported LUX
To string `json:"to"`
}
ImportArgs are arguments for passing into Import requests
type ImportKeyArgs ¶ added in v1.1.11
type ImportKeyArgs struct {
apitypes.UserPass
PrivateKey *secp256k1.PrivateKey `json:"privateKey"`
}
ImportKeyArgs are arguments for ImportKey
type ImportKeyReply ¶ added in v1.1.11
type ImportKeyReply struct {
// The address controlled by the PrivateKey provided in the arguments
Address string `json:"address"`
}
ImportKeyReply is the response for ImportKey
type JSONChangeAddr ¶ added in v1.24.12
type JSONChangeAddr struct {
ChangeAddr string `json:"changeAddr"`
}
JSONChangeAddr contains the change address
type JSONFromAddrs ¶ added in v1.24.12
type JSONFromAddrs struct {
From []string `json:"from"`
}
JSONFromAddrs contains the addresses to spend from
type JSONSpendHeader ¶ added in v1.24.12
type JSONSpendHeader struct {
apitypes.UserPass
JSONFromAddrs
JSONChangeAddr
}
JSONSpendHeader includes common fields for spend transactions
type JSONTxIDChangeAddr ¶ added in v1.24.12
type JSONTxIDChangeAddr struct {
apitypes.JSONTxID
JSONChangeAddr
}
JSONTxIDChangeAddr contains a transaction ID and a change address
type MintArgs ¶ added in v1.1.11
type MintArgs struct {
JSONSpendHeader // User, password, from addrs, change addr
Amount avajson.Uint64 `json:"amount"`
AssetID string `json:"assetID"`
To string `json:"to"`
}
MintArgs are arguments for passing into Mint requests
type MintNFTArgs ¶ added in v1.1.11
type MintNFTArgs struct {
JSONSpendHeader // User, password, from addrs, change addr
AssetID string `json:"assetID"`
Payload string `json:"payload"`
To string `json:"to"`
Encoding formatting.Encoding `json:"encoding"`
}
MintNFTArgs are arguments for passing into MintNFT requests
type Owners ¶
type Owners struct {
Threshold avajson.Uint32 `json:"threshold"`
Minters []string `json:"minters"`
}
Owners describes who can perform an action
type SendArgs ¶ added in v1.1.11
type SendArgs struct {
// User, password, from addrs, change addr
JSONSpendHeader
// The amount, assetID, and destination to send funds to
SendOutput
// Memo field
Memo string `json:"memo"`
}
SendArgs are arguments for passing into Send requests
type SendMultipleArgs ¶ added in v1.1.11
type SendMultipleArgs struct {
// User, password, from addrs, change addr
JSONSpendHeader
// The outputs of the transaction
Outputs []SendOutput `json:"outputs"`
// Memo field
Memo string `json:"memo"`
}
SendMultipleArgs are arguments for passing into SendMultiple requests
type SendNFTArgs ¶ added in v1.1.11
type SendNFTArgs struct {
JSONSpendHeader // User, password, from addrs, change addr
AssetID string `json:"assetID"`
GroupID avajson.Uint32 `json:"groupID"`
To string `json:"to"`
}
SendNFTArgs are arguments for passing into SendNFT requests
type SendOutput ¶ added in v1.1.11
type SendOutput struct {
// The amount of funds to send
Amount avajson.Uint64 `json:"amount"`
// ID of the asset being sent
AssetID string `json:"assetID"`
// Address of the recipient
To string `json:"to"`
}
SendOutput specifies that [Amount] of asset [AssetID] be sent to [To]
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service defines the base service for the asset vm
func (*Service) CreateAddress ¶ added in v1.1.11
func (s *Service) CreateAddress(_ *http.Request, args *apitypes.UserPass, reply *apitypes.JSONAddress) error
CreateAddress creates an address for the user [args.Username]
func (*Service) CreateAsset ¶ added in v1.1.11
func (s *Service) CreateAsset(_ *http.Request, args *CreateAssetArgs, reply *AssetIDChangeAddr) error
CreateAsset returns ID of the newly created asset
func (*Service) CreateFixedCapAsset ¶ added in v1.1.11
func (s *Service) CreateFixedCapAsset(r *http.Request, args *CreateAssetArgs, reply *AssetIDChangeAddr) error
CreateFixedCapAsset returns ID of the newly created asset
func (*Service) CreateNFTAsset ¶ added in v1.1.11
func (s *Service) CreateNFTAsset(_ *http.Request, args *CreateNFTAssetArgs, reply *AssetIDChangeAddr) error
CreateNFTAsset returns ID of the newly created asset
func (*Service) CreateVariableCapAsset ¶ added in v1.1.11
func (s *Service) CreateVariableCapAsset(r *http.Request, args *CreateAssetArgs, reply *AssetIDChangeAddr) error
CreateVariableCapAsset returns ID of the newly created asset
func (*Service) Export ¶ added in v1.1.11
func (s *Service) Export(_ *http.Request, args *ExportArgs, reply *JSONTxIDChangeAddr) error
Export sends an asset from this chain to the P/C-Chain. After this tx is accepted, the LUX must be imported to the P/C-chain with an importTx. Returns the ID of the newly created atomic transaction
func (*Service) ExportKey ¶ added in v1.1.11
func (s *Service) ExportKey(_ *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error
ExportKey returns a private key from the provided user
func (*Service) GetAddressTxs ¶ added in v1.1.11
func (s *Service) GetAddressTxs(_ *http.Request, args *GetAddressTxsArgs, reply *GetAddressTxsReply) error
GetAddressTxs returns list of transactions for a given address
func (*Service) GetAllBalances ¶
func (s *Service) GetAllBalances(_ *http.Request, args *GetAllBalancesArgs, reply *GetAllBalancesReply) error
GetAllBalances returns a map where:
Key: ID of an asset such that [args.Address] has a non-zero balance of the asset Value: The balance of the asset held by the address
If ![args.IncludePartial], returns only unlocked balance/UTXOs with a 1-out-of-1 multisig. Otherwise, returned balance/UTXOs includes assets held only partially by the address, and includes balances with locktime in the future.
func (*Service) GetAssetDescription ¶
func (s *Service) GetAssetDescription(_ *http.Request, args *GetAssetDescriptionArgs, reply *GetAssetDescriptionReply) error
GetAssetDescription creates an empty account with the name passed in
func (*Service) GetBalance ¶
func (s *Service) GetBalance(_ *http.Request, args *GetBalanceArgs, reply *GetBalanceReply) error
GetBalance returns the balance of an asset held by an address. If ![args.IncludePartial], returns only the balance held solely (1 out of 1 multisig) by the address and with a locktime in the past. Otherwise, returned balance includes assets held only partially by the address, and includes balances with locktime in the future.
func (*Service) GetBlock ¶
func (s *Service) GetBlock(_ *http.Request, args *apitypes.GetBlockArgs, reply *apitypes.GetBlockResponse) error
GetBlock returns the requested block.
func (*Service) GetBlockByHeight ¶
func (s *Service) GetBlockByHeight(_ *http.Request, args *apitypes.GetBlockByHeightArgs, reply *apitypes.GetBlockResponse) error
GetBlockByHeight returns the block at the given height.
func (*Service) GetTx ¶
func (s *Service) GetTx(_ *http.Request, args *apitypes.GetTxArgs, reply *apitypes.GetTxReply) error
GetTx returns the specified transaction
func (*Service) GetTxStatus
deprecated
func (*Service) GetUTXOs ¶
func (s *Service) GetUTXOs(_ *http.Request, args *apitypes.GetUTXOsArgs, reply *apitypes.GetUTXOsReply) error
GetUTXOs gets all utxos for passed in addresses
func (*Service) Import ¶ added in v1.1.11
Import imports an asset to this chain from the P/C-Chain. The LUX must have already been exported from the P/C-Chain. Returns the ID of the newly created atomic transaction
func (*Service) ImportKey ¶ added in v1.1.11
func (s *Service) ImportKey(_ *http.Request, args *ImportKeyArgs, reply *apitypes.JSONAddress) error
ImportKey adds a private key to the provided user
func (*Service) IssueTx ¶
func (s *Service) IssueTx(_ *http.Request, args *apitypes.FormattedTx, reply *apitypes.JSONTxID) error
IssueTx attempts to issue a transaction into consensus
func (*Service) ListAddresses ¶ added in v1.1.11
func (s *Service) ListAddresses(_ *http.Request, args *apitypes.UserPass, response *apitypes.JSONAddresses) error
ListAddresses returns all of the addresses controlled by user [args.Username]
func (*Service) MintNFT ¶ added in v1.1.11
func (s *Service) MintNFT(_ *http.Request, args *MintNFTArgs, reply *JSONTxIDChangeAddr) error
MintNFT issues a MintNFT transaction and returns the ID of the newly created transaction
func (*Service) SendMultiple ¶ added in v1.1.11
func (s *Service) SendMultiple(_ *http.Request, args *SendMultipleArgs, reply *JSONTxIDChangeAddr) error
SendMultiple sends a transaction with multiple outputs.
func (*Service) SendNFT ¶ added in v1.1.11
func (s *Service) SendNFT(_ *http.Request, args *SendNFTArgs, reply *JSONTxIDChangeAddr) error
SendNFT sends an NFT
type SharedMemory ¶ added in v1.16.16
type SharedMemory interface {
}
SharedMemory provides cross-chain shared memory
type StaticClient ¶ added in v1.1.11
type StaticClient interface {
BuildGenesis(ctx context.Context, args *BuildGenesisArgs, options ...rpc.Option) (*BuildGenesisReply, error)
}
StaticClient for interacting with the XVM static api
func NewStaticClient ¶ added in v1.1.11
func NewStaticClient(uri string) StaticClient
NewClient returns an XVM client for interacting with the xvm static api
type StaticService ¶ added in v1.1.11
type StaticService struct{}
StaticService defines the base service for the asset vm
func CreateStaticService ¶ added in v1.1.11
func CreateStaticService() *StaticService
func (*StaticService) BuildGenesis ¶ added in v1.1.11
func (*StaticService) BuildGenesis(_ *http.Request, args *BuildGenesisArgs, reply *BuildGenesisReply) error
BuildGenesis returns the UTXOs such that at least one address in [args.Addresses] is referenced in the UTXO.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) Height ¶ added in v1.16.16
Height returns the height of this transaction (not used in XVM)
type VM ¶
type VM struct {
network.Atomic
config.Config
lux.AddressManager
ids.Aliaser
utxo.Spender
// Lock for thread safety (exposed for tests)
Lock sync.RWMutex
// Chain information
ChainID ids.ID
XChainID ids.ID
SharedMemory SharedMemory
// These values are only initialized after the chain has been linearized.
blockbuilder.Builder
// contains filtered or unexported fields
}
func (*VM) BuildVertex ¶
BuildVertex builds a new vertex - required for LinearizableVMWithEngine
func (*VM) CodecRegistry ¶ added in v1.24.12
CodecRegistry returns the codec registry for marshalling/unmarshalling
func (*VM) CreateHandlers ¶
func (*VM) CreateStaticHandlers ¶ added in v1.16.16
func (*VM) GetBlockIDAtHeight ¶
func (*VM) GetEngine ¶
GetEngine returns the consensus engine - required for LinearizableVMWithEngine
func (*VM) GetTx ¶ added in v1.16.16
GetTx returns a transaction by ID - required for LinearizableVMWithEngine
func (*VM) GetUTXOs ¶ added in v1.30.27
GetUTXOs returns every UTXO this chain's state holds that is owned by at least one address in [addrs]. This is the in-process (no-HTTP) counterpart to Service.GetUTXOs: the chain manager's NFT-authorization gate calls it to decide whether a validator's staking X-address holds a chain-activation NFT.
GetAllUTXOs is a multi-step UTXOIDs-then-GetUTXO walk over vm.state, so it acquires vm.Lock for read to take a consistent snapshot — mirroring Service.GetUTXOs, which locks for its own GetUTXOs walk. The lock is taken HERE (not left to callers) so the snapshot guarantee is part of the method's contract and no caller can violate it; a read lock is sufficient and lets concurrent readers proceed. Safe against deadlock: the sole in-process caller is the chain manager's NFT gate (chains/manager_authz.go), which holds only its own chainsLock when resolving this reader and never vm.Lock. Returns an empty slice (never nil error) when [addrs] is empty.
func (*VM) GetVertex ¶ added in v1.11.14
GetVertex gets a vertex by ID - required for LinearizableVMWithEngine
func (*VM) LoadUser ¶ added in v1.1.11
func (vm *VM) LoadUser( username string, password string, addresses set.Set[ids.ShortID], ) ([]*lux.UTXO, *secp256k1fx.Keychain, error)
LoadUser retrieves user keys from external storage
func (*VM) NewHTTPHandler ¶
NewHTTPHandler implements the engine.VM interface
func (*VM) ParseAddress ¶ added in v1.24.12
ParseAddress resolves chain aliases (like "X") via BCLookup before parsing. This overrides the embedded AddressManager which can't resolve aliases.
func (*VM) ParseBlock ¶
func (*VM) ParseVertex ¶
ParseVertex parses vertex bytes - required for LinearizableVMWithEngine
type WalletClient
deprecated
type WalletClient struct {
Requester rpc.EndpointRequester
}
WalletClient for interacting with exchangevm managed wallet.
Deprecated: Transactions should be issued using the `luxfi/node/wallet/chain/x.Wallet` utility.
func NewWalletClient
deprecated
func NewWalletClient(uri, chain string) *WalletClient
NewWalletClient returns an Exchange VM wallet client for interacting with exchangevm managed wallet
Deprecated: Transactions should be issued using the `luxfi/node/wallet/chain/x.Wallet` utility.
type WalletService ¶
type WalletService struct {
// contains filtered or unexported fields
}
func (*WalletService) IssueTx ¶
func (w *WalletService) IssueTx(_ *http.Request, args *apitypes.FormattedTx, reply *apitypes.JSONTxID) error
IssueTx attempts to issue a transaction into consensus
func (*WalletService) Send ¶ added in v1.1.11
func (w *WalletService) Send(r *http.Request, args *SendArgs, reply *JSONTxIDChangeAddr) error
Send returns the ID of the newly created transaction
func (*WalletService) SendMultiple ¶ added in v1.1.11
func (w *WalletService) SendMultiple(_ *http.Request, args *SendMultipleArgs, reply *JSONTxIDChangeAddr) error
SendMultiple sends a transaction with multiple outputs.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
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 genesis builds X-Chain (XVM) genesis bytes from a small, caller-supplied descriptor.
|
Package genesis builds X-Chain (XVM) genesis bytes from a small, caller-supplied descriptor. |
|
metricsmock
Package metricsmock is a generated GoMock package.
|
Package metricsmock is a generated GoMock package. |
|
Package state is a generated GoMock package.
|
Package state is a generated GoMock package. |
|
statemock
Package statemock is a generated GoMock package.
|
Package statemock is a generated GoMock package. |
|
xvmroot
Package xvmroot computes the xvm execution_root in native Go, byte-identical to the lux-private GPU xvm_root_update kernel (ops/xvm/cuda/xvm_roots.cu) and every backend's CPU oracle.
|
Package xvmroot computes the xvm execution_root in native Go, byte-identical to the lux-private GPU xvm_root_update kernel (ops/xvm/cuda/xvm_roots.cu) and every backend's CPU oracle. |
|
Package txs is the X-chain (xvm) transaction package for the luxfi/node binary.
|
Package txs is the X-chain (xvm) transaction package for the luxfi/node binary. |
|
mempool
Package mempool is a generated GoMock package.
|
Package mempool is a generated GoMock package. |
|
mempool/mempoolmock
Package mempoolmock is a generated GoMock package.
|
Package mempoolmock is a generated GoMock package. |
|
txsmock
Package txsmock is a generated GoMock package.
|
Package txsmock is a generated GoMock package. |