@cityofzion/bs-multichain 3.1.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,16 @@
1
1
  import { type TBSAccount, type IBlockchainService, type TUntilIndexRecord } from '@cityofzion/blockchain-service';
2
- export declare class BSAggregator<N extends string> {
3
- readonly blockchainServicesByName: Record<N, IBlockchainService<N>>;
4
- readonly blockchainServices: IBlockchainService<N>[];
5
- constructor(blockchainServices: IBlockchainService<N>[]);
2
+ import type { TBSService, TBSServiceByName, TBSServiceName } from './types';
3
+ export declare class BSAggregator<S extends TBSService[] = TBSService[], T = [TBSService] extends [S[number]] ? Partial<TBSServiceByName<S>> : TBSServiceByName<S>> {
4
+ readonly blockchainServicesByName: T;
5
+ readonly blockchainServices: S;
6
+ readonly blockchainServicesByNameRecord: Record<TBSServiceName, IBlockchainService<TBSServiceName, string>>;
7
+ constructor(blockchainServices: S);
6
8
  validateAddressAllBlockchains(address: string): boolean;
7
9
  validateTextAllBlockchains(text: string): boolean;
8
10
  validateKeyAllBlockchains(wif: string): boolean;
9
11
  validateEncryptedAllBlockchains(keyOrJson: string): boolean;
10
- getBlockchainNameByAddress(address: string): N[];
11
- getBlockchainNameByKey(wif: string): N[];
12
- getBlockchainNameByEncrypted(keyOrJson: string): N[];
13
- generateAccountsFromMnemonic(mnemonic: string, untilIndexByBlockchainService?: TUntilIndexRecord<N>): Promise<Map<N, TBSAccount<N>[]>>;
12
+ getBlockchainNameByAddress(address: string): TBSServiceName[];
13
+ getBlockchainNameByKey(wif: string): TBSServiceName[];
14
+ getBlockchainNameByEncrypted(keyOrJson: string): TBSServiceName[];
15
+ generateAccountsFromMnemonic(mnemonic: string, untilIndexByBlockchainService?: TUntilIndexRecord<TBSServiceName>): Promise<Map<TBSServiceName, TBSAccount<TBSServiceName>[]>>;
14
16
  }
@@ -9,6 +9,7 @@ class BSAggregator {
9
9
  acc[service.name] = service;
10
10
  return acc;
11
11
  }, {});
12
+ this.blockchainServicesByNameRecord = this.blockchainServicesByName;
12
13
  }
