Files
node/vms/platformvm/api/static_client.go
T
zeekayandHanzo Dev 51a304804c chore: migrate luxd HTTP routes /ext -> /v1
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>
2026-07-01 11:40:13 -07:00

45 lines
1.1 KiB
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package api
import (
"context"
"github.com/luxfi/rpc"
)
var _ StaticClient = (*staticClient)(nil)
// StaticClient for interacting with the platformvm static api
type StaticClient interface {
BuildGenesis(
ctx context.Context,
args *BuildGenesisArgs,
options ...rpc.Option,
) (*BuildGenesisReply, error)
}
// staticClient is an implementation of a platformvm client for interacting with
// the platformvm static api
type staticClient struct {
requester rpc.EndpointRequester
}
// NewClient returns a platformvm client for interacting with the platformvm static api
func NewStaticClient(uri string) StaticClient {
return &staticClient{requester: rpc.NewEndpointRequester(
uri + "/v1/vm/platform",
)}
}
func (c *staticClient) BuildGenesis(
ctx context.Context,
args *BuildGenesisArgs,
options ...rpc.Option,
) (resp *BuildGenesisReply, err error) {
resp = &BuildGenesisReply{}
err = c.requester.SendRequest(ctx, "platform.buildGenesis", args, resp, options...)
return resp, err
}