Skip to content

Commit

Permalink
fix: get correct balance on snap homepage (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyyconsensys authored Mar 7, 2024
1 parent 83d1088 commit 781406e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/starknet-snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/ConsenSys/starknet-snap.git"
},
"source": {
"shasum": "lLTHMW/oau9o6LzRE+2n+2qHCooLpe1RSJJPR/6UOEU=",
"shasum": "A3cyal6PKAzEQQ3ptdBUK106XMp5jQVh4kydh87u7AA=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
3 changes: 2 additions & 1 deletion packages/starknet-snap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export const onHomePage: OnHomePageHandler = async () => {

let accContract: AccContract;
if (state.currentNetwork) {
accContract = state.accContracts.find(n => n.chainId == state.currentNetwork.chainId);
accContract = state.accContracts.find((n) => n.chainId == state.currentNetwork.chainId);
} else {
accContract = state.accContracts[0];
}
Expand All @@ -287,6 +287,7 @@ export const onHomePage: OnHomePageHandler = async () => {
requestParams: {
tokenAddress: ercToken.address,
userAddress: userAddress,
chainId: network.chainId,
},
};
const balance = await getErc20TokenBalance(params);
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3155,15 +3155,15 @@ __metadata:

"@consensys/starknet-snap@file:../starknet-snap::locator=wallet-ui%40workspace%3Apackages%2Fwallet-ui":
version: 2.5.1
resolution: "@consensys/starknet-snap@file:../starknet-snap#../starknet-snap::hash=f43351&locator=wallet-ui%40workspace%3Apackages%2Fwallet-ui"
resolution: "@consensys/starknet-snap@file:../starknet-snap#../starknet-snap::hash=195ab3&locator=wallet-ui%40workspace%3Apackages%2Fwallet-ui"
dependencies:
"@metamask/snaps-sdk": 3.0.1
async-mutex: ^0.3.2
ethereum-unit-converter: ^0.0.17
ethers: ^5.5.1
starknet: ^5.14.0
starknet_v4.22.0: "npm:[email protected]"
checksum: f6c425fa95f59effaa3cb47e30e5f5a339fb47e9cd5b0337f229213642436efb5fe8dc6b4df4de75a9b4e4524793145c78914514ff2d11bd055f365c2ce180d5
checksum: dc8a3354e0ec4863c9ff6d2841abeb0ea841f69519202d1c1b904308024a7ff76f3d44a1cfa91d043739ce807aa7b8513d06baf7cb357475450d653a39f89efd
languageName: node
linkType: hard

Expand Down

0 comments on commit 781406e

Please sign in to comment.