13
14
  validateAddressAllBlockchains(address) {
14
15
  return this.blockchainServices.some(bs => bs.validateAddress(address));
@@ -1,21 +1,21 @@
1
- import { type TBSAccount, type TBalanceResponse, type IBridgeOrchestrator, type TBridgeOrchestratorEvents, type TBridgeToken } from '@cityofzion/blockchain-service';
1
+ import { type TBSAccount, type TBalanceResponse, type IBridgeOrchestrator, type TBridgeOrchestratorEvents, type TBridgeToken, type TBSBridgeName } from '@cityofzion/blockchain-service';
2
2
  import { BSNeo3 } from '@cityofzion/bs-neo3';
3
3
  import { BSNeoX } from '@cityofzion/bs-neox';
4
4
  import TypedEmitter from 'typed-emitter';
5
5
  import type { TNeo3NeoXBridgeOrchestratorInitParams, TNeo3NeoXBridgeOrchestratorWaitParams } from './types';
6
- export declare class Neo3NeoXBridgeOrchestrator<N extends string> implements IBridgeOrchestrator<N> {
6
+ export declare class Neo3NeoXBridgeOrchestrator implements IBridgeOrchestrator<TBSBridgeName> {
7
7
  #private;
8
- eventEmitter: TypedEmitter<TBridgeOrchestratorEvents<N>>;
9
- fromService: BSNeo3<N> | BSNeoX<N>;
10
- toService: BSNeo3<N> | BSNeoX<N>;
11
- constructor(params: TNeo3NeoXBridgeOrchestratorInitParams<N>);
8
+ eventEmitter: TypedEmitter<TBridgeOrchestratorEvents<TBSBridgeName>>;
9
+ fromService: BSNeo3 | BSNeoX;
10
+ toService: BSNeo3 | BSNeoX;
11
+ constructor(params: TNeo3NeoXBridgeOrchestratorInitParams);
12
12
  init(): Promise<void>;
13
13
  switchTokens(): Promise<void>;
14
- setTokenToUse(token: TBridgeToken<N> | null): Promise<void>;
15
- setAccountToUse(account: TBSAccount<N> | null): Promise<void>;
14
+ setTokenToUse(token: TBridgeToken<TBSBridgeName> | null): Promise<void>;
15
+ setAccountToUse(account: TBSAccount<TBSBridgeName> | null): Promise<void>;
16
16
  setAddressToReceive(address: string | null): Promise<void>;
17
17
  setBalances(balances: TBalanceResponse[] | null): Promise<void>;
18
18
  setAmountToUse(amount: string | null): Promise<void>;
19
19
  bridge(): Promise<string>;
20
- static wait<N extends string = string>({ tokenToUse, tokenToReceive, transactionHash, neo3Service, neoXService, }: TNeo3NeoXBridgeOrchestratorWaitParams<N>): Promise<void>;
20
+ static wait({ tokenToUse, tokenToReceive, transactionHash, neo3Service, neoXService, }: TNeo3NeoXBridgeOrchestratorWaitParams): Promise<void>;
21
21
  }
@@ -25,7 +25,11 @@ class Neo3NeoXBridgeOrchestrator {
25
25
  _Neo3NeoXBridgeOrchestrator_feeTokenBalance.set(this, null);
26
26
  _Neo3NeoXBridgeOrchestrator_addressToReceiveTimeout.set(this, undefined);
27
27
  _Neo3NeoXBridgeOrchestrator_amountToUseTimeout.set(this, undefined);
28
- _Neo3NeoXBridgeOrchestrator_internalAvailableTokensToUse.set(this, { value: null, loading: false, error: null });
28
+ _Neo3NeoXBridgeOrchestrator_internalAvailableTokensToUse.set(this, {
29
+ value: null,
30
+ loading: false,
31
+ error: null,
32
+ });
29
33
  _Neo3NeoXBridgeOrchestrator_internalTokenToUse.set(this, { value: null, loading: false, error: null });
30
34
  _Neo3NeoXBridgeOrchestrator_internalAccountToUse.set(this, { value: null, loading: false, error: null });
31
35
  _Neo3NeoXBridgeOrchestrator_internalAmountToUse.set(this, { value: null, valid: null, loading: false, error: null });
@@ -145,7 +149,8 @@ class Neo3NeoXBridgeOrchestrator {
145
149
  __classPrivateFieldSet(this, _Neo3NeoXBridgeOrchestrator_instances, { loading: true, error: null }, "a", _Neo3NeoXBridgeOrchestrator_amountToUseMin_set);
146
150
  __classPrivateFieldSet(this, _Neo3NeoXBridgeOrchestrator_instances, { loading: true, error: null }, "a", _Neo3NeoXBridgeOrchestrator_bridgeFee_set);
147
151
  try {
148
- const constants = await this.fromService.neo3NeoXBridgeService.getBridgeConstants(__classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_tokenToUse_get).value);
152
+ const neo3NeoXBridgeService = this.fromService.neo3NeoXBridgeService;
153
+ const constants = await neo3NeoXBridgeService.getBridgeConstants(__classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_tokenToUse_get).value);
149
154
  __classPrivateFieldSet(this, _Neo3NeoXBridgeOrchestrator_instances, { value: constants.bridgeMinAmount }, "a", _Neo3NeoXBridgeOrchestrator_amountToUseMin_set);
150
155
  __classPrivateFieldSet(this, _Neo3NeoXBridgeOrchestrator_instances, { value: constants.bridgeFee }, "a", _Neo3NeoXBridgeOrchestrator_bridgeFee_set);
151
156
  const bridgeMaxAmountBn = blockchain_service_1.BSBigNumberHelper.fromNumber(constants.bridgeMaxAmount);
@@ -203,7 +208,8 @@ class Neo3NeoXBridgeOrchestrator {
203
208
  if (amountToUseBn.isGreaterThan(__classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_amountToUseMax_get).value)) {
204
209
  throw new blockchain_service_1.BSError('Amount is above the maximum', 'AMOUNT_ABOVE_MAXIMUM');
205
210
  }
206
- const approvalFee = await this.fromService.neo3NeoXBridgeService
211
+ const neo3NeoXBridgeService = this.fromService.neo3NeoXBridgeService;
212
+ const approvalFee = await neo3NeoXBridgeService
207
213
  .getApprovalFee({
208
214
  account: __classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_accountToUse_get).value,
209
215
  token: __classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_tokenToUse_get).value,
@@ -242,7 +248,8 @@ class Neo3NeoXBridgeOrchestrator {
242
248
  !__classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_bridgeFee_get).value) {
243
249
  throw new blockchain_service_1.BSError('Required parameters are not set for bridging', 'BRIDGE_NOT_READY');
244
250
  }
245
- return await this.fromService.neo3NeoXBridgeService.bridge({
251
+ const neo3NeoXBridgeService = this.fromService.neo3NeoXBridgeService;
252
+ return await neo3NeoXBridgeService.bridge({
246
253
  account: __classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_accountToUse_get).value,
247
254
  token: __classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_tokenToUse_get).value,
248
255
  amount: __classPrivateFieldGet(this, _Neo3NeoXBridgeOrchestrator_instances, "a", _Neo3NeoXBridgeOrchestrator_amountToUse_get).value,
@@ -254,14 +261,16 @@ class Neo3NeoXBridgeOrchestrator {
254
261
  const isNeo3Service = tokenToUse.blockchain === neo3Service.name;
255
262
  const fromService = isNeo3Service ? neo3Service : neoXService;
256
263
  const toService = isNeo3Service ? neoXService : neo3Service;
257
- const nonce = await blockchain_service_1.BSUtilsHelper.retry(() => fromService.neo3NeoXBridgeService.getNonce({
264
+ const fromNeo3NeoXBridgeService = fromService.neo3NeoXBridgeService;
265
+ const toNeo3NeoXBridgeService = toService.neo3NeoXBridgeService;
266
+ const nonce = await blockchain_service_1.BSUtilsHelper.retry(() => fromNeo3NeoXBridgeService.getNonce({
258
267
  token: tokenToUse,
259
268
  transactionHash,
260
269
  }), {
261
270
  retries: 10,
262
271
  delay: 30000,
263
272
  });
264
- await blockchain_service_1.BSUtilsHelper.retry(() => toService.neo3NeoXBridgeService.getTransactionHashByNonce({ nonce, token: tokenToReceive }), {
273
+ await blockchain_service_1.BSUtilsHelper.retry(() => toNeo3NeoXBridgeService.getTransactionHashByNonce({ nonce, token: tokenToReceive }), {
265
274
  retries: 10,
266
275
  delay: 30000,
267
276
  });
@@ -1,15 +1,15 @@
1
- import type { TBridgeToken } from '@cityofzion/blockchain-service';
1
+ import type { TBridgeToken, TBSBridgeName } from '@cityofzion/blockchain-service';
2
2
  import { BSNeo3 } from '@cityofzion/bs-neo3';
3
3
  import { BSNeoX } from '@cityofzion/bs-neox';
4
- export type TNeo3NeoXBridgeOrchestratorInitParams<N extends string> = {
5
- neo3Service: BSNeo3<N>;
6
- neoXService: BSNeoX<N>;
7
- initialFromServiceName?: N;
4
+ export type TNeo3NeoXBridgeOrchestratorInitParams = {
5
+ neo3Service: BSNeo3;
6
+ neoXService: BSNeoX;
7
+ initialFromServiceName?: TBSBridgeName;
8
8
  };
9
- export type TNeo3NeoXBridgeOrchestratorWaitParams<N extends string = string> = {
10
- neo3Service: BSNeo3<N>;
11
- neoXService: BSNeoX<N>;
9
+ export type TNeo3NeoXBridgeOrchestratorWaitParams = {
10
+ neo3Service: BSNeo3;
11
+ neoXService: BSNeoX;
12
12
  transactionHash: string;
13
- tokenToUse: TBridgeToken<N>;
14
- tokenToReceive: TBridgeToken<N>;
13
+ tokenToUse: TBridgeToken<TBSBridgeName>;
14
+ tokenToReceive: TBridgeToken<TBSBridgeName>;
15
15
  };
@@ -1,8 +1,8 @@
1
1
  import type { TSimpleSwapApiCreateExchangeParams, TSimpleSwapApiCurrency, TSimpleSwapOrchestratorInitParams } from './types';
2
- export declare class SimpleSwapApi<N extends string> {
2
+ export declare class SimpleSwapApi {
3
3
  #private;
4
- getCurrencies(options: TSimpleSwapOrchestratorInitParams<N>): Promise<TSimpleSwapApiCurrency<N>[]>;
5
- getPairs(ticker: string, network: string): Promise<TSimpleSwapApiCurrency<N>[]>;
4
+ getCurrencies(options: TSimpleSwapOrchestratorInitParams): Promise<TSimpleSwapApiCurrency[]>;
5
+ getPairs(ticker: string, network: string): Promise<TSimpleSwapApiCurrency[]>;
6
6
  getRange(currencyFrom: TSimpleSwapApiCurrency, currencyTo: TSimpleSwapApiCurrency): Promise<{
7
7
  min: string;
8
8
  max: string | null;
@@ -1,17 +1,18 @@
1
1
  import { type TBSAccount, type ISwapOrchestrator, type TSwapOrchestratorEvents, type TSwapResponse, type TSwapToken } from '@cityofzion/blockchain-service';
2
2
  import TypedEmitter from 'typed-emitter';
3
3
  import type { TSimpleSwapOrchestratorInitParams } from './types';
4
- export declare class SimpleSwapOrchestrator<N extends string = string> implements ISwapOrchestrator<N> {
4
+ import type { TBSServiceName } from '../../types';
5
+ export declare class SimpleSwapOrchestrator implements ISwapOrchestrator<TBSServiceName> {
5
6
  #private;
6
- eventEmitter: TypedEmitter<TSwapOrchestratorEvents<N>>;
7
- constructor(params: TSimpleSwapOrchestratorInitParams<N>);
7
+ eventEmitter: TypedEmitter<TSwapOrchestratorEvents<TBSServiceName>>;
8
+ constructor(params: TSimpleSwapOrchestratorInitParams);
8
9
  init(): Promise<void>;
9
- setTokenToUse(token: TSwapToken<N> | null): Promise<void>;
10
- setAccountToUse(account: TBSAccount<N> | null): Promise<void>;
10
+ setTokenToUse(token: TSwapToken<TBSServiceName> | null): Promise<void>;
11
+ setAccountToUse(account: TBSAccount<TBSServiceName> | null): Promise<void>;
11
12
  setAmountToUse(amount: string | null): Promise<void>;
12
- setTokenToReceive(token: TSwapToken<N> | null): Promise<void>;
13
+ setTokenToReceive(token: TSwapToken<TBSServiceName> | null): Promise<void>;
13
14
  setAddressToReceive(address: string | null): Promise<void>;
14
15
  setExtraIdToReceive(extraIdToReceive: string | null): Promise<void>;
15
- swap(): Promise<TSwapResponse<N>>;
16
+ swap(): Promise<TSwapResponse>;
16
17
  calculateFee(): Promise<string>;
17
18
  }
@@ -1,5 +1,5 @@
1
1
  import type { ISwapService, TSwapServiceStatusResponse } from '@cityofzion/blockchain-service';
2
- export declare class SimpleSwapService<N extends string = string> implements ISwapService {
2
+ export declare class SimpleSwapService implements ISwapService {
3
3
  #private;
4
4
  constructor();
5
5
  getStatus(id: string): Promise<TSwapServiceStatusResponse>;
@@ -1,9 +1,10 @@
1
- import type { IBlockchainService, TSwapToken } from '@cityofzion/blockchain-service';
2
- export type TSimpleSwapOrchestratorInitParams<N extends string = string> = {
3
- blockchainServicesByName: Record<N, IBlockchainService<N>>;
4
- chainsByServiceName: Partial<Record<N, string[]>>;
1
+ import type { IBlockchainService, TBSNetworkId, TSwapToken } from '@cityofzion/blockchain-service';
2
+ import type { TBSServiceName } from '../../types';
3
+ export type TSimpleSwapOrchestratorInitParams = {
4
+ blockchainServicesByName: Record<TBSServiceName, IBlockchainService<TBSServiceName, TBSNetworkId>>;
5
+ chainsByServiceName: Partial<Record<TBSServiceName, string[]>>;
5
6
  };
6
- export type TSimpleSwapApiCurrency<N extends string = string> = TSwapToken<N> & {
7
+ export type TSimpleSwapApiCurrency = TSwapToken<TBSServiceName> & {
7
8
  network: string;
8
9
  ticker: string;
9
10
  hasExtraId: boolean;
@@ -1,19 +1,19 @@
1
- import { type IBlockchainService, type IBSWithWalletConnect } from '@cityofzion/blockchain-service';
1
+ import { type IBlockchainService, type IBSWithWalletConnect, type TBSNetworkId } from '@cityofzion/blockchain-service';
2
2
  import { ErrorResponse } from '@walletconnect/jsonrpc-utils';
3
3
  import type { PendingRequestTypes, SessionTypes } from '@walletconnect/types';
4
4
  import { SdkErrorKey } from '@walletconnect/utils';
5
5
  import type { TWalletKitHelperFilterSessionsParams, TWalletKitHelperGetProposalDetailsParams, TWalletKitHelperGetSessionDetailsParams, TWalletKitHelperProcessRequestParams, TWalletKitHelperProposalDetails, TWalletKitHelperSessionDetails, TWalletKitHelperGetProposalServicesParams } from './types';
6
6
  export declare class WalletKitHelper {
7
- static getProposalDetails<N extends string>({ address, proposal, service, }: TWalletKitHelperGetProposalDetailsParams<N>): TWalletKitHelperProposalDetails<N>;
8
- static getProposalServices<N extends string>({ proposal, services }: TWalletKitHelperGetProposalServicesParams<N>): (IBlockchainService<N, string> & IBSWithWalletConnect<N>)[];
9
- static getSessionDetails<N extends string>({ session, services, }: TWalletKitHelperGetSessionDetailsParams<N>): TWalletKitHelperSessionDetails<N>;
7
+ static getProposalDetails({ address, proposal, service, }: TWalletKitHelperGetProposalDetailsParams): TWalletKitHelperProposalDetails;
8
+ static getProposalServices({ proposal, services }: TWalletKitHelperGetProposalServicesParams): (IBlockchainService<"ethereum" | "polygon" | "base" | "arbitrum" | "neo3" | "neoLegacy" | "neox" | "solana" | "stellar" | "bitcoin", TBSNetworkId> & IBSWithWalletConnect<"ethereum" | "polygon" | "base" | "arbitrum" | "neo3" | "neoLegacy" | "neox" | "solana" | "stellar" | "bitcoin">)[];
9
+ static getSessionDetails({ session, services, }: TWalletKitHelperGetSessionDetailsParams): TWalletKitHelperSessionDetails;
10
10
  static getError(key: SdkErrorKey): {
11
11
  message: string;
12
12
  code: number;
13
13
  };
14
14
  static formatRequestResult(request: PendingRequestTypes.Struct, response: any): import("@walletconnect/jsonrpc-utils").JsonRpcResult<any>;
15
15
  static formatRequestError(request: PendingRequestTypes.Struct, reason: ErrorResponse): import("@walletconnect/jsonrpc-utils").JsonRpcError;
16
- static processRequest<N extends string>({ sessionDetails, account, request, }: TWalletKitHelperProcessRequestParams<N>): Promise<any>;
16
+ static processRequest({ sessionDetails, account, request }: TWalletKitHelperProcessRequestParams): Promise<any>;
17
17
  static filterSessions(sessions: SessionTypes.Struct[], filters: TWalletKitHelperFilterSessionsParams): SessionTypes.Struct[];
18
18
  static isValidURI(uri: string): boolean;
19
19
  }
@@ -54,7 +54,7 @@ class WalletKitHelper {
54
54
  static formatRequestError(request, reason) {
55
55
  return (0, jsonrpc_utils_1.formatJsonRpcError)(request.id, reason ?? (0, utils_1.getSdkError)('USER_REJECTED'));
56
56
  }
57
- static async processRequest({ sessionDetails, account, request, }) {
57
+ static async processRequest({ sessionDetails, account, request }) {
58
58
  if (account.address !== sessionDetails.address) {
59
59
  throw new blockchain_service_1.BSError('Account address does not match session address', 'INVALID_ACCOUNT');
60
60
  }
@@ -1,34 +1,35 @@
1
- import type { IBlockchainService, IBSWithWalletConnect, TBSAccount } from '@cityofzion/blockchain-service';
1
+ import type { IBlockchainService, IBSWithWalletConnect, TBSAccount, TBSNetworkId } from '@cityofzion/blockchain-service';
2
2
  import type { PendingRequestTypes, ProposalTypes, SessionTypes } from '@walletconnect/types';
3
- export type TWalletKitHelperGetProposalDetailsParams<N extends string = string> = {
3
+ import type { TBSServiceName } from '../../types';
4
+ export type TWalletKitHelperGetProposalDetailsParams = {
4
5
  proposal: ProposalTypes.Struct;
5
6
  address: string;
6
- service: IBlockchainService<N>;
7
+ service: IBlockchainService<TBSServiceName, TBSNetworkId>;
7
8
  };
8
- export type TWalletKitHelperGetProposalServicesParams<N extends string = string> = {
9
+ export type TWalletKitHelperGetProposalServicesParams = {
9
10
  proposal: ProposalTypes.Struct;
10
- services: IBlockchainService<N>[];
11
+ services: IBlockchainService<TBSServiceName, TBSNetworkId>[];
11
12
  };
12
- export type TWalletKitHelperProposalDetails<N extends string = string> = {
13
+ export type TWalletKitHelperProposalDetails = {
13
14
  methods: string[];
14
15
  approvedNamespaces: SessionTypes.Namespaces;
15
- service: IBlockchainService<N> & IBSWithWalletConnect<N>;
16
- blockchain: N;
16
+ service: IBlockchainService<TBSServiceName, TBSNetworkId> & IBSWithWalletConnect<TBSServiceName>;
17
+ blockchain: TBSServiceName;
17
18
  };
18
- export type TWalletKitHelperGetSessionDetailsParams<N extends string = string> = {
19
+ export type TWalletKitHelperGetSessionDetailsParams = {
19
20
  session: SessionTypes.Struct;
20
- services: IBlockchainService<N>[];
21
+ services: IBlockchainService<TBSServiceName, TBSNetworkId>[];
21
22
  };
22
- export type TWalletKitHelperSessionDetails<N extends string = string> = {
23
+ export type TWalletKitHelperSessionDetails = {
23
24
  address: string;
24
25
  methods: string[];
25
- service: IBlockchainService<N> & IBSWithWalletConnect<N>;
26
- blockchain: N;
26
+ service: IBlockchainService<TBSServiceName, TBSNetworkId> & IBSWithWalletConnect<TBSServiceName>;
27
+ blockchain: TBSServiceName;
27
28
  };
28
- export type TWalletKitHelperProcessRequestParams<N extends string = string> = {
29
+ export type TWalletKitHelperProcessRequestParams = {
29
30
  request: PendingRequestTypes.Struct;
30
- sessionDetails: TWalletKitHelperSessionDetails<N>;
31
- account: TBSAccount<N>;
31
+ sessionDetails: TWalletKitHelperSessionDetails;
32
+ account: TBSAccount<TBSServiceName>;
32
33
  };
33
34
  export type TWalletKitHelperFilterSessionsParams = {
34
35
  addresses?: string[];
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './features/swap';
2
2
  export * from './features/bridge';
3
3
  export * from './features/wallet-connect';
4
4
  export * from './BSAggregator';
5
+ export * from './types';
package/dist/index.js CHANGED
@@ -18,3 +18,4 @@ __exportStar(require("./features/swap"), exports);
18
18
  __exportStar(require("./features/bridge"), exports);
19
19
  __exportStar(require("./features/wallet-connect"), exports);
20
20
  __exportStar(require("./BSAggregator"), exports);
21
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,14 @@
1
+ import type { IBSNeo3 } from '@cityofzion/bs-neo3';
2
+ import type { IBSNeoLegacy } from '@cityofzion/bs-neo-legacy';
3
+ import type { IBSEthereum } from '@cityofzion/bs-ethereum';
4
+ import type { IBSNeoX } from '@cityofzion/bs-neox';
5
+ import type { IBSSolana } from '@cityofzion/bs-solana';
6
+ import type { IBSStellar } from '@cityofzion/bs-stellar';
7
+ import type { IBSBitcoin } from '@cityofzion/bs-bitcoin';
8
+ export type TBSService = IBSNeo3 | IBSNeoLegacy | IBSEthereum<'ethereum'> | IBSEthereum<'polygon'> | IBSEthereum<'base'> | IBSEthereum<'arbitrum'> | IBSNeoX | IBSSolana | IBSStellar | IBSBitcoin;
9
+ export type TBSServiceByName<S extends Array<TBSService>> = {
10
+ [K in S[number]['name']]: Extract<S[number], {
11
+ name: K;
12
+ }>;
13
+ };
14
+ export type TBSServiceName = TBSService['name'];
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-multichain",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "repository": "https://github.com/CityOfZion/blockchain-services",
5
5
  "license": "GPL-3.0-only",
6
6
  "author": "Coz",
@@ -13,7 +13,7 @@
13
13
  "@walletconnect/utils": "~2.21.9",
14
14
  "@walletconnect/jsonrpc-utils": "~1.0.8",
15
15
  "axios": "~1.13.5",
16
- "@cityofzion/blockchain-service": "3.1.3"
16
+ "@cityofzion/blockchain-service": "3.1.4"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/node": "~24.5.2",
@@ -23,12 +23,16 @@
23
23
  "typed-emitter": "~2.1.0",
24
24
  "typescript": "~5.9.2",
25
25
  "vitest": "~4.0.18",
26
- "@cityofzion/bs-ethereum": "3.1.3",
27
- "@cityofzion/bs-neo3": "3.1.3",
28
- "@cityofzion/bs-neox": "3.1.3"
26
+ "@cityofzion/bs-ethereum": "3.1.4",
27
+ "@cityofzion/bs-neo3": "3.1.4",
28
+ "@cityofzion/bs-neox": "3.1.4",
29
+ "@cityofzion/bs-bitcoin": "3.1.4",
30
+ "@cityofzion/bs-solana": "3.1.4",
31
+ "@cityofzion/bs-neo-legacy": "3.1.4",
32
+ "@cityofzion/bs-stellar": "3.1.4"
29
33
  },
30
34
  "scripts": {
31
- "build": "rm -rf ./dist && npm run typecheck && tsc --project tsconfig.build.json",
35
+ "build": "rm -rf ./dist && rm -f *.tgz && npm run typecheck && tsc --project tsconfig.build.json",
32
36
  "format": "eslint --fix",
33
37
  "lint": "eslint .",
34
38
  "package": "npm run build && npm pack",