A collection of CLI tools and utilities for account and banking operations.
- Command-line interface tools for common operations.
- Account and bank search utilities.
- Collection of debugging and testing scripts.
- Node, with support for crypto. If this is false, upgrade Node versions:
console.log("Environment supports crypto: ", !!global.crypto?.subtle);
- pnpm (
npm install -g pnpm@latest-10
) - (Optional) A wallet (with SOL) at ~/keys/wallet.json
Copy the env.template file to .env
file and populate missing data.
Description:
Retrieves account details by providing the account public key.
Usage:
pnpm accounts:get --account <ACCOUNT_PUBLIC_KEY>
Options:
-a, --account
Account public key (string, required)
Description:
Retrieves details for all accounts associated with a wallet.
Usage:
pnpm accounts:get-all --wallet <WALLET_PUBLIC_KEY>
Options:
-w, --wallet
Wallet public key (string, required)
Description:
Searches for users based on assets, liabilities, and balance criteria.
Usage:
pnpm accounts:find-users [options]
Options:
--assets
Comma-separated list of token symbols to search for assets.--liabs
Comma-separated list of token symbols to search for liabilities.-m, --min-balance
Minimum balance to return (number, default: 0.1)-l, --limit
Maximum number of accounts to return (number, default: 1)
Description:
Caches account data for quicker access.
Usage:
pnpm accounts:cache
Options:
- No options available.
Description:
Retrieves bank details using either the bank's public key or a token symbol.
Usage:
pnpm banks:get [options]
Options:
-a, --address
Bank public key (string)-s, --symbol
Token symbol (e.g., 'USDC') (string)
Description:
Retrieves details for all banks.
Usage:
pnpm banks:get-all
Options:
- No options available.
Description:
Retrieves accounts associated with a specific bank.
Usage:
pnpm banks:get-accounts [options]
Options:
-a, --address
Bank public key (string)-s, --symbol
Token symbol (e.g., 'USDC') (string)-l, --limit
Limit the number of accounts to return (number, default: 5)-m, --min-balance
Minimum balance to return (number, default: 0.01)-t, --type
Type of accounts to return
Description
Runs simulations for Switchboard price feeds in an infinite loop and saves simulation results in the swb-sim-output-{DateTime}.csv
file.
Usage
pnpm ts-node scripts/simulate-swb-feed.ts <SWB_FEEDS_FILE> <CROSSBAR_URL> [all]
Parameters:
SWB_FEEDS_FILE
(required) The KVP file with Switchboard price feed addresses. The swb-feeds.kvp file can be taken as prototype.CROSSBAR_URL
- (required) the Switchboard Crossbar instance URL. Example:https://crossbar.switchboard.xyz
all
- (optional) flag to crank all feeds in a single call
Example
[ -f swb-sim.out ] && rm swb-sim.out; nohup pnpm ts-node scripts/simulate-swb-feed.ts data/swb-feeds.kvp https://internal-crossbar.stage.mrgn.app > swb-sim.out 2>&1 &
tbd
Description
Cranks Switchboard price feeds in an infinite loop and saves simulation results in the swb-crank-output-{DateTime}.csv
file.
Usage
pnpm ts-node scripts/crank-swb-feed.ts <SWB_FEEDS_FILE> <CROSSBAR_URL> [all]
Parameters:
SWB_FEEDS_FILE
(required) The KVP file with Switchboard price feed addresses. The swb-feeds.kvp file can be taken as prototype.CROSSBAR_URL
- (required) the Switchboard Crossbar instance URL. Example:https://crossbar.switchboard.xyz
all
- (optional) flag to run simulation for all feeds in a single call
Example
[ -f swb-crank.out ] && rm swb-crank.out; nohup pnpm ts-node scripts/crank-swb-feed.ts data/swb-feeds.kvp https://internal-crossbar.stage.mrgn.app > swb-crank.out 2>&1 &
tbd
Run any script with the --help
flag for more details.
Example:
pnpm accounts:get --help