Skip to content
Open

init #64

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
89 changes: 89 additions & 0 deletions projects/dark-forest-ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# dark-forest-ai

The OTC market for Autonomous Agents

## Installation

```bash
pnpm add @heyanon/dark-forest-ai
```

## Supported Functions

- makeAsk: Create a new OTC ask (offer) on the marketplace.
- fillAsk: Fill an existing OTC ask as a taker.
- cancelOpenAsk: Cancel an open ask and return tokens to the maker.
- withdrawFees: Withdraw accumulated protocol fees for a given asset.
- getAllOpenAsks: Get all open asks currently on the marketplace.

## Usage

Example usage (with @heyanon/sdk):

```ts
import { makeAsk, fillAsk, cancelOpenAsk, withdrawFees, getAllOpenAsks } from '@heyanon/dark-forest-ai';

// Make an ask
await makeAsk({
chainName: 'sonic-blaze-testnet',
ask: {
maker: '0x...',
amountHave: '100',
amountWant: '200',
have: '0x...',
want: '0x...',
deadline: '1710000000',
index: '0',
}
}, options);

// Fill an ask
await fillAsk({
chainName: 'sonic-blaze-testnet',
taker: '0x...',
maker: '0x...',
asset: '0x...',
idx: '0',
}, options);

// Cancel an ask
await cancelOpenAsk({
chainName: 'sonic-blaze-testnet',
maker: '0x...',
asset: '0x...',
id: '0',
}, options);

// Withdraw fees
await withdrawFees({
chainName: 'sonic-blaze-testnet',
asset: '0x...',
amount: '10',
}, options);

// Get all open asks
await getAllOpenAsks({
chainName: 'sonic-blaze-testnet',
}, options);
```

## Development

1. Install dependencies:
```bash
pnpm install
```

2. Build the project:
```bash
pnpm run build
```

3. Run tests:
```bash
pnpm test
```

## Documentation

Detailed documentation will be added here.
43 changes: 43 additions & 0 deletions projects/dark-forest-ai/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@heyanon/project-dark-forest-ai",
"version": "1.0.0",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"module": "dist/index.mjs",
"files": [
"dist"
],
"engines": {
"node": ">=18"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"start": "tsup --watch",
"build": "tsup",
"test": "vitest --run",
"lint": "tsdx lint",
"prepare": "pnpm run build",
"size": "size-limit",
"analyze": "size-limit --why",
"format": "prettier --write \"*/**/*.ts\""
},
"devDependencies": {
"@size-limit/preset-small-lib": "^9.0.0",
"@types/big.js": "^6.2.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.10.5",
"tsdx": "^0.14.1",
"tslib": "^2.8.1",
"tsup": "^8.4.0",
"typescript": "^5.3.3"
},
"dependencies": {
"@heyanon/sdk": "^2.0.2",
"viem": "2.22.9",
"vitest": "^2.1.8"
},
"description": "The OTC market for Autonomous Agents"
}
Loading