Wallet

Wallet

class Wallet(**kwargs)

Implements the wallet api endpoints.

account(wallet_name: str, password: str, **kwargs) → str

Creates a new account for a wallet.

Parameters:
  • password (str) – The wallet password.
  • wallet_name (str) – The wallet name.
  • **kwargs – Extra keyword arguments.
Returns:

The newly created account name.

Return type:

str

Raises:

APIError – Error thrown by node API. See message for details.

accounts(wallet_name: str, **kwargs) → List[str]

Gets a list of accounts for the specified wallet.

Parameters:
  • wallet_name (str) – The wallet name.
  • **kwargs – Extra keyword arguments.
Returns:

A list of accounts.

Return type:

List[str]

Raises:

APIError – Error thrown by node API. See message for details.

addresses(wallet_name: str, account_name: str = 'account 0', segwit: bool = False, **kwargs) → pystratis.api.global_responsemodels.addressesmodel.AddressesModel

Gets all addresses for a wallet account.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • segwit (bool, optional) – If True, gets a segwit address. Default=False.
  • **kwargs – Extra keyword arguments.
Returns:

All addresses associated with the account given.

Return type:

AddressesModel

Raises:

APIError – Error thrown by node API. See message for details.

balance(wallet_name: str, account_name: str = 'account 0', include_balance_by_address: bool = False, **kwargs) → pystratis.api.global_responsemodels.walletbalancemodel.WalletBalanceModel

Gets the balance of a wallet in STRAX (or sidechain coin). Both the confirmed and unconfirmed balance are returned.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • include_balance_by_address (bool, optional) – If true, includes detailed information about balances by address. Default=False.
  • **kwargs – Extra keyword arguments.
Returns:

The wallet balance.

Return type:

WalletBalanceModel

Raises:

APIError – Error thrown by node API. See message for details.

build_interflux_transaction(wallet_name: str, password: str, destination_chain: int, destination_address: Union[pystratis.core.types.address.Address, str], outpoints: List[pystratis.core.outpoint.Outpoint], recipients: List[pystratis.core.recipient.Recipient], fee_amount: Union[pystratis.core.types.money.Money, int, float, decimal.Decimal] = None, segwit_change_address: bool = False, op_return_data: str = None, op_return_amount: Union[pystratis.core.types.money.Money, int, float, decimal.Decimal] = None, fee_type: str = None, allow_unconfirmed: bool = False, shuffle_outputs: bool = False, account_name: str = 'account 0', change_address: Union[pystratis.core.types.address.Address, str] = None, **kwargs) → pystratis.api.global_responsemodels.buildtransactionmodel.BuildTransactionModel

Builds a transaction and returns the hex to use when executing the transaction.

Parameters:
  • destination_chain (int) – Enumeration representing the destination chain.
  • destination_address (Address, str) – The destination address.
  • fee_amount (Money, int, float, Decimal, optional) – The fee amount. Cannot be set with fee_type.
  • password (str) – The password.
  • segwit_change_address (bool, optional) – If True, the change address is a segwit address.
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • outpoints (List[Outpoint]) – A list of outpoints to include in the transaction.
  • recipients (List[Recipient]) – A list of recipients with amounts.
  • op_return_data (str, optional) – The OP_RETURN data.
  • op_return_amount (Money, int, float, Decimal, optional) – The amount to burn in OP_RETURN.
  • fee_type (str, optional) – The fee type. Allowed [low, medium, high]
  • allow_unconfirmed (bool, optional) – If True, includes unconfirmed outputs. Default=False.
  • shuffle_outputs (bool, optional) – If True, shuffle outputs. Default=False.
  • change_address (Address, str, optional) – Specify a change address. If not set, a new change address is used.
  • **kwargs – Extra keyword arguments.
Returns:

A built interflux transaction.

Return type:

BuildTransactionModel

Raises:

APIError – Error thrown by node API. See message for details.

