@pafi-dev/core 0.9.5 → 0.10.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/README.md +194 -189
- package/dist/{chunk-UTG2UT54.cjs → chunk-4NTU7XGP.cjs} +2 -54
- package/dist/chunk-4NTU7XGP.cjs.map +1 -0
- package/dist/{chunk-BNO5SM25.cjs → chunk-BBQLGBOD.cjs} +2 -11
- package/dist/{chunk-Y5EYH2SQ.js.map → chunk-BBQLGBOD.cjs.map} +1 -1
- package/dist/{chunk-Y5EYH2SQ.js → chunk-J7EYOLMI.js} +1 -10
- package/dist/chunk-J7EYOLMI.js.map +1 -0
- package/dist/{chunk-XNVVZVK6.js → chunk-RVSW7I6U.js} +2 -54
- package/dist/chunk-RVSW7I6U.js.map +1 -0
- package/dist/contract/index.cjs +2 -4
- package/dist/contract/index.cjs.map +1 -1
- package/dist/contract/index.d.cts +2 -11
- package/dist/contract/index.d.ts +2 -11
- package/dist/contract/index.js +1 -3
- package/dist/eip712/index.cjs +2 -8
- package/dist/eip712/index.cjs.map +1 -1
- package/dist/eip712/index.d.cts +3 -42
- package/dist/eip712/index.d.ts +3 -42
- package/dist/eip712/index.js +3 -9
- package/dist/index.cjs +29 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -84
- package/dist/index.d.ts +36 -84
- package/dist/index.js +27 -54
- package/dist/index.js.map +1 -1
- package/dist/{types-DWLZNgcw.d.ts → types-B3UivyQ1.d.cts} +1 -10
- package/dist/{types-DWLZNgcw.d.cts → types-B3UivyQ1.d.ts} +1 -10
- package/package.json +10 -1
- package/dist/chunk-BNO5SM25.cjs.map +0 -1
- package/dist/chunk-UTG2UT54.cjs.map +0 -1
- package/dist/chunk-XNVVZVK6.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Address, Hex, TypedDataDomain, PublicClient, WalletClient, TransactionReceipt, HttpTransport } from 'viem';
|
|
2
|
-
import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest,
|
|
3
|
-
export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, e as ExactOutputBestQuote, f as ExactOutputQuoteResult, I as Issuer, g as PathKey, Q as QuoteResult,
|
|
2
|
+
import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, E as EIP712Signature, S as SignatureVerification } from './types-B3UivyQ1.cjs';
|
|
3
|
+
export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, e as ExactOutputBestQuote, f as ExactOutputQuoteResult, I as Issuer, g as PathKey, Q as QuoteResult, R as Recipient, h as RedemptionDecision, i as RedemptionDenial, j as RedemptionDenialCode, k as RedemptionPolicy, l as RedemptionPolicySource, m as RedemptionPreview, T as TokenCap } from './types-B3UivyQ1.cjs';
|
|
4
4
|
export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.cjs';
|
|
5
|
-
export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData,
|
|
6
|
-
export { getBurnRequestNonce, getIssuer, getMintFeeBps, getMintFeeRecipients, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress,
|
|
5
|
+
export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, signBurnRequest, signMintRequest, verifyBurnRequest, verifyMintRequest } from './eip712/index.cjs';
|
|
6
|
+
export { getBurnRequestNonce, getIssuer, getMintFeeBps, getMintFeeRecipients, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getTokenCap, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.cjs';
|
|
7
7
|
import { LoginMessageParams } from './auth/index.cjs';
|
|
8
8
|
export { BuildSponsorAuthParams, BuiltSponsorAuth, SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET, SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildAndSignSponsorAuth, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, generateSponsorAuthNonce, getSponsorAuthDomainAnchor, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.cjs';
|
|
9
9
|
|
|
@@ -52,27 +52,6 @@ declare const burnRequestTypes: {
|
|
|
52
52
|
readonly type: "uint256";
|
|
53
53
|
}];
|
|
54
54
|
};
|
|
55
|
-
declare const receiverConsentTypes: {
|
|
56
|
-
readonly ReceiverConsent: readonly [{
|
|
57
|
-
readonly name: "onBehalfOf";
|
|
58
|
-
readonly type: "address";
|
|
59
|
-
}, {
|
|
60
|
-
readonly name: "originalReceiver";
|
|
61
|
-
readonly type: "address";
|
|
62
|
-
}, {
|
|
63
|
-
readonly name: "amount";
|
|
64
|
-
readonly type: "uint256";
|
|
65
|
-
}, {
|
|
66
|
-
readonly name: "nonce";
|
|
67
|
-
readonly type: "uint256";
|
|
68
|
-
}, {
|
|
69
|
-
readonly name: "deadline";
|
|
70
|
-
readonly type: "uint256";
|
|
71
|
-
}, {
|
|
72
|
-
readonly name: "extData";
|
|
73
|
-
readonly type: "bytes";
|
|
74
|
-
}];
|
|
75
|
-
};
|
|
76
55
|
declare const SUPPORTED_CHAINS: Record<number, ChainConfig>;
|
|
77
56
|
declare const V4_QUOTER_ADDRESSES: Record<number, Address>;
|
|
78
57
|
declare const UNIVERSAL_ROUTER_ADDRESSES: Record<number, Address>;
|
|
@@ -680,12 +659,13 @@ declare function rawCallOp(target: Address, data: `0x${string}`, value?: bigint)
|
|
|
680
659
|
* and invokes each one in sequence, reverting all if any fail.
|
|
681
660
|
*
|
|
682
661
|
* Function name is `executeBatch` (selector `0x34fcd5be`) to match
|
|
683
|
-
* Pimlico's `Simple7702Account`
|
|
684
|
-
*
|
|
685
|
-
* The shorter `execute(Call[])` (selector
|
|
686
|
-
* legacy/standalone batch executor
|
|
687
|
-
* delegated EOA falls through to the
|
|
688
|
-
* with "account: not from EntryPoint"
|
|
662
|
+
* Pimlico's `Simple7702Account` — the EIP-7702 delegate impl PAFI
|
|
663
|
+
* pins on Base mainnet as of v1.4 (replaced an earlier Coinbase Smart
|
|
664
|
+
* Wallet v2 trial). The shorter `execute(Call[])` (selector
|
|
665
|
+
* `0x3f707e6b`) only exists on legacy/standalone batch executor
|
|
666
|
+
* contracts; calling it on a 7702 delegated EOA falls through to the
|
|
667
|
+
* fallback function and reverts with "account: not from EntryPoint"
|
|
668
|
+
* (AA23).
|
|
689
669
|
*/
|
|
690
670
|
declare const BATCH_EXECUTOR_ABI: readonly [{
|
|
691
671
|
readonly name: "executeBatch";
|
|
@@ -708,20 +688,21 @@ declare const BATCH_EXECUTOR_ABI: readonly [{
|
|
|
708
688
|
readonly outputs: readonly [];
|
|
709
689
|
}];
|
|
710
690
|
/**
|
|
711
|
-
* Encode a batch of operations into calldata for
|
|
712
|
-
*
|
|
691
|
+
* Encode a batch of operations into calldata for
|
|
692
|
+
* `BatchExecutor.executeBatch((address,uint256,bytes)[])`. The
|
|
693
|
+
* resulting calldata goes into `UserOperation.callData`.
|
|
713
694
|
*
|
|
714
695
|
* When the EOA has an EIP-7702 delegation to a BatchExecutor, calling
|
|
715
696
|
* this calldata against the EOA runs all operations with
|
|
716
697
|
* `msg.sender = EOA` for each inner call.
|
|
717
698
|
*
|
|
718
699
|
* @param operations batch of calls, in execution order
|
|
719
|
-
* @returns calldata bytes for `
|
|
700
|
+
* @returns calldata bytes for `executeBatch((address,uint256,bytes)[])`
|
|
720
701
|
*/
|
|
721
702
|
declare function encodeBatchExecute(operations: Operation[]): Hex;
|
|
722
703
|
/**
|
|
723
|
-
* Decode `BatchExecutor.
|
|
724
|
-
* `{ to, data, value }` objects.
|
|
704
|
+
* Decode `BatchExecutor.executeBatch(calls[])` callData back into
|
|
705
|
+
* individual `{ to, data, value }` objects.
|
|
725
706
|
*
|
|
726
707
|
* Used by issuer backends to convert a `PartialUserOperation.callData`
|
|
727
708
|
* into the `calls[]` array returned to web/FE clients (which submit via
|
|
@@ -882,20 +863,31 @@ declare function computeUserOpHash(userOp: Parameters<typeof buildUserOpTypedDat
|
|
|
882
863
|
|
|
883
864
|
/**
|
|
884
865
|
* EIP-7702 delegate impls supported by the PAFI mobile prepare/submit
|
|
885
|
-
* flow. Each impl exposes `
|
|
886
|
-
* selector `0x34fcd5be
|
|
887
|
-
*
|
|
888
|
-
*
|
|
866
|
+
* flow. Each impl exposes `executeBatch((address,uint256,bytes)[])`
|
|
867
|
+
* (selector `0x34fcd5be`) so callData encoding is identical, but each
|
|
868
|
+
* may use a slightly different dummy-signature pattern that Pimlico's
|
|
869
|
+
* `pm_sponsorUserOperation` simulation accepts.
|
|
870
|
+
*
|
|
871
|
+
* Current primary impl is `simple7702` (Pimlico's `Simple7702Account`).
|
|
872
|
+
* `batchExecutor` is retained for transition / back-compat with EOAs
|
|
873
|
+
* that delegated to the earlier Coinbase Smart Wallet v2 BatchExecutor
|
|
874
|
+
* (trialled before v1.4 — Pimlico became the canonical impl on
|
|
875
|
+
* 2026-04-27 due to a Coinbase SignatureWrapper incompatibility that
|
|
876
|
+
* caused AA23 0x3c10b94e during validateUserOp).
|
|
889
877
|
*/
|
|
890
878
|
type DelegateImpl = "simple7702" | "batchExecutor" | "unknown";
|
|
891
879
|
/**
|
|
892
|
-
* Pimlico's `Simple7702Account` implementation address on Base mainnet
|
|
880
|
+
* Pimlico's `Simple7702Account` implementation address on Base mainnet —
|
|
881
|
+
* the canonical PAFI delegation target as of v1.4 (2026-04-27).
|
|
893
882
|
* Used by `permissionless.to7702SimpleSmartAccount`.
|
|
894
883
|
*/
|
|
895
884
|
declare const SIMPLE_7702_IMPL_BASE_MAINNET: Address;
|
|
896
885
|
/**
|
|
897
|
-
* Coinbase Smart Wallet v2 BatchExecutor —
|
|
898
|
-
* target. Same on Base mainnet + Base Sepolia.
|
|
886
|
+
* Legacy Coinbase Smart Wallet v2 BatchExecutor — PAFI's pre-v1.4
|
|
887
|
+
* delegation target. Same on Base mainnet + Base Sepolia. Detected
|
|
888
|
+
* here so EOAs that delegated to this address before the v1.4 cutover
|
|
889
|
+
* still pass the impl check; new delegations should target
|
|
890
|
+
* {@link SIMPLE_7702_IMPL_BASE_MAINNET} instead.
|
|
899
891
|
*/
|
|
900
892
|
declare const BATCH_EXECUTOR_7702_IMPL: Address;
|
|
901
893
|
/**
|
|
@@ -2003,12 +1995,6 @@ declare class PafiSDK {
|
|
|
2003
1995
|
verify: PafiSDK["verifyMintRequest"];
|
|
2004
1996
|
getNonce: PafiSDK["getMintRequestNonce"];
|
|
2005
1997
|
};
|
|
2006
|
-
readonly consent: {
|
|
2007
|
-
buildTypedData: PafiSDK["buildReceiverConsentTypedData"];
|
|
2008
|
-
sign: PafiSDK["signReceiverConsent"];
|
|
2009
|
-
verify: PafiSDK["verifyReceiverConsent"];
|
|
2010
|
-
getNonce: PafiSDK["getReceiverConsentNonce"];
|
|
2011
|
-
};
|
|
2012
1998
|
readonly auth: {
|
|
2013
1999
|
createLoginMessage: PafiSDK["createLoginMessage"];
|
|
2014
2000
|
signMessage: PafiSDK["signLoginMessage"];
|
|
@@ -2050,46 +2036,12 @@ declare class PafiSDK {
|
|
|
2050
2036
|
primaryType: "MintForRequest";
|
|
2051
2037
|
message: MintRequest;
|
|
2052
2038
|
}>;
|
|
2053
|
-
buildReceiverConsentTypedData(message: ReceiverConsent): Promise<{
|
|
2054
|
-
domain: {
|
|
2055
|
-
name: string;
|
|
2056
|
-
version: string;
|
|
2057
|
-
chainId: number;
|
|
2058
|
-
verifyingContract: `0x${string}`;
|
|
2059
|
-
};
|
|
2060
|
-
types: {
|
|
2061
|
-
readonly ReceiverConsent: readonly [{
|
|
2062
|
-
readonly name: "onBehalfOf";
|
|
2063
|
-
readonly type: "address";
|
|
2064
|
-
}, {
|
|
2065
|
-
readonly name: "originalReceiver";
|
|
2066
|
-
readonly type: "address";
|
|
2067
|
-
}, {
|
|
2068
|
-
readonly name: "amount";
|
|
2069
|
-
readonly type: "uint256";
|
|
2070
|
-
}, {
|
|
2071
|
-
readonly name: "nonce";
|
|
2072
|
-
readonly type: "uint256";
|
|
2073
|
-
}, {
|
|
2074
|
-
readonly name: "deadline";
|
|
2075
|
-
readonly type: "uint256";
|
|
2076
|
-
}, {
|
|
2077
|
-
readonly name: "extData";
|
|
2078
|
-
readonly type: "bytes";
|
|
2079
|
-
}];
|
|
2080
|
-
};
|
|
2081
|
-
primaryType: "ReceiverConsent";
|
|
2082
|
-
message: ReceiverConsent;
|
|
2083
|
-
}>;
|
|
2084
2039
|
signMintRequest(message: MintRequest): Promise<EIP712Signature>;
|
|
2085
2040
|
verifyMintRequest(message: MintRequest, signature: Hex, expectedMinter: Address): Promise<SignatureVerification>;
|
|
2086
|
-
signReceiverConsent(message: ReceiverConsent): Promise<EIP712Signature>;
|
|
2087
|
-
verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
|
|
2088
2041
|
getMintRequestNonce(receiver: Address): Promise<bigint>;
|
|
2089
|
-
getReceiverConsentNonce(receiver: Address): Promise<bigint>;
|
|
2090
2042
|
createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
|
|
2091
2043
|
/** Sign a login message string with the current signer (personal_sign) */
|
|
2092
2044
|
signLoginMessage(message: string): Promise<Hex>;
|
|
2093
2045
|
}
|
|
2094
2046
|
|
|
2095
|
-
export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SERVICE_URLS, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiErrorType, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig,
|
|
2047
|
+
export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SERVICE_URLS, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiErrorType, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, SDK_ERROR_HTTP_STATUS_CODE, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SdkErrorHttpStatus, type SendWithPaymasterFallbackParams, type SignAuthorizationFn, type SignatureStruct, SignatureVerification, type SignedAuthorization, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V4_QUOTER_ADDRESSES, ValidationError, type VaultDepositFE, ZERO_VALUE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, defaultErrorTypeForStatus, delegateDirect, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiServiceUrls, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Address, Hex, TypedDataDomain, PublicClient, WalletClient, TransactionReceipt, HttpTransport } from 'viem';
|
|
2
|
-
import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest,
|
|
3
|
-
export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, e as ExactOutputBestQuote, f as ExactOutputQuoteResult, I as Issuer, g as PathKey, Q as QuoteResult,
|
|
2
|
+
import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, E as EIP712Signature, S as SignatureVerification } from './types-B3UivyQ1.js';
|
|
3
|
+
export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, e as ExactOutputBestQuote, f as ExactOutputQuoteResult, I as Issuer, g as PathKey, Q as QuoteResult, R as Recipient, h as RedemptionDecision, i as RedemptionDenial, j as RedemptionDenialCode, k as RedemptionPolicy, l as RedemptionPolicySource, m as RedemptionPreview, T as TokenCap } from './types-B3UivyQ1.js';
|
|
4
4
|
export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.js';
|
|
5
|
-
export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData,
|
|
6
|
-
export { getBurnRequestNonce, getIssuer, getMintFeeBps, getMintFeeRecipients, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress,
|
|
5
|
+
export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, signBurnRequest, signMintRequest, verifyBurnRequest, verifyMintRequest } from './eip712/index.js';
|
|
6
|
+
export { getBurnRequestNonce, getIssuer, getMintFeeBps, getMintFeeRecipients, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getTokenCap, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.js';
|
|
7
7
|
import { LoginMessageParams } from './auth/index.js';
|
|
8
8
|
export { BuildSponsorAuthParams, BuiltSponsorAuth, SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET, SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildAndSignSponsorAuth, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, generateSponsorAuthNonce, getSponsorAuthDomainAnchor, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.js';
|
|
9
9
|
|
|
@@ -52,27 +52,6 @@ declare const burnRequestTypes: {
|
|
|
52
52
|
readonly type: "uint256";
|
|
53
53
|
}];
|
|
54
54
|
};
|
|
55
|
-
declare const receiverConsentTypes: {
|
|
56
|
-
readonly ReceiverConsent: readonly [{
|
|
57
|
-
readonly name: "onBehalfOf";
|
|
58
|
-
readonly type: "address";
|
|
59
|
-
}, {
|
|
60
|
-
readonly name: "originalReceiver";
|
|
61
|
-
readonly type: "address";
|
|
62
|
-
}, {
|
|
63
|
-
readonly name: "amount";
|
|
64
|
-
readonly type: "uint256";
|
|
65
|
-
}, {
|
|
66
|
-
readonly name: "nonce";
|
|
67
|
-
readonly type: "uint256";
|
|
68
|
-
}, {
|
|
69
|
-
readonly name: "deadline";
|
|
70
|
-
readonly type: "uint256";
|
|
71
|
-
}, {
|
|
72
|
-
readonly name: "extData";
|
|
73
|
-
readonly type: "bytes";
|
|
74
|
-
}];
|
|
75
|
-
};
|
|
76
55
|
declare const SUPPORTED_CHAINS: Record<number, ChainConfig>;
|
|
77
56
|
declare const V4_QUOTER_ADDRESSES: Record<number, Address>;
|
|
78
57
|
declare const UNIVERSAL_ROUTER_ADDRESSES: Record<number, Address>;
|
|
@@ -680,12 +659,13 @@ declare function rawCallOp(target: Address, data: `0x${string}`, value?: bigint)
|
|
|
680
659
|
* and invokes each one in sequence, reverting all if any fail.
|
|
681
660
|
*
|
|
682
661
|
* Function name is `executeBatch` (selector `0x34fcd5be`) to match
|
|
683
|
-
* Pimlico's `Simple7702Account`
|
|
684
|
-
*
|
|
685
|
-
* The shorter `execute(Call[])` (selector
|
|
686
|
-
* legacy/standalone batch executor
|
|
687
|
-
* delegated EOA falls through to the
|
|
688
|
-
* with "account: not from EntryPoint"
|
|
662
|
+
* Pimlico's `Simple7702Account` — the EIP-7702 delegate impl PAFI
|
|
663
|
+
* pins on Base mainnet as of v1.4 (replaced an earlier Coinbase Smart
|
|
664
|
+
* Wallet v2 trial). The shorter `execute(Call[])` (selector
|
|
665
|
+
* `0x3f707e6b`) only exists on legacy/standalone batch executor
|
|
666
|
+
* contracts; calling it on a 7702 delegated EOA falls through to the
|
|
667
|
+
* fallback function and reverts with "account: not from EntryPoint"
|
|
668
|
+
* (AA23).
|
|
689
669
|
*/
|
|
690
670
|
declare const BATCH_EXECUTOR_ABI: readonly [{
|
|
691
671
|
readonly name: "executeBatch";
|
|
@@ -708,20 +688,21 @@ declare const BATCH_EXECUTOR_ABI: readonly [{
|
|
|
708
688
|
readonly outputs: readonly [];
|
|
709
689
|
}];
|
|
710
690
|
/**
|
|
711
|
-
* Encode a batch of operations into calldata for
|
|
712
|
-
*
|
|
691
|
+
* Encode a batch of operations into calldata for
|
|
692
|
+
* `BatchExecutor.executeBatch((address,uint256,bytes)[])`. The
|
|
693
|
+
* resulting calldata goes into `UserOperation.callData`.
|
|
713
694
|
*
|
|
714
695
|
* When the EOA has an EIP-7702 delegation to a BatchExecutor, calling
|
|
715
696
|
* this calldata against the EOA runs all operations with
|
|
716
697
|
* `msg.sender = EOA` for each inner call.
|
|
717
698
|
*
|
|
718
699
|
* @param operations batch of calls, in execution order
|
|
719
|
-
* @returns calldata bytes for `
|
|
700
|
+
* @returns calldata bytes for `executeBatch((address,uint256,bytes)[])`
|
|
720
701
|
*/
|
|
721
702
|
declare function encodeBatchExecute(operations: Operation[]): Hex;
|
|
722
703
|
/**
|
|
723
|
-
* Decode `BatchExecutor.
|
|
724
|
-
* `{ to, data, value }` objects.
|
|
704
|
+
* Decode `BatchExecutor.executeBatch(calls[])` callData back into
|
|
705
|
+
* individual `{ to, data, value }` objects.
|
|
725
706
|
*
|
|
726
707
|
* Used by issuer backends to convert a `PartialUserOperation.callData`
|
|
727
708
|
* into the `calls[]` array returned to web/FE clients (which submit via
|
|
@@ -882,20 +863,31 @@ declare function computeUserOpHash(userOp: Parameters<typeof buildUserOpTypedDat
|
|
|
882
863
|
|
|
883
864
|
/**
|
|
884
865
|
* EIP-7702 delegate impls supported by the PAFI mobile prepare/submit
|
|
885
|
-
* flow. Each impl exposes `
|
|
886
|
-
* selector `0x34fcd5be
|
|
887
|
-
*
|
|
888
|
-
*
|
|
866
|
+
* flow. Each impl exposes `executeBatch((address,uint256,bytes)[])`
|
|
867
|
+
* (selector `0x34fcd5be`) so callData encoding is identical, but each
|
|
868
|
+
* may use a slightly different dummy-signature pattern that Pimlico's
|
|
869
|
+
* `pm_sponsorUserOperation` simulation accepts.
|
|
870
|
+
*
|
|
871
|
+
* Current primary impl is `simple7702` (Pimlico's `Simple7702Account`).
|
|
872
|
+
* `batchExecutor` is retained for transition / back-compat with EOAs
|
|
873
|
+
* that delegated to the earlier Coinbase Smart Wallet v2 BatchExecutor
|
|
874
|
+
* (trialled before v1.4 — Pimlico became the canonical impl on
|
|
875
|
+
* 2026-04-27 due to a Coinbase SignatureWrapper incompatibility that
|
|
876
|
+
* caused AA23 0x3c10b94e during validateUserOp).
|
|
889
877
|
*/
|
|
890
878
|
type DelegateImpl = "simple7702" | "batchExecutor" | "unknown";
|
|
891
879
|
/**
|
|
892
|
-
* Pimlico's `Simple7702Account` implementation address on Base mainnet
|
|
880
|
+
* Pimlico's `Simple7702Account` implementation address on Base mainnet —
|
|
881
|
+
* the canonical PAFI delegation target as of v1.4 (2026-04-27).
|
|
893
882
|
* Used by `permissionless.to7702SimpleSmartAccount`.
|
|
894
883
|
*/
|
|
895
884
|
declare const SIMPLE_7702_IMPL_BASE_MAINNET: Address;
|
|
896
885
|
/**
|
|
897
|
-
* Coinbase Smart Wallet v2 BatchExecutor —
|
|
898
|
-
* target. Same on Base mainnet + Base Sepolia.
|
|
886
|
+
* Legacy Coinbase Smart Wallet v2 BatchExecutor — PAFI's pre-v1.4
|
|
887
|
+
* delegation target. Same on Base mainnet + Base Sepolia. Detected
|
|
888
|
+
* here so EOAs that delegated to this address before the v1.4 cutover
|
|
889
|
+
* still pass the impl check; new delegations should target
|
|
890
|
+
* {@link SIMPLE_7702_IMPL_BASE_MAINNET} instead.
|
|
899
891
|
*/
|
|
900
892
|
declare const BATCH_EXECUTOR_7702_IMPL: Address;
|
|
901
893
|
/**
|
|
@@ -2003,12 +1995,6 @@ declare class PafiSDK {
|
|
|
2003
1995
|
verify: PafiSDK["verifyMintRequest"];
|
|
2004
1996
|
getNonce: PafiSDK["getMintRequestNonce"];
|
|
2005
1997
|
};
|
|
2006
|
-
readonly consent: {
|
|
2007
|
-
buildTypedData: PafiSDK["buildReceiverConsentTypedData"];
|
|
2008
|
-
sign: PafiSDK["signReceiverConsent"];
|
|
2009
|
-
verify: PafiSDK["verifyReceiverConsent"];
|
|
2010
|
-
getNonce: PafiSDK["getReceiverConsentNonce"];
|
|
2011
|
-
};
|
|
2012
1998
|
readonly auth: {
|
|
2013
1999
|
createLoginMessage: PafiSDK["createLoginMessage"];
|
|
2014
2000
|
signMessage: PafiSDK["signLoginMessage"];
|
|
@@ -2050,46 +2036,12 @@ declare class PafiSDK {
|
|
|
2050
2036
|
primaryType: "MintForRequest";
|
|
2051
2037
|
message: MintRequest;
|
|
2052
2038
|
}>;
|
|
2053
|
-
buildReceiverConsentTypedData(message: ReceiverConsent): Promise<{
|
|
2054
|
-
domain: {
|
|
2055
|
-
name: string;
|
|
2056
|
-
version: string;
|
|
2057
|
-
chainId: number;
|
|
2058
|
-
verifyingContract: `0x${string}`;
|
|
2059
|
-
};
|
|
2060
|
-
types: {
|
|
2061
|
-
readonly ReceiverConsent: readonly [{
|
|
2062
|
-
readonly name: "onBehalfOf";
|
|
2063
|
-
readonly type: "address";
|
|
2064
|
-
}, {
|
|
2065
|
-
readonly name: "originalReceiver";
|
|
2066
|
-
readonly type: "address";
|
|
2067
|
-
}, {
|
|
2068
|
-
readonly name: "amount";
|
|
2069
|
-
readonly type: "uint256";
|
|
2070
|
-
}, {
|
|
2071
|
-
readonly name: "nonce";
|
|
2072
|
-
readonly type: "uint256";
|
|
2073
|
-
}, {
|
|
2074
|
-
readonly name: "deadline";
|
|
2075
|
-
readonly type: "uint256";
|
|
2076
|
-
}, {
|
|
2077
|
-
readonly name: "extData";
|
|
2078
|
-
readonly type: "bytes";
|
|
2079
|
-
}];
|
|
2080
|
-
};
|
|
2081
|
-
primaryType: "ReceiverConsent";
|
|
2082
|
-
message: ReceiverConsent;
|
|
2083
|
-
}>;
|
|
2084
2039
|
signMintRequest(message: MintRequest): Promise<EIP712Signature>;
|
|
2085
2040
|
verifyMintRequest(message: MintRequest, signature: Hex, expectedMinter: Address): Promise<SignatureVerification>;
|
|
2086
|
-
signReceiverConsent(message: ReceiverConsent): Promise<EIP712Signature>;
|
|
2087
|
-
verifyReceiverConsent(message: ReceiverConsent, signature: Hex, expectedReceiver: Address): Promise<SignatureVerification>;
|
|
2088
2041
|
getMintRequestNonce(receiver: Address): Promise<bigint>;
|
|
2089
|
-
getReceiverConsentNonce(receiver: Address): Promise<bigint>;
|
|
2090
2042
|
createLoginMessage(params: Omit<LoginMessageParams, "address" | "chainId">): Promise<string>;
|
|
2091
2043
|
/** Sign a login message string with the current signer (personal_sign) */
|
|
2092
2044
|
signLoginMessage(message: string): Promise<Hex>;
|
|
2093
2045
|
}
|
|
2094
2046
|
|
|
2095
|
-
export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SERVICE_URLS, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiErrorType, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig,
|
|
2047
|
+
export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SERVICE_URLS, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiErrorType, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, SDK_ERROR_HTTP_STATUS_CODE, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SdkErrorHttpStatus, type SendWithPaymasterFallbackParams, type SignAuthorizationFn, type SignatureStruct, SignatureVerification, type SignedAuthorization, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V4_QUOTER_ADDRESSES, ValidationError, type VaultDepositFE, ZERO_VALUE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, defaultErrorTypeForStatus, delegateDirect, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiServiceUrls, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
erc20Abi,
|
|
3
|
-
permit2Abi,
|
|
4
|
-
pointTokenFactoryAbi,
|
|
5
|
-
universalRouterAbi,
|
|
6
|
-
v4QuoterAbi
|
|
7
|
-
} from "./chunk-CWH4KOUW.js";
|
|
8
1
|
import {
|
|
9
2
|
SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET,
|
|
10
3
|
SPONSOR_AUTH_DOMAIN_NAME,
|
|
@@ -21,6 +14,13 @@ import {
|
|
|
21
14
|
verifyLoginMessage,
|
|
22
15
|
verifySponsorAuth
|
|
23
16
|
} from "./chunk-4EGXLYMM.js";
|
|
17
|
+
import {
|
|
18
|
+
erc20Abi,
|
|
19
|
+
permit2Abi,
|
|
20
|
+
pointTokenFactoryAbi,
|
|
21
|
+
universalRouterAbi,
|
|
22
|
+
v4QuoterAbi
|
|
23
|
+
} from "./chunk-CWH4KOUW.js";
|
|
24
24
|
import {
|
|
25
25
|
getBurnRequestNonce,
|
|
26
26
|
getIssuer,
|
|
@@ -30,14 +30,13 @@ import {
|
|
|
30
30
|
getMintRequestNonce,
|
|
31
31
|
getPointTokenBalance,
|
|
32
32
|
getPointTokenIssuer,
|
|
33
|
-
getReceiverConsentNonce,
|
|
34
33
|
getTokenCap,
|
|
35
34
|
getTokenName,
|
|
36
35
|
isActiveIssuer,
|
|
37
36
|
isMinter,
|
|
38
37
|
issuerRegistryGetIssuerFlatAbi,
|
|
39
38
|
verifyMintCap
|
|
40
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-J7EYOLMI.js";
|
|
41
40
|
import {
|
|
42
41
|
issuerRegistryAbi,
|
|
43
42
|
mintFeeWrapperAbi,
|
|
@@ -58,17 +57,13 @@ import {
|
|
|
58
57
|
buildBurnRequestTypedData,
|
|
59
58
|
buildDomain,
|
|
60
59
|
buildMintRequestTypedData,
|
|
61
|
-
buildReceiverConsentTypedData,
|
|
62
60
|
burnRequestTypes,
|
|
63
61
|
mintRequestTypes,
|
|
64
|
-
receiverConsentTypes,
|
|
65
62
|
signBurnRequest,
|
|
66
63
|
signMintRequest,
|
|
67
|
-
signReceiverConsent,
|
|
68
64
|
verifyBurnRequest,
|
|
69
|
-
verifyMintRequest
|
|
70
|
-
|
|
71
|
-
} from "./chunk-XNVVZVK6.js";
|
|
65
|
+
verifyMintRequest
|
|
66
|
+
} from "./chunk-RVSW7I6U.js";
|
|
72
67
|
import {
|
|
73
68
|
pointTokenAbi
|
|
74
69
|
} from "./chunk-UCO5DXD6.js";
|
|
@@ -637,7 +632,7 @@ function warnDeprecated(fn) {
|
|
|
637
632
|
if (_deprecationWarned) return;
|
|
638
633
|
_deprecationWarned = true;
|
|
639
634
|
console.warn(
|
|
640
|
-
`[PAFI] DEPRECATION
|
|
635
|
+
`[PAFI] DEPRECATION: \`${fn}\` from @pafi-dev/core/paymaster has been deprecated since v0.7.1 and will be removed in the next major bump (v1.0). Use \`PafiBackendClient\` from @pafi-dev/issuer/pafi-backend instead.`
|
|
641
636
|
);
|
|
642
637
|
}
|
|
643
638
|
function setPaymasterConfig(config) {
|
|
@@ -1210,15 +1205,24 @@ async function getPtPerUsdt18dec(fetchImpl, subgraphUrl, pointTokenAddress, fall
|
|
|
1210
1205
|
const pool = json.data?.pafiToken?.pool;
|
|
1211
1206
|
if (!pool) throw new Error("pafiToken or pool not found");
|
|
1212
1207
|
const isPtToken0 = pool.token0.id.toLowerCase() === pointTokenAddress.toLowerCase();
|
|
1213
|
-
|
|
1214
|
-
if (
|
|
1215
|
-
|
|
1208
|
+
let ptPerUsdtHumanStr;
|
|
1209
|
+
if (isPtToken0) {
|
|
1210
|
+
const usdtPerPtHuman = Number(pool.token0Price);
|
|
1211
|
+
if (!Number.isFinite(usdtPerPtHuman) || usdtPerPtHuman <= 0) {
|
|
1212
|
+
throw new Error(`invalid pool token0Price from subgraph: ${pool.token0Price}`);
|
|
1213
|
+
}
|
|
1214
|
+
ptPerUsdtHumanStr = (1 / usdtPerPtHuman).toFixed(18);
|
|
1215
|
+
} else {
|
|
1216
|
+
ptPerUsdtHumanStr = pool.token1Price;
|
|
1217
|
+
if (!ptPerUsdtHumanStr || Number(ptPerUsdtHumanStr) <= 0) {
|
|
1218
|
+
throw new Error(`invalid pool token1Price from subgraph: ${ptPerUsdtHumanStr}`);
|
|
1219
|
+
}
|
|
1216
1220
|
}
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1219
|
-
throw new Error(`pool price parsed to zero: ${
|
|
1221
|
+
const ptPerUsdt18dec = parseBigDecimalTo18(ptPerUsdtHumanStr);
|
|
1222
|
+
if (ptPerUsdt18dec === 0n) {
|
|
1223
|
+
throw new Error(`pool price parsed to zero: ${ptPerUsdtHumanStr}`);
|
|
1220
1224
|
}
|
|
1221
|
-
return
|
|
1225
|
+
return ptPerUsdt18dec;
|
|
1222
1226
|
} catch (err) {
|
|
1223
1227
|
const reason = err instanceof Error ? err.message : String(err);
|
|
1224
1228
|
if (fallbackPtPriceUsdt === null) {
|
|
@@ -1412,7 +1416,6 @@ var PafiSDK = class {
|
|
|
1412
1416
|
// lives in the flat methods below so both access styles work.
|
|
1413
1417
|
// -------------------------------------------------------------------------
|
|
1414
1418
|
mint;
|
|
1415
|
-
consent;
|
|
1416
1419
|
auth;
|
|
1417
1420
|
constructor(config) {
|
|
1418
1421
|
this._pointTokenAddress = config.pointTokenAddress;
|
|
@@ -1431,12 +1434,6 @@ var PafiSDK = class {
|
|
|
1431
1434
|
verify: this.verifyMintRequest.bind(this),
|
|
1432
1435
|
getNonce: this.getMintRequestNonce.bind(this)
|
|
1433
1436
|
};
|
|
1434
|
-
this.consent = {
|
|
1435
|
-
buildTypedData: this.buildReceiverConsentTypedData.bind(this),
|
|
1436
|
-
sign: this.signReceiverConsent.bind(this),
|
|
1437
|
-
verify: this.verifyReceiverConsent.bind(this),
|
|
1438
|
-
getNonce: this.getReceiverConsentNonce.bind(this)
|
|
1439
|
-
};
|
|
1440
1437
|
this.auth = {
|
|
1441
1438
|
createLoginMessage: this.createLoginMessage.bind(this),
|
|
1442
1439
|
signMessage: this.signLoginMessage.bind(this)
|
|
@@ -1498,10 +1495,6 @@ var PafiSDK = class {
|
|
|
1498
1495
|
const domain = await this.getDomain();
|
|
1499
1496
|
return buildMintRequestTypedData(domain, message);
|
|
1500
1497
|
}
|
|
1501
|
-
async buildReceiverConsentTypedData(message) {
|
|
1502
|
-
const domain = await this.getDomain();
|
|
1503
|
-
return buildReceiverConsentTypedData(domain, message);
|
|
1504
|
-
}
|
|
1505
1498
|
async signMintRequest(message) {
|
|
1506
1499
|
const domain = await this.getDomain();
|
|
1507
1500
|
return signMintRequest(this.requireSigner(), domain, message);
|
|
@@ -1510,14 +1503,6 @@ var PafiSDK = class {
|
|
|
1510
1503
|
const domain = await this.getDomain();
|
|
1511
1504
|
return verifyMintRequest(domain, message, signature, expectedMinter);
|
|
1512
1505
|
}
|
|
1513
|
-
async signReceiverConsent(message) {
|
|
1514
|
-
const domain = await this.getDomain();
|
|
1515
|
-
return signReceiverConsent(this.requireSigner(), domain, message);
|
|
1516
|
-
}
|
|
1517
|
-
async verifyReceiverConsent(message, signature, expectedReceiver) {
|
|
1518
|
-
const domain = await this.getDomain();
|
|
1519
|
-
return verifyReceiverConsent(domain, message, signature, expectedReceiver);
|
|
1520
|
-
}
|
|
1521
1506
|
// -------------------------------------------------------------------------
|
|
1522
1507
|
// Contract reads
|
|
1523
1508
|
// -------------------------------------------------------------------------
|
|
@@ -1528,13 +1513,6 @@ var PafiSDK = class {
|
|
|
1528
1513
|
receiver
|
|
1529
1514
|
);
|
|
1530
1515
|
}
|
|
1531
|
-
async getReceiverConsentNonce(receiver) {
|
|
1532
|
-
return getReceiverConsentNonce(
|
|
1533
|
-
this.requireProvider(),
|
|
1534
|
-
this.requirePointToken(),
|
|
1535
|
-
receiver
|
|
1536
|
-
);
|
|
1537
|
-
}
|
|
1538
1516
|
// -------------------------------------------------------------------------
|
|
1539
1517
|
// Auth — EIP-4361 login helpers (offline, stateless)
|
|
1540
1518
|
// -------------------------------------------------------------------------
|
|
@@ -1612,7 +1590,6 @@ export {
|
|
|
1612
1590
|
buildPartialUserOperation,
|
|
1613
1591
|
buildPerpDepositViaRelay,
|
|
1614
1592
|
buildPerpDepositWithGasDeduction,
|
|
1615
|
-
buildReceiverConsentTypedData,
|
|
1616
1593
|
buildSponsorAuthDomain,
|
|
1617
1594
|
buildSponsorAuthTypedData,
|
|
1618
1595
|
buildUserOpTypedData,
|
|
@@ -1650,7 +1627,6 @@ export {
|
|
|
1650
1627
|
getPointTokenBalance,
|
|
1651
1628
|
getPointTokenIssuer,
|
|
1652
1629
|
getIssuer as getPointTokenIssuerAddress,
|
|
1653
|
-
getReceiverConsentNonce,
|
|
1654
1630
|
getSponsorAuthDomainAnchor,
|
|
1655
1631
|
getTokenCap,
|
|
1656
1632
|
getTokenName,
|
|
@@ -1675,14 +1651,12 @@ export {
|
|
|
1675
1651
|
quoteOperatorFeePt,
|
|
1676
1652
|
quoteOperatorFeeUsdt,
|
|
1677
1653
|
rawCallOp,
|
|
1678
|
-
receiverConsentTypes,
|
|
1679
1654
|
sendWithPaymasterFallback,
|
|
1680
1655
|
serializeUserOpToJsonRpc,
|
|
1681
1656
|
setPafiWebModalAdapter,
|
|
1682
1657
|
setPaymasterConfig,
|
|
1683
1658
|
signBurnRequest,
|
|
1684
1659
|
signMintRequest,
|
|
1685
|
-
signReceiverConsent,
|
|
1686
1660
|
signSponsorAuth,
|
|
1687
1661
|
splitAuthorizationSig,
|
|
1688
1662
|
universalRouterAbi,
|
|
@@ -1691,7 +1665,6 @@ export {
|
|
|
1691
1665
|
verifyLoginMessage,
|
|
1692
1666
|
verifyMintCap,
|
|
1693
1667
|
verifyMintRequest,
|
|
1694
|
-
verifyReceiverConsent,
|
|
1695
1668
|
verifySponsorAuth,
|
|
1696
1669
|
webPopupAdapter
|
|
1697
1670
|
};
|