@cityofzion/bs-multichain 3.1.3 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BSAggregator.d.ts +10 -8
- package/dist/BSAggregator.js +1 -0
- package/dist/features/bridge/Neo3NeoXBridgeOrchestrator.d.ts +9 -9
- package/dist/features/bridge/Neo3NeoXBridgeOrchestrator.js +15 -6
- package/dist/features/bridge/types.d.ts +10 -10
- package/dist/features/swap/SimpleSwapApi.d.ts +3 -3
- package/dist/features/swap/SimpleSwapOrchestrator.d.ts +8 -7
- package/dist/features/swap/SimpleSwapService.d.ts +1 -1
- package/dist/features/swap/types.d.ts +6 -5
- package/dist/features/wallet-connect/WalletKitHelper.d.ts +5 -5
- package/dist/features/wallet-connect/WalletKitHelper.js +1 -1
- package/dist/features/wallet-connect/types.d.ts +17 -16
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.js +2 -0
- package/package.json +10 -6
package/dist/BSAggregator.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { type TBSAccount, type IBlockchainService, type TUntilIndexRecord } from '@cityofzion/blockchain-service';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
readonly
|
|
5
|
-
|
|
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):
|
|
11
|
-
getBlockchainNameByKey(wif: string):
|
|
12
|
-
getBlockchainNameByEncrypted(keyOrJson: string):
|
|
13
|
-
generateAccountsFromMnemonic(mnemonic: string, untilIndexByBlockchainService?: TUntilIndexRecord<
|
|
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
|
}
|
package/dist/BSAggregator.js
CHANGED
|
@@ -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
|
|
6
|
+
export declare class Neo3NeoXBridgeOrchestrator implements IBridgeOrchestrator<TBSBridgeName> {
|
|
7
7
|
#private;
|
|
8
|
-
eventEmitter: TypedEmitter<TBridgeOrchestratorEvents<
|
|
9
|
-
fromService: BSNeo3
|
|
10
|
-
toService: BSNeo3
|
|
11
|
-
constructor(params: TNeo3NeoXBridgeOrchestratorInitParams
|
|
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<
|
|
15
|
-
setAccountToUse(account: TBSAccount<
|
|
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
|
|
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, {
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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(() =>
|
|
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
|
|
5
|
-
neo3Service: BSNeo3
|
|
6
|
-
neoXService: BSNeoX
|
|
7
|
-
initialFromServiceName?:
|
|
4
|
+
export type TNeo3NeoXBridgeOrchestratorInitParams = {
|
|
5
|
+
neo3Service: BSNeo3;
|
|
6
|
+
neoXService: BSNeoX;
|
|
7
|
+
initialFromServiceName?: TBSBridgeName;
|
|
8
8
|
};
|
|
9
|
-
export type TNeo3NeoXBridgeOrchestratorWaitParams
|
|
10
|
-
neo3Service: BSNeo3
|
|
11
|
-
neoXService: BSNeoX
|
|
9
|
+
export type TNeo3NeoXBridgeOrchestratorWaitParams = {
|
|
10
|
+
neo3Service: BSNeo3;
|
|
11
|
+
neoXService: BSNeoX;
|
|
12
12
|
transactionHash: string;
|
|
13
|
-
tokenToUse: TBridgeToken<
|
|
14
|
-
tokenToReceive: TBridgeToken<
|
|
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
|
|
2
|
+
export declare class SimpleSwapApi {
|
|
3
3
|
#private;
|
|
4
|
-
getCurrencies(options: TSimpleSwapOrchestratorInitParams
|
|
5
|
-
getPairs(ticker: string, network: string): Promise<TSimpleSwapApiCurrency
|
|
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
|
-
|
|
4
|
+
import type { TBSServiceName } from '../../types';
|
|
5
|
+
export declare class SimpleSwapOrchestrator implements ISwapOrchestrator<TBSServiceName> {
|
|
5
6
|
#private;
|
|
6
|
-
eventEmitter: TypedEmitter<TSwapOrchestratorEvents<
|
|
7
|
-
constructor(params: TSimpleSwapOrchestratorInitParams
|
|
7
|
+
eventEmitter: TypedEmitter<TSwapOrchestratorEvents<TBSServiceName>>;
|
|
8
|
+
constructor(params: TSimpleSwapOrchestratorInitParams);
|
|
8
9
|
init(): Promise<void>;
|
|
9
|
-
setTokenToUse(token: TSwapToken<
|
|
10
|
-
setAccountToUse(account: TBSAccount<
|
|
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<
|
|
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
|
|
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
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
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
|
|
8
|
-
static getProposalServices
|
|
9
|
-
static getSessionDetails
|
|
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
|
|
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
|
-
|
|
3
|
+
import type { TBSServiceName } from '../../types';
|
|
4
|
+
export type TWalletKitHelperGetProposalDetailsParams = {
|
|
4
5
|
proposal: ProposalTypes.Struct;
|
|
5
6
|
address: string;
|
|
6
|
-
service: IBlockchainService<
|
|
7
|
+
service: IBlockchainService<TBSServiceName, TBSNetworkId>;
|
|
7
8
|
};
|
|
8
|
-
export type TWalletKitHelperGetProposalServicesParams
|
|
9
|
+
export type TWalletKitHelperGetProposalServicesParams = {
|
|
9
10
|
proposal: ProposalTypes.Struct;
|
|
10
|
-
services: IBlockchainService<
|
|
11
|
+
services: IBlockchainService<TBSServiceName, TBSNetworkId>[];
|
|
11
12
|
};
|
|
12
|
-
export type TWalletKitHelperProposalDetails
|
|
13
|
+
export type TWalletKitHelperProposalDetails = {
|
|
13
14
|
methods: string[];
|
|
14
15
|
approvedNamespaces: SessionTypes.Namespaces;
|
|
15
|
-
service: IBlockchainService<
|
|
16
|
-
blockchain:
|
|
16
|
+
service: IBlockchainService<TBSServiceName, TBSNetworkId> & IBSWithWalletConnect<TBSServiceName>;
|
|
17
|
+
blockchain: TBSServiceName;
|
|
17
18
|
};
|
|
18
|
-
export type TWalletKitHelperGetSessionDetailsParams
|
|
19
|
+
export type TWalletKitHelperGetSessionDetailsParams = {
|
|
19
20
|
session: SessionTypes.Struct;
|
|
20
|
-
services: IBlockchainService<
|
|
21
|
+
services: IBlockchainService<TBSServiceName, TBSNetworkId>[];
|
|
21
22
|
};
|
|
22
|
-
export type TWalletKitHelperSessionDetails
|
|
23
|
+
export type TWalletKitHelperSessionDetails = {
|
|
23
24
|
address: string;
|
|
24
25
|
methods: string[];
|
|
25
|
-
service: IBlockchainService<
|
|
26
|
-
blockchain:
|
|
26
|
+
service: IBlockchainService<TBSServiceName, TBSNetworkId> & IBSWithWalletConnect<TBSServiceName>;
|
|
27
|
+
blockchain: TBSServiceName;
|
|
27
28
|
};
|
|
28
|
-
export type TWalletKitHelperProcessRequestParams
|
|
29
|
+
export type TWalletKitHelperProcessRequestParams = {
|
|
29
30
|
request: PendingRequestTypes.Struct;
|
|
30
|
-
sessionDetails: TWalletKitHelperSessionDetails
|
|
31
|
-
account: TBSAccount<
|
|
31
|
+
sessionDetails: TWalletKitHelperSessionDetails;
|
|
32
|
+
account: TBSAccount<TBSServiceName>;
|
|
32
33
|
};
|
|
33
34
|
export type TWalletKitHelperFilterSessionsParams = {
|
|
34
35
|
addresses?: string[];
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/types.d.ts
ADDED
|
@@ -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-multichain",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
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.
|
|
16
|
+
"@cityofzion/blockchain-service": "3.1.5"
|
|
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-
|
|
27
|
-
"@cityofzion/bs-
|
|
28
|
-
"@cityofzion/bs-
|
|
26
|
+
"@cityofzion/bs-bitcoin": "3.1.5",
|
|
27
|
+
"@cityofzion/bs-ethereum": "3.1.5",
|
|
28
|
+
"@cityofzion/bs-neo3": "3.1.5",
|
|
29
|
+
"@cityofzion/bs-neox": "3.1.5",
|
|
30
|
+
"@cityofzion/bs-neo-legacy": "3.1.5",
|
|
31
|
+
"@cityofzion/bs-solana": "3.1.5",
|
|
32
|
+
"@cityofzion/bs-stellar": "3.1.5"
|
|
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",
|