Skip to content

Instantly share code, notes, and snippets.

@miohtama
Created September 14, 2021 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miohtama/f4ec590e96c23ad77bae9f534f6af0f8 to your computer and use it in GitHub Desktop.
Save miohtama/f4ec590e96c23ad77bae9f534f6af0f8 to your computer and use it in GitHub Desktop.
from erdpy.accounts import Account, Address
from erdpy.proxy import ElrondProxy
from erdpy.transactions import BunchOfTransactions
from erdpy.transactions import Transaction
from erdpy.wallet import signing
proxy = ElrondProxy("https://devnet-gateway.elrond.com")
sender = Account(pem_file="test-wallet.pem")
sender.sync_nonce(proxy)
tx = Transaction()
tx.nonce = sender.nonce
tx.value = str(0.05 * 10**18) # 0.05 ERD, as required for issuing a token according to the documentation
tx.sender = sender.address.bech32()
# System contract address to issue out the new token as per
# https://docs.elrond.com/developers/esdt-tokens/#issuance-of-fungible-esdt-tokens
tx.receiver = "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u"
tx.gasPrice = 1000000000
tx.gasLimit = 50000
tx.data = ""
tx.chainID = "D" # For devnet https://devnet-gateway.elrond.com/network/config
tx.version = 1 # No idea where this should come from, because the lack of documentation
tx.signature = signing.sign_transaction(tx, sender)
tx.send(proxy)
# Error
# ProxyRequestError: Proxy request error for url [https://devnet-gateway.elrond.com/transaction/send]: {'data': None, 'error': 'transaction generation failed: invalid value', 'code': 'internal_issue'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment