@pafi-dev/core 0.3.0-beta.3 → 0.3.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/abi/index.cjs +2 -6
  2. package/dist/abi/index.cjs.map +1 -1
  3. package/dist/abi/index.d.cts +1 -286
  4. package/dist/abi/index.d.ts +1 -286
  5. package/dist/abi/index.js +1 -5
  6. package/dist/{chunk-R4L66ZR5.js → chunk-73CQTNLB.js} +10 -1
  7. package/dist/chunk-73CQTNLB.js.map +1 -0
  8. package/dist/{chunk-5YH4D7QF.js → chunk-7UBO7DY5.js} +1 -1
  9. package/dist/{chunk-FGKLDKJK.cjs → chunk-ALCWYDVG.cjs} +1 -1
  10. package/dist/{chunk-FGKLDKJK.cjs.map → chunk-ALCWYDVG.cjs.map} +1 -1
  11. package/dist/{chunk-X3I5XWAR.cjs → chunk-CQCSQPWG.cjs} +2 -15
  12. package/dist/chunk-CQCSQPWG.cjs.map +1 -0
  13. package/dist/{chunk-CWP4PFOP.cjs → chunk-DMW67WBU.cjs} +11 -2
  14. package/dist/chunk-DMW67WBU.cjs.map +1 -0
  15. package/dist/{chunk-C4ZDYG4D.js → chunk-DUY7Z2AI.js} +48 -6
  16. package/dist/chunk-DUY7Z2AI.js.map +1 -0
  17. package/dist/{chunk-CXFUP2YK.cjs → chunk-EDR5SFJN.cjs} +46 -6
  18. package/dist/chunk-EDR5SFJN.cjs.map +1 -0
  19. package/dist/{chunk-FIKTQR7H.js → chunk-I2P3TIP7.js} +2 -2
  20. package/dist/{chunk-BNTVOKYT.cjs → chunk-KJKDLD7N.cjs} +51 -9
  21. package/dist/chunk-KJKDLD7N.cjs.map +1 -0
  22. package/dist/{chunk-VQSRCMMK.js → chunk-QGO6X6LG.js} +2 -15
  23. package/dist/chunk-QGO6X6LG.js.map +1 -0
  24. package/dist/{chunk-IK4UK7KT.js → chunk-W23EJNYG.js} +44 -4
  25. package/dist/chunk-W23EJNYG.js.map +1 -0
  26. package/dist/{chunk-CAE2BVKI.cjs → chunk-Z2V525IS.cjs} +6 -6
  27. package/dist/{chunk-CAE2BVKI.cjs.map → chunk-Z2V525IS.cjs.map} +1 -1
  28. package/dist/contract/index.cjs +2 -5
  29. package/dist/contract/index.cjs.map +1 -1
  30. package/dist/contract/index.d.cts +2 -4
  31. package/dist/contract/index.d.ts +2 -4
  32. package/dist/contract/index.js +1 -4
  33. package/dist/eip712/index.cjs +9 -3
  34. package/dist/eip712/index.cjs.map +1 -1
  35. package/dist/eip712/index.d.cts +44 -2
  36. package/dist/eip712/index.d.ts +44 -2
  37. package/dist/eip712/index.js +8 -2
  38. package/dist/{index-CNALKsH1.d.ts → index-B06IJlHe.d.ts} +1 -1
  39. package/dist/{index-BpUYHGu3.d.cts → index-B7pGBych.d.cts} +1 -1
  40. package/dist/index.cjs +106 -200
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +370 -258
  43. package/dist/index.d.ts +370 -258
  44. package/dist/index.js +104 -198
  45. package/dist/index.js.map +1 -1
  46. package/dist/quoting/index.cjs +3 -3
  47. package/dist/quoting/index.d.cts +1 -1
  48. package/dist/quoting/index.d.ts +1 -1
  49. package/dist/quoting/index.js +2 -2
  50. package/dist/swap/index.cjs +2 -3
  51. package/dist/swap/index.cjs.map +1 -1
  52. package/dist/swap/index.d.cts +2 -2
  53. package/dist/swap/index.d.ts +2 -2
  54. package/dist/swap/index.js +1 -2
  55. package/dist/{types-BDOnH5Le.d.cts → types-b5_Tokjl.d.cts} +8 -17
  56. package/dist/{types-BDOnH5Le.d.ts → types-b5_Tokjl.d.ts} +8 -17
  57. package/package.json +1 -1
  58. package/dist/chunk-27V32VNM.cjs +0 -370
  59. package/dist/chunk-27V32VNM.cjs.map +0 -1
  60. package/dist/chunk-4RYBJLF3.js +0 -370
  61. package/dist/chunk-4RYBJLF3.js.map +0 -1
  62. package/dist/chunk-5QJZT7VB.cjs +0 -46
  63. package/dist/chunk-5QJZT7VB.cjs.map +0 -1
  64. package/dist/chunk-BNTVOKYT.cjs.map +0 -1
  65. package/dist/chunk-C4ZDYG4D.js.map +0 -1
  66. package/dist/chunk-CWP4PFOP.cjs.map +0 -1
  67. package/dist/chunk-CXFUP2YK.cjs.map +0 -1
  68. package/dist/chunk-IK4UK7KT.js.map +0 -1
  69. package/dist/chunk-L74CZAVQ.cjs +0 -99
  70. package/dist/chunk-L74CZAVQ.cjs.map +0 -1
  71. package/dist/chunk-P56TUGTS.js +0 -46
  72. package/dist/chunk-P56TUGTS.js.map +0 -1
  73. package/dist/chunk-R4L66ZR5.js.map +0 -1
  74. package/dist/chunk-VQSRCMMK.js.map +0 -1
  75. package/dist/chunk-X3I5XWAR.cjs.map +0 -1
  76. package/dist/chunk-X4IXUTTD.js +0 -99
  77. package/dist/chunk-X4IXUTTD.js.map +0 -1
  78. package/dist/relay/index.cjs +0 -19
  79. package/dist/relay/index.cjs.map +0 -1
  80. package/dist/relay/index.d.cts +0 -75
  81. package/dist/relay/index.d.ts +0 -75
  82. package/dist/relay/index.js +0 -19
  83. package/dist/relay/index.js.map +0 -1
  84. /package/dist/{chunk-5YH4D7QF.js.map → chunk-7UBO7DY5.js.map} +0 -0
  85. /package/dist/{chunk-FIKTQR7H.js.map → chunk-I2P3TIP7.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,14 +1,12 @@
1
1
  import { Address, Hex, PublicClient, WalletClient } from 'viem';
2
- import { P as PoolKey, C as ChainConfig, a as PointTokenDomainConfig, E as EIP712Signature, S as SignatureVerification, b as PafiSDKConfig, M as MintRequest, R as ReceiverConsent, c as MintParams, d as SwapParams, B as BestQuote, Q as QuoteResult, e as PathKey } from './types-BDOnH5Le.js';
3
- export { I as Issuer } from './types-BDOnH5Le.js';
4
- export { erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, relayAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.js';
5
- export { buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signMintRequest, signReceiverConsent, verifyMintRequest, verifyReceiverConsent } from './eip712/index.js';
6
- import { SimulationResult } from './relay/index.js';
7
- export { buildRelaySwapParams, decodeExtData, decodeMintAndSwap, encodeExtData, encodeMintAndSwap, simulateMintAndSwap } from './relay/index.js';
8
- export { getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, getUsdt, isActiveIssuer, isMinter, verifyMintCap } from './contract/index.js';
2
+ import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification, B as BestQuote, Q as QuoteResult } from './types-b5_Tokjl.js';
3
+ export { c as BurnRequest, I as Issuer, d as PathKey } from './types-b5_Tokjl.js';
4
+ export { erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.js';
5
+ export { buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.js';
6
+ export { getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, verifyMintCap } from './contract/index.js';
9
7
  export { buildAllPaths, combineRoutes, findBestQuote, quoteBestRoute, quoteExactInput, quoteExactInputSingle } from './quoting/index.js';
10
- import { O as Operation, P as PartialUserOperation, U as UserOperation, S as SwapSimulationResult } from './index-CNALKsH1.js';
11
- export { B as BuildSwapWithGasDeductionParams, E as ENTRY_POINT_V07, a as PaymasterFields, b as SETTLE_ALL, c as SWAP_EXACT_IN, T as TAKE_ALL, d as UserOpReceipt, V as V4_SWAP, Z as ZERO_VALUE, e as buildErc20ApprovalCalldata, f as buildPermit2ApprovalCalldata, g as buildSwapFromQuote, h as buildSwapWithGasDeduction, i as buildUniversalRouterExecuteArgs, j as buildV4SwapInput, k as checkAllowance, s as simulateSwap } from './index-CNALKsH1.js';
8
+ import { O as Operation, P as PartialUserOperation, U as UserOperation, S as SwapSimulationResult } from './index-B06IJlHe.js';
9
+ export { B as BuildSwapWithGasDeductionParams, E as ENTRY_POINT_V07, a as PaymasterFields, b as SETTLE_ALL, c as SWAP_EXACT_IN, T as TAKE_ALL, d as UserOpReceipt, V as V4_SWAP, Z as ZERO_VALUE, e as buildErc20ApprovalCalldata, f as buildPermit2ApprovalCalldata, g as buildSwapFromQuote, h as buildSwapWithGasDeduction, i as buildUniversalRouterExecuteArgs, j as buildV4SwapInput, k as checkAllowance, s as simulateSwap } from './index-B06IJlHe.js';
12
10
  import { LoginMessageParams } from './auth/index.js';
13
11
  export { VerifyLoginResult, createLoginMessage, parseLoginMessage, verifyLoginMessage } from './auth/index.js';
14
12
 
@@ -27,6 +25,21 @@ declare const mintRequestTypes: {
27
25
  readonly type: "uint256";
28
26
  }];
29
27
  };
28
+ declare const burnRequestTypes: {
29
+ readonly BurnRequest: readonly [{
30
+ readonly name: "from";
31
+ readonly type: "address";
32
+ }, {
33
+ readonly name: "amount";
34
+ readonly type: "uint256";
35
+ }, {
36
+ readonly name: "nonce";
37
+ readonly type: "uint256";
38
+ }, {
39
+ readonly name: "deadline";
40
+ readonly type: "uint256";
41
+ }];
42
+ };
30
43
  declare const receiverConsentTypes: {
31
44
  readonly ReceiverConsent: readonly [{
32
45
  readonly name: "onBehalfOf";
@@ -276,122 +289,286 @@ interface CheckEthAndBranchParams {
276
289
  declare function checkEthAndBranch(params: CheckEthAndBranchParams): Promise<SubmissionPath>;
277
290
 
278
291
  /**
279
- * ⚠️ MOCK — `PointToken` v1.4 surface (mint + burn).
292
+ * Real `PointToken` ABI matches the contract deployed on Base mainnet
293
+ * (POINT at `0x7d25E7156E51F865D522fd3ef257a6B5DD41b97e`). Sourced from
294
+ * the Solidity contract shipped by the SC team 2026-04-21.
295
+ *
296
+ * ## Mint — two paths
280
297
  *
281
- * ## Mint (NEW direct flow — no Relayer)
298
+ * Path 1 Direct (whitelisted minter):
299
+ * mint(address to, uint256 amount)
300
+ * - msg.sender must be in minters[]
301
+ * - Used by off-chain services that hold a minter key
282
302
  *
283
- * In v1.4 the user calls `PointToken.mint()` directly via an EIP-7702
284
- * delegated UserOp `msg.sender == user`. The contract checks the
285
- * caller is on its authorized minter allowlist. **No Relayer contract,
286
- * no MintRequest EIP-712 signature.** Backend (gg56) only validates
287
- * off-chain (balance, policy, KYC) before returning the unsigned UserOp.
303
+ * Path 2 — Sig-gated (gasless, v1.4 sponsored flow):
304
+ * mint(address to, uint256 amount, uint256 deadline, bytes minterSig)
305
+ * - msg.sender MUST equal `to` (the receiver)
306
+ * - minterSig is an EIP-712 MintRequest signature from a whitelisted minter
307
+ * - Consumes `mintRequestNonces[to]`
308
+ * - This is the path v1.4 uses: issuer backend signs, user submits
309
+ * via EIP-7702 + Coinbase Paymaster
288
310
  *
289
- * The mock signature `mint(uint256 amount)` mints to `msg.sender`.
290
- * SC team confirmation pending — they may pick `mint(address to,
291
- * uint256 amount)` instead. Either is a 1-line ABI change here.
311
+ * ## Burn mirror structure
292
312
  *
293
- * ## Burntwo variants mocked
313
+ * Path 1: burn(address from, uint256 amount) whitelisted burner
314
+ * Path 2: burn(address from, uint256 amount, uint256 deadline, bytes burnerSig)
315
+ * — msg.sender must equal `from`, burnerSig from whitelisted burner,
316
+ * consumes `burnRequestNonces[from]`
294
317
  *
295
- * Variant A (simpler, most likely):
296
- * burn(uint256 amount)
297
- * - burns from `msg.sender` (user via EIP-7702)
318
+ * Either burn path emits `Transfer(from 0x0)` so BurnIndexer semantics
319
+ * don't depend on which path was taken.
298
320
  *
299
- * Variant B (signature-based, if SC prefers explicit on-chain consent):
300
- * burnWithSig(BurnConsent consent, Signature sig)
301
- * - verifies EIP-712 signature before burning
321
+ * ## EIP-712 type hashes (from contract source)
302
322
  *
303
- * Either way the ERC-20 emits `Transfer(from, address(0), amount)` so
304
- * `BurnIndexer` semantics don't change.
323
+ * MintRequest(address to,uint256 amount,uint256 nonce,uint256 deadline)
324
+ * BurnRequest(address from,uint256 amount,uint256 nonce,uint256 deadline)
325
+ *
326
+ * Domain: EIP-712 standard — name = ERC-20 token name, version = "1",
327
+ * chainId, verifyingContract = this PointToken address.
305
328
  */
306
- declare const MOCK_POINT_TOKEN_V2_ABI: readonly [{
329
+ declare const POINT_TOKEN_ABI: readonly [{
307
330
  readonly name: "mint";
308
331
  readonly type: "function";
309
332
  readonly stateMutability: "nonpayable";
310
333
  readonly inputs: readonly [{
334
+ readonly type: "address";
335
+ readonly name: "to";
336
+ }, {
337
+ readonly type: "uint256";
338
+ readonly name: "amount";
339
+ }];
340
+ readonly outputs: readonly [];
341
+ }, {
342
+ readonly name: "mint";
343
+ readonly type: "function";
344
+ readonly stateMutability: "nonpayable";
345
+ readonly inputs: readonly [{
346
+ readonly type: "address";
347
+ readonly name: "to";
348
+ }, {
349
+ readonly type: "uint256";
350
+ readonly name: "amount";
351
+ }, {
352
+ readonly type: "uint256";
353
+ readonly name: "deadline";
354
+ }, {
355
+ readonly type: "bytes";
356
+ readonly name: "minterSig";
357
+ }];
358
+ readonly outputs: readonly [];
359
+ }, {
360
+ readonly name: "burn";
361
+ readonly type: "function";
362
+ readonly stateMutability: "nonpayable";
363
+ readonly inputs: readonly [{
364
+ readonly type: "address";
365
+ readonly name: "from";
366
+ }, {
311
367
  readonly type: "uint256";
312
368
  readonly name: "amount";
313
369
  }];
314
370
  readonly outputs: readonly [];
371
+ }, {
372
+ readonly name: "burn";
373
+ readonly type: "function";
374
+ readonly stateMutability: "nonpayable";
375
+ readonly inputs: readonly [{
376
+ readonly type: "address";
377
+ readonly name: "from";
378
+ }, {
379
+ readonly type: "uint256";
380
+ readonly name: "amount";
381
+ }, {
382
+ readonly type: "uint256";
383
+ readonly name: "deadline";
384
+ }, {
385
+ readonly type: "bytes";
386
+ readonly name: "burnerSig";
387
+ }];
388
+ readonly outputs: readonly [];
315
389
  }, {
316
390
  readonly name: "minters";
317
391
  readonly type: "function";
318
392
  readonly stateMutability: "view";
319
393
  readonly inputs: readonly [{
320
394
  readonly type: "address";
321
- readonly name: "user";
395
+ readonly name: "account";
322
396
  }];
323
397
  readonly outputs: readonly [{
324
398
  readonly type: "bool";
325
399
  }];
326
400
  }, {
327
- readonly name: "burn";
401
+ readonly name: "burners";
402
+ readonly type: "function";
403
+ readonly stateMutability: "view";
404
+ readonly inputs: readonly [{
405
+ readonly type: "address";
406
+ readonly name: "account";
407
+ }];
408
+ readonly outputs: readonly [{
409
+ readonly type: "bool";
410
+ }];
411
+ }, {
412
+ readonly name: "addMinter";
328
413
  readonly type: "function";
329
414
  readonly stateMutability: "nonpayable";
330
415
  readonly inputs: readonly [{
331
- readonly type: "uint256";
332
- readonly name: "amount";
416
+ readonly type: "address";
417
+ readonly name: "minter";
333
418
  }];
334
419
  readonly outputs: readonly [];
335
420
  }, {
336
- readonly name: "burnWithSig";
421
+ readonly name: "removeMinter";
337
422
  readonly type: "function";
338
423
  readonly stateMutability: "nonpayable";
339
424
  readonly inputs: readonly [{
340
- readonly type: "tuple";
341
- readonly components: readonly [{
342
- readonly type: "address";
343
- readonly name: "user";
344
- }, {
345
- readonly type: "address";
346
- readonly name: "pointToken";
347
- }, {
348
- readonly type: "uint256";
349
- readonly name: "amount";
350
- }, {
351
- readonly type: "uint256";
352
- readonly name: "nonce";
353
- }, {
354
- readonly type: "uint256";
355
- readonly name: "deadline";
356
- }];
357
- readonly name: "consent";
358
- }, {
359
- readonly type: "tuple";
360
- readonly components: readonly [{
361
- readonly type: "uint8";
362
- readonly name: "v";
363
- }, {
364
- readonly type: "bytes32";
365
- readonly name: "r";
366
- }, {
367
- readonly type: "bytes32";
368
- readonly name: "s";
369
- }];
370
- readonly name: "sig";
425
+ readonly type: "address";
426
+ readonly name: "minter";
371
427
  }];
372
428
  readonly outputs: readonly [];
373
429
  }, {
374
- readonly name: "balanceOf";
430
+ readonly name: "addBurner";
431
+ readonly type: "function";
432
+ readonly stateMutability: "nonpayable";
433
+ readonly inputs: readonly [{
434
+ readonly type: "address";
435
+ readonly name: "burner";
436
+ }];
437
+ readonly outputs: readonly [];
438
+ }, {
439
+ readonly name: "removeBurner";
440
+ readonly type: "function";
441
+ readonly stateMutability: "nonpayable";
442
+ readonly inputs: readonly [{
443
+ readonly type: "address";
444
+ readonly name: "burner";
445
+ }];
446
+ readonly outputs: readonly [];
447
+ }, {
448
+ readonly name: "mintRequestNonces";
375
449
  readonly type: "function";
376
450
  readonly stateMutability: "view";
377
451
  readonly inputs: readonly [{
378
452
  readonly type: "address";
379
- readonly name: "user";
453
+ readonly name: "receiver";
380
454
  }];
381
455
  readonly outputs: readonly [{
382
456
  readonly type: "uint256";
383
457
  }];
384
458
  }, {
385
- readonly name: "burnNonce";
459
+ readonly name: "burnRequestNonces";
460
+ readonly type: "function";
461
+ readonly stateMutability: "view";
462
+ readonly inputs: readonly [{
463
+ readonly type: "address";
464
+ readonly name: "from";
465
+ }];
466
+ readonly outputs: readonly [{
467
+ readonly type: "uint256";
468
+ }];
469
+ }, {
470
+ readonly name: "mintingOracle";
471
+ readonly type: "function";
472
+ readonly stateMutability: "view";
473
+ readonly inputs: readonly [];
474
+ readonly outputs: readonly [{
475
+ readonly type: "address";
476
+ }];
477
+ }, {
478
+ readonly name: "setMintingOracle";
479
+ readonly type: "function";
480
+ readonly stateMutability: "nonpayable";
481
+ readonly inputs: readonly [{
482
+ readonly type: "address";
483
+ readonly name: "_mintingOracle";
484
+ }];
485
+ readonly outputs: readonly [];
486
+ }, {
487
+ readonly name: "issuer";
488
+ readonly type: "function";
489
+ readonly stateMutability: "view";
490
+ readonly inputs: readonly [];
491
+ readonly outputs: readonly [{
492
+ readonly type: "address";
493
+ }];
494
+ }, {
495
+ readonly name: "balanceOf";
386
496
  readonly type: "function";
387
497
  readonly stateMutability: "view";
388
498
  readonly inputs: readonly [{
389
499
  readonly type: "address";
390
- readonly name: "user";
500
+ readonly name: "account";
391
501
  }];
392
502
  readonly outputs: readonly [{
393
503
  readonly type: "uint256";
394
504
  }];
505
+ }, {
506
+ readonly name: "totalSupply";
507
+ readonly type: "function";
508
+ readonly stateMutability: "view";
509
+ readonly inputs: readonly [];
510
+ readonly outputs: readonly [{
511
+ readonly type: "uint256";
512
+ }];
513
+ }, {
514
+ readonly name: "name";
515
+ readonly type: "function";
516
+ readonly stateMutability: "view";
517
+ readonly inputs: readonly [];
518
+ readonly outputs: readonly [{
519
+ readonly type: "string";
520
+ }];
521
+ }, {
522
+ readonly name: "symbol";
523
+ readonly type: "function";
524
+ readonly stateMutability: "view";
525
+ readonly inputs: readonly [];
526
+ readonly outputs: readonly [{
527
+ readonly type: "string";
528
+ }];
529
+ }, {
530
+ readonly name: "decimals";
531
+ readonly type: "function";
532
+ readonly stateMutability: "view";
533
+ readonly inputs: readonly [];
534
+ readonly outputs: readonly [{
535
+ readonly type: "uint8";
536
+ }];
537
+ }, {
538
+ readonly name: "DOMAIN_SEPARATOR";
539
+ readonly type: "function";
540
+ readonly stateMutability: "view";
541
+ readonly inputs: readonly [];
542
+ readonly outputs: readonly [{
543
+ readonly type: "bytes32";
544
+ }];
545
+ }, {
546
+ readonly name: "eip712Domain";
547
+ readonly type: "function";
548
+ readonly stateMutability: "view";
549
+ readonly inputs: readonly [];
550
+ readonly outputs: readonly [{
551
+ readonly type: "bytes1";
552
+ readonly name: "fields";
553
+ }, {
554
+ readonly type: "string";
555
+ readonly name: "name";
556
+ }, {
557
+ readonly type: "string";
558
+ readonly name: "version";
559
+ }, {
560
+ readonly type: "uint256";
561
+ readonly name: "chainId";
562
+ }, {
563
+ readonly type: "address";
564
+ readonly name: "verifyingContract";
565
+ }, {
566
+ readonly type: "bytes32";
567
+ readonly name: "salt";
568
+ }, {
569
+ readonly type: "uint256[]";
570
+ readonly name: "extensions";
571
+ }];
395
572
  }, {
396
573
  readonly name: "Transfer";
397
574
  readonly type: "event";
@@ -407,54 +584,99 @@ declare const MOCK_POINT_TOKEN_V2_ABI: readonly [{
407
584
  readonly type: "uint256";
408
585
  readonly name: "value";
409
586
  }];
587
+ }, {
588
+ readonly name: "MinterAdded";
589
+ readonly type: "event";
590
+ readonly inputs: readonly [{
591
+ readonly type: "address";
592
+ readonly name: "minter";
593
+ readonly indexed: true;
594
+ }];
595
+ }, {
596
+ readonly name: "MinterRemoved";
597
+ readonly type: "event";
598
+ readonly inputs: readonly [{
599
+ readonly type: "address";
600
+ readonly name: "minter";
601
+ readonly indexed: true;
602
+ }];
603
+ }, {
604
+ readonly name: "BurnerAdded";
605
+ readonly type: "event";
606
+ readonly inputs: readonly [{
607
+ readonly type: "address";
608
+ readonly name: "burner";
609
+ readonly indexed: true;
610
+ }];
611
+ }, {
612
+ readonly name: "BurnerRemoved";
613
+ readonly type: "event";
614
+ readonly inputs: readonly [{
615
+ readonly type: "address";
616
+ readonly name: "burner";
617
+ readonly indexed: true;
618
+ }];
619
+ }, {
620
+ readonly name: "MintingOracleUpdated";
621
+ readonly type: "event";
622
+ readonly inputs: readonly [{
623
+ readonly type: "address";
624
+ readonly name: "mintingOracle";
625
+ readonly indexed: true;
626
+ }];
410
627
  }];
411
628
 
412
629
  /**
413
- * ⚠️ MOCK placeholder BatchExecutor address.
630
+ * BatchExecutor delegation target addresses.
631
+ *
632
+ * ## Status
414
633
  *
415
- * Real deployment:
416
- * - Coinbase may pre-deploy a canonical BatchExecutor that we target
417
- * via EIP-7702 delegation (see blocker B2 in V1.4_V1.5_READINESS.md)
418
- * - Otherwise PAFI deploys a minimal one and publishes the address
634
+ * Per-chain addresses are **still placeholder** (`0x...DE01` / `DE02`)
635
+ * pending the SC team's Phase B delivery. When Coinbase publishes a
636
+ * canonical BatchExecutor, or PAFI deploys its own and publishes the
637
+ * address, swap the constants below callers already import from here
638
+ * so no wiring changes.
419
639
  *
420
- * The ABI itself (`execute(Call[])`) is stable and lives under
421
- * `../../userop/batchExecute.ts` that's the real one, unchanged
422
- * by the mock swap. Only the **address** is mocked here.
640
+ * The ABI (`execute(Call[])`) itself is real and stable — it lives
641
+ * under `../../userop/batchExecute.ts` and is re-exported below so
642
+ * consumers can grab both ABI + address from one import path.
423
643
  *
424
- * Pattern: checksum address with hex "DEAD0001" suffix per chain so
425
- * it's obvious in logs which chain is using a mock.
644
+ * ## Why checksum with DEAD0001 / DEAD0002 suffix
645
+ *
646
+ * The placeholder pattern makes the fact-of-mockness obvious in logs
647
+ * and block explorers. A request targeting `0x...DE01` is impossible
648
+ * to confuse with a production contract.
426
649
  */
427
- declare const MOCK_BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA: Address;
428
- declare const MOCK_BATCH_EXECUTOR_ADDRESS_BASE_MAINNET: Address;
650
+ declare const BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA: Address;
651
+ declare const BATCH_EXECUTOR_ADDRESS_BASE_MAINNET: Address;
429
652
 
430
653
  /**
431
- * ⚠️ MOCK — per-chain contract addresses for the v1.4 sponsored flow.
432
- *
433
- * Real addresses come from SC team once they deploy Relayer v2 and
434
- * pick a BatchExecutor. Until then we use placeholders so the SDK
435
- * code path compiles + tests execute end-to-end.
436
- *
437
- * **Intentionally not merge-safe to mainnet**callers that resolve
438
- * a mainnet address here get a `0x...DEAD` placeholder which will
439
- * revert at contract-level. That's the point: prod refuses to run
440
- * on mocks.
441
- *
442
- * Chain id map:
443
- * - 8453 Base mainnet
444
- * - 84532 Base Sepolia
445
- *
446
- * Swap workflow when SC delivers:
447
- * 1. Rename this file `addresses.ts` under `src/contracts/real/`
448
- * 2. Fill real addresses per chain
449
- * 3. Update `src/contracts/index.ts` re-export
450
- * 4. Delete MOCK_* named exports
451
- */
452
- /**
453
- * Per-chain contract addresses.
654
+ * Per-chain deployed contract addresses v1.4 flow.
655
+ *
656
+ * ## Status (2026-04-21)
657
+ *
658
+ * Base mainnet (8453): all SC-delivered and real, EXCEPT `batchExecutor`
659
+ * which is still a `0x...DE02` placeholder pending the Phase B delivery.
660
+ * Base Sepolia (84532): entire row is placeholder not in active use.
661
+ *
662
+ * ## What lives where
663
+ *
664
+ * pointToken — live POINT instance (clone of PointToken impl)
665
+ * batchExecutor — EIP-7702 delegation target (PLACEHOLDER)
666
+ * usdt — MockERC20 used by Uniswap pools
667
+ * issuerRegistry — registry of all issuers on this chain
668
+ * mintingOracle — per-issuer mint cap enforcer
669
+ *
670
+ * PointTokenFactory + PointToken implementation addresses live in
671
+ * separate exports below they're only needed at provisioning /
672
+ * observability time, not in the hot mint/burn path, so excluded from
673
+ * the per-chain bundle.
674
+ *
675
+ * ## Swap workflow when BatchExecutor lands
454
676
  *
455
- * v1.4 update: `relayerV2` field dropped flow now calls
456
- * `PointToken.mint()` directly via EIP-7702 delegation. No Relayer
457
- * contract sits between user and PointToken.
677
+ * 1. Replace `batchExecutor` placeholder with real address
678
+ * 2. Structure / imports don't change — callers are stable
679
+ * 3. Bump core to next beta and update release notes
458
680
  */
459
681
  interface ContractAddresses {
460
682
  pointToken: Address;
@@ -463,121 +685,61 @@ interface ContractAddresses {
463
685
  issuerRegistry: Address;
464
686
  mintingOracle: Address;
465
687
  }
466
- declare const MOCK_ADDRESSES: Record<number, ContractAddresses>;
688
+ declare const CONTRACT_ADDRESSES: Record<number, ContractAddresses>;
467
689
  /**
468
- * Lookup helperthrows if the chain isn't in the map so callers fail
469
- * loudly on misconfiguration instead of silently using `undefined`.
690
+ * PointTokenFactory addressseparate from `ContractAddresses` because
691
+ * it's only used at provisioning time (issuer onboard + token creation),
692
+ * not in the hot mint/burn path.
470
693
  */
471
- declare function getMockAddresses(chainId: number): ContractAddresses;
472
-
694
+ declare const POINT_TOKEN_FACTORY_ADDRESSES: Record<number, Address>;
473
695
  /**
474
- * ⚠️ MOCK`BurnConsent` EIP-712 type for the v1.4 reverse flow.
475
- *
476
- * New type entirely v0.2.x had no burn-for-credit flow.
477
- *
478
- * User signs `BurnConsent` to authorize burning `amount` PT from their
479
- * wallet in exchange for an off-chain credit of (amount - gasFee).
480
- * Signature is consumed either by:
481
- * - A relayer calling `PointToken.burnWithSig(...)` (Variant B)
482
- * - The paymaster-proxy-sponsored UserOp calling `PointToken.burn(...)`
483
- * with msg.sender = user via EIP-7702 (Variant A)
484
- *
485
- * Either way the tx emits `Transfer(user → 0x0)` which the issuer's
486
- * `BurnIndexer` watches for and uses to credit the off-chain ledger.
487
- *
488
- * Field list is a best-guess — SC team may add fields (e.g. `feeAmount`
489
- * explicit, `extData`). Update this mock when they freeze the spec.
696
+ * PointToken implementation address the EIP-1167 clone target used
697
+ * by PointTokenFactory. Exposed for observability / proxy verification;
698
+ * consumers should never call this directly.
490
699
  */
491
- interface MockBurnConsent {
492
- user: Address;
493
- pointToken: Address;
494
- amount: bigint;
495
- nonce: bigint;
496
- deadline: bigint;
497
- }
498
- declare const MOCK_BURN_CONSENT_TYPES: {
499
- readonly BurnConsent: readonly [{
500
- readonly name: "user";
501
- readonly type: "address";
502
- }, {
503
- readonly name: "pointToken";
504
- readonly type: "address";
505
- }, {
506
- readonly name: "amount";
507
- readonly type: "uint256";
508
- }, {
509
- readonly name: "nonce";
510
- readonly type: "uint256";
511
- }, {
512
- readonly name: "deadline";
513
- readonly type: "uint256";
514
- }];
515
- };
516
- declare function buildMockBurnConsentTypedData(domain: PointTokenDomainConfig, message: MockBurnConsent): {
517
- domain: {
518
- name: string;
519
- version: "1";
520
- chainId: number;
521
- verifyingContract: `0x${string}`;
522
- };
523
- types: {
524
- readonly BurnConsent: readonly [{
525
- readonly name: "user";
526
- readonly type: "address";
527
- }, {
528
- readonly name: "pointToken";
529
- readonly type: "address";
530
- }, {
531
- readonly name: "amount";
532
- readonly type: "uint256";
533
- }, {
534
- readonly name: "nonce";
535
- readonly type: "uint256";
536
- }, {
537
- readonly name: "deadline";
538
- readonly type: "uint256";
539
- }];
540
- };
541
- primaryType: "BurnConsent";
542
- message: MockBurnConsent;
543
- };
544
- declare function signMockBurnConsent(walletClient: WalletClient, domain: PointTokenDomainConfig, message: MockBurnConsent): Promise<EIP712Signature>;
545
- declare function verifyMockBurnConsent(domain: PointTokenDomainConfig, message: MockBurnConsent, signature: Hex, expectedUser: Address): Promise<SignatureVerification>;
700
+ declare const POINT_TOKEN_IMPL_ADDRESSES: Record<number, Address>;
701
+ /**
702
+ * Lookup helper — throws if the chain isn't in the map so callers fail
703
+ * loudly on misconfiguration instead of silently using `undefined`.
704
+ */
705
+ declare function getContractAddresses(chainId: number): ContractAddresses;
546
706
 
547
707
  /**
548
708
  * Public contract surface for `@pafi-dev/core/contracts`.
549
709
  *
550
- * Consumers import contract ABIs + addresses + EIP-712 builders from
551
- * this module. The re-exports below dispatch to either `./mocks/*`
552
- * (current) or `./real/*` (once SC team delivers real ABIs).
710
+ * Consumers import ABIs + per-chain addresses from this module. EIP-712
711
+ * helpers (`signMintRequest`, `signBurnRequest`, etc.) live under
712
+ * `./eip712/` and are re-exported from the package root — not duplicated
713
+ * here.
553
714
  *
554
- * ## v1.4 update — Relayer removed
715
+ * ## v1.4 flowno Relayer, sig-gated mint/burn
555
716
  *
556
- * The flow no longer routes mint through a Relayer contract. Users
557
- * call `PointToken.mint()` directly via an EIP-7702 delegated UserOp
558
- * (`msg.sender == user`). PointToken checks `minters[user]` for
559
- * authorization. No on-chain MintRequest signature, no dual-sig
560
- * verification.
717
+ * Relayer contract dropped. Users call `PointToken.mint(to, amount,
718
+ * deadline, minterSig)` directly via an EIP-7702 delegated UserOp
719
+ * `msg.sender == user == to`. `minterSig` is an EIP-712 `MintRequest`
720
+ * signed off-chain by the issuer's minter signer (HSM/KMS). Mirror
721
+ * structure on the burn side with `BurnRequest` + `burn(from, amount,
722
+ * deadline, burnerSig)`.
561
723
  *
562
- * Exports kept:
563
- * - `POINT_TOKEN_V2_ABI` — mint + burn surface
564
- * - `BATCH_EXECUTOR_*` — EIP-7702 delegation target
565
- * - `CONTRACT_ADDRESSES` per-chain map (pointToken, batchExecutor, etc.)
566
- * - `BURN_CONSENT_*` EIP-712 for Scenario 2 if `burnWithSig` variant
724
+ * Exports:
725
+ * - `POINT_TOKEN_V2_ABI` full mint + burn + admin surface
726
+ * - `BATCH_EXECUTOR_*` — EIP-7702 delegation target (ABI real,
727
+ * address still placeholder on all
728
+ * chains until SC delivers)
729
+ * - `CONTRACT_ADDRESSES` — per-chain map (real on 8453 except
730
+ * `batchExecutor` — pending SC)
731
+ * - `POINT_TOKEN_FACTORY_ADDRESSES`, `POINT_TOKEN_IMPL_ADDRESSES`
732
+ * — provisioning / observability helpers
567
733
  *
568
- * Exports removed (vs beta.2):
569
- * - `RELAYER_V2_ABI`, `RELAYER_V2_MINT_SELECTOR`, `MintRequestV2`,
570
- * `SignatureStruct` — Relayer contract dropped from flow
571
- * - `MINT_REQUEST_V2_TYPES`, `buildMintRequestV2TypedData`,
572
- * `signMintRequestV2`, `verifyMintRequestV2` — no MintRequest sig
573
- *
574
- * Status: MOCKS active. See `./mocks/README.md` for deletion checklist.
734
+ * Status: all real except BatchExecutor address (single remaining
735
+ * placeholder, flagged inline in `real/addresses.ts`).
575
736
  */
576
737
 
577
738
  /**
578
- * Signature struct shared by `burnWithSig` (and any future EIP-712
579
- * verifier on-chain). Exported here so consumers don't need to
580
- * redefine it locally.
739
+ * Signature struct kept for consumers that want the tuple form.
740
+ * Most v1.4 paths pass `bytes` (serialized signature) directly to the
741
+ * contract; this struct is only needed if you're manually splitting
742
+ * for other on-chain verifiers.
581
743
  */
582
744
  interface SignatureStruct {
583
745
  v: number;
@@ -769,13 +931,11 @@ declare function openPafiWebModal(url: string, options?: ModalOpenOptions): Prom
769
931
 
770
932
  declare class PafiSDK {
771
933
  private _pointTokenAddress?;
772
- private _relayContractAddress?;
773
934
  private _signer?;
774
935
  private _provider?;
775
936
  private _chainId?;
776
937
  constructor(config: PafiSDKConfig);
777
938
  setPointTokenAddress(address: Address): void;
778
- setRelayContractAddress(address: Address): void;
779
939
  setSigner(signer: WalletClient): void;
780
940
  setProvider(provider: PublicClient): void;
781
941
  private requirePointToken;
@@ -783,10 +943,6 @@ declare class PafiSDK {
783
943
  private requireSigner;
784
944
  private requireChainId;
785
945
  getDomain(): Promise<PointTokenDomainConfig>;
786
- /**
787
- * Build the EIP-712 typed data for a MintRequest.
788
- * Pass the result to any external signer (Privy, WalletConnect, etc.).
789
- */
790
946
  buildMintRequestTypedData(message: MintRequest): Promise<{
791
947
  domain: {
792
948
  name: string;
@@ -812,10 +968,6 @@ declare class PafiSDK {
812
968
  primaryType: "MintRequest";
813
969
  message: MintRequest;
814
970
  }>;
815
- /**
816
- * Build the EIP-712 typed data for a ReceiverConsent.
817
- * Pass the result to any external signer (Privy, WalletConnect, etc.).
818
- */
819
971
  buildReceiverConsentTypedData(message: ReceiverConsent): Promise<{
820
972
  domain: {
821
973
  name: string;
@@ -853,11 +1005,6 @@ declare class PafiSDK {
853
1005
  verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
854
1006
  getMintRequestNonce(receiver: Address): Promise<bigint>;
855
1007
  getReceiverConsentNonce(receiver: Address): Promise<bigint>;
856
- encodeMintAndSwap(mint: MintParams, swap: SwapParams): Hex;
857
- decodeMintAndSwap(calldata: Hex): {
858
- mint: MintParams;
859
- swap: SwapParams;
860
- };
861
1008
  /**
862
1009
  * Find the best swap route from `tokenIn` to `tokenOut`.
863
1010
  * Merges `pools` with COMMON_POOLS for the configured chain, builds all
@@ -878,36 +1025,6 @@ declare class PafiSDK {
878
1025
  commands: Hex;
879
1026
  inputs: Hex[];
880
1027
  };
881
- /**
882
- * Build Relay SwapParams + extData from a quote result.
883
- * Returns ready-to-use args for `Relay.mintAndSwap`.
884
- */
885
- buildRelaySwapParams(params: {
886
- quote: {
887
- path: PathKey[];
888
- };
889
- minAmountOut: bigint;
890
- feeInUsdt: bigint;
891
- deadline: bigint;
892
- }): {
893
- swapParams: SwapParams;
894
- extData: Hex;
895
- };
896
- /**
897
- * Encode extData for ReceiverConsent and MintParams.
898
- * extData = abi.encode(minAmountOut, feeInUsdt)
899
- */
900
- encodeExtData(minAmountOut: bigint, feeInUsdt: bigint): Hex;
901
- /**
902
- * Simulate a Relay.mintAndSwap call. Catches reverts (bad signatures,
903
- * expired deadlines, insufficient mint cap, pool errors) before submitting.
904
- *
905
- * @param relayAddress - Relay contract address
906
- * @param mint - MintParams with real signatures
907
- * @param swap - SwapParams (path + deadline)
908
- * @param from - Relayer address that will submit the tx
909
- */
910
- simulateMintAndSwap(relayAddress: Address, mint: MintParams, swap: SwapParams, from: Address): Promise<SimulationResult>;
911
1028
  /**
912
1029
  * Simulate a UniversalRouter.execute swap call. Catches reverts (bad
913
1030
  * approvals, insufficient balance, pool errors) before submitting.
@@ -919,14 +1036,9 @@ declare class PafiSDK {
919
1036
  * @param from - Address that will execute the swap
920
1037
  */
921
1038
  simulateSwap(routerAddress: Address, commands: Hex, inputs: Hex[], deadline: bigint, from: Address): Promise<SwapSimulationResult>;
922
- /**
923
- * Build an EIP-4361 login message for the current signer + chain. The
924
- * caller supplies the issuer-specific fields (domain, nonce, uri); the SDK
925
- * fills in the wallet address and chain id from its own config.
926
- */
927
1039
  createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
928
1040
  /** Sign a login message string with the current signer (personal_sign) */
929
1041
  signLoginMessage(message: string): Promise<Hex>;
930
1042
  }
931
1043
 
932
- export { ApiError, BATCH_EXECUTOR_ABI, MOCK_BATCH_EXECUTOR_ADDRESS_BASE_MAINNET as BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, MOCK_BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA as BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, MOCK_BURN_CONSENT_TYPES as BURN_CONSENT_TYPES, BestQuote, type BuildPartialUserOpParams, type MockBurnConsent as BurnConsent, COMMON_POOLS, COMMON_TOKENS, MOCK_ADDRESSES as CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, EIP712Signature, LoginMessageParams, MintParams, MintRequest, type ModalOpenOptions, Operation, POINT_TOKEN_POOLS, MOCK_POINT_TOKEN_V2_ABI as POINT_TOKEN_V2_ABI, PafiSDK, PafiSDKConfig, PafiSDKError, type PafiWebModalAdapter, type PafiWebModalHandle, PartialUserOperation, PathKey, type PaymasterConfig, PointTokenDomainConfig, PoolKey, QuoteResult, ReceiverConsent, SUPPORTED_CHAINS, type SignatureStruct, SignatureVerification, SigningError, SimulationError, SimulationResult, type SponsorshipScenario, type SubmissionPath, SwapParams, SwapSimulationResult, UNIVERSAL_ROUTER_ADDRESSES, UserOperation, V4_QUOTER_ADDRESSES, _resetPaymasterConfigForTests, assembleUserOperation, buildMockBurnConsentTypedData as buildBurnConsentTypedData, buildPartialUserOperation, checkEthAndBranch, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, getMockAddresses as getContractAddresses, getPafiWebModalAdapter, getPaymasterConfig, isPaymasterConfigured, mintRequestTypes, openPafiWebModal, openWebPopup, rawCallOp, receiverConsentTypes, setPafiWebModalAdapter, setPaymasterConfig, signMockBurnConsent as signBurnConsent, verifyMockBurnConsent as verifyBurnConsent, webPopupAdapter };
1044
+ export { ApiError, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BestQuote, type BuildPartialUserOpParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, EIP712Signature, LoginMessageParams, MintRequest, type ModalOpenOptions, Operation, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, POINT_TOKEN_ABI as POINT_TOKEN_V2_ABI, PafiSDK, PafiSDKConfig, PafiSDKError, type PafiWebModalAdapter, type PafiWebModalHandle, PartialUserOperation, type PaymasterConfig, PointTokenDomainConfig, PoolKey, QuoteResult, ReceiverConsent, SUPPORTED_CHAINS, type SignatureStruct, SignatureVerification, SigningError, SimulationError, type SponsorshipScenario, type SubmissionPath, SwapSimulationResult, UNIVERSAL_ROUTER_ADDRESSES, UserOperation, V4_QUOTER_ADDRESSES, _resetPaymasterConfigForTests, assembleUserOperation, buildPartialUserOperation, burnRequestTypes, checkEthAndBranch, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, getContractAddresses, getPafiWebModalAdapter, getPaymasterConfig, isPaymasterConfigured, mintRequestTypes, openPafiWebModal, openWebPopup, rawCallOp, receiverConsentTypes, setPafiWebModalAdapter, setPaymasterConfig, webPopupAdapter };