@coinbase/agentkit 0.10.3 → 0.10.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 +47 -10
- package/dist/action-providers/across/acrossActionProvider.js +2 -4
- package/dist/action-providers/across/acrossActionProvider.test.js +10 -5
- package/dist/action-providers/baseAccount/baseAccountActionProvider.js +5 -7
- package/dist/action-providers/clanker/utils.d.ts +2 -1
- package/dist/action-providers/clanker/utils.js +2 -2
- package/dist/action-providers/index.d.ts +1 -0
- package/dist/action-providers/index.js +1 -0
- package/dist/action-providers/jupiter/jupiterActionProvider.js +2 -2
- package/dist/action-providers/spl/splActionProvider.js +12 -13
- package/dist/action-providers/superfluid/graphQueries/superfluidGraphQueries.js +2 -2
- package/dist/action-providers/sushi/constants.d.ts +35 -0
- package/dist/action-providers/sushi/constants.js +7 -0
- package/dist/action-providers/sushi/index.d.ts +4 -0
- package/dist/action-providers/sushi/index.js +20 -0
- package/dist/action-providers/sushi/sushiDataActionProvider.d.ts +32 -0
- package/dist/action-providers/sushi/sushiDataActionProvider.js +113 -0
- package/dist/action-providers/sushi/sushiDataSchemas.d.ts +11 -0
- package/dist/action-providers/sushi/sushiDataSchemas.js +16 -0
- package/dist/action-providers/sushi/sushiRouterActionProvider.d.ts +40 -0
- package/dist/action-providers/sushi/sushiRouterActionProvider.js +386 -0
- package/dist/action-providers/sushi/sushiRouterActionProvider.test.d.ts +1 -0
- package/dist/action-providers/sushi/sushiRouterActionProvider.test.js +392 -0
- package/dist/action-providers/sushi/sushiRouterSchemas.d.ts +36 -0
- package/dist/action-providers/sushi/sushiRouterSchemas.js +55 -0
- package/dist/action-providers/vaultsfyi/constants.d.ts +8 -12
- package/dist/action-providers/vaultsfyi/constants.js +47 -13
- package/dist/action-providers/vaultsfyi/schemas.d.ts +120 -65
- package/dist/action-providers/vaultsfyi/schemas.js +72 -38
- package/dist/action-providers/vaultsfyi/sdk.d.ts +8 -0
- package/dist/action-providers/vaultsfyi/sdk.js +15 -0
- package/dist/action-providers/vaultsfyi/utils.d.ts +151 -55
- package/dist/action-providers/vaultsfyi/utils.js +29 -75
- package/dist/action-providers/vaultsfyi/vaultsfyiActionProvider.d.ts +55 -16
- package/dist/action-providers/vaultsfyi/vaultsfyiActionProvider.js +413 -217
- package/dist/action-providers/vaultsfyi/vaultsfyiActionProvider.test.js +509 -316
- package/dist/action-providers/x402/constants.d.ts +67 -0
- package/dist/action-providers/x402/constants.js +37 -0
- package/dist/action-providers/x402/schemas.d.ts +45 -5
- package/dist/action-providers/x402/schemas.js +81 -11
- package/dist/action-providers/x402/utils.d.ts +85 -10
- package/dist/action-providers/x402/utils.js +302 -35
- package/dist/action-providers/x402/x402ActionProvider.d.ts +15 -1
- package/dist/action-providers/x402/x402ActionProvider.js +230 -179
- package/dist/action-providers/x402/x402ActionProvider.test.js +222 -262
- package/dist/action-providers/zora/zoraActionProvider.js +4 -5
- package/package.json +10 -7
- package/dist/action-providers/vaultsfyi/api/actions.d.ts +0 -41
- package/dist/action-providers/vaultsfyi/api/actions.js +0 -28
- package/dist/action-providers/vaultsfyi/api/historicalData.d.ts +0 -31
- package/dist/action-providers/vaultsfyi/api/historicalData.js +0 -44
- package/dist/action-providers/vaultsfyi/api/types.d.ts +0 -34
- package/dist/action-providers/vaultsfyi/api/types.js +0 -2
- package/dist/action-providers/vaultsfyi/api/vaults.d.ts +0 -66
- package/dist/action-providers/vaultsfyi/api/vaults.js +0 -57
|
@@ -29,6 +29,7 @@ const schemas_1 = require("./schemas");
|
|
|
29
29
|
const actionDecorator_1 = require("../actionDecorator");
|
|
30
30
|
const viem_1 = require("viem");
|
|
31
31
|
const utils_1 = require("./utils");
|
|
32
|
+
const coins_sdk_1 = require("@zoralabs/coins-sdk");
|
|
32
33
|
const SUPPORTED_NETWORKS = ["base-mainnet", "base-sepolia"];
|
|
33
34
|
/**
|
|
34
35
|
* ZoraActionProvider provides actions for interacting with the Zora protocol.
|
|
@@ -72,8 +73,6 @@ class ZoraActionProvider extends actionProvider_1.ActionProvider {
|
|
|
72
73
|
category: args.category,
|
|
73
74
|
pinataConfig: { jwt: __classPrivateFieldGet(this, _ZoraActionProvider_pinataJwt, "f") },
|
|
74
75
|
});
|
|
75
|
-
// Dynamically import Zora SDK
|
|
76
|
-
const { createCoinCall, DeployCurrency, getCoinCreateFromLogs } = await import("@zoralabs/coins-sdk");
|
|
77
76
|
// Create coin call
|
|
78
77
|
const call = {
|
|
79
78
|
name: args.name,
|
|
@@ -82,16 +81,16 @@ class ZoraActionProvider extends actionProvider_1.ActionProvider {
|
|
|
82
81
|
uri: uri,
|
|
83
82
|
payoutRecipient: args.payoutRecipient || walletProvider.getAddress(),
|
|
84
83
|
platformReferrer: args.platformReferrer || "0x0000000000000000000000000000000000000000",
|
|
85
|
-
currency: args.currency === "ZORA" ? DeployCurrency.ZORA : DeployCurrency.ETH,
|
|
84
|
+
currency: args.currency === "ZORA" ? coins_sdk_1.DeployCurrency.ZORA : coins_sdk_1.DeployCurrency.ETH,
|
|
86
85
|
};
|
|
87
|
-
const createCoinRequest = await createCoinCall(call);
|
|
86
|
+
const createCoinRequest = await (0, coins_sdk_1.createCoinCall)(call);
|
|
88
87
|
const { abi, functionName, address, args: callArgs, value } = createCoinRequest;
|
|
89
88
|
const data = (0, viem_1.encodeFunctionData)({ abi, functionName, args: callArgs });
|
|
90
89
|
const txRequest = { to: address, data, value };
|
|
91
90
|
// Send transaction
|
|
92
91
|
const hash = await walletProvider.sendTransaction(txRequest);
|
|
93
92
|
const receipt = await walletProvider.waitForTransactionReceipt(hash);
|
|
94
|
-
const deployment = getCoinCreateFromLogs(receipt);
|
|
93
|
+
const deployment = (0, coins_sdk_1.getCoinCreateFromLogs)(receipt);
|
|
95
94
|
if (receipt.status === "success") {
|
|
96
95
|
return JSON.stringify({
|
|
97
96
|
success: true,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@coinbase/agentkit",
|
|
3
3
|
"description": "Coinbase AgentKit core primitives",
|
|
4
4
|
"repository": "https://github.com/coinbase/agentkit",
|
|
5
|
-
"version": "0.10.
|
|
5
|
+
"version": "0.10.4",
|
|
6
6
|
"author": "Coinbase Inc.",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -28,17 +28,22 @@
|
|
|
28
28
|
"@coinbase/cdp-sdk": "^1.38.0",
|
|
29
29
|
"@coinbase/coinbase-sdk": "^0.20.0",
|
|
30
30
|
"@coinbase/x402": "^0.6.3",
|
|
31
|
+
"@ensofinance/sdk": "^2.0.6",
|
|
31
32
|
"@jup-ag/api": "^6.0.39",
|
|
32
33
|
"@privy-io/public-api": "2.18.5",
|
|
33
34
|
"@privy-io/server-auth": "1.18.4",
|
|
34
35
|
"@solana/kit": "^2.1.1",
|
|
35
36
|
"@solana/spl-token": "^0.4.12",
|
|
36
37
|
"@solana/web3.js": "^1.98.1",
|
|
38
|
+
"@vaultsfyi/sdk": "^2.1.9",
|
|
39
|
+
"@x402/evm": "^2.0.0",
|
|
40
|
+
"@x402/svm": "^2.0.0",
|
|
41
|
+
"@x402/fetch": "^2.0.0",
|
|
37
42
|
"@zerodev/ecdsa-validator": "^5.4.5",
|
|
38
43
|
"@zerodev/intent": "^0.0.24",
|
|
39
44
|
"@zerodev/sdk": "^5.4.28",
|
|
40
|
-
"@zoralabs/coins-sdk": "
|
|
41
|
-
"
|
|
45
|
+
"@zoralabs/coins-sdk": "0.2.8",
|
|
46
|
+
"@zoralabs/protocol-deployments": "0.6.1",
|
|
42
47
|
"bs58": "^4.0.1",
|
|
43
48
|
"canonicalize": "^2.1.0",
|
|
44
49
|
"clanker-sdk": "^4.1.18",
|
|
@@ -48,11 +53,9 @@
|
|
|
48
53
|
"md5": "^2.3.0",
|
|
49
54
|
"opensea-js": "^7.1.18",
|
|
50
55
|
"reflect-metadata": "^0.2.2",
|
|
51
|
-
"
|
|
56
|
+
"sushi": "6.2.1",
|
|
52
57
|
"twitter-api-v2": "^1.18.2",
|
|
53
|
-
"viem": "
|
|
54
|
-
"x402": "^0.6.0",
|
|
55
|
-
"x402-axios": "^0.6.0",
|
|
58
|
+
"viem": "2.38.3",
|
|
56
59
|
"zod": "^3.23.8"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { claimActionSchema, depositActionSchema, redeemActionSchema } from "../schemas";
|
|
3
|
-
import { ApiError } from "./types";
|
|
4
|
-
import { Address, Hex } from "viem";
|
|
5
|
-
type FetchVaultActionsParams = ({
|
|
6
|
-
action: "deposit";
|
|
7
|
-
args: z.infer<typeof depositActionSchema>;
|
|
8
|
-
} | {
|
|
9
|
-
action: "redeem";
|
|
10
|
-
args: z.infer<typeof redeemActionSchema>;
|
|
11
|
-
} | {
|
|
12
|
-
action: "claim-rewards";
|
|
13
|
-
args: z.infer<typeof claimActionSchema>;
|
|
14
|
-
}) & {
|
|
15
|
-
sender: string;
|
|
16
|
-
apiKey: string;
|
|
17
|
-
};
|
|
18
|
-
export type Actions = {
|
|
19
|
-
actions: {
|
|
20
|
-
tx: {
|
|
21
|
-
to: Address;
|
|
22
|
-
data: Hex;
|
|
23
|
-
value: string;
|
|
24
|
-
chainId: number;
|
|
25
|
-
};
|
|
26
|
-
description: string;
|
|
27
|
-
}[];
|
|
28
|
-
currentActionIndex: number;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Fetches a list of actions for a vault from the vaultsfyi API.
|
|
32
|
-
*
|
|
33
|
-
* @param root0 - The fetch parameters
|
|
34
|
-
* @param root0.action - The action to fetch
|
|
35
|
-
* @param root0.args - The action parameters
|
|
36
|
-
* @param root0.sender - The sender address
|
|
37
|
-
* @param root0.apiKey - The vaultsfyi API key
|
|
38
|
-
* @returns The list of actions
|
|
39
|
-
*/
|
|
40
|
-
export declare function fetchVaultActions({ action, args, sender, apiKey, }: FetchVaultActionsParams): Promise<Actions | ApiError>;
|
|
41
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchVaultActions = fetchVaultActions;
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
/**
|
|
7
|
-
* Fetches a list of actions for a vault from the vaultsfyi API.
|
|
8
|
-
*
|
|
9
|
-
* @param root0 - The fetch parameters
|
|
10
|
-
* @param root0.action - The action to fetch
|
|
11
|
-
* @param root0.args - The action parameters
|
|
12
|
-
* @param root0.sender - The sender address
|
|
13
|
-
* @param root0.apiKey - The vaultsfyi API key
|
|
14
|
-
* @returns The list of actions
|
|
15
|
-
*/
|
|
16
|
-
async function fetchVaultActions({ action, args, sender, apiKey, }) {
|
|
17
|
-
const params = (0, utils_1.createSearchParams)({
|
|
18
|
-
...args,
|
|
19
|
-
sender,
|
|
20
|
-
});
|
|
21
|
-
const response = await fetch(`${constants_1.VAULTS_API_URL}/transactions/vaults/${action}?${params}`, {
|
|
22
|
-
method: "GET",
|
|
23
|
-
headers: {
|
|
24
|
-
"x-api-key": apiKey,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
return (await response.json());
|
|
28
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { VaultHistoricalDataActionSchema } from "../schemas";
|
|
3
|
-
import { ApiError } from "./types";
|
|
4
|
-
type ApyData = {
|
|
5
|
-
timestamp: number;
|
|
6
|
-
blockNumber: number;
|
|
7
|
-
apy: {
|
|
8
|
-
base: number;
|
|
9
|
-
rewards: number;
|
|
10
|
-
total: number;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
type TvlData = {
|
|
14
|
-
timestamp: number;
|
|
15
|
-
blockNumber: number;
|
|
16
|
-
tvlDetails: {
|
|
17
|
-
tvlUsd: number;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Fetch historical data for a vault
|
|
22
|
-
*
|
|
23
|
-
* @param args - The arguments for the action
|
|
24
|
-
* @param apiKey - The API key to use for the request
|
|
25
|
-
* @returns The historical data for the vault
|
|
26
|
-
*/
|
|
27
|
-
export declare function fetchVaultHistoricalData(args: z.infer<typeof VaultHistoricalDataActionSchema>, apiKey: string): Promise<ApiError | {
|
|
28
|
-
apy: ApyData;
|
|
29
|
-
tvl: TvlData;
|
|
30
|
-
}>;
|
|
31
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchVaultHistoricalData = fetchVaultHistoricalData;
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
/**
|
|
7
|
-
* Fetch historical data for a vault
|
|
8
|
-
*
|
|
9
|
-
* @param args - The arguments for the action
|
|
10
|
-
* @param apiKey - The API key to use for the request
|
|
11
|
-
* @returns The historical data for the vault
|
|
12
|
-
*/
|
|
13
|
-
async function fetchVaultHistoricalData(args, apiKey) {
|
|
14
|
-
const params = (0, utils_1.createSearchParams)({
|
|
15
|
-
interval: args.apyRange ?? "7day",
|
|
16
|
-
});
|
|
17
|
-
const timestamp = new Date(args.date).getTime() / 1000;
|
|
18
|
-
const [tvlResponse, apyResponse] = await Promise.all([
|
|
19
|
-
fetch(`${constants_1.VAULTS_API_URL}/vaults/${args.network}/${args.vaultAddress}/historical-tvl/${timestamp}?${params}`, {
|
|
20
|
-
method: "GET",
|
|
21
|
-
headers: {
|
|
22
|
-
"x-api-key": apiKey,
|
|
23
|
-
},
|
|
24
|
-
}),
|
|
25
|
-
fetch(`${constants_1.VAULTS_API_URL}/vaults/${args.network}/${args.vaultAddress}/historical-apy/${timestamp}?${params}`, {
|
|
26
|
-
method: "GET",
|
|
27
|
-
headers: {
|
|
28
|
-
"x-api-key": apiKey,
|
|
29
|
-
},
|
|
30
|
-
}),
|
|
31
|
-
]);
|
|
32
|
-
const [apy, tvl] = await Promise.all([
|
|
33
|
-
apyResponse.json(),
|
|
34
|
-
tvlResponse.json(),
|
|
35
|
-
]);
|
|
36
|
-
if ("error" in apy)
|
|
37
|
-
return apy;
|
|
38
|
-
if ("error" in tvl)
|
|
39
|
-
return tvl;
|
|
40
|
-
return {
|
|
41
|
-
apy,
|
|
42
|
-
tvl,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export type ApiError = {
|
|
2
|
-
statusCode: number;
|
|
3
|
-
error: string;
|
|
4
|
-
message: string;
|
|
5
|
-
};
|
|
6
|
-
export type Balances = {
|
|
7
|
-
[network: string]: {
|
|
8
|
-
address: string;
|
|
9
|
-
name: string;
|
|
10
|
-
symbol: string;
|
|
11
|
-
balance: string;
|
|
12
|
-
decimals: number;
|
|
13
|
-
}[];
|
|
14
|
-
};
|
|
15
|
-
export type Positions = {
|
|
16
|
-
[network: string]: {
|
|
17
|
-
vaultName: string;
|
|
18
|
-
vaultAddress: string;
|
|
19
|
-
asset: {
|
|
20
|
-
assetAddress: string;
|
|
21
|
-
name: string;
|
|
22
|
-
symbol: string;
|
|
23
|
-
decimals: number;
|
|
24
|
-
};
|
|
25
|
-
balanceNative: string;
|
|
26
|
-
balanceLp: string;
|
|
27
|
-
unclaimedUsd: string;
|
|
28
|
-
apy: {
|
|
29
|
-
base: number;
|
|
30
|
-
rewards: number;
|
|
31
|
-
total: number;
|
|
32
|
-
};
|
|
33
|
-
}[];
|
|
34
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { VaultDetailsActionSchema, VaultsActionSchema } from "../schemas";
|
|
3
|
-
import { ApiError } from "./types";
|
|
4
|
-
type ApyData = {
|
|
5
|
-
"1day": number;
|
|
6
|
-
"7day": number;
|
|
7
|
-
"30day": number;
|
|
8
|
-
};
|
|
9
|
-
export type ApiVault = {
|
|
10
|
-
name: string;
|
|
11
|
-
address: string;
|
|
12
|
-
network: string;
|
|
13
|
-
protocol: string;
|
|
14
|
-
isTransactional: boolean;
|
|
15
|
-
tvlDetails: {
|
|
16
|
-
tvlUsd: string;
|
|
17
|
-
};
|
|
18
|
-
token: {
|
|
19
|
-
name: string;
|
|
20
|
-
assetAddress: string;
|
|
21
|
-
symbol: string;
|
|
22
|
-
decimals: number;
|
|
23
|
-
};
|
|
24
|
-
apy: {
|
|
25
|
-
base: ApyData;
|
|
26
|
-
rewards: ApyData;
|
|
27
|
-
total: ApyData;
|
|
28
|
-
};
|
|
29
|
-
numberOfHolders: number;
|
|
30
|
-
rewards: {
|
|
31
|
-
apy: ApyData;
|
|
32
|
-
asset: {
|
|
33
|
-
name: string;
|
|
34
|
-
symbol: string;
|
|
35
|
-
assetAddress: string;
|
|
36
|
-
decimals: number;
|
|
37
|
-
};
|
|
38
|
-
}[];
|
|
39
|
-
description: string;
|
|
40
|
-
additionalIncentives: string;
|
|
41
|
-
score: {
|
|
42
|
-
vaultScore: number;
|
|
43
|
-
vaultTvlScore: number;
|
|
44
|
-
protocolTvlScore: number;
|
|
45
|
-
holderScore: number;
|
|
46
|
-
networkScore: number;
|
|
47
|
-
assetScore: number;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Fetches a list of vaults from the vaultsfyi API.
|
|
52
|
-
*
|
|
53
|
-
* @param args - The action parameters
|
|
54
|
-
* @param apiKey - The vaultsfyi API key
|
|
55
|
-
* @returns The list of vaults
|
|
56
|
-
*/
|
|
57
|
-
export declare function fetchVaults(args: z.infer<typeof VaultsActionSchema>, apiKey: string): Promise<ApiVault[] | ApiError>;
|
|
58
|
-
/**
|
|
59
|
-
* Fetches the details of a specific vault from the vaultsfyi API.
|
|
60
|
-
*
|
|
61
|
-
* @param args - The action parameters
|
|
62
|
-
* @param apiKey - The vaultsfyi API key
|
|
63
|
-
* @returns The vault details
|
|
64
|
-
*/
|
|
65
|
-
export declare function fetchVault(args: z.infer<typeof VaultDetailsActionSchema>, apiKey: string): Promise<ApiError | ApiVault>;
|
|
66
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchVaults = fetchVaults;
|
|
4
|
-
exports.fetchVault = fetchVault;
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
7
|
-
/**
|
|
8
|
-
* Fetches a list of vaults from the vaultsfyi API.
|
|
9
|
-
*
|
|
10
|
-
* @param args - The action parameters
|
|
11
|
-
* @param apiKey - The vaultsfyi API key
|
|
12
|
-
* @returns The list of vaults
|
|
13
|
-
*/
|
|
14
|
-
async function fetchVaults(args, apiKey) {
|
|
15
|
-
const vaults = [];
|
|
16
|
-
const params = (0, utils_1.createSearchParams)({
|
|
17
|
-
per_page: 250,
|
|
18
|
-
token: args.token,
|
|
19
|
-
network: args.network,
|
|
20
|
-
tvl_min: args.minTvl ?? 100000,
|
|
21
|
-
transactionalOnly: true,
|
|
22
|
-
});
|
|
23
|
-
for (let i = 0; i < 10; i++) {
|
|
24
|
-
const response = await fetch(`${constants_1.VAULTS_API_URL}/detailed/vaults?${params}`, {
|
|
25
|
-
method: "GET",
|
|
26
|
-
headers: {
|
|
27
|
-
"x-api-key": apiKey,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
const data = (await response.json());
|
|
31
|
-
if ("error" in data)
|
|
32
|
-
return data;
|
|
33
|
-
vaults.push(...data.data);
|
|
34
|
-
if (!data.next_page)
|
|
35
|
-
break;
|
|
36
|
-
else
|
|
37
|
-
params.set("page", data.next_page);
|
|
38
|
-
}
|
|
39
|
-
return vaults;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Fetches the details of a specific vault from the vaultsfyi API.
|
|
43
|
-
*
|
|
44
|
-
* @param args - The action parameters
|
|
45
|
-
* @param apiKey - The vaultsfyi API key
|
|
46
|
-
* @returns The vault details
|
|
47
|
-
*/
|
|
48
|
-
async function fetchVault(args, apiKey) {
|
|
49
|
-
const response = await fetch(`${constants_1.VAULTS_API_URL}/vaults/${args.network}/${args.vaultAddress}`, {
|
|
50
|
-
method: "GET",
|
|
51
|
-
headers: {
|
|
52
|
-
"x-api-key": apiKey,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
const data = (await response.json());
|
|
56
|
-
return data;
|
|
57
|
-
}
|