@actalink/commonlib 0.0.6 → 0.0.8

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.d.cts CHANGED
@@ -62,6 +62,9 @@ interface DepositClassParams extends AbstractPaymentParams {
62
62
  depositSessionId?: string;
63
63
  allowMaxTokenApproval?: boolean;
64
64
  }
65
+ interface BillingClassParams extends AbstractPaymentParams {
66
+ allowMaxTokenApproval?: boolean;
67
+ }
65
68
  type EstimateSinglePaymentGasParameters = Omit<AbstractPaymentParams, "connectorType" | "signer" | "walletClient" | "serviceType" | "paymentType" | "count" | "intervalUnit" | "startDate" | "endDate" | "serviceUrl" | "serviceParams" | "serviceSessionParams">;
66
69
  type ModularSigner = {
67
70
  account: LocalAccount;
@@ -244,6 +247,62 @@ declare class ActaDeposit {
244
247
  getPaymentSteps(): Promise<string[]>;
245
248
  }
246
249
 
250
+ declare class ActaBilling {
251
+ private readonly connectorType;
252
+ private readonly walletClient;
253
+ private readonly signerAddress;
254
+ private readonly chainId;
255
+ private readonly token;
256
+ private readonly amount;
257
+ private readonly receiver;
258
+ private readonly feeInclusive;
259
+ private readonly paymentType;
260
+ private count?;
261
+ private intervalUnit?;
262
+ private startDate?;
263
+ private endDate?;
264
+ private serviceSessionParams?;
265
+ status: "not_started" | "payment_started" | "token_approval_started" | "token_approval_waiting_for_sign" | "token_approval_signed" | "token_approval_processing" | "token_approval_completed" | "token_approval_failed" | "payment_waiting_for_sign" | "payment_signed" | "payment_processing" | "payment_completed" | "payment_failed";
266
+ private readonly account;
267
+ private readonly viemClient;
268
+ private readonly serviceType;
269
+ private readonly allowMaxTokenApproval;
270
+ constructor(parameters: BillingClassParams);
271
+ estimateSinglePaymentGas(parameters: EstimateSinglePaymentGasParameters): Promise<{
272
+ estimatedGasCostInToken: bigint;
273
+ ActalinkFeesInToken: bigint;
274
+ feeInclusiveAmountInToken: bigint;
275
+ feeExclusiveAmountInToken: bigint;
276
+ estimatedTotalFeesInToken: bigint;
277
+ paymaster: `0x${string}`;
278
+ userOperation: {
279
+ authorization?: viem.SignedAuthorization<number> | undefined;
280
+ callData: viem.Hex;
281
+ callGasLimit: bigint;
282
+ factory?: `0x${string}` | undefined;
283
+ factoryData?: `0x${string}` | undefined;
284
+ maxFeePerGas: bigint;
285
+ maxPriorityFeePerGas: bigint;
286
+ nonce: bigint;
287
+ paymaster?: `0x${string}` | undefined;
288
+ paymasterData?: `0x${string}` | undefined;
289
+ paymasterPostOpGasLimit?: bigint | undefined;
290
+ paymasterVerificationGasLimit?: bigint | undefined;
291
+ preVerificationGas: bigint;
292
+ sender: Address;
293
+ signature: viem.Hex;
294
+ verificationGasLimit: bigint;
295
+ };
296
+ }>;
297
+ createSinglePayment(servicePaymentParams: {
298
+ checkoutSessionId: string;
299
+ }): Promise<any>;
300
+ createRecurringPayments(servicePaymentParams: {
301
+ checkoutSessionId: string;
302
+ }): Promise<any>;
303
+ getPaymentSteps(): Promise<string[]>;
304
+ }
305
+
247
306
  declare class ActaAccount {
248
307
  private readonly chainId;
249
308
  private readonly publicClient;
@@ -2304,6 +2363,12 @@ declare const decodeParamsFromInitCode: (initCode: Hex, kernelVersion: KERNEL_VE
2304
2363
  useMetaFactory: boolean;
2305
2364
  };
2306
2365
  declare const getPeriodInterval: (periodUnit: string) => number;
2366
+ declare const createBillingCheckoutSession: (serviceSessionparams: {
2367
+ paylinkId: string;
2368
+ }) => Promise<string | undefined>;
2369
+ declare const getBillingPaymentSessionDetails: (serviceSessionparams: {
2370
+ checkoutSessionId: string;
2371
+ }) => Promise<any>;
2307
2372
 
2308
2373
  declare class ViemClient {
2309
2374
  private readonly chainId;
@@ -9236,6 +9301,10 @@ declare function scheduleRecurringPaymentsAPICall(url: string, params: {
9236
9301
  approval: string;
9237
9302
  serviceParams: any;
9238
9303
  }): Promise<any>;
9304
+ declare function createBillingSessionAPICall(url: string, sessionBodyParams: {
9305
+ paylinkId: string;
9306
+ }): Promise<any>;
9307
+ declare function fetchBillingSessionDetails(url: string): Promise<any>;
9239
9308
  declare function executeSinglePaymentAPICall(url: string, userOperation: RpcUserOperation$1<"0.7">, paymentParams: {
9240
9309
  senderAddress: string;
9241
9310
  receiverAddress: string;
@@ -9246,4 +9315,4 @@ declare function executeSinglePaymentAPICall(url: string, userOperation: RpcUser
9246
9315
  serviceType: string;
9247
9316
  }, serviceParams: any): Promise<any>;
9248
9317
 
9249
- export { type AbstractPaymentParams, ActaAccount, ActaDeposit, ConnectorType, type DepositClassParams, type EstimateSinglePaymentGasParameters, type ExportPermissionAccountParams, HttpMethod, type ModularSigner, type PermissionAccountParams, type PermissionData, type PermissionPlugin, type PermissionPluginParams, type Policy, PolicyFlags, type PolicyParams, type RecurringPaymentParamsType, type SinglePaymentParamsType, type Token, TokenLogo, ViemClient, arbitrumDAI, arbitrumETH, arbitrumUSDC, arbitrumUSDCe, arbitrumUSDT, arbitrumWETH, base64ToBytes, baseDAI, baseETH, baseEURC, baseUSDC, baseUSDT, baseUSDbC, baseWETH, bscBNB, bscUSDC, bscUSDT, bscWBNB, bytesToBase64, createPolicyFromParams, createSessionAPICall, decodeParamsFromInitCode, deserializePermissionAccount, deserializePermissionAccountParams, ethereumDAI, ethereumETH, ethereumEURC, ethereumUSDC, ethereumUSDT, ethereumWETH, executeSinglePaymentAPICall, getChainById, getChainExplorerByChainId, getPeriodInterval, getPimlicoRpcByChainId, getRpcByChainId, getTokenByChainIdAndAddress, getTokenByChainIdAndSymbol, isKernelVersionAfter, isPermissionValidatorPlugin, lineaDAI, lineaETH, lineaUSDC, lineaWETH, optimismDAI, optimismETH, optimismUSDC, optimismUSDCe, optimismUSDT, optimismWETH, polygonDAI, polygonPOL, polygonUSDC, polygonUSDCe, polygonUSDT, polygonWETH, polygonWPOL, scheduleRecurringPaymentsAPICall, sendRequest, serializePermissionAccount, serializePermissionAccountParams, supportedChains, supportedTokensByChain, toECDSASigner, toPermissionValidator, toPolicyId, toSignerId, token, tokensCommonSymbols, verifySessionAPICall };
9318
+ export { type AbstractPaymentParams, ActaAccount, ActaBilling, ActaDeposit, type BillingClassParams, ConnectorType, type DepositClassParams, type EstimateSinglePaymentGasParameters, type ExportPermissionAccountParams, HttpMethod, type ModularSigner, type PermissionAccountParams, type PermissionData, type PermissionPlugin, type PermissionPluginParams, type Policy, PolicyFlags, type PolicyParams, type RecurringPaymentParamsType, type SinglePaymentParamsType, type Token, TokenLogo, ViemClient, arbitrumDAI, arbitrumETH, arbitrumUSDC, arbitrumUSDCe, arbitrumUSDT, arbitrumWETH, base64ToBytes, baseDAI, baseETH, baseEURC, baseUSDC, baseUSDT, baseUSDbC, baseWETH, bscBNB, bscUSDC, bscUSDT, bscWBNB, bytesToBase64, createBillingCheckoutSession, createBillingSessionAPICall, createPolicyFromParams, createSessionAPICall, decodeParamsFromInitCode, deserializePermissionAccount, deserializePermissionAccountParams, ethereumDAI, ethereumETH, ethereumEURC, ethereumUSDC, ethereumUSDT, ethereumWETH, executeSinglePaymentAPICall, fetchBillingSessionDetails, getBillingPaymentSessionDetails, getChainById, getChainExplorerByChainId, getPeriodInterval, getPimlicoRpcByChainId, getRpcByChainId, getTokenByChainIdAndAddress, getTokenByChainIdAndSymbol, isKernelVersionAfter, isPermissionValidatorPlugin, lineaDAI, lineaETH, lineaUSDC, lineaWETH, optimismDAI, optimismETH, optimismUSDC, optimismUSDCe, optimismUSDT, optimismWETH, polygonDAI, polygonPOL, polygonUSDC, polygonUSDCe, polygonUSDT, polygonWETH, polygonWPOL, scheduleRecurringPaymentsAPICall, sendRequest, serializePermissionAccount, serializePermissionAccountParams, supportedChains, supportedTokensByChain, toECDSASigner, toPermissionValidator, toPolicyId, toSignerId, token, tokensCommonSymbols, verifySessionAPICall };
package/dist/index.d.ts CHANGED
@@ -62,6 +62,9 @@ interface DepositClassParams extends AbstractPaymentParams {
62
62
  depositSessionId?: string;
63
63
  allowMaxTokenApproval?: boolean;
64
64
  }
65
+ interface BillingClassParams extends AbstractPaymentParams {
66
+ allowMaxTokenApproval?: boolean;
67
+ }
65
68
  type EstimateSinglePaymentGasParameters = Omit<AbstractPaymentParams, "connectorType" | "signer" | "walletClient" | "serviceType" | "paymentType" | "count" | "intervalUnit" | "startDate" | "endDate" | "serviceUrl" | "serviceParams" | "serviceSessionParams">;
66
69
  type ModularSigner = {
67
70
  account: LocalAccount;
@@ -244,6 +247,62 @@ declare class ActaDeposit {
244
247
  getPaymentSteps(): Promise<string[]>;
245
248
  }
246
249
 
250
+ declare class ActaBilling {
251
+ private readonly connectorType;
252
+ private readonly walletClient;
253
+ private readonly signerAddress;
254
+ private readonly chainId;
255
+ private readonly token;
256
+ private readonly amount;
257
+ private readonly receiver;
258
+ private readonly feeInclusive;
259
+ private readonly paymentType;
260
+ private count?;
261
+ private intervalUnit?;
262
+ private startDate?;
263
+ private endDate?;
264
+ private serviceSessionParams?;
265
+ status: "not_started" | "payment_started" | "token_approval_started" | "token_approval_waiting_for_sign" | "token_approval_signed" | "token_approval_processing" | "token_approval_completed" | "token_approval_failed" | "payment_waiting_for_sign" | "payment_signed" | "payment_processing" | "payment_completed" | "payment_failed";
266
+ private readonly account;
267
+ private readonly viemClient;
268
+ private readonly serviceType;
269
+ private readonly allowMaxTokenApproval;
270
+ constructor(parameters: BillingClassParams);
271
+ estimateSinglePaymentGas(parameters: EstimateSinglePaymentGasParameters): Promise<{
272
+ estimatedGasCostInToken: bigint;
273
+ ActalinkFeesInToken: bigint;
274
+ feeInclusiveAmountInToken: bigint;
275
+ feeExclusiveAmountInToken: bigint;
276
+ estimatedTotalFeesInToken: bigint;
277
+ paymaster: `0x${string}`;
278
+ userOperation: {
279
+ authorization?: viem.SignedAuthorization<number> | undefined;
280
+ callData: viem.Hex;
281
+ callGasLimit: bigint;
282
+ factory?: `0x${string}` | undefined;
283
+ factoryData?: `0x${string}` | undefined;
284
+ maxFeePerGas: bigint;
285
+ maxPriorityFeePerGas: bigint;
286
+ nonce: bigint;
287
+ paymaster?: `0x${string}` | undefined;
288
+ paymasterData?: `0x${string}` | undefined;
289
+ paymasterPostOpGasLimit?: bigint | undefined;
290
+ paymasterVerificationGasLimit?: bigint | undefined;
291
+ preVerificationGas: bigint;
292
+ sender: Address;
293
+ signature: viem.Hex;
294
+ verificationGasLimit: bigint;
295
+ };
296
+ }>;
297
+ createSinglePayment(servicePaymentParams: {
298
+ checkoutSessionId: string;
299
+ }): Promise<any>;
300
+ createRecurringPayments(servicePaymentParams: {
301
+ checkoutSessionId: string;
302
+ }): Promise<any>;
303
+ getPaymentSteps(): Promise<string[]>;
304
+ }
305
+
247
306
  declare class ActaAccount {
248
307
  private readonly chainId;
249
308
  private readonly publicClient;
@@ -2304,6 +2363,12 @@ declare const decodeParamsFromInitCode: (initCode: Hex, kernelVersion: KERNEL_VE
2304
2363
  useMetaFactory: boolean;
2305
2364
  };
2306
2365
  declare const getPeriodInterval: (periodUnit: string) => number;
2366
+ declare const createBillingCheckoutSession: (serviceSessionparams: {
2367
+ paylinkId: string;
2368
+ }) => Promise<string | undefined>;
2369
+ declare const getBillingPaymentSessionDetails: (serviceSessionparams: {
2370
+ checkoutSessionId: string;
2371
+ }) => Promise<any>;
2307
2372
 
2308
2373
  declare class ViemClient {
2309
2374
  private readonly chainId;
@@ -9236,6 +9301,10 @@ declare function scheduleRecurringPaymentsAPICall(url: string, params: {
9236
9301
  approval: string;
9237
9302
  serviceParams: any;
9238
9303
  }): Promise<any>;
9304
+ declare function createBillingSessionAPICall(url: string, sessionBodyParams: {
9305
+ paylinkId: string;
9306
+ }): Promise<any>;
9307
+ declare function fetchBillingSessionDetails(url: string): Promise<any>;
9239
9308
  declare function executeSinglePaymentAPICall(url: string, userOperation: RpcUserOperation$1<"0.7">, paymentParams: {
9240
9309
  senderAddress: string;
9241
9310
  receiverAddress: string;
@@ -9246,4 +9315,4 @@ declare function executeSinglePaymentAPICall(url: string, userOperation: RpcUser
9246
9315
  serviceType: string;
9247
9316
  }, serviceParams: any): Promise<any>;
9248
9317
 
9249
- export { type AbstractPaymentParams, ActaAccount, ActaDeposit, ConnectorType, type DepositClassParams, type EstimateSinglePaymentGasParameters, type ExportPermissionAccountParams, HttpMethod, type ModularSigner, type PermissionAccountParams, type PermissionData, type PermissionPlugin, type PermissionPluginParams, type Policy, PolicyFlags, type PolicyParams, type RecurringPaymentParamsType, type SinglePaymentParamsType, type Token, TokenLogo, ViemClient, arbitrumDAI, arbitrumETH, arbitrumUSDC, arbitrumUSDCe, arbitrumUSDT, arbitrumWETH, base64ToBytes, baseDAI, baseETH, baseEURC, baseUSDC, baseUSDT, baseUSDbC, baseWETH, bscBNB, bscUSDC, bscUSDT, bscWBNB, bytesToBase64, createPolicyFromParams, createSessionAPICall, decodeParamsFromInitCode, deserializePermissionAccount, deserializePermissionAccountParams, ethereumDAI, ethereumETH, ethereumEURC, ethereumUSDC, ethereumUSDT, ethereumWETH, executeSinglePaymentAPICall, getChainById, getChainExplorerByChainId, getPeriodInterval, getPimlicoRpcByChainId, getRpcByChainId, getTokenByChainIdAndAddress, getTokenByChainIdAndSymbol, isKernelVersionAfter, isPermissionValidatorPlugin, lineaDAI, lineaETH, lineaUSDC, lineaWETH, optimismDAI, optimismETH, optimismUSDC, optimismUSDCe, optimismUSDT, optimismWETH, polygonDAI, polygonPOL, polygonUSDC, polygonUSDCe, polygonUSDT, polygonWETH, polygonWPOL, scheduleRecurringPaymentsAPICall, sendRequest, serializePermissionAccount, serializePermissionAccountParams, supportedChains, supportedTokensByChain, toECDSASigner, toPermissionValidator, toPolicyId, toSignerId, token, tokensCommonSymbols, verifySessionAPICall };
9318
+ export { type AbstractPaymentParams, ActaAccount, ActaBilling, ActaDeposit, type BillingClassParams, ConnectorType, type DepositClassParams, type EstimateSinglePaymentGasParameters, type ExportPermissionAccountParams, HttpMethod, type ModularSigner, type PermissionAccountParams, type PermissionData, type PermissionPlugin, type PermissionPluginParams, type Policy, PolicyFlags, type PolicyParams, type RecurringPaymentParamsType, type SinglePaymentParamsType, type Token, TokenLogo, ViemClient, arbitrumDAI, arbitrumETH, arbitrumUSDC, arbitrumUSDCe, arbitrumUSDT, arbitrumWETH, base64ToBytes, baseDAI, baseETH, baseEURC, baseUSDC, baseUSDT, baseUSDbC, baseWETH, bscBNB, bscUSDC, bscUSDT, bscWBNB, bytesToBase64, createBillingCheckoutSession, createBillingSessionAPICall, createPolicyFromParams, createSessionAPICall, decodeParamsFromInitCode, deserializePermissionAccount, deserializePermissionAccountParams, ethereumDAI, ethereumETH, ethereumEURC, ethereumUSDC, ethereumUSDT, ethereumWETH, executeSinglePaymentAPICall, fetchBillingSessionDetails, getBillingPaymentSessionDetails, getChainById, getChainExplorerByChainId, getPeriodInterval, getPimlicoRpcByChainId, getRpcByChainId, getTokenByChainIdAndAddress, getTokenByChainIdAndSymbol, isKernelVersionAfter, isPermissionValidatorPlugin, lineaDAI, lineaETH, lineaUSDC, lineaWETH, optimismDAI, optimismETH, optimismUSDC, optimismUSDCe, optimismUSDT, optimismWETH, polygonDAI, polygonPOL, polygonUSDC, polygonUSDCe, polygonUSDT, polygonWETH, polygonWPOL, scheduleRecurringPaymentsAPICall, sendRequest, serializePermissionAccount, serializePermissionAccountParams, supportedChains, supportedTokensByChain, toECDSASigner, toPermissionValidator, toPolicyId, toSignerId, token, tokensCommonSymbols, verifySessionAPICall };