We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi I have a problem using ic-py library.
I would like to mint canister tokens and send request similar to
dfx canister --network ${NETWORK} call ${CANISTER_ADDRESS} transfer '(record { memo = 0 : nat64; amount = record { e8s = 100 : nat64 }; fee = record { e8s = 0 : nat64 }; from_subaccount = null; to = '${TOKENS_TRANSFER_ACCOUNT_ID_BYTES}' : vec nat8; created_at_time = null; })'
But I am not sure how to use ic-py params to fulfill my needs. It would be ideal to do something similar to
params = { "memo": 0, "amount": { "e8s": 100 }, "fee": { "e8s": 0 }, "from_subaccount": None, "to": ["${TOKENS_TRANSFER_ACCOUNT_ID_BYTES}"], "created_at_time": None, } result = agent.update_raw("${CANISTER_ADDRESS}", "transfer", encode(params)) print(result)
If you have any idea what approach could I take, please share. Library documentation has only few simple examples and so I couldn't get it done yet
The text was updated successfully, but these errors were encountered:
You need to provide the type structure, like
# transfer 100 token to blackhole address `aaaaa-aa` params = [ {'type': Types.Principal, 'value': 'aaaaa-aa'}, {'type': Types.Nat, 'value': 10000000000} ] result = agent.update_raw("gvbup-jyaaa-aaaah-qcdwa-cai", "transfer", encode(params))
For ur code, set params like this:
params = [{ 'type': Types.Record({ "memo": Types.Nat64, "amont": Types.Record({"e8s": Types.Nat64}), ...... }), 'value': { "memo": 0, "amount": { "e8s": 100 }, "fee": { "e8s": 0 }, "from_subaccount": None, "to": ["${TOKENS_TRANSFER_ACCOUNT_ID_BYTES}"], "created_at_time": [], # None is empty array } }]
Better to use Canister to parse the did file. Pls refer to here
Canister
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Hi I have a problem using ic-py library.
I would like to mint canister tokens and send request similar to
But I am not sure how to use ic-py params to fulfill my needs. It would be ideal to do something similar to
If you have any idea what approach could I take, please share.
Library documentation has only few simple examples and so I couldn't get it done yet
The text was updated successfully, but these errors were encountered: