v3.0.1
Add
- Add join method to call builder. (#436). Given the following code:
const operations = await server
.operations()
.limit(50)
.join("transactions") // <------- new option
.call();
const transactions = await Promise.all(
operations.records.map(r => r.transaction())
);
console.log("transaction", transactions.length)
Without join
, the following snippet will make 50
request to horizon:
const transactions = await Promise.all(
operations.records.map(r => r.transaction())
);
But since we are using join
, calling record.transaction()
will return a promise which resolves immediately with the payload included in the response.
We kept the API as a promise so you can use the same syntax regardless if using join
or not.
Although you can call join
in any builder, right now it will only work for the payments
and operations
end-points and the only valid argument is transactions
.