Types

Besides accounts (specified in State), the types exposed by the auth module are StdFee, the combination of an amount and gas limit, StdSignature, the combination of an optional public key and a cryptographic signature as a byte array, StdTx, a struct which implements the sdk.Tx interface using StdFee and StdSignature, and StdSignDoc, a replay-prevention structure for StdTx which transaction senders must sign over.

StdFee

A StdFee is simply the combination of a fee amount, in any number of denominations, and a gas limit (where dividing the amount by the gas limit gives a "gas price").

type StdFee struct {
  Amount Coins
  Gas    uint64
}
1
2
3
4

StdSignature

A StdSignature is the combination of an optional public key and a cryptographic signature as a byte array. The SDK is agnostic to particular key or signature formats and supports any supported by the PubKey interface.

type StdSignature struct {
  PubKey    PubKey
  Signature []byte
}
1
2
3
4

StdTx

A StdTx is a struct which implements the sdk.Tx interface, and is likely to be generic enough to serve the purposes of many Cosmos SDK blockchains.

type StdTx struct {
  Msgs        []sdk.Msg
  Fee         StdFee  
  Signatures  []StdSignature
  Memo        string
}
1
2
3
4
5
6

StdSignDoc

A StdSignDoc is a replay-prevention structure to be signed over, which ensures that any submitted transaction (which is simply a signature over a particular bytestring) will only be executable once on a particular blockchain.

json.RawMessage is preferred over using the SDK types for future compatibility.

type StdSignDoc struct {
  AccountNumber uint64
  ChainID       string
  Fee           json.RawMessage
  Memo          string
  Msgs          []json.RawMessage
  Sequence      uint64
}
1
2
3
4
5
6
7
8
Last Updated: 2/21/2019, 2:21:57 AM