@andrewkimjoseph/celina-sdk 0.2.11 → 0.3.1

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 (78) hide show
  1. package/README.md +3 -0
  2. package/build/abis/self-registry.d.ts +194 -0
  3. package/build/abis/self-registry.js +120 -0
  4. package/build/abis/self-registry.js.map +1 -0
  5. package/build/analytics/amplitude.d.ts +5 -0
  6. package/build/analytics/amplitude.js +56 -0
  7. package/build/analytics/amplitude.js.map +1 -0
  8. package/build/analytics/config.d.ts +7 -0
  9. package/build/analytics/config.js +30 -0
  10. package/build/analytics/config.js.map +1 -0
  11. package/build/analytics/mcp-tool-events.d.ts +5 -0
  12. package/build/analytics/mcp-tool-events.js +55 -0
  13. package/build/analytics/mcp-tool-events.js.map +1 -0
  14. package/build/analytics/wrap-service.d.ts +5 -0
  15. package/build/analytics/wrap-service.js +36 -0
  16. package/build/analytics/wrap-service.js.map +1 -0
  17. package/build/clients/carbon-rest.d.ts +17 -0
  18. package/build/clients/carbon-rest.js +59 -0
  19. package/build/clients/carbon-rest.js.map +1 -0
  20. package/build/clients/carbon-sdk.d.ts +31 -0
  21. package/build/clients/carbon-sdk.js +48 -0
  22. package/build/clients/carbon-sdk.js.map +1 -0
  23. package/build/clients/self-api.d.ts +82 -0
  24. package/build/clients/self-api.js +242 -0
  25. package/build/clients/self-api.js.map +1 -0
  26. package/build/config/carbon.d.ts +12 -0
  27. package/build/config/carbon.js +13 -0
  28. package/build/config/carbon.js.map +1 -0
  29. package/build/config/sdk-config.d.ts +14 -0
  30. package/build/config/sdk-config.js +16 -0
  31. package/build/config/sdk-config.js.map +1 -1
  32. package/build/config/self.d.ts +22 -0
  33. package/build/config/self.js +27 -0
  34. package/build/config/self.js.map +1 -0
  35. package/build/index.d.ts +16 -0
  36. package/build/index.js +27 -13
  37. package/build/index.js.map +1 -1
  38. package/build/services/carbon.service.d.ts +68 -0
  39. package/build/services/carbon.service.js +189 -0
  40. package/build/services/carbon.service.js.map +1 -0
  41. package/build/services/self-session-store.d.ts +19 -0
  42. package/build/services/self-session-store.js +28 -0
  43. package/build/services/self-session-store.js.map +1 -0
  44. package/build/services/self.service.d.ts +241 -0
  45. package/build/services/self.service.js +692 -0
  46. package/build/services/self.service.js.map +1 -0
  47. package/build/types/carbon.d.ts +31 -0
  48. package/build/types/carbon.js +2 -0
  49. package/build/types/carbon.js.map +1 -0
  50. package/build/utils/carbon-prepared-flow.d.ts +11 -0
  51. package/build/utils/carbon-prepared-flow.js +25 -0
  52. package/build/utils/carbon-prepared-flow.js.map +1 -0
  53. package/build/utils/carbon-rest-adapter.d.ts +8 -0
  54. package/build/utils/carbon-rest-adapter.js +72 -0
  55. package/build/utils/carbon-rest-adapter.js.map +1 -0
  56. package/build/utils/self-format.d.ts +28 -0
  57. package/build/utils/self-format.js +79 -0
  58. package/build/utils/self-format.js.map +1 -0
  59. package/build/utils/self-signing.d.ts +4 -0
  60. package/build/utils/self-signing.js +38 -0
  61. package/build/utils/self-signing.js.map +1 -0
  62. package/package.json +16 -2
  63. package/tests/README.md +72 -0
  64. package/tests/catalog/domains/blockchain.ts +91 -0
  65. package/tests/catalog/domains/carbon.ts +409 -0
  66. package/tests/catalog/domains/chain-ext.ts +219 -0
  67. package/tests/catalog/domains/defi.ts +264 -0
  68. package/tests/catalog/domains/self.ts +220 -0
  69. package/tests/catalog/domains/token.ts +74 -0
  70. package/tests/catalog/domains/transaction.ts +111 -0
  71. package/tests/catalog/index.ts +7 -0
  72. package/tests/catalog/operations.ts +48 -0
  73. package/tests/catalog/types.ts +27 -0
  74. package/tests/fixtures/mainnet.ts +93 -0
  75. package/tests/helpers/assert.ts +30 -0
  76. package/tests/helpers/env.ts +38 -0
  77. package/tests/helpers/gating.ts +36 -0
  78. package/tests/testing-entry.ts +22 -0
@@ -0,0 +1,264 @@
1
+ import type { OperationSpec } from "../types.js";
2
+ import { assertHasKeys } from "../../helpers/assert.js";
3
+
4
+ function fromAddress(fx: Parameters<OperationSpec["assert"]>[1]): `0x${string}` {
5
+ return fx.signerAddress ?? fx.wallet;
6
+ }
7
+
8
+ export const mentoFxOperations: OperationSpec[] = [
9
+ {
10
+ id: "mentoFx.getFxQuote",
11
+ domain: "mentoFx",
12
+ layer: "read",
13
+ sdk: {
14
+ invoke: (client) => client.mentoFx.getFxQuote("USDm", "EURm", "1"),
15
+ },
16
+ mcp: {
17
+ tool: "get_mento_fx_quote",
18
+ arguments: () => ({
19
+ tokenIn: "USDm",
20
+ tokenOut: "EURm",
21
+ amount: "1",
22
+ }),
23
+ },
24
+ assert: (result) => {
25
+ assertHasKeys(result, ["tokenIn", "tokenOut", "expectedOut"]);
26
+ },
27
+ },
28
+ {
29
+ id: "mentoFx.estimateFx",
30
+ domain: "mentoFx",
31
+ layer: "read",
32
+ requiresEnv: ["CELO_PRIVATE_KEY"],
33
+ sdk: {
34
+ invoke: (client, fx) =>
35
+ client.mentoFx.estimateFx(fromAddress(fx), "USDm", "EURm", "1"),
36
+ },
37
+ mcp: {
38
+ tool: "estimate_mento_fx",
39
+ arguments: () => ({
40
+ tokenIn: "USDm",
41
+ tokenOut: "EURm",
42
+ amount: "1",
43
+ }),
44
+ },
45
+ assert: (result) => {
46
+ assertHasKeys(result, ["fxGas", "expectedOut"]);
47
+ },
48
+ },
49
+ {
50
+ id: "mentoFx.prepareFx",
51
+ domain: "mentoFx",
52
+ layer: "prepare",
53
+ sdk: {
54
+ invoke: (client, fx) =>
55
+ client.mentoFx.prepareFx(fromAddress(fx), "USDm", "EURm", "1"),
56
+ },
57
+ assert: (result) => {
58
+ assertHasKeys(result, ["from", "steps", "summary"]);
59
+ },
60
+ },
61
+ {
62
+ id: "mentoFx.executeFx",
63
+ domain: "mentoFx",
64
+ layer: "write",
65
+ requiresEnv: ["CELO_PRIVATE_KEY"],
66
+ requiresWrites: true,
67
+ mcp: {
68
+ tool: "execute_mento_fx",
69
+ arguments: () => ({
70
+ tokenIn: "USDm",
71
+ tokenOut: "EURm",
72
+ amount: "0.01",
73
+ }),
74
+ },
75
+ assert: (result) => {
76
+ assertHasKeys(result, ["hash"]);
77
+ },
78
+ },
79
+ ];
80
+
81
+ export const uniswapOperations: OperationSpec[] = [
82
+ {
83
+ id: "uniswap.getSwapQuote",
84
+ domain: "uniswap",
85
+ layer: "read",
86
+ sdk: {
87
+ invoke: (client) => client.uniswap.getSwapQuote("CELO", "USDC", "0.001"),
88
+ },
89
+ mcp: {
90
+ tool: "get_uniswap_quote",
91
+ arguments: () => ({
92
+ tokenIn: "CELO",
93
+ tokenOut: "USDC",
94
+ amount: "0.001",
95
+ }),
96
+ },
97
+ assert: (result) => {
98
+ assertHasKeys(result, ["tokenIn", "tokenOut", "expectedOut", "protocol"]);
99
+ },
100
+ },
101
+ {
102
+ id: "uniswap.estimateSwap",
103
+ domain: "uniswap",
104
+ layer: "read",
105
+ requiresEnv: ["CELO_PRIVATE_KEY"],
106
+ sdk: {
107
+ invoke: (client, fx) =>
108
+ client.uniswap.estimateSwap(
109
+ fromAddress(fx),
110
+ "CELO",
111
+ "USDC",
112
+ "0.001",
113
+ ),
114
+ },
115
+ mcp: {
116
+ tool: "estimate_uniswap_swap",
117
+ arguments: () => ({
118
+ tokenIn: "CELO",
119
+ tokenOut: "USDC",
120
+ amount: "0.001",
121
+ }),
122
+ },
123
+ assert: (result) => {
124
+ assertHasKeys(result, ["swapGas", "expectedOut"]);
125
+ },
126
+ },
127
+ {
128
+ id: "uniswap.prepareSwap",
129
+ domain: "uniswap",
130
+ layer: "prepare",
131
+ sdk: {
132
+ invoke: (client, fx) =>
133
+ client.uniswap.prepareSwap(
134
+ fromAddress(fx),
135
+ "CELO",
136
+ "USDC",
137
+ "0.001",
138
+ ),
139
+ },
140
+ assert: (result) => {
141
+ assertHasKeys(result, ["from", "steps", "summary"]);
142
+ },
143
+ },
144
+ {
145
+ id: "uniswap.executeSwap",
146
+ domain: "uniswap",
147
+ layer: "write",
148
+ requiresEnv: ["CELO_PRIVATE_KEY"],
149
+ requiresWrites: true,
150
+ mcp: {
151
+ tool: "execute_uniswap_swap",
152
+ arguments: () => ({
153
+ tokenIn: "CELO",
154
+ tokenOut: "USDC",
155
+ amount: "0.001",
156
+ }),
157
+ },
158
+ assert: (result) => {
159
+ assertHasKeys(result, ["hash"]);
160
+ },
161
+ },
162
+ ];
163
+
164
+ export const aaveOperations: OperationSpec[] = [
165
+ {
166
+ id: "aave.prepareSupply",
167
+ domain: "aave",
168
+ layer: "prepare",
169
+ requiresEnv: ["CELO_PRIVATE_KEY"],
170
+ sdk: {
171
+ invoke: (client, fx) =>
172
+ client.aave.prepareSupply(fromAddress(fx), "USDm", "0.01"),
173
+ },
174
+ assert: (result) => {
175
+ assertHasKeys(result, ["from", "steps"]);
176
+ },
177
+ },
178
+ {
179
+ id: "aave.prepareWithdraw",
180
+ domain: "aave",
181
+ layer: "prepare",
182
+ requiresEnv: ["CELO_PRIVATE_KEY"],
183
+ sdk: {
184
+ invoke: (client, fx) =>
185
+ client.aave.prepareWithdraw(fromAddress(fx), "USDm", "0.01"),
186
+ },
187
+ assert: (result) => {
188
+ assertHasKeys(result, ["from", "steps"]);
189
+ },
190
+ },
191
+ {
192
+ id: "aave.supply",
193
+ domain: "aave",
194
+ layer: "write",
195
+ requiresEnv: ["CELO_PRIVATE_KEY"],
196
+ requiresWrites: true,
197
+ mcp: {
198
+ tool: "supply_aave",
199
+ arguments: () => ({
200
+ token: "USDm",
201
+ amount: "0.01",
202
+ }),
203
+ },
204
+ assert: (result) => {
205
+ assertHasKeys(result, ["hash"]);
206
+ },
207
+ },
208
+ {
209
+ id: "aave.withdraw",
210
+ domain: "aave",
211
+ layer: "write",
212
+ requiresEnv: ["CELO_PRIVATE_KEY"],
213
+ requiresWrites: true,
214
+ mcp: {
215
+ tool: "withdraw_aave",
216
+ arguments: () => ({
217
+ token: "USDm",
218
+ amount: "0.01",
219
+ }),
220
+ },
221
+ assert: (result) => {
222
+ assertHasKeys(result, ["hash"]);
223
+ },
224
+ },
225
+ ];
226
+
227
+ export const ensOperations: OperationSpec[] = [
228
+ {
229
+ id: "ens.resolveEns",
230
+ domain: "ens",
231
+ layer: "read",
232
+ sdk: {
233
+ invoke: (client, fx) => client.ens.resolveEns(fx.ensName, "celo"),
234
+ },
235
+ mcp: {
236
+ tool: "resolve_ens",
237
+ arguments: (fx) => ({
238
+ name: fx.ensName,
239
+ chain: "celo",
240
+ }),
241
+ },
242
+ assert: (result) => {
243
+ assertHasKeys(result, ["name", "address"]);
244
+ },
245
+ },
246
+ ];
247
+
248
+ export const gooddollarOperations: OperationSpec[] = [
249
+ {
250
+ id: "gooddollar.getWhitelistingInfo",
251
+ domain: "gooddollar",
252
+ layer: "read",
253
+ sdk: {
254
+ invoke: (client, fx) => client.gooddollar.getWhitelistingInfo(fx.wallet),
255
+ },
256
+ mcp: {
257
+ tool: "get_gooddollar_whitelisting_info",
258
+ arguments: (fx) => ({ address: fx.wallet }),
259
+ },
260
+ assert: (result) => {
261
+ assertHasKeys(result, ["isCurrentlyWhitelisted"]);
262
+ },
263
+ },
264
+ ];
@@ -0,0 +1,220 @@
1
+ import type { OperationSpec } from "../types.js";
2
+ import { assertHasKeys } from "../../helpers/assert.js";
3
+
4
+ const SELF_DEMO_VERIFY_URL =
5
+ "https://app.ai.self.xyz/api/demo/verify?network=celo-mainnet";
6
+
7
+ export const selfOperations: OperationSpec[] = [
8
+ {
9
+ id: "self.verifySelfAgent",
10
+ domain: "self",
11
+ layer: "read",
12
+ sdk: {
13
+ invoke: (client, fx) =>
14
+ client.self.verifyAgent({ agentAddress: fx.selfAgentAddress }),
15
+ },
16
+ mcp: {
17
+ tool: "verify_self_agent",
18
+ arguments: (fx) => ({
19
+ agent_address: fx.selfAgentAddress,
20
+ }),
21
+ },
22
+ assert: (result) => {
23
+ assertHasKeys(result, ["verified"]);
24
+ },
25
+ },
26
+ {
27
+ id: "self.lookupSelfAgent",
28
+ domain: "self",
29
+ layer: "read",
30
+ sdk: {
31
+ invoke: (client, fx) => client.self.lookupAgent(fx.selfAgentId),
32
+ },
33
+ mcp: {
34
+ tool: "lookup_self_agent",
35
+ arguments: (fx) => ({
36
+ agent_id: fx.selfAgentId,
37
+ }),
38
+ },
39
+ assert: (result) => {
40
+ assertHasKeys(result, ["agentId"]);
41
+ },
42
+ },
43
+ {
44
+ id: "self.verifySelfRequest",
45
+ domain: "self",
46
+ layer: "read",
47
+ requiresEnv: ["SELF_AGENT_PRIVATE_KEY"],
48
+ sdk: {
49
+ invoke: (client, fx) => {
50
+ const args = fx.selfVerifyRequestArgs ?? {};
51
+ return client.self.verifyRequest({
52
+ agentSignature: args.agent_signature as `0x${string}`,
53
+ agentTimestamp: String(args.agent_timestamp),
54
+ method: String(args.method),
55
+ path: String(args.path),
56
+ body: typeof args.body === "string" ? args.body : undefined,
57
+ keytype: typeof args.keytype === "string" ? args.keytype : undefined,
58
+ agentKey: args.agent_key as `0x${string}` | undefined,
59
+ });
60
+ },
61
+ },
62
+ mcp: {
63
+ tool: "verify_self_request",
64
+ arguments: (fx) => fx.selfVerifyRequestArgs ?? {},
65
+ },
66
+ skip: () =>
67
+ process.env.CELINA_TEST_SELF_VERIFY === "1"
68
+ ? undefined
69
+ : "Set CELINA_TEST_SELF_VERIFY=1 (MCP suite enriches signed fixture in beforeAll)",
70
+ assert: (result) => {
71
+ assertHasKeys(result, ["valid"]);
72
+ },
73
+ },
74
+ {
75
+ id: "self.registerSelfAgent",
76
+ domain: "self",
77
+ layer: "write",
78
+ requiresDestructive: true,
79
+ sdk: {
80
+ invoke: (client) =>
81
+ client.self.registerAgent({
82
+ mode: "wallet-free",
83
+ agentName: "celina-test",
84
+ }),
85
+ },
86
+ mcp: {
87
+ tool: "register_self_agent",
88
+ arguments: () => ({
89
+ mode: "wallet-free",
90
+ agent_name: "celina-test",
91
+ }),
92
+ },
93
+ assert: (result) => {
94
+ assertHasKeys(result, ["session_id"]);
95
+ },
96
+ },
97
+ {
98
+ id: "self.checkSelfRegistration",
99
+ domain: "self",
100
+ layer: "read",
101
+ sdk: {
102
+ invoke: (client) =>
103
+ client.self.checkRegistration(
104
+ process.env.CELINA_TEST_SELF_SESSION ?? "missing-session",
105
+ ),
106
+ },
107
+ mcp: {
108
+ tool: "check_self_registration",
109
+ arguments: () => ({
110
+ session_id: process.env.CELINA_TEST_SELF_SESSION ?? "missing-session",
111
+ }),
112
+ },
113
+ skip: () =>
114
+ process.env.CELINA_TEST_SELF_SESSION
115
+ ? undefined
116
+ : "Set CELINA_TEST_SELF_SESSION to poll a pending Self session",
117
+ assert: (result) => {
118
+ assertHasKeys(result, ["status"]);
119
+ },
120
+ },
121
+ {
122
+ id: "self.getSelfIdentity",
123
+ domain: "self",
124
+ layer: "read",
125
+ requiresEnv: ["SELF_AGENT_PRIVATE_KEY"],
126
+ sdk: {
127
+ invoke: (client) => client.self.getIdentity(),
128
+ },
129
+ mcp: {
130
+ tool: "get_self_identity",
131
+ arguments: () => ({}),
132
+ },
133
+ assert: (result) => {
134
+ const obj = result as Record<string, unknown>;
135
+ assertHasKeys(obj, obj.registered === false ? ["registered"] : ["address"]);
136
+ },
137
+ },
138
+ {
139
+ id: "self.refreshSelfProof",
140
+ domain: "self",
141
+ layer: "write",
142
+ requiresEnv: ["SELF_AGENT_PRIVATE_KEY"],
143
+ requiresDestructive: true,
144
+ sdk: {
145
+ invoke: (client) => client.self.refreshProof(),
146
+ },
147
+ mcp: {
148
+ tool: "refresh_self_proof",
149
+ arguments: () => ({}),
150
+ },
151
+ assert: (result) => {
152
+ assertHasKeys(result, ["session_id"]);
153
+ },
154
+ },
155
+ {
156
+ id: "self.deregisterSelfAgent",
157
+ domain: "self",
158
+ layer: "write",
159
+ requiresEnv: ["SELF_AGENT_PRIVATE_KEY"],
160
+ requiresDestructive: true,
161
+ sdk: {
162
+ invoke: (client) => client.self.deregisterAgent(),
163
+ },
164
+ mcp: {
165
+ tool: "deregister_self_agent",
166
+ arguments: () => ({}),
167
+ },
168
+ assert: (result) => {
169
+ assertHasKeys(result, ["session_id"]);
170
+ },
171
+ },
172
+ {
173
+ id: "self.signSelfRequest",
174
+ domain: "self",
175
+ layer: "read",
176
+ requiresEnv: ["SELF_AGENT_PRIVATE_KEY"],
177
+ sdk: {
178
+ invoke: (client) =>
179
+ client.self.signRequest({
180
+ method: "GET",
181
+ url: SELF_DEMO_VERIFY_URL,
182
+ }),
183
+ },
184
+ mcp: {
185
+ tool: "sign_self_request",
186
+ arguments: () => ({
187
+ method: "GET",
188
+ url: SELF_DEMO_VERIFY_URL,
189
+ }),
190
+ },
191
+ assert: (result) => {
192
+ assertHasKeys(result, ["headers"]);
193
+ },
194
+ },
195
+ {
196
+ id: "self.authenticatedSelfFetch",
197
+ domain: "self",
198
+ layer: "read",
199
+ requiresEnv: ["SELF_AGENT_PRIVATE_KEY"],
200
+ sdk: {
201
+ invoke: (client) =>
202
+ client.self.authenticatedFetch({
203
+ method: "POST",
204
+ url: SELF_DEMO_VERIFY_URL,
205
+ body: JSON.stringify({ ping: true }),
206
+ }),
207
+ },
208
+ mcp: {
209
+ tool: "authenticated_self_fetch",
210
+ arguments: () => ({
211
+ method: "POST",
212
+ url: SELF_DEMO_VERIFY_URL,
213
+ body: JSON.stringify({ ping: true }),
214
+ }),
215
+ },
216
+ assert: (result) => {
217
+ assertHasKeys(result, ["status"]);
218
+ },
219
+ },
220
+ ];
@@ -0,0 +1,74 @@
1
+ import { expect } from "vitest";
2
+ import type { OperationSpec } from "../types.js";
3
+ import { assertHasKeys } from "../../helpers/assert.js";
4
+
5
+ export const tokenOperations: OperationSpec[] = [
6
+ {
7
+ id: "token.getBalances",
8
+ domain: "token",
9
+ layer: "read",
10
+ sdk: {
11
+ invoke: (client, fx) =>
12
+ client.token.getBalances(fx.wallet, ["CELO", "USDm"]),
13
+ },
14
+ mcp: {
15
+ tool: "get_celo_balances",
16
+ arguments: (fx) => ({
17
+ address: fx.wallet,
18
+ tokens: ["CELO", "USDm"],
19
+ }),
20
+ },
21
+ assert: (result) => {
22
+ assertHasKeys(result, ["address", "balances"]);
23
+ },
24
+ },
25
+ {
26
+ id: "token.getStablecoinBalances",
27
+ domain: "token",
28
+ layer: "read",
29
+ sdk: {
30
+ invoke: (client, fx) => client.token.getStablecoinBalances(fx.wallet),
31
+ },
32
+ mcp: {
33
+ tool: "get_stablecoin_balances",
34
+ arguments: (fx) => ({ address: fx.wallet }),
35
+ },
36
+ assert: (result) => {
37
+ assertHasKeys(result, ["address", "stablecoins"]);
38
+ },
39
+ },
40
+ {
41
+ id: "token.getTokenInfo",
42
+ domain: "token",
43
+ layer: "read",
44
+ sdk: {
45
+ invoke: (client) => client.token.getTokenInfo("USDm"),
46
+ },
47
+ mcp: {
48
+ tool: "get_token_info",
49
+ arguments: () => ({ token: "USDm" }),
50
+ },
51
+ assert: (result) => {
52
+ assertHasKeys(result, ["symbol", "decimals"]);
53
+ },
54
+ },
55
+ {
56
+ id: "token.getTokenBalance",
57
+ domain: "token",
58
+ layer: "read",
59
+ sdk: {
60
+ invoke: (client, fx) =>
61
+ client.token.getTokenBalance("USDm", fx.wallet),
62
+ },
63
+ mcp: {
64
+ tool: "get_token_balance",
65
+ arguments: (fx) => ({
66
+ token: "USDm",
67
+ address: fx.wallet,
68
+ }),
69
+ },
70
+ assert: (result) => {
71
+ assertHasKeys(result, ["formatted", "symbol"]);
72
+ },
73
+ },
74
+ ];
@@ -0,0 +1,111 @@
1
+ import { parseEther } from "viem";
2
+ import type { OperationSpec } from "../types.js";
3
+ import { assertHasKeys } from "../../helpers/assert.js";
4
+
5
+ function fromAddress(fx: Parameters<OperationSpec["assert"]>[1]): `0x${string}` {
6
+ return fx.signerAddress ?? fx.wallet;
7
+ }
8
+
9
+ export const transactionOperations: OperationSpec[] = [
10
+ {
11
+ id: "transaction.getGasFeeData",
12
+ domain: "transaction",
13
+ layer: "read",
14
+ sdk: {
15
+ invoke: (client) => client.transaction.getGasFeeData(),
16
+ },
17
+ mcp: {
18
+ tool: "get_gas_fee_data",
19
+ arguments: () => ({}),
20
+ },
21
+ assert: (result) => {
22
+ assertHasKeys(result, ["network"]);
23
+ },
24
+ },
25
+ {
26
+ id: "transaction.estimateTransaction",
27
+ domain: "transaction",
28
+ layer: "read",
29
+ requiresEnv: ["CELO_PRIVATE_KEY"],
30
+ sdk: {
31
+ invoke: (client, fx) =>
32
+ client.transaction.estimateTransaction({
33
+ from: fromAddress(fx),
34
+ to: fx.wallet,
35
+ value: parseEther("0.001").toString(),
36
+ }),
37
+ },
38
+ mcp: {
39
+ tool: "estimate_transaction",
40
+ arguments: (fx) => ({
41
+ from: fromAddress(fx),
42
+ to: fx.wallet,
43
+ value: parseEther("0.001").toString(),
44
+ }),
45
+ },
46
+ assert: (result) => {
47
+ assertHasKeys(result, ["gasLimit"]);
48
+ },
49
+ },
50
+ {
51
+ id: "transaction.estimateSend",
52
+ domain: "transaction",
53
+ layer: "read",
54
+ requiresEnv: ["CELO_PRIVATE_KEY"],
55
+ sdk: {
56
+ invoke: (client, fx) =>
57
+ client.transaction.estimateSend(
58
+ fromAddress(fx),
59
+ fx.wallet,
60
+ "CELO",
61
+ "0.001",
62
+ ),
63
+ },
64
+ mcp: {
65
+ tool: "estimate_send",
66
+ arguments: () => ({
67
+ to: "0x471EcE3750Da237f93B8E339c536989b8978a438",
68
+ token: "CELO",
69
+ amount: "0.001",
70
+ }),
71
+ },
72
+ assert: (result) => {
73
+ assertHasKeys(result, ["gas"]);
74
+ },
75
+ },
76
+ {
77
+ id: "transaction.prepareSend",
78
+ domain: "transaction",
79
+ layer: "prepare",
80
+ sdk: {
81
+ invoke: (client, fx) =>
82
+ client.transaction.prepareSend(
83
+ fromAddress(fx),
84
+ fx.wallet,
85
+ "CELO",
86
+ "0.001",
87
+ ),
88
+ },
89
+ assert: (result) => {
90
+ assertHasKeys(result, ["from", "steps", "summary"]);
91
+ },
92
+ },
93
+ {
94
+ id: "transaction.sendToken",
95
+ domain: "transaction",
96
+ layer: "write",
97
+ requiresEnv: ["CELO_PRIVATE_KEY"],
98
+ requiresWrites: true,
99
+ mcp: {
100
+ tool: "send_token",
101
+ arguments: () => ({
102
+ to: "0x471EcE3750Da237f93B8E339c536989b8978a438",
103
+ token: "CELO",
104
+ amount: "0.000001",
105
+ }),
106
+ },
107
+ assert: (result) => {
108
+ assertHasKeys(result, ["hash"]);
109
+ },
110
+ },
111
+ ];
@@ -0,0 +1,7 @@
1
+ export type { OperationSpec, OperationLayer, EnvRequirement } from "./types.js";
2
+ export {
3
+ OPERATIONS,
4
+ MCP_OPERATIONS,
5
+ SDK_OPERATIONS,
6
+ MCP_TOOL_NAMES,
7
+ } from "./operations.js";