@actalink/sdkv2 0.1.6 → 0.1.7-dev2

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
@@ -58,8 +58,8 @@ var __async = (__this, __arguments, generator) => {
58
58
  var index_exports = {};
59
59
  __export(index_exports, {
60
60
  ActaAccount: () => ActaAccount,
61
- ActaFlexSDK: () => ActaFlexSDK,
62
61
  HttpMethod: () => HttpMethod,
62
+ OpendepositSDK: () => OpendepositSDK,
63
63
  ViemClient: () => ViemClient,
64
64
  arbitrumDAI: () => arbitrumDAI,
65
65
  arbitrumETH: () => arbitrumETH,
@@ -188,7 +188,7 @@ var ProviderConfigSchema = import_zod.z.object({
188
188
  apiKey: import_zod.z.string().min(1, "API key is required"),
189
189
  url: import_zod.z.string().url().optional()
190
190
  });
191
- var ActaAccessConfigSchema = import_zod.z.object({
191
+ var OpendepositConfigSchema = import_zod.z.object({
192
192
  projectId: import_zod.z.string().min(1, "projectId is required")
193
193
  });
194
194
  var CreateSinglePaymentSchema = import_zod.z.object({
@@ -814,8 +814,8 @@ var import_permissions = require("@zerodev/permissions");
814
814
  var import_policies = require("@zerodev/permissions/policies");
815
815
 
816
816
  // src/constants.ts
817
- var ACCESS_URL = "https://flex-api.acta.link/flex/deposit";
818
- var ACCESS_TESTNET_URL = "https://flex-api.acta.link/flex/deposit/test";
817
+ var OPENDEPOSIT_URL = "https://api.opendeposit.xyz/flex/deposit";
818
+ var OPENDEPOSIT_TESTNET_URL = "https://api.opendeposit.xyz/flex/deposit/test";
819
819
  var PAYMASTER_URL = `https://api.acta.link/paymaster/flex/deposit`;
820
820
  var PROXY_URL = `https://api.acta.link/proxy/v1`;
821
821
 
@@ -840,7 +840,7 @@ var ActaAccount = class {
840
840
  },
841
841
  entryPoint,
842
842
  kernelVersion,
843
- index: BigInt("flex-deposit".length)
843
+ index: BigInt("open-deposit".length)
844
844
  });
845
845
  return account;
846
846
  });
@@ -918,6 +918,7 @@ var ActaAccount = class {
918
918
  throw new Error("Token not found.");
919
919
  }
920
920
  const userOperation = yield accountClient.prepareUserOperation({
921
+ account,
921
922
  calls: [
922
923
  {
923
924
  to: (0, import_viem4.getAddress)(token2.address),
@@ -1025,6 +1026,7 @@ var ActaAccount = class {
1025
1026
  allowMaxTokenApproval != null ? allowMaxTokenApproval : false
1026
1027
  );
1027
1028
  const userOperation = yield accountClient.prepareUserOperation({
1029
+ account,
1028
1030
  calls: [
1029
1031
  {
1030
1032
  to: (0, import_viem4.getAddress)(token2.address),
@@ -1312,7 +1314,7 @@ function waitForPaymentStatus(url, id, intervalMs = 2e3) {
1312
1314
  });
1313
1315
  }
1314
1316
 
1315
- // src/execution/access.ts
1317
+ // src/execution/opendeposit.ts
1316
1318
  var import_viem5 = require("viem");
1317
1319
  var returnEnvUrl = (chainId) => {
1318
1320
  const mainnetChain = mainnetChains.find((c) => c.id === chainId);
@@ -1322,11 +1324,11 @@ var returnEnvUrl = (chainId) => {
1322
1324
  }
1323
1325
  if (mainnetChain) {
1324
1326
  return {
1325
- envAccessURL: ACCESS_URL
1327
+ envOpendepositURL: OPENDEPOSIT_URL
1326
1328
  };
1327
1329
  } else {
1328
1330
  return {
1329
- envAccessURL: ACCESS_TESTNET_URL
1331
+ envOpendepositURL: OPENDEPOSIT_TESTNET_URL
1330
1332
  };
1331
1333
  }
1332
1334
  };
@@ -1387,7 +1389,7 @@ function createOnetimePaymentInternal(parameters, projectId) {
1387
1389
  if (!token2) {
1388
1390
  throw new Error("Token not supported.");
1389
1391
  }
1390
- const { envAccessURL } = returnEnvUrl(chainId);
1392
+ const { envOpendepositURL } = returnEnvUrl(chainId);
1391
1393
  const accountInstance = new ActaAccount(publicClient, walletClient);
1392
1394
  const rpcParameters = yield accountInstance.signSinglePaymentOperation(
1393
1395
  {
@@ -1405,7 +1407,7 @@ function createOnetimePaymentInternal(parameters, projectId) {
1405
1407
  projectId
1406
1408
  );
1407
1409
  const data = yield executeSinglePaymentAPICall(
1408
- `${envAccessURL}/api/v1/execute/single`,
1410
+ `${envOpendepositURL}/api/v1/execute/single`,
1409
1411
  rpcParameters,
1410
1412
  {
1411
1413
  amount: (0, import_viem5.toHex)(amount),
@@ -1439,7 +1441,7 @@ function createRecurringePaymentInternal(parameters, projectId) {
1439
1441
  if (!token2) {
1440
1442
  throw new Error("Token not supported.");
1441
1443
  }
1442
- const { envAccessURL } = returnEnvUrl(chainId);
1444
+ const { envOpendepositURL } = returnEnvUrl(chainId);
1443
1445
  const accountInstance = new ActaAccount(publicClient, walletClient);
1444
1446
  const { approval, amountExclusive } = yield accountInstance.signRecurringPayments(
1445
1447
  {
@@ -1460,7 +1462,7 @@ function createRecurringePaymentInternal(parameters, projectId) {
1460
1462
  );
1461
1463
  const startAt = Math.floor(Date.now() / 1e3) + 2 * 60;
1462
1464
  const data = yield scheduleRecurringPaymentsAPICall(
1463
- `${envAccessURL}/api/v1/schedule/recurring`,
1465
+ `${envOpendepositURL}/api/v1/schedule/recurring`,
1464
1466
  {
1465
1467
  senderAddress: signerAddress,
1466
1468
  receiverAddress: receiver,
@@ -1481,8 +1483,8 @@ function createRecurringePaymentInternal(parameters, projectId) {
1481
1483
  });
1482
1484
  }
1483
1485
 
1484
- // src/flex.ts
1485
- var ActaFlexSDK = class {
1486
+ // src/opendeposit.ts
1487
+ var OpendepositSDK = class {
1486
1488
  constructor(parameters) {
1487
1489
  this.projectId = parameters.projectId;
1488
1490
  }
@@ -1538,7 +1540,7 @@ var ActaFlexSDK = class {
1538
1540
  const result = PollPaymentStatusSchema.parse({ id });
1539
1541
  const envType = id.split("_")[1];
1540
1542
  return yield waitForPaymentStatus(
1541
- `${envType !== "test" ? ACCESS_URL : ACCESS_TESTNET_URL}/api/v1/payment/status`,
1543
+ `${envType !== "test" ? OPENDEPOSIT_URL : OPENDEPOSIT_TESTNET_URL}/api/v1/payment/status`,
1542
1544
  result.id,
1543
1545
  intervalMs
1544
1546
  );
@@ -1554,8 +1556,8 @@ var ActaFlexSDK = class {
1554
1556
  // Annotate the CommonJS export names for ESM import in node:
1555
1557
  0 && (module.exports = {
1556
1558
  ActaAccount,
1557
- ActaFlexSDK,
1558
1559
  HttpMethod,
1560
+ OpendepositSDK,
1559
1561
  ViemClient,
1560
1562
  arbitrumDAI,
1561
1563
  arbitrumETH,