@cityofzion/blockchain-service 0.3.1 → 0.4.0
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/interfaces.d.ts +12 -17
- package/package.json +6 -4
package/dist/interfaces.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export type IntentTransactionParam = {
|
|
|
8
8
|
tokenHash: string;
|
|
9
9
|
amount: number;
|
|
10
10
|
};
|
|
11
|
+
export type TokenInfo = {
|
|
12
|
+
hash: string;
|
|
13
|
+
symbol: string;
|
|
14
|
+
decimals: number;
|
|
15
|
+
};
|
|
11
16
|
export type CalculateTransferFeeDetails = {
|
|
12
17
|
systemFee?: string;
|
|
13
18
|
networkFee?: string;
|
|
@@ -25,11 +30,7 @@ export type ClaimResponse = {
|
|
|
25
30
|
export interface Claimable {
|
|
26
31
|
claim(account: Account): Promise<ClaimResponse>;
|
|
27
32
|
dataService: BlockchainDataService & BDSClaimable;
|
|
28
|
-
tokenClaim:
|
|
29
|
-
hash: string;
|
|
30
|
-
symbol: string;
|
|
31
|
-
decimals: number;
|
|
32
|
-
};
|
|
33
|
+
tokenClaim: TokenInfo;
|
|
33
34
|
}
|
|
34
35
|
export declare enum NNSRecordTypes {
|
|
35
36
|
IPV4 = "1",
|
|
@@ -59,19 +60,13 @@ export type CalculateTransferFeeResponse = {
|
|
|
59
60
|
export interface BlockchainService<BSCustomName extends string = string> {
|
|
60
61
|
readonly dataService: BlockchainDataService;
|
|
61
62
|
readonly blockchainName: BSCustomName;
|
|
62
|
-
readonly
|
|
63
|
-
readonly feeToken: {
|
|
64
|
-
hash: string;
|
|
65
|
-
symbol: string;
|
|
66
|
-
decimals: number;
|
|
67
|
-
};
|
|
63
|
+
readonly feeToken: TokenInfo;
|
|
68
64
|
readonly exchange: Exchange;
|
|
69
65
|
readonly tokens: Token[];
|
|
70
66
|
sendTransaction(param: SendTransactionParam): Promise<string>;
|
|
71
|
-
generateMnemonic(): string;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
generateAccountFromWif(wif: string): string;
|
|
67
|
+
generateMnemonic(): string[];
|
|
68
|
+
generateAccount(mnemonic: string[], index: number): Account;
|
|
69
|
+
generateAccountFromWif(wif: string): Account;
|
|
75
70
|
decryptKey(encryptedKey: string, password: string): Promise<Account>;
|
|
76
71
|
validateAddress(address: string): boolean;
|
|
77
72
|
validateEncryptedKey(encryptedKey: string): boolean;
|
|
@@ -154,10 +149,10 @@ export interface BlockchainDataService {
|
|
|
154
149
|
getAllNodes(): Promise<ConsensusNodeResponse[]>;
|
|
155
150
|
getHigherNode(): Promise<ConsensusNodeResponse>;
|
|
156
151
|
}
|
|
157
|
-
export type
|
|
152
|
+
export type TokenPricesResponse = {
|
|
158
153
|
amount: number;
|
|
159
154
|
Symbol: string;
|
|
160
155
|
};
|
|
161
156
|
export interface Exchange {
|
|
162
|
-
getTokenPrices(currency: Currency): Promise<
|
|
157
|
+
getTokenPrices(currency: Currency): Promise<TokenPricesResponse[]>;
|
|
163
158
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/blockchain-service",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
7
7
|
"author": "Coz",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"files": [
|
|
9
|
+
"files": [
|
|
10
|
+
"/dist"
|
|
11
|
+
],
|
|
10
12
|
"scripts": {
|
|
11
|
-
"build": "tsc && typedoc
|
|
13
|
+
"build": "tsc && typedoc"
|
|
12
14
|
},
|
|
13
15
|
"dependencies": {
|
|
14
16
|
"axios": "1.3.2"
|
|
@@ -18,4 +20,4 @@
|
|
|
18
20
|
"typescript": "4.9.5",
|
|
19
21
|
"typedoc": "0.23.24"
|
|
20
22
|
}
|
|
21
|
-
}
|
|
23
|
+
}
|