# @uma/sdk

> This package is meant as a low level cross platform utility library for viewing and interacting with UMA and other relevant contracts.

Latest version **0.34.13** (published 2025-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @uma/sdk
pnpm add @uma/sdk
yarn add @uma/sdk
bun add @uma/sdk
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.34.13 |
| Published | 2025-09-24 |
| First published | 2021-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 14 |
| Unpacked size | 2.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | David Adams |
| Maintainers | mrice32, chrismaree, evaldofelipe, nicholaspai |

## Links

- npm: https://www.npmjs.com/package/@uma/sdk
- npm.io page: https://npm.io/package/@uma/sdk

## Dependencies (14)

- [axios](https://npm.io/package/axios.md) ^1.6.0
- [bn.js](https://npm.io/package/bn.js.md) ^4.11.9
- [immer](https://npm.io/package/immer.md) ^9.0.7
- [bluebird](https://npm.io/package/bluebird.md) ^3.7.2
- [highland](https://npm.io/package/highland.md) ^2.13.5
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21
- [decimal.js](https://npm.io/package/decimal.js.md) ^10.3.1
- [@types/lodash-es](https://npm.io/package/@types/lodash-es.md) ^4.17.5
- [@uma/contracts-node](https://npm.io/package/@uma/contracts-node.md) ^0.4.28
- [@google-cloud/datastore](https://npm.io/package/@google-cloud/datastore.md) ^8.2.1
- [@uma/contracts-frontend](https://npm.io/package/@uma/contracts-frontend.md) ^0.4.28
- [@eth-optimism/core-utils](https://npm.io/package/@eth-optimism/core-utils.md) ^0.7.7
- [@ethersproject/providers](https://npm.io/package/@ethersproject/providers.md) ^5.4.2
- [@ethersproject/abstract-signer](https://npm.io/package/@ethersproject/abstract-signer.md) ^5.4.0

## Recent versions

- 0.34.13 (latest) — 2025-09-24
- 0.3.0-beta.0 (next) — 2021-07-06
- 0.34.11 — 2025-07-15
- 0.34.10 — 2024-10-29
- 0.34.8 — 2024-07-20
- 0.34.7 — 2024-04-30
- 0.34.6 — 2024-04-09
- 0.34.5 — 2024-03-07
- 0.34.4 — 2023-11-13
- 0.34.3 — 2023-10-13
- 0.34.2 — 2023-07-17
- 0.34.1 — 2023-04-18
- 0.34.0 — 2023-03-30
- 0.33.0 — 2023-03-23
- 0.32.8 — 2023-03-16
- … 59 more at https://npm.io/package/@uma/sdk/versions

## README

# UMA SDK

This package is meant as a low level cross platform utility library for viewing and interacting with UMA and other relevant contracts.

## Architecture

This is meant to be modular and add features as needed. This was bootstraped with TSDX, which you can find usage at the bottom of this file.

- [**clients**](./src/clients/README.md): are meant to be contract interaction clients that can lookup deployed contracts by network and return an ethers contract instance as well as parse events into useful state.
- [**stores**](./src/stores/README.md): are meant to be data shape agnostic classes for persistence or caching
- [**tables**](./src/tables/README.md): are classes which store tabular data, understand data shape and rely on stores for low level persistence
- [**utils**](./src/utils.ts): are meant to hold and expose useful utilities which can be shared and eventually promoted to their own modules
- [**across**](./src/across/README.md): supporting libraries for applications built on the across cross platform token transfer project.

Each folder should contain a README, index.ts and index.d.ts if needed which expose any code to the root of the SDK.

## Install

`yarn add @uma/sdk`

Or if running locally, checkout the protocol repo, and run `yarn link` inside the `packages/sdk` folder
Then inside your project type `yarn link @uma/sdk` to link to your local copy.

## Quick Start

```js
import * as uma from '@uma/sdk'

const { clients,stores,tables utils, across} = uma

const {Registry} = clients
const {JsMap, GoogleDatastore} = stores
const {blocks, base} = tables

// to see usage of each of these classes, see their individual readme within their directories.

```

## Building

This repo modifies the standard tsdx build process to support builds for frontend and node. Instances of `@uma/contracts-node` will
be replaced with `@uma/contracts-frontend` when using the `yarn build` command. To build frontend/node independently
you can run `build:web` or `build:node`. By default `yarn start` will start watching the node version of the sdk, and all
tests by default will run in the node context.

# TSDX User Guide

Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.

> This TSDX setup is meant for developing libraries (not apps!) that can be published to NPM. If you’re looking to build a Node app, you could use `ts-node-dev`, plain `ts-node`, or simple `tsc`.

> If you’re new to TypeScript, checkout [this handy cheatsheet](https://devhints.io/typescript)

## Commands

TSDX scaffolds your new library inside `/src`.

To run TSDX, use:

```bash
npm start # or yarn start
```

This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.

To do a one-off build, use `npm run build` or `yarn build`.

To run tests, use `npm test` or `yarn test`.

## Configuration

Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.

### Jest

Jest tests are set up to run with `npm test` or `yarn test`.

### Bundle Analysis

[`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.

#### Setup Files

This is the folder structure we set up for you:

```txt
/src
  index.tsx       # EDIT THIS
/test
  blah.test.tsx   # EDIT THIS
.gitignore
package.json
README.md         # EDIT THIS
tsconfig.json
```

### Rollup

TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.

### TypeScript

`tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.

## Continuous Integration

### GitHub Actions

Two actions are added by default:

- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
- `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)

## Optimizations

Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:

```js
// ./types/index.d.ts
declare var __DEV__: boolean

// inside your code...
if (__DEV__) {
  console.log("foo")
}
```

You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.

## Module Formats

CJS, ESModules, and UMD module formats are supported.

The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.

## Named Exports

Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.

## Including Styles

There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.

For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.

## Publishing to NPM

We recommend using [np](https://github.com/sindresorhus/np).

---
_Source: https://npm.io/package/@uma/sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
