@actalink/commonlib 0.0.37-dev → 0.0.37
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 +29 -15
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +29 -15
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1239,7 +1239,7 @@ var ActaAccount = class {
|
|
|
1239
1239
|
signer: this.signer
|
|
1240
1240
|
}
|
|
1241
1241
|
);
|
|
1242
|
-
const sessionKeyAddress = "
|
|
1242
|
+
const sessionKeyAddress = "0x182f375CD15102B22A55702a516d36f8a6443E40";
|
|
1243
1243
|
const emptyAccount = (0, import_sdk.addressToEmptyAccount)(sessionKeyAddress);
|
|
1244
1244
|
const emptySessionKeySigner = yield (0, import_signers.toECDSASigner)({ signer: emptyAccount });
|
|
1245
1245
|
const {
|
|
@@ -1367,7 +1367,7 @@ var ActaAccount = class {
|
|
|
1367
1367
|
signer: this.signer
|
|
1368
1368
|
}
|
|
1369
1369
|
);
|
|
1370
|
-
const sessionKeyAddress = "
|
|
1370
|
+
const sessionKeyAddress = "0x182f375CD15102B22A55702a516d36f8a6443E40";
|
|
1371
1371
|
const emptyAccount = (0, import_sdk.addressToEmptyAccount)(sessionKeyAddress);
|
|
1372
1372
|
const emptySessionKeySigner = yield (0, import_signers.toECDSASigner)({ signer: emptyAccount });
|
|
1373
1373
|
const {
|
|
@@ -1473,7 +1473,7 @@ var ActaAccount = class {
|
|
|
1473
1473
|
const viemClient = new ViemClient(this.chainId, this.signer);
|
|
1474
1474
|
const account = yield this.createAccount();
|
|
1475
1475
|
const { kernelAccountClient, accountClient } = yield this.createAccountHelpers();
|
|
1476
|
-
const sessionKeyAddress = "
|
|
1476
|
+
const sessionKeyAddress = "0x182f375CD15102B22A55702a516d36f8a6443E40";
|
|
1477
1477
|
const emptyAccount = (0, import_sdk.addressToEmptyAccount)(sessionKeyAddress);
|
|
1478
1478
|
const emptySessionKeySigner = yield (0, import_signers.toECDSASigner)({ signer: emptyAccount });
|
|
1479
1479
|
const callPolicy = (0, import_policies.toCallPolicy)({
|
|
@@ -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);
|
|
@@ -2622,8 +2622,7 @@ var ActaBatch = class {
|
|
|
2622
2622
|
},
|
|
2623
2623
|
serviceParams
|
|
2624
2624
|
);
|
|
2625
|
-
|
|
2626
|
-
return txn.transaction.id;
|
|
2625
|
+
return txn;
|
|
2627
2626
|
} catch (error) {
|
|
2628
2627
|
if (error instanceof Error) {
|
|
2629
2628
|
throw new Error(error.message);
|
|
@@ -3187,21 +3186,36 @@ var decodeParamsFromInitCode = (initCode, kernelVersion) => {
|
|
|
3187
3186
|
throw new Error("Invalid initCode");
|
|
3188
3187
|
return { index, validatorInitData, useMetaFactory };
|
|
3189
3188
|
};
|
|
3190
|
-
var getPeriodInterval = (periodUnit) => {
|
|
3189
|
+
var getPeriodInterval = (periodUnit, currentDate = /* @__PURE__ */ new Date(), count = 1) => {
|
|
3190
|
+
const nextDate = new Date(currentDate);
|
|
3191
|
+
const c = count;
|
|
3191
3192
|
switch (periodUnit) {
|
|
3192
3193
|
case "5mins":
|
|
3193
|
-
|
|
3194
|
+
nextDate.setMinutes(nextDate.getMinutes() + 5 * c);
|
|
3195
|
+
break;
|
|
3194
3196
|
case "day":
|
|
3195
|
-
|
|
3197
|
+
nextDate.setDate(nextDate.getDate() + 1 * c);
|
|
3198
|
+
break;
|
|
3196
3199
|
case "week":
|
|
3197
|
-
|
|
3200
|
+
nextDate.setDate(nextDate.getDate() + 7 * c);
|
|
3201
|
+
break;
|
|
3198
3202
|
case "month":
|
|
3199
|
-
|
|
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;
|
|
3200
3211
|
case "year":
|
|
3201
|
-
|
|
3212
|
+
nextDate.setFullYear(nextDate.getFullYear() + 1 * c);
|
|
3213
|
+
break;
|
|
3202
3214
|
default:
|
|
3203
3215
|
throw new Error("Invalid period unit");
|
|
3204
3216
|
}
|
|
3217
|
+
const milliSeconds = nextDate.getTime();
|
|
3218
|
+
return { milliSeconds, nextDate };
|
|
3205
3219
|
};
|
|
3206
3220
|
var createBillingCheckoutSession = (serviceSessionparams) => __async(null, null, function* () {
|
|
3207
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
|
@@ -1166,7 +1166,7 @@ var ActaAccount = class {
|
|
|
1166
1166
|
signer: this.signer
|
|
1167
1167
|
}
|
|
1168
1168
|
);
|
|
1169
|
-
const sessionKeyAddress = "
|
|
1169
|
+
const sessionKeyAddress = "0x182f375CD15102B22A55702a516d36f8a6443E40";
|
|
1170
1170
|
const emptyAccount = addressToEmptyAccount(sessionKeyAddress);
|
|
1171
1171
|
const emptySessionKeySigner = yield toECDSASigner({ signer: emptyAccount });
|
|
1172
1172
|
const {
|
|
@@ -1294,7 +1294,7 @@ var ActaAccount = class {
|
|
|
1294
1294
|
signer: this.signer
|
|
1295
1295
|
}
|
|
1296
1296
|
);
|
|
1297
|
-
const sessionKeyAddress = "
|
|
1297
|
+
const sessionKeyAddress = "0x182f375CD15102B22A55702a516d36f8a6443E40";
|
|
1298
1298
|
const emptyAccount = addressToEmptyAccount(sessionKeyAddress);
|
|
1299
1299
|
const emptySessionKeySigner = yield toECDSASigner({ signer: emptyAccount });
|
|
1300
1300
|
const {
|
|
@@ -1400,7 +1400,7 @@ var ActaAccount = class {
|
|
|
1400
1400
|
const viemClient = new ViemClient(this.chainId, this.signer);
|
|
1401
1401
|
const account = yield this.createAccount();
|
|
1402
1402
|
const { kernelAccountClient, accountClient } = yield this.createAccountHelpers();
|
|
1403
|
-
const sessionKeyAddress = "
|
|
1403
|
+
const sessionKeyAddress = "0x182f375CD15102B22A55702a516d36f8a6443E40";
|
|
1404
1404
|
const emptyAccount = addressToEmptyAccount(sessionKeyAddress);
|
|
1405
1405
|
const emptySessionKeySigner = yield toECDSASigner({ signer: emptyAccount });
|
|
1406
1406
|
const callPolicy = toCallPolicy({
|
|
@@ -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);
|
|
@@ -2554,8 +2554,7 @@ var ActaBatch = class {
|
|
|
2554
2554
|
},
|
|
2555
2555
|
serviceParams
|
|
2556
2556
|
);
|
|
2557
|
-
|
|
2558
|
-
return txn.transaction.id;
|
|
2557
|
+
return txn;
|
|
2559
2558
|
} catch (error) {
|
|
2560
2559
|
if (error instanceof Error) {
|
|
2561
2560
|
throw new Error(error.message);
|
|
@@ -3150,21 +3149,36 @@ var decodeParamsFromInitCode = (initCode, kernelVersion) => {
|
|
|
3150
3149
|
throw new Error("Invalid initCode");
|
|
3151
3150
|
return { index, validatorInitData, useMetaFactory };
|
|
3152
3151
|
};
|
|
3153
|
-
var getPeriodInterval = (periodUnit) => {
|
|
3152
|
+
var getPeriodInterval = (periodUnit, currentDate = /* @__PURE__ */ new Date(), count = 1) => {
|
|
3153
|
+
const nextDate = new Date(currentDate);
|
|
3154
|
+
const c = count;
|
|
3154
3155
|
switch (periodUnit) {
|
|
3155
3156
|
case "5mins":
|
|
3156
|
-
|
|
3157
|
+
nextDate.setMinutes(nextDate.getMinutes() + 5 * c);
|
|
3158
|
+
break;
|
|
3157
3159
|
case "day":
|
|
3158
|
-
|
|
3160
|
+
nextDate.setDate(nextDate.getDate() + 1 * c);
|
|
3161
|
+
break;
|
|
3159
3162
|
case "week":
|
|
3160
|
-
|
|
3163
|
+
nextDate.setDate(nextDate.getDate() + 7 * c);
|
|
3164
|
+
break;
|
|
3161
3165
|
case "month":
|
|
3162
|
-
|
|
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;
|
|
3163
3174
|
case "year":
|
|
3164
|
-
|
|
3175
|
+
nextDate.setFullYear(nextDate.getFullYear() + 1 * c);
|
|
3176
|
+
break;
|
|
3165
3177
|
default:
|
|
3166
3178
|
throw new Error("Invalid period unit");
|
|
3167
3179
|
}
|
|
3180
|
+
const milliSeconds = nextDate.getTime();
|
|
3181
|
+
return { milliSeconds, nextDate };
|
|
3168
3182
|
};
|
|
3169
3183
|
var createBillingCheckoutSession = (serviceSessionparams) => __async(null, null, function* () {
|
|
3170
3184
|
var _a, _b, _c, _d;
|