@pafi-dev/issuer 0.10.1 → 0.10.2

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.d.cts CHANGED
@@ -2238,13 +2238,20 @@ interface PTClaimHandlerConfig {
2238
2238
  signatureDeadlineSeconds?: number;
2239
2239
  now?: () => number;
2240
2240
  /**
2241
- * Optional v1.6+ when set, mints route through `MintFeeWrapper` so a
2242
- * fee is skimmed and split per the registered recipient list. Caller
2243
- * responsibility:
2244
- * - DAO must have called `IssuerRegistry.setMintFeeWrapper(this address)`
2245
- * - The PointToken must have been registered (cascaded from
2246
- * `IssuerRegistry.addIssuer` or owner-only `wrapper.registerToken`)
2247
- * When unset, claims fall back to direct PointToken.mint (no fee skim).
2241
+ * Optional override for the v1.6+ MintFeeWrapper address. By default the
2242
+ * handler auto-resolves the wrapper from the request's `chainId` via
2243
+ * `getContractAddresses(chainId).mintFeeWrapper`. Set this only when:
2244
+ * - testing against a non-canonical wrapper deploy, or
2245
+ * - the SDK's hardcoded address is stale and you can't bump the SDK yet
2246
+ *
2247
+ * Pass the dead-zero address to opt OUT of the wrapper path (force direct
2248
+ * mint with no fee). Pass `undefined` (default) to use SDK's lookup.
2249
+ *
2250
+ * Caller responsibility either way:
2251
+ * - DAO must have called `IssuerRegistry.setMintFeeWrapper(...)` so
2252
+ * `addIssuer` cascades the recipient list.
2253
+ * - The PointToken must have been registered with the wrapper (via
2254
+ * `addIssuer` cascade or owner-only `wrapper.registerToken`).
2248
2255
  */
2249
2256
  mintFeeWrapperAddress?: Address;
2250
2257
  }
package/dist/index.d.ts CHANGED
@@ -2238,13 +2238,20 @@ interface PTClaimHandlerConfig {
2238
2238
  signatureDeadlineSeconds?: number;
2239
2239
  now?: () => number;
2240
2240
  /**
2241
- * Optional v1.6+ when set, mints route through `MintFeeWrapper` so a
2242
- * fee is skimmed and split per the registered recipient list. Caller
2243
- * responsibility:
2244
- * - DAO must have called `IssuerRegistry.setMintFeeWrapper(this address)`
2245
- * - The PointToken must have been registered (cascaded from
2246
- * `IssuerRegistry.addIssuer` or owner-only `wrapper.registerToken`)
2247
- * When unset, claims fall back to direct PointToken.mint (no fee skim).
2241
+ * Optional override for the v1.6+ MintFeeWrapper address. By default the
2242
+ * handler auto-resolves the wrapper from the request's `chainId` via
2243
+ * `getContractAddresses(chainId).mintFeeWrapper`. Set this only when:
2244
+ * - testing against a non-canonical wrapper deploy, or
2245
+ * - the SDK's hardcoded address is stale and you can't bump the SDK yet
2246
+ *
2247
+ * Pass the dead-zero address to opt OUT of the wrapper path (force direct
2248
+ * mint with no fee). Pass `undefined` (default) to use SDK's lookup.
2249
+ *
2250
+ * Caller responsibility either way:
2251
+ * - DAO must have called `IssuerRegistry.setMintFeeWrapper(...)` so
2252
+ * `addIssuer` cascades the recipient list.
2253
+ * - The PointToken must have been registered with the wrapper (via
2254
+ * `addIssuer` cascade or owner-only `wrapper.registerToken`).
2248
2255
  */
2249
2256
  mintFeeWrapperAddress?: Address;
2250
2257
  }
package/dist/index.js CHANGED
@@ -2380,6 +2380,11 @@ var PTClaimError = class extends PafiSdkError {
2380
2380
  this.details = details;
2381
2381
  }
2382
2382
  };
2383
+ function isNoWrapper(address) {
2384
+ if (!address) return true;
2385
+ const lower = address.toLowerCase();
2386
+ return lower === "0x0000000000000000000000000000000000000000" || lower === "0x000000000000000000000000000000000000dead";
2387
+ }
2383
2388
  var DEFAULT_LOCK_MS = 15 * 60 * 1e3;
2384
2389
  var DEFAULT_SIG_DEADLINE_SEC2 = 15 * 60;
2385
2390
  var PTClaimHandler = class {
@@ -2416,9 +2421,11 @@ var PTClaimHandler = class {
2416
2421
  );
2417
2422
  }
2418
2423
  }
2419
- const { batchExecutor: batchExecutorAddress } = getContractAddresses3(
2420
- request.chainId
2421
- );
2424
+ const chainAddresses = getContractAddresses3(request.chainId);
2425
+ const { batchExecutor: batchExecutorAddress } = chainAddresses;
2426
+ const wrapperOverride = this.cfg.mintFeeWrapperAddress;
2427
+ const wrapperFromSdk = chainAddresses.mintFeeWrapper;
2428
+ const resolvedWrapper = wrapperOverride !== void 0 ? isNoWrapper(wrapperOverride) ? void 0 : wrapperOverride : isNoWrapper(wrapperFromSdk) ? void 0 : wrapperFromSdk;
2422
2429
  const lockId = await this.cfg.ledger.lockForMinting(
2423
2430
  request.userAddress,
2424
2431
  request.amount,
@@ -2447,7 +2454,7 @@ var PTClaimHandler = class {
2447
2454
  domain,
2448
2455
  mintRequestNonce: request.mintRequestNonce,
2449
2456
  deadline: signatureDeadline,
2450
- mintFeeWrapperAddress: this.cfg.mintFeeWrapperAddress
2457
+ mintFeeWrapperAddress: resolvedWrapper
2451
2458
  // No feeAmount/feeRecipient — RelayService auto-resolves.
2452
2459
  });
2453
2460
  } catch (err) {
@@ -2470,7 +2477,7 @@ var PTClaimHandler = class {
2470
2477
  mintRequestNonce: request.mintRequestNonce,
2471
2478
  deadline: signatureDeadline,
2472
2479
  feeAmount: 0n,
2473
- mintFeeWrapperAddress: this.cfg.mintFeeWrapperAddress
2480
+ mintFeeWrapperAddress: resolvedWrapper
2474
2481
  });
2475
2482
  } catch (err) {
2476
2483
  throw new PTClaimError(
@@ -4414,7 +4421,7 @@ var MemoryRedemptionHistoryStore = class {
4414
4421
  };
4415
4422
 
4416
4423
  // src/index.ts
4417
- var PAFI_ISSUER_SDK_VERSION = true ? "0.10.1" : "dev";
4424
+ var PAFI_ISSUER_SDK_VERSION = true ? "0.10.2" : "dev";
4418
4425
  export {
4419
4426
  AdapterMisconfiguredError,
4420
4427
  AuthError,