Skip to content

Commit

Permalink
fixed balance bug
Browse files Browse the repository at this point in the history
Signed-off-by: aritroCoder <[email protected]>
  • Loading branch information
aritroCoder committed Dec 10, 2023
1 parent 88b8d75 commit a1849a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"dependencies": {
"@metamask/providers": "^14.0.0",
"crypto-js": "^4.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
Expand Down
6 changes: 4 additions & 2 deletions packages/site/src/utils/snap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import type { MetaMaskInpageProvider } from '@metamask/providers';
import { Maybe } from '@metamask/providers/dist/utils';
import { SHA256 } from 'crypto-js';

import { defaultSnapOrigin } from '../config';
import type { GetSnapsResponse, Snap } from '../types';
Expand Down Expand Up @@ -76,7 +78,7 @@ export const sendGetAccount = async (password: string) => {
snapId: defaultSnapOrigin,
request: {
method: 'getAccount',
params: { password },
params: { password: SHA256(password).toString() },
},
},
});
Expand Down Expand Up @@ -135,7 +137,7 @@ export const sendGetBalance = async () => {
},
});
console.log('this is balance', balance);
return balance;
return balance.balance;
};

export const sendSetData = async (
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21412,6 +21412,7 @@ __metadata:
"@types/styled-components": ^5.1.25
"@typescript-eslint/eslint-plugin": ^5.42.1
"@typescript-eslint/parser": ^5.42.1
crypto-js: ^4.2.0
eslint: ^8.45.0
eslint-config-prettier: ^8.5.0
eslint-plugin-import: ~2.26.0
Expand Down

0 comments on commit a1849a0

Please sign in to comment.