testnet
GitHub

Configuration Setters

SetBech32Prefixes(config *sdk.Config) SetBip44CoinType(config *sdk.Config)

A collection of functions used to configure the global Cosmos SDK settings for the Maroo network. These functions must be called at application startup to ensure that addresses are serialized correctly and that HD wallets can derive the proper keys. They set network-specific parameters like Bech32 address prefixes and the BIP-44 coin type.

Parameters

Name Type Required Description
config *sdk.Config A pointer to the global SDK configuration object to be modified.

Returns

Type: void

These functions modify the provided config object in place and do not return any value.

Examples

Initializing SDK Config in `main.go`

This example demonstrates the standard usage of the configuration setters. They are typically called in an `init()` function in the application's main package to ensure they are executed before any other logic.

package main

import (
	"github.com/delight-labs/maroo/config"
	sdk "github.com/cosmos/cosmos-sdk/types"
)

func init() {
	// Get the global SDK config
	cfg := sdk.GetConfig()

	// Set Maroo-specific Bech32 prefixes for accounts, validators, etc.
	config.SetBech32Prefixes(cfg)

	// Set the BIP-44 coin type for HD wallet compatibility (e.g., MetaMask)
	config.SetBip44CoinType(cfg)

	// Seal the config to prevent further modifications
	cfg.Seal()
}
ESC
Type to search