UNPKG

edge-core-js

Version:

Edge account & wallet management library

46 lines (27 loc) 599 B
import { syncStorageWallet } from './storage-actions' import { getStorageWalletDisklet, getStorageWalletLocalDisklet } from './storage-selectors' export function makeStorageWalletApi( ai, walletInfo ) { const { id, type, keys } = walletInfo return { // Broken-out key info: id, type, keys, // Folders: get disklet() { return getStorageWalletDisklet(ai.props.state, id) }, get localDisklet() { return getStorageWalletLocalDisklet(ai.props.state, id) }, async sync() { await syncStorageWallet(ai, id) } } }