Use Contract directly

use_contract_directly.py
 1# import library
 2from litewax import Client
 3
 4# Create a client with a private key
 5client = Client(private_key="5K...")
 6
 7# import contract object (for ex. eosio.token). Before you can use this contract, you must create a contract .py file via abigen. 
 8# For example, you can use this command: `python -c "from litewax import Contract; Contract('eosio.token')"`
 9from contracts.eosio_token import eosio_token
10
11# init contract object
12contract = eosio_token(actor=client.name)
13
14# Create a transaction object
15trx = client.Transaction(
16    contract.transfer(
17        _from=client.name,
18        to="abuztradewax",
19        quantity="1.00000000 WAX",
20        memo="Test send"
21    )
22)
23
24# Push the transaction
25r = trx.push()
26
27print(r)
28# {'transaction_id': '928802d253bffc29d6178e634052ec5f044b2fcce0c4c8bc5b44d978e22ec5d4', ...}