@alphafi/alphafi-sdk 0.0.20 → 0.0.22
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/dist/cjs/common/coins.d.ts.map +1 -1
- package/dist/cjs/common/coins.js +7 -1
- package/dist/cjs/common/coins.js.map +1 -1
- package/dist/cjs/common/constants.d.ts.map +1 -1
- package/dist/cjs/common/constants.js +145 -121
- package/dist/cjs/common/constants.js.map +1 -1
- package/dist/cjs/common/maps.d.ts.map +1 -1
- package/dist/cjs/common/maps.js +183 -157
- package/dist/cjs/common/maps.js.map +1 -1
- package/dist/cjs/common/pyth.d.ts.map +1 -1
- package/dist/cjs/common/pyth.js.map +1 -1
- package/dist/cjs/common/types.d.ts.map +1 -1
- package/dist/cjs/common/types.js +6 -5
- package/dist/cjs/common/types.js.map +1 -1
- package/dist/cjs/getAllVaults.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js +2 -2
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.js +5 -5
- package/dist/cjs/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/cjs/utils/hop.d.ts.map +1 -1
- package/dist/cjs/utils/hop.js +6 -0
- package/dist/cjs/utils/hop.js.map +1 -1
- package/dist/cjs/utils/prices.d.ts.map +1 -1
- package/dist/cjs/utils/prices.js +11 -0
- package/dist/cjs/utils/prices.js.map +1 -1
- package/dist/esm/common/coins.d.ts.map +1 -1
- package/dist/esm/common/coins.js +7 -1
- package/dist/esm/common/coins.js.map +1 -1
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +145 -121
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/common/maps.d.ts.map +1 -1
- package/dist/esm/common/maps.js +183 -157
- package/dist/esm/common/maps.js.map +1 -1
- package/dist/esm/common/pyth.d.ts.map +1 -1
- package/dist/esm/common/pyth.js.map +1 -1
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js +6 -5
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/getAllVaults.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js +2 -2
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.js +5 -5
- package/dist/esm/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/esm/utils/hop.d.ts.map +1 -1
- package/dist/esm/utils/hop.js +5 -0
- package/dist/esm/utils/hop.js.map +1 -1
- package/dist/esm/utils/prices.d.ts.map +1 -1
- package/dist/esm/utils/prices.js +12 -2
- package/dist/esm/utils/prices.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.LICENSE.txt +48 -0
- package/dist/index.js.map +1 -0
- package/package.json +2 -2
- package/dist/cjs/graphql/queries/autoCompoundEvents.graphql +0 -14
- package/dist/cjs/graphql/queries/cetusPools.graphql +0 -48
- package/dist/cjs/graphql/queries/investors.graphql +0 -48
- package/dist/cjs/graphql/queries/lockedTableData.graphql +0 -25
- package/dist/cjs/graphql/queries/lockedTableDataFragment.graphql +0 -19
- package/dist/cjs/graphql/queries/nftHolders.graphql +0 -18
- package/dist/cjs/graphql/queries/pools.graphql +0 -78
- package/dist/cjs/graphql/queries/receiptData.graphql +0 -16
- package/dist/cjs/graphql/queries/userVaultBalances.graphql +0 -57
- package/dist/cjs/graphql/queries/userVaults.graphql +0 -57
- package/dist/esm/graphql/queries/autoCompoundEvents.graphql +0 -14
- package/dist/esm/graphql/queries/cetusPools.graphql +0 -48
- package/dist/esm/graphql/queries/investors.graphql +0 -48
- package/dist/esm/graphql/queries/lockedTableData.graphql +0 -25
- package/dist/esm/graphql/queries/lockedTableDataFragment.graphql +0 -19
- package/dist/esm/graphql/queries/nftHolders.graphql +0 -18
- package/dist/esm/graphql/queries/pools.graphql +0 -78
- package/dist/esm/graphql/queries/receiptData.graphql +0 -16
- package/dist/esm/graphql/queries/userVaultBalances.graphql +0 -57
- package/dist/esm/graphql/queries/userVaults.graphql +0 -57
- package/embed-graphql.js +0 -95
- package/jest.config.cjs.js +0 -14
- package/jest.config.esm.js +0 -15
- package/tsconfig.cjs.json +0 -18
- package/tsconfig.esm.json +0 -35
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
query GetUserVaultBalances($address: SuiAddress!) {
|
|
2
|
-
owner(address: $address) {
|
|
3
|
-
alphaPoolReceipts: objects(
|
|
4
|
-
filter: {
|
|
5
|
-
type: "0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphapool::Receipt"
|
|
6
|
-
}
|
|
7
|
-
) {
|
|
8
|
-
...ReceiptFields
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
cetusSuiPoolReceipts: objects(
|
|
12
|
-
filter: {
|
|
13
|
-
type: "0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphafi_cetus_sui_pool::Receipt"
|
|
14
|
-
}
|
|
15
|
-
) {
|
|
16
|
-
...ReceiptFields
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
cetusPoolReceipts: objects(
|
|
20
|
-
filter: {
|
|
21
|
-
type: "0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphafi_cetus_pool::Receipt"
|
|
22
|
-
}
|
|
23
|
-
) {
|
|
24
|
-
...ReceiptFields
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
cetusPoolBaseAReceipts: objects(
|
|
28
|
-
filter: {
|
|
29
|
-
type: "0x2793db7aa0e0209afc84f0adb1b258973cf1c9da55c35ee85c18f2ed4912bb6f::alphafi_cetus_pool_base_a::Receipt"
|
|
30
|
-
}
|
|
31
|
-
) {
|
|
32
|
-
...ReceiptFields
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
naviPoolReceipts: objects(
|
|
36
|
-
filter: {
|
|
37
|
-
type: "0x8f7d2c35e19c65213bc2153086969a55ec207b5a25ebdee303a6d9edd9c053e3::alphafi_navi_pool::Receipt"
|
|
38
|
-
}
|
|
39
|
-
) {
|
|
40
|
-
...ReceiptFields
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
fragment ReceiptFields on MoveObjectConnection {
|
|
46
|
-
pageInfo {
|
|
47
|
-
hasNextPage
|
|
48
|
-
}
|
|
49
|
-
nodes {
|
|
50
|
-
contents {
|
|
51
|
-
type {
|
|
52
|
-
repr
|
|
53
|
-
}
|
|
54
|
-
json
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
query GetUserVaults($address: SuiAddress!) {
|
|
2
|
-
owner(address: $address) {
|
|
3
|
-
alphaObjects: objects(
|
|
4
|
-
filter: {
|
|
5
|
-
type: "0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphapool::Receipt"
|
|
6
|
-
}
|
|
7
|
-
) {
|
|
8
|
-
...ReceiptFields
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
alphaSuiObjects: objects(
|
|
12
|
-
filter: {
|
|
13
|
-
type: "0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphafi_cetus_sui_pool::Receipt"
|
|
14
|
-
}
|
|
15
|
-
) {
|
|
16
|
-
...ReceiptFields
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
usdtUsdcObjects: objects(
|
|
20
|
-
filter: {
|
|
21
|
-
type: "0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba7123::alphafi_cetus_pool::Receipt"
|
|
22
|
-
}
|
|
23
|
-
) {
|
|
24
|
-
...ReceiptFields
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
usdcWbtcObjects: objects(
|
|
28
|
-
filter: {
|
|
29
|
-
type: "0x2793db7aa0e0209afc84f0adb1b258973cf1c9da55c35ee85c18f2ed4912bb6f::alphafi_cetus_pool_base_a::Receipt"
|
|
30
|
-
}
|
|
31
|
-
) {
|
|
32
|
-
...ReceiptFields
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
naviObjects: objects(
|
|
36
|
-
filter: {
|
|
37
|
-
type: "0x8f7d2c35e19c65213bc2153086969a55ec207b5a25ebdee303a6d9edd9c053e3::alphafi_navi_pool::Receipt"
|
|
38
|
-
}
|
|
39
|
-
) {
|
|
40
|
-
...ReceiptFields
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
fragment ReceiptFields on MoveObjectConnection {
|
|
46
|
-
pageInfo {
|
|
47
|
-
hasNextPage
|
|
48
|
-
}
|
|
49
|
-
nodes {
|
|
50
|
-
contents {
|
|
51
|
-
type {
|
|
52
|
-
repr
|
|
53
|
-
}
|
|
54
|
-
json
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
package/embed-graphql.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
const path = require("path");
|
|
3
|
-
//const chokidar = require("chokidar");
|
|
4
|
-
|
|
5
|
-
const filesToEmbed = [
|
|
6
|
-
{
|
|
7
|
-
source: path.resolve(__dirname, "./src/graphql/queries/userVaults.graphql"),
|
|
8
|
-
target: path.resolve(__dirname, "./src/graphql/queries/userVaults.ts"),
|
|
9
|
-
variableName: "userVaults",
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
source: path.resolve(
|
|
13
|
-
__dirname,
|
|
14
|
-
"./src/graphql/queries/userVaultBalances.graphql",
|
|
15
|
-
),
|
|
16
|
-
target: path.resolve(
|
|
17
|
-
__dirname,
|
|
18
|
-
"./src/graphql/queries/userVaultBalances.ts",
|
|
19
|
-
),
|
|
20
|
-
variableName: "userVaultBalances",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
source: path.resolve(__dirname, "./src/graphql/queries/pools.graphql"),
|
|
24
|
-
target: path.resolve(__dirname, "./src/graphql/queries/pools.ts"),
|
|
25
|
-
variableName: "pools",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
source: path.resolve(__dirname, "./src/graphql/queries/investors.graphql"),
|
|
29
|
-
target: path.resolve(__dirname, "./src/graphql/queries/investors.ts"),
|
|
30
|
-
variableName: "investors",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
source: path.resolve(__dirname, "./src/graphql/queries/cetusPools.graphql"),
|
|
34
|
-
target: path.resolve(__dirname, "./src/graphql/queries/cetusPools.ts"),
|
|
35
|
-
variableName: "cetusPools",
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
source: path.resolve(
|
|
39
|
-
__dirname,
|
|
40
|
-
"./src/graphql/queries/autoCompoundEvents.graphql",
|
|
41
|
-
),
|
|
42
|
-
target: path.resolve(
|
|
43
|
-
__dirname,
|
|
44
|
-
"./src/graphql/queries/autoCompoundEvents.ts",
|
|
45
|
-
),
|
|
46
|
-
variableName: "autoCompoundEvents",
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
source: path.resolve(__dirname, "./src/graphql/queries/nftHolders.graphql"),
|
|
50
|
-
target: path.resolve(__dirname, "./src/graphql/queries/nftHolders.ts"),
|
|
51
|
-
variableName: "nftHolders",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
source: path.resolve(
|
|
55
|
-
__dirname,
|
|
56
|
-
"./src/graphql/queries/receiptData.graphql",
|
|
57
|
-
),
|
|
58
|
-
target: path.resolve(__dirname, "./src/graphql/queries/receiptData.ts"),
|
|
59
|
-
variableName: "receiptData",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
source: path.resolve(
|
|
63
|
-
__dirname,
|
|
64
|
-
"./src/graphql/queries/lockedTableDataFragment.graphql",
|
|
65
|
-
),
|
|
66
|
-
target: path.resolve(
|
|
67
|
-
__dirname,
|
|
68
|
-
"./src/graphql/queries/lockedTableDataFragment.ts",
|
|
69
|
-
),
|
|
70
|
-
variableName: "lockedTableDataFragment",
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
source: path.resolve(
|
|
74
|
-
__dirname,
|
|
75
|
-
"./src/graphql/queries/lockedTableData.graphql",
|
|
76
|
-
),
|
|
77
|
-
target: path.resolve(__dirname, "./src/graphql/queries/lockedTableData.ts"),
|
|
78
|
-
variableName: "lockedTableData",
|
|
79
|
-
},
|
|
80
|
-
];
|
|
81
|
-
|
|
82
|
-
function embedGraphQL() {
|
|
83
|
-
filesToEmbed.forEach(({ source, target, variableName }) => {
|
|
84
|
-
const content = fs.readFileSync(source, "utf-8");
|
|
85
|
-
const tsContent = `export const ${variableName} = \`${content}\`;`;
|
|
86
|
-
fs.writeFileSync(target, tsContent);
|
|
87
|
-
console.log(`Embedded ${path.basename(source)} into ${target}`);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Run initially
|
|
92
|
-
embedGraphQL();
|
|
93
|
-
|
|
94
|
-
// Watch for changes in GraphQL files and re-embed
|
|
95
|
-
// chokidar.watch(filesToEmbed.map((f) => f.source)).on("change", embedGraphQL);
|
package/jest.config.cjs.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
preset: "ts-jest",
|
|
3
|
-
testEnvironment: "node",
|
|
4
|
-
rootDir: "__tests__", // root directory for Jest
|
|
5
|
-
transform: {
|
|
6
|
-
"^.+\\.ts$": [
|
|
7
|
-
"ts-jest",
|
|
8
|
-
{
|
|
9
|
-
useESM: false, // Do not treat files as ESM
|
|
10
|
-
tsconfig: "tsconfig.cjs.json", // Path to your TypeScript config for CJS
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
},
|
|
14
|
-
};
|
package/jest.config.esm.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
preset: "ts-jest/presets/default-esm",
|
|
3
|
-
testEnvironment: "node",
|
|
4
|
-
rootDir: "__tests__", // root directory for Jest
|
|
5
|
-
extensionsToTreatAsEsm: [".ts"], // Treat TypeScript files as ESM
|
|
6
|
-
transform: {
|
|
7
|
-
"^.+\\.ts$": [
|
|
8
|
-
"ts-jest",
|
|
9
|
-
{
|
|
10
|
-
useESM: true, // ts-jest ESM support
|
|
11
|
-
tsconfig: "tsconfig.esm.json", // Path to your TypeScript config for ESM
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
},
|
|
15
|
-
};
|
package/tsconfig.cjs.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.esm.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "CommonJS",
|
|
5
|
-
"moduleResolution": "Node",
|
|
6
|
-
"target": "es2020",
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"outDir": "./dist/cjs",
|
|
9
|
-
"rootDir": "./src",
|
|
10
|
-
// Add the baseUrl option
|
|
11
|
-
"baseUrl": "./", // Specifies the base directory for non-relative module names
|
|
12
|
-
"paths": {
|
|
13
|
-
"@mysten/sui/*": ["node_modules/@mysten/sui/dist/cjs/*"]
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"include": ["src/**/*"],
|
|
17
|
-
"exclude": ["src/__tests__"]
|
|
18
|
-
}
|
package/tsconfig.esm.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "NodeNext",
|
|
4
|
-
"moduleResolution": "NodeNext",
|
|
5
|
-
"target": "ES2022",
|
|
6
|
-
"outDir": "./dist/esm",
|
|
7
|
-
"rootDir": "./src",
|
|
8
|
-
|
|
9
|
-
// build
|
|
10
|
-
"types": ["node", "jest"],
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"preserveConstEnums": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
|
-
"importHelpers": true,
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
"allowJs": true,
|
|
17
|
-
"checkJs": true,
|
|
18
|
-
|
|
19
|
-
// linting
|
|
20
|
-
"strict": true,
|
|
21
|
-
|
|
22
|
-
// sources
|
|
23
|
-
"sourceMap": true,
|
|
24
|
-
"declaration": true,
|
|
25
|
-
"declarationMap": true,
|
|
26
|
-
"inlineSources": true,
|
|
27
|
-
// Add the baseUrl option
|
|
28
|
-
"baseUrl": "./", // Specifies the base directory for non-relative module names
|
|
29
|
-
"paths": {
|
|
30
|
-
"@mysten/sui/*": ["node_modules/@mysten/sui/dist/esm/*"]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"include": ["src/**/*"],
|
|
34
|
-
"exclude": ["src/__tests__"]
|
|
35
|
-
}
|