@actalink/commonlib 0.0.20 → 0.0.22

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
@@ -1983,10 +1983,10 @@ var ActaDeposit = class {
1983
1983
  const receiver = this.receiver;
1984
1984
  const feeInclusive = this.feeInclusive;
1985
1985
  const serviceType = this.serviceType;
1986
- const { envTransactionServiceUrl } = returnEnvUrl(chainId);
1986
+ const { envTransactionServiceUrl, envDepositServiceUrl } = returnEnvUrl(chainId);
1987
1987
  if (this.depositSessionId !== "") {
1988
1988
  const session = yield verifySessionAPICall(
1989
- `${envTransactionServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1989
+ `${envDepositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1990
1990
  this.depositSessionId
1991
1991
  );
1992
1992
  this.depositSessionId = session.sessionId;
@@ -2880,6 +2880,7 @@ var ECDSA_SIGNER_CONTRACT = "0x6A6F069E2a08c2468e7724Ab3250CdBFBA14D4FF";
2880
2880
  var billingServiceUrl2 = "https://api.acta.link/billing/v1/";
2881
2881
  var depositServiceUrl2 = "https://api.acta.link/deposit/v1/";
2882
2882
  var transactionServiceUrl4 = "https://api.acta.link/transaction/v1/";
2883
+ var billingServiceTestUrl = "https://api.acta.link/billing/test/v1/";
2883
2884
  var toSignerId = (signer) => {
2884
2885
  return (0, import_viem8.encodeAbiParameters)(
2885
2886
  [{ name: "signerData", type: "bytes" }],
@@ -3219,7 +3220,7 @@ var createBillingCheckoutSession = (serviceSessionparams) => __async(null, null,
3219
3220
  var _a, _b, _c, _d;
3220
3221
  try {
3221
3222
  const sessionData = yield createBillingSessionAPICall(
3222
- `${billingServiceUrl2}paysession/create`,
3223
+ `${serviceSessionparams.env === "mainnet" ? billingServiceUrl2 : billingServiceTestUrl}paysession/create`,
3223
3224
  {
3224
3225
  paylinkId: serviceSessionparams.paylinkId,
3225
3226
  mode: serviceSessionparams.mode,
@@ -3244,7 +3245,7 @@ var getBillingPaymentSessionDetails = (serviceSessionparams) => __async(null, nu
3244
3245
  throw new Error("checkout session ID is required.");
3245
3246
  }
3246
3247
  const sessionData = yield fetchBillingSessionDetails(
3247
- `${billingServiceUrl2}paysession?checkoutSessionId=${serviceSessionparams.checkoutSessionId}`
3248
+ `${serviceSessionparams.env === "mainnet" ? billingServiceUrl2 : billingServiceTestUrl}paysession?checkoutSessionId=${serviceSessionparams.checkoutSessionId}`
3248
3249
  );
3249
3250
  return sessionData;
3250
3251
  });
package/dist/index.d.cts CHANGED
@@ -5067,9 +5067,11 @@ declare const createBillingCheckoutSession: (serviceSessionparams: {
5067
5067
  cancelUrl?: string;
5068
5068
  failureUrl?: string;
5069
5069
  metadata?: Record<string, string>;
5070
+ env: "mainnet" | "testnet";
5070
5071
  }) => Promise<any>;
5071
5072
  declare const getBillingPaymentSessionDetails: (serviceSessionparams: {
5072
5073
  checkoutSessionId: string;
5074
+ env: "mainnet" | "testnet";
5073
5075
  }) => Promise<any>;
5074
5076
  declare const cancelRecurringTransaction: ({ serviceType, paymentId, chainId, walletClient, }: {
5075
5077
  serviceType: "deposit" | "billing";
package/dist/index.d.ts CHANGED
@@ -5067,9 +5067,11 @@ declare const createBillingCheckoutSession: (serviceSessionparams: {
5067
5067
  cancelUrl?: string;
5068
5068
  failureUrl?: string;
5069
5069
  metadata?: Record<string, string>;
5070
+ env: "mainnet" | "testnet";
5070
5071
  }) => Promise<any>;
5071
5072
  declare const getBillingPaymentSessionDetails: (serviceSessionparams: {
5072
5073
  checkoutSessionId: string;
5074
+ env: "mainnet" | "testnet";
5073
5075
  }) => Promise<any>;
5074
5076
  declare const cancelRecurringTransaction: ({ serviceType, paymentId, chainId, walletClient, }: {
5075
5077
  serviceType: "deposit" | "billing";
package/dist/index.js CHANGED
@@ -1910,10 +1910,10 @@ var ActaDeposit = class {
1910
1910
  const receiver = this.receiver;
1911
1911
  const feeInclusive = this.feeInclusive;
1912
1912
  const serviceType = this.serviceType;
1913
- const { envTransactionServiceUrl } = returnEnvUrl(chainId);
1913
+ const { envTransactionServiceUrl, envDepositServiceUrl } = returnEnvUrl(chainId);
1914
1914
  if (this.depositSessionId !== "") {
1915
1915
  const session = yield verifySessionAPICall(
1916
- `${envTransactionServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1916
+ `${envDepositServiceUrl}verify-session?sessionId=${this.depositSessionId}`,
1917
1917
  this.depositSessionId
1918
1918
  );
1919
1919
  this.depositSessionId = session.sessionId;
@@ -2843,6 +2843,7 @@ var ECDSA_SIGNER_CONTRACT = "0x6A6F069E2a08c2468e7724Ab3250CdBFBA14D4FF";
2843
2843
  var billingServiceUrl2 = "https://api.acta.link/billing/v1/";
2844
2844
  var depositServiceUrl2 = "https://api.acta.link/deposit/v1/";
2845
2845
  var transactionServiceUrl4 = "https://api.acta.link/transaction/v1/";
2846
+ var billingServiceTestUrl = "https://api.acta.link/billing/test/v1/";
2846
2847
  var toSignerId = (signer) => {
2847
2848
  return encodeAbiParameters(
2848
2849
  [{ name: "signerData", type: "bytes" }],
@@ -3182,7 +3183,7 @@ var createBillingCheckoutSession = (serviceSessionparams) => __async(null, null,
3182
3183
  var _a, _b, _c, _d;
3183
3184
  try {
3184
3185
  const sessionData = yield createBillingSessionAPICall(
3185
- `${billingServiceUrl2}paysession/create`,
3186
+ `${serviceSessionparams.env === "mainnet" ? billingServiceUrl2 : billingServiceTestUrl}paysession/create`,
3186
3187
  {
3187
3188
  paylinkId: serviceSessionparams.paylinkId,
3188
3189
  mode: serviceSessionparams.mode,
@@ -3207,7 +3208,7 @@ var getBillingPaymentSessionDetails = (serviceSessionparams) => __async(null, nu
3207
3208
  throw new Error("checkout session ID is required.");
3208
3209
  }
3209
3210
  const sessionData = yield fetchBillingSessionDetails(
3210
- `${billingServiceUrl2}paysession?checkoutSessionId=${serviceSessionparams.checkoutSessionId}`
3211
+ `${serviceSessionparams.env === "mainnet" ? billingServiceUrl2 : billingServiceTestUrl}paysession?checkoutSessionId=${serviceSessionparams.checkoutSessionId}`
3211
3212
  );
3212
3213
  return sessionData;
3213
3214
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actalink/commonlib",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "author": "Actalink",
5
5
  "license": "MIT license",
6
6
  "publishConfig": {