Skip to content

Commit

Permalink
feat(data): 🚧 experiment with dashsight.getAllTxs
Browse files Browse the repository at this point in the history
  • Loading branch information
jojobyte committed Apr 11, 2024
1 parent b2ecab5 commit 8a8c0da
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
5 changes: 2 additions & 3 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 @@ -42,7 +42,7 @@
"dashhd": "^3.3.0",
"dashkeys": "^1.1.0",
"dashphrase": "^1.4.0",
"dashsight": "^1.6.1",
"dashsight": "dashhive/DashSight.js#feat/bulk-txs",
"dashtx": "^0.13.2",
"dashwallet": "^0.7.0-1",
"html5-qrcode": "^2.3.8",
Expand Down
14 changes: 14 additions & 0 deletions src/helpers/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,11 @@ export async function updateAllFunds(wallet, walletFunds) {
)

let balances = await dashsight.getInstantBalances(addrKeys)
let txs = await dashsight.getAllTxs(
addrKeys
)

console.log('getAllTxs', txs)

if (balances.length >= 0) {
walletFunds.balance = funds
Expand Down Expand Up @@ -1270,6 +1275,7 @@ export async function deriveTxWallet(
let cachedAddrs = {}
let privateKeys = {}
let coreUtxos
let txs
let tmpWallet

if (Array.isArray(fundAddrs) && fundAddrs.length > 0) {
Expand All @@ -1296,6 +1302,9 @@ export async function deriveTxWallet(
coreUtxos = await dashsight.getMultiCoreUtxos(
Object.keys(privateKeys)
)
txs = await dashsight.getAllTxs(
Object.keys(privateKeys)
)
} else {
tmpWallet = await deriveWalletData(
fromWallet.recoveryPhrase,
Expand All @@ -1315,8 +1324,13 @@ export async function deriveTxWallet(
coreUtxos = await dashsight.getCoreUtxos(
tmpWallet.address
)
txs = await dashsight.getAllTxs(
[tmpWallet.address]
)
}

console.log('getAllTxs', txs)

return {
privateKeys,
cachedAddrs,
Expand Down
4 changes: 4 additions & 0 deletions src/rigs/send-confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ export let sendConfirmRig = (async function (globals) {
...appState.sentTransactions,
[txRes.txid]: state.tx,
}
store.transactions.setItem(
txRes.txid,
state.tx
)
console.log(
'===sentTransactions===',
appState?.sentTransactions
Expand Down

0 comments on commit 8a8c0da

Please sign in to comment.