Comments (8)
We can't repro. Could you please provide a test case?
from iota.js.
Make sure you pass total
in options
. If total
is not passed to getNewAddress()
it will call findTransactions()
and increment the index until a new unused address is found.
from iota.js.
@chrisdukakis Are you sure about that? If I pass total
along with index
in options
, it returns multiple addresses (ignores index
). Please try it yourself.
@th0br0 Check the following codes. I have 13 used addresses. This code always returns the next unused address even if I set index
as less than 13. For the index value >= 13
looks fine.
`var iota = new IOTA({
'host': 'http://service.iotasupport.com',
'port': 14265
});
var seed = 'YOUR SEED';
var options = {
checksum: true,
security: 2,
index: 3
}
iota.api.getNewAddress( seed, options, function( error, result ) {
console.log(result);
// Address:
});`
from iota.js.
@th0br0 You didn't yet repro the issue?!
from iota.js.
I can't close, but:
// Case 1: total
//
// If total number of addresses to generate is supplied, simply generate
// and return the list of all addresses
// Case 2: no total provided
//
// Continue calling findTransactions to see if address was already created
// if null, return list of addresses
Please read the documentation.
getNewAddress will return the next unused address.
This is no bug. If you think it is, please provide a repro case.
from iota.js.
@th0br0 OMG! Who wrote this library?!
I was talking about index
, not total
! Please read my posts carefully. I've already provided a case.
If you don't know, getNewAddress also returns specific address based on index
, not just next unused address!
from iota.js.
You have not provided a test or repro case. You have provided a code snippet copied from the documentation. That is something quite different.
getNewAddress
will only return either:
- a set number of addresses from index to index+total
- all addresses that are checked for past transactions starting at index
- the first address after or at index without past transactions
If the address at index
has been used, you will only see it returned if you either specify total
or provide returnAll
.
from iota.js.
Wow! I've lost my words!
It's really the most sophisticated function out there. Probably, we'll be able to transfer IOTA using this function in the future. (Because a function should do more than what it says in the documentation of course.)
I am closing this thread anyway. It seems like IOTA libraries are too perfect to have any bug in them.
from iota.js.
Related Issues (20)
- Implement Basic output syntactic validation
- Implement Alias output syntactic validation
- Implement Foundry output syntactic validation
- Implement Nft output syntactic validation
- Implement Block syntactic validation HOT 1
- Implement Block Inputs syntactic validation
- Implement Block Unlocks syntactic validation
- [Request] Support different coin types in address generation HOT 1
- Native tokens are serialized as empty array and burnt after calling buildTransactionPayload
- [Task]: Extract common validation rule logic for output types
- [Task]: Change validation flow to fail-fast
- [Task]: Review Tutorial part 1 and merge
- [Task] Publish new iotajs and types versions
- [Task] Merge outstanding PRs (dependabot + tutorials) HOT 1
- Does not work in ARM machines HOT 2
- Problem while building HOT 2
- Problem building pow-wasm HOT 1
- Time unlock condition with MAX(uint32) either not sent properly to Node or Explorer showing incorrect date at the limits
- Can HexEncodedString be included in @iota/types? HOT 1
- PowNeon dependencies failing the build 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 iota.js.