@pafi-dev/issuer 0.5.31 → 0.5.32
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.
- package/README.md +41 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,10 +17,10 @@ ledger, policy engine, EIP-712 issuer signing, relay submission, and mint/burn e
|
|
|
17
17
|
- TypeScript >= 5.0
|
|
18
18
|
- `viem` ^2.0.0 and `@pafi-dev/core` ^0.5.16 (peer dependencies)
|
|
19
19
|
|
|
20
|
-
> **Latest:** `0.5.
|
|
21
|
-
>
|
|
22
|
-
>
|
|
23
|
-
>
|
|
20
|
+
> **Latest:** `0.5.31` — `RelayService.prepareMint` / `prepareBurn`
|
|
21
|
+
> now auto-quote the operator fee and auto-resolve the PAFI fee
|
|
22
|
+
> recipient. Drop `feeAmount` / `feeRecipient` from your call sites;
|
|
23
|
+
> SDK reads gas price + Chainlink + V4 subgraph internally. See
|
|
24
24
|
> [Changelog](#changelog).
|
|
25
25
|
|
|
26
26
|
---
|
|
@@ -386,6 +386,43 @@ try {
|
|
|
386
386
|
|
|
387
387
|
## Changelog
|
|
388
388
|
|
|
389
|
+
### 0.5.31
|
|
390
|
+
|
|
391
|
+
`RelayService.prepareMint` / `prepareBurn` now auto-quote the operator
|
|
392
|
+
fee + auto-resolve the PAFI fee recipient when the service is
|
|
393
|
+
constructed with `provider + chainId`. `createIssuerService` wires
|
|
394
|
+
this automatically — issuer integrations don't need to change
|
|
395
|
+
anything to pick it up.
|
|
396
|
+
|
|
397
|
+
**API changes** (additive, backwards-compatible):
|
|
398
|
+
|
|
399
|
+
- `RelayService` constructor accepts an optional `RelayServiceConfig`
|
|
400
|
+
with `provider` + `chainId`. When set, callers can drop `feeAmount`
|
|
401
|
+
/ `feeRecipient` from `prepareMint` / `prepareBurn` calls — the
|
|
402
|
+
service runs `quoteOperatorFeePt` (Chainlink ETH/USD + V4 subgraph
|
|
403
|
+
PT/USDT spot price) internally and pulls the canonical recipient
|
|
404
|
+
from `getContractAddresses(chainId).pafiFeeRecipient`.
|
|
405
|
+
- `prepareBurn` is now `async` (was sync) — the auto-quote requires
|
|
406
|
+
RPC + subgraph reads. Callers must `await`. `PTRedeemHandler`
|
|
407
|
+
already does this.
|
|
408
|
+
- `feeAmount: 0n` explicit means "no fee transfer" (force unsponsored
|
|
409
|
+
fallback variant). `undefined` means "auto-quote".
|
|
410
|
+
- Existing callers that pass `feeAmount + feeRecipient` keep working
|
|
411
|
+
— those values override the auto-resolve.
|
|
412
|
+
|
|
413
|
+
**Migration**: in your controller, drop the manual fee fetch when
|
|
414
|
+
calling `relayService.prepareMint`:
|
|
415
|
+
|
|
416
|
+
```diff
|
|
417
|
+
- const { pafiFeeRecipient: feeRecipient } = getContractAddresses(chainId);
|
|
418
|
+
- const feeAmount = await issuerService.fee.estimateGasFee();
|
|
419
|
+
const userOp = await relayService.prepareMint({
|
|
420
|
+
...,
|
|
421
|
+
- feeAmount,
|
|
422
|
+
- feeRecipient,
|
|
423
|
+
});
|
|
424
|
+
```
|
|
425
|
+
|
|
389
426
|
### 0.5.28
|
|
390
427
|
|
|
391
428
|
`PafiBackendClient.getUserOpReceipt(userOpHash)` added.
|