@andrewkimjoseph/celina-sdk 0.2.12 → 0.4.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 (78) hide show
  1. package/README.md +27 -0
  2. package/build/abis/gooddollar-identity.d.ts +12 -0
  3. package/build/abis/gooddollar-identity.js +7 -0
  4. package/build/abis/gooddollar-identity.js.map +1 -1
  5. package/build/abis/self-registry.d.ts +194 -0
  6. package/build/abis/self-registry.js +120 -0
  7. package/build/abis/self-registry.js.map +1 -0
  8. package/build/abis/ubi-scheme.d.ts +79 -0
  9. package/build/abis/ubi-scheme.js +59 -0
  10. package/build/abis/ubi-scheme.js.map +1 -0
  11. package/build/analytics/amplitude.d.ts +5 -0
  12. package/build/analytics/amplitude.js +56 -0
  13. package/build/analytics/amplitude.js.map +1 -0
  14. package/build/analytics/config.d.ts +7 -0
  15. package/build/analytics/config.js +30 -0
  16. package/build/analytics/config.js.map +1 -0
  17. package/build/analytics/mcp-tool-events.d.ts +5 -0
  18. package/build/analytics/mcp-tool-events.js +56 -0
  19. package/build/analytics/mcp-tool-events.js.map +1 -0
  20. package/build/analytics/wrap-service.d.ts +5 -0
  21. package/build/analytics/wrap-service.js +36 -0
  22. package/build/analytics/wrap-service.js.map +1 -0
  23. package/build/clients/carbon-rest.d.ts +17 -0
  24. package/build/clients/carbon-rest.js +59 -0
  25. package/build/clients/carbon-rest.js.map +1 -0
  26. package/build/clients/carbon-sdk.d.ts +31 -0
  27. package/build/clients/carbon-sdk.js +48 -0
  28. package/build/clients/carbon-sdk.js.map +1 -0
  29. package/build/clients/self-api.d.ts +82 -0
  30. package/build/clients/self-api.js +242 -0
  31. package/build/clients/self-api.js.map +1 -0
  32. package/build/config/carbon.d.ts +12 -0
  33. package/build/config/carbon.js +13 -0
  34. package/build/config/carbon.js.map +1 -0
  35. package/build/config/gooddollar.d.ts +2 -0
  36. package/build/config/gooddollar.js +2 -0
  37. package/build/config/gooddollar.js.map +1 -1
  38. package/build/config/sdk-config.d.ts +14 -0
  39. package/build/config/sdk-config.js +16 -0
  40. package/build/config/sdk-config.js.map +1 -1
  41. package/build/config/self.d.ts +22 -0
  42. package/build/config/self.js +27 -0
  43. package/build/config/self.js.map +1 -0
  44. package/build/index.d.ts +18 -1
  45. package/build/index.js +28 -13
  46. package/build/index.js.map +1 -1
  47. package/build/services/carbon.service.d.ts +68 -0
  48. package/build/services/carbon.service.js +189 -0
  49. package/build/services/carbon.service.js.map +1 -0
  50. package/build/services/gooddollar.service.d.ts +41 -3
  51. package/build/services/gooddollar.service.js +164 -1
  52. package/build/services/gooddollar.service.js.map +1 -1
  53. package/build/services/self-session-store.d.ts +19 -0
  54. package/build/services/self-session-store.js +28 -0
  55. package/build/services/self-session-store.js.map +1 -0
  56. package/build/services/self.service.d.ts +241 -0
  57. package/build/services/self.service.js +692 -0
  58. package/build/services/self.service.js.map +1 -0
  59. package/build/types/carbon.d.ts +31 -0
  60. package/build/types/carbon.js +2 -0
  61. package/build/types/carbon.js.map +1 -0
  62. package/build/utils/carbon-prepared-flow.d.ts +11 -0
  63. package/build/utils/carbon-prepared-flow.js +25 -0
  64. package/build/utils/carbon-prepared-flow.js.map +1 -0
  65. package/build/utils/carbon-rest-adapter.d.ts +8 -0
  66. package/build/utils/carbon-rest-adapter.js +72 -0
  67. package/build/utils/carbon-rest-adapter.js.map +1 -0
  68. package/build/utils/self-format.d.ts +28 -0
  69. package/build/utils/self-format.js +79 -0
  70. package/build/utils/self-format.js.map +1 -0
  71. package/build/utils/self-signing.d.ts +4 -0
  72. package/build/utils/self-signing.js +38 -0
  73. package/build/utils/self-signing.js.map +1 -0
  74. package/package.json +7 -2
  75. package/tests/catalog/domains/carbon.ts +409 -0
  76. package/tests/catalog/domains/defi.ts +43 -0
  77. package/tests/catalog/domains/self.ts +63 -4
  78. package/tests/catalog/operations.ts +2 -0
