Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeEvent(event *types.Event) ([]client.DecodedEvent, error)
- func NewTransferTx(fee *types.Fee, body *Transfer) *types.Transaction
- type AccountBalances
- type Addresses
- type AddressesQuery
- type BalancesQuery
- type BurnEvent
- type DenominationInfo
- type DenominationInfoQuery
- type Event
- type GasCosts
- type MintEvent
- type NonceQuery
- type Parameters
- type Transfer
- type TransferEvent
- type V1
Constants ¶
const ( // TransferEventCode is the event code for the transfer event. TransferEventCode = 1 // BurnEventCode is the event code for the burn event. BurnEventCode = 2 // MintEventCode is the event code for the mint event. MintEventCode = 3 )
const ModuleName = "accounts"
ModuleName is the accounts module name.
Variables ¶
var ( // CommonPoolAddress is the address of the internal common pool account in the accounts module. CommonPoolAddress = types.NewAddressForModule(ModuleName, []byte("common-pool")) // FeeAccumulatorAddress is the address of the internal fee accumulator account in the accounts module. FeeAccumulatorAddress = types.NewAddressForModule(ModuleName, []byte("fee-accumulator")) )
Functions ¶
func DecodeEvent ¶ added in v0.2.0
func DecodeEvent(event *types.Event) ([]client.DecodedEvent, error)
DecodeEvent decodes an accounts event.
func NewTransferTx ¶
func NewTransferTx(fee *types.Fee, body *Transfer) *types.Transaction
NewTransferTx generates a new accounts.Transfer transaction.
Types ¶
type AccountBalances ¶
type AccountBalances struct {
Balances map[types.Denomination]types.Quantity `json:"balances"`
}
AccountBalances are the balances in an account.
type AddressesQuery ¶ added in v0.2.0
type AddressesQuery struct {
Denomination types.Denomination `json:"denomination"`
}
AddressesQuery are the arguments for the accounts.Addresses query.
type BalancesQuery ¶
BalancesQuery are the arguments for the accounts.Balances query.
type DenominationInfo ¶ added in v0.2.0
type DenominationInfo struct { // Decimals is the number of decimals that the denomination is using. Decimals uint8 `json:"decimals"` }
DenominationInfo represents information about a denomination.
type DenominationInfoQuery ¶ added in v0.2.0
type DenominationInfoQuery struct {
Denomination types.Denomination `json:"denomination"`
}
DenominationInfoQuery are the arguments for the accounts.DenominationInfo query.
type Event ¶ added in v0.2.0
type Event struct { Transfer *TransferEvent Burn *BurnEvent Mint *MintEvent }
Event is an account event.
type GasCosts ¶ added in v0.2.0
type GasCosts struct {
TxTransfer uint64 `json:"tx_transfer"`
}
GasCosts are the accounts module gas costs.
type NonceQuery ¶
NonceQuery are the arguments for the accounts.Nonce query.
type Parameters ¶ added in v0.2.0
type Parameters struct { TransfersDisabled bool `json:"transfers_disabled"` GasCosts GasCosts `json:"gas_costs"` DebugDisableNonceCheck bool `json:"debug_disable_nonce_check,omitempty"` DenominationInfos map[types.Denomination]DenominationInfo `json:"denomination_infos,omitempty"` }
Parameters are the parameters for the accounts module.
type Transfer ¶
Transfer is the body for the accounts.Transfer call.
func (*Transfer) PrettyPrint ¶ added in v0.4.0
PrettyPrint writes a pretty-printed representation of the transaction to the given writer.
func (*Transfer) PrettyType ¶ added in v0.4.0
PrettyType returns a representation of the type that can be used for pretty printing.
type TransferEvent ¶ added in v0.2.0
type TransferEvent struct { From types.Address `json:"from"` To types.Address `json:"to"` Amount types.BaseUnits `json:"amount"` }
TransferEvent is the transfer event.
type V1 ¶
type V1 interface { client.EventDecoder // Transfer generates an accounts.Transfer transaction. Transfer(to types.Address, amount types.BaseUnits) *client.TransactionBuilder // Parameters queries the accounts module parameters. Parameters(ctx context.Context, round uint64) (*Parameters, error) // Nonce queries the given account's nonce. Nonce(ctx context.Context, round uint64, address types.Address) (uint64, error) // Balances queries the given account's balances. Balances(ctx context.Context, round uint64, address types.Address) (*AccountBalances, error) // Addresses queries all account addresses. Addresses(ctx context.Context, round uint64, denomination types.Denomination) (Addresses, error) // DenominationInfo queries the information about a given denomination. DenominationInfo(ctx context.Context, round uint64, denomination types.Denomination) (*DenominationInfo, error) // GetEvents returns all account events emitted in a given block. GetEvents(ctx context.Context, round uint64) ([]*Event, error) }
V1 is the v1 accounts module interface.
func NewV1 ¶
func NewV1(rc client.RuntimeClient) V1
NewV1 generates a V1 client helper for the accounts module.