Skip to main content

Install

npm install @joltz/bridge-sdk

Create a Quote

Estimates costs & provides the steps needed to bridge.
import { Client } from "@joltz/bridge-sdk";

const client = new Client(wallet); // Wallet must be an `ethers.wallet`.

const quote = await client.quote({ 
	inputChainID: 1, // 1 = ethereum
	inputToken: "0x0000000000000000000000000000000000000000", // 0x000.. = ETH
	amount: (0.0001 * 1e18).toString(), // 0.0001 ETH
	address: wallet.address, // Sending address (used for refunds)
	sparkAddress: "sp1pgss8m8gqwmrem7zef7h5yusdznxmrrm46vjnaq0tfr0ljanmcaw8z9qtxsja9" // Recipient address
});

Execute a quote

Execute the steps provided by the quote.
// Execute the quote, returns the txhash from input transaction.
const txhash = await client.exec(quote);

Query a quote

Returns the quote details and status.
const status = await client.queryQuote(quote.id);

List supported currencies

const currencies = await client.currencies();