package/README.md CHANGED
@@ -18,6 +18,9 @@ Requires Node.js ≥ 20.
18
18
 
19
19
  - [Quick start](https://andrewkimjoseph.gitbook.io/celina-sdk/getting-started/quick-start)
20
20
  - [wagmi integration](https://andrewkimjoseph.gitbook.io/celina-sdk/guides/wagmi-integration)
21
+ - [Carbon DeFi on Celo](docs/guides/carbon.md) — hybrid Carbon REST + `@bancor/carbon-sdk` (25 operations)
22
+ - [Self Agent ID](docs/guides/self-agent-id.md) — verify, register, and refresh human-backed agents on Celo
23
+ - [Telemetry](docs/guides/telemetry.md) — optional Amplitude read metrics (opt out with `CELINA_ANALYTICS_DISABLED=1`)
21
24
  - [API reference](https://andrewkimjoseph.gitbook.io/celina-sdk/api-reference)
22
25
 
23
26
  Docs source lives in [`docs/`](docs/) in this repository.
@@ -33,8 +36,32 @@ await celina.token.getStablecoinBalances("0xYourAddress");
33
36
 
34
37
  const flow = await celina.transaction.prepareSend("0xFrom", "0xTo", "USDm", "10");
35
38
  // flow.steps → pass to wagmi sendTransaction
39
+
40
+ // Carbon DeFi (reads + unsigned strategy/trade prep)
41
+ const strategies = await celina.carbon.getStrategies("0xYourAddress");
42
+ const prepared = await celina.carbon.prepareLimitOrder({
43
+ wallet_address: "0xYourAddress",
44
+ base_token: "CELO",
45
+ quote_token: "USDC",
46
+ direction: "buy",
47
+ price: 0.5,
48
+ budget: 100,
49
+ });
50
+ // prepared.preparedFlow?.steps → same signing flow; check prepared.warnings
36
51
  ```
37
52
 
53
+ ## Carbon DeFi
54
+
55
+ Hybrid **Carbon REST** (`https://mcp.carbondefi.xyz`) plus **`@bancor/carbon-sdk`** fallback for trade quotes and taker swaps when REST is unavailable. All 25 operations target Celo mainnet; no private keys — `prepare*` returns unsigned flows for the user’s wallet.
56
+
57
+ | Reads (`celina.carbon`) | Prepare (unsigned) |
58
+ |-------------------------|-------------------|
59
+ | `getStrategies`, `getStrategy`, `getTradeQuote`, `explorePair`, `resolveToken`, `getActivity`, `findOpportunities`, `getProtocolStats`, `getPriceHistory`, `simulateStrategy`, `help`, `learn` | `prepareLimitOrder`, `prepareRangeOrder`, `prepareRecurringStrategy`, `prepareConcentratedStrategy`, `prepareFullRangeStrategy`, `prepareRepriceStrategy`, `prepareEditStrategy`, `prepareDepositBudget`, `prepareWithdrawBudget`, `preparePauseStrategy`, `prepareResumeStrategy`, `prepareDeleteStrategy`, `prepareTrade` |
60
+
61
+ Set `CARBON_API_BASE_URL` to override the REST base. Hosted [celina-mcp](https://mcp.usecelina.xyz/api/mcp) exposes the 12 read tools only; use this SDK or local MCP stdio for all `prepare*` methods.
62
+
63
+ Full workflow, MCP tool names, and env vars: [Carbon DeFi guide](docs/guides/carbon.md).
64
+
38
65
  ## Related packages
39
66
 
40
67
  - [`@andrewkimjoseph/celina-mcp`](https://www.npmjs.com/package/@andrewkimjoseph/celina-mcp) — MCP server for IDE/CLI agents
@@ -37,6 +37,18 @@ export declare const goodDollarIdentityAbi: readonly [{
37
37
  readonly name: "";
38
38
  readonly type: "bool";
39
39
  }];
40
+ }, {
41
+ readonly name: "getWhitelistedRoot";
42
+ readonly type: "function";
43
+ readonly stateMutability: "view";
44
+ readonly inputs: readonly [{
45
+ readonly name: "account";
46
+ readonly type: "address";
47
+ }];
48
+ readonly outputs: readonly [{
49
+ readonly name: "whitelisted";
50
+ readonly type: "address";
51
+ }];
40
52
  }, {
41
53
  readonly name: "authenticationPeriod";
42
54
  readonly type: "function";
@@ -20,6 +20,13 @@ export const goodDollarIdentityAbi = [
20
20
  inputs: [{ name: "account", type: "address" }],
21
21
  outputs: [{ name: "", type: "bool" }],
22
22
  },
23
+ {
24
+ name: "getWhitelistedRoot",
25
+ type: "function",
26
+ stateMutability: "view",
27
+ inputs: [{ name: "account", type: "address" }],
28
+ outputs: [{ name: "whitelisted", type: "address" }],
29
+ },
23
30
  {
24
31
  name: "authenticationPeriod",
25
32
  type: "function",
@@ -1 +1 @@
1
- {"version":3,"file":"gooddollar-identity.js","sourceRoot":"","sources":["../../src/abis/gooddollar-identity.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC;QACE,IA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I,EAAE,sBAAsB;QAC5B,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KACzC;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACvC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;KACvC;CACqB,CAAC"}
@@ -0,0 +1,194 @@
1
+ export declare const selfRegistryAbi: readonly [{
2
+ readonly name: "isVerifiedAgent";
3
+ readonly type: "function";
4
+ readonly stateMutability: "view";
5
+ readonly inputs: readonly [{
6
+ readonly name: "agentPubKey";
7
+ readonly type: "bytes32";
8
+ }];
9
+ readonly outputs: readonly [{
10
+ readonly name: "";
11
+ readonly type: "bool";
12
+ }];
13
+ }, {
14
+ readonly name: "getAgentId";
15
+ readonly type: "function";
16
+ readonly stateMutability: "view";
17
+ readonly inputs: readonly [{
18
+ readonly name: "agentPubKey";
19
+ readonly type: "bytes32";
20
+ }];
21
+ readonly outputs: readonly [{
22
+ readonly name: "";
23
+ readonly type: "uint256";
24
+ }];
25
+ }, {
26
+ readonly name: "hasHumanProof";
27
+ readonly type: "function";
28
+ readonly stateMutability: "view";
29
+ readonly inputs: readonly [{
30
+ readonly name: "agentId";
31
+ readonly type: "uint256";
32
+ }];
33
+ readonly outputs: readonly [{
34
+ readonly name: "";
35
+ readonly type: "bool";
36
+ }];
37
+ }, {
38
+ readonly name: "getHumanNullifier";
39
+ readonly type: "function";
40
+ readonly stateMutability: "view";
41
+ readonly inputs: readonly [{
42
+ readonly name: "agentId";
43
+ readonly type: "uint256";
44
+ }];
45
+ readonly outputs: readonly [{
46
+ readonly name: "";
47
+ readonly type: "uint256";
48
+ }];
49
+ }, {
50
+ readonly name: "getAgentCountForHuman";
51
+ readonly type: "function";
52
+ readonly stateMutability: "view";
53
+ readonly inputs: readonly [{
54
+ readonly name: "nullifier";
55
+ readonly type: "uint256";
56
+ }];
57
+ readonly outputs: readonly [{
58
+ readonly name: "";
59
+ readonly type: "uint256";
60
+ }];
61
+ }, {
62
+ readonly name: "getProofProvider";
63
+ readonly type: "function";
64
+ readonly stateMutability: "view";
65
+ readonly inputs: readonly [{
66
+ readonly name: "agentId";
67
+ readonly type: "uint256";
68
+ }];
69
+ readonly outputs: readonly [{
70
+ readonly name: "";
71
+ readonly type: "address";
72
+ }];
73
+ }, {
74
+ readonly name: "selfProofProvider";
75
+ readonly type: "function";
76
+ readonly stateMutability: "view";
77
+ readonly inputs: readonly [];
78
+ readonly outputs: readonly [{
79
+ readonly name: "";
80
+ readonly type: "address";
81
+ }];
82
+ }, {
83
+ readonly name: "getAgentCredentials";
84
+ readonly type: "function";
85
+ readonly stateMutability: "view";
86
+ readonly inputs: readonly [{
87
+ readonly name: "agentId";
88
+ readonly type: "uint256";
89
+ }];
90
+ readonly outputs: readonly [{
91
+ readonly name: "";
92
+ readonly type: "tuple";
93
+ readonly components: readonly [{
94
+ readonly name: "issuingState";
95
+ readonly type: "string";
96
+ }, {
97
+ readonly name: "name";
98
+ readonly type: "string[]";
99
+ }, {
100
+ readonly name: "idNumber";
101
+ readonly type: "string";
102
+ }, {
103
+ readonly name: "nationality";
104
+ readonly type: "string";
105
+ }, {
106
+ readonly name: "dateOfBirth";
107
+ readonly type: "string";
108
+ }, {
109
+ readonly name: "gender";
110
+ readonly type: "string";
111
+ }, {
112
+ readonly name: "expiryDate";
113
+ readonly type: "string";
114
+ }, {
115
+ readonly name: "olderThan";
116
+ readonly type: "uint256";
117
+ }, {
118
+ readonly name: "ofac";
119
+ readonly type: "bool[3]";
120
+ }];
121
+ }];
122
+ }, {
123
+ readonly name: "agentRegisteredAt";
124
+ readonly type: "function";
125
+ readonly stateMutability: "view";
126
+ readonly inputs: readonly [{
127
+ readonly name: "agentId";
128
+ readonly type: "uint256";
129
+ }];
130
+ readonly outputs: readonly [{
131
+ readonly name: "";
132
+ readonly type: "uint256";
133
+ }];
134
+ }, {
135
+ readonly name: "proofExpiresAt";
136
+ readonly type: "function";
137
+ readonly stateMutability: "view";
138
+ readonly inputs: readonly [{
139
+ readonly name: "agentId";
140
+ readonly type: "uint256";
141
+ }];
142
+ readonly outputs: readonly [{
143
+ readonly name: "";
144
+ readonly type: "uint256";
145
+ }];
146
+ }, {
147
+ readonly name: "isProofFresh";
148
+ readonly type: "function";
149
+ readonly stateMutability: "view";
150
+ readonly inputs: readonly [{
151
+ readonly name: "agentId";
152
+ readonly type: "uint256";
153
+ }];
154
+ readonly outputs: readonly [{
155
+ readonly name: "";
156
+ readonly type: "bool";
157
+ }];
158
+ }, {
159
+ readonly name: "getAgentsForNullifier";
160
+ readonly type: "function";
161
+ readonly stateMutability: "view";
162
+ readonly inputs: readonly [{
163
+ readonly name: "nullifier";
164
+ readonly type: "uint256";
165
+ }];
166
+ readonly outputs: readonly [{
167
+ readonly name: "";
168
+ readonly type: "uint256[]";
169
+ }];
170
+ }, {
171
+ readonly name: "ownerOf";
172
+ readonly type: "function";
173
+ readonly stateMutability: "view";
174
+ readonly inputs: readonly [{
175
+ readonly name: "tokenId";
176
+ readonly type: "uint256";
177
+ }];
178
+ readonly outputs: readonly [{
179
+ readonly name: "";
180
+ readonly type: "address";
181
+ }];
182
+ }, {
183
+ readonly name: "updateAgentMetadata";
184
+ readonly type: "function";
185
+ readonly stateMutability: "nonpayable";
186
+ readonly inputs: readonly [{
187
+ readonly name: "agentId";
188
+ readonly type: "uint256";
189
+ }, {
190
+ readonly name: "metadata";
191
+ readonly type: "string";
192
+ }];
193
+ readonly outputs: readonly [];
194
+ }];
@@ -0,0 +1,120 @@
1
+ export const selfRegistryAbi = [
2
+ {
3
+ name: "isVerifiedAgent",
4
+ type: "function",
5
+ stateMutability: "view",
6
+ inputs: [{ name: "agentPubKey", type: "bytes32" }],
7
+ outputs: [{ name: "", type: "bool" }],
8
+ },
9
+ {
10
+ name: "getAgentId",
11
+ type: "function",
12
+ stateMutability: "view",
13
+ inputs: [{ name: "agentPubKey", type: "bytes32" }],
14
+ outputs: [{ name: "", type: "uint256" }],
15
+ },
16
+ {
17
+ name: "hasHumanProof",
18
+ type: "function",
19
+ stateMutability: "view",
20
+ inputs: [{ name: "agentId", type: "uint256" }],
21
+ outputs: [{ name: "", type: "bool" }],
22
+ },
23
+ {
24
+ name: "getHumanNullifier",
25
+ type: "function",
26
+ stateMutability: "view",
27
+ inputs: [{ name: "agentId", type: "uint256" }],
28
+ outputs: [{ name: "", type: "uint256" }],
29
+ },
30
+ {
31
+ name: "getAgentCountForHuman",
32
+ type: "function",
33
+ stateMutability: "view",
34
+ inputs: [{ name: "nullifier", type: "uint256" }],
35
+ outputs: [{ name: "", type: "uint256" }],
36
+ },
37
+ {
38
+ name: "getProofProvider",
39
+ type: "function",
40
+ stateMutability: "view",
41
+ inputs: [{ name: "agentId", type: "uint256" }],
42
+ outputs: [{ name: "", type: "address" }],
43
+ },
44
+ {
45
+ name: "selfProofProvider",
46
+ type: "function",
47
+ stateMutability: "view",
48
+ inputs: [],
49
+ outputs: [{ name: "", type: "address" }],
50
+ },
51
+ {
52
+ name: "getAgentCredentials",
53
+ type: "function",
54
+ stateMutability: "view",
55
+ inputs: [{ name: "agentId", type: "uint256" }],
56
+ outputs: [
57
+ {
58
+ name: "",
59
+ type: "tuple",
60
+ components: [
61
+ { name: "issuingState", type: "string" },
62
+ { name: "name", type: "string[]" },
63
+ { name: "idNumber", type: "string" },
64
+ { name: "nationality", type: "string" },
65
+ { name: "dateOfBirth", type: "string" },
66
+ { name: "gender", type: "string" },
67
+ { name: "expiryDate", type: "string" },
68
+ { name: "olderThan", type: "uint256" },
69
+ { name: "ofac", type: "bool[3]" },
70
+ ],
71
+ },
72
+ ],
73
+ },
74
+ {
75
+ name: "agentRegisteredAt",
76
+ type: "function",
77
+ stateMutability: "view",
78
+ inputs: [{ name: "agentId", type: "uint256" }],
79
+ outputs: [{ name: "", type: "uint256" }],
80
+ },
81
+ {
82
+ name: "proofExpiresAt",
83
+ type: "function",
84
+ stateMutability: "view",
85
+ inputs: [{ name: "agentId", type: "uint256" }],
86
+ outputs: [{ name: "", type: "uint256" }],
87
+ },
88
+ {
89
+ name: "isProofFresh",
90
+ type: "function",
91
+ stateMutability: "view",
92
+ inputs: [{ name: "agentId", type: "uint256" }],
93
+ outputs: [{ name: "", type: "bool" }],
94
+ },
95
+ {
96
+ name: "getAgentsForNullifier",
97
+ type: "function",
98
+ stateMutability: "view",
99
+ inputs: [{ name: "nullifier", type: "uint256" }],
100
+ outputs: [{ name: "", type: "uint256[]" }],
101
+ },
102
+ {
103
+ name: "ownerOf",
104
+ type: "function",
105
+ stateMutability: "view",
106
+ inputs: [{ name: "tokenId", type: "uint256" }],
107
+ outputs: [{ name: "", type: "address" }],
108
+ },
109
+ {
110
+ name: "updateAgentMetadata",
111
+ type: "function",
112
+ stateMutability: "nonpayable",
113
+ inputs: [
114
+ { name: "agentId", type: "uint256" },
115
+ { name: "metadata", type: "string" },
116
+ ],
117
+ outputs: [],
118
+ },
119
+ ];
120
+ //# sourceMappingURL=self-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self-registry.js","sourceRoot":"","sources":["../../src/abis/self-registry.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B;QACE,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAClD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KACtC;IACD;QACE,IAAI,EA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pC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;SACrC;QACD,OAAO,EAAE,EAAE;KACZ;CACqB,CAAC"}
@@ -0,0 +1,79 @@
1
+ export declare const ubiSchemeAbi: readonly [{
2
+ readonly name: "claim";
3
+ readonly type: "function";
4
+ readonly stateMutability: "nonpayable";
5
+ readonly inputs: readonly [];
6
+ readonly outputs: readonly [{
7
+ readonly name: "";
8
+ readonly type: "bool";
9
+ }];
10
+ }, {
11
+ readonly name: "checkEntitlement";
12
+ readonly type: "function";
13
+ readonly stateMutability: "view";
14
+ readonly inputs: readonly [{
15
+ readonly name: "_member";
16
+ readonly type: "address";
17
+ }];
18
+ readonly outputs: readonly [{
19
+ readonly name: "";
20
+ readonly type: "uint256";
21
+ }];
22
+ }, {
23
+ readonly name: "hasClaimed";
24
+ readonly type: "function";
25
+ readonly stateMutability: "view";
26
+ readonly inputs: readonly [{
27
+ readonly name: "account";
28
+ readonly type: "address";
29
+ }];
30
+ readonly outputs: readonly [{
31
+ readonly name: "";
32
+ readonly type: "bool";
33
+ }];
34
+ }, {
35
+ readonly name: "paused";
36
+ readonly type: "function";
37
+ readonly stateMutability: "view";
38
+ readonly inputs: readonly [];
39
+ readonly outputs: readonly [{
40
+ readonly name: "";
41
+ readonly type: "bool";
42
+ }];
43
+ }, {
44
+ readonly name: "periodStart";
45
+ readonly type: "function";
46
+ readonly stateMutability: "view";
47
+ readonly inputs: readonly [];
48
+ readonly outputs: readonly [{
49
+ readonly name: "";
50
+ readonly type: "uint256";
51
+ }];
52
+ }, {
53
+ readonly name: "estimateNextDailyUBI";
54
+ readonly type: "function";
55
+ readonly stateMutability: "view";
56
+ readonly inputs: readonly [];
57
+ readonly outputs: readonly [{
58
+ readonly name: "";
59
+ readonly type: "uint256";
60
+ }];
61
+ }, {
62
+ readonly name: "dailyUbi";
63
+ readonly type: "function";
64
+ readonly stateMutability: "view";
65
+ readonly inputs: readonly [];
66
+ readonly outputs: readonly [{
67
+ readonly name: "";
68
+ readonly type: "uint256";
69
+ }];
70
+ }, {
71
+ readonly name: "currentDay";
72
+ readonly type: "function";
73
+ readonly stateMutability: "view";
74
+ readonly inputs: readonly [];
75
+ readonly outputs: readonly [{
76
+ readonly name: "";
77
+ readonly type: "uint256";
78
+ }];
79
+ }];
@@ -0,0 +1,59 @@
1
+ export const ubiSchemeAbi = [
2
+ {
3
+ name: "claim",
4
+ type: "function",
5
+ stateMutability: "nonpayable",
6
+ inputs: [],
7
+ outputs: [{ name: "", type: "bool" }],
8
+ },
9
+ {
10
+ name: "checkEntitlement",
11
+ type: "function",
12
+ stateMutability: "view",
13
+ inputs: [{ name: "_member", type: "address" }],
14
+ outputs: [{ name: "", type: "uint256" }],
15
+ },
16
+ {
17
+ name: "hasClaimed",
18
+ type: "function",
19
+ stateMutability: "view",
20
+ inputs: [{ name: "account", type: "address" }],
21
+ outputs: [{ name: "", type: "bool" }],
22
+ },
23
+ {
24
+ name: "paused",
25
+ type: "function",
26
+ stateMutability: "view",
27
+ inputs: [],
28
+ outputs: [{ name: "", type: "bool" }],
29
+ },
30
+ {
31
+ name: "periodStart",
32
+ type: "function",
33
+ stateMutability: "view",
34
+ inputs: [],
35
+ outputs: [{ name: "", type: "uint256" }],
36
+ },
37
+ {
38
+ name: "estimateNextDailyUBI",
39
+ type: "function",
40
+ stateMutability: "view",
41
+ inputs: [],
42
+ outputs: [{ name: "", type: "uint256" }],
43
+ },
44
+ {
45
+ name: "dailyUbi",
46
+ type: "function",
47
+ stateMutability: "view",
48
+ inputs: [],
49
+ outputs: [{ name: "", type: "uint256" }],
50
+ },
51
+ {
52
+ name: "currentDay",
53
+ type: "function",
54
+ stateMutability: "view",
55
+ inputs: [],
56
+ outputs: [{ name: "", type: "uint256" }],
57
+ },
58
+ ];
59
+ //# sourceMappingURL=ubi-scheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ubi-scheme.js","sourceRoot":"","sources":["../../src/abis/ubi-scheme.ts"],"names":[],"m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AE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KACzC;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KACzC;IACD;QACE,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KACzC;CACqB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { SdkConfig } from "../config/sdk-config.js";
2
+ /** Test-only hook to assert telemetry without calling Amplitude. */
3
+ export declare function setTrackFnForTests(fn: ((eventName: string, config: SdkConfig) => void) | null): void;
4
+ /** Fire-and-forget MCP tool name event; never throws to callers. */
5
+ export declare function trackMcpTool(eventName: string, config: SdkConfig): void;
@@ -0,0 +1,56 @@
1
+ import { isAnalyticsEnabled, resolveAmplitudeApiKey, resolveDeviceId, } from "./config.js";
2
+ let initialized = false;
3
+ let testTrackFn = null;
4
+ /** Test-only hook to assert telemetry without calling Amplitude. */
5
+ export function setTrackFnForTests(fn) {
6
+ testTrackFn = fn;
7
+ initialized = false;
8
+ }
9
+ async function ensureInit(config) {
10
+ const apiKey = resolveAmplitudeApiKey(config);
11
+ if (!apiKey) {
12
+ return false;
13
+ }
14
+ if (initialized) {
15
+ return true;
16
+ }
17
+ try {
18
+ const amplitude = await import("@amplitude/analytics-node");
19
+ amplitude.init(apiKey);
20
+ initialized = true;
21
+ return true;
22
+ }
23
+ catch {
24
+ return false;
25
+ }
26
+ }
27
+ /** Fire-and-forget MCP tool name event; never throws to callers. */
28
+ export function trackMcpTool(eventName, config) {
29
+ if (!isAnalyticsEnabled(config)) {
30
+ return;
31
+ }
32
+ if (testTrackFn) {
33
+ try {
34
+ testTrackFn(eventName, config);
35
+ }
36
+ catch {
37
+ // ignore test hook failures
38
+ }
39
+ return;
40
+ }
41
+ void (async () => {
42
+ try {
43
+ if (!(await ensureInit(config))) {
44
+ return;
45
+ }
46
+ const amplitude = await import("@amplitude/analytics-node");
47
+ amplitude.track(eventName, undefined, {
48
+ device_id: resolveDeviceId(config),
49
+ });
50
+ }
51
+ catch {
52
+ // telemetry must not break SDK reads
53
+ }
54
+ })();
55
+ }
56
+ //# sourceMappingURL=amplitude.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amplitude.js","sourceRoot":"","sources":["../../src/analytics/amplitude.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB,IAAI,WAAW,GACb,IAAI,CAAC;AAEP,oEAAoE;AACpE,MAAM,UAAU,kBAAkB,CAChC,EAA2D;IAE3D,WAAW,GAAG,EAAE,CAAC;IACjB,WAAW,GAAG,KAAK,CAAC;AACtB,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,MAAiB;IACzC,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC;QAC5D,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,WAAW,GAAG,IAAI,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,YAAY,CAAC,SAAiB,EAAE,MAAiB;IAC/D,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;QAChC,OAAO;IACT,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,CAAC;YACH,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACjC,CAAC;QAAC,MAAM,CAAC;YACP,4BAA4B;QAC9B,CAAC;QACD,OAAO;IACT,CAAC;IAED,KAAK,CAAC,KAAK,IAAI,EAAE;QACf,IAAI,CAAC;YACH,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBAChC,OAAO;YACT,CAAC;YACD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC;YAC5D,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE;gBACpC,SAAS,EAAE,eAAe,CAAC,MAAM,CAAC;aACnC,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,qCAAqC;QACvC,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { SdkConfig } from "../config/sdk-config.js";
2
+ /** Public Amplitude project ingestion key (bundled for default telemetry on Node installs). */
3
+ export declare const DEFAULT_AMPLITUDE_API_KEY = "f36f9a7fdc253ed864072edc627b2a55";
4
+ /** Whether Amplitude read telemetry is active for this process. */
5
+ export declare function isAnalyticsEnabled(config: SdkConfig): boolean;
6
+ export declare function resolveAmplitudeApiKey(config: SdkConfig): string | undefined;
7
+ export declare function resolveDeviceId(config: SdkConfig): string;
@@ -0,0 +1,30 @@
1
+ /** Public Amplitude project ingestion key (bundled for default telemetry on Node installs). */
2
+ export const DEFAULT_AMPLITUDE_API_KEY = "f36f9a7fdc253ed864072edc627b2a55";
3
+ const DEFAULT_DEVICE_ID = "celina-sdk";
4
+ /** Whether Amplitude read telemetry is active for this process. */
5
+ export function isAnalyticsEnabled(config) {
6
+ if (typeof process === "undefined") {
7
+ return false;
8
+ }
9
+ if (process.env.CELINA_ANALYTICS_DISABLED === "1") {
10
+ return false;
11
+ }
12
+ if (config.analyticsEnabled === false) {
13
+ return false;
14
+ }
15
+ return true;
16
+ }
17
+ export function resolveAmplitudeApiKey(config) {
18
+ if (!isAnalyticsEnabled(config)) {
19
+ return undefined;
20
+ }
21
+ return (config.amplitudeApiKey ??
22
+ process.env.AMPLITUDE_API_KEY ??
23
+ DEFAULT_AMPLITUDE_API_KEY);
24
+ }
25
+ export function resolveDeviceId(config) {
26
+ return (config.analyticsDeviceId ??
27
+ process.env.CELINA_ANALYTICS_DEVICE_ID ??
28
+ DEFAULT_DEVICE_ID);
29
+ }
30
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/analytics/config.ts"],"names":[],"mappings":"AAEA,+FAA+F;AAC/F,MAAM,CAAC,MAAM,yBAAyB,GAAG,kCAAkC,CAAC;AAE5E,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAEvC,mEAAmE;AACnE,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,CAAC,GAAG,CAAC,yBAAyB,KAAK,GAAG,EAAE,CAAC;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,MAAM,CAAC,gBAAgB,KAAK,KAAK,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,MAAiB;IACtD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,CACL,MAAM,CAAC,eAAe;QACtB,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAC7B,yBAAyB,CAC1B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,OAAO,CACL,MAAM,CAAC,iBAAiB;QACxB,OAAO,CAAC,GAAG,CAAC,0BAA0B;QACtC,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated by scripts/generate-mcp-analytics-map.mjs — do not edit by hand.
3
+ * Maps SDK method keys (catalog OperationSpec.id) to MCP tool event names.
4
+ */
5
+ export declare const MCP_TOOL_EVENT_BY_SDK_METHOD: Readonly<Record<string, string>>;