Skip to content

Commit

Permalink
format resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ttwishing committed Oct 2, 2024
1 parent a858804 commit 313e39d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/pages/resources/resources.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {derived, Readable} from 'svelte/store'
import {API, Asset} from '@greymass/eosio'
import {Resources, SampleUsage, PowerUpState, RAMState, REXState} from '@greymass/eosio-resources'
import {activeBlockchain} from '~/store'
import { derived, Readable } from 'svelte/store'
import { API, Asset } from '@greymass/eosio'
import { Resources, SampleUsage, PowerUpState, RAMState, REXState } from '@greymass/eosio-resources'
import { activeBlockchain } from '~/store'

import {getClient} from '../../api-client'
import {ChainConfig, ChainFeatures, resourceFeatures} from '~/config'
import { getClient } from '../../api-client'
import { ChainConfig, ChainFeatures, resourceFeatures } from '~/config'

const getResourceClient = (chain: ChainConfig) => {
const api = getClient(chain)
const options: any = {api}
const options: any = { api }
if (chain.resourceSampleAccount) {
options.sampleAccount = chain.resourceSampleAccount
}
Expand Down Expand Up @@ -127,7 +127,7 @@ export const cpuStakingPrice = derived(
[activeBlockchain, msToRent, sampleUsage],
([$activeBlockchain, $msToRent, $sampleUsage]) => {
if ($msToRent && $sampleUsage) {
const {account} = $sampleUsage
const { account } = $sampleUsage
const cpu_weight = Number(account.total_resources.cpu_weight.units)
const cpu_limit = Number(account.cpu_limit.max.value)
let price = cpu_weight / cpu_limit
Expand All @@ -145,7 +145,7 @@ export const netStakingPrice = derived(
[activeBlockchain, msToRent, sampleUsage],
([$activeBlockchain, $msToRent, $sampleUsage]) => {
if ($msToRent && $sampleUsage) {
const {account} = $sampleUsage
const { account } = $sampleUsage
const net_weight = Number(account.total_resources.net_weight.units)
const net_limit = Number(account.net_limit.max.value)
let price = net_weight / net_limit
Expand Down

0 comments on commit 313e39d

Please sign in to comment.