ethaergo_wallet
¶
-
class
ethaergo_wallet.wallet.
EthAergoWallet
(config_file_path: str, config_data: Dict[KT, VT] = None, root_path: str = './', eth_gas_price: int = 10, aergo_gas_price: int = 0)¶ EthAergoWallet transfers tokens on the Eth<->Aergo Bridge
-
aergo_to_eth_sidechain
(from_chain: str, to_chain: str, asset_name: str, amount: int, aergo_receiver: str, aergo_privkey_name: str = 'default', aergo_privkey_pwd: str = None, eth_privkey_name: str = 'default', eth_privkey_pwd: str = None) → None¶ Transfer a native Aergo Standard Token or Aer to Ethereum
-
burn_to_aergo
(from_chain: str, to_chain: str, asset_name: str, amount: int, receiver: str, privkey_name: str = 'default', privkey_pwd: str = None) → Tuple[int, str]¶ Initiate minted Standard token transfer back to aergo origin
-
burn_to_eth
(from_chain: str, to_chain: str, asset_name: str, amount: int, receiver: str, privkey_name: str = 'default', privkey_pwd: str = None) → Tuple[int, str]¶ Initiate minted token transfer back to ethereum origin
-
eth_to_aergo_sidechain
(from_chain: str, to_chain: str, asset_name: str, amount: int, aergo_receiver: str, aergo_privkey_name: str = 'default', aergo_privkey_pwd: str = None, eth_privkey_name: str = 'default', eth_privkey_pwd: str = None) → None¶ Transfer a native ERC20 or ether to Aergo
-
freeze
(from_chain: str, to_chain: str, amount: int, receiver: str, privkey_name: str = 'default', privkey_pwd: str = None) → Tuple[int, str]¶ Initiate Aer transfer back to Ethereum AergoERC20 sidechain
-
get_aergo
(network_name: str, privkey_name: str = 'default', privkey_pwd: str = None, skip_state: bool = False) → aergo.herapy.aergo.Aergo¶ Return aergo provider with account loaded from keystore
-
get_balance_aergo
(asset_name: str, network_name: str, asset_origin_chain: str = None, account_name: str = 'default', account_addr: str = None) → Tuple[int, str]¶ Get account name balance of asset_name on network_name, and specify asset_origin_chain for a pegged asset query,
-
get_balance_eth
(asset_name: str, network_name: str, asset_origin_chain: str = None, account_name: str = 'default', account_addr: str = None) → Tuple[int, str]¶ Get account name balance of asset_name on network_name, and specify asset_origin_chain for a pegged asset query,
-
get_signer
(w3: web3.main.Web3, privkey_name: str, privkey_pwd: str = None)¶ Get the web3 signer object from the ethereum private key.
-
load_bridge_abi
(from_chain: str, to_chain: str) → str¶ Load Ethereum bridge contract abi from file location in config.
-
load_erc20_abi
(origin_chain: str, asset_name: str) → str¶ Load erc20 contract abi from file location in config.
-
load_keystore
(privkey_name: str) → str¶ Load encrypted private key from Ethereum json keystore.
-
load_minted_erc20_abi
(from_chain: str, to_chain: str) → str¶ Load Ethereum bridge contract minted token abi from file location in config.
-
lock_to_aergo
(from_chain: str, to_chain: str, asset_name: str, amount: int, receiver: str, privkey_name: str = 'default', privkey_pwd: str = None) → Tuple[int, str]¶ Initiate ERC20 token or Ether transfer to Aergo sidechain
-
lock_to_eth
(from_chain: str, to_chain: str, asset_name: str, amount: int, receiver: str, privkey_name: str = 'default', privkey_pwd: str = None) → Tuple[int, str]¶ Initiate Aergo Standard Token transfer to Ethereum sidechain
-
mint_to_aergo
(from_chain: str, to_chain: str, asset_name: str, receiver: str = None, lock_height: int = 0, privkey_name: str = 'default', privkey_pwd: str = None) → str¶ Finalize ERC20 token or Ether transfer to Aergo sidechain
-
mint_to_eth
(from_chain: str, to_chain: str, asset_name: str, receiver: str = None, lock_height: int = 0, privkey_name: str = 'default', privkey_pwd: str = None) → Tuple[str, str]¶ Finalize Aergo Standard Token transfer to Ethereum sidechain NOTE anybody can mint so sender is not necessary. The amount to mint is the difference between total deposit and already minted amount. Bridge tempo is taken from config_data
-
mintable_to_aergo
(from_chain: str, to_chain: str, asset_name: str, receiver: str) → Tuple[int, int]¶ Check mintable balance on Aergo.
-
mintable_to_eth
(from_chain: str, to_chain: str, asset_name: str, receiver: str) → Tuple[int, int]¶ Check mintable balance on Ethereum.
-
unfreezable
(from_chain: str, to_chain: str, receiver: str) → Tuple[int, int]¶ Check unfreezable balance on Aergo.
-
unfreeze
(from_chain: str, to_chain: str, receiver: str = None, lock_height: int = 0, privkey_name: str = 'default', privkey_pwd: str = None) → str¶ Finalize ERC20Aergo transfer to Aergo Mainnet by unfreezing (aers are already minted and freezed in the bridge contract)
-
unlock_to_aergo
(from_chain: str, to_chain: str, asset_name: str, receiver: str, burn_height: int = 0, privkey_name: str = 'default', privkey_pwd: str = None) → str¶ Finalize Aergo Standard token transfer back to Aergo Origin
-
unlock_to_eth
(from_chain: str, to_chain: str, asset_name: str, receiver: str = None, burn_height: int = 0, privkey_name: str = 'default', privkey_pwd: str = None) → str¶ Finalize ERC20 or Eth transfer back to Ethereum origin
-
unlockable_to_aergo
(from_chain: str, to_chain: str, asset_name: str, receiver: str) → Tuple[int, int]¶ Check unlockable balance on Aergo.
-
unlockable_to_eth
(from_chain: str, to_chain: str, asset_name: str, receiver: str) → Tuple[int, int]¶ Check unlockable balance on Ethereum.
-
-
ethaergo_wallet.aergo_to_eth.
build_burn_proof
(aergo_from: aergo.herapy.aergo.Aergo, w3: web3.main.Web3, receiver: str, bridge_from: str, bridge_to: str, bridge_to_abi: str, burn_height: int, token_origin: str)¶ Check the last anchored root includes the burn and build a burn proof for that root
-
ethaergo_wallet.aergo_to_eth.
build_lock_proof
(aergo_from: aergo.herapy.aergo.Aergo, w3: web3.main.Web3, receiver: str, bridge_from: str, bridge_to: str, bridge_to_abi: str, lock_height: int, token_origin: str)¶ Check the last anchored root includes the lock and build a lock proof for that root
-
ethaergo_wallet.aergo_to_eth.
burn
(aergo_from: aergo.herapy.aergo.Aergo, bridge_from: str, receiver: str, value: int, token_pegged: str, gas_limit: int, gas_price: int) → Tuple[int, str, aergo.herapy.obj.transaction.Transaction]¶ Burn a minted token on a sidechain.
-
ethaergo_wallet.aergo_to_eth.
freeze
(aergo_from: aergo.herapy.aergo.Aergo, bridge_from: str, receiver: str, value: int, gas_limit: int, gas_price: int) → Tuple[int, str, aergo.herapy.obj.transaction.Transaction]¶ Freeze aergo native
-
ethaergo_wallet.aergo_to_eth.
lock
(aergo_from: aergo.herapy.aergo.Aergo, bridge_from: str, receiver: str, value: int, asset: str, gas_limit: int, gas_price: int) → Tuple[int, str, aergo.herapy.obj.transaction.Transaction]¶ Lock can be called to lock aer or tokens. it supports delegated transfers when tx broadcaster is not the same as the token owner
-
ethaergo_wallet.aergo_to_eth.
mint
(w3: web3.main.Web3, signer_acct, receiver: str, lock_proof: aergo.herapy.obj.sc_state.SCState, token_origin: str, bridge_to: str, bridge_to_abi: str, gas_limit: int, gas_price: int) → Tuple[str, str, web3.datastructures.AttributeDict]¶ Mint the receiver’s deposit balance on aergo_to.
-
ethaergo_wallet.aergo_to_eth.
unlock
(w3: web3.main.Web3, signer_acct, receiver: str, burn_proof: aergo.herapy.obj.sc_state.SCState, token_origin: str, bridge_to: str, bridge_to_abi: str, gas_limit: int, gas_price: int) → Tuple[str, web3.datastructures.AttributeDict]¶ Unlock the receiver’s burnt balance on aergo_to.
-
ethaergo_wallet.eth_to_aergo.
build_burn_proof
(w3: web3.main.Web3, aergo_to: aergo.herapy.aergo.Aergo, receiver: str, bridge_from: str, bridge_to: str, burn_height: int, token_origin: str)¶ Check the last anchored root includes the lock and build a lock proof for that root
-
ethaergo_wallet.eth_to_aergo.
build_lock_proof
(w3: web3.main.Web3, aergo_to: aergo.herapy.aergo.Aergo, receiver: str, bridge_from: str, bridge_to: str, lock_height: int, token_origin: str)¶ Check the last anchored root includes the lock and build a lock proof for that root
-
ethaergo_wallet.eth_to_aergo.
burn
(w3: web3.main.Web3, signer_acct, receiver: str, amount: int, bridge_from: str, bridge_from_abi: str, token_pegged: str, gas_limit: int, gas_price: int) → Tuple[int, str, web3.datastructures.AttributeDict]¶ Burn a token that was minted on ethereum.
-
ethaergo_wallet.eth_to_aergo.
lock
(w3: web3.main.Web3, signer_acct, receiver: str, amount: int, bridge_from: str, bridge_from_abi: str, erc20_address: str, gas_limit: int, gas_price: int, next_nonce: int = None) → Tuple[int, str, web3.datastructures.AttributeDict]¶ Lock an Ethereum ERC20 token.
-
ethaergo_wallet.eth_to_aergo.
mint
(aergo_to: aergo.herapy.aergo.Aergo, receiver: str, lock_proof: web3.datastructures.AttributeDict, token_origin: str, bridge_to: str, gas_limit: int, gas_price: int) → Tuple[str, str, aergo.herapy.obj.transaction.Transaction]¶ Unlock the receiver’s deposit balance on aergo_to.
-
ethaergo_wallet.eth_to_aergo.
unfreeze
(aergo_to: aergo.herapy.aergo.Aergo, receiver: str, lock_proof: web3.datastructures.AttributeDict, bridge_to: str, gas_limit: int, gas_price: int) → Tuple[str, aergo.herapy.obj.transaction.Transaction]¶ Unlock the receiver’s deposit balance on aergo_to.
-
ethaergo_wallet.eth_to_aergo.
unlock
(aergo_to: aergo.herapy.aergo.Aergo, receiver: str, burn_proof: web3.datastructures.AttributeDict, token_origin: str, bridge_to: str, gas_limit: int, gas_price: int) → Tuple[str, aergo.herapy.obj.transaction.Transaction]¶ Unlock the receiver’s deposit balance on aergo_to.
-
ethaergo_wallet.eth_utils.contract_deployer.
deploy_contract
(bytecode: str, abi: str, w3: web3.main.Web3, gas_limit: int, gas_price: int, privkey: bytes, *args)¶ Deploy a new contract to ethereum.
-
ethaergo_wallet.eth_utils.erc20.
increase_approval
(spender: str, asset_addr: str, amount: int, w3: web3.main.Web3, erc20_abi: str, signer_acct, gas_limit: int, gas_price: int) → Tuple[int, str]¶ Increase approval increases the amount of tokens that spender can withdraw. For older tokens without the increaseApproval function in the abi, approval should be set to 0 and then to amount. Newer tokens with increaseAllowance should also be suported