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>
45 lines
1.1 KiB
Go
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
|
|
}
|