Open hitchhooker opened 2 years ago
Ummm... it checks against what is on-chain in the metadata, so assuming you connected to a proxy-capable chain, it should just work. https://github.com/polkadot-js/tools/blob/master/packages/api-cli/src/api.ts#L188
Will try and see if I can reproduce on something like Kusama/Polkadot with proxies.
It indeed works as expected, i.e. tx.proxy.proxy ... args goes here...
assuming the chain you are connected to has the proxy pallet. (Tested against both Kusama and Polkadot)
Which chain did you try it on?
Having said all that - the nested calls (same would be the case with batch) as an issue. An example is the tx.sudo.*
family that has a specific override, e.g. https://github.com/polkadot-js/tools/blob/master/packages/api-cli/src/api.ts#L138-L141 performs the wrapping.
So although it has nothing to do with your specific question (well, it is related, aka it won't work), stuff like tx.{batch, proxy, sudo}.*
should actually be detected and allow wrapping, aka the CLI should know that subsequent tx.<somewhere>.<something>
is a wrapped call (instead of the case with sudo where a specific flag is passed)
TL;DR Your chain may not expose tx.proxy
, but as it stands it would need a lot more introspection to properly support it.
Thanks for taking time to provide support. I tried to do Kusama Democracy votes. I will post you the complete logs, perhaps it was something else wrong in transaction. Error messaging of the api-cli seems a bit tricky to understand for me still. tx im looking to do is something like this to be able to vote using my mobile phone.
polkadot-js-api tx.proxy.proxy [ "real":"0xStashWallet", "force_proxy_type":null, "call":{ "args": { "vote": { "standard": { "vote": "0x80", "balance": 10000000000000 } }, "ref_index": 168 }, "callIndex": "0x0d02" } ] --seed "seed words"
polkadot-js-api tx.proxy.proxy [ "0xStashWallet", null, { "args": { "vote": { "standard": { "vote": "0x80", "balance": 10000000000000 } }, "ref_index": 168 }, "callIndex": "0x0d02" } ] --seed "0xPrivateKeyOfProxyWallet"
polkadot-js-api tx.proxy.proxy real:'StashWalletAddress',force_proxy_type:"Governance",call:{"args":{"ref_index":"170","vote":{"Standard":{"vote":{"conviction":"None","vote":"Aye"},"balance":1000000000000}}},"method":"vote","section":"democracy"} --seed "0xPrivateKeyOfProxy"
Error: Extrinsic proxy.proxy expects 3 arguments, got 6.
So polkadot-js-extension wallet generates following extrinsics as argument contents, but api support only 3 arguments.
I am a bit lost how should I generate this call data args correctly to be supported by api-cli?
is there cli tooling for calculating call hash data out of the call( call:{"args":{"ref_index":"170","vote":{"Standard":{"vote":{"conviction":"None","vote":"Aye"},"balance":1000000000000}}},"method":"vote","section":"democracy"}
)?
Receiving error when trying to commit tx.proxy commands using api-cli.