zano_web3 4.1.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 CHANGED
@@ -6,4 +6,6 @@ export {useZanoWallet};
6
6
  import validateWallet from "./src/server";
7
7
  export {validateWallet};
8
8
 
9
+ export * from "./src/types";
10
+
9
11
  export default zanoWallet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zano_web3",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
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'))?.data;
205
+ return (await this.zanoWallet.request('GET_WALLET_DATA'))?.data as Wallet;
205
206
  }
206
207
  }
207
208