@wirexapp/wpay-baas-sdk 0.1.9 → 0.1.10

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 { S as SDKEnvironment, R as RemoteConfig, C as ChainConfig } from '../types-_RME4STd.js';
2
- export { a as Chain, b as ContractAddresses, H as Hex, c as HttpClient, d as HttpClientConfig, L as Logger, M as MainWalletClient, e as ModuleContext, f as RequestOptions, g as ResolvedSDKConfig, h as SDKConfig, i as SDKModule, T as TokenInfo, j as TransactionHash, k as defaultLogger, s as silentLogger } from '../types-_RME4STd.js';
1
+ import { c as SDKEnvironment, f as RemoteConfig, g as ChainConfig } from '../types-BVFY0JJu.js';
2
+ export { h as Chain, C as ContractAddresses, H as Hex, i as HttpClient, j as HttpClientConfig, L as Logger, M as MainWalletClient, b as ModuleContext, k as RequestOptions, R as ResolvedSDKConfig, a as SDKConfig, S as SDKModule, T as TokenInfo, d as TransactionHash, e as defaultLogger, s as silentLogger } from '../types-BVFY0JJu.js';
3
3
  export { A as AuthenticationError, C as ConfigurationError, a as ContractError, N as NetworkError, S as SDKError, T as TransactionError, V as ValidationError, W as WalletError } from '../errors-5LpyK95R.js';
4
4
  import 'viem';
5
5
 
@@ -29,4 +29,8 @@ declare class ConfigService {
29
29
  getEnvironment(): SDKEnvironment | null;
30
30
  }
31
31
 
32
- export { ChainConfig, ConfigService, RemoteConfig, SDKEnvironment };
32
+ declare function toDataSuffix(codes: string[]): `0x${string}`;
33
+ declare const BUILDER_CODE_SUFFIX: `0x${string}`;
34
+ declare function withBuilderCode(callData: `0x${string}`, chainId: number): `0x${string}`;
35
+
36
+ export { BUILDER_CODE_SUFFIX, ChainConfig, ConfigService, RemoteConfig, SDKEnvironment, toDataSuffix, withBuilderCode };
@@ -1,3 +1,3 @@
1
- export { AuthenticationError, ConfigService, ConfigurationError, ContractError, HttpClient, NetworkError, SDKError, TransactionError, ValidationError, WalletError, defaultLogger, silentLogger } from '../chunk-YXNNTBO5.js';
1
+ export { AuthenticationError, BUILDER_CODE_SUFFIX, ConfigService, ConfigurationError, ContractError, HttpClient, NetworkError, SDKError, TransactionError, ValidationError, WalletError, defaultLogger, silentLogger, toDataSuffix, withBuilderCode } from '../chunk-XYHCKANZ.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  import { KernelAccountClient } from '@zerodev/sdk';
2
2
  import { WalletClient, PublicClient, HttpTransport } from 'viem';
3
- import { H as Hex, j as TransactionHash, b as ContractAddresses, T as TokenInfo, M as MainWalletClient, a as Chain, L as Logger, i as SDKModule, e as ModuleContext } from './types-_RME4STd.js';
4
- import { W as WithdrawalApi, I as ICryptoService } from './withdrawal.api-CmRHIoyc.js';
3
+ import { H as Hex, d as TransactionHash, C as ContractAddresses, T as TokenInfo, M as MainWalletClient, h as Chain, L as Logger, S as SDKModule, b as ModuleContext } from './types-BVFY0JJu.js';
4
+ import { W as WithdrawalApi, I as ICryptoService } from './withdrawal.api-DhpWX0eX.js';
5
5
  import { WaitForUserOperationReceiptReturnType } from 'viem/account-abstraction';
6
6
 
7
7
  /** A single call inside a UserOp batch, as accepted by `account.encodeCalls`. */
