added example script for sending tokens

This commit is contained in:
Alexander 2024-09-10 19:06:03 -04:00
parent 308179d4f8
commit 098ad8a737

20
example-send-token.py Normal file
View file

@ -0,0 +1,20 @@
from core import *
tokenA_address = ''
tokenA_info = get_token_info(tokenA_address)
tokenA_amount = 1
wallet_address = ''
destination_address = ''
set_logging(wallet_address, 'INFO')
account = load_wallet(wallet_address, os.getenv('SECRET'))
if send_tokens(
account,
tokenA_address,
destination_address,
tokenA_amount
):
logging.info("Sent {} {} to {}".format(tokenA_amount, tokenA_info['symbol'], destination_address))
else:
logging.info("Failed to send {} {} to {}".format(tokenA_amount, tokenA_info['symbol'], destination_address))