diff --git a/CHANGELOG.md b/CHANGELOG.md index c08aae5..2ee43df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### [2.2.1](https://github.com/ElvenTools/elven-tools-dapp/releases/tag/v2.2.1) (2022-06-17) +- bugfix for web wallet signing, it is now required to provide the sender when creating a transaction + ### [2.2.0](https://github.com/ElvenTools/elven-tools-dapp/releases/tag/v2.2.0) (2022-06-09) - Hardware Wallet (Ledger) support diff --git a/components/core/TransactionPendingModal.tsx b/components/core/TransactionPendingModal.tsx index 5a8cd4e..e3e29e2 100644 --- a/components/core/TransactionPendingModal.tsx +++ b/components/core/TransactionPendingModal.tsx @@ -50,7 +50,10 @@ export const TransactionPendingModal: FC = ({ ) { return 'Transaction was rejected by user.'; } - if (txError === 'Request error on url [transactions]: [{"statusCode":400,"message":""}]') { + if ( + txError === + 'Request error on url [transactions]: [{"statusCode":400,"message":""}]' + ) { return "The transaction can't be processed. Check if there are funds on chosen wallet address."; } if (txError) { diff --git a/hooks/interaction/useScTransaction.tsx b/hooks/interaction/useScTransaction.tsx index 0b9966e..fe2a9a5 100644 --- a/hooks/interaction/useScTransaction.tsx +++ b/hooks/interaction/useScTransaction.tsx @@ -1,6 +1,5 @@ /* eslint-disable react-hooks/exhaustive-deps */ import { - SmartContract, ContractFunction, Address, Transaction, @@ -8,6 +7,7 @@ import { TypedValue, TokenPayment, TransactionWatcher, + ContractCallPayloadBuilder, } from '@elrondnetwork/erdjs'; import { ApiNetworkProvider } from '@elrondnetwork/erdjs-network-providers'; import { @@ -131,19 +131,23 @@ export function useScTransaction(cb?: (params: ScTransactionCb) => void) { currentNonce !== undefined && mintTxBaseGasLimit && smartContractAddress && + accountSnap.address && + args && !pending ) { setPending(true); - const contract = new SmartContract({ - address: new Address(smartContractAddress), - }); + const data = new ContractCallPayloadBuilder() + .setFunction(func) + .setArgs(args) + .build(); - let tx = contract.call({ - func, + let tx = new Transaction({ + data, gasLimit, - args, value, + receiver: new Address(smartContractAddress), + sender: new Address(accountSnap.address), chainID: networkConfig[chainType].shortId, }); diff --git a/package.json b/package.json index 7a02b38..e1a8887 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "elven-tools-dapp", - "version": "2.2.0", + "version": "2.2.1", "author": "Julian Ćwirko ", "license": "MIT", "homepage": "https://www.elven.tools",