Skip to main content

terra_sdk.client.lcd.wallet

Wallet Objects


_1
class Wallet()

Wraps around a :class:Key implementation and provides transaction building and signing functionality. It is recommended to create this object through :meth:LCDClient.wallet()<terra_sdk.client.lcd.LCDClient.wallet>.

account_number


_1
def account_number() -> int

Fetches account number for the account associated with the Key.

sequence


_1
def sequence() -> int

Fetches the sequence number for the account associated with the Key.

account_number_and_sequence


_1
def account_number_and_sequence() -> dict

Fetches both account and sequence number associated with the Key.

create_tx


_1
def create_tx(options: CreateTxOptions) -> Tx

Builds an unsigned transaction object. The Wallet will first query the blockchain to fetch the latest account and sequence values for the account corresponding to its Key, unless the they are both provided. If no fee parameter is set, automatic fee estimation will be used (see fee_estimation).

Arguments:

  • options CreateTxOptions - Options to create a tx

Returns:

  • Tx - unsigned transaction

create_and_sign_tx


_1
def create_and_sign_tx(options: CreateTxOptions) -> Tx

Creates and signs a :class:Tx object in a single step. This is the recommended method for preparing transaction for immediate signing and broadcastring. The transaction is generated exactly as :meth:create_tx.

Arguments:

  • options CreateTxOptions - Options to create a tx

Returns:

  • Tx - signed transaction