Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tools): added docs #1073

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<p>
<!-- Build -->
<a><img alt="Build" src="https://img.shields.io/github/actions/workflow/status/mrgnlabs/mrgn-ts/main.yml?style=flat-square"/></a>
<!-- Discord -->
<a href="https://discord.gg/pJ3U7gHJFe"><img alt="Discord Chat" src="https://img.shields.io/discord/882369954916212737?color=blueviolet&style=flat-square"/></a>
<!-- License -->
<a href="http://www.apache.org/licenses/LICENSE-2.0"><img alt="License" src="https://img.shields.io/github/license/mrgnlabs/mrgn-ts?style=flat-square&color=ffff00"/></a>
<!-- Total lines -->
Expand All @@ -32,7 +30,7 @@ A monorepo for [marginfi](https://app.marginfi.com)-related TypeScript projects

## About

`mrgn-ts` is an open source monorepo for TypeScript projects. It includes various app UI frontends, such as one for the product `mrgnlend`, as well as SDKs for `marginfi v2`, the `marginfi v2 liquidator` client, and the `liquidity incentive program (LIP)` client.
`mrgn-ts` is an open source monorepo for TypeScript projects. It includes various app UI frontends, such as one for the product `mrgnlend` and `the arena`, as well as SDKs for `marginfi v2`.

## Features

Expand All @@ -47,7 +45,7 @@ A monorepo for [marginfi](https://app.marginfi.com)-related TypeScript projects
2. Install dependencies:

```
yarn
pnpm install
```

3. marginfi frontend UIs can be found in [apps/](apps/).
Expand Down
21 changes: 5 additions & 16 deletions apps/marginfi-v2-trading/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<div align="center">
<img height="170" src="./images/logo.png" />

<h1>marginfi v2 UI (mrgnlend frontend)</h1>
<h1>marginfi v2 trading (the arena frontend)</h1>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha noice


<p>
<!-- Discord -->
<a href="https://discord.com/channels/882369954916212737"><img alt="Discord Chat" src="https://img.shields.io/discord/882369954916212737?color=blueviolet&style=flat-square"/></a>
<!-- License -->
<a href="http://www.apache.org/licenses/LICENSE-2.0"><img alt="License" src="https://img.shields.io/github/license/mrgnlabs/mrgn-ts?style=flat-square&color=ffff00"/></a>
</p>
Expand All @@ -15,22 +13,13 @@
</h4>
</div>

The marginfi V2 UI is a nextjs web client that serves as the frontend for the mrgnlend lending platform. It provides an easy-to-use interface for managing your lending and borrowing activities on the Solana blockchain. The UI is built using Next.js, a popular React-based framework for building server-rendered or statically exported React applications.

## Features

A clean and modern design with [Tailwind CSS](https://tailwindcss.com/), a utility-first CSS framework for rapidly building custom designs.
Built with [Material UI](https://material-ui.com/), a popular React UI library that implements Google's Material Design guidelines.
Leverages a number of other `@mrgnlabs` TypeScript packages, all available in the same [monorepo](https://github.com/mrgnlabs/mrgn-ts).
Frontend built for Solana smart contracts, providing a seamless and efficient user experience for trading and lending on the Solana network.

## Developing

To get started with the marginfi v2 UI, follow these steps:
To get started with the marginfi v2 trading, follow these steps:

1. Clone the monorepo and navigate to the `apps/marginfi-v2-ui` directory.
2. Install the dependencies by running `yarn install`.
3. Start the development server by running `yarn dev`.
1. Clone the monorepo and navigate to the `apps/marginfi-v2-trading` directory.
2. Install the dependencies by running `pnpm install`.
3. Start the development server by running `pnpm dev`.
4. Access the frontend in your web browser at http://localhost:3004.

## Contributing
Expand Down
7 changes: 3 additions & 4 deletions apps/marginfi-v2-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<h1>marginfi v2 UI (mrgnlend frontend)</h1>

<p>
<a href="https://discord.com/channels/882369954916212737"><img alt="Discord Chat" src="https://img.shields.io/discord/882369954916212737?color=blueviolet&style=flat-square"/></a>
<a href="http://www.apache.org/licenses/LICENSE-2.0"><img alt="License" src="https://img.shields.io/github/license/mrgnlabs/mrgn-ts?style=flat-square&color=ffff00"/></a>
</p>

Expand All @@ -18,7 +17,7 @@ The marginfi V2 UI is a nextjs web client that serves as the frontend for the mr
## Features

A clean and modern design with [Tailwind CSS](https://tailwindcss.com/), a utility-first CSS framework for rapidly building custom designs.
Built with [Material UI](https://material-ui.com/), a popular React UI library that implements Google's Material Design guidelines.
Built with [Shadcn](https://ui.shadcn.com/), a popular React component library designed for building accessible and customizable user interfaces.
Leverages a number of other `@mrgnlabs` TypeScript packages, all available in the same [monorepo](https://github.com/mrgnlabs/mrgn-ts).
Frontend built for Solana smart contracts, providing a seamless and efficient user experience for trading and lending on the Solana network.

Expand All @@ -27,8 +26,8 @@ Frontend built for Solana smart contracts, providing a seamless and efficient us
To get started with the marginfi v2 UI, follow these steps:

1. Clone the monorepo and navigate to the `apps/marginfi-v2-ui` directory.
2. Install the dependencies by running `yarn install`.
3. Start the development server by running `yarn dev`.
2. Install the dependencies by running `pnpm install`.
3. Start the development server by running `pnpm dev`.
4. Access the frontend in your web browser at http://localhost:3004.

## Contributing
Expand Down
4 changes: 2 additions & 2 deletions packages/mrgn-ui/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# marginfi ui

- Install: `yarn`
- Run: `yarn dev`
- Install: `pnpm install`
- Run: `pnpm dev`
146 changes: 146 additions & 0 deletions packages/tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Tools Package

A collection of CLI tools and utilities for account and banking operations.

## Features

- Command-line interface tools for common operations.
- Account and bank search utilities.
- Collection of debugging and testing scripts.

## Available Tools

### `pnpm accounts:get`

**Description:**
Retrieves account details by providing the account public key.

**Usage:**
```bash
pnpm accounts:get --account <ACCOUNT_PUBLIC_KEY>
```

**Options:**
- `-a, --account`
Account public key *(string, required)*

---

### `pnpm accounts:get-all`

**Description:**
Retrieves details for all accounts associated with a wallet.

**Usage:**
```bash
pnpm accounts:get-all --wallet <WALLET_PUBLIC_KEY>
```

**Options:**
- `-w, --wallet`
Wallet public key *(string, required)*

---

### `pnpm accounts:find-users`

**Description:**
Searches for users based on assets, liabilities, and balance criteria.

**Usage:**
```bash
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)*

---

### `pnpm accounts:cache`

**Description:**
Caches account data for quicker access.

**Usage:**
```bash
pnpm accounts:cache
```

**Options:**
- *No options available.*

---

### `pnpm banks:get`

**Description:**
Retrieves bank details using either the bank's public key or a token symbol.

**Usage:**
```bash
pnpm banks:get [options]
```

**Options:**
- `-a, --address`
Bank public key *(string)*
- `-s, --symbol`
Token symbol (e.g., 'USDC') *(string)*

---

### `pnpm banks:get-all`

**Description:**
Retrieves details for all banks.

**Usage:**
```bash
pnpm banks:get-all
```

**Options:**
- *No options available.*

---

### `pnpm banks:get-accounts`

**Description:**
Retrieves accounts associated with a specific bank.

**Usage:**
```bash
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

---

## Additional Help

Run any script with the `--help` flag for more details.

**Example:**
```bash
pnpm accounts:get --help
```
6 changes: 3 additions & 3 deletions packages/tools/lib/list-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ async function main() {
.map((line) => line.trim())
.join("\n ");

console.log(`yarn ${name}`);
console.log(`pnpm ${name}`);
console.log(` Options:`);
console.log(` ${optionsSection || "No options available"}\n`);
} catch (error) {
console.log(`yarn ${name}: Unable to get description\n`);
console.log(`Unable to get details\n`);
}
}

console.log("\nRun any script with --help for more details");
console.log("Example: yarn account:get --help\n");
console.log("Example: pnpm account:get --help\n");
}

main().catch((err) => {
Expand Down