@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.
- package/README.md +13 -2
- package/dist/{chunk-D2YHFKQI.js → chunk-RIB34JK2.js} +3 -3
- package/dist/{chunk-D2YHFKQI.js.map → chunk-RIB34JK2.js.map} +1 -1
- package/dist/{chunk-YXNNTBO5.js → chunk-XYHCKANZ.js} +23 -3
- package/dist/chunk-XYHCKANZ.js.map +1 -0
- package/dist/{chunk-NYDDEDPQ.js → chunk-YGNDXSTF.js} +218 -93
- package/dist/chunk-YGNDXSTF.js.map +1 -0
- package/dist/core/index.d.ts +7 -3
- package/dist/core/index.js +1 -1
- package/dist/{crypto.module-BsI4pLhf.d.ts → crypto.module-DMKRqQiN.d.ts} +8 -3
- package/dist/{index-3P-X9tLg.d.ts → index-Bi3ZpwPK.d.ts} +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +22 -9
- package/dist/index.js.map +1 -1
- package/dist/modules/api/index.d.ts +3 -3
- package/dist/modules/api/index.js +2 -2
- package/dist/modules/crypto/index.d.ts +15 -5
- package/dist/modules/crypto/index.js +3 -3
- package/dist/{types-_RME4STd.d.ts → types-BVFY0JJu.d.ts} +7 -1
- package/dist/{withdrawal.api-CmRHIoyc.d.ts → withdrawal.api-DhpWX0eX.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-NYDDEDPQ.js.map +0 -1
- package/dist/chunk-YXNNTBO5.js.map +0 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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
|
-
|
|
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 };
|
package/dist/core/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AuthenticationError, ConfigService, ConfigurationError, ContractError, HttpClient, NetworkError, SDKError, TransactionError, ValidationError, WalletError, defaultLogger, silentLogger } from '../chunk-
|
|
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,
|
|
4
|
-
import { W as WithdrawalApi, I as ICryptoService } from './withdrawal.api-
|
|
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:
|
|
137
|
+
depositAddress: string;
|
|
138
138
|
destinationChain: string;
|
|
139
139
|
destinationAddress: `0x${string}`;
|
|
140
140
|
isActive: boolean;
|
|
@@ -144,16 +144,21 @@ declare class SmartDepositAddressesService {
|
|
|
144
144
|
private rhinoSdkInstance;
|
|
145
145
|
private walletService;
|
|
146
146
|
private readonly rhinoApiKey;
|
|
147
|
+
private readonly destinationChain;
|
|
147
148
|
private addresses;
|
|
148
149
|
constructor(config: {
|
|
149
150
|
walletService: IWalletService;
|
|
150
151
|
rhinoApiKey: string;
|
|
152
|
+
chainId: number;
|
|
151
153
|
});
|
|
154
|
+
getDestinationChain(): string;
|
|
152
155
|
initializeSmartDepositAddresses(forceRefresh?: boolean): Promise<IDepositAddressData[]>;
|
|
153
156
|
getAddresses(): IDepositAddressData[];
|
|
154
157
|
clearAddresses(): void;
|
|
155
158
|
private setAddresses;
|
|
156
159
|
private createSmartDepositAddressForChains;
|
|
160
|
+
private activateDepositAddresses;
|
|
161
|
+
private activateDepositAddress;
|
|
157
162
|
private createSmartDepositAddresses;
|
|
158
163
|
private createMissingAddressesForChainGroup;
|
|
159
164
|
private hasAddressesForChainGroup;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { W as WithdrawalApi } from './withdrawal.api-
|
|
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-
|
|
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-
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import { A as ApiModule, a as AuthService } from './index-
|
|
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-
|
|
1
|
+
import { C as CryptoModule } from './crypto.module-DMKRqQiN.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-DMKRqQiN.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-
|
|
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-
|
|
2
|
-
export { CryptoModule } from './chunk-
|
|
3
|
-
import { AuthService, ApiModule } from './chunk-
|
|
4
|
-
export { ApiModule, AuthService, BaasModule } from './chunk-
|
|
5
|
-
import { HttpClient, ConfigurationError, defaultLogger, silentLogger, ConfigService } from './chunk-
|
|
6
|
-
export { AuthenticationError, ConfigurationError, ContractError, NetworkError, SDKError, TransactionError, ValidationError, WalletError, defaultLogger } from './chunk-
|
|
7
|
-
import { arcTestnet, baseSepolia, base } from 'viem/chains';
|
|
1
|
+
import { CryptoModule } from './chunk-YGNDXSTF.js';
|
|
2
|
+
export { CryptoModule } from './chunk-YGNDXSTF.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.
|
|
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: ${
|
|
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":";;;;;;;;
|
|
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;AACX,CAAA;AAEA,IAAM,sBAAsB,MAAA,CAAO,IAAA,CA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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-
|
|
2
|
-
export { W as WithdrawalApi } from '../../withdrawal.api-
|
|
3
|
-
import '../../types-
|
|
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-
|
|
2
|
-
import '../../chunk-
|
|
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-
|
|
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-
|
|
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-DMKRqQiN.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-DMKRqQiN.js';
|
|
3
3
|
export { Signer } from '@zerodev/sdk/types';
|
|
4
|
-
import { M as MainWalletClient,
|
|
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-
|
|
9
|
-
export { c as BatchTransferResponse } from '../../withdrawal.api-
|
|
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-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
export { BaseAccountAbstractionService, BaseAccountContractService, BaseCryptoService, BaseOnboardingService, BaseWalletService, BaseYieldService, ContractRegistryService, CryptoModule, chainRegistry } from '../../chunk-YGNDXSTF.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
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirexapp/wpay-baas-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
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.
|
|
74
|
+
"viem": "^2.49.3"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@rhino.fi/sdk": "^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",
|