@pafi-dev/core 0.7.10 → 0.8.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/abi/index.cjs +5 -3
- package/dist/abi/index.cjs.map +1 -1
- package/dist/abi/index.d.cts +451 -2
- package/dist/abi/index.d.ts +451 -2
- package/dist/abi/index.js +4 -2
- package/dist/chunk-644KZUKR.cjs +519 -0
- package/dist/chunk-644KZUKR.cjs.map +1 -0
- package/dist/{chunk-6CXTFOIH.js → chunk-ABNM6LMP.js} +266 -1
- package/dist/chunk-ABNM6LMP.js.map +1 -0
- package/dist/{chunk-4QRHSZZQ.cjs → chunk-ACQHZWHP.cjs} +3 -3
- package/dist/{chunk-4QRHSZZQ.cjs.map → chunk-ACQHZWHP.cjs.map} +1 -1
- package/dist/{chunk-QL5COJQI.js → chunk-BB5YW57R.js} +2 -2
- package/dist/chunk-CUVUSVWR.js +519 -0
- package/dist/chunk-CUVUSVWR.js.map +1 -0
- package/dist/{chunk-Q6WCDZXI.cjs → chunk-RFANYF24.cjs} +267 -2
- package/dist/chunk-RFANYF24.cjs.map +1 -0
- package/dist/{chunk-AEYEFV5G.js → chunk-Y4CFC4OC.js} +2 -2
- package/dist/{chunk-REUEMYWB.cjs → chunk-YCY7MBSJ.cjs} +9 -9
- package/dist/{chunk-REUEMYWB.cjs.map → chunk-YCY7MBSJ.cjs.map} +1 -1
- package/dist/contract/index.cjs +3 -3
- package/dist/contract/index.d.cts +1 -1
- package/dist/contract/index.d.ts +1 -1
- package/dist/contract/index.js +2 -2
- package/dist/eip712/index.cjs +3 -3
- package/dist/eip712/index.d.cts +1 -1
- package/dist/eip712/index.d.ts +1 -1
- package/dist/eip712/index.js +2 -2
- package/dist/index.cjs +88 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -5
- package/dist/index.d.ts +39 -5
- package/dist/index.js +50 -6
- package/dist/index.js.map +1 -1
- package/dist/{types-CCvAk-ma.d.ts → types-BS4kpO4Z.d.cts} +8 -11
- package/dist/{types-CCvAk-ma.d.cts → types-BS4kpO4Z.d.ts} +8 -11
- package/package.json +1 -1
- package/dist/chunk-6CXTFOIH.js.map +0 -1
- package/dist/chunk-6WWSKC3Z.cjs +0 -1097
- package/dist/chunk-6WWSKC3Z.cjs.map +0 -1
- package/dist/chunk-Q6WCDZXI.cjs.map +0 -1
- package/dist/chunk-SZMSKZHY.js +0 -1097
- package/dist/chunk-SZMSKZHY.js.map +0 -1
- /package/dist/{chunk-QL5COJQI.js.map → chunk-BB5YW57R.js.map} +0 -0
- /package/dist/{chunk-AEYEFV5G.js.map → chunk-Y4CFC4OC.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification } from './types-
|
|
3
|
-
export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, I as Issuer, e as PathKey, Q as QuoteResult, f as
|
|
4
|
-
export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.cjs';
|
|
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 } from './types-BS4kpO4Z.cjs';
|
|
3
|
+
export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, I as Issuer, e as PathKey, Q as QuoteResult, f as Recipient, g as RedemptionDecision, h as RedemptionDenial, i as RedemptionDenialCode, j as RedemptionPolicy, k as RedemptionPolicySource, l as RedemptionPreview } from './types-BS4kpO4Z.cjs';
|
|
4
|
+
export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.cjs';
|
|
5
5
|
export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.cjs';
|
|
6
6
|
export { getBurnRequestNonce, getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.cjs';
|
|
7
7
|
import { LoginMessageParams } from './auth/index.cjs';
|
|
@@ -92,6 +92,16 @@ declare const PERMIT2_ADDRESS: Address;
|
|
|
92
92
|
* still becomes 500.
|
|
93
93
|
*/
|
|
94
94
|
type SdkErrorHttpStatus = "not_found" | "forbidden" | "unprocessable" | "service_unavailable";
|
|
95
|
+
/**
|
|
96
|
+
* Stripe-style error taxonomy. The SDK emits one of these on every
|
|
97
|
+
* error so consumers can branch UI behavior on `type` (toast vs modal
|
|
98
|
+
* vs retry banner) without whitelisting individual `code` values.
|
|
99
|
+
*/
|
|
100
|
+
type PafiErrorType = "validation_error" | "authentication_error" | "authorization_error" | "not_found_error" | "business_logic_error" | "rate_limit_error" | "server_error" | "service_unavailable_error";
|
|
101
|
+
/** Numeric HTTP status implied by an `SdkErrorHttpStatus` slot. */
|
|
102
|
+
declare const SDK_ERROR_HTTP_STATUS_CODE: Record<SdkErrorHttpStatus, number>;
|
|
103
|
+
/** Default `type` slot for a numeric HTTP status. */
|
|
104
|
+
declare function defaultErrorTypeForStatus(status: number): PafiErrorType;
|
|
95
105
|
declare abstract class PafiSdkError extends Error {
|
|
96
106
|
abstract readonly code: string;
|
|
97
107
|
/**
|
|
@@ -101,6 +111,24 @@ declare abstract class PafiSdkError extends Error {
|
|
|
101
111
|
readonly safeToRetry: boolean;
|
|
102
112
|
readonly details?: unknown;
|
|
103
113
|
abstract readonly httpStatus: SdkErrorHttpStatus;
|
|
114
|
+
/**
|
|
115
|
+
* Optional Stripe-style taxonomy override. Defaults to the type
|
|
116
|
+
* implied by `httpStatus` (forbidden→authorization_error,
|
|
117
|
+
* unprocessable→business_logic_error, etc).
|
|
118
|
+
*/
|
|
119
|
+
readonly type?: PafiErrorType;
|
|
120
|
+
/**
|
|
121
|
+
* Optional name of the request field that triggered the error (e.g.
|
|
122
|
+
* `"amount"`, `"chainId"`). Surfaced on validation failures so the
|
|
123
|
+
* client can highlight the offending field.
|
|
124
|
+
*/
|
|
125
|
+
readonly param?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Optional structured context (e.g. `{ available, requested }` for a
|
|
128
|
+
* cap denial). Distinct from `details` — `metadata` is meant for
|
|
129
|
+
* UI consumption; `details` carries raw debug info.
|
|
130
|
+
*/
|
|
131
|
+
readonly metadata?: Record<string, unknown>;
|
|
104
132
|
constructor(message: string);
|
|
105
133
|
}
|
|
106
134
|
/**
|
|
@@ -154,9 +182,15 @@ declare class OracleStaleError extends PafiSdkError {
|
|
|
154
182
|
*/
|
|
155
183
|
declare class ValidationError extends PafiSdkError {
|
|
156
184
|
readonly httpStatus: "unprocessable";
|
|
185
|
+
readonly type: "validation_error";
|
|
157
186
|
readonly code: string;
|
|
158
187
|
readonly details?: Record<string, unknown>;
|
|
159
|
-
|
|
188
|
+
readonly param?: string;
|
|
189
|
+
readonly metadata?: Record<string, unknown>;
|
|
190
|
+
constructor(code: string, message: string, details?: Record<string, unknown>, options?: {
|
|
191
|
+
param?: string;
|
|
192
|
+
metadata?: Record<string, unknown>;
|
|
193
|
+
});
|
|
160
194
|
}
|
|
161
195
|
|
|
162
196
|
/**
|
|
@@ -2018,4 +2052,4 @@ declare class PafiSDK {
|
|
|
2018
2052
|
signLoginMessage(message: string): Promise<Hex>;
|
|
2019
2053
|
}
|
|
2020
2054
|
|
|
2021
|
-
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 PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, ReceiverConsent, 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, delegateDirect, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiServiceUrls, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
|
|
2055
|
+
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, ReceiverConsent, 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, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification } from './types-
|
|
3
|
-
export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, I as Issuer, e as PathKey, Q as QuoteResult, f as
|
|
4
|
-
export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.js';
|
|
2
|
+
import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification } from './types-BS4kpO4Z.js';
|
|
3
|
+
export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, I as Issuer, e as PathKey, Q as QuoteResult, f as Recipient, g as RedemptionDecision, h as RedemptionDenial, i as RedemptionDenialCode, j as RedemptionPolicy, k as RedemptionPolicySource, l as RedemptionPreview } from './types-BS4kpO4Z.js';
|
|
4
|
+
export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.js';
|
|
5
5
|
export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.js';
|
|
6
6
|
export { getBurnRequestNonce, getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.js';
|
|
7
7
|
import { LoginMessageParams } from './auth/index.js';
|
|
@@ -92,6 +92,16 @@ declare const PERMIT2_ADDRESS: Address;
|
|
|
92
92
|
* still becomes 500.
|
|
93
93
|
*/
|
|
94
94
|
type SdkErrorHttpStatus = "not_found" | "forbidden" | "unprocessable" | "service_unavailable";
|
|
95
|
+
/**
|
|
96
|
+
* Stripe-style error taxonomy. The SDK emits one of these on every
|
|
97
|
+
* error so consumers can branch UI behavior on `type` (toast vs modal
|
|
98
|
+
* vs retry banner) without whitelisting individual `code` values.
|
|
99
|
+
*/
|
|
100
|
+
type PafiErrorType = "validation_error" | "authentication_error" | "authorization_error" | "not_found_error" | "business_logic_error" | "rate_limit_error" | "server_error" | "service_unavailable_error";
|
|
101
|
+
/** Numeric HTTP status implied by an `SdkErrorHttpStatus` slot. */
|
|
102
|
+
declare const SDK_ERROR_HTTP_STATUS_CODE: Record<SdkErrorHttpStatus, number>;
|
|
103
|
+
/** Default `type` slot for a numeric HTTP status. */
|
|
104
|
+
declare function defaultErrorTypeForStatus(status: number): PafiErrorType;
|
|
95
105
|
declare abstract class PafiSdkError extends Error {
|
|
96
106
|
abstract readonly code: string;
|
|
97
107
|
/**
|
|
@@ -101,6 +111,24 @@ declare abstract class PafiSdkError extends Error {
|
|
|
101
111
|
readonly safeToRetry: boolean;
|
|
102
112
|
readonly details?: unknown;
|
|
103
113
|
abstract readonly httpStatus: SdkErrorHttpStatus;
|
|
114
|
+
/**
|
|
115
|
+
* Optional Stripe-style taxonomy override. Defaults to the type
|
|
116
|
+
* implied by `httpStatus` (forbidden→authorization_error,
|
|
117
|
+
* unprocessable→business_logic_error, etc).
|
|
118
|
+
*/
|
|
119
|
+
readonly type?: PafiErrorType;
|
|
120
|
+
/**
|
|
121
|
+
* Optional name of the request field that triggered the error (e.g.
|
|
122
|
+
* `"amount"`, `"chainId"`). Surfaced on validation failures so the
|
|
123
|
+
* client can highlight the offending field.
|
|
124
|
+
*/
|
|
125
|
+
readonly param?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Optional structured context (e.g. `{ available, requested }` for a
|
|
128
|
+
* cap denial). Distinct from `details` — `metadata` is meant for
|
|
129
|
+
* UI consumption; `details` carries raw debug info.
|
|
130
|
+
*/
|
|
131
|
+
readonly metadata?: Record<string, unknown>;
|
|
104
132
|
constructor(message: string);
|
|
105
133
|
}
|
|
106
134
|
/**
|
|
@@ -154,9 +182,15 @@ declare class OracleStaleError extends PafiSdkError {
|
|
|
154
182
|
*/
|
|
155
183
|
declare class ValidationError extends PafiSdkError {
|
|
156
184
|
readonly httpStatus: "unprocessable";
|
|
185
|
+
readonly type: "validation_error";
|
|
157
186
|
readonly code: string;
|
|
158
187
|
readonly details?: Record<string, unknown>;
|
|
159
|
-
|
|
188
|
+
readonly param?: string;
|
|
189
|
+
readonly metadata?: Record<string, unknown>;
|
|
190
|
+
constructor(code: string, message: string, details?: Record<string, unknown>, options?: {
|
|
191
|
+
param?: string;
|
|
192
|
+
metadata?: Record<string, unknown>;
|
|
193
|
+
});
|
|
160
194
|
}
|
|
161
195
|
|
|
162
196
|
/**
|
|
@@ -2018,4 +2052,4 @@ declare class PafiSDK {
|
|
|
2018
2052
|
signLoginMessage(message: string): Promise<Hex>;
|
|
2019
2053
|
}
|
|
2020
2054
|
|
|
2021
|
-
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 PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, ReceiverConsent, 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, delegateDirect, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiServiceUrls, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
|
|
2055
|
+
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, ReceiverConsent, 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, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
erc20Abi,
|
|
3
|
+
mintFeeWrapperAbi,
|
|
3
4
|
permit2Abi,
|
|
4
5
|
pointTokenFactoryAbi,
|
|
5
6
|
universalRouterAbi,
|
|
6
7
|
v4QuoterAbi
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ABNM6LMP.js";
|
|
8
9
|
import {
|
|
9
10
|
SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET,
|
|
10
11
|
SPONSOR_AUTH_DOMAIN_NAME,
|
|
@@ -34,7 +35,7 @@ import {
|
|
|
34
35
|
isMinter,
|
|
35
36
|
issuerRegistryGetIssuerFlatAbi,
|
|
36
37
|
verifyMintCap
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-Y4CFC4OC.js";
|
|
38
39
|
import {
|
|
39
40
|
issuerRegistryAbi,
|
|
40
41
|
mintingOracleAbi
|
|
@@ -64,16 +65,32 @@ import {
|
|
|
64
65
|
verifyBurnRequest,
|
|
65
66
|
verifyMintRequest,
|
|
66
67
|
verifyReceiverConsent
|
|
67
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-BB5YW57R.js";
|
|
68
69
|
import {
|
|
69
70
|
pointTokenAbi
|
|
70
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-CUVUSVWR.js";
|
|
71
72
|
import "./chunk-DGUM43GV.js";
|
|
72
73
|
|
|
73
74
|
// src/index.ts
|
|
74
75
|
import { createPublicClient, http as http2 } from "viem";
|
|
75
76
|
|
|
76
77
|
// src/errors.ts
|
|
78
|
+
var SDK_ERROR_HTTP_STATUS_CODE = {
|
|
79
|
+
not_found: 404,
|
|
80
|
+
forbidden: 403,
|
|
81
|
+
unprocessable: 422,
|
|
82
|
+
service_unavailable: 503
|
|
83
|
+
};
|
|
84
|
+
function defaultErrorTypeForStatus(status) {
|
|
85
|
+
if (status === 400) return "validation_error";
|
|
86
|
+
if (status === 401) return "authentication_error";
|
|
87
|
+
if (status === 403) return "authorization_error";
|
|
88
|
+
if (status === 404) return "not_found_error";
|
|
89
|
+
if (status === 422) return "business_logic_error";
|
|
90
|
+
if (status === 429) return "rate_limit_error";
|
|
91
|
+
if (status === 503) return "service_unavailable_error";
|
|
92
|
+
return "server_error";
|
|
93
|
+
}
|
|
77
94
|
var PafiSdkError = class extends Error {
|
|
78
95
|
/**
|
|
79
96
|
* `true` when the FE should consider a retry safe — typically because
|
|
@@ -81,6 +98,24 @@ var PafiSdkError = class extends Error {
|
|
|
81
98
|
*/
|
|
82
99
|
safeToRetry = false;
|
|
83
100
|
details;
|
|
101
|
+
/**
|
|
102
|
+
* Optional Stripe-style taxonomy override. Defaults to the type
|
|
103
|
+
* implied by `httpStatus` (forbidden→authorization_error,
|
|
104
|
+
* unprocessable→business_logic_error, etc).
|
|
105
|
+
*/
|
|
106
|
+
type;
|
|
107
|
+
/**
|
|
108
|
+
* Optional name of the request field that triggered the error (e.g.
|
|
109
|
+
* `"amount"`, `"chainId"`). Surfaced on validation failures so the
|
|
110
|
+
* client can highlight the offending field.
|
|
111
|
+
*/
|
|
112
|
+
param;
|
|
113
|
+
/**
|
|
114
|
+
* Optional structured context (e.g. `{ available, requested }` for a
|
|
115
|
+
* cap denial). Distinct from `details` — `metadata` is meant for
|
|
116
|
+
* UI consumption; `details` carries raw debug info.
|
|
117
|
+
*/
|
|
118
|
+
metadata;
|
|
84
119
|
constructor(message) {
|
|
85
120
|
super(message);
|
|
86
121
|
this.name = new.target.name;
|
|
@@ -135,12 +170,18 @@ var OracleStaleError = class extends PafiSdkError {
|
|
|
135
170
|
};
|
|
136
171
|
var ValidationError = class extends PafiSdkError {
|
|
137
172
|
httpStatus = "unprocessable";
|
|
173
|
+
type = "validation_error";
|
|
138
174
|
code;
|
|
139
|
-
details
|
|
140
|
-
constructor(code, message, details) {
|
|
175
|
+
constructor(code, message, details, options) {
|
|
141
176
|
super(message);
|
|
142
177
|
this.code = code;
|
|
143
178
|
this.details = details;
|
|
179
|
+
if (options?.param) {
|
|
180
|
+
this.param = options.param;
|
|
181
|
+
}
|
|
182
|
+
if (options?.metadata) {
|
|
183
|
+
this.metadata = options.metadata;
|
|
184
|
+
}
|
|
144
185
|
}
|
|
145
186
|
};
|
|
146
187
|
|
|
@@ -1542,6 +1583,7 @@ export {
|
|
|
1542
1583
|
PafiSDK,
|
|
1543
1584
|
PafiSDKError,
|
|
1544
1585
|
PafiSdkError,
|
|
1586
|
+
SDK_ERROR_HTTP_STATUS_CODE,
|
|
1545
1587
|
SIMPLE_7702_IMPL_BASE_MAINNET,
|
|
1546
1588
|
SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET,
|
|
1547
1589
|
SPONSOR_AUTH_DOMAIN_NAME,
|
|
@@ -1580,6 +1622,7 @@ export {
|
|
|
1580
1622
|
createLoginMessage,
|
|
1581
1623
|
createPafiProxyTransport,
|
|
1582
1624
|
decodeBatchExecuteCalls,
|
|
1625
|
+
defaultErrorTypeForStatus,
|
|
1583
1626
|
delegateDirect,
|
|
1584
1627
|
detectDelegateImpl,
|
|
1585
1628
|
encodeBatchExecute,
|
|
@@ -1612,6 +1655,7 @@ export {
|
|
|
1612
1655
|
isPaymasterError,
|
|
1613
1656
|
issuerRegistryAbi,
|
|
1614
1657
|
issuerRegistryGetIssuerFlatAbi,
|
|
1658
|
+
mintFeeWrapperAbi,
|
|
1615
1659
|
mintRequestTypes,
|
|
1616
1660
|
mintingOracleAbi,
|
|
1617
1661
|
openPafiWebModal,
|