@andrewkimjoseph/celina 0.3.6 → 0.4.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 (149) hide show
  1. package/bin/wrapper.js +2 -0
  2. package/package.json +5 -49
  3. package/LICENSE +0 -21
  4. package/README.md +0 -292
  5. package/assets/logo-black.png +0 -0
  6. package/assets/logo-yellow.png +0 -0
  7. package/assets/logo.png +0 -0
  8. package/bin/cli.js +0 -2
  9. package/build/abis/aave-pool.d.ts +0 -37
  10. package/build/abis/aave-pool.js +0 -26
  11. package/build/abis/aave-pool.js.map +0 -1
  12. package/build/abis/gooddollar-identity.d.ts +0 -61
  13. package/build/abis/gooddollar-identity.js +0 -38
  14. package/build/abis/gooddollar-identity.js.map +0 -1
  15. package/build/abis/self-registry.d.ts +0 -194
  16. package/build/abis/self-registry.js +0 -120
  17. package/build/abis/self-registry.js.map +0 -1
  18. package/build/clients/celo-client.d.ts +0 -14
  19. package/build/clients/celo-client.js +0 -58
  20. package/build/clients/celo-client.js.map +0 -1
  21. package/build/clients/ens-client.d.ts +0 -10
  22. package/build/clients/ens-client.js +0 -23
  23. package/build/clients/ens-client.js.map +0 -1
  24. package/build/clients/mento-sdk.d.ts +0 -2
  25. package/build/clients/mento-sdk.js +0 -9
  26. package/build/clients/mento-sdk.js.map +0 -1
  27. package/build/clients/self-api.d.ts +0 -82
  28. package/build/clients/self-api.js +0 -242
  29. package/build/clients/self-api.js.map +0 -1
  30. package/build/config/aave.d.ts +0 -5
  31. package/build/config/aave.js +0 -6
  32. package/build/config/aave.js.map +0 -1
  33. package/build/config/celina-tag.d.ts +0 -1
  34. package/build/config/celina-tag.js +0 -3
  35. package/build/config/celina-tag.js.map +0 -1
  36. package/build/config/chains.d.ts +0 -935
  37. package/build/config/chains.js +0 -244
  38. package/build/config/chains.js.map +0 -1
  39. package/build/config/env.d.ts +0 -7
  40. package/build/config/env.js +0 -9
  41. package/build/config/env.js.map +0 -1
  42. package/build/config/gooddollar.d.ts +0 -1
  43. package/build/config/gooddollar.js +0 -2
  44. package/build/config/gooddollar.js.map +0 -1
  45. package/build/config/load-env.d.ts +0 -1
  46. package/build/config/load-env.js +0 -4
  47. package/build/config/load-env.js.map +0 -1
  48. package/build/config/self.d.ts +0 -22
  49. package/build/config/self.js +0 -27
  50. package/build/config/self.js.map +0 -1
  51. package/build/context/app-context.d.ts +0 -28
  52. package/build/context/app-context.js +0 -28
  53. package/build/context/app-context.js.map +0 -1
  54. package/build/crypto/wallet-key-crypto.d.ts +0 -11
  55. package/build/crypto/wallet-key-crypto.js +0 -57
  56. package/build/crypto/wallet-key-crypto.js.map +0 -1
  57. package/build/http.d.ts +0 -2
  58. package/build/http.js +0 -15
  59. package/build/http.js.map +0 -1
  60. package/build/index.d.ts +0 -2
  61. package/build/index.js +0 -17
  62. package/build/index.js.map +0 -1
  63. package/build/schemas/common.d.ts +0 -6
  64. package/build/schemas/common.js +0 -24
  65. package/build/schemas/common.js.map +0 -1
  66. package/build/server/create-http-app.d.ts +0 -1
  67. package/build/server/create-http-app.js +0 -147
  68. package/build/server/create-http-app.js.map +0 -1
  69. package/build/server/create-server.d.ts +0 -2
  70. package/build/server/create-server.js +0 -23
  71. package/build/server/create-server.js.map +0 -1
  72. package/build/server/instructions.d.ts +0 -1
  73. package/build/server/instructions.js +0 -22
  74. package/build/server/instructions.js.map +0 -1
  75. package/build/services/aave.service.d.ts +0 -29
  76. package/build/services/aave.service.js +0 -166
  77. package/build/services/aave.service.js.map +0 -1
  78. package/build/services/account.service.d.ts +0 -13
  79. package/build/services/account.service.js +0 -23
  80. package/build/services/account.service.js.map +0 -1
  81. package/build/services/blockchain.service.d.ts +0 -40
  82. package/build/services/blockchain.service.js +0 -81
  83. package/build/services/blockchain.service.js.map +0 -1
  84. package/build/services/ens.service.d.ts +0 -30
  85. package/build/services/ens.service.js +0 -78
  86. package/build/services/ens.service.js.map +0 -1
  87. package/build/services/gooddollar.service.d.ts +0 -38
  88. package/build/services/gooddollar.service.js +0 -127
  89. package/build/services/gooddollar.service.js.map +0 -1
  90. package/build/services/mento-fx.service.d.ts +0 -72
  91. package/build/services/mento-fx.service.js +0 -266
  92. package/build/services/mento-fx.service.js.map +0 -1
  93. package/build/services/self-session-store.d.ts +0 -19
  94. package/build/services/self-session-store.js +0 -28
  95. package/build/services/self-session-store.js.map +0 -1
  96. package/build/services/self.service.d.ts +0 -250
  97. package/build/services/self.service.js +0 -689
  98. package/build/services/self.service.js.map +0 -1
  99. package/build/services/token.service.d.ts +0 -54
  100. package/build/services/token.service.js +0 -147
  101. package/build/services/token.service.js.map +0 -1
  102. package/build/services/transaction.service.d.ts +0 -24
  103. package/build/services/transaction.service.js +0 -117
  104. package/build/services/transaction.service.js.map +0 -1
  105. package/build/tools/aave.tools.d.ts +0 -2
  106. package/build/tools/aave.tools.js +0 -56
  107. package/build/tools/aave.tools.js.map +0 -1
  108. package/build/tools/blockchain.tools.d.ts +0 -3
  109. package/build/tools/blockchain.tools.js +0 -88
  110. package/build/tools/blockchain.tools.js.map +0 -1
  111. package/build/tools/ens.tools.d.ts +0 -2
  112. package/build/tools/ens.tools.js +0 -27
  113. package/build/tools/ens.tools.js.map +0 -1
  114. package/build/tools/gooddollar.tools.d.ts +0 -2
  115. package/build/tools/gooddollar.tools.js +0 -23
  116. package/build/tools/gooddollar.tools.js.map +0 -1
  117. package/build/tools/helpers.d.ts +0 -3
  118. package/build/tools/helpers.js +0 -16
  119. package/build/tools/helpers.js.map +0 -1
  120. package/build/tools/index.d.ts +0 -5
  121. package/build/tools/index.js +0 -25
  122. package/build/tools/index.js.map +0 -1
  123. package/build/tools/mento-fx.tools.d.ts +0 -2
  124. package/build/tools/mento-fx.tools.js +0 -87
  125. package/build/tools/mento-fx.tools.js.map +0 -1
  126. package/build/tools/self.tools.d.ts +0 -2
  127. package/build/tools/self.tools.js +0 -256
  128. package/build/tools/self.tools.js.map +0 -1
  129. package/build/tools/token.tools.d.ts +0 -2
  130. package/build/tools/token.tools.js +0 -62
  131. package/build/tools/token.tools.js.map +0 -1
  132. package/build/tools/transaction.tools.d.ts +0 -2
  133. package/build/tools/transaction.tools.js +0 -55
  134. package/build/tools/transaction.tools.js.map +0 -1
  135. package/build/tools/types.d.ts +0 -5
  136. package/build/tools/types.js +0 -2
  137. package/build/tools/types.js.map +0 -1
  138. package/build/utils/erc20-allowance-storage.d.ts +0 -7
  139. package/build/utils/erc20-allowance-storage.js +0 -44
  140. package/build/utils/erc20-allowance-storage.js.map +0 -1
  141. package/build/utils/format-date.d.ts +0 -1
  142. package/build/utils/format-date.js +0 -12
  143. package/build/utils/format-date.js.map +0 -1
  144. package/build/utils/self-format.d.ts +0 -16
  145. package/build/utils/self-format.js +0 -59
  146. package/build/utils/self-format.js.map +0 -1
  147. package/build/utils/self-signing.d.ts +0 -4
  148. package/build/utils/self-signing.js +0 -38
  149. package/build/utils/self-signing.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"self-session-store.js","sourceRoot":"","sources":["../../src/services/self-session-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AA0B3E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA6B,CAAC;AAEtD,SAAS,oBAAoB;IAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEvB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,QAAQ,EAAE,CAAC;QACpC,IAAI,GAAG,GAAG,KAAK,CAAC,SAAS,GAAG,mBAAmB,EAAE,CAAC;YAChD,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,YAAoB,EACpB,KAAwB;IAExB,oBAAoB,EAAE,CAAC;IAEvB,IAAI,QAAQ,CAAC,IAAI,IAAI,iBAAiB,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACb,yGAAyG,CAC1G,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,YAAoB;IACjD,oBAAoB,EAAE,CAAC;IACvB,OAAO,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,YAAoB;IACpD,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC"}
@@ -1,250 +0,0 @@
1
- import { type Hex } from "viem";
2
- import type { SelfRegistrationMode } from "../config/self.js";
3
- import type { CeloClientFactory } from "../clients/celo-client.js";
4
- export interface SelfAgentKeyParams {
5
- encryptedSelfAgentPrivateKey?: string;
6
- }
7
- export interface VerifySelfAgentParams {
8
- agentAddress: `0x${string}`;
9
- requireAge?: 0 | 18 | 21;
10
- requireOfac?: boolean;
11
- requireSelfProvider?: boolean;
12
- }
13
- export interface VerifySelfRequestParams {
14
- agentSignature: Hex;
15
- agentTimestamp: string;
16
- method: string;
17
- path: string;
18
- body?: string;
19
- keytype?: string;
20
- agentKey?: Hex;
21
- }
22
- export interface RegisterSelfAgentParams {
23
- mode?: SelfRegistrationMode;
24
- minimumAge?: 0 | 18 | 21;
25
- ofac?: boolean;
26
- humanAddress?: `0x${string}`;
27
- agentName?: string;
28
- agentDescription?: string;
29
- }
30
- export declare class SelfService {
31
- private readonly clientFactory;
32
- private readonly envSelfAgentPrivateKey?;
33
- constructor(clientFactory: CeloClientFactory, envSelfAgentPrivateKey?: `0x${string}` | undefined);
34
- private resolveAgentPrivateKey;
35
- private registryClient;
36
- private assertProofRefreshEligible;
37
- verifyAgent(params: VerifySelfAgentParams): Promise<{
38
- verified: boolean;
39
- agent_address: `0x${string}`;
40
- reason: string;
41
- network: "mainnet";
42
- } | {
43
- verification_strength: string;
44
- network: "mainnet";
45
- sibling_agent_ids: number[];
46
- proof_expires_at: string | null;
47
- days_until_expiry: number;
48
- is_expiring_soon: boolean;
49
- verified: boolean;
50
- agent_address: `0x${string}`;
51
- agent_id: number;
52
- reason: string;
53
- credentials: {
54
- nationality: string | undefined;
55
- older_than: number;
56
- ofac_clear: boolean;
57
- };
58
- } | {
59
- verification_strength: string;
60
- registered_at: number;
61
- agent_count: number;
62
- is_proof_fresh: boolean;
63
- network: "mainnet";
64
- sibling_agent_ids: number[];
65
- proof_expires_at: string | null;
66
- days_until_expiry: number;
67
- is_expiring_soon: boolean;
68
- verified: boolean;
69
- agent_address: `0x${string}`;
70
- agent_id: number;
71
- credentials: {
72
- nationality: string | undefined;
73
- older_than: number;
74
- ofac_clear: boolean;
75
- };
76
- reason?: undefined;
77
- }>;
78
- lookupAgent(agentId: number): Promise<{
79
- is_expired: boolean;
80
- network: "mainnet";
81
- proof_expires_at: string | null;
82
- days_until_expiry: number;
83
- is_expiring_soon: boolean;
84
- credentialsSummary: string;
85
- }>;
86
- verifyRequest(params: VerifySelfRequestParams): Promise<{
87
- valid: boolean;
88
- reason: string;
89
- agent_address?: undefined;
90
- agent_id?: undefined;
91
- agent_count?: undefined;
92
- nullifier?: undefined;
93
- credentials?: undefined;
94
- note?: undefined;
95
- } | {
96
- valid: boolean;
97
- agent_address: `0x${string}`;
98
- reason: string;
99
- agent_id?: undefined;
100
- agent_count?: undefined;
101
- nullifier?: undefined;
102
- credentials?: undefined;
103
- note?: undefined;
104
- } | {
105
- valid: boolean;
106
- agent_address: `0x${string}`;
107
- agent_id: number;
108
- reason: string;
109
- agent_count?: undefined;
110
- nullifier?: undefined;
111
- credentials?: undefined;
112
- note?: undefined;
113
- } | {
114
- valid: boolean;
115
- agent_address: `0x${string}`;
116
- agent_id: number;
117
- agent_count: number;
118
- nullifier: number;
119
- credentials: {
120
- nationality: string | undefined;
121
- older_than: number;
122
- ofac_clear: boolean;
123
- };
124
- note: string;
125
- reason?: undefined;
126
- }>;
127
- private getAgentInfoFromKey;
128
- getIdentity(params?: SelfAgentKeyParams): Promise<{
129
- expiry_warning?: string | undefined;
130
- is_expired: boolean;
131
- sibling_agent_ids: number[];
132
- network: "mainnet";
133
- proof_expires_at: string | null;
134
- days_until_expiry: number;
135
- is_expiring_soon: boolean;
136
- registered: true;
137
- address: `0x${string}`;
138
- agentKey: `0x${string}`;
139
- agentId: number;
140
- isVerified: boolean;
141
- nullifier: number;
142
- agentCount: number;
143
- verificationStrength: string;
144
- credentials_summary: string;
145
- } | {
146
- message: string;
147
- registered: false;
148
- address: `0x${string}`;
149
- network: "mainnet";
150
- }>;
151
- registerAgent(params?: RegisterSelfAgentParams): Promise<{
152
- session_id: string;
153
- agent_address: string;
154
- qr_url: string;
155
- deep_link: string;
156
- expires_at: string;
157
- instructions: string;
158
- next_step: string;
159
- }>;
160
- checkRegistration(sessionId: string): Promise<{
161
- status: "deregistered";
162
- message: string;
163
- proof_expires_at?: undefined;
164
- agent_id?: undefined;
165
- agent_address?: undefined;
166
- private_key_hex?: undefined;
167
- tx_hash?: undefined;
168
- } | {
169
- status: "refreshed";
170
- proof_expires_at: string;
171
- message: string;
172
- agent_id?: undefined;
173
- agent_address?: undefined;
174
- private_key_hex?: undefined;
175
- tx_hash?: undefined;
176
- } | {
177
- status: "verified";
178
- agent_id: number;
179
- agent_address: string;
180
- private_key_hex: string;
181
- tx_hash: string | undefined;
182
- message: string;
183
- proof_expires_at?: undefined;
184
- } | {
185
- status: "pending";
186
- message: string;
187
- proof_expires_at?: undefined;
188
- agent_id?: undefined;
189
- agent_address?: undefined;
190
- private_key_hex?: undefined;
191
- tx_hash?: undefined;
192
- } | {
193
- status: "expired";
194
- message: string;
195
- proof_expires_at?: undefined;
196
- agent_id?: undefined;
197
- agent_address?: undefined;
198
- private_key_hex?: undefined;
199
- tx_hash?: undefined;
200
- }>;
201
- refreshProof(params: SelfAgentKeyParams & {
202
- agentId?: number;
203
- }): Promise<{
204
- next_step: string;
205
- is_expired: boolean;
206
- is_proof_fresh: false;
207
- proof_expires_at: string | null;
208
- days_until_expiry: number;
209
- is_expiring_soon: boolean;
210
- session_id: string;
211
- agent_id: number;
212
- qr_url: string;
213
- deep_link: string;
214
- expires_at: string;
215
- instructions: string;
216
- }>;
217
- deregisterAgent(params?: SelfAgentKeyParams): Promise<{
218
- session_id: string;
219
- qr_url: string;
220
- deep_link: string;
221
- expires_at: string;
222
- instructions: string;
223
- warning: string;
224
- next_step: string;
225
- }>;
226
- signRequest(params: SelfAgentKeyParams & {
227
- method: string;
228
- url: string;
229
- body?: string;
230
- }): Promise<{
231
- headers: {
232
- "x-self-agent-address": `0x${string}`;
233
- "x-self-agent-signature": `0x${string}`;
234
- "x-self-agent-timestamp": string;
235
- };
236
- instructions: string;
237
- }>;
238
- authenticatedFetch(params: SelfAgentKeyParams & {
239
- method: string;
240
- url: string;
241
- body?: string;
242
- contentType?: string;
243
- }): Promise<{
244
- status: number;
245
- body: string;
246
- truncated: boolean;
247
- }>;
248
- /** Reserved for future on-chain Self writes (e.g. metadata updates). */
249
- protected taggedCalldata(data: Hex): Hex;
250
- }