@harmoniclabs/blockfrost-pluts
wrapper over the @blockfrost/blockfrost-js
SDK based on the @harmoniclabs/cardano-ledger-ts
types.
Installation
npm install @harmoniclabs/blockfrost-pluts
Quick start
Build you blockfrost provider and wrap it in a BlockfrostPluts
instance
import { BlockFrostAPI } from "@blockfrost/blockfrost-js";
import { BlockfrostPluts } from "@harmoniclabs/blockfrost-pluts";
const api = new BlockFrostAPI({
projectId: "YOUR API KEY HERE",
});
const provider = new BlockfrostPluts( api );
or directly pass the arguments to the wrapper class
import { BlockfrostPluts } from "@harmoniclabs/blockfrost-pluts";
const provider = new BlockfrostPluts({
projectId: "YOUR API KEY HERE",
});
Usage with @harmoniclabs/plu-ts
the provider can be used with the transaction builder to get a TxBuilderRunner
instance:
import { TxBuilder, defaultProtocolParameters } from "@harmoniclabs/plu-ts";
import { BlockfrostPluts } from "@harmoniclabs/blockfrost-pluts";
const txBuilder = new TxBuilder( defaultProtocolParameters );
const provider = new BlockfrostPluts({
projectId: "YOUR API KEY HERE",
});
const txRunner = txBuilder.runWithProvider( provider );
which you can use to easly build transacitons
const tx = await txRunner
.addInput(
contractUtxo,
"40"
)
.attachValidator( contractSource )
.payTo( myAddress, 5_000_000 )
.build()