zano_web3 4.0.0 → 4.2.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/index.ts +2 -0
- package/package.json +1 -1
- package/src/types.ts +35 -0
- package/src/zanoWallet.ts +2 -1
package/index.ts
CHANGED
package/package.json
CHANGED
package/src/types.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface Asset {
|
|
2
|
+
name: string;
|
|
3
|
+
ticker: string;
|
|
4
|
+
assetId: string;
|
|
5
|
+
decimalPoint: number;
|
|
6
|
+
balance: string;
|
|
7
|
+
unlockedBalance: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface Transfer {
|
|
11
|
+
amount: string;
|
|
12
|
+
assetId: string;
|
|
13
|
+
incoming: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Transaction {
|
|
17
|
+
isConfirmed: boolean;
|
|
18
|
+
txHash: string;
|
|
19
|
+
blobSize: number;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
height: number;
|
|
22
|
+
paymentId: string;
|
|
23
|
+
comment: string;
|
|
24
|
+
fee: string;
|
|
25
|
+
isInitiator: boolean;
|
|
26
|
+
transfers: Transfer[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface Wallet {
|
|
30
|
+
address: string;
|
|
31
|
+
alias: string;
|
|
32
|
+
balance: string;
|
|
33
|
+
assets: Asset[];
|
|
34
|
+
transactions: Transaction[];
|
|
35
|
+
}
|
package/src/zanoWallet.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
import { Wallet } from './types';
|
|
2
3
|
|
|
3
4
|
export interface ZanoWalletParams {
|
|
4
5
|
authPath: string;
|
|
@@ -201,7 +202,7 @@ class ZanoWallet {
|
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
async getWallet() {
|
|
204
|
-
return await this.zanoWallet.request('GET_WALLET_DATA');
|
|
205
|
+
return (await this.zanoWallet.request('GET_WALLET_DATA'))?.data as Wallet;
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
208
|
|