@alphafi/alphafi-sdk 0.0.2 → 0.0.4
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 +97 -1
- package/dist/getAllVaults.d.ts +4 -0
- package/dist/getAllVaults.d.ts.map +1 -0
- package/dist/getVaults.d.ts +2 -0
- package/dist/getVaults.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
- package/.babelrc +0 -6
- package/.eslintrc.json +0 -30
- package/jest.config.js +0 -14
- package/src/common/cetus_mainnet_config.ts +0 -72
- package/src/common/coins.ts +0 -126
- package/src/common/constants.ts +0 -820
- package/src/common/maps.ts +0 -200
- package/src/common/pyth.ts +0 -23
- package/src/common/types.ts +0 -446
- package/src/functions.ts +0 -299
- package/src/getVaultBalances.ts +0 -128
- package/src/getVaults.ts +0 -63
- package/src/index.ts +0 -13
- package/src/portfolioAmount.ts +0 -365
- package/src/price.ts +0 -397
- package/tsconfig.json +0 -21
- package/webpack.config.js +0 -59
package/README.md
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ALPHAFI TypeScript SDK
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i @alphafi/alphafi-sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## `getVaults`
|
|
10
|
+
|
|
11
|
+
Call this to get all Vaults that a particular user has deposited in.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { getVaults, AlphaFiVault } from "alphafi-sdk";
|
|
15
|
+
|
|
16
|
+
const vaults: AlphaFiVault[] | undefined = await getVaults(address);
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## `getSingleAssetVaults`
|
|
20
|
+
|
|
21
|
+
Call this to get all Single Asset Vaults that a particular user has deposited in.
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { getSingleAssetVaults, AlphaFiVault } from "alphafi-sdk";
|
|
25
|
+
|
|
26
|
+
const vaults: AlphaFiVault[] | undefined = await getSingleAssetVaults(address);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## `getDoubleAssetVaults`
|
|
30
|
+
|
|
31
|
+
Call this to get all Double Asset Vaults that a particular user has deposited in.
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { getDoubleAssetVaults, AlphaFiVault } from "alphafi-sdk";
|
|
35
|
+
|
|
36
|
+
const vaults: AlphaFiVault[] | undefined = await getDoubleAssetVaults(address);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## `getAlphaVaultBalance`
|
|
40
|
+
|
|
41
|
+
Call this to get user balance in Alpha Vault.
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { getAlphaVaultBalance, AlphaVaultBalance } from "alphafi-sdk";
|
|
45
|
+
|
|
46
|
+
const balance: AlphaVaultBalance | undefined = await getAlphaVaultBalance(address);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## `getSingleAssetVaultBalance`
|
|
50
|
+
|
|
51
|
+
Call this to get user balance in Single Asset Vaults.
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { getSingleAssetVaultBalance, SingleAssetVaultBalance } from "alphafi-sdk";
|
|
55
|
+
|
|
56
|
+
const balance: SingleAssetVaultBalance | undefined = await getSingleAssetVaultBalance(address, poolName);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## `getDoubleAssetVaultBalance`
|
|
60
|
+
|
|
61
|
+
Call this to get user balance in Double Asset Vaults.
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import { getDoubleAssetVaultBalance, DoubleAssetVaultBalance } from "alphafi-sdk";
|
|
65
|
+
|
|
66
|
+
const balance: DoubleAssetVaultBalance | undefined = await getDoubleAssetVaultBalance(address, poolName);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## `getAllVaults`
|
|
70
|
+
|
|
71
|
+
Call this to get all Vaults on AlphaFi Protocol.
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { getAllVaults } from "alphafi-sdk";
|
|
75
|
+
|
|
76
|
+
const vaults: string[] = await getAllVaults();
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## `getAllSingleAssetVaults`
|
|
80
|
+
|
|
81
|
+
Call this to get all Single Asset Vaults on AlphaFi Protocol.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { getAllSingleAssetVaults } from "alphafi-sdk";
|
|
85
|
+
|
|
86
|
+
const vaults: string[] = await getAllSingleAssetVaults();
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## `getAllDoubleAssetVaults`
|
|
90
|
+
|
|
91
|
+
Call this to get all Double Asset Vaults on AlphaFi Protocol.
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { getAllDoubleAssetVaults } from "alphafi-sdk";
|
|
95
|
+
|
|
96
|
+
const vaults: string[] = await getAllDoubleAssetVaults();
|
|
97
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllVaults.d.ts","sourceRoot":"","sources":["../src/getAllVaults.ts"],"names":[],"mappings":"AAEA,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAMtD;AAED,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAQjE;AAED,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAQjE"}
|
package/dist/getVaults.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { AlphaFiVault } from "./common/types";
|
|
2
2
|
export declare function getVaults(address: string): Promise<AlphaFiVault[] | undefined>;
|
|
3
|
+
export declare function getSingleAssetVaults(address: string): Promise<AlphaFiVault[] | undefined>;
|
|
4
|
+
export declare function getDoubleAssetVaults(address: string): Promise<AlphaFiVault[] | undefined>;
|
|
3
5
|
//# sourceMappingURL=getVaults.d.ts.map
|
package/dist/getVaults.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVaults.d.ts","sourceRoot":"","sources":["../src/getVaults.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAqB9C,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,CAoCrC"}
|
|
1
|
+
{"version":3,"file":"getVaults.d.ts","sourceRoot":"","sources":["../src/getVaults.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAqB9C,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,CAoCrC;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,CAMrC;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,EAAE,GAAG,SAAS,CAAC,CAMrC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { getVaults } from "./getVaults";
|
|
1
|
+
export { getVaults, getSingleAssetVaults, getDoubleAssetVaults, } from "./getVaults";
|
|
2
2
|
export { getAlphaVaultBalance, getSingleAssetVaultBalance, getDoubleAssetVaultBalance, } from "./getVaultBalances";
|
|
3
|
+
export { getAllVaults, getAllDoubleAssetVaults, getAllSingleAssetVaults, } from "./getAllVaults";
|
|
3
4
|
export { AlphaFiVault, AlphaVaultBalance, DoubleAssetVaultBalance, SingleAssetVaultBalance, PoolName, } from "./common/types";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,QAAQ,GACT,MAAM,gBAAgB,CAAC"}
|