diff --git a/package-lock.json b/package-lock.json index e937cb1f..937e69ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3924,15 +3924,14 @@ } }, "node_modules/@massalabs/wallet-provider": { - "version": "3.0.0-next.20240801075227", - "resolved": "https://registry.npmjs.org/@massalabs/wallet-provider/-/wallet-provider-3.0.0-next.20240801075227.tgz", - "integrity": "sha512-Rd2kW7pERe1np8KvApPLw7mhIxtfWOZRjiEYEo2xCVp7/JltG0JNMvUr6pDH9Q0fRDSY8rDiyJNsWqcRnCMjdw==", + "version": "3.0.0-next.20240801111008", + "resolved": "https://registry.npmjs.org/@massalabs/wallet-provider/-/wallet-provider-3.0.0-next.20240801111008.tgz", + "integrity": "sha512-JjL7Pu95YM9DtsCr0VMXOSRT0+WP59tAsdCpjQD2kKP8vFfcjk7YLaw4tfX02bq99Byiyt215M+mkfesDorDRg==", "dependencies": { "@hicaru/bearby.js": "^0.5.8", "@massalabs/massa-web3": "^5.0.0-next", - "@massalabs/web3-utils": "^1.4.9-dev", "axios": "^0.28.0", - "bs58check": "^3.0.1", + "bs58check": "^4.0.0", "buffer": "^6.0.3", "uid": "^2.0.1" }, @@ -3941,28 +3940,6 @@ "utf-8-validate": "^6.0.2" } }, - "node_modules/@massalabs/wallet-provider/node_modules/base-x": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", - "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" - }, - "node_modules/@massalabs/wallet-provider/node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", - "dependencies": { - "base-x": "^4.0.0" - } - }, - "node_modules/@massalabs/wallet-provider/node_modules/bs58check": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-3.0.1.tgz", - "integrity": "sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==", - "dependencies": { - "@noble/hashes": "^1.2.0", - "bs58": "^5.0.0" - } - }, "node_modules/@massalabs/wallet-provider/node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", @@ -3986,40 +3963,6 @@ "ieee754": "^1.2.1" } }, - "node_modules/@massalabs/web3-utils": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@massalabs/web3-utils/-/web3-utils-1.4.11.tgz", - "integrity": "sha512-9iUoSc9OZxrvx8UbDor934z0cetenEU3PlDqTa9Hsh3EuZJ9jalcEU8Q9Z+hjLn2S9Ojmqu2ldcOAxVzYeNCbw==", - "dependencies": { - "bignumber.js": "^9.1.2", - "buffer": "^6.0.3", - "events": "^3.3.0", - "string_decoder": "^1.3.0" - } - }, - "node_modules/@massalabs/web3-utils/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "node_modules/@mdx-js/react": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-2.3.0.tgz", @@ -8928,14 +8871,6 @@ "node": "*" } }, - "node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -11762,6 +11697,8 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "peer": true, "engines": { "node": ">=0.8.x" } diff --git a/src/lib/massa-react/hooks/useWriteSmartContract.tsx b/src/lib/massa-react/hooks/useWriteSmartContract.tsx index 518351f2..a4debbeb 100644 --- a/src/lib/massa-react/hooks/useWriteSmartContract.tsx +++ b/src/lib/massa-react/hooks/useWriteSmartContract.tsx @@ -2,13 +2,7 @@ import { useState } from 'react'; import { toast } from '../../../components'; import { logSmartContractEvents, showToast } from '../utils'; import Intl from '../i18n'; -import { - Mas, - Operation, - OperationStatus, - Provider, -} from '@massalabs/massa-web3'; -import { MINIMAL_FEE } from '../const'; +import { Operation, OperationStatus, Provider } from '@massalabs/massa-web3'; interface ToasterMessage { pending: string; @@ -29,8 +23,8 @@ export function useWriteSmartContract(account: Provider, isMainnet = false) { targetAddress: string, parameter: Uint8Array, messages: ToasterMessage, - coins = Mas.fromString('0'), - fee = MINIMAL_FEE, + coins = 0n, + fee?: bigint, ) { if (isOpPending) { throw new Error('Operation is already pending');