credgate-sdk 1.0.0 → 1.0.2

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 (2) hide show
  1. package/README.md +118 -34
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # credgate-sdk
2
2
 
3
- On-chain credit scoring for DeFi lending protocols, powered by CreditCoin ZK proofs.
3
+ On-chain credit scoring for onchain-protocols, powered by CreditCoin ZK proofs.
4
4
 
5
- Any lending protocol can use this SDK to:
5
+ Any onchain protocol can use this SDK to:
6
6
  - Analyze a wallet's on-chain credit score
7
7
  - Determine max loan size and interest tier
8
8
  - Poll CreditCoin ZK proof status
@@ -18,6 +18,8 @@ npm install credgate-sdk
18
18
 
19
19
  ---
20
20
 
21
+ ## STEP By STEP GUIDE to integrate over a lending protocol.
22
+
21
23
  ## Architecture
22
24
 
23
25
  ```
@@ -35,6 +37,7 @@ Your Lending Protocol
35
37
  ├── Stablecoin treasury analysis
36
38
  ├── CrossChain maturity
37
39
  ├── DEX activity
40
+ ├── Wallet activity and age
38
41
 
39
42
 
40
43
  CreditScoreRegistry (Sepolia)
@@ -224,40 +227,121 @@ const result = await client.analyzeWallet("0x...", {
224
227
  **Response shape:**
225
228
  ```typescript
226
229
  {
227
- score: {
228
- address: "0x...",
229
- creditScore: 87, // 0–100
230
- tier: "PRIME",
231
- riskScore: 42,
232
- riskLevel: "MEDIUM",
233
- loanProfile: {
234
- recommendedLTV: 70,
235
- interestTier: "PRIME",
236
- maxLoanSizeUSD: 25000,
230
+ "status": "DONE",
231
+ "result": {
232
+ "address": "0xa81a12e0c285b234a9c801b2bd215eabb3dda461",
233
+ "basic": {
234
+ "ethBalance": "0.0",
235
+ "txCount": 0,
236
+ "walletAgeBlocks": null
237
+ },
238
+ "aave": {
239
+ "borrows": [],
240
+ "repays": [],
241
+ "liquidations": []
237
242
  },
238
- scoreBreakdown: {
239
- lending: 28.5,
240
- stable: 22.0,
241
- crossChain: 12.0,
242
- dex: 8.0,
243
- ageBonus: 5.5,
244
- riskPenalty: 8.0,
243
+ "meta": {
244
+ "analyzedAt": 1772742968948
245
245
  },
246
- analyzedAt: 1709123456789,
247
- },
248
- onchain: {
249
- status: "UPDATED", // "NOT_SUBMITTED" | "UPDATED" | "COOLDOWN_ACTIVE" | "FAILED"
250
- txHash: "0x...",
251
- reportHash: "0x...",
252
- remainingSeconds: 0,
253
- },
254
- proof: {
255
- status: "waiting_attestation",
256
- jobId: "job_0xabc123_1709...",
257
- currentAttestedBlock: 7450000,
258
- targetBlock: 7450123,
259
- blocksRemaining: 123,
260
- estimatedWaitSeconds: 1476,
246
+ "intelligence": {
247
+ "metrics": {
248
+ "totalBorrows": 0,
249
+ "totalRepays": 0,
250
+ "totalLiquidations": 0,
251
+ "repayRatio": 0,
252
+ "liquidationRate": 0,
253
+ "borrowRepayCycles": 0
254
+ },
255
+ "risk": {
256
+ "riskScore": 60,
257
+ "riskLevel": "MEDIUM"
258
+ },
259
+ "creditScore": 0,
260
+ "scoreBreakdown": {
261
+ "lending": 0,
262
+ "stable": 0,
263
+ "crossChain": 0,
264
+ "dex": 0,
265
+ "ageBonus": 0,
266
+ "riskPenalty": 12
267
+ },
268
+ "stable": {
269
+ "totalInflow": 0,
270
+ "totalOutflow": 0,
271
+ "netFlow": 0,
272
+ "transferCount": 0,
273
+ "inflowCount": 0,
274
+ "outflowCount": 0,
275
+ "avgMonthlyNetFlow": 0,
276
+ "netFlowVolatility": 0,
277
+ "retentionRatio": 0,
278
+ "recentActivityScore": 0,
279
+ "activeMonths": 0,
280
+ "avgHoldingDays": 0,
281
+ "largestInflowSourceShare": 0,
282
+ "churnRatio": 0,
283
+ "stableScore": 0,
284
+ "stableLevel": "WEAK"
285
+ },
286
+ "crossChain": {
287
+ "chainsUsedCount": 0,
288
+ "activeChains": [],
289
+ "totalTxAcrossChains": 0,
290
+ "chainDetails": [
291
+ {
292
+ "chain": "ethereum",
293
+ "txCount": 0,
294
+ "firstTxBlock": null,
295
+ "walletAgeDays": null
296
+ },
297
+ {
298
+ "chain": "arbitrum",
299
+ "txCount": 0,
300
+ "firstTxBlock": null,
301
+ "walletAgeDays": null
302
+ },
303
+ {
304
+ "chain": "optimism",
305
+ "txCount": 0,
306
+ "firstTxBlock": null,
307
+ "walletAgeDays": null
308
+ },
309
+ {
310
+ "chain": "base",
311
+ "txCount": 0,
312
+ "firstTxBlock": null,
313
+ "walletAgeDays": null
314
+ },
315
+ {
316
+ "chain": "polygon",
317
+ "txCount": 0,
318
+ "firstTxBlock": null,
319
+ "walletAgeDays": null
320
+ }
321
+ ],
322
+ "crossChainMaturityScore": 0,
323
+ "crossChainRiskImpact": 10
324
+ },
325
+ "dex": {
326
+ "totalSwaps": 0,
327
+ "totalVolumeUSD": 0,
328
+ "uniqueTokensTraded": 0,
329
+ "avgSwapSizeUSD": 0,
330
+ "swapFrequencyPerMonth": 0,
331
+ "dexMaturityScore": 0,
332
+ "dexRiskImpact": 0
333
+ },
334
+ "loanProfile": {
335
+ "recommendedLTV": 0,
336
+ "interestTier": "REJECT",
337
+ "maxLoanSizeUSD": 0
338
+ }
339
+ },
340
+ "onchain": {
341
+ "status": "UPDATED",
342
+ "txHash": "0x8f4b45d041e6d4a502407f8dd5fda49e73d882136db7e2d25096e1269cb211fd",
343
+ "reportHash": "0xf44b9f3a31ac3bb921289f6823b523ad01f3df9f543d01a573aab3c0bdb9386b"
344
+ }
261
345
  }
262
346
  }
263
347
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "credgate-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "On-chain credit scoring SDK — integrate undercollateralized lending into any DeFi protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -48,4 +48,4 @@
48
48
  "@types/react": "^18.3.28",
49
49
  "typescript": "^5.9.3"
50
50
  }
51
- }
51
+ }