-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathallTools.ts
More file actions
135 lines (124 loc) · 3.97 KB
/
Copy pathallTools.ts
File metadata and controls
135 lines (124 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import { getWalletAddressTool } from "./getWalletAddress";
import { getBalanceTool } from "./getBalance";
import { getTokenBalancesTool } from "./getTokenBalances";
import { getNFTBalancesTool } from "./getNFTBalances";
import { getLastTransactionsTool } from "./getLastTransactions";
import { searchHashTool } from "./searchHash";
import { getSTXSupplyTool } from "./getSTXSupply";
import { sendTransactionTool } from "./sendTransaction";
import { getTokenInformationVelarTool } from "./getTokenInformation";
import { getPoolInformationVelarTool } from "./getPoolInformationFromVelar";
import { getsBTCEnrollmentTool } from "./getsBTCEnrollment";
import { getsBTCCurrentCycleTool } from "./getsBTCCurrentCycle";
import { getsBTCRewardAddressTool } from "./getsBTCRewardAddress";
import { getsBTCRewardsByCycleAddressTool } from "./getsBTCRewardsByCycleAddress";
import { enrollsBTCIncentivesTool } from "./enrollsBTCIncentives";
import { changesBTCRewardAddressTool } from "./changesBTCRewardAddress";
import { optoutsBTCIncentivesTool } from "./optOutBTCIncentives";
import { getFeeRatefromAlexgoTool } from "./getFeeRatefromAlexgo";
import { getAvailableTokensfromAlexgoTool } from "./getAvailableTokensfromAlexgo";
import { getTokenPricesfromAlexgoTool } from "./getTokenPricesfromAlexgo";
export interface ToolConfig<T = any> {
/**
* The definition of the tool.
*/
definition: {
type: "function";
function: {
name: string;
description: string;
parameters: {
type: "object";
properties: Record<string, unknown>;
required: string[];
};
};
};
/**
* The handler function that will be called when the tool is executed.
*/
handler: (args: T) => Promise<any>;
}
export const tools: Record<string, ToolConfig> = {
// == READ == \\
/**
* Get the connected wallet address.
*/
get_wallet_address: getWalletAddressTool,
/**
* Get the balance of a wallet address.
*/
get_balance: getBalanceTool,
/**
* Get the token balances of a wallet address.
*/
get_token_balances: getTokenBalancesTool,
/**
* Get the NFT balances of a wallet address.
*/
get_nft_balances: getNFTBalancesTool,
/**
* Get the last transactions of a wallet address.
*/
get_last_transactions: getLastTransactionsTool,
/**
* Search a hash
*/
search_hash: searchHashTool,
/**
* Get the STX supply in the network
*/
get_stx_supply: getSTXSupplyTool,
/**
* Get information about the tokens available in Velar protocol
*/
get_token_information_velar: getTokenInformationVelarTool,
/**
* Get information about the tokens available in Velar protocol
*/
get_pool_information_velar: getPoolInformationVelarTool,
/**
* Get the confirmation if a wallet is enrolled in sBTC incentives
*/
get_sbtc_enrollment: getsBTCEnrollmentTool,
/**
* Get the current cycle for sBTC incentives
*/
get_sbtc_currentcycle: getsBTCCurrentCycleTool,
/**
* Get the current reward address for sBTC incentives
*/
get_sbtc_rewardaddress: getsBTCRewardAddressTool,
/**
* Get the rewards for an address for sBTC incentives
*/
get_sbtc_rewardsbycycleaddress: getsBTCRewardsByCycleAddressTool,
/**
* Get the fee rate in swapping between 2 tokens in AlexGo protocol
*/
get_feerate_alexgo: getFeeRatefromAlexgoTool,
/**
* Get the available tokens to swap in AlexGo protocol
*/
get_availabletokens_alexgo: getAvailableTokensfromAlexgoTool,
/**
* Get the price of the tokens to swap in AlexGo protocol
*/
get_tokenprices_alexgo: getTokenPricesfromAlexgoTool,
/**
* Send a transaction to another address
*/
send_transaction: sendTransactionTool,
/**
* Enroll to sBTC incentives
*/
enroll_sbtc_incentives: enrollsBTCIncentivesTool,
/**
* Change the reward address for sBTC incentives
*/
change_sbtc_rewardaddress: changesBTCRewardAddressTool,
/**
* Unenroll to sBTC incentives
*/
optout_sbtc_incentives: optoutsBTCIncentivesTool,
};