Any interaction with the RPC connection and blockchain itself require first to start internal processor and other tasks, to do so we call the async account.init():
wallet = pyrin.Wallet()success =await wallet.connect()account = await wallet.import_account("custom elevator under van sunset reason much puppy valley speak coffee debris loud shoot maple govern evoke junior view duty elder cabin swap spray")
Change Address
account.change_address()
Send PYI
Minimum sending of PYI is 0.2 due to the storage mass calculation, more into can be found at KIP9
# Creating or importing an accountawait account.init()# Make sure we initialize the proper blockchain tracking of the accountresult = await account.send("pyrin:qpwx6a66j38gqgxcvc74ts77fkxhdzdunl6uhvdcplp0cgvvwrx86n2zl67u0", 0.1, 0.2) # address, priority fee, amount
print("aggregated_utxos", result.aggregated_utxos)# 1print("aggregated_fees", result.aggregated_fees)# 10052054print("number_of_generated_transactions", result.number_of_generated_transactions)# 1print("final_transaction_amount", result.final_transaction_amount)# 20000000print("final_transaction_id", result.final_transaction_id) # 996ad73da7427fa732555139380f46ce54f92d1469a70b5fc52329e389346abf