@pafi-dev/core 0.3.0-beta.2 → 0.3.0-beta.4

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 (42) hide show
  1. package/dist/{chunk-R4L66ZR5.js → chunk-73CQTNLB.js} +10 -1
  2. package/dist/chunk-73CQTNLB.js.map +1 -0
  3. package/dist/{chunk-CWP4PFOP.cjs → chunk-DMW67WBU.cjs} +11 -2
  4. package/dist/chunk-DMW67WBU.cjs.map +1 -0
  5. package/dist/{chunk-C4ZDYG4D.js → chunk-DUY7Z2AI.js} +48 -6
  6. package/dist/chunk-DUY7Z2AI.js.map +1 -0
  7. package/dist/{chunk-FIKTQR7H.js → chunk-I2P3TIP7.js} +2 -2
  8. package/dist/{chunk-BNTVOKYT.cjs → chunk-KJKDLD7N.cjs} +51 -9
  9. package/dist/chunk-KJKDLD7N.cjs.map +1 -0
  10. package/dist/{chunk-CAE2BVKI.cjs → chunk-Z2V525IS.cjs} +6 -6
  11. package/dist/{chunk-CAE2BVKI.cjs.map → chunk-Z2V525IS.cjs.map} +1 -1
  12. package/dist/contract/index.d.cts +1 -1
  13. package/dist/contract/index.d.ts +1 -1
  14. package/dist/eip712/index.cjs +9 -3
  15. package/dist/eip712/index.cjs.map +1 -1
  16. package/dist/eip712/index.d.cts +44 -2
  17. package/dist/eip712/index.d.ts +44 -2
  18. package/dist/eip712/index.js +8 -2
  19. package/dist/{index-BpUYHGu3.d.cts → index-B5OJ9Kcx.d.cts} +1 -1
  20. package/dist/{index-CNALKsH1.d.ts → index-BYL8Nn-n.d.ts} +1 -1
  21. package/dist/index.cjs +79 -154
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +353 -349
  24. package/dist/index.d.ts +353 -349
  25. package/dist/index.js +79 -154
  26. package/dist/index.js.map +1 -1
  27. package/dist/quoting/index.cjs +3 -3
  28. package/dist/quoting/index.d.cts +1 -1
  29. package/dist/quoting/index.d.ts +1 -1
  30. package/dist/quoting/index.js +2 -2
  31. package/dist/relay/index.d.cts +1 -1
  32. package/dist/relay/index.d.ts +1 -1
  33. package/dist/swap/index.d.cts +2 -2
  34. package/dist/swap/index.d.ts +2 -2
  35. package/dist/{types-BDOnH5Le.d.cts → types-DGDlKiDe.d.cts} +8 -1
  36. package/dist/{types-BDOnH5Le.d.ts → types-DGDlKiDe.d.ts} +8 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-BNTVOKYT.cjs.map +0 -1
  39. package/dist/chunk-C4ZDYG4D.js.map +0 -1
  40. package/dist/chunk-CWP4PFOP.cjs.map +0 -1
  41. package/dist/chunk-R4L66ZR5.js.map +0 -1
  42. /package/dist/{chunk-FIKTQR7H.js.map → chunk-I2P3TIP7.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
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';
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, c as MintParams, d as SwapParams, B as BestQuote, Q as QuoteResult, e as PathKey } from './types-DGDlKiDe.js';
3
+ export { f as BurnRequest, I as Issuer } from './types-DGDlKiDe.js';
4
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';
5
+ export { buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.js';
6
6
  import { SimulationResult } from './relay/index.js';
7
7
  export { buildRelaySwapParams, decodeExtData, decodeMintAndSwap, encodeExtData, encodeMintAndSwap, simulateMintAndSwap } from './relay/index.js';
8
8
  export { getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, getUsdt, isActiveIssuer, isMinter, verifyMintCap } from './contract/index.js';
9
9
  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';
10
+ import { O as Operation, P as PartialUserOperation, U as UserOperation, S as SwapSimulationResult } from './index-BYL8Nn-n.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-BYL8Nn-n.js';
12
12
  import { LoginMessageParams } from './auth/index.js';
13
13
  export { VerifyLoginResult, createLoginMessage, parseLoginMessage, verifyLoginMessage } from './auth/index.js';
14
14
 
@@ -27,6 +27,21 @@ declare const mintRequestTypes: {
27
27
  readonly type: "uint256";
28
28
  }];
29
29
  };
