Getting Started
Configuration
npm install @deltadefi-protocol/[email protected]import { BlockfrostProvider, MeshWallet } from "@meshsdk/core";
import { KhorConstants, SwapIntentTx } from "@deltadefi-protocol/khor";
// Setup
const blockfrost = new BlockfrostProvider("YOUR_BLOCKFROST_API_KEY");
const wallet = new MeshWallet({
networkId: 0,
fetcher: blockfrost,
submitter: blockfrost,
key: { type: "mnemonic", words: "your 24 words here".split(" ") },
});
// Get all required variables
const userAddress = await wallet.getChangeAddress();
const utxos = await wallet.getUtxos();
const collateral = (await wallet.getCollateral())[0];
// Create swap intent
const config = new KhorConstants("preprod");
const swapIntentTx = new SwapIntentTx(config);Create Swap Intent
Cancel Swap Intent
Open Source
Supported Pairs
Last updated