@wirexapp/wpay-baas-sdk 0.1.9 → 0.1.11

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/types.ts","../src/core/errors.ts","../src/core/internal/http-client.ts","../src/core/config/types.ts","../src/core/config/config.service.ts","../src/core/builderCode.ts"],"names":[],"mappings":";;;;AA+EO,IAAM,aAAA,GAAwB;AAAA,EACnC,KAAA,EAAO,CAAC,OAAA,EAAA,GAAY,IAAA,KAAS,OAAA,CAAQ,MAAM,CAAA,MAAA,EAAS,OAAO,CAAA,CAAA,EAAI,GAAG,IAAI,CAAA;AAAA,EACtE,IAAA,EAAM,CAAC,OAAA,EAAA,GAAY,IAAA,KAAS,OAAA,CAAQ,KAAK,CAAA,MAAA,EAAS,OAAO,CAAA,CAAA,EAAI,GAAG,IAAI,CAAA;AAAA,EACpE,IAAA,EAAM,CAAC,OAAA,EAAA,GAAY,IAAA,KAAS,OAAA,CAAQ,KAAK,CAAA,MAAA,EAAS,OAAO,CAAA,CAAA,EAAI,GAAG,IAAI,CAAA;AAAA,EACpE,KAAA,EAAO,CAAC,OAAA,EAAA,GAAY,IAAA,KAAS,OAAA,CAAQ,MAAM,CAAA,MAAA,EAAS,OAAO,CAAA,CAAA,EAAI,GAAG,IAAI;AACxE;AAEO,IAAM,YAAA,GAAuB;AAAA,EAClC,OAAO,MAAM;AAAA,EAAC,CAAA;AAAA,EACd,MAAM,MAAM;AAAA,EAAC,CAAA;AAAA,EACb,MAAM,MAAM;AAAA,EAAC,CAAA;AAAA,EACb,OAAO,MAAM;AAAA,EAAC;AAChB;;;AC3FO,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,KAAA,CAAM;AAAA,EAIlC,WAAA,CAAY,OAAA,EAAiB,IAAA,EAAc,KAAA,EAAe;AACxD,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,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ChG;AAEO,IAAM,mBAAA,GAAsB,aAAa,aAAa;AAEtD,SAAS,eAAA,CAAgB,UAAyB,OAAA,EAAgC;AACvF,EAAA,IAAI,CAAC,sBAAA,CAAuB,GAAA,CAAI,OAAO,CAAA,EAAG;AACxC,IAAA,OAAO,QAAA;AAAA,EACT;AACA,EAAA,OAAO,MAAA,CAAO,CAAC,QAAA,EAAU,mBAAmB,CAAC,CAAA;AAC/C","file":"chunk-XYHCKANZ.js","sourcesContent":["import type { SDKEnvironment } from './config/index';\nimport type { HttpClient } from './internal/http-client';\nimport type { Chain as ViemChain } from 'viem';\n\nexport type Chain = ViemChain;\n\nexport interface MainWalletClient {\n address: `0x${string}`;\n getEthereumProvider(): Promise<unknown>;\n}\n\n/**\n * SDK configuration.\n * All chain/API values are fetched from remote config based on environment.\n */\nexport interface SDKConfig {\n /**\n * Environment: 'dev' or 'prod'. Selects the default remote-config URL\n * (`CONFIG_URLS[env]`). Used as the fallback when `configUrl` is not set.\n */\n env: SDKEnvironment;\n /**\n * Optional explicit remote-config URL. When set, it takes priority over `env`\n * and the config is fetched from this URL instead of the environment default.\n */\n configUrl?: string;\n /** Company ID (hex format without dashes, e.g., '0x...') */\n companyId: string;\n /**\n * Optional company name. When set, it is sent as the `X-Company-Name` header on the\n * remote-config fetch so the SDK resolves the chain/contracts/default company for that\n * company (e.g. \"Wirex One\" → Arc Testnet) instead of the default company's config.\n */\n companyName?: string;\n /**\n * Optional chain ID to run the SDK on. When set, the chain is looked up in the remote\n * config's `chains` map; when omitted, the remote config's `defaultChain` is used.\n * Supported: Base (8453), Base Sepolia (84532), Arc (5042), Arc Testnet (5042002).\n */\n chainId?: number;\n /** Function to get the main wallet client (e.g., from Privy) */\n getMainWalletClient: () => MainWalletClient | Promise<MainWalletClient>;\n /**\n * Optional Rhino.fi API key. Required only for smart deposit addresses\n * (`sdk.crypto.smartDepositAddress`). If omitted, accessing that service logs an error.\n */\n rhinoApiKey?: string;\n /** Enable logging. If false, no logs are written. Default: false */\n enableLogging?: boolean;\n /** Optional: Custom logger (used only if enableLogging is true) */\n logger?: Logger;\n}\n\n/**\n * Internal resolved configuration used by SDK modules.\n * Contains all values resolved from remote config + user overrides.\n */\nexport interface ResolvedSDKConfig {\n env: SDKEnvironment;\n chainId: number;\n chain: Chain;\n rpcUrl: string;\n bundlerRpc: string;\n paymasterRpc: string;\n contractRegistry: `0x${string}`;\n apiBaseUrl: string;\n rhinoApiKey?: string;\n companyId: string;\n logger: Logger;\n getMainWalletClient: () => MainWalletClient | Promise<MainWalletClient>;\n}\n\nexport interface Logger {\n debug(message: string, ...args: unknown[]): void;\n info(message: string, ...args: unknown[]): void;\n warn(message: string, ...args: unknown[]): void;\n error(message: string, ...args: unknown[]): void;\n}\n\nexport const defaultLogger: Logger = {\n debug: (message, ...args) => console.debug(`[SDK] ${message}`, ...args),\n info: (message, ...args) => console.info(`[SDK] ${message}`, ...args),\n warn: (message, ...args) => console.warn(`[SDK] ${message}`, ...args),\n error: (message, ...args) => console.error(`[SDK] ${message}`, ...args),\n};\n\nexport const silentLogger: Logger = {\n debug: () => {},\n info: () => {},\n warn: () => {},\n error: () => {},\n};\n\nexport interface TokenInfo {\n symbol: string;\n address: `0x${string}`;\n decimals: number;\n baseToken?: TokenInfo;\n isSynthetic: boolean;\n}\n\nexport interface ContractAddresses {\n accounts: `0x${string}`;\n corporateAccounts: `0x${string}`;\n tokenRegistry: `0x${string}`;\n processing: `0x${string}`;\n executionDelayPolicy: `0x${string}`;\n fundsManagement: `0x${string}`;\n fundsBuffer: `0x${string}`;\n syntheticRouter: `0x${string}`;\n yieldCalculator: `0x${string}`;\n cardsManagement: `0x${string}`;\n}\n\nexport type Hex = `0x${string}`;\n\nexport type TransactionHash = `0x${string}`;\n\nexport interface SDKModule {\n readonly name: string;\n initialize(): Promise<void>;\n isInitialized(): boolean;\n}\n\nexport interface ModuleContext {\n config: ResolvedSDKConfig;\n logger: Logger;\n httpClient: HttpClient;\n}\n","export class SDKError extends Error {\n public readonly code: string;\n public readonly cause?: Error;\n\n constructor(message: string, code: string, cause?: Error) {\n super(message);\n this.name = 'SDKError';\n this.code = code;\n this.cause = cause;\n Object.setPrototypeOf(this, SDKError.prototype);\n }\n}\n\nexport class ConfigurationError extends SDKError {\n constructor(message: string, cause?: Error) {\n super(message, 'CONFIGURATION_ERROR', cause);\n this.name = 'ConfigurationError';\n Object.setPrototypeOf(this, ConfigurationError.prototype);\n }\n}\n\nexport class NetworkError extends SDKError {\n public readonly statusCode?: number;\n\n constructor(message: string, statusCode?: number, cause?: Error) {\n super(message, 'NETWORK_ERROR', cause);\n this.name = 'NetworkError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, NetworkError.prototype);\n }\n}\n\nexport class ContractError extends SDKError {\n public readonly contractAddress?: string;\n\n constructor(message: string, contractAddress?: string, cause?: Error) {\n super(message, 'CONTRACT_ERROR', cause);\n this.name = 'ContractError';\n this.contractAddress = contractAddress;\n Object.setPrototypeOf(this, ContractError.prototype);\n }\n}\n\nexport class WalletError extends SDKError {\n constructor(message: string, cause?: Error) {\n super(message, 'WALLET_ERROR', cause);\n this.name = 'WalletError';\n Object.setPrototypeOf(this, WalletError.prototype);\n }\n}\n\nexport class TransactionError extends SDKError {\n public readonly transactionHash?: string;\n\n constructor(message: string, transactionHash?: string, cause?: Error) {\n super(message, 'TRANSACTION_ERROR', cause);\n this.name = 'TransactionError';\n this.transactionHash = transactionHash;\n Object.setPrototypeOf(this, TransactionError.prototype);\n }\n}\n\nexport class AuthenticationError extends SDKError {\n constructor(message: string, cause?: Error) {\n super(message, 'AUTHENTICATION_ERROR', cause);\n this.name = 'AuthenticationError';\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n }\n}\n\nexport class ValidationError extends SDKError {\n public readonly field?: string;\n\n constructor(message: string, field?: string, cause?: Error) {\n super(message, 'VALIDATION_ERROR', cause);\n this.name = 'ValidationError';\n this.field = field;\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n","import axios, { type AxiosInstance, type AxiosResponse } from 'axios';\n\nimport { NetworkError, AuthenticationError } from '../errors';\n\nimport type { Logger } from '../types';\n\ndeclare module 'axios' {\n interface AxiosRequestConfig {\n requireAuth?: boolean;\n }\n interface InternalAxiosRequestConfig {\n requireAuth?: boolean;\n }\n}\n\nexport interface HttpClientConfig {\n baseUrl: string;\n chainId: number;\n logger?: Logger;\n getAccessToken?: () => string | null;\n isAuthenticated?: () => boolean;\n getUserWallet?: () => string | null;\n}\n\nexport interface RequestOptions {\n headers?: Record<string, string | undefined>;\n params?: Record<string, unknown>;\n timeout?: number;\n requireAuth?: boolean;\n}\n\nexport class HttpClient {\n private readonly client: AxiosInstance;\n private readonly logger?: Logger;\n private readonly getAccessToken?: () => string | null;\n private readonly isAuthenticated?: () => boolean;\n private readonly getUserWallet?: () => string | null;\n\n constructor(config: HttpClientConfig) {\n this.logger = config.logger;\n this.getAccessToken = config.getAccessToken;\n this.isAuthenticated = config.isAuthenticated;\n this.getUserWallet = config.getUserWallet;\n\n this.client = axios.create({\n baseURL: config.baseUrl,\n timeout: 30000,\n headers: {\n 'Content-Type': 'application/json',\n 'X-Chain-Id': String(config.chainId),\n },\n });\n\n this.setupInterceptors();\n }\n\n private setupInterceptors(): void {\n this.client.interceptors.request.use(\n config => {\n const requireAuth = config.requireAuth !== false;\n\n if (requireAuth) {\n if (this.isAuthenticated && !this.isAuthenticated()) {\n throw new AuthenticationError('User is not authenticated. Please login first.');\n }\n\n if (this.getAccessToken) {\n const token = this.getAccessToken();\n if (token) {\n config.headers.Authorization = `Bearer ${token}`;\n }\n }\n\n if (this.getUserWallet) {\n const wallet = this.getUserWallet();\n if (wallet) {\n config.headers['X-User-Wallet'] = wallet;\n }\n }\n }\n\n this.logger?.debug(`Request: ${config.method?.toUpperCase()} ${config.url}`);\n return config;\n },\n error => {\n this.logger?.error('Request interceptor error', error);\n return Promise.reject(error);\n },\n );\n\n this.client.interceptors.response.use(\n response => {\n this.logger?.debug(`Response: ${response.status} ${response.config.url}`);\n return response;\n },\n error => {\n if (axios.isAxiosError(error)) {\n const status = error.response?.status;\n const message = error.response?.data?.message || error.message;\n\n this.logger?.error(`HTTP Error: ${status} - ${message}`);\n\n if (status === 401 || status === 403) {\n throw new AuthenticationError(message, error);\n }\n\n throw new NetworkError(message, status, error);\n }\n throw error;\n },\n );\n }\n\n async get<T>(url: string, options?: RequestOptions): Promise<T> {\n const response: AxiosResponse<T> = await this.client.get(url, {\n headers: options?.headers,\n params: options?.params,\n timeout: options?.timeout,\n requireAuth: options?.requireAuth,\n });\n return response.data;\n }\n\n async post<T>(url: string, data?: unknown, options?: RequestOptions): Promise<T> {\n const response: AxiosResponse<T> = await this.client.post(url, data, {\n headers: options?.headers,\n params: options?.params,\n timeout: options?.timeout,\n requireAuth: options?.requireAuth,\n });\n return response.data;\n }\n\n async put<T>(url: string, data?: unknown, options?: RequestOptions): Promise<T> {\n const response: AxiosResponse<T> = await this.client.put(url, data, {\n headers: options?.headers,\n params: options?.params,\n timeout: options?.timeout,\n requireAuth: options?.requireAuth,\n });\n return response.data;\n }\n\n async delete<T>(url: string, options?: RequestOptions): Promise<T> {\n const response: AxiosResponse<T> = await this.client.delete(url, {\n headers: options?.headers,\n params: options?.params,\n timeout: options?.timeout,\n requireAuth: options?.requireAuth,\n });\n return response.data;\n }\n\n async patch<T>(url: string, data?: unknown, options?: RequestOptions): Promise<T> {\n const response: AxiosResponse<T> = await this.client.patch(url, data, {\n headers: options?.headers,\n params: options?.params,\n timeout: options?.timeout,\n requireAuth: options?.requireAuth,\n });\n return response.data;\n }\n\n setHeader(name: string, value: string): void {\n this.client.defaults.headers.common[name] = value;\n }\n\n removeHeader(name: string): void {\n delete this.client.defaults.headers.common[name];\n }\n}\n","export type SDKEnvironment = 'dev' | 'uat' | 'prod';\n\nexport interface ChainConfig {\n id: number;\n name: string;\n contractRegistry: `0x${string}`;\n blockExplorerUrl: string;\n bridgeUrl: string;\n rpcUrl: string;\n rpcWsUrl: string;\n bundlerUrl: string;\n paymasterUrl: string;\n}\n\nexport interface RemoteConfig {\n auth: {\n privyAppId: string;\n privyClientId: string;\n crossmintAppId: string;\n crossmintApiKey: string;\n googleApiKey: string;\n rhinoApiKey: string;\n };\n api: {\n socketIo: string;\n apiUrl: string;\n };\n support: {\n chatUrl: string;\n widgetId: string;\n };\n analytics: {\n googleTagManagerId: string;\n googleAnalyticsId: string;\n amplitudeApiKey: string;\n };\n defaultChain: ChainConfig;\n defaultCompanyId: string;\n chains: Record<string, ChainConfig>;\n}\n\nexport const CONFIG_URLS: Record<SDKEnvironment, string> = {\n dev: 'https://api-baas.wirexapp.tech/api/v1/config',\n uat: 'https://api-baas.wirexapp.tech/api/v1/config',\n prod: 'https://api-baas.wirexapp.com/api/v1/config',\n};\n","import { CONFIG_URLS } from './types';\nimport { ConfigurationError } from '../errors';\n\nimport type { SDKEnvironment, RemoteConfig, ChainConfig } from './types';\n\nexport class ConfigService {\n private static instance: ConfigService | null = null;\n private config: RemoteConfig | null = null;\n private environment: SDKEnvironment | null = null;\n private companyName: string | undefined = undefined;\n private configUrl: string | undefined = undefined;\n\n private constructor() {}\n\n static getInstance(): ConfigService {\n if (!ConfigService.instance) {\n ConfigService.instance = new ConfigService();\n }\n return ConfigService.instance;\n }\n\n static resetInstance(): void {\n ConfigService.instance = null;\n }\n\n /**\n * Loads the remote config.\n *\n * The config URL is resolved with `configUrl` taking priority over the\n * environment-based URL: an explicit `configUrl` wins, otherwise the URL is\n * derived from `env` (`CONFIG_URLS[env]`).\n */\n async loadConfig(\n env: SDKEnvironment,\n companyName?: string,\n configUrl?: string,\n ): Promise<RemoteConfig> {\n if (\n this.config &&\n this.environment === env &&\n this.companyName === companyName &&\n this.configUrl === configUrl\n ) {\n return this.config;\n }\n\n const url = configUrl ?? CONFIG_URLS[env];\n const headers: Record<string, string> = {};\n if (companyName) headers['X-Company-Name'] = companyName;\n const maxAttempts = 2;\n let lastError: Error | null = null;\n\n for (let attempt = 1; attempt <= maxAttempts; attempt++) {\n try {\n const response = await fetch(url, { headers });\n\n if (!response.ok) {\n throw new ConfigurationError(`Failed to fetch config: ${response.statusText}`);\n }\n\n this.config = (await response.json()) as RemoteConfig;\n this.environment = env;\n this.companyName = companyName;\n this.configUrl = configUrl;\n\n return this.config!;\n } catch (error) {\n lastError = error as Error;\n\n if (attempt < maxAttempts) {\n continue;\n }\n }\n }\n\n throw new ConfigurationError(\n `Failed to load SDK config after ${maxAttempts} attempts: ${lastError?.message}`,\n );\n }\n\n getConfig(): RemoteConfig {\n if (!this.config) {\n throw new ConfigurationError('Config not loaded. Call loadConfig() first.');\n }\n return this.config;\n }\n\n getChainConfig(chainId?: number): ChainConfig {\n const config = this.getConfig();\n\n if (!chainId) {\n return config.defaultChain;\n }\n\n const chainConfig = config.chains[String(chainId)];\n if (!chainConfig) {\n const availableChains = Object.keys(config.chains).join(', ');\n throw new ConfigurationError(\n `Chain ${chainId} not found in config. Available chains: ${availableChains}`,\n );\n }\n\n return chainConfig;\n }\n\n getApiUrl(): string {\n return this.getConfig().api.apiUrl;\n }\n\n getRhinoApiKey(): string {\n return this.getConfig().auth.rhinoApiKey;\n }\n\n getPrivyAppId(): string {\n return this.getConfig().auth.privyAppId;\n }\n\n getDefaultCompanyId(): string {\n return this.getConfig().defaultCompanyId;\n }\n\n getEnvironment(): SDKEnvironment | null {\n return this.environment;\n }\n}\n","import { concat, numberToHex, stringToHex } from 'viem';\n\nconst ERC8021_MARKER = '0x80218021802180218021802180218021';\nconst ERC8021_SCHEMA_ID = '0x00';\nconst BUILDER_CODES = ['bc_h744yhsx'];\nconst BUILDER_CODE_CHAIN_IDS = new Set([8453, 84532]);\n\nexport function toDataSuffix(codes: string[]): `0x${string}` {\n const ascii = stringToHex(codes.join(','));\n const byteLength = (ascii.length - 2) / 2;\n if (byteLength === 0 || byteLength > 255) {\n throw new Error('ERC-8021 builder codes must encode to 1..255 bytes');\n }\n return concat([ascii, numberToHex(byteLength, { size: 1 }), ERC8021_SCHEMA_ID, ERC8021_MARKER]);\n}\n\nexport const BUILDER_CODE_SUFFIX = toDataSuffix(BUILDER_CODES);\n\nexport function withBuilderCode(callData: `0x${string}`, chainId: number): `0x${string}` {\n if (!BUILDER_CODE_CHAIN_IDS.has(chainId)) {\n return callData;\n }\n return concat([callData, BUILDER_CODE_SUFFIX]);\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { AuthService, WithdrawalApi } from './chunk-D2YHFKQI.js';
2
- import { ContractError, ConfigurationError } from './chunk-YXNNTBO5.js';
1
+ import { AuthService, WithdrawalApi } from './chunk-RIB34JK2.js';
2
+ import { withBuilderCode, ContractError, ConfigurationError } from './chunk-XYHCKANZ.js';
3
3
  import { toPermissionValidator } from '@zerodev/permissions';
4
4
  import { toSudoPolicy } from '@zerodev/permissions/policies';
5
5
  import { toECDSASigner } from '@zerodev/permissions/signers';
@@ -3461,6 +3461,7 @@ var BaseAccountAbstractionService = class {
3461
3461
  this.kernelPublicClient = config.kernelPublicClient;
3462
3462
  this.contracts = config.contracts;
3463
3463
  this.walletService = config.walletService;
3464
+ this.chainId = config.chainId;
3464
3465
  this.logger = config.logger;
3465
3466
  }
3466
3467
  async isExecutorInstalled() {
@@ -3534,42 +3535,51 @@ var BaseAccountAbstractionService = class {
3534
3535
  const smartWalletClient = await this.walletService.getSmartWalletClientWithoutPolicy();
3535
3536
  const executorCallData = await this.getExecutorCallData();
3536
3537
  const policyCallData = await this.getPolicyCallData();
3537
- const calls = await smartWalletClient.account.encodeCalls([
3538
- {
3539
- to: smartWalletClient.account.address,
3540
- value: BigInt(0),
3541
- data: executorCallData
3542
- },
3543
- {
3544
- to: smartWalletClient.account.address,
3545
- value: BigInt(0),
3546
- data: policyCallData
3547
- }
3548
- ]);
3538
+ const calls = withBuilderCode(
3539
+ await smartWalletClient.account.encodeCalls([
3540
+ {
3541
+ to: smartWalletClient.account.address,
3542
+ value: BigInt(0),
3543
+ data: executorCallData
3544
+ },
3545
+ {
3546
+ to: smartWalletClient.account.address,
3547
+ value: BigInt(0),
3548
+ data: policyCallData
3549
+ }
3550
+ ]),
3551
+ this.chainId
3552
+ );
3549
3553
  return await this.walletService.sendUserOperationsAndWaitReceipt(calls, smartWalletClient);
3550
3554
  }
3551
3555
  async signInPolicy() {
3552
3556
  const smartWalletClient = await this.walletService.getSmartWalletClientWithoutPolicy();
3553
3557
  const policyCallData = await this.getPolicyCallData();
3554
- const calls = await smartWalletClient.account.encodeCalls([
3555
- {
3556
- to: smartWalletClient.account.address,
3557
- value: BigInt(0),
3558
- data: policyCallData
3559
- }
3560
- ]);
3558
+ const calls = withBuilderCode(
3559
+ await smartWalletClient.account.encodeCalls([
3560
+ {
3561
+ to: smartWalletClient.account.address,
3562
+ value: BigInt(0),
3563
+ data: policyCallData
3564
+ }
3565
+ ]),
3566
+ this.chainId
3567
+ );
3561
3568
  return await this.walletService.sendUserOperationsAndWaitReceipt(calls, smartWalletClient);
3562
3569
  }
3563
3570
  async signInExecutor() {
3564
3571
  const smartWalletClient = await this.walletService.getSmartWalletClientWithoutPolicy();
3565
3572
  const policyCallData = await this.getExecutorCallData();
3566
- const calls = await smartWalletClient.account.encodeCalls([
3567
- {
3568
- to: smartWalletClient.account.address,
3569
- value: BigInt(0),
3570
- data: policyCallData
3571
- }
3572
- ]);
3573
+ const calls = withBuilderCode(
3574
+ await smartWalletClient.account.encodeCalls([
3575
+ {
3576
+ to: smartWalletClient.account.address,
3577
+ value: BigInt(0),
3578
+ data: policyCallData
3579
+ }
3580
+ ]),
3581
+ this.chainId
3582
+ );
3573
3583
  return await this.walletService.sendUserOperationsAndWaitReceipt(calls, smartWalletClient);
3574
3584
  }
3575
3585
  // Batch-ready variants of the installs above: they return the calls instead of
@@ -3638,6 +3648,7 @@ var BaseAccountAbstractionService = class {
3638
3648
  var BaseAccountContractService = class {
3639
3649
  constructor(config) {
3640
3650
  this.walletService = config.walletService;
3651
+ this.chainId = config.chainId;
3641
3652
  this.logger = config.logger;
3642
3653
  this.companyId = config.companyId;
3643
3654
  this.publicRpcClient = config.publicRpcClient;
@@ -3695,13 +3706,16 @@ var BaseAccountContractService = class {
3695
3706
  async registerInAccounts() {
3696
3707
  const callData = await this.getCallData();
3697
3708
  const smartWalletClient = await this.walletService.getSmartWalletClient();
3698
- const encodedCallData = await smartWalletClient.account.encodeCalls([
3699
- {
3700
- to: this.contracts.accounts,
3701
- value: BigInt(0),
3702
- data: callData
3703
- }
3704
- ]);
3709
+ const encodedCallData = withBuilderCode(
3710
+ await smartWalletClient.account.encodeCalls([
3711
+ {
3712
+ to: this.contracts.accounts,
3713
+ value: BigInt(0),
3714
+ data: callData
3715
+ }
3716
+ ]),
3717
+ this.chainId
3718
+ );
3705
3719
  const receipt = await this.walletService.sendUserOperationsAndWaitReceipt(encodedCallData);
3706
3720
  if (!receipt) {
3707
3721
  throw new Error("Unable to register in accounts contract");
@@ -3711,13 +3725,16 @@ var BaseAccountContractService = class {
3711
3725
  async registerInCorporateAccounts() {
3712
3726
  const callData = await this.getCorporateCallData();
3713
3727
  const smartWalletClient = await this.walletService.getSmartWalletClient();
3714
- const encodedCallData = await smartWalletClient.account.encodeCalls([
3715
- {
3716
- to: this.contracts.corporateAccounts,
3717
- value: BigInt(0),
3718
- data: callData
3719
- }
3720
- ]);
3728
+ const encodedCallData = withBuilderCode(
3729
+ await smartWalletClient.account.encodeCalls([
3730
+ {
3731
+ to: this.contracts.corporateAccounts,
3732
+ value: BigInt(0),
3733
+ data: callData
3734
+ }
3735
+ ]),
3736
+ this.chainId
3737
+ );
3721
3738
  const receipt = await this.walletService.sendUserOperationsAndWaitReceipt(encodedCallData);
3722
3739
  if (!receipt) {
3723
3740
  throw new Error("Unable to register in corporate accounts contract");
@@ -3751,6 +3768,7 @@ var BaseAccountContractService = class {
3751
3768
  var BaseCryptoService = class {
3752
3769
  constructor(config) {
3753
3770
  this.walletService = config.walletService;
3771
+ this.chainId = config.chainId;
3754
3772
  this.contracts = config.contracts;
3755
3773
  this.logger = config.logger;
3756
3774
  this.tokens = config.tokens;
@@ -3781,9 +3799,15 @@ var BaseCryptoService = class {
3781
3799
  if (!smartWalletClient.account) {
3782
3800
  throw new Error("Smart wallet client account is not available.");
3783
3801
  }
3784
- const encodedExecutionCalls = await smartWalletClient.account.encodeCalls(callDataArray);
3802
+ const encodedExecutionCalls = withBuilderCode(
3803
+ await smartWalletClient.account.encodeCalls(callDataArray),
3804
+ this.chainId
3805
+ );
3785
3806
  const requestCallData = await this.operationRequestCall(encodedExecutionCalls);
3786
- const requestCalls = await smartWalletClient.account.encodeCalls([requestCallData.call]);
3807
+ const requestCalls = withBuilderCode(
3808
+ await smartWalletClient.account.encodeCalls([requestCallData.call]),
3809
+ this.chainId
3810
+ );
3787
3811
  const userOpReceipt = await this.walletService.sendUserOperationsAndWaitReceipt(requestCalls);
3788
3812
  if (!userOpReceipt.success) {
3789
3813
  throw new Error(
@@ -3829,12 +3853,18 @@ var BaseCryptoService = class {
3829
3853
  params.recipientAddress,
3830
3854
  parseUnits(String(params.amount), baseToken?.decimals ?? 18)
3831
3855
  );
3832
- const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([
3833
- unwrapCallData,
3834
- erc20TransferCallDetails
3835
- ]);
3856
+ const encodedExecutionCalls = withBuilderCode(
3857
+ await smartWalletClient.account.encodeCalls([
3858
+ unwrapCallData,
3859
+ erc20TransferCallDetails
3860
+ ]),
3861
+ this.chainId
3862
+ );
3836
3863
  const requestCallData = await this.operationRequestCall(encodedExecutionCalls);
3837
- const requestCalls = await smartWalletClient.account.encodeCalls([requestCallData.call]);
3864
+ const requestCalls = withBuilderCode(
3865
+ await smartWalletClient.account.encodeCalls([requestCallData.call]),
3866
+ this.chainId
3867
+ );
3838
3868
  const requestUserOpReceipt = await this.walletService.sendUserOperationsAndWaitReceipt(
3839
3869
  requestCalls,
3840
3870
  void 0,
@@ -3869,9 +3899,12 @@ var BaseCryptoService = class {
3869
3899
  params.recipientAddress,
3870
3900
  parseUnits(String(params.amount), tokenData?.decimals ?? 18)
3871
3901
  );
3872
- const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([
3873
- erc20TransferCallDetails
3874
- ]);
3902
+ const encodedExecutionCalls = withBuilderCode(
3903
+ await smartWalletClient.account.encodeCalls([
3904
+ erc20TransferCallDetails
3905
+ ]),
3906
+ this.chainId
3907
+ );
3875
3908
  const userOpReceipt = await this.walletService.sendUserOperationsAndWaitReceipt(encodedExecutionCalls);
3876
3909
  if (!userOpReceipt.success) {
3877
3910
  throw new Error(
@@ -3955,10 +3988,13 @@ var BaseCryptoService = class {
3955
3988
  params.recipientAddress,
3956
3989
  parseUnits(params.amount, baseToken.decimals ?? 18)
3957
3990
  );
3958
- const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([
3959
- unwrapCallData,
3960
- erc20TransferCallDetails
3961
- ]);
3991
+ const encodedExecutionCalls = withBuilderCode(
3992
+ await smartWalletClient.account.encodeCalls([
3993
+ unwrapCallData,
3994
+ erc20TransferCallDetails
3995
+ ]),
3996
+ this.chainId
3997
+ );
3962
3998
  const userOpReceipt = await this.walletService.sendUserOperationsAndWaitReceipt(
3963
3999
  encodedExecutionCalls,
3964
4000
  void 0,
@@ -3994,7 +4030,10 @@ var BaseCryptoService = class {
3994
4030
  if (!smartWalletClient.account) {
3995
4031
  throw new Error("Smart wallet client account is not available.");
3996
4032
  }
3997
- const encodedCall = await smartWalletClient.account.encodeCalls([callData]);
4033
+ const encodedCall = withBuilderCode(
4034
+ await smartWalletClient.account.encodeCalls([callData]),
4035
+ this.chainId
4036
+ );
3998
4037
  const nonce = await this.getCustomNonceToFinishRequest(encodedCall);
3999
4038
  const userOpReceipt = await this.walletService.sendUserOperationsWithNonceAndWaitReceipt(
4000
4039
  encodedCall,
@@ -4082,6 +4121,7 @@ var BaseCryptoService = class {
4082
4121
  var BaseOnboardingService = class {
4083
4122
  constructor(config) {
4084
4123
  this.walletService = config.walletService;
4124
+ this.chainId = config.chainId;
4085
4125
  this.accountAbstractionService = config.accountAbstractionService;
4086
4126
  this.accountContractService = config.accountContractService;
4087
4127
  this.logger = config.logger;
@@ -4097,11 +4137,14 @@ var BaseOnboardingService = class {
4097
4137
  const executorCall = await this.accountAbstractionService.getExecutorInstallCall();
4098
4138
  const policyCall = await this.accountAbstractionService.getPolicyInstallCall();
4099
4139
  const accountCall = await this.accountContractService.getAccountRegistrationCall();
4100
- const callData = await smartWalletClient.account.encodeCalls([
4101
- executorCall,
4102
- policyCall,
4103
- accountCall
4104
- ]);
4140
+ const callData = withBuilderCode(
4141
+ await smartWalletClient.account.encodeCalls([
4142
+ executorCall,
4143
+ policyCall,
4144
+ accountCall
4145
+ ]),
4146
+ this.chainId
4147
+ );
4105
4148
  const userOpReceipt = await this.walletService.sendUserOperationsAndWaitReceipt(
4106
4149
  callData,
4107
4150
  smartWalletClient
@@ -4302,6 +4345,7 @@ var BaseYieldService = class {
4302
4345
  this.BLOCKS_PER_SECOND = 0.5;
4303
4346
  this.publicClient = config.publicClient;
4304
4347
  this.walletService = config.walletService;
4348
+ this.chainId = config.chainId;
4305
4349
  this.contracts = config.contracts;
4306
4350
  this.tokens = config.tokens;
4307
4351
  }
@@ -4349,7 +4393,10 @@ var BaseYieldService = class {
4349
4393
  async switchYieldToken(token) {
4350
4394
  const smartWalletClient = await this.walletService.getSmartWalletClient();
4351
4395
  const claimCallData = await this.generateCallDataFoSwitchToken(token);
4352
- const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([claimCallData]);
4396
+ const encodedExecutionCalls = withBuilderCode(
4397
+ await smartWalletClient.account.encodeCalls([claimCallData]),
4398
+ this.chainId
4399
+ );
4353
4400
  const { receipt: executeReceipt } = await this.walletService.sendUserOperationsAndWaitReceipt(encodedExecutionCalls);
4354
4401
  if (executeReceipt.success === false) {
4355
4402
  throw new Error("Switching yield token failed");
@@ -4360,7 +4407,10 @@ var BaseYieldService = class {
4360
4407
  async withdraw() {
4361
4408
  const smartWalletClient = await this.walletService.getSmartWalletClient();
4362
4409
  const claimCallData = await this.generateClaimCallData();
4363
- const encodedExecutionCalls = await smartWalletClient.account.encodeCalls([claimCallData]);
4410
+ const encodedExecutionCalls = withBuilderCode(
4411
+ await smartWalletClient.account.encodeCalls([claimCallData]),
4412
+ this.chainId
4413
+ );
4364
4414
  const { receipt: executeReceipt } = await this.walletService.sendUserOperationsAndWaitReceipt(encodedExecutionCalls);
4365
4415
  if (executeReceipt.success === false) {
4366
4416
  throw new Error("Claimed yield failed");
@@ -4629,6 +4679,7 @@ var baseFactory = {
4629
4679
  kernelPublicClient: config.kernelPublicClient,
4630
4680
  contracts: config.contracts,
4631
4681
  walletService,
4682
+ chainId: config.chain.id,
4632
4683
  logger: config.logger
4633
4684
  });
4634
4685
  },
@@ -4636,6 +4687,7 @@ var baseFactory = {
4636
4687
  return new BaseCryptoService({
4637
4688
  contracts: config.contracts,
4638
4689
  walletService,
4690
+ chainId: config.chain.id,
4639
4691
  tokens,
4640
4692
  logger: config.logger,
4641
4693
  withdrawalApi: config.withdrawalApi
@@ -4645,6 +4697,7 @@ var baseFactory = {
4645
4697
  return new BaseYieldService({
4646
4698
  publicClient: config.publicClient,
4647
4699
  walletService,
4700
+ chainId: config.chain.id,
4648
4701
  contracts: config.contracts,
4649
4702
  tokens
4650
4703
  });
@@ -4653,6 +4706,7 @@ var baseFactory = {
4653
4706
  return new BaseAccountContractService({
4654
4707
  publicRpcClient: config.publicClient,
4655
4708
  walletService,
4709
+ chainId: config.chain.id,
4656
4710
  companyId: config.companyId || "",
4657
4711
  logger: config.logger,
4658
4712
  contracts: config.contracts
@@ -4661,6 +4715,7 @@ var baseFactory = {
4661
4715
  createOnboardingService(config, walletService, accountAbstractionService, accountContractService) {
4662
4716
  return new BaseOnboardingService({
4663
4717
  walletService,
4718
+ chainId: config.chain.id,
4664
4719
  accountAbstractionService,
4665
4720
  accountContractService,
4666
4721
  logger: config.logger
@@ -4669,6 +4724,7 @@ var baseFactory = {
4669
4724
  };
4670
4725
  chainRegistry.register(8453, baseFactory);
4671
4726
  chainRegistry.register(84532, baseFactory);
4727
+ chainRegistry.register(5042, baseFactory);
4672
4728
  chainRegistry.register(5042002, baseFactory);
4673
4729
 
4674
4730
  // src/modules/crypto/internal/contract-registry.service.ts
@@ -4747,6 +4803,8 @@ var ContractRegistryService = class {
4747
4803
  }
4748
4804
  }
4749
4805
  };
4806
+ var STELLAR_CHAIN = "STELLAR";
4807
+ var ARC_CHAIN = "ARC";
4750
4808
  var supportedEVMChains = [
4751
4809
  SupportedChains.BASE,
4752
4810
  SupportedChains.ARBITRUM_ONE,
@@ -4756,13 +4814,41 @@ var supportedEVMChains = [
4756
4814
  SupportedChains.POLYGON,
4757
4815
  SupportedChains.OPTIMISM
4758
4816
  ];
4817
+ var RHINO_DESTINATION_CHAIN_BY_CHAIN_ID = {
4818
+ 8453: SupportedChains.BASE,
4819
+ 84532: SupportedChains.BASE,
4820
+ 5042: ARC_CHAIN,
4821
+ 5042002: ARC_CHAIN
4822
+ };
4823
+ function resolveRhinoDestinationChain(chainId) {
4824
+ const destinationChain = RHINO_DESTINATION_CHAIN_BY_CHAIN_ID[chainId];
4825
+ if (!destinationChain) {
4826
+ const supported = Object.keys(RHINO_DESTINATION_CHAIN_BY_CHAIN_ID).join(", ");
4827
+ throw new ConfigurationError(
4828
+ `No Rhino.fi destination chain for chainId ${chainId}. Supported: ${supported}`
4829
+ );
4830
+ }
4831
+ return destinationChain;
4832
+ }
4759
4833
  var SYSTEM_SUPPORTED_TOKENS = ["USDT", "USDC", "EURC"];
4834
+ var NO_BRIDGEABLE_TOKENS_TAG = "DepositAddressNoBridgableTokens";
4835
+ function getUnbridgeableChain(error) {
4836
+ if (!error || typeof error !== "object") {
4837
+ return void 0;
4838
+ }
4839
+ const { _tag, from } = error;
4840
+ return _tag === NO_BRIDGEABLE_TOKENS_TAG && typeof from === "string" ? from : void 0;
4841
+ }
4760
4842
  var SmartDepositAddressesService = class {
4761
4843
  constructor(config) {
4762
4844
  this.rhinoSdkInstance = null;
4763
4845
  this.addresses = [];
4764
4846
  this.walletService = config.walletService;
4765
4847
  this.rhinoApiKey = config.rhinoApiKey;
4848
+ this.destinationChain = resolveRhinoDestinationChain(config.chainId);
4849
+ }
4850
+ getDestinationChain() {
4851
+ return this.destinationChain;
4766
4852
  }
4767
4853
  async initializeSmartDepositAddresses(forceRefresh = false) {
4768
4854
  if (this.addresses.length > 0 && !forceRefresh) {
@@ -4774,12 +4860,14 @@ var SmartDepositAddressesService = class {
4774
4860
  const hasEvmAddresses = result.evmChains.length > 0;
4775
4861
  const hasTronAddresses = result.tronChains.length > 0;
4776
4862
  const hasSolanaAddresses = result.solanaChains.length > 0;
4777
- if (!hasEvmAddresses || !hasTronAddresses || !hasSolanaAddresses) {
4863
+ const hasStellarAddresses = result.stellarChains.length > 0;
4864
+ if (!hasEvmAddresses || !hasTronAddresses || !hasSolanaAddresses || !hasStellarAddresses) {
4778
4865
  const failedGroups = [];
4779
4866
  if (!hasEvmAddresses) failedGroups.push("EVM");
4780
4867
  if (!hasTronAddresses) failedGroups.push("TRON");
4781
4868
  if (!hasSolanaAddresses) failedGroups.push("Solana");
4782
- console.warn(`Some chain groups failed to initialize: ${failedGroups.join(", ")}`);
4869
+ if (!hasStellarAddresses) failedGroups.push("Stellar");
4870
+ console.warn(`No deposit addresses for chain groups: ${failedGroups.join(", ")}`);
4783
4871
  }
4784
4872
  this.setAddresses(allAddresses);
4785
4873
  return allAddresses;
@@ -4801,31 +4889,47 @@ var SmartDepositAddressesService = class {
4801
4889
  const smartWalletClient = await this.walletService.getSmartWalletClient();
4802
4890
  const smartWalletAddress = smartWalletClient.account.address;
4803
4891
  const sdk = this.getRhinoSdk();
4804
- const response = await sdk.api.depositAddresses.create({
4805
- depositChains: supportedChains,
4806
- destinationChain: SupportedChains.BASE,
4807
- destinationAddress: smartWalletAddress,
4808
- bridgeIfNotSwappable: true,
4809
- tokenOut: "USDC",
4810
- postBridgeData: {
4811
- _tag: "wirexwrap"
4812
- },
4813
- reusePolicy: "reuse-existing"
4814
- });
4815
- if (response.response.status !== 200 || !response.data) {
4816
- throw new Error(JSON.stringify(response.error));
4817
- }
4818
- const activationPromises = response.data.filter((depositData) => !depositData.isActive).map(async (depositData) => {
4819
- const activationResponse = await sdk.api.depositAddresses.activate({
4820
- depositAddress: depositData.depositAddress,
4821
- depositChain: depositData.depositChain
4892
+ let depositChains = [...supportedChains];
4893
+ while (depositChains.length > 0) {
4894
+ const response = await sdk.api.depositAddresses.create({
4895
+ depositChains,
4896
+ destinationChain: this.destinationChain,
4897
+ destinationAddress: smartWalletAddress,
4898
+ bridgeIfNotSwappable: true,
4899
+ tokenOut: "USDC",
4900
+ postBridgeData: {
4901
+ _tag: "wirexwrap"
4902
+ },
4903
+ reusePolicy: "reuse-existing"
4822
4904
  });
4823
- if (activationResponse.response.status !== 200) {
4824
- throw new Error(JSON.stringify(activationResponse.error));
4905
+ if (response.response.status === 200 && response.data) {
4906
+ return this.activateDepositAddresses(sdk, response.data);
4907
+ }
4908
+ const unbridgeableChain = getUnbridgeableChain(response.error);
4909
+ if (!unbridgeableChain || !depositChains.includes(unbridgeableChain)) {
4910
+ throw new Error(JSON.stringify(response.error));
4911
+ }
4912
+ console.warn(
4913
+ `No bridgeable tokens from ${unbridgeableChain} to ${this.destinationChain}, skipping chain`
4914
+ );
4915
+ depositChains = depositChains.filter((chain) => chain !== unbridgeableChain);
4916
+ }
4917
+ return [];
4918
+ }
4919
+ async activateDepositAddresses(sdk, depositAddresses) {
4920
+ const inactiveAddresses = depositAddresses.filter((depositData) => !depositData.isActive);
4921
+ const activationResults = await Promise.allSettled(
4922
+ inactiveAddresses.map((depositData) => this.activateDepositAddress(sdk, depositData))
4923
+ );
4924
+ const failedChains = /* @__PURE__ */ new Set();
4925
+ activationResults.forEach((result, index) => {
4926
+ if (result.status === "rejected") {
4927
+ const chain = inactiveAddresses[index].depositChain;
4928
+ failedChains.add(chain);
4929
+ console.error(`Failed to activate ${chain} deposit address:`, result.reason);
4825
4930
  }
4826
4931
  });
4827
- await Promise.all(activationPromises);
4828
- return response.data.map((item) => {
4932
+ return depositAddresses.filter((item) => !failedChains.has(item.depositChain)).map((item) => {
4829
4933
  const supportedTokens = (item.supportedTokens || []).map((token) => token.symbol).filter((symbol) => SYSTEM_SUPPORTED_TOKENS.includes(symbol));
4830
4934
  return {
4831
4935
  depositChain: item.depositChain,
@@ -4837,15 +4941,26 @@ var SmartDepositAddressesService = class {
4837
4941
  };
4838
4942
  });
4839
4943
  }
4944
+ async activateDepositAddress(sdk, depositData) {
4945
+ const activationResponse = await sdk.api.depositAddresses.activate({
4946
+ depositAddress: depositData.depositAddress,
4947
+ depositChain: depositData.depositChain
4948
+ });
4949
+ if (activationResponse.response.status !== 200) {
4950
+ throw new Error(JSON.stringify(activationResponse.error));
4951
+ }
4952
+ }
4840
4953
  async createSmartDepositAddresses() {
4841
4954
  const results = await Promise.allSettled([
4842
4955
  this.createSmartDepositAddressForChains(supportedEVMChains),
4843
4956
  this.createSmartDepositAddressForChains([SupportedChains.TRON]),
4844
- this.createSmartDepositAddressForChains([SupportedChains.SOLANA])
4957
+ this.createSmartDepositAddressForChains([SupportedChains.SOLANA]),
4958
+ this.createSmartDepositAddressForChains([STELLAR_CHAIN])
4845
4959
  ]);
4846
4960
  const evmChains = results[0].status === "fulfilled" ? results[0].value : [];
4847
4961
  const tronChains = results[1].status === "fulfilled" ? results[1].value : [];
4848
4962
  const solanaChains = results[2].status === "fulfilled" ? results[2].value : [];
4963
+ const stellarChains = results[3].status === "fulfilled" ? results[3].value : [];
4849
4964
  if (results[0].status === "rejected") {
4850
4965
  console.error("Failed to create EVM chain addresses:", results[0].reason);
4851
4966
  }
@@ -4855,11 +4970,15 @@ var SmartDepositAddressesService = class {
4855
4970
  if (results[2].status === "rejected") {
4856
4971
  console.error("Failed to create Solana chain addresses:", results[2].reason);
4857
4972
  }
4973
+ if (results[3].status === "rejected") {
4974
+ console.error("Failed to create Stellar chain addresses:", results[3].reason);
4975
+ }
4858
4976
  return {
4859
4977
  evmChains,
4860
4978
  tronChains,
4861
4979
  solanaChains,
4862
- allAddresses: [...evmChains, ...tronChains, ...solanaChains]
4980
+ stellarChains,
4981
+ allAddresses: [...evmChains, ...tronChains, ...solanaChains, ...stellarChains]
4863
4982
  };
4864
4983
  }
4865
4984
  async createMissingAddressesForChainGroup(chainCode) {
@@ -4896,6 +5015,8 @@ var SmartDepositAddressesService = class {
4896
5015
  return [SupportedChains.TRON];
4897
5016
  case "solana":
4898
5017
  return [SupportedChains.SOLANA];
5018
+ case "stellar":
5019
+ return [STELLAR_CHAIN];
4899
5020
  default:
4900
5021
  throw new Error(`Unknown chain group: ${chainGroup}`);
4901
5022
  }
@@ -4910,6 +5031,9 @@ var SmartDepositAddressesService = class {
4910
5031
  if (chainCode === SupportedChains.SOLANA) {
4911
5032
  return "solana";
4912
5033
  }
5034
+ if (chainCode === STELLAR_CHAIN) {
5035
+ return "stellar";
5036
+ }
4913
5037
  throw new Error(`Unknown chain code: ${chainCode}`);
4914
5038
  }
4915
5039
  getRhinoSdk() {
@@ -5062,7 +5186,8 @@ var CryptoModule = class {
5062
5186
  if (config.rhinoApiKey) {
5063
5187
  this._smartDepositService = new SmartDepositAddressesService({
5064
5188
  walletService: this._walletService,
5065
- rhinoApiKey: config.rhinoApiKey
5189
+ rhinoApiKey: config.rhinoApiKey,
5190
+ chainId: config.chainId
5066
5191
  });
5067
5192
  }
5068
5193
  }
@@ -5073,5 +5198,5 @@ var CryptoModule = class {
5073
5198
  };
5074
5199
 
5075
5200
  export { BaseAccountAbstractionService, BaseAccountContractService, BaseCryptoService, BaseOnboardingService, BaseWalletService, BaseYieldService, ContractRegistryService, CryptoModule, chainRegistry };
5076
- //# sourceMappingURL=chunk-NYDDEDPQ.js.map
5077
- //# sourceMappingURL=chunk-NYDDEDPQ.js.map
5201
+ //# sourceMappingURL=chunk-YGNDXSTF.js.map
5202
+ //# sourceMappingURL=chunk-YGNDXSTF.js.map