import { SignerResult } from '@polkadot/api/types' ; import type { SignOptions } from '@polkadot/keyring/types' ; import { SignerPayloadJSON } from '@polkadot/types/types' ; import type { LocalKeyringPair , ApiPromise , Signer as ISigner } from '../types' ; import { Signer as AccountSigner } from './account-signer' ; /**
 * A wrapper for Keyringpair
 */ export class Signer implements ISigner { param pair param api constructor ( public pair , public readonly accountSigner ) { } description get address ( ) { return this . pair . address ; } description get addressRaw ( ) { return this . pair . addressRaw ; } description get publicKey ( ) { return this . pair . publicKey ; } description public sign ( data , options ? ) { return this . pair . sign ( data , options ) ; } param payload returns public async signPayload ( payload ) { return this . accountSigner . signPayload ( payload ) ; } returns public async getAddress ( ) { return Promise . resolve ( this . pair . address ) ; } public setKeyPair ( pair ) { this . pair = pair ; } }