Skip to content

Commit

Permalink
refactor: 🚚 mv wallet.js to dash/network.js & local.js into `da…
Browse files Browse the repository at this point in the history
…sh/`
  • Loading branch information
jojobyte committed Sep 20, 2024
1 parent ebe9da5 commit fdd6887
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/components/balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
lit as html,
} from '../utils/generic.js'
import { envoy, } from '../utils/retort.js'
import { formatDash, } from '../utils/local.js'
import { updateAllFunds, } from '../utils/wallet.js'
import { formatDash, } from '../utils/dash/local.js'
import { updateAllFunds, } from '../utils/dash/network.js'

const initialState = {
id: 'Balance',
Expand Down
2 changes: 1 addition & 1 deletion src/components/contacts-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
sortContactsByAlias,
filterPairedContacts,
filterUnpairedContacts,
} from '../utils/local.js'
} from '../utils/dash/local.js'

let _handlers = []

Expand Down
2 changes: 1 addition & 1 deletion src/components/transactions-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '../utils/retort.js'
import {
sortTransactionsByTime,
} from '../utils/local.js'
} from '../utils/dash/local.js'

let _handlers = []

Expand Down
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
getUnusedChangeAddress,
loadWalletsForAlias,
getTransactionsByContactAlias,
} from './utils/local.js'
} from './utils/dash/local.js'

import {
createTx,
Expand All @@ -31,7 +31,7 @@ import {
store,
sendTx,
updateAllFunds,
} from './utils/wallet.js'
} from './utils/dash/network.js'

import {
decryptKeystore,
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/add-contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
generateContactPairingURI,
getUniqueAlias,
isUniqueAlias,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let addContactRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/edit-contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
parseAddressField,
getUniqueAlias,
isUniqueAlias,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let editContactRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/pair-qr.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { qrSvg } from '../utils/qr.js'

import {
generateContactPairingURI,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let pairQrRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/phrase-backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {

import {
phraseToEl,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let phraseBackupRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/phrase-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {

import {
verifyPhrase,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let phraseImportRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/request-qr.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
generatePaymentRequestURI,
getPartialHDPath,
getAddressIndexFromUsage,
} from '../utils/local.js'
} from '../utils/dash/local.js'

import { qrSvg } from '../utils/qr.js'

Expand Down
2 changes: 1 addition & 1 deletion src/rigs/send-confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

import {
formatDash,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let sendConfirmRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/send-or-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
roundUsing,
getPartialHDPath,
getAddressIndexFromUsage,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let sendOrReceiveRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/tx-info.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { lit as html } from '../utils/generic.js'
import {
formatDash,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let txInfoRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/wallet-decrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from '../utils/generic.js'
import {
initWallet,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let walletDecryptRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/wallet-encrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from '../utils/generic.js'
import {
initWallet,
} from '../utils/local.js'
} from '../utils/dash/local.js'

export let walletEncryptRig = (async function (globals) {
'use strict';
Expand Down
2 changes: 1 addition & 1 deletion src/state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '../utils/retort.js'
import {
store,
} from '../utils/wallet.js'
} from '../utils/dash/network.js'

export const appDialogs = envoy(
{
Expand Down
8 changes: 4 additions & 4 deletions src/utils/local.js → src/utils/dash/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ import {
DASH_URI_REGEX,
OIDC_CLAIMS,
SUPPORTED_CLAIMS,
} from './constants.js'
} from '../constants.js'

import {
DashHd,
DashTx,
DashPhrase,
} from '../imports.js'
} from '../../imports.js'

import {
DatabaseSetup,
findInStore,
getFilteredStoreLength,
getStoredItems,
loadStoreObject,
} from './db.js'
} from '../db.js'

import {
encryptData,
encryptKeystore,
} from './cryptic.js'
} from '../cryptic.js'

export const store = await DatabaseSetup()

Expand Down
6 changes: 3 additions & 3 deletions src/utils/wallet.js → src/utils/dash/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import {
DashTx,
DashSight,
DashSocket,
} from '../imports.js'
} from '../../imports.js'

import {
walletFunds,
} from '../state/index.js'
} from '../../state/index.js'

import {
DatabaseSetup,
loadStoreObject,
} from './db.js'
} from '../db.js'

import {
batchGenAccts,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/qr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

import { toDash } from './local.js'
import { toDash } from './dash/local.js'

/**
* @typedef QrOpts
Expand Down

0 comments on commit fdd6887

Please sign in to comment.