bank

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 7 Imported by: 0

README

Bank module

Usage

(Tx) Bank coin send
// from address, to address, coin amount(axpla)
bankSendMsg := types.BankSendMsg {
    FromAddress: "xpla19w2r47nczglwlpfynqe5769cwkwq5fvmzu5pu7", 
    ToAddress: "xpla13trl452wgle9qxpxhse9605k9x0399cmkfzn7g", 
    Amount: "10",
}
txbytes, err := xplac.BankSend(bankSendMsg).CreateAndSignTx()
res, err := xplac.Broadcast(txbytes)
(Query) Bank all balances & denom balance
// All balances
bankBalancesMsg := types.BankBalancesMsg {
    Address: "xpla19w2r47nczglwlpfynqe5769cwkwq5fvmzu5pu7",		
}
response, err := xplac.BankBalances(bankBalancesMsg).Query()	

// denom balances
bankBalancesMsg := types.BankBalancesMsg {
    Address: "xpla19w2r47nczglwlpfynqe5769cwkwq5fvmzu5pu7",		
    Denom: "axpla"
}
response, err := xplac.BankBalances(bankBalancesMsg).Query()	
(Query) Bank denom metadata
// All metadata
denomMetadataMsg := types.DenomMetadataMsg{}
response, err := xplac.DenomMetadata(denomMetadataMsg).Query()

// client metadata for denom
denomMetadataMsg := types.DenomMetadataMsg{
    Denom: "axpla",
}
response, err := xplac.DenomMetadata(denomMetadataMsg).Query()
(Query) Bank total supply
// Total supply
response, err := xplac.Total().Query()

// Total supply of denom
totalMsg := types.TotalMsg {
    Denom: "axpla",
}
response, err := xplac.Total(totalMsg).Query()

Documentation

Index

Constants

View Source
const (
	BankModule                = "bank"
	BankSendMsgType           = "bank-send"
	BankAllBalancesMsgType    = "bank-all-balances"
	BankBalanceMsgType        = "bank-balance"
	BankDenomsMetadataMsgType = "denoms-metadata"
	BankDenomMetadataMsgType  = "denom-metadata"
	BankTotalMsgType          = "bank-total"
	BankTotalSupplyOfMsgType  = "bank-total-denom"
)

Variables

This section is empty.

Functions

func MakeBankAllBalancesMsg

func MakeBankAllBalancesMsg(bankBalancesMsg types.BankBalancesMsg) (banktypes.QueryAllBalancesRequest, error)

(Query) make msg - all balances

func MakeBankBalanceMsg

func MakeBankBalanceMsg(bankBalancesMsg types.BankBalancesMsg) (banktypes.QueryBalanceRequest, error)

(Query) make msg - balance

func MakeBankSendMsg

func MakeBankSendMsg(bankSendMsg types.BankSendMsg, privKey key.PrivateKey) (banktypes.MsgSend, error)

(Tx) make msg - bank send

func MakeDenomMetaDataMsg

func MakeDenomMetaDataMsg(denomMetadataMsg types.DenomMetadataMsg) (banktypes.QueryDenomMetadataRequest, error)

(Query) make msg - denomination metadata

func MakeDenomsMetaDataMsg

func MakeDenomsMetaDataMsg() (banktypes.QueryDenomsMetadataRequest, error)

(Query) make msg - denominations metadata

func MakeSupplyOfMsg

func MakeSupplyOfMsg(totalMsg types.TotalMsg) (banktypes.QuerySupplyOfRequest, error)

(Query) make msg - supply of

func MakeTotalSupplyMsg

func MakeTotalSupplyMsg() (banktypes.QueryTotalSupplyRequest, error)

(Query) make msg - total supply

Types

This section is empty.

Jump to

Keyboard shortcuts

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