0.0.27 • Published 2 days ago

@polymedia/commando v0.0.27

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 days ago

Polymedia Commando

Sui command line tools to help with Sui airdrops (send coins to many addresses), gather data from different sources (Sui RPCs, Indexer.xyz, Suiscan), and more.

Polymedia Commando

Installation

Clone and install the repo:

git clone https://github.com/juzybits/polymedia-commando.git
cd polymedia-commando
pnpm install

Create .env and add your Indexer.xyz credentials if you'll fetch NFT data:

cp .env.example .env

Usage

Tools can be used as follows:

pnpm commando COMMAND [OPTIONS]

See all available tools with pnpm commando -h:

POLYMEDIA COMMANDO

Usage:
  pnpm commando COMMAND [OPTIONS]

Available Commands:
  - bulksender: Send Coin<T> to a list of addresses
  - find-coin-balances: Find how much Coin<T> is owned by each address
  - find-coin-holders: Find Coin<T> holders using the Suiscan API
  - find-last-txn: Find the last transaction for each Sui address
  - find-nft-holders: Find NFT holders for a set of collections via Indexer.xyz
  - find-nfts: Find all NFTs and their owners for a set of collections via Indexer.xyz
  - get-balance: Get the total Coin<T> balance owned by one or more addresses.
  - send-coin-amount: Send an amount of Coin<T> to a recipient
  - test-rpc-endpoints: Test the latency of various Sui RPC endpoints
  ...

For more information about a command:
  pnpm commando COMMAND -h

Node.js utilities

The @polymedia/commando NPM package provides some utility functions for Node.js projects.

Usage

Add the package to your project:

pnpm add @polymedia/commando

Use it in your code, for example:

import { getActiveEnv } from '@polymedia/commando';

Sui functions

  • function getActiveAddressKeypair - Build a Ed25519Keypair object for the current active address by loading the secret key from ~/.sui/sui_config/sui.keystore.
  • function getActiveEnv - Get the active Sui environment from sui client active-env.
  • function setupSuiTransaction - Initialize objects to execute Sui transactions blocks using the current Sui active network and address.
  • function executeSuiTransaction - Execute a transaction block with showEffects and showObjectChanges set to true.

File functions

  • fileExists - Check if a file exists in the filesystem.
  • getFileName - Extract the file name from a module URL, without path or extension.
  • readCsvFile - Read a CSV file and parse each line into an object.
  • readJsonFile - Read a JSON file and parse its contents into an object.
  • writeCsvFile - Write objects into a CSV file.
  • writeJsonFile - Write an object's JSON representation into a file.
  • writeTextFile - Write a string into a file.

Misc functions

  • parseArguments - Parse command line arguments and show usage instructions.
  • promptUser - Display a query to the user and wait for their input. Return true if the user enters y.
0.0.27

2 days ago

0.0.26

15 days ago

0.0.25

1 month ago

0.0.24

2 months ago

0.0.23

2 months ago

0.0.22

2 months ago

0.0.20

2 months ago

0.0.21

2 months ago

0.0.18

2 months ago

0.0.19

2 months ago

0.0.17

3 months ago

0.0.16

3 months ago

0.0.15

3 months ago

0.0.14

3 months ago

0.0.13

3 months ago

0.0.11

3 months ago

0.0.12

3 months ago

0.0.10

4 months ago

0.0.9

4 months ago

0.0.8

4 months ago

0.0.7

4 months ago

0.0.6

4 months ago

0.0.5

4 months ago

0.0.4

4 months ago

0.0.3

4 months ago

0.0.2

4 months ago

0.0.1

4 months ago