> For the complete documentation index, see [llms.txt](https://docs.seismic.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seismic.systems/getting-started/src20-factory/sdk.md).

# TypeScript SDK

`@seismic/src20-sdk` is the TypeScript library that powers the CLI and web interface in this repo. It wraps the SRC20 Factory contract and exposes three functions and the contract ABIs.

{% hint style="info" %}
`@seismic/src20-sdk` is an internal workspace package — it is not published to npm. It is used by the `packages/cli` and `packages/web` packages within this monorepo. This page documents its API surface as a reference.
{% endhint %}

***

## createToken

Deploys a new SRC20 token through the factory and returns the deployed address.

### Signature

```typescript
async function createToken(
  client: ShieldedWalletClient,
  params: CreateTokenParams,
): Promise<CreateTokenResult>;
```

### Parameters

| Parameter              | Type                   | Required | Description                                           |
| ---------------------- | ---------------------- | -------- | ----------------------------------------------------- |
| `client`               | `ShieldedWalletClient` | yes      | A shielded wallet client from `seismic-viem`          |
| `params.name`          | `string`               | yes      | Token name                                            |
| `params.symbol`        | `string`               | yes      | Token symbol                                          |
| `params.initialSupply` | `bigint`               | yes      | Supply in base units (e.g. `1_000_000n * 10n ** 18n`) |
| `params.decimals`      | `number`               | no       | Token decimals, defaults to `18`                      |

### Returns

```typescript
interface CreateTokenResult {
  tokenAddress: Address; // address of the deployed SRC20Token contract
  txHash: Hash; // transaction hash
}
```

***

## getTokenInfo

Reads public metadata from a deployed SRC20 token using a standard public client.

### Signature

```typescript
async function getTokenInfo(
  client: PublicClient,
  tokenAddress: Address,
): Promise<TokenInfo>;
```

### Returns

```typescript
interface TokenInfo {
  name: string;
  symbol: string;
  decimals: number;
  owner: Address;
  totalSupply: bigint; // in base units
}
```

***

## getFactoryAddress

Resolves the factory contract address for a given chain ID. Throws if the chain is not supported.

### Signature

```typescript
function getFactoryAddress(chainId: number): Address;
```

### FACTORY\_ADDRESSES

The raw mapping of chain IDs to factory addresses:

```typescript
const FACTORY_ADDRESSES: Record<number, Address> = {
  5124: "0x87F850cbC2cFfac086F20d0d7307E12d06fA2127",
};
```

***

## ABIs

The package exports the full contract ABIs:

* **`SRC20FactoryAbi`** — `createToken`, `getTokenCount`, `tokens(uint256)`, `TokenCreated` event
* **`SRC20TokenAbi`** — `name`, `symbol`, `decimals`, `owner`, `totalSupply`, `mint`, `burn`, and all inherited SRC20 functions (`transfer`, `transferFrom`, `approve`, `balance`, `allowance`, `balanceOfSigned`, `permit`)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.seismic.systems/getting-started/src20-factory/sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
