Skip to content

How to calculate the handling fee? #300

Answered by arjanz
Smilestate asked this question in Q&A
Discussion options

You must be logged in to vote

I ran into a problem. When I transferred money, the fee received through get_payment_info was incorrect. How to accurately obtain its handling fee.

I ran a test transfer with the following call:

keypair = Keypair.create_from_uri('//Alice', ss58_format=42)

balance_info = substrate.query(
    module='System',
    storage_function='Account',
    params=[keypair.ss58_address],
)

print('Balance info', balance_info.value)

call = substrate.compose_call(
    call_module='Balances',
    call_function='transfer_keep_alive',
    call_params={
        'dest': keypair.ss58_address,
        'value': 600000000000
    }
)

info = substrate.get_payment_info(call, keypair)
# result: {'class': 'normal'…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by arjanz
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #149 on January 03, 2023 15:06.