Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
aaitor committed Oct 14, 2022
1 parent 9beafd5 commit 6be16cc
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const cmdHandler = async (
argv: any,
requiresAccount = true
) => {
// eslint-disable-next-line prefer-const
let { verbose, network, accountIndex } = argv

let config: ConfigEntry
Expand Down
3 changes: 1 addition & 2 deletions src/commands/accounts/list.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {
Nevermined,
Account,
Nft721,
Accounts
Nft721
} from '@nevermined-io/nevermined-sdk-js'
import chalk from 'chalk'
import { Logger } from 'log4js'
Expand Down
8 changes: 0 additions & 8 deletions src/commands/assets/getAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@ import { StatusCodes } from '../../utils'
import chalk from 'chalk'
import readline from 'readline'
import { Logger } from 'log4js'
import { Dtp } from '@nevermined-io/nevermined-sdk-dtp/dist/Dtp'
import { makeKeyTransfer } from '@nevermined-io/nevermined-sdk-dtp/dist/KeyTransfer'
import { CryptoConfig } from '@nevermined-io/nevermined-sdk-dtp/dist/utils'
import { ExecutionOutput } from '../../models/ExecutionOutput'
import { ConfigEntry } from '../../models/ConfigDefinition'
import {
generateIntantiableConfigFromConfig,
InstantiableConfig
} from '@nevermined-io/nevermined-sdk-js/dist/node/Instantiable.abstract'

readline.createInterface({
input: process.stdin,
Expand Down Expand Up @@ -51,7 +44,6 @@ export const getAsset = async (
chalk.dim(`Downloading asset: ${did} with agreement id: ${agreementId}`)
)

let results
// if (password) {
// const dtp = await Dtp.getInstance(instanceConfig, cryptoConfig)
// const key = await dtp.consumeProof(agreementId, did, account)
Expand Down
3 changes: 0 additions & 3 deletions src/commands/assets/registerAsset.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Account, Nevermined } from '@nevermined-io/nevermined-sdk-js'
import {
Constants,
StatusCodes,
printTokenBanner,
loadToken,
Expand Down Expand Up @@ -50,8 +49,6 @@ export const registerAsset = async (
: BigNumber.from(0)

if (!metadata) {
const decimals =
token !== null ? await token.decimals() : Constants.ETHDecimals

logger.debug(`Using Price ${argv.price}`)

Expand Down
2 changes: 0 additions & 2 deletions src/commands/network/networkStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ExecutionOutput } from '../../models/ExecutionOutput'
import { PlatformTechStatus } from '@nevermined-io/nevermined-sdk-js/dist/node/nevermined/Versions'
import chalk from 'chalk'
import { ConfigEntry } from '../../models/ConfigDefinition'
import BigNumber from '@nevermined-io/nevermined-sdk-js/dist/node/utils/BigNumber'

export const networkStatus = async (
nvm: Nevermined,
Expand Down Expand Up @@ -40,7 +39,6 @@ export const networkStatus = async (
try {
const configContract = loadNeverminedConfigContract(configEntry)
const networkFee = await configContract.getMarketplaceFee()
const networkFeeFormatted = getFeesFromBigNumber(networkFee)
logger.info(
chalk.dim(
` Network Fee: ${chalk.yellow(getFeesFromBigNumber(networkFee))} %`
Expand Down
5 changes: 0 additions & 5 deletions src/commands/nfts/createNft.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Account, Nevermined, Nft721 } from '@nevermined-io/nevermined-sdk-js'
import {
Constants,
StatusCodes,
printNftTokenBanner,
loadToken,
Expand All @@ -21,7 +20,6 @@ import {
getRoyaltyAttributes,
RoyaltyKind
} from '@nevermined-io/nevermined-sdk-js/dist/node/nevermined/Assets'
import { ethers } from 'ethers'

export const createNft = async (
nvm: Nevermined,
Expand Down Expand Up @@ -63,9 +61,6 @@ export const createNft = async (
}
}

const decimals =
token !== null ? await token.decimals() : Constants.ETHDecimals

logger.trace(`new BigNumber ${BigNumber.from(argv.price)}`)
logger.trace(`DDO Price: ${ddoPrice}`)
logger.trace(`to Fixed: ${ddoPrice.toString()}`)
Expand Down
7 changes: 1 addition & 6 deletions src/commands/nfts/showNft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {
StatusCodes,
printNftTokenBanner,
getNFTAddressFromInput,
loadToken,
getFeesFromBigNumber
loadToken
} from '../../utils'
import { ExecutionOutput } from '../../models/ExecutionOutput'
import { Account } from '@nevermined-io/nevermined-sdk-js'
Expand All @@ -17,10 +16,6 @@ import {
import { Logger } from 'log4js'
import { ConfigEntry } from '../../models/ConfigDefinition'
import BigNumber from '@nevermined-io/nevermined-sdk-js/dist/node/utils/BigNumber'
import {
getRoyaltyAttributes,
RoyaltyKind
} from '@nevermined-io/nevermined-sdk-js/dist/node/nevermined/Assets'

export const showNft = async (
nvm: Nevermined,
Expand Down
2 changes: 0 additions & 2 deletions src/commands/nfts/transferNft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ export const transferNft = async (

const symbol = token !== null ? await token.symbol() : config.nativeToken

const serviceInDDO = 'nft-sales'

const price = BigNumber.formatUnits(
getAssetRewardsFromDDOByService(ddo, 'nft-sales').getTotalPrice(),
decimals
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,6 @@ export const getJsonLoggerConfig = (): Configuration => {
}
}

export const getFeesFromBigNumber = (fees: BigNumber): String => {
export const getFeesFromBigNumber = (fees: BigNumber): string => {
return (fees.toNumber() / 10000).toPrecision(2).toString()
}

0 comments on commit 6be16cc

Please sign in to comment.