From 241d10fceea9c415319a5a0f4c86bd5ef43ff686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20=C4=86wirko?= Date: Wed, 22 Feb 2023 21:41:17 +0100 Subject: [PATCH] change transaction value type --- CHANGELOG.md | 3 +++ package.json | 2 +- src/hooks/useTransaction.tsx | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d079601..5ed9a5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/package.json b/package.json index c884851..6f22c66 100644 --- a/package.json +++ b/package.json @@ -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 ", diff --git a/src/hooks/useTransaction.tsx b/src/hooks/useTransaction.tsx index 09b7aa0..4448028 100644 --- a/src/hooks/useTransaction.tsx +++ b/src/hooks/useTransaction.tsx @@ -5,7 +5,7 @@ import { Transaction, ITransactionPayload, IGasLimit, - TokenPayment, + ITransactionValue, ITransactionOnNetwork, } from '@multiversx/sdk-core'; import { useWebWalletTxSend } from './common-helpers/useWebWalletTxSend'; @@ -24,7 +24,7 @@ interface TransactionParams { address: string; gasLimit: IGasLimit; data?: ITransactionPayload; - value?: number; + value?: ITransactionValue; } interface TransactionArgs { @@ -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), });