
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
casper-cep78-js-client
Advanced tools
This package was created to help JS/TS users with the cep-78-enhanced-nft and is published in npm
as the casper-cep78-js-client. It was built on top of the casper-js-sdk.
Users can treat this package as a deploy builder for all of these possible interactions:
NamedKeys
To install, run:
npm i -S casper-cep78-js-client
Import the contract in your code:
import { CEP78Client } from 'casper-cep78-js-client'
If you want to install it, look at the install
method and all of the possible configuration options (InstallArgs
).
If you want to start working with a previously installed contract, use the setContractHash(contractHash)
method.
NOTE: Since version 1.3
both casper-js-sdk
and @make-software/ces-js-parser
are peer dependencies. If you are using npm version <7
you may need to install both dependencies manually.
As a good starting point, you can look into the examples/
directory to see the most common usage scenarios (install.ts
and usage.ts
). You can install the contract and run the example scenario by running the npm run example:install
and npm run example:usage
. You will need to specify environment variables, preferebly in a client-js/.env
file. Here are some example values for the environment variables that need to be specified:
NODE_URL=http://localhost:11101/rpc
NETWORK_NAME=casper-net-1
MASTER_KEY_PAIR_PATH=/Users/someuser/.casper/casper-node/utils/nctl/assets/net-1/faucet
USER1_KEY_PAIR_PATH=/Users/someuser/.casper/casper-node/utils/nctl/assets/net-1/users/user-1
As CEP-78 1.2 supports two events modes - CEP47
and CES
we have two parsers as a part of this SDK.
import { EventStream, EventName } from 'casper-js-sdk';
import { CEP47EventParserFactory, CEP47Events } from 'casper-cep78-js-sdk';
const cep47EventParser = CEP47EventParserFactory({
contractPackageHash,
eventNames: [
CEP47Events.Mint,
CEP47Events.Transfer,
CEP47Events.Burn
],
});
const es = new EventStream(EVENT_STREAM_ADDRESS);
es.subscribe(EventName.DeployProcessed, async (event) => {
const parsedEvents = cep47EventParser(event);
if (parsedEvents?.success) {
console.log(parsedEvents.data);
}
});
es.start();
import { EventStream, EventName, CasperServiceByJsonRPC } from 'casper-js-sdk';
import { CESEventParserFactory } from 'casper-cep78-js-sdk';
const casperClient = new CasperServiceByJsonRPC(NODE_URL);
const cesEventParser = CESEventParserFactory({
contractHashes: [contractHash],
casperClient,
});
const es = new EventStream(EVENT_STREAM_ADDRESS);
es.subscribe(EventName.DeployProcessed, async (event) => {
const parsedEvents = await cesEventParser(event);
if (parsedEvents?.success) {
console.log(parsedEvents.data);
}
});
es.start();
FAQs
CEP78 Enhanced NFT JS Client
The npm package casper-cep78-js-client receives a total of 22 weekly downloads. As such, casper-cep78-js-client popularity was classified as not popular.
We found that casper-cep78-js-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.