@zyfai/sdk 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,13 +3,13 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@zyfai/sdk.svg)](https://www.npmjs.com/package/@zyfai/sdk)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
 
6
- TypeScript SDK for interacting with the Zyfai Yield Optimization Engine. This SDK provides easy-to-use methods for deploying Safe smart wallets, managing DeFi positions, and optimizing yield across multiple protocols.
6
+ TypeScript SDK for integrating self-custodial Zyfai yield agents. Discover DeFi opportunities and manage deposits, withdrawals, positions, and strategies across Ethereum Mainnet, Base, and Arbitrum.
7
7
 
8
- You can generate an api key from here: https://sdk.zyf.ai/
8
+ Get an API key from [sma.zyf.ai](https://sma.zyf.ai/). For chat-based integrations, use the hosted MCP endpoint at [`https://mcp.zyf.ai/mcp`](https://mcp.zyf.ai/mcp) (registry ID: `io.github.ondefy/zyfai`).
9
9
 
10
10
  ## Features
11
11
 
12
- - **Safe Smart Wallet Deployment**: Deploy Safe wallets with deterministic addresses
12
+ - **First-Deposit Onboarding**: The first deposit assigns a pre-deployed Safe and active session to the user's EOA
13
13
  - **Flexible Authentication**: Support for private keys and modern wallet providers
14
14
  - **Multi-Chain Support**: Works on Ethereum Mainnet, Base, and Arbitrum
15
15
  - **Yield Optimization**: Access to multiple DeFi protocols and strategies
@@ -51,7 +51,7 @@ After changesets merge to `main`, a maintainer runs `npm run version-packages`,
51
51
 
52
52
  1. **API Key**: Single API key for both Execution API (Safe deployment, transactions, session keys) and Data API (earnings, opportunities, analytics)
53
53
 
54
- **Get your API key from [Zyfai Dashboard](https://sdk.zyf.ai)**
54
+ **Get your API key from [Zyfai Dashboard](https://sma.zyf.ai)**
55
55
 
56
56
  ## Quick Start
57
57
 
@@ -426,9 +426,9 @@ Transfer tokens to your Safe smart wallet. Token address is automatically select
426
426
  **Minimum portfolio balance (enforced on Safe balance + deposit amount):**
427
427
 
428
428
  - Ethereum Mainnet (1) / USDC or EURC: 10,000 units
429
- - Base (8453) and Arbitrum (42161) / USDC or EURC: 100 units
430
- - WETH: about **$10,000** of ETH on Ethereum Mainnet, **$100** on Base and Arbitrum
431
- - NVDAc: about **$100** on Base
429
+ - Base (8453) and Arbitrum (42161) / USDC or EURC: 10 units
430
+ - WETH: about **$10,000** of ETH on Ethereum Mainnet, **$10** on Base and Arbitrum
431
+ - NVDAc: about **$10** on Base
432
432
 
433
433
  Minimums for WETH and NVDAc are quoted in dollars and converted at deposit time from the live USD price (Data API `GET /api/v2/price?token=eth` and `?token=nvdac`, same API key as the SDK), so the on-chain threshold moves with the market.
434
434
 
@@ -1131,9 +1131,9 @@ resolves to zero protocols for NVDAc and the agent has nothing to deploy into.
1131
1131
  Every NVDAc withdrawal is therefore a delayed one — read
1132
1132
  [Total balance](#total-balance) before showing a balance.
1133
1133
 
1134
- **The minimum deposit is $100 of NVDAc, not 100 NVDAc.** It is converted from
1134
+ **The minimum deposit is $10 of NVDAc, not 10 NVDAc.** It is converted from
1135
1135
  the live price at deposit time, so the threshold in token units moves daily
1136
- (around `0.44` NVDAc at $225/share).
1136
+ (around `0.044` NVDAc at $225/share).
1137
1137
 
1138
1138
  **Deposits pause when the market is closed**, typically over the weekend. Funds
1139
1139
  stay idle in the Safe and are deployed at the next open; other assets are
@@ -1145,7 +1145,7 @@ unaffected. `getPortfolio` returns ready-to-display copy in
1145
1145
  // Chains default to Base, the only one NVDAc exists on.
1146
1146
  await sdk.setAssetStrategy({ asset: "NVDAc", strategy: "yieldmaxxing" });
1147
1147
 
1148
- // 1 NVDAc = 100000000 (8 decimals). Must leave at least ~$100 in the Safe.
1148
+ // 1 NVDAc = 100000000 (8 decimals). Must leave at least ~$10 in the Safe.
1149
1149
  const sentNvda = await sdk.sendDeposit(userAddress, 8453, "100000000", "NVDAc");
1150
1150
  await sdk.waitForDepositCredit(sentNvda.registration.id, 8453);
1151
1151
  ```
@@ -1555,7 +1555,7 @@ npx vitest src/integration/get-protocols.integration.test.ts --fileParallelism=f
1555
1555
 
1556
1556
  Tests call `describe.skipIf(!integrationEnvReady())` and skip cleanly when `.env.test` is missing or invalid.
1557
1557
 
1558
- When the execution API is **local** or **staging** and `NODE_ENV` is not `production`, the SDK skips client-side minimum portfolio checks so small test deposits (e.g. 0.1 USDC) work without topping up 100 USDC on Base. Production (`api.zyf.ai`) always enforces real minimums.
1558
+ When the execution API is **local** or **staging** and `NODE_ENV` is not `production`, the SDK skips client-side minimum portfolio checks so small test deposits (e.g. 0.1 USDC) work without topping up 10 USDC on Base. Production (`api.zyf.ai`) always enforces real minimums.
1559
1559
 
1560
1560
  **Release smoke (`deposit-withdraw`)** on Base USDC: **local and staging only** — **0.1 USDC** round-trip (fund the test EOA on Base with ~0.1 USDC plus gas). Staging api must have **`SMOKE_AMOUNTS_ENABLED=true`** in its `.env` (see `zyfai-api/docs/deployment.md`). One withdraw per run. Production does not run fund-spending integration tests.
1561
1561
 
package/dist/index.js CHANGED
@@ -648,22 +648,22 @@ var MIN_PORTFOLIO_BALANCE = {
648
648
  // 10,000 EURC (6 decimals)
649
649
  },
650
650
  8453: {
651
- USDC: 100n * 10n ** 6n,
652
- // 100 USDC (6 decimals)
653
- EURC: 100n * 10n ** 6n
654
- // 100 EURC (6 decimals)
651
+ USDC: 10n * 10n ** 6n,
652
+ // 10 USDC (6 decimals)
653
+ EURC: 10n * 10n ** 6n
654
+ // 10 EURC (6 decimals)
655
655
  },
656
656
  42161: {
657
- USDC: 100n * 10n ** 6n,
658
- // 100 USDC (6 decimals)
659
- EURC: 100n * 10n ** 6n
660
- // 100 EURC (6 decimals)
657
+ USDC: 10n * 10n ** 6n,
658
+ // 10 USDC (6 decimals)
659
+ EURC: 10n * 10n ** 6n
660
+ // 10 EURC (6 decimals)
661
661
  }
662
662
  };
663
663
  var MIN_PORTFOLIO_USD = {
664
664
  1: { WETH: 10000n },
665
- 8453: { WETH: 100n, NVDAc: 100n },
666
- 42161: { WETH: 100n }
665
+ 8453: { WETH: 10n, NVDAc: 10n },
666
+ 42161: { WETH: 10n }
667
667
  };
668
668
  var DEPOSIT_CREDIT_INTERVAL_MS = {
669
669
  1: 2e3,
package/dist/index.mjs CHANGED
@@ -580,22 +580,22 @@ var MIN_PORTFOLIO_BALANCE = {
580
580
  // 10,000 EURC (6 decimals)
581
581
  },
582
582
  8453: {
583
- USDC: 100n * 10n ** 6n,
584
- // 100 USDC (6 decimals)
585
- EURC: 100n * 10n ** 6n
586
- // 100 EURC (6 decimals)
583
+ USDC: 10n * 10n ** 6n,
584
+ // 10 USDC (6 decimals)
585
+ EURC: 10n * 10n ** 6n
586
+ // 10 EURC (6 decimals)
587
587
  },
588
588
  42161: {
589
- USDC: 100n * 10n ** 6n,
590
- // 100 USDC (6 decimals)
591
- EURC: 100n * 10n ** 6n
592
- // 100 EURC (6 decimals)
589
+ USDC: 10n * 10n ** 6n,
590
+ // 10 USDC (6 decimals)
591
+ EURC: 10n * 10n ** 6n
592
+ // 10 EURC (6 decimals)
593
593
  }
594
594
  };
595
595
  var MIN_PORTFOLIO_USD = {
596
596
  1: { WETH: 10000n },
597
- 8453: { WETH: 100n, NVDAc: 100n },
598
- 42161: { WETH: 100n }
597
+ 8453: { WETH: 10n, NVDAc: 10n },
598
+ 42161: { WETH: 10n }
599
599
  };
600
600
  var DEPOSIT_CREDIT_INTERVAL_MS = {
601
601
  1: 2e3,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zyfai/sdk",
3
- "version": "0.4.0",
4
- "description": "TypeScript SDK for Zyfai Yield Optimization Engine - Deploy Safe smart wallets, manage session keys, and interact with DeFi protocols",
3
+ "version": "0.4.1",
4
+ "description": "TypeScript SDK for self-custodial Zyfai yield agents: discover DeFi opportunities and manage deposits, withdrawals, positions, and strategies across Ethereum, Base, and Arbitrum",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -44,6 +44,9 @@
44
44
  "defi",
45
45
  "yield",
46
46
  "yield-optimization",
47
+ "yield-agent",
48
+ "defi-agent",
49
+ "self-custodial",
47
50
  "web3",
48
51
  "ethereum",
49
52
  "smart-wallet",