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

@taikai/dappkit-launchpad

v0.0.19

Published

@taikai/dappkit tool to parse Solidity ABI into typescript

Downloads

25

Readme

dappkit-launchpad

Solidity to Typescript transpiler for @taikai/dappkit with templates

$ npm install -g @taikai/dappkit-launchpad

Usage

$ dlt -f path/to/your/contract/abi.json

CLI usage

All non provided cli options will be overriden by their counterpart value on the json configuration, and if none exists a default will be used.

  -f, --file                File to parse                             [required]
  -i, --interfaceDir        directory to output interface file into
  -c, --classDir            directory to output class file into
  -n, --name                change the file name
  -I, --overwriteInterface  allow interface file overwrite
  -C, --overwriteClass      allow class file overwrite
  -e, --eventsDir           directory to output events to
  -E, --overwriteEvent      allow event interface file overwrite (events will be
                             spawned on same folder as interface)
  -j, --json                json configuration file
  -p, --asPackage           outputs imports from dappkit istead of source (deprecated)
  -h, --help                Show help                                 

Example

Given the ERC20 standard from @openzepplin and its compilation json, ERC20.json, issuing

$ dk-transpile -f ERC20.json -i ./ -c ./ -e ./ -IEC

Will output,

$ dk-transpile -f ERC20.json -i ./interfaces -c ./classes -e ./events -IEC

Created /interfaces/erc20.ts
Created /classes/erc20.ts
Created /events/erc20-events.ts

These proxies can then be customizable and will eventually look like the one provided by @taikai/dappkit.

Configuration

All the cli options are available as a json configuration,

|option||description| |-|-|-| |asPackage||asPackage is a backwards compatability flag that should always be true and will be deprecated.| |templatesDir||source for the hbs templates. If you provide a custom path, you'll need to provide ALL templates| |paths||paths works when asPackage=false and is a backwards compatability flag, it can be ignored as it will be deprecated| |paths|base|dappkit base folder| |paths|abi|where all abis are| |paths|interfaces|where interfaces are imported from/exported to| |paths|methods|where the methods are imported from/exported to| |paths|events|where the events are imported from/exported to| |output||Output controls where the generated files will be created; Leaving it empty the file will be outputted to the terminal| |output|interfaceDir|folder for interfaces output| |output|classDir|folder for model extension output| |output|eventsDir|folder for events output| |overwrite||Which files can be overwritten if already exist| |overwrite|interface|| |overwrite|class|| |overwrite|events||

default configuration (config.mjs)
{
  paths: {                            // import paths, ignore if asPackage: true
    base: "@base",                    // @taikai/dappkit base folder
    abi: "@abi",                      // @taikai/dappkit abi folder        | will be rewritten if asPackage = true, path.dirname(--file)
    interfaces: "@interfaces",        // @taikai/dappkit interfaces folder | will be rewritten if asPackage = true, output.interfaceDir
    methods: "@methods",              // @taikai/dappkit methods folder    | will be rewritten if asPackage = true, output.interfaceDir
    events: "@events"                 // @taikai/dappkit events folder     | will be rewritten if asPackage = true, output.eventsDir
  },
  output: {                           // where to output each file (empty defaults to console.log)
    interfaceDir: "",
    classDir: "",
    eventsDir: ""
  },
  overwrite: {                        // which files can be overwritten
    interface: false,
    class: false,
    events: false
  },
  asPackage: true,                    // used internally, "false" will use imports from @taikai/dappkit source
  templatesDir: "./src/templates"     // where to get the handlebars templates from, you'll need to provide ALL files
}

Templates

Templates can essentially be used to complement customizations in a standard way, and by providing the templatesDir option on the configuration file along with all the handlebars templates this is easily achievable.