Documentation
¶
Overview ¶
Package client builds the Cosmos SDK client.Context from the akt context system.
It bridges our context (network, keyring, defaults) to the SDK's client.Context that all tx/query commands expect. This allows chain-sdk CLI commands to work unmodified with our context-based configuration.
Index ¶
- func BuildClientContext(rc *aktctx.Context, kr sdkkeyring.Keyring, enc sdkutil.EncodingConfig, ...) sdkclient.Context
- func InitClientContext(cmd *cobra.Command, rc *aktctx.Context, kr sdkkeyring.Keyring, ...) error
- func MustResolveAndInit(cmd *cobra.Command, mgr *aktctx.Manager, krMgr *aktkeyring.Manager, ...) (bool, error)
- func ResolveAccountAddress(cctx sdkclient.Context) (sdk.AccAddress, error)
- type LocalIdentityMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClientContext ¶
func BuildClientContext( rc *aktctx.Context, kr sdkkeyring.Keyring, enc sdkutil.EncodingConfig, fromOverride string, ) sdkclient.Context
BuildClientContext constructs a fully populated Cosmos SDK client.Context from the akt context. This bridges our context system to the SDK.
func InitClientContext ¶
func InitClientContext( cmd *cobra.Command, rc *aktctx.Context, kr sdkkeyring.Keyring, enc sdkutil.EncodingConfig, fromOverride string, ) error
InitClientContext initializes the Cosmos SDK client context on a cobra command. This must be called in the root PersistentPreRunE before any chain-sdk CLI commands execute. It stores the client.Context in the cobra context the same way the SDK's SetCmdClientContextHandler does.
func MustResolveAndInit ¶
func MustResolveAndInit( cmd *cobra.Command, mgr *aktctx.Manager, krMgr *aktkeyring.Manager, enc sdkutil.EncodingConfig, contextOverride string, fromOverride string, identityMode LocalIdentityMode, ) (bool, error)
MustResolveAndInit is a convenience that resolves the context, gets the keyring, and initializes the SDK client context on the command. Used in the root PersistentPreRunE. Returns true if a context was resolved.
identityMode is the caller's explicit decision about when this invocation may open the local signing identity (SPEC §1.7). The client layer does not infer that policy from command names.
func ResolveAccountAddress ¶ added in v0.0.4
func ResolveAccountAddress(cctx sdkclient.Context) (sdk.AccAddress, error)
ResolveAccountAddress resolves the account carried by cctx. Address-valued accounts are parsed without consulting the keyring; named accounts trigger the first key operation on an on-demand keyring.
Types ¶
type LocalIdentityMode ¶ added in v0.0.4
type LocalIdentityMode uint8
LocalIdentityMode controls when command startup may open the selected context's keyring (SPEC §1.7).
const ( LocalIdentityNone LocalIdentityMode = iota LocalIdentityOnDemand LocalIdentityRequired )