Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const { account, parentAccount, transaction, status } = this.props
if (!account) return null
const mainAccount = getMainAccount(account, parentAccount)
if (!mainAccount || !transaction) return null
const { estimatedFees, amount, totalSpent, warnings } = status
const feeTooHigh = warnings.feeTooHigh
const currency = getAccountCurrency(account)
const feesUnit = getAccountUnit(mainAccount)
const unit = getAccountUnit(account)
return (
const Row = ({ account, parentAccount, delegation }: Props) => {
const unit = getAccountUnit(account)
const currency = getAccountCurrency(account)
const mainAccount = getMainAccount(account, parentAccount)
const name = delegation.baker ? delegation.baker.name : shortAddressPreview(delegation.address)
const diffInDays = useMemo(() => moment().diff(delegation.operation.date, 'days'), [
delegation.operation.date,
])
const explorerView = getDefaultExplorerView(mainAccount.currency)
const bakerURL = getAddressExplorer(explorerView, delegation.address)
const txURL = getTransactionExplorer(explorerView, delegation.operation.hash)
const openBaker = useCallback(() => {
if (bakerURL) openURL(bakerURL)
}, [bakerURL])
const openTx = useCallback(() => {
onAcceptFees = async () => {
const { account, parentAccount, navigation } = this.props;
if (!account) return;
const transaction = navigation.getParam("transaction");
const bridge = getAccountBridge(account, parentAccount);
const mainAccount = getMainAccount(account, parentAccount);
await bridge.checkValidTransaction(mainAccount, transaction);
navigation.navigate("SendConnectDevice", {
accountId: account.id,
parentId: parentAccount && parentAccount.id,
transaction,
});
this.setState({ highFeesOpen: false });
};
render() {
const { navigation, account, parentAccount } = this.props;
if (!account) return null;
const operation = navigation.getParam("operation");
const mainAccount = getMainAccount(account, parentAccount);
const url = getTransactionExplorer(
getDefaultExplorerView(mainAccount.currency),
operation.hash,
);
return (
render() {
const { account, parentAccount } = this.props;
const mainAccount = getMainAccount(account, parentAccount);
const hasSubAccounts = Array.isArray(mainAccount.subAccounts);
const isToken =
listTokenTypesForCryptoCurrency(mainAccount.currency).length > 0;
return (
render() {
const { account, parentAccount, confirmationsNb, t, operation, marketIndicator } = this.props
const mainAccount = getMainAccount(account, parentAccount)
const amount = getOperationAmountNumber(operation)
const isNegative = amount.isNegative()
const isConfirmed =
(operation.blockHeight ? mainAccount.blockHeight - operation.blockHeight : 0) >
confirmationsNb
const marketColor = getMarketColor({
marketIndicator,
isNegative,
})
return (
export default function StepAccount({
token,
account,
parentAccount,
receiveTokenMode,
onChangeAccount,
onChangeToken,
}: StepProps) {
const mainAccount = account ? getMainAccount(account, parentAccount) : null
const error = account ? getReceiveFlowError(account, parentAccount) : null
return (
{mainAccount ? : null}
{error ? : null}
{receiveTokenMode && mainAccount ? (
) : (
)}
{receiveTokenMode && mainAccount ? (
render() {
const { account, parentAccount, openModal, t } = this.props
const mainAccount = getMainAccount(account, parentAccount)
let cap
try {
const bridge = getAccountBridge(account, parentAccount)
cap = bridge.getCapabilities(mainAccount)
} catch (e) {
return null
}
return (
{!isAccountEmpty(account) ? (
{cap.canSend ? (
<button> openModal(MODAL_SEND, { parentAccount, account })}</button>
export default ({
t,
account,
parentAccount,
openedFromAccount,
transaction,
onChangeAccount,
onChangeTransaction,
error,
status,
bridgePending,
}: StepProps) => {
if (!status) return null
const mainAccount = account ? getMainAccount(account, parentAccount) : null
return (
{mainAccount ? : null}
{error ? : null}
<label>{t('send.steps.details.selectAccountDebit')}</label>
render() {
const { t, account, parentAccount, status, bridgePending } = this.props
const { errors } = status
if (!account) return null
const mainAccount = getMainAccount(account, parentAccount)
const isTerminated = mainAccount.currency.terminated
const hasErrors = Object.keys(errors).length
const canNext = !bridgePending && !hasErrors && !isTerminated
return (
<button disabled="{!canNext}">
{t('common.continue')}
</button>
)
}
}