|
1 |
| -import { Attestation, Payload, SessionSignature, Signature } from '@0xsequence/wallet-primitives' |
2 |
| -import { AbiFunction, Address, Bytes, Hex, Provider, Secp256k1 } from 'ox' |
3 |
| -import { SignerInterface } from './session.js' |
| 1 | +import { Attestation, Payload, Signature as SequenceSignature, SessionSignature } from '@0xsequence/wallet-primitives' |
| 2 | +import { AbiFunction, Address, Bytes, Hex, Provider, Secp256k1, Signature } from 'ox' |
4 | 3 | import { MemoryPkStore, PkStore } from '../pk/index.js'
|
| 4 | +import { SignerInterface } from './session.js' |
5 | 5 |
|
6 | 6 | export type AttestationParams = Omit<Attestation.Attestation, 'approvedSigner'>
|
7 | 7 |
|
8 | 8 | export class Implicit implements SignerInterface {
|
9 | 9 | private readonly _privateKey: PkStore
|
| 10 | + private readonly _identitySignature: SequenceSignature.RSY |
10 | 11 | public readonly address: Address.Address
|
11 | 12 |
|
12 | 13 | constructor(
|
13 | 14 | privateKey: Hex.Hex | PkStore,
|
14 | 15 | private readonly _attestation: Attestation.Attestation,
|
15 |
| - private readonly _identitySignature: Signature.RSY, |
| 16 | + identitySignature: SequenceSignature.RSY | Hex.Hex, |
16 | 17 | private readonly _sessionManager: Address.Address,
|
17 | 18 | ) {
|
18 | 19 | this._privateKey = typeof privateKey === 'string' ? new MemoryPkStore(privateKey) : privateKey
|
19 | 20 | this.address = this._privateKey.address()
|
20 | 21 | if (this._attestation.approvedSigner !== this.address) {
|
21 | 22 | throw new Error('Invalid attestation')
|
22 | 23 | }
|
| 24 | + this._identitySignature = |
| 25 | + typeof identitySignature === 'string' ? Signature.fromHex(identitySignature) : identitySignature |
23 | 26 | }
|
24 | 27 |
|
25 | 28 | get identitySigner(): Address.Address {
|
|
0 commit comments