build_offline_sign_request(wallet_name: str, outpoints: List[pystratis.core.outpoint.Outpoint], recipients: List[pystratis.core.recipient.Recipient], fee_amount: Union[pystratis.core.types.money.Money, int, float, decimal.Decimal] = None, op_return_data: str = None, op_return_amount: Union[pystratis.core.types.money.Money, int, float, decimal.Decimal] = None, fee_type: str = None, allow_unconfirmed: bool = False, shuffle_outputs: bool = False, account_name: str = 'account 0', change_address: Union[pystratis.core.types.address.Address, str] = None, **kwargs) → pystratis.api.global_responsemodels.buildofflinesignmodel.BuildOfflineSignModel

Builds an offline sign request for a transaction.

Parameters:
  • fee_amount (Money, int, float, Decimal) – The fee amount. Cannot be set with fee_type.
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • outpoints (List[Outpoint]) – A list of outputs to use for the transaction.
  • recipients (List[Recipient]) – A list of recipients, including amounts.
  • op_return_data (str, optional) – The OP_RETURN data.
  • op_return_amount (Money, optional) – The amount to burn in OP_RETURN.
  • fee_type (str, optional) – The fee type. Allowed [low, medium, high]
  • allow_unconfirmed (bool, optional) – If True, includes unconfirmed outputs. Default=False.
  • shuffle_outputs (bool, optional) – If True, shuffle outputs. Default=False.
  • change_address (Address, optional) – Specify a change address. If not set, a new change address is used.
  • **kwargs – Extra keyword arguments.
Returns:

A built transaction that can be signed offline.

Return type:

BuildOfflineSignModel

Raises:

APIError – Error thrown by node API. See message for details.

build_transaction(wallet_name: str, password: str, outpoints: List[pystratis.core.outpoint.Outpoint], recipients: List[pystratis.core.recipient.Recipient], fee_amount: Union[pystratis.core.types.money.Money, int, float, decimal.Decimal] = None, segwit_change_address: bool = False, op_return_data: str = None, op_return_amount: Union[pystratis.core.types.money.Money, int, float, decimal.Decimal] = None, fee_type: str = None, allow_unconfirmed: bool = False, shuffle_outputs: bool = False, account_name: str = 'account 0', change_address: Union[pystratis.core.types.address.Address, str] = None, **kwargs) → pystratis.api.global_responsemodels.buildtransactionmodel.BuildTransactionModel

Builds a transaction and returns the hex to use when executing the transaction.

Parameters:
  • fee_amount (Money, int, float, Decimal, optional) – The fee amount. Cannot be set with fee_type.
  • password (str) – The password.
  • segwit_change_address (bool, optional) – If True, the change address is a segwit address. Default=False.
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • outpoints (List[Outpoint]) – A list of outpoints to include in the transaction.
  • recipients (List[Recipient]) – A list of recipients with amounts.
  • op_return_data (str, optional) – The OP_RETURN data.
  • op_return_amount (Money, int, float, Decimal, optional) – The amount to burn in OP_RETURN.
  • fee_type (str, optional) – The fee type. Allowed [low, medium, high]
  • allow_unconfirmed (bool, optional) – If True, includes unconfirmed outputs. Default=False.
  • shuffle_outputs (bool, optional) – If True, shuffle outputs. Default=False.
  • change_address (Address, str, optional) – Specify a change address. If not set, a new change address is used.
  • **kwargs – Extra keyword arguments.
Returns:

A built transaction.

Return type:

BuildTransactionModel

Raises:

APIError – Error thrown by node API. See message for details.

consolidate(wallet_password: str, wallet_name: str, destination_address: Union[pystratis.core.types.address.Address, str], utxo_value_threshold_in_satoshis: int, wallet_account: str = 'account 0', broadcast: bool = False, **kwargs) → pystratis.core.types.hexstr.hexstr

Consolidate a wallet.

utxo_value_threshold looks to consolidate any utxo amount below the threshold.

Parameters:
  • wallet_password (str) – The wallet password.
  • wallet_name (str) – The wallet name.
  • wallet_account (str, optional) – The account name. Default=’account 0’.
  • destination_address (Address, str) – The destination address.
  • utxo_value_threshold_in_satoshis (int) – The threshold where amounts below this amount will be consolidated. (min 1e8)
  • broadcast (bool, optional) – If True, broadcast consolidation transaction. Default=False.
  • **kwargs – Extra keyword arguments.
