@pafi-dev/issuer 0.12.1 → 0.12.3

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 CHANGED
@@ -4653,33 +4653,42 @@ var IssuerStateValidator = class _IssuerStateValidator {
4653
4653
  }
4654
4654
  async fetchIssuerState(tokenAddr) {
4655
4655
  const issuerAddr = await this.getIssuerAddressForPointToken(tokenAddr);
4656
- const [issuerTuple, totalSupply] = await Promise.all([
4657
- this.provider.readContract({
4658
- address: this.registryAddress,
4659
- abi: import_core20.issuerRegistryGetIssuerFlatAbi,
4660
- functionName: "getIssuer",
4661
- args: [issuerAddr]
4662
- }),
4656
+ const issuerTuple = await this.provider.readContract({
4657
+ address: this.registryAddress,
4658
+ abi: import_core20.issuerRegistryGetIssuerFlatAbi,
4659
+ functionName: "getIssuer",
4660
+ args: [issuerAddr]
4661
+ });
4662
+ const issuer = {
4663
+ issuerAddress: issuerTuple[0],
4664
+ signerAddress: issuerTuple[1],
4665
+ name: issuerTuple[2],
4666
+ symbol: issuerTuple[3],
4667
+ active: issuerTuple[4],
4668
+ pointToken: issuerTuple[5],
4669
+ mintingOracle: issuerTuple[6]
4670
+ };
4671
+ const [tokenCap, totalSupply] = await Promise.all([
4672
+ (0, import_core20.getTokenCap)(this.provider, issuer.mintingOracle, tokenAddr),
4663
4673
  this.provider.readContract({
4664
4674
  address: tokenAddr,
4665
4675
  abi: import_core20.POINT_TOKEN_V2_ABI,
4666
4676
  functionName: "totalSupply"
4667
4677
  })
4668
4678
  ]);
4669
- const issuer = {
4670
- issuerAddress: issuerTuple[0],
4671
- signerAddress: issuerTuple[1],
4672
- name: issuerTuple[2],
4673
- symbol: issuerTuple[3],
4674
- declaredTotalSupply: issuerTuple[4],
4675
- capBasisPoints: issuerTuple[5],
4676
- active: issuerTuple[6],
4677
- pointToken: issuerTuple[7],
4678
- mintingOracle: issuerTuple[8]
4679
+ const tokenCapRecord = {
4680
+ declaredTotalSupply: tokenCap.declaredTotalSupply,
4681
+ capBasisPoints: tokenCap.capBasisPoints
4679
4682
  };
4680
- const hardCap = issuer.declaredTotalSupply * BigInt(issuer.capBasisPoints) / 10000n;
4683
+ const hardCap = tokenCapRecord.declaredTotalSupply * BigInt(tokenCapRecord.capBasisPoints) / 10000n;
4681
4684
  const remaining = hardCap > totalSupply ? hardCap - totalSupply : 0n;
4682
- return { issuer, totalSupply, hardCap, remaining };
4685
+ return {
4686
+ issuer,
4687
+ tokenCap: tokenCapRecord,
4688
+ totalSupply,
4689
+ hardCap,
4690
+ remaining
4691
+ };
4683
4692
  }
4684
4693
  };
4685
4694
 
@@ -4720,7 +4729,7 @@ var MemoryRedemptionHistoryStore = class {
4720
4729
  };
4721
4730
 
4722
4731
  // src/index.ts
4723
- var PAFI_ISSUER_SDK_VERSION = true ? "0.12.1" : "dev";
4732
+ var PAFI_ISSUER_SDK_VERSION = true ? "0.12.3" : "dev";
4724
4733
  // Annotate the CommonJS export names for ESM import in node:
4725
4734
  0 && (module.exports = {
4726
4735
  AdapterMisconfiguredError,