Skip to content

Commit af7a352

Browse files
committed
Implicit signer accept more types
1 parent 4ddf8fd commit af7a352

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/wallet/core/src/signers/session/implicit.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
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'
43
import { MemoryPkStore, PkStore } from '../pk/index.js'
4+
import { SignerInterface } from './session.js'
55

66
export type AttestationParams = Omit<Attestation.Attestation, 'approvedSigner'>
77

88
export class Implicit implements SignerInterface {
99
private readonly _privateKey: PkStore
10+
private readonly _identitySignature: SequenceSignature.RSY
1011
public readonly address: Address.Address
1112

1213
constructor(
1314
privateKey: Hex.Hex | PkStore,
1415
private readonly _attestation: Attestation.Attestation,
15-
private readonly _identitySignature: Signature.RSY,
16+
identitySignature: SequenceSignature.RSY | Hex.Hex,
1617
private readonly _sessionManager: Address.Address,
1718
) {
1819
this._privateKey = typeof privateKey === 'string' ? new MemoryPkStore(privateKey) : privateKey
1920
this.address = this._privateKey.address()
2021
if (this._attestation.approvedSigner !== this.address) {
2122
throw new Error('Invalid attestation')
2223
}
24+
this._identitySignature =
25+
typeof identitySignature === 'string' ? Signature.fromHex(identitySignature) : identitySignature
2326
}
2427

2528
get identitySigner(): Address.Address {

0 commit comments

Comments
 (0)