Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata.
Apache License 2.0
1.07k
stars
349
forks
source link
Ensure signAsync and dryRun is fully compatible with signedTransaction, and add `withSignedTransaction` option #5920
Add an option withSignedTranscation that enables the use of signedTransaction.
Add signedTransaction support for signAsync, and dryRun.
withSignedTransaction
This option has been added to SignerOptions. When using signAndSend or signAsync you may now enable or disable the use of signedTransaction by adding withSignedTransaction. When withSignedTransaction is not enabled but the signer adds a signedTransaction the api will error.
signAsync
signAsync now accepts signedTransaction as well. This means that if withSignedTransaction is enabled, and signedTransaction is present the api will adjust the current payload attached to the SubmittableExtrinsic, and add the signature. Then the user can call .send() as they please.
NOTE: With the previous PR linked above signAsync broke for certain cases, therefore the functionality needed to be extended to it.
dryRun
All steps will be the same as signAsync with the exception that .send() has never needed to be called.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Summary
To ensure https://github.com/polkadot-js/api/pull/5914 does not break all dApps we have done a few things in this PR. I will list them out, then work through each change.
withSignedTranscation
that enables the use ofsignedTransaction
.signedTransaction
support forsignAsync
, anddryRun
.withSignedTransaction
This option has been added to
SignerOptions
. When usingsignAndSend
orsignAsync
you may now enable or disable the use ofsignedTransaction
by addingwithSignedTransaction
. WhenwithSignedTransaction
is not enabled but the signer adds asignedTransaction
the api will error.signAsync
signAsync
now acceptssignedTransaction
as well. This means that ifwithSignedTransaction
is enabled, andsignedTransaction
is present the api will adjust the current payload attached to theSubmittableExtrinsic
, and add the signature. Then the user can call.send()
as they please.NOTE: With the previous PR linked above signAsync broke for certain cases, therefore the functionality needed to be extended to it.
dryRun
All steps will be the same as
signAsync
with the exception that.send()
has never needed to be called.