import BigNumber from "bignumber.js"; import { ProtoNFT, ProtoNFTRaw } from "@ledgerhq/types-live"; export function toNFTRaw({ id, tokenId, amount, contract, standard, currencyId, metadata, }: ProtoNFT): ProtoNFTRaw { return { id, tokenId, amount: amount.toFixed(), contract, standard, currencyId, metadata, }; } export function fromNFTRaw({ id, tokenId, amount, contract, standard, currencyId, metadata, }: ProtoNFTRaw): ProtoNFT { return { id, tokenId, amount: new BigNumber(amount), contract, standard, currencyId, metadata, }; }