BaseClients

BaseClient object

The BaseClient object is the base class for all clients. It provides the basic functionality for all clients. It is not meant to be used directly. Instead, use one of the subclasses. BaseClient supports iteraction with node url and cleos.

class litewax.baseclients.BaseClient(node: str)[source]

BaseClient is a base client for interacting with the blockchain

Parameters:

node (str) – Node URL

Returns:

__node
__wax
property node: str

Node URL

property wax: Cleos

Cleos instance

change_node(node: str) None[source]

Change node for client by redeffining dynamic_url in Cleos instance

Parameters:

node (str) – Node URL

Returns:

AnchorClient object

Class for iteracting with private, public keys, signing transactions. Based on eospy.cleos.

class litewax.baseclients.AnchorClient(private_key: str, node: str)[source]

AnchorClient is a client for interacting with the blockchain using a private key

Parameters:
  • private_key (str) – Private key string

  • node (str) – Node URL

Returns:

property private_key: EOSKey

Private key

property public_key: EOSKey

Public key

property name: str

Wallet name

get_name() str[source]

Get wallet name by public key

Raises:

KeyError if account not found

Returns:

wallet name

Return type:

str

sign(trx: bytearray) List[str][source]

Sign transaction with private key

Parameters:

trx – transaction to sign

Returns:

signatures (length: 1)

Return type:

list

WCWClient object

Class for iteracting with blockchain via Wax Cloud Wallet Client by cookies. Use Wax Cloud Wallet for sing transaction. Provide token session for authorization.

class litewax.baseclients.WCWClient(cookie: str, node: str)[source]

WCWClient is a client for interacting with the blockchain using a WCW session token

Parameters:
  • cookie (str) – WCW session token

  • node (str) – Node URL

Returns:

property cookie: str

WCW session token

property session: CloudScraper

CloudScraper instance

property name: str

Wallet name

get_name() str[source]

Get wallet name by session_token

Raises:

litewax.exceptions.CookiesExpired if session token is expired or invalid

Returns:

wallet name

Return type:

str

sign(trx: bytearray) List[str][source]

Sign transaction with WCW session token

Parameters:

trx (bytearray) – transaction to sign

Returns:

signatures (length: 2)

Return type:

list