setup

package
v0.0.0-...-f0911fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2026 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultApiRef = "env:API_KEY"
View Source
const DefaultTreasuryApiRef = "env:TREASURY_API_KEY"

Variables

This section is empty.

Functions

func AddRpcArgs

func AddRpcArgs(cmd *cobra.Command)

func AddStakingArgs

func AddStakingArgs(cmd *cobra.Command)

func ConfigureLogger

func ConfigureLogger(args *RpcArgs)

func CreateContext

func CreateContext(xcFactory *factory.Factory, chain *xc.ChainConfig) context.Context

func LoadChain

func LoadChain(xcFactory *factory.Factory, chain string) (*xc.ChainConfig, error)

func LoadFactory

func LoadFactory(rcpArgs *RpcArgs) (*factory.Factory, error)

func OverrideChainSettings

func OverrideChainSettings(chain *xc.ChainConfig, args *RpcArgs)

func OverwriteCrosschainSettings

func OverwriteCrosschainSettings(overrides map[string]*ChainOverride, xcFactory *factory.Factory)

func UnwrapChain

func UnwrapChain(ctx context.Context) *xc.ChainConfig

func UnwrapStakingConfig

func UnwrapStakingConfig(ctx context.Context) *services.ServicesConfig

func UnwrapXc

func UnwrapXc(ctx context.Context) *factory.Factory

func WrapChain

func WrapChain(ctx context.Context, chain *xc.ChainConfig) context.Context

func WrapStakingArgs

func WrapStakingArgs(ctx context.Context, args *StakingArgs) context.Context

func WrapStakingConfig

func WrapStakingConfig(ctx context.Context, args *services.ServicesConfig) context.Context

func WrapXc

func WrapXc(ctx context.Context, xcFactory *factory.Factory) context.Context

Types

type ChainOverride

type ChainOverride struct {
	// The RPC URL for the chain
	Rpc string `json:"rpc,omitempty" toml:"rpc,omitempty"`
	// A secret reference that may be used with RPC access
	ApiKey config.Secret `json:"api_key,omitempty" toml:"api_key,omitempty"`
	// The network to use (e.g. mainnet/testnet/regtest on bitcoin chains)
	Network string `json:"network,omitempty" toml:"network,omitempty"`

	Applied bool `json:"-" toml:"-"`
}

type RpcArgs

type RpcArgs struct {
	// Config         *tconfig.Connector
	Rpc            string
	Chain          string
	Algorithm      string
	VerbosityCount int
	NotMainnet     bool
	Provider       string
	Network        string
	IndexerType    string
	ApiKey         config.Secret
	// ConfigPath     string
	UseLocalImplementation bool

	Overrides map[string]*ChainOverride
}

func RpcArgsFromCmd

func RpcArgsFromCmd(cmd *cobra.Command) (*RpcArgs, error)

type RpcContextKey

type RpcContextKey string
const ContextChain RpcContextKey = "chain"
const ContextStakingArgs RpcContextKey = "staking-args"
const ContextStakingConfig RpcContextKey = "staking-config"
const ContextXc RpcContextKey = "xc"

type StakingArgs

type StakingArgs struct {
	ConfigPath string
	AccountId  string
	Amount     *xc.AmountHumanReadable
	Validator  string
	Provider   xc.StakingProvider
}

func StakingArgsFromCmd

func StakingArgsFromCmd(cmd *cobra.Command) (*StakingArgs, error)

func UnwrapStakingArgs

func UnwrapStakingArgs(ctx context.Context) *StakingArgs

func (*StakingArgs) BuilderOptionsWith

func (args *StakingArgs) BuilderOptionsWith(publicKey []byte) []builder.BuilderOption

func (*StakingArgs) ToBalanceOptions

func (args *StakingArgs) ToBalanceOptions() []client.StakedBalanceOption

func (*StakingArgs) ToBuilderOptions

func (args *StakingArgs) ToBuilderOptions() []builder.BuilderOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL