@andrewkimjoseph/celina 0.2.17 → 0.3.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.
- package/README.md +45 -15
- package/build/abis/self-registry.d.ts +194 -0
- package/build/abis/self-registry.js +120 -0
- package/build/abis/self-registry.js.map +1 -0
- package/build/clients/self-api.d.ts +82 -0
- package/build/clients/self-api.js +242 -0
- package/build/clients/self-api.js.map +1 -0
- package/build/config/env.d.ts +1 -0
- package/build/config/env.js +1 -0
- package/build/config/env.js.map +1 -1
- package/build/config/self.d.ts +22 -0
- package/build/config/self.js +27 -0
- package/build/config/self.js.map +1 -0
- package/build/context/app-context.d.ts +4 -1
- package/build/context/app-context.js +4 -1
- package/build/context/app-context.js.map +1 -1
- package/build/server/create-server.js +1 -1
- package/build/server/create-server.js.map +1 -1
- package/build/server/instructions.js +6 -2
- package/build/server/instructions.js.map +1 -1
- package/build/services/self-session-store.d.ts +19 -0
- package/build/services/self-session-store.js +28 -0
- package/build/services/self-session-store.js.map +1 -0
- package/build/services/self.service.d.ts +250 -0
- package/build/services/self.service.js +689 -0
- package/build/services/self.service.js.map +1 -0
- package/build/tools/index.js +2 -0
- package/build/tools/index.js.map +1 -1
- package/build/tools/self.tools.d.ts +2 -0
- package/build/tools/self.tools.js +256 -0
- package/build/tools/self.tools.js.map +1 -0
- package/build/utils/self-format.d.ts +16 -0
- package/build/utils/self-format.js +59 -0
- package/build/utils/self-format.js.map +1 -0
- package/build/utils/self-signing.d.ts +4 -0
- package/build/utils/self-signing.js +38 -0
- package/build/utils/self-signing.js.map +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -24,10 +24,12 @@ npm: [@andrewkimjoseph/celina](https://www.npmjs.com/package/@andrewkimjoseph/ce
|
|
|
24
24
|
|
|
25
25
|
## Quick start
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Celina is not meant to be run manually in a terminal for normal use. Your MCP client (Cursor, Claude Desktop, LM Studio, etc.) spawns it as a child process and talks to it over stdio. Install the package, then add it to your MCP config (see [Cursor / Claude Desktop config](#cursor--claude-desktop-config)).
|
|
28
|
+
|
|
29
|
+
**From npm:**
|
|
28
30
|
|
|
29
31
|
```bash
|
|
30
|
-
|
|
32
|
+
npm i @andrewkimjoseph/celina
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
**From source** (development):
|
|
@@ -78,16 +80,14 @@ openssl rsa -pubout -in private.pem -out public.pem
|
|
|
78
80
|
|
|
79
81
|
### Claude Desktop — remote (free plan)
|
|
80
82
|
|
|
81
|
-
Claude Desktop's `claude_desktop_config.json` only supports local stdio servers — it does **not** accept `"type": "streamable-http"` with a `"url"`. Free-plan users should bridge the hosted server with [`mcp-remote`](https://github.com/geelen/mcp-remote):
|
|
83
|
+
Claude Desktop's `claude_desktop_config.json` only supports local stdio servers — it does **not** accept `"type": "streamable-http"` with a `"url"`. Free-plan users should bridge the hosted server with [`mcp-remote`](https://github.com/geelen/mcp-remote). Install it once (`npm i -g mcp-remote`), then:
|
|
82
84
|
|
|
83
85
|
```json
|
|
84
86
|
{
|
|
85
87
|
"mcpServers": {
|
|
86
88
|
"celina": {
|
|
87
|
-
"command": "
|
|
89
|
+
"command": "mcp-remote",
|
|
88
90
|
"args": [
|
|
89
|
-
"-y",
|
|
90
|
-
"mcp-remote",
|
|
91
91
|
"https://mcp.celina.andrewkimjoseph.com/mcp",
|
|
92
92
|
"--transport",
|
|
93
93
|
"http-only"
|
|
@@ -103,12 +103,14 @@ Fully quit and relaunch Claude Desktop after editing the config (closing the win
|
|
|
103
103
|
|
|
104
104
|
### Local stdio (npm)
|
|
105
105
|
|
|
106
|
+
After `npm i @andrewkimjoseph/celina`, point your MCP client at the installed entry file (use an absolute path):
|
|
107
|
+
|
|
106
108
|
```json
|
|
107
109
|
{
|
|
108
110
|
"mcpServers": {
|
|
109
111
|
"celina": {
|
|
110
|
-
"command": "
|
|
111
|
-
"args": ["
|
|
112
|
+
"command": "node",
|
|
113
|
+
"args": ["/absolute/path/to/node_modules/@andrewkimjoseph/celina/build/index.js"]
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
}
|
|
@@ -156,8 +158,8 @@ LM Studio can host MCP servers directly via `mcp.json` (same format as Cursor).
|
|
|
156
158
|
{
|
|
157
159
|
"mcpServers": {
|
|
158
160
|
"celina": {
|
|
159
|
-
"command": "
|
|
160
|
-
"args": ["
|
|
161
|
+
"command": "node",
|
|
162
|
+
"args": ["/absolute/path/to/node_modules/@andrewkimjoseph/celina/build/index.js"],
|
|
161
163
|
"env": {
|
|
162
164
|
"CELO_PRIVATE_KEY": "0x..."
|
|
163
165
|
}
|
|
@@ -204,10 +206,9 @@ schema: v1
|
|
|
204
206
|
mcpServers:
|
|
205
207
|
- name: celina
|
|
206
208
|
type: stdio
|
|
207
|
-
command:
|
|
209
|
+
command: node
|
|
208
210
|
args:
|
|
209
|
-
- "
|
|
210
|
-
- "@andrewkimjoseph/celina"
|
|
211
|
+
- "/absolute/path/to/node_modules/@andrewkimjoseph/celina/build/index.js"
|
|
211
212
|
env:
|
|
212
213
|
CELO_PRIVATE_KEY: "0x..."
|
|
213
214
|
```
|
|
@@ -255,6 +256,8 @@ The server decrypts the key ephemerally to sign the transaction — it is not st
|
|
|
255
256
|
|----------|---------|-------------|
|
|
256
257
|
| `CELO_RPC_URL_MAINNET` | Forno public RPC | Override mainnet RPC |
|
|
257
258
|
| `CELO_PRIVATE_KEY` | — | Local stdio write tools only |
|
|
259
|
+
| `SELF_AGENT_PRIVATE_KEY` | — | Self Agent ID signing/identity tools (separate from CELO wallet) |
|
|
260
|
+
| `SELF_AGENT_API_BASE` | `https://app.ai.self.xyz` | Override Self Agent ID REST API base URL |
|
|
258
261
|
| `WALLET_ENCRYPTION_PRIVATE_KEY` | — | RSA private key PEM for HTTP write tools |
|
|
259
262
|
| `ALLOWED_HOSTS` | — | Comma-separated custom hostnames (e.g. `mcp.celina.andrewkimjoseph.com`) |
|
|
260
263
|
| `PORT` | `10000` | HTTP server port (set by Render) |
|
|
@@ -297,6 +300,33 @@ Token symbols are resolved case-insensitively. Legacy aliases `cUSD` and `cEUR`
|
|
|
297
300
|
| `execute_mento_fx` | write | Execute Mento FX conversion |
|
|
298
301
|
| `supply_aave_usdt` | write | Supply USDT to Aave V3 on Celo |
|
|
299
302
|
| `withdraw_aave_usdt` | write | Withdraw USDT from Aave V3 on Celo |
|
|
303
|
+
| `get_gooddollar_whitelisting_info` | read | GoodDollar IdentityV4 whitelist status |
|
|
304
|
+
| `verify_self_agent` | read | Verify Self Agent ID on-chain by address |
|
|
305
|
+
| `lookup_self_agent` | read | Look up Self agent by numeric ID (ai.self.xyz) |
|
|
306
|
+
| `verify_self_request` | read | Verify signed Self Agent HTTP request headers |
|
|
307
|
+
| `register_self_agent` | write | Start Self agent registration (QR/deep link) |
|
|
308
|
+
| `check_self_registration` | read* | Poll registration/refresh/deregister session (*may return private key) |
|
|
309
|
+
| `get_self_identity` | read* | Current Self agent identity (*needs agent key) |
|
|
310
|
+
| `refresh_self_proof` | write | Renew human proof after on-chain expiry (`isProofFresh` false) |
|
|
311
|
+
| `deregister_self_agent` | write | Irreversibly revoke Self agent identity |
|
|
312
|
+
| `sign_self_request` | read* | Sign HTTP request with Self agent headers (*needs agent key) |
|
|
313
|
+
| `authenticated_self_fetch` | write | HTTP fetch with Self agent auth (*needs agent key) |
|
|
314
|
+
|
|
315
|
+
### Self Agent ID notes
|
|
316
|
+
|
|
317
|
+
- **Registration lifecycle APIs** (`register_self_agent`, `refresh_self_proof`, `deregister_self_agent`) use `network: "mainnet"` in the Self REST API request body.
|
|
318
|
+
- **Demo and gated HTTP endpoints** (e.g. `https://app.ai.self.xyz/api/demo/verify`) require the query param **`network=celo-mainnet`**, not `network=mainnet`.
|
|
319
|
+
- **QR scan URLs** use `/scan/{sessionToken}`, not `/qr/...`.
|
|
320
|
+
- **`refresh_self_proof`** only starts after on-chain proof expiry (`isProofFresh` is false); while fresh it returns a clear error instead of a QR that will fail on-chain. The 30-day `is_expiring_soon` flag (matching Self SDK `isProofExpiringSoon`) is for warnings only. Self SDK also documents deregister → re-register as an alternative renewal path.
|
|
321
|
+
|
|
322
|
+
Example authenticated demo call:
|
|
323
|
+
|
|
324
|
+
```text
|
|
325
|
+
authenticated_self_fetch
|
|
326
|
+
method: POST
|
|
327
|
+
url: https://app.ai.self.xyz/api/demo/verify?network=celo-mainnet
|
|
328
|
+
body: {}
|
|
329
|
+
```
|
|
300
330
|
|
|
301
331
|
## Adding a new tool
|
|
302
332
|
|
|
@@ -324,8 +354,8 @@ No changes to `src/index.ts` or server bootstrap required.
|
|
|
324
354
|
|
|
325
355
|
- [x] Mento FX routing (`get_mento_fx_quote`, `estimate_mento_fx`, `execute_mento_fx`)
|
|
326
356
|
- [x] Aave lending tools (`supply_aave_usdt`, `withdraw_aave_usdt`)
|
|
327
|
-
- [
|
|
328
|
-
- [
|
|
357
|
+
- [x] Self proof verification (`verify_self_agent`, `verify_self_request`, `ai.self.xyz`)
|
|
358
|
+
- [x] Self Agent ID check (`lookup_self_agent`, registration & lifecycle tools)
|
|
329
359
|
|
|
330
360
|
## Development
|
|
331
361
|
|
|
@@ -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;QA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;QAChB,eAAe,EAAE,YAAY;QAC7B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;SACrC;QACD,OAAO,EAAE,EAAE;KACZ;CACqB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type SelfRegistrationMode } from "../config/self.js";
|
|
2
|
+
export declare class SelfApiError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class SelfExpiredSessionError extends Error {
|
|
6
|
+
constructor(message?: string);
|
|
7
|
+
}
|
|
8
|
+
export interface SelfRegistrationDisclosures {
|
|
9
|
+
minimumAge?: number;
|
|
10
|
+
ofac?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SelfRegistrationResult {
|
|
13
|
+
agentId: number;
|
|
14
|
+
agentAddress: string;
|
|
15
|
+
credentials?: unknown;
|
|
16
|
+
txHash?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SelfRefreshResult {
|
|
19
|
+
proofExpiresAt: Date;
|
|
20
|
+
}
|
|
21
|
+
export interface SelfRegistrationSession {
|
|
22
|
+
sessionToken: string;
|
|
23
|
+
stage: string;
|
|
24
|
+
deepLink: string;
|
|
25
|
+
scanUrl?: string;
|
|
26
|
+
agentAddress: string;
|
|
27
|
+
expiresAt: string;
|
|
28
|
+
timeRemainingMs?: number;
|
|
29
|
+
humanInstructions: string[];
|
|
30
|
+
waitForCompletion(opts?: {
|
|
31
|
+
timeoutMs?: number;
|
|
32
|
+
pollIntervalMs?: number;
|
|
33
|
+
}): Promise<SelfRegistrationResult>;
|
|
34
|
+
exportKey(): Promise<string>;
|
|
35
|
+
}
|
|
36
|
+
export interface SelfRefreshSession {
|
|
37
|
+
sessionToken: string;
|
|
38
|
+
stage: string;
|
|
39
|
+
deepLink: string;
|
|
40
|
+
scanUrl?: string;
|
|
41
|
+
expiresAt: string;
|
|
42
|
+
timeRemainingMs?: number;
|
|
43
|
+
humanInstructions: string[];
|
|
44
|
+
waitForCompletion(opts?: {
|
|
45
|
+
timeoutMs?: number;
|
|
46
|
+
pollIntervalMs?: number;
|
|
47
|
+
}): Promise<SelfRefreshResult>;
|
|
48
|
+
}
|
|
49
|
+
export interface SelfDeregistrationSession {
|
|
50
|
+
sessionToken: string;
|
|
51
|
+
stage: string;
|
|
52
|
+
deepLink: string;
|
|
53
|
+
scanUrl?: string;
|
|
54
|
+
expiresAt: string;
|
|
55
|
+
timeRemainingMs?: number;
|
|
56
|
+
humanInstructions: string[];
|
|
57
|
+
waitForCompletion(opts?: {
|
|
58
|
+
timeoutMs?: number;
|
|
59
|
+
pollIntervalMs?: number;
|
|
60
|
+
}): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
export declare function requestRegistration(opts: {
|
|
63
|
+
mode?: SelfRegistrationMode;
|
|
64
|
+
disclosures?: SelfRegistrationDisclosures;
|
|
65
|
+
humanAddress?: string;
|
|
66
|
+
agentName?: string;
|
|
67
|
+
agentDescription?: string;
|
|
68
|
+
apiBase?: string;
|
|
69
|
+
}): Promise<SelfRegistrationSession>;
|
|
70
|
+
export declare function requestDeregistration(opts: {
|
|
71
|
+
agentAddress: string;
|
|
72
|
+
disclosures?: SelfRegistrationDisclosures;
|
|
73
|
+
apiBase?: string;
|
|
74
|
+
}): Promise<SelfDeregistrationSession>;
|
|
75
|
+
export declare function requestProofRefresh(opts: {
|
|
76
|
+
agentId: number;
|
|
77
|
+
disclosures?: SelfRegistrationDisclosures;
|
|
78
|
+
apiBase?: string;
|
|
79
|
+
}): Promise<SelfRefreshSession>;
|
|
80
|
+
export declare function getAgentInfo(agentId: number, apiBase?: string): Promise<Record<string, unknown>>;
|
|
81
|
+
export declare function getAgentsForHuman(address: string, apiBase?: string): Promise<Record<string, unknown>>;
|
|
82
|
+
export declare function selfQrUrl(sessionToken: string, apiBase?: string): string;
|