@@ -134,7 +134,7 @@ interface ChainServicesFactory {
134
134
 
135
135
  interface IDepositAddressData {
136
136
  depositChain: string;
137
- depositAddress: `0x${string}`;
137
+ depositAddress: string;
138
138
  destinationChain: string;
139
139
  destinationAddress: `0x${string}`;
140
140
  isActive: boolean;
@@ -1,5 +1,5 @@
1
- import { c as HttpClient, L as Logger, i as SDKModule, e as ModuleContext } from './types-_RME4STd.js';
2
- import { W as WithdrawalApi } from './withdrawal.api-CmRHIoyc.js';
1
+ import { i as HttpClient, L as Logger, S as SDKModule, b as ModuleContext } from './types-BVFY0JJu.js';
2
+ import { W as WithdrawalApi } from './withdrawal.api-DhpWX0eX.js';
3
3
 
4
4
  /**
5
5
  * Activity Feed endpoints - Types match API spec
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { C as CryptoModule } from './crypto.module-BsI4pLhf.js';
2
- export { A as AccountStatus, B as BatchTransferItem, a as BatchTransferResult, b as CallData, P as PolicyStatus, T as TransferRequest, c as TransferResult, Y as YieldData, d as YieldGraphicDataPoint } from './crypto.module-BsI4pLhf.js';
3
- import { g as ResolvedSDKConfig, i as SDKModule, h as SDKConfig } from './types-_RME4STd.js';
4
- export { b as ContractAddresses, H as Hex, L as Logger, M as MainWalletClient, e as ModuleContext, S as SDKEnvironment, T as TokenInfo, j as TransactionHash, k as defaultLogger } from './types-_RME4STd.js';
5
- import { A as ApiModule, a as AuthService } from './index-3P-X9tLg.js';
6
- export { b as ActionConfirmationCreateSmsRequest, c as ActionConfirmationCreateTokenRequest, d as ActionConfirmationSmsSessionResponse, e as ActionConfirmationVerifySmsRequest, f as ActionTokenResponse, g as ActivateBankAccountRequest, h as AuthResponse, i as AuthorizeUserResponse, B as BaasModule, W as BaasWalletBalance, C as CardActivateRequestBody, j as CardDetailsGetCvvRequestBody, k as CardDetailsGetDetailsRequestBody, l as CardDetailsGetPinRequestBody, m as CardFeesCreateInvoiceRequestBody, n as CardIssuePlasticRequest, o as CardIssueVirtualRequest, p as CardLimitChangeRequestBody, q as CardNameChangeRequestBody, r as CardTransactionResponse, s as CardTransactionsResponse, t as CardTransferEstimateRequest, u as CardTransferExecuteRequest, v as CardWithdrawalEstimateRequestBody, w as CardWithdrawalExecuteRequestBody, x as ConfirmPhoneNumberRequest, y as ConfirmationActionType, z as CorridorEstimateRequest, D as CorridorTransferRequest, E as CreateUserRequest, F as EstimateTransferRequest, G as ExecuteTransferRequest, H as GetActivityByIdRequest, I as GetActivityFeedRequest, J as GetBankAccountsRequest, K as GetCardTransactionsRequest, L as GetCardsRequest, M as GetFullStatementRequest, N as GetRatesRequest, O as GetRecipientsByCatalogRequest, P as GetRecipientsByCurrencyRequest, Q as GetRecipientsByNameRequest, R as GetRecipientsByTypeRequest, S as GetRecipientsRequest, T as GetSharingTokenResponse, U as GetVerificationTokenResponse, V as GetWalletRequest, X as InitialData, Y as LoginCompanyParams, Z as LoginUserParams, _ as OAuth2TokenRequest, $ as OAuth2TokenResponse, a0 as PrivyAuth, a1 as RatesResponse, a2 as RecipientCreateDetailsRequestBody, a3 as RecipientCreateRequest, a4 as RecipientCreateRequestV2, a5 as RecipientDetailsType, a6 as RecipientPaymentDetailsAch, a7 as RecipientPaymentDetailsBiFast, a8 as RecipientPaymentDetailsCard, a9 as RecipientPaymentDetailsCrypto, aa as RecipientPaymentDetailsFasterPayment, ab as RecipientPaymentDetailsFpsHk, ac as RecipientPaymentDetailsImps, ad as RecipientPaymentDetailsInstapay, ae as RecipientPaymentDetailsIpp, af as RecipientPaymentDetailsLegalAddress, ag as RecipientPaymentDetailsNip, ah as RecipientPaymentDetailsPix, ai as RecipientPaymentDetailsPse, aj as RecipientPaymentDetailsResponse, ak as RecipientPaymentDetailsSepa, al as RecipientPaymentDetailsSpei, am as RecipientPaymentDetailsSwift, an as RecipientPersonalInfo, ao as RecipientResponse, ap as RecipientSortOrder, aq as RecipientUpdateDetailsRequestBody, ar as RecipientUpdateRequestBody, as as RecipientsResponse, at as RegisterCompanyParams, au as RegisterUserParams, av as RegisterUserResponse, aw as RequestedErcWithdrawalResponse, ax as RequestedErcWithdrawalsResponse, ay as ResidenceAddress, az as SendVerificationLinkRequest, aA as SwapEstimateRequest, aB as SwapEstimateRequestByDestinationAmount, aC as SwapEstimateRequestBySourceAmount, aD as SwapEstimateResponse, aE as SwapExecuteRequest, aF as SwapExecuteResponse, aG as TokenResponse, aH as UpdateFreshdeskIdRequest, aI as UpdatePhoneNumberRequest, aJ as UserDescriptor, aK as UserProfile, aL as ValidateUserParams, aM as ValidateUserResponse, aN as VerifyTokenRequest, aO as VerifyTokenResponse, aP as WalletCreateGlobalRequest, aQ as WalletResponse, aR as WalletStatus, aS as WalletType } from './index-3P-X9tLg.js';
1
+ import { C as CryptoModule } from './crypto.module-b1_0pvdU.js';
2
+ export { A as AccountStatus, B as BatchTransferItem, a as BatchTransferResult, b as CallData, P as PolicyStatus, T as TransferRequest, c as TransferResult, Y as YieldData, d as YieldGraphicDataPoint } from './crypto.module-b1_0pvdU.js';
3
+ import { R as ResolvedSDKConfig, S as SDKModule, a as SDKConfig } from './types-BVFY0JJu.js';
4
+ export { C as ContractAddresses, H as Hex, L as Logger, M as MainWalletClient, b as ModuleContext, c as SDKEnvironment, T as TokenInfo, d as TransactionHash, e as defaultLogger } from './types-BVFY0JJu.js';
5
+ import { A as ApiModule, a as AuthService } from './index-Bi3ZpwPK.js';
6
+ export { b as ActionConfirmationCreateSmsRequest, c as ActionConfirmationCreateTokenRequest, d as ActionConfirmationSmsSessionResponse, e as ActionConfirmationVerifySmsRequest, f as ActionTokenResponse, g as ActivateBankAccountRequest, h as AuthResponse, i as AuthorizeUserResponse, B as BaasModule, W as BaasWalletBalance, C as CardActivateRequestBody, j as CardDetailsGetCvvRequestBody, k as CardDetailsGetDetailsRequestBody, l as CardDetailsGetPinRequestBody, m as CardFeesCreateInvoiceRequestBody, n as CardIssuePlasticRequest, o as CardIssueVirtualRequest, p as CardLimitChangeRequestBody, q as CardNameChangeRequestBody, r as CardTransactionResponse, s as CardTransactionsResponse, t as CardTransferEstimateRequest, u as CardTransferExecuteRequest, v as CardWithdrawalEstimateRequestBody, w as CardWithdrawalExecuteRequestBody, x as ConfirmPhoneNumberRequest, y as ConfirmationActionType, z as CorridorEstimateRequest, D as CorridorTransferRequest, E as CreateUserRequest, F as EstimateTransferRequest, G as ExecuteTransferRequest, H as GetActivityByIdRequest, I as GetActivityFeedRequest, J as GetBankAccountsRequest, K as GetCardTransactionsRequest, L as GetCardsRequest, M as GetFullStatementRequest, N as GetRatesRequest, O as GetRecipientsByCatalogRequest, P as GetRecipientsByCurrencyRequest, Q as GetRecipientsByNameRequest, R as GetRecipientsByTypeRequest, S as GetRecipientsRequest, T as GetSharingTokenResponse, U as GetVerificationTokenResponse, V as GetWalletRequest, X as InitialData, Y as LoginCompanyParams, Z as LoginUserParams, _ as OAuth2TokenRequest, $ as OAuth2TokenResponse, a0 as PrivyAuth, a1 as RatesResponse, a2 as RecipientCreateDetailsRequestBody, a3 as RecipientCreateRequest, a4 as RecipientCreateRequestV2, a5 as RecipientDetailsType, a6 as RecipientPaymentDetailsAch, a7 as RecipientPaymentDetailsBiFast, a8 as RecipientPaymentDetailsCard, a9 as RecipientPaymentDetailsCrypto, aa as RecipientPaymentDetailsFasterPayment, ab as RecipientPaymentDetailsFpsHk, ac as RecipientPaymentDetailsImps, ad as RecipientPaymentDetailsInstapay, ae as RecipientPaymentDetailsIpp, af as RecipientPaymentDetailsLegalAddress, ag as RecipientPaymentDetailsNip, ah as RecipientPaymentDetailsPix, ai as RecipientPaymentDetailsPse, aj as RecipientPaymentDetailsResponse, ak as RecipientPaymentDetailsSepa, al as RecipientPaymentDetailsSpei, am as RecipientPaymentDetailsSwift, an as RecipientPersonalInfo, ao as RecipientResponse, ap as RecipientSortOrder, aq as RecipientUpdateDetailsRequestBody, ar as RecipientUpdateRequestBody, as as RecipientsResponse, at as RegisterCompanyParams, au as RegisterUserParams, av as RegisterUserResponse, aw as RequestedErcWithdrawalResponse, ax as RequestedErcWithdrawalsResponse, ay as ResidenceAddress, az as SendVerificationLinkRequest, aA as SwapEstimateRequest, aB as SwapEstimateRequestByDestinationAmount, aC as SwapEstimateRequestBySourceAmount, aD as SwapEstimateResponse, aE as SwapExecuteRequest, aF as SwapExecuteResponse, aG as TokenResponse, aH as UpdateFreshdeskIdRequest, aI as UpdatePhoneNumberRequest, aJ as UserDescriptor, aK as UserProfile, aL as ValidateUserParams, aM as ValidateUserResponse, aN as VerifyTokenRequest, aO as VerifyTokenResponse, aP as WalletCreateGlobalRequest, aQ as WalletResponse, aR as WalletStatus, aS as WalletType } from './index-Bi3ZpwPK.js';
7
7
  export { A as AuthenticationError, C as ConfigurationError, a as ContractError, N as NetworkError, S as SDKError, T as TransactionError, V as ValidationError, W as WalletError } from './errors-5LpyK95R.js';
8
8
  export { Signer } from '@zerodev/sdk/types';
9
9
  import '@zerodev/sdk';
10
10
  import 'viem';
11
- import './withdrawal.api-CmRHIoyc.js';
11
+ import './withdrawal.api-DhpWX0eX.js';
12
12
  import 'viem/account-abstraction';
13
13
 
14
14
  declare class WirexPaySDK {
package/dist/index.js CHANGED
@@ -1,16 +1,29 @@
1
- import { CryptoModule } from './chunk-NYDDEDPQ.js';
2
- export { CryptoModule } from './chunk-NYDDEDPQ.js';
3
- import { AuthService, ApiModule } from './chunk-D2YHFKQI.js';
4
- export { ApiModule, AuthService, BaasModule } from './chunk-D2YHFKQI.js';
5
- import { HttpClient, ConfigurationError, defaultLogger, silentLogger, ConfigService } from './chunk-YXNNTBO5.js';
6
- export { AuthenticationError, ConfigurationError, ContractError, NetworkError, SDKError, TransactionError, ValidationError, WalletError, defaultLogger } from './chunk-YXNNTBO5.js';
7
- import { arcTestnet, baseSepolia, base } from 'viem/chains';
1
+ import { CryptoModule } from './chunk-GOPZA7GB.js';
2
+ export { CryptoModule } from './chunk-GOPZA7GB.js';
3
+ import { AuthService, ApiModule } from './chunk-RIB34JK2.js';
4
+ export { ApiModule, AuthService, BaasModule } from './chunk-RIB34JK2.js';
5
+ import { HttpClient, ConfigurationError, defaultLogger, silentLogger, ConfigService } from './chunk-XYHCKANZ.js';
6
+ export { AuthenticationError, ConfigurationError, ContractError, NetworkError, SDKError, TransactionError, ValidationError, WalletError, defaultLogger } from './chunk-XYHCKANZ.js';
7
+ import { arcTestnet, arc, baseSepolia, base } from 'viem/chains';
8
8
 
9
9
  var CHAIN_MAP = {
10
10
  8453: base,
11
11
  84532: baseSepolia,
12
+ 5042: arc,
12
13
  5042002: arcTestnet
13
14
  };
15
+ var SUPPORTED_CHAIN_IDS = Object.keys(CHAIN_MAP).join(", ");
16
+ function resolveChainConfig(configService, remoteConfig, chainId) {
17
+ if (chainId === void 0) {
18
+ return remoteConfig.defaultChain;
19
+ }
20
+ if (!CHAIN_MAP[chainId]) {
21
+ throw new ConfigurationError(
22
+ `Chain ${chainId} is not supported by the SDK. Supported chains: ${SUPPORTED_CHAIN_IDS}`
23
+ );
24
+ }
25
+ return configService.getChainConfig(chainId);
26
+ }
14
27
  var WirexPaySDK = class {
15
28
  constructor(config) {
16
29
  this.modules = /* @__PURE__ */ new Map();
@@ -80,11 +93,11 @@ async function createSDK(config) {
80
93
  config.companyName,
81
94
  config.configUrl
82
95
  );
83
- const chainConfig = remoteConfig.defaultChain;
96
+ const chainConfig = resolveChainConfig(configService, remoteConfig, config.chainId);
84
97
  const chain = CHAIN_MAP[chainConfig.id];
85
98
  if (!chain) {
86
99
  throw new ConfigurationError(
87
- `No viem chain mapping for chainId ${chainConfig.id}. Supported: ${Object.keys(CHAIN_MAP).join(", ")}`
100
+ `No viem chain mapping for chainId ${chainConfig.id}. Supported: ${SUPPORTED_CHAIN_IDS}`
88
101
  );
89
102
  }
90
103
  const resolvedConfig = {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts"],"names":[],"mappings":";;;;;;;;AAWA,IAAM,SAAA,GAAmC;AAAA,EACvC,IAAA,EAAM,IAAA;AAAA,EACN,KAAA,EAAO,WAAA;AAAA,EACP,OAAA,EAAS;AACX,CAAA;AAEO,IAAM,cAAN,MAAkB;AAAA,EAYvB,YAAY,MAAA,EAA2B;AARvC,IAAA,IAAA,CAAiB,OAAA,uBAAsC,GAAA,EAAI;AAM3D,IAAA,IAAA,CAAQ,YAAA,GAAe,KAAA;AAGrB,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,SAAS,MAAA,CAAO,MAAA;AAErB,IAAA,MAAM,UAAA,GAAa,IAAI,UAAA,CAAW;AAAA,MAChC,SAAS,MAAA,CAAO,UAAA;AAAA,MAChB,SAAS,MAAA,CAAO,OAAA;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":"index.js","sourcesContent":["import { arcTestnet, base, baseSepolia } from 'viem/chains';\n\nimport { CryptoModule } from './modules/crypto/crypto.module';\n\nimport type { SDKConfig, ResolvedSDKConfig, SDKModule, ModuleContext, Logger } from './core/index';\nimport type { Chain } from 'viem';\n\nimport { AuthService } from './modules/auth/index';\nimport { defaultLogger, silentLogger, ConfigurationError, ConfigService, HttpClient } from './core/index';\nimport { ApiModule } from './modules/api/index';\n\nconst CHAIN_MAP: Record<number, Chain> = {\n 8453: base,\n 84532: baseSepolia,\n 5042002: arcTestnet,\n};\n\nexport class WirexPaySDK {\n private readonly config: ResolvedSDKConfig;\n private readonly logger: Logger;\n private readonly context: ModuleContext;\n private readonly modules: Map<string, SDKModule> = new Map();\n\n public readonly api: ApiModule;\n public readonly crypto: CryptoModule;\n public readonly auth: AuthService;\n\n private _initialized = false;\n\n constructor(config: ResolvedSDKConfig) {\n this.config = config;\n this.logger = config.logger;\n\n const httpClient = new HttpClient({\n baseUrl: config.apiBaseUrl,\n chainId: config.chainId,\n logger: this.logger,\n getAccessToken: () => this.auth?.getAccessToken() ?? null,\n isAuthenticated: () => this.auth?.isAuthenticated() ?? false,\n getUserWallet: () => this.auth?.getUserWallet() ?? null,\n });\n\n this.auth = AuthService.initialize({\n httpClient,\n chainId: config.chainId,\n logger: this.logger,\n });\n\n this.context = { config, logger: this.logger, httpClient };\n\n this.api = new ApiModule(this.context);\n this.crypto = new CryptoModule(this.context);\n\n this.registerModule(this.api);\n this.registerModule(this.crypto);\n }\n\n private registerModule(module: SDKModule): void {\n if (this.modules.has(module.name)) {\n throw new ConfigurationError(`Module \"${module.name}\" already registered`);\n }\n this.modules.set(module.name, module);\n this.logger.debug(`Module \"${module.name}\" registered`);\n }\n\n async initialize(): Promise<void> {\n if (this._initialized) {\n this.logger.warn('SDK already initialized');\n return;\n }\n\n this.logger.info('Initializing WirexPay SDK...');\n\n for (const [name, module] of this.modules) {\n this.logger.debug(`Initializing module \"${name}\"...`);\n await module.initialize();\n }\n\n this._initialized = true;\n this.logger.info('WirexPay SDK initialized successfully');\n }\n\n isInitialized(): boolean {\n return this._initialized;\n }\n\n getModule<T extends SDKModule>(name: string): T | undefined {\n return this.modules.get(name) as T | undefined;\n }\n\n getModules(): SDKModule[] {\n return Array.from(this.modules.values());\n }\n\n getConfig(): Readonly<ResolvedSDKConfig> {\n return this.config;\n }\n}\n\nexport async function createSDK(config: SDKConfig): Promise<WirexPaySDK> {\n const logger = config.enableLogging ? (config.logger ?? defaultLogger) : silentLogger;\n\n logger.info(\n config.configUrl\n ? `Loading SDK config from custom URL: ${config.configUrl}`\n : `Loading SDK config for environment: ${config.env}`,\n );\n\n const configService = ConfigService.getInstance();\n const remoteConfig = await configService.loadConfig(\n config.env,\n config.companyName,\n config.configUrl,\n );\n\n const chainConfig = remoteConfig.defaultChain;\n\n const chain = CHAIN_MAP[chainConfig.id];\n if (!chain) {\n throw new ConfigurationError(\n `No viem chain mapping for chainId ${chainConfig.id}. Supported: ${Object.keys(CHAIN_MAP).join(', ')}`,\n );\n }\n\n const resolvedConfig: ResolvedSDKConfig = {\n env: config.env,\n chainId: chainConfig.id,\n chain,\n rpcUrl: chainConfig.rpcUrl,\n bundlerRpc: chainConfig.bundlerUrl,\n paymasterRpc: chainConfig.paymasterUrl,\n contractRegistry: chainConfig.contractRegistry,\n apiBaseUrl: remoteConfig.api.apiUrl,\n rhinoApiKey: config.rhinoApiKey,\n companyId: config.companyId,\n logger,\n getMainWalletClient: config.getMainWalletClient,\n };\n\n logger.info(`SDK config resolved for chain: ${chainConfig.name} (${chainConfig.id})`);\n\n const sdk = new WirexPaySDK(resolvedConfig);\n await sdk.initialize();\n\n return sdk;\n}\n"]}
1
+ {"version":3,"sources":["../src/client.ts"],"names":[],"mappings":";;;;;;;;AAmBA,IAAM,SAAA,GAAmC;AAAA,EACvC,IAAA,EAAM,IAAA;AAAA,EACN,KAAA,EAAO,WAAA;AAAA,EACP,IAAA,EAAM,GAAA;AAAA,EACN,OAAA,EAAS;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A;AAAA,MACR,CAAA,kCAAA,EAAqC,WAAA,CAAY,EAAE,CAAA,aAAA,EAAgB,mBAAmB,CAAA;AAAA,KACxF;AAAA,EACF;AAEA,EAAA,MAAM,cAAA,GAAoC;AAAA,IACxC,KAAK,MAAA,CAAO,GAAA;AAAA,IACZ,SAAS,WAAA,CAAY,EAAA;AAAA,IACrB,KAAA;AAAA,IACA,QAAQ,WAAA,CAAY,MAAA;AAAA,IACpB,YAAY,WAAA,CAAY,UAAA;AAAA,IACxB,cAAc,WAAA,CAAY,YAAA;AAAA,IAC1B,kBAAkB,WAAA,CAAY,gBAAA;AAAA,IAC9B,UAAA,EAAY,aAAa,GAAA,CAAI,MAAA;AAAA,IAC7B,aAAa,MAAA,CAAO,WAAA;AAAA,IACpB,WAAW,MAAA,CAAO,SAAA;AAAA,IAClB,MAAA;AAAA,IACA,qBAAqB,MAAA,CAAO;AAAA,GAC9B;AAEA,EAAA,MAAA,CAAO,KAAK,CAAA,+BAAA,EAAkC,WAAA,CAAY,IAAI,CAAA,EAAA,EAAK,WAAA,CAAY,EAAE,CAAA,CAAA,CAAG,CAAA;AAEpF,EAAA,MAAM,GAAA,GAAM,IAAI,WAAA,CAAY,cAAc,CAAA;AAC1C,EAAA,MAAM,IAAI,UAAA,EAAW;AAErB,EAAA,OAAO,GAAA;AACT","file":"index.js","sourcesContent":["import { arc, arcTestnet, base, baseSepolia } from 'viem/chains';\n\nimport { CryptoModule } from './modules/crypto/crypto.module';\n\nimport type {\n SDKConfig,\n ResolvedSDKConfig,\n SDKModule,\n ModuleContext,\n Logger,\n RemoteConfig,\n ChainConfig,\n} from './core/index';\nimport type { Chain } from 'viem';\n\nimport { AuthService } from './modules/auth/index';\nimport { defaultLogger, silentLogger, ConfigurationError, ConfigService, HttpClient } from './core/index';\nimport { ApiModule } from './modules/api/index';\n\nconst CHAIN_MAP: Record<number, Chain> = {\n 8453: base,\n 84532: baseSepolia,\n 5042: arc,\n 5042002: arcTestnet,\n};\n\nconst SUPPORTED_CHAIN_IDS = Object.keys(CHAIN_MAP).join(', ');\n\nfunction resolveChainConfig(\n configService: ConfigService,\n remoteConfig: RemoteConfig,\n chainId?: number,\n): ChainConfig {\n if (chainId === undefined) {\n return remoteConfig.defaultChain;\n }\n\n if (!CHAIN_MAP[chainId]) {\n throw new ConfigurationError(\n `Chain ${chainId} is not supported by the SDK. Supported chains: ${SUPPORTED_CHAIN_IDS}`,\n );\n }\n\n return configService.getChainConfig(chainId);\n}\n\nexport class WirexPaySDK {\n private readonly config: ResolvedSDKConfig;\n private readonly logger: Logger;\n private readonly context: ModuleContext;\n private readonly modules: Map<string, SDKModule> = new Map();\n\n public readonly api: ApiModule;\n public readonly crypto: CryptoModule;\n public readonly auth: AuthService;\n\n private _initialized = false;\n\n constructor(config: ResolvedSDKConfig) {\n this.config = config;\n this.logger = config.logger;\n\n const httpClient = new HttpClient({\n baseUrl: config.apiBaseUrl,\n chainId: config.chainId,\n logger: this.logger,\n getAccessToken: () => this.auth?.getAccessToken() ?? null,\n isAuthenticated: () => this.auth?.isAuthenticated() ?? false,\n getUserWallet: () => this.auth?.getUserWallet() ?? null,\n });\n\n this.auth = AuthService.initialize({\n httpClient,\n chainId: config.chainId,\n logger: this.logger,\n });\n\n this.context = { config, logger: this.logger, httpClient };\n\n this.api = new ApiModule(this.context);\n this.crypto = new CryptoModule(this.context);\n\n this.registerModule(this.api);\n this.registerModule(this.crypto);\n }\n\n private registerModule(module: SDKModule): void {\n if (this.modules.has(module.name)) {\n throw new ConfigurationError(`Module \"${module.name}\" already registered`);\n }\n this.modules.set(module.name, module);\n this.logger.debug(`Module \"${module.name}\" registered`);\n }\n\n async initialize(): Promise<void> {\n if (this._initialized) {\n this.logger.warn('SDK already initialized');\n return;\n }\n\n this.logger.info('Initializing WirexPay SDK...');\n\n for (const [name, module] of this.modules) {\n this.logger.debug(`Initializing module \"${name}\"...`);\n await module.initialize();\n }\n\n this._initialized = true;\n this.logger.info('WirexPay SDK initialized successfully');\n }\n\n isInitialized(): boolean {\n return this._initialized;\n }\n\n getModule<T extends SDKModule>(name: string): T | undefined {\n return this.modules.get(name) as T | undefined;\n }\n\n getModules(): SDKModule[] {\n return Array.from(this.modules.values());\n }\n\n getConfig(): Readonly<ResolvedSDKConfig> {\n return this.config;\n }\n}\n\nexport async function createSDK(config: SDKConfig): Promise<WirexPaySDK> {\n const logger = config.enableLogging ? (config.logger ?? defaultLogger) : silentLogger;\n\n logger.info(\n config.configUrl\n ? `Loading SDK config from custom URL: ${config.configUrl}`\n : `Loading SDK config for environment: ${config.env}`,\n );\n\n const configService = ConfigService.getInstance();\n const remoteConfig = await configService.loadConfig(\n config.env,\n config.companyName,\n config.configUrl,\n );\n\n const chainConfig = resolveChainConfig(configService, remoteConfig, config.chainId);\n\n const chain = CHAIN_MAP[chainConfig.id];\n if (!chain) {\n throw new ConfigurationError(\n `No viem chain mapping for chainId ${chainConfig.id}. Supported: ${SUPPORTED_CHAIN_IDS}`,\n );\n }\n\n const resolvedConfig: ResolvedSDKConfig = {\n env: config.env,\n chainId: chainConfig.id,\n chain,\n rpcUrl: chainConfig.rpcUrl,\n bundlerRpc: chainConfig.bundlerUrl,\n paymasterRpc: chainConfig.paymasterUrl,\n contractRegistry: chainConfig.contractRegistry,\n apiBaseUrl: remoteConfig.api.apiUrl,\n rhinoApiKey: config.rhinoApiKey,\n companyId: config.companyId,\n logger,\n getMainWalletClient: config.getMainWalletClient,\n };\n\n logger.info(`SDK config resolved for chain: ${chainConfig.name} (${chainConfig.id})`);\n\n const sdk = new WirexPaySDK(resolvedConfig);\n await sdk.initialize();\n\n return sdk;\n}\n"]}
@@ -1,4 +1,4 @@
1
- export { b as ActionConfirmationCreateSmsRequest, c as ActionConfirmationCreateTokenRequest, d as ActionConfirmationSmsSessionResponse, e as ActionConfirmationVerifySmsRequest, f as ActionTokenResponse, g as ActivateBankAccountRequest, aT as ActivateBankAccountResponse, aU as ActivityAmount, aV as ActivityDirection, aW as ActivityFeedResponse, aX as ActivityFullStatementResponse, aY as ActivityItem, aZ as ActivityOperation, a_ as ActivityRate, a$ as ActivityRecipient, b0 as ActivityReward, b1 as ActivityRewardType, b2 as ActivityService, b3 as ActivitySortOrder, b4 as ActivityStatus, b5 as ActivityStep, b6 as ActivityStepType, b7 as ActivitySubject, b8 as ActivitySubjectBankAccount, b9 as ActivitySubjectCard, ba as ActivitySubjectMerchant, bb as ActivitySubjectType, bc as ActivitySubjectWallet, bd as ActivityType, be as ApiError, A as ApiModule, bf as ApiResponse, i as AuthorizeUserResponse, B as BaasModule, bg as BankAccount, bh as BankAccountDetails, bi as BankAccountStatus, bj as BankAccountType, bk as BankAccountsResponse, bl as BankCorridorEstimateResponse, bm as BankCorridorExecuteResponse, bn as BankService, bo as BankSortOrder, bp as Capability, bq as CapabilityStatus, br as CapabilityType, bs as CardAction, bt as CardActionType, C as CardActivateRequestBody, bu as CardBalance, bv as CardData, bw as CardDeliveryAddress, bx as CardDeliveryMethod, by as CardDetailsCvvResponse, j as CardDetailsGetCvvRequestBody, k as CardDetailsGetDetailsRequestBody, l as CardDetailsGetPinRequestBody, bz as CardDetailsPanExpiryResponse, bA as CardDetailsPinResponse, m as CardFeesCreateInvoiceRequestBody, bB as CardFeesInvoiceResponse, bC as CardFeesOrderResponse, bD as CardFormat, bE as CardGeneration, n as CardIssuePlasticRequest, bF as CardIssueResponse, o as CardIssueVirtualRequest, bG as CardLimit, p as CardLimitChangeRequestBody, q as CardNameChangeRequestBody, bH as CardPaymentSystem, bI as CardProvider, bJ as CardResponse, bK as CardSortOrder, bL as CardStatus, bM as CardTransactionConfirmationResponse, bN as CardTransactionDirection, r as CardTransactionResponse, bO as CardTransactionResponseCardAmount, bP as CardTransactionResponseMerchantAmount, bQ as CardTransactionResponseMerchantDetails, bR as CardTransactionStatus, bS as CardTransactionType, s as CardTransactionsResponse, t as CardTransferEstimateRequest, bT as CardTransferEstimateResponse, u as CardTransferExecuteRequest, bU as CardTransferExecuteResponse, v as CardWithdrawalEstimateRequestBody, bV as CardWithdrawalEstimateResponse, w as CardWithdrawalExecuteRequestBody, bW as CardWithdrawalExecuteResponse, bX as CardsResponse, bY as CardsService, bZ as ClientAppConfig, b_ as ConfigAnalytics, b$ as ConfigApi, c0 as ConfigAuth, c1 as ConfigChain, c2 as ConfigService, c3 as ConfigSupport, x as ConfirmPhoneNumberRequest, y as ConfirmationActionType, c4 as ConfirmationService, z as CorridorEstimateRequest, D as CorridorTransferRequest, c5 as CreateRetailUserRequest, c6 as CreateRetailUserResponse, E as CreateUserRequest, c7 as CreateUserResponse, c8 as DeliveryAddress, F as EstimateTransferRequest, c9 as EstimateTransferResponse, ca as EstimatedAmount, cb as EstimatedAmountResponse, G as ExecuteTransferRequest, cc as ExecuteTransferResponse, H as GetActivityByIdRequest, I as GetActivityFeedRequest, J as GetBankAccountsRequest, K as GetCardTransactionsRequest, L as GetCardsRequest, M as GetFullStatementRequest, N as GetRatesRequest, O as GetRecipientsByCatalogRequest, P as GetRecipientsByCurrencyRequest, Q as GetRecipientsByNameRequest, R as GetRecipientsByTypeRequest, S as GetRecipientsRequest, cd as GetSharingTokenRequest, T as GetSharingTokenResponse, ce as GetVerificationLinkResponse, U as GetVerificationTokenResponse, V as GetWalletRequest, cf as LegalAddress, _ as OAuth2TokenRequest, $ as OAuth2TokenResponse, cg as PaginatedResponse, ch as Rate, a1 as RatesResponse, ci as RatesService, cj as RecipientAccount, a2 as RecipientCreateDetailsRequestBody, a3 as RecipientCreateRequest, a4 as RecipientCreateRequestV2, a5 as RecipientDetailsType, ck as RecipientInfo, a6 as RecipientPaymentDetailsAch, a7 as RecipientPaymentDetailsBiFast, a8 as RecipientPaymentDetailsCard, a9 as RecipientPaymentDetailsCrypto, aa as RecipientPaymentDetailsFasterPayment, ab as RecipientPaymentDetailsFpsHk, ac as RecipientPaymentDetailsImps, ad as RecipientPaymentDetailsInstapay, ae as RecipientPaymentDetailsIpp, af as RecipientPaymentDetailsLegalAddress, ag as RecipientPaymentDetailsNip, ah as RecipientPaymentDetailsPix, ai as RecipientPaymentDetailsPse, aj as RecipientPaymentDetailsResponse, ak as RecipientPaymentDetailsSepa, al as RecipientPaymentDetailsSpei, am as RecipientPaymentDetailsSwift, an as RecipientPersonalInfo, ao as RecipientResponse, ap as RecipientSortOrder, aq as RecipientUpdateDetailsRequestBody, ar as RecipientUpdateRequestBody, as as RecipientsResponse, cl as RecipientsService, aw as RequestedErcWithdrawalResponse, ax as RequestedErcWithdrawalsResponse, cm as SetSharingTokenRequest, cn as SetSharingTokenResponse, co as StatementBalance, cp as StatementBankAccountsResponse, cq as StatementPeriod, cr as StatementTransaction, cs as StatementUserData, aA as SwapEstimateRequest, aB as SwapEstimateRequestByDestinationAmount, aC as SwapEstimateRequestBySourceAmount, aD as SwapEstimateResponse, aE as SwapExecuteRequest, aF as SwapExecuteResponse, ct as SwapService, aG as TokenResponse, cu as TokenService, aH as UpdateFreshdeskIdRequest, aI as UpdatePhoneNumberRequest, cv as User, cw as UserAction, cx as UserActionType, aJ as UserDescriptor, cy as UserDocumentV2, cz as UserExternalProviderV2, cA as UserPersonalInfo, cB as UserPhoneNumberData, cC as UserProfileV2, cD as UserResidenceAddress, cE as UserResidenceAddressV2, cF as UserService, cG as UserStatus, cH as UserV2, cI as UserVerificationLevelV2, cJ as UserVerificationStatus, cK as UserVerificationV2, cL as ValidateRetailUserResponse, cM as VerificationLevel, W as WalletBalance, aP as WalletCreateGlobalRequest, aQ as WalletResponse, cN as WalletService, aR as WalletStatus, aS as WalletType } from '../../index-3P-X9tLg.js';
2
- export { W as WithdrawalApi } from '../../withdrawal.api-CmRHIoyc.js';
3
- import '../../types-_RME4STd.js';
1
+ export { b as ActionConfirmationCreateSmsRequest, c as ActionConfirmationCreateTokenRequest, d as ActionConfirmationSmsSessionResponse, e as ActionConfirmationVerifySmsRequest, f as ActionTokenResponse, g as ActivateBankAccountRequest, aT as ActivateBankAccountResponse, aU as ActivityAmount, aV as ActivityDirection, aW as ActivityFeedResponse, aX as ActivityFullStatementResponse, aY as ActivityItem, aZ as ActivityOperation, a_ as ActivityRate, a$ as ActivityRecipient, b0 as ActivityReward, b1 as ActivityRewardType, b2 as ActivityService, b3 as ActivitySortOrder, b4 as ActivityStatus, b5 as ActivityStep, b6 as ActivityStepType, b7 as ActivitySubject, b8 as ActivitySubjectBankAccount, b9 as ActivitySubjectCard, ba as ActivitySubjectMerchant, bb as ActivitySubjectType, bc as ActivitySubjectWallet, bd as ActivityType, be as ApiError, A as ApiModule, bf as ApiResponse, i as AuthorizeUserResponse, B as BaasModule, bg as BankAccount, bh as BankAccountDetails, bi as BankAccountStatus, bj as BankAccountType, bk as BankAccountsResponse, bl as BankCorridorEstimateResponse, bm as BankCorridorExecuteResponse, bn as BankService, bo as BankSortOrder, bp as Capability, bq as CapabilityStatus, br as CapabilityType, bs as CardAction, bt as CardActionType, C as CardActivateRequestBody, bu as CardBalance, bv as CardData, bw as CardDeliveryAddress, bx as CardDeliveryMethod, by as CardDetailsCvvResponse, j as CardDetailsGetCvvRequestBody, k as CardDetailsGetDetailsRequestBody, l as CardDetailsGetPinRequestBody, bz as CardDetailsPanExpiryResponse, bA as CardDetailsPinResponse, m as CardFeesCreateInvoiceRequestBody, bB as CardFeesInvoiceResponse, bC as CardFeesOrderResponse, bD as CardFormat, bE as CardGeneration, n as CardIssuePlasticRequest, bF as CardIssueResponse, o as CardIssueVirtualRequest, bG as CardLimit, p as CardLimitChangeRequestBody, q as CardNameChangeRequestBody, bH as CardPaymentSystem, bI as CardProvider, bJ as CardResponse, bK as CardSortOrder, bL as CardStatus, bM as CardTransactionConfirmationResponse, bN as CardTransactionDirection, r as CardTransactionResponse, bO as CardTransactionResponseCardAmount, bP as CardTransactionResponseMerchantAmount, bQ as CardTransactionResponseMerchantDetails, bR as CardTransactionStatus, bS as CardTransactionType, s as CardTransactionsResponse, t as CardTransferEstimateRequest, bT as CardTransferEstimateResponse, u as CardTransferExecuteRequest, bU as CardTransferExecuteResponse, v as CardWithdrawalEstimateRequestBody, bV as CardWithdrawalEstimateResponse, w as CardWithdrawalExecuteRequestBody, bW as CardWithdrawalExecuteResponse, bX as CardsResponse, bY as CardsService, bZ as ClientAppConfig, b_ as ConfigAnalytics, b$ as ConfigApi, c0 as ConfigAuth, c1 as ConfigChain, c2 as ConfigService, c3 as ConfigSupport, x as ConfirmPhoneNumberRequest, y as ConfirmationActionType, c4 as ConfirmationService, z as CorridorEstimateRequest, D as CorridorTransferRequest, c5 as CreateRetailUserRequest, c6 as CreateRetailUserResponse, E as CreateUserRequest, c7 as CreateUserResponse, c8 as DeliveryAddress, F as EstimateTransferRequest, c9 as EstimateTransferResponse, ca as EstimatedAmount, cb as EstimatedAmountResponse, G as ExecuteTransferRequest, cc as ExecuteTransferResponse, H as GetActivityByIdRequest, I as GetActivityFeedRequest, J as GetBankAccountsRequest, K as GetCardTransactionsRequest, L as GetCardsRequest, M as GetFullStatementRequest, N as GetRatesRequest, O as GetRecipientsByCatalogRequest, P as GetRecipientsByCurrencyRequest, Q as GetRecipientsByNameRequest, R as GetRecipientsByTypeRequest, S as GetRecipientsRequest, cd as GetSharingTokenRequest, T as GetSharingTokenResponse, ce as GetVerificationLinkResponse, U as GetVerificationTokenResponse, V as GetWalletRequest, cf as LegalAddress, _ as OAuth2TokenRequest, $ as OAuth2TokenResponse, cg as PaginatedResponse, ch as Rate, a1 as RatesResponse, ci as RatesService, cj as RecipientAccount, a2 as RecipientCreateDetailsRequestBody, a3 as RecipientCreateRequest, a4 as RecipientCreateRequestV2, a5 as RecipientDetailsType, ck as RecipientInfo, a6 as RecipientPaymentDetailsAch, a7 as RecipientPaymentDetailsBiFast, a8 as RecipientPaymentDetailsCard, a9 as RecipientPaymentDetailsCrypto, aa as RecipientPaymentDetailsFasterPayment, ab as RecipientPaymentDetailsFpsHk, ac as RecipientPaymentDetailsImps, ad as RecipientPaymentDetailsInstapay, ae as RecipientPaymentDetailsIpp, af as RecipientPaymentDetailsLegalAddress, ag as RecipientPaymentDetailsNip, ah as RecipientPaymentDetailsPix, ai as RecipientPaymentDetailsPse, aj as RecipientPaymentDetailsResponse, ak as RecipientPaymentDetailsSepa, al as RecipientPaymentDetailsSpei, am as RecipientPaymentDetailsSwift, an as RecipientPersonalInfo, ao as RecipientResponse, ap as RecipientSortOrder, aq as RecipientUpdateDetailsRequestBody, ar as RecipientUpdateRequestBody, as as RecipientsResponse, cl as RecipientsService, aw as RequestedErcWithdrawalResponse, ax as RequestedErcWithdrawalsResponse, cm as SetSharingTokenRequest, cn as SetSharingTokenResponse, co as StatementBalance, cp as StatementBankAccountsResponse, cq as StatementPeriod, cr as StatementTransaction, cs as StatementUserData, aA as SwapEstimateRequest, aB as SwapEstimateRequestByDestinationAmount, aC as SwapEstimateRequestBySourceAmount, aD as SwapEstimateResponse, aE as SwapExecuteRequest, aF as SwapExecuteResponse, ct as SwapService, aG as TokenResponse, cu as TokenService, aH as UpdateFreshdeskIdRequest, aI as UpdatePhoneNumberRequest, cv as User, cw as UserAction, cx as UserActionType, aJ as UserDescriptor, cy as UserDocumentV2, cz as UserExternalProviderV2, cA as UserPersonalInfo, cB as UserPhoneNumberData, cC as UserProfileV2, cD as UserResidenceAddress, cE as UserResidenceAddressV2, cF as UserService, cG as UserStatus, cH as UserV2, cI as UserVerificationLevelV2, cJ as UserVerificationStatus, cK as UserVerificationV2, cL as ValidateRetailUserResponse, cM as VerificationLevel, W as WalletBalance, aP as WalletCreateGlobalRequest, aQ as WalletResponse, cN as WalletService, aR as WalletStatus, aS as WalletType } from '../../index-Bi3ZpwPK.js';
2
+ export { W as WithdrawalApi } from '../../withdrawal.api-DhpWX0eX.js';
3
+ import '../../types-BVFY0JJu.js';
4
4
  import 'viem';
@@ -1,4 +1,4 @@
1
- export { ActivityService, ApiModule, BaasModule, BankService, CardsService, ConfigService, ConfirmationService, RatesService, RecipientsService, SwapService, TokenService, UserService, WalletService, WithdrawalApi } from '../../chunk-D2YHFKQI.js';
2
- import '../../chunk-YXNNTBO5.js';
1
+ export { ActivityService, ApiModule, BaasModule, BankService, CardsService, ConfigService, ConfirmationService, RatesService, RecipientsService, SwapService, TokenService, UserService, WalletService, WithdrawalApi } from '../../chunk-RIB34JK2.js';
2
+ import '../../chunk-XYHCKANZ.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,12 +1,12 @@
1
- import { I as IWalletService, e as ChainServiceConfig, S as SendUserOperationConfig, f as IAccountAbstractionService, b as CallData, g as IYieldService, h as IYieldData, i as IYieldGraphicData, j as IAccountContractService, k as IOnboardingService, l as ChainServicesFactory } from '../../crypto.module-BsI4pLhf.js';
2
- export { A as AccountStatus, B as BatchTransferItem, a as BatchTransferResult, C as CryptoModule, m as CryptoModuleState, P as PolicyStatus, T as TransferRequest, c as TransferResult, Y as YieldData, d as YieldGraphicDataPoint } from '../../crypto.module-BsI4pLhf.js';
1
+ import { I as IWalletService, e as ChainServiceConfig, S as SendUserOperationConfig, f as IAccountAbstractionService, b as CallData, g as IYieldService, h as IYieldData, i as IYieldGraphicData, j as IAccountContractService, k as IOnboardingService, l as ChainServicesFactory } from '../../crypto.module-b1_0pvdU.js';
2
+ export { A as AccountStatus, B as BatchTransferItem, a as BatchTransferResult, C as CryptoModule, m as CryptoModuleState, P as PolicyStatus, T as TransferRequest, c as TransferResult, Y as YieldData, d as YieldGraphicDataPoint } from '../../crypto.module-b1_0pvdU.js';
3
3
  export { Signer } from '@zerodev/sdk/types';
4
- import { M as MainWalletClient, b as ContractAddresses, L as Logger, T as TokenInfo, H as Hex$1 } from '../../types-_RME4STd.js';
4
+ import { M as MainWalletClient, C as ContractAddresses, L as Logger, T as TokenInfo, H as Hex$1 } from '../../types-BVFY0JJu.js';
5
5
  import * as viem from 'viem';
6
6
  import { WalletClient, PublicClient, Hex } from 'viem';
7
7
  import { KernelAccountClient } from '@zerodev/sdk';
8
- import { I as ICryptoService, W as WithdrawalApi, E as Erc20TransferParams, S as SyntheticTransferParams, F as FullTransferParams, a as FullTransferResult, b as SwapTransferParams, B as BatchTransferParams } from '../../withdrawal.api-CmRHIoyc.js';
9
- export { c as BatchTransferResponse } from '../../withdrawal.api-CmRHIoyc.js';
8
+ import { I as ICryptoService, W as WithdrawalApi, E as Erc20TransferParams, S as SyntheticTransferParams, F as FullTransferParams, a as FullTransferResult, b as SwapTransferParams, B as BatchTransferParams } from '../../withdrawal.api-DhpWX0eX.js';
9
+ export { c as BatchTransferResponse } from '../../withdrawal.api-DhpWX0eX.js';
10
10
  import { WaitForUserOperationReceiptReturnType } from 'viem/account-abstraction';
11
11
 
12
12
  declare class BaseWalletService implements IWalletService {
@@ -62,6 +62,7 @@ declare class BaseWalletService implements IWalletService {
62
62
  declare class BaseAccountAbstractionService implements IAccountAbstractionService {
63
63
  private readonly contracts;
64
64
  private readonly walletService;
65
+ private readonly chainId;
65
66
  private readonly logger?;
66
67
  private readonly publicRpcClient;
67
68
  private readonly kernelPublicClient;
@@ -70,6 +71,7 @@ declare class BaseAccountAbstractionService implements IAccountAbstractionServic
70
71
  kernelPublicClient: KernelAccountClient;
71
72
  contracts: ContractAddresses;
72
73
  walletService: IWalletService;
74
+ chainId: number;
73
75
  logger?: Logger;
74
76
  });
75
77
  isExecutorInstalled(): Promise<boolean>;
@@ -86,6 +88,7 @@ declare class BaseAccountAbstractionService implements IAccountAbstractionServic
86
88
 
87
89
  declare class BaseCryptoService implements ICryptoService {
88
90
  private readonly walletService;
91
+ private readonly chainId;
89
92
  private readonly tokens;
90
93
  private readonly contracts?;
91
94
  private readonly logger?;
@@ -93,6 +96,7 @@ declare class BaseCryptoService implements ICryptoService {
93
96
  constructor(config: {
94
97
  contracts: ContractAddresses;
95
98
  walletService: IWalletService;
99
+ chainId: number;
96
100
  tokens: TokenInfo[];
97
101
  logger?: Logger;
98
102
  withdrawalApi?: WithdrawalApi;
@@ -116,6 +120,7 @@ declare class BaseCryptoService implements ICryptoService {
116
120
  declare class BaseYieldService implements IYieldService {
117
121
  private readonly publicClient;
118
122
  private readonly walletService;
123
+ private readonly chainId;
119
124
  private syntheticToken?;
120
125
  private readonly contracts;
121
126
  private readonly tokens;
@@ -124,6 +129,7 @@ declare class BaseYieldService implements IYieldService {
124
129
  constructor(config: {
125
130
  publicClient: PublicClient;
126
131
  walletService: IWalletService;
132
+ chainId: number;
127
133
  contracts: ContractAddresses;
128
134
  tokens: TokenInfo[];
129
135
  });
@@ -149,6 +155,7 @@ declare class BaseYieldService implements IYieldService {
149
155
 
150
156
  declare class BaseAccountContractService implements IAccountContractService {
151
157
  private readonly walletService;
158
+ private readonly chainId;
152
159
  private readonly logger?;
153
160
  private readonly companyId;
154
161
  private readonly publicRpcClient;
@@ -156,6 +163,7 @@ declare class BaseAccountContractService implements IAccountContractService {
156
163
  constructor(config: {
157
164
  publicRpcClient: PublicClient;
158
165
  walletService: IWalletService;
166
+ chainId: number;
159
167
  companyId: string;
160
168
  logger?: Logger;
161
169
  contracts: ContractAddresses;
@@ -171,11 +179,13 @@ declare class BaseAccountContractService implements IAccountContractService {
171
179
 
172
180
  declare class BaseOnboardingService implements IOnboardingService {
173
181
  private readonly walletService;
182
+ private readonly chainId;
174
183
  private readonly accountAbstractionService;
175
184
  private readonly accountContractService;
176
185
  private readonly logger?;
177
186
  constructor(config: {
178
187
  walletService: IWalletService;
188
+ chainId: number;
179
189
  accountAbstractionService: IAccountAbstractionService;
180
190
  accountContractService: IAccountContractService;
181
191
  logger?: Logger;
@@ -1,5 +1,5 @@
1
- export { BaseAccountAbstractionService, BaseAccountContractService, BaseCryptoService, BaseOnboardingService, BaseWalletService, BaseYieldService, ContractRegistryService, CryptoModule, chainRegistry } from '../../chunk-NYDDEDPQ.js';
2
- import '../../chunk-D2YHFKQI.js';
3
- import '../../chunk-YXNNTBO5.js';
1
+ export { BaseAccountAbstractionService, BaseAccountContractService, BaseCryptoService, BaseOnboardingService, BaseWalletService, BaseYieldService, ContractRegistryService, CryptoModule, chainRegistry } from '../../chunk-GOPZA7GB.js';
2
+ import '../../chunk-RIB34JK2.js';
3
+ import '../../chunk-XYHCKANZ.js';
4
4
  //# sourceMappingURL=index.js.map
5
5
  //# sourceMappingURL=index.js.map
@@ -106,6 +106,12 @@ interface SDKConfig {
106
106
  * company (e.g. "Wirex One" → Arc Testnet) instead of the default company's config.
107
107
  */
108
108
  companyName?: string;
109
+ /**
110
+ * Optional chain ID to run the SDK on. When set, the chain is looked up in the remote
111
+ * config's `chains` map; when omitted, the remote config's `defaultChain` is used.
112
+ * Supported: Base (8453), Base Sepolia (84532), Arc (5042), Arc Testnet (5042002).
113
+ */
114
+ chainId?: number;
109
115
  /** Function to get the main wallet client (e.g., from Privy) */
110
116
  getMainWalletClient: () => MainWalletClient | Promise<MainWalletClient>;
111
117
  /**
@@ -176,4 +182,4 @@ interface ModuleContext {
176
182
  httpClient: HttpClient;
177
183
  }
178
184
 
179
- export { type ChainConfig as C, type Hex as H, type Logger as L, type MainWalletClient as M, type RemoteConfig as R, type SDKEnvironment as S, type TokenInfo as T, type Chain as a, type ContractAddresses as b, HttpClient as c, type HttpClientConfig as d, type ModuleContext as e, type RequestOptions as f, type ResolvedSDKConfig as g, type SDKConfig as h, type SDKModule as i, type TransactionHash as j, defaultLogger as k, silentLogger as s };
185
+ export { type ContractAddresses as C, type Hex as H, type Logger as L, type MainWalletClient as M, type ResolvedSDKConfig as R, type SDKModule as S, type TokenInfo as T, type SDKConfig as a, type ModuleContext as b, type SDKEnvironment as c, type TransactionHash as d, defaultLogger as e, type RemoteConfig as f, type ChainConfig as g, type Chain as h, HttpClient as i, type HttpClientConfig as j, type RequestOptions as k, silentLogger as s };
@@ -1,4 +1,4 @@
1
- import { c as HttpClient } from './types-_RME4STd.js';
1
+ import { i as HttpClient } from './types-BVFY0JJu.js';
2
2
  import { Hex } from 'viem';
3
3
 
4
4
  interface Erc20TransferParams {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirexapp/wpay-baas-sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -71,10 +71,10 @@
71
71
  "prepublishOnly": "yarn build"
72
72
  },
73
73
  "peerDependencies": {
74
- "viem": "^2.0.0"
74
+ "viem": "^2.49.3"
75
75
  },
76
76
  "dependencies": {
77
- "@rhino.fi/sdk": "^1.13.1",
77
+ "@rhino.fi/sdk": "^1.14.0",
78
78
  "@zerodev/ecdsa-validator": "^5.4.9",
79
79
  "@zerodev/permissions": "^5.5.1",
80
80
  "@zerodev/sdk": "^5.5.4",