@actalink/commonlib 0.0.18 → 0.0.20

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
@@ -1788,6 +1788,26 @@ function fetchBatchInstructionDetails(url, APIKey) {
1788
1788
  // src/deposit.ts
1789
1789
  var transactionServiceUrl = "https://api.acta.link/transaction/v1/";
1790
1790
  var depositServiceUrl = "https://api.acta.link/deposit/v1/";
1791
+ var transactionServiceTestUrl = "https://api.acta.link/transaction/test/v1/";
1792
+ var depositServiceTestUrl = "https://api.acta.link/deposit/test/v1/";
1793
+ var returnEnvUrl = (chainId) => {
1794
+ const mainnetChain = mainnetChains.find((c) => c.id === chainId);
1795
+ const testnetChain = testnetChains.find((c) => c.id === chainId);
1796
+ if (!mainnetChain && !testnetChain) {
1797
+ throw new Error(`Chain ${chainId} not supported.`);
1798
+ }
1799
+ if (mainnetChain) {
1800
+ return {
1801
+ envTransactionServiceUrl: transactionServiceUrl,
1802
+ envDepositServiceUrl: depositServiceUrl
1803
+ };
1804
+ } else {
1805
+ return {
1806
+ envTransactionServiceUrl: transactionServiceTestUrl,
1807
+ envDepositServiceUrl: depositServiceTestUrl
1808
+ };
1809
+ }
1810
+ };
1791
1811
  var ActaDeposit = class {
1792
1812
  constructor(parameters) {
1793
1813
  this.feeInclusive = false;
@@ -1841,9 +1861,10 @@ var ActaDeposit = class {
1841
1861
  if (this.paymentType === "recurring" && this.intervalUnit === void 0) {
1842
1862
  throw new Error("Interval unit is required for recurring payments.");
1843
1863
  }
1864
+ const { envDepositServiceUrl } = returnEnvUrl(this.chainId);
1844
1865
  if (this.depositSessionId !== "") {
1845
1866
  const session2 = yield verifySessionAPICall(
1846
- `${depositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1867
+ `${envDepositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1847
1868
  this.depositSessionId
1848
1869
  );
1849
1870
  this.depositSessionId = session2.sessionId;
@@ -1854,7 +1875,7 @@ var ActaDeposit = class {
1854
1875
  throw new Error("Token not supported.");
1855
1876
  }
1856
1877
  const session = yield createSessionAPICall(
1857
- `${depositServiceUrl}session`,
1878
+ `${envDepositServiceUrl}session`,
1858
1879
  {
1859
1880
  paymentParams: {
1860
1881
  signerAddress: this.signerAddress,
@@ -1955,13 +1976,6 @@ var ActaDeposit = class {
1955
1976
  if (!this.depositSessionId || this.depositSessionId === "") {
1956
1977
  throw new Error("Deposit session ID is required.");
1957
1978
  }
1958
- if (this.depositSessionId !== "") {
1959
- const session = yield verifySessionAPICall(
1960
- `${depositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1961
- this.depositSessionId
1962
- );
1963
- this.depositSessionId = session.sessionId;
1964
- }
1965
1979
  const signerAddress = this.signerAddress;
1966
1980
  const chainId = this.chainId;
1967
1981
  const tokenSymbol = this.token;
@@ -1969,6 +1983,14 @@ var ActaDeposit = class {
1969
1983
  const receiver = this.receiver;
1970
1984
  const feeInclusive = this.feeInclusive;
1971
1985
  const serviceType = this.serviceType;
1986
+ const { envTransactionServiceUrl } = returnEnvUrl(chainId);
1987
+ if (this.depositSessionId !== "") {
1988
+ const session = yield verifySessionAPICall(
1989
+ `${envTransactionServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1990
+ this.depositSessionId
1991
+ );
1992
+ this.depositSessionId = session.sessionId;
1993
+ }
1972
1994
  const token2 = getTokenByChainIdAndSymbol(chainId, tokenSymbol);
1973
1995
  if (!token2) {
1974
1996
  throw new Error("Token not supported.");
@@ -1984,7 +2006,7 @@ var ActaDeposit = class {
1984
2006
  feebps: 10
1985
2007
  });
1986
2008
  const txn = yield executeSinglePaymentAPICall(
1987
- `${transactionServiceUrl}execute/single`,
2009
+ `${envTransactionServiceUrl}execute/single`,
1988
2010
  rpcParameters,
1989
2011
  {
1990
2012
  senderAddress: signerAddress,
@@ -2038,13 +2060,6 @@ var ActaDeposit = class {
2038
2060
  if (!this.walletClient) {
2039
2061
  throw new Error("Signer is required for self custody payments.");
2040
2062
  }
2041
- if (this.depositSessionId !== "") {
2042
- const session = yield verifySessionAPICall(
2043
- `${depositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
2044
- this.depositSessionId
2045
- );
2046
- this.depositSessionId = session.sessionId;
2047
- }
2048
2063
  const signerAddress = this.signerAddress;
2049
2064
  const chainId = this.chainId;
2050
2065
  const tokenSymbol = this.token;
@@ -2056,6 +2071,14 @@ var ActaDeposit = class {
2056
2071
  const startDate = this.startDate;
2057
2072
  const endDate = this.endDate;
2058
2073
  const serviceType = this.serviceType;
2074
+ const { envTransactionServiceUrl, envDepositServiceUrl } = returnEnvUrl(chainId);
2075
+ if (this.depositSessionId !== "") {
2076
+ const session = yield verifySessionAPICall(
2077
+ `${envDepositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
2078
+ this.depositSessionId
2079
+ );
2080
+ this.depositSessionId = session.sessionId;
2081
+ }
2059
2082
  const token2 = getTokenByChainIdAndSymbol(chainId, tokenSymbol);
2060
2083
  if (!token2) {
2061
2084
  throw new Error("Token not supported.");
@@ -2078,7 +2101,7 @@ var ActaDeposit = class {
2078
2101
  feebps: 20
2079
2102
  });
2080
2103
  const txn = yield scheduleRecurringPaymentsAPICall(
2081
- `${transactionServiceUrl}schedule/recurring`,
2104
+ `${envTransactionServiceUrl}schedule/recurring`,
2082
2105
  {
2083
2106
  amount,
2084
2107
  amountExclusive,
@@ -2137,6 +2160,26 @@ var ActaDeposit = class {
2137
2160
  // src/billing.ts
2138
2161
  var import_viem6 = require("viem");
2139
2162
  var transactionServiceUrl2 = "https://api.acta.link/transaction/v1/";
2163
+ var billingServiceUrl = "https://api.acta.link/billing/v1/";
2164
+ var transactionServiceTestUrl2 = "https://api.acta.link/transaction/test/v1/";
2165
+ var returnEnvUrl2 = (chainId) => {
2166
+ const mainnetChain = mainnetChains.find((c) => c.id === chainId);
2167
+ const testnetChain = testnetChains.find((c) => c.id === chainId);
2168
+ if (!mainnetChain && !testnetChain) {
2169
+ throw new Error(`Chain ${chainId} not supported.`);
2170
+ }
2171
+ if (mainnetChain) {
2172
+ return {
2173
+ envTransactionServiceUrl: transactionServiceUrl2,
2174
+ envBillingServiceUrl: billingServiceUrl
2175
+ };
2176
+ } else {
2177
+ return {
2178
+ envTransactionServiceUrl: transactionServiceTestUrl2,
2179
+ envBillingServiceUrl: billingServiceUrl
2180
+ };
2181
+ }
2182
+ };
2140
2183
  var ActaBilling = class {
2141
2184
  constructor(parameters) {
2142
2185
  this.feeInclusive = true;
@@ -2223,6 +2266,7 @@ var ActaBilling = class {
2223
2266
  if (!token2) {
2224
2267
  throw new Error("Token not supported.");
2225
2268
  }
2269
+ const { envTransactionServiceUrl } = returnEnvUrl2(chainId);
2226
2270
  const rpcParameters = yield this.account.signSinglePaymentOperation({
2227
2271
  signerAddress,
2228
2272
  chainId,
@@ -2234,7 +2278,7 @@ var ActaBilling = class {
2234
2278
  feebps: 20
2235
2279
  });
2236
2280
  const txn = yield executeSinglePaymentAPICall(
2237
- `${transactionServiceUrl2}execute/single`,
2281
+ `${envTransactionServiceUrl}execute/single`,
2238
2282
  rpcParameters,
2239
2283
  {
2240
2284
  senderAddress: signerAddress,
@@ -2285,6 +2329,7 @@ var ActaBilling = class {
2285
2329
  if (!chainId || !count || !intervalUnit || !startDate || !endDate) {
2286
2330
  throw new Error("Invalid parameters.");
2287
2331
  }
2332
+ const { envTransactionServiceUrl } = returnEnvUrl2(chainId);
2288
2333
  const { approval, amountExclusive } = yield this.account.signRecurringPayments({
2289
2334
  signerAddress,
2290
2335
  chainId,
@@ -2300,7 +2345,7 @@ var ActaBilling = class {
2300
2345
  feebps: 20
2301
2346
  });
2302
2347
  const txn = yield scheduleRecurringPaymentsAPICall(
2303
- `${transactionServiceUrl2}schedule/recurring`,
2348
+ `${envTransactionServiceUrl}schedule/recurring`,
2304
2349
  {
2305
2350
  amount,
2306
2351
  amountExclusive,
@@ -2360,9 +2405,9 @@ var ActaBilling = class {
2360
2405
  var import_viem7 = require("viem");
2361
2406
  var transactionServiceUrl3 = "https://api.acta.link/transaction/v1/";
2362
2407
  var batchServiceUrl = "https://api.acta.link/batch/api/v1/";
2363
- var transactionServiceTestUrl = "https://api.acta.link/transaction/test/v1/";
2408
+ var transactionServiceTestUrl3 = "https://api.acta.link/transaction/test/v1/";
2364
2409
  var batchServiceTestUrl = "https://api.acta.link/batch/test/api/v1/";
2365
- var returnEnvUrl = (chainId) => {
2410
+ var returnEnvUrl3 = (chainId) => {
2366
2411
  const mainnetChain = mainnetChains.find((c) => c.id === chainId);
2367
2412
  const testnetChain = testnetChains.find((c) => c.id === chainId);
2368
2413
  if (!mainnetChain && !testnetChain) {
@@ -2375,7 +2420,7 @@ var returnEnvUrl = (chainId) => {
2375
2420
  };
2376
2421
  } else {
2377
2422
  return {
2378
- envTransactionServiceUrl: transactionServiceTestUrl,
2423
+ envTransactionServiceUrl: transactionServiceTestUrl3,
2379
2424
  envBatchServiceUrl: batchServiceTestUrl
2380
2425
  };
2381
2426
  }
@@ -2404,7 +2449,7 @@ var ActaBatch = class {
2404
2449
  if (!instructionId || instructionId === "") {
2405
2450
  throw new Error("Instruction id is required");
2406
2451
  }
2407
- const { envBatchServiceUrl } = returnEnvUrl(chainId);
2452
+ const { envBatchServiceUrl } = returnEnvUrl3(chainId);
2408
2453
  const session = yield createBatchSessionAPICall(
2409
2454
  `${envBatchServiceUrl}create/session`,
2410
2455
  this.APIkey,
@@ -2445,7 +2490,7 @@ var ActaBatch = class {
2445
2490
  if (feeInclusive) {
2446
2491
  isFeeInclusive = true;
2447
2492
  }
2448
- const { envBatchServiceUrl } = returnEnvUrl(chainId);
2493
+ const { envBatchServiceUrl } = returnEnvUrl3(chainId);
2449
2494
  const instuctionData = yield fetchBatchInstructionDetails(
2450
2495
  `${envBatchServiceUrl}instruction/${instructionId}`,
2451
2496
  this.APIkey
@@ -2531,7 +2576,7 @@ var ActaBatch = class {
2531
2576
  if (feeInclusive) {
2532
2577
  isFeeInclusive = true;
2533
2578
  }
2534
- const { envBatchServiceUrl } = returnEnvUrl(chainId);
2579
+ const { envBatchServiceUrl } = returnEnvUrl3(chainId);
2535
2580
  const instuctionData = yield fetchBatchInstructionDetails(
2536
2581
  `${envBatchServiceUrl}instruction/${instructionId}`,
2537
2582
  this.APIkey
@@ -2620,7 +2665,7 @@ var ActaBatch = class {
2620
2665
  if (feeInclusive) {
2621
2666
  isFeeInclusive = true;
2622
2667
  }
2623
- const { envBatchServiceUrl } = returnEnvUrl(chainId);
2668
+ const { envBatchServiceUrl } = returnEnvUrl3(chainId);
2624
2669
  if (executionTime <= Date.now() + 1e3 * 60 * 2) {
2625
2670
  throw new Error(
2626
2671
  "Execution time must be more than 5 mins from current time."
@@ -2832,7 +2877,7 @@ var import_account_abstraction2 = require("viem/account-abstraction");
2832
2877
  var import_policies2 = require("@zerodev/permissions/policies");
2833
2878
  var import_semver = require("semver");
2834
2879
  var ECDSA_SIGNER_CONTRACT = "0x6A6F069E2a08c2468e7724Ab3250CdBFBA14D4FF";
2835
- var billingServiceUrl = "https://api.acta.link/billing/v1/";
2880
+ var billingServiceUrl2 = "https://api.acta.link/billing/v1/";
2836
2881
  var depositServiceUrl2 = "https://api.acta.link/deposit/v1/";
2837
2882
  var transactionServiceUrl4 = "https://api.acta.link/transaction/v1/";
2838
2883
  var toSignerId = (signer) => {
@@ -3174,7 +3219,7 @@ var createBillingCheckoutSession = (serviceSessionparams) => __async(null, null,
3174
3219
  var _a, _b, _c, _d;
3175
3220
  try {
3176
3221
  const sessionData = yield createBillingSessionAPICall(
3177
- `${billingServiceUrl}paysession/create`,
3222
+ `${billingServiceUrl2}paysession/create`,
3178
3223
  {
3179
3224
  paylinkId: serviceSessionparams.paylinkId,
3180
3225
  mode: serviceSessionparams.mode,
@@ -3199,7 +3244,7 @@ var getBillingPaymentSessionDetails = (serviceSessionparams) => __async(null, nu
3199
3244
  throw new Error("checkout session ID is required.");
3200
3245
  }
3201
3246
  const sessionData = yield fetchBillingSessionDetails(
3202
- `${billingServiceUrl}paysession?checkoutSessionId=${serviceSessionparams.checkoutSessionId}`
3247
+ `${billingServiceUrl2}paysession?checkoutSessionId=${serviceSessionparams.checkoutSessionId}`
3203
3248
  );
3204
3249
  return sessionData;
3205
3250
  });
@@ -3212,7 +3257,7 @@ var cancelRecurringTransaction = (_0) => __async(null, [_0], function* ({
3212
3257
  if (serviceType !== "billing" && serviceType !== "deposit")
3213
3258
  throw new Error("service is not compatible");
3214
3259
  const response = yield fetchRecurringTransactionWithId(
3215
- `${serviceType === "billing" ? billingServiceUrl : depositServiceUrl2}customer/payment/recurring/info?id=${paymentId}`
3260
+ `${serviceType === "billing" ? billingServiceUrl2 : depositServiceUrl2}customer/payment/recurring/info?id=${paymentId}`
3216
3261
  );
3217
3262
  if (response) {
3218
3263
  const viemClient = new ViemClient(chainId, walletClient);
package/dist/index.js CHANGED
@@ -1715,6 +1715,26 @@ function fetchBatchInstructionDetails(url, APIKey) {
1715
1715
  // src/deposit.ts
1716
1716
  var transactionServiceUrl = "https://api.acta.link/transaction/v1/";
1717
1717
  var depositServiceUrl = "https://api.acta.link/deposit/v1/";
1718
+ var transactionServiceTestUrl = "https://api.acta.link/transaction/test/v1/";
1719
+ var depositServiceTestUrl = "https://api.acta.link/deposit/test/v1/";
1720
+ var returnEnvUrl = (chainId) => {
1721
+ const mainnetChain = mainnetChains.find((c) => c.id === chainId);
1722
+ const testnetChain = testnetChains.find((c) => c.id === chainId);
1723
+ if (!mainnetChain && !testnetChain) {
1724
+ throw new Error(`Chain ${chainId} not supported.`);
1725
+ }
1726
+ if (mainnetChain) {
1727
+ return {
1728
+ envTransactionServiceUrl: transactionServiceUrl,
1729
+ envDepositServiceUrl: depositServiceUrl
1730
+ };
1731
+ } else {
1732
+ return {
1733
+ envTransactionServiceUrl: transactionServiceTestUrl,
1734
+ envDepositServiceUrl: depositServiceTestUrl
1735
+ };
1736
+ }
1737
+ };
1718
1738
  var ActaDeposit = class {
1719
1739
  constructor(parameters) {
1720
1740
  this.feeInclusive = false;
@@ -1768,9 +1788,10 @@ var ActaDeposit = class {
1768
1788
  if (this.paymentType === "recurring" && this.intervalUnit === void 0) {
1769
1789
  throw new Error("Interval unit is required for recurring payments.");
1770
1790
  }
1791
+ const { envDepositServiceUrl } = returnEnvUrl(this.chainId);
1771
1792
  if (this.depositSessionId !== "") {
1772
1793
  const session2 = yield verifySessionAPICall(
1773
- `${depositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1794
+ `${envDepositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1774
1795
  this.depositSessionId
1775
1796
  );
1776
1797
  this.depositSessionId = session2.sessionId;
@@ -1781,7 +1802,7 @@ var ActaDeposit = class {
1781
1802
  throw new Error("Token not supported.");
1782
1803
  }
1783
1804
  const session = yield createSessionAPICall(
1784
- `${depositServiceUrl}session`,
1805
+ `${envDepositServiceUrl}session`,
1785
1806
  {
1786
1807
  paymentParams: {
1787
1808
  signerAddress: this.signerAddress,
@@ -1882,13 +1903,6 @@ var ActaDeposit = class {
1882
1903
  if (!this.depositSessionId || this.depositSessionId === "") {
1883
1904
  throw new Error("Deposit session ID is required.");
1884
1905
  }
1885
- if (this.depositSessionId !== "") {
1886
- const session = yield verifySessionAPICall(
1887
- `${depositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1888
- this.depositSessionId
1889
- );
1890
- this.depositSessionId = session.sessionId;
1891
- }
1892
1906
  const signerAddress = this.signerAddress;
1893
1907
  const chainId = this.chainId;
1894
1908
  const tokenSymbol = this.token;
@@ -1896,6 +1910,14 @@ var ActaDeposit = class {
1896
1910
  const receiver = this.receiver;
1897
1911
  const feeInclusive = this.feeInclusive;
1898
1912
  const serviceType = this.serviceType;
1913
+ const { envTransactionServiceUrl } = returnEnvUrl(chainId);
1914
+ if (this.depositSessionId !== "") {
1915
+ const session = yield verifySessionAPICall(
1916
+ `${envTransactionServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1917
+ this.depositSessionId
1918
+ );
1919
+ this.depositSessionId = session.sessionId;
1920
+ }
1899
1921
  const token2 = getTokenByChainIdAndSymbol(chainId, tokenSymbol);
1900
1922
  if (!token2) {
1901
1923
  throw new Error("Token not supported.");
@@ -1911,7 +1933,7 @@ var ActaDeposit = class {
1911
1933
  feebps: 10
1912
1934
  });
1913
1935
  const txn = yield executeSinglePaymentAPICall(
1914
- `${transactionServiceUrl}execute/single`,
1936
+ `${envTransactionServiceUrl}execute/single`,
1915
1937
  rpcParameters,
1916
1938
  {
1917
1939
  senderAddress: signerAddress,
@@ -1965,13 +1987,6 @@ var ActaDeposit = class {
1965
1987
  if (!this.walletClient) {
1966
1988
  throw new Error("Signer is required for self custody payments.");
1967
1989
  }
1968
- if (this.depositSessionId !== "") {
1969
- const session = yield verifySessionAPICall(
1970
- `${depositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1971
- this.depositSessionId
1972
- );
1973
- this.depositSessionId = session.sessionId;
1974
- }
1975
1990
  const signerAddress = this.signerAddress;
1976
1991
  const chainId = this.chainId;
1977
1992
  const tokenSymbol = this.token;
@@ -1983,6 +1998,14 @@ var ActaDeposit = class {
1983
1998
  const startDate = this.startDate;
1984
1999
  const endDate = this.endDate;
1985
2000
  const serviceType = this.serviceType;
2001
+ const { envTransactionServiceUrl, envDepositServiceUrl } = returnEnvUrl(chainId);
2002
+ if (this.depositSessionId !== "") {
2003
+ const session = yield verifySessionAPICall(
2004
+ `${envDepositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
2005
+ this.depositSessionId
2006
+ );
2007
+ this.depositSessionId = session.sessionId;
2008
+ }
1986
2009
  const token2 = getTokenByChainIdAndSymbol(chainId, tokenSymbol);
1987
2010
  if (!token2) {
1988
2011
  throw new Error("Token not supported.");
@@ -2005,7 +2028,7 @@ var ActaDeposit = class {
2005
2028
  feebps: 20
2006
2029
  });
2007
2030
  const txn = yield scheduleRecurringPaymentsAPICall(
2008
- `${transactionServiceUrl}schedule/recurring`,
2031
+ `${envTransactionServiceUrl}schedule/recurring`,
2009
2032
  {
2010
2033
  amount,
2011
2034
  amountExclusive,
@@ -2064,6 +2087,26 @@ var ActaDeposit = class {
2064
2087
  // src/billing.ts
2065
2088
  import { toHex as toHex3 } from "viem";
2066
2089
  var transactionServiceUrl2 = "https://api.acta.link/transaction/v1/";
2090
+ var billingServiceUrl = "https://api.acta.link/billing/v1/";
2091
+ var transactionServiceTestUrl2 = "https://api.acta.link/transaction/test/v1/";
2092
+ var returnEnvUrl2 = (chainId) => {
2093
+ const mainnetChain = mainnetChains.find((c) => c.id === chainId);
2094
+ const testnetChain = testnetChains.find((c) => c.id === chainId);
2095
+ if (!mainnetChain && !testnetChain) {
2096
+ throw new Error(`Chain ${chainId} not supported.`);
2097
+ }
2098
+ if (mainnetChain) {
2099
+ return {
2100
+ envTransactionServiceUrl: transactionServiceUrl2,
2101
+ envBillingServiceUrl: billingServiceUrl
2102
+ };
2103
+ } else {
2104
+ return {
2105
+ envTransactionServiceUrl: transactionServiceTestUrl2,
2106
+ envBillingServiceUrl: billingServiceUrl
2107
+ };
2108
+ }
2109
+ };
2067
2110
  var ActaBilling = class {
2068
2111
  constructor(parameters) {
2069
2112
  this.feeInclusive = true;
@@ -2150,6 +2193,7 @@ var ActaBilling = class {
2150
2193
  if (!token2) {
2151
2194
  throw new Error("Token not supported.");
2152
2195
  }
2196
+ const { envTransactionServiceUrl } = returnEnvUrl2(chainId);
2153
2197
  const rpcParameters = yield this.account.signSinglePaymentOperation({
2154
2198
  signerAddress,
2155
2199
  chainId,
@@ -2161,7 +2205,7 @@ var ActaBilling = class {
2161
2205
  feebps: 20
2162
2206
  });
2163
2207
  const txn = yield executeSinglePaymentAPICall(
2164
- `${transactionServiceUrl2}execute/single`,
2208
+ `${envTransactionServiceUrl}execute/single`,
2165
2209
  rpcParameters,
2166
2210
  {
2167
2211
  senderAddress: signerAddress,
@@ -2212,6 +2256,7 @@ var ActaBilling = class {
2212
2256
  if (!chainId || !count || !intervalUnit || !startDate || !endDate) {
2213
2257
  throw new Error("Invalid parameters.");
2214
2258
  }
2259
+ const { envTransactionServiceUrl } = returnEnvUrl2(chainId);
2215
2260
  const { approval, amountExclusive } = yield this.account.signRecurringPayments({
2216
2261
  signerAddress,
2217
2262
  chainId,
@@ -2227,7 +2272,7 @@ var ActaBilling = class {
2227
2272
  feebps: 20
2228
2273
  });
2229
2274
  const txn = yield scheduleRecurringPaymentsAPICall(
2230
- `${transactionServiceUrl2}schedule/recurring`,
2275
+ `${envTransactionServiceUrl}schedule/recurring`,
2231
2276
  {
2232
2277
  amount,
2233
2278
  amountExclusive,
@@ -2292,9 +2337,9 @@ import {
2292
2337
  } from "viem";
2293
2338
  var transactionServiceUrl3 = "https://api.acta.link/transaction/v1/";
2294
2339
  var batchServiceUrl = "https://api.acta.link/batch/api/v1/";
2295
- var transactionServiceTestUrl = "https://api.acta.link/transaction/test/v1/";
2340
+ var transactionServiceTestUrl3 = "https://api.acta.link/transaction/test/v1/";
2296
2341
  var batchServiceTestUrl = "https://api.acta.link/batch/test/api/v1/";
2297
- var returnEnvUrl = (chainId) => {
2342
+ var returnEnvUrl3 = (chainId) => {
2298
2343
  const mainnetChain = mainnetChains.find((c) => c.id === chainId);
2299
2344
  const testnetChain = testnetChains.find((c) => c.id === chainId);
2300
2345
  if (!mainnetChain && !testnetChain) {
@@ -2307,7 +2352,7 @@ var returnEnvUrl = (chainId) => {
2307
2352
  };
2308
2353
  } else {
2309
2354
  return {
2310
- envTransactionServiceUrl: transactionServiceTestUrl,
2355
+ envTransactionServiceUrl: transactionServiceTestUrl3,
2311
2356
  envBatchServiceUrl: batchServiceTestUrl
2312
2357
  };
2313
2358
  }
@@ -2336,7 +2381,7 @@ var ActaBatch = class {
2336
2381
  if (!instructionId || instructionId === "") {
2337
2382
  throw new Error("Instruction id is required");
2338
2383
  }
2339
- const { envBatchServiceUrl } = returnEnvUrl(chainId);
2384
+ const { envBatchServiceUrl } = returnEnvUrl3(chainId);
2340
2385
  const session = yield createBatchSessionAPICall(
2341
2386
  `${envBatchServiceUrl}create/session`,
2342
2387
  this.APIkey,
@@ -2377,7 +2422,7 @@ var ActaBatch = class {
2377
2422
  if (feeInclusive) {
2378
2423
  isFeeInclusive = true;
2379
2424
  }
2380
- const { envBatchServiceUrl } = returnEnvUrl(chainId);
2425
+ const { envBatchServiceUrl } = returnEnvUrl3(chainId);
2381
2426
  const instuctionData = yield fetchBatchInstructionDetails(
2382
2427
  `${envBatchServiceUrl}instruction/${instructionId}`,
2383
2428
  this.APIkey
@@ -2463,7 +2508,7 @@ var ActaBatch = class {
2463
2508
  if (feeInclusive) {
2464
2509
  isFeeInclusive = true;
2465
2510
  }
2466
- const { envBatchServiceUrl } = returnEnvUrl(chainId);
2511
+ const { envBatchServiceUrl } = returnEnvUrl3(chainId);
2467
2512
  const instuctionData = yield fetchBatchInstructionDetails(
2468
2513
  `${envBatchServiceUrl}instruction/${instructionId}`,
2469
2514
  this.APIkey
@@ -2552,7 +2597,7 @@ var ActaBatch = class {
2552
2597
  if (feeInclusive) {
2553
2598
  isFeeInclusive = true;
2554
2599
  }
2555
- const { envBatchServiceUrl } = returnEnvUrl(chainId);
2600
+ const { envBatchServiceUrl } = returnEnvUrl3(chainId);
2556
2601
  if (executionTime <= Date.now() + 1e3 * 60 * 2) {
2557
2602
  throw new Error(
2558
2603
  "Execution time must be more than 5 mins from current time."
@@ -2795,7 +2840,7 @@ import {
2795
2840
  } from "@zerodev/permissions/policies";
2796
2841
  import { coerce, gt } from "semver";
2797
2842
  var ECDSA_SIGNER_CONTRACT = "0x6A6F069E2a08c2468e7724Ab3250CdBFBA14D4FF";
2798
- var billingServiceUrl = "https://api.acta.link/billing/v1/";
2843
+ var billingServiceUrl2 = "https://api.acta.link/billing/v1/";
2799
2844
  var depositServiceUrl2 = "https://api.acta.link/deposit/v1/";
2800
2845
  var transactionServiceUrl4 = "https://api.acta.link/transaction/v1/";
2801
2846
  var toSignerId = (signer) => {
@@ -3137,7 +3182,7 @@ var createBillingCheckoutSession = (serviceSessionparams) => __async(null, null,
3137
3182
  var _a, _b, _c, _d;
3138
3183
  try {
3139
3184
  const sessionData = yield createBillingSessionAPICall(
3140
- `${billingServiceUrl}paysession/create`,
3185
+ `${billingServiceUrl2}paysession/create`,
3141
3186
  {
3142
3187
  paylinkId: serviceSessionparams.paylinkId,
3143
3188
  mode: serviceSessionparams.mode,
@@ -3162,7 +3207,7 @@ var getBillingPaymentSessionDetails = (serviceSessionparams) => __async(null, nu
3162
3207
  throw new Error("checkout session ID is required.");
3163
3208
  }
3164
3209
  const sessionData = yield fetchBillingSessionDetails(
3165
- `${billingServiceUrl}paysession?checkoutSessionId=${serviceSessionparams.checkoutSessionId}`
3210
+ `${billingServiceUrl2}paysession?checkoutSessionId=${serviceSessionparams.checkoutSessionId}`
3166
3211
  );
3167
3212
  return sessionData;
3168
3213
  });
@@ -3175,7 +3220,7 @@ var cancelRecurringTransaction = (_0) => __async(null, [_0], function* ({
3175
3220
  if (serviceType !== "billing" && serviceType !== "deposit")
3176
3221
  throw new Error("service is not compatible");
3177
3222
  const response = yield fetchRecurringTransactionWithId(
3178
- `${serviceType === "billing" ? billingServiceUrl : depositServiceUrl2}customer/payment/recurring/info?id=${paymentId}`
3223
+ `${serviceType === "billing" ? billingServiceUrl2 : depositServiceUrl2}customer/payment/recurring/info?id=${paymentId}`
3179
3224
  );
3180
3225
  if (response) {
3181
3226
  const viemClient = new ViemClient(chainId, walletClient);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actalink/commonlib",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "author": "Actalink",
5
5
  "license": "MIT license",
6
6
  "publishConfig": {