@@ -204,7 +204,7 @@ export class PDPAuthHelper {
204204 * ```
205205 */
206206 async signCreateDataSet (
207- clientDataSetId : number | bigint ,
207+ clientDataSetId : bigint ,
208208 payee : string ,
209209 metadata : MetadataEntry [ ] = [ ]
210210 ) : Promise < AuthSignature > {
@@ -226,7 +226,7 @@ export class PDPAuthHelper {
226226 } else {
227227 // Use standard ethers.js signing (for private keys, etc)
228228 const value = {
229- clientDataSetId : BigInt ( clientDataSetId ) ,
229+ clientDataSetId,
230230 metadata,
231231 payee,
232232 }
@@ -241,7 +241,7 @@ export class PDPAuthHelper {
241241
242242 // For EIP-712, signedData contains the actual message hash that was signed
243243 const signedData = ethers . TypedDataEncoder . hash ( this . domain , types , {
244- clientDataSetId : BigInt ( clientDataSetId ) ,
244+ clientDataSetId,
245245 metadata,
246246 payee,
247247 } )
@@ -282,8 +282,8 @@ export class PDPAuthHelper {
282282 * ```
283283 */
284284 async signAddPieces (
285- clientDataSetId : number | bigint ,
286- firstPieceId : number | bigint ,
285+ clientDataSetId : bigint ,
286+ firstPieceId : bigint ,
287287 pieceDataArray : PieceCID [ ] | string [ ] ,
288288 metadata : MetadataEntry [ ] [ ] = [ ]
289289 ) : Promise < AuthSignature > {
@@ -341,8 +341,8 @@ export class PDPAuthHelper {
341341 } else {
342342 // Use standard ethers.js signing with bigint values
343343 const value = {
344- clientDataSetId : BigInt ( clientDataSetId ) ,
345- firstAdded : BigInt ( firstPieceId ) ,
344+ clientDataSetId,
345+ firstAdded : firstPieceId ,
346346 pieceData : formattedPieceData ,
347347 pieceMetadata : pieceMetadata ,
348348 }
@@ -357,8 +357,8 @@ export class PDPAuthHelper {
357357
358358 // For EIP-712, signedData contains the actual message hash that was signed
359359 const signedData = ethers . TypedDataEncoder . hash ( this . domain , types , {
360- clientDataSetId : BigInt ( clientDataSetId ) ,
361- firstAdded : BigInt ( firstPieceId ) ,
360+ clientDataSetId,
361+ firstAdded : firstPieceId ,
362362 pieceData : formattedPieceData ,
363363 pieceMetadata : pieceMetadata ,
364364 } )
@@ -392,13 +392,7 @@ export class PDPAuthHelper {
392392 * )
393393 * ```
394394 */
395- async signSchedulePieceRemovals (
396- clientDataSetId : number | bigint ,
397- pieceIds : Array < number | bigint >
398- ) : Promise < AuthSignature > {
399- // Convert pieceIds to BigInt array for proper encoding
400- const pieceIdsBigInt = pieceIds . map ( ( id ) => BigInt ( id ) )
401-
395+ async signSchedulePieceRemovals ( clientDataSetId : bigint , pieceIds : Array < bigint > ) : Promise < AuthSignature > {
402396 let signature : string
403397
404398 // Check if we should use MetaMask-friendly signing
@@ -408,16 +402,13 @@ export class PDPAuthHelper {
408402 // Use MetaMask-friendly signing for better UX
409403 const value = {
410404 clientDataSetId : clientDataSetId . toString ( ) , // Keep as string for MetaMask display
411- pieceIds : pieceIdsBigInt . map ( ( id ) => id . toString ( ) ) , // Convert to string array for display
405+ pieceIds : pieceIds . map ( ( id ) => id . toString ( ) ) , // Convert to string array for display
412406 }
413407
414408 signature = await this . signWithMetaMask ( { SchedulePieceRemovals : EIP712_TYPES . SchedulePieceRemovals } , value )
415409 } else {
416410 // Use standard ethers.js signing with BigInt values
417- const value = {
418- clientDataSetId : BigInt ( clientDataSetId ) ,
419- pieceIds : pieceIdsBigInt ,
420- }
411+ const value = { clientDataSetId, pieceIds }
421412
422413 // Use underlying signer for typed data signing (handles NonceManager)
423414 const actualSigner = this . getUnderlyingSigner ( )
@@ -434,10 +425,7 @@ export class PDPAuthHelper {
434425 const signedData = ethers . TypedDataEncoder . hash (
435426 this . domain ,
436427 { SchedulePieceRemovals : EIP712_TYPES . SchedulePieceRemovals } ,
437- {
438- clientDataSetId : BigInt ( clientDataSetId ) ,
439- pieceIds : pieceIdsBigInt ,
440- }
428+ { clientDataSetId, pieceIds }
441429 )
442430
443431 return {
@@ -467,7 +455,7 @@ export class PDPAuthHelper {
467455 * )
468456 * ```
469457 */
470- async signDeleteDataSet ( clientDataSetId : number | bigint ) : Promise < AuthSignature > {
458+ async signDeleteDataSet ( clientDataSetId : bigint ) : Promise < AuthSignature > {
471459 let signature : string
472460
473461 // Check if we should use MetaMask-friendly signing
@@ -482,9 +470,7 @@ export class PDPAuthHelper {
482470 signature = await this . signWithMetaMask ( { DeleteDataSet : EIP712_TYPES . DeleteDataSet } , value )
483471 } else {
484472 // Use standard ethers.js signing
485- const value = {
486- clientDataSetId : BigInt ( clientDataSetId ) ,
487- }
473+ const value = { clientDataSetId }
488474
489475 // Use underlying signer for typed data signing (handles NonceManager)
490476 const actualSigner = this . getUnderlyingSigner ( )
@@ -497,9 +483,7 @@ export class PDPAuthHelper {
497483 const signedData = ethers . TypedDataEncoder . hash (
498484 this . domain ,
499485 { DeleteDataSet : EIP712_TYPES . DeleteDataSet } ,
500- {
501- clientDataSetId : BigInt ( clientDataSetId ) ,
502- }
486+ { clientDataSetId }
503487 )
504488
505489 return {
0 commit comments