Skip to content

Commit

Permalink
web wallet bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
juliancwirko committed Jun 17, 2022
1 parent 91844e0 commit cee5058
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 4 additions & 1 deletion components/core/TransactionPendingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export const TransactionPendingModal: FC<TransactionPendingModalProps> = ({
) {
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) {
Expand Down
18 changes: 11 additions & 7 deletions hooks/interaction/useScTransaction.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable react-hooks/exhaustive-deps */
import {
SmartContract,
ContractFunction,
Address,
Transaction,
Account,
TypedValue,
TokenPayment,
TransactionWatcher,
ContractCallPayloadBuilder,
} from '@elrondnetwork/erdjs';
import { ApiNetworkProvider } from '@elrondnetwork/erdjs-network-providers';
import {
Expand Down Expand Up @@ -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,
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elven-tools-dapp",
"version": "2.2.0",
"version": "2.2.1",
"author": "Julian Ćwirko <julian.io>",
"license": "MIT",
"homepage": "https://www.elven.tools",
Expand Down

0 comments on commit cee5058

Please sign in to comment.