tx

package
v0.0.0-...-0cc983d Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SignModeUnspecified specifies an unknown signing mode and will be
	// rejected
	SignModeUnspecified SignMode = 0
	// SignModeDirect specifies a signing mode which uses SignDoc and is
	// verified with raw bytes from Tx
	SignModeDirect SignMode = 1
	// SignModeTexture is a future signing mode that will verify some
	// human-readable textual representation on top of the binary representation
	// from SIGN_MODE_DIRECT
	SignModeTexture SignMode = 2
	// SignModeLegacyAminoJSON is a backwards compatibility mode which uses
	// Amino JSON and will be removed in the future
	SignModeLegacyAminoJSON SignMode = 127

	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
	Bech32PrefixAccAddr = "terra"
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
	Bech32PrefixAccPub = "terrapub"
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
	Bech32PrefixValAddr = "terravaloper"
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
	Bech32PrefixValPub = "terravaloperpub"
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
	Bech32PrefixConsAddr = "terravalcons"
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
	Bech32PrefixConsPub = "terravalconspub"

	// CoinType defines LUNA bip44 coin type
	CoinType = uint32(330)
	// FullFundraiserPath defines full fundraiser path for LUNA coin type
	FullFundraiserPath = "44'/330'/0'/0/0"
)

Variables

View Source
var (
	// AddressVerifier terra address verifier
	AddressVerifier = func(bz []byte) error {
		if n := len(bz); n != 20 && n != 32 {
			return fmt.Errorf("incorrect address length %d", n)
		}

		return nil
	}
)

Functions

This section is empty.

Types

type Builder

type Builder struct {
	client.TxBuilder
	client.TxConfig
}

Builder to create transaction for broadcasting

func NewTxBuilder

func NewTxBuilder(txConfig client.TxConfig) Builder

NewTxBuilder - create TxBuilder

func (Builder) GetTxBytes

func (txBuilder Builder) GetTxBytes() ([]byte, error)

GetTxBytes return tx bytes for broadcast

func (Builder) Sign

func (txBuilder Builder) Sign(
	signMode signing.SignMode, signerData SignerData,
	privKey key.PrivKey, overwriteSig bool) error

Sign - generate signatures of the tx with given armored private key Only support Secp256k1 uses the Bitcoin secp256k1 ECDSA parameters.

type SignMode

type SignMode = signing.SignMode

SignMode represents a signing mode with its own security guarantees.

type SignatureV2

type SignatureV2 = signing.SignatureV2

SignatureV2 is a convenience type that is easier to use in application logic than the protobuf SignerInfo's and raw signature bytes. It goes beyond the first sdk.Signature types by supporting sign modes and explicitly nested multi-signatures. It is intended to be used for both building and verifying signatures.

type SignerData

type SignerData = authsigning.SignerData

SignerData is the specific information needed to sign a transaction that generally isn't included in the transaction body itself

type Tx

type Tx = authsigning.Tx

Tx defines a transaction interface that supports all standard message, signature fee, memo, and auxiliary interfaces.

Jump to

Keyboard shortcuts

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