bank

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 10 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) (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

func NewCoreModule added in v0.1.2

func NewCoreModule() core.CoreModule

func QueryBank

func QueryBank(i core.QueryClient) (string, error)

Query client for bank module.

Types

type BankExternal added in v0.1.2

type BankExternal struct {
	Xplac provider.XplaClient
}

func NewBankExternal added in v0.1.2

func NewBankExternal(xplac provider.XplaClient) (e BankExternal)

func (BankExternal) BankBalances added in v0.1.2

func (e BankExternal) BankBalances(bankBalancesMsg types.BankBalancesMsg) provider.XplaClient

Query for account balances by address

func (BankExternal) BankSend added in v0.1.2

func (e BankExternal) BankSend(bankSendMsg types.BankSendMsg) provider.XplaClient

Send funds from one account to another.

func (BankExternal) DenomMetadata added in v0.1.2

func (e BankExternal) DenomMetadata(denomMetadataMsg ...types.DenomMetadataMsg) provider.XplaClient

Query the client metadata for coin denominations.

func (BankExternal) Total added in v0.1.2

func (e BankExternal) Total(totalMsg ...types.TotalMsg) provider.XplaClient

Query the total supply of coins of the chain.

Jump to

Keyboard shortcuts

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