{"id":43933301,"url":"https://github.com/stakekit/sdk","last_synced_at":"2026-02-07T00:20:02.111Z","repository":{"id":303756167,"uuid":"1015902631","full_name":"stakekit/sdk","owner":"stakekit","description":"A TypeScript SDK for the most complete API for integrating non-custodial, on-chain yield — including staking, restaking, liquid staking, DeFi lending, RWA yields, vaults, and more across 70+ blockchain networks.","archived":false,"fork":false,"pushed_at":"2025-12-18T10:35:24.000Z","size":295,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T17:15:20.151Z","etag":null,"topics":["crypto","defi","staking","web3","yield"],"latest_commit_sha":null,"homepage":"https://yield.xyz/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stakekit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-08T07:50:01.000Z","updated_at":"2025-12-18T10:34:18.000Z","dependencies_parsed_at":"2025-07-09T09:25:39.388Z","dependency_job_id":"0fc7ded5-42e9-478f-a1c8-53fa779377e6","html_url":"https://github.com/stakekit/sdk","commit_stats":null,"previous_names":["stakekit/sdk"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/stakekit/sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fsdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fsdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fsdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fsdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stakekit","download_url":"https://codeload.github.com/stakekit/sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stakekit%2Fsdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29181340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T23:15:33.022Z","status":"ssl_error","status_checked_at":"2026-02-06T23:15:09.128Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","defi","staking","web3","yield"],"created_at":"2026-02-07T00:20:01.222Z","updated_at":"2026-02-07T00:20:02.098Z","avatar_url":"https://github.com/stakekit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yield.xyz SDK\n\nA TypeScript SDK for the **most complete API for integrating non-custodial, on-chain yield** — including staking, restaking, liquid staking, DeFi lending, RWA yields, vaults, and more across 70+ blockchain networks.\n\nOriginally developed as the backbone of Omni (one of the most advanced staking wallets in Web3), Yield.xyz now powers platforms like **Ledger, Zerion, and Tangem**, serving **4M+ users** and supporting **hundreds of millions in monthly volume**.\n\n## Why Yield.xyz?\n\n- **🔗 Unified Interface** — Every protocol and opportunity is abstracted into a consistent, schema-based format: one format for metadata, one for actions, one for balances\n- **⚡ Instant Integration** — No need to write custom logic for Cosmos staking vs. Aave lending — integrate once, support everything\n- **🔐 Self-Custodial by Design** — Transactions are returned fully constructed but never executed — you sign and broadcast using any infrastructure: wallets, smart contracts, or custody platforms\n- **🏗️ Battle-Tested Infrastructure** — Built on the stack that powers millions of real-world transactions and billions in TVL\n- **🔄 Composable** — Chain together multiple yields to build cross-chain workflows (e.g. bridge + stake + restake) in a single declarative call\n- **🌐 Chain-Agnostic** — Works across EVM and non-EVM chains, including Ethereum, Cosmos, Tron, Solana, and more\n- **💰 Monetizable** — Configure deposit, performance, and management fees or earn validator rebates directly in your integration\n- **🎯 TypeScript First** — Full type safety with auto-generated types from OpenAPI spec\n- **🧪 Testing Support** — Built-in MSW (Mock Service Worker) support for testing\n\n## What You Can Build\n\n- **💳 Wallets** — Add staking, DeFi flows with full control over UX, signing, and monetization\n- **🏦 Custodians \u0026 Fintechs** — Offer on-chain yield on crypto or stablecoin balances with full transparency and fee control\n- **🤖 AI Agents** — Query all available yield actions and execute optimal strategies using standard schemas\n- **🔗 Aggregators \u0026 Infra** — Compose multi-step flows using a unified transaction model — no chain-specific code required\n\n## Core Concepts\n\n### Yields\nEach yield represents an opportunity: staking, restaking, lending, vaults, or RWA strategies — with standardized metadata, reward mechanics, and execution logic across 70+ networks.\n\n### Actions\nEach yield supports consistent actions like `enter`, `exit`, and `manage`, using schema-based inputs. No matter if it's Ethereum staking or Cosmos delegation — the interface is the same.\n\n### Balances\nRetrieve unified views of user positions across all lifecycle stages: active, pending, cooldown, claimable, and more — all in a consistent format regardless of the underlying protocol.\n\n### Protocols\nYields can be grouped under known brands or ecosystems (e.g. Aave, Cosmos, EigenLayer) for easy discovery and filtering.\n\n## Installation\n\n```bash\nnpm install @yieldxyz/sdk\n# or\nyarn add @yieldxyz/sdk\n# or\npnpm add @yieldxyz/sdk\n```\n\n## Quick Start\n\n### Configuration\n\n```typescript\nimport { sdk } from '@yieldxyz/sdk';\n\nsdk.configure({\n  apiKey: 'your-api-key',\n  baseURL: 'https://api.yield.xyz/', // Optional, defaults to this URL\n});\n```\n\n### Basic Usage\n\n```typescript\nimport { sdk } from '@yieldxyz/sdk';\n\n// Configure the SDK first\nsdk.configure({\n  apiKey: 'your-api-key',\n});\n\n// Discover yield opportunities across all networks and protocols\nconst yields = await sdk.api.getYields({\n  network: 'ethereum',\n  limit: 10\n});\n\n// Get balances for a specific yield and address\nconst balances = await sdk.api.getYieldBalances('ethereum-lido-staking', {\n  address: '0x1234567890123456789012345678901234567890',\n  arguments: {}\n});\n\n// Enter a yield position (returns unsigned transactions)\nconst action = await sdk.api.enterYield({\n  yieldId: 'ethereum-lido-staking',\n  address: '0x1234567890123456789012345678901234567890',\n  arguments: {\n    amount: '1000000000000000000' // 1 ETH in wei\n  }\n});\n\n// The transactions are ready to sign and broadcast with your preferred method\nconsole.log(action.transactions); // Array of unsigned transactions\n```\n\n## API Reference\n\n### Yield Discovery\n\n#### Get All Yields\n```typescript\nconst yields = await sdk.api.getYields({\n  network?: string;        // Filter by network (ethereum, polygon, etc.)\n  token?: string;          // Filter by token symbol or address\n  inputToken?: string;     // Filter by input token\n  provider?: string;       // Filter by provider\n  limit?: number;          // Page size\n  offset?: number;         // Pagination offset\n});\n```\n\n#### Get Specific Yield\n```typescript\nconst yieldDetails = await sdk.api.getYield('ethereum-lido-staking');\n```\n\n#### Get Yield Validators (for staking)\n```typescript\nconst validators = await sdk.api.getYieldValidators('cosmos-staking', {\n  limit?: 10,\n  offset?: 0\n});\n```\n\n### Balance Management\n\n#### Get Yield Balances\n```typescript\nconst balances = await sdk.api.getYieldBalances('ethereum-lido-staking', {\n  address: '0x...',\n  arguments?: object // Protocol-specific parameters\n});\n```\n\n#### Get Aggregate Balances (multiple yields)\n```typescript\nconst aggregateBalances = await sdk.api.getAggregateBalances({\n  queries: [\n    {\n      yieldId: 'ethereum-lido-staking',\n      address: '0x...',\n      network: 'ethereum'\n    },\n    {\n      yieldId: 'polygon-staking', \n      address: '0x...',\n      network: 'polygon'\n    }\n  ]\n});\n```\n\n### Action Execution\n\n#### Enter Yield Position\n```typescript\nconst enterAction = await sdk.api.enterYield({\n  yieldId: 'ethereum-lido-staking',\n  address: '0x...',\n  arguments: {\n    amount: '1000000000000000000'\n  }\n});\n```\n\n#### Exit Yield Position\n```typescript\nconst exitAction = await sdk.api.exitYield({\n  yieldId: 'ethereum-lido-staking',\n  address: '0x...',\n  arguments: {\n    amount: '1000000000000000000'\n  }\n});\n```\n\n#### Manage Yield Position\n```typescript\nconst manageAction = await sdk.api.manageYield({\n  yieldId: 'ethereum-lido-staking',\n  address: '0x...',\n  action: 'CLAIM_REWARDS', // Available actions from balance.pendingActions\n  passthrough: 'server-generated-passthrough', // From balance query\n  arguments: {}\n});\n```\n\n#### Get User Actions\n```typescript\nconst actions = await sdk.api.getActions({\n  address: '0x...',\n  status?: 'CREATED' | 'PROCESSING' | 'SUCCESS' | 'FAILED',\n  intent?: 'enter' | 'exit' | 'manage',\n  yieldId?: 'ethereum-lido-staking',\n  limit?: 10,\n  offset?: 0\n});\n```\n\n#### Get Action Details\n```typescript\nconst action = await sdk.api.getAction('action-id');\n```\n\n### Transaction Management\n\n#### Submit Transaction Hash\n```typescript\nconst transaction = await sdk.api.submitTransactionHash(\n  'transaction-id',\n  {\n    hash: '0x...' // After broadcasting the transaction\n  }\n);\n```\n\n#### Get Transaction Details\n```typescript\nconst transaction = await sdk.api.getTransaction('transaction-id');\n```\n\n### Network \u0026 Provider Discovery\n\n#### Get Networks\n```typescript\nconst networks = await sdk.api.getNetworks();\n```\n\n#### Get Providers\n```typescript\nconst providers = await sdk.api.getProviders({\n  limit?: 10,\n  offset?: 0\n});\n```\n\n#### Get Provider Details\n```typescript\nconst provider = await sdk.api.getProvider('lido');\n```\n\n### Health Check\n\n#### Get API Health Status\n```typescript\nconst healthStatus = await sdk.api.health();\n```\n\n## Advanced Configuration\n\n### Custom Fetch Instance\n\nYou can provide your own fetch implementation for custom request handling:\n\n```typescript\nimport { sdk, type FetchInstance } from '@yieldxyz/sdk';\n\nconst customFetch: FetchInstance = async \u003cT\u003e(url: string, init: RequestInit): Promise\u003cT\u003e =\u003e {\n  // Custom fetch logic (e.g., retry, logging, etc.)\n  const response = await fetch(url, init);\n\n  if (!response.ok) {\n    throw new Error(`HTTP error! status: ${response.status}`);\n  }\n\n  return response.json();\n};\n\nsdk.configure({\n  apiKey: 'your-api-key',\n  baseURL: 'https://api.yield.xyz/',\n  fetchInstance: customFetch\n});\n```\n\n## Testing\n\nThe SDK includes MSW (Mock Service Worker) support for testing:\n\n```typescript\nimport { setupServer } from 'msw/node';\nimport { getYieldXyzAPIMock } from '@yieldxyz/sdk/msw';\n\nconst server = setupServer(...getYieldXyzAPIMock());\n\nbeforeAll(() =\u003e server.listen());\nafterEach(() =\u003e server.resetHandlers());\nafterAll(() =\u003e server.close());\n```\n\n## Type Safety\n\nThe SDK provides full TypeScript support with auto-generated types:\n\n```typescript\nimport { sdk } from '@yieldxyz/sdk';\nimport type {\n  YieldDto,\n  ActionDto,\n  BalancesResponseDto,\n  NetworkDto\n} from '@yieldxyz/sdk';\n\n// All API responses are fully typed\nconst handleYieldData = (yield: YieldDto) =\u003e {\n  console.log(yield.id, yield.metadata.name);\n  console.log(yield.rewardRate.total); // Fully typed reward information\n  console.log(yield.mechanics.type); // staking | restaking | lending | vault | etc.\n};\n```\n\n## Error Handling\n\nThe SDK will throw an error if you try to use the API without configuring it first:\n\n```typescript\nimport { sdk } from '@yieldxyz/sdk';\n\ntry {\n  // This will throw an error if not configured\n  const yields = await sdk.api.getYields();\n} catch (error) {\n  console.error('SDK not configured:', error.message);\n}\n\n// Configure first\nsdk.configure({ apiKey: 'your-api-key' });\n\n// Now API calls will work\nconst yields = await sdk.api.getYields();\n```\n\n## Development\n\n```bash\n# Install dependencies\npnpm install\n\n# Generate API client from OpenAPI spec\npnpm run generate-api\n\n# Build the SDK\npnpm run build\n\n# Run linting\npnpm run lint\n\n# Format code\npnpm run format\n```\n\n## Getting an API Key\n\nTo get started with Yield.xyz:\n\n1. Visit [docs.yield.xyz](https://docs.yield.xyz/) to learn more about the platform\n2. Contact the Yield.xyz team to get your API key and discuss your use case\n3. Review the [official documentation](https://docs.yield.xyz/) for comprehensive guides and examples\n\n## License\n\nISC\n\n## Documentation \u0026 Support\n\nFor comprehensive guides, API reference, and detailed examples, visit the [official Yield.xyz documentation](https://docs.yield.xyz/).\n\nFor support and partnerships:\n- Email: [support@yield.xyz](mailto:support@yield.xyz)\n- Documentation: [docs.yield.xyz](https://docs.yield.xyz/)\n\n---\n\n**Welcome to the yield layer of Web3** 🌱\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstakekit%2Fsdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstakekit%2Fsdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstakekit%2Fsdk/lists"}