diff --git a/src/extensions/artcpaclub/src/esdt/EsdtTab.tsx b/src/extensions/artcpaclub/src/esdt/EsdtTab.tsx index 6726307..9659af1 100644 --- a/src/extensions/artcpaclub/src/esdt/EsdtTab.tsx +++ b/src/extensions/artcpaclub/src/esdt/EsdtTab.tsx @@ -61,7 +61,7 @@ export function EsdtTab() { )} <_Staker pool={selectedPool} className="mb-4" /> {!!selectedPoolOnChain && selectedPoolOnChain.user_stake_amount.isGreaterThan(0) && ( - <_Unstaker pool={selectedPool} className="mb-4" /> + <_Unstaker pool={selectedPool} poolOnChain={selectedPoolOnChain} className="mb-4" /> )} > ) diff --git a/src/extensions/artcpaclub/src/esdt/_Unstaker.tsx b/src/extensions/artcpaclub/src/esdt/_Unstaker.tsx index 2734871..46f1ffe 100644 --- a/src/extensions/artcpaclub/src/esdt/_Unstaker.tsx +++ b/src/extensions/artcpaclub/src/esdt/_Unstaker.tsx @@ -1,19 +1,21 @@ -import { EsdtPool } from '../types' import { Contracts } from '../contracts' import { Button, Input } from '@peerme/web-ui' import { sanitizeNumeric } from '@peerme/core-ts' +import { EsdtPool, EsdtPoolOnChain } from '../types' import React, { SyntheticEvent, useState } from 'react' import { useApp } from '../../../../shared/hooks/useApp' import { AppSection } from '../../../../shared/ui/elements' type Props = { pool: EsdtPool + poolOnChain: EsdtPoolOnChain className?: string } export function _Unstaker(props: Props) { const app = useApp() const [amount, setAmount] = useState('0') + const balanceDenominated = props.poolOnChain.user_stake_amount.shiftedBy(-props.pool.stake_token_decimal) const handleSubmit = (e: SyntheticEvent) => { e.preventDefault() @@ -43,17 +45,17 @@ export function _Unstaker(props: Props) { className="mb-2" autoComplete="off" /> - {/* TODO: implement once SC data available {+amount !== +scAmount && ( -