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

neo-smacco

v1.12.0

Published

SMart ACcount COmposer

Downloads

34

Readme

smacco

SMACCO - SMart ACcount COmposer

This project aims to easily generate "smart accounts" for holding assets based on different (and combined) features:

  • public/private key validation
  • MultiSig
  • timelock
  • Asset-specific behavior (only allowing withdraws for specific assets, for example)

That will help NEO users to easily create and manage safe account addresses. Initially, only json interface will be provided to allow C# code generation (that will become AVM). After that, visual interfaces can help the design process, keeping in mind this is NOT a tool intended for developers, but to general public.

How to use it

Install on web browser

<script src="https://unpkg.com/neo-smacco/dist/bundle.js"></script>
Smacco = smacco.Smacco;

Install on npm

npm install neo-smacco

const Smacco = require('smacco').Smacco;

For Developers

Tests

npm test

Build Webpack

npm run build

New minor version

npm version minor

Push and Publish

git push origin master --tags

npm publish

Examples

Checking Simple Signature

{
  "standard": "smacco-1.0",
  "input_type" : "single",
  "pubkey_list" : ["036245f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fb"],
  "rule" : {
    "rule_type": "ALLOW_IF",
    "condition" : {
      "condition_type" : "CHECKSIG"
    }
  }
}

Checking Multiple Signatures (2/3 multisig)

{
 "standard": "smacco-1.0",
 "input_type" : "array",
 "pubkey_list" : ["036245f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fb",
   "0303897394935bb5418b1c1c4cf35513e276c6bd313ddd1330f113ec3dc34fbd0d", "02e2baf21e36df2007189d05b9e682f4192a101dcdf07eed7d6313625a930874b4"],
 "rule" : {
   "rule_type": "ALLOW_IF",
   "condition" : {
     "condition_type" : "CHECKMULTISIG",
     "minimum_required" : "2"
   },
 }
}

Time Locking funds (until timestamp 1536896190)

{
  "standard": "smacco-1.0",
  "input_type" : "single",
  "pubkey_list" : ["036245f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fb"],
  "rules" : [
    {
      "rule_type": "DENY_IF",
      "condition" : {
        "condition_type" : "TIMESTAMP_LESS",
        "timestamp" : "1536896190",
      },
    },
    {
      "rule_type": "ALLOW_IF",
      "condition" : {
        "condition_type" : "CHECKSIG"
      },
    },
  ]
}

Complex logic -- Charity Donations Template

This example is inspired by a conversation with @lerider and @vncoelho (https://github.com/neo-project/proposals/issues/53), the idea is to demonstrate the capability of easily handling different logic for different assets (Neo/Gas/...).

{
  "standard": "smacco-1.0",
  "input_type" : "single",
  "pubkey_list" : ["031a6c6fbbdf02ca351745fa86b9ba5a9452d785ac4f7fc2b7548ca2a46c4fcf4a", "036245f426b4522e8a2901be6ccc1f71e37dc376726cc6665d80c5997e240568fb"],
  "rules" : [
    {
      "rule_type": "ALLOW_IF",
      "condition" : {
        "condition_type" : "CHECKSIG",
        "pubkey" : "0"
      },
    },
    {
      "rule_type": "ALLOW_IF",
      "condition" : {
        "condition_type" : "AND",
        "conditions" : [
          {
            "condition_type" : "CHECKSIG",
            "pubkey" : "1"
          },
          {
            "condition_type" : "OR",
            "conditions" : [
              {
                "condition_type" : "AND",
                "conditions" : [
                  {
                    "condition_type" : "SELF_TRANSFER"
                  },
                  {
                    "condition_type" : "ONLY_NEO"
                  }
                ]
              },
              {
                "condition_type" : "ONLY_GAS"
              }
            ]
          },
        ]
      },
    },
  ],
  "default_rule" : "DENY_ALL"
}

License

Copyleft 2018

MIT license