Get the FREE Ultimate OpenClaw Setup Guide →
B

The Trench

Scanned

@BAGWATCHER

npx machina-cli add skill @BAGWATCHER/the-trench --openclaw
Files (1)
SKILL.md
1.2 KB

The Trench Skill

Use this skill to construct Anchor clients that call The Trench program on devnet. This repo is public and contains only the IDL and TS types (no private bot logic).

Program

  • Program ID (devnet): 6fs4qcRYSdR8pd2ZPoAmLpthrqZR94Dhf6J4PLvtqQt1
  • IDL: {baseDir}/../idl.json
  • TS types: {baseDir}/../the_trench.ts

Usage (TypeScript)

import { Connection, PublicKey } from "@solana/web3.js";
import { AnchorProvider, Program } from "@coral-xyz/anchor";
import idl from "../idl.json";

const programId = new PublicKey("6fs4qcRYSdR8pd2ZPoAmLpthrqZR94Dhf6J4PLvtqQt1");
const connection = new Connection("https://api.devnet.solana.com", "confirmed");
const provider = AnchorProvider.env();
const program = new Program(idl as any, programId, provider);

// Example call
// await program.methods.listDeadToken(...).accounts({ ... }).rpc();

Notes

  • This skill does not include any private trading logic or alpha.
  • If you need mainnet, update the program ID and IDL accordingly.

Source

git clone https://clawhub.ai/BAGWATCHER/the-trenchView on GitHub

Overview

The Trench skill lets you build Anchor clients that invoke the The Trench program on Solana's devnet. It uses the public IDL and TypeScript types provided in the repository, with no private bot logic. The example demonstrates configuring the program with the devnet programId and calling methods like listDeadToken.

How This Skill Works

It imports Solana web3.js, Anchor's Provider and Program, loads the IDL (idl.json), constructs the programId PublicKey, and creates a Program instance. You then call program.methods.<method>().accounts({ ... }).rpc() to execute on devnet; the repo contains only IDL and TS types, not runtime bot logic.

When to Use It

  • You are building a client to interact with The Trench program on devnet for testing and demos
  • You want a typed, private-bot-free Anchor client using the public IDL and TS types
  • You plan to call a method like listDeadToken and need a quick example with accounts
  • You intend to switch to mainnet by swapping the program ID and IDL
  • You are integrating this into a TypeScript project or script with AnchorProvider.env()

Quick Start

  1. Step 1: Import modules and load idl.json from the repo
  2. Step 2: Create programId with 6fs4qcRYSdR8pd2ZPoAmLpthrqZR94Dhf6J4PLvtqQt1, set up connection and provider, then Program
  3. Step 3: Call an example method like program.methods.listDeadToken(...).accounts({ ... }).rpc()

Best Practices

  • Use the devnet URL https://api.devnet.solana.com with confirmed commitment
  • Keep the devnet programId (6fs4qcRYSdR8pd2ZPoAmLpthrqZR94Dhf6J4PLvtqQt1) consistent and replace when moving to mainnet
  • Rely on the public IDL and TS types from the repo; no private bot logic
  • Validate accounts and instruction data before rpc() calls
  • Test calls in a sandbox environment before deploying to any live network

Example Use Cases

  • Bootstrapping a TS script to call listDeadToken via program.methods..rpc()
  • Creating a web UI button that triggers a devnet The Trench call using AnchorProvider.env()
  • Replacing programId and IDL to prepare a mainnet integration
  • Using the provided IDL path {baseDir}/../idl.json to load the IDL in your app
  • Leveraging the TS types file {baseDir}/../the_trench.ts to ensure type-safe calls

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers