@raac/rpc 1.1.0-beta.8 → 1.1.0-beta.9

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.
@@ -1,7 +1,11 @@
1
1
  import { Provider } from "ethers";
2
2
  import { AssetType } from "../../utils/artifacts";
3
3
  import { ChainId } from "../../configs/chains/index";
4
- declare function getBalance(chainId: ChainId, assetId: AssetType, address: string, provider: Provider): Promise<number | {
4
+ declare function getBalance(chainId: ChainId, assetId: AssetType, address: string, provider: Provider): Promise<0 | {
5
+ balance: number;
6
+ symbol: string;
7
+ decimals: number;
8
+ } | {
5
9
  balance: string;
6
10
  symbol: any;
7
11
  decimals: any;
@@ -8,7 +8,11 @@ async function getBalance(chainId, assetId, address, provider) {
8
8
  if (assetId === "eth") {
9
9
  const balance = await provider.getBalance(address);
10
10
  const parsedBalance = parseFloat(ethers_1.ethers.formatEther(balance));
11
- return parsedBalance;
11
+ return {
12
+ balance: parsedBalance,
13
+ symbol: "ETH",
14
+ decimals: 18,
15
+ };
12
16
  }
13
17
  const contractAddress = (0, contracts_1.getContractAddress)(chainId, assetId);
14
18
  const contract = new ethers_1.ethers.Contract(contractAddress, BALANCE_OF_ABI, provider);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raac/rpc",
3
- "version": "1.1.0-beta.8",
3
+ "version": "1.1.0-beta.9",
4
4
  "description": "RPC Library for RAAC ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",