Closed marvinirwin closed 2 years ago
Hello, First of all, you can use all the features provided by caver-js by installing only one caver-js-ext-kas
.
So there is no need to use caver-js and caver-js-ext-kas at the same time.
Please install and use only caver-js-ext-kas
.
In addition, caver.kas.wallet.migrateAccounts is an API that migrates the account you are using so that it can be used in the KAS Wallet API.
After migration, the private key of the Klaytn account is managed by KAS and not provided to users.
When KAS receives the migration request, it sends an Account Update transaction to the key managed by KAS using the received address and key.
This is why invalid transaction v, r, s values of the sender
error is hannped.
Therefore, the klaytnPrivateKey
passed to the API is used to sign the transaction to update the account key, and klaytnPrivateKey cannot be used after the account key is updated.
Looking at the code you posted, it seems to send a migration request by creating a new key ring to be used in the KAS Wallet API. In this case, you can simply use caver.kas.wallet.createAccount(). Migration is only used when you want to use your existing Klaytn Account through the KAS Wallet API.
If an account has been added to the KAS Wallet API, you can deploy/execute the contract using the KAS Wallet API account by using the caver.contract
provided by caver-js-ext-kas. Please see this documentation for details.
And since this question is an issue of caver-js-ext-kas, not caver-js, please ask additional questions in the relevant repo.
Describe the bug
I can't seem to call
contract.methods.someMethod().send()
orcontract.methods.someMethod().sign()
without getting aninvalid transaction v, r, s values of the sender
error.I made the following script to show an extremely minimal example. It seems like it should let me deploy and interact with the contract, but I it produces the above error.
Expected behavior It should be able to execute the method.