-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
A-commonArea - Common codeArea - Common codeC-trackingCategory - Tracking issueCategory - Tracking issueD-mediumDifficulty - MediumDifficulty - MediumP-mediumPriority - MediumPriority - Medium
Milestone
Description
Hi, I've compiled a list of most significant changes in iota.js so far + short term roadmap. I suggest to discuss new specs and build a cross platform v1 API. Current v1-alpha API is still like fresh clay, we should form it for production readiness with precise decisions.
Other than that please ping here or DM me for anything you will need.
Changes in v1.0.0-alpha: (modifié)
sendTransfer()was removed -prepareTransfers()+sendTrytes()should be used instead, with intermediate step of persisting transaction trytes. This extra step should be mentioned in docs for all methods that publish transactions (like in this case here: https://github.com/iotaledger/iota.lib.js/tree/next/packages/core#module_core.storeAndBroadcast)prepareTransfers()works offline: https://github.com/iotaledger/iota.lib.js/blob/next/packages/core/test/integration/prepareTransfers.test.ts#L46getBundlesFromAddresses()is deprecated and will probably be removed in next major version. - Reason for deprecating is poor performance; number of bundle instances can be any, and fetching all bundles lazily is preferred for most use cases. I think thatfindTransactions()on addresses is fine for most cases.getTransfers()is deprecated - callsgetBundlesFromAddressestransfersfield ofgetAccountData()is deprecated - Reason for this is internalgetBundlesFromAddressescall to fetch full bundles.transactionsfield was added as replacement which contains transactions (instead of bundles) as returned byfindTransactions()on account addresses. (https://github.com/iotaledger/iota.lib.js/blob/next/packages/core/src/createGetAccountData.ts#L154)isPromotable(tail)ofdevelopbranch is now renamed tocheckConsistency(tail)isPromotable(tail, depth)is now expressed as function ofcheckConsistency(tail)&depth, because promotion becomes ineffective after a few milestones. Internally uses a time heuristic: https://github.com/iotaledger/iota.lib.js/blob/next/packages/core/src/createIsPromotable.ts- Added
generateAddress(seed, index, security = 2, checksum = false)for deterministic address generation: https://github.com/iotaledger/iota.lib.js/tree/next/packages/core#module_core.generateAddress total,returnAll&checksumoptions ofgetNewAddressare deprecated - Reason is responsibility overload & goal is to havegetNewAddress()do only one thing, what the name says. Next step is to have it work with local store and accept seed as the only argument.wereAddressesSpentFrom()is no longer exported - We don't want devs to build solutions around a method which might be infeasible in IoT environment. It's still being used under the hood in the following methods, until local store solution is implemented:getNewAddress(): https://github.com/iotaledger/iota.lib.js/blob/next/packages/core/src/createGetNewAddress.ts#L23getAccountData(): https://github.com/iotaledger/iota.lib.js/blob/next/packages/core/src/createGetAccountData.ts#L168 & https://github.com/iotaledger/iota.lib.js/blob/next/packages/core/src/createGetAccountData.ts#L179getInputs(): need to be added - issue TBD- Modularized from api, utils, crypto, multisig & valid to packages seen here: https://www.npmjs.com/org/iota - Everything is in iota.js monorepo, tested in integration and released with an even version across packages. Monorepos are really cool in our case! Please review, it's important to have high cohesion & low coupling! (would be nice to look for some good static code analysis tools too...)
- Fixed extended ascii issue in converter: UTF-8 compatibility iotaledger-archive/iota.js#243
- Refactored bundle module: https://github.com/iotaledger/iota.lib.js/tree/next/packages/bundle#module_bundle
- Renamed
transactionTrytes/Object()to*as*TransactionTrytes/Object(). -asTransactionTrytes()accepts string or array of transaction trytes. Also addedasTransactionObject*s* = hashes => trytes => objectswhich doesn't recalculate known hashes: https://github.com/iotaledger/iota.lib.js/tree/next/packages/transaction-converter#module_transaction-converter..asTransactionObjects - New padding utils: https://github.com/iotaledger/iota.lib.js/blob/next/packages/pad/src/index.ts
- Emphasis on simple tests. (modifié)
Changes being worked on:
- Address validation strategy in relation to checksum: Address validation strategy iotaledger-archive/iota.js#245 - This requires refactoring of
validatorspackage. - Request timeouts: Implement timeout (typescript) iotaledger-archive/iota.js#204
- Functional (end-to-end) tests: issue TBD
- Conventional commits & automatic releases: issue TBD
- Errors with standard codes & messages: issue TBD
- More enhancements soon:trade-mark:...
Metadata
Metadata
Assignees
Labels
A-commonArea - Common codeArea - Common codeC-trackingCategory - Tracking issueCategory - Tracking issueD-mediumDifficulty - MediumDifficulty - MediumP-mediumPriority - MediumPriority - Medium