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 and auth.currentAllowance are available
}

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

Common Interfaces

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

// Chain IDs
type ChainId = 1 | 42161 | 8453; // Mainnet, Arbitrum, Base

// Transaction data structure
interface TxData {
  abi: Abi;
  address: Address;
  functionName: string;
  args: unknown[];
  chainId: number;
}