Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
968e42b
fix(ui): :construction: improve send precision
jojobyte Feb 28, 2024
235d082
chore(ui): :coffin: improve send precision
jojobyte Feb 28, 2024
4e6d1b2
style(ui): :lipstick: improve the look of send & request & confirmati…
jojobyte Feb 29, 2024
c7d2244
refactor: :recycle: disable utils `batchAddressGenerate` & move walle…
jojobyte Feb 29, 2024
d901c7b
chore: :label: add usageIndex to SeedWallet type
jojobyte Feb 29, 2024
4479901
style(ui): :lipstick: add gap styles
jojobyte Feb 29, 2024
45a4119
feat(ui): :lipstick: improve layout of confirm & tx info dialogs
jojobyte Feb 29, 2024
e1a097e
refactor: :recycle: include id in dialog form slug
jojobyte Feb 29, 2024
e73a682
feat(data): :sparkles: batch generate change addresses
jojobyte Feb 29, 2024
cfde8b7
style(ui): :lipstick: add styles for generating addrs
jojobyte Mar 3, 2024
df1f252
refactor: :coffin: comment out and remove code
jojobyte Mar 3, 2024
7121ea9
feat(data): :sparkles: add helper utils and constants
jojobyte Mar 3, 2024
d5d5a0b
fix(ui): :bug: batch addr gen fixes & move receive address generation
jojobyte Mar 3, 2024
ea384b7
docs: :memo: mv txs view from roadmap stage 3 to stage 2
jojobyte Mar 7, 2024
6c0e088
fix(ui): :bug: use addressIndex from store for request QR dialog
jojobyte Mar 7, 2024
3b9b651
fix(data): :bug: usageIndex for bulk generated addresses
jojobyte Mar 7, 2024
1918893
fix(data): :bug: get unused change address on send
jojobyte Mar 7, 2024
16f47fd
fix(data): :bug: skip contact if state.to is undefined
jojobyte Mar 7, 2024
6a4c3a4
fix(ui): :bug: make sure request qr ui updates
jojobyte Mar 7, 2024
e6d1f9f
fix(data): :bug: use wallet addressIndex from store in receive dialog
jojobyte Mar 7, 2024
172a1dd
chore: :recycle: improve readability
jojobyte Mar 7, 2024
952e759
style(ui): :lipstick: change footer into two lines
jojobyte Mar 15, 2024
1110e86
feat(data): :sparkles: add `createSignal` util
jojobyte Mar 15, 2024
5111142
fix(data): :sparkles: pre-generate accounts on import
jojobyte Mar 15, 2024
652cee0
style(ui): :lipstick: fix css scrollbar corner
jojobyte Mar 16, 2024
619c71c
style(ui): :lipstick: add css helper classes for max height & overflow
jojobyte Mar 16, 2024
a10036f
refactor: :coffin: remove unused imports from tx-info
jojobyte Mar 16, 2024
871836f
fix(data): :construction: partial fix for importing old out of date f…
jojobyte Mar 16, 2024
93a06de
feat(ui): :goal_net: add `showErrorDialog` to display errors
jojobyte Mar 16, 2024
ae18dc9
docs(ui): :lipstick: change receive button to `Edit Amount or Contact`
jojobyte Mar 16, 2024
668bad3
fix(ui): :lipstick: pretty format dash values for #55
jojobyte Mar 16, 2024
a11cd36
style(ui): :lipstick: update favicon png & ico
jojobyte Mar 21, 2024
a36d4d3
style(ui): :lipstick: change significant digit split index
jojobyte Mar 21, 2024
633bc7c
feat(ui): :lipstick: wrong file type error for keystore/backup import
jojobyte Mar 21, 2024
55f6926
fix: :bug: add dashwallet.js draftTx to fix full send
jojobyte Mar 21, 2024
f49f053
fix(ui): :lipstick: showErrorDialog on sendTx failure
jojobyte Mar 23, 2024
5e9f05d
fix(ui): :bug: updateAllFunds not clearing insight balances
jojobyte Mar 23, 2024
f6cc9a8
ci: :construction_worker: display URL for github action deployments
jojobyte Mar 23, 2024
f22d168
ci: :construction_worker: cleanup gitub action
jojobyte Mar 23, 2024
e8c971b
ci: :construction_worker: actions checkout & node
jojobyte Mar 23, 2024
5bdd031
style(ui): :lipstick: new helpers & btns
jojobyte Apr 6, 2024
e340065
refactor(data): :recycle: move show error to seperate file
jojobyte Apr 6, 2024
b1b8169
refactor(data): :recycle: add contact tabbing between (un)/paired
jojobyte Apr 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions .github/workflows/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ process.removeAllListeners('warning');
process.on('SIGTERM', () => process.exit());
process.on('SIGINT', () => process.exit());

const { BASE_HREF = '' } = process.env
const {
BASE_HREF = '',
GITHUB_REF_NAME = '',
PAGE_URL = '',
} = process.env

