@vaultsfyi/sdk 1.0.0 → 1.0.2
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/CHANGELOG.md +7 -0
- package/README.md +76 -0
- package/dist/client.d.mts +8913 -0
- package/dist/client.d.ts +8913 -0
- package/dist/client.js +213 -0
- package/dist/client.js.map +1 -0
- package/dist/client.mjs +186 -0
- package/dist/client.mjs.map +1 -0
- package/package.json +15 -13
- package/.turbo/turbo-lint$colon$fix.log +0 -5
- package/.turbo/turbo-lint.log +0 -9
- package/src/client.ts +0 -155
- package/src/errors.ts +0 -1
- package/src/types/openapi.ts +0 -3956
- package/src/utils/generateQueryParams.ts +0 -20
- package/test/constructor.test.ts +0 -18
- package/test/utils/generateQueryParams.test.ts +0 -26
- package/tsconfig.json +0 -13
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# `@vaultsfyi/sdk`
|
|
2
|
+
An SDK for interacting with the VaultsFYI API.
|
|
3
|
+
|
|
4
|
+
## Installation
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install @vaultsfyi/sdk
|
|
8
|
+
# or
|
|
9
|
+
pnpm add @vaultsfyi/sdk
|
|
10
|
+
# or
|
|
11
|
+
yarn add @vaultsfyi/sdk
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```javascript
|
|
17
|
+
// Import the SDK
|
|
18
|
+
import { VaultsSdk } from "@vaultsfyi/sdk";
|
|
19
|
+
|
|
20
|
+
// Initialize the SDK with your API key
|
|
21
|
+
const sdk = new VaultsSdk({ apiKey: "your-api-key" })
|
|
22
|
+
|
|
23
|
+
// Example usage: get all vaults
|
|
24
|
+
async function main() {
|
|
25
|
+
const vaults = await sdk.getAllVaults()
|
|
26
|
+
console.log(vaults)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
main()
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Available Methods
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Get information about all vaults
|
|
36
|
+
getAllVaults(params?: Params<'/v1/detailed/vaults'>)
|
|
37
|
+
|
|
38
|
+
// Get information about a specific vault
|
|
39
|
+
getVault(params: { path: { network: string, vaultAddress: string } })
|
|
40
|
+
|
|
41
|
+
// Get APY information for a vault
|
|
42
|
+
getVaultApy(params: { path: { network: string, vaultAddress: string } })
|
|
43
|
+
|
|
44
|
+
// Get historical data for a vault
|
|
45
|
+
getHistoricalData(params: { path: { network: string, vaultAddress: string } })
|
|
46
|
+
|
|
47
|
+
// Get holder events for a specific address
|
|
48
|
+
getVaultHolderEvents(params: { path: { network: string, vaultAddress: string, holder: string } })
|
|
49
|
+
|
|
50
|
+
// Get total returns for a specific holder
|
|
51
|
+
getVaultTotalReturns(params: { path: { network: string, vaultAddress: string, holder: string } })
|
|
52
|
+
|
|
53
|
+
// Get best deposit options for a user
|
|
54
|
+
bestDepositOption(params: { path: { userAddress: string } })
|
|
55
|
+
|
|
56
|
+
// Get wallet balances
|
|
57
|
+
getWalletBalances(params)
|
|
58
|
+
|
|
59
|
+
// Get all positions for a user
|
|
60
|
+
getAllPositions(params: { path: { userAddress: string } })
|
|
61
|
+
|
|
62
|
+
// Get benchmarks
|
|
63
|
+
getBenchmarks()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Configuration
|
|
67
|
+
|
|
68
|
+
You can override the default API URL:
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
const sdk = new VaultsSdk(
|
|
72
|
+
{ apiKey: "your-api-key" },
|
|
73
|
+
{ apiBaseUrl: "https://custom-api.example.com" }
|
|
74
|
+
)
|
|
75
|
+
```
|
|
76
|
+
|