Skip to content

Commit

Permalink
refactor: drop bignumber.js
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Oct 19, 2024
1 parent 531ded4 commit c503e9d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/stores/sdkStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from "@aeternity/aepp-sdk";
import { COMPILER_URL, nodes } from "../utils/config";
import { Ref, ref, ShallowRef, shallowRef, UnwrapRef } from "vue";
import BigNumber from "bignumber.js";
import { getSecretKey, persistSecretKey } from "../utils/utils";

interface Wallet {
Expand Down Expand Up @@ -175,7 +174,7 @@ export const useSdkStore = defineStore("sdk", () => {
if (
networkId.value === "ae_uat" &&
address.value &&
new BigNumber(10000000000000000).gt(balance)
+balance < 10000000000000000
) {
await fetch(`https://faucet.aepps.com/account/${address.value}`, {
method: "POST",
Expand Down
4 changes: 1 addition & 3 deletions src/utils/toJsonExtensions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import BigNumber from "bignumber.js";

// @ts-ignore: Property 'toJSON' does not exist on type 'BigInt'.
BigInt.prototype.toJSON = function () {
return BigNumber(this.toString()).toNumber();
return +this.toString();
};

Uint8Array.prototype.toString = function () {
Expand Down
3 changes: 2 additions & 1 deletion src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export function argsStringToArgs(argsString: string) {
export const exampleContractCode = `@compiler >= 4
contract Example =
entrypoint example(x : int) = x`;
entrypoint example(x : int) = x
`;

export const defaultCallOptions = {
gasPrice: 1000000000,
Expand Down

0 comments on commit c503e9d

Please sign in to comment.