@zyfai/sdk 0.2.49 → 0.2.50
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 +1 -0
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +11 -4
- package/dist/index.mjs +11 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -739,6 +739,7 @@ console.log("Chain ID:", firstTopup.chainId);
|
|
|
739
739
|
const history = await sdk.getHistory(walletAddress, 8453, {
|
|
740
740
|
limit: 50,
|
|
741
741
|
fromDate: "2024-01-01",
|
|
742
|
+
assetType: "eth",
|
|
742
743
|
});
|
|
743
744
|
history.data.forEach((tx) => console.log(tx.type, tx.amount));
|
|
744
745
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -1310,12 +1310,15 @@ declare class ZyfaiSDK {
|
|
|
1310
1310
|
*
|
|
1311
1311
|
* @param walletAddress - Smart wallet address
|
|
1312
1312
|
* @param chainId - Chain ID
|
|
1313
|
-
* @param options - Optional pagination and
|
|
1313
|
+
* @param options - Optional pagination, date, and assetType filters
|
|
1314
1314
|
* @returns Transaction history
|
|
1315
1315
|
*
|
|
1316
1316
|
* @example
|
|
1317
1317
|
* ```typescript
|
|
1318
|
-
* const history = await sdk.getHistory("0x...", 8453, {
|
|
1318
|
+
* const history = await sdk.getHistory("0x...", 8453, {
|
|
1319
|
+
* limit: 50,
|
|
1320
|
+
* assetType: "eth",
|
|
1321
|
+
* });
|
|
1319
1322
|
* history.data.forEach(tx => console.log(tx.type, tx.amount));
|
|
1320
1323
|
* ```
|
|
1321
1324
|
*/
|
|
@@ -1324,6 +1327,7 @@ declare class ZyfaiSDK {
|
|
|
1324
1327
|
offset?: number;
|
|
1325
1328
|
fromDate?: string;
|
|
1326
1329
|
toDate?: string;
|
|
1330
|
+
assetType?: "usdc" | "eth" | "eurc";
|
|
1327
1331
|
}): Promise<HistoryResponse>;
|
|
1328
1332
|
/**
|
|
1329
1333
|
* Get onchain earnings for a wallet
|
package/dist/index.d.ts
CHANGED
|
@@ -1310,12 +1310,15 @@ declare class ZyfaiSDK {
|
|
|
1310
1310
|
*
|
|
1311
1311
|
* @param walletAddress - Smart wallet address
|
|
1312
1312
|
* @param chainId - Chain ID
|
|
1313
|
-
* @param options - Optional pagination and
|
|
1313
|
+
* @param options - Optional pagination, date, and assetType filters
|
|
1314
1314
|
* @returns Transaction history
|
|
1315
1315
|
*
|
|
1316
1316
|
* @example
|
|
1317
1317
|
* ```typescript
|
|
1318
|
-
* const history = await sdk.getHistory("0x...", 8453, {
|
|
1318
|
+
* const history = await sdk.getHistory("0x...", 8453, {
|
|
1319
|
+
* limit: 50,
|
|
1320
|
+
* assetType: "eth",
|
|
1321
|
+
* });
|
|
1319
1322
|
* history.data.forEach(tx => console.log(tx.type, tx.amount));
|
|
1320
1323
|
* ```
|
|
1321
1324
|
*/
|
|
@@ -1324,6 +1327,7 @@ declare class ZyfaiSDK {
|
|
|
1324
1327
|
offset?: number;
|
|
1325
1328
|
fromDate?: string;
|
|
1326
1329
|
toDate?: string;
|
|
1330
|
+
assetType?: "usdc" | "eth" | "eurc";
|
|
1327
1331
|
}): Promise<HistoryResponse>;
|
|
1328
1332
|
/**
|
|
1329
1333
|
* Get onchain earnings for a wallet
|
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ var ENDPOINTS = {
|
|
|
81
81
|
// Data (v1)
|
|
82
82
|
DATA_POSITION: (walletAddress) => `/data/position?walletAddress=${walletAddress}`,
|
|
83
83
|
DATA_PORTFOLIO: (walletAddress) => `/data/wallet-portfolio?walletAddress=${walletAddress}`,
|
|
84
|
-
DATA_HISTORY: (walletAddress, chainId) => `/data/history?walletAddress=${walletAddress}&chainId=${chainId}`,
|
|
84
|
+
DATA_HISTORY: (walletAddress, chainId, assetType) => `/data/history?walletAddress=${walletAddress}&chainId=${chainId}${assetType ? `&assetType=${assetType}` : ""}`,
|
|
85
85
|
DATA_TVL: "/data/usd-tvl",
|
|
86
86
|
DATA_VOLUME: (assetType) => `/data/volume?assetType=${assetType}`,
|
|
87
87
|
DATA_FIRST_TOPUP: (walletAddress, chainId) => `/data/first-topup?walletAddress=${walletAddress}&chainId=${chainId}`,
|
|
@@ -3132,12 +3132,15 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
3132
3132
|
*
|
|
3133
3133
|
* @param walletAddress - Smart wallet address
|
|
3134
3134
|
* @param chainId - Chain ID
|
|
3135
|
-
* @param options - Optional pagination and
|
|
3135
|
+
* @param options - Optional pagination, date, and assetType filters
|
|
3136
3136
|
* @returns Transaction history
|
|
3137
3137
|
*
|
|
3138
3138
|
* @example
|
|
3139
3139
|
* ```typescript
|
|
3140
|
-
* const history = await sdk.getHistory("0x...", 8453, {
|
|
3140
|
+
* const history = await sdk.getHistory("0x...", 8453, {
|
|
3141
|
+
* limit: 50,
|
|
3142
|
+
* assetType: "eth",
|
|
3143
|
+
* });
|
|
3141
3144
|
* history.data.forEach(tx => console.log(tx.type, tx.amount));
|
|
3142
3145
|
* ```
|
|
3143
3146
|
*/
|
|
@@ -3149,7 +3152,11 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
3149
3152
|
if (!chainId) {
|
|
3150
3153
|
throw new Error("Chain ID is required");
|
|
3151
3154
|
}
|
|
3152
|
-
let endpoint = ENDPOINTS.DATA_HISTORY(
|
|
3155
|
+
let endpoint = ENDPOINTS.DATA_HISTORY(
|
|
3156
|
+
walletAddress,
|
|
3157
|
+
chainId,
|
|
3158
|
+
options?.assetType
|
|
3159
|
+
);
|
|
3153
3160
|
if (options?.limit) endpoint += `&limit=${options.limit}`;
|
|
3154
3161
|
if (options?.offset) endpoint += `&offset=${options.offset}`;
|
|
3155
3162
|
if (options?.fromDate) endpoint += `&fromDate=${options.fromDate}`;
|
package/dist/index.mjs
CHANGED
|
@@ -29,7 +29,7 @@ var ENDPOINTS = {
|
|
|
29
29
|
// Data (v1)
|
|
30
30
|
DATA_POSITION: (walletAddress) => `/data/position?walletAddress=${walletAddress}`,
|
|
31
31
|
DATA_PORTFOLIO: (walletAddress) => `/data/wallet-portfolio?walletAddress=${walletAddress}`,
|
|
32
|
-
DATA_HISTORY: (walletAddress, chainId) => `/data/history?walletAddress=${walletAddress}&chainId=${chainId}`,
|
|
32
|
+
DATA_HISTORY: (walletAddress, chainId, assetType) => `/data/history?walletAddress=${walletAddress}&chainId=${chainId}${assetType ? `&assetType=${assetType}` : ""}`,
|
|
33
33
|
DATA_TVL: "/data/usd-tvl",
|
|
34
34
|
DATA_VOLUME: (assetType) => `/data/volume?assetType=${assetType}`,
|
|
35
35
|
DATA_FIRST_TOPUP: (walletAddress, chainId) => `/data/first-topup?walletAddress=${walletAddress}&chainId=${chainId}`,
|
|
@@ -3100,12 +3100,15 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
3100
3100
|
*
|
|
3101
3101
|
* @param walletAddress - Smart wallet address
|
|
3102
3102
|
* @param chainId - Chain ID
|
|
3103
|
-
* @param options - Optional pagination and
|
|
3103
|
+
* @param options - Optional pagination, date, and assetType filters
|
|
3104
3104
|
* @returns Transaction history
|
|
3105
3105
|
*
|
|
3106
3106
|
* @example
|
|
3107
3107
|
* ```typescript
|
|
3108
|
-
* const history = await sdk.getHistory("0x...", 8453, {
|
|
3108
|
+
* const history = await sdk.getHistory("0x...", 8453, {
|
|
3109
|
+
* limit: 50,
|
|
3110
|
+
* assetType: "eth",
|
|
3111
|
+
* });
|
|
3109
3112
|
* history.data.forEach(tx => console.log(tx.type, tx.amount));
|
|
3110
3113
|
* ```
|
|
3111
3114
|
*/
|
|
@@ -3117,7 +3120,11 @@ var _ZyfaiSDK = class _ZyfaiSDK {
|
|
|
3117
3120
|
if (!chainId) {
|
|
3118
3121
|
throw new Error("Chain ID is required");
|
|
3119
3122
|
}
|
|
3120
|
-
let endpoint = ENDPOINTS.DATA_HISTORY(
|
|
3123
|
+
let endpoint = ENDPOINTS.DATA_HISTORY(
|
|
3124
|
+
walletAddress,
|
|
3125
|
+
chainId,
|
|
3126
|
+
options?.assetType
|
|
3127
|
+
);
|
|
3121
3128
|
if (options?.limit) endpoint += `&limit=${options.limit}`;
|
|
3122
3129
|
if (options?.offset) endpoint += `&offset=${options.offset}`;
|
|
3123
3130
|
if (options?.fromDate) endpoint += `&fromDate=${options.fromDate}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zyfai/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.50",
|
|
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",
|