@kasarlabs/opus-mcp 0.1.0

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.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/bin/opus-mcp.js +14 -0
  4. package/build/index.d.ts +2 -0
  5. package/build/index.js +106 -0
  6. package/build/index.js.map +1 -0
  7. package/build/interfaces/index.d.ts +49 -0
  8. package/build/interfaces/index.js +2 -0
  9. package/build/interfaces/index.js.map +1 -0
  10. package/build/lib/abis/abbotAbi.d.ts +283 -0
  11. package/build/lib/abis/abbotAbi.js +384 -0
  12. package/build/lib/abis/abbotAbi.js.map +1 -0
  13. package/build/lib/abis/erc20Abi.d.ts +197 -0
  14. package/build/lib/abis/erc20Abi.js +273 -0
  15. package/build/lib/abis/erc20Abi.js.map +1 -0
  16. package/build/lib/abis/sentinelAbi.d.ts +476 -0
  17. package/build/lib/abis/sentinelAbi.js +651 -0
  18. package/build/lib/abis/sentinelAbi.js.map +1 -0
  19. package/build/lib/abis/shrineAbi.d.ts +1426 -0
  20. package/build/lib/abis/shrineAbi.js +1937 -0
  21. package/build/lib/abis/shrineAbi.js.map +1 -0
  22. package/build/lib/constant/erc20.d.ts +3 -0
  23. package/build/lib/constant/erc20.js +34 -0
  24. package/build/lib/constant/erc20.js.map +1 -0
  25. package/build/lib/constant/index.d.ts +83 -0
  26. package/build/lib/constant/index.js +38 -0
  27. package/build/lib/constant/index.js.map +1 -0
  28. package/build/lib/dependances/types.d.ts +85 -0
  29. package/build/lib/dependances/types.js +51 -0
  30. package/build/lib/dependances/types.js.map +1 -0
  31. package/build/lib/types/index.d.ts +14 -0
  32. package/build/lib/types/index.js +2 -0
  33. package/build/lib/types/index.js.map +1 -0
  34. package/build/lib/utils/contracts.d.ts +2383 -0
  35. package/build/lib/utils/contracts.js +26 -0
  36. package/build/lib/utils/contracts.js.map +1 -0
  37. package/build/lib/utils/format.d.ts +5 -0
  38. package/build/lib/utils/format.js +11 -0
  39. package/build/lib/utils/format.js.map +1 -0
  40. package/build/lib/utils/troveManager.d.ts +27 -0
  41. package/build/lib/utils/troveManager.js +386 -0
  42. package/build/lib/utils/troveManager.js.map +1 -0
  43. package/build/schemas/index.d.ts +332 -0
  44. package/build/schemas/index.js +73 -0
  45. package/build/schemas/index.js.map +1 -0
  46. package/build/tools/borrowTrove.d.ts +11 -0
  47. package/build/tools/borrowTrove.js +19 -0
  48. package/build/tools/borrowTrove.js.map +1 -0
  49. package/build/tools/depositTrove.d.ts +11 -0
  50. package/build/tools/depositTrove.js +19 -0
  51. package/build/tools/depositTrove.js.map +1 -0
  52. package/build/tools/getters.d.ts +29 -0
  53. package/build/tools/getters.js +53 -0
  54. package/build/tools/getters.js.map +1 -0
  55. package/build/tools/openTrove.d.ts +11 -0
  56. package/build/tools/openTrove.js +19 -0
  57. package/build/tools/openTrove.js.map +1 -0
  58. package/build/tools/repayTrove.d.ts +11 -0
  59. package/build/tools/repayTrove.js +19 -0
  60. package/build/tools/repayTrove.js.map +1 -0
  61. package/build/tools/withdrawTrove.d.ts +11 -0
  62. package/build/tools/withdrawTrove.js +19 -0
  63. package/build/tools/withdrawTrove.js.map +1 -0
  64. package/package.json +44 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kasar Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Snak - Opus Plugin
