Terra Documentation
  • Docs
  • Whitepaper
  • Agora
  • GitHub

›MODULE SPECS

Overview

  • Introduction
  • Columbus-3 Mainnet

Terra Protocol

  • How Terra Works
  • Developer Guide
  • MODULE SPECS

    • Auth
    • Bank
    • Supply
    • Distribution
    • Staking
    • Slashing
    • Oracle
    • Market
    • Treasury
    • Governance

User Manual

    NODE SOFTWARE

    • Installation
    • User Guide
    • Light Client Daemon
    • terracli Reference
    • Ledger Nano Support
    • Production Settings
    • Join a Network
    • Deploy a Testnet

Validator Handbook

  • Introduction
  • Validator FAQ
  • GUIDES

    • Getting Started
    • Security Best Practices
    • Exchange Rate Oracle

Contribute

  • Contribution guidelines for Terra Core
  • Help to translate

Bank

Terra's Bank module inherits from Cosmos SDK's bank module. This document is a stub, and covers mainly important Terra-specific notes about how it is used.

The Bank module is the base transactional layer of the Terra blockchain: it allows assets to be sent from one Account to another. Bank defines 2 types of Send-Transactions: MsgSend and MsgMultiSend. These messages automatically incur a stability fee, which is performed by the ante handler in the Auth module.

Message Types

MsgSend

Send Coins

// MsgSend - high level transaction of the coin module
type MsgSend struct {
    FromAddress sdk.AccAddress `json:"from_address"`
    ToAddress   sdk.AccAddress `json:"to_address"`
    Amount      sdk.Coins      `json:"amount"`
}

The Bank module can be used to send coins from one Account (terra- prefixed account) to another. A MsgSend is constructed to facilitate the transfer. If the balance of coins in the Account is insufficient or the recipient Account does not exist, the transaction fails.

MsgMultiSend

Batch Send Operations

// MsgMultiSend - high level transaction of the coin module
type MsgMultiSend struct {
    Inputs  []Input  `json:"inputs"`
    Outputs []Output `json:"outputs"`
}

The Bank module can be used to send multiple transactions at once. Inputs contains the incoming transactions, and Outputs contains the outgoing transactions. The coin balance of the Inputs and the Outputs must match exactly. Batching transactions via multisend has the benefit of conserving network bandwidth and gas fees.

If any of the Accounts fails, then taxes and fees already paid through the transaction is not refunded.

Parameters

The subspace for the Bank module is bank.

type GenesisState struct {
    SendEnabled bool `json:"send_enabled" yaml:"send_enabled"`
}

SendEnabled

Governs whether sends (MsgSend or MsgMultiSend transactions) are able to be performed.

  • type: bool
  • default value: true
Last updated on 11/30/2019
← AuthSupply →
  • Message Types
    • MsgSend
    • MsgMultiSend
  • Parameters
    • SendEnabled
Terra Documentation
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Follow @terra_money
© 2019 Terra