@cityofzion/blockchain-service 1.3.0 → 1.3.2
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 +5 -1
- package/dist/interfaces.d.ts +3 -1
- package/package.json +1 -1
package/dist/functions.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { BlockchainService, BSCalculableFee, BSClaimable, BSWithExplorerService, BSWithLedger, BSWithNameService, BSWithNft } from './interfaces';
|
|
1
|
+
import { BlockchainService, BSCalculableFee, BSClaimable, BSWithExplorerService, BSWithLedger, BSWithNameService, BSWithNft, BSWithSwap } from './interfaces';
|
|
2
2
|
export declare function hasNameService(service: BlockchainService): service is BlockchainService & BSWithNameService;
|
|
3
3
|
export declare function isClaimable(service: BlockchainService): service is BlockchainService & BSClaimable;
|
|
4
4
|
export declare function isCalculableFee(service: BlockchainService): service is BlockchainService & BSCalculableFee;
|
|
5
5
|
export declare function hasNft(service: BlockchainService): service is BlockchainService & BSWithNft;
|
|
6
6
|
export declare function hasExplorerService(service: BlockchainService): service is BlockchainService & BSWithExplorerService;
|
|
7
7
|
export declare function hasLedger(service: BlockchainService): service is BlockchainService & BSWithLedger;
|
|
8
|
+
export declare function hasSwap(service: BlockchainService): service is BlockchainService & BSWithSwap;
|
|
8
9
|
export declare function waitForTransaction(service: BlockchainService, txId: string): Promise<boolean>;
|
package/dist/functions.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.waitForTransaction = exports.hasLedger = exports.hasExplorerService = exports.hasNft = exports.isCalculableFee = exports.isClaimable = exports.hasNameService = void 0;
|
|
12
|
+
exports.waitForTransaction = exports.hasSwap = exports.hasLedger = exports.hasExplorerService = exports.hasNft = exports.isCalculableFee = exports.isClaimable = exports.hasNameService = void 0;
|
|
13
13
|
function hasNameService(service) {
|
|
14
14
|
return 'resolveNameServiceDomain' in service && 'validateNameServiceDomainFormat' in service;
|
|
15
15
|
}
|
|
@@ -34,6 +34,10 @@ function hasLedger(service) {
|
|
|
34
34
|
return 'ledgerService' in service;
|
|
35
35
|
}
|
|
36
36
|
exports.hasLedger = hasLedger;
|
|
37
|
+
function hasSwap(service) {
|
|
38
|
+
return 'createSwapService' in service;
|
|
39
|
+
}
|
|
40
|
+
exports.hasSwap = hasSwap;
|
|
37
41
|
function wait(ms) {
|
|
38
42
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
39
43
|
}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -74,6 +74,9 @@ export interface BSWithLedger {
|
|
|
74
74
|
ledgerService: LedgerService;
|
|
75
75
|
generateAccountFromPublicKey(publicKey: string): Account;
|
|
76
76
|
}
|
|
77
|
+
export interface BSWithSwap<BSAvailableNetworks extends string = string> {
|
|
78
|
+
createSwapService(): SwapService<BSAvailableNetworks>;
|
|
79
|
+
}
|
|
77
80
|
export type TransactionNotifications = {
|
|
78
81
|
eventName: string;
|
|
79
82
|
state: {
|
|
@@ -279,6 +282,5 @@ export interface SwapService<AvailableNetworkIds extends string> {
|
|
|
279
282
|
setTokenToReceive(token: Token | null): void;
|
|
280
283
|
startListeningBlockGeneration(): void;
|
|
281
284
|
stopListeningBlockGeneration(): void;
|
|
282
|
-
listSwappableTokens(network: Network<AvailableNetworkIds>): PoolGraph;
|
|
283
285
|
swap(isLedger?: boolean): void;
|
|
284
286
|
}
|