Returns:

A consolidation transaction ready for broadcast.

Return type:

hexstr

Raises:

APIError – Error thrown by node API. See message for details.

create(name: str, password: str, passphrase: str, mnemonic: Union[str, NoneType] = None, **kwargs) → List[str]

Creates a new wallet on this full node.

Parameters:
  • mnemonic (str, optional) – The mnemonic used to create a HD wallet. If not specified, it will be randomly generated underhood.
  • password (str) – The password for a wallet to be created.
  • passphrase (str) – The passphrase used in master key generation.
  • name – (str): The name for a wallet to be created.
  • **kwargs – Extra keyword arguments.
Returns:

The mnemonic used to generate this HD wallet.

Return type:

List[str]

Raises:

APIError – Error thrown by node API. See message for details.

distribute_utxos(wallet_name: str, wallet_password: str, utxos_count: int, utxo_per_transaction: int, outpoints: List[pystratis.core.outpoint.Outpoint], account_name: str = 'account 0', use_unique_address_per_utxo: bool = True, reuse_addresses: bool = True, use_change_addresses: bool = False, timestamp_difference_between_transactions: int = 0, min_confirmations: int = 0, dry_run: bool = True, **kwargs) → pystratis.api.wallet.responsemodels.distributeutxomodel.DistributeUtxoModel

Splits and distributes UTXOs across wallet addresses

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • wallet_password (str) – The wallet password.
  • use_unique_address_per_utxo (bool, optional) – If True, uses a unique address for each utxo. Default=True.
  • reuse_addresses (bool, optional) – If True, reuses addresses. Default=True.
  • use_change_addresses (bool, optional) – If True, use change addresses. Default=False.
  • utxos_count (int) – The number of utxos to create.
  • utxo_per_transaction (int) – The number of utxos per transaction.
  • timestamp_difference_between_transactions (int, optional) – The number of seconds between transactions. Default=0.
  • min_confirmations (int, optional) – The minimum number of confirmations to include in transaction. Default=0.
  • outpoints (List[Outpoint]) – A list of outpoints to include in the transaction.
  • dry_run (bool, optional) – If True, simulate transaction. Default=True.
  • **kwargs – Extra keyword arguments.
Returns:

Information about the distribute utxo transaction.

Return type:

DistributeUtxoModel

Raises:

APIError – Error thrown by node API. See message for details.

estimate_txfee(wallet_name: str, outpoints: List[pystratis.core.outpoint.Outpoint], recipients: List[pystratis.core.recipient.Recipient], op_return_data: str = None, op_return_amount: pystratis.core.types.money.Money = None, fee_type: str = None, allow_unconfirmed: bool = False, shuffle_outputs: bool = False, change_address: pystratis.core.types.address.Address = None, account_name: str = 'account 0', **kwargs) → pystratis.core.types.money.Money

Gets a fee estimate for a specific transaction.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • outpoints (List[Outpoint]) – A list of outpoints to include in the transaction.
  • recipients (List[Recipient]) – A list of recipients with amounts.
  • op_return_data (str, optional) – The OP_RETURN data.
  • op_return_amount (Money, int, float, Decimal, optional) – The amount to burn in OP_RETURN.
  • fee_type (str, optional) – The fee type. Allowed [low, medium, high]
  • allow_unconfirmed (bool, optional) – If True, includes unconfirmed outputs. Default=False.
  • shuffle_outputs (bool, optional) – If True, shuffle outputs. Default=False.
  • change_address (Address, str, optional) – Specify a change address. If not set, a new change address is used.
  • **kwargs – Extra keyword arguments.
Returns:

An estimate of the transaction fee.

Return type:

Money

Raises:

APIError – Error thrown by node API. See message for details.

extpubkey(wallet_name: str, account_name: str = 'account 0', **kwargs) → pystratis.core.extpubkey.ExtPubKey

Gets the extended public key of a specified wallet account.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • **kwargs – Extra keyword arguments.
Returns:

ExtPubKey

Raises:

APIError – Error thrown by node API. See message for details.

general_info(name: str, **kwargs) → pystratis.api.global_responsemodels.walletgeneralinfomodel.WalletGeneralInfoModel

