@otim/sdk-core 0.0.4-alpha.0 → 0.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otim/sdk-core",
3
- "version": "0.0.4-alpha.0",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -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/typescript-config": "0.0.0",
113
- "@otim/eslint-config": "0.0.1"
112
+ "@otim/eslint-config": "0.0.1",
113
+ "@otim/typescript-config": "0.0.0"
114
114
  },
115
115
  "dependencies": {
116
116
  "@t3-oss/env-core": "^0.13.8",
@@ -1 +0,0 @@
1
- {"version":3,"file":"clients-BCyzdTLc.cjs","names":["apiClient: APIClient","apiClient: APIClient","account: OtimAccount","context: OtimClientContext","apiClient: APIClient","apiClient: APIClient","UnifiedPaymentSigner","ApiKeyClientSigningService","ServerWalletSigningService","apiClient: APIClient","account: OtimAccount","context: OtimServerClientContext","hexStringSchema","hexStringSchema","supportedChains"],"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/orchestration.ts","../src/clients/helpers/prepare-payment-request.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 { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type {\n APIClient,\n GetPaymentRequestsRequest,\n GetPaymentRequestsResponse,\n PaginatedServiceResponse,\n PaymentRequestBuildRequest,\n PaymentRequestDetailsRequest,\n PaymentRequestDetailsResponse,\n ServiceResponse,\n} from \"@otim/utils/api\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { Address } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport { getChainById } from \"@otim/utils/chains\";\nimport {\n addActionNamesToInstructions,\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\";\nimport type { PreparedPaymentRequest } from \"./helpers/prepare-payment-request\";\n\nexport type { PreparedPaymentRequest } from \"./helpers/prepare-payment-request\";\n\nexport interface CreatePaymentRequestResponse {\n requestId: string;\n ephemeralWalletAddress: Address;\n}\n\ntype PaymentInstruction =\n PaymentResponseWithActionNames[\"completionInstructions\"][number];\n\nexport class OrchestrationClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimServerClientContext,\n ) {}\n\n async create(\n preparedRequest: PreparedPaymentRequest,\n ): Promise<CreatePaymentRequestResponse> {\n assertServerContext(this.context);\n\n const { payload, chainId } = preparedRequest;\n\n const buildResponse = await this.buildAndEnhancePaymentRequest(payload);\n await this.activate(buildResponse, chainId);\n\n return {\n requestId: buildResponse.requestId,\n ephemeralWalletAddress: buildResponse.ephemeralWalletAddress,\n };\n }\n\n async getDetails(\n request: PaymentRequestDetailsRequest,\n ): Promise<ServiceResponse<PaymentRequestDetailsResponse>> {\n return this.apiClient.payments.getPaymentRequestDetails(request);\n }\n\n async list(\n request: GetPaymentRequestsRequest,\n ): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>> {\n return this.apiClient.payments.getPaymentRequests(request);\n }\n\n private async activate(\n buildResponse: PaymentResponseWithActionNames,\n settlementChainId: number,\n ): Promise<void> {\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 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","import type { PaymentRequestBuildRequest } from \"@otim/utils/api\";\nimport type { SupportedChainId } from \"@otim/utils/chains\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { PaymentRequestMetadata } from \"@otim/utils/payments\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport {\n getChainTokens,\n getTokenAddress,\n getTokenMetadata,\n supportedChains,\n} from \"@otim/utils/chains\";\nimport { validateIso8601Date } from \"@otim/utils/helpers\";\nimport {\n buildPaymentMetadata,\n createChainTokenConfigs,\n createComprehensivePaymentRequest,\n} from \"@otim/utils/payments\";\nimport { hexStringSchema } from \"@otim/utils/schemas\";\n\nexport interface PreparePaymentRequestParams {\n amount: number;\n chainId: SupportedChainId;\n recipient: Address;\n token?: \"USDC\" | \"USDT\";\n payer?: Nullable<Address>;\n dueDate?: string;\n metadata?: PaymentRequestMetadata;\n note?: string;\n maxRuns?: number;\n}\n\nexport interface PreparedPaymentRequest {\n payload: PaymentRequestBuildRequest;\n chainId: number;\n}\n\nfunction 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\nfunction buildMetadataFromParams(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 ? { ...baseMetadata, ...customMetadata } : baseMetadata;\n}\n\nfunction createPayload(params: {\n chainId: number;\n recipient: Address;\n amount: number;\n payer?: Address | null;\n metadata: PaymentRequestMetadata;\n feeTokenAddress: Address;\n maxRuns?: number;\n}): PaymentRequestBuildRequest {\n const {\n chainId,\n recipient,\n amount,\n payer,\n metadata,\n feeTokenAddress,\n maxRuns,\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 maxRuns,\n });\n}\n\nexport function preparePaymentRequest(\n params: PreparePaymentRequestParams,\n): PreparedPaymentRequest {\n const {\n chainId,\n token = \"USDC\",\n recipient,\n amount,\n payer,\n note,\n dueDate,\n metadata: customMetadata,\n maxRuns,\n } = params;\n\n if (dueDate) {\n validateIso8601Date(dueDate);\n }\n\n const feeTokenAddress = validateAndGetTokenAddress(chainId, token);\n const metadata = buildMetadataFromParams({\n token,\n amount,\n recipient,\n note,\n dueDate,\n customMetadata,\n });\n\n const payload = createPayload({\n chainId,\n recipient,\n amount,\n payer,\n metadata,\n feeTokenAddress,\n maxRuns,\n });\n\n return { payload, chainId };\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,OAA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AM,IAAI,MAAM,SAAS,MAAM,0BAA0B,UAAU;AAIrE,KAAI,2CADmC,MAAM,CAE3C,OAAM,IAAI,MAAM,SAAS,MAAM,qBAAqB;AAGtD,QAAOC,qCAAgB,MAAM,aAAa;;AAG5C,SAAS,wBAAwB,QAON;CACzB,MAAM,EAAE,OAAO,QAAQ,WAAW,MAAM,SAAS,mBAAmB;CAEpE,MAAM,+DAAoC;EACxC,aAAa;EACb,aAAa;EACb,oBAAoB;EACpB;EACA;EACA,oBAAoB;EACrB,CAAC;AAEF,QAAO,iBAAiB;EAAE,GAAG;EAAc,GAAG;EAAgB,GAAG;;AAGnE,SAAS,cAAc,QAQQ;CAC7B,MAAM,EACJ,SACA,WACA,QACA,OACA,UACA,iBACA,YACE;CAMJ,MAAM,uEAJS,OAAO,OAAOC,oCAAgB,QAAQ,CAAC,SAAS,kDAC9C,MAAM,GAAG,CACzB,CAEwD;AAEzD,qEAAyC;EACvC,mBAAmB;EACnB;EACA,QAAQ,OAAO,UAAU;EACzB,wBAAwB;EACxB;EACA,cAAc,SAAS;EACvB;EACA,UAAU;EACV;EACD,CAAC;;AAGJ,SAAgB,sBACd,QACwB;CACxB,MAAM,EACJ,SACA,QAAQ,QACR,WACA,QACA,OACA,MACA,SACA,UAAU,gBACV,YACE;AAEJ,KAAI,QACF,+CAAoB,QAAQ;CAG9B,MAAM,kBAAkB,2BAA2B,SAAS,MAAM;AAoBlE,QAAO;EAAE,SAVO,cAAc;GAC5B;GACA;GACA;GACA;GACA,UAde,wBAAwB;IACvC;IACA;IACA;IACA;IACA;IACA;IACD,CAAC;GAQA;GACA;GACD,CAAC;EAEgB;EAAS"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"clients-Bn4BUElo.mjs","names":["apiClient: APIClient","apiClient: APIClient","account: OtimAccount","context: OtimClientContext","apiClient: APIClient","apiClient: APIClient","apiClient: APIClient","account: OtimAccount","context: OtimServerClientContext"],"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/orchestration.ts","../src/clients/helpers/prepare-payment-request.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 { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type {\n APIClient,\n GetPaymentRequestsRequest,\n GetPaymentRequestsResponse,\n PaginatedServiceResponse,\n PaymentRequestBuildRequest,\n PaymentRequestDetailsRequest,\n PaymentRequestDetailsResponse,\n ServiceResponse,\n} from \"@otim/utils/api\";\nimport type { PaymentResponseWithActionNames } from \"@otim/utils/payments\";\nimport type { Address } from \"@otim/utils/schemas\";\nimport type { PublicClient } from \"viem\";\n\nimport { getChainById } from \"@otim/utils/chains\";\nimport {\n addActionNamesToInstructions,\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\";\nimport type { PreparedPaymentRequest } from \"./helpers/prepare-payment-request\";\n\nexport type { PreparedPaymentRequest } from \"./helpers/prepare-payment-request\";\n\nexport interface CreatePaymentRequestResponse {\n requestId: string;\n ephemeralWalletAddress: Address;\n}\n\ntype PaymentInstruction =\n PaymentResponseWithActionNames[\"completionInstructions\"][number];\n\nexport class OrchestrationClient {\n constructor(\n private readonly apiClient: APIClient,\n private readonly account: OtimAccount,\n private readonly context: OtimServerClientContext,\n ) {}\n\n async create(\n preparedRequest: PreparedPaymentRequest,\n ): Promise<CreatePaymentRequestResponse> {\n assertServerContext(this.context);\n\n const { payload, chainId } = preparedRequest;\n\n const buildResponse = await this.buildAndEnhancePaymentRequest(payload);\n await this.activate(buildResponse, chainId);\n\n return {\n requestId: buildResponse.requestId,\n ephemeralWalletAddress: buildResponse.ephemeralWalletAddress,\n };\n }\n\n async getDetails(\n request: PaymentRequestDetailsRequest,\n ): Promise<ServiceResponse<PaymentRequestDetailsResponse>> {\n return this.apiClient.payments.getPaymentRequestDetails(request);\n }\n\n async list(\n request: GetPaymentRequestsRequest,\n ): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>> {\n return this.apiClient.payments.getPaymentRequests(request);\n }\n\n private async activate(\n buildResponse: PaymentResponseWithActionNames,\n settlementChainId: number,\n ): Promise<void> {\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 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","import type { PaymentRequestBuildRequest } from \"@otim/utils/api\";\nimport type { SupportedChainId } from \"@otim/utils/chains\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { PaymentRequestMetadata } from \"@otim/utils/payments\";\nimport type { Address } from \"@otim/utils/schemas\";\n\nimport {\n getChainTokens,\n getTokenAddress,\n getTokenMetadata,\n supportedChains,\n} from \"@otim/utils/chains\";\nimport { validateIso8601Date } from \"@otim/utils/helpers\";\nimport {\n buildPaymentMetadata,\n createChainTokenConfigs,\n createComprehensivePaymentRequest,\n} from \"@otim/utils/payments\";\nimport { hexStringSchema } from \"@otim/utils/schemas\";\n\nexport interface PreparePaymentRequestParams {\n amount: number;\n chainId: SupportedChainId;\n recipient: Address;\n token?: \"USDC\" | \"USDT\";\n payer?: Nullable<Address>;\n dueDate?: string;\n metadata?: PaymentRequestMetadata;\n note?: string;\n maxRuns?: number;\n}\n\nexport interface PreparedPaymentRequest {\n payload: PaymentRequestBuildRequest;\n chainId: number;\n}\n\nfunction 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\nfunction buildMetadataFromParams(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 ? { ...baseMetadata, ...customMetadata } : baseMetadata;\n}\n\nfunction createPayload(params: {\n chainId: number;\n recipient: Address;\n amount: number;\n payer?: Address | null;\n metadata: PaymentRequestMetadata;\n feeTokenAddress: Address;\n maxRuns?: number;\n}): PaymentRequestBuildRequest {\n const {\n chainId,\n recipient,\n amount,\n payer,\n metadata,\n feeTokenAddress,\n maxRuns,\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 maxRuns,\n });\n}\n\nexport function preparePaymentRequest(\n params: PreparePaymentRequestParams,\n): PreparedPaymentRequest {\n const {\n chainId,\n token = \"USDC\",\n recipient,\n amount,\n payer,\n note,\n dueDate,\n metadata: customMetadata,\n maxRuns,\n } = params;\n\n if (dueDate) {\n validateIso8601Date(dueDate);\n }\n\n const feeTokenAddress = validateAndGetTokenAddress(chainId, token);\n const metadata = buildMetadataFromParams({\n token,\n amount,\n recipient,\n note,\n dueDate,\n customMetadata,\n });\n\n const payload = createPayload({\n chainId,\n recipient,\n amount,\n payer,\n metadata,\n feeTokenAddress,\n maxRuns,\n });\n\n return { payload, chainId };\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,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EACJ,SACA,QAAQ,QACR,WACA,QACA,OACA,MACA,SACA,UAAU,gBACV,YACE;AAEJ,KAAI,QACF,qBAAoB,QAAQ;CAG9B,MAAM,kBAAkB,2BAA2B,SAAS,MAAM;AAoBlE,QAAO;EAAE,SAVO,cAAc;GAC5B;GACA;GACA;GACA;GACA,UAde,wBAAwB;IACvC;IACA;IACA;IACA;IACA;IACA;IACD,CAAC;GAQA;GACA;GACD,CAAC;EAEgB;EAAS"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Ce_qYSJj.d.cts","names":[],"sources":["../src/clients/activity.ts","../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/helpers/prepare-payment-request.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;;;;UCfY,2BAAA;;WAEN;aACE;;EJjBA,KAAA,CAAA,EImBH,QJnBG,CImBM,OJnBQ,CAAA;EACe,OAAA,CAAA,EAAA,MAAA;EAG7B,QAAA,CAAA,EIiBA,sBJjBA;EACA,IAAA,CAAA,EAAA,MAAA;EAAR,OAAA,CAAA,EAAA,MAAA;;UIqBY,sBAAA;WACN;;AHvBX;AAIa,iBGiGG,qBAAA,CHjGO,MAAA,EGkGb,2BHlGa,CAAA,EGmGpB,sBHnGoB;;;UIiBN,4BAAA;;0BAES;;AL3Bb,cKiCA,mBAAA,CLjCc;EACe,iBAAA,SAAA;EAG7B,iBAAA,OAAA;EACA,iBAAA,OAAA;EAAR,WAAA,CAAA,SAAA,EK8B2B,SL9B3B,EAAA,OAAA,EK+ByB,WL/BzB,EAAA,OAAA,EKgCyB,uBLhCzB;EAAO,MAAA,CAAA,eAAA,EKoCS,sBLpCT,CAAA,EKqCP,OLrCO,CKqCC,4BLrCD,CAAA;sBKoDC,+BACR,QAAQ,gBAAgB;gBAKhB,4BACR,QAAQ,yBAAyB;;EJ5DrB,QAAA,6BACC;EAGL,QAAA,kBAAU;EAES,QAAA,sBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-CiyyA-wd.d.mts","names":[],"sources":["../src/clients/activity.ts","../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/helpers/prepare-payment-request.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;;;;UCfY,2BAAA;;WAEN;aACE;;EJjBA,KAAA,CAAA,EImBH,QJnBG,CImBM,OJnBQ,CAAA;EACe,OAAA,CAAA,EAAA,M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