@actalink/commonlib 0.0.38-dev → 0.0.38
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 +28 -13
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +28 -13
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2153,8 +2153,8 @@ var ActaDeposit = class {
|
|
|
2153
2153
|
|
|
2154
2154
|
// src/billing.ts
|
|
2155
2155
|
var import_viem6 = require("viem");
|
|
2156
|
-
var billingServiceUrl = "https://api.
|
|
2157
|
-
var billingServiceTestUrl = "https://api.
|
|
2156
|
+
var billingServiceUrl = "https://api.acta.link/pay/api/v1/";
|
|
2157
|
+
var billingServiceTestUrl = "https://api.acta.link/pay/test/api/v1/";
|
|
2158
2158
|
var returnEnvUrl2 = (chainId) => {
|
|
2159
2159
|
const mainnetChain = mainnetChains.find((c) => c.id === chainId);
|
|
2160
2160
|
const testnetChain = testnetChains.find((c) => c.id === chainId);
|
|
@@ -2394,8 +2394,8 @@ var ActaBilling = class {
|
|
|
2394
2394
|
|
|
2395
2395
|
// src/batch.ts
|
|
2396
2396
|
var import_viem7 = require("viem");
|
|
2397
|
-
var batchServiceUrl = "https://api.
|
|
2398
|
-
var batchServiceTestUrl = "https://api.
|
|
2397
|
+
var batchServiceUrl = "https://api.acta.link/bexo/api/v1/";
|
|
2398
|
+
var batchServiceTestUrl = "https://api.acta.link/bexo/test/api/v1/";
|
|
2399
2399
|
var returnEnvUrl3 = (chainId) => {
|
|
2400
2400
|
const mainnetChain = mainnetChains.find((c) => c.id === chainId);
|
|
2401
2401
|
const testnetChain = testnetChains.find((c) => c.id === chainId);
|
|
@@ -2863,10 +2863,10 @@ var import_account_abstraction2 = require("viem/account-abstraction");
|
|
|
2863
2863
|
var import_policies2 = require("@zerodev/permissions/policies");
|
|
2864
2864
|
var import_semver = require("semver");
|
|
2865
2865
|
var ECDSA_SIGNER_CONTRACT = "0x6A6F069E2a08c2468e7724Ab3250CdBFBA14D4FF";
|
|
2866
|
-
var billingServiceUrl2 = "https://api.
|
|
2866
|
+
var billingServiceUrl2 = "https://api.acta.link/pay/v1/";
|
|
2867
2867
|
var depositServiceUrl2 = "https://api.acta.link/bexo/v1/";
|
|
2868
|
-
var transactionServiceUrl2 = "https://api.
|
|
2869
|
-
var billingServiceTestUrl2 = "https://api.
|
|
2868
|
+
var transactionServiceUrl2 = "https://api.acta.link/transaction/v1/";
|
|
2869
|
+
var billingServiceTestUrl2 = "https://api.acta.link/pay/test/v1/";
|
|
2870
2870
|
var toSignerId = (signer) => {
|
|
2871
2871
|
return (0, import_viem8.encodeAbiParameters)(
|
|
2872
2872
|
[{ name: "signerData", type: "bytes" }],
|
|
@@ -3186,21 +3186,36 @@ var decodeParamsFromInitCode = (initCode, kernelVersion) => {
|
|
|
3186
3186
|
throw new Error("Invalid initCode");
|
|
3187
3187
|
return { index, validatorInitData, useMetaFactory };
|
|
3188
3188
|
};
|
|
3189
|
-
var getPeriodInterval = (periodUnit) => {
|
|
3189
|
+
var getPeriodInterval = (periodUnit, currentDate = /* @__PURE__ */ new Date(), count = 1) => {
|
|
3190
|
+
const nextDate = new Date(currentDate);
|
|
3191
|
+
const c = count;
|
|
3190
3192
|
switch (periodUnit) {
|
|
3191
3193
|
case "5mins":
|
|
3192
|
-
|
|
3194
|
+
nextDate.setMinutes(nextDate.getMinutes() + 5 * c);
|
|
3195
|
+
break;
|
|
3193
3196
|
case "day":
|
|
3194
|
-
|
|
3197
|
+
nextDate.setDate(nextDate.getDate() + 1 * c);
|
|
3198
|
+
break;
|
|
3195
3199
|
case "week":
|
|
3196
|
-
|
|
3200
|
+
nextDate.setDate(nextDate.getDate() + 7 * c);
|
|
3201
|
+
break;
|
|
3197
3202
|
case "month":
|
|
3198
|
-
|
|
3203
|
+
nextDate.setMonth(nextDate.getMonth() + 1 * c);
|
|
3204
|
+
break;
|
|
3205
|
+
case "quarter":
|
|
3206
|
+
nextDate.setMonth(nextDate.getMonth() + 3 * c);
|
|
3207
|
+
break;
|
|
3208
|
+
case "halfyear":
|
|
3209
|
+
nextDate.setMonth(nextDate.getMonth() + 6 * c);
|
|
3210
|
+
break;
|
|
3199
3211
|
case "year":
|
|
3200
|
-
|
|
3212
|
+
nextDate.setFullYear(nextDate.getFullYear() + 1 * c);
|
|
3213
|
+
break;
|
|
3201
3214
|
default:
|
|
3202
3215
|
throw new Error("Invalid period unit");
|
|
3203
3216
|
}
|
|
3217
|
+
const milliSeconds = nextDate.getTime();
|
|
3218
|
+
return { milliSeconds, nextDate };
|
|
3204
3219
|
};
|
|
3205
3220
|
var createBillingCheckoutSession = (serviceSessionparams) => __async(null, null, function* () {
|
|
3206
3221
|
var _a, _b, _c, _d;
|
package/dist/index.d.cts
CHANGED
|
@@ -5038,6 +5038,10 @@ declare class ActaAccount {
|
|
|
5038
5038
|
}): Promise<RpcUserOperation>;
|
|
5039
5039
|
}
|
|
5040
5040
|
|
|
5041
|
+
interface PeriodIntervalResult {
|
|
5042
|
+
milliSeconds: number;
|
|
5043
|
+
nextDate: Date;
|
|
5044
|
+
}
|
|
5041
5045
|
declare const toSignerId: (signer: ModularSigner) => Hex;
|
|
5042
5046
|
declare function toECDSASigner(signer: Signer, signerContractAddress?: `0x${string}`): Promise<ModularSigner>;
|
|
5043
5047
|
declare const toPolicyId: (policies: Policy[]) => Hex;
|
|
@@ -5059,7 +5063,7 @@ declare const decodeParamsFromInitCode: (initCode: Hex, kernelVersion: KERNEL_VE
|
|
|
5059
5063
|
validatorInitData: ValidatorInitData;
|
|
5060
5064
|
useMetaFactory: boolean;
|
|
5061
5065
|
};
|
|
5062
|
-
declare const getPeriodInterval: (periodUnit:
|
|
5066
|
+
declare const getPeriodInterval: (periodUnit: "5mins" | "day" | "week" | "month" | "quarter" | "halfyear" | "year", currentDate?: Date, count?: number) => PeriodIntervalResult;
|
|
5063
5067
|
declare const createBillingCheckoutSession: (serviceSessionparams: {
|
|
5064
5068
|
paylinkId: string;
|
|
5065
5069
|
mode: "paylink";
|
package/dist/index.d.ts
CHANGED
|
@@ -5038,6 +5038,10 @@ declare class ActaAccount {
|
|
|
5038
5038
|
}): Promise<RpcUserOperation>;
|
|
5039
5039
|
}
|
|
5040
5040
|
|
|
5041
|
+
interface PeriodIntervalResult {
|
|
5042
|
+
milliSeconds: number;
|
|
5043
|
+
nextDate: Date;
|
|
5044
|
+
}
|
|
5041
5045
|
declare const toSignerId: (signer: ModularSigner) => Hex;
|
|
5042
5046
|
declare function toECDSASigner(signer: Signer, signerContractAddress?: `0x${string}`): Promise<ModularSigner>;
|
|
5043
5047
|
declare const toPolicyId: (policies: Policy[]) => Hex;
|
|
@@ -5059,7 +5063,7 @@ declare const decodeParamsFromInitCode: (initCode: Hex, kernelVersion: KERNEL_VE
|
|
|
5059
5063
|
validatorInitData: ValidatorInitData;
|
|
5060
5064
|
useMetaFactory: boolean;
|
|
5061
5065
|
};
|
|
5062
|
-
declare const getPeriodInterval: (periodUnit:
|
|
5066
|
+
declare const getPeriodInterval: (periodUnit: "5mins" | "day" | "week" | "month" | "quarter" | "halfyear" | "year", currentDate?: Date, count?: number) => PeriodIntervalResult;
|
|
5063
5067
|
declare const createBillingCheckoutSession: (serviceSessionparams: {
|
|
5064
5068
|
paylinkId: string;
|
|
5065
5069
|
mode: "paylink";
|
package/dist/index.js
CHANGED
|
@@ -2080,8 +2080,8 @@ var ActaDeposit = class {
|
|
|
2080
2080
|
|
|
2081
2081
|
// src/billing.ts
|
|
2082
2082
|
import { toHex as toHex3 } from "viem";
|
|
2083
|
-
var billingServiceUrl = "https://api.
|
|
2084
|
-
var billingServiceTestUrl = "https://api.
|
|
2083
|
+
var billingServiceUrl = "https://api.acta.link/pay/api/v1/";
|
|
2084
|
+
var billingServiceTestUrl = "https://api.acta.link/pay/test/api/v1/";
|
|
2085
2085
|
var returnEnvUrl2 = (chainId) => {
|
|
2086
2086
|
const mainnetChain = mainnetChains.find((c) => c.id === chainId);
|
|
2087
2087
|
const testnetChain = testnetChains.find((c) => c.id === chainId);
|
|
@@ -2326,8 +2326,8 @@ import {
|
|
|
2326
2326
|
toHex as toHex4,
|
|
2327
2327
|
zeroAddress as zeroAddress4
|
|
2328
2328
|
} from "viem";
|
|
2329
|
-
var batchServiceUrl = "https://api.
|
|
2330
|
-
var batchServiceTestUrl = "https://api.
|
|
2329
|
+
var batchServiceUrl = "https://api.acta.link/bexo/api/v1/";
|
|
2330
|
+
var batchServiceTestUrl = "https://api.acta.link/bexo/test/api/v1/";
|
|
2331
2331
|
var returnEnvUrl3 = (chainId) => {
|
|
2332
2332
|
const mainnetChain = mainnetChains.find((c) => c.id === chainId);
|
|
2333
2333
|
const testnetChain = testnetChains.find((c) => c.id === chainId);
|
|
@@ -2826,10 +2826,10 @@ import {
|
|
|
2826
2826
|
} from "@zerodev/permissions/policies";
|
|
2827
2827
|
import { coerce, gt } from "semver";
|
|
2828
2828
|
var ECDSA_SIGNER_CONTRACT = "0x6A6F069E2a08c2468e7724Ab3250CdBFBA14D4FF";
|
|
2829
|
-
var billingServiceUrl2 = "https://api.
|
|
2829
|
+
var billingServiceUrl2 = "https://api.acta.link/pay/v1/";
|
|
2830
2830
|
var depositServiceUrl2 = "https://api.acta.link/bexo/v1/";
|
|
2831
|
-
var transactionServiceUrl2 = "https://api.
|
|
2832
|
-
var billingServiceTestUrl2 = "https://api.
|
|
2831
|
+
var transactionServiceUrl2 = "https://api.acta.link/transaction/v1/";
|
|
2832
|
+
var billingServiceTestUrl2 = "https://api.acta.link/pay/test/v1/";
|
|
2833
2833
|
var toSignerId = (signer) => {
|
|
2834
2834
|
return encodeAbiParameters(
|
|
2835
2835
|
[{ name: "signerData", type: "bytes" }],
|
|
@@ -3149,21 +3149,36 @@ var decodeParamsFromInitCode = (initCode, kernelVersion) => {
|
|
|
3149
3149
|
throw new Error("Invalid initCode");
|
|
3150
3150
|
return { index, validatorInitData, useMetaFactory };
|
|
3151
3151
|
};
|
|
3152
|
-
var getPeriodInterval = (periodUnit) => {
|
|
3152
|
+
var getPeriodInterval = (periodUnit, currentDate = /* @__PURE__ */ new Date(), count = 1) => {
|
|
3153
|
+
const nextDate = new Date(currentDate);
|
|
3154
|
+
const c = count;
|
|
3153
3155
|
switch (periodUnit) {
|
|
3154
3156
|
case "5mins":
|
|
3155
|
-
|
|
3157
|
+
nextDate.setMinutes(nextDate.getMinutes() + 5 * c);
|
|
3158
|
+
break;
|
|
3156
3159
|
case "day":
|
|
3157
|
-
|
|
3160
|
+
nextDate.setDate(nextDate.getDate() + 1 * c);
|
|
3161
|
+
break;
|
|
3158
3162
|
case "week":
|
|
3159
|
-
|
|
3163
|
+
nextDate.setDate(nextDate.getDate() + 7 * c);
|
|
3164
|
+
break;
|
|
3160
3165
|
case "month":
|
|
3161
|
-
|
|
3166
|
+
nextDate.setMonth(nextDate.getMonth() + 1 * c);
|
|
3167
|
+
break;
|
|
3168
|
+
case "quarter":
|
|
3169
|
+
nextDate.setMonth(nextDate.getMonth() + 3 * c);
|
|
3170
|
+
break;
|
|
3171
|
+
case "halfyear":
|
|
3172
|
+
nextDate.setMonth(nextDate.getMonth() + 6 * c);
|
|
3173
|
+
break;
|
|
3162
3174
|
case "year":
|
|
3163
|
-
|
|
3175
|
+
nextDate.setFullYear(nextDate.getFullYear() + 1 * c);
|
|
3176
|
+
break;
|
|
3164
3177
|
default:
|
|
3165
3178
|
throw new Error("Invalid period unit");
|
|
3166
3179
|
}
|
|
3180
|
+
const milliSeconds = nextDate.getTime();
|
|
3181
|
+
return { milliSeconds, nextDate };
|
|
3167
3182
|
};
|
|
3168
3183
|
var createBillingCheckoutSession = (serviceSessionparams) => __async(null, null, function* () {
|
|
3169
3184
|
var _a, _b, _c, _d;
|