> For the complete documentation index, see [llms.txt](https://docs.baas.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.baas.sh/baas-sdk/resources/exported-types.md).

# Exported types

TypeScript types and classes exported by the BaaS SDK.

The SDK is written in TypeScript and ships with full type definitions. No extra `@types` package is needed.

## Types

Import types with `import type`:

```ts
import type { BaasSession, BaasChain, ContractEvent, UnitValue } from '@baas.sh/sdk';
```

| Area                                             | Types                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Client                                           | `BaasClient`, `BaasClientOptions`, `RequestOptions`                                                                                                                                                                                                                                      |
| Auth & sessions                                  | `BaasSession`, `WalletMode`, `AuthChangeEvent`, `AuthStateChangeCallback`, `BaasAuthClient`, `EIP1193Provider`, `EmailOption`, `PasskeyCeremonyOptions`, `SmartWalletSignUpOptions`, `SmartWalletSignUpResult`, `SmartWalletSignInOptions`, `WalletSignInOptions`, `PasskeyCapabilities` |
| Smart wallet                                     | `BaasSmartWalletClient`, `SmartWalletActivationResult`, `SmartWalletChainConfig`, `SmartWalletJournalV1`                                                                                                                                                                                 |
| Chains                                           | `BaasChain`, `BaasChainsClient`, `ChainChangeCallback`, `SwitchChainOptions`                                                                                                                                                                                                             |
| User                                             | `BaasUserClient`, `BaasUser`                                                                                                                                                                                                                                                             |
| Errors                                           | `BaasErrorCode`, `BaasApiErrorLevel`, `UserOperationReference`, `ContractRevert`                                                                                                                                                                                                         |
| Smart contracts — fluent chain                   | `ContractStep`, `AddressStep`, `FunctionStep`, `TerminalStep`, `SendOptions`, `SimulateOptions`, `EstimateGasOptions`                                                                                                                                                                    |
| Event history — the contract's and the user's    | `ContractEventsOptions`, `UserEventsOptions`, `ContractEventsCountOptions`, `UserEventsCountOptions`, `ContractEventsCount`, `Where`, `WhereRule`, `WhereValue`, `ContractEvent`, `ContractEventLog`, `UserContractEvent`, `ContractEventsPage`, `WalletDirection`                       |
| Typed wrapper for overload disambiguation        | `TypedValue`                                                                                                                                                                                                                                                                             |
| Smart units — input wrapper and formatted output | `UnitInput`, `UnitFormattedValue`, `UnitValue`                                                                                                                                                                                                                                           |
| Wallet                                           | `BaasWallet`, `BaasTransaction`, `SendTransactionOptions`, `SignMessageOptions`                                                                                                                                                                                                          |
| viem re-export                                   | `TransactionReceipt`                                                                                                                                                                                                                                                                     |

{% hint style="info" %}
`TransactionReceipt` is re-exported from viem, so you can type the result of `tx.wait()` without installing viem yourself.
{% endhint %}

## Error classes

Error classes are exported as values, so you can use `instanceof`:

```ts
import {
  BaasError,
  BaasAuthError,
  BaasWalletError,
  BaasTransactionError,
  BaasUserOperationError,
  BaasNetworkError,
  BaasApiError,
} from '@baas.sh/sdk';
```

## Helpers

```ts
import { Typed, SmartUnits, and, or, eq, gte, oneOf } from '@baas.sh/sdk';
```

* `Typed` provides ABI type wrappers for disambiguating Solidity overloads when JavaScript can't distinguish scalar types (e.g. `Typed.uint8(100)` vs `Typed.uint256(100)`). See [Disambiguating overloaded functions](/baas-sdk/blockchain/smart-contracts.md#disambiguating-overloaded-functions).
* `SmartUnits()` marks an amount expressed in the token's unit or in native currency: native `value` uses 18 decimals, and contract arguments use their configured binding. See [Smart units](/baas-sdk/blockchain/smart-units.md).
* `and()` and `or()` combine filter rules and nested groups. Conditions use `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `oneOf`, `contains`, `startsWith` and `endsWith`. See [event filter examples](/baas-sdk/blockchain/events.md#filter-events).

## Next

* [API reference](/baas-sdk/resources/api-reference.md) — every method, option, and signature.
* [Error handling](/baas-sdk/resources/error-handling.md) — the typed error hierarchy.
* [Integration guides](/baas-sdk/integrations.md) — TypeScript setup and supported environments.
