@pafi-dev/issuer 0.5.5 → 0.5.6
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 +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -31,7 +31,7 @@ __export(index_exports, {
|
|
|
31
31
|
MemorySessionStore: () => MemorySessionStore,
|
|
32
32
|
NonceManager: () => NonceManager,
|
|
33
33
|
PAFI_ISSUER_SDK_VERSION: () => PAFI_ISSUER_SDK_VERSION,
|
|
34
|
-
PAFI_SUBGRAPH_URL: () => PAFI_SUBGRAPH_URL,
|
|
34
|
+
PAFI_SUBGRAPH_URL: () => import_core6.PAFI_SUBGRAPH_URL,
|
|
35
35
|
PTRedeemError: () => PTRedeemError,
|
|
36
36
|
PTRedeemHandler: () => PTRedeemHandler,
|
|
37
37
|
PafiBackendClient: () => PafiBackendClient,
|
|
@@ -1481,7 +1481,7 @@ var TopUpRedemptionHandler = class {
|
|
|
1481
1481
|
|
|
1482
1482
|
// src/pools/subgraphPoolsProvider.ts
|
|
1483
1483
|
var import_viem9 = require("viem");
|
|
1484
|
-
var
|
|
1484
|
+
var import_core6 = require("@pafi-dev/core");
|
|
1485
1485
|
var DEFAULT_CACHE_TTL_MS = 3e4;
|
|
1486
1486
|
var POOL_QUERY = `
|
|
1487
1487
|
query GetPoolForPointToken($id: ID!) {
|
|
@@ -1499,7 +1499,7 @@ var POOL_QUERY = `
|
|
|
1499
1499
|
}
|
|
1500
1500
|
`;
|
|
1501
1501
|
function createSubgraphPoolsProvider(config = {}) {
|
|
1502
|
-
const subgraphUrl = config.subgraphUrl ?? PAFI_SUBGRAPH_URL;
|
|
1502
|
+
const subgraphUrl = config.subgraphUrl ?? import_core6.PAFI_SUBGRAPH_URL;
|
|
1503
1503
|
try {
|
|
1504
1504
|
const parsed = new URL(subgraphUrl);
|
|
1505
1505
|
if (process.env.NODE_ENV === "production" && parsed.protocol !== "https:") {
|
|
@@ -1631,7 +1631,7 @@ var PRICE_QUERY = `
|
|
|
1631
1631
|
}
|
|
1632
1632
|
`;
|
|
1633
1633
|
function createSubgraphNativeUsdtQuoter(config = {}) {
|
|
1634
|
-
const subgraphUrl = config.subgraphUrl ?? PAFI_SUBGRAPH_URL;
|
|
1634
|
+
const subgraphUrl = config.subgraphUrl ?? import_core6.PAFI_SUBGRAPH_URL;
|
|
1635
1635
|
try {
|
|
1636
1636
|
const parsed = new URL(subgraphUrl);
|
|
1637
1637
|
if (process.env.NODE_ENV === "production" && parsed.protocol !== "https:") {
|
|
@@ -1739,7 +1739,7 @@ function toUsdtPerNative(priceFloat, usdtDecimals) {
|
|
|
1739
1739
|
}
|
|
1740
1740
|
|
|
1741
1741
|
// src/balance/balanceAggregator.ts
|
|
1742
|
-
var
|
|
1742
|
+
var import_core7 = require("@pafi-dev/core");
|
|
1743
1743
|
var BalanceAggregator = class {
|
|
1744
1744
|
provider;
|
|
1745
1745
|
ledger;
|
|
@@ -1760,7 +1760,7 @@ var BalanceAggregator = class {
|
|
|
1760
1760
|
async getCombinedBalance(user, pointToken) {
|
|
1761
1761
|
const [offChain, onChain] = await Promise.all([
|
|
1762
1762
|
this.ledger.getBalance(user, pointToken),
|
|
1763
|
-
(0,
|
|
1763
|
+
(0, import_core7.getPointTokenBalance)(this.provider, pointToken, user)
|
|
1764
1764
|
]);
|
|
1765
1765
|
return {
|
|
1766
1766
|
offChain,
|
|
@@ -1910,7 +1910,7 @@ var PafiBackendClient = class {
|
|
|
1910
1910
|
|
|
1911
1911
|
// src/config.ts
|
|
1912
1912
|
var import_viem10 = require("viem");
|
|
1913
|
-
var
|
|
1913
|
+
var import_core8 = require("@pafi-dev/core");
|
|
1914
1914
|
function createIssuerService(config) {
|
|
1915
1915
|
if (!config.provider) {
|
|
1916
1916
|
throw new Error("createIssuerService: provider is required");
|
|
@@ -1977,7 +1977,7 @@ function createIssuerService(config) {
|
|
|
1977
1977
|
indexers.set(tokenAddress, new PointIndexer(indexerConfig));
|
|
1978
1978
|
}
|
|
1979
1979
|
const firstIndexer = indexers.get(tokenAddresses[0]);
|
|
1980
|
-
const chainAddresses = (0,
|
|
1980
|
+
const chainAddresses = (0, import_core8.getContractAddresses)(config.chainId);
|
|
1981
1981
|
const resolvedContracts = {
|
|
1982
1982
|
batchExecutor: chainAddresses.batchExecutor,
|
|
1983
1983
|
usdt: chainAddresses.usdt,
|