npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ckb-lumos/experiment-script-registry

v0.18.0-rc6

Published

This package provides functions to simplify the transaction assembling process.

Downloads

3

Readme

@ckb-lumos/experiment-tx-assembler

This package provides functions to simplify the transaction assembling process.

Usage

createScriptRegistry is for creating and managing script more easier.

import { createScriptRegistry } from "@ckb-lumos/experiment";
import { predefined } from "@ckb-lumos/config-manager";
const { AGGRON4 } = predefined;
const registry = createScriptRegistry(AGGRON4.SCRIPTS);
const secp256k1Script = registry.newScript("SECP256K1_BLAKE160", "0x");
const newRegistry = registry.extend({
  OMNI_LOCK: {
    CODE_HASH:
      "0x79f90bb5e892d80dd213439eeab551120eb417678824f282b4ffb5f21bad2e1e",
    HASH_TYPE: "type",
    TX_HASH:
      "0x9154df4f7336402114d04495175b37390ce86a4906d2d4001cf02c3e6d97f39c",
    INDEX: "0x0",
    DEP_TYPE: "code",
  },
});
const omniCellDep = newRegistry.newCellDep("OMNI_LOCK");

To create input or output cells, you can use createCell or createCellWithMinimalCapacity, you can also indicate type, data, block_hash, block_number of the cell.

  • Create an input cell:

    const lock: Script = {
      code_hash:
        "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
      args: "0x159890a7cacb44a95bef0743064433d763de229c",
      hash_type: "type",
    };
    const outPoint = {
      tx_hash:
        "0x942c23f72f0a2558a0029522b1dea2a7c64ba5196aed829ab6bfe4b6c3270958",
      index: "0x0",
    };
    const cell = createCell({
      lock: lock,
      capacity: BI.from("10000000000"),
      out_point: outPoint,
    });
  • Create an output cell:

    const lock: Script = {
      code_hash:
        "0x79f90bb5e892d80dd213439eeab551120eb417678824f282b4ffb5f21bad2e1e",
      hash_type: "type",
      args: "0x01a08bcc398854db4eaffd9c28b881c65f91e3a28b00",
    };
    const cell = createCell({ lock: lock, capacity: BI.from("10000000000") });
  • Create cell with minimal capacity:

    const lock: Script = {
      code_hash:
        "0x79f90bb5e892d80dd213439eeab551120eb417678824f282b4ffb5f21bad2e1e",
      hash_type: "type",
      args: "0x01a08bcc398854db4eaffd9c28b881c65f91e3a28b00",
    };
    const cell = createCellWithMinimalCapacity({ lock: lock });