@@ -59,6 +59,8 @@ export type ManagerOptions = {
5959 guardUrl ?: string
6060 guardAddresses ?: Record < GuardRole , Address . Address >
6161
62+ nonWitnessableSigners ?: Address . Address [ ]
63+
6264 // The default guard topology MUST have a placeholder address for the guard address
6365 defaultGuardTopology ?: Config . Topology
6466 defaultRecoverySettings ?: RecoverySettings
@@ -123,6 +125,8 @@ export const ManagerOptionsDefaults = {
123125 } ,
124126 bundlers : [ ] ,
125127
128+ nonWitnessableSigners : [ ] as Address . Address [ ] ,
129+
126130 guardUrl : 'https://guard.sequence.app' ,
127131 guardAddresses : {
128132 wallet : '0x26f3D30F41FA897309Ae804A2AFf15CEb1dA5742' ,
@@ -183,11 +187,41 @@ export const CreateWalletOptionsDefaults = {
183187}
184188
185189export function applyManagerOptionsDefaults ( options ?: ManagerOptions ) {
186- return {
190+ const merged = {
187191 ...ManagerOptionsDefaults ,
188192 ...options ,
189193 identity : { ...ManagerOptionsDefaults . identity , ...options ?. identity } ,
190194 }
195+
196+ // Merge and normalize non-witnessable signers.
197+ // We always include the sessions extension address for the active extensions set.
198+ const nonWitnessable = new Set < string > ( )
199+ for ( const address of ManagerOptionsDefaults . nonWitnessableSigners ?? [ ] ) {
200+ nonWitnessable . add ( address . toLowerCase ( ) )
201+ }
202+ for ( const address of options ?. nonWitnessableSigners ?? [ ] ) {
203+ nonWitnessable . add ( address . toLowerCase ( ) )
204+ }
205+ nonWitnessable . add ( merged . extensions . sessions . toLowerCase ( ) )
206+
207+ // Include static signer leaves from the guard topology (e.g. recovery guard signer),
208+ // but ignore the placeholder address that is later replaced per-role.
209+ if ( merged . defaultGuardTopology ) {
210+ const guardTopologySigners = Config . getSigners ( merged . defaultGuardTopology )
211+ for ( const signer of guardTopologySigners . signers ) {
212+ if ( Address . isEqual ( signer , Constants . PlaceholderAddress ) ) {
213+ continue
214+ }
215+ nonWitnessable . add ( signer . toLowerCase ( ) )
216+ }
217+ for ( const signer of guardTopologySigners . sapientSigners ) {
218+ nonWitnessable . add ( signer . address . toLowerCase ( ) )
219+ }
220+ }
221+
222+ merged . nonWitnessableSigners = Array . from ( nonWitnessable ) as Address . Address [ ]
223+
224+ return merged
191225}
192226
193227export type RecoverySettings = {
@@ -221,6 +255,8 @@ export type Sequence = {
221255 readonly relayers : Relayer . Relayer [ ]
222256 readonly bundlers : Bundler . Bundler [ ]
223257
258+ readonly nonWitnessableSigners : ReadonlySet < Address . Address >
259+
224260 readonly defaultGuardTopology : Config . Topology
225261 readonly defaultRecoverySettings : RecoverySettings
226262
@@ -408,6 +444,10 @@ export class Manager {
408444 relayers,
409445 bundlers : ops . bundlers ,
410446
447+ nonWitnessableSigners : new Set (
448+ ( ops . nonWitnessableSigners ?? [ ] ) . map ( ( address ) => address . toLowerCase ( ) as Address . Address ) ,
449+ ) ,
450+
411451 defaultGuardTopology : ops . defaultGuardTopology ,
412452 defaultRecoverySettings : ops . defaultRecoverySettings ,
413453
0 commit comments