Skip to content

Commit

Permalink
change transaction value type
Browse files Browse the repository at this point in the history
  • Loading branch information
juliancwirko committed Feb 22, 2023
1 parent f99cac4 commit 241d10f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### [0.0.6](https://github.com/useElven/core/releases/tag/v0.0.6) (2023-02-22)
- useTransaction now takes `ITransactionValue` instead of `Number` for value

### [0.0.5](https://github.com/useElven/core/releases/tag/v0.0.5) (2023-02-22)
- fix for useConfig, missing IPFSGateway param

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": "@useelven/core",
"version": "0.0.5",
"version": "0.0.6",
"description": "Core hooks for MultiversX React DApps",
"license": "MIT",
"author": "Julian Ćwirko <julian.io>",
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Transaction,
ITransactionPayload,
IGasLimit,
TokenPayment,
ITransactionValue,
ITransactionOnNetwork,
} from '@multiversx/sdk-core';
import { useWebWalletTxSend } from './common-helpers/useWebWalletTxSend';
Expand All @@ -24,7 +24,7 @@ interface TransactionParams {
address: string;
gasLimit: IGasLimit;
data?: ITransactionPayload;
value?: number;
value?: ITransactionValue;
}

interface TransactionArgs {
Expand Down Expand Up @@ -77,7 +77,7 @@ export function useTransaction(
gasLimit,
chainID: configStateSnap.shortId || 'D',
data,
...(value ? { value: TokenPayment.egldFromAmount(value) } : {}),
value: value || 0,
sender: new Address(accountSnap.address),
});

Expand Down

0 comments on commit 241d10f

Please sign in to comment.