Documentation
¶
Index ¶
- Constants
- func AddRpcArgs(cmd *cobra.Command)
- func AddStakingArgs(cmd *cobra.Command)
- func ConfigureLogger(args *RpcArgs)
- func CreateContext(xcFactory *factory.Factory, chain *xc.ChainConfig) context.Context
- func LoadChain(xcFactory *factory.Factory, chain string) (*xc.ChainConfig, error)
- func LoadFactory(rcpArgs *RpcArgs) (*factory.Factory, error)
- func OverrideChainSettings(chain *xc.ChainConfig, args *RpcArgs)
- func OverwriteCrosschainSettings(overrides map[string]*ChainOverride, xcFactory *factory.Factory)
- func UnwrapChain(ctx context.Context) *xc.ChainConfig
- func UnwrapStakingConfig(ctx context.Context) *services.ServicesConfig
- func UnwrapXc(ctx context.Context) *factory.Factory
- func WrapChain(ctx context.Context, chain *xc.ChainConfig) context.Context
- func WrapStakingArgs(ctx context.Context, args *StakingArgs) context.Context
- func WrapStakingConfig(ctx context.Context, args *services.ServicesConfig) context.Context
- func WrapXc(ctx context.Context, xcFactory *factory.Factory) context.Context
- type ChainOverride
- type RpcArgs
- type RpcContextKey
- type StakingArgs
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 AddStakingArgs ¶
func ConfigureLogger ¶
func ConfigureLogger(args *RpcArgs)
func CreateContext ¶
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 WrapStakingArgs ¶
func WrapStakingArgs(ctx context.Context, args *StakingArgs) context.Context
func WrapStakingConfig ¶
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 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
Click to show internal directories.
Click to hide internal directories.