Closed narendracode closed 2 years ago
Environment
import Caver from 'caver-js'; const caver = new Caver('...'); const keyring = caver.wallet.keyring.generate()
typescript build error : "Property 'keyring' does not exist on type 'IWallet'."
I find some of the implementation methods are missing in IWallet interface as mentioned in doc here(mentioned here in doc
IWallet
https://github.com/klaytn/caver-js/blob/master/index.js
function Caver(..) { ... this.wallet = new KeyringContainer() }
https://github.com/klaytn/caver-js/blob/master/types/index.d.ts
export default class Caver { ... wallet: IWallet ... }
Solutions : 1.Either IWallet should have all those methods
export class IWallet { generate(num: number): string[] sign(address: string, transaction: Transaction): Promise<Transaction> signAsFeePayer(address: string, transaction: FeeDelegatedTransaction): Promise<FeeDelegatedTransaction> isExisted(address: string): boolean remove(address: string): boolean ... // methods to be added here }
or 2. wallet type requires to be updated as KeyringContainer in Caver class. https://github.com/klaytn/caver-js/blob/master/types/index.d.ts
KeyringContainer
Caver
Looking forward to your update on this issue and I can create PR accordingly.
Hi, Please use latest rc version. I fixed type in there. Please reopen if there is still an issue.
Environment
typescript build error : "Property 'keyring' does not exist on type 'IWallet'."
I find some of the implementation methods are missing in
IWallet
interface as mentioned in doc here(mentioned here in dochttps://github.com/klaytn/caver-js/blob/master/index.js
https://github.com/klaytn/caver-js/blob/master/types/index.d.ts
Solutions : 1.Either IWallet should have all those methods
or 2. wallet type requires to be updated as
KeyringContainer
inCaver
class. https://github.com/klaytn/caver-js/blob/master/types/index.d.tsLooking forward to your update on this issue and I can create PR accordingly.