ICX Transfer

For transfering a ICX to a particular wallet address or contract address we will make a transaction using TransactionBuilder()

Here we will be using this to transfer 99 ICX from our deployer wallet to our dice SCORE.

If you don't have enough ICX in your wallet then the transfer will fail. Use ibriz-faucet for getting ICX.

Also use deployer wallet only to make the transfer because fallback method of Dice SCORE only accepts incoming plain ICX from its owner

Execute the cell using Ctrl + Enter to transfer ICX to Dice SCORE.

transaction = TransactionBuilder()\
estimate_step = icon_service.estimate_step(transaction)
step_limit = estimate_step + 100000
# Returns the signed transaction object having a signature
signed_transaction = SignedTransaction(transaction, caller_wallet,step_limit)
# Reads params to transfer to nodes
# Sends the transaction
tx_hash = icon_service.send_transaction(signed_transaction)
@retry(JSONRPCException, tries=10, delay=1, back_off=2)
def get_tx_result(_tx_hash):
tx_result = icon_service.get_transaction_result(_tx_hash)
return tx_result

Execute the cell to get balance of Dice SCORE after transfer

balance = icon_service.get_balance(<YOUR_SCORE_ADDRESS>)