Gets some general information about a wallet.

Parameters:
  • name (str) – The wallet name.
  • **kwargs – Extra keyword arguments.
Returns:

General information about the wallet.

Return type:

WalletGeneralInfoModel

Raises:

APIError – Error thrown by node API. See message for details.

history(wallet_name: str, account_name: str = 'account 0', address: Union[pystratis.core.types.address.Address, str] = None, skip: int = 0, take: int = None, prev_output_tx_time: int = None, prev_output_index: int = None, search_query: str = None, **kwargs) → pystratis.api.wallet.responsemodels.wallethistorymodel.WalletHistoryModel

Gets the history of a wallet.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • address (Address, str, optional) – The address to query the history.
  • skip (conint(ge=0), optional) – The number of history items to skip.
  • take (conint(ge=0), optional) – The number of history items to take.
  • prev_output_tx_time (conint(ge=0), optional) – The previous output transaction time.
  • prev_output_index (conint(ge=0), optional) – The previous output transaction index.
  • search_query (str, optional) – A search query.
  • **kwargs – Extra keyword arguments.
Returns:

The wallet history.

Return type:

WalletHistoryModel

Raises:

APIError – Error thrown by node API. See message for details.

list_wallets(**kwargs) → dict

Lists all the files found in the database

Parameters:**kwargs – Extra keyword arguments.
Returns:A list of wallets.
Return type:dict
Raises:APIError – Error thrown by node API. See message for details.
load(name: str, password: str, **kwargs) → None

Loads a previously created wallet.

Parameters:
  • name (str) – The wallet name to load.
  • password (str) – The wallet password.
  • **kwargs – Extra keyword arguments.
Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

max_balance(wallet_name: str, fee_type: str, account_name: str = 'account 0', allow_unconfirmed: bool = False, **kwargs) → pystratis.api.wallet.responsemodels.maxspendableamountmodel.MaxSpendableAmountModel

Gets the maximum spendable balance for an account along with the fee required to spend it.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • fee_type (str) – The fee type. Allowed [low, medium, high]
  • allow_unconfirmed (bool, optional) – If True, allow unconfirmed utxo in request. Default=False.
  • **kwargs – Extra keyword arguments.
Returns:

Information about the maximum spendable amount and fee to send.

Return type:

MaxSpendableAmountModel

Raises:

APIError – Error thrown by node API. See message for details.

mnemonic(language: str = 'English', word_count: int = 12, **kwargs) → List[str]

Generates a mnemonic to use for an HD wallet. For more information about mnemonics, see BIP39.

Parameters:
  • language (str) – The language used to generate mnemonic.
  • word_count (int) – Count of words needs to be generated.
  • **kwargs – Extra keyword arguments.
Returns:

The generated mnemonic.

Return type:

List[str]

Raises:

APIError – Error thrown by node API. See message for details.

new_addresses(wallet_name: str, count: int, account_name: str = 'account 0', segwit: bool = False, **kwargs) → List[pystratis.core.types.address.Address]

Gets a specified number of new addresses (in the Base58 format) for a wallet account.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • count (conint(ge=1)) – The number of addresses to get.
  • segwit (bool, optional) – If True, get a segwit address. Default=False.
  • **kwargs – Extra keyword arguments.
Returns:

A new address.

Return type:

List[Address]

Raises:

APIError – Error thrown by node API. See message for details.

offline_sign_request(wallet_password: str, wallet_name: str, unsigned_transaction: Union[str, pystratis.core.types.hexstr.hexstr], fee: Union[pystratis.core.types.money.Money, int, float, decimal.Decimal], utxos: List[pystratis.api.global_responsemodels.utxodescriptor.UtxoDescriptor], addresses: List[pystratis.api.global_responsemodels.addressdescriptor.AddressDescriptor], wallet_account: str = 'account 0', **kwargs) → pystratis.api.global_responsemodels.buildtransactionmodel.BuildTransactionModel

Build an offline sign request for a transaction. The resulting transaction hex can be broadcast.

Parameters:
  • wallet_password (str) – The wallet password.
  • wallet_name (str) – The wallet name.
  • wallet_account (str, optional) – The account name. Default=’account 0’.
  • unsigned_transaction (hexstr, str) – The unsigned transaction hexstr.
  • fee (Money, int, float, Decimal) – The fee.
  • utxos (List[UtxoDescriptor]) – A list of utxodescriptors.
  • addresses (List[AddressDescriptor]) – A list of addresses to send transactions.
  • **kwargs – Extra keyword arguments.
Returns:

A signed transaction that can be broadcast.

Return type:

BuildTransactionModel

Raises:

APIError – Error thrown by node API. See message for details.

private_key(password: str, wallet_name: str, address: Union[pystratis.core.types.address.Address, str], **kwargs) → pystratis.core.key.Key

Gets the private key of a specified wallet address.

Parameters:
  • password (str) – The wallet password.
  • wallet_name (str) – The wallet name.
  • address (Address, str) – The address to request a private key for.
  • **kwargs – Extra keyword arguments.
Returns:

The private key.

Return type:

Key

Raises:

APIError – Error thrown by node API. See message for details.

pubkey(wallet_name: str, external_address: Union[pystratis.core.types.address.Address, str], **kwargs) → pystratis.core.pubkey.PubKey

Gets the public key for an address.

Parameters:
  • wallet_name (str) – The name of the wallet to search for pubkey in.
  • external_address (Address, str) – The external address of a wanted pubkey.
  • **kwargs – Extra keyword arguments.
Returns:

The requested public key.

Return type:

PubKey

Raises:

APIError – Error thrown by node API. See message for details.

received_by_address(address: Union[pystratis.core.types.address.Address, str], **kwargs) → pystratis.api.global_responsemodels.addressbalancemodel.AddressBalanceModel

Retrieves transactions received by the specified address.

Parameters:
  • address (Address) – The address to query.
  • **kwargs – Extra keyword arguments.
Returns:

The transactions associated with the address.

Return type:

AddressBalanceModel

Raises:

APIError – Error thrown by node API. See message for details.

recover(mnemonic: str, password: str, passphrase: str, name: str, creation_date: str = None, **kwargs) → None

Recovers an existing wallet.

Parameters:
  • mnemonic (str) – A mnemonic for initializing a wallet.
  • password (str) – The password for the wallet.
  • passphrase (str) – The passphrase for the wallet.
  • name (str) – The name for the wallet.
  • creation_date (str, datetime, optional) – An estimate of the wallet creation date.
  • **kwargs – Extra keyword arguments.
Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

recover_via_extpubkey(extpubkey: Union[pystratis.core.extpubkey.ExtPubKey, str, pystratis.core.types.hexstr.hexstr], account_index: int, name: str, creation_date: str, **kwargs) → None

Recovers a wallet using its extended public key.

Parameters:
  • extpubkey (ExtPubKey, str, hexstr) – The extpubkey for the recovered wallet.
  • account_index (int) – The account index.
  • name (str) – The wallet name.
  • creation_date (str, datetime, optional) – An estimate of the wallet creation date.
  • **kwargs – Extra keyword arguments.
Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

remove_transactions(wallet_name: str, ids: List[Union[str, pystratis.core.types.uint256.uint256]] = None, from_date: str = None, remove_all: bool = False, resync: bool = True, **kwargs) → List[pystratis.api.global_responsemodels.removedtransactionmodel.RemovedTransactionModel]

Removes transactions from the wallet.

Parameters:
  • wallet_name (str) – The wallet name.
  • ids (List[uint256, str], optional) – A list of transaction ids to remove.
  • from_date (str, optional) – An option to remove transactions after given date.
  • remove_all (bool, optional) – An option to remove all transactions. Default=False.
  • resync (bool, optional) – If True, resyncs wallet after items removed. Default=True.
  • **kwargs – Extra keyword arguments.
Returns:

A list of removed transactions.

Return type:

List[RemovedTransactionModel]

Raises:

APIError – Error thrown by node API. See message for details.

remove_wallet(wallet_name: str, **kwargs) → None

Remove a wallet

Parameters:
  • wallet_name (str) – The wallet name.
  • **kwargs – Extra keyword arguments.
Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

