@otim/sdk-core 0.0.1 → 0.0.3

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.
@@ -1,5 +1,6 @@
1
- const require_clients = require('../clients-DBRhkU4y.cjs');
1
+ const require_clients = require('../clients-CVg-yW5b.cjs');
2
2
 
3
+ exports.ActivityClient = require_clients.ActivityClient;
3
4
  exports.AuthClient = require_clients.AuthClient;
4
5
  exports.ConfigClient = require_clients.ConfigClient;
5
6
  exports.DelegationClient = require_clients.DelegationClient;
@@ -1,3 +1,3 @@
1
1
  import "../abi-CQuxrNCU.cjs";
2
- import { a as PaymentRequestsClient, c as AuthClient, i as CreatePaymentRequestResponse, l as LoginOptions, n as ActivatePaymentRequestParams, o as DelegationClient, r as CreatePaymentRequestParameters, s as ConfigClient, t as OrchestrationClient } from "../index-De8OZ-Be.cjs";
3
- export { ActivatePaymentRequestParams, AuthClient, ConfigClient, CreatePaymentRequestParameters, CreatePaymentRequestResponse, DelegationClient, LoginOptions, OrchestrationClient, PaymentRequestsClient };
2
+ import { a as PaymentRequestsClient, c as AuthClient, i as CreatePaymentRequestResponse, l as LoginOptions, n as ActivatePaymentRequestParams, o as DelegationClient, r as CreatePaymentRequestParameters, s as ConfigClient, t as OrchestrationClient, u as ActivityClient } from "../index-BH1YuouL.cjs";
3
+ export { ActivatePaymentRequestParams, ActivityClient, AuthClient, ConfigClient, CreatePaymentRequestParameters, CreatePaymentRequestResponse, DelegationClient, LoginOptions, OrchestrationClient, PaymentRequestsClient };
@@ -1,3 +1,3 @@
1
1
  import "../abi-Bd3X6gV9.mjs";
2
- import { a as PaymentRequestsClient, c as AuthClient, i as CreatePaymentRequestResponse, l as LoginOptions, n as ActivatePaymentRequestParams, o as DelegationClient, r as CreatePaymentRequestParameters, s as ConfigClient, t as OrchestrationClient } from "../index-e5BLgzcW.mjs";
3
- export { ActivatePaymentRequestParams, AuthClient, ConfigClient, CreatePaymentRequestParameters, CreatePaymentRequestResponse, DelegationClient, LoginOptions, OrchestrationClient, PaymentRequestsClient };
2
+ import { a as PaymentRequestsClient, c as AuthClient, i as CreatePaymentRequestResponse, l as LoginOptions, n as ActivatePaymentRequestParams, o as DelegationClient, r as CreatePaymentRequestParameters, s as ConfigClient, t as OrchestrationClient, u as ActivityClient } from "../index-747pyuMH.mjs";
3
+ export { ActivatePaymentRequestParams, ActivityClient, AuthClient, ConfigClient, CreatePaymentRequestParameters, CreatePaymentRequestResponse, DelegationClient, LoginOptions, OrchestrationClient, PaymentRequestsClient };
@@ -1,3 +1,3 @@
1
- import { a as AuthClient, i as ConfigClient, n as PaymentRequestsClient, r as DelegationClient, t as OrchestrationClient } from "../clients-DMKeLhcJ.mjs";
1
+ import { a as AuthClient, i as ConfigClient, n as PaymentRequestsClient, o as ActivityClient, r as DelegationClient, t as OrchestrationClient } from "../clients-DnPvBXkX.mjs";
2
2
 
3
- export { AuthClient, ConfigClient, DelegationClient, OrchestrationClient, PaymentRequestsClient };
3
+ export { ActivityClient, AuthClient, ConfigClient, DelegationClient, OrchestrationClient, PaymentRequestsClient };
@@ -9,6 +9,17 @@ let __otim_turnkey_signing = require("@otim/turnkey/signing");
9
9
  let viem_accounts = require("viem/accounts");
10
10
  let __otim_sdk_core_account = require("@otim/sdk-core/account");
11
11
 
12
+ //#region src/clients/activity.ts
13
+ var ActivityClient = class {
14
+ constructor(apiClient) {
15
+ this.apiClient = apiClient;
16
+ }
17
+ async getInstructionActivity(request) {
18
+ return (await this.apiClient.activity.getInstructionActivity(request)).data;
19
+ }
20
+ };
21
+
22
+ //#endregion
12
23
  //#region src/clients/auth.ts
