Skip to content

v3.0.1

Compare
Choose a tag to compare
@abuiles abuiles released this 13 Sep 14:55
· 340 commits to master since this release
b8c7524

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.