@cityofzion/blockchain-service 1.21.3 → 1.22.1
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/functions.d.ts +2 -1
- package/dist/functions.js +4 -0
- package/dist/interfaces.d.ts +19 -1
- package/package.json +1 -1
package/dist/functions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TBSAccount, IBlockchainService, IBSWithClaim, IBSWithEncryption, IBSWithExplorer, IBSWithFee, IBSWithLedger, IBSWithNameService, IBSWithNeo3NeoXBridge, IBSWithNft, TUntilIndexRecord } from './interfaces';
|
|
1
|
+
import { TBSAccount, IBlockchainService, IBSWithClaim, IBSWithEncryption, IBSWithExplorer, IBSWithFee, IBSWithLedger, IBSWithNameService, IBSWithNeo3NeoXBridge, IBSWithNft, TUntilIndexRecord, IBSWithWalletConnect } from './interfaces';
|
|
2
2
|
export declare function hasNameService<BSName extends string = string>(service: IBlockchainService<BSName>): service is IBlockchainService<BSName> & IBSWithNameService;
|
|
3
3
|
export declare function isClaimable<BSName extends string = string>(service: IBlockchainService<BSName>): service is IBlockchainService<BSName> & IBSWithClaim<BSName>;
|
|
4
4
|
export declare function isCalculableFee<BSName extends string = string>(service: IBlockchainService<BSName>): service is IBlockchainService<BSName> & IBSWithFee<BSName>;
|
|
@@ -7,6 +7,7 @@ export declare function hasExplorerService<BSName extends string = string>(servi
|
|
|
7
7
|
export declare function hasLedger<BSName extends string = string>(service: IBlockchainService<BSName>): service is IBlockchainService<BSName> & IBSWithLedger<BSName>;
|
|
8
8
|
export declare function hasNeo3NeoXBridge<BSName extends string = string>(service: IBlockchainService<BSName>): service is IBlockchainService<BSName> & IBSWithNeo3NeoXBridge<BSName>;
|
|
9
9
|
export declare function hasEncryption<BSName extends string = string>(service: IBlockchainService<BSName>): service is IBlockchainService<BSName> & IBSWithEncryption<BSName>;
|
|
10
|
+
export declare function hasWalletConnect<BSName extends string = string>(service: IBlockchainService<BSName>): service is IBlockchainService<BSName> & IBSWithWalletConnect;
|
|
10
11
|
/**
|
|
11
12
|
* @deprecated use `waitForAccountTransaction` instead
|
|
12
13
|
*/
|
package/dist/functions.js
CHANGED
|
@@ -17,6 +17,7 @@ exports.hasExplorerService = hasExplorerService;
|
|
|
17
17
|
exports.hasLedger = hasLedger;
|
|
18
18
|
exports.hasNeo3NeoXBridge = hasNeo3NeoXBridge;
|
|
19
19
|
exports.hasEncryption = hasEncryption;
|
|
20
|
+
exports.hasWalletConnect = hasWalletConnect;
|
|
20
21
|
exports.waitForTransaction = waitForTransaction;
|
|
21
22
|
exports.waitForAccountTransaction = waitForAccountTransaction;
|
|
22
23
|
exports.fetchAccounts = fetchAccounts;
|
|
@@ -47,6 +48,9 @@ function hasNeo3NeoXBridge(service) {
|
|
|
47
48
|
function hasEncryption(service) {
|
|
48
49
|
return 'encrypt' in service && 'decrypt' in service;
|
|
49
50
|
}
|
|
51
|
+
function hasWalletConnect(service) {
|
|
52
|
+
return 'walletConnectService' in service;
|
|
53
|
+
}
|
|
50
54
|
/**
|
|
51
55
|
* @deprecated use `waitForAccountTransaction` instead
|
|
52
56
|
*/
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export interface IBlockchainService<N extends string = string, A extends string
|
|
|
56
56
|
exchangeDataService: IExchangeDataService;
|
|
57
57
|
blockchainDataService: IBlockchainDataService;
|
|
58
58
|
tokenService: ITokenService;
|
|
59
|
-
|
|
59
|
+
pingNode: (url: string) => Promise<TPingNetworkResponse>;
|
|
60
60
|
setNetwork: (network: TBSNetwork<A>) => void;
|
|
61
61
|
generateAccountFromMnemonic(mnemonic: string, index: number): TBSAccount<N>;
|
|
62
62
|
generateAccountFromKey(key: string): TBSAccount<N>;
|
|
@@ -92,6 +92,9 @@ export interface IBSWithLedger<N extends string = string> {
|
|
|
92
92
|
ledgerService: ILedgerService<N>;
|
|
93
93
|
generateAccountFromPublicKey(publicKey: string): TBSAccount<N>;
|
|
94
94
|
}
|
|
95
|
+
export interface IBSWithWalletConnect {
|
|
96
|
+
walletConnectService: IWalletConnectService;
|
|
97
|
+
}
|
|
95
98
|
export type TTransactionNotificationTypedResponse = {
|
|
96
99
|
type: string;
|
|
97
100
|
value?: string;
|
|
@@ -482,4 +485,19 @@ export interface ITokenService {
|
|
|
482
485
|
normalizeToken<T extends TBSToken | TBSToken[]>(token: T): T;
|
|
483
486
|
normalizeHash(hash: string): string;
|
|
484
487
|
}
|
|
488
|
+
export type TWalletConnectServiceRequestMethodParams<N extends string = string> = {
|
|
489
|
+
account: TBSAccount<N>;
|
|
490
|
+
params: any;
|
|
491
|
+
};
|
|
492
|
+
export type TWalletConnectServiceRequestMethod = (params: TWalletConnectServiceRequestMethodParams) => Promise<any>;
|
|
493
|
+
export interface IWalletConnectService {
|
|
494
|
+
readonly namespace: string;
|
|
495
|
+
readonly chain: string;
|
|
496
|
+
readonly supportedMethods: string[];
|
|
497
|
+
readonly supportedEvents: string[];
|
|
498
|
+
readonly calculableMethods: string[];
|
|
499
|
+
readonly autoApproveMethods: string[];
|
|
500
|
+
calculateRequestFee(args: TWalletConnectServiceRequestMethodParams): Promise<string>;
|
|
501
|
+
[methodName: string]: any | TWalletConnectServiceRequestMethod;
|
|
502
|
+
}
|
|
485
503
|
export {};
|