Comments (10)
I would say the current codebase should be refactored to make this smooth. Today you could probably hack thing around like
const { init } = require("@ledgerhq/xpub-scan/lib/helpers");
const checkBalance = require("@ledgerhq/xpub-scan/lib/actions/checkBalance");
async function main() {
const xpub =
"tpubDCR8dij5wujL48XPKtQATpKUEQkJL2VkuKrtypXXba7hWSjW8uziMYVud6HHT99egY4BG1WUJ3z8hcDvdwrWGvTuk8AfbqF6euw1F2gRvUj";
const silent = false;
const quiet = false;
const currency = "BTC";
const testnet = undefined;
const derivationMode = undefined;
init(xpub, silent, quiet, currency, testnet, derivationMode);
const res = await checkBalance.run(xpub);
console.log(res);
}
main()
from xpub-scan.
@sambP Yes, this function returns all addresses with at least one operation. Therefore, you will have all past movements. Xpub Scan systematically retrieves all active addresses, that is addresses that had been used and addresses that are currently being used.
from xpub-scan.
I would vote to have this feature as well
from xpub-scan.
This is a great idea. It will require some refactoring. We will definitely take a look at this, @sambP.
from xpub-scan.
Thanks @meriadec, works so far. The only problem is, that I have to scan multiple pubs in parallel, it would be nice to get an instance of init() somehow.
Sounds great, @glethuillier. I know everyone hates time estimates, but would it be possible to give me one? :) We need this feature for our product and I have to decide if I just wait or try to build a solution for myself.
from xpub-scan.
I checked the code, running checkBalance in parellel with different xpubs seems to work fine, as long as they can share the global configuration. We use only btc xpubs, so no problems for us and no time estimates anymore needed :)
Looking forward for an official solution.
from xpub-scan.
@meriadec sorry but one question a little bit offtopic, do I get with the checkBalance.run function also addresses which are currently empty but hold assets in the past? I would need them to find all movements.
from xpub-scan.
I think @glethuillier should be able to answer as he's the author of the lib, I would rather not saying sh*t 😄
To answer your previous questions about how the code will evolve in the future, I don't think we can give you satisfying answers for now. This tool has been initially built for internal QA purposes first, although we already considered splitting in into more manageable & documented pieces (e.g: balance module, comparison module..) but it will probably take time.
But feedbacks always appreciated :)
from xpub-scan.
A PR dedicated to this topic from @pglushchenko-ledger has just been merged: #75
from xpub-scan.
Here is the documentation associated with this feature.
This issue can be closed.
from xpub-scan.
Related Issues (20)
- Scan also for unused addresses HOT 1
- Add unit tests
- Add coins and networks HOT 1
- Generalize support for external providers
- Make Xpub Scan more easily configurable HOT 2
- xpub-scab for BCH throws an error HOT 1
- What are the xpub-scan limitations?
- xpub-scan is crashing with high number of address gaps HOT 1
- Scanning fails due to axios minor update breaking api HOT 3
- Make Xpub Scan more user-friendly
- Custom derivation paths
- General: Block explorer api is no longer working HOT 1
- Strengthen Privacy
- Sent Transactions: Show All Addresses Belonging to the Xpub
- Handle Aggregated Operations
- Comparisons Feature: Option to Show Diffs Only
- Import Type B JSONs
- Optimize the Comparisons Based on Type A CSVs
- HTML Reports: Add Pagination HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xpub-scan.