30
+ declare const burnRequestTypes: {
31
+ readonly BurnRequest: readonly [{
32
+ readonly name: "from";
33
+ readonly type: "address";
34
+ }, {
35
+ readonly name: "amount";
36
+ readonly type: "uint256";
37
+ }, {
38
+ readonly name: "nonce";
39
+ readonly type: "uint256";
40
+ }, {
41
+ readonly name: "deadline";
42
+ readonly type: "uint256";
43
+ }];
44
+ };
30
45
  declare const receiverConsentTypes: {
31
46
  readonly ReceiverConsent: readonly [{
32
47
  readonly name: "onBehalfOf";
@@ -276,238 +291,290 @@ interface CheckEthAndBranchParams {
276
291
  declare function checkEthAndBranch(params: CheckEthAndBranchParams): Promise<SubmissionPath>;
277
292
 
278
293
  /**
279
- * ⚠️ MOCK — Relayer v2 `mint()` ABI for the v1.4 sponsored flow.
294
+ * ⚠️ PARTIAL MOCK — `PointToken` ABI.
295
+ *
296
+ * As of 2026-04-21 this matches the deployed Base mainnet contract
297
+ * (POINT at `0x7d25E7156E51F865D522fd3ef257a6B5DD41b97e`). The ABI
298
+ * itself is no longer mocked — kept under `mocks/` only because the
299
+ * rest of the folder is still mock (pending BatchExecutor real address).
300
+ * Once Phase B completes, this file moves to `contracts/real/`.
301
+ *
302
+ * ## Mint — two paths
303
+ *
304
+ * Path 1 — Direct (whitelisted minter):
305
+ * mint(address to, uint256 amount)
306
+ * - msg.sender must be in minters[]
307
+ * - Used by off-chain services that hold a minter key
308
+ *
309
+ * Path 2 — Sig-gated (gasless, v1.4 sponsored flow):
310
+ * mint(address to, uint256 amount, uint256 deadline, bytes minterSig)
311
+ * - msg.sender MUST equal `to` (the receiver)
312
+ * - minterSig is an EIP-712 MintRequest signature from a whitelisted minter
313
+ * - Consumes `mintRequestNonces[to]`
314
+ * - This is the path v1.4 uses: issuer backend signs, user submits
315
+ * via EIP-7702 + Coinbase Paymaster
280
316
  *
281
- * Signature guess based on stakeholder memo (`REQUIREMENTS_V2.md §3`):
317
+ * ## Burn mirror structure
282
318
  *
283
- * mint(
284
- * MintRequest request, // EIP-712 signed by user + issuer
285
- * Signature userSig, // v, r, s
286
- * Signature issuerSig, // v, r, s
287
- * uint256 feeAmount, // PT units to split off to feeRecipient
288
- * address feeRecipient // typically operator or fee collector
289
- * )
319
+ * Path 1: burn(address from, uint256 amount) — whitelisted burner
320
+ * Path 2: burn(address from, uint256 amount, uint256 deadline, bytes burnerSig)
321
+ * msg.sender must equal `from`, burnerSig from whitelisted burner,
322
+ * consumes `burnRequestNonces[from]`
290
323
  *
291
- * Behaviour expected:
292
- * - Verify user + issuer EIP-712 signatures against `request`
293
- * - Mint `request.amount` PT to `request.to`
294
- * - Atomic transfer `feeAmount` from `request.to` → `feeRecipient`
295
- * (net mint = `amount - feeAmount`)
296
- * - Increment the on-chain nonce to prevent replay
324
+ * Either burn path emits `Transfer(from → 0x0)` so BurnIndexer semantics
325
+ * don't depend on which path was taken.
297
326
  *
298
- * When SC team publishes the real ABI, drop it in under
299
- * `src/contracts/real/relayerV2.abi.ts` and flip the export in
300
- * `src/contracts/index.ts` — call sites unchanged.
327
+ * ## EIP-712 type hashes (from contract source)
301
328
  *
302
- * See [SC_MOCK_PLAN.md §2.1] for the rationale + swap checklist.
329
+ * MintRequest(address to,uint256 amount,uint256 nonce,uint256 deadline)
330
+ * BurnRequest(address from,uint256 amount,uint256 nonce,uint256 deadline)
331
+ *
332
+ * Domain: EIP-712 standard — name = ERC-20 token name, version = "1",
333
+ * chainId, verifyingContract = this PointToken address.
303
334
  */
304
- declare const MOCK_RELAYER_V2_ABI: readonly [{
335
+ declare const MOCK_POINT_TOKEN_V2_ABI: readonly [{
305
336
  readonly name: "mint";
306
337
  readonly type: "function";
307
338
  readonly stateMutability: "nonpayable";
308
339
  readonly inputs: readonly [{
309
- readonly type: "tuple";
310
- readonly components: readonly [{
311
- readonly type: "address";
312
- readonly name: "to";
313
- }, {
314
- readonly type: "uint256";
315
- readonly name: "amount";
316
- }, {
317
- readonly type: "uint256";
318
- readonly name: "feeAmount";
319
- }, {
320
- readonly type: "address";
321
- readonly name: "feeRecipient";
322
- }, {
323
- readonly type: "uint256";
324
- readonly name: "nonce";
325
- }, {
326
- readonly type: "uint256";
327
- readonly name: "deadline";
328
- }, {
329
- readonly type: "bytes";
330
- readonly name: "extData";
331
- }];
332
- readonly name: "request";
333
- }, {
334
- readonly type: "tuple";
335
- readonly components: readonly [{
336
- readonly type: "uint8";
337
- readonly name: "v";
338
- }, {
339
- readonly type: "bytes32";
340
- readonly name: "r";
341
- }, {
342
- readonly type: "bytes32";
343
- readonly name: "s";
344
- }];
345
- readonly name: "userSig";
340
+ readonly type: "address";
341
+ readonly name: "to";
346
342
  }, {
347
- readonly type: "tuple";
348
- readonly components: readonly [{
349
- readonly type: "uint8";
350
- readonly name: "v";
351
- }, {
352
- readonly type: "bytes32";
353
- readonly name: "r";
354
- }, {
355
- readonly type: "bytes32";
356
- readonly name: "s";
357
- }];
358
- readonly name: "issuerSig";
343
+ readonly type: "uint256";
344
+ readonly name: "amount";
359
345
  }];
360
346
  readonly outputs: readonly [];
361
347
  }, {
362
- readonly name: "mintRequestNonce";
348
+ readonly name: "mint";
363
349
  readonly type: "function";
364
- readonly stateMutability: "view";
350
+ readonly stateMutability: "nonpayable";
365
351
  readonly inputs: readonly [{
366
352
  readonly type: "address";
367
- readonly name: "user";
353
+ readonly name: "to";
354
+ }, {
355
+ readonly type: "uint256";
356
+ readonly name: "amount";
357
+ }, {
358
+ readonly type: "uint256";
359
+ readonly name: "deadline";
360
+ }, {
361
+ readonly type: "bytes";
362
+ readonly name: "minterSig";
368
363
  }];
369
- readonly outputs: readonly [{
364
+ readonly outputs: readonly [];
365
+ }, {
366
+ readonly name: "burn";
367
+ readonly type: "function";
368
+ readonly stateMutability: "nonpayable";
369
+ readonly inputs: readonly [{
370
+ readonly type: "address";
371
+ readonly name: "from";
372
+ }, {
370
373
  readonly type: "uint256";
374
+ readonly name: "amount";
371
375
  }];
376
+ readonly outputs: readonly [];
372
377
  }, {
373
- readonly name: "Minted";
374
- readonly type: "event";
378
+ readonly name: "burn";
379
+ readonly type: "function";
380
+ readonly stateMutability: "nonpayable";
375
381
  readonly inputs: readonly [{
376
382
  readonly type: "address";
377
- readonly name: "user";
378
- readonly indexed: true;
383
+ readonly name: "from";
379
384
  }, {
380
385
  readonly type: "uint256";
381
386
  readonly name: "amount";
382
387
  }, {
383
388
  readonly type: "uint256";
384
- readonly name: "feeAmount";
389
+ readonly name: "deadline";
385
390
  }, {
391
+ readonly type: "bytes";
392
+ readonly name: "burnerSig";
393
+ }];
394
+ readonly outputs: readonly [];
395
+ }, {
396
+ readonly name: "minters";
397
+ readonly type: "function";
398
+ readonly stateMutability: "view";
399
+ readonly inputs: readonly [{
386
400
  readonly type: "address";
387
- readonly name: "feeRecipient";
388
- readonly indexed: true;
389
- }, {
390
- readonly type: "bytes32";
391
- readonly name: "requestHash";
401
+ readonly name: "account";
392
402
  }];
393
- }];
394
- /**
395
- * Calldata function selector for `mint((...),(...),(...))` as encoded
396
- * by viem against {@link MOCK_RELAYER_V2_ABI}. Callers compare against
397
- * this to sanity-check decoded UserOp inner calls.
398
- *
399
- * Recompute when the real ABI lands — almost certainly differs.
400
- */
401
- declare const MOCK_RELAYER_V2_MINT_SELECTOR: "0xMOCKED__";
402
- /**
403
- * Struct shape that matches {@link MOCK_RELAYER_V2_ABI}. Exported so
404
- * builders can accept a typed input without `as const` gymnastics.
405
- */
406
- interface MockMintRequestV2 {
407
- to: Address;
408
- amount: bigint;
409
- feeAmount: bigint;
410
- feeRecipient: Address;
411
- nonce: bigint;
412
- deadline: bigint;
413
- extData: `0x${string}`;
414
- }
415
- interface MockSignatureStruct {
416
- v: number;
417
- r: `0x${string}`;
418
- s: `0x${string}`;
419
- }
420
-
421
- /**
422
- * ⚠️ MOCK — `PointToken` v1.4 burn surface.
423
- *
424
- * Two variants mocked — SC team will pick ONE before stable; the other
425
- * gets deleted during Phase B swap.
426
- *
427
- * Variant A (simpler, most likely):
428
- * burn(uint256 amount)
429
- * - burns from `msg.sender`
430
- * - caller handles authorization (the user is `msg.sender` via
431
- * EIP-7702 delegation, so `msg.sender == user`)
432
- *
433
- * Variant B (signature-based, if SC prefers explicit consent on-chain):
434
- * burnWithSig(BurnConsent consent, Signature sig)
435
- * - verifies EIP-712 signature before burning
436
- * - used when the caller isn't the user (e.g. a relayer burns on
437
- * behalf of the user)
438
- *
439
- * Either way the ERC-20 emits `Transfer(from, address(0), amount)` so
440
- * `BurnIndexer` semantics don't change.
441
- */
442
- declare const MOCK_POINT_TOKEN_V2_ABI: readonly [{
443
- readonly name: "burn";
403
+ readonly outputs: readonly [{
404
+ readonly type: "bool";
405
+ }];
406
+ }, {
407
+ readonly name: "burners";
408
+ readonly type: "function";
409
+ readonly stateMutability: "view";
410
+ readonly inputs: readonly [{
411
+ readonly type: "address";
412
+ readonly name: "account";
413
+ }];
414
+ readonly outputs: readonly [{
415
+ readonly type: "bool";
416
+ }];
417
+ }, {
418
+ readonly name: "addMinter";
444
419
  readonly type: "function";
445
420
  readonly stateMutability: "nonpayable";
446
421
  readonly inputs: readonly [{
447
- readonly type: "uint256";
448
- readonly name: "amount";
422
+ readonly type: "address";
423
+ readonly name: "minter";
449
424
  }];
450
425
  readonly outputs: readonly [];
451
426
  }, {
452
- readonly name: "burnWithSig";
427
+ readonly name: "removeMinter";
453
428
  readonly type: "function";
454
429
  readonly stateMutability: "nonpayable";
455
430
  readonly inputs: readonly [{
456
- readonly type: "tuple";
457
- readonly components: readonly [{
458
- readonly type: "address";
459
- readonly name: "user";
460
- }, {
461
- readonly type: "address";
462
- readonly name: "pointToken";
463
- }, {
464
- readonly type: "uint256";
465
- readonly name: "amount";
466
- }, {
467
- readonly type: "uint256";
468
- readonly name: "nonce";
469
- }, {
470
- readonly type: "uint256";
471
- readonly name: "deadline";
472
- }];
473
- readonly name: "consent";
474
- }, {
475
- readonly type: "tuple";
476
- readonly components: readonly [{
477
- readonly type: "uint8";
478
- readonly name: "v";
479
- }, {
480
- readonly type: "bytes32";
481
- readonly name: "r";
482
- }, {
483
- readonly type: "bytes32";
484
- readonly name: "s";
485
- }];
486
- readonly name: "sig";
431
+ readonly type: "address";
432
+ readonly name: "minter";
487
433
  }];
488
434
  readonly outputs: readonly [];
489
435
  }, {
490
- readonly name: "balanceOf";
436
+ readonly name: "addBurner";
437
+ readonly type: "function";
438
+ readonly stateMutability: "nonpayable";
439
+ readonly inputs: readonly [{
440
+ readonly type: "address";
441
+ readonly name: "burner";
442
+ }];
443
+ readonly outputs: readonly [];
444
+ }, {
445
+ readonly name: "removeBurner";
446
+ readonly type: "function";
447
+ readonly stateMutability: "nonpayable";
448
+ readonly inputs: readonly [{
449
+ readonly type: "address";
450
+ readonly name: "burner";
451
+ }];
452
+ readonly outputs: readonly [];
453
+ }, {
454
+ readonly name: "mintRequestNonces";
491
455
  readonly type: "function";
492
456
  readonly stateMutability: "view";
493
457
  readonly inputs: readonly [{
494
458
  readonly type: "address";
495
- readonly name: "user";
459
+ readonly name: "receiver";
496
460
  }];
497
461
  readonly outputs: readonly [{
498
462
  readonly type: "uint256";
499
463
  }];
500
464
  }, {
501
- readonly name: "burnNonce";
465
+ readonly name: "burnRequestNonces";
502
466
  readonly type: "function";
503
467
  readonly stateMutability: "view";
504
468
  readonly inputs: readonly [{
505
469
  readonly type: "address";
506
- readonly name: "user";
470
+ readonly name: "from";
507
471
  }];
508
472
  readonly outputs: readonly [{
509
473
  readonly type: "uint256";
510
474
  }];
475
+ }, {
476
+ readonly name: "mintingOracle";
477
+ readonly type: "function";
478
+ readonly stateMutability: "view";
479
+ readonly inputs: readonly [];
480
+ readonly outputs: readonly [{
481
+ readonly type: "address";
482
+ }];
483
+ }, {
484
+ readonly name: "setMintingOracle";
485
+ readonly type: "function";
486
+ readonly stateMutability: "nonpayable";
487
+ readonly inputs: readonly [{
488
+ readonly type: "address";
489
+ readonly name: "_mintingOracle";
490
+ }];
491
+ readonly outputs: readonly [];
492
+ }, {
493
+ readonly name: "issuer";
494
+ readonly type: "function";
495
+ readonly stateMutability: "view";
496
+ readonly inputs: readonly [];
497
+ readonly outputs: readonly [{
498
+ readonly type: "address";
499
+ }];
500
+ }, {
501
+ readonly name: "balanceOf";
502
+ readonly type: "function";
503
+ readonly stateMutability: "view";
504
+ readonly inputs: readonly [{
505
+ readonly type: "address";
506
+ readonly name: "account";
507
+ }];
508
+ readonly outputs: readonly [{
509
+ readonly type: "uint256";
510
+ }];
511
+ }, {
512
+ readonly name: "totalSupply";
513
+ readonly type: "function";
514
+ readonly stateMutability: "view";
515
+ readonly inputs: readonly [];
516
+ readonly outputs: readonly [{
517
+ readonly type: "uint256";
518
+ }];
519
+ }, {
520
+ readonly name: "name";
521
+ readonly type: "function";
522
+ readonly stateMutability: "view";
523
+ readonly inputs: readonly [];
524
+ readonly outputs: readonly [{
525
+ readonly type: "string";
526
+ }];
527
+ }, {
528
+ readonly name: "symbol";
529
+ readonly type: "function";
530
+ readonly stateMutability: "view";
531
+ readonly inputs: readonly [];
532
+ readonly outputs: readonly [{
533
+ readonly type: "string";
534
+ }];
535
+ }, {
536
+ readonly name: "decimals";
537
+ readonly type: "function";
538
+ readonly stateMutability: "view";
539
+ readonly inputs: readonly [];
540
+ readonly outputs: readonly [{
541
+ readonly type: "uint8";
542
+ }];
543
+ }, {
544
+ readonly name: "DOMAIN_SEPARATOR";
545
+ readonly type: "function";
546
+ readonly stateMutability: "view";
547
+ readonly inputs: readonly [];
548
+ readonly outputs: readonly [{
549
+ readonly type: "bytes32";
550
+ }];
551
+ }, {
552
+ readonly name: "eip712Domain";
553
+ readonly type: "function";
554
+ readonly stateMutability: "view";
555
+ readonly inputs: readonly [];
556
+ readonly outputs: readonly [{
557
+ readonly type: "bytes1";
558
+ readonly name: "fields";
559
+ }, {
560
+ readonly type: "string";
561
+ readonly name: "name";
562
+ }, {
563
+ readonly type: "string";
564
+ readonly name: "version";
565
+ }, {
566
+ readonly type: "uint256";
567
+ readonly name: "chainId";
568
+ }, {
569
+ readonly type: "address";
570
+ readonly name: "verifyingContract";
571
+ }, {
572
+ readonly type: "bytes32";
573
+ readonly name: "salt";
574
+ }, {
575
+ readonly type: "uint256[]";
576
+ readonly name: "extensions";
577
+ }];
511
578
  }, {
512
579
  readonly name: "Transfer";
513
580
  readonly type: "event";
@@ -523,6 +590,46 @@ declare const MOCK_POINT_TOKEN_V2_ABI: readonly [{
523
590
  readonly type: "uint256";
524
591
  readonly name: "value";
525
592
  }];
593
+ }, {
594
+ readonly name: "MinterAdded";
595
+ readonly type: "event";
596
+ readonly inputs: readonly [{
597
+ readonly type: "address";
598
+ readonly name: "minter";
599
+ readonly indexed: true;
600
+ }];
601
+ }, {
602
+ readonly name: "MinterRemoved";
603
+ readonly type: "event";
604
+ readonly inputs: readonly [{
605
+ readonly type: "address";
606
+ readonly name: "minter";
607
+ readonly indexed: true;
608
+ }];
609
+ }, {
610
+ readonly name: "BurnerAdded";
611
+ readonly type: "event";
612
+ readonly inputs: readonly [{
613
+ readonly type: "address";
614
+ readonly name: "burner";
615
+ readonly indexed: true;
616
+ }];
617
+ }, {
618
+ readonly name: "BurnerRemoved";
619
+ readonly type: "event";
620
+ readonly inputs: readonly [{
621
+ readonly type: "address";
622
+ readonly name: "burner";
623
+ readonly indexed: true;
624
+ }];
625
+ }, {
626
+ readonly name: "MintingOracleUpdated";
627
+ readonly type: "event";
628
+ readonly inputs: readonly [{
629
+ readonly type: "address";
630
+ readonly name: "mintingOracle";
631
+ readonly indexed: true;
632
+ }];
526
633
  }];
527
634
 
528
635
  /**
@@ -544,29 +651,34 @@ declare const MOCK_BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA: Address;
544
651
  declare const MOCK_BATCH_EXECUTOR_ADDRESS_BASE_MAINNET: Address;
545
652
 
546
653
  /**
547
- * ⚠️ MOCK — per-chain contract addresses for the v1.4 sponsored flow.
548
- *
549
- * Real addresses come from SC team once they deploy Relayer v2 and
550
- * pick a BatchExecutor. Until then we use placeholders so the SDK
551
- * code path compiles + tests execute end-to-end.
654
+ * ⚠️ PARTIAL MOCK — per-chain contract addresses for the v1.4 flow.
552
655
  *
553
- * **Intentionally not merge-safe to mainnet** callers that resolve
554
- * a mainnet address here get a `0x...DEAD` placeholder which will
555
- * revert at contract-level. That's the point: prod refuses to run
556
- * on mocks.
656
+ * As of 2026-04-21 SC team delivered the first round of deployed
657
+ * addresses on Base mainnet. `batchExecutor` is still pending (not
658
+ * part of the first deploy batch) so that single field remains a
659
+ * placeholder until Phase B.
557
660
  *
558
661
  * Chain id map:
559
- * - 8453 Base mainnet
560
- * - 84532 Base Sepolia
662
+ * - 8453 Base mainnet — SC-delivered (see below)
663
+ * - 84532 Base Sepolia — not in use; placeholders only
664
+ *
665
+ * v1.4 notes:
666
+ * - No `relayerV2` — flow dropped the intermediate Relayer contract.
667
+ * User submits UserOp that calls `PointToken.mint(...)` directly.
668
+ * - `pointToken` here is the live deployed POINT instance (clone
669
+ * from PointTokenFactory) — not the implementation. The impl
670
+ * lives at tokenImpl and is only referenced by the factory.
671
+ * - `usdt` is the MockERC20 (dev USDT) used by Uniswap pools.
561
672
  *
562
- * Swap workflow when SC delivers:
563
- * 1. Rename this file → `addresses.ts` under `src/contracts/real/`
564
- * 2. Fill real addresses per chain
565
- * 3. Update `src/contracts/index.ts` re-export
566
- * 4. Delete MOCK_* named exports
673
+ * Swap workflow when BatchExecutor lands:
674
+ * 1. Replace `batchExecutor` placeholder with real address
675
+ * 2. Keep structure consumers already import from the same key
676
+ * 3. Bump core to `0.3.0-beta.N+1`
677
+ */
678
+ /**
679
+ * Per-chain contract addresses.
567
680
  */
568
681
  interface ContractAddresses {
569
- relayerV2: Address;
570
682
  pointToken: Address;
571
683
  batchExecutor: Address;
572
684
  usdt: Address;
@@ -574,6 +686,18 @@ interface ContractAddresses {
574
686
  mintingOracle: Address;
575
687
  }
576
688
  declare const MOCK_ADDRESSES: Record<number, ContractAddresses>;
689
+ /**
690
+ * PointTokenFactory address — separate from `ContractAddresses`
691
+ * because it's only used at provisioning time (issuer onboard +
692
+ * token creation), not in the hot mint/burn path.
693
+ */
694
+ declare const POINT_TOKEN_FACTORY_ADDRESSES: Record<number, Address>;
695
+ /**
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.
699
+ */
700
+ declare const POINT_TOKEN_IMPL_ADDRESSES: Record<number, Address>;
577
701
  /**
578
702
  * Lookup helper — throws if the chain isn't in the map so callers fail
579
703
  * loudly on misconfiguration instead of silently using `undefined`.
@@ -581,168 +705,48 @@ declare const MOCK_ADDRESSES: Record<number, ContractAddresses>;
581
705
  declare function getMockAddresses(chainId: number): ContractAddresses;
582
706
 
583
707
  /**
584
- * ⚠️ MOCK `MintRequest` v2 EIP-712 types.
708
+ * Public contract surface for `@pafi-dev/core/contracts`.
585
709
  *
586
- * Extends v0.2.x `MintRequest` (4 fields) with three new fields needed
587
- * for the v1.4 sponsored flow:
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.
588
714
  *
589
- * + feeAmount PT units taken from the mint for the operator
590
- * + feeRecipient where the fee goes (operator or treasury)
591
- * + extData arbitrary bytes for future extensions (swap path, etc.)
715
+ * ## v1.4 flow no Relayer, sig-gated mint/burn
592
716
  *
593
- * When SC team confirms the real struct, drop this file's content into
594
- * the real builder and remove the MOCK_ prefix. The function signatures
595
- * below stay stable only `MOCK_MINT_REQUEST_V2_TYPES` changes.
596
- */
597
- declare const MOCK_MINT_REQUEST_V2_TYPES: {
598
- readonly MintRequest: readonly [{
599
- readonly name: "to";
600
- readonly type: "address";
601
- }, {
602
- readonly name: "amount";
603
- readonly type: "uint256";
604
- }, {
605
- readonly name: "feeAmount";
606
- readonly type: "uint256";
607
- }, {
608
- readonly name: "feeRecipient";
609
- readonly type: "address";
610
- }, {
611
- readonly name: "nonce";
612
- readonly type: "uint256";
613
- }, {
614
- readonly name: "deadline";
615
- readonly type: "uint256";
616
- }, {
617
- readonly name: "extData";
618
- readonly type: "bytes";
619
- }];
620
- };
621
- /**
622
- * Build the typed-data envelope that any EIP-712 signer (viem, ethers,
623
- * Privy) can consume. Callers typically pass the result to
624
- * `walletClient.signTypedData()` or `privy.signTypedData()`.
625
- */
626
- declare function buildMockMintRequestV2TypedData(domain: PointTokenDomainConfig, message: MockMintRequestV2): {
627
- domain: {
628
- name: string;
629
- version: "1";
630
- chainId: number;
631
- verifyingContract: `0x${string}`;
632
- };
633
- types: {
634
- readonly MintRequest: readonly [{
635
- readonly name: "to";
636
- readonly type: "address";
637
- }, {
638
- readonly name: "amount";
639
- readonly type: "uint256";
640
- }, {
641
- readonly name: "feeAmount";
642
- readonly type: "uint256";
643
- }, {
644
- readonly name: "feeRecipient";
645
- readonly type: "address";
646
- }, {
647
- readonly name: "nonce";
648
- readonly type: "uint256";
649
- }, {
650
- readonly name: "deadline";
651
- readonly type: "uint256";
652
- }, {
653
- readonly name: "extData";
654
- readonly type: "bytes";
655
- }];
656
- };
657
- primaryType: "MintRequest";
658
- message: MockMintRequestV2;
659
- };
660
- /**
661
- * Sign a `MintRequest` v2 with a viem WalletClient — server-side flow
662
- * where the issuer holds the private key directly (KMS-backed signer
663
- * is the production path; see `@pafi-dev/issuer` KMSSignerAdapter).
664
- */
665
- declare function signMockMintRequestV2(walletClient: WalletClient, domain: PointTokenDomainConfig, message: MockMintRequestV2): Promise<EIP712Signature>;
666
- /**
667
- * Verify a `MintRequest` v2 signature and check it came from the
668
- * expected signer (either user or issuer depending on which side is
669
- * being verified).
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)`.
723
+ *
724
+ * Exports:
725
+ * - `POINT_TOKEN_V2_ABI` full mint + burn + admin surface
726
+ * - `BATCH_EXECUTOR_*` — EIP-7702 delegation target (ABI real,
727
+ * address placeholder on all chains until
728
+ * 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
733
+ *
734
+ * Status: PARTIAL mock. Only `batchExecutor` on Base mainnet + the
735
+ * entire Base Sepolia row are still placeholder. See mocks/README.md
736
+ * for the deletion checklist.
670
737
  */
671
- declare function verifyMockMintRequestV2(domain: PointTokenDomainConfig, message: MockMintRequestV2, signature: Hex, expectedSigner: Address): Promise<SignatureVerification>;
672
738
 
673
739
  /**
674
- * ⚠️ MOCK`BurnConsent` EIP-712 type for the v1.4 reverse flow.
675
- *
676
- * New type entirely v0.2.x had no burn-for-credit flow.
677
- *
678
- * User signs `BurnConsent` to authorize burning `amount` PT from their
679
- * wallet in exchange for an off-chain credit of (amount - gasFee).
680
- * Signature is consumed either by:
681
- * - A relayer calling `PointToken.burnWithSig(...)` (Variant B)
682
- * - The paymaster-proxy-sponsored UserOp calling `PointToken.burn(...)`
683
- * with msg.sender = user via EIP-7702 (Variant A)
684
- *
685
- * Either way the tx emits `Transfer(user → 0x0)` which the issuer's
686
- * `BurnIndexer` watches for and uses to credit the off-chain ledger.
687
- *
688
- * Field list is a best-guess — SC team may add fields (e.g. `feeAmount`
689
- * explicit, `extData`). Update this mock when they freeze the spec.
740
+ * Signature structkept for consumers that want the tuple form.
741
+ * Most v1.4 paths pass `bytes` (serialized signature) directly to the
742
+ * contract; this struct is only needed if you're manually splitting
743
+ * for other on-chain verifiers.
690
744
  */
691
- interface MockBurnConsent {
692
- user: Address;
693
- pointToken: Address;
694
- amount: bigint;
695
- nonce: bigint;
696
- deadline: bigint;
745
+ interface SignatureStruct {
746
+ v: number;
747
+ r: `0x${string}`;
748
+ s: `0x${string}`;
697
749
  }
698
- declare const MOCK_BURN_CONSENT_TYPES: {
699
- readonly BurnConsent: readonly [{
700
- readonly name: "user";
701
- readonly type: "address";
702
- }, {
703
- readonly name: "pointToken";
704
- readonly type: "address";
705
- }, {
706
- readonly name: "amount";
707
- readonly type: "uint256";
708
- }, {
709
- readonly name: "nonce";
710
- readonly type: "uint256";
711
- }, {
712
- readonly name: "deadline";
713
- readonly type: "uint256";
714
- }];
715
- };
716
- declare function buildMockBurnConsentTypedData(domain: PointTokenDomainConfig, message: MockBurnConsent): {
717
- domain: {
718
- name: string;
719
- version: "1";
720
- chainId: number;
721
- verifyingContract: `0x${string}`;
722
- };
723
- types: {
724
- readonly BurnConsent: readonly [{
725
- readonly name: "user";
726
- readonly type: "address";
727
- }, {
728
- readonly name: "pointToken";
729
- readonly type: "address";
730
- }, {
731
- readonly name: "amount";
732
- readonly type: "uint256";
733
- }, {
734
- readonly name: "nonce";
735
- readonly type: "uint256";
736
- }, {
737
- readonly name: "deadline";
738
- readonly type: "uint256";
739
- }];
740
- };
741
- primaryType: "BurnConsent";
742
- message: MockBurnConsent;
743
- };
744
- declare function signMockBurnConsent(walletClient: WalletClient, domain: PointTokenDomainConfig, message: MockBurnConsent): Promise<EIP712Signature>;
745
- declare function verifyMockBurnConsent(domain: PointTokenDomainConfig, message: MockBurnConsent, signature: Hex, expectedUser: Address): Promise<SignatureVerification>;
746
750
 
747
751
  /**
748
752
  * Options for opening a PAFI Web modal — passed through by all adapters.
@@ -1088,4 +1092,4 @@ declare class PafiSDK {
1088
1092
  signLoginMessage(message: string): Promise<Hex>;
1089
1093
  }
1090
1094
 
1091
- 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, MOCK_MINT_REQUEST_V2_TYPES as MINT_REQUEST_V2_TYPES, MintParams, MintRequest, type MockMintRequestV2 as MintRequestV2, 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, MOCK_RELAYER_V2_ABI as RELAYER_V2_ABI, MOCK_RELAYER_V2_MINT_SELECTOR as RELAYER_V2_MINT_SELECTOR, ReceiverConsent, SUPPORTED_CHAINS, type MockSignatureStruct as SignatureStruct, SignatureVerification, SigningError, SimulationError, SimulationResult, type SponsorshipScenario, type SubmissionPath, SwapParams, SwapSimulationResult, UNIVERSAL_ROUTER_ADDRESSES, UserOperation, V4_QUOTER_ADDRESSES, _resetPaymasterConfigForTests, assembleUserOperation, buildMockBurnConsentTypedData as buildBurnConsentTypedData, buildMockMintRequestV2TypedData as buildMintRequestV2TypedData, buildPartialUserOperation, checkEthAndBranch, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, getMockAddresses as getContractAddresses, getPafiWebModalAdapter, getPaymasterConfig, isPaymasterConfigured, mintRequestTypes, openPafiWebModal, openWebPopup, rawCallOp, receiverConsentTypes, setPafiWebModalAdapter, setPaymasterConfig, signMockBurnConsent as signBurnConsent, signMockMintRequestV2 as signMintRequestV2, verifyMockBurnConsent as verifyBurnConsent, verifyMockMintRequestV2 as verifyMintRequestV2, webPopupAdapter };
1095
+ 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, BestQuote, type BuildPartialUserOpParams, COMMON_POOLS, COMMON_TOKENS, MOCK_ADDRESSES as CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, EIP712Signature, LoginMessageParams, MintParams, MintRequest, type ModalOpenOptions, Operation, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, 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, buildPartialUserOperation, burnRequestTypes, checkEthAndBranch, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, getMockAddresses as getContractAddresses, getPafiWebModalAdapter, getPaymasterConfig, isPaymasterConfigured, mintRequestTypes, openPafiWebModal, openWebPopup, rawCallOp, receiverConsentTypes, setPafiWebModalAdapter, setPaymasterConfig, webPopupAdapter };