import {
readFile, writeFile, readdir,
Expand All @@ -17,6 +21,15 @@ const PUB = 'public/'
const DIST = './dist/'
const FAV = 'favicon.png'

let footerReplacer = []

if (GITHUB_REF_NAME && !['master','main'].includes(GITHUB_REF_NAME)) {
footerReplacer.push([
'<a target="_blank" href="https://github.com/dashhive/wallet-ui">Source Code</a>',
`<a target="_blank" href="https://github.com/dashhive/wallet-ui/tree/${GITHUB_REF_NAME}">Source Code</a> for <br/><output>${GITHUB_REF_NAME}</output>`,
])
}

const walk = async (
dirPath,
filterFiles = f => f
Expand Down Expand Up @@ -54,7 +67,8 @@ const fixOrCopy = async (
[
'../public/',
'../public/'
]
],
...footerReplacer,
],
}
) => {
Expand All @@ -81,7 +95,21 @@ const fixOrCopy = async (
}

let filterDirs = file => {
return !file?.name?.includes('.git') && !file?.name?.includes('dist/')
return ![
'.env',
'.git',
'.vscode',
'.nvmrc',
'.jshintrc',
'.github',
'.prettierignore',
'.prettierrc.json',
'jsconfig.json',
'package-lock.json',
'package.json',
'dist/',
].includes(file?.name)
// return !file?.name?.includes('.git') && !file?.name?.includes('dist/')
}

try {
Expand Down Expand Up @@ -127,6 +155,7 @@ try {
'../public/',
'./public/'
],
...footerReplacer,
],
js: [
[
Expand All @@ -141,6 +170,7 @@ try {
'/src/manifest.webmanifest',
'/manifest.webmanifest',
],
...footerReplacer,
],
json: [
[
Expand All @@ -162,6 +192,9 @@ try {
'prepare files for deployment',
allFiles
);
// console.log(
// PAGE_URL,
// );
} catch (err) {
console.error(err);
}
24 changes: 14 additions & 10 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,37 @@ concurrency:

jobs:
deploy:
# outputs:
# branch: ${{ steps.clean_branch.outputs.branch }}
environment:
name: wallet
url: ${{ vars.WEBSITE }}
url: ${{ steps.clean_branch.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
check-latest: true
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run deploy
- name: Get clean branch name
id: clean_branch
env:
REPLACE_SLASH: "/"
WITH_DASH: "-"
BASE_DOMAIN: ${{ vars.BASE_DOMAIN }}
run: |
export BRANCH=${GITHUB_REF_NAME//$REPLACE_SLASH/$WITH_DASH}
export PAGE_URL=https://$BRANCH.$BASE_DOMAIN/
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
- name: Deploy via rsync
uses: bnnanet/github-actions-rsync@master
echo "page_url=$PAGE_URL" >> "$GITHUB_OUTPUT"
echo "name=page_url::$PAGE_URL" >> $GITHUB_OUTPUT
- run: npm run deploy
id: run_deploy
env:
PAGE_URL: ${{ steps.clean_branch.outputs.page_url }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_OUTPUT: $GITHUB_OUTPUT
- uses: bnnanet/github-actions-rsync@master
with:
RSYNC_OPTIONS: -avzr --delete --exclude '.git*'
RSYNC_SOURCE: ./dist/
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ See the [Stage 2](/../../milestone/2) milestone
- [ ] Contact/Payment Share Features
- [ ] SMS (sms:)
- [ ] Email (mailto:)
- [ ] Transactions view
- [ ] Table with filter/sort
- [ ] Select & Copy as CSV
- [ ] View & manage addresses associated with Wallet
- [ ] Coin Control
- [ ] Set Fund Denomination for Send & Request payments
Expand Down
24 changes: 8 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"dashphrase": "^1.4.0",
"dashsight": "^1.6.1",
"dashtx": "^0.13.2",
"dashwallet": "^0.6.1",
"dashwallet": "^0.7.0-1",
"html5-qrcode": "^2.3.8",
"idb": "^8.0.0",
"localforage": "^1.10.0",
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
Binary file modified public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 11 additions & 32 deletions src/components/balance.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { lit as html } from '../helpers/lit.js'
import { fixedDash, envoy, } from '../helpers/utils.js'
import { envoy, formatDash, } from '../helpers/utils.js'
import { updateAllFunds, } from '../helpers/wallet.js'

const initialState = {
Expand All @@ -14,6 +14,7 @@ const initialState = {
addr: null,
maxlen: 10,
fract: 8,
sigsplit: 3,
render(
renderState = {},
position = 'afterbegin',
Expand All @@ -23,41 +24,19 @@ const initialState = {
<figcaption>${state.name} ${state.id}</figcaption>
`,
content: state => {
let funds = 0
let balance = `${funds}`

if (state.walletFunds.balance) {
funds += state.walletFunds.balance
balance = fixedDash(funds, state.fract)
// TODO FIX: does not support large balances

// console.log('balance fixedDash', balance, balance.length)

let [fundsInt,fundsFract] = balance.split('.')
state.maxlen -= fundsInt.length

let fundsFraction = fundsFract?.substring(
0, Math.min(Math.max(0, state.maxlen), 3)
)

let fundsRemainder = fundsFract?.substring(
fundsFraction.length,
Math.max(0, state.maxlen)
)

balance = html`${
fundsInt
}<sub><span>.${
fundsFraction
}</span>${
fundsRemainder
}</sub>`
}
let balance = formatDash(
state.walletFunds.balance,
{
fract: state.fract,
maxlen: state.maxlen,
sigsplit: state.sigsplit,
}
)

return html`
${state.header(state)}

<div title="${funds}">
<div title="${state.walletFunds.balance}">
<svg width="32" height="33" viewBox="0 0 32 33">
<use xlink:href="#icon-dash-mark"></use>
</svg>
Expand Down
Loading