send_transaction(transaction_hex: Union[str, pystratis.core.types.hexstr.hexstr], **kwargs) → pystratis.api.global_responsemodels.walletsendtransactionmodel.WalletSendTransactionModel

Sends a transaction that has already been built.

Parameters:
  • transaction_hex (hexstr, str) – The hexified transaction.
  • **kwargs – Extra keyword arguments.
Returns:

Information about a sent transaction.

Return type:

WalletSendTransactionModel

Raises:

APIError – Error thrown by node API. See message for details.

sign_message(wallet_name: str, password: str, external_address: Union[pystratis.core.types.address.Address, str], message: str, **kwargs) → str

Signs a message and returns the signature.

Parameters:
  • wallet_name (str) – The name of the wallet to sign message with.
  • password (str) – The password of the wallet to sign message with.
  • external_address (Address, str) – The external address of a private key used to sign message.
  • message (str) – The message to be signed.
  • **kwargs – Extra keyword arguments.
Returns:

The signature of the message.

Return type:

str

Raises:

APIError – Error thrown by node API. See message for details.

spendable_transactions(wallet_name: str, account_name: str = 'account 0', min_confirmations: int = 0, **kwargs) → pystratis.api.wallet.responsemodels.spendabletransactionsmodel.SpendableTransactionsModel

Gets the spendable transactions for an account with the option to specify how many confirmations a transaction needs to be included.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • min_confirmations (int, optional) – Get spendable transactions less this value from chain tip. Default=0.
  • **kwargs – Extra keyword arguments.
Returns:

Spendable transactions.

Return type:

SpendableTransactionsModel

Raises:

APIError – Error thrown by node API. See message for details.

split_coins(wallet_name: str, wallet_password: str, total_amount_to_split: Union[pystratis.core.types.money.Money, int, float, decimal.Decimal], utxos_count: int, account_name: str = 'account 0', **kwargs) → pystratis.api.global_responsemodels.walletsendtransactionmodel.WalletSendTransactionModel

Creates requested amount of UTXOs each of equal value and sends the transaction.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • wallet_password (str) – The wallet password.
  • total_amount_to_split (Money, int, float, Decimal) – The total amount to split.
  • utxos_count (int) – The number of utxos to create. (Must be greater than 2).
  • **kwargs – Extra keyword arguments.
Returns:

Information about the sent transaction.

Return type:

WalletSendTransactionModel

Raises:

APIError – Error thrown by node API. See message for details.

sweep(private_keys: List[Union[pystratis.core.key.Key, str]], destination_address: Union[pystratis.core.types.address.Address, str], broadcast: bool = False, **kwargs) → List[pystratis.core.types.uint256.uint256]

Sweeps a wallet to specified address.

Parameters:
  • private_keys (List[Key, str]) – A list of private keys to sweep.
  • destination_address (Address, str) – The address to sweep the coins to.
  • broadcast (bool, optional) – Broadcast transaction after creation. Default=False.
  • **kwargs – Extra keyword arguments.
Returns:

A list of transactions for the sweep.

Return type:

List[uint256]

Raises:

APIError – Error thrown by node API. See message for details.

sync(block_hash: Union[pystratis.core.types.uint256.uint256, str], **kwargs) → None

Requests the node resyncs from a block specified by its block hash.

Parameters:
  • block_hash (uint256, str) – The hash to start syncing from.
  • **kwargs – Extra keyword arguments.
Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

sync_from_date(wallet_name: str, date: str, all_transactions: bool = True, **kwargs) → None

Request the node resyncs starting from a given date and time.

Parameters:
  • date (str) – The date to sync from in YYYY-MM-DDTHH:MM:SS format.
  • all_transactions (bool, optional) – If True, sync all transactions. Default=True.
  • wallet_name (str) – The wallet name.
  • **kwargs – Extra keyword arguments.
Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

transaction_count(wallet_name: str, account_name: str = 'account 0', **kwargs) → int

Get the transaction count for the specified Wallet and Account.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • **kwargs – Extra keyword arguments.
Returns:

The number of transactions.

Return type:

int

Raises:

APIError – Error thrown by node API. See message for details.

