@pafi-dev/issuer 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +9 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +9 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2210,8 +2210,7 @@ interface MintStatusParams {
|
|
|
2210
2210
|
*/
|
|
2211
2211
|
pafiBackendClient?: PafiBackendClient | null;
|
|
2212
2212
|
/**
|
|
2213
|
-
*
|
|
2214
|
-
* bundler-receipt fallback. The bundler returns success at zero
|
|
2213
|
+
* Guard for the bundler-receipt fallback. The bundler returns success at zero
|
|
2215
2214
|
* confs, but `PointIndexer` enforces a 3-block reorg window;
|
|
2216
2215
|
* crediting / debiting off-chain at 0 confs while the indexer waits
|
|
2217
2216
|
* for finality leaves an unbacked durable mutation if the tx is
|
|
@@ -2222,7 +2221,7 @@ interface MintStatusParams {
|
|
|
2222
2221
|
*/
|
|
2223
2222
|
provider?: PublicClient;
|
|
2224
2223
|
/**
|
|
2225
|
-
*
|
|
2224
|
+
* Confirmation depth required before the receipt
|
|
2226
2225
|
* fallback applies the credit / debit. MUST match
|
|
2227
2226
|
* `PointIndexer.confirmations` (default 3). Operators who reduce
|
|
2228
2227
|
* the indexer depth must set this to the same value.
|
|
@@ -2237,7 +2236,7 @@ interface BurnStatusParams {
|
|
|
2237
2236
|
ledger: IPointLedger;
|
|
2238
2237
|
pafiBackendClient?: PafiBackendClient | null;
|
|
2239
2238
|
/**
|
|
2240
|
-
*
|
|
2239
|
+
* BurnStatusParams.provider` for full
|
|
2241
2240
|
* rationale. The receipt-fallback path applies a spendable
|
|
2242
2241
|
* off-chain credit; without a confirmation-depth gate a reorg
|
|
2243
2242
|
* before `BurnIndexer.confirmations` leaves durable unbacked
|
|
@@ -2245,7 +2244,7 @@ interface BurnStatusParams {
|
|
|
2245
2244
|
*/
|
|
2246
2245
|
provider?: PublicClient;
|
|
2247
2246
|
/**
|
|
2248
|
-
*
|
|
2247
|
+
* Confirmation depth required before the receipt
|
|
2249
2248
|
* fallback applies the credit. MUST match
|
|
2250
2249
|
* `BurnIndexer.confirmations` (default 3).
|
|
2251
2250
|
*/
|
|
@@ -3951,9 +3950,12 @@ declare class IssuerStateError extends PafiSdkError {
|
|
|
3951
3950
|
*
|
|
3952
3951
|
* Caching:
|
|
3953
3952
|
* - `PointToken.issuer()` — memoized for the process lifetime (immutable)
|
|
3954
|
-
* - Full state (registry + totalSupply) —
|
|
3953
|
+
* - Full state (registry + totalSupply) — 10s TTL per PointToken
|
|
3954
|
+
* (was 30s pre-audit PACI5-3; see `ISSUER_RECORD_TTL_MS` comment)
|
|
3955
3955
|
* - Burst calls while a fetch is in-flight share the same Promise
|
|
3956
3956
|
* (thundering-herd protection)
|
|
3957
|
+
* - Operators can call `invalidate()` after admin txs land to bust
|
|
3958
|
+
* the cache immediately instead of waiting up to TTL.
|
|
3957
3959
|
*
|
|
3958
3960
|
* Usage in NestJS: wrap this in an `@Injectable()` service; pass
|
|
3959
3961
|
* `PublicClient` and `registryAddress` from your DI container.
|
|
@@ -3972,7 +3974,9 @@ declare class IssuerStateValidator {
|
|
|
3972
3974
|
static forChain(provider: PublicClient, chainId: number): IssuerStateValidator;
|
|
3973
3975
|
/**
|
|
3974
3976
|
* Invalidate cached state for one PointToken, or everything if omitted.
|
|
3975
|
-
* Call after admin txs that change registry or cap settings
|
|
3977
|
+
* Call after admin txs that change registry or cap settings — closes
|
|
3978
|
+
* the split-brain window described in audit PACI5-3 ahead of the
|
|
3979
|
+
* passive TTL. Idempotent: safe to call when no entry exists.
|
|
3976
3980
|
*/
|
|
3977
3981
|
invalidate(pointToken?: Address): void;
|
|
3978
3982
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -2210,8 +2210,7 @@ interface MintStatusParams {
|
|
|
2210
2210
|
*/
|
|
2211
2211
|
pafiBackendClient?: PafiBackendClient | null;
|
|
2212
2212
|
/**
|
|
2213
|
-
*
|
|
2214
|
-
* bundler-receipt fallback. The bundler returns success at zero
|
|
2213
|
+
* Guard for the bundler-receipt fallback. The bundler returns success at zero
|
|
2215
2214
|
* confs, but `PointIndexer` enforces a 3-block reorg window;
|
|
2216
2215
|
* crediting / debiting off-chain at 0 confs while the indexer waits
|
|
2217
2216
|
* for finality leaves an unbacked durable mutation if the tx is
|
|
@@ -2222,7 +2221,7 @@ interface MintStatusParams {
|
|
|
2222
2221
|
*/
|
|
2223
2222
|
provider?: PublicClient;
|
|
2224
2223
|
/**
|
|
2225
|
-
*
|
|
2224
|
+
* Confirmation depth required before the receipt
|
|
2226
2225
|
* fallback applies the credit / debit. MUST match
|
|
2227
2226
|
* `PointIndexer.confirmations` (default 3). Operators who reduce
|
|
2228
2227
|
* the indexer depth must set this to the same value.
|
|
@@ -2237,7 +2236,7 @@ interface BurnStatusParams {
|
|
|
2237
2236
|
ledger: IPointLedger;
|
|
2238
2237
|
pafiBackendClient?: PafiBackendClient | null;
|
|
2239
2238
|
/**
|
|
2240
|
-
*
|
|
2239
|
+
* BurnStatusParams.provider` for full
|
|
2241
2240
|
* rationale. The receipt-fallback path applies a spendable
|
|
2242
2241
|
* off-chain credit; without a confirmation-depth gate a reorg
|
|
2243
2242
|
* before `BurnIndexer.confirmations` leaves durable unbacked
|
|
@@ -2245,7 +2244,7 @@ interface BurnStatusParams {
|
|
|
2245
2244
|
*/
|
|
2246
2245
|
provider?: PublicClient;
|
|
2247
2246
|
/**
|
|
2248
|
-
*
|
|
2247
|
+
* Confirmation depth required before the receipt
|
|
2249
2248
|
* fallback applies the credit. MUST match
|
|
2250
2249
|
* `BurnIndexer.confirmations` (default 3).
|
|
2251
2250
|
*/
|
|
@@ -3951,9 +3950,12 @@ declare class IssuerStateError extends PafiSdkError {
|
|
|
3951
3950
|
*
|
|
3952
3951
|
* Caching:
|
|
3953
3952
|
* - `PointToken.issuer()` — memoized for the process lifetime (immutable)
|
|
3954
|
-
* - Full state (registry + totalSupply) —
|
|
3953
|
+
* - Full state (registry + totalSupply) — 10s TTL per PointToken
|
|
3954
|
+
* (was 30s pre-audit PACI5-3; see `ISSUER_RECORD_TTL_MS` comment)
|
|
3955
3955
|
* - Burst calls while a fetch is in-flight share the same Promise
|
|
3956
3956
|
* (thundering-herd protection)
|
|
3957
|
+
* - Operators can call `invalidate()` after admin txs land to bust
|
|
3958
|
+
* the cache immediately instead of waiting up to TTL.
|
|
3957
3959
|
*
|
|
3958
3960
|
* Usage in NestJS: wrap this in an `@Injectable()` service; pass
|
|
3959
3961
|
* `PublicClient` and `registryAddress` from your DI container.
|
|
@@ -3972,7 +3974,9 @@ declare class IssuerStateValidator {
|
|
|
3972
3974
|
static forChain(provider: PublicClient, chainId: number): IssuerStateValidator;
|
|
3973
3975
|
/**
|
|
3974
3976
|
* Invalidate cached state for one PointToken, or everything if omitted.
|
|
3975
|
-
* Call after admin txs that change registry or cap settings
|
|
3977
|
+
* Call after admin txs that change registry or cap settings — closes
|
|
3978
|
+
* the split-brain window described in audit PACI5-3 ahead of the
|
|
3979
|
+
* passive TTL. Idempotent: safe to call when no entry exists.
|
|
3976
3980
|
*/
|
|
3977
3981
|
invalidate(pointToken?: Address): void;
|
|
3978
3982
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2426,13 +2426,13 @@ var DEFAULT_STATUS_CONFIRMATIONS = 3;
|
|
|
2426
2426
|
async function isReceiptPastConfirmations(receipt, provider, confirmations, onWarning, handlerName) {
|
|
2427
2427
|
if (!provider) {
|
|
2428
2428
|
onWarning?.(
|
|
2429
|
-
`${handlerName}: provider missing \u2014 cannot enforce confirmation depth; deferring receipt fallback to on-chain indexer
|
|
2429
|
+
`${handlerName}: provider missing \u2014 cannot enforce confirmation depth; deferring receipt fallback to on-chain indexer.`
|
|
2430
2430
|
);
|
|
2431
2431
|
return false;
|
|
2432
2432
|
}
|
|
2433
2433
|
if (!receipt.blockNumber) {
|
|
2434
2434
|
onWarning?.(
|
|
2435
|
-
`${handlerName}: receipt has no blockNumber \u2014 cannot enforce confirmation depth; deferring to indexer
|
|
2435
|
+
`${handlerName}: receipt has no blockNumber \u2014 cannot enforce confirmation depth; deferring to indexer.`
|
|
2436
2436
|
);
|
|
2437
2437
|
return false;
|
|
2438
2438
|
}
|
|
@@ -2442,7 +2442,7 @@ async function isReceiptPastConfirmations(receipt, provider, confirmations, onWa
|
|
|
2442
2442
|
receiptBlock = BigInt(receipt.blockNumber);
|
|
2443
2443
|
} catch {
|
|
2444
2444
|
onWarning?.(
|
|
2445
|
-
`${handlerName}: malformed receipt blockNumber (${receipt.blockNumber}) \u2014 deferring to indexer
|
|
2445
|
+
`${handlerName}: malformed receipt blockNumber (${receipt.blockNumber}) \u2014 deferring to indexer.`
|
|
2446
2446
|
);
|
|
2447
2447
|
return false;
|
|
2448
2448
|
}
|
|
@@ -2451,7 +2451,7 @@ async function isReceiptPastConfirmations(receipt, provider, confirmations, onWa
|
|
|
2451
2451
|
head = await provider.getBlockNumber();
|
|
2452
2452
|
} catch (err) {
|
|
2453
2453
|
onWarning?.(
|
|
2454
|
-
`${handlerName}: getBlockNumber failed (${err instanceof Error ? err.message : String(err)}) \u2014 deferring to indexer
|
|
2454
|
+
`${handlerName}: getBlockNumber failed (${err instanceof Error ? err.message : String(err)}) \u2014 deferring to indexer.`
|
|
2455
2455
|
);
|
|
2456
2456
|
return false;
|
|
2457
2457
|
}
|
|
@@ -3794,8 +3794,6 @@ var IssuerApiAdapter = class {
|
|
|
3794
3794
|
userAddress: authenticatedAddress,
|
|
3795
3795
|
ledger: this.cfg.ledger,
|
|
3796
3796
|
pafiBackendClient: this.cfg.pafiBackendClient,
|
|
3797
|
-
// Audit PACI5-13 — pass the same provider the indexers use so
|
|
3798
|
-
// the receipt fallback gates on the same reorg depth.
|
|
3799
3797
|
provider: this.cfg.provider,
|
|
3800
3798
|
onWarning: this.cfg.onWarning
|
|
3801
3799
|
});
|
|
@@ -3806,7 +3804,6 @@ var IssuerApiAdapter = class {
|
|
|
3806
3804
|
userAddress: authenticatedAddress,
|
|
3807
3805
|
ledger: this.cfg.ledger,
|
|
3808
3806
|
pafiBackendClient: this.cfg.pafiBackendClient,
|
|
3809
|
-
// Audit PACI5-13 — see claimStatus comment.
|
|
3810
3807
|
provider: this.cfg.provider,
|
|
3811
3808
|
onWarning: this.cfg.onWarning
|
|
3812
3809
|
});
|
|
@@ -5026,7 +5023,7 @@ import {
|
|
|
5026
5023
|
issuerRegistryAbi,
|
|
5027
5024
|
getContractAddresses as getContractAddresses8
|
|
5028
5025
|
} from "@pafi-dev/core";
|
|
5029
|
-
var ISSUER_RECORD_TTL_MS =
|
|
5026
|
+
var ISSUER_RECORD_TTL_MS = 1e4;
|
|
5030
5027
|
var IssuerStateValidator = class _IssuerStateValidator {
|
|
5031
5028
|
constructor(provider, registryAddress) {
|
|
5032
5029
|
this.provider = provider;
|
|
@@ -5047,7 +5044,9 @@ var IssuerStateValidator = class _IssuerStateValidator {
|
|
|
5047
5044
|
}
|
|
5048
5045
|
/**
|
|
5049
5046
|
* Invalidate cached state for one PointToken, or everything if omitted.
|
|
5050
|
-
* Call after admin txs that change registry or cap settings
|
|
5047
|
+
* Call after admin txs that change registry or cap settings — closes
|
|
5048
|
+
* the split-brain window described in audit PACI5-3 ahead of the
|
|
5049
|
+
* passive TTL. Idempotent: safe to call when no entry exists.
|
|
5051
5050
|
*/
|
|
5052
5051
|
invalidate(pointToken) {
|
|
5053
5052
|
if (pointToken) {
|
|
@@ -5220,7 +5219,7 @@ var MemoryRedemptionHistoryStore = class {
|
|
|
5220
5219
|
};
|
|
5221
5220
|
|
|
5222
5221
|
// src/index.ts
|
|
5223
|
-
var PAFI_ISSUER_SDK_VERSION = true ? "0.
|
|
5222
|
+
var PAFI_ISSUER_SDK_VERSION = true ? "0.34.0" : "dev";
|
|
5224
5223
|
export {
|
|
5225
5224
|
AdapterMisconfiguredError,
|
|
5226
5225
|
AuthError,
|