@pafi-dev/issuer 0.5.42 → 0.6.0
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/dist/index.cjs +138 -536
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -343
- package/dist/index.d.ts +49 -343
- package/dist/index.js +95 -498
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -34,10 +34,11 @@ __export(index_exports, {
|
|
|
34
34
|
IssuerStateError: () => IssuerStateError,
|
|
35
35
|
IssuerStateValidator: () => IssuerStateValidator,
|
|
36
36
|
LockNotFoundError: () => LockNotFoundError,
|
|
37
|
+
MemoryPendingUserOpStore: () => MemoryPendingUserOpStore,
|
|
37
38
|
MemorySessionStore: () => MemorySessionStore,
|
|
38
39
|
NonceManager: () => NonceManager,
|
|
39
40
|
PAFI_ISSUER_SDK_VERSION: () => PAFI_ISSUER_SDK_VERSION,
|
|
40
|
-
PAFI_SUBGRAPH_URL: () =>
|
|
41
|
+
PAFI_SUBGRAPH_URL: () => import_core12.PAFI_SUBGRAPH_URL,
|
|
41
42
|
PTClaimError: () => PTClaimError,
|
|
42
43
|
PTClaimHandler: () => PTClaimHandler,
|
|
43
44
|
PTRedeemError: () => PTRedeemError,
|
|
@@ -52,10 +53,6 @@ __export(index_exports, {
|
|
|
52
53
|
PointIndexer: () => PointIndexer,
|
|
53
54
|
RelayError: () => RelayError,
|
|
54
55
|
RelayService: () => RelayService,
|
|
55
|
-
SwapError: () => SwapError,
|
|
56
|
-
SwapHandler: () => SwapHandler,
|
|
57
|
-
TopUpRedemptionError: () => TopUpRedemptionError,
|
|
58
|
-
TopUpRedemptionHandler: () => TopUpRedemptionHandler,
|
|
59
56
|
authenticateRequest: () => authenticateRequest,
|
|
60
57
|
createIssuerService: () => createIssuerService,
|
|
61
58
|
createNativePtQuoter: () => createNativePtQuoter,
|
|
@@ -69,7 +66,6 @@ __export(index_exports, {
|
|
|
69
66
|
handleRedeemStatus: () => handleRedeemStatus,
|
|
70
67
|
mergePaymasterFields: () => mergePaymasterFields,
|
|
71
68
|
prepareMobileUserOp: () => prepareMobileUserOp,
|
|
72
|
-
quotePointTokenToUsdt: () => quotePointTokenToUsdt,
|
|
73
69
|
relayUserOp: () => relayUserOp,
|
|
74
70
|
requestPaymaster: () => requestPaymaster,
|
|
75
71
|
serializeEntryToJsonRpc: () => serializeEntryToJsonRpc,
|
|
@@ -640,15 +636,13 @@ var RelayService = class {
|
|
|
640
636
|
});
|
|
641
637
|
}
|
|
642
638
|
/**
|
|
643
|
-
* Build an unsigned UserOp for Scenario 2 (Burn/Redeem)
|
|
639
|
+
* Build an unsigned UserOp for Scenario 2 (Burn/Redeem) — sig-gated
|
|
640
|
+
* `PointToken.burn(from, amount, deadline, burnerSig)`. Caller
|
|
641
|
+
* provides a pre-signed `BurnRequest` + sig bytes (typically from
|
|
642
|
+
* `PTRedeemHandler`).
|
|
644
643
|
*
|
|
645
|
-
*
|
|
646
|
-
*
|
|
647
|
-
* usable if the caller (via EIP-7702) is whitelisted as a burner.
|
|
648
|
-
* Rare in v1.4; kept for admin/operator tools.
|
|
649
|
-
* - `mode: 'burnWithSig'` — `PointToken.burn(from, amount, deadline,
|
|
650
|
-
* burnerSig)`. Caller provides a pre-signed `BurnRequest` + sig
|
|
651
|
-
* bytes (typically from `PTRedeemHandler`).
|
|
644
|
+
* Direct burn (no sig) was dropped in v1.4 — every burn now goes
|
|
645
|
+
* through the issuer-signed `BurnRequest` path.
|
|
652
646
|
*/
|
|
653
647
|
async prepareBurn(params) {
|
|
654
648
|
if (!params.pointTokenAddress) {
|
|
@@ -660,29 +654,24 @@ var RelayService = class {
|
|
|
660
654
|
"prepareBurn: batchExecutorAddress required"
|
|
661
655
|
);
|
|
662
656
|
}
|
|
657
|
+
if (!params.burnRequest || !params.burnerSignature) {
|
|
658
|
+
throw new RelayError(
|
|
659
|
+
"ENCODE_FAILED",
|
|
660
|
+
"prepareBurn: burnRequest + burnerSignature required"
|
|
661
|
+
);
|
|
662
|
+
}
|
|
663
663
|
let burnCallData;
|
|
664
664
|
try {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
params.burnRequest.deadline,
|
|
676
|
-
params.burnerSignature
|
|
677
|
-
]
|
|
678
|
-
});
|
|
679
|
-
} else {
|
|
680
|
-
burnCallData = (0, import_viem3.encodeFunctionData)({
|
|
681
|
-
abi: import_core2.POINT_TOKEN_V2_ABI,
|
|
682
|
-
functionName: "burn",
|
|
683
|
-
args: [params.userAddress, params.amount]
|
|
684
|
-
});
|
|
685
|
-
}
|
|
665
|
+
burnCallData = (0, import_viem3.encodeFunctionData)({
|
|
666
|
+
abi: import_core2.POINT_TOKEN_V2_ABI,
|
|
667
|
+
functionName: "burn",
|
|
668
|
+
args: [
|
|
669
|
+
params.burnRequest.from,
|
|
670
|
+
params.burnRequest.amount,
|
|
671
|
+
params.burnRequest.deadline,
|
|
672
|
+
params.burnerSignature
|
|
673
|
+
]
|
|
674
|
+
});
|
|
686
675
|
} catch (err) {
|
|
687
676
|
throw new RelayError(
|
|
688
677
|
"ENCODE_FAILED",
|
|
@@ -1150,7 +1139,6 @@ var IssuerApiHandlers = class {
|
|
|
1150
1139
|
pafiWebUrl;
|
|
1151
1140
|
feeManager;
|
|
1152
1141
|
poolsProvider;
|
|
1153
|
-
claim;
|
|
1154
1142
|
constructor(config) {
|
|
1155
1143
|
this.authService = config.authService;
|
|
1156
1144
|
this.ledger = config.ledger;
|
|
@@ -1168,7 +1156,6 @@ var IssuerApiHandlers = class {
|
|
|
1168
1156
|
if (config.pafiWebUrl) this.pafiWebUrl = config.pafiWebUrl;
|
|
1169
1157
|
if (config.feeManager) this.feeManager = config.feeManager;
|
|
1170
1158
|
if (config.poolsProvider) this.poolsProvider = config.poolsProvider;
|
|
1171
|
-
if (config.claim) this.claim = config.claim;
|
|
1172
1159
|
}
|
|
1173
1160
|
// =========================================================================
|
|
1174
1161
|
// Public handlers (no auth required)
|
|
@@ -1302,91 +1289,9 @@ var IssuerApiHandlers = class {
|
|
|
1302
1289
|
isMinter: minter
|
|
1303
1290
|
};
|
|
1304
1291
|
}
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
* Policy gate + ledger lock + MintRequest signing in a single atomic
|
|
1309
|
-
* step. Returns an unsigned UserOp the frontend attaches paymaster data
|
|
1310
|
-
* to and submits via EIP-7702 + Bundler.
|
|
1311
|
-
*
|
|
1312
|
-
* Order of operations:
|
|
1313
|
-
* 1. Validate request fields.
|
|
1314
|
-
* 2. policy.evaluate() — throws if denied; cannot be bypassed.
|
|
1315
|
-
* 3. ledger.lockForMinting() — reserves the balance.
|
|
1316
|
-
* 4. Read on-chain mintRequestNonce + token name in parallel.
|
|
1317
|
-
* 5. relayService.prepareMint() — sign MintRequest + encode UserOp.
|
|
1318
|
-
* 6. On any error after step 3, release the lock before re-throwing.
|
|
1319
|
-
*/
|
|
1320
|
-
async handleClaim(userAddress, request) {
|
|
1321
|
-
if (!this.claim) {
|
|
1322
|
-
throw new Error("handleClaim: claim is not configured on this issuer");
|
|
1323
|
-
}
|
|
1324
|
-
if (request.chainId !== this.chainId) {
|
|
1325
|
-
throw new Error(`handleClaim: unsupported chainId ${request.chainId}`);
|
|
1326
|
-
}
|
|
1327
|
-
const pointToken = (0, import_viem6.getAddress)(request.pointTokenAddress);
|
|
1328
|
-
if (!this.supportedTokens.has(pointToken)) {
|
|
1329
|
-
throw new Error(`handleClaim: unsupported pointToken ${pointToken}`);
|
|
1330
|
-
}
|
|
1331
|
-
if (request.amount <= 0n) {
|
|
1332
|
-
throw new Error("handleClaim: amount must be positive");
|
|
1333
|
-
}
|
|
1334
|
-
const nowSecs = BigInt(Math.floor(Date.now() / 1e3));
|
|
1335
|
-
if (request.deadline <= nowSecs) {
|
|
1336
|
-
throw new Error("handleClaim: deadline is in the past");
|
|
1337
|
-
}
|
|
1338
|
-
const { policy, relayService, issuerSignerWallet, batchExecutorAddress } = this.claim;
|
|
1339
|
-
const lockDurationMs = this.claim.lockDurationMs ?? 15 * 60 * 1e3;
|
|
1340
|
-
const normalizedUser = (0, import_viem6.getAddress)(userAddress);
|
|
1341
|
-
const decision = await policy.evaluate({
|
|
1342
|
-
userAddress: normalizedUser,
|
|
1343
|
-
amount: request.amount,
|
|
1344
|
-
pointTokenAddress: pointToken,
|
|
1345
|
-
chainId: this.chainId
|
|
1346
|
-
});
|
|
1347
|
-
if (!decision.approved) {
|
|
1348
|
-
throw new Error(`handleClaim: policy denied \u2014 ${decision.reason ?? "no reason given"}`);
|
|
1349
|
-
}
|
|
1350
|
-
const lockId = await this.ledger.lockForMinting(
|
|
1351
|
-
normalizedUser,
|
|
1352
|
-
request.amount,
|
|
1353
|
-
lockDurationMs,
|
|
1354
|
-
pointToken
|
|
1355
|
-
);
|
|
1356
|
-
try {
|
|
1357
|
-
const [mintRequestNonce, tokenName] = await Promise.all([
|
|
1358
|
-
(0, import_core3.getMintRequestNonce)(this.provider, pointToken, normalizedUser),
|
|
1359
|
-
(0, import_core3.getTokenName)(this.provider, pointToken)
|
|
1360
|
-
]);
|
|
1361
|
-
const domain = {
|
|
1362
|
-
name: tokenName,
|
|
1363
|
-
verifyingContract: pointToken,
|
|
1364
|
-
chainId: this.chainId
|
|
1365
|
-
};
|
|
1366
|
-
const userOp = await relayService.prepareMint({
|
|
1367
|
-
userAddress: normalizedUser,
|
|
1368
|
-
aaNonce: request.aaNonce,
|
|
1369
|
-
batchExecutorAddress,
|
|
1370
|
-
pointTokenAddress: pointToken,
|
|
1371
|
-
amount: request.amount,
|
|
1372
|
-
issuerSignerWallet,
|
|
1373
|
-
domain,
|
|
1374
|
-
mintRequestNonce,
|
|
1375
|
-
deadline: request.deadline,
|
|
1376
|
-
feeAmount: request.feeAmount,
|
|
1377
|
-
feeRecipient: request.feeRecipient
|
|
1378
|
-
});
|
|
1379
|
-
return {
|
|
1380
|
-
lockId,
|
|
1381
|
-
userOp,
|
|
1382
|
-
expiresInSeconds: Math.floor(lockDurationMs / 1e3)
|
|
1383
|
-
};
|
|
1384
|
-
} catch (err) {
|
|
1385
|
-
await this.ledger.releaseLock(lockId).catch(() => {
|
|
1386
|
-
});
|
|
1387
|
-
throw err;
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1292
|
+
// Note: legacy `handleClaim` (sync sponsored-claim returning calls[]) was
|
|
1293
|
+
// removed in 0.5.43 — callers should use `PTClaimHandler` directly or
|
|
1294
|
+
// wire `IssuerApiAdapter.claim()` which composes the full flow.
|
|
1390
1295
|
};
|
|
1391
1296
|
|
|
1392
1297
|
// src/api/handlers/ptRedeemHandler.ts
|
|
@@ -1625,70 +1530,6 @@ var PTRedeemHandler = class {
|
|
|
1625
1530
|
}
|
|
1626
1531
|
};
|
|
1627
1532
|
|
|
1628
|
-
// src/api/handlers/topUpRedemptionHandler.ts
|
|
1629
|
-
var import_viem8 = require("viem");
|
|
1630
|
-
var import_core5 = require("@pafi-dev/core");
|
|
1631
|
-
var TopUpRedemptionError = class extends Error {
|
|
1632
|
-
constructor(code, message) {
|
|
1633
|
-
super(message);
|
|
1634
|
-
this.code = code;
|
|
1635
|
-
this.name = "TopUpRedemptionError";
|
|
1636
|
-
}
|
|
1637
|
-
code;
|
|
1638
|
-
};
|
|
1639
|
-
var TopUpRedemptionHandler = class {
|
|
1640
|
-
ledger;
|
|
1641
|
-
ptRedeemHandler;
|
|
1642
|
-
provider;
|
|
1643
|
-
pointTokenAddress;
|
|
1644
|
-
constructor(config) {
|
|
1645
|
-
this.ledger = config.ledger;
|
|
1646
|
-
this.ptRedeemHandler = config.ptRedeemHandler;
|
|
1647
|
-
this.provider = config.provider;
|
|
1648
|
-
this.pointTokenAddress = (0, import_viem8.getAddress)(config.pointTokenAddress);
|
|
1649
|
-
}
|
|
1650
|
-
async handle(request) {
|
|
1651
|
-
if ((0, import_viem8.getAddress)(request.authenticatedAddress) !== (0, import_viem8.getAddress)(request.userAddress)) {
|
|
1652
|
-
throw new TopUpRedemptionError(
|
|
1653
|
-
"UNAUTHORIZED",
|
|
1654
|
-
`userAddress (${request.userAddress}) does not match authenticated session (${request.authenticatedAddress})`
|
|
1655
|
-
);
|
|
1656
|
-
}
|
|
1657
|
-
const offChainBalance = await this.ledger.getBalance(
|
|
1658
|
-
request.userAddress,
|
|
1659
|
-
this.pointTokenAddress
|
|
1660
|
-
);
|
|
1661
|
-
if (offChainBalance >= request.requiredAmount) {
|
|
1662
|
-
return { action: "NO_TOP_UP_NEEDED", offChainBalance };
|
|
1663
|
-
}
|
|
1664
|
-
const shortfall = request.requiredAmount - offChainBalance;
|
|
1665
|
-
const onChainBalance = await (0, import_core5.getPointTokenBalance)(
|
|
1666
|
-
this.provider,
|
|
1667
|
-
this.pointTokenAddress,
|
|
1668
|
-
request.userAddress
|
|
1669
|
-
);
|
|
1670
|
-
if (onChainBalance < shortfall) {
|
|
1671
|
-
return {
|
|
1672
|
-
action: "INSUFFICIENT_ONCHAIN",
|
|
1673
|
-
offChainBalance,
|
|
1674
|
-
onChainBalance,
|
|
1675
|
-
shortfall
|
|
1676
|
-
};
|
|
1677
|
-
}
|
|
1678
|
-
const redeem = await this.ptRedeemHandler.handle({
|
|
1679
|
-
authenticatedAddress: request.authenticatedAddress,
|
|
1680
|
-
userAddress: request.userAddress,
|
|
1681
|
-
amount: shortfall,
|
|
1682
|
-
aaNonce: request.aaNonce
|
|
1683
|
-
});
|
|
1684
|
-
return {
|
|
1685
|
-
action: "TOP_UP_STARTED",
|
|
1686
|
-
shortfall,
|
|
1687
|
-
redeem
|
|
1688
|
-
};
|
|
1689
|
-
}
|
|
1690
|
-
};
|
|
1691
|
-
|
|
1692
1533
|
// src/api/statusHandlers.ts
|
|
1693
1534
|
var LockNotFoundError = class extends PafiSdkError {
|
|
1694
1535
|
code = "LOCK_NOT_FOUND";
|
|
@@ -1790,11 +1631,11 @@ async function handleRedeemStatus(params) {
|
|
|
1790
1631
|
}
|
|
1791
1632
|
|
|
1792
1633
|
// src/api/mobileHandlers.ts
|
|
1793
|
-
var
|
|
1794
|
-
var
|
|
1634
|
+
var import_viem8 = require("viem");
|
|
1635
|
+
var import_core7 = require("@pafi-dev/core");
|
|
1795
1636
|
|
|
1796
1637
|
// src/userop-store/serialize.ts
|
|
1797
|
-
var
|
|
1638
|
+
var import_core5 = require("@pafi-dev/core");
|
|
1798
1639
|
function serializeEntryToJsonRpc(entry, signature, variant = "sponsored") {
|
|
1799
1640
|
if (variant === "fallback") {
|
|
1800
1641
|
if (!entry.fallback) {
|
|
@@ -1802,7 +1643,7 @@ function serializeEntryToJsonRpc(entry, signature, variant = "sponsored") {
|
|
|
1802
1643
|
"serializeEntryToJsonRpc: variant=fallback requested but the stored entry has no `fallback` branch \u2014 caller should resubmit with variant='sponsored' or re-prepare with a fee configured."
|
|
1803
1644
|
);
|
|
1804
1645
|
}
|
|
1805
|
-
return (0,
|
|
1646
|
+
return (0, import_core5.serializeUserOpToJsonRpc)(
|
|
1806
1647
|
{
|
|
1807
1648
|
sender: entry.sender,
|
|
1808
1649
|
nonce: BigInt(entry.nonce),
|
|
@@ -1817,7 +1658,7 @@ function serializeEntryToJsonRpc(entry, signature, variant = "sponsored") {
|
|
|
1817
1658
|
signature
|
|
1818
1659
|
);
|
|
1819
1660
|
}
|
|
1820
|
-
return (0,
|
|
1661
|
+
return (0, import_core5.serializeUserOpToJsonRpc)(
|
|
1821
1662
|
{
|
|
1822
1663
|
sender: entry.sender,
|
|
1823
1664
|
nonce: BigInt(entry.nonce),
|
|
@@ -1836,8 +1677,35 @@ function serializeEntryToJsonRpc(entry, signature, variant = "sponsored") {
|
|
|
1836
1677
|
);
|
|
1837
1678
|
}
|
|
1838
1679
|
|
|
1680
|
+
// src/userop-store/memoryStore.ts
|
|
1681
|
+
var MemoryPendingUserOpStore = class {
|
|
1682
|
+
entries = /* @__PURE__ */ new Map();
|
|
1683
|
+
now;
|
|
1684
|
+
constructor(now = () => Date.now()) {
|
|
1685
|
+
this.now = now;
|
|
1686
|
+
}
|
|
1687
|
+
async save(lockId, entry, ttlSeconds) {
|
|
1688
|
+
this.entries.set(lockId, {
|
|
1689
|
+
entry,
|
|
1690
|
+
expiresAt: this.now() + ttlSeconds * 1e3
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
async get(lockId) {
|
|
1694
|
+
const hit = this.entries.get(lockId);
|
|
1695
|
+
if (!hit) return null;
|
|
1696
|
+
if (hit.expiresAt <= this.now()) {
|
|
1697
|
+
this.entries.delete(lockId);
|
|
1698
|
+
return null;
|
|
1699
|
+
}
|
|
1700
|
+
return hit.entry;
|
|
1701
|
+
}
|
|
1702
|
+
async delete(lockId) {
|
|
1703
|
+
this.entries.delete(lockId);
|
|
1704
|
+
}
|
|
1705
|
+
};
|
|
1706
|
+
|
|
1839
1707
|
// src/userop-store/prepareUserOp.ts
|
|
1840
|
-
var
|
|
1708
|
+
var import_core6 = require("@pafi-dev/core");
|
|
1841
1709
|
function serializeUserOpTypedData(td) {
|
|
1842
1710
|
return {
|
|
1843
1711
|
domain: td.domain,
|
|
@@ -1872,9 +1740,9 @@ async function prepareMobileUserOp(params) {
|
|
|
1872
1740
|
params.partialUserOp,
|
|
1873
1741
|
params.paymasterFields
|
|
1874
1742
|
);
|
|
1875
|
-
const userOpHash = (0,
|
|
1743
|
+
const userOpHash = (0, import_core6.computeUserOpHash)(userOp, params.chainId);
|
|
1876
1744
|
const typedData = serializeUserOpTypedData(
|
|
1877
|
-
(0,
|
|
1745
|
+
(0, import_core6.buildUserOpTypedData)(userOp, params.chainId)
|
|
1878
1746
|
);
|
|
1879
1747
|
let fallback;
|
|
1880
1748
|
let fallbackEntry;
|
|
@@ -1884,9 +1752,9 @@ async function prepareMobileUserOp(params) {
|
|
|
1884
1752
|
maxFeePerGas: userOp.maxFeePerGas,
|
|
1885
1753
|
maxPriorityFeePerGas: userOp.maxPriorityFeePerGas
|
|
1886
1754
|
};
|
|
1887
|
-
const fallbackHash = (0,
|
|
1755
|
+
const fallbackHash = (0, import_core6.computeUserOpHash)(fallbackUserOp, params.chainId);
|
|
1888
1756
|
const fallbackTypedData = serializeUserOpTypedData(
|
|
1889
|
-
(0,
|
|
1757
|
+
(0, import_core6.buildUserOpTypedData)(fallbackUserOp, params.chainId)
|
|
1890
1758
|
);
|
|
1891
1759
|
fallback = {
|
|
1892
1760
|
userOp: fallbackUserOp,
|
|
@@ -2020,7 +1888,7 @@ async function handleMobilePrepare(params) {
|
|
|
2020
1888
|
params.provider.estimateFeesPerGas(),
|
|
2021
1889
|
params.provider.getCode({ address: params.userAddress })
|
|
2022
1890
|
]);
|
|
2023
|
-
const needsDelegation = (0,
|
|
1891
|
+
const needsDelegation = (0, import_core7.parseEip7702DelegatedAddress)(userCode) === null;
|
|
2024
1892
|
const sponsoredOp = {
|
|
2025
1893
|
...params.partialUserOp,
|
|
2026
1894
|
maxFeePerGas: fees.maxFeePerGas ?? params.partialUserOp.maxFeePerGas ?? 0n,
|
|
@@ -2054,7 +1922,7 @@ async function handleMobileSubmit(params) {
|
|
|
2054
1922
|
if (!entry) {
|
|
2055
1923
|
throw new PendingUserOpNotFoundError(params.lockId);
|
|
2056
1924
|
}
|
|
2057
|
-
if ((0,
|
|
1925
|
+
if ((0, import_viem8.getAddress)(entry.sender) !== (0, import_viem8.getAddress)(params.authenticatedAddress)) {
|
|
2058
1926
|
throw new PendingUserOpForbiddenError(params.lockId);
|
|
2059
1927
|
}
|
|
2060
1928
|
const variant = params.variant ?? "sponsored";
|
|
@@ -2062,7 +1930,7 @@ async function handleMobileSubmit(params) {
|
|
|
2062
1930
|
const result = await relayUserOp({
|
|
2063
1931
|
client: params.pafiBackendClient,
|
|
2064
1932
|
userOp: userOpJson,
|
|
2065
|
-
entryPoint: params.entryPoint ??
|
|
1933
|
+
entryPoint: params.entryPoint ?? import_core7.ENTRY_POINT_V08
|
|
2066
1934
|
});
|
|
2067
1935
|
await params.bindUserOpHash(params.lockId, result.userOpHash);
|
|
2068
1936
|
await params.store.delete(params.lockId);
|
|
@@ -2070,8 +1938,8 @@ async function handleMobileSubmit(params) {
|
|
|
2070
1938
|
}
|
|
2071
1939
|
|
|
2072
1940
|
// src/api/handlers/ptClaimHandler.ts
|
|
2073
|
-
var
|
|
2074
|
-
var
|
|
1941
|
+
var import_viem9 = require("viem");
|
|
1942
|
+
var import_core8 = require("@pafi-dev/core");
|
|
2075
1943
|
|
|
2076
1944
|
// src/issuer-state/types.ts
|
|
2077
1945
|
var IssuerStateError = class extends PafiSdkError {
|
|
@@ -2111,7 +1979,7 @@ var PTClaimHandler = class {
|
|
|
2111
1979
|
};
|
|
2112
1980
|
}
|
|
2113
1981
|
async handle(request) {
|
|
2114
|
-
if ((0,
|
|
1982
|
+
if ((0, import_viem9.getAddress)(request.authenticatedAddress) !== (0, import_viem9.getAddress)(request.userAddress)) {
|
|
2115
1983
|
throw new PTClaimError(
|
|
2116
1984
|
"VALIDATION_FAILED",
|
|
2117
1985
|
`userAddress (${request.userAddress}) does not match authenticated session (${request.authenticatedAddress})`
|
|
@@ -2134,7 +2002,7 @@ var PTClaimHandler = class {
|
|
|
2134
2002
|
);
|
|
2135
2003
|
}
|
|
2136
2004
|
}
|
|
2137
|
-
const { batchExecutor: batchExecutorAddress } = (0,
|
|
2005
|
+
const { batchExecutor: batchExecutorAddress } = (0, import_core8.getContractAddresses)(
|
|
2138
2006
|
request.chainId
|
|
2139
2007
|
);
|
|
2140
2008
|
const lockId = await this.cfg.ledger.lockForMinting(
|
|
@@ -2194,8 +2062,8 @@ var PTClaimHandler = class {
|
|
|
2194
2062
|
);
|
|
2195
2063
|
}
|
|
2196
2064
|
}
|
|
2197
|
-
const calls = (0,
|
|
2198
|
-
const callsFallback = fallback ? (0,
|
|
2065
|
+
const calls = (0, import_core8.decodeBatchExecuteCalls)(userOp.callData);
|
|
2066
|
+
const callsFallback = fallback ? (0, import_core8.decodeBatchExecuteCalls)(fallback.callData) : void 0;
|
|
2199
2067
|
return {
|
|
2200
2068
|
userOp,
|
|
2201
2069
|
fallback,
|
|
@@ -2209,140 +2077,8 @@ var PTClaimHandler = class {
|
|
|
2209
2077
|
}
|
|
2210
2078
|
};
|
|
2211
2079
|
|
|
2212
|
-
// src/api/handlers/swapHandler.ts
|
|
2213
|
-
var import_core10 = require("@pafi-dev/core");
|
|
2214
|
-
var SwapError = class extends PafiSdkError {
|
|
2215
|
-
httpStatus = "unprocessable";
|
|
2216
|
-
code;
|
|
2217
|
-
constructor(code, message) {
|
|
2218
|
-
super(message);
|
|
2219
|
-
this.code = code;
|
|
2220
|
-
}
|
|
2221
|
-
};
|
|
2222
|
-
var DEFAULT_SLIPPAGE_BPS = 50;
|
|
2223
|
-
var DEFAULT_SWAP_DEADLINE_SEC = 5 * 60;
|
|
2224
|
-
var SwapHandler = class {
|
|
2225
|
-
cfg;
|
|
2226
|
-
constructor(config) {
|
|
2227
|
-
this.cfg = {
|
|
2228
|
-
...config,
|
|
2229
|
-
defaultSlippageBps: config.defaultSlippageBps ?? DEFAULT_SLIPPAGE_BPS,
|
|
2230
|
-
defaultSwapDeadlineSeconds: config.defaultSwapDeadlineSeconds ?? DEFAULT_SWAP_DEADLINE_SEC,
|
|
2231
|
-
now: config.now ?? (() => Date.now())
|
|
2232
|
-
};
|
|
2233
|
-
}
|
|
2234
|
-
async handle(request) {
|
|
2235
|
-
if (request.amountIn <= 0n) {
|
|
2236
|
-
throw new SwapError("INVALID_AMOUNT", "amountIn must be positive");
|
|
2237
|
-
}
|
|
2238
|
-
const slippageBps = request.slippageBps ?? this.cfg.defaultSlippageBps;
|
|
2239
|
-
const { usdt, pafiFeeRecipient, universalRouter } = (0, import_core10.getContractAddresses)(
|
|
2240
|
-
request.chainId
|
|
2241
|
-
);
|
|
2242
|
-
const poolsResponse = await this.cfg.poolsProvider({
|
|
2243
|
-
chainId: request.chainId,
|
|
2244
|
-
pointTokenAddress: request.pointTokenAddress
|
|
2245
|
-
});
|
|
2246
|
-
if (poolsResponse.pools.length === 0) {
|
|
2247
|
-
throw new SwapError(
|
|
2248
|
-
"QUOTE_UNAVAILABLE",
|
|
2249
|
-
"no liquidity pool found for this point token"
|
|
2250
|
-
);
|
|
2251
|
-
}
|
|
2252
|
-
let fallbackQuote;
|
|
2253
|
-
try {
|
|
2254
|
-
fallbackQuote = await (0, import_core10.findBestQuote)(
|
|
2255
|
-
this.cfg.provider,
|
|
2256
|
-
request.chainId,
|
|
2257
|
-
request.pointTokenAddress,
|
|
2258
|
-
usdt,
|
|
2259
|
-
request.amountIn,
|
|
2260
|
-
poolsResponse.pools
|
|
2261
|
-
);
|
|
2262
|
-
} catch {
|
|
2263
|
-
throw new SwapError(
|
|
2264
|
-
"QUOTE_UNAVAILABLE",
|
|
2265
|
-
"no swap path found for this point token"
|
|
2266
|
-
);
|
|
2267
|
-
}
|
|
2268
|
-
const estimatedUsdtOutFallback = fallbackQuote.bestRoute.amountOut;
|
|
2269
|
-
const minAmountOutFallback = estimatedUsdtOutFallback * BigInt(1e4 - slippageBps) / 10000n;
|
|
2270
|
-
const deadline = request.deadline ?? BigInt(
|
|
2271
|
-
Math.floor(this.cfg.now() / 1e3) + this.cfg.defaultSwapDeadlineSeconds
|
|
2272
|
-
);
|
|
2273
|
-
const feeAmount = this.cfg.feeService ? await this.cfg.feeService.estimateGasFee() : 0n;
|
|
2274
|
-
if (feeAmount > 0n && feeAmount >= request.amountIn) {
|
|
2275
|
-
throw new SwapError(
|
|
2276
|
-
"FEE_EXCEEDS_AMOUNT",
|
|
2277
|
-
`gas fee (${feeAmount}) must be strictly less than swap amount (${request.amountIn})`
|
|
2278
|
-
);
|
|
2279
|
-
}
|
|
2280
|
-
const sponsoredAmountIn = request.amountIn - feeAmount;
|
|
2281
|
-
let estimatedUsdtOutSponsored = estimatedUsdtOutFallback;
|
|
2282
|
-
let sponsoredPath = fallbackQuote.bestRoute.path;
|
|
2283
|
-
if (feeAmount > 0n) {
|
|
2284
|
-
try {
|
|
2285
|
-
const sponsoredQuote = await (0, import_core10.findBestQuote)(
|
|
2286
|
-
this.cfg.provider,
|
|
2287
|
-
request.chainId,
|
|
2288
|
-
request.pointTokenAddress,
|
|
2289
|
-
usdt,
|
|
2290
|
-
sponsoredAmountIn,
|
|
2291
|
-
poolsResponse.pools
|
|
2292
|
-
);
|
|
2293
|
-
estimatedUsdtOutSponsored = sponsoredQuote.bestRoute.amountOut;
|
|
2294
|
-
sponsoredPath = sponsoredQuote.bestRoute.path;
|
|
2295
|
-
} catch {
|
|
2296
|
-
throw new SwapError(
|
|
2297
|
-
"QUOTE_UNAVAILABLE",
|
|
2298
|
-
"no swap path found for sponsored amount (after fee deduction)"
|
|
2299
|
-
);
|
|
2300
|
-
}
|
|
2301
|
-
}
|
|
2302
|
-
const minAmountOutSponsored = estimatedUsdtOutSponsored * BigInt(1e4 - slippageBps) / 10000n;
|
|
2303
|
-
const sponsoredOp = (0, import_core10.buildSwapWithGasDeduction)({
|
|
2304
|
-
userAddress: request.userAddress,
|
|
2305
|
-
aaNonce: request.aaNonce,
|
|
2306
|
-
pointTokenAddress: request.pointTokenAddress,
|
|
2307
|
-
outputTokenAddress: usdt,
|
|
2308
|
-
universalRouterAddress: universalRouter,
|
|
2309
|
-
amountIn: sponsoredAmountIn,
|
|
2310
|
-
minAmountOut: minAmountOutSponsored,
|
|
2311
|
-
swapPath: sponsoredPath,
|
|
2312
|
-
deadline,
|
|
2313
|
-
gasFeePt: feeAmount,
|
|
2314
|
-
feeRecipient: pafiFeeRecipient
|
|
2315
|
-
});
|
|
2316
|
-
const fallbackOp = feeAmount > 0n ? (0, import_core10.buildSwapWithGasDeduction)({
|
|
2317
|
-
userAddress: request.userAddress,
|
|
2318
|
-
aaNonce: request.aaNonce,
|
|
2319
|
-
pointTokenAddress: request.pointTokenAddress,
|
|
2320
|
-
outputTokenAddress: usdt,
|
|
2321
|
-
universalRouterAddress: universalRouter,
|
|
2322
|
-
amountIn: request.amountIn,
|
|
2323
|
-
minAmountOut: minAmountOutFallback,
|
|
2324
|
-
swapPath: fallbackQuote.bestRoute.path,
|
|
2325
|
-
deadline,
|
|
2326
|
-
gasFeePt: 0n,
|
|
2327
|
-
feeRecipient: pafiFeeRecipient
|
|
2328
|
-
}) : void 0;
|
|
2329
|
-
return {
|
|
2330
|
-
userOp: sponsoredOp,
|
|
2331
|
-
fallback: fallbackOp,
|
|
2332
|
-
feeAmount,
|
|
2333
|
-
estimatedUsdtOut: estimatedUsdtOutSponsored,
|
|
2334
|
-
minAmountOut: minAmountOutSponsored,
|
|
2335
|
-
estimatedUsdtOutFallback: fallbackOp ? estimatedUsdtOutFallback : void 0,
|
|
2336
|
-
minAmountOutFallback: fallbackOp ? minAmountOutFallback : void 0,
|
|
2337
|
-
deadline,
|
|
2338
|
-
calls: (0, import_core10.decodeBatchExecuteCalls)(sponsoredOp.callData),
|
|
2339
|
-
callsFallback: fallbackOp ? (0, import_core10.decodeBatchExecuteCalls)(fallbackOp.callData) : void 0
|
|
2340
|
-
};
|
|
2341
|
-
}
|
|
2342
|
-
};
|
|
2343
|
-
|
|
2344
2080
|
// src/api/handlers/perpDepositHandler.ts
|
|
2345
|
-
var
|
|
2081
|
+
var import_core9 = require("@pafi-dev/core");
|
|
2346
2082
|
var PerpDepositError = class extends PafiSdkError {
|
|
2347
2083
|
httpStatus = "unprocessable";
|
|
2348
2084
|
code;
|
|
@@ -2366,26 +2102,26 @@ var PerpDepositHandler = class {
|
|
|
2366
2102
|
if (request.amount <= 0n) {
|
|
2367
2103
|
throw new PerpDepositError("INVALID_AMOUNT", "amount must be positive");
|
|
2368
2104
|
}
|
|
2369
|
-
const brokerHash =
|
|
2370
|
-
const tokenHash =
|
|
2371
|
-
const vault =
|
|
2105
|
+
const brokerHash = import_core9.BROKER_HASHES[request.brokerId];
|
|
2106
|
+
const tokenHash = import_core9.TOKEN_HASHES.USDC;
|
|
2107
|
+
const vault = import_core9.ORDERLY_VAULT_ADDRESSES[request.chainId];
|
|
2372
2108
|
if (!vault) {
|
|
2373
2109
|
throw new PerpDepositError(
|
|
2374
2110
|
"PERP_DEPOSIT_UNAVAILABLE",
|
|
2375
2111
|
`no Orderly Vault for chainId ${request.chainId}`
|
|
2376
2112
|
);
|
|
2377
2113
|
}
|
|
2378
|
-
const { orderlyRelay: relayAddress, pafiFeeRecipient } = (0,
|
|
2114
|
+
const { orderlyRelay: relayAddress, pafiFeeRecipient } = (0, import_core9.getContractAddresses)(request.chainId);
|
|
2379
2115
|
const [usdcAddress, brokerAllowed] = await Promise.all([
|
|
2380
2116
|
this.cfg.provider.readContract({
|
|
2381
2117
|
address: vault,
|
|
2382
|
-
abi:
|
|
2118
|
+
abi: import_core9.ORDERLY_VAULT_ABI,
|
|
2383
2119
|
functionName: "getAllowedToken",
|
|
2384
2120
|
args: [tokenHash]
|
|
2385
2121
|
}),
|
|
2386
2122
|
this.cfg.provider.readContract({
|
|
2387
2123
|
address: vault,
|
|
2388
|
-
abi:
|
|
2124
|
+
abi: import_core9.ORDERLY_VAULT_ABI,
|
|
2389
2125
|
functionName: "getAllowedBroker",
|
|
2390
2126
|
args: [brokerHash]
|
|
2391
2127
|
})
|
|
@@ -2396,7 +2132,7 @@ var PerpDepositHandler = class {
|
|
|
2396
2132
|
`broker "${request.brokerId}" is not whitelisted on Orderly Vault`
|
|
2397
2133
|
);
|
|
2398
2134
|
}
|
|
2399
|
-
const accountId = (0,
|
|
2135
|
+
const accountId = (0, import_core9.computeAccountId)(request.userAddress, brokerHash);
|
|
2400
2136
|
const requestForQuote = {
|
|
2401
2137
|
token: usdcAddress,
|
|
2402
2138
|
receiver: request.userAddress,
|
|
@@ -2407,7 +2143,7 @@ var PerpDepositHandler = class {
|
|
|
2407
2143
|
const [relayTokenFee, ptGasFee] = await Promise.all([
|
|
2408
2144
|
this.cfg.provider.readContract({
|
|
2409
2145
|
address: relayAddress,
|
|
2410
|
-
abi:
|
|
2146
|
+
abi: import_core9.ORDERLY_RELAY_ABI,
|
|
2411
2147
|
functionName: "quoteTokenFee",
|
|
2412
2148
|
args: [requestForQuote]
|
|
2413
2149
|
}),
|
|
@@ -2427,7 +2163,7 @@ var PerpDepositHandler = class {
|
|
|
2427
2163
|
totalAmount: request.amount,
|
|
2428
2164
|
maxFee
|
|
2429
2165
|
};
|
|
2430
|
-
const sponsoredOp = (0,
|
|
2166
|
+
const sponsoredOp = (0, import_core9.buildPerpDepositViaRelay)({
|
|
2431
2167
|
userAddress: request.userAddress,
|
|
2432
2168
|
aaNonce: request.aaNonce,
|
|
2433
2169
|
relayAddress,
|
|
@@ -2436,7 +2172,7 @@ var PerpDepositHandler = class {
|
|
|
2436
2172
|
gasFeePt: ptGasFee,
|
|
2437
2173
|
gasFeePtRecipient: pafiFeeRecipient
|
|
2438
2174
|
});
|
|
2439
|
-
const fallbackOp = ptGasFee > 0n ? (0,
|
|
2175
|
+
const fallbackOp = ptGasFee > 0n ? (0, import_core9.buildPerpDepositViaRelay)({
|
|
2440
2176
|
userAddress: request.userAddress,
|
|
2441
2177
|
aaNonce: request.aaNonce,
|
|
2442
2178
|
relayAddress,
|
|
@@ -2453,22 +2189,22 @@ var PerpDepositHandler = class {
|
|
|
2453
2189
|
brokerHash,
|
|
2454
2190
|
usdcAddress,
|
|
2455
2191
|
relayAddress,
|
|
2456
|
-
calls: (0,
|
|
2457
|
-
callsFallback: fallbackOp ? (0,
|
|
2192
|
+
calls: (0, import_core9.decodeBatchExecuteCalls)(sponsoredOp.callData),
|
|
2193
|
+
callsFallback: fallbackOp ? (0, import_core9.decodeBatchExecuteCalls)(fallbackOp.callData) : void 0
|
|
2458
2194
|
};
|
|
2459
2195
|
}
|
|
2460
2196
|
};
|
|
2461
2197
|
|
|
2462
2198
|
// src/api/delegateHandler.ts
|
|
2463
|
-
var
|
|
2199
|
+
var import_core10 = require("@pafi-dev/core");
|
|
2464
2200
|
var DEFAULT_DELEGATE_GAS = {
|
|
2465
2201
|
callGasLimit: 100000n,
|
|
2466
2202
|
verificationGasLimit: 150000n,
|
|
2467
2203
|
preVerificationGas: 50000n
|
|
2468
2204
|
};
|
|
2469
2205
|
async function handleDelegateSubmit(params) {
|
|
2470
|
-
const { batchExecutor } = (0,
|
|
2471
|
-
const callData = (0,
|
|
2206
|
+
const { batchExecutor } = (0, import_core10.getContractAddresses)(params.chainId);
|
|
2207
|
+
const callData = (0, import_core10.encodeBatchExecute)([]);
|
|
2472
2208
|
const userOp = {
|
|
2473
2209
|
sender: params.userAddress,
|
|
2474
2210
|
nonce: params.aaNonce,
|
|
@@ -2491,7 +2227,7 @@ async function handleDelegateSubmit(params) {
|
|
|
2491
2227
|
...userOp,
|
|
2492
2228
|
...paymasterFields ?? {}
|
|
2493
2229
|
};
|
|
2494
|
-
const userOpJson = (0,
|
|
2230
|
+
const userOpJson = (0, import_core10.serializeUserOpToJsonRpc)(
|
|
2495
2231
|
{
|
|
2496
2232
|
sender: merged.sender,
|
|
2497
2233
|
nonce: merged.nonce,
|
|
@@ -2510,7 +2246,7 @@ async function handleDelegateSubmit(params) {
|
|
|
2510
2246
|
// is the user's "consent"; no separate AA signature is needed.
|
|
2511
2247
|
"0x"
|
|
2512
2248
|
);
|
|
2513
|
-
const authorization = (0,
|
|
2249
|
+
const authorization = (0, import_core10.buildEip7702Authorization)({
|
|
2514
2250
|
chainId: params.chainId,
|
|
2515
2251
|
address: batchExecutor,
|
|
2516
2252
|
nonce: params.delegationNonce,
|
|
@@ -2519,7 +2255,7 @@ async function handleDelegateSubmit(params) {
|
|
|
2519
2255
|
const result = await relayUserOp({
|
|
2520
2256
|
client: params.pafiBackendClient,
|
|
2521
2257
|
userOp: userOpJson,
|
|
2522
|
-
entryPoint:
|
|
2258
|
+
entryPoint: import_core10.ENTRY_POINT_V08,
|
|
2523
2259
|
eip7702Auth: authorization
|
|
2524
2260
|
});
|
|
2525
2261
|
return {
|
|
@@ -2529,71 +2265,6 @@ async function handleDelegateSubmit(params) {
|
|
|
2529
2265
|
};
|
|
2530
2266
|
}
|
|
2531
2267
|
|
|
2532
|
-
// src/api/quoteHelper.ts
|
|
2533
|
-
var import_core13 = require("@pafi-dev/core");
|
|
2534
|
-
var DEFAULT_DEADLINE_SECONDS = 300;
|
|
2535
|
-
async function quotePointTokenToUsdt(params) {
|
|
2536
|
-
const now = params.now ?? (() => Date.now());
|
|
2537
|
-
const suggestedDeadline = Math.floor(now() / 1e3) + (params.deadlineSeconds ?? DEFAULT_DEADLINE_SECONDS);
|
|
2538
|
-
if (params.pointAmount === 0n) {
|
|
2539
|
-
return {
|
|
2540
|
-
estimatedUsdtOut: 0n,
|
|
2541
|
-
netUsdtOut: 0n,
|
|
2542
|
-
exchangeRate: "0.00000000",
|
|
2543
|
-
gasEstimate: 0n,
|
|
2544
|
-
suggestedDeadline
|
|
2545
|
-
};
|
|
2546
|
-
}
|
|
2547
|
-
if (params.pools.length === 0) {
|
|
2548
|
-
return {
|
|
2549
|
-
estimatedUsdtOut: 0n,
|
|
2550
|
-
netUsdtOut: 0n,
|
|
2551
|
-
exchangeRate: "0.00000000",
|
|
2552
|
-
gasEstimate: 0n,
|
|
2553
|
-
suggestedDeadline,
|
|
2554
|
-
quoteError: "QUOTE_UNAVAILABLE"
|
|
2555
|
-
};
|
|
2556
|
-
}
|
|
2557
|
-
const { usdt: usdtAddress } = (0, import_core13.getContractAddresses)(params.chainId);
|
|
2558
|
-
let estimatedUsdtOut = 0n;
|
|
2559
|
-
let gasEstimate = 0n;
|
|
2560
|
-
try {
|
|
2561
|
-
const best = await (0, import_core13.findBestQuote)(
|
|
2562
|
-
params.provider,
|
|
2563
|
-
params.chainId,
|
|
2564
|
-
params.pointTokenAddress,
|
|
2565
|
-
usdtAddress,
|
|
2566
|
-
params.pointAmount,
|
|
2567
|
-
params.pools
|
|
2568
|
-
);
|
|
2569
|
-
estimatedUsdtOut = best.bestRoute.amountOut;
|
|
2570
|
-
gasEstimate = best.bestRoute.gasEstimate;
|
|
2571
|
-
} catch {
|
|
2572
|
-
return {
|
|
2573
|
-
estimatedUsdtOut: 0n,
|
|
2574
|
-
netUsdtOut: 0n,
|
|
2575
|
-
exchangeRate: "0.00000000",
|
|
2576
|
-
gasEstimate: 0n,
|
|
2577
|
-
suggestedDeadline,
|
|
2578
|
-
quoteError: "QUOTE_UNAVAILABLE"
|
|
2579
|
-
};
|
|
2580
|
-
}
|
|
2581
|
-
const netUsdtOut = estimatedUsdtOut > params.gasFeeUsdt ? estimatedUsdtOut - params.gasFeeUsdt : 0n;
|
|
2582
|
-
const quoteError = estimatedUsdtOut > 0n && netUsdtOut === 0n ? "AMOUNT_TOO_SMALL_FOR_GAS" : void 0;
|
|
2583
|
-
const rateNum = estimatedUsdtOut > 0n ? Number(
|
|
2584
|
-
estimatedUsdtOut * 1000000n * 10n ** 18n / params.pointAmount
|
|
2585
|
-
) / 1e6 : 0;
|
|
2586
|
-
const exchangeRate = rateNum.toFixed(8);
|
|
2587
|
-
return {
|
|
2588
|
-
estimatedUsdtOut,
|
|
2589
|
-
netUsdtOut,
|
|
2590
|
-
exchangeRate,
|
|
2591
|
-
gasEstimate,
|
|
2592
|
-
suggestedDeadline,
|
|
2593
|
-
...quoteError ? { quoteError } : {}
|
|
2594
|
-
};
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2597
2268
|
// src/api/errorMapper.ts
|
|
2598
2269
|
function createSdkErrorMapper(factories) {
|
|
2599
2270
|
return (err) => {
|
|
@@ -2620,8 +2291,8 @@ function createSdkErrorMapper(factories) {
|
|
|
2620
2291
|
}
|
|
2621
2292
|
|
|
2622
2293
|
// src/api/issuerApiAdapter.ts
|
|
2623
|
-
var
|
|
2624
|
-
var
|
|
2294
|
+
var import_viem10 = require("viem");
|
|
2295
|
+
var import_core11 = require("@pafi-dev/core");
|
|
2625
2296
|
var IssuerApiAdapter = class {
|
|
2626
2297
|
cfg;
|
|
2627
2298
|
constructor(config) {
|
|
@@ -2642,7 +2313,7 @@ var IssuerApiAdapter = class {
|
|
|
2642
2313
|
async pools(authenticatedAddress, chainId, pointTokenAddress) {
|
|
2643
2314
|
const result = await this.cfg.issuerService.api.handlePools(
|
|
2644
2315
|
authenticatedAddress,
|
|
2645
|
-
{ chainId, pointTokenAddress: (0,
|
|
2316
|
+
{ chainId, pointTokenAddress: (0, import_viem10.getAddress)(pointTokenAddress) }
|
|
2646
2317
|
);
|
|
2647
2318
|
return { pools: result.pools };
|
|
2648
2319
|
}
|
|
@@ -2651,8 +2322,8 @@ var IssuerApiAdapter = class {
|
|
|
2651
2322
|
authenticatedAddress,
|
|
2652
2323
|
{
|
|
2653
2324
|
chainId,
|
|
2654
|
-
userAddress: (0,
|
|
2655
|
-
pointTokenAddress: (0,
|
|
2325
|
+
userAddress: (0, import_viem10.getAddress)(userAddress),
|
|
2326
|
+
pointTokenAddress: (0, import_viem10.getAddress)(pointTokenAddress)
|
|
2656
2327
|
}
|
|
2657
2328
|
);
|
|
2658
2329
|
return {
|
|
@@ -2665,34 +2336,8 @@ var IssuerApiAdapter = class {
|
|
|
2665
2336
|
isMinter: result.isMinter
|
|
2666
2337
|
};
|
|
2667
2338
|
}
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
this.cfg.issuerService.api.handleGasFee(),
|
|
2671
|
-
this.cfg.issuerService.api.handlePools(authenticatedAddress, {
|
|
2672
|
-
chainId,
|
|
2673
|
-
pointTokenAddress: (0, import_viem11.getAddress)(pointTokenAddress)
|
|
2674
|
-
})
|
|
2675
|
-
]);
|
|
2676
|
-
const quote = await quotePointTokenToUsdt({
|
|
2677
|
-
provider: this.cfg.provider,
|
|
2678
|
-
chainId,
|
|
2679
|
-
pointTokenAddress: (0, import_viem11.getAddress)(pointTokenAddress),
|
|
2680
|
-
pointAmount,
|
|
2681
|
-
pools: poolsResult.pools,
|
|
2682
|
-
gasFeeUsdt: gasFeeResult.gasFeeUsdt
|
|
2683
|
-
});
|
|
2684
|
-
const dto = {
|
|
2685
|
-
pointAmount: pointAmount.toString(),
|
|
2686
|
-
estimatedUsdtOut: quote.estimatedUsdtOut.toString(),
|
|
2687
|
-
gasFeeUsdt: gasFeeResult.gasFeeUsdt.toString(),
|
|
2688
|
-
netUsdtOut: quote.netUsdtOut.toString(),
|
|
2689
|
-
exchangeRate: quote.exchangeRate,
|
|
2690
|
-
suggestedDeadline: quote.suggestedDeadline.toString(),
|
|
2691
|
-
gasEstimate: quote.gasEstimate.toString()
|
|
2692
|
-
};
|
|
2693
|
-
if (quote.quoteError) dto.quoteError = quote.quoteError;
|
|
2694
|
-
return dto;
|
|
2695
|
-
}
|
|
2339
|
+
// quote() removed (2026-04-27) — FE PAFI calls @pafi-dev/trading
|
|
2340
|
+
// directly. Issuer SDK doesn't ship swap/quote anymore.
|
|
2696
2341
|
// ------------------------------ Action endpoints -------------------------
|
|
2697
2342
|
async claim(input) {
|
|
2698
2343
|
const ptClaimHandler = this.assertHandler(
|
|
@@ -2700,7 +2345,7 @@ var IssuerApiAdapter = class {
|
|
|
2700
2345
|
"ptClaimHandler",
|
|
2701
2346
|
"claim"
|
|
2702
2347
|
);
|
|
2703
|
-
const pointTokenAddress = (0,
|
|
2348
|
+
const pointTokenAddress = (0, import_viem10.getAddress)(input.pointTokenAddress);
|
|
2704
2349
|
const result = await ptClaimHandler.handle({
|
|
2705
2350
|
authenticatedAddress: input.authenticatedAddress,
|
|
2706
2351
|
userAddress: input.authenticatedAddress,
|
|
@@ -2741,8 +2386,8 @@ var IssuerApiAdapter = class {
|
|
|
2741
2386
|
"burn"
|
|
2742
2387
|
);
|
|
2743
2388
|
return {
|
|
2744
|
-
calls: (0,
|
|
2745
|
-
callsFallback: response.fallback ? (0,
|
|
2389
|
+
calls: (0, import_core11.decodeBatchExecuteCalls)(response.userOp.callData),
|
|
2390
|
+
callsFallback: response.fallback ? (0, import_core11.decodeBatchExecuteCalls)(response.fallback.userOp.callData) : void 0,
|
|
2746
2391
|
feeAmount: response.feeAmount.toString(),
|
|
2747
2392
|
lockId: response.lockId,
|
|
2748
2393
|
lockIdFallback: response.fallback?.lockId,
|
|
@@ -2753,38 +2398,8 @@ var IssuerApiAdapter = class {
|
|
|
2753
2398
|
sponsorAuth
|
|
2754
2399
|
};
|
|
2755
2400
|
}
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
this.cfg.swapHandler,
|
|
2759
|
-
"swapHandler",
|
|
2760
|
-
"swap"
|
|
2761
|
-
);
|
|
2762
|
-
const result = await swapHandler.handle({
|
|
2763
|
-
userAddress: input.authenticatedAddress,
|
|
2764
|
-
chainId: input.chainId,
|
|
2765
|
-
pointTokenAddress: (0, import_viem11.getAddress)(input.pointTokenAddress),
|
|
2766
|
-
amountIn: input.amountIn,
|
|
2767
|
-
aaNonce: input.aaNonce,
|
|
2768
|
-
slippageBps: input.slippageBps
|
|
2769
|
-
});
|
|
2770
|
-
const sponsorAuth = await this.buildSponsorAuth(
|
|
2771
|
-
input.authenticatedAddress,
|
|
2772
|
-
result.userOp.callData,
|
|
2773
|
-
input.chainId,
|
|
2774
|
-
"swap"
|
|
2775
|
-
);
|
|
2776
|
-
return {
|
|
2777
|
-
calls: result.calls,
|
|
2778
|
-
callsFallback: result.callsFallback,
|
|
2779
|
-
feeAmount: result.feeAmount.toString(),
|
|
2780
|
-
estimatedUsdtOut: result.estimatedUsdtOut.toString(),
|
|
2781
|
-
minAmountOut: result.minAmountOut.toString(),
|
|
2782
|
-
estimatedUsdtOutFallback: result.estimatedUsdtOutFallback?.toString(),
|
|
2783
|
-
minAmountOutFallback: result.minAmountOutFallback?.toString(),
|
|
2784
|
-
deadline: result.deadline.toString(),
|
|
2785
|
-
sponsorAuth
|
|
2786
|
-
};
|
|
2787
|
-
}
|
|
2401
|
+
// swap() removed (2026-04-27) — moved to @pafi-dev/trading.
|
|
2402
|
+
// PAFI's web FE calls TradingHandlers.handleSwap directly.
|
|
2788
2403
|
async perpDeposit(input) {
|
|
2789
2404
|
const perpHandler = this.assertHandler(
|
|
2790
2405
|
this.cfg.perpHandler,
|
|
@@ -2825,7 +2440,7 @@ var IssuerApiAdapter = class {
|
|
|
2825
2440
|
"ptClaimHandler",
|
|
2826
2441
|
"claimPrepare"
|
|
2827
2442
|
);
|
|
2828
|
-
const pointTokenAddress = (0,
|
|
2443
|
+
const pointTokenAddress = (0, import_viem10.getAddress)(input.pointTokenAddress);
|
|
2829
2444
|
const claimResult = await ptClaimHandler.handle({
|
|
2830
2445
|
authenticatedAddress: input.authenticatedAddress,
|
|
2831
2446
|
userAddress: input.authenticatedAddress,
|
|
@@ -2871,7 +2486,7 @@ var IssuerApiAdapter = class {
|
|
|
2871
2486
|
}
|
|
2872
2487
|
async redeemPrepare(input) {
|
|
2873
2488
|
this.assertRedeemHandler();
|
|
2874
|
-
const pointTokenAddress = (0,
|
|
2489
|
+
const pointTokenAddress = (0, import_viem10.getAddress)(input.pointTokenAddress);
|
|
2875
2490
|
const redeemResponse = await this.cfg.ptRedeemHandler.handle({
|
|
2876
2491
|
userAddress: input.authenticatedAddress,
|
|
2877
2492
|
authenticatedAddress: input.authenticatedAddress,
|
|
@@ -2935,23 +2550,23 @@ var IssuerApiAdapter = class {
|
|
|
2935
2550
|
}
|
|
2936
2551
|
// ------------------------------ Delegate endpoints -----------------------
|
|
2937
2552
|
async delegateStatus(authenticatedAddress, chainId) {
|
|
2938
|
-
const { batchExecutor } = (0,
|
|
2553
|
+
const { batchExecutor } = (0, import_core11.getContractAddresses)(chainId);
|
|
2939
2554
|
const code = await this.cfg.provider.getCode({
|
|
2940
2555
|
address: authenticatedAddress
|
|
2941
2556
|
});
|
|
2942
2557
|
return {
|
|
2943
|
-
isDelegated: (0,
|
|
2558
|
+
isDelegated: (0, import_core11.parseEip7702DelegatedAddress)(code) !== null,
|
|
2944
2559
|
batchExecutorAddress: batchExecutor
|
|
2945
2560
|
};
|
|
2946
2561
|
}
|
|
2947
2562
|
async delegatePrepare(authenticatedAddress, chainId) {
|
|
2948
|
-
const { batchExecutor } = (0,
|
|
2563
|
+
const { batchExecutor } = (0, import_core11.getContractAddresses)(chainId);
|
|
2949
2564
|
const accountNonce = BigInt(
|
|
2950
2565
|
await this.cfg.provider.getTransactionCount({
|
|
2951
2566
|
address: authenticatedAddress
|
|
2952
2567
|
})
|
|
2953
2568
|
);
|
|
2954
|
-
const authorizationHash = (0,
|
|
2569
|
+
const authorizationHash = (0, import_core11.computeAuthorizationHash)(
|
|
2955
2570
|
chainId,
|
|
2956
2571
|
batchExecutor,
|
|
2957
2572
|
accountNonce
|
|
@@ -2984,7 +2599,7 @@ var IssuerApiAdapter = class {
|
|
|
2984
2599
|
*/
|
|
2985
2600
|
async buildSponsorAuth(authenticatedAddress, callData, chainId, scenario) {
|
|
2986
2601
|
if (!this.cfg.pafiIssuerId) return void 0;
|
|
2987
|
-
return (0,
|
|
2602
|
+
return (0, import_core11.buildAndSignSponsorAuth)({
|
|
2988
2603
|
userAddress: authenticatedAddress,
|
|
2989
2604
|
callData,
|
|
2990
2605
|
chainId,
|
|
@@ -3033,8 +2648,8 @@ var IssuerApiAdapter = class {
|
|
|
3033
2648
|
};
|
|
3034
2649
|
|
|
3035
2650
|
// src/pools/subgraphPoolsProvider.ts
|
|
3036
|
-
var
|
|
3037
|
-
var
|
|
2651
|
+
var import_viem11 = require("viem");
|
|
2652
|
+
var import_core12 = require("@pafi-dev/core");
|
|
3038
2653
|
var DEFAULT_CACHE_TTL_MS = 3e4;
|
|
3039
2654
|
var POOL_QUERY = `
|
|
3040
2655
|
query GetPoolForPointToken($id: ID!) {
|
|
@@ -3052,7 +2667,7 @@ var POOL_QUERY = `
|
|
|
3052
2667
|
}
|
|
3053
2668
|
`;
|
|
3054
2669
|
function createSubgraphPoolsProvider(config = {}) {
|
|
3055
|
-
const subgraphUrl = config.subgraphUrl ??
|
|
2670
|
+
const subgraphUrl = config.subgraphUrl ?? import_core12.PAFI_SUBGRAPH_URL;
|
|
3056
2671
|
try {
|
|
3057
2672
|
const parsed = new URL(subgraphUrl);
|
|
3058
2673
|
if (process.env.NODE_ENV === "production" && parsed.protocol !== "https:") {
|
|
@@ -3134,7 +2749,7 @@ async function fetchPoolsFromSubgraph(fetchImpl, subgraphUrl, pointTokenAddress)
|
|
|
3134
2749
|
return [];
|
|
3135
2750
|
}
|
|
3136
2751
|
const { pool } = token;
|
|
3137
|
-
if (!(0,
|
|
2752
|
+
if (!(0, import_viem11.isAddress)(pool.hooks)) {
|
|
3138
2753
|
console.error(
|
|
3139
2754
|
"[PAFI] SubgraphPoolsProvider: invalid hooks address in response:",
|
|
3140
2755
|
pool.hooks,
|
|
@@ -3142,7 +2757,7 @@ async function fetchPoolsFromSubgraph(fetchImpl, subgraphUrl, pointTokenAddress)
|
|
|
3142
2757
|
);
|
|
3143
2758
|
return [];
|
|
3144
2759
|
}
|
|
3145
|
-
if (!(0,
|
|
2760
|
+
if (!(0, import_viem11.isAddress)(pool.token0.id) || !(0, import_viem11.isAddress)(pool.token1.id)) {
|
|
3146
2761
|
console.error(
|
|
3147
2762
|
"[PAFI] SubgraphPoolsProvider: invalid token address in response \u2014 skipping pool"
|
|
3148
2763
|
);
|
|
@@ -3184,7 +2799,7 @@ var PRICE_QUERY = `
|
|
|
3184
2799
|
}
|
|
3185
2800
|
`;
|
|
3186
2801
|
function createSubgraphNativeUsdtQuoter(config = {}) {
|
|
3187
|
-
const subgraphUrl = config.subgraphUrl ??
|
|
2802
|
+
const subgraphUrl = config.subgraphUrl ?? import_core12.PAFI_SUBGRAPH_URL;
|
|
3188
2803
|
try {
|
|
3189
2804
|
const parsed = new URL(subgraphUrl);
|
|
3190
2805
|
if (process.env.NODE_ENV === "production" && parsed.protocol !== "https:") {
|
|
@@ -3292,8 +2907,8 @@ function toUsdtPerNative(priceFloat, usdtDecimals) {
|
|
|
3292
2907
|
}
|
|
3293
2908
|
|
|
3294
2909
|
// src/pools/nativePtQuoter.ts
|
|
3295
|
-
var
|
|
3296
|
-
var CHAINLINK_ABI = (0,
|
|
2910
|
+
var import_viem12 = require("viem");
|
|
2911
|
+
var CHAINLINK_ABI = (0, import_viem12.parseAbi)([
|
|
3297
2912
|
"function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)"
|
|
3298
2913
|
]);
|
|
3299
2914
|
var CHAINLINK_MAX_AGE_S = 3600n;
|
|
@@ -3314,7 +2929,7 @@ function createNativePtQuoter(config) {
|
|
|
3314
2929
|
provider,
|
|
3315
2930
|
pointTokenAddress,
|
|
3316
2931
|
chainlinkFeedAddress = "0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70",
|
|
3317
|
-
subgraphUrl =
|
|
2932
|
+
subgraphUrl = import_core12.PAFI_SUBGRAPH_URL,
|
|
3318
2933
|
cacheTtlMs = 3e4,
|
|
3319
2934
|
fallbackEthPriceUsd = 3e3,
|
|
3320
2935
|
fallbackPtPriceUsdt = 0.1,
|
|
@@ -3396,7 +3011,7 @@ function parseBigDecimalTo18(s) {
|
|
|
3396
3011
|
}
|
|
3397
3012
|
|
|
3398
3013
|
// src/balance/balanceAggregator.ts
|
|
3399
|
-
var
|
|
3014
|
+
var import_core13 = require("@pafi-dev/core");
|
|
3400
3015
|
var BalanceAggregator = class {
|
|
3401
3016
|
provider;
|
|
3402
3017
|
ledger;
|
|
@@ -3417,7 +3032,7 @@ var BalanceAggregator = class {
|
|
|
3417
3032
|
async getCombinedBalance(user, pointToken) {
|
|
3418
3033
|
const [offChain, onChain] = await Promise.all([
|
|
3419
3034
|
this.ledger.getBalance(user, pointToken),
|
|
3420
|
-
(0,
|
|
3035
|
+
(0, import_core13.getPointTokenBalance)(this.provider, pointToken, user)
|
|
3421
3036
|
]);
|
|
3422
3037
|
return {
|
|
3423
3038
|
offChain,
|
|
@@ -3650,8 +3265,8 @@ var PafiBackendClient = class {
|
|
|
3650
3265
|
};
|
|
3651
3266
|
|
|
3652
3267
|
// src/config.ts
|
|
3653
|
-
var
|
|
3654
|
-
var
|
|
3268
|
+
var import_viem13 = require("viem");
|
|
3269
|
+
var import_core14 = require("@pafi-dev/core");
|
|
3655
3270
|
function createIssuerService(config) {
|
|
3656
3271
|
if (!config.provider) {
|
|
3657
3272
|
throw new Error("createIssuerService: provider is required");
|
|
@@ -3671,7 +3286,7 @@ function createIssuerService(config) {
|
|
|
3671
3286
|
"createIssuerService: at least one of pointTokenAddress / pointTokenAddresses is required"
|
|
3672
3287
|
);
|
|
3673
3288
|
}
|
|
3674
|
-
const tokenAddresses = rawAddresses.map((a) => (0,
|
|
3289
|
+
const tokenAddresses = rawAddresses.map((a) => (0, import_viem13.getAddress)(a));
|
|
3675
3290
|
const ledger = config.ledger;
|
|
3676
3291
|
const sessionStore = config.sessionStore ?? new MemorySessionStore();
|
|
3677
3292
|
const policy = config.policy ?? new DefaultPolicyEngine({ ledger });
|
|
@@ -3721,7 +3336,7 @@ function createIssuerService(config) {
|
|
|
3721
3336
|
indexers.set(tokenAddress, new PointIndexer(indexerConfig));
|
|
3722
3337
|
}
|
|
3723
3338
|
const firstIndexer = indexers.get(tokenAddresses[0]);
|
|
3724
|
-
const chainAddresses = (0,
|
|
3339
|
+
const chainAddresses = (0, import_core14.getContractAddresses)(config.chainId);
|
|
3725
3340
|
const resolvedContracts = {
|
|
3726
3341
|
batchExecutor: chainAddresses.batchExecutor,
|
|
3727
3342
|
usdt: chainAddresses.usdt,
|
|
@@ -3740,15 +3355,6 @@ function createIssuerService(config) {
|
|
|
3740
3355
|
};
|
|
3741
3356
|
if (feeManager) handlersConfig.feeManager = feeManager;
|
|
3742
3357
|
if (config.poolsProvider) handlersConfig.poolsProvider = config.poolsProvider;
|
|
3743
|
-
if (config.claim) {
|
|
3744
|
-
handlersConfig.claim = {
|
|
3745
|
-
policy,
|
|
3746
|
-
relayService,
|
|
3747
|
-
issuerSignerWallet: config.claim.issuerSignerWallet,
|
|
3748
|
-
batchExecutorAddress: config.claim.batchExecutorAddress ?? chainAddresses.batchExecutor,
|
|
3749
|
-
lockDurationMs: config.claim.lockDurationMs
|
|
3750
|
-
};
|
|
3751
|
-
}
|
|
3752
3358
|
const handlers = new IssuerApiHandlers(handlersConfig);
|
|
3753
3359
|
if (config.indexer?.autoStart) {
|
|
3754
3360
|
for (const idx of indexers.values()) {
|
|
@@ -3769,8 +3375,8 @@ function createIssuerService(config) {
|
|
|
3769
3375
|
}
|
|
3770
3376
|
|
|
3771
3377
|
// src/issuer-state/validator.ts
|
|
3772
|
-
var
|
|
3773
|
-
var
|
|
3378
|
+
var import_viem14 = require("viem");
|
|
3379
|
+
var import_core15 = require("@pafi-dev/core");
|
|
3774
3380
|
var ISSUER_RECORD_TTL_MS = 3e4;
|
|
3775
3381
|
var IssuerStateValidator = class _IssuerStateValidator {
|
|
3776
3382
|
constructor(provider, registryAddress) {
|
|
@@ -3787,7 +3393,7 @@ var IssuerStateValidator = class _IssuerStateValidator {
|
|
|
3787
3393
|
* `CONTRACT_ADDRESSES` map for the given chain.
|
|
3788
3394
|
*/
|
|
3789
3395
|
static forChain(provider, chainId) {
|
|
3790
|
-
const { issuerRegistry } = (0,
|
|
3396
|
+
const { issuerRegistry } = (0, import_core15.getContractAddresses)(chainId);
|
|
3791
3397
|
return new _IssuerStateValidator(provider, issuerRegistry);
|
|
3792
3398
|
}
|
|
3793
3399
|
/**
|
|
@@ -3796,7 +3402,7 @@ var IssuerStateValidator = class _IssuerStateValidator {
|
|
|
3796
3402
|
*/
|
|
3797
3403
|
invalidate(pointToken) {
|
|
3798
3404
|
if (pointToken) {
|
|
3799
|
-
const key = (0,
|
|
3405
|
+
const key = (0, import_viem14.getAddress)(pointToken);
|
|
3800
3406
|
this.pointTokenIssuerCache.delete(key);
|
|
3801
3407
|
this.stateCache.delete(key);
|
|
3802
3408
|
this.inflight.delete(key);
|
|
@@ -3811,23 +3417,23 @@ var IssuerStateValidator = class _IssuerStateValidator {
|
|
|
3811
3417
|
* The issuer field is set at `initialize()` and never changes.
|
|
3812
3418
|
*/
|
|
3813
3419
|
async getIssuerAddressForPointToken(pointToken) {
|
|
3814
|
-
const key = (0,
|
|
3420
|
+
const key = (0, import_viem14.getAddress)(pointToken);
|
|
3815
3421
|
const cached = this.pointTokenIssuerCache.get(key);
|
|
3816
3422
|
if (cached) return cached;
|
|
3817
3423
|
const issuer = await this.provider.readContract({
|
|
3818
3424
|
address: key,
|
|
3819
|
-
abi:
|
|
3425
|
+
abi: import_core15.POINT_TOKEN_V2_ABI,
|
|
3820
3426
|
functionName: "issuer"
|
|
3821
3427
|
});
|
|
3822
|
-
this.pointTokenIssuerCache.set(key, (0,
|
|
3823
|
-
return (0,
|
|
3428
|
+
this.pointTokenIssuerCache.set(key, (0, import_viem14.getAddress)(issuer));
|
|
3429
|
+
return (0, import_viem14.getAddress)(issuer);
|
|
3824
3430
|
}
|
|
3825
3431
|
/**
|
|
3826
3432
|
* Read registry record + totalSupply, with 30s cache and in-flight
|
|
3827
3433
|
* deduplication. Does NOT throw on inactive/missing — returns raw state.
|
|
3828
3434
|
*/
|
|
3829
3435
|
async getIssuerState(pointToken) {
|
|
3830
|
-
const tokenAddr = (0,
|
|
3436
|
+
const tokenAddr = (0, import_viem14.getAddress)(pointToken);
|
|
3831
3437
|
const now = Date.now();
|
|
3832
3438
|
const cached = this.stateCache.get(tokenAddr);
|
|
3833
3439
|
if (cached && cached.expiresAt > now) return cached.value;
|
|
@@ -3897,13 +3503,13 @@ var IssuerStateValidator = class _IssuerStateValidator {
|
|
|
3897
3503
|
const [issuerTuple, totalSupply] = await Promise.all([
|
|
3898
3504
|
this.provider.readContract({
|
|
3899
3505
|
address: this.registryAddress,
|
|
3900
|
-
abi:
|
|
3506
|
+
abi: import_core15.issuerRegistryGetIssuerFlatAbi,
|
|
3901
3507
|
functionName: "getIssuer",
|
|
3902
3508
|
args: [issuerAddr]
|
|
3903
3509
|
}),
|
|
3904
3510
|
this.provider.readContract({
|
|
3905
3511
|
address: tokenAddr,
|
|
3906
|
-
abi:
|
|
3512
|
+
abi: import_core15.POINT_TOKEN_V2_ABI,
|
|
3907
3513
|
functionName: "totalSupply"
|
|
3908
3514
|
})
|
|
3909
3515
|
]);
|
|
@@ -3942,6 +3548,7 @@ var PAFI_ISSUER_SDK_VERSION = "0.4.0";
|
|
|
3942
3548
|
IssuerStateError,
|
|
3943
3549
|
IssuerStateValidator,
|
|
3944
3550
|
LockNotFoundError,
|
|
3551
|
+
MemoryPendingUserOpStore,
|
|
3945
3552
|
MemorySessionStore,
|
|
3946
3553
|
NonceManager,
|
|
3947
3554
|
PAFI_ISSUER_SDK_VERSION,
|
|
@@ -3960,10 +3567,6 @@ var PAFI_ISSUER_SDK_VERSION = "0.4.0";
|
|
|
3960
3567
|
PointIndexer,
|
|
3961
3568
|
RelayError,
|
|
3962
3569
|
RelayService,
|
|
3963
|
-
SwapError,
|
|
3964
|
-
SwapHandler,
|
|
3965
|
-
TopUpRedemptionError,
|
|
3966
|
-
TopUpRedemptionHandler,
|
|
3967
3570
|
authenticateRequest,
|
|
3968
3571
|
createIssuerService,
|
|
3969
3572
|
createNativePtQuoter,
|
|
@@ -3977,7 +3580,6 @@ var PAFI_ISSUER_SDK_VERSION = "0.4.0";
|
|
|
3977
3580
|
handleRedeemStatus,
|
|
3978
3581
|
mergePaymasterFields,
|
|
3979
3582
|
prepareMobileUserOp,
|
|
3980
|
-
quotePointTokenToUsdt,
|
|
3981
3583
|
relayUserOp,
|
|
3982
3584
|
requestPaymaster,
|
|
3983
3585
|
serializeEntryToJsonRpc,
|