@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 +11 -11
- package/dist/index.js +10 -10
- package/dist/index.mjs +10 -10
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@zyfai/sdk)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
TypeScript SDK for
|
|
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
|
-
|
|
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
|
-
- **
|
|
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://
|
|
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:
|
|
430
|
-
- WETH: about **$10,000** of ETH on Ethereum Mainnet, **$
|
|
431
|
-
- NVDAc: about **$
|
|
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 $
|
|
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.
|
|
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 ~$
|
|
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
|
|
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:
|
|
652
|
-
//
|
|
653
|
-
EURC:
|
|
654
|
-
//
|
|
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:
|
|
658
|
-
//
|
|
659
|
-
EURC:
|
|
660
|
-
//
|
|
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:
|
|
666
|
-
42161: { WETH:
|
|
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:
|
|
584
|
-
//
|
|
585
|
-
EURC:
|
|
586
|
-
//
|
|
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:
|
|
590
|
-
//
|
|
591
|
-
EURC:
|
|
592
|
-
//
|
|
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:
|
|
598
|
-
42161: { WETH:
|
|
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.
|
|
4
|
-
"description": "TypeScript SDK for Zyfai
|
|
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",
|