Sundae-SDK is a TypeScript library for building transactions for the SundaeSwap DEX on Cardano.
⚠️ This is a pre-release package: until we release v1.0.0, the interface may change as we identify the optimal usage patterns.
First, install the relevant packages:
$ yarn add lucid-cardano @sundaeswap/sdk-core
Then start using the SDK:
import { SundaeSDK } from "@sundaeswap/sdk-core";
import {
TxBuilderLucid,
ProviderSundaeSwap
} from "@sundaeswap/sdk-core/extensions";
const txBuilder = new TxBuilderLucid(
{
wallet: "eternl",
network: "preview",
provider: "blockfrost",
blockfrost: {
url: "https://cardano-preview.blockfrost.io/api/v0",
apiKey: "YOUR_API_KEY"
}
},
new ProviderSundaeSwap("preview")
);
const sdk: SundaeSDK = new SundaeSDK(txBuilder);
const txHash = await sdk.swap( /** ... */ ).then(({ submit }) => submit());
Documentation is available at https://sundaeswap-finance.github.io/sundae-sdk/, but it is very much a work-in-progress. Feel free to open a discussion with feedback, or submit a pull request!
Want to contribute? See CONTRIBUTING.md to know how.