@pafi-dev/issuer 0.5.2 → 0.5.4

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
@@ -1482,10 +1482,12 @@ interface IssuerServiceConfig {
1482
1482
  /** All PointToken addresses this issuer supports. */
1483
1483
  pointTokenAddresses?: Address[];
1484
1484
  /**
1485
- * Full contract address bundle returned verbatim by `handleConfig` so
1486
- * the frontend SDK can pick them up.
1485
+ * Issuer-specific contract addresses merged into the `/config` response.
1486
+ * PAFI-owned addresses (batchExecutor, usdt, issuerRegistry, mintingOracle,
1487
+ * pafiHook) are auto-resolved from `getContractAddresses(chainId)` and
1488
+ * can be omitted. Only `pointToken` / `pointTokens` must be provided.
1487
1489
  */
1488
- contracts: ApiConfigResponse["contracts"];
1490
+ contracts?: Pick<ApiConfigResponse["contracts"], "pointToken" | "pointTokens" | "relay">;
1489
1491
  /**
1490
1492
  * Shared `PublicClient` used for on-chain reads, simulation, indexer
1491
1493
  * polling, and gas-price lookups. Must be pointed at the target chain.
@@ -1530,7 +1532,8 @@ interface IssuerServiceConfig {
1530
1532
  */
1531
1533
  claim?: {
1532
1534
  issuerSignerWallet: WalletClient;
1533
- batchExecutorAddress: Address;
1535
+ /** Defaults to the PAFI-deployed BatchExecutor for the target chain. */
1536
+ batchExecutorAddress?: Address;
1534
1537
  lockDurationMs?: number;
1535
1538
  };
1536
1539
  indexer?: {
package/dist/index.d.ts CHANGED
@@ -1482,10 +1482,12 @@ interface IssuerServiceConfig {
1482
1482
  /** All PointToken addresses this issuer supports. */
1483
1483
  pointTokenAddresses?: Address[];
1484
1484
  /**
1485
- * Full contract address bundle returned verbatim by `handleConfig` so
1486
- * the frontend SDK can pick them up.
1485
+ * Issuer-specific contract addresses merged into the `/config` response.
1486
+ * PAFI-owned addresses (batchExecutor, usdt, issuerRegistry, mintingOracle,
1487
+ * pafiHook) are auto-resolved from `getContractAddresses(chainId)` and
1488
+ * can be omitted. Only `pointToken` / `pointTokens` must be provided.
1487
1489
  */
1488
- contracts: ApiConfigResponse["contracts"];
1490
+ contracts?: Pick<ApiConfigResponse["contracts"], "pointToken" | "pointTokens" | "relay">;
1489
1491
  /**
1490
1492
  * Shared `PublicClient` used for on-chain reads, simulation, indexer
1491
1493
  * polling, and gas-price lookups. Must be pointed at the target chain.
@@ -1530,7 +1532,8 @@ interface IssuerServiceConfig {
1530
1532
  */
1531
1533
  claim?: {
1532
1534
  issuerSignerWallet: WalletClient;
1533
- batchExecutorAddress: Address;
1535
+ /** Defaults to the PAFI-deployed BatchExecutor for the target chain. */
1536
+ batchExecutorAddress?: Address;
1534
1537
  lockDurationMs?: number;
1535
1538
  };
1536
1539
  indexer?: {
package/dist/index.js CHANGED
@@ -1928,6 +1928,7 @@ var PafiBackendClient = class {
1928
1928
 
1929
1929
  // src/config.ts
1930
1930
  import { getAddress as getAddress8 } from "viem";
1931
+ import { getContractAddresses } from "@pafi-dev/core";
1931
1932
  function createIssuerService(config) {
1932
1933
  if (!config.provider) {
1933
1934
  throw new Error("createIssuerService: provider is required");
@@ -1994,13 +1995,22 @@ function createIssuerService(config) {
1994
1995
  indexers.set(tokenAddress, new PointIndexer(indexerConfig));
1995
1996
  }
1996
1997
  const firstIndexer = indexers.get(tokenAddresses[0]);
1998
+ const chainAddresses = getContractAddresses(config.chainId);
1999
+ const resolvedContracts = {
2000
+ batchExecutor: chainAddresses.batchExecutor,
2001
+ usdt: chainAddresses.usdt,
2002
+ issuerRegistry: chainAddresses.issuerRegistry,
2003
+ mintingOracle: chainAddresses.mintingOracle,
2004
+ pafiHook: chainAddresses.pafiHook,
2005
+ ...config.contracts
2006
+ };
1997
2007
  const handlersConfig = {
1998
2008
  authService,
1999
2009
  ledger,
2000
2010
  provider: config.provider,
2001
2011
  pointTokenAddresses: tokenAddresses,
2002
2012
  chainId: config.chainId,
2003
- contracts: config.contracts
2013
+ contracts: resolvedContracts
2004
2014
  };
2005
2015
  if (feeManager) handlersConfig.feeManager = feeManager;
2006
2016
  if (config.poolsProvider) handlersConfig.poolsProvider = config.poolsProvider;
@@ -2009,7 +2019,7 @@ function createIssuerService(config) {
2009
2019
  policy,
2010
2020
  relayService,
2011
2021
  issuerSignerWallet: config.claim.issuerSignerWallet,
2012
- batchExecutorAddress: config.claim.batchExecutorAddress,
2022
+ batchExecutorAddress: config.claim.batchExecutorAddress ?? chainAddresses.batchExecutor,
2013
2023
  lockDurationMs: config.claim.lockDurationMs
2014
2024
  };
2015
2025
  }