0.1.11 • Published 4 months ago

@harmoniclabs/blockfrost-pluts v0.1.11

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

@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", // see: https://blockfrost.io
});

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", // see: https://blockfrost.io
});

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", // see: https://blockfrost.io
});

const txRunner = txBuilder.runWithProvider( provider );

which you can use to easly build transacitons

const tx = await txRunner
    .addInput(
        contractUtxo,
        "40" // redeemer ( CBOR for empty bytestring )
    )
    .attachValidator( contractSource ) // `Script` instance
    .payTo( myAddress, 5_000_000 ) // send 5 ADA
    .build()
0.1.10

4 months ago

0.1.11

4 months ago

0.1.11-dev0

4 months ago

0.1.11-dev1

4 months ago

0.1.11-dev2

4 months ago

0.1.11-dev3

4 months ago

0.1.8

4 months ago

0.1.7

4 months ago

0.1.9

4 months ago

0.1.4

4 months ago

0.1.6

4 months ago

0.1.5

4 months ago

0.1.2

9 months ago

0.1.1

11 months ago

0.1.3

8 months ago

0.1.0

12 months ago