Skip to content

Commit

Permalink
fix balance, remove here wallet (#22)
Browse files Browse the repository at this point in the history
* fix balance, remove here wallet

* check ci (#23)

Co-authored-by: dj8yf0μl <[email protected]>

---------

Co-authored-by: PiVortex <[email protected]>
Co-authored-by: dj8yf0μl <[email protected]>
Co-authored-by: dj8yf0μl <[email protected]>
  • Loading branch information
4 people authored Oct 24, 2024
1 parent 0694283 commit 85639b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contract-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ near-sdk = "5.4.0"

[dev-dependencies]
near-sdk = { version = "5.4.0", features = ["unit-testing"] }
near-workspaces = { version = "0.11.0", features = ["unstable"] }
near-workspaces = { version = "0.14.1", features = ["unstable"] }
tokio = { version = "1.12.0", features = ["full"] }
serde_json = "1"

Expand Down
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@near-wallet-selector/bitte-wallet": "^8.9.13",
"@near-wallet-selector/core": "^8.9.13",
"@near-wallet-selector/ethereum-wallets": "^8.9.13",
"@near-wallet-selector/here-wallet": "^8.9.13",
"@near-wallet-selector/ledger": "^8.9.13",
"@near-wallet-selector/meteor-wallet": "^8.9.13",
"@near-wallet-selector/modal-ui": "^8.9.13",
Expand Down
11 changes: 7 additions & 4 deletions frontend/src/wallets/near.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import '@near-wallet-selector/modal-ui/styles.css';
import { setupBitteWallet } from '@near-wallet-selector/bitte-wallet';
import { setupWalletSelector } from '@near-wallet-selector/core';
import { setupEthereumWallets } from '@near-wallet-selector/ethereum-wallets';
import { setupHereWallet } from '@near-wallet-selector/here-wallet';
import { setupLedger } from '@near-wallet-selector/ledger';
import { setupMeteorWallet } from '@near-wallet-selector/meteor-wallet';
import { setupModal } from '@near-wallet-selector/modal-ui';
Expand Down Expand Up @@ -45,7 +44,6 @@ export class Wallet {
network: this.networkId,
modules: [
setupMyNearWallet(),
setupHereWallet(),
setupLedger(),
setupMeteorWallet(),
setupSender(),
Expand Down Expand Up @@ -167,8 +165,13 @@ export class Wallet {
account_id: accountId,
finality: 'final',
});
// return amount on NEAR
return account.amount ? Number(utils.format.formatNearAmount(account.amount)) : 0;

// Format the amout and remove commas
const amountString = utils.format.formatNearAmount(account.amount);
const amount = Number(amountString.replace(/,/g, "").trim());

// Return amount in NEAR
return account.amount ? amount : 0;
};

/**
Expand Down

0 comments on commit 85639b5

Please sign in to comment.