unused_address(wallet_name: str, account_name: str = 'account 0', segwit: bool = False, **kwargs) → pystratis.core.types.address.Address

Gets an unused address (in the Base58 format) for a wallet account.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • segwit (bool, optional) – If True, get a segwit address. Default=False.
  • **kwargs – Extra keyword arguments.
Returns:

An unused address.

Return type:

Address

Raises:

APIError – Error thrown by node API. See message for details.

unused_addresses(wallet_name: str, count: int, account_name: str = 'account 0', segwit: bool = False, **kwargs) → List[pystratis.core.types.address.Address]

Gets a specified number of unused addresses (in the Base58 format) for a wallet account.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • count (int) – The number of addresses to get.
  • segwit (bool, optional) – If True, get a segwit address. Default=False.
  • **kwargs – Extra keyword arguments.
Returns:

A list of unused addresses.

Return type:

List[Address]

Raises:

APIError – Error thrown by node API. See message for details.

verify_message(signature: str, external_address: Union[pystratis.core.types.address.Address, str], message: str, **kwargs) → bool

Verifies the signature of a message.

Parameters:
  • signature (str) – The signature to be verified.
  • external_address (Address, str) – The address of the signer.
  • message (str) – The message that was signed.
  • **kwargs – Extra keyword arguments.
Returns:

True if signature is verified, False otherwise.

Return type:

bool

Raises:

APIError – Error thrown by node API. See message for details.

wallet_stats(wallet_name: str, account_name: str = 'account 0', min_confirmations: int = 0, verbose: bool = True, **kwargs) → pystratis.api.wallet.responsemodels.walletstatsmodel.WalletStatsModel

Retrieves information about the wallet.

Parameters:
  • wallet_name (str) – The wallet name.
  • account_name (str, optional) – The account name. Default=’account 0’.
  • min_confirmations (int, optional) – Include transaction less this amount from the chain tip. Default=0.
  • verbose (bool, optional) – If True, give verbose response. Default=True.
  • **kwargs – Extra keyword arguments.
Returns:

Wallet statistical information.

Return type:

WalletStatsModel

Raises:

APIError – Error thrown by node API. See message for details.

AccountHistoryModel

class AccountHistoryModel

An pydantic model for account history.

AddressBalanceModel

class AddressBalanceModel

A pydantic model for an address balance.

AddressesModel

class AddressesModel

A pydantic model for a list of addressmodels.

BuildOfflineSignModel

class BuildOfflineSignModel

A pydantic model for a built offline sign request.

BuildTransactionModel

class BuildTransactionModel

A pydantic model for a built transaction.

DistributeUtxoModel

class DistributeUtxoModel

A pydantic model for the distribute utxo method.

MaxSpendableAmountModel

class MaxSpendableAmountModel

A pydantic model for the maximum spendable amount.

PaymentDetailModel

class PaymentDetailModel

A pydantic model for payment details.

RemovedTransactionModel

class RemovedTransactionModel

A pydantic model for a removed transaction.

SpendableTransactionModel

class SpendableTransactionModel

A pydantic model representing spendable transactions.

SpendableTransactionsModel

class SpendableTransactionsModel

A pydantic model for a list of spendable transactions.

TransactionItemModel

class TransactionItemModel

A pydantic model for a transaction item.

TransactionOutputModel

class TransactionOutputModel

A pydantic model of a transaction output.

UtxoAmountModel

class UtxoAmountModel

A pydantic model representing a utxo amount.

UtxoPerBlockModel

class UtxoPerBlockModel

A pydantic model representing utxo per block.

UtxoPerTransactionModel

class UtxoPerTransactionModel

A pydantic model for utxo per transaction.

WalletHistoryModel

class WalletHistoryModel

A pydantic model for a wallet history.

WalletStatsModel

class WalletStatsModel

A pydantic model for wallet stats.

WalletBalanceModel

class WalletBalanceModel

A pydantic model for a wallet balance.

WalletGeneralInfoModel

class WalletGeneralInfoModel

A model representing general wallet info.

WalletSendTransactionModel

class WalletSendTransactionModel

A pydantic model for a send transaction response.