mirror of
https://github.com/luxfi/node.git
synced 2026-07-27 03:39:39 +00:00
Drop the Avalanche-heritage /ext prefix; /v1 is the single canonical route surface (one way, no backward compat). The node's baseURL is the source of truth; clients, SDKs, CLI, indexer, maker, genesis, netrunner, and the k8s/compose/gateway/explorer configs are updated to match. Co-authored-by: Hanzo Dev <dev@hanzo.ai>
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package xvm
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/luxfi/rpc"
|
|
)
|
|
|
|
var _ StaticClient = (*staticClient)(nil)
|
|
|
|
// StaticClient for interacting with the XVM static api
|
|
type StaticClient interface {
|
|
BuildGenesis(ctx context.Context, args *BuildGenesisArgs, options ...rpc.Option) (*BuildGenesisReply, error)
|
|
}
|
|
|
|
// staticClient is an implementation of an XVM client for interacting with the
|
|
// xvm static api
|
|
type staticClient struct {
|
|
requester rpc.EndpointRequester
|
|
}
|
|
|
|
// NewClient returns an XVM client for interacting with the xvm static api
|
|
func NewStaticClient(uri string) StaticClient {
|
|
return &staticClient{requester: rpc.NewEndpointRequester(
|
|
uri + "/v1/vm/xvm",
|
|
)}
|
|
}
|
|
|
|
func (c *staticClient) BuildGenesis(ctx context.Context, args *BuildGenesisArgs, options ...rpc.Option) (resp *BuildGenesisReply, err error) {
|
|
resp = &BuildGenesisReply{}
|
|
err = c.requester.SendRequest(ctx, "xvm.buildGenesis", args, resp, options...)
|
|
return resp, err
|
|
}
|