@@ -72,6 +72,7 @@ export class Contract {
7272 voiceCreditAmount,
7373 circuitType,
7474 preDeactivateRoot,
75+ preDeactivateCoordinator,
7576 oracleWhitelistPubkey,
7677 fee = 'auto' ,
7778 } : CreateAMaciRoundParams & { signer : OfflineSigner } ) {
@@ -90,10 +91,33 @@ export class Contract {
9091 ) ;
9192
9293 preDeactivateRoot = preDeactivateRoot || '0' ;
94+
95+ // Convert preDeactivateCoordinator to {x, y} format if provided
96+ let preDeactivateCoordinatorPubKey : { x : string ; y : string } | undefined =
97+ undefined ;
98+ if ( preDeactivateCoordinator !== undefined ) {
99+ let coordinatorX : bigint ;
100+ let coordinatorY : bigint ;
101+
102+ if ( typeof preDeactivateCoordinator === 'bigint' ) {
103+ // If it's a packed bigint, unpack it
104+ [ coordinatorX , coordinatorY ] = unpackPubKey ( preDeactivateCoordinator ) ;
105+ } else {
106+ // If it's already a PubKey array [x, y]
107+ [ coordinatorX , coordinatorY ] = preDeactivateCoordinator ;
108+ }
109+
110+ preDeactivateCoordinatorPubKey = {
111+ x : coordinatorX . toString ( ) ,
112+ y : coordinatorY . toString ( ) ,
113+ } ;
114+ }
115+
93116 const res = await client . createRound (
94117 {
95118 operator,
96119 preDeactivateRoot,
120+ preDeactivateCoordinator : preDeactivateCoordinatorPubKey ,
97121 voiceCreditAmount,
98122 whitelist,
99123 roundInfo : {
@@ -1513,6 +1537,7 @@ export class Contract {
15131537 whitelist,
15141538 voiceCreditAmount,
15151539 preDeactivateRoot,
1540+ preDeactivateCoordinator,
15161541 oracleWhitelistPubkey,
15171542 circuitType,
15181543 gasStation = false ,
@@ -1527,13 +1552,35 @@ export class Contract {
15271552 contractAddress : this . apiSaasAddress ,
15281553 } ) ;
15291554
1555+ // Convert preDeactivateCoordinator to {x, y} format if provided
1556+ let preDeactivateCoordinatorPubKey : { x : string ; y : string } | undefined =
1557+ undefined ;
1558+ if ( preDeactivateCoordinator !== undefined ) {
1559+ let coordinatorX : bigint ;
1560+ let coordinatorY : bigint ;
1561+
1562+ if ( typeof preDeactivateCoordinator === 'bigint' ) {
1563+ // If it's a packed bigint, unpack it
1564+ [ coordinatorX , coordinatorY ] = unpackPubKey ( preDeactivateCoordinator ) ;
1565+ } else {
1566+ // If it's already a PubKey array [x, y]
1567+ [ coordinatorX , coordinatorY ] = preDeactivateCoordinator ;
1568+ }
1569+
1570+ preDeactivateCoordinatorPubKey = {
1571+ x : coordinatorX . toString ( ) ,
1572+ y : coordinatorY . toString ( ) ,
1573+ } ;
1574+ }
1575+
15301576 const roundParams = {
15311577 certificationSystem : '0' ,
15321578 circuitType : circuitType . toString ( ) ,
15331579 maxVoter : maxVoter . toString ( ) ,
15341580 operator,
15351581 oracleWhitelistPubkey,
15361582 preDeactivateRoot : preDeactivateRoot || '0' ,
1583+ preDeactivateCoordinator : preDeactivateCoordinatorPubKey ,
15371584 roundInfo : {
15381585 title,
15391586 description : description || '' ,
@@ -1562,6 +1609,7 @@ export class Contract {
15621609 operator,
15631610 oracle_whitelist_pubkey : oracleWhitelistPubkey ,
15641611 pre_deactivate_root : preDeactivateRoot || '0' ,
1612+ pre_deactivate_coordinator : preDeactivateCoordinatorPubKey ,
15651613 round_info : roundParams . roundInfo ,
15661614 voice_credit_amount : voiceCreditAmount ,
15671615 vote_option_map : voteOptionMap ,
0 commit comments