13
24
  var AuthClient = class {
14
25
  constructor(apiClient, account, context) {
@@ -264,6 +275,12 @@ var OrchestrationClient = class {
264
275
  };
265
276
 
266
277
  //#endregion
278
+ Object.defineProperty(exports, 'ActivityClient', {
279
+ enumerable: true,
280
+ get: function () {
281
+ return ActivityClient;
282
+ }
283
+ });
267
284
  Object.defineProperty(exports, 'AuthClient', {
268
285
  enumerable: true,
269
286
  get: function () {
@@ -294,4 +311,4 @@ Object.defineProperty(exports, 'PaymentRequestsClient', {
294
311
  return PaymentRequestsClient;
295
312
  }
296
313
  });
297
- //# sourceMappingURL=clients-DBRhkU4y.cjs.map
314
+ //# sourceMappingURL=clients-CVg-yW5b.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients-CVg-yW5b.cjs","names":["apiClient: APIClient","apiClient: APIClient","account: OtimAccount","context: OtimClientContext","apiClient: APIClient","apiClient: APIClient","UnifiedPaymentSigner","ApiKeyClientSigningService","ServerWalletSigningService","apiClient: APIClient","account: OtimAccount","context: OtimClientContext","hexStringSchema","supportedChains","apiClient: APIClient","account: OtimAccount","context: OtimClientContext"],"sources":["../src/clients/activity.ts","../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/helpers/payment-signer.ts","../src/clients/payment-requests.ts","../src/clients/orchestration.ts"],"sourcesContent":["import type {\n APIClient,\n GetInstructionActivityRequest,\n GetInstructionActivityResponse,\n} from \"@otim/utils/api\";\n\nexport class ActivityClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getInstructionActivity(\n request: GetInstructionActivityRequest,\n ): Promise<GetInstructionActivityResponse> {\n const response =\n await this.apiClient.activity.getInstructionActivity(request);\n\n return response.data;\n }\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient, AuthLoginResponse, MeResponse } from \"@otim/utils/api\";\nimport type { Address } from \"viem\";\n\nimport { parseSignatureToVRS } from \"@otim/utils/helpers\";\n\nimport { createLoginSiweMessage } from \"@otim/sdk-core/config\";\nimport { assertRequiresAuth } from \"@otim/sdk-core/context\";\n\nexport interface LoginOptions {\n address: Address;\n}\n\nexport class AuthClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {}\n\n async login({ address }: LoginOptions): Promise<AuthLoginResponse> {\n assertRequiresAuth(this.context);\n\n const message = createLoginSiweMessage(address, Date.now().toString());\n const signature = await this.account.signMessage({ message });\n const vrsParsedSignature = parseSignatureToVRS(signature);\n\n const response = await this.apiClient.auth.login({\n siwe: message,\n signature: vrsParsedSignature,\n });\n\n return response.data;\n }\n\n async getCurrentUser(): Promise<MeResponse> {\n const response = await this.apiClient.auth.me();\n return response.data;\n }\n}\n","import type {\n APIClient,\n GetMaxPriorityFeePerGasEstimateRequest,\n GetMaxPriorityFeePerGasEstimateResponse,\n} from \"@otim/utils/api\";\n\nexport class ConfigClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getMaxPriorityFeeEstimate({\n chainId,\n }: GetMaxPriorityFeePerGasEstimateRequest): Promise<GetMaxPriorityFeePerGasEstimateResponse> {\n const response =\n await this.apiClient.config.getMaxPriorityFeePerGasEstimate({ chainId });\n\n return response.data;\n }\n}\n","import type {\n APIClient,\n DelegationCreateRequest,\n DelegationStatusRequest,\n DelegationStatusResponse,\n GetDelegateAddressRequest,\n GetDelegateAddressResponse,\n} from \"@otim/utils/api\";\n\nexport class DelegationClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getDelegateAddress({\n chainId,\n }: GetDelegateAddressRequest): Promise<GetDelegateAddressResponse> {\n const response = await this.apiClient.config.getDelegateAddress({\n chainId,\n });\n\n return response.data;\n }\n\n async getDelegationStatus(\n options: DelegationStatusRequest,\n ): Promise<DelegationStatusResponse> {\n const response = await this.apiClient.account.getDelegationStatus({\n address: options.address,\n chainId: options.chainId,\n });\n\n return response.data;\n }\n\n async createDelegation(\n delegationRequest: DelegationCreateRequest,\n ): Promise<void> {\n await this.apiClient.account.createDelegation(delegationRequest);\n }\n}\n","import type { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { Address } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport {\n ApiKeyClientSigningService,\n ServerWalletSigningService,\n UnifiedPaymentSigner,\n} from \"@otim/turnkey/signing\";\nimport { createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport { isApiAccountConfig } from \"@otim/sdk-core/account\";\n\nexport interface CreatePaymentSignerParams {\n context: OtimServerClientContext;\n buildResponse: PaymentResponseWithActionNames;\n publicClient: PublicClient;\n delegateAddressMap: Map<number, Address>;\n}\n\ntype CreatePaymentSignerResult = Awaited<\n ReturnType<UnifiedPaymentSigner[\"signAll\"]>\n>;\n\nexport async function createPaymentSigner(\n params: CreatePaymentSignerParams,\n): Promise<CreatePaymentSignerResult> {\n const { context, buildResponse, publicClient, delegateAddressMap } = params;\n\n if (isApiAccountConfig(context.config)) {\n const signingService = new ApiKeyClientSigningService(\n context.config.publicKey,\n context.config.privateKey,\n );\n\n const signer = new UnifiedPaymentSigner({\n buildResponse,\n signingService,\n publicClient,\n delegateAddressMap,\n });\n\n return signer.signAll();\n }\n\n const account = privateKeyToAccount(context.config.privateKey);\n const walletClient = createWalletClient({\n account,\n transport: http(),\n });\n\n const signingService =\n ServerWalletSigningService.fromViemWallet(walletClient);\n\n const signer = new UnifiedPaymentSigner({\n buildResponse,\n signingService,\n publicClient,\n delegateAddressMap,\n });\n\n return signer.signAll();\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type {\n APIClient,\n GetPaymentRequestsRequest,\n GetPaymentRequestsResponse,\n PaginatedServiceResponse,\n PaymentRequestBuildRequest,\n PaymentRequestDetailsRequest,\n PaymentRequestDetailsResponse,\n PaymentsListRequest,\n ServiceResponse,\n} from \"@otim/utils/api\";\nimport type { SupportedChainId } from \"@otim/utils/chains\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { PaymentRequestMetadata } from \"@otim/utils/payments\";\nimport type { Address, Payments } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport {\n getChainById,\n getChainTokens,\n getTokenAddress,\n getTokenMetadata,\n supportedChains,\n} from \"@otim/utils/chains\";\nimport { validateIso8601Date } from \"@otim/utils/helpers\";\nimport {\n addActionNamesToInstructions,\n buildPaymentMetadata,\n createChainTokenConfigs,\n createComprehensivePaymentRequest,\n extractActionNamesMap,\n} from \"@otim/utils/payments\";\nimport { hexStringSchema } from \"@otim/utils/schemas\";\nimport { createPublicClient, http } from \"viem\";\n\nimport { assertServerContext } from \"@otim/sdk-core/context\";\n\nimport { createPaymentSigner } from \"./helpers/payment-signer\";\n\nexport interface CreatePaymentRequestParameters {\n amount: number;\n chainId: SupportedChainId;\n recipient: Address;\n token?: \"USDC\" | \"USDT\";\n payer?: Nullable<Address>;\n /**\n * ISO 8601 date format (e.g., \"2024-12-31T23:59:59.000Z\")\n */\n dueDate?: string;\n metadata?: PaymentRequestMetadata;\n note?: string;\n}\n\nexport interface CreatePaymentRequestResponse {\n requestId: string;\n ephemeralWalletAddress: Address;\n}\n\nexport interface ActivatePaymentRequestParams {\n buildResponse: PaymentResponseWithActionNames;\n settlementChainId: number;\n}\n\ntype PaymentInstruction =\n PaymentResponseWithActionNames[\"completionInstructions\"][number];\n\nexport class PaymentRequestsClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {}\n\n async create(\n params: CreatePaymentRequestParameters,\n ): Promise<CreatePaymentRequestResponse> {\n const {\n chainId,\n token = \"USDC\",\n recipient,\n amount,\n payer,\n note,\n dueDate,\n metadata: customMetadata,\n } = params;\n\n if (dueDate) {\n validateIso8601Date(dueDate);\n }\n\n const feeTokenAddress = this.validateAndGetTokenAddress(chainId, token);\n const metadata = this.buildMetadata({\n token,\n amount,\n recipient,\n note,\n dueDate,\n customMetadata,\n });\n const payload = this.createPayload({\n chainId,\n recipient,\n amount,\n payer,\n metadata,\n feeTokenAddress,\n });\n\n const buildResponse = await this.buildAndEnhancePaymentRequest(payload);\n\n await this.activate({ buildResponse, settlementChainId: chainId });\n\n return {\n requestId: buildResponse.requestId,\n ephemeralWalletAddress: buildResponse.ephemeralWalletAddress,\n };\n }\n\n async activate(params: ActivatePaymentRequestParams): Promise<void> {\n assertServerContext(this.context);\n\n const { buildResponse, settlementChainId } = params;\n const publicClient = this.createPublicClient(settlementChainId);\n\n const instructions = [\n ...buildResponse.completionInstructions,\n ...buildResponse.instructions,\n ];\n\n const delegateAddressMap = await this.fetchDelegateAddresses(instructions);\n\n const {\n signedAuthorization,\n completionInstructions,\n instructions: signedInstructions,\n } = await createPaymentSigner({\n context: this.context,\n buildResponse,\n publicClient,\n delegateAddressMap,\n });\n\n await this.apiClient.payments.newPaymentRequest({\n requestId: buildResponse.requestId,\n signedAuthorization,\n completionInstructions,\n instructions: signedInstructions,\n });\n }\n\n private validateAndGetTokenAddress(chainId: number, token: string): Address {\n const tokenAddress = getTokenAddress(chainId, token);\n if (!tokenAddress) {\n throw new Error(`Token ${token} not supported on chain ${chainId}`);\n }\n\n const tokenMetadata = getTokenMetadata(token);\n if (!tokenMetadata) {\n throw new Error(`Token ${token} metadata not found`);\n }\n\n return hexStringSchema.parse(tokenAddress);\n }\n\n private buildMetadata(params: {\n token: string;\n amount: number;\n recipient: Address;\n note?: string;\n dueDate?: string;\n customMetadata?: PaymentRequestMetadata;\n }): PaymentRequestMetadata {\n const { token, amount, recipient, note, dueDate, customMetadata } = params;\n\n const baseMetadata = buildPaymentMetadata({\n tokenSymbol: token,\n amountInUSD: amount,\n fromAccountAddress: recipient,\n note,\n dueDate,\n hasInvoiceMetadata: false,\n });\n\n return customMetadata\n ? { ...baseMetadata, ...customMetadata }\n : baseMetadata;\n }\n\n private createPayload(params: {\n chainId: number;\n recipient: Address;\n amount: number;\n payer?: Address | null;\n metadata: PaymentRequestMetadata;\n feeTokenAddress: Address;\n }): PaymentRequestBuildRequest {\n const { chainId, recipient, amount, payer, metadata, feeTokenAddress } =\n params;\n\n const tokens = Object.values(supportedChains.mainnet).flatMap((chain) =>\n getChainTokens(chain.id),\n );\n\n const chainTokenConfigs = createChainTokenConfigs(tokens);\n\n return createComprehensivePaymentRequest({\n settlementChainId: chainId,\n recipient,\n amount: amount.toString(),\n ephemeralWalletAddress: recipient,\n chainTokenConfigs,\n payerAddress: payer ?? null,\n metadata,\n feeToken: feeTokenAddress,\n });\n }\n\n private async buildAndEnhancePaymentRequest(\n payload: PaymentRequestBuildRequest,\n ): Promise<PaymentResponseWithActionNames> {\n const actionNames = extractActionNamesMap(\n payload.completionInstructions,\n payload.instructions,\n );\n\n const response = await this.apiClient.payments.buildPaymentRequest(payload);\n\n return addActionNamesToInstructions(response.data, actionNames);\n }\n\n private createPublicClient(chainId: number): PublicClient {\n const chain = getChainById(chainId);\n if (!chain) {\n throw new Error(`Chain with id ${chainId} not found`);\n }\n\n return createPublicClient({ chain, transport: http() });\n }\n\n private async fetchDelegateAddresses(\n instructions: PaymentInstruction[],\n ): Promise<Map<number, Address>> {\n const chainIds = Array.from(\n new Set(instructions.map((instruction) => instruction.chainId)),\n );\n\n const addresses = await Promise.all(\n chainIds.map(async (chainId) => {\n const response = await this.apiClient.config.getDelegateAddress({\n chainId,\n });\n const address = hexStringSchema.parse(\n response.data.otimDelegateAddress,\n );\n return [chainId, address] as const;\n }),\n );\n\n return new Map(addresses);\n }\n\n async getDetails(\n request: PaymentRequestDetailsRequest,\n ): Promise<ServiceResponse<PaymentRequestDetailsResponse>> {\n return this.apiClient.payments.getPaymentRequestDetails(request);\n }\n\n async listOutgoingPaymentRequests(\n request: PaymentsListRequest,\n ): Promise<PaginatedServiceResponse<Payments>> {\n return this.apiClient.payments.getOutgoingPaymentsList(request);\n }\n\n async listIncomingPaymentRequests(\n request: PaymentsListRequest,\n ): Promise<PaginatedServiceResponse<Payments>> {\n return this.apiClient.payments.getIncomingPaymentsList(request);\n }\n\n async list(\n request: GetPaymentRequestsRequest,\n ): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>> {\n return this.apiClient.payments.getPaymentRequests(request);\n }\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient } from \"@otim/utils/api\";\n\nimport { PaymentRequestsClient } from \"./payment-requests\";\n\nexport class OrchestrationClient {\n public readonly paymentRequests: PaymentRequestsClient;\n\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {\n this.paymentRequests = new PaymentRequestsClient(\n apiClient,\n account,\n context,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAMA,IAAa,iBAAb,MAA4B;CAC1B,YAAY,AAAiBA,WAAsB;EAAtB;;CAE7B,MAAM,uBACJ,SACyC;AAIzC,UAFE,MAAM,KAAK,UAAU,SAAS,uBAAuB,QAAQ,EAE/C;;;;;;ACDpB,IAAa,aAAb,MAAwB;CACtB,YACE,AAAiBC,WACjB,AAAiBC,SACjB,AAAiBC,SACjB;EAHiB;EACA;EACA;;CAGnB,MAAM,MAAM,EAAE,WAAqD;AACjE,kDAAmB,KAAK,QAAQ;EAEhC,MAAM,6DAAiC,SAAS,KAAK,KAAK,CAAC,UAAU,CAAC;EAEtE,MAAM,mEADY,MAAM,KAAK,QAAQ,YAAY,EAAE,SAAS,CAAC,CACJ;AAOzD,UALiB,MAAM,KAAK,UAAU,KAAK,MAAM;GAC/C,MAAM;GACN,WAAW;GACZ,CAAC,EAEc;;CAGlB,MAAM,iBAAsC;AAE1C,UADiB,MAAM,KAAK,UAAU,KAAK,IAAI,EAC/B;;;;;;AChCpB,IAAa,eAAb,MAA0B;CACxB,YAAY,AAAiBC,WAAsB;EAAtB;;CAE7B,MAAM,0BAA0B,EAC9B,WAC2F;AAI3F,UAFE,MAAM,KAAK,UAAU,OAAO,gCAAgC,EAAE,SAAS,CAAC,EAE1D;;;;;;ACNpB,IAAa,mBAAb,MAA8B;CAC5B,YAAY,AAAiBC,WAAsB;EAAtB;;CAE7B,MAAM,mBAAmB,EACvB,WACiE;AAKjE,UAJ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eyClientSigningService, ServerWalletSigningService, UnifiedPaymentS
9
9
  import { privateKeyToAccount } from "viem/accounts";
10
10
  import { isApiAccountConfig } from "@otim/sdk-core/account";
11
11
 
12
+ //#region src/clients/activity.ts
13
+ var ActivityClient = class {
14
+ constructor(apiClient) {
15
+ this.apiClient = apiClient;
16
+ }
17
+ async getInstructionActivity(request) {
18
+ return (await this.apiClient.activity.getInstructionActivity(request)).data;
19
+ }
20
+ };
21
+
22
+ //#endregion
12
23
  //#region src/clients/auth.ts
13
24
  var AuthClient = class {
14
25
  constructor(apiClient, account, context) {
@@ -264,5 +275,5 @@ var OrchestrationClient = class {
264
275
  };
265
276
 
266
277
  //#endregion
267
- export { AuthClient as a, ConfigClient as i, PaymentRequestsClient as n, DelegationClient as r, OrchestrationClient as t };
268
- //# sourceMappingURL=clients-DMKeLhcJ.mjs.map
278
+ export { AuthClient as a, ConfigClient as i, PaymentRequestsClient as n, ActivityClient as o, DelegationClient as r, OrchestrationClient as t };
279
+ //# sourceMappingURL=clients-DnPvBXkX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients-DnPvBXkX.mjs","names":["apiClient: APIClient","apiClient: APIClient","account: OtimAccount","context: OtimClientContext","apiClient: APIClient","apiClient: APIClient","apiClient: APIClient","account: OtimAccount","context: OtimClientContext","apiClient: APIClient","account: OtimAccount","context: OtimClientContext"],"sources":["../src/clients/activity.ts","../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/helpers/payment-signer.ts","../src/clients/payment-requests.ts","../src/clients/orchestration.ts"],"sourcesContent":["import type {\n APIClient,\n GetInstructionActivityRequest,\n GetInstructionActivityResponse,\n} from \"@otim/utils/api\";\n\nexport class ActivityClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getInstructionActivity(\n request: GetInstructionActivityRequest,\n ): Promise<GetInstructionActivityResponse> {\n const response =\n await this.apiClient.activity.getInstructionActivity(request);\n\n return response.data;\n }\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient, AuthLoginResponse, MeResponse } from \"@otim/utils/api\";\nimport type { Address } from \"viem\";\n\nimport { parseSignatureToVRS } from \"@otim/utils/helpers\";\n\nimport { createLoginSiweMessage } from \"@otim/sdk-core/config\";\nimport { assertRequiresAuth } from \"@otim/sdk-core/context\";\n\nexport interface LoginOptions {\n address: Address;\n}\n\nexport class AuthClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {}\n\n async login({ address }: LoginOptions): Promise<AuthLoginResponse> {\n assertRequiresAuth(this.context);\n\n const message = createLoginSiweMessage(address, Date.now().toString());\n const signature = await this.account.signMessage({ message });\n const vrsParsedSignature = parseSignatureToVRS(signature);\n\n const response = await this.apiClient.auth.login({\n siwe: message,\n signature: vrsParsedSignature,\n });\n\n return response.data;\n }\n\n async getCurrentUser(): Promise<MeResponse> {\n const response = await this.apiClient.auth.me();\n return response.data;\n }\n}\n","import type {\n APIClient,\n GetMaxPriorityFeePerGasEstimateRequest,\n GetMaxPriorityFeePerGasEstimateResponse,\n} from \"@otim/utils/api\";\n\nexport class ConfigClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getMaxPriorityFeeEstimate({\n chainId,\n }: GetMaxPriorityFeePerGasEstimateRequest): Promise<GetMaxPriorityFeePerGasEstimateResponse> {\n const response =\n await this.apiClient.config.getMaxPriorityFeePerGasEstimate({ chainId });\n\n return response.data;\n }\n}\n","import type {\n APIClient,\n DelegationCreateRequest,\n DelegationStatusRequest,\n DelegationStatusResponse,\n GetDelegateAddressRequest,\n GetDelegateAddressResponse,\n} from \"@otim/utils/api\";\n\nexport class DelegationClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getDelegateAddress({\n chainId,\n }: GetDelegateAddressRequest): Promise<GetDelegateAddressResponse> {\n const response = await this.apiClient.config.getDelegateAddress({\n chainId,\n });\n\n return response.data;\n }\n\n async getDelegationStatus(\n options: DelegationStatusRequest,\n ): Promise<DelegationStatusResponse> {\n const response = await this.apiClient.account.getDelegationStatus({\n address: options.address,\n chainId: options.chainId,\n });\n\n return response.data;\n }\n\n async createDelegation(\n delegationRequest: DelegationCreateRequest,\n ): Promise<void> {\n await this.apiClient.account.createDelegation(delegationRequest);\n }\n}\n","import type { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { Address } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport {\n ApiKeyClientSigningService,\n ServerWalletSigningService,\n UnifiedPaymentSigner,\n} from \"@otim/turnkey/signing\";\nimport { createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport { isApiAccountConfig } from \"@otim/sdk-core/account\";\n\nexport interface CreatePaymentSignerParams {\n context: OtimServerClientContext;\n buildResponse: PaymentResponseWithActionNames;\n publicClient: PublicClient;\n delegateAddressMap: Map<number, Address>;\n}\n\ntype CreatePaymentSignerResult = Awaited<\n ReturnType<UnifiedPaymentSigner[\"signAll\"]>\n>;\n\nexport async function createPaymentSigner(\n params: CreatePaymentSignerParams,\n): Promise<CreatePaymentSignerResult> {\n const { context, buildResponse, publicClient, delegateAddressMap } = params;\n\n if (isApiAccountConfig(context.config)) {\n const signingService = new ApiKeyClientSigningService(\n context.config.publicKey,\n context.config.privateKey,\n );\n\n const signer = new UnifiedPaymentSigner({\n buildResponse,\n signingService,\n publicClient,\n delegateAddressMap,\n });\n\n return signer.signAll();\n }\n\n const account = privateKeyToAccount(context.config.privateKey);\n const walletClient = createWalletClient({\n account,\n transport: http(),\n });\n\n const signingService =\n ServerWalletSigningService.fromViemWallet(walletClient);\n\n const signer = new UnifiedPaymentSigner({\n buildResponse,\n signingService,\n publicClient,\n delegateAddressMap,\n });\n\n return signer.signAll();\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type {\n APIClient,\n GetPaymentRequestsRequest,\n GetPaymentRequestsResponse,\n PaginatedServiceResponse,\n PaymentRequestBuildRequest,\n PaymentRequestDetailsRequest,\n PaymentRequestDetailsResponse,\n PaymentsListRequest,\n ServiceResponse,\n} from \"@otim/utils/api\";\nimport type { SupportedChainId } from \"@otim/utils/chains\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { PaymentRequestMetadata } from \"@otim/utils/payments\";\nimport type { Address, Payments } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport {\n getChainById,\n getChainTokens,\n getTokenAddress,\n getTokenMetadata,\n supportedChains,\n} from \"@otim/utils/chains\";\nimport { validateIso8601Date } from \"@otim/utils/helpers\";\nimport {\n addActionNamesToInstructions,\n buildPaymentMetadata,\n createChainTokenConfigs,\n createComprehensivePaymentRequest,\n extractActionNamesMap,\n} from \"@otim/utils/payments\";\nimport { hexStringSchema } from \"@otim/utils/schemas\";\nimport { createPublicClient, http } from \"viem\";\n\nimport { assertServerContext } from \"@otim/sdk-core/context\";\n\nimport { createPaymentSigner } from \"./helpers/payment-signer\";\n\nexport interface CreatePaymentRequestParameters {\n amount: number;\n chainId: SupportedChainId;\n recipient: Address;\n token?: \"USDC\" | \"USDT\";\n payer?: Nullable<Address>;\n /**\n * ISO 8601 date format (e.g., \"2024-12-31T23:59:59.000Z\")\n */\n dueDate?: string;\n metadata?: PaymentRequestMetadata;\n note?: string;\n}\n\nexport interface CreatePaymentRequestResponse {\n requestId: string;\n ephemeralWalletAddress: Address;\n}\n\nexport interface ActivatePaymentRequestParams {\n buildResponse: PaymentResponseWithActionNames;\n settlementChainId: number;\n}\n\ntype PaymentInstruction =\n PaymentResponseWithActionNames[\"completionInstructions\"][number];\n\nexport class PaymentRequestsClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {}\n\n async create(\n params: CreatePaymentRequestParameters,\n ): Promise<CreatePaymentRequestResponse> {\n const {\n chainId,\n token = \"USDC\",\n recipient,\n amount,\n payer,\n note,\n dueDate,\n metadata: customMetadata,\n } = params;\n\n if (dueDate) {\n validateIso8601Date(dueDate);\n }\n\n const feeTokenAddress = this.validateAndGetTokenAddress(chainId, token);\n const metadata = this.buildMetadata({\n token,\n amount,\n recipient,\n note,\n dueDate,\n customMetadata,\n });\n const payload = this.createPayload({\n chainId,\n recipient,\n amount,\n payer,\n metadata,\n feeTokenAddress,\n });\n\n const buildResponse = await this.buildAndEnhancePaymentRequest(payload);\n\n await this.activate({ buildResponse, settlementChainId: chainId });\n\n return {\n requestId: buildResponse.requestId,\n ephemeralWalletAddress: buildResponse.ephemeralWalletAddress,\n };\n }\n\n async activate(params: ActivatePaymentRequestParams): Promise<void> {\n assertServerContext(this.context);\n\n const { buildResponse, settlementChainId } = params;\n const publicClient = this.createPublicClient(settlementChainId);\n\n const instructions = [\n ...buildResponse.completionInstructions,\n ...buildResponse.instructions,\n ];\n\n const delegateAddressMap = await this.fetchDelegateAddresses(instructions);\n\n const {\n signedAuthorization,\n completionInstructions,\n instructions: signedInstructions,\n } = await createPaymentSigner({\n context: this.context,\n buildResponse,\n publicClient,\n delegateAddressMap,\n });\n\n await this.apiClient.payments.newPaymentRequest({\n requestId: buildResponse.requestId,\n signedAuthorization,\n completionInstructions,\n instructions: signedInstructions,\n });\n }\n\n private validateAndGetTokenAddress(chainId: number, token: string): Address {\n const tokenAddress = getTokenAddress(chainId, token);\n if (!tokenAddress) {\n throw new Error(`Token ${token} not supported on chain ${chainId}`);\n }\n\n const tokenMetadata = getTokenMetadata(token);\n if (!tokenMetadata) {\n throw new Error(`Token ${token} metadata not found`);\n }\n\n return hexStringSchema.parse(tokenAddress);\n }\n\n private buildMetadata(params: {\n token: string;\n amount: number;\n recipient: Address;\n note?: string;\n dueDate?: string;\n customMetadata?: PaymentRequestMetadata;\n }): PaymentRequestMetadata {\n const { token, amount, recipient, note, dueDate, customMetadata } = params;\n\n const baseMetadata = buildPaymentMetadata({\n tokenSymbol: token,\n amountInUSD: amount,\n fromAccountAddress: recipient,\n note,\n dueDate,\n hasInvoiceMetadata: false,\n });\n\n return customMetadata\n ? { ...baseMetadata, ...customMetadata }\n : baseMetadata;\n }\n\n private createPayload(params: {\n chainId: number;\n recipient: Address;\n amount: number;\n payer?: Address | null;\n metadata: PaymentRequestMetadata;\n feeTokenAddress: Address;\n }): PaymentRequestBuildRequest {\n const { chainId, recipient, amount, payer, metadata, feeTokenAddress } =\n params;\n\n const tokens = Object.values(supportedChains.mainnet).flatMap((chain) =>\n getChainTokens(chain.id),\n );\n\n const chainTokenConfigs = createChainTokenConfigs(tokens);\n\n return createComprehensivePaymentRequest({\n settlementChainId: chainId,\n recipient,\n amount: amount.toString(),\n ephemeralWalletAddress: recipient,\n chainTokenConfigs,\n payerAddress: payer ?? null,\n metadata,\n feeToken: feeTokenAddress,\n });\n }\n\n private async buildAndEnhancePaymentRequest(\n payload: PaymentRequestBuildRequest,\n ): Promise<PaymentResponseWithActionNames> {\n const actionNames = extractActionNamesMap(\n payload.completionInstructions,\n payload.instructions,\n );\n\n const response = await this.apiClient.payments.buildPaymentRequest(payload);\n\n return addActionNamesToInstructions(response.data, actionNames);\n }\n\n private createPublicClient(chainId: number): PublicClient {\n const chain = getChainById(chainId);\n if (!chain) {\n throw new Error(`Chain with id ${chainId} not found`);\n }\n\n return createPublicClient({ chain, transport: http() });\n }\n\n private async fetchDelegateAddresses(\n instructions: PaymentInstruction[],\n ): Promise<Map<number, Address>> {\n const chainIds = Array.from(\n new Set(instructions.map((instruction) => instruction.chainId)),\n );\n\n const addresses = await Promise.all(\n chainIds.map(async (chainId) => {\n const response = await this.apiClient.config.getDelegateAddress({\n chainId,\n });\n const address = hexStringSchema.parse(\n response.data.otimDelegateAddress,\n );\n return [chainId, address] as const;\n }),\n );\n\n return new Map(addresses);\n }\n\n async getDetails(\n request: PaymentRequestDetailsRequest,\n ): Promise<ServiceResponse<PaymentRequestDetailsResponse>> {\n return this.apiClient.payments.getPaymentRequestDetails(request);\n }\n\n async listOutgoingPaymentRequests(\n request: PaymentsListRequest,\n ): Promise<PaginatedServiceResponse<Payments>> {\n return this.apiClient.payments.getOutgoingPaymentsList(request);\n }\n\n async listIncomingPaymentRequests(\n request: PaymentsListRequest,\n ): Promise<PaginatedServiceResponse<Payments>> {\n return this.apiClient.payments.getIncomingPaymentsList(request);\n }\n\n async list(\n request: GetPaymentRequestsRequest,\n ): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>> {\n return this.apiClient.payments.getPaymentRequests(request);\n }\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient } from \"@otim/utils/api\";\n\nimport { PaymentRequestsClient } from \"./payment-requests\";\n\nexport class OrchestrationClient {\n public readonly paymentRequests: PaymentRequestsClient;\n\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {\n this.paymentRequests = new PaymentRequestsClient(\n apiClient,\n account,\n context,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAMA,IAAa,iBAAb,MAA4B;CAC1B,YAAY,AAAiBA,WAAsB;EAAtB;;CAE7B,MAAM,uBACJ,SACyC;AAIzC,UAFE,MAAM,KAAK,UAAU,SAAS,uBAAuB,QAAQ,EAE/C;;;;;;ACDpB,IAAa,aAAb,MAAwB;CACtB,YACE,AAAiBC,WACjB,AAAiBC,SACjB,AAAiBC,SACjB;EAHiB;EACA;EACA;;CAGnB,MAAM,MAAM,EAAE,WAAqD;AACjE,qBAAmB,KAAK,QAAQ;EAEhC,MAAM,UAAU,uBAAuB,SAAS,KAAK,KAAK,CAAC,UAAU,CAAC;EAEtE,MAAM,qBAAqB,oBADT,MAAM,KAAK,QAAQ,YAAY,EAAE,SAAS,CAAC,CACJ;AAOzD,UALiB,MAAM,KAAK,UAAU,KAAK,MAAM;GA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,yBAAyB,QAAQ;;CAGlE,MAAM,4BACJ,SAC6C;AAC7C,SAAO,KAAK,UAAU,SAAS,wBAAwB,QAAQ;;CAGjE,MAAM,4BACJ,SAC6C;AAC7C,SAAO,KAAK,UAAU,SAAS,wBAAwB,QAAQ;;CAGjE,MAAM,KACJ,SAC+D;AAC/D,SAAO,KAAK,UAAU,SAAS,mBAAmB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxR9D,IAAa,sBAAb,MAAiC;CAG/B,YACE,AAAiBC,WACjB,AAAiBC,SACjB,AAAiBC,SACjB;EAHiB;EACA;EACA;wBALH;AAOd,OAAK,kBAAkB,IAAI,sBACzB,WACA,SACA,QACD"}
@@ -5,8 +5,15 @@ import { SupportedChainId } from "@otim/utils/chains";
5
5
  import { PaymentRequestMetadata, PaymentResponseWithActionNames } from "@otim/utils/payments";
6
6
  import { Address, Payments } from "@otim/utils/schemas";
7
7
  import { OtimAccount } from "@otim/sdk-core/account";
8
- import { APIClient, AuthLoginResponse, DelegationCreateRequest, DelegationStatusRequest, DelegationStatusResponse, GetDelegateAddressRequest, GetDelegateAddressResponse, GetMaxPriorityFeePerGasEstimateRequest, GetMaxPriorityFeePerGasEstimateResponse, GetPaymentRequestsRequest, GetPaymentRequestsResponse, MeResponse, PaginatedServiceResponse, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, PaymentsListRequest, ServiceResponse } from "@otim/utils/api";
8
+ import { APIClient, AuthLoginResponse, DelegationCreateRequest, DelegationStatusRequest, DelegationStatusResponse, GetDelegateAddressRequest, GetDelegateAddressResponse, GetInstructionActivityRequest, GetInstructionActivityResponse, GetMaxPriorityFeePerGasEstimateRequest, GetMaxPriorityFeePerGasEstimateResponse, GetPaymentRequestsRequest, GetPaymentRequestsResponse, MeResponse, PaginatedServiceResponse, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, PaymentsListRequest, ServiceResponse } from "@otim/utils/api";
9
9
 
10
+ //#region src/clients/activity.d.ts
11
+ declare class ActivityClient {
12
+ private readonly apiClient;
13
+ constructor(apiClient: APIClient);
14
+ getInstructionActivity(request: GetInstructionActivityRequest): Promise<GetInstructionActivityResponse>;
15
+ }
16
+ //#endregion
10
17
  //#region src/clients/auth.d.ts
11
18
  interface LoginOptions {
12
19
  address: Address$1;
@@ -92,5 +99,5 @@ declare class OrchestrationClient {
92
99
  constructor(apiClient: APIClient, account: OtimAccount, context: OtimClientContext);
93
100
  }
94
101
  //#endregion
95
- export { PaymentRequestsClient as a, AuthClient as c, CreatePaymentRequestResponse as i, LoginOptions as l, ActivatePaymentRequestParams as n, DelegationClient as o, CreatePaymentRequestParameters as r, ConfigClient as s, OrchestrationClient as t };
96
- //# sourceMappingURL=index-e5BLgzcW.d.mts.map
102
+ export { PaymentRequestsClient as a, AuthClient as c, CreatePaymentRequestResponse as i, LoginOptions as l, ActivatePaymentRequestParams as n, DelegationClient as o, CreatePaymentRequestParameters as r, ConfigClient as s, OrchestrationClient as t, ActivityClient as u };
103
+ //# sourceMappingURL=index-747pyuMH.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-747pyuMH.d.mts","names":[],"sources":["../src/clients/activity.ts","../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/payment-requests.ts","../src/clients/orchestration.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAMa,cAAA;;yBAC6B;kCAG7B,gCACR,QAAQ;;;;UCDI,YAAA;WACN;;cAGE,UAAA;;;EDRA,iBAAc,OAAA;EACe,WAAA,CAAA,SAAA,ECSV,SDTU,EAAA,OAAA,ECUZ,WDVY,EAAA,OAAA,ECWZ,iBDXY;EAG7B,KAAA,CAAA;IAAA;EAAA,CAAA,ECWc,YDXd,CAAA,ECW6B,ODX7B,CCWqC,iBDXrC,CAAA;EACA,cAAA,CAAA,CAAA,ECyBa,ODzBb,CCyBqB,UDzBrB,CAAA;;;;cELA,YAAA;;yBAC6B;;;KAIrC,yCAA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";
2
2
  import { OtimClientContext } from "@otim/sdk-core/context";
3
+ import { APIClient, AuthLoginResponse, DelegationCreateRequest, DelegationStatusRequest, DelegationStatusResponse, GetDelegateAddressRequest, GetDelegateAddressResponse, GetInstructionActivityRequest, GetInstructionActivityResponse, GetMaxPriorityFeePerGasEstimateRequest, GetMaxPriorityFeePerGasEstimateResponse, GetPaymentRequestsRequest, GetPaymentRequestsResponse, MeResponse, PaginatedServiceResponse, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, PaymentsListRequest, ServiceResponse } from "@otim/utils/api";
3
4
  import { OtimAccount } from "@otim/sdk-core/account";
4
- import { APIClient, AuthLoginResponse, DelegationCreateRequest, DelegationStatusRequest, DelegationStatusResponse, GetDelegateAddressRequest, GetDelegateAddressResponse, GetMaxPriorityFeePerGasEstimateRequest, GetMaxPriorityFeePerGasEstimateResponse, GetPaymentRequestsRequest, GetPaymentRequestsResponse, MeResponse, PaginatedServiceResponse, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, PaymentsListRequest, ServiceResponse } from "@otim/utils/api";
5
5
  import { SupportedChainId } from "@otim/utils/chains";
6
6
  import { Nullable } from "@otim/utils/helpers";
7
7
  import { PaymentRequestMetadata, PaymentResponseWithActionNames } from "@otim/utils/payments";
8
8
  import { Address, Payments } from "@otim/utils/schemas";
9
9
 
10
+ //#region src/clients/activity.d.ts
11
+ declare class ActivityClient {
12
+ private readonly apiClient;
13
+ constructor(apiClient: APIClient);
14
+ getInstructionActivity(request: GetInstructionActivityRequest): Promise<GetInstructionActivityResponse>;
15
+ }
16
+ //#endregion
10
17
  //#region src/clients/auth.d.ts
11
18
  interface LoginOptions {
12
19
  address: Address$1;
@@ -92,5 +99,5 @@ declare class OrchestrationClient {
92
99
  constructor(apiClient: APIClient, account: OtimAccount, context: OtimClientContext);
93
100
  }
94
101
  //#endregion
95
- export { PaymentRequestsClient as a, AuthClient as c, CreatePaymentRequestResponse as i, LoginOptions as l, ActivatePaymentRequestParams as n, DelegationClient as o, CreatePaymentRequestParameters as r, ConfigClient as s, OrchestrationClient as t };
96
- //# sourceMappingURL=index-De8OZ-Be.d.cts.map
102
+ export { PaymentRequestsClient as a, AuthClient as c, CreatePaymentRequestResponse as i, LoginOptions as l, ActivatePaymentRequestParams as n, DelegationClient as o, CreatePaymentRequestParameters as r, ConfigClient as s, OrchestrationClient as t, ActivityClient as u };
103
+ //# sourceMappingURL=index-BH1YuouL.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BH1YuouL.d.cts","names":[],"sources":["../src/clients/activity.ts","../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/payment-requests.ts","../src/clients/orchestration.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAMa,cAAA;;yBAC6B;kCAG7B,gCACR,QAAQ;;;;UCDI,YAAA;WACN;;cAGE,UAAA;;;EDRA,iBAAc,OAAA;EACe,WAAA,CAAA,SAAA,ECSV,SDTU,EAAA,OAAA,ECUZ,WDVY,EAAA,OAAA,ECWZ,iBDXY;EAG7B,KAAA,CAAA;IAAA;EAAA,CAAA,ECWc,YDXd,CAAA,ECW6B,ODX7B,CCWqC,iBDXrC,CAAA;EACA,cAAA,CAAA,CAAA,ECyBa,ODzBb,CCyBqB,UDzBrB,CAAA;;;;cELA,YAAA;;yBAC6B;;;KAIrC,yCAAyC,QAAQ;;;;cCFzC,gBAAA;;yBAC6B;;;KAIrC,4BAA4B,QAAQ;+BAS5B,0BACR,QAAQ;sCAUU,0BAClB;;;;UCOY,8BAAA;;EJpCJ,OAAA,EIsCF,gBJtCgB;EACe,SAAA,EIsC7B,OJtC6B;EAG7B,KAAA,CAAA,EAAA,MAAA,GAAA,MAAA;EACA,KAAA,CAAA,EIoCH,QJpCG,CIoCM,OJpCN,CAAA;EAAR;;;;aIyCQ;EH1CI,IAAA,CAAA,EAAA,MAAA;AAIjB;AAEgC,UGwCf,4BAAA,CHxCe;EACF,SAAA,EAAA,MAAA;EACA,sBAAA,EGwCJ,OHxCI;;AAGH,UGwCV,4BAAA,CHxCU;EAAuB,aAAA,EGyCjC,8BHzCiC;EAAR,iBAAA,EAAA,MAAA;;AAehB,cGiCb,qBAAA,CHjCa;EAAO,iBAAA,SAAA;;;yBGmCD,oBACF,sBACA;EFnEjB,MAAA,CAAA,MAAA,EEuED,8BFvEa,CAAA,EEwEpB,OFxEoB,CEwEZ,4BFxEY,CAAA;EACiB,QAAA,CAAA,MAAA,EEmHjB,4BFnHiB,CAAA,EEmHc,OFnHd,CAAA,IAAA,CAAA;EAGtC,QAAA,0BAAA;EACC,QAAA,aAAA;EAAiD,QAAA,aAAA;EAAR,QAAA,6BAAA;EAAO,QAAA,kBAAA;;sBE+PxC,+BACR,QAAQ,gBAAgB;uCAKhB,sBACR,QAAQ,yBAAyB;EDxQzB,2BAAgB,CAAA,OAAA,EC6QhB,mBD7QgB,CAAA,EC8QxB,OD9QwB,CC8QhB,wBD9QgB,CC8QS,QD9QT,CAAA,CAAA;EACa,IAAA,CAAA,OAAA,ECkR7B,yBDlR6B,CAAA,ECmRrC,ODnRqC,CCmR7B,wBDnR6B,CCmRJ,0BDnRI,CAAA,CAAA;;;;cEJ7B,mBAAA;;;;4BACsB;yBAGH,oBACF,sBACA;ALN9B"}
package/dist/index.cjs CHANGED
@@ -1,10 +1,11 @@
1
1
  const require_account = require('./account-Bwm5PTcc.cjs');
2
- const require_clients = require('./clients-DBRhkU4y.cjs');
2
+ const require_clients = require('./clients-CVg-yW5b.cjs');
3
3
  const require_config = require('./config-CjGpscVk.cjs');
4
4
  const require_context = require('./context-B-Wcmhb3.cjs');
5
5
  const require_utils = require('./utils-CVQFvsfl.cjs');
6
6
 
7
7
  exports.AccountType = require_account.AccountType;
8
+ exports.ActivityClient = require_clients.ActivityClient;
8
9
  exports.AuthClient = require_clients.AuthClient;
9
10
  exports.ConfigClient = require_clients.ConfigClient;
10
11
  exports.DelegationClient = require_clients.DelegationClient;
package/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@ import "./abi-CQuxrNCU.cjs";
2
2
  import "./misc-CpZxSPCP.cjs";
3
3
  import { i as normalizeYParityValue, n as parseSignatureToVRS, r as createRlpEncodedAuthorization, t as createEIP2098Signature } from "./index-BnP8vpJJ.cjs";
4
4
  import { a as AccountType, c as OtimAccountSignMessageArgs, d as ServerAccountType, i as AccountConfig, l as PrivateKeyAccountConfig, n as isApiAccountConfig, o as ApiAccountConfig, r as isPrivateKeyAccountConfig, s as OtimAccount, t as createClientContext, u as ServerAccountConfig } from "./index-DK-40z4V.cjs";
5
- import { a as PaymentRequestsClient, c as AuthClient, i as CreatePaymentRequestResponse, l as LoginOptions, n as ActivatePaymentRequestParams, o as DelegationClient, r as CreatePaymentRequestParameters, s as ConfigClient, t as OrchestrationClient } from "./index-De8OZ-Be.cjs";
5
+ import { a as PaymentRequestsClient, c as AuthClient, i as CreatePaymentRequestResponse, l as LoginOptions, n as ActivatePaymentRequestParams, o as DelegationClient, r as CreatePaymentRequestParameters, s as ConfigClient, t as OrchestrationClient, u as ActivityClient } from "./index-BH1YuouL.cjs";
6
6
  import { a as env, c as isEnvironment, i as Environment, n as SIWE_VERSION, o as getApiUrl, r as createLoginSiweMessage, s as getTurnkeyApiUrl, t as SIWE_CHAIN_ID } from "./index-UnaahQgb.cjs";
7
7
  import { a as OtimReactClientContext, i as OtimClientContext, n as assertRequiresAuth, o as OtimServerClientContext, r as assertServerContext, t as isServerContext } from "./index-C1HSAemv.cjs";
8
- export { AccountConfig, AccountType, ActivatePaymentRequestParams, ApiAccountConfig, AuthClient, ConfigClient, CreatePaymentRequestParameters, CreatePaymentRequestResponse, DelegationClient, Environment, Environment as EnvironmentType, LoginOptions, OrchestrationClient, OtimAccount, OtimAccountSignMessageArgs, OtimClientContext, OtimReactClientContext, OtimServerClientContext, PaymentRequestsClient, PrivateKeyAccountConfig, SIWE_CHAIN_ID, SIWE_VERSION, ServerAccountConfig, ServerAccountType, assertRequiresAuth, assertServerContext, createClientContext, createEIP2098Signature, createLoginSiweMessage, createRlpEncodedAuthorization, env, getApiUrl, getTurnkeyApiUrl, isApiAccountConfig, isEnvironment, isPrivateKeyAccountConfig, isServerContext, normalizeYParityValue, parseSignatureToVRS };
8
+ export { AccountConfig, AccountType, ActivatePaymentRequestParams, ActivityClient, ApiAccountConfig, AuthClient, ConfigClient, CreatePaymentRequestParameters, CreatePaymentRequestResponse, DelegationClient, Environment, Environment as EnvironmentType, LoginOptions, OrchestrationClient, OtimAccount, OtimAccountSignMessageArgs, OtimClientContext, OtimReactClientContext, OtimServerClientContext, PaymentRequestsClient, PrivateKeyAccountConfig, SIWE_CHAIN_ID, SIWE_VERSION, ServerAccountConfig, ServerAccountType, assertRequiresAuth, assertServerContext, createClientContext, createEIP2098Signature, createLoginSiweMessage, createRlpEncodedAuthorization, env, getApiUrl, getTurnkeyApiUrl, isApiAccountConfig, isEnvironment, isPrivateKeyAccountConfig, isServerContext, normalizeYParityValue, parseSignatureToVRS };
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import "./abi-Bd3X6gV9.mjs";
2
2
  import "./misc-CX4pLJaA.mjs";
3
3
  import { i as normalizeYParityValue, n as parseSignatureToVRS, r as createRlpEncodedAuthorization, t as createEIP2098Signature } from "./index-DW_zBRKz.mjs";
4
4
  import { a as AccountType, c as OtimAccountSignMessageArgs, d as ServerAccountType, i as AccountConfig, l as PrivateKeyAccountConfig, n as isApiAccountConfig, o as ApiAccountConfig, r as isPrivateKeyAccountConfig, s as OtimAccount, t as createClientContext, u as ServerAccountConfig } from "./index-B4fkcFy5.mjs";
5
- import { a as PaymentRequestsClient, c as AuthClient, i as CreatePaymentRequestResponse, l as LoginOptions, n as ActivatePaymentRequestParams, o as DelegationClient, r as CreatePaymentRequestParameters, s as ConfigClient, t as OrchestrationClient } from "./index-e5BLgzcW.mjs";
5
+ import { a as PaymentRequestsClient, c as AuthClient, i as CreatePaymentRequestResponse, l as LoginOptions, n as ActivatePaymentRequestParams, o as DelegationClient, r as CreatePaymentRequestParameters, s as ConfigClient, t as OrchestrationClient, u as ActivityClient } from "./index-747pyuMH.mjs";
6
6
  import { a as env, c as isEnvironment, i as Environment, n as SIWE_VERSION, o as getApiUrl, r as createLoginSiweMessage, s as getTurnkeyApiUrl, t as SIWE_CHAIN_ID } from "./index-C4N2Xixk.mjs";
7
7
  import { a as OtimReactClientContext, i as OtimClientContext, n as assertRequiresAuth, o as OtimServerClientContext, r as assertServerContext, t as isServerContext } from "./index-CcCMIBgF.mjs";
8
- export { AccountConfig, AccountType, ActivatePaymentRequestParams, ApiAccountConfig, AuthClient, ConfigClient, CreatePaymentRequestParameters, CreatePaymentRequestResponse, DelegationClient, Environment, Environment as EnvironmentType, LoginOptions, OrchestrationClient, OtimAccount, OtimAccountSignMessageArgs, OtimClientContext, OtimReactClientContext, OtimServerClientContext, PaymentRequestsClient, PrivateKeyAccountConfig, SIWE_CHAIN_ID, SIWE_VERSION, ServerAccountConfig, ServerAccountType, assertRequiresAuth, assertServerContext, createClientContext, createEIP2098Signature, createLoginSiweMessage, createRlpEncodedAuthorization, env, getApiUrl, getTurnkeyApiUrl, isApiAccountConfig, isEnvironment, isPrivateKeyAccountConfig, isServerContext, normalizeYParityValue, parseSignatureToVRS };
8
+ export { AccountConfig, AccountType, ActivatePaymentRequestParams, ActivityClient, ApiAccountConfig, AuthClient, ConfigClient, CreatePaymentRequestParameters, CreatePaymentRequestResponse, DelegationClient, Environment, Environment as EnvironmentType, LoginOptions, OrchestrationClient, OtimAccount, OtimAccountSignMessageArgs, OtimClientContext, OtimReactClientContext, OtimServerClientContext, PaymentRequestsClient, PrivateKeyAccountConfig, SIWE_CHAIN_ID, SIWE_VERSION, ServerAccountConfig, ServerAccountType, assertRequiresAuth, assertServerContext, createClientContext, createEIP2098Signature, createLoginSiweMessage, createRlpEncodedAuthorization, env, getApiUrl, getTurnkeyApiUrl, isApiAccountConfig, isEnvironment, isPrivateKeyAccountConfig, isServerContext, normalizeYParityValue, parseSignatureToVRS };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as ServerAccountType, i as AccountType, n as isApiAccountConfig, r as isPrivateKeyAccountConfig, t as createClientContext } from "./account-p4sxzIt3.mjs";
2
- import { a as AuthClient, i as ConfigClient, n as PaymentRequestsClient, r as DelegationClient, t as OrchestrationClient } from "./clients-DMKeLhcJ.mjs";
2
+ import { a as AuthClient, i as ConfigClient, n as PaymentRequestsClient, o as ActivityClient, r as DelegationClient, t as OrchestrationClient } from "./clients-DnPvBXkX.mjs";
3
3
  import { a as env, c as isEnvironment, i as Environment, n as SIWE_VERSION, o as getApiUrl, r as createLoginSiweMessage, s as getTurnkeyApiUrl, t as SIWE_CHAIN_ID } from "./config-C_nc1DXn.mjs";
4
4
  import { n as assertRequiresAuth, r as assertServerContext, t as isServerContext } from "./context-uTye69B0.mjs";
5
5
  import { i as normalizeYParityValue, n as parseSignatureToVRS, r as createRlpEncodedAuthorization, t as createEIP2098Signature } from "./utils-DziAHBiz.mjs";
6
6
 
7
- export { AccountType, AuthClient, ConfigClient, DelegationClient, Environment, OrchestrationClient, PaymentRequestsClient, SIWE_CHAIN_ID, SIWE_VERSION, ServerAccountType, assertRequiresAuth, assertServerContext, createClientContext, createEIP2098Signature, createLoginSiweMessage, createRlpEncodedAuthorization, env, getApiUrl, getTurnkeyApiUrl, isApiAccountConfig, isEnvironment, isPrivateKeyAccountConfig, isServerContext, normalizeYParityValue, parseSignatureToVRS };
7
+ export { AccountType, ActivityClient, AuthClient, ConfigClient, DelegationClient, Environment, OrchestrationClient, PaymentRequestsClient, SIWE_CHAIN_ID, SIWE_VERSION, ServerAccountType, assertRequiresAuth, assertServerContext, createClientContext, createEIP2098Signature, createLoginSiweMessage, createRlpEncodedAuthorization, env, getApiUrl, getTurnkeyApiUrl, isApiAccountConfig, isEnvironment, isPrivateKeyAccountConfig, isServerContext, normalizeYParityValue, parseSignatureToVRS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otim/sdk-core",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -95,8 +95,8 @@
95
95
  "homepage": "https://github.com/otimlabs/otim-ts-sdk#readme",
96
96
  "devDependencies": {
97
97
  "@arethetypeswrong/cli": "^0.18.2",
98
- "@otim/turnkey": "0.0.2-development.0",
99
- "@otim/utils": "0.0.2-development.0",
98
+ "@otim/turnkey": "0.0.2",
99
+ "@otim/utils": "0.0.2",
100
100
  "@playwright/test": "^1.56.1",
101
101
  "@types/adm-zip": "^0.5.7",
102
102
  "@types/node": "^24.10.1",
@@ -109,8 +109,8 @@
109
109
  "tsdown": "^0.16.5",
110
110
  "typescript-eslint": "^8.47.0",
111
111
  "vitest": "^4.0.10",
112
- "@otim/eslint-config": "0.0.1",
113
- "@otim/typescript-config": "0.0.0"
112
+ "@otim/typescript-config": "0.0.0",
113
+ "@otim/eslint-config": "0.0.1"
114
114
  },
115
115
  "dependencies": {
116
116
  "@t3-oss/env-core": "^0.13.8",
@@ -1 +0,0 @@
1
- {"version":3,"file":"clients-DBRhkU4y.cjs","names":["apiClient: APIClient","account: OtimAccount","context: OtimClientContext","apiClient: APIClient","apiClient: APIClient","UnifiedPaymentSigner","ApiKeyClientSigningService","ServerWalletSigningService","apiClient: APIClient","account: OtimAccount","context: OtimClientContext","hexStringSchema","supportedChains","apiClient: APIClient","account: OtimAccount","context: OtimClientContext"],"sources":["../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/helpers/payment-signer.ts","../src/clients/payment-requests.ts","../src/clients/orchestration.ts"],"sourcesContent":["import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient, AuthLoginResponse, MeResponse } from \"@otim/utils/api\";\nimport type { Address } from \"viem\";\n\nimport { parseSignatureToVRS } from \"@otim/utils/helpers\";\n\nimport { createLoginSiweMessage } from \"@otim/sdk-core/config\";\nimport { assertRequiresAuth } from \"@otim/sdk-core/context\";\n\nexport interface LoginOptions {\n address: Address;\n}\n\nexport class AuthClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {}\n\n async login({ address }: LoginOptions): Promise<AuthLoginResponse> {\n assertRequiresAuth(this.context);\n\n const message = createLoginSiweMessage(address, Date.now().toString());\n const signature = await this.account.signMessage({ message });\n const vrsParsedSignature = parseSignatureToVRS(signature);\n\n const response = await this.apiClient.auth.login({\n siwe: message,\n signature: vrsParsedSignature,\n });\n\n return response.data;\n }\n\n async getCurrentUser(): Promise<MeResponse> {\n const response = await this.apiClient.auth.me();\n return response.data;\n }\n}\n","import type {\n APIClient,\n GetMaxPriorityFeePerGasEstimateRequest,\n GetMaxPriorityFeePerGasEstimateResponse,\n} from \"@otim/utils/api\";\n\nexport class ConfigClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getMaxPriorityFeeEstimate({\n chainId,\n }: GetMaxPriorityFeePerGasEstimateRequest): Promise<GetMaxPriorityFeePerGasEstimateResponse> {\n const response =\n await this.apiClient.config.getMaxPriorityFeePerGasEstimate({ chainId });\n\n return response.data;\n }\n}\n","import type {\n APIClient,\n DelegationCreateRequest,\n DelegationStatusRequest,\n DelegationStatusResponse,\n GetDelegateAddressRequest,\n GetDelegateAddressResponse,\n} from \"@otim/utils/api\";\n\nexport class DelegationClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getDelegateAddress({\n chainId,\n }: GetDelegateAddressRequest): Promise<GetDelegateAddressResponse> {\n const response = await this.apiClient.config.getDelegateAddress({\n chainId,\n });\n\n return response.data;\n }\n\n async getDelegationStatus(\n options: DelegationStatusRequest,\n ): Promise<DelegationStatusResponse> {\n const response = await this.apiClient.account.getDelegationStatus({\n address: options.address,\n chainId: options.chainId,\n });\n\n return response.data;\n }\n\n async createDelegation(\n delegationRequest: DelegationCreateRequest,\n ): Promise<void> {\n await this.apiClient.account.createDelegation(delegationRequest);\n }\n}\n","import type { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { Address } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport {\n ApiKeyClientSigningService,\n ServerWalletSigningService,\n UnifiedPaymentSigner,\n} from \"@otim/turnkey/signing\";\nimport { createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport { isApiAccountConfig } from \"@otim/sdk-core/account\";\n\nexport interface CreatePaymentSignerParams {\n context: OtimServerClientContext;\n buildResponse: PaymentResponseWithActionNames;\n publicClient: PublicClient;\n delegateAddressMap: Map<number, Address>;\n}\n\ntype CreatePaymentSignerResult = Awaited<\n ReturnType<UnifiedPaymentSigner[\"signAll\"]>\n>;\n\nexport async function createPaymentSigner(\n params: CreatePaymentSignerParams,\n): Promise<CreatePaymentSignerResult> {\n const { context, buildResponse, publicClient, delegateAddressMap } = params;\n\n if (isApiAccountConfig(context.config)) {\n const signingService = new ApiKeyClientSigningService(\n context.config.publicKey,\n context.config.privateKey,\n );\n\n const signer = new UnifiedPaymentSigner({\n buildResponse,\n signingService,\n publicClient,\n delegateAddressMap,\n });\n\n return signer.signAll();\n }\n\n const account = privateKeyToAccount(context.config.privateKey);\n const walletClient = createWalletClient({\n account,\n transport: http(),\n });\n\n const signingService =\n ServerWalletSigningService.fromViemWallet(walletClient);\n\n const signer = new UnifiedPaymentSigner({\n buildResponse,\n signingService,\n publicClient,\n delegateAddressMap,\n });\n\n return signer.signAll();\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type {\n APIClient,\n GetPaymentRequestsRequest,\n GetPaymentRequestsResponse,\n PaginatedServiceResponse,\n PaymentRequestBuildRequest,\n PaymentRequestDetailsRequest,\n PaymentRequestDetailsResponse,\n PaymentsListRequest,\n ServiceResponse,\n} from \"@otim/utils/api\";\nimport type { SupportedChainId } from \"@otim/utils/chains\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { PaymentRequestMetadata } from \"@otim/utils/payments\";\nimport type { Address, Payments } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport {\n getChainById,\n getChainTokens,\n getTokenAddress,\n getTokenMetadata,\n supportedChains,\n} from \"@otim/utils/chains\";\nimport { validateIso8601Date } from \"@otim/utils/helpers\";\nimport {\n addActionNamesToInstructions,\n buildPaymentMetadata,\n createChainTokenConfigs,\n createComprehensivePaymentRequest,\n extractActionNamesMap,\n} from \"@otim/utils/payments\";\nimport { hexStringSchema } from \"@otim/utils/schemas\";\nimport { createPublicClient, http } from \"viem\";\n\nimport { assertServerContext } from \"@otim/sdk-core/context\";\n\nimport { createPaymentSigner } from \"./helpers/payment-signer\";\n\nexport interface CreatePaymentRequestParameters {\n amount: number;\n chainId: SupportedChainId;\n recipient: Address;\n token?: \"USDC\" | \"USDT\";\n payer?: Nullable<Address>;\n /**\n * ISO 8601 date format (e.g., \"2024-12-31T23:59:59.000Z\")\n */\n dueDate?: string;\n metadata?: PaymentRequestMetadata;\n note?: string;\n}\n\nexport interface CreatePaymentRequestResponse {\n requestId: string;\n ephemeralWalletAddress: Address;\n}\n\nexport interface ActivatePaymentRequestParams {\n buildResponse: PaymentResponseWithActionNames;\n settlementChainId: number;\n}\n\ntype PaymentInstruction =\n PaymentResponseWithActionNames[\"completionInstructions\"][number];\n\nexport class PaymentRequestsClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {}\n\n async create(\n params: CreatePaymentRequestParameters,\n ): Promise<CreatePaymentRequestResponse> {\n const {\n chainId,\n token = \"USDC\",\n recipient,\n amount,\n payer,\n note,\n dueDate,\n metadata: customMetadata,\n } = params;\n\n if (dueDate) {\n validateIso8601Date(dueDate);\n }\n\n const feeTokenAddress = this.validateAndGetTokenAddress(chainId, token);\n const metadata = this.buildMetadata({\n token,\n amount,\n recipient,\n note,\n dueDate,\n customMetadata,\n });\n const payload = this.createPayload({\n chainId,\n recipient,\n amount,\n payer,\n metadata,\n feeTokenAddress,\n });\n\n const buildResponse = await this.buildAndEnhancePaymentRequest(payload);\n\n await this.activate({ buildResponse, settlementChainId: chainId });\n\n return {\n requestId: buildResponse.requestId,\n ephemeralWalletAddress: buildResponse.ephemeralWalletAddress,\n };\n }\n\n async activate(params: ActivatePaymentRequestParams): Promise<void> {\n assertServerContext(this.context);\n\n const { buildResponse, settlementChainId } = params;\n const publicClient = this.createPublicClient(settlementChainId);\n\n const instructions = [\n ...buildResponse.completionInstructions,\n ...buildResponse.instructions,\n ];\n\n const delegateAddressMap = await this.fetchDelegateAddresses(instructions);\n\n const {\n signedAuthorization,\n completionInstructions,\n instructions: signedInstructions,\n } = await createPaymentSigner({\n context: this.context,\n buildResponse,\n publicClient,\n delegateAddressMap,\n });\n\n await this.apiClient.payments.newPaymentRequest({\n requestId: buildResponse.requestId,\n signedAuthorization,\n completionInstructions,\n instructions: signedInstructions,\n });\n }\n\n private validateAndGetTokenAddress(chainId: number, token: string): Address {\n const tokenAddress = getTokenAddress(chainId, token);\n if (!tokenAddress) {\n throw new Error(`Token ${token} not supported on chain ${chainId}`);\n }\n\n const tokenMetadata = getTokenMetadata(token);\n if (!tokenMetadata) {\n throw new Error(`Token ${token} metadata not found`);\n }\n\n return hexStringSchema.parse(tokenAddress);\n }\n\n private buildMetadata(params: {\n token: string;\n amount: number;\n recipient: Address;\n note?: string;\n dueDate?: string;\n customMetadata?: PaymentRequestMetadata;\n }): PaymentRequestMetadata {\n const { token, amount, recipient, note, dueDate, customMetadata } = params;\n\n const baseMetadata = buildPaymentMetadata({\n tokenSymbol: token,\n amountInUSD: amount,\n fromAccountAddress: recipient,\n note,\n dueDate,\n hasInvoiceMetadata: false,\n });\n\n return customMetadata\n ? { ...baseMetadata, ...customMetadata }\n : baseMetadata;\n }\n\n private createPayload(params: {\n chainId: number;\n recipient: Address;\n amount: number;\n payer?: Address | null;\n metadata: PaymentRequestMetadata;\n feeTokenAddress: Address;\n }): PaymentRequestBuildRequest {\n const { chainId, recipient, amount, payer, metadata, feeTokenAddress } =\n params;\n\n const tokens = Object.values(supportedChains.mainnet).flatMap((chain) =>\n getChainTokens(chain.id),\n );\n\n const chainTokenConfigs = createChainTokenConfigs(tokens);\n\n return createComprehensivePaymentRequest({\n settlementChainId: chainId,\n recipient,\n amount: amount.toString(),\n ephemeralWalletAddress: recipient,\n chainTokenConfigs,\n payerAddress: payer ?? null,\n metadata,\n feeToken: feeTokenAddress,\n });\n }\n\n private async buildAndEnhancePaymentRequest(\n payload: PaymentRequestBuildRequest,\n ): Promise<PaymentResponseWithActionNames> {\n const actionNames = extractActionNamesMap(\n payload.completionInstructions,\n payload.instructions,\n );\n\n const response = await this.apiClient.payments.buildPaymentRequest(payload);\n\n return addActionNamesToInstructions(response.data, actionNames);\n }\n\n private createPublicClient(chainId: number): PublicClient {\n const chain = getChainById(chainId);\n if (!chain) {\n throw new Error(`Chain with id ${chainId} not found`);\n }\n\n return createPublicClient({ chain, transport: http() });\n }\n\n private async fetchDelegateAddresses(\n instructions: PaymentInstruction[],\n ): Promise<Map<number, Address>> {\n const chainIds = Array.from(\n new Set(instructions.map((instruction) => instruction.chainId)),\n );\n\n const addresses = await Promise.all(\n chainIds.map(async (chainId) => {\n const response = await this.apiClient.config.getDelegateAddress({\n chainId,\n });\n const address = hexStringSchema.parse(\n response.data.otimDelegateAddress,\n );\n return [chainId, address] as const;\n }),\n );\n\n return new Map(addresses);\n }\n\n async getDetails(\n request: PaymentRequestDetailsRequest,\n ): Promise<ServiceResponse<PaymentRequestDetailsResponse>> {\n return this.apiClient.payments.getPaymentRequestDetails(request);\n }\n\n async listOutgoingPaymentRequests(\n request: PaymentsListRequest,\n ): Promise<PaginatedServiceResponse<Payments>> {\n return this.apiClient.payments.getOutgoingPaymentsList(request);\n }\n\n async listIncomingPaymentRequests(\n request: PaymentsListRequest,\n ): Promise<PaginatedServiceResponse<Payments>> {\n return this.apiClient.payments.getIncomingPaymentsList(request);\n }\n\n async list(\n request: GetPaymentRequestsRequest,\n ): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>> {\n return this.apiClient.payments.getPaymentRequests(request);\n }\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient } from \"@otim/utils/api\";\n\nimport { PaymentRequestsClient } from \"./payment-requests\";\n\nexport class OrchestrationClient {\n public readonly paymentRequests: PaymentRequestsClient;\n\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {\n this.paymentRequests = new PaymentRequestsClient(\n apiClient,\n account,\n context,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAcA,IAAa,aAAb,MAAwB;CACtB,YACE,AAAiBA,WACjB,AAAiBC,SACjB,AAAiBC,SACjB;EAHiB;EACA;EACA;;CAGnB,MAAM,MAAM,EAAE,WAAqD;AACjE,kDAAmB,KAAK,QAAQ;EAEhC,MAAM,6DAAiC,SAAS,KAAK,KAAK,CAAC,UAAU,CAAC;EAEtE,MAAM,mEADY,MAAM,KAAK,QAAQ,YAAY,EAAE,SAAS,CAAC,CACJ;AAOzD,UALiB,MAAM,KAAK,UAAU,KAAK,MAAM;GAC/C,MAAM;GACN,WAAW;GACZ,CAAC,EAEc;;CAGlB,MAAM,iBAAsC;AAE1C,UADiB,MAAM,KAAK,UAAU,KAAK,IAAI,EAC/B;;;;;;AChCpB,IAAa,eAAb,MAA0B;CACxB,YAAY,AAAiBC,WAAsB;EAAtB;;CAE7B,MAAM,0BAA0B,EAC9B,WAC2F;AAI3F,UAFE,MAAM,KAAK,UAAU,OAAO,gCAAgC,EAAE,SAAS,CAAC,EAE1D;;;;;;ACNpB,IAAa,mBAAb,MAA8B;CAC5B,YAAY,AAAiBC,WAAsB;EAAtB;;CAE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A,SACA,QACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"clients-DMKeLhcJ.mjs","names":["apiClient: APIClient","account: OtimAccount","context: OtimClientContext","apiClient: APIClient","apiClient: APIClient","apiClient: APIClient","account: OtimAccount","context: OtimClientContext","apiClient: APIClient","account: OtimAccount","context: OtimClientContext"],"sources":["../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/helpers/payment-signer.ts","../src/clients/payment-requests.ts","../src/clients/orchestration.ts"],"sourcesContent":["import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient, AuthLoginResponse, MeResponse } from \"@otim/utils/api\";\nimport type { Address } from \"viem\";\n\nimport { parseSignatureToVRS } from \"@otim/utils/helpers\";\n\nimport { createLoginSiweMessage } from \"@otim/sdk-core/config\";\nimport { assertRequiresAuth } from \"@otim/sdk-core/context\";\n\nexport interface LoginOptions {\n address: Address;\n}\n\nexport class AuthClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {}\n\n async login({ address }: LoginOptions): Promise<AuthLoginResponse> {\n assertRequiresAuth(this.context);\n\n const message = createLoginSiweMessage(address, Date.now().toString());\n const signature = await this.account.signMessage({ message });\n const vrsParsedSignature = parseSignatureToVRS(signature);\n\n const response = await this.apiClient.auth.login({\n siwe: message,\n signature: vrsParsedSignature,\n });\n\n return response.data;\n }\n\n async getCurrentUser(): Promise<MeResponse> {\n const response = await this.apiClient.auth.me();\n return response.data;\n }\n}\n","import type {\n APIClient,\n GetMaxPriorityFeePerGasEstimateRequest,\n GetMaxPriorityFeePerGasEstimateResponse,\n} from \"@otim/utils/api\";\n\nexport class ConfigClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getMaxPriorityFeeEstimate({\n chainId,\n }: GetMaxPriorityFeePerGasEstimateRequest): Promise<GetMaxPriorityFeePerGasEstimateResponse> {\n const response =\n await this.apiClient.config.getMaxPriorityFeePerGasEstimate({ chainId });\n\n return response.data;\n }\n}\n","import type {\n APIClient,\n DelegationCreateRequest,\n DelegationStatusRequest,\n DelegationStatusResponse,\n GetDelegateAddressRequest,\n GetDelegateAddressResponse,\n} from \"@otim/utils/api\";\n\nexport class DelegationClient {\n constructor(private readonly apiClient: APIClient) {}\n\n async getDelegateAddress({\n chainId,\n }: GetDelegateAddressRequest): Promise<GetDelegateAddressResponse> {\n const response = await this.apiClient.config.getDelegateAddress({\n chainId,\n });\n\n return response.data;\n }\n\n async getDelegationStatus(\n options: DelegationStatusRequest,\n ): Promise<DelegationStatusResponse> {\n const response = await this.apiClient.account.getDelegationStatus({\n address: options.address,\n chainId: options.chainId,\n });\n\n return response.data;\n }\n\n async createDelegation(\n delegationRequest: DelegationCreateRequest,\n ): Promise<void> {\n await this.apiClient.account.createDelegation(delegationRequest);\n }\n}\n","import type { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { Address } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport {\n ApiKeyClientSigningService,\n ServerWalletSigningService,\n UnifiedPaymentSigner,\n} from \"@otim/turnkey/signing\";\nimport { createWalletClient, http } from \"viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport { isApiAccountConfig } from \"@otim/sdk-core/account\";\n\nexport interface CreatePaymentSignerParams {\n context: OtimServerClientContext;\n buildResponse: PaymentResponseWithActionNames;\n publicClient: PublicClient;\n delegateAddressMap: Map<number, Address>;\n}\n\ntype CreatePaymentSignerResult = Awaited<\n ReturnType<UnifiedPaymentSigner[\"signAll\"]>\n>;\n\nexport async function createPaymentSigner(\n params: CreatePaymentSignerParams,\n): Promise<CreatePaymentSignerResult> {\n const { context, buildResponse, publicClient, delegateAddressMap } = params;\n\n if (isApiAccountConfig(context.config)) {\n const signingService = new ApiKeyClientSigningService(\n context.config.publicKey,\n context.config.privateKey,\n );\n\n const signer = new UnifiedPaymentSigner({\n buildResponse,\n signingService,\n publicClient,\n delegateAddressMap,\n });\n\n return signer.signAll();\n }\n\n const account = privateKeyToAccount(context.config.privateKey);\n const walletClient = createWalletClient({\n account,\n transport: http(),\n });\n\n const signingService =\n ServerWalletSigningService.fromViemWallet(walletClient);\n\n const signer = new UnifiedPaymentSigner({\n buildResponse,\n signingService,\n publicClient,\n delegateAddressMap,\n });\n\n return signer.signAll();\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type {\n APIClient,\n GetPaymentRequestsRequest,\n GetPaymentRequestsResponse,\n PaginatedServiceResponse,\n PaymentRequestBuildRequest,\n PaymentRequestDetailsRequest,\n PaymentRequestDetailsResponse,\n PaymentsListRequest,\n ServiceResponse,\n} from \"@otim/utils/api\";\nimport type { SupportedChainId } from \"@otim/utils/chains\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { PaymentRequestMetadata } from \"@otim/utils/payments\";\nimport type { Address, Payments } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport {\n getChainById,\n getChainTokens,\n getTokenAddress,\n getTokenMetadata,\n supportedChains,\n} from \"@otim/utils/chains\";\nimport { validateIso8601Date } from \"@otim/utils/helpers\";\nimport {\n addActionNamesToInstructions,\n buildPaymentMetadata,\n createChainTokenConfigs,\n createComprehensivePaymentRequest,\n extractActionNamesMap,\n} from \"@otim/utils/payments\";\nimport { hexStringSchema } from \"@otim/utils/schemas\";\nimport { createPublicClient, http } from \"viem\";\n\nimport { assertServerContext } from \"@otim/sdk-core/context\";\n\nimport { createPaymentSigner } from \"./helpers/payment-signer\";\n\nexport interface CreatePaymentRequestParameters {\n amount: number;\n chainId: SupportedChainId;\n recipient: Address;\n token?: \"USDC\" | \"USDT\";\n payer?: Nullable<Address>;\n /**\n * ISO 8601 date format (e.g., \"2024-12-31T23:59:59.000Z\")\n */\n dueDate?: string;\n metadata?: PaymentRequestMetadata;\n note?: string;\n}\n\nexport interface CreatePaymentRequestResponse {\n requestId: string;\n ephemeralWalletAddress: Address;\n}\n\nexport interface ActivatePaymentRequestParams {\n buildResponse: PaymentResponseWithActionNames;\n settlementChainId: number;\n}\n\ntype PaymentInstruction =\n PaymentResponseWithActionNames[\"completionInstructions\"][number];\n\nexport class PaymentRequestsClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {}\n\n async create(\n params: CreatePaymentRequestParameters,\n ): Promise<CreatePaymentRequestResponse> {\n const {\n chainId,\n token = \"USDC\",\n recipient,\n amount,\n payer,\n note,\n dueDate,\n metadata: customMetadata,\n } = params;\n\n if (dueDate) {\n validateIso8601Date(dueDate);\n }\n\n const feeTokenAddress = this.validateAndGetTokenAddress(chainId, token);\n const metadata = this.buildMetadata({\n token,\n amount,\n recipient,\n note,\n dueDate,\n customMetadata,\n });\n const payload = this.createPayload({\n chainId,\n recipient,\n amount,\n payer,\n metadata,\n feeTokenAddress,\n });\n\n const buildResponse = await this.buildAndEnhancePaymentRequest(payload);\n\n await this.activate({ buildResponse, settlementChainId: chainId });\n\n return {\n requestId: buildResponse.requestId,\n ephemeralWalletAddress: buildResponse.ephemeralWalletAddress,\n };\n }\n\n async activate(params: ActivatePaymentRequestParams): Promise<void> {\n assertServerContext(this.context);\n\n const { buildResponse, settlementChainId } = params;\n const publicClient = this.createPublicClient(settlementChainId);\n\n const instructions = [\n ...buildResponse.completionInstructions,\n ...buildResponse.instructions,\n ];\n\n const delegateAddressMap = await this.fetchDelegateAddresses(instructions);\n\n const {\n signedAuthorization,\n completionInstructions,\n instructions: signedInstructions,\n } = await createPaymentSigner({\n context: this.context,\n buildResponse,\n publicClient,\n delegateAddressMap,\n });\n\n await this.apiClient.payments.newPaymentRequest({\n requestId: buildResponse.requestId,\n signedAuthorization,\n completionInstructions,\n instructions: signedInstructions,\n });\n }\n\n private validateAndGetTokenAddress(chainId: number, token: string): Address {\n const tokenAddress = getTokenAddress(chainId, token);\n if (!tokenAddress) {\n throw new Error(`Token ${token} not supported on chain ${chainId}`);\n }\n\n const tokenMetadata = getTokenMetadata(token);\n if (!tokenMetadata) {\n throw new Error(`Token ${token} metadata not found`);\n }\n\n return hexStringSchema.parse(tokenAddress);\n }\n\n private buildMetadata(params: {\n token: string;\n amount: number;\n recipient: Address;\n note?: string;\n dueDate?: string;\n customMetadata?: PaymentRequestMetadata;\n }): PaymentRequestMetadata {\n const { token, amount, recipient, note, dueDate, customMetadata } = params;\n\n const baseMetadata = buildPaymentMetadata({\n tokenSymbol: token,\n amountInUSD: amount,\n fromAccountAddress: recipient,\n note,\n dueDate,\n hasInvoiceMetadata: false,\n });\n\n return customMetadata\n ? { ...baseMetadata, ...customMetadata }\n : baseMetadata;\n }\n\n private createPayload(params: {\n chainId: number;\n recipient: Address;\n amount: number;\n payer?: Address | null;\n metadata: PaymentRequestMetadata;\n feeTokenAddress: Address;\n }): PaymentRequestBuildRequest {\n const { chainId, recipient, amount, payer, metadata, feeTokenAddress } =\n params;\n\n const tokens = Object.values(supportedChains.mainnet).flatMap((chain) =>\n getChainTokens(chain.id),\n );\n\n const chainTokenConfigs = createChainTokenConfigs(tokens);\n\n return createComprehensivePaymentRequest({\n settlementChainId: chainId,\n recipient,\n amount: amount.toString(),\n ephemeralWalletAddress: recipient,\n chainTokenConfigs,\n payerAddress: payer ?? null,\n metadata,\n feeToken: feeTokenAddress,\n });\n }\n\n private async buildAndEnhancePaymentRequest(\n payload: PaymentRequestBuildRequest,\n ): Promise<PaymentResponseWithActionNames> {\n const actionNames = extractActionNamesMap(\n payload.completionInstructions,\n payload.instructions,\n );\n\n const response = await this.apiClient.payments.buildPaymentRequest(payload);\n\n return addActionNamesToInstructions(response.data, actionNames);\n }\n\n private createPublicClient(chainId: number): PublicClient {\n const chain = getChainById(chainId);\n if (!chain) {\n throw new Error(`Chain with id ${chainId} not found`);\n }\n\n return createPublicClient({ chain, transport: http() });\n }\n\n private async fetchDelegateAddresses(\n instructions: PaymentInstruction[],\n ): Promise<Map<number, Address>> {\n const chainIds = Array.from(\n new Set(instructions.map((instruction) => instruction.chainId)),\n );\n\n const addresses = await Promise.all(\n chainIds.map(async (chainId) => {\n const response = await this.apiClient.config.getDelegateAddress({\n chainId,\n });\n const address = hexStringSchema.parse(\n response.data.otimDelegateAddress,\n );\n return [chainId, address] as const;\n }),\n );\n\n return new Map(addresses);\n }\n\n async getDetails(\n request: PaymentRequestDetailsRequest,\n ): Promise<ServiceResponse<PaymentRequestDetailsResponse>> {\n return this.apiClient.payments.getPaymentRequestDetails(request);\n }\n\n async listOutgoingPaymentRequests(\n request: PaymentsListRequest,\n ): Promise<PaginatedServiceResponse<Payments>> {\n return this.apiClient.payments.getOutgoingPaymentsList(request);\n }\n\n async listIncomingPaymentRequests(\n request: PaymentsListRequest,\n ): Promise<PaginatedServiceResponse<Payments>> {\n return this.apiClient.payments.getIncomingPaymentsList(request);\n }\n\n async list(\n request: GetPaymentRequestsRequest,\n ): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>> {\n return this.apiClient.payments.getPaymentRequests(request);\n }\n}\n","import type { OtimAccount } from \"@otim/sdk-core/account\";\nimport type { OtimClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient } from \"@otim/utils/api\";\n\nimport { PaymentRequestsClient } from \"./payment-requests\";\n\nexport class OrchestrationClient {\n public readonly paymentRequests: PaymentRequestsClient;\n\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimClientContext,\n ) {\n this.paymentRequests = new PaymentRequestsClient(\n apiClient,\n account,\n context,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAcA,IAAa,aAAb,MAAwB;CACtB,YACE,AAAiBA,WACjB,AAAiBC,SACjB,AAAiBC,SACjB;EAHiB;EACA;EACA;;CAGnB,MAAM,MAAM,EAAE,WAAqD;AACjE,qBAAmB,KAAK,QAAQ;EA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AAmB,EAC9D,SACD,CAAC;AAIF,UAAO,CAAC,SAHQ,gBAAgB,MAC9B,SAAS,KAAK,oBACf,CACwB;IACzB,CACH;AAED,SAAO,IAAI,IAAI,UAAU;;CAG3B,MAAM,WACJ,SACyD;AACzD,SAAO,KAAK,UAAU,SAAS,yBAAyB,QAAQ;;CAGlE,MAAM,4BACJ,SAC6C;AAC7C,SAAO,KAAK,UAAU,SAAS,wBAAwB,QAAQ;;CAGjE,MAAM,4BACJ,SAC6C;AAC7C,SAAO,KAAK,UAAU,SAAS,wBAAwB,QAAQ;;CAGjE,MAAM,KACJ,SAC+D;AAC/D,SAAO,KAAK,UAAU,SAAS,mBAAmB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxR9D,IAAa,sBAAb,MAAiC;CAG/B,YACE,AAAiBC,WACjB,AAAiBC,SACjB,AAAiBC,SACjB;EAHiB;EACA;EACA;wBALH;AAOd,OAAK,kBAAkB,IAAI,sBACzB,WACA,SACA,QACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-De8OZ-Be.d.cts","names":[],"sources":["../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/payment-requests.ts","../src/clients/orchestration.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;UAUiB,YAAA;WACN;;cAGE,UAAA;;;EAJI,iBAAY,OAAA;EAIhB,WAAA,CAAA,SAAU,EAES,SAFT,EAAA,OAAA,EAGO,WAHP,EAAA,OAAA,EAIO,iBAJP;EAES,KAAA,CAAA;IAAA;EAAA,CAAA,EAKL,YALK,CAAA,EAKU,OALV,CAKkB,iBALlB,CAAA;EACF,cAAA,CAAA,CAAA,EAmBJ,OAnBI,CAmBI,UAnBJ,CAAA;;;;cCXjB,YAAA;;yBAC6B;;;KAIrC,yCAAyC,QAAQ;;;;cCFzC,gBAAA;;yBAC6B;;;KAIrC,4BAA4B,QAAQ;+BAS5B,0BACR,QAAQ;sCAUU,0BA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"file":"index-e5BLgzcW.d.mts","names":[],"sources":["../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/payment-requests.ts","../src/clients/orchestration.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;UAUiB,YAAA;WACN;;cAGE,UAAA;;;EAJI,iBAAY,OAAA;EAIhB,WAAA,CAAA,SAAU,EAES,SAFT,EAAA,OAAA,EAGO,WAHP,EAAA,OAAA,EAIO,iBAJP;EAES,KAAA,CAAA;IAAA;EAAA,CAAA,EAKL,YALK,CAAA,EAKU,OALV,CAKkB,iBALlB,CAAA;EACF,cAAA,CAAA,CAAA,EAmBJ,OAnBI,CAmBI,UAnBJ,CAAA;;;;cCXjB,YAAA;;yBAC6B;;;KAIrC,yCAAyC,QAAQ;;;;cCFzC,gBAAA;;yBAC6B;;;KAIrC,4BAA4B,QAAQ;+BAS5B,0BACR,QAAQ;sCAUU,0BAClB;;;;UCOY,8BAAA;;EHhCA,OAAA,EGkCN,gBHlCkB;EAIhB,SAAA,EG+BA,OH/BU;EAES,KAAA,CAAA,EAAA,MAAA,GAAA,MAAA;EACF,KAAA,CAAA,EG8BpB,QH9BoB,CG8BX,OH9BW,CAAA;EACA;;;EAGoB,OAAA,CAAA,EAAA,MAAA;EAAR,QAAA,CAAA,EG+B7B,sBH/B6B;EAeR,IAAA,CAAA,EAAA,MAAA;;AAAD,UGoBhB,4BAAA,CHpBgB;;0BGsBP;;AFpDb,UEuDI,4BAAA,CFvDQ;EACiB,aAAA,EEuDzB,8BFvDyB;EAGtC,iBAAA,EAAA,MAAA;;AACkD,cE0DzC,qBAAA,CF1DyC;EAAR,iBAAA,SAAA;EAAO,iBAAA,OAAA;;yBE4DrB,oBACF,sBACA;iBAIlB,iCACP,QAAQ;EDrEA,QAAA,CAAA,MAAA,ECiHY,4BDjHI,CAAA,ECiH2B,ODjH3B,CAAA,IAAA,CAAA;EACa,QAAA,0BAAA;EAGtC,QAAA,aAAA;EACC,QAAA,aAAA;EAAoC,QAA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