@pafi-dev/core 0.3.0-beta.4 → 0.3.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abi/index.cjs +2 -6
- package/dist/abi/index.cjs.map +1 -1
- package/dist/abi/index.d.cts +1 -286
- package/dist/abi/index.d.ts +1 -286
- package/dist/abi/index.js +1 -5
- package/dist/{chunk-5YH4D7QF.js → chunk-7UBO7DY5.js} +1 -1
- package/dist/{chunk-FGKLDKJK.cjs → chunk-ALCWYDVG.cjs} +1 -1
- package/dist/{chunk-FGKLDKJK.cjs.map → chunk-ALCWYDVG.cjs.map} +1 -1
- package/dist/{chunk-X3I5XWAR.cjs → chunk-CQCSQPWG.cjs} +2 -15
- package/dist/chunk-CQCSQPWG.cjs.map +1 -0
- package/dist/{chunk-CXFUP2YK.cjs → chunk-EDR5SFJN.cjs} +46 -6
- package/dist/chunk-EDR5SFJN.cjs.map +1 -0
- package/dist/{chunk-VQSRCMMK.js → chunk-QGO6X6LG.js} +2 -15
- package/dist/chunk-QGO6X6LG.js.map +1 -0
- package/dist/{chunk-IK4UK7KT.js → chunk-W23EJNYG.js} +44 -4
- package/dist/chunk-W23EJNYG.js.map +1 -0
- package/dist/contract/index.cjs +2 -5
- package/dist/contract/index.cjs.map +1 -1
- package/dist/contract/index.d.cts +2 -4
- package/dist/contract/index.d.ts +2 -4
- package/dist/contract/index.js +1 -4
- package/dist/eip712/index.d.cts +1 -1
- package/dist/eip712/index.d.ts +1 -1
- package/dist/{index-BYL8Nn-n.d.ts → index-B06IJlHe.d.ts} +1 -1
- package/dist/{index-B5OJ9Kcx.d.cts → index-B7pGBych.d.cts} +1 -1
- package/dist/index.cjs +36 -122
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -115
- package/dist/index.d.ts +64 -115
- package/dist/index.js +34 -120
- package/dist/index.js.map +1 -1
- package/dist/quoting/index.d.cts +1 -1
- package/dist/quoting/index.d.ts +1 -1
- package/dist/swap/index.cjs +2 -3
- package/dist/swap/index.cjs.map +1 -1
- package/dist/swap/index.d.cts +2 -2
- package/dist/swap/index.d.ts +2 -2
- package/dist/swap/index.js +1 -2
- package/dist/{types-DGDlKiDe.d.ts → types-b5_Tokjl.d.cts} +1 -17
- package/dist/{types-DGDlKiDe.d.cts → types-b5_Tokjl.d.ts} +1 -17
- package/package.json +1 -1
- package/dist/chunk-27V32VNM.cjs +0 -370
- package/dist/chunk-27V32VNM.cjs.map +0 -1
- package/dist/chunk-4RYBJLF3.js +0 -370
- package/dist/chunk-4RYBJLF3.js.map +0 -1
- package/dist/chunk-5QJZT7VB.cjs +0 -46
- package/dist/chunk-5QJZT7VB.cjs.map +0 -1
- package/dist/chunk-CXFUP2YK.cjs.map +0 -1
- package/dist/chunk-IK4UK7KT.js.map +0 -1
- package/dist/chunk-L74CZAVQ.cjs +0 -99
- package/dist/chunk-L74CZAVQ.cjs.map +0 -1
- package/dist/chunk-P56TUGTS.js +0 -46
- package/dist/chunk-P56TUGTS.js.map +0 -1
- package/dist/chunk-VQSRCMMK.js.map +0 -1
- package/dist/chunk-X3I5XWAR.cjs.map +0 -1
- package/dist/chunk-X4IXUTTD.js +0 -99
- package/dist/chunk-X4IXUTTD.js.map +0 -1
- package/dist/relay/index.cjs +0 -19
- package/dist/relay/index.cjs.map +0 -1
- package/dist/relay/index.d.cts +0 -75
- package/dist/relay/index.d.ts +0 -75
- package/dist/relay/index.js +0 -19
- package/dist/relay/index.js.map +0 -1
- /package/dist/{chunk-5YH4D7QF.js.map → chunk-7UBO7DY5.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Address, Hex, PublicClient, WalletClient } from 'viem';
|
|
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,
|
|
3
|
-
export {
|
|
4
|
-
export { erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi,
|
|
2
|
+
import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification, B as BestQuote, Q as QuoteResult } from './types-b5_Tokjl.cjs';
|
|
3
|
+
export { c as BurnRequest, I as Issuer, d as PathKey } from './types-b5_Tokjl.cjs';
|
|
4
|
+
export { erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.cjs';
|
|
5
5
|
export { buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.cjs';
|
|
6
|
-
|
|
7
|
-
export { buildRelaySwapParams, decodeExtData, decodeMintAndSwap, encodeExtData, encodeMintAndSwap, simulateMintAndSwap } from './relay/index.cjs';
|
|
8
|
-
export { getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, getUsdt, isActiveIssuer, isMinter, verifyMintCap } from './contract/index.cjs';
|
|
6
|
+
export { getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, verifyMintCap } from './contract/index.cjs';
|
|
9
7
|
export { buildAllPaths, combineRoutes, findBestQuote, quoteBestRoute, quoteExactInput, quoteExactInputSingle } from './quoting/index.cjs';
|
|
10
|
-
import { O as Operation, P as PartialUserOperation, U as UserOperation, S as SwapSimulationResult } from './index-
|
|
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-
|
|
8
|
+
import { O as Operation, P as PartialUserOperation, U as UserOperation, S as SwapSimulationResult } from './index-B7pGBych.cjs';
|
|
9
|
+
export { B as BuildSwapWithGasDeductionParams, E as ENTRY_POINT_V07, a as PaymasterFields, b as SETTLE_ALL, c as SWAP_EXACT_IN, T as TAKE_ALL, d as UserOpReceipt, V as V4_SWAP, Z as ZERO_VALUE, e as buildErc20ApprovalCalldata, f as buildPermit2ApprovalCalldata, g as buildSwapFromQuote, h as buildSwapWithGasDeduction, i as buildUniversalRouterExecuteArgs, j as buildV4SwapInput, k as checkAllowance, s as simulateSwap } from './index-B7pGBych.cjs';
|
|
12
10
|
import { LoginMessageParams } from './auth/index.cjs';
|
|
13
11
|
export { VerifyLoginResult, createLoginMessage, parseLoginMessage, verifyLoginMessage } from './auth/index.cjs';
|
|
14
12
|
|
|
@@ -291,13 +289,9 @@ interface CheckEthAndBranchParams {
|
|
|
291
289
|
declare function checkEthAndBranch(params: CheckEthAndBranchParams): Promise<SubmissionPath>;
|
|
292
290
|
|
|
293
291
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
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/`.
|
|
292
|
+
* Real `PointToken` ABI — matches the contract deployed on Base mainnet
|
|
293
|
+
* (POINT at `0x7d25E7156E51F865D522fd3ef257a6B5DD41b97e`). Sourced from
|
|
294
|
+
* the Solidity contract shipped by the SC team 2026-04-21.
|
|
301
295
|
*
|
|
302
296
|
* ## Mint — two paths
|
|
303
297
|
*
|
|
@@ -332,7 +326,7 @@ declare function checkEthAndBranch(params: CheckEthAndBranchParams): Promise<Sub
|
|
|
332
326
|
* Domain: EIP-712 standard — name = ERC-20 token name, version = "1",
|
|
333
327
|
* chainId, verifyingContract = this PointToken address.
|
|
334
328
|
*/
|
|
335
|
-
declare const
|
|
329
|
+
declare const POINT_TOKEN_ABI: readonly [{
|
|
336
330
|
readonly name: "mint";
|
|
337
331
|
readonly type: "function";
|
|
338
332
|
readonly stateMutability: "nonpayable";
|
|
@@ -633,50 +627,56 @@ declare const MOCK_POINT_TOKEN_V2_ABI: readonly [{
|
|
|
633
627
|
}];
|
|
634
628
|
|
|
635
629
|
/**
|
|
636
|
-
*
|
|
630
|
+
* BatchExecutor delegation target addresses.
|
|
631
|
+
*
|
|
632
|
+
* ## Status
|
|
637
633
|
*
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
*
|
|
641
|
-
*
|
|
634
|
+
* Per-chain addresses are **still placeholder** (`0x...DE01` / `DE02`)
|
|
635
|
+
* pending the SC team's Phase B delivery. When Coinbase publishes a
|
|
636
|
+
* canonical BatchExecutor, or PAFI deploys its own and publishes the
|
|
637
|
+
* address, swap the constants below — callers already import from here
|
|
638
|
+
* so no wiring changes.
|
|
642
639
|
*
|
|
643
|
-
* The ABI
|
|
644
|
-
* `../../userop/batchExecute.ts`
|
|
645
|
-
*
|
|
640
|
+
* The ABI (`execute(Call[])`) itself is real and stable — it lives
|
|
641
|
+
* under `../../userop/batchExecute.ts` and is re-exported below so
|
|
642
|
+
* consumers can grab both ABI + address from one import path.
|
|
646
643
|
*
|
|
647
|
-
*
|
|
648
|
-
*
|
|
644
|
+
* ## Why checksum with DEAD0001 / DEAD0002 suffix
|
|
645
|
+
*
|
|
646
|
+
* The placeholder pattern makes the fact-of-mockness obvious in logs
|
|
647
|
+
* and block explorers. A request targeting `0x...DE01` is impossible
|
|
648
|
+
* to confuse with a production contract.
|
|
649
649
|
*/
|
|
650
|
-
declare const
|
|
651
|
-
declare const
|
|
650
|
+
declare const BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA: Address;
|
|
651
|
+
declare const BATCH_EXECUTOR_ADDRESS_BASE_MAINNET: Address;
|
|
652
652
|
|
|
653
653
|
/**
|
|
654
|
-
*
|
|
654
|
+
* Per-chain deployed contract addresses — v1.4 flow.
|
|
655
|
+
*
|
|
656
|
+
* ## Status (2026-04-21)
|
|
655
657
|
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
* placeholder until Phase B.
|
|
658
|
+
* Base mainnet (8453): all SC-delivered and real, EXCEPT `batchExecutor`
|
|
659
|
+
* which is still a `0x...DE02` placeholder pending the Phase B delivery.
|
|
660
|
+
* Base Sepolia (84532): entire row is placeholder — not in active use.
|
|
660
661
|
*
|
|
661
|
-
*
|
|
662
|
-
* - 8453 Base mainnet — SC-delivered (see below)
|
|
663
|
-
* - 84532 Base Sepolia — not in use; placeholders only
|
|
662
|
+
* ## What lives where
|
|
664
663
|
*
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
*
|
|
670
|
-
*
|
|
671
|
-
*
|
|
664
|
+
* pointToken — live POINT instance (clone of PointToken impl)
|
|
665
|
+
* batchExecutor — EIP-7702 delegation target (PLACEHOLDER)
|
|
666
|
+
* usdt — MockERC20 used by Uniswap pools
|
|
667
|
+
* issuerRegistry — registry of all issuers on this chain
|
|
668
|
+
* mintingOracle — per-issuer mint cap enforcer
|
|
669
|
+
*
|
|
670
|
+
* PointTokenFactory + PointToken implementation addresses live in
|
|
671
|
+
* separate exports below — they're only needed at provisioning /
|
|
672
|
+
* observability time, not in the hot mint/burn path, so excluded from
|
|
673
|
+
* the per-chain bundle.
|
|
674
|
+
*
|
|
675
|
+
* ## Swap workflow when BatchExecutor lands
|
|
672
676
|
*
|
|
673
|
-
* Swap workflow when BatchExecutor lands:
|
|
674
677
|
* 1. Replace `batchExecutor` placeholder with real address
|
|
675
|
-
* 2.
|
|
676
|
-
* 3. Bump core to
|
|
677
|
-
*/
|
|
678
|
-
/**
|
|
679
|
-
* Per-chain contract addresses.
|
|
678
|
+
* 2. Structure / imports don't change — callers are stable
|
|
679
|
+
* 3. Bump core to next beta and update release notes
|
|
680
680
|
*/
|
|
681
681
|
interface ContractAddresses {
|
|
682
682
|
pointToken: Address;
|
|
@@ -685,11 +685,11 @@ interface ContractAddresses {
|
|
|
685
685
|
issuerRegistry: Address;
|
|
686
686
|
mintingOracle: Address;
|
|
687
687
|
}
|
|
688
|
-
declare const
|
|
688
|
+
declare const CONTRACT_ADDRESSES: Record<number, ContractAddresses>;
|
|
689
689
|
/**
|
|
690
|
-
* PointTokenFactory address — separate from `ContractAddresses`
|
|
691
|
-
*
|
|
692
|
-
*
|
|
690
|
+
* PointTokenFactory address — separate from `ContractAddresses` because
|
|
691
|
+
* it's only used at provisioning time (issuer onboard + token creation),
|
|
692
|
+
* not in the hot mint/burn path.
|
|
693
693
|
*/
|
|
694
694
|
declare const POINT_TOKEN_FACTORY_ADDRESSES: Record<number, Address>;
|
|
695
695
|
/**
|
|
@@ -702,7 +702,7 @@ declare const POINT_TOKEN_IMPL_ADDRESSES: Record<number, Address>;
|
|
|
702
702
|
* Lookup helper — throws if the chain isn't in the map so callers fail
|
|
703
703
|
* loudly on misconfiguration instead of silently using `undefined`.
|
|
704
704
|
*/
|
|
705
|
-
declare function
|
|
705
|
+
declare function getContractAddresses(chainId: number): ContractAddresses;
|
|
706
706
|
|
|
707
707
|
/**
|
|
708
708
|
* Public contract surface for `@pafi-dev/core/contracts`.
|
|
@@ -722,18 +722,17 @@ declare function getMockAddresses(chainId: number): ContractAddresses;
|
|
|
722
722
|
* deadline, burnerSig)`.
|
|
723
723
|
*
|
|
724
724
|
* Exports:
|
|
725
|
-
* - `POINT_TOKEN_V2_ABI`
|
|
726
|
-
* - `BATCH_EXECUTOR_*`
|
|
727
|
-
*
|
|
728
|
-
*
|
|
729
|
-
* - `CONTRACT_ADDRESSES`
|
|
730
|
-
*
|
|
725
|
+
* - `POINT_TOKEN_V2_ABI` — full mint + burn + admin surface
|
|
726
|
+
* - `BATCH_EXECUTOR_*` — EIP-7702 delegation target (ABI real,
|
|
727
|
+
* address still placeholder on all
|
|
728
|
+
* chains until SC delivers)
|
|
729
|
+
* - `CONTRACT_ADDRESSES` — per-chain map (real on 8453 except
|
|
730
|
+
* `batchExecutor` — pending SC)
|
|
731
731
|
* - `POINT_TOKEN_FACTORY_ADDRESSES`, `POINT_TOKEN_IMPL_ADDRESSES`
|
|
732
|
-
*
|
|
732
|
+
* — provisioning / observability helpers
|
|
733
733
|
*
|
|
734
|
-
* Status:
|
|
735
|
-
*
|
|
736
|
-
* for the deletion checklist.
|
|
734
|
+
* Status: all real except BatchExecutor address (single remaining
|
|
735
|
+
* placeholder, flagged inline in `real/addresses.ts`).
|
|
737
736
|
*/
|
|
738
737
|
|
|
739
738
|
/**
|
|
@@ -932,13 +931,11 @@ declare function openPafiWebModal(url: string, options?: ModalOpenOptions): Prom
|
|
|
932
931
|
|
|
933
932
|
declare class PafiSDK {
|
|
934
933
|
private _pointTokenAddress?;
|
|
935
|
-
private _relayContractAddress?;
|
|
936
934
|
private _signer?;
|
|
937
935
|
private _provider?;
|
|
938
936
|
private _chainId?;
|
|
939
937
|
constructor(config: PafiSDKConfig);
|
|
940
938
|
setPointTokenAddress(address: Address): void;
|
|
941
|
-
setRelayContractAddress(address: Address): void;
|
|
942
939
|
setSigner(signer: WalletClient): void;
|
|
943
940
|
setProvider(provider: PublicClient): void;
|
|
944
941
|
private requirePointToken;
|
|
@@ -946,10 +943,6 @@ declare class PafiSDK {
|
|
|
946
943
|
private requireSigner;
|
|
947
944
|
private requireChainId;
|
|
948
945
|
getDomain(): Promise<PointTokenDomainConfig>;
|
|
949
|
-
/**
|
|
950
|
-
* Build the EIP-712 typed data for a MintRequest.
|
|
951
|
-
* Pass the result to any external signer (Privy, WalletConnect, etc.).
|
|
952
|
-
*/
|
|
953
946
|
buildMintRequestTypedData(message: MintRequest): Promise<{
|
|
954
947
|
domain: {
|
|
955
948
|
name: string;
|
|
@@ -975,10 +968,6 @@ declare class PafiSDK {
|
|
|
975
968
|
primaryType: "MintRequest";
|
|
976
969
|
message: MintRequest;
|
|
977
970
|
}>;
|
|
978
|
-
/**
|
|
979
|
-
* Build the EIP-712 typed data for a ReceiverConsent.
|
|
980
|
-
* Pass the result to any external signer (Privy, WalletConnect, etc.).
|
|
981
|
-
*/
|
|
982
971
|
buildReceiverConsentTypedData(message: ReceiverConsent): Promise<{
|
|
983
972
|
domain: {
|
|
984
973
|
name: string;
|
|
@@ -1016,11 +1005,6 @@ declare class PafiSDK {
|
|
|
1016
1005
|
verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
|
|
1017
1006
|
getMintRequestNonce(receiver: Address): Promise<bigint>;
|
|
1018
1007
|
getReceiverConsentNonce(receiver: Address): Promise<bigint>;
|
|
1019
|
-
encodeMintAndSwap(mint: MintParams, swap: SwapParams): Hex;
|
|
1020
|
-
decodeMintAndSwap(calldata: Hex): {
|
|
1021
|
-
mint: MintParams;
|
|
1022
|
-
swap: SwapParams;
|
|
1023
|
-
};
|
|
1024
1008
|
/**
|
|
1025
1009
|
* Find the best swap route from `tokenIn` to `tokenOut`.
|
|
1026
1010
|
* Merges `pools` with COMMON_POOLS for the configured chain, builds all
|
|
@@ -1041,36 +1025,6 @@ declare class PafiSDK {
|
|
|
1041
1025
|
commands: Hex;
|
|
1042
1026
|
inputs: Hex[];
|
|
1043
1027
|
};
|
|
1044
|
-
/**
|
|
1045
|
-
* Build Relay SwapParams + extData from a quote result.
|
|
1046
|
-
* Returns ready-to-use args for `Relay.mintAndSwap`.
|
|
1047
|
-
*/
|
|
1048
|
-
buildRelaySwapParams(params: {
|
|
1049
|
-
quote: {
|
|
1050
|
-
path: PathKey[];
|
|
1051
|
-
};
|
|
1052
|
-
minAmountOut: bigint;
|
|
1053
|
-
feeInUsdt: bigint;
|
|
1054
|
-
deadline: bigint;
|
|
1055
|
-
}): {
|
|
1056
|
-
swapParams: SwapParams;
|
|
1057
|
-
extData: Hex;
|
|
1058
|
-
};
|
|
1059
|
-
/**
|
|
1060
|
-
* Encode extData for ReceiverConsent and MintParams.
|
|
1061
|
-
* extData = abi.encode(minAmountOut, feeInUsdt)
|
|
1062
|
-
*/
|
|
1063
|
-
encodeExtData(minAmountOut: bigint, feeInUsdt: bigint): Hex;
|
|
1064
|
-
/**
|
|
1065
|
-
* Simulate a Relay.mintAndSwap call. Catches reverts (bad signatures,
|
|
1066
|
-
* expired deadlines, insufficient mint cap, pool errors) before submitting.
|
|
1067
|
-
*
|
|
1068
|
-
* @param relayAddress - Relay contract address
|
|
1069
|
-
* @param mint - MintParams with real signatures
|
|
1070
|
-
* @param swap - SwapParams (path + deadline)
|
|
1071
|
-
* @param from - Relayer address that will submit the tx
|
|
1072
|
-
*/
|
|
1073
|
-
simulateMintAndSwap(relayAddress: Address, mint: MintParams, swap: SwapParams, from: Address): Promise<SimulationResult>;
|
|
1074
1028
|
/**
|
|
1075
1029
|
* Simulate a UniversalRouter.execute swap call. Catches reverts (bad
|
|
1076
1030
|
* approvals, insufficient balance, pool errors) before submitting.
|
|
@@ -1082,14 +1036,9 @@ declare class PafiSDK {
|
|
|
1082
1036
|
* @param from - Address that will execute the swap
|
|
1083
1037
|
*/
|
|
1084
1038
|
simulateSwap(routerAddress: Address, commands: Hex, inputs: Hex[], deadline: bigint, from: Address): Promise<SwapSimulationResult>;
|
|
1085
|
-
/**
|
|
1086
|
-
* Build an EIP-4361 login message for the current signer + chain. The
|
|
1087
|
-
* caller supplies the issuer-specific fields (domain, nonce, uri); the SDK
|
|
1088
|
-
* fills in the wallet address and chain id from its own config.
|
|
1089
|
-
*/
|
|
1090
1039
|
createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
|
|
1091
1040
|
/** Sign a login message string with the current signer (personal_sign) */
|
|
1092
1041
|
signLoginMessage(message: string): Promise<Hex>;
|
|
1093
1042
|
}
|
|
1094
1043
|
|
|
1095
|
-
export { ApiError, BATCH_EXECUTOR_ABI,
|
|
1044
|
+
export { ApiError, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BestQuote, type BuildPartialUserOpParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, EIP712Signature, LoginMessageParams, MintRequest, type ModalOpenOptions, Operation, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, POINT_TOKEN_ABI as POINT_TOKEN_V2_ABI, PafiSDK, PafiSDKConfig, PafiSDKError, type PafiWebModalAdapter, type PafiWebModalHandle, PartialUserOperation, type PaymasterConfig, PointTokenDomainConfig, PoolKey, QuoteResult, ReceiverConsent, SUPPORTED_CHAINS, type SignatureStruct, SignatureVerification, SigningError, SimulationError, type SponsorshipScenario, type SubmissionPath, SwapSimulationResult, UNIVERSAL_ROUTER_ADDRESSES, UserOperation, V4_QUOTER_ADDRESSES, _resetPaymasterConfigForTests, assembleUserOperation, buildPartialUserOperation, burnRequestTypes, checkEthAndBranch, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, getContractAddresses, getPafiWebModalAdapter, getPaymasterConfig, isPaymasterConfigured, mintRequestTypes, openPafiWebModal, openWebPopup, rawCallOp, receiverConsentTypes, setPafiWebModalAdapter, setPaymasterConfig, webPopupAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Address, Hex, PublicClient, WalletClient } from 'viem';
|
|
2
|
-
import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification,
|
|
3
|
-
export {
|
|
4
|
-
export { erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi,
|
|
2
|
+
import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification, B as BestQuote, Q as QuoteResult } from './types-b5_Tokjl.js';
|
|
3
|
+
export { c as BurnRequest, I as Issuer, d as PathKey } from './types-b5_Tokjl.js';
|
|
4
|
+
export { erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.js';
|
|
5
5
|
export { buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.js';
|
|
6
|
-
|
|
7
|
-
export { buildRelaySwapParams, decodeExtData, decodeMintAndSwap, encodeExtData, encodeMintAndSwap, simulateMintAndSwap } from './relay/index.js';
|
|
8
|
-
export { getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, getUsdt, isActiveIssuer, isMinter, verifyMintCap } from './contract/index.js';
|
|
6
|
+
export { getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, verifyMintCap } from './contract/index.js';
|
|
9
7
|
export { buildAllPaths, combineRoutes, findBestQuote, quoteBestRoute, quoteExactInput, quoteExactInputSingle } from './quoting/index.js';
|
|
10
|
-
import { O as Operation, P as PartialUserOperation, U as UserOperation, S as SwapSimulationResult } from './index-
|
|
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-
|
|
8
|
+
import { O as Operation, P as PartialUserOperation, U as UserOperation, S as SwapSimulationResult } from './index-B06IJlHe.js';
|
|
9
|
+
export { B as BuildSwapWithGasDeductionParams, E as ENTRY_POINT_V07, a as PaymasterFields, b as SETTLE_ALL, c as SWAP_EXACT_IN, T as TAKE_ALL, d as UserOpReceipt, V as V4_SWAP, Z as ZERO_VALUE, e as buildErc20ApprovalCalldata, f as buildPermit2ApprovalCalldata, g as buildSwapFromQuote, h as buildSwapWithGasDeduction, i as buildUniversalRouterExecuteArgs, j as buildV4SwapInput, k as checkAllowance, s as simulateSwap } from './index-B06IJlHe.js';
|
|
12
10
|
import { LoginMessageParams } from './auth/index.js';
|
|
13
11
|
export { VerifyLoginResult, createLoginMessage, parseLoginMessage, verifyLoginMessage } from './auth/index.js';
|
|
14
12
|
|
|
@@ -291,13 +289,9 @@ interface CheckEthAndBranchParams {
|
|
|
291
289
|
declare function checkEthAndBranch(params: CheckEthAndBranchParams): Promise<SubmissionPath>;
|
|
292
290
|
|
|
293
291
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
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/`.
|
|
292
|
+
* Real `PointToken` ABI — matches the contract deployed on Base mainnet
|
|
293
|
+
* (POINT at `0x7d25E7156E51F865D522fd3ef257a6B5DD41b97e`). Sourced from
|
|
294
|
+
* the Solidity contract shipped by the SC team 2026-04-21.
|
|
301
295
|
*
|
|
302
296
|
* ## Mint — two paths
|
|
303
297
|
*
|
|
@@ -332,7 +326,7 @@ declare function checkEthAndBranch(params: CheckEthAndBranchParams): Promise<Sub
|
|
|
332
326
|
* Domain: EIP-712 standard — name = ERC-20 token name, version = "1",
|
|
333
327
|
* chainId, verifyingContract = this PointToken address.
|
|
334
328
|
*/
|
|
335
|
-
declare const
|
|
329
|
+
declare const POINT_TOKEN_ABI: readonly [{
|
|
336
330
|
readonly name: "mint";
|
|
337
331
|
readonly type: "function";
|
|
338
332
|
readonly stateMutability: "nonpayable";
|
|
@@ -633,50 +627,56 @@ declare const MOCK_POINT_TOKEN_V2_ABI: readonly [{
|
|
|
633
627
|
}];
|
|
634
628
|
|
|
635
629
|
/**
|
|
636
|
-
*
|
|
630
|
+
* BatchExecutor delegation target addresses.
|
|
631
|
+
*
|
|
632
|
+
* ## Status
|
|
637
633
|
*
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
*
|
|
641
|
-
*
|
|
634
|
+
* Per-chain addresses are **still placeholder** (`0x...DE01` / `DE02`)
|
|
635
|
+
* pending the SC team's Phase B delivery. When Coinbase publishes a
|
|
636
|
+
* canonical BatchExecutor, or PAFI deploys its own and publishes the
|
|
637
|
+
* address, swap the constants below — callers already import from here
|
|
638
|
+
* so no wiring changes.
|
|
642
639
|
*
|
|
643
|
-
* The ABI
|
|
644
|
-
* `../../userop/batchExecute.ts`
|
|
645
|
-
*
|
|
640
|
+
* The ABI (`execute(Call[])`) itself is real and stable — it lives
|
|
641
|
+
* under `../../userop/batchExecute.ts` and is re-exported below so
|
|
642
|
+
* consumers can grab both ABI + address from one import path.
|
|
646
643
|
*
|
|
647
|
-
*
|
|
648
|
-
*
|
|
644
|
+
* ## Why checksum with DEAD0001 / DEAD0002 suffix
|
|
645
|
+
*
|
|
646
|
+
* The placeholder pattern makes the fact-of-mockness obvious in logs
|
|
647
|
+
* and block explorers. A request targeting `0x...DE01` is impossible
|
|
648
|
+
* to confuse with a production contract.
|
|
649
649
|
*/
|
|
650
|
-
declare const
|
|
651
|
-
declare const
|
|
650
|
+
declare const BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA: Address;
|
|
651
|
+
declare const BATCH_EXECUTOR_ADDRESS_BASE_MAINNET: Address;
|
|
652
652
|
|
|
653
653
|
/**
|
|
654
|
-
*
|
|
654
|
+
* Per-chain deployed contract addresses — v1.4 flow.
|
|
655
|
+
*
|
|
656
|
+
* ## Status (2026-04-21)
|
|
655
657
|
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
* placeholder until Phase B.
|
|
658
|
+
* Base mainnet (8453): all SC-delivered and real, EXCEPT `batchExecutor`
|
|
659
|
+
* which is still a `0x...DE02` placeholder pending the Phase B delivery.
|
|
660
|
+
* Base Sepolia (84532): entire row is placeholder — not in active use.
|
|
660
661
|
*
|
|
661
|
-
*
|
|
662
|
-
* - 8453 Base mainnet — SC-delivered (see below)
|
|
663
|
-
* - 84532 Base Sepolia — not in use; placeholders only
|
|
662
|
+
* ## What lives where
|
|
664
663
|
*
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
*
|
|
670
|
-
*
|
|
671
|
-
*
|
|
664
|
+
* pointToken — live POINT instance (clone of PointToken impl)
|
|
665
|
+
* batchExecutor — EIP-7702 delegation target (PLACEHOLDER)
|
|
666
|
+
* usdt — MockERC20 used by Uniswap pools
|
|
667
|
+
* issuerRegistry — registry of all issuers on this chain
|
|
668
|
+
* mintingOracle — per-issuer mint cap enforcer
|
|
669
|
+
*
|
|
670
|
+
* PointTokenFactory + PointToken implementation addresses live in
|
|
671
|
+
* separate exports below — they're only needed at provisioning /
|
|
672
|
+
* observability time, not in the hot mint/burn path, so excluded from
|
|
673
|
+
* the per-chain bundle.
|
|
674
|
+
*
|
|
675
|
+
* ## Swap workflow when BatchExecutor lands
|
|
672
676
|
*
|
|
673
|
-
* Swap workflow when BatchExecutor lands:
|
|
674
677
|
* 1. Replace `batchExecutor` placeholder with real address
|
|
675
|
-
* 2.
|
|
676
|
-
* 3. Bump core to
|
|
677
|
-
*/
|
|
678
|
-
/**
|
|
679
|
-
* Per-chain contract addresses.
|
|
678
|
+
* 2. Structure / imports don't change — callers are stable
|
|
679
|
+
* 3. Bump core to next beta and update release notes
|
|
680
680
|
*/
|
|
681
681
|
interface ContractAddresses {
|
|
682
682
|
pointToken: Address;
|
|
@@ -685,11 +685,11 @@ interface ContractAddresses {
|
|
|
685
685
|
issuerRegistry: Address;
|
|
686
686
|
mintingOracle: Address;
|
|
687
687
|
}
|
|
688
|
-
declare const
|
|
688
|
+
declare const CONTRACT_ADDRESSES: Record<number, ContractAddresses>;
|
|
689
689
|
/**
|
|
690
|
-
* PointTokenFactory address — separate from `ContractAddresses`
|
|
691
|
-
*
|
|
692
|
-
*
|
|
690
|
+
* PointTokenFactory address — separate from `ContractAddresses` because
|
|
691
|
+
* it's only used at provisioning time (issuer onboard + token creation),
|
|
692
|
+
* not in the hot mint/burn path.
|
|
693
693
|
*/
|
|
694
694
|
declare const POINT_TOKEN_FACTORY_ADDRESSES: Record<number, Address>;
|
|
695
695
|
/**
|
|
@@ -702,7 +702,7 @@ declare const POINT_TOKEN_IMPL_ADDRESSES: Record<number, Address>;
|
|
|
702
702
|
* Lookup helper — throws if the chain isn't in the map so callers fail
|
|
703
703
|
* loudly on misconfiguration instead of silently using `undefined`.
|
|
704
704
|
*/
|
|
705
|
-
declare function
|
|
705
|
+
declare function getContractAddresses(chainId: number): ContractAddresses;
|
|
706
706
|
|
|
707
707
|
/**
|
|
708
708
|
* Public contract surface for `@pafi-dev/core/contracts`.
|
|
@@ -722,18 +722,17 @@ declare function getMockAddresses(chainId: number): ContractAddresses;
|
|
|
722
722
|
* deadline, burnerSig)`.
|
|
723
723
|
*
|
|
724
724
|
* Exports:
|
|
725
|
-
* - `POINT_TOKEN_V2_ABI`
|
|
726
|
-
* - `BATCH_EXECUTOR_*`
|
|
727
|
-
*
|
|
728
|
-
*
|
|
729
|
-
* - `CONTRACT_ADDRESSES`
|
|
730
|
-
*
|
|
725
|
+
* - `POINT_TOKEN_V2_ABI` — full mint + burn + admin surface
|
|
726
|
+
* - `BATCH_EXECUTOR_*` — EIP-7702 delegation target (ABI real,
|
|
727
|
+
* address still placeholder on all
|
|
728
|
+
* chains until SC delivers)
|
|
729
|
+
* - `CONTRACT_ADDRESSES` — per-chain map (real on 8453 except
|
|
730
|
+
* `batchExecutor` — pending SC)
|
|
731
731
|
* - `POINT_TOKEN_FACTORY_ADDRESSES`, `POINT_TOKEN_IMPL_ADDRESSES`
|
|
732
|
-
*
|
|
732
|
+
* — provisioning / observability helpers
|
|
733
733
|
*
|
|
734
|
-
* Status:
|
|
735
|
-
*
|
|
736
|
-
* for the deletion checklist.
|
|
734
|
+
* Status: all real except BatchExecutor address (single remaining
|
|
735
|
+
* placeholder, flagged inline in `real/addresses.ts`).
|
|
737
736
|
*/
|
|
738
737
|
|
|
739
738
|
/**
|
|
@@ -932,13 +931,11 @@ declare function openPafiWebModal(url: string, options?: ModalOpenOptions): Prom
|
|
|
932
931
|
|
|
933
932
|
declare class PafiSDK {
|
|
934
933
|
private _pointTokenAddress?;
|
|
935
|
-
private _relayContractAddress?;
|
|
936
934
|
private _signer?;
|
|
937
935
|
private _provider?;
|
|
938
936
|
private _chainId?;
|
|
939
937
|
constructor(config: PafiSDKConfig);
|
|
940
938
|
setPointTokenAddress(address: Address): void;
|
|
941
|
-
setRelayContractAddress(address: Address): void;
|
|
942
939
|
setSigner(signer: WalletClient): void;
|
|
943
940
|
setProvider(provider: PublicClient): void;
|
|
944
941
|
private requirePointToken;
|
|
@@ -946,10 +943,6 @@ declare class PafiSDK {
|
|
|
946
943
|
private requireSigner;
|
|
947
944
|
private requireChainId;
|
|
948
945
|
getDomain(): Promise<PointTokenDomainConfig>;
|
|
949
|
-
/**
|
|
950
|
-
* Build the EIP-712 typed data for a MintRequest.
|
|
951
|
-
* Pass the result to any external signer (Privy, WalletConnect, etc.).
|
|
952
|
-
*/
|
|
953
946
|
buildMintRequestTypedData(message: MintRequest): Promise<{
|
|
954
947
|
domain: {
|
|
955
948
|
name: string;
|
|
@@ -975,10 +968,6 @@ declare class PafiSDK {
|
|
|
975
968
|
primaryType: "MintRequest";
|
|
976
969
|
message: MintRequest;
|
|
977
970
|
}>;
|
|
978
|
-
/**
|
|
979
|
-
* Build the EIP-712 typed data for a ReceiverConsent.
|
|
980
|
-
* Pass the result to any external signer (Privy, WalletConnect, etc.).
|
|
981
|
-
*/
|
|
982
971
|
buildReceiverConsentTypedData(message: ReceiverConsent): Promise<{
|
|
983
972
|
domain: {
|
|
984
973
|
name: string;
|
|
@@ -1016,11 +1005,6 @@ declare class PafiSDK {
|
|
|
1016
1005
|
verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
|
|
1017
1006
|
getMintRequestNonce(receiver: Address): Promise<bigint>;
|
|
1018
1007
|
getReceiverConsentNonce(receiver: Address): Promise<bigint>;
|
|
1019
|
-
encodeMintAndSwap(mint: MintParams, swap: SwapParams): Hex;
|
|
1020
|
-
decodeMintAndSwap(calldata: Hex): {
|
|
1021
|
-
mint: MintParams;
|
|
1022
|
-
swap: SwapParams;
|
|
1023
|
-
};
|
|
1024
1008
|
/**
|
|
1025
1009
|
* Find the best swap route from `tokenIn` to `tokenOut`.
|
|
1026
1010
|
* Merges `pools` with COMMON_POOLS for the configured chain, builds all
|
|
@@ -1041,36 +1025,6 @@ declare class PafiSDK {
|
|
|
1041
1025
|
commands: Hex;
|
|
1042
1026
|
inputs: Hex[];
|
|
1043
1027
|
};
|
|
1044
|
-
/**
|
|
1045
|
-
* Build Relay SwapParams + extData from a quote result.
|
|
1046
|
-
* Returns ready-to-use args for `Relay.mintAndSwap`.
|
|
1047
|
-
*/
|
|
1048
|
-
buildRelaySwapParams(params: {
|
|
1049
|
-
quote: {
|
|
1050
|
-
path: PathKey[];
|
|
1051
|
-
};
|
|
1052
|
-
minAmountOut: bigint;
|
|
1053
|
-
feeInUsdt: bigint;
|
|
1054
|
-
deadline: bigint;
|
|
1055
|
-
}): {
|
|
1056
|
-
swapParams: SwapParams;
|
|
1057
|
-
extData: Hex;
|
|
1058
|
-
};
|
|
1059
|
-
/**
|
|
1060
|
-
* Encode extData for ReceiverConsent and MintParams.
|
|
1061
|
-
* extData = abi.encode(minAmountOut, feeInUsdt)
|
|
1062
|
-
*/
|
|
1063
|
-
encodeExtData(minAmountOut: bigint, feeInUsdt: bigint): Hex;
|
|
1064
|
-
/**
|
|
1065
|
-
* Simulate a Relay.mintAndSwap call. Catches reverts (bad signatures,
|
|
1066
|
-
* expired deadlines, insufficient mint cap, pool errors) before submitting.
|
|
1067
|
-
*
|
|
1068
|
-
* @param relayAddress - Relay contract address
|
|
1069
|
-
* @param mint - MintParams with real signatures
|
|
1070
|
-
* @param swap - SwapParams (path + deadline)
|
|
1071
|
-
* @param from - Relayer address that will submit the tx
|
|
1072
|
-
*/
|
|
1073
|
-
simulateMintAndSwap(relayAddress: Address, mint: MintParams, swap: SwapParams, from: Address): Promise<SimulationResult>;
|
|
1074
1028
|
/**
|
|
1075
1029
|
* Simulate a UniversalRouter.execute swap call. Catches reverts (bad
|
|
1076
1030
|
* approvals, insufficient balance, pool errors) before submitting.
|
|
@@ -1082,14 +1036,9 @@ declare class PafiSDK {
|
|
|
1082
1036
|
* @param from - Address that will execute the swap
|
|
1083
1037
|
*/
|
|
1084
1038
|
simulateSwap(routerAddress: Address, commands: Hex, inputs: Hex[], deadline: bigint, from: Address): Promise<SwapSimulationResult>;
|
|
1085
|
-
/**
|
|
1086
|
-
* Build an EIP-4361 login message for the current signer + chain. The
|
|
1087
|
-
* caller supplies the issuer-specific fields (domain, nonce, uri); the SDK
|
|
1088
|
-
* fills in the wallet address and chain id from its own config.
|
|
1089
|
-
*/
|
|
1090
1039
|
createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
|
|
1091
1040
|
/** Sign a login message string with the current signer (personal_sign) */
|
|
1092
1041
|
signLoginMessage(message: string): Promise<Hex>;
|
|
1093
1042
|
}
|
|
1094
1043
|
|
|
1095
|
-
export { ApiError, BATCH_EXECUTOR_ABI,
|
|
1044
|
+
export { ApiError, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BestQuote, type BuildPartialUserOpParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, EIP712Signature, LoginMessageParams, MintRequest, type ModalOpenOptions, Operation, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, POINT_TOKEN_ABI as POINT_TOKEN_V2_ABI, PafiSDK, PafiSDKConfig, PafiSDKError, type PafiWebModalAdapter, type PafiWebModalHandle, PartialUserOperation, type PaymasterConfig, PointTokenDomainConfig, PoolKey, QuoteResult, ReceiverConsent, SUPPORTED_CHAINS, type SignatureStruct, SignatureVerification, SigningError, SimulationError, type SponsorshipScenario, type SubmissionPath, SwapSimulationResult, UNIVERSAL_ROUTER_ADDRESSES, UserOperation, V4_QUOTER_ADDRESSES, _resetPaymasterConfigForTests, assembleUserOperation, buildPartialUserOperation, burnRequestTypes, checkEthAndBranch, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, getContractAddresses, getPafiWebModalAdapter, getPaymasterConfig, isPaymasterConfigured, mintRequestTypes, openPafiWebModal, openWebPopup, rawCallOp, receiverConsentTypes, setPafiWebModalAdapter, setPaymasterConfig, webPopupAdapter };
|