Closed Wangmmx closed 4 months ago
same too,any solutions?
On Kusama the CheckMetadataHash
signed extension was added which acted as a breaking change. Support for it has been added to the api in 11.1.1 - That being said, I have been able to successfully send transactions in Kusama, but I can double check using .sign
Try adding mode: 0
to the signerOptions.
how to adding mode: 0 to the signerOptions?
seems add field metadataHash and mode in payload,but I do not test it .
Yea you just need to add mode: 0
to the signerOptions
which is just a options object at the end of sign
const provider = new WsProvider('wss://kusama-rpc.polkadot.io');
const api = await ApiPromise.create({ provider });
console.log("the address is =========")
console.log(sender.address)
// Estimate the fees as RuntimeDispatchInfo using the signer
const info = await api.tx.balances.transferAllowDeath("F7B8Hd9LrEyeLFdcXnf81NcNH75W4UobQ81viZBVTVFsRhK", 1).signAndSend(sender, {mode:0})
v11.3.1 how does the err resolve
I have no idea why got this error after adding the mode:0 to sign function, at last I solved it without using this sdk, create it offline and sign it in local environment, and also the signerPayload need add {mode:0, metadataHash:''}, and send it online
Or I use the other function can success too, after build the transfer, then
await transfer.signAndSend(pair, {mode: 0}).then(function (ret) {
console.log(ret)
})
ok
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.
I got this error when transfer KSM with the @polkadot/api v11.2.1 lib, and sign with @polkadot/types v11.2.1
And pair can be any random one, I had never got this error before, could you please help me with this? Thanks a lot