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.
- package/README.md +118 -34
- 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
|
|
3
|
+
On-chain credit scoring for onchain-protocols, powered by CreditCoin ZK proofs.
|
|
4
4
|
|
|
5
|
-
Any
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
|
|
239
|
-
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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.
|
|
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
|
+
}
|