@kleo-protocol/kleo-sdk 0.1.0 → 0.1.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.
- package/README.md +4 -4
- package/dist/src/client.d.ts +1 -3
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +14 -44
- package/dist/src/client.js.map +1 -1
- package/dist/src/dedot.client.d.ts.map +1 -1
- package/dist/src/dedot.client.js +2 -1
- package/dist/src/dedot.client.js.map +1 -1
- package/dist/src/metadata/config.json +1080 -0
- package/dist/src/metadata/index.d.ts +1260 -0
- package/dist/src/metadata/index.d.ts.map +1 -0
- package/dist/src/metadata/index.js +21 -0
- package/dist/src/metadata/index.js.map +1 -0
- package/dist/src/metadata/lending_pool.json +1307 -0
- package/dist/src/metadata/reputation.json +1041 -0
- package/dist/src/metadata/vouch.json +1387 -0
- package/dist/src/services/lending.service.d.ts.map +1 -1
- package/dist/src/services/lending.service.js +2 -6
- package/dist/src/services/lending.service.js.map +1 -1
- package/dist/src/services/pool.service.d.ts.map +1 -1
- package/dist/src/services/pool.service.js +0 -3
- package/dist/src/services/pool.service.js.map +1 -1
- package/dist/src/services/profile.service.js +1 -1
- package/dist/src/services/profile.service.js.map +1 -1
- package/dist/src/services/reputation.service.d.ts.map +1 -1
- package/dist/src/services/reputation.service.js +6 -17
- package/dist/src/services/reputation.service.js.map +1 -1
- package/dist/src/services/vouch.service.d.ts.map +1 -1
- package/dist/src/services/vouch.service.js +2 -8
- package/dist/src/services/vouch.service.js.map +1 -1
- package/dist/src/supabase.client.d.ts +2 -2
- package/dist/src/supabase.client.d.ts.map +1 -1
- package/dist/src/supabase.client.js +8 -2
- package/dist/src/supabase.client.js.map +1 -1
- package/dist/src/utils/contract-helpers.d.ts +0 -6
- package/dist/src/utils/contract-helpers.d.ts.map +1 -1
- package/dist/src/utils/contract-helpers.js.map +1 -1
- package/dist/types/types.d.ts +2 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +10 -4
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Kleo SDK
|
|
2
2
|
|
|
3
|
-
A TypeScript SDK for interacting with the Kleo Protocol on Polkadot Asset Hub. This SDK provides a unified interface for managing lending pools, reputation systems, and vouch relationships.
|
|
3
|
+
A TypeScript SDK for interacting with the Kleo Protocol on Polkadot Paseo Asset Hub. This SDK provides a unified interface for managing lending pools, reputation systems, and vouch relationships.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **Blockchain Integration** - Connect to Polkadot Asset Hub via WebSocket
|
|
7
|
+
- **Blockchain Integration** - Connect to Polkadot Paseo Asset Hub via WebSocket
|
|
8
8
|
- **Lending Pool Management** - Query pool states and user deposits
|
|
9
9
|
- **Reputation System** - Track lender exposure and borrower reputation
|
|
10
10
|
- **Vouch System** - Manage vouch relationships between users
|
|
@@ -31,7 +31,7 @@ import vouchMetadata from './metadata/vouch.json';
|
|
|
31
31
|
// Initialize the client
|
|
32
32
|
const client = new KleoClient(
|
|
33
33
|
{
|
|
34
|
-
endpoint: 'wss://
|
|
34
|
+
endpoint: 'wss://asset-hub-paseo.dotters.network', // Optional, this is the default
|
|
35
35
|
timeout: 30000, // Optional, default is 30000ms
|
|
36
36
|
},
|
|
37
37
|
{
|
|
@@ -69,7 +69,7 @@ async function main() {
|
|
|
69
69
|
|
|
70
70
|
| Option | Type | Default | Description |
|
|
71
71
|
|--------|------|---------|-------------|
|
|
72
|
-
| `endpoint` | `string` | `wss://
|
|
72
|
+
| `endpoint` | `string` | `wss://asset-hub-paseo.dotters.network` | WebSocket endpoint for blockchain connection |
|
|
73
73
|
| `timeout` | `number` | `30000` | Request timeout in milliseconds |
|
|
74
74
|
|
|
75
75
|
## API Reference
|
package/dist/src/client.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { SupabaseClient } from '@supabase/supabase-js';
|
|
|
4
4
|
import { KleoConfig } from '../types/types';
|
|
5
5
|
import { ensureAccountMapped } from './dedot.client';
|
|
6
6
|
import { ReputationUserReputation } from '../types/reputation/index.js';
|
|
7
|
-
import { ContractMetadata } from './utils/contract-helpers';
|
|
8
7
|
import { BackedPosition, VouchInfo, BorrowerInfo, Loan } from './interfaces';
|
|
9
8
|
export { BackedPosition, VouchInfo, BorrowerInfo, Loan } from './interfaces';
|
|
10
9
|
import * as PoolService from './services/pool.service';
|
|
@@ -13,8 +12,7 @@ export declare class KleoClient {
|
|
|
13
12
|
private dedotClient;
|
|
14
13
|
private supabaseClient;
|
|
15
14
|
private config;
|
|
16
|
-
|
|
17
|
-
constructor(config?: KleoConfig, metadata?: ContractMetadata);
|
|
15
|
+
constructor(config?: KleoConfig);
|
|
18
16
|
connect(): Promise<DedotClient<PolkadotApi>>;
|
|
19
17
|
getDedotClient(): DedotClient<PolkadotApi> | null;
|
|
20
18
|
getSupabaseClient(): SupabaseClient | null;
|
package/dist/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAqB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC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IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM/D,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAahF,iBAAiB,CACrB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;IAW1C,eAAe,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAe9B,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAalE,oBAAoB,CACxB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAYhC,kBAAkB,CACtB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,SAAS,EAAE,CAAC;CAUxB"}
|
package/dist/src/client.js
CHANGED
|
@@ -32,34 +32,25 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.KleoClient = void 0;
|
|
40
37
|
const dedot_client_1 = require("./dedot.client");
|
|
41
|
-
const supabase_client_1 =
|
|
38
|
+
const supabase_client_1 = require("./supabase.client");
|
|
39
|
+
const metadata_1 = require("./metadata");
|
|
42
40
|
const PoolService = __importStar(require("./services/pool.service"));
|
|
43
41
|
const ProfileService = __importStar(require("./services/profile.service"));
|
|
44
42
|
const LendingService = __importStar(require("./services/lending.service"));
|
|
45
43
|
const VouchService = __importStar(require("./services/vouch.service"));
|
|
46
44
|
const ReputationService = __importStar(require("./services/reputation.service"));
|
|
47
45
|
class KleoClient {
|
|
48
|
-
constructor(config = {}
|
|
46
|
+
constructor(config = {}) {
|
|
49
47
|
this.dedotClient = null;
|
|
50
|
-
this.supabaseClient = supabase_client_1.default;
|
|
51
48
|
this.config = {
|
|
52
|
-
endpoint: config.endpoint || 'wss://
|
|
49
|
+
endpoint: config.endpoint || 'wss://asset-hub-paseo.dotters.network',
|
|
53
50
|
timeout: config.timeout || 30000,
|
|
54
51
|
};
|
|
55
|
-
this.
|
|
56
|
-
config: metadata?.config,
|
|
57
|
-
lendingPool: metadata?.lendingPool,
|
|
58
|
-
reputation: metadata?.reputation,
|
|
59
|
-
vouch: metadata?.vouch,
|
|
60
|
-
};
|
|
52
|
+
this.supabaseClient = (0, supabase_client_1.createSupabaseClient)(config.supabaseUrl, config.supabaseAnonKey);
|
|
61
53
|
this.connect();
|
|
62
|
-
this.supabaseClient = supabase_client_1.default;
|
|
63
54
|
}
|
|
64
55
|
async connect() {
|
|
65
56
|
if (!this.dedotClient) {
|
|
@@ -90,11 +81,8 @@ class KleoClient {
|
|
|
90
81
|
return PoolService.getPool(this.supabaseClient, poolId);
|
|
91
82
|
}
|
|
92
83
|
async getPoolState(poolId, defaultCaller) {
|
|
93
|
-
if (!this.metadata.config) {
|
|
94
|
-
throw new Error('Config metadata not provided. Pass it to the KleoClient constructor.');
|
|
95
|
-
}
|
|
96
84
|
const client = await this.connect();
|
|
97
|
-
return PoolService.getPoolState(this.supabaseClient, client,
|
|
85
|
+
return PoolService.getPoolState(this.supabaseClient, client, metadata_1.metadata.config, poolId, defaultCaller);
|
|
98
86
|
}
|
|
99
87
|
async getProfile(userAddress) {
|
|
100
88
|
return ProfileService.getProfile(this.supabaseClient, userAddress);
|
|
@@ -106,50 +94,32 @@ class KleoClient {
|
|
|
106
94
|
return ProfileService.updateProfile(this.supabaseClient, userAddress, name);
|
|
107
95
|
}
|
|
108
96
|
async getUserDeposit(poolId, userAddress) {
|
|
109
|
-
if (!this.metadata.lendingPool) {
|
|
110
|
-
throw new Error('LendingPool metadata not provided. Pass it to the KleoClient constructor.');
|
|
111
|
-
}
|
|
112
97
|
const client = await this.connect();
|
|
113
|
-
return LendingService.getUserDeposit(this.supabaseClient, client,
|
|
98
|
+
return LendingService.getUserDeposit(this.supabaseClient, client, metadata_1.metadata.lendingPool, poolId, userAddress);
|
|
114
99
|
}
|
|
115
100
|
async getLenderExposure(poolId, userAddress) {
|
|
116
|
-
if (!this.metadata.reputation) {
|
|
117
|
-
throw new Error('Reputation metadata not provided. Pass it to the KleoClient constructor.');
|
|
118
|
-
}
|
|
119
101
|
const client = await this.connect();
|
|
120
|
-
return ReputationService.getLenderExposure(this.supabaseClient, client,
|
|
102
|
+
return ReputationService.getLenderExposure(this.supabaseClient, client, metadata_1.metadata.reputation, poolId, userAddress);
|
|
121
103
|
}
|
|
122
104
|
async getBorrowerInfo(poolId, userAddress) {
|
|
123
|
-
if (!this.metadata.reputation || !this.metadata.vouch || !this.metadata.config) {
|
|
124
|
-
throw new Error('Required metadata not provided. Pass all metadata to the KleoClient constructor.');
|
|
125
|
-
}
|
|
126
105
|
const client = await this.connect();
|
|
127
106
|
return ReputationService.getBorrowerInfo(this.supabaseClient, client, {
|
|
128
|
-
config:
|
|
129
|
-
reputation:
|
|
130
|
-
vouch:
|
|
107
|
+
config: metadata_1.metadata.config,
|
|
108
|
+
reputation: metadata_1.metadata.reputation,
|
|
109
|
+
vouch: metadata_1.metadata.vouch,
|
|
131
110
|
}, poolId, userAddress);
|
|
132
111
|
}
|
|
133
112
|
async getUserLoans(poolId, userAddress) {
|
|
134
|
-
if (!this.metadata.reputation) {
|
|
135
|
-
throw new Error('Reputation metadata not provided. Pass it to the KleoClient constructor.');
|
|
136
|
-
}
|
|
137
113
|
const client = await this.connect();
|
|
138
|
-
return ReputationService.getUserLoans(this.supabaseClient, client,
|
|
114
|
+
return ReputationService.getUserLoans(this.supabaseClient, client, metadata_1.metadata.reputation, poolId, userAddress);
|
|
139
115
|
}
|
|
140
116
|
async getVouchRelationship(poolId, voucherAddress, borrowerAddress) {
|
|
141
|
-
if (!this.metadata.vouch) {
|
|
142
|
-
throw new Error('Vouch metadata not provided. Pass it to the KleoClient constructor.');
|
|
143
|
-
}
|
|
144
117
|
const client = await this.connect();
|
|
145
|
-
return VouchService.getVouchRelationship(this.supabaseClient, client,
|
|
118
|
+
return VouchService.getVouchRelationship(this.supabaseClient, client, metadata_1.metadata.vouch, poolId, voucherAddress, borrowerAddress);
|
|
146
119
|
}
|
|
147
120
|
async getBorrowerVouches(poolId, borrowerAddress) {
|
|
148
|
-
if (!this.metadata.vouch) {
|
|
149
|
-
throw new Error('Vouch metadata not provided. Pass it to the KleoClient constructor.');
|
|
150
|
-
}
|
|
151
121
|
const client = await this.connect();
|
|
152
|
-
return VouchService.getBorrowerVouches(this.supabaseClient, client,
|
|
122
|
+
return VouchService.getBorrowerVouches(this.supabaseClient, client, metadata_1.metadata.vouch, poolId, borrowerAddress);
|
|
153
123
|
}
|
|
154
124
|
}
|
|
155
125
|
exports.KleoClient = KleoClient;
|
package/dist/src/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,iDAAwE;AACxE,uDAAyD;AAGzD,yCAAsC;AAMtC,qEAAuD;AACvD,2EAA6D;AAC7D,2EAA6D;AAC7D,uEAAyD;AACzD,iFAAmE;AAQnE,MAAa,UAAU;IASrB,YAAY,SAAqB,EAAE;QAR3B,gBAAW,GA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EAAE,WAAW,EAAc,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,wBAAsB,iBAAiB,CAAC,QAAQ,GAAE,
|
|
1
|
+
{"version":3,"file":"dedot.client.d.ts","sourceRoot":"","sources":["../../src/dedot.client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,wBAAsB,iBAAiB,CAAC,QAAQ,GAAE,MAAgD,qCAKjG;AAMD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,UAAU,CAAC;IACtB,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,CAAC;CACxC,CAAC;AAQF,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC,EAChC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,OAAO,CAAC,CAmBlB"}
|
package/dist/src/dedot.client.js
CHANGED
|
@@ -4,9 +4,10 @@ exports.createDedotClient = createDedotClient;
|
|
|
4
4
|
exports.ensureAccountMapped = ensureAccountMapped;
|
|
5
5
|
const dedot_1 = require("dedot");
|
|
6
6
|
const contracts_1 = require("dedot/contracts");
|
|
7
|
-
async function createDedotClient(endpoint = 'wss://
|
|
7
|
+
async function createDedotClient(endpoint = 'wss://asset-hub-paseo.dotters.network') {
|
|
8
8
|
const provider = new dedot_1.WsProvider(endpoint);
|
|
9
9
|
const client = await dedot_1.DedotClient.new(provider);
|
|
10
|
+
console.log("Connected to Dedot client at", endpoint);
|
|
10
11
|
return client;
|
|
11
12
|
}
|
|
12
13
|
async function ensureAccountMapped(client, caller) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dedot.client.js","sourceRoot":"","sources":["../../src/dedot.client.ts"],"names":[],"mappings":";;AAIA,
|
|
1
|
+
{"version":3,"file":"dedot.client.js","sourceRoot":"","sources":["../../src/dedot.client.ts"],"names":[],"mappings":";;AAIA,8CAKC;AAmBD,kDAsBC;AAlDD,iCAAgD;AAChD,+CAA+C;AAGxC,KAAK,UAAU,iBAAiB,CAAC,WAAmB,uCAAuC;IAChG,MAAM,QAAQ,GAAG,IAAI,kBAAU,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,mBAAW,CAAC,GAAG,CAAc,QAAQ,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,QAAQ,CAAC,CAAC;IACtD,OAAO,MAAM,CAAC;AAChB,CAAC;AAmBM,KAAK,UAAU,mBAAmB,CACvC,MAAgC,EAChC,MAAqB;IAErB,MAAM,aAAa,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;IAG3E,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,IAAA,wBAAY,EAAC,aAAa,CAAC,CAAC,CAAC;IAE7F,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QAEnD,MAAM,MAAM,CAAC,EAAE,CAAC,MAAM;aACnB,UAAU,EAAE;aACZ,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAgC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC3F,cAAc,EAAE,CAAC;QAEpB,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|