Skip to content

Commit

Permalink
Delete the rate plugin type
Browse files Browse the repository at this point in the history
  • Loading branch information
swansontec authored and paullinator committed Dec 12, 2023
1 parent c859e2a commit 1be57cb
Show file tree
Hide file tree
Showing 18 changed files with 8 additions and 1,256 deletions.
7 changes: 0 additions & 7 deletions src/core/account/account-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
EdgeLobby,
EdgePendingVoucher,
EdgePluginMap,
EdgeRateCache,
EdgeResult,
EdgeSwapConfig,
EdgeSwapQuote,
Expand All @@ -30,7 +29,6 @@ import {
} from '../../types/types'
import { base58 } from '../../util/encoding'
import { getPublicWalletInfo } from '../currency/wallet/currency-wallet-pixie'
import { makeExchangeCache } from '../exchange/exchange-api'
import {
finishWalletCreation,
makeCurrencyWalletKeys,
Expand Down Expand Up @@ -91,7 +89,6 @@ export function makeAccountApi(ai: ApiInput, accountId: string): EdgeAccount {
}

// Specialty API's:
const rateCache = makeExchangeCache(ai)
const dataStore = makeDataStoreApi(ai, accountId)
const storageWalletApi = makeStorageWalletApi(ai, accountWalletInfo)

Expand Down Expand Up @@ -187,10 +184,6 @@ export function makeAccountApi(ai: ApiInput, accountId: string): EdgeAccount {
return swapConfigs
},

get rateCache(): EdgeRateCache {
return rateCache
},

get dataStore(): EdgeDataStore {
return dataStore
},
Expand Down
13 changes: 1 addition & 12 deletions src/core/account/account-pixie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
stopUpdates,
TamePixie
} from 'redux-pixies'
import { close, emit, update } from 'yaob'
import { close, update } from 'yaob'

import {
asMaybeOtpError,
Expand All @@ -17,7 +17,6 @@ import {
} from '../../types/types'
import { makePeriodicTask } from '../../util/periodic-task'
import { snooze } from '../../util/snooze'
import { ExchangeState } from '../exchange/exchange-reducer'
import { syncLogin } from '../login/login'
import { waitForPlugins } from '../plugins/plugins-selectors'
import { RootProps, toApiInput } from '../root-pixie'
Expand Down Expand Up @@ -61,7 +60,6 @@ const accountPixie: TamePixie<AccountProps> = combinePixies({
update(accountApi)
close(accountApi)
close(accountApi.dataStore)
close(accountApi.rateCache)
const { currencyConfig, swapConfig } = accountApi
for (const pluginId of Object.keys(currencyConfig)) {
close(currencyConfig[pluginId])
Expand Down Expand Up @@ -202,7 +200,6 @@ const accountPixie: TamePixie<AccountProps> = combinePixies({
watcher(input: AccountInput) {
let lastState: AccountState | undefined
// let lastWallets
let lastExchangeState: ExchangeState | undefined

return () => {
const { accountState, accountOutput } = input.props
Expand Down Expand Up @@ -234,14 +231,6 @@ const accountPixie: TamePixie<AccountProps> = combinePixies({
// lastWallets = input.props.output.currency.wallets
// if (accountOutput.accountApi != null) update(accountOutput.accountApi)
// }

// Exchange:
if (lastExchangeState !== input.props.state.exchangeCache) {
lastExchangeState = input.props.state.exchangeCache
if (accountApi != null) {
emit(accountApi.rateCache, 'update', undefined)
}
}
}
},

Expand Down
13 changes: 0 additions & 13 deletions src/core/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
EdgeCurrencyTools,
EdgeLogSettings,
EdgePluginMap,
EdgeRateHint,
EdgeStakingStatus,
EdgeToken,
EdgeTokenMap,
Expand All @@ -19,7 +18,6 @@ import {
TxFileNames,
TxidHashes
} from './currency/wallet/currency-wallet-reducer'
import { ExchangePair } from './exchange/exchange-reducer'
import { LoginStash } from './login/login-stash'
import { LoginType } from './login/login-types'
import {
Expand Down Expand Up @@ -327,11 +325,6 @@ export type RootAction =
walletInfo: EdgeWalletInfo
}
}
| {
// Fired when we fetch exchange pairs from some server.
type: 'EXCHANGE_PAIRS_FETCHED'
payload: ExchangePair[]
}
| {
// Initializes the redux store on context creation.
type: 'INIT'
Expand All @@ -345,7 +338,6 @@ export type RootAction =
deviceDescription: string | null
hideKeys: boolean
logSettings: EdgeLogSettings
rateHintCache: EdgeRateHint[]
pluginsInit: EdgeCorePluginsInit
skipBlockHeight: boolean
stashes: LoginStash[]
Expand Down Expand Up @@ -404,10 +396,5 @@ export type RootAction =
// Dummy action to propagate `next` changes.
type: 'UPDATE_NEXT'
}
| {
// Fires when there are new rate hints to add to the cache
type: 'UPDATE_RATE_HINT_CACHE'
payload: { rateHintCache: EdgeRateHint[] }
}

export type Dispatch = (action: RootAction) => RootAction
2 changes: 1 addition & 1 deletion src/core/currency/wallet/currency-wallet-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ export async function setupNewTxMetadata(
const creationDate = Date.now() / 1000

// Calculate the exchange rate:
const nativeAmount = tx.nativeAmount
const { nativeAmount } = tx

// Set up metadata:
const metadata: DiskMetadata =
Expand Down
56 changes: 0 additions & 56 deletions src/core/exchange/exchange-api.ts

This file was deleted.

Loading

0 comments on commit 1be57cb

Please sign in to comment.