0

I am trying to initiate a balance transfer call using a proxy with the 'Any' type. I'm using the Python API, which allows me to create and submit the transaction successfully. However, it fails (https://westend.subscan.io/extrinsic/17455468-2). I am able to create the transaction using a wallet for the wallets.

# Compose the transfer call using the balances module
    transfer_call = substrate.compose_call(
        call_module='Balances',
        call_function='transfer',
        call_params={
            'dest': recipient_address,
            'value': transfer_amount,
        },
    )

    # Compose the proxy call to execute the transfer via the proxy
    proxy_call = substrate.compose_call(
        call_module='Proxy',
        call_function='proxy',
        call_params={
            'real': proxy_account,
            'call': transfer_call,
        },
    )

    nonce = substrate.get_account_nonce(keypair.ss58_address)
    signature_payload = substrate.generate_signature_payload(call=call, nonce=nonce)

    signature = keypair.sign(signature_payload)

    extrinsic = substrate.create_signed_extrinsic(
        call=call, keypair=keypair, signature=signature
    )

    print(extrinsic)

    result = substrate.submit_extrinsic(extrinsic=extrinsic, wait_for_finalization=False)

Also, the transaction is listed under the 'Extrinsics' tab in the explorer, rather than the 'Transfers' tab. Any advice on this would be greatly appreciated.

Thank you

1 Answer 1

0

The error is clearly visible here.

If this succeeds, it means you can transfer someone's money without their permission.

enter image description here

You must set up the proxy first. Use proxy.add_proxy.

1
  • Thanks, I realised it later yesterday evening. I was sending the tx as the stash account rather then from the Proxy.
    – slickfive
    Sep 14 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.