@zyfai/sdk 0.2.11 → 0.2.12
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 +30 -2
- package/dist/index.d.mts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +14 -2
- package/dist/index.mjs +14 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -462,12 +462,39 @@ The SDK provides access to various analytics and data endpoints:
|
|
|
462
462
|
|
|
463
463
|
#### Get User Details
|
|
464
464
|
|
|
465
|
+
Fetch complete authenticated user profile including smart wallet, chains, protocols, and all configuration settings:
|
|
466
|
+
|
|
465
467
|
```typescript
|
|
466
468
|
const user = await sdk.getUserDetails();
|
|
469
|
+
|
|
467
470
|
console.log("Smart Wallet:", user.user.smartWallet);
|
|
468
471
|
console.log("Active Chains:", user.user.chains);
|
|
469
472
|
console.log("Active Protocols:", user.user.protocols);
|
|
470
|
-
|
|
473
|
+
console.log("Strategy:", user.user.strategy); // "conservative" | "aggressive"
|
|
474
|
+
console.log("Has Active Session:", user.user.hasActiveSessionKey);
|
|
475
|
+
|
|
476
|
+
// Feature flags
|
|
477
|
+
console.log("Auto-compounding:", user.user.autocompounding);
|
|
478
|
+
console.log("Auto-select Protocols:", user.user.autoSelectProtocols);
|
|
479
|
+
console.log("Omni Account:", user.user.omniAccount);
|
|
480
|
+
console.log("Cross-chain Strategy:", user.user.crosschainStrategy);
|
|
481
|
+
console.log("Executor Proxy:", user.user.executorProxy);
|
|
482
|
+
console.log("Splitting:", user.user.splitting);
|
|
483
|
+
console.log("Min Splits:", user.user.minSplits);
|
|
484
|
+
|
|
485
|
+
// Optional fields
|
|
486
|
+
console.log("Email:", user.user.email);
|
|
487
|
+
console.log("Telegram ID:", user.user.telegramId);
|
|
488
|
+
console.log("Agent Name:", user.user.agentName);
|
|
489
|
+
console.log("Wallet Type:", user.user.walletType);
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
**Available Fields:**
|
|
493
|
+
- **Core Info**: `id`, `address`, `smartWallet`, `chains`, `protocols`
|
|
494
|
+
- **Strategy**: `strategy` (conservative or aggressive)
|
|
495
|
+
- **Session**: `hasActiveSessionKey` (boolean)
|
|
496
|
+
- **Features**: `autocompounding`, `autoSelectProtocols`, `omniAccount`, `crosschainStrategy`, `executorProxy`, `splitting`, `minSplits`
|
|
497
|
+
- **Optional**: `email`, `telegramId`, `agentName`, `walletType`, `customization`, `registered`
|
|
471
498
|
|
|
472
499
|
#### Pause Agent
|
|
473
500
|
|
|
@@ -726,7 +753,8 @@ All examples are available in the `examples/` directory:
|
|
|
726
753
|
8. **`get-positions.ts`** - Get active positions for a wallet
|
|
727
754
|
9. **`get-user-details.ts`** - Get authenticated user details
|
|
728
755
|
10. **`pause-agent.ts`** - Pause agent by clearing all protocols
|
|
729
|
-
11. **`
|
|
756
|
+
11. **`update-profile-with-protocols.ts`** - Configure user profile with protocols, chains, and advanced features
|
|
757
|
+
12. **`get-tvl-volume.ts`** - Get TVL and trading volume
|
|
730
758
|
12. **`get-active-wallets.ts`** - Get active wallets by chain
|
|
731
759
|
13. **`get-smart-wallets-by-eoa.ts`** - Get smart wallets by EOA
|
|
732
760
|
14. **`get-first-topup.ts`** - Get first deposit information
|
package/dist/index.d.mts
CHANGED
|
@@ -28,9 +28,14 @@ interface UpdateUserProfileRequest {
|
|
|
28
28
|
chains?: number[];
|
|
29
29
|
protocols?: string[];
|
|
30
30
|
autoSelectProtocols?: boolean;
|
|
31
|
-
|
|
31
|
+
omniAccount?: boolean;
|
|
32
|
+
autocompounding?: boolean;
|
|
33
|
+
agentName?: string;
|
|
34
|
+
crosschainStrategy?: boolean;
|
|
35
|
+
executorProxy?: boolean;
|
|
32
36
|
splitting?: boolean;
|
|
33
37
|
minSplits?: number;
|
|
38
|
+
customization?: Record<string, any>;
|
|
34
39
|
}
|
|
35
40
|
/** @internal */
|
|
36
41
|
interface UpdateUserProfileResponse {
|
|
@@ -39,6 +44,16 @@ interface UpdateUserProfileResponse {
|
|
|
39
44
|
smartWallet?: Address;
|
|
40
45
|
chains?: number[];
|
|
41
46
|
strategy?: string;
|
|
47
|
+
protocols?: string[];
|
|
48
|
+
autoSelectProtocols?: boolean;
|
|
49
|
+
omniAccount?: boolean;
|
|
50
|
+
autocompounding?: boolean;
|
|
51
|
+
agentName?: string;
|
|
52
|
+
crosschainStrategy?: boolean;
|
|
53
|
+
executorProxy?: boolean;
|
|
54
|
+
splitting?: boolean;
|
|
55
|
+
minSplits?: number;
|
|
56
|
+
customization?: Record<string, any>;
|
|
42
57
|
}
|
|
43
58
|
/** @internal */
|
|
44
59
|
interface AddSessionKeyResponse {
|
|
@@ -143,9 +158,11 @@ interface UserDetails {
|
|
|
143
158
|
omniAccount?: boolean;
|
|
144
159
|
crosschainStrategy?: boolean;
|
|
145
160
|
agentName?: string;
|
|
146
|
-
customization?: Record<string,
|
|
161
|
+
customization?: Record<string, any>;
|
|
162
|
+
executorProxy?: boolean;
|
|
147
163
|
splitting?: boolean;
|
|
148
164
|
minSplits?: number;
|
|
165
|
+
registered?: boolean;
|
|
149
166
|
}
|
|
150
167
|
interface UserDetailsResponse {
|
|
151
168
|
success: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,9 +28,14 @@ interface UpdateUserProfileRequest {
|
|
|
28
28
|
chains?: number[];
|
|
29
29
|
protocols?: string[];
|
|
30
30
|
autoSelectProtocols?: boolean;
|
|
31
|
-
|
|
31
|
+
omniAccount?: boolean;
|
|
32
|
+
autocompounding?: boolean;
|
|
33
|
+
agentName?: string;
|
|
34
|
+
crosschainStrategy?: boolean;
|
|
35
|
+
executorProxy?: boolean;
|
|
32
36
|
splitting?: boolean;
|
|
33
37
|
minSplits?: number;
|
|
38
|
+
customization?: Record<string, any>;
|
|
34
39
|
}
|
|
35
40
|
/** @internal */
|
|
36
41
|
interface UpdateUserProfileResponse {
|
|
@@ -39,6 +44,16 @@ interface UpdateUserProfileResponse {
|
|
|
39
44
|
smartWallet?: Address;
|
|
40
45
|
chains?: number[];
|
|
41
46
|
strategy?: string;
|
|
47
|
+
protocols?: string[];
|
|
48
|
+
autoSelectProtocols?: boolean;
|
|
49
|
+
omniAccount?: boolean;
|
|
50
|
+
autocompounding?: boolean;
|
|
51
|
+
agentName?: string;
|
|
52
|
+
crosschainStrategy?: boolean;
|
|
53
|
+
executorProxy?: boolean;
|
|
54
|
+
splitting?: boolean;
|
|
55
|
+
minSplits?: number;
|
|
56
|
+
customization?: Record<string, any>;
|
|
42
57
|
}
|
|
43
58
|
/** @internal */
|
|
44
59
|
interface AddSessionKeyResponse {
|
|
@@ -143,9 +158,11 @@ interface UserDetails {
|
|
|
143
158
|
omniAccount?: boolean;
|
|
144
159
|
crosschainStrategy?: boolean;
|
|
145
160
|
agentName?: string;
|
|
146
|
-
customization?: Record<string,
|
|
161
|
+
customization?: Record<string, any>;
|
|
162
|
+
executorProxy?: boolean;
|
|
147
163
|
splitting?: boolean;
|
|
148
164
|
minSplits?: number;
|
|
165
|
+
registered?: boolean;
|
|
149
166
|
}
|
|
150
167
|
interface UserDetailsResponse {
|
|
151
168
|
success: boolean;
|
package/dist/index.js
CHANGED
|
@@ -794,7 +794,17 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
794
794
|
userId: response.userId || response.id,
|
|
795
795
|
smartWallet: response.smartWallet,
|
|
796
796
|
chains: response.chains,
|
|
797
|
-
strategy: response.strategy
|
|
797
|
+
strategy: response.strategy,
|
|
798
|
+
protocols: response.protocols,
|
|
799
|
+
autoSelectProtocols: response.autoSelectProtocols,
|
|
800
|
+
omniAccount: response.omniAccount,
|
|
801
|
+
autocompounding: response.autocompounding,
|
|
802
|
+
agentName: response.agentName,
|
|
803
|
+
crosschainStrategy: response.crosschainStrategy,
|
|
804
|
+
executorProxy: response.executorProxy,
|
|
805
|
+
splitting: response.splitting,
|
|
806
|
+
minSplits: response.minSplits,
|
|
807
|
+
customization: response.customization
|
|
798
808
|
};
|
|
799
809
|
} catch (error) {
|
|
800
810
|
throw new Error(
|
|
@@ -1750,8 +1760,10 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
1750
1760
|
crosschainStrategy: convertedResponse.crosschainStrategy,
|
|
1751
1761
|
agentName: convertedResponse.agentName,
|
|
1752
1762
|
customization: convertedResponse.customization,
|
|
1763
|
+
executorProxy: convertedResponse.executorProxy,
|
|
1753
1764
|
splitting: convertedResponse.splitting,
|
|
1754
|
-
minSplits: convertedResponse.minSplits
|
|
1765
|
+
minSplits: convertedResponse.minSplits,
|
|
1766
|
+
registered: convertedResponse.registered
|
|
1755
1767
|
}
|
|
1756
1768
|
};
|
|
1757
1769
|
} catch (error) {
|
package/dist/index.mjs
CHANGED
|
@@ -772,7 +772,17 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
772
772
|
userId: response.userId || response.id,
|
|
773
773
|
smartWallet: response.smartWallet,
|
|
774
774
|
chains: response.chains,
|
|
775
|
-
strategy: response.strategy
|
|
775
|
+
strategy: response.strategy,
|
|
776
|
+
protocols: response.protocols,
|
|
777
|
+
autoSelectProtocols: response.autoSelectProtocols,
|
|
778
|
+
omniAccount: response.omniAccount,
|
|
779
|
+
autocompounding: response.autocompounding,
|
|
780
|
+
agentName: response.agentName,
|
|
781
|
+
crosschainStrategy: response.crosschainStrategy,
|
|
782
|
+
executorProxy: response.executorProxy,
|
|
783
|
+
splitting: response.splitting,
|
|
784
|
+
minSplits: response.minSplits,
|
|
785
|
+
customization: response.customization
|
|
776
786
|
};
|
|
777
787
|
} catch (error) {
|
|
778
788
|
throw new Error(
|
|
@@ -1728,8 +1738,10 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
1728
1738
|
crosschainStrategy: convertedResponse.crosschainStrategy,
|
|
1729
1739
|
agentName: convertedResponse.agentName,
|
|
1730
1740
|
customization: convertedResponse.customization,
|
|
1741
|
+
executorProxy: convertedResponse.executorProxy,
|
|
1731
1742
|
splitting: convertedResponse.splitting,
|
|
1732
|
-
minSplits: convertedResponse.minSplits
|
|
1743
|
+
minSplits: convertedResponse.minSplits,
|
|
1744
|
+
registered: convertedResponse.registered
|
|
1733
1745
|
}
|
|
1734
1746
|
};
|
|
1735
1747
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyfai/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "TypeScript SDK for Zyfai Yield Optimization Engine - Deploy Safe smart wallets, manage session keys, and interact with DeFi protocols",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|