@dynamic-labs/sdk-react-core
Version:
A React SDK for implementing wallet web3 authentication and authorization to your website.
19 lines (14 loc) • 630 B
JavaScript
'use client'
;
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
const useTransactionTotal = ({ transactionValue, gasTotalPrice, isGasSponsored = false, }) => React.useMemo(() => {
if (isGasSponsored) {
return transactionValue !== undefined ? transactionValue : BigInt(0);
}
if (gasTotalPrice !== undefined && transactionValue !== undefined) {
return gasTotalPrice + transactionValue;
}
return transactionValue || gasTotalPrice;
}, [gasTotalPrice, transactionValue, isGasSponsored]);
exports.useTransactionTotal = useTransactionTotal;