2
+
3
+ The Opus Plugin provides comprehensive tools for interacting with the Opus protocol on Starknet, a decentralized borrowing platform where users can create and manage Troves (collateralized debt positions).
4
+
5
+ ## Features
6
+
7
+ This plugin adds the following tools:
8
+
9
+ - **open_trove**: Open a new Trove on Opus with collateral and borrow CASH.
10
+ - **get_user_troves**: Get trove IDs for a specific address on Opus.
11
+ - **get_trove_health**: Get the health metrics of a specific trove.
12
+ - **get_borrow_fee**: Get the current borrow fee for Opus.
13
+ - **deposit_trove**: Deposit additional collateral to an existing Trove.
14
+ - **withdraw_trove**: Withdraw collateral from a Trove on Opus.
15
+ - **borrow_trove**: Borrow additional CASH from an existing Trove.
16
+ - **repay_trove**: Repay CASH debt for a Trove on Opus.
17
+
18
+ ## Usage
19
+
20
+ The Opus Plugin is used internally by the Starknet Agent and doesn't need to be called directly. When the agent is initialized, it automatically registers these tools, making them available for use.
21
+
22
+ ## Example
23
+
24
+ When asking the agent to perform Opus-related tasks, it will use the appropriate tool from this plugin:
25
+
26
+ ```
27
+ "Open a trove with 1 ETH collateral and borrow 1000 CASH" // Uses open_trove
28
+ "What troves do I have on Opus?" // Uses get_user_troves
29
+ "Check the health of my trove" // Uses get_trove_health
30
+ "Deposit more collateral to my trove" // Uses deposit_trove
31
+ "Repay 500 CASH on my trove" // Uses repay_trove
32
+ ```
33
+
34
+ ## Development
35
+
36
+ To extend this plugin, add new tools in the `src/tools` directory and register them in the `registerTools` function in `src/index.ts`.
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync } from 'fs';
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname, join } from 'path';
5
+
6
+ const __dirname = dirname(fileURLToPath(import.meta.url));
7
+ const buildPath = join(__dirname, '..', 'build', 'index.js');
8
+
9
+ if (!existsSync(buildPath)) {
10
+ console.error('Build not found. Run: npm run build');
11
+ process.exit(1);
12
+ }
13
+
14
+ await import(buildPath);
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export declare const RegisterToolInServer: () => Promise<void>;
package/build/index.js ADDED
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { registerToolsWithServer, getOnchainWrite, } from '@kasarlabs/ask-starknet-core';
5
+ import dotenv from 'dotenv';
6
+ import { borrowTroveSchema, collateralActionSchema, getTroveHealthSchema, getUserTrovesSchema, openTroveSchema, repayTroveSchema, } from './schemas/index.js';
7
+ import { openTrove } from './tools/openTrove.js';
8
+ import { getBorrowFee, getTroveHealth, getUserTroves, } from './tools/getters.js';
9
+ import { depositTrove } from './tools/depositTrove.js';
10
+ import { withdrawTrove } from './tools/withdrawTrove.js';
11
+ import { borrowTrove } from './tools/borrowTrove.js';
12
+ import { repayTrove } from './tools/repayTrove.js';
13
+ dotenv.config();
14
+ const server = new McpServer({
15
+ name: 'starknet-opus-mcp',
16
+ version: '0.0.1',
17
+ });
18
+ const registerTools = (OpusToolRegistry) => {
19
+ OpusToolRegistry.push({
20
+ name: 'open_trove',
21
+ description: 'Open a Trove on Opus',
22
+ schema: openTroveSchema,
23
+ execute: async (params) => {
24
+ const onchainWrite = getOnchainWrite();
25
+ return await openTrove(onchainWrite, params);
26
+ },
27
+ });
28
+ OpusToolRegistry.push({
29
+ name: 'get_user_troves',
30
+ description: 'Get trove IDs for an address on Opus',
31
+ schema: getUserTrovesSchema,
32
+ execute: async (params) => {
33
+ const onchainWrite = getOnchainWrite();
34
+ return await getUserTroves(onchainWrite, params);
35
+ },
36
+ });
37
+ OpusToolRegistry.push({
38
+ name: 'get_trove_health',
39
+ description: 'Get the health of a trove on Opus',
40
+ schema: getTroveHealthSchema,
41
+ execute: async (params) => {
42
+ const onchainWrite = getOnchainWrite();
43
+ return await getTroveHealth(onchainWrite, params);
44
+ },
45
+ });
46
+ OpusToolRegistry.push({
47
+ name: 'get_borrow_fee',
48
+ description: 'Get the current borrow fee for Opus',
49
+ execute: async () => {
50
+ const onchainWrite = getOnchainWrite();
51
+ return await getBorrowFee(onchainWrite);
52
+ },
53
+ });
54
+ OpusToolRegistry.push({
55
+ name: 'deposit_trove',
56
+ description: 'Deposit collateral to a Trove on Opus',
57
+ schema: collateralActionSchema,
58
+ execute: async (params) => {
59
+ const onchainWrite = getOnchainWrite();
60
+ return await depositTrove(onchainWrite, params);
61
+ },
62
+ });
63
+ OpusToolRegistry.push({
64
+ name: 'withdraw_trove',
65
+ description: 'Withdraw collateral from a Trove on Opus',
66
+ schema: collateralActionSchema,
67
+ execute: async (params) => {
68
+ const onchainWrite = getOnchainWrite();
69
+ return await withdrawTrove(onchainWrite, params);
70
+ },
71
+ });
72
+ OpusToolRegistry.push({
73
+ name: 'borrow_trove',
74
+ description: 'Borrow CASH for a Trove on Opus',
75
+ schema: borrowTroveSchema,
76
+ execute: async (params) => {
77
+ const onchainWrite = getOnchainWrite();
78
+ return await borrowTrove(onchainWrite, params);
79
+ },
80
+ });
81
+ OpusToolRegistry.push({
82
+ name: 'repay_trove',
83
+ description: 'Repay CASH for a Trove on Opus',
84
+ schema: repayTroveSchema,
85
+ execute: async (params) => {
86
+ const onchainWrite = getOnchainWrite();
87
+ return await repayTrove(onchainWrite, params);
88
+ },
89
+ });
90
+ };
91
+ export const RegisterToolInServer = async () => {
92
+ const tools = [];
93
+ registerTools(tools);
94
+ await registerToolsWithServer(server, tools);
95
+ };
96
+ async function main() {
97
+ const transport = new StdioServerTransport();
98
+ await RegisterToolInServer();
99
+ await server.connect(transport);
100
+ console.error('Starknet Opus MCP Server running on stdio');
101
+ }
102
+ main().catch((error) => {
103
+ console.error('Fatal error in main():', error);
104
+ process.exit(1);
105
+ });
106
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAEL,uBAAuB,EACvB,eAAe,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,gBAA2B,EAAE,EAAE;IACpD,gBAAgB,CAAC,IAAI,CAAC;QACpB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,sBAAsB;QACnC,MAAM,EAAE,eAAe;QACvB,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AoB,EAAE,CAAC;IAE7C,MAAM,oBAAoB,EAAE,CAAC;IAC7B,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;AAC7D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,49 @@
1
+ export interface Status {
2
+ status: 'success' | 'failure';
3
+ }
4
+ export interface TroveActionResult extends Status {
5
+ trove_id?: string;
6
+ transaction_hash?: string;
7
+ error?: string;
8
+ step?: string;
9
+ }
10
+ export interface BorrowActionResult {
11
+ borrow_fee?: string;
12
+ borrow_fee_pct?: string;
13
+ }
14
+ export interface DebtActionResult {
15
+ amount?: string;
16
+ before_debt?: string;
17
+ after_debt?: string;
18
+ before_ltv?: string;
19
+ after_ltv?: string;
20
+ }
21
+ export interface CollateralActionResult {
22
+ before_value?: string;
23
+ after_value?: string;
24
+ before_ltv?: string;
25
+ after_ltv?: string;
26
+ }
27
+ export interface OpenTroveResult extends TroveActionResult, BorrowActionResult {
28
+ }
29
+ export interface RepayTroveResult extends TroveActionResult, DebtActionResult {
30
+ }
31
+ export interface BorrowTroveResult extends TroveActionResult, DebtActionResult, BorrowActionResult {
32
+ }
33
+ export interface DepositTroveResult extends TroveActionResult, CollateralActionResult {
34
+ }
35
+ export interface WithdrawTroveResult extends TroveActionResult, CollateralActionResult {
36
+ }
37
+ export interface GetUserTrovesResult extends Status {
38
+ troves?: string[];
39
+ }
40
+ export interface GetTroveHealthResult extends Status {
41
+ trove_id?: string;
42
+ debt?: string;
43
+ value?: string;
44
+ ltv?: string;
45
+ threshold?: string;
46
+ }
47
+ export interface GetBorrowFeeResult extends Status {
48
+ borrow_fee?: string;
49
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,283 @@
1
+ export declare const abbotAbi: readonly [{
2
+ readonly type: "impl";
3
+ readonly name: "IAbbotImpl";
4
+ readonly interface_name: "opus::interfaces::IAbbot::IAbbot";
5
+ }, {
6
+ readonly type: "enum";
7
+ readonly name: "core::option::Option::<core::starknet::contract_address::ContractAddress>";
8
+ readonly variants: readonly [{
9
+ readonly name: "Some";
10
+ readonly type: "core::starknet::contract_address::ContractAddress";
11
+ }, {
12
+ readonly name: "None";
13
+ readonly type: "()";
14
+ }];
15
+ }, {
16
+ readonly type: "struct";
17
+ readonly name: "core::array::Span::<core::integer::u64>";
18
+ readonly members: readonly [{
19
+ readonly name: "snapshot";
20
+ readonly type: "@core::array::Array::<core::integer::u64>";
21
+ }];
22
+ }, {
23
+ readonly type: "struct";
24
+ readonly name: "opus::types::AssetBalance";
25
+ readonly members: readonly [{
26
+ readonly name: "address";
27
+ readonly type: "core::starknet::contract_address::ContractAddress";
28
+ }, {
29
+ readonly name: "amount";
30
+ readonly type: "core::integer::u128";
31
+ }];
32
+ }, {
33
+ readonly type: "struct";
34
+ readonly name: "core::array::Span::<opus::types::AssetBalance>";
35
+ readonly members: readonly [{
36
+ readonly name: "snapshot";
37
+ readonly type: "@core::array::Array::<opus::types::AssetBalance>";
38
+ }];
39
+ }, {
40
+ readonly type: "struct";
41
+ readonly name: "wadray::wadray::Wad";
42
+ readonly members: readonly [{
43
+ readonly name: "val";
44
+ readonly type: "core::integer::u128";
45
+ }];
46
+ }, {
47
+ readonly type: "interface";
48
+ readonly name: "opus::interfaces::IAbbot::IAbbot";
49
+ readonly items: readonly [{
50
+ readonly type: "function";
51
+ readonly name: "get_trove_owner";
52
+ readonly inputs: readonly [{
53
+ readonly name: "trove_id";
54
+ readonly type: "core::integer::u64";
55
+ }];
56
+ readonly outputs: readonly [{
57
+ readonly type: "core::option::Option::<core::starknet::contract_address::ContractAddress>";
58
+ }];
59
+ readonly state_mutability: "view";
60
+ }, {
61
+ readonly type: "function";
62
+ readonly name: "get_user_trove_ids";
63
+ readonly inputs: readonly [{
64
+ readonly name: "user";
65
+ readonly type: "core::starknet::contract_address::ContractAddress";
66
+ }];
67
+ readonly outputs: readonly [{
68
+ readonly type: "core::array::Span::<core::integer::u64>";
69
+ }];
70
+ readonly state_mutability: "view";
71
+ }, {
72
+ readonly type: "function";
73
+ readonly name: "get_troves_count";
74
+ readonly inputs: readonly [];
75
+ readonly outputs: readonly [{
76
+ readonly type: "core::integer::u64";
77
+ }];
78
+ readonly state_mutability: "view";
79
+ }, {
80
+ readonly type: "function";
81
+ readonly name: "get_trove_asset_balance";
82
+ readonly inputs: readonly [{
83
+ readonly name: "trove_id";
84
+ readonly type: "core::integer::u64";
85
+ }, {
86
+ readonly name: "yang";
87
+ readonly type: "core::starknet::contract_address::ContractAddress";
88
+ }];
89
+ readonly outputs: readonly [{
90
+ readonly type: "core::integer::u128";
91
+ }];
92
+ readonly state_mutability: "view";
93
+ }, {
94
+ readonly type: "function";
95
+ readonly name: "open_trove";
96
+ readonly inputs: readonly [{
97
+ readonly name: "yang_assets";
98
+ readonly type: "core::array::Span::<opus::types::AssetBalance>";
99
+ }, {
100
+ readonly name: "forge_amount";
101
+ readonly type: "wadray::wadray::Wad";
102
+ }, {
103
+ readonly name: "max_forge_fee_pct";
104
+ readonly type: "wadray::wadray::Wad";
105
+ }];
106
+ readonly outputs: readonly [{
107
+ readonly type: "core::integer::u64";
108
+ }];
109
+ readonly state_mutability: "external";
110
+ }, {
111
+ readonly type: "function";
112
+ readonly name: "close_trove";
113
+ readonly inputs: readonly [{
114
+ readonly name: "trove_id";
115
+ readonly type: "core::integer::u64";
116
+ }];
117
+ readonly outputs: readonly [];
118
+ readonly state_mutability: "external";
119
+ }, {
120
+ readonly type: "function";
121
+ readonly name: "deposit";
122
+ readonly inputs: readonly [{
123
+ readonly name: "trove_id";
124
+ readonly type: "core::integer::u64";
125
+ }, {
126
+ readonly name: "yang_asset";
127
+ readonly type: "opus::types::AssetBalance";
128
+ }];
129
+ readonly outputs: readonly [];
130
+ readonly state_mutability: "external";
131
+ }, {
132
+ readonly type: "function";
133
+ readonly name: "withdraw";
134
+ readonly inputs: readonly [{
135
+ readonly name: "trove_id";
136
+ readonly type: "core::integer::u64";
137
+ }, {
138
+ readonly name: "yang_asset";
139
+ readonly type: "opus::types::AssetBalance";
140
+ }];
141
+ readonly outputs: readonly [];
142
+ readonly state_mutability: "external";
143
+ }, {
144
+ readonly type: "function";
145
+ readonly name: "forge";
146
+ readonly inputs: readonly [{
147
+ readonly name: "trove_id";
148
+ readonly type: "core::integer::u64";
149
+ }, {
150
+ readonly name: "amount";
151
+ readonly type: "wadray::wadray::Wad";
152
+ }, {
153
+ readonly name: "max_forge_fee_pct";
154
+ readonly type: "wadray::wadray::Wad";
155
+ }];
156
+ readonly outputs: readonly [];
157
+ readonly state_mutability: "external";
158
+ }, {
159
+ readonly type: "function";
160
+ readonly name: "melt";
161
+ readonly inputs: readonly [{
162
+ readonly name: "trove_id";
163
+ readonly type: "core::integer::u64";
164
+ }, {
165
+ readonly name: "amount";
166
+ readonly type: "wadray::wadray::Wad";
167
+ }];
168
+ readonly outputs: readonly [];
169
+ readonly state_mutability: "external";
170
+ }];
171
+ }, {
172
+ readonly type: "constructor";
173
+ readonly name: "constructor";
174
+ readonly inputs: readonly [{
175
+ readonly name: "shrine";
176
+ readonly type: "core::starknet::contract_address::ContractAddress";
177
+ }, {
178
+ readonly name: "sentinel";
179
+ readonly type: "core::starknet::contract_address::ContractAddress";
180
+ }];
181
+ }, {
182
+ readonly type: "event";
183
+ readonly name: "opus::utils::reentrancy_guard::reentrancy_guard_component::Event";
184
+ readonly kind: "enum";
185
+ readonly variants: readonly [];
186
+ }, {
187
+ readonly type: "event";
188
+ readonly name: "opus::core::abbot::abbot::Deposit";
189
+ readonly kind: "struct";
190
+ readonly members: readonly [{
191
+ readonly name: "user";
192
+ readonly type: "core::starknet::contract_address::ContractAddress";
193
+ readonly kind: "key";
194
+ }, {
195
+ readonly name: "trove_id";
196
+ readonly type: "core::integer::u64";
197
+ readonly kind: "key";
198
+ }, {
199
+ readonly name: "yang";
200
+ readonly type: "core::starknet::contract_address::ContractAddress";
201
+ readonly kind: "key";
202
+ }, {
203
+ readonly name: "yang_amt";
204
+ readonly type: "wadray::wadray::Wad";
205
+ readonly kind: "data";
206
+ }, {
207
+ readonly name: "asset_amt";
208
+ readonly type: "core::integer::u128";
209
+ readonly kind: "data";
210
+ }];
211
+ }, {
212
+ readonly type: "event";
213
+ readonly name: "opus::core::abbot::abbot::Withdraw";
214
+ readonly kind: "struct";
215
+ readonly members: readonly [{
216
+ readonly name: "user";
217
+ readonly type: "core::starknet::contract_address::ContractAddress";
218
+ readonly kind: "key";
219
+ }, {
220
+ readonly name: "trove_id";
221
+ readonly type: "core::integer::u64";
222
+ readonly kind: "key";
223
+ }, {
224
+ readonly name: "yang";
225
+ readonly type: "core::starknet::contract_address::ContractAddress";
226
+ readonly kind: "key";
227
+ }, {
228
+ readonly name: "yang_amt";
229
+ readonly type: "wadray::wadray::Wad";
230
+ readonly kind: "data";
231
+ }, {
232
+ readonly name: "asset_amt";
233
+ readonly type: "core::integer::u128";
234
+ readonly kind: "data";
235
+ }];
236
+ }, {
237
+ readonly type: "event";
238
+ readonly name: "opus::core::abbot::abbot::TroveOpened";
239
+ readonly kind: "struct";
240
+ readonly members: readonly [{
241
+ readonly name: "user";
242
+ readonly type: "core::starknet::contract_address::ContractAddress";
243
+ readonly kind: "key";
244
+ }, {
245
+ readonly name: "trove_id";
246
+ readonly type: "core::integer::u64";
247
+ readonly kind: "key";
248
+ }];
249
+ }, {
250
+ readonly type: "event";
251
+ readonly name: "opus::core::abbot::abbot::TroveClosed";
252
+ readonly kind: "struct";
253
+ readonly members: readonly [{
254
+ readonly name: "trove_id";
255
+ readonly type: "core::integer::u64";
256
+ readonly kind: "key";
257
+ }];
258
+ }, {
259
+ readonly type: "event";
260
+ readonly name: "opus::core::abbot::abbot::Event";
261
+ readonly kind: "enum";
262
+ readonly variants: readonly [{
263
+ readonly name: "ReentrancyGuardEvent";
264
+ readonly type: "opus::utils::reentrancy_guard::reentrancy_guard_component::Event";
265
+ readonly kind: "nested";
266
+ }, {
267
+ readonly name: "Deposit";
268
+ readonly type: "opus::core::abbot::abbot::Deposit";
269
+ readonly kind: "nested";
270
+ }, {
271
+ readonly name: "Withdraw";
272
+ readonly type: "opus::core::abbot::abbot::Withdraw";
273
+ readonly kind: "nested";
274
+ }, {
275
+ readonly name: "TroveOpened";
276
+ readonly type: "opus::core::abbot::abbot::TroveOpened";
277
+ readonly kind: "nested";
278
+ }, {
279
+ readonly name: "TroveClosed";
280
+ readonly type: "opus::core::abbot::abbot::TroveClosed";
281
+ readonly kind: "nested";
282
+ }];
283
+ }];