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.tsgenerateAddress(seed, index, security = 2, checksum = false)for deterministic address generation: https://github.com/iotaledger/iota.lib.js/tree/next/packages/core#module_core.generateAddresstotal,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 TBDtransactionTrytes/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..asTransactionObjectsChanges being worked on:
validatorspackage.