Skip to content

Releases: spiceai/spice.js

v0.3

13 Mar 09:09
36f8462
Compare
Choose a tag to compare

Spice.xyz Node.js SDK v0.3

This release adds support for improved Prices APIs supporting spot/latest and historical prices for pair across Coinbase, Gemini, and tracked by Coinmarket Cap.

New functions available on the client are:

  • getPrice()
  • getPrices()

For full documentation see docs.spice.xyz.

What's Changed

New Contributors

Full Changelog: v0.2.0...v0.3.0

v0.2

18 Jan 12:42
0ab3b79
Compare
Choose a tag to compare

Spice.xyz Node.js SDK v0.2

This release adds support for the new Spice.xyz Async Query API!

New functions available on the client are:

  • queryAsync()
  • getQueryResults()
  • getQueryResultsAll()
  • getQueryResultsFromNotification()

For full documentation see docs.spice.xyz.

What's Changed

New Contributors

Full Changelog: v0.1.0...v0.2.0

v0.1.0

20 Jun 06:07
cf42889
Compare
Choose a tag to compare

Initial release of the Spice Node.js SDK.

Installation

npm install @spiceai/spice or yarn add @spiceai/spice

Usage

Arrow Query

import { SpiceClient } from "@spiceai/spice";

const main = async () => {
  const spiceClient = new SpiceClient("API_KEY");
  const table = await spiceClient.query(
    'SELECT number, "timestamp", gas_used FROM eth.recent_blocks LIMIT 10'
  );
  console.table(table.toArray());
};

main();

Querying data is done through a SpiceClient object that initializes the connection with Spice endpoint. SpiceClient has the following arguments:

  • apiKey (string, required): API key to authenticate with the endpoint.
  • url (string, optional): URL of the endpoint to use (default: flight.spiceai.io:443)

Documentation

Check out our API documentation to learn more about how to use the Node.js SDK.