Skip to main content
The Amplify SDK is fully typed with TypeScript. This section documents the key types, enums, and interfaces you’ll use when integrating.

YieldType

Yield strategy enum values (CORE, TREASURY, FRONTIER).

DepositAuthMethod

Authorization method discriminated unions and type guards.

Errors

APIError class and error code reference.

Quick Reference

Core Enums

import { YieldType, LogLevel } from "@paxoslabs/amplify-sdk";

// Yield types
YieldType.CORE      // Standard yield strategy
YieldType.TREASURY  // Treasury-backed strategy
YieldType.FRONTIER  // Higher-risk/reward strategy

// Log levels
LogLevel.DEBUG  // 0 - Verbose debugging
LogLevel.INFO   // 1 - General information
LogLevel.WARN   // 2 - Warnings
LogLevel.ERROR  // 3 - Errors only (default)
LogLevel.NONE   // 4 - Disable logging

Type Guards

import {
  isPermitAuth,
  isApprovalAuth,
  isAlreadyApprovedAuth,
} from "@paxoslabs/amplify-sdk";

const auth = await prepareDepositAuthorization(params);

if (isPermitAuth(auth)) {
  // TypeScript knows: auth.method === "permit"
  // auth.permitData is available
}

if (isApprovalAuth(auth)) {
  // TypeScript knows: auth.method === "approval"
  // auth.txData is available
}

if (isAlreadyApprovedAuth(auth)) {
  // TypeScript knows: auth.method === "already_approved"
  // auth.allowance is available
}

Common Types

// Address type (from viem)
type Address = `0x${string}`;

// Flexible chain ID — accepts number or numeric string
type ChainId = number | `${number}`;
ChainId is intentionally flexible to support both numeric and string-based chain IDs. The SDK normalizes these internally via toChainId(). Currently supported chains include Ethereum Mainnet (1), Sepolia (11155111), HyperEVM (999), and Stable Testnet (2201).