Skip to content

Commit

Permalink
docs: add types to documentation.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ignaciopenia committed Jul 22, 2024
1 parent d9ed3fb commit 4c416a6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,22 @@ async function runSwap(stxAddress: string, currencyX: Currency, currencyY: Curre
```

Possible exceptions: `Failed to fetch token mappings`, `Can't find AMM route`, `Token mapping not found`, `Too many AMM pools in route`.

## Types
```typescript
export type TokenInfo = { // TokenInfo represents the details of a token that can be used in the AlexSDK.
id: Currency; // The unique identifier of the currency.
name: string; // The display name of the token that ALEX maintains, usually the token symbol.
icon: string; // The URL to the icon image of the token, maintained by ALEX.
wrapToken: string; // The full asset id of the alex wrapped token in the format of "{deployer}.{contract}::{asset}".
wrapTokenDecimals: number; // The number of decimal places for the wrapped token.
underlyingToken: string; // The full asset id of the underlying token in the format of "{deployer}.{contract}::{asset}".
underlyingTokenDecimals: number; // The number of decimal places for the underlying token.
isRebaseToken: boolean;
/**
* A boolean flag indicating whether the token is a rebase token.
* In a rebase token, getBalance is different from ft-balance
* Also postcondition would need to be adjusted since amount is different from ft-events
*/
};
```

0 comments on commit 4c416a6

Please sign in to comment.