@decaf-ts/for-fabric 0.1.27 → 0.1.28
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/lib/client/FabricClientAdapter.cjs +38 -37
- package/lib/client/FabricClientAdapter.d.ts +28 -27
- package/lib/client/FabricClientAdapter.js.map +1 -1
- package/lib/client/FabricClientDispatch.cjs +6 -2
- package/lib/client/FabricClientDispatch.d.ts +4 -4
- package/lib/client/FabricClientDispatch.js.map +1 -1
- package/lib/client/FabricClientRepository.cjs +2 -2
- package/lib/client/FabricClientRepository.d.ts +1 -1
- package/lib/client/FabricClientRepository.js.map +1 -1
- package/lib/client/constants.cjs +10 -0
- package/lib/client/constants.d.ts +2 -0
- package/lib/client/constants.js.map +1 -0
- package/lib/client/erc20/FabricERC20ClientRepository.cjs +48 -22
- package/lib/client/erc20/FabricERC20ClientRepository.js.map +1 -1
- package/lib/client/types.cjs +3 -0
- package/lib/client/types.d.ts +7 -0
- package/lib/client/types.js.map +1 -0
- package/lib/esm/client/FabricClientAdapter.d.ts +28 -27
- package/lib/esm/client/FabricClientAdapter.js +38 -37
- package/lib/esm/client/FabricClientAdapter.js.map +1 -1
- package/lib/esm/client/FabricClientDispatch.d.ts +4 -4
- package/lib/esm/client/FabricClientDispatch.js +6 -2
- package/lib/esm/client/FabricClientDispatch.js.map +1 -1
- package/lib/esm/client/FabricClientRepository.d.ts +1 -1
- package/lib/esm/client/FabricClientRepository.js +2 -2
- package/lib/esm/client/FabricClientRepository.js.map +1 -1
- package/lib/esm/client/constants.d.ts +2 -0
- package/lib/esm/client/constants.js +7 -0
- package/lib/esm/client/constants.js.map +1 -0
- package/lib/esm/client/erc20/FabricERC20ClientRepository.js +49 -23
- package/lib/esm/client/erc20/FabricERC20ClientRepository.js.map +1 -1
- package/lib/esm/client/types.d.ts +7 -0
- package/lib/esm/client/types.js +2 -0
- package/lib/esm/client/types.js.map +1 -0
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/version.cjs +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FabricClientDispatch.js","sourceRoot":"","sources":["../../src/client/FabricClientDispatch.ts"],"names":[],"mappings":";;;AAAA,yCAOwB;AAGxB,mEAA4D;AAC5D,2DAIiC;AAKjC,mDAAkD;AAClD,yEAAuD;
|
|
1
|
+
{"version":3,"file":"FabricClientDispatch.js","sourceRoot":"","sources":["../../src/client/FabricClientDispatch.ts"],"names":[],"mappings":";;;AAAA,yCAOwB;AAGxB,mEAA4D;AAC5D,2DAIiC;AAKjC,mDAAkD;AAClD,yEAAuD;AAIvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAa,oBAAqB,SAAQ,eAA6B;IAWrE;;;;OAIG;IACH,YAAsB,MAAc;QAClC,KAAK,EAAE,CAAC;QADY,WAAM,GAAN,MAAM,CAAQ;QAVpC;;WAEG;QACK,YAAO,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;IAS1C,CAAC;IAED;;;;OAIG;IACM,KAAK,CAAC,KAAK;QAClB,IAAI,IAAI,CAAC,cAAc;YAAE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACK,YAAY,CAAC,SAAqB;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACM,OAAO,CAAC,QAAqC;QACpD,IAAI,CAAC,CAAC,QAAQ,YAAY,yCAAmB,CAAC;YAC5C,MAAM,IAAI,uBAAgB,CACxB,sDAAsD,CACvD,CAAC;QACJ,KAAK,CAAC,OAAO,CAAC,QAA+B,CAAC,CAAC;IACjD,CAAC;IAED;;;;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AAI,yCAAmB;IACrB,yCAAmB,CAAC,eAAe,CAAC,GAAG,oBAAoB,CAAC"}
|
|
@@ -71,9 +71,9 @@ class FabricClientRepository extends core_1.Repository {
|
|
|
71
71
|
}
|
|
72
72
|
async statement(name, ...args) {
|
|
73
73
|
const contextArgs = await core_1.Context.args(core_1.PersistenceKeys.STATEMENT, this.class, args, this.adapter, this._overrides || {});
|
|
74
|
-
const { log } = this.logCtx(contextArgs.args, this.statement);
|
|
74
|
+
const { log, ctx } = this.logCtx(contextArgs.args, this.statement);
|
|
75
75
|
log.verbose(`Executing prepared statement ${name}`);
|
|
76
|
-
return this.adapter.evaluateTransaction(core_1.PersistenceKeys.STATEMENT, contextArgs.args);
|
|
76
|
+
return this.adapter.evaluateTransaction(ctx, core_1.PersistenceKeys.STATEMENT, contextArgs.args);
|
|
77
77
|
}
|
|
78
78
|
async create(model, ...args) {
|
|
79
79
|
const { ctx, log, ctxArgs } = this.logCtx(args, this.create);
|
|
@@ -31,7 +31,7 @@ import { type FabricClientAdapter } from "./FabricClientAdapter";
|
|
|
31
31
|
* Adapter-->>Repo: result
|
|
32
32
|
* Repo-->>App: model
|
|
33
33
|
*/
|
|
34
|
-
export declare class FabricClientRepository<M extends Model, A extends FabricClientAdapter> extends Repository<M, A> {
|
|
34
|
+
export declare class FabricClientRepository<M extends Model, A extends FabricClientAdapter = FabricClientAdapter> extends Repository<M, A> {
|
|
35
35
|
protected _overrides: Partial<import("@decaf-ts/core").FlagsOf<ContextOf<A>>> & Partial<import("@decaf-ts/db-decorators").FlagsOf<ContextOf<A>>> & {
|
|
36
36
|
ignoreValidation: boolean;
|
|
37
37
|
ignoreHandlers: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FabricClientRepository.js","sourceRoot":"","sources":["../../src/client/FabricClientRepository.ts"],"names":[],"mappings":";;;AAAA,yCAOwB;AAExB,yEAAuD;
|
|
1
|
+
{"version":3,"file":"FabricClientRepository.js","sourceRoot":"","sources":["../../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AC,CAAC,CAAC,EAAE,CAAC,EACxB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAC/B,GAAG,OAAO,CACX,CAAC;QACF,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAC1B,IAAI,CAAC,OAAO,CAAC,MAAM,CACjB,CAAC,EACD,IAAI,CAAC,KAAK,EACV,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EACb,GAAG,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAClE,GAAG,CACJ,CACF,CAAC;IACJ,CAAC;CACF;AApRD,wDAoRC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultFabricClientFlags = void 0;
|
|
4
|
+
exports.DefaultFabricClientFlags = {
|
|
5
|
+
evaluateTimeout: 5,
|
|
6
|
+
endorseTimeout: 15,
|
|
7
|
+
submitTimeout: 5,
|
|
8
|
+
commitTimeout: 60,
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/client/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,wBAAwB,GAAsB;IACzD,eAAe,EAAE,CAAC;IAClB,cAAc,EAAE,EAAE;IAClB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,EAAE;CACX,CAAC"}
|
|
@@ -67,7 +67,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
67
67
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
68
68
|
*/
|
|
69
69
|
async tokenName() {
|
|
70
|
-
const
|
|
70
|
+
const contextArgs = await core_1.Context.args("tokenName", this.class, [], this.adapter, this._overrides || {});
|
|
71
|
+
const { ctx } = this.logCtx(contextArgs.args, this.clientAccountID);
|
|
72
|
+
const name = await this.adapter.evaluateTransaction(ctx, "TokenName");
|
|
71
73
|
return this.decode(name);
|
|
72
74
|
}
|
|
73
75
|
/**
|
|
@@ -81,7 +83,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
81
83
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
82
84
|
*/
|
|
83
85
|
async symbol() {
|
|
84
|
-
const
|
|
86
|
+
const contextArgs = await core_1.Context.args("symbol", this.class, [], this.adapter, this._overrides || {});
|
|
87
|
+
const { ctx } = this.logCtx(contextArgs.args, this.symbol);
|
|
88
|
+
const symbol = await this.adapter.evaluateTransaction(ctx, "Symbol");
|
|
85
89
|
return this.decode(symbol);
|
|
86
90
|
}
|
|
87
91
|
/**
|
|
@@ -95,7 +99,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
95
99
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
96
100
|
*/
|
|
97
101
|
async decimals() {
|
|
98
|
-
const
|
|
102
|
+
const contextArgs = await core_1.Context.args("decimals", this.class, [], this.adapter, this._overrides || {});
|
|
103
|
+
const { ctx } = this.logCtx(contextArgs.args, this.decimals);
|
|
104
|
+
const decimals = await this.adapter.evaluateTransaction(ctx, "Decimals");
|
|
99
105
|
return Number(this.decode(decimals));
|
|
100
106
|
}
|
|
101
107
|
/**
|
|
@@ -109,7 +115,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
109
115
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
110
116
|
*/
|
|
111
117
|
async totalSupply() {
|
|
112
|
-
const
|
|
118
|
+
const contextArgs = await core_1.Context.args("totalSupply", this.class, [], this.adapter, this._overrides || {});
|
|
119
|
+
const { ctx } = this.logCtx(contextArgs.args, this.totalSupply);
|
|
120
|
+
const total = await this.adapter.evaluateTransaction(ctx, "TotalSupply");
|
|
113
121
|
return Number(this.decode(total));
|
|
114
122
|
}
|
|
115
123
|
/**
|
|
@@ -127,7 +135,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
127
135
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
128
136
|
*/
|
|
129
137
|
async balanceOf(owner) {
|
|
130
|
-
const
|
|
138
|
+
const contextArgs = await core_1.Context.args("balance", this.class, [], this.adapter, this._overrides || {});
|
|
139
|
+
const { ctx } = this.logCtx(contextArgs.args, this.balanceOf);
|
|
140
|
+
const balance = await this.adapter.evaluateTransaction(ctx, "BalanceOf", [
|
|
131
141
|
owner,
|
|
132
142
|
]);
|
|
133
143
|
return Number(this.decode(balance));
|
|
@@ -148,7 +158,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
148
158
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
149
159
|
*/
|
|
150
160
|
async transfer(to, value) {
|
|
151
|
-
const
|
|
161
|
+
const contextArgs = await core_1.Context.args("transfer", this.class, [], this.adapter, this._overrides || {});
|
|
162
|
+
const { ctx } = this.logCtx(contextArgs.args, this.transfer);
|
|
163
|
+
const transferred = await this.adapter.submitTransaction(ctx, "Transfer", [
|
|
152
164
|
to,
|
|
153
165
|
value.toString(),
|
|
154
166
|
]);
|
|
@@ -172,11 +184,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
172
184
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
173
185
|
*/
|
|
174
186
|
async transferFrom(from, to, value) {
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
value.toString(),
|
|
179
|
-
]);
|
|
187
|
+
const contextArgs = await core_1.Context.args("transferFrom", this.class, [], this.adapter, this._overrides || {});
|
|
188
|
+
const { ctx } = this.logCtx(contextArgs.args, this.transferFrom);
|
|
189
|
+
const transferred = await this.adapter.submitTransaction(ctx, "TransferFrom", [from, to, value.toString()]);
|
|
180
190
|
return this.decode(transferred) === "true" ? true : false;
|
|
181
191
|
}
|
|
182
192
|
/**
|
|
@@ -194,7 +204,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
194
204
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
195
205
|
*/
|
|
196
206
|
async approve(spender, value) {
|
|
197
|
-
const
|
|
207
|
+
const contextArgs = await core_1.Context.args("approve", this.class, [], this.adapter, this._overrides || {});
|
|
208
|
+
const { ctx } = this.logCtx(contextArgs.args, this.approve);
|
|
209
|
+
const approved = await this.adapter.submitTransaction(ctx, "Approve", [
|
|
198
210
|
spender,
|
|
199
211
|
value.toString(),
|
|
200
212
|
]);
|
|
@@ -216,7 +228,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
216
228
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
217
229
|
*/
|
|
218
230
|
async allowance(owner, spender) {
|
|
219
|
-
const
|
|
231
|
+
const contextArgs = await core_1.Context.args("allowance", this.class, [], this.adapter, this._overrides || {});
|
|
232
|
+
const { ctx } = this.logCtx(contextArgs.args, this.allowance);
|
|
233
|
+
const allowance = await this.adapter.submitTransaction(ctx, "Allowance", [
|
|
220
234
|
owner,
|
|
221
235
|
spender,
|
|
222
236
|
]);
|
|
@@ -237,9 +251,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
237
251
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
238
252
|
*/
|
|
239
253
|
async initialize(token) {
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
]);
|
|
254
|
+
const contextArgs = await core_1.Context.args("initialize", this.class, [], this.adapter, this._overrides || {});
|
|
255
|
+
const { ctx } = this.logCtx(contextArgs.args, this.initialize);
|
|
256
|
+
const initiliazed = await this.adapter.submitTransaction(ctx, "Initialize", [FabricERC20ClientRepository.serializer.serialize(token)]);
|
|
243
257
|
return this.decode(initiliazed) === "true" ? true : false;
|
|
244
258
|
}
|
|
245
259
|
/**
|
|
@@ -253,7 +267,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
253
267
|
* @throws {Error} If the transaction fails.
|
|
254
268
|
*/
|
|
255
269
|
async checkInitialized() {
|
|
256
|
-
await
|
|
270
|
+
const contextArgs = await core_1.Context.args("checkInitialized", this.class, [], this.adapter, this._overrides || {});
|
|
271
|
+
const { ctx } = this.logCtx(contextArgs.args, this.checkInitialized);
|
|
272
|
+
await this.adapter.evaluateTransaction(ctx, "CheckInitialized");
|
|
257
273
|
}
|
|
258
274
|
/**
|
|
259
275
|
* Mints a specified amount of ERC20 tokens.
|
|
@@ -270,7 +286,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
270
286
|
* @throws {Error} If the transaction fails.
|
|
271
287
|
*/
|
|
272
288
|
async mint(amount) {
|
|
273
|
-
await
|
|
289
|
+
const contextArgs = await core_1.Context.args("mint", this.class, [], this.adapter, this._overrides || {});
|
|
290
|
+
const { ctx } = this.logCtx(contextArgs.args, this.mint);
|
|
291
|
+
await this.adapter.submitTransaction(ctx, "Mint", [amount.toString()]);
|
|
274
292
|
}
|
|
275
293
|
/**
|
|
276
294
|
* Burns a specified amount of ERC20 tokens from the minter's account.
|
|
@@ -286,7 +304,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
286
304
|
* @throws {Error} If the transaction fails.
|
|
287
305
|
*/
|
|
288
306
|
async burn(amount) {
|
|
289
|
-
await
|
|
307
|
+
const contextArgs = await core_1.Context.args("burn", this.class, [], this.adapter, this._overrides || {});
|
|
308
|
+
const { ctx } = this.logCtx(contextArgs.args, this.burn);
|
|
309
|
+
await this.adapter.submitTransaction(ctx, "Burn", [amount.toString()]);
|
|
290
310
|
}
|
|
291
311
|
/**
|
|
292
312
|
* Burns a specified amount of ERC20 tokens from a specified account.
|
|
@@ -303,7 +323,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
303
323
|
* @throws {Error} If the transaction fails.
|
|
304
324
|
*/
|
|
305
325
|
async burnFrom(account, amount) {
|
|
306
|
-
await
|
|
326
|
+
const contextArgs = await core_1.Context.args("burnFrom", this.class, [], this.adapter, this._overrides || {});
|
|
327
|
+
const { ctx } = this.logCtx(contextArgs.args, this.burnFrom);
|
|
328
|
+
await this.adapter.submitTransaction(ctx, "BurnFrom", [
|
|
307
329
|
account,
|
|
308
330
|
amount.toString(),
|
|
309
331
|
]);
|
|
@@ -320,7 +342,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
320
342
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
321
343
|
*/
|
|
322
344
|
async clientAccountBalance() {
|
|
323
|
-
const
|
|
345
|
+
const contextArgs = await core_1.Context.args("accountBalance", this.class, [], this.adapter, this._overrides || {});
|
|
346
|
+
const { ctx } = this.logCtx(contextArgs.args, this.clientAccountBalance);
|
|
347
|
+
const serializedAccountBalance = await this.adapter.evaluateTransaction(ctx, "ClientAccountBalance");
|
|
324
348
|
return Number(this.decode(serializedAccountBalance));
|
|
325
349
|
}
|
|
326
350
|
/**
|
|
@@ -335,7 +359,9 @@ class FabricERC20ClientRepository extends FabricClientRepository_1.FabricClientR
|
|
|
335
359
|
* @throws {Error} If the transaction fails or the decoding process fails.
|
|
336
360
|
*/
|
|
337
361
|
async clientAccountID() {
|
|
338
|
-
const
|
|
362
|
+
const contextArgs = await core_1.Context.args("accountId", this.class, [], this.adapter, this._overrides || {});
|
|
363
|
+
const { ctx } = this.logCtx(contextArgs.args, this.clientAccountID);
|
|
364
|
+
const clientAccountID = await this.adapter.evaluateTransaction(ctx, "ClientAccountID");
|
|
339
365
|
return this.decode(clientAccountID);
|
|
340
366
|
}
|
|
341
367
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FabricERC20ClientRepository.js","sourceRoot":"","sources":["../../../src/client/erc20/FabricERC20ClientRepository.ts"],"names":[],"mappings":";;;AAAA,4EAAmE;AACnE,+DAAuE;AACvE,yEAAmE;AAEnE,0EAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"FabricERC20ClientRepository.js","sourceRoot":"","sources":["../../../src/client/erc20/FabricERC20ClientRepository.ts"],"names":[],"mappings":";;;AAAA,4EAAmE;AACnE,+DAAuE;AACvE,yEAAmE;AAEnE,0EAAiE;AACjE,yCAMwB;AACxB,2DAIiC;AAEjC;;;GAGG;AACH,MAAa,2BAEX,SAAQ,+CAAsC;aAC/B,eAAU,GAAG,IAAI,mCAAgB,EAAE,AAAzB,CAA0B;aAKpC,YAAO,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,AAA1B,CAA2B;IAEjD;;;;;;;;;OASG;IACM,KAAK,CAAC,eAAe,CAC5B,KAA8B,EAC9B,KAAqD,EACrD,EAAY,EACZ,GAAG,IAAkC;QAErC,IAAI,CAAC,IAAI,CAAC,eAAe;YACvB,MAAM,IAAI,6BAAa,CACrB,oEAAoE,CACrE,CAAC;QACJ,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACjE,GAAG,CAAC,OAAO,CACT,YAAY,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,kBAAkB,IAAI,EAAE,CACjE,CAAC;QAEF,KAAK,GAAG,CACN,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,4BAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CACnC,CAAC;QACpB,IAAI,QAAuC,CAAC;QAE5C,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACrB,QAAQ,GAAG,SAAS,CAAC;QACvB,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QACzE,MAAM,wBAAwB,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CACrE,GAAG,EACH,sBAAsB,CACvB,CAAC;QAEF,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,eAAe;QACnB,MAAM,WAAW,GAAG,MAAM,cAAO,CAAC,IAAI,CACpC,WAAW,EACX,IAAI,CAAC,KAAK,EACV,EAAE,EACF,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,UAAU,IAAI,EAAE,CACtB,CAAC;QACF,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACpE,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAC5D,GAAG,EACH,iBAAiB,CAClB,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC;;AAngBH,kEAogBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":""}
|
|
@@ -2,12 +2,13 @@ import "../shared/overrides";
|
|
|
2
2
|
import { type MangoQuery } from "@decaf-ts/for-couchdb";
|
|
3
3
|
import { Client } from "@grpc/grpc-js";
|
|
4
4
|
import { Model, type ModelConstructor, type Serializer } from "@decaf-ts/decorator-validation";
|
|
5
|
-
import { type
|
|
5
|
+
import { type PeerConfig, type SegregatedModel } from "../shared/types";
|
|
6
6
|
import { Gateway, Network, Contract as Contrakt } from "@hyperledger/fabric-gateway";
|
|
7
7
|
import { BaseError, OperationKeys, type PrimaryKeyType } from "@decaf-ts/db-decorators";
|
|
8
8
|
import { Context, Adapter, type AdapterFlags, Repository, Statement, type PreparedStatement, Paginator, MaybeContextualArg, ContextualArgs, type PreparedModel } from "@decaf-ts/core";
|
|
9
9
|
import { FabricClientDispatch } from "./FabricClientDispatch";
|
|
10
10
|
import { type Constructor } from "@decaf-ts/decoration";
|
|
11
|
+
import { FabricClientFlags } from "./types";
|
|
11
12
|
/**
|
|
12
13
|
* @description Adapter for interacting with Hyperledger Fabric networks
|
|
13
14
|
* @summary The FabricAdapter extends CouchDBAdapter to provide a seamless interface for interacting with Hyperledger Fabric networks.
|
|
@@ -59,7 +60,7 @@ import { type Constructor } from "@decaf-ts/decoration";
|
|
|
59
60
|
* FabricAdapter->>FabricAdapter: serializer.deserialize(decodedResult)
|
|
60
61
|
* FabricAdapter-->>Client: deserializedResult
|
|
61
62
|
*/
|
|
62
|
-
export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, MangoQuery, Context<
|
|
63
|
+
export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, MangoQuery, Context<FabricClientFlags>> {
|
|
63
64
|
/**
|
|
64
65
|
* @description Static text decoder for converting Uint8Array to string
|
|
65
66
|
*/
|
|
@@ -76,7 +77,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
76
77
|
constructor(config: PeerConfig, alias?: string);
|
|
77
78
|
Statement<M extends Model>(overrides?: Partial<AdapterFlags>): Statement<M, FabricClientAdapter, any, MangoQuery>;
|
|
78
79
|
Paginator<M extends Model>(query: PreparedStatement<any> | MangoQuery, size: number, clazz: Constructor<M>): Paginator<M, any, MangoQuery>;
|
|
79
|
-
context<M extends Model>(operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE | string, overrides: Partial<
|
|
80
|
+
context<M extends Model>(operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE | string, overrides: Partial<FabricClientFlags>, model: Constructor<M> | Constructor<M>[], ...args: any[]): Promise<Context<FabricClientFlags>>;
|
|
80
81
|
/**
|
|
81
82
|
* @description Decodes a Uint8Array to a string
|
|
82
83
|
* @summary Converts binary data received from Fabric to a string using UTF-8 encoding
|
|
@@ -84,8 +85,8 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
84
85
|
* @return {string} The decoded string
|
|
85
86
|
*/
|
|
86
87
|
decode(data: Uint8Array): string;
|
|
87
|
-
repository<R extends Repository<any, Adapter<PeerConfig, Client, MangoQuery, Context<
|
|
88
|
-
protected createPrefix<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, ...args: MaybeContextualArg<Context<
|
|
88
|
+
repository<R extends Repository<any, Adapter<PeerConfig, Client, MangoQuery, Context<FabricClientFlags>>>>(): Constructor<R>;
|
|
89
|
+
protected createPrefix<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, ...args: MaybeContextualArg<Context<FabricClientFlags>>): [Constructor<M>, PrimaryKeyType, Record<string, any>, ...any[], Context];
|
|
89
90
|
/**
|
|
90
91
|
* @description Prepares multiple records for creation
|
|
91
92
|
* @summary Adds necessary CouchDB fields to multiple records before creation
|
|
@@ -95,8 +96,8 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
95
96
|
* @return A tuple containing the tableName, ids, and prepared records
|
|
96
97
|
* @throws {InternalError} If ids and models arrays have different lengths
|
|
97
98
|
*/
|
|
98
|
-
protected createAllPrefix<M extends Model>(clazz: Constructor<M>, ids: string[] | number[], models: Record<string, any>[], ...args: MaybeContextualArg<Context<
|
|
99
|
-
protected updateAllPrefix<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], models: Record<string, any>[], ...args: MaybeContextualArg<Context<
|
|
99
|
+
protected createAllPrefix<M extends Model>(clazz: Constructor<M>, ids: string[] | number[], models: Record<string, any>[], ...args: MaybeContextualArg<Context<FabricClientFlags>>): any[];
|
|
100
|
+
protected updateAllPrefix<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], models: Record<string, any>[], ...args: MaybeContextualArg<Context<FabricClientFlags>>): any[];
|
|
100
101
|
/**
|
|
101
102
|
* @description Creates multiple records in a single transaction
|
|
102
103
|
* @summary Submits a transaction to create multiple records in the Fabric ledger
|
|
@@ -106,7 +107,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
106
107
|
* @param {Record<string, any>} transient - Transient data for the transaction
|
|
107
108
|
* @return {Promise<Array<Record<string, any>>>} Promise resolving to the created records
|
|
108
109
|
*/
|
|
109
|
-
createAll<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], models: Record<string, any>[], ...args: ContextualArgs<Context<
|
|
110
|
+
createAll<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], models: Record<string, any>[], ...args: ContextualArgs<Context<FabricClientFlags>>): Promise<Record<string, any>[]>;
|
|
110
111
|
/**
|
|
111
112
|
* @description Reads multiple records in a single transaction
|
|
112
113
|
* @summary Submits a transaction to read multiple records from the Fabric ledger
|
|
@@ -114,7 +115,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
114
115
|
* @param {string[] | number[]} ids - Array of record identifiers to read
|
|
115
116
|
* @return {Promise<Array<Record<string, any>>>} Promise resolving to the retrieved records
|
|
116
117
|
*/
|
|
117
|
-
readAll<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], ...args: ContextualArgs<Context<
|
|
118
|
+
readAll<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], ...args: ContextualArgs<Context<FabricClientFlags>>): Promise<Record<string, any>[]>;
|
|
118
119
|
/**
|
|
119
120
|
* @description Updates multiple records in a single transaction
|
|
120
121
|
* @summary Submits a transaction to update multiple records in the Fabric ledger
|
|
@@ -124,7 +125,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
124
125
|
* @param {Record<string, any>} transient - Transient data for the transaction
|
|
125
126
|
* @return {Promise<Array<Record<string, any>>>} Promise resolving to the updated records
|
|
126
127
|
*/
|
|
127
|
-
updateAll<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], models: Record<string, any>[], ...args: ContextualArgs<Context<
|
|
128
|
+
updateAll<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], models: Record<string, any>[], ...args: ContextualArgs<Context<FabricClientFlags>>): Promise<Record<string, any>[]>;
|
|
128
129
|
/**
|
|
129
130
|
* @description Deletes multiple records in a single transaction
|
|
130
131
|
* @summary Submits a transaction to delete multiple records from the Fabric ledger
|
|
@@ -133,7 +134,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
133
134
|
* @param {Serializer<any>} serializer - Serializer for the model data
|
|
134
135
|
* @return {Promise<Array<Record<string, any>>>} Promise resolving to the deleted records
|
|
135
136
|
*/
|
|
136
|
-
deleteAll<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], ...args: ContextualArgs<Context<
|
|
137
|
+
deleteAll<M extends Model>(clazz: Constructor<M>, ids: PrimaryKeyType[], ...args: ContextualArgs<Context<FabricClientFlags>>): Promise<Record<string, any>[]>;
|
|
137
138
|
/**
|
|
138
139
|
* @description Prepares a model for persistence
|
|
139
140
|
* @summary Converts a model instance into a format suitable for database storage,
|
|
@@ -143,8 +144,8 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
143
144
|
* @param pk - The primary key property name
|
|
144
145
|
* @return The prepared data
|
|
145
146
|
*/
|
|
146
|
-
prepare<M extends Model>(model: M, ...args: ContextualArgs<Context<
|
|
147
|
-
revert<M extends Model>(obj: Record<string, any>, clazz: Constructor<M>, id: PrimaryKeyType, transient?: Record<string, any>, ...args: ContextualArgs<Context<
|
|
147
|
+
prepare<M extends Model>(model: M, ...args: ContextualArgs<Context<FabricClientFlags>>): SegregatedModel<M> & PreparedModel;
|
|
148
|
+
revert<M extends Model>(obj: Record<string, any>, clazz: Constructor<M>, id: PrimaryKeyType, transient?: Record<string, any>, ...args: ContextualArgs<Context<FabricClientFlags>>): M;
|
|
148
149
|
/**
|
|
149
150
|
* @description Creates indexes for the given models
|
|
150
151
|
* @summary Abstract method that must be implemented to create database indexes for the specified models
|
|
@@ -152,7 +153,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
152
153
|
* @param {...Constructor<M>} models - The model constructors to create indexes for
|
|
153
154
|
* @return {Promise<void>} A promise that resolves when all indexes are created
|
|
154
155
|
*/
|
|
155
|
-
protected index<M extends Model>(...args: MaybeContextualArg<Context<
|
|
156
|
+
protected index<M extends Model>(...args: MaybeContextualArg<Context<FabricClientFlags>, [
|
|
156
157
|
string,
|
|
157
158
|
...(Constructor<M> | string)[]
|
|
158
159
|
]>): Promise<void>;
|
|
@@ -165,7 +166,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
165
166
|
* @param {Record<string, any>} transient - Transient data for the transaction
|
|
166
167
|
* @return {Promise<Record<string, any>>} Promise resolving to the created record
|
|
167
168
|
*/
|
|
168
|
-
create<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, transient?: Record<string, any>, ...args: ContextualArgs<Context<
|
|
169
|
+
create<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, transient?: Record<string, any>, ...args: ContextualArgs<Context<FabricClientFlags>>): Promise<Record<string, any>>;
|
|
169
170
|
/**
|
|
170
171
|
* @description Reads a single record
|
|
171
172
|
* @summary Evaluates a transaction to read a record from the Fabric ledger
|
|
@@ -173,8 +174,8 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
173
174
|
* @param {string | number} id - The record identifier
|
|
174
175
|
* @return {Promise<Record<string, any>>} Promise resolving to the retrieved record
|
|
175
176
|
*/
|
|
176
|
-
read<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, ...args: ContextualArgs<Context<
|
|
177
|
-
updatePrefix<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, ...args: MaybeContextualArg<Context<
|
|
177
|
+
read<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, ...args: ContextualArgs<Context<FabricClientFlags>>): Promise<Record<string, any>>;
|
|
178
|
+
updatePrefix<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, ...args: MaybeContextualArg<Context<FabricClientFlags>>): any[];
|
|
178
179
|
/**
|
|
179
180
|
* @description Updates a single record
|
|
180
181
|
* @summary Submits a transaction to update a record in the Fabric ledger
|
|
@@ -184,7 +185,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
184
185
|
* @param {Record<string, any>} transient - Transient data for the transaction
|
|
185
186
|
* @return {Promise<Record<string, any>>} Promise resolving to the updated record
|
|
186
187
|
*/
|
|
187
|
-
update<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, transient?: Record<string, any>, ...args: ContextualArgs<Context<
|
|
188
|
+
update<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, model: Record<string, any>, transient?: Record<string, any>, ...args: ContextualArgs<Context<FabricClientFlags>>): Promise<Record<string, any>>;
|
|
188
189
|
/**
|
|
189
190
|
* @description Deletes a single record
|
|
190
191
|
* @summary Submits a transaction to delete a record from the Fabric ledger
|
|
@@ -192,7 +193,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
192
193
|
* @param {string | number} id - The record identifier to delete
|
|
193
194
|
* @return {Promise<Record<string, any>>} Promise resolving to the deleted record
|
|
194
195
|
*/
|
|
195
|
-
delete<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, ...args: ContextualArgs<Context<
|
|
196
|
+
delete<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, ...args: ContextualArgs<Context<FabricClientFlags>>): Promise<Record<string, any>>;
|
|
196
197
|
/**
|
|
197
198
|
* @description Executes a raw query against the Fabric ledger
|
|
198
199
|
* @summary Evaluates a transaction to perform a query using Mango Query syntax
|
|
@@ -218,7 +219,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
218
219
|
* FabricAdapter->>FabricAdapter: Process result based on type
|
|
219
220
|
* FabricAdapter-->>Client: processed result
|
|
220
221
|
*/
|
|
221
|
-
raw<V, D extends boolean>(rawInput: MangoQuery, docsOnly: D | undefined, clazz: ModelConstructor<any>, ...args: ContextualArgs<Context<
|
|
222
|
+
raw<V, D extends boolean>(rawInput: MangoQuery, docsOnly: D | undefined, clazz: ModelConstructor<any>, ...args: ContextualArgs<Context<FabricClientFlags>>): Promise<V>;
|
|
222
223
|
/**
|
|
223
224
|
* @description Gets or creates a gRPC client for the Fabric peer
|
|
224
225
|
* @summary Returns a cached client or creates a new one if none exists
|
|
@@ -230,14 +231,14 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
230
231
|
* @summary Creates a new Gateway instance using the current client
|
|
231
232
|
* @return {Promise<Gateway>} Promise resolving to the Gateway instance
|
|
232
233
|
*/
|
|
233
|
-
protected Gateway(): Promise<Gateway>;
|
|
234
|
+
protected Gateway(ctx: Context<FabricClientFlags>): Promise<Gateway>;
|
|
234
235
|
private getContractName;
|
|
235
236
|
/**
|
|
236
237
|
* @description Gets a Contract instance for the Fabric chaincode
|
|
237
238
|
* @summary Creates a new Contract instance using the current Gateway
|
|
238
239
|
* @return {Promise<Contrakt>} Promise resolving to the Contract instance
|
|
239
240
|
*/
|
|
240
|
-
protected Contract(contractName?: string): Promise<Contrakt>;
|
|
241
|
+
protected Contract(ctx: Context<FabricClientFlags>, contractName?: string): Promise<Contrakt>;
|
|
241
242
|
/**
|
|
242
243
|
* @description Executes a transaction on the Fabric network
|
|
243
244
|
* @summary Submits or evaluates a transaction on the Fabric chaincode
|
|
@@ -266,7 +267,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
266
267
|
* Contract-->>FabricAdapter: result
|
|
267
268
|
* FabricAdapter->>Gateway: close()
|
|
268
269
|
*/
|
|
269
|
-
protected transaction(api: string, submit?: boolean, args?: any[], transientData?: Record<string, string>, endorsingOrganizations?: Array<string>, className?: string): Promise<Uint8Array>;
|
|
270
|
+
protected transaction(ctx: Context<FabricClientFlags>, api: string, submit?: boolean, args?: any[], transientData?: Record<string, string>, endorsingOrganizations?: Array<string>, className?: string): Promise<Uint8Array>;
|
|
270
271
|
/**
|
|
271
272
|
* @description Parses an error into a BaseError
|
|
272
273
|
* @summary Converts any error into a standardized BaseError
|
|
@@ -284,7 +285,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
284
285
|
* @param {Array<string>} [endorsingOrganizations] - Organizations that must endorse the transaction
|
|
285
286
|
* @return {Promise<Uint8Array>} Promise resolving to the transaction result
|
|
286
287
|
*/
|
|
287
|
-
submitTransaction(api: string, args?: any[], transientData?: Record<string, string>, endorsingOrganizations?: Array<string>, className?: string): Promise<Uint8Array>;
|
|
288
|
+
submitTransaction(ctx: Context<FabricClientFlags>, api: string, args?: any[], transientData?: Record<string, string>, endorsingOrganizations?: Array<string>, className?: string): Promise<Uint8Array>;
|
|
288
289
|
/**
|
|
289
290
|
* @description Evaluates a transaction on the Fabric network
|
|
290
291
|
* @summary Executes a transaction that does not modify the ledger state
|
|
@@ -294,7 +295,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
294
295
|
* @param {Array<string>} [endorsingOrganizations] - Organizations that must endorse the transaction
|
|
295
296
|
* @return {Promise<Uint8Array>} Promise resolving to the transaction result
|
|
296
297
|
*/
|
|
297
|
-
evaluateTransaction(api: string, args?: any[], transientData?: Record<string, string>, endorsingOrganizations?: Array<string>, className?: string): Promise<Uint8Array>;
|
|
298
|
+
evaluateTransaction(ctx: Context<FabricClientFlags>, api: string, args?: any[], transientData?: Record<string, string>, endorsingOrganizations?: Array<string>, className?: string): Promise<Uint8Array>;
|
|
298
299
|
/**
|
|
299
300
|
* @description Closes the connection to the Fabric network
|
|
300
301
|
* @summary Closes the gRPC client if it exists
|
|
@@ -324,7 +325,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
324
325
|
* @param {Client} [client] - Optional gRPC client, will be created if not provided
|
|
325
326
|
* @return {Promise<Gateway>} Promise resolving to the Gateway instance
|
|
326
327
|
*/
|
|
327
|
-
static getGateway(config: PeerConfig, client?: Client): Promise<Gateway>;
|
|
328
|
+
static getGateway(ctx: Context<FabricClientFlags>, config: PeerConfig, client?: Client): Promise<Gateway>;
|
|
328
329
|
/**
|
|
329
330
|
* @description Creates a gRPC client for connecting to a Fabric peer
|
|
330
331
|
* @summary Initializes a client with TLS credentials for secure communication
|
|
@@ -356,7 +357,7 @@ export declare class FabricClientAdapter extends Adapter<PeerConfig, Client, Man
|
|
|
356
357
|
* Gateway-->>FabricAdapter: gateway
|
|
357
358
|
* FabricAdapter-->>Caller: gateway
|
|
358
359
|
*/
|
|
359
|
-
static getConnection(client: Client, config: PeerConfig): Promise<Gateway>;
|
|
360
|
+
static getConnection(client: Client, config: PeerConfig, ctx: Context<FabricClientFlags>): Promise<Gateway>;
|
|
360
361
|
/**
|
|
361
362
|
* @description Creates a new Dispatch instance for the Fabric client.
|
|
362
363
|
* @summary This function is responsible for creating a new FabricClientDispatch instance that can be used to interact with the Fabric network.
|