> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blink.cash/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript Types

> Complete type reference for the Deposit SDK.

All types are exported from the main entry point:

```typescript theme={null}
import type {
  DepositConfig,
  DepositStatus,
  DepositRequest,
  DepositResult,
  SignerFunction,
  SignerRequest,
  SignerResponse,
  TransferSummary,
  DepositErrorCode,
} from '@swype-org/deposit';
```

> [!NOTE]
>
> `DepositRequest`, `DepositResult`, `TransferSummary`, `SignerRequest`, `SignerResponse`, and `SignerFunction` are shared between `@swype-org/deposit` (web) and `@swype-org/deposit-mobile` (mobile). The type definitions are identical across both SDKs.

## DepositStatus

Current phase of the deposit flow.

```typescript theme={null}
type DepositStatus =
  | 'idle'
  | 'signer-loading'
  | 'iframe-active'
  | 'completed'
  | 'error';
```

## DepositConfig

Configuration for a `Deposit` instance. See [Deposit Class](https://docs.blink.cash/sdk-reference/deposit-class.md) for detailed descriptions.

```typescript theme={null}
interface DepositConfig {
  signer: string | SignerFunction;
  environment?: 'production' | 'sandbox';
  webviewBaseUrl?: string;
  hostedFlowOrigin?: string;
  containerElement?: HTMLElement;
  presentation?: 'overlay' | 'embedded';
  embedMaxHeightPx?: number;
  signerTimeoutMs?: number;
  flowTimeoutMs?: number;
  enableFullWidget?: boolean;
  appearance?: {
    hideDepositTitle?: boolean;
    theme?: 'light' | 'dark' | 'system';
    variables?: {
      colorPrimary?: string;
      colorBackground?: string;
      colorText?: string;
      colorDanger?: string;
      colorBorder?: string;
    };
  };
  preload?: boolean;
  merchantId?: string;
  debug?: boolean;
}
```

`presentation` and `embedMaxHeightPx` configure [aggregator embedding](https://docs.blink.cash/integration/embedded-deposit-sdk.md). Embedded presentation requires `containerElement` and resolves to overlay on mobile.

The web SDK defaults `appearance.theme` to your page's declared `color-scheme`. `appearance.variables` accepts five opaque hex brand colors and applies only to the web hosted flow. See [Dark and light mode](https://docs.blink.cash/integration/deposit-sdk.md#dark-and-light-mode) and [Match your appearance](https://docs.blink.cash/integration/embedded-deposit-sdk.md#match-your-appearance).

`appearance.hideDepositTitle` defaults to `false`. Set it to `true` to hide deposit entry and status titles when your container supplies its own heading. **More** and other navigation titles remain visible. See [Deposit titles](https://docs.blink.cash/integration/deposit-sdk.md#deposit-titles).

`preload` defaults to `true`. `merchantId` is an optional preload performance hint and is never used as authorization.

## DepositRequest

Parameters for a single deposit request.

```typescript theme={null}
interface DepositDestination {
  chainId: number;
  address: string;
  token: string;
}

interface DepositRequest {
  amount: number;
  // Either the single destination…
  chainId?: number;
  address?: string;
  token?: string;
  // …or a menu of them. Exactly one shape.
  destinations?: DepositDestination[];
  callbackScheme?: string | null;
  minimumDeposit?: number | null;
  reference?: string;
  metadata?: Record<string, string>;
}
```

| Field | Type | Required | Description |
| - | - | - | - |
| `amount` | `number` | Yes | USD amount to deposit. Must be > 0. |
| `chainId` | `number` | With `address`/`token` | Destination chain ID (for example, `8453` for Base or `792703809` for Solana). |
| `address` | `string` | With `chainId` | Destination wallet address. In the web SDK this can be an EVM address or a Solana address, depending on the destination chain. |
| `token` | `string` | With `chainId` | Destination token identifier. Use an EVM token contract address on EVM chains or an SPL mint address on Solana. |
| `destinations` | `DepositDestination[]` | Instead of the three above | Up to 10 accepted destinations, most-preferred first. Blink settles each deposit on exactly one of them, picked from the asset the user sends (a direct chain+token match first). No two entries may share a chain and token. See [Multiple destinations](https://docs.blink.cash/integration/signer-endpoint.md#multiple-destinations). |
| `callbackScheme` | `string \| null` | No | Custom URL scheme for native app deep-link callbacks. Always `null` for browser. |
| `minimumDeposit` | `number \| null` | No | Your minimum deposit in USD. Raises Blink's route minimum; never lowers it. Omit or pass `null` to use Blink's minimum. |
| `reference` | `string` | No | Merchant order or invoice ID for reconciliation. |
| `metadata` | `Record<string, string>` | No | Arbitrary key-value pairs forwarded to the signer. |

> [!NOTE]
>
> Choose `chainId` and `token` from Blink's active routing catalog. See [Supported Networks and Wallets](https://docs.blink.cash/integration/supported-networks-and-wallets.md) for the current support matrix and fee behavior.

`minimumDeposit` accepts a finite USD number greater than `0` and less than `1,000,000`, rounded up to whole cents. It applies to the amount screen and manual/QR deposit terms. The property is unsigned and is not forwarded to your signer. See [Minimum deposit](https://docs.blink.cash/integration/deposit-sdk.md#minimum-deposit) for examples and validation behavior.

## DepositResult

Result returned when a deposit completes successfully.

```typescript theme={null}
interface DepositResult {
  transfer: TransferSummary;
  idempotencyKey?: string;
  preview?: {
    amount: number;
    chainId: number;
    address: string;
    token: string;
    /** The menu, when the deposit was requested with one. */
    destinations?: DepositDestination[];
  };
}
```

`transfer.destinations` carries the **one** destination the deposit actually settled on.

## TransferSummary

Subset of transfer data returned from the hosted flow on completion.

```typescript theme={null}
interface TransferSummary {
  id: string;
  status: string;
  amount?: {
    amount: number;
    currency: string;
  };
  destinations?: Array<{
    chainId: string;
    address: string;
    token?: { address?: string; symbol?: string };
  }>;
}
```

## SignerRequest

Data the SDK passes to the merchant signer.

```typescript theme={null}
interface SignerRequest {
  amount: number;
  chainId?: number;
  address?: string;
  token?: string;
  destinations?: DepositDestination[];
  callbackScheme: string | null;
  url: string;
  version: 'v1';
  reference?: string;
  metadata?: Record<string, string>;
}
```

| Field | Type | Description |
| - | - | - |
| `amount` | `number` | USD amount to deposit. |
| `chainId` | `number?` | Destination chain ID. Present for a single destination. |
| `address` | `string?` | Destination wallet address. Present for a single destination. |
| `token` | `string?` | Destination token identifier for that chain. Present for a single destination. |
| `destinations` | `DepositDestination[]?` | The destination menu, present instead of the three above. Sign it through as `destinations`; verify ownership of every address. |
| `callbackScheme` | `string \| null` | `null` for browser integrations. |
| `url` | `string` | Base webview URL. Provided for logging/validation only. |
| `version` | `'v1'` | Protocol version. |
| `reference` | `string?` | Merchant order or invoice ID. |
| `metadata` | `Record<string, string>?` | Arbitrary key-value pairs. |

## SignerResponse

Shape the merchant signer must return.

```typescript theme={null}
interface SignerResponse {
  merchantId: string;
  payload: string;
  signature: string;
  expiresAt?: string;
  preview: {
    amount: number;
    chainId: number;
    address: string;
    token: string;
    destinations?: DepositDestination[];
    idempotencyKey: string;
  };
}
```

| Field | Type | Description |
| - | - | - |
| `merchantId` | `string` | Your merchant UUID. |
| `payload` | `string` | Base64url-encoded payment payload. |
| `signature` | `string` | Base64url-encoded ECDSA signature of the payload string. |
| `expiresAt` | `string?` | ISO 8601 expiration timestamp. Optional. Swype enforces expiry server-side via `signatureTimestamp` in the payload. |
| `preview` | `object` | Echo of payment parameters for client-side display. |

## SignerFunction

Custom async function for full control over the signer call.

```typescript theme={null}
type SignerFunction = (data: SignerRequest) => Promise<SignerResponse>;
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.