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

msafe

v0.0.1

Published

The CLI interface for interacting Momentum Safe. This repository majorly has two components:

Downloads

4

Readme

CLI-MSafe

The CLI interface for interacting Momentum Safe. This repository majorly has two components:

  1. The CLI interface for users to interact with Momentum Safe.
  2. Scripts to interact with the Momentum Safe.
  3. The underlying typescript SDK of for smart contract interaction.

1. Installation

Clone the repository and change directory:

git clone [email protected]:Momentum-Safe/CLI-MSafe.git
cd CLI-MSafe

Install dependencies:

yarn install

Install Aptos CLI tools.

The CLI tool is used for setting up the initial account. Install with github release or compile from source.

Initialize a wallet

Use aptos CLI to setup the wallet and environment.

aptos init 

Choose all default settings to create a new wallet with the devnet endpoint settings.

The command will create a config file .aptos/config.yaml under the current directory, which includes the wallet information as well as the network endpoint message.

2. Interactive CLI

Start Momentum Safe CLI

yarn start

And follow the instructions to operate with momemtum safe.

Interact with Momentum Safe

Please check Gitbook for handbook of interactive CLI tools.

The following features are currently supported by Momentum Safe:

  1. Momentum Safe creation
  2. APT coin transfer
  3. View momentum safe owned by the account
  4. View pending transactions of the momentum safe
  5. Coin registry.
  6. Coin transfer of any coin type.
  7. Custom MOVE module interaction (For simple types).
  8. MOVE module publish.
  9. Revert transaction.

We will add more features shortly:

  1. Add coin decimal and bigint
  2. Add more custom ABI, struct, e.t.c.

3. Running script using SDK

Several scripts are provided as example to interact with SDK.

  1. scripts/deploy.ts Can be used to deploy a MOVE module with momentum safe.
  2. scripts/entry-function.ts An example script to interact with an entry function.

3.1. deploy.ts

deploy.ts is the script used to deploy the move module.

You will need to finish the following items as the prerequisite before calling this script.

  1. You have ready have a momentum safe wallet created with the account in config.yaml in step 1.
  2. Deployer address is replaced with the momentum safe address in Move.toml
  3. MOVE module is compiled with flag --save-metadata

After compiled the move module, call

yarn run deploy --msafe ${MSAFE_ADDRESS} --move-dir ./tests/move

There is some test contracts in folder ./test/move that you may try it out.

Action:			Module publish
Verify Hash:		0x80e3c2779b714ab355ecc6fc4c8db221e770adb127a18ebfb150f11d9ca65edc
Deployer:		0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0
Package:		MomentumSafe-test
Upgrade Policy:		compatible
Upgrade Number:		0
Source Digest:		BC36D67FB3DE5ABD5541BCAF633C28E1EFECF0DDDED20544296DCA98F744DE82
Modules:		0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::message
			0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::test_coin
Dependency:		0x0000000000000000000000000000000000000000000000000000000000000001::AptosFramework
			0x0000000000000000000000000000000000000000000000000000000000000001::AptosStdlib
			0x0000000000000000000000000000000000000000000000000000000000000001::MoveStdlib
Sender:			0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0
Sequence Number:	8
Expiration:		Thu Oct 13 2022 18:00:20 GMT-0700 (Pacific Daylight Time)
Gas Price:		100
Max Gas:		5000

--------------------

Do you confirm with the transaction? [Y/n]

The script will load compiled move modules from move directory and print message about the code deployment.

After confirm, the transaction to initiate the multi-sig transaction request will be confirmed on blockchain.

3.2 Call an entry function

Run an entry function using scripts/entry-function.ts.

In the script, a function calling the test script is called.

0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::message::set_message

You may change the entry function, type arguments and arguments as you want for your own usage.

Run script with yarn

yarn run entry-function --msafe ${MSAFE_ADDR}
Action:			Entry function
Call function:		0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::message::set_message
Arguments (1):		[string]	Hello momentum safe
Sender:			0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0
Sequence Number:	10
Expiration:		Thu Oct 13 2022 20:45:55 GMT-0700 (Pacific Daylight Time)
Gas Price:		100
Max Gas:		5000

--------------------

Do you confirm with the transaction? [Y/n]

After confirming the entry function, a transaction to initiate a transaction from momentum safe wallet calling message::set_message is submitted on chain.