1.2.0 • Published 6 months ago
@pact-toolbox/prelude v1.2.0
@pact-toolbox/preludes
Streamlines the downloading and deployment of standard Kadena contracts.
Table of Contents
Introduction
The @pact-toolbox/preludes module provides utilities for managing the downloading and deployment of standard Kadena contracts, known as preludes. This package aims to simplify the process of handling contract dependencies and ensuring they are properly deployed to a Kadena network.
Installation
To install the package, run:
npm install @pact-toolbox/preludesUsage
Downloading Preludes
You can download the necessary preludes by using the downloadPreludes function. This function resolves and downloads all specified preludes based on the provided configuration.
Example:
import { downloadAllPreludes } from "@pact-toolbox/preludes";
import { PactToolboxClient } from "@pact-toolbox/runtime";
const myPactToolboxClient = new PactToolboxClient();
const config = {
contractsDir: "./contracts",
preludes: ["kadena/chainweb", "kadena/marmalade"],
client: myPactToolboxClient,
};
await downloadAllPreludes(config);Deploying Preludes
After downloading the preludes, you can deploy them using the deployPreludes function. This function ensures that all resolved preludes are deployed to the Kadena network.
Example:
import { deployPreludes } from "@pact-toolbox/preludes";
import { PactToolboxClient } from "@pact-toolbox/runtime";
const myPactToolboxClient = new PactToolboxClient();
const config = {
contractsDir: "./contracts",
preludes: ["kadena/chainweb", "kadena/marmalade"],
client: myPactToolboxClient,
};
await deployPreludes(config);