How to use the @ledgerhq/live-common/lib/account.getAccountCurrency function in @ledgerhq/live-common

To help you get started, we’ve selected a few @ledgerhq/live-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LedgerHQ / ledger-live-desktop / src / components / SelectAccount / index.js View on Github external
({
    account,
    isValue,
    disabled,
  }: {
    account: AccountLike,
    isValue?: boolean,
    disabled?: boolean,
  }) => {
    const currency = getAccountCurrency(account)
    const unit = getAccountUnit(account)
    const name = getAccountName(account)

    return (
      
        {!isValue && account.type === 'TokenAccount' ? tokenTick : null}
        
        
          {name}
github LedgerHQ / ledger-live-desktop / src / components / modals / Send / AccountFooter.js View on Github external
const AccountFooter = ({ account, parentAccount, status }: Props) => {
  const currency = getAccountCurrency(account)
  const mainAccount = getMainAccount(account, parentAccount)
  const accountUnit = getAccountUnit(mainAccount)
  return (
    
      
      
        <label>
          
        </label>
        {accountUnit &amp;&amp; (
github LedgerHQ / ledger-live-desktop / src / components / AccountsPage / AccountGridItem / Header.js View on Github external
render() {
    const { account, parentAccount } = this.props
    const currency = getAccountCurrency(account)
    const unit = getAccountUnit(account)
    const name = getAccountName(account)

    let title
    switch (account.type) {
      case 'Account':
      case 'AccountChild':
        title = currency.name
        break
      case 'TokenAccount':
        title = 'token'
        break
      default:
        title = ''
    }
github LedgerHQ / ledger-live-mobile / src / components / OperationRow.js View on Github external
render() {
    const {
      operation,
      account,
      parentAccount,
      multipleAccounts,
      isLast,
    } = this.props;
    const amount = getOperationAmountNumber(operation);
    const valueColor = amount.isNegative() ? colors.darkBlue : colors.green;
    const currency = getAccountCurrency(account);
    const unit = getAccountUnit(account);

    const text = ;

    const isOptimistic = operation.blockHeight === null;
    const spinner = (
github LedgerHQ / ledger-live-desktop / src / components / OperationsList / Operation.js View on Github external
render() {
    const { account, parentAccount, t, operation, withAccount, text } = this.props
    const isOptimistic = operation.blockHeight === null
    const currency = getAccountCurrency(account)
    const unit = getAccountUnit(account)
    return (
      
        
        
        {withAccount &amp;&amp; }
        
        
      
    )
  }
github LedgerHQ / ledger-live-desktop / src / reducers / accounts.js View on Github external
    [...new Set(flattenAccounts(accounts).map(a => getAccountCurrency(a)))].sort((a, b) =>
      a.name.localeCompare(b.name),
github LedgerHQ / ledger-live-desktop / src / components / AccountPage / index.js View on Github external
account,
  parentAccount,
  t,
  counterValue,
  selectedTimeRange,
  countervalueFirst,
  setCountervalueFirst,
}: Props) =&gt; {
  const mainAccount = account ? getMainAccount(account, parentAccount) : null
  const bgColor = useTheme('colors.palette.background.paper')

  if (!account || !mainAccount) {
    return 
  }

  const currency = getAccountCurrency(account)
  const color = getCurrencyColor(currency, bgColor)

  return (
github LedgerHQ / ledger-live-mobile / src / reducers / accounts.js View on Github external
    uniq(flattenAccounts(accounts).map(a => getAccountCurrency(a))).sort(
      (a, b) => a.name.localeCompare(b.name),
github LedgerHQ / ledger-live-mobile / src / screens / ReceiveFunds / 03-Confirmation.js View on Github external
render() {
    const {
      account,
      parentAccount,
      navigation,
      readOnlyModeEnabled,
    } = this.props;
    if (!account) return null;
    const { verified, error, isModalOpened, onModalHide, zoom } = this.state;
    const { width } = getWindowDimensions();
    const unsafe = !navigation.getParam("deviceId");
    const allowNavigation = navigation.getParam("allowNavigation");
    const QRSize = Math.round(width / 1.8 - 16);
    const mainAccount = getMainAccount(account, parentAccount);
    const currency = getAccountCurrency(account);

    return (
      
        
        {allowNavigation ? null : (
          &lt;&gt;
            
            
          
        )}
github LedgerHQ / ledger-live-desktop / src / bridge / BridgeSyncContext.js View on Github external
subAccounts.forEach(a => {
              track('SyncSuccessToken', {
                tokenId: getAccountCurrency(a).id,
                tokenTicker: getAccountCurrency(a).ticker,
                operationsLength: a.operations.length,
                parentCurrencyName: account.currency.name,
                parentDerivationMode: account.derivationMode,
              })
            })
          }