@pafi-dev/issuer 0.23.0 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +90 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -18
- package/dist/index.d.ts +76 -18
- package/dist/index.js +99 -45
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1029,6 +1029,23 @@ interface ISingletonLock {
|
|
|
1029
1029
|
acquire(key: string): Promise<SingletonLockHandle | null>;
|
|
1030
1030
|
}
|
|
1031
1031
|
|
|
1032
|
+
declare class PointIndexerFinalizeError extends Error {
|
|
1033
|
+
readonly context: {
|
|
1034
|
+
pointToken: Address;
|
|
1035
|
+
to: Address;
|
|
1036
|
+
amount: bigint;
|
|
1037
|
+
txHash: `0x${string}`;
|
|
1038
|
+
blockNumber: bigint;
|
|
1039
|
+
};
|
|
1040
|
+
readonly cause: unknown;
|
|
1041
|
+
constructor(message: string, context: {
|
|
1042
|
+
pointToken: Address;
|
|
1043
|
+
to: Address;
|
|
1044
|
+
amount: bigint;
|
|
1045
|
+
txHash: `0x${string}`;
|
|
1046
|
+
blockNumber: bigint;
|
|
1047
|
+
}, cause: unknown);
|
|
1048
|
+
}
|
|
1032
1049
|
interface PointIndexerConfig {
|
|
1033
1050
|
provider: PublicClient;
|
|
1034
1051
|
pointTokenAddress: Address;
|
|
@@ -1179,6 +1196,33 @@ declare class PointIndexer {
|
|
|
1179
1196
|
private finalize;
|
|
1180
1197
|
}
|
|
1181
1198
|
|
|
1199
|
+
/**
|
|
1200
|
+
* Mirror of `PointIndexerFinalizeError` — raised when
|
|
1201
|
+
* `ledger.resolveCreditByBurnTx` rejects. See audit M-12: pre-fix this
|
|
1202
|
+
* was silently swallowed and the cursor advanced regardless,
|
|
1203
|
+
* permanently dropping confirmed on-chain burns from the off-chain
|
|
1204
|
+
* credit pipeline. Post-fix the error propagates, the chunk's cursor
|
|
1205
|
+
* save is skipped, and the next tick retries.
|
|
1206
|
+
*/
|
|
1207
|
+
declare class BurnIndexerFinalizeError extends Error {
|
|
1208
|
+
readonly context: {
|
|
1209
|
+
pointToken: Address;
|
|
1210
|
+
from: Address;
|
|
1211
|
+
amount: bigint;
|
|
1212
|
+
txHash: `0x${string}`;
|
|
1213
|
+
blockNumber: bigint;
|
|
1214
|
+
lockId: string;
|
|
1215
|
+
};
|
|
1216
|
+
readonly cause: unknown;
|
|
1217
|
+
constructor(message: string, context: {
|
|
1218
|
+
pointToken: Address;
|
|
1219
|
+
from: Address;
|
|
1220
|
+
amount: bigint;
|
|
1221
|
+
txHash: `0x${string}`;
|
|
1222
|
+
blockNumber: bigint;
|
|
1223
|
+
lockId: string;
|
|
1224
|
+
}, cause: unknown);
|
|
1225
|
+
}
|
|
1182
1226
|
interface BurnIndexerConfig {
|
|
1183
1227
|
provider: PublicClient;
|
|
1184
1228
|
pointTokenAddress: Address;
|
|
@@ -3646,34 +3690,48 @@ declare function relayUserOp(params: RelayUserOpParams): Promise<{
|
|
|
3646
3690
|
userOpHash: Hex;
|
|
3647
3691
|
}>;
|
|
3648
3692
|
|
|
3693
|
+
/**
|
|
3694
|
+
* Registry record returned by `IssuerRegistry.getIssuer()` in V2
|
|
3695
|
+
* dual-bucket. Schema reshape from V1:
|
|
3696
|
+
*
|
|
3697
|
+
* V1: { issuerAddress, signerAddress, name, symbol, active, pointToken, mintingOracle }
|
|
3698
|
+
* V2: { signerAddress, name, active, capitalBase, basisPoints }
|
|
3699
|
+
*
|
|
3700
|
+
* `issuerAddress` is the lookup key the caller passed; we don't
|
|
3701
|
+
* re-emit it here because the caller already has it. `capitalBase` +
|
|
3702
|
+
* `basisPoints` drive the EQUITY-bucket cap (`capitalBase *
|
|
3703
|
+
* basisPoints / 10000`).
|
|
3704
|
+
*/
|
|
3649
3705
|
interface IssuerRegistryRecord {
|
|
3650
|
-
issuerAddress: Address;
|
|
3651
3706
|
signerAddress: Address;
|
|
3652
3707
|
name: string;
|
|
3653
|
-
symbol: string;
|
|
3654
3708
|
active: boolean;
|
|
3655
|
-
|
|
3656
|
-
|
|
3709
|
+
capitalBase: bigint;
|
|
3710
|
+
basisPoints: number;
|
|
3657
3711
|
}
|
|
3658
3712
|
/**
|
|
3659
|
-
*
|
|
3660
|
-
*
|
|
3661
|
-
*
|
|
3713
|
+
* Equity-bucket cap snapshot computed from the `IssuerRegistryRecord`.
|
|
3714
|
+
*
|
|
3715
|
+
* V1 had a separate `TokenCapRecord` sourced from
|
|
3716
|
+
* `MintingOracle.tokenCaps`; in V2 the oracle is stateless and the
|
|
3717
|
+
* EQUITY cap derives from the registry's `capitalBase` + `basisPoints`.
|
|
3718
|
+
* Kept as a distinct shape (rather than inlining into
|
|
3719
|
+
* `PreValidateMintResult`) so admin tooling can read it without
|
|
3720
|
+
* re-deriving the multiplication.
|
|
3662
3721
|
*/
|
|
3663
|
-
interface
|
|
3664
|
-
|
|
3665
|
-
|
|
3722
|
+
interface EquityCapRecord {
|
|
3723
|
+
capitalBase: bigint;
|
|
3724
|
+
basisPoints: number;
|
|
3725
|
+
hardCap: bigint;
|
|
3666
3726
|
}
|
|
3667
3727
|
interface PreValidateMintResult {
|
|
3668
3728
|
/** Registry record read at pre-validation time. */
|
|
3669
3729
|
issuer: IssuerRegistryRecord;
|
|
3670
|
-
/**
|
|
3671
|
-
|
|
3672
|
-
/** Current on-chain PointToken.
|
|
3673
|
-
|
|
3674
|
-
/**
|
|
3675
|
-
hardCap: bigint;
|
|
3676
|
-
/** hardCap − totalSupply (clamped to 0). */
|
|
3730
|
+
/** Equity-bucket cap derived from issuer.capitalBase × basisPoints. */
|
|
3731
|
+
equityCap: EquityCapRecord;
|
|
3732
|
+
/** Current on-chain `PointToken.equitySupply()`. */
|
|
3733
|
+
equitySupply: bigint;
|
|
3734
|
+
/** equityCap.hardCap − equitySupply (clamped to 0). */
|
|
3677
3735
|
remaining: bigint;
|
|
3678
3736
|
}
|
|
3679
3737
|
/**
|
|
@@ -3827,4 +3885,4 @@ declare class MemoryRedemptionHistoryStore implements IRedemptionHistoryStore {
|
|
|
3827
3885
|
|
|
3828
3886
|
declare const PAFI_ISSUER_SDK_VERSION: string;
|
|
3829
3887
|
|
|
3830
|
-
export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiRedemptionEvaluateRequest, type ApiRedemptionEvaluateResponse, type ApiRedemptionPreviewRequest, type ApiRedemptionPreviewResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, type BundlerEstimatorClient, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type ConfigDto, ConfigurationError, DEFAULT_REDEMPTION_POLICY, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, type EstimateGasFeeOptions, type EvaluateInput, FeeManager, type FeeManagerConfig, type FeeManagerMetrics, type FetchFailureReason, type FetchImpl, type FetchResult, type GasFeeDto, type GasFeeSource, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type IRateLimiter, type IRedemptionHistoryStore, type ISessionStore, type ISingletonLock, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemoryRateLimiter, MemoryRedemptionHistoryStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, NoopRateLimiter, PAFI_ISSUER_SDK_VERSION, PTClaimError, PTClaimHandler, type PTClaimHandlerConfig, type PTClaimRequest, type PTClaimResponse, PTRedeemError, PTRedeemHandler, type PTRedeemHandlerConfig, type PTRedeemRequest, type PTRedeemResponse, PafiBackendClient, type PafiBackendConfig, PafiBackendError, type PafiBackendErrorCode, type PafiEstimatorClientConfig, PafiEstimatorHttpError, type PaymasterGasEstimates, type PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, PointTokenDomainResolver, type PointTokenDomainResolverConfig, type PolicyDecision, type PolicyEvalRequest, PolicyProvider, type PolicyProviderConfig, type PoolsDto, type PoolsProvider, type PostgresQueryRunner, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type PreviewBurnParams, type PreviewMintParams, REDEMPTION_HISTORY_WINDOW_SEC, type RateLimitAction, type RateLimiterConfig, type RedeemDto, type RedeemPrepareDto, RedemptionService, type RedemptionServiceConfig, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type ResolvedPolicy, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, SettlementClient, type SettlementClientConfig, type SingletonLockHandle, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, type UserHistory, applyPaymasterGasEstimates, authenticateRequest, buildSdkErrorBody, createIssuerService, createNativePtQuoter, createPafiEstimatorClient, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, defaultPolicyFor, evaluateRedemption, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, makePostgresSingletonLock, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };
|
|
3888
|
+
export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiRedemptionEvaluateRequest, type ApiRedemptionEvaluateResponse, type ApiRedemptionPreviewRequest, type ApiRedemptionPreviewResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, type BundlerEstimatorClient, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, BurnIndexerFinalizeError, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type ConfigDto, ConfigurationError, DEFAULT_REDEMPTION_POLICY, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, type EstimateGasFeeOptions, type EvaluateInput, FeeManager, type FeeManagerConfig, type FeeManagerMetrics, type FetchFailureReason, type FetchImpl, type FetchResult, type GasFeeDto, type GasFeeSource, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type IRateLimiter, type IRedemptionHistoryStore, type ISessionStore, type ISingletonLock, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemoryRateLimiter, MemoryRedemptionHistoryStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, NoopRateLimiter, PAFI_ISSUER_SDK_VERSION, PTClaimError, PTClaimHandler, type PTClaimHandlerConfig, type PTClaimRequest, type PTClaimResponse, PTRedeemError, PTRedeemHandler, type PTRedeemHandlerConfig, type PTRedeemRequest, type PTRedeemResponse, PafiBackendClient, type PafiBackendConfig, PafiBackendError, type PafiBackendErrorCode, type PafiEstimatorClientConfig, PafiEstimatorHttpError, type PaymasterGasEstimates, type PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, PointIndexerFinalizeError, PointTokenDomainResolver, type PointTokenDomainResolverConfig, type PolicyDecision, type PolicyEvalRequest, PolicyProvider, type PolicyProviderConfig, type PoolsDto, type PoolsProvider, type PostgresQueryRunner, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type PreviewBurnParams, type PreviewMintParams, REDEMPTION_HISTORY_WINDOW_SEC, type RateLimitAction, type RateLimiterConfig, type RedeemDto, type RedeemPrepareDto, RedemptionService, type RedemptionServiceConfig, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type ResolvedPolicy, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, SettlementClient, type SettlementClientConfig, type SingletonLockHandle, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, type UserHistory, applyPaymasterGasEstimates, authenticateRequest, buildSdkErrorBody, createIssuerService, createNativePtQuoter, createPafiEstimatorClient, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, defaultPolicyFor, evaluateRedemption, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, makePostgresSingletonLock, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };
|
package/dist/index.d.ts
CHANGED
|
@@ -1029,6 +1029,23 @@ interface ISingletonLock {
|
|
|
1029
1029
|
acquire(key: string): Promise<SingletonLockHandle | null>;
|
|
1030
1030
|
}
|
|
1031
1031
|
|
|
1032
|
+
declare class PointIndexerFinalizeError extends Error {
|
|
1033
|
+
readonly context: {
|
|
1034
|
+
pointToken: Address;
|
|
1035
|
+
to: Address;
|
|
1036
|
+
amount: bigint;
|
|
1037
|
+
txHash: `0x${string}`;
|
|
1038
|
+
blockNumber: bigint;
|
|
1039
|
+
};
|
|
1040
|
+
readonly cause: unknown;
|
|
1041
|
+
constructor(message: string, context: {
|
|
1042
|
+
pointToken: Address;
|
|
1043
|
+
to: Address;
|
|
1044
|
+
amount: bigint;
|
|
1045
|
+
txHash: `0x${string}`;
|
|
1046
|
+
blockNumber: bigint;
|
|
1047
|
+
}, cause: unknown);
|
|
1048
|
+
}
|
|
1032
1049
|
interface PointIndexerConfig {
|
|
1033
1050
|
provider: PublicClient;
|
|
1034
1051
|
pointTokenAddress: Address;
|
|
@@ -1179,6 +1196,33 @@ declare class PointIndexer {
|
|
|
1179
1196
|
private finalize;
|
|
1180
1197
|
}
|
|
1181
1198
|
|
|
1199
|
+
/**
|
|
1200
|
+
* Mirror of `PointIndexerFinalizeError` — raised when
|
|
1201
|
+
* `ledger.resolveCreditByBurnTx` rejects. See audit M-12: pre-fix this
|
|
1202
|
+
* was silently swallowed and the cursor advanced regardless,
|
|
1203
|
+
* permanently dropping confirmed on-chain burns from the off-chain
|
|
1204
|
+
* credit pipeline. Post-fix the error propagates, the chunk's cursor
|
|
1205
|
+
* save is skipped, and the next tick retries.
|
|
1206
|
+
*/
|
|
1207
|
+
declare class BurnIndexerFinalizeError extends Error {
|
|
1208
|
+
readonly context: {
|
|
1209
|
+
pointToken: Address;
|
|
1210
|
+
from: Address;
|
|
1211
|
+
amount: bigint;
|
|
1212
|
+
txHash: `0x${string}`;
|
|
1213
|
+
blockNumber: bigint;
|
|
1214
|
+
lockId: string;
|
|
1215
|
+
};
|
|
1216
|
+
readonly cause: unknown;
|
|
1217
|
+
constructor(message: string, context: {
|
|
1218
|
+
pointToken: Address;
|
|
1219
|
+
from: Address;
|
|
1220
|
+
amount: bigint;
|
|
1221
|
+
txHash: `0x${string}`;
|
|
1222
|
+
blockNumber: bigint;
|
|
1223
|
+
lockId: string;
|
|
1224
|
+
}, cause: unknown);
|
|
1225
|
+
}
|
|
1182
1226
|
interface BurnIndexerConfig {
|
|
1183
1227
|
provider: PublicClient;
|
|
1184
1228
|
pointTokenAddress: Address;
|
|
@@ -3646,34 +3690,48 @@ declare function relayUserOp(params: RelayUserOpParams): Promise<{
|
|
|
3646
3690
|
userOpHash: Hex;
|
|
3647
3691
|
}>;
|
|
3648
3692
|
|
|
3693
|
+
/**
|
|
3694
|
+
* Registry record returned by `IssuerRegistry.getIssuer()` in V2
|
|
3695
|
+
* dual-bucket. Schema reshape from V1:
|
|
3696
|
+
*
|
|
3697
|
+
* V1: { issuerAddress, signerAddress, name, symbol, active, pointToken, mintingOracle }
|
|
3698
|
+
* V2: { signerAddress, name, active, capitalBase, basisPoints }
|
|
3699
|
+
*
|
|
3700
|
+
* `issuerAddress` is the lookup key the caller passed; we don't
|
|
3701
|
+
* re-emit it here because the caller already has it. `capitalBase` +
|
|
3702
|
+
* `basisPoints` drive the EQUITY-bucket cap (`capitalBase *
|
|
3703
|
+
* basisPoints / 10000`).
|
|
3704
|
+
*/
|
|
3649
3705
|
interface IssuerRegistryRecord {
|
|
3650
|
-
issuerAddress: Address;
|
|
3651
3706
|
signerAddress: Address;
|
|
3652
3707
|
name: string;
|
|
3653
|
-
symbol: string;
|
|
3654
3708
|
active: boolean;
|
|
3655
|
-
|
|
3656
|
-
|
|
3709
|
+
capitalBase: bigint;
|
|
3710
|
+
basisPoints: number;
|
|
3657
3711
|
}
|
|
3658
3712
|
/**
|
|
3659
|
-
*
|
|
3660
|
-
*
|
|
3661
|
-
*
|
|
3713
|
+
* Equity-bucket cap snapshot computed from the `IssuerRegistryRecord`.
|
|
3714
|
+
*
|
|
3715
|
+
* V1 had a separate `TokenCapRecord` sourced from
|
|
3716
|
+
* `MintingOracle.tokenCaps`; in V2 the oracle is stateless and the
|
|
3717
|
+
* EQUITY cap derives from the registry's `capitalBase` + `basisPoints`.
|
|
3718
|
+
* Kept as a distinct shape (rather than inlining into
|
|
3719
|
+
* `PreValidateMintResult`) so admin tooling can read it without
|
|
3720
|
+
* re-deriving the multiplication.
|
|
3662
3721
|
*/
|
|
3663
|
-
interface
|
|
3664
|
-
|
|
3665
|
-
|
|
3722
|
+
interface EquityCapRecord {
|
|
3723
|
+
capitalBase: bigint;
|
|
3724
|
+
basisPoints: number;
|
|
3725
|
+
hardCap: bigint;
|
|
3666
3726
|
}
|
|
3667
3727
|
interface PreValidateMintResult {
|
|
3668
3728
|
/** Registry record read at pre-validation time. */
|
|
3669
3729
|
issuer: IssuerRegistryRecord;
|
|
3670
|
-
/**
|
|
3671
|
-
|
|
3672
|
-
/** Current on-chain PointToken.
|
|
3673
|
-
|
|
3674
|
-
/**
|
|
3675
|
-
hardCap: bigint;
|
|
3676
|
-
/** hardCap − totalSupply (clamped to 0). */
|
|
3730
|
+
/** Equity-bucket cap derived from issuer.capitalBase × basisPoints. */
|
|
3731
|
+
equityCap: EquityCapRecord;
|
|
3732
|
+
/** Current on-chain `PointToken.equitySupply()`. */
|
|
3733
|
+
equitySupply: bigint;
|
|
3734
|
+
/** equityCap.hardCap − equitySupply (clamped to 0). */
|
|
3677
3735
|
remaining: bigint;
|
|
3678
3736
|
}
|
|
3679
3737
|
/**
|
|
@@ -3827,4 +3885,4 @@ declare class MemoryRedemptionHistoryStore implements IRedemptionHistoryStore {
|
|
|
3827
3885
|
|
|
3828
3886
|
declare const PAFI_ISSUER_SDK_VERSION: string;
|
|
3829
3887
|
|
|
3830
|
-
export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiRedemptionEvaluateRequest, type ApiRedemptionEvaluateResponse, type ApiRedemptionPreviewRequest, type ApiRedemptionPreviewResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, type BundlerEstimatorClient, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type ConfigDto, ConfigurationError, DEFAULT_REDEMPTION_POLICY, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, type EstimateGasFeeOptions, type EvaluateInput, FeeManager, type FeeManagerConfig, type FeeManagerMetrics, type FetchFailureReason, type FetchImpl, type FetchResult, type GasFeeDto, type GasFeeSource, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type IRateLimiter, type IRedemptionHistoryStore, type ISessionStore, type ISingletonLock, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemoryRateLimiter, MemoryRedemptionHistoryStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, NoopRateLimiter, PAFI_ISSUER_SDK_VERSION, PTClaimError, PTClaimHandler, type PTClaimHandlerConfig, type PTClaimRequest, type PTClaimResponse, PTRedeemError, PTRedeemHandler, type PTRedeemHandlerConfig, type PTRedeemRequest, type PTRedeemResponse, PafiBackendClient, type PafiBackendConfig, PafiBackendError, type PafiBackendErrorCode, type PafiEstimatorClientConfig, PafiEstimatorHttpError, type PaymasterGasEstimates, type PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, PointTokenDomainResolver, type PointTokenDomainResolverConfig, type PolicyDecision, type PolicyEvalRequest, PolicyProvider, type PolicyProviderConfig, type PoolsDto, type PoolsProvider, type PostgresQueryRunner, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type PreviewBurnParams, type PreviewMintParams, REDEMPTION_HISTORY_WINDOW_SEC, type RateLimitAction, type RateLimiterConfig, type RedeemDto, type RedeemPrepareDto, RedemptionService, type RedemptionServiceConfig, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type ResolvedPolicy, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, SettlementClient, type SettlementClientConfig, type SingletonLockHandle, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, type UserHistory, applyPaymasterGasEstimates, authenticateRequest, buildSdkErrorBody, createIssuerService, createNativePtQuoter, createPafiEstimatorClient, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, defaultPolicyFor, evaluateRedemption, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, makePostgresSingletonLock, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };
|
|
3888
|
+
export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiRedemptionEvaluateRequest, type ApiRedemptionEvaluateResponse, type ApiRedemptionPreviewRequest, type ApiRedemptionPreviewResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, type BundlerEstimatorClient, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, BurnIndexerFinalizeError, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type ConfigDto, ConfigurationError, DEFAULT_REDEMPTION_POLICY, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, type EstimateGasFeeOptions, type EvaluateInput, FeeManager, type FeeManagerConfig, type FeeManagerMetrics, type FetchFailureReason, type FetchImpl, type FetchResult, type GasFeeDto, type GasFeeSource, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type IRateLimiter, type IRedemptionHistoryStore, type ISessionStore, type ISingletonLock, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemoryRateLimiter, MemoryRedemptionHistoryStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, NoopRateLimiter, PAFI_ISSUER_SDK_VERSION, PTClaimError, PTClaimHandler, type PTClaimHandlerConfig, type PTClaimRequest, type PTClaimResponse, PTRedeemError, PTRedeemHandler, type PTRedeemHandlerConfig, type PTRedeemRequest, type PTRedeemResponse, PafiBackendClient, type PafiBackendConfig, PafiBackendError, type PafiBackendErrorCode, type PafiEstimatorClientConfig, PafiEstimatorHttpError, type PaymasterGasEstimates, type PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, PointIndexerFinalizeError, PointTokenDomainResolver, type PointTokenDomainResolverConfig, type PolicyDecision, type PolicyEvalRequest, PolicyProvider, type PolicyProviderConfig, type PoolsDto, type PoolsProvider, type PostgresQueryRunner, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type PreviewBurnParams, type PreviewMintParams, REDEMPTION_HISTORY_WINDOW_SEC, type RateLimitAction, type RateLimiterConfig, type RedeemDto, type RedeemPrepareDto, RedemptionService, type RedemptionServiceConfig, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type ResolvedPolicy, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, SettlementClient, type SettlementClientConfig, type SingletonLockHandle, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, type UserHistory, applyPaymasterGasEstimates, authenticateRequest, buildSdkErrorBody, createIssuerService, createNativePtQuoter, createPafiEstimatorClient, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, defaultPolicyFor, evaluateRedemption, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, makePostgresSingletonLock, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };
|
package/dist/index.js
CHANGED
|
@@ -579,12 +579,14 @@ import {
|
|
|
579
579
|
erc20Abi
|
|
580
580
|
} from "viem";
|
|
581
581
|
import {
|
|
582
|
-
|
|
582
|
+
POINT_TOKEN_MINT_SIG_ABI,
|
|
583
|
+
POINT_TOKEN_BURN_SIG_ABI,
|
|
583
584
|
mintFeeWrapperAbi,
|
|
584
585
|
buildPartialUserOperation,
|
|
585
586
|
signMintRequest,
|
|
586
587
|
getContractAddresses,
|
|
587
|
-
quoteOperatorFeePt
|
|
588
|
+
quoteOperatorFeePt,
|
|
589
|
+
Source
|
|
588
590
|
} from "@pafi-dev/core";
|
|
589
591
|
var RelayService = class {
|
|
590
592
|
provider;
|
|
@@ -673,6 +675,7 @@ var RelayService = class {
|
|
|
673
675
|
"prepareMint: deadline exceeds maximum allowed window (1 hour)"
|
|
674
676
|
);
|
|
675
677
|
}
|
|
678
|
+
const MINT_SOURCE = Source.EQUITY;
|
|
676
679
|
const useWrapper = params.mintFeeWrapperAddress !== void 0;
|
|
677
680
|
const receiverForSig = useWrapper ? params.mintFeeWrapperAddress : params.userAddress;
|
|
678
681
|
let minterSig;
|
|
@@ -684,6 +687,7 @@ var RelayService = class {
|
|
|
684
687
|
user: params.userAddress,
|
|
685
688
|
receiver: receiverForSig,
|
|
686
689
|
amount: params.amount,
|
|
690
|
+
source: MINT_SOURCE,
|
|
687
691
|
nonce: params.mintRequestNonce,
|
|
688
692
|
deadline: params.deadline
|
|
689
693
|
}
|
|
@@ -714,9 +718,15 @@ var RelayService = class {
|
|
|
714
718
|
mintTarget = params.mintFeeWrapperAddress;
|
|
715
719
|
} else {
|
|
716
720
|
mintCallData = encodeFunctionData({
|
|
717
|
-
abi:
|
|
721
|
+
abi: POINT_TOKEN_MINT_SIG_ABI,
|
|
718
722
|
functionName: "mint",
|
|
719
|
-
args: [
|
|
723
|
+
args: [
|
|
724
|
+
params.userAddress,
|
|
725
|
+
params.amount,
|
|
726
|
+
MINT_SOURCE,
|
|
727
|
+
params.deadline,
|
|
728
|
+
minterSig
|
|
729
|
+
]
|
|
720
730
|
});
|
|
721
731
|
mintTarget = params.pointTokenAddress;
|
|
722
732
|
}
|
|
@@ -801,11 +811,12 @@ var RelayService = class {
|
|
|
801
811
|
let burnCallData;
|
|
802
812
|
try {
|
|
803
813
|
burnCallData = encodeFunctionData({
|
|
804
|
-
abi:
|
|
814
|
+
abi: POINT_TOKEN_BURN_SIG_ABI,
|
|
805
815
|
functionName: "burn",
|
|
806
816
|
args: [
|
|
807
817
|
params.burnRequest.from,
|
|
808
818
|
params.burnRequest.amount,
|
|
819
|
+
params.burnRequest.source,
|
|
809
820
|
params.burnRequest.deadline,
|
|
810
821
|
params.burnerSignature
|
|
811
822
|
]
|
|
@@ -900,11 +911,12 @@ var RelayService = class {
|
|
|
900
911
|
mintTarget = params.mintFeeWrapperAddress;
|
|
901
912
|
} else {
|
|
902
913
|
mintCallData = encodeFunctionData({
|
|
903
|
-
abi:
|
|
914
|
+
abi: POINT_TOKEN_MINT_SIG_ABI,
|
|
904
915
|
functionName: "mint",
|
|
905
916
|
args: [
|
|
906
917
|
params.userAddress,
|
|
907
918
|
params.amount,
|
|
919
|
+
Source.EQUITY,
|
|
908
920
|
params.deadline,
|
|
909
921
|
PLACEHOLDER_SIG_65
|
|
910
922
|
]
|
|
@@ -926,11 +938,12 @@ var RelayService = class {
|
|
|
926
938
|
/** Burn-side mirror of `previewMintUserOp`. */
|
|
927
939
|
previewBurnUserOp(params) {
|
|
928
940
|
const burnCallData = encodeFunctionData({
|
|
929
|
-
abi:
|
|
941
|
+
abi: POINT_TOKEN_BURN_SIG_ABI,
|
|
930
942
|
functionName: "burn",
|
|
931
943
|
args: [
|
|
932
944
|
params.userAddress,
|
|
933
945
|
params.amount,
|
|
946
|
+
Source.EQUITY,
|
|
934
947
|
params.deadline,
|
|
935
948
|
PLACEHOLDER_SIG_65
|
|
936
949
|
]
|
|
@@ -1148,6 +1161,16 @@ var InMemoryCursorStore = class _InMemoryCursorStore {
|
|
|
1148
1161
|
|
|
1149
1162
|
// src/indexer/pointIndexer.ts
|
|
1150
1163
|
import { getAddress as getAddress3, parseAbiItem } from "viem";
|
|
1164
|
+
var PointIndexerFinalizeError = class extends Error {
|
|
1165
|
+
constructor(message, context, cause) {
|
|
1166
|
+
super(message);
|
|
1167
|
+
this.context = context;
|
|
1168
|
+
this.cause = cause;
|
|
1169
|
+
this.name = "PointIndexerFinalizeError";
|
|
1170
|
+
}
|
|
1171
|
+
context;
|
|
1172
|
+
cause;
|
|
1173
|
+
};
|
|
1151
1174
|
var TRANSFER_EVENT = parseAbiItem(
|
|
1152
1175
|
"event Transfer(address indexed from, address indexed to, uint256 value)"
|
|
1153
1176
|
);
|
|
@@ -1373,8 +1396,18 @@ var PointIndexer = class {
|
|
|
1373
1396
|
evt.txHash,
|
|
1374
1397
|
this.pointTokenAddress
|
|
1375
1398
|
);
|
|
1376
|
-
} catch {
|
|
1377
|
-
|
|
1399
|
+
} catch (err) {
|
|
1400
|
+
throw new PointIndexerFinalizeError(
|
|
1401
|
+
`PointIndexer.deductBalance failed for tx ${evt.txHash} (to=${evt.to}, amount=${evt.amount}, block=${evt.blockNumber}); cursor will NOT advance, next tick retries.`,
|
|
1402
|
+
{
|
|
1403
|
+
pointToken: this.pointTokenAddress,
|
|
1404
|
+
to: evt.to,
|
|
1405
|
+
amount: evt.amount,
|
|
1406
|
+
txHash: evt.txHash,
|
|
1407
|
+
blockNumber: evt.blockNumber
|
|
1408
|
+
},
|
|
1409
|
+
err
|
|
1410
|
+
);
|
|
1378
1411
|
}
|
|
1379
1412
|
try {
|
|
1380
1413
|
await this.ledger.updateMintStatus(match.lockId, "MINTED", evt.txHash);
|
|
@@ -1396,6 +1429,16 @@ function pickMatchingLock(locks, amount) {
|
|
|
1396
1429
|
|
|
1397
1430
|
// src/indexer/burnIndexer.ts
|
|
1398
1431
|
import { getAddress as getAddress4, parseAbiItem as parseAbiItem2 } from "viem";
|
|
1432
|
+
var BurnIndexerFinalizeError = class extends Error {
|
|
1433
|
+
constructor(message, context, cause) {
|
|
1434
|
+
super(message);
|
|
1435
|
+
this.context = context;
|
|
1436
|
+
this.cause = cause;
|
|
1437
|
+
this.name = "BurnIndexerFinalizeError";
|
|
1438
|
+
}
|
|
1439
|
+
context;
|
|
1440
|
+
cause;
|
|
1441
|
+
};
|
|
1399
1442
|
var TRANSFER_EVENT2 = parseAbiItem2(
|
|
1400
1443
|
"event Transfer(address indexed from, address indexed to, uint256 value)"
|
|
1401
1444
|
);
|
|
@@ -1563,7 +1606,18 @@ var BurnIndexer = class {
|
|
|
1563
1606
|
try {
|
|
1564
1607
|
await this.ledger.resolveCreditByBurnTx(lockId, evt.txHash);
|
|
1565
1608
|
} catch (err) {
|
|
1566
|
-
|
|
1609
|
+
throw new BurnIndexerFinalizeError(
|
|
1610
|
+
`BurnIndexer.resolveCreditByBurnTx failed for tx ${evt.txHash} (lockId=${lockId}, from=${evt.from}, amount=${evt.amount}, block=${evt.blockNumber}); cursor will NOT advance, next tick retries.`,
|
|
1611
|
+
{
|
|
1612
|
+
pointToken: this.pointTokenAddress,
|
|
1613
|
+
from: evt.from,
|
|
1614
|
+
amount: evt.amount,
|
|
1615
|
+
txHash: evt.txHash,
|
|
1616
|
+
blockNumber: evt.blockNumber,
|
|
1617
|
+
lockId
|
|
1618
|
+
},
|
|
1619
|
+
err
|
|
1620
|
+
);
|
|
1567
1621
|
}
|
|
1568
1622
|
}
|
|
1569
1623
|
};
|
|
@@ -2027,9 +2081,10 @@ var PointTokenDomainResolver = class {
|
|
|
2027
2081
|
import { getAddress as getAddress7 } from "viem";
|
|
2028
2082
|
import {
|
|
2029
2083
|
signBurnRequest,
|
|
2030
|
-
POINT_TOKEN_ABI
|
|
2084
|
+
POINT_TOKEN_ABI,
|
|
2031
2085
|
getPointTokenBalance as getPointTokenBalance2,
|
|
2032
|
-
getContractAddresses as getContractAddresses2
|
|
2086
|
+
getContractAddresses as getContractAddresses2,
|
|
2087
|
+
Source as Source2
|
|
2033
2088
|
} from "@pafi-dev/core";
|
|
2034
2089
|
var DEFAULT_REDEEM_LOCK_MS = 15 * 60 * 1e3;
|
|
2035
2090
|
var DEFAULT_SIG_DEADLINE_SEC = 15 * 60;
|
|
@@ -2133,7 +2188,7 @@ var PTRedeemHandler = class {
|
|
|
2133
2188
|
try {
|
|
2134
2189
|
burnNonce = await this.provider.readContract({
|
|
2135
2190
|
address: pointTokenAddress,
|
|
2136
|
-
abi:
|
|
2191
|
+
abi: POINT_TOKEN_ABI,
|
|
2137
2192
|
functionName: "burnRequestNonces",
|
|
2138
2193
|
args: [request.userAddress]
|
|
2139
2194
|
});
|
|
@@ -2215,10 +2270,12 @@ var PTRedeemHandler = class {
|
|
|
2215
2270
|
chainId: this.chainId,
|
|
2216
2271
|
verifyingContract: pointTokenAddress
|
|
2217
2272
|
};
|
|
2273
|
+
const BURN_SOURCE = Source2.EQUITY;
|
|
2218
2274
|
const sponsoredBurnAmount = request.amount - fee;
|
|
2219
2275
|
const sponsoredBurnRequest = {
|
|
2220
2276
|
from: request.userAddress,
|
|
2221
2277
|
amount: sponsoredBurnAmount,
|
|
2278
|
+
source: BURN_SOURCE,
|
|
2222
2279
|
nonce: burnNonce,
|
|
2223
2280
|
deadline
|
|
2224
2281
|
};
|
|
@@ -2254,6 +2311,7 @@ var PTRedeemHandler = class {
|
|
|
2254
2311
|
const fallbackBurnRequest = {
|
|
2255
2312
|
from: request.userAddress,
|
|
2256
2313
|
amount: request.amount,
|
|
2314
|
+
source: BURN_SOURCE,
|
|
2257
2315
|
nonce: burnNonce,
|
|
2258
2316
|
deadline
|
|
2259
2317
|
};
|
|
@@ -4701,10 +4759,9 @@ async function createIssuerService(config) {
|
|
|
4701
4759
|
// src/issuer-state/validator.ts
|
|
4702
4760
|
import { getAddress as getAddress13 } from "viem";
|
|
4703
4761
|
import {
|
|
4704
|
-
POINT_TOKEN_ABI as
|
|
4762
|
+
POINT_TOKEN_ABI as POINT_TOKEN_ABI2,
|
|
4705
4763
|
issuerRegistryAbi,
|
|
4706
|
-
getContractAddresses as getContractAddresses8
|
|
4707
|
-
getTokenCap
|
|
4764
|
+
getContractAddresses as getContractAddresses8
|
|
4708
4765
|
} from "@pafi-dev/core";
|
|
4709
4766
|
var ISSUER_RECORD_TTL_MS = 3e4;
|
|
4710
4767
|
var IssuerStateValidator = class _IssuerStateValidator {
|
|
@@ -4751,7 +4808,7 @@ var IssuerStateValidator = class _IssuerStateValidator {
|
|
|
4751
4808
|
if (cached) return cached;
|
|
4752
4809
|
const issuer = await this.provider.readContract({
|
|
4753
4810
|
address: key,
|
|
4754
|
-
abi:
|
|
4811
|
+
abi: POINT_TOKEN_ABI2,
|
|
4755
4812
|
functionName: "issuer"
|
|
4756
4813
|
});
|
|
4757
4814
|
this.pointTokenIssuerCache.set(key, getAddress13(issuer));
|
|
@@ -4805,22 +4862,22 @@ var IssuerStateValidator = class _IssuerStateValidator {
|
|
|
4805
4862
|
}
|
|
4806
4863
|
throw err;
|
|
4807
4864
|
}
|
|
4808
|
-
const { issuer,
|
|
4865
|
+
const { issuer, equityCap, equitySupply, remaining } = state;
|
|
4809
4866
|
if (!issuer.active) {
|
|
4810
4867
|
throw new IssuerStateError(
|
|
4811
4868
|
"ISSUER_INACTIVE",
|
|
4812
|
-
`Issuer ${issuer.
|
|
4813
|
-
{
|
|
4869
|
+
`Issuer "${issuer.name}" is deactivated on IssuerRegistry`,
|
|
4870
|
+
{ pointToken }
|
|
4814
4871
|
);
|
|
4815
4872
|
}
|
|
4816
|
-
if (
|
|
4873
|
+
if (equitySupply + amount > equityCap.hardCap) {
|
|
4817
4874
|
throw new IssuerStateError(
|
|
4818
4875
|
"MINT_CAP_EXCEEDED",
|
|
4819
|
-
`Requested ${amount} PT would exceed mint cap. Cap=${hardCap},
|
|
4876
|
+
`Requested ${amount} PT would exceed EQUITY mint cap. Cap=${equityCap.hardCap}, equityMinted=${equitySupply}, remaining=${remaining}`,
|
|
4820
4877
|
{
|
|
4821
4878
|
requested: amount.toString(),
|
|
4822
|
-
cap: hardCap.toString(),
|
|
4823
|
-
|
|
4879
|
+
cap: equityCap.hardCap.toString(),
|
|
4880
|
+
equityMinted: equitySupply.toString(),
|
|
4824
4881
|
remaining: remaining.toString()
|
|
4825
4882
|
}
|
|
4826
4883
|
);
|
|
@@ -4836,33 +4893,28 @@ var IssuerStateValidator = class _IssuerStateValidator {
|
|
|
4836
4893
|
args: [issuerAddr]
|
|
4837
4894
|
});
|
|
4838
4895
|
const issuer = {
|
|
4839
|
-
issuerAddress: issuerStruct.issuerAddress,
|
|
4840
4896
|
signerAddress: issuerStruct.signerAddress,
|
|
4841
4897
|
name: issuerStruct.name,
|
|
4842
|
-
symbol: issuerStruct.symbol,
|
|
4843
4898
|
active: issuerStruct.active,
|
|
4844
|
-
|
|
4845
|
-
|
|
4899
|
+
capitalBase: issuerStruct.capitalBase,
|
|
4900
|
+
basisPoints: Number(issuerStruct.basisPoints)
|
|
4846
4901
|
};
|
|
4847
|
-
const
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
capBasisPoints: tokenCap.capBasisPoints
|
|
4902
|
+
const equitySupply = await this.provider.readContract({
|
|
4903
|
+
address: tokenAddr,
|
|
4904
|
+
abi: POINT_TOKEN_ABI2,
|
|
4905
|
+
functionName: "equitySupply"
|
|
4906
|
+
});
|
|
4907
|
+
const hardCap = issuer.capitalBase * BigInt(issuer.basisPoints) / 10000n;
|
|
4908
|
+
const equityCap = {
|
|
4909
|
+
capitalBase: issuer.capitalBase,
|
|
4910
|
+
basisPoints: issuer.basisPoints,
|
|
4911
|
+
hardCap
|
|
4858
4912
|
};
|
|
4859
|
-
const
|
|
4860
|
-
const remaining = hardCap > totalSupply ? hardCap - totalSupply : 0n;
|
|
4913
|
+
const remaining = hardCap > equitySupply ? hardCap - equitySupply : 0n;
|
|
4861
4914
|
return {
|
|
4862
4915
|
issuer,
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
hardCap,
|
|
4916
|
+
equityCap,
|
|
4917
|
+
equitySupply,
|
|
4866
4918
|
remaining
|
|
4867
4919
|
};
|
|
4868
4920
|
}
|
|
@@ -4905,7 +4957,7 @@ var MemoryRedemptionHistoryStore = class {
|
|
|
4905
4957
|
};
|
|
4906
4958
|
|
|
4907
4959
|
// src/index.ts
|
|
4908
|
-
var PAFI_ISSUER_SDK_VERSION = true ? "0.
|
|
4960
|
+
var PAFI_ISSUER_SDK_VERSION = true ? "0.24.1" : "dev";
|
|
4909
4961
|
export {
|
|
4910
4962
|
AdapterMisconfiguredError,
|
|
4911
4963
|
AuthError,
|
|
@@ -4913,6 +4965,7 @@ export {
|
|
|
4913
4965
|
BundlerNotConfiguredError,
|
|
4914
4966
|
BundlerRejectedError,
|
|
4915
4967
|
BurnIndexer,
|
|
4968
|
+
BurnIndexerFinalizeError,
|
|
4916
4969
|
ConfigurationError,
|
|
4917
4970
|
DEFAULT_REDEMPTION_POLICY,
|
|
4918
4971
|
DefaultPolicyEngine,
|
|
@@ -4944,6 +4997,7 @@ export {
|
|
|
4944
4997
|
PerpDepositError,
|
|
4945
4998
|
PerpDepositHandler,
|
|
4946
4999
|
PointIndexer,
|
|
5000
|
+
PointIndexerFinalizeError,
|
|
4947
5001
|
PointTokenDomainResolver,
|
|
4948
5002
|
PolicyProvider,
|
|
4949
5003
|
REDEMPTION_HISTORY_WINDOW_SEC,
|