Documentation ¶
Index ¶
- Constants
- Variables
- func CreateAccount(keyName string, mnemonic string, passphase string) int
- func DeleteAccount(keyName string, password string) int
- func ExecuteWasmContract(senderAddress, contractAddress, executeMsg, denom string, amount int) string
- func GenerateRecoveryPhrase() string
- func GetAccountCoins(address string) (sdk.Coins, error)
- func GetAccountInfo(address string) (account authtypes.AccountI, err error)
- func GetAddressFromKeyName(keyName string) string
- func GetListAccountInfo() (accouns []authtypes.AccountI, err error)
- func GetPrivKeyFromMnemonic(mnemoic string, keyName string) []byte
- func HasKeyByAddress(addr string) int
- func HasKeyByName(name string) int
- func ImportAccountFromMnemoic(mnemonic string, keyName string) int
- func ImportAccountFromPrivateKey(privateKey []byte, keyName string) int
- func InitClients() error
- func NewNibiruClient(chainId string, grpcEndpoint string, rpcEndpoint string) int
- func NewNibiruClientDefault() int
- func PrintBaseAccountInfo(addrs ...string)
- func PrintListSigners()
- func PrintPayload(funcName string, args ...interface{})
- func QueryTXHash(txHash string) string
- func QueryWasmContract(contractAddress, queryMsg string) string
- func SwitchNetwork(network string) int
- func TransferToken(fromAddress, toAddress, denom string, amount int) string
- type BaseAccount
- type Coin
- type Coins
- type KeyInfo
- type NetworkInfo
- type UserAccount
Constants ¶
View Source
const ( Success = 0 // Success indicates that the function completed its task without errors. Fail = 1 // Fail indicates that the function encountered an error and did not complete successfully. )
Constants to represent the success or failure of functions.
Variables ¶
View Source
var ( LocalNetworkInfo = NetworkInfo{ GrpcEndpoint: "localhost:9090", LcdEndpoint: "http://localhost:1317", TmRpcEndpoint: "http://localhost:26657", WebsocketEndpoint: "ws://localhost:26657/websocket", ChainID: "nibiru-localnet-0", } DevNetworkInfo = NetworkInfo{ GrpcEndpoint: "tcp://grpc.devnet-2.nibiru.fi:443", LcdEndpoint: "http://localhost:1317", TmRpcEndpoint: "https://rpc.devnet-2.nibiru.fi:443", WebsocketEndpoint: "wss://rpc.devnet-2.nibiru.fi/websocket", ChainID: "nibiru-devnet-2", } TestNetworkInfo = NetworkInfo{ GrpcEndpoint: "tcp://grpc.testnet-1.nibiru.fi:9090", LcdEndpoint: "https://lcd.testnet-1.nibiru.fi", TmRpcEndpoint: "https://rpc.testnet-1.nibiru.fi::443", WebsocketEndpoint: "wss://rpc.testnet-1.nibiru.fi/websocket", ChainID: "nibiru-testnet-1", } MainNetworkInfo = NetworkInfo{ GrpcEndpoint: "localhost:9090", LcdEndpoint: "http://localhost:1317", TmRpcEndpoint: "https://rpc.nibiru.fi:443", WebsocketEndpoint: "ws://localhost:26657/websocket", ChainID: "cataclysm-1", } )
Functions ¶
func DeleteAccount ¶
func ExecuteWasmContract ¶
func GenerateRecoveryPhrase ¶
func GenerateRecoveryPhrase() string
func GetAccountInfo ¶
func GetAddressFromKeyName ¶
func GetListAccountInfo ¶
func GetPrivKeyFromMnemonic ¶
func HasKeyByAddress ¶
func HasKeyByName ¶
func InitClients ¶
func InitClients() error
func NewNibiruClient ¶
func NewNibiruClientDefault ¶
func NewNibiruClientDefault() int
func PrintBaseAccountInfo ¶
func PrintBaseAccountInfo(addrs ...string)
func PrintListSigners ¶
func PrintListSigners()
func PrintPayload ¶
func PrintPayload(funcName string, args ...interface{})
func QueryTXHash ¶
func QueryWasmContract ¶
func SwitchNetwork ¶
SwitchNetwork changes the network configuration based on the provided network name. It returns Success (0) if the switch is successful, otherwise Fail (1).
func TransferToken ¶
Types ¶
type BaseAccount ¶
type BaseAccount struct { Address []byte Coins *Coins PubKey []byte AccountNumber uint64 Sequence uint64 }
Define the BaseAccount struct in Go
func QueryAccount ¶
func QueryAccount(address string) (*BaseAccount, error)
type KeyInfo ¶
Define the KeyInfo struct in Go
func GetAccountByAddress ¶
func GetAccountByKeyName ¶
type NetworkInfo ¶
type UserAccount ¶
Define the UserAccount struct in Go
Click to show internal directories.
Click to hide internal directories.