Skip to content

Commit

Permalink
Base PR to include ts-doc in sdk library sources (#15)
Browse files Browse the repository at this point in the history
* add typedoc comments

* documentation.md was removed because typedoc is now used

* running typedoc

* removed docs

* added docs into gitignore

* irrelevant subtitle removed
  • Loading branch information
ignaciopenia authored Sep 7, 2024
1 parent f673f2d commit 075372b
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 163 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.DS_Store
node_modules
dist
docs
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,11 @@ You can install Alex-SDK using npm:
npm install alex-sdk
```

## Functions
## Documentation

The AlexSDK class includes the following functions:
For detailed API documentation, including a full list of available methods and their usage, please refer to:

```typescript
export declare class AlexSDK {
fetchSwappableCurrency(): Promise<TokenInfo[]>;
getAllPossibleRoutes(from: Currency, to: Currency): Promise<AMMRoute[]>;
getAmountTo(from: Currency, fromAmount: bigint, to: Currency): Promise<bigint>;
getBalances(stxAddress: string): Promise<Partial<{ [currency in Currency]: bigint }>>;
getFeeRate(from: Currency, to: Currency): Promise<bigint>;
getLatestPrices(): Promise<Partial<{ [currency in Currency]: number }>>;
getRoute(from: Currency, to: Currency): Promise<AMMRoute>;
getRouter(from: Currency, to: Currency): Promise<Currency[]>; // deprecated
getWayPoints(route: AMMRoute): Promise<TokenInfo[]>;
runSwap(stxAddress: string, currencyX: Currency,
currencyY: Currency, fromAmount: bigint,
minDy: bigint, customRoute: AMMRoute): Promise<TxToBroadCast>;
}
```

(detailed list [here](./documentation.md)).
[SDK API Documentation](/alex-sdk/).

## Usage

Expand Down
131 changes: 0 additions & 131 deletions documentation.md

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"lint-fix": "dts lint --fix",
"size": "size-limit",
"gen:contract": "rm -rf src/generated/smartContract/* && tsx ./scripts/gen-contract.ts && prettier --write 'src/generated/smartContract'",
"docs": "typedoc src/index.ts",
"docs:watch": "typedoc src/index.ts --watch",
"analyze": "size-limit --why",
"ci": "pnpm run lint && pnpm run test && pnpm run size"
},
Expand Down Expand Up @@ -72,6 +74,7 @@
"ts-json-schema-generator": "^2.3.0",
"tslib": "^2.6.3",
"tsx": "^4.15.5",
"typedoc": "^0.26.6",
"typescript": "^5.4.5"
}
}
Loading

0 comments on commit 075372b

Please sign in to comment.