@caict/bop-typescript-sdk 1.0.0

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 (115) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +5 -0
  4. package/README.md +112 -0
  5. package/package.json +90 -0
  6. package/src/bop/bop-base/README.md +5 -0
  7. package/src/bop/bop-base/base.ts +366 -0
  8. package/src/bop/bop-base/index.ts +83 -0
  9. package/src/bop/bop-base/permit.ts +116 -0
  10. package/src/bop/bop-base/test/base.test.ts +867 -0
  11. package/src/bop/bop-base/test/index.test.ts +69 -0
  12. package/src/bop/bop-base/test/permit.test.ts +125 -0
  13. package/src/bop/bop-base/tsconfig.json +8 -0
  14. package/src/bop/bop-proto/README.md +2 -0
  15. package/src/bop/bop-proto/bop-ws.proto +266 -0
  16. package/src/bop/bop-proto/bop-ws.ts +4447 -0
  17. package/src/bop/bop-proto/bop.proto +898 -0
  18. package/src/bop/bop-proto/bop.ts +12890 -0
  19. package/src/bop/bop-proto/tsconfig.json +8 -0
  20. package/src/bop/bop-ws/index.ts +315 -0
  21. package/src/bop/bop-ws/sample/sample.ts +107 -0
  22. package/src/bop/bop-ws/tsconfig.json +8 -0
  23. package/src/bop/index.ts +14 -0
  24. package/src/bop-sdk/index.ts +22 -0
  25. package/src/bop-sdk/interface/abstract-service/abstract-account.ts +23 -0
  26. package/src/bop-sdk/interface/abstract-service/abstract-chain.ts +9 -0
  27. package/src/bop-sdk/interface/abstract-service/abstract-contract.ts +16 -0
  28. package/src/bop-sdk/interface/abstract-service/abstract-ledger.ts +15 -0
  29. package/src/bop-sdk/interface/abstract-service/abstract-provider.ts +13 -0
  30. package/src/bop-sdk/interface/abstract-service/abstract-signer.ts +133 -0
  31. package/src/bop-sdk/interface/abstract-service/abstract-transaction.ts +86 -0
  32. package/src/bop-sdk/interface/provider-ws.ts +10 -0
  33. package/src/bop-sdk/interface/provider.ts +22 -0
  34. package/src/bop-sdk/interface/service/3rd.ts +54 -0
  35. package/src/bop-sdk/interface/service/account.ts +86 -0
  36. package/src/bop-sdk/interface/service/chain.ts +27 -0
  37. package/src/bop-sdk/interface/service/contract.ts +51 -0
  38. package/src/bop-sdk/interface/service/helper.ts +426 -0
  39. package/src/bop-sdk/interface/service/ledger.ts +75 -0
  40. package/src/bop-sdk/interface/service/offline/check/index.js +138 -0
  41. package/src/bop-sdk/interface/service/offline/common/constant.js +6 -0
  42. package/src/bop-sdk/interface/service/offline/common/snowFlakeUtils.js +192 -0
  43. package/src/bop-sdk/interface/service/offline/common/util.js +511 -0
  44. package/src/bop-sdk/interface/service/offline/exception/customErrors.js +29 -0
  45. package/src/bop-sdk/interface/service/offline/exception/errors.js +90 -0
  46. package/src/bop-sdk/interface/service/offline/exception/index.js +5 -0
  47. package/src/bop-sdk/interface/service/offline/operation/accountCreateOperation.js +28 -0
  48. package/src/bop-sdk/interface/service/offline/operation/accountSetMetadataOperation.js +44 -0
  49. package/src/bop-sdk/interface/service/offline/operation/accountSetPrivilegeOperation.js +49 -0
  50. package/src/bop-sdk/interface/service/offline/operation/contractCreateOperation.js +43 -0
  51. package/src/bop-sdk/interface/service/offline/operation/contractInvokeOperation.js +42 -0
  52. package/src/bop-sdk/interface/service/offline/operation/contractInvokeRequestOperation.js +69 -0
  53. package/src/bop-sdk/interface/service/offline/operation/gasSendOperation.js +29 -0
  54. package/src/bop-sdk/interface/service/offline/operation/gasSendRequestOperation.js +61 -0
  55. package/src/bop-sdk/interface/service/offline/operation/index.js +20 -0
  56. package/src/bop-sdk/interface/service/offline/proto/chain_pb.js +12079 -0
  57. package/src/bop-sdk/interface/service/offline/proto/common_pb.js +2867 -0
  58. package/src/bop-sdk/interface/service/offline/transaction/index.js +988 -0
  59. package/src/bop-sdk/interface/service/offline/transaction/operations.js +188 -0
  60. package/src/bop-sdk/interface/service/offline/validate/account.js +152 -0
  61. package/src/bop-sdk/interface/service/offline/validate/contract.js +101 -0
  62. package/src/bop-sdk/interface/service/offline/validate/index.js +10 -0
  63. package/src/bop-sdk/interface/service/offline/validate/transaction.js +51 -0
  64. package/src/bop-sdk/interface/service/transaction.ts +731 -0
  65. package/src/bop-sdk/interface/signer.ts +46 -0
  66. package/src/bop-sdk/interface/test/3rd.test.ts +1571 -0
  67. package/src/bop-sdk/interface/test/account.test.ts +284 -0
  68. package/src/bop-sdk/interface/test/chain.test.ts +45 -0
  69. package/src/bop-sdk/interface/test/contract.test.ts +283 -0
  70. package/src/bop-sdk/interface/test/ledger.test.ts +166 -0
  71. package/src/bop-sdk/interface/test/provider.test.ts +407 -0
  72. package/src/bop-sdk/interface/test/signer.test.ts +105 -0
  73. package/src/bop-sdk/interface/test/transaction.test.ts +713 -0
  74. package/src/bop-sdk/proto/bop-sdk-common.proto +159 -0
  75. package/src/bop-sdk/proto/bop-sdk-common.ts +829 -0
  76. package/src/bop-sdk/proto/bop-sdk-interface.proto +581 -0
  77. package/src/bop-sdk/proto/bop-sdk-interface.ts +10839 -0
  78. package/src/bop-sdk/proto/bop-sdk-utils.proto +86 -0
  79. package/src/bop-sdk/proto/bop-sdk-utils.ts +1495 -0
  80. package/src/bop-sdk/utils/abi/abi-coder.ts +147 -0
  81. package/src/bop-sdk/utils/abi/address.ts +109 -0
  82. package/src/bop-sdk/utils/abi/bignumber.ts +403 -0
  83. package/src/bop-sdk/utils/abi/bytes.ts +565 -0
  84. package/src/bop-sdk/utils/abi/coders/abstract-coder.ts +239 -0
  85. package/src/bop-sdk/utils/abi/coders/address.ts +58 -0
  86. package/src/bop-sdk/utils/abi/coders/anonymous.ts +25 -0
  87. package/src/bop-sdk/utils/abi/coders/array.ts +275 -0
  88. package/src/bop-sdk/utils/abi/coders/boolean.ts +21 -0
  89. package/src/bop-sdk/utils/abi/coders/bytes.ts +36 -0
  90. package/src/bop-sdk/utils/abi/coders/fixed-bytes.ts +35 -0
  91. package/src/bop-sdk/utils/abi/coders/null.ts +25 -0
  92. package/src/bop-sdk/utils/abi/coders/number.ts +56 -0
  93. package/src/bop-sdk/utils/abi/coders/string.ts +24 -0
  94. package/src/bop-sdk/utils/abi/coders/tuple.ts +73 -0
  95. package/src/bop-sdk/utils/abi/constants/addresses.ts +1 -0
  96. package/src/bop-sdk/utils/abi/constants/bignumbers.ts +30 -0
  97. package/src/bop-sdk/utils/abi/constants/hashes.ts +2 -0
  98. package/src/bop-sdk/utils/abi/constants/index.ts +15 -0
  99. package/src/bop-sdk/utils/abi/constants/strings.ts +2 -0
  100. package/src/bop-sdk/utils/abi/fragments.ts +1243 -0
  101. package/src/bop-sdk/utils/abi/id.ts +6 -0
  102. package/src/bop-sdk/utils/abi/index.ts +46 -0
  103. package/src/bop-sdk/utils/abi/interface.ts +921 -0
  104. package/src/bop-sdk/utils/abi/keccak256.ts +9 -0
  105. package/src/bop-sdk/utils/abi/properties.ts +172 -0
  106. package/src/bop-sdk/utils/abi/strings/bytes32.ts +40 -0
  107. package/src/bop-sdk/utils/abi/strings/idna.ts +258 -0
  108. package/src/bop-sdk/utils/abi/strings/index.ts +28 -0
  109. package/src/bop-sdk/utils/abi/strings/utf8.ts +373 -0
  110. package/src/bop-sdk/utils/encryption-address.ts +501 -0
  111. package/src/bop-sdk/utils/encryption-crypto.ts +427 -0
  112. package/src/bop-sdk/utils/encryption-mnemonics.ts +120 -0
  113. package/src/bop-sdk/utils/index.ts +27 -0
  114. package/src/bop-sdk/utils/logger.ts +480 -0
  115. package/src/index.ts +35 -0
@@ -0,0 +1,480 @@
1
+ "use strict";
2
+ import debug from "debug";
3
+
4
+ let _permanentCensorErrors = false;
5
+ let _censorErrors = false;
6
+
7
+ const LogLevels: { [name: string]: number } = {
8
+ debug: 1,
9
+ default: 2,
10
+ info: 2,
11
+ warning: 3,
12
+ error: 4,
13
+ off: 5,
14
+ };
15
+ let _logLevel = LogLevels["debug"];
16
+
17
+ const version = "logger/1.0.0";
18
+
19
+ const log = debug("bop-sdk:utils");
20
+
21
+ let _globalLogger: Logger = null;
22
+
23
+ function _checkNormalize(): string {
24
+ try {
25
+ const missing: Array<string> = [];
26
+
27
+ // Make sure all forms of normalization are supported
28
+ ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => {
29
+ try {
30
+ if ("test".normalize(form) !== "test") {
31
+ throw new Error("bad normalize");
32
+ }
33
+ } catch (error) {
34
+ missing.push(form);
35
+ }
36
+ });
37
+
38
+ if (missing.length) {
39
+ throw new Error("missing " + missing.join(", "));
40
+ }
41
+
42
+ if (
43
+ String.fromCharCode(0xe9).normalize("NFD") !==
44
+ String.fromCharCode(0x65, 0x0301)
45
+ ) {
46
+ throw new Error("broken implementation");
47
+ }
48
+ } catch (error) {
49
+ return error.message;
50
+ }
51
+
52
+ return null;
53
+ }
54
+
55
+ const _normalizeError = _checkNormalize();
56
+
57
+ export enum LogLevel {
58
+ DEBUG = "DEBUG",
59
+ INFO = "INFO",
60
+ WARNING = "WARNING",
61
+ ERROR = "ERROR",
62
+ OFF = "OFF",
63
+ }
64
+
65
+ export enum ErrorCode {
66
+ ///////////////////
67
+ // Generic Errors
68
+
69
+ // Unknown Error
70
+ UNKNOWN_ERROR = "UNKNOWN_ERROR",
71
+
72
+ // Not Implemented
73
+ NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
74
+
75
+ // Unsupported Operation
76
+ // - operation
77
+ UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION",
78
+
79
+ // Network Error (i.e. Ethereum Network, such as an invalid chain ID)
80
+ // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown)
81
+ NETWORK_ERROR = "NETWORK_ERROR",
82
+
83
+ // Some sort of bad response from the server
84
+ SERVER_ERROR = "SERVER_ERROR",
85
+
86
+ // Timeout
87
+ TIMEOUT = "TIMEOUT",
88
+
89
+ ///////////////////
90
+ // Operational Errors
91
+
92
+ // Buffer Overrun
93
+ BUFFER_OVERRUN = "BUFFER_OVERRUN",
94
+
95
+ // Numeric Fault
96
+ // - operation: the operation being executed
97
+ // - fault: the reason this faulted
98
+ NUMERIC_FAULT = "NUMERIC_FAULT",
99
+
100
+ ///////////////////
101
+ // Argument Errors
102
+
103
+ // Missing new operator to an object
104
+ // - name: The name of the class
105
+ MISSING_NEW = "MISSING_NEW",
106
+
107
+ // Invalid argument (e.g. value is incompatible with type) to a function:
108
+ // - argument: The argument name that was invalid
109
+ // - value: The value of the argument
110
+ INVALID_ARGUMENT = "INVALID_ARGUMENT",
111
+
112
+ // Missing argument to a function:
113
+ // - count: The number of arguments received
114
+ // - expectedCount: The number of arguments expected
115
+ MISSING_ARGUMENT = "MISSING_ARGUMENT",
116
+
117
+ // Too many arguments
118
+ // - count: The number of arguments received
119
+ // - expectedCount: The number of arguments expected
120
+ UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT",
121
+
122
+ ///////////////////
123
+ // Blockchain Errors
124
+
125
+ // Call exception
126
+ // - transaction: the transaction
127
+ // - address?: the contract address
128
+ // - args?: The arguments passed into the function
129
+ // - method?: The Solidity method signature
130
+ // - errorSignature?: The EIP848 error signature
131
+ // - errorArgs?: The EIP848 error parameters
132
+ // - reason: The reason (only for EIP848 "Error(string)")
133
+ CALL_EXCEPTION = "CALL_EXCEPTION",
134
+
135
+ // Insufficient funds (< value + gasLimit * gasPrice)
136
+ // - transaction: the transaction attempted
137
+ INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
138
+
139
+ // Nonce has already been used
140
+ // - transaction: the transaction attempted
141
+ NONCE_EXPIRED = "NONCE_EXPIRED",
142
+
143
+ // The replacement fee for the transaction is too low
144
+ // - transaction: the transaction attempted
145
+ REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED",
146
+
147
+ // The gas limit could not be estimated
148
+ // - transaction: the transaction passed to estimateGas
149
+ UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT",
150
+
151
+ // The transaction was replaced by one with a higher gas price
152
+ // - reason: "cancelled", "replaced" or "repriced"
153
+ // - cancelled: true if reason == "cancelled" or reason == "replaced")
154
+ // - hash: original transaction hash
155
+ // - replacement: the full TransactionsResponse for the replacement
156
+ // - receipt: the receipt of the replacement
157
+ TRANSACTION_REPLACED = "TRANSACTION_REPLACED",
158
+
159
+ ///////////////////
160
+ // Interaction Errors
161
+
162
+ // The user rejected the action, such as signing a message or sending
163
+ // a transaction
164
+ ACTION_REJECTED = "ACTION_REJECTED",
165
+ }
166
+
167
+ const HEX = "0123456789abcdef";
168
+
169
+ export class Logger {
170
+ readonly version: string;
171
+
172
+ static errors = ErrorCode;
173
+
174
+ static levels = LogLevel;
175
+
176
+ constructor(version: string) {
177
+ Object.defineProperty(this, "version", {
178
+ enumerable: true,
179
+ value: version,
180
+ writable: false,
181
+ });
182
+ }
183
+
184
+ _log(logLevel: LogLevel, args: Array<any>): void {
185
+ const level = logLevel.toLowerCase();
186
+ if (LogLevels[level] == null) {
187
+ this.throwArgumentError("invalid log level name", "logLevel", logLevel);
188
+ }
189
+ if (_logLevel > LogLevels[level]) {
190
+ return;
191
+ }
192
+ //console.log.apply(console, args);
193
+ log(args);
194
+ }
195
+
196
+ debug(...args: Array<any>): void {
197
+ this._log(Logger.levels.DEBUG, args);
198
+ }
199
+
200
+ info(...args: Array<any>): void {
201
+ this._log(Logger.levels.INFO, args);
202
+ }
203
+
204
+ warn(...args: Array<any>): void {
205
+ this._log(Logger.levels.WARNING, args);
206
+ }
207
+
208
+ makeError(message: string, code?: ErrorCode, params?: any): Error {
209
+ // Errors are being censored
210
+ if (_censorErrors) {
211
+ return this.makeError("censored error", code, {});
212
+ }
213
+
214
+ if (!code) {
215
+ code = Logger.errors.UNKNOWN_ERROR;
216
+ }
217
+ if (!params) {
218
+ params = {};
219
+ }
220
+
221
+ const messageDetails: Array<string> = [];
222
+ Object.keys(params).forEach((key) => {
223
+ const value = params[key];
224
+ try {
225
+ if (value instanceof Uint8Array) {
226
+ let hex = "";
227
+ for (let i = 0; i < value.length; i++) {
228
+ hex += HEX[value[i] >> 4];
229
+ hex += HEX[value[i] & 0x0f];
230
+ }
231
+ messageDetails.push(key + "=Uint8Array(0x" + hex + ")");
232
+ } else {
233
+ messageDetails.push(key + "=" + JSON.stringify(value));
234
+ }
235
+ } catch (error) {
236
+ messageDetails.push(key + "=" + JSON.stringify(params[key].toString()));
237
+ }
238
+ });
239
+ messageDetails.push(`code=${code}`);
240
+ messageDetails.push(`version=${this.version}`);
241
+
242
+ const reason = message;
243
+
244
+ let url = "";
245
+
246
+ switch (code) {
247
+ case ErrorCode.NUMERIC_FAULT: {
248
+ url = "NUMERIC_FAULT";
249
+ const fault = message;
250
+
251
+ switch (fault) {
252
+ case "overflow":
253
+ case "underflow":
254
+ case "division-by-zero":
255
+ url += "-" + fault;
256
+ break;
257
+ case "negative-power":
258
+ case "negative-width":
259
+ url += "-unsupported";
260
+ break;
261
+ case "unbound-bitwise-result":
262
+ url += "-unbound-result";
263
+ break;
264
+ }
265
+ break;
266
+ }
267
+ case ErrorCode.CALL_EXCEPTION:
268
+ case ErrorCode.INSUFFICIENT_FUNDS:
269
+ case ErrorCode.MISSING_NEW:
270
+ case ErrorCode.NONCE_EXPIRED:
271
+ case ErrorCode.REPLACEMENT_UNDERPRICED:
272
+ case ErrorCode.TRANSACTION_REPLACED:
273
+ case ErrorCode.UNPREDICTABLE_GAS_LIMIT:
274
+ url = code;
275
+ break;
276
+ }
277
+
278
+ if (url) {
279
+ message += " [ See: https:/\/links.ethers.org/v5-errors-" + url + " ]";
280
+ }
281
+
282
+ if (messageDetails.length) {
283
+ message += " (" + messageDetails.join(", ") + ")";
284
+ }
285
+
286
+ // @TODO: Any??
287
+ const error: any = new Error(message);
288
+ error.reason = reason;
289
+ error.code = code;
290
+
291
+ Object.keys(params).forEach(function (key) {
292
+ error[key] = params[key];
293
+ });
294
+
295
+ return error;
296
+ }
297
+
298
+ throwError(message: string, code?: ErrorCode, params?: any): never {
299
+ throw this.makeError(message, code, params);
300
+ }
301
+
302
+ throwArgumentError(message: string, name: string, value: any): never {
303
+ return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {
304
+ argument: name,
305
+ value: value,
306
+ });
307
+ }
308
+
309
+ assert(
310
+ condition: any,
311
+ message: string,
312
+ code?: ErrorCode,
313
+ params?: any,
314
+ ): void {
315
+ if (!!condition) {
316
+ return;
317
+ }
318
+ this.throwError(message, code, params);
319
+ }
320
+
321
+ assertArgument(
322
+ condition: any,
323
+ message: string,
324
+ name: string,
325
+ value: any,
326
+ ): void {
327
+ if (!!condition) {
328
+ return;
329
+ }
330
+ this.throwArgumentError(message, name, value);
331
+ }
332
+
333
+ checkNormalize(message?: string): void {
334
+ if (message == null) {
335
+ message = "platform missing String.prototype.normalize";
336
+ }
337
+ if (_normalizeError) {
338
+ this.throwError(
339
+ "platform missing String.prototype.normalize",
340
+ Logger.errors.UNSUPPORTED_OPERATION,
341
+ {
342
+ operation: "String.prototype.normalize",
343
+ form: _normalizeError,
344
+ },
345
+ );
346
+ }
347
+ }
348
+
349
+ checkSafeUint53(value: number, message?: string): void {
350
+ if (typeof value !== "number") {
351
+ return;
352
+ }
353
+
354
+ if (message == null) {
355
+ message = "value not safe";
356
+ }
357
+
358
+ if (value < 0 || value >= 0x1fffffffffffff) {
359
+ this.throwError(message, Logger.errors.NUMERIC_FAULT, {
360
+ operation: "checkSafeInteger",
361
+ fault: "out-of-safe-range",
362
+ value: value,
363
+ });
364
+ }
365
+
366
+ if (value % 1) {
367
+ this.throwError(message, Logger.errors.NUMERIC_FAULT, {
368
+ operation: "checkSafeInteger",
369
+ fault: "non-integer",
370
+ value: value,
371
+ });
372
+ }
373
+ }
374
+
375
+ checkArgumentCount(
376
+ count: number,
377
+ expectedCount: number,
378
+ message?: string,
379
+ ): void {
380
+ if (message) {
381
+ message = ": " + message;
382
+ } else {
383
+ message = "";
384
+ }
385
+
386
+ if (count < expectedCount) {
387
+ this.throwError(
388
+ "missing argument" + message,
389
+ Logger.errors.MISSING_ARGUMENT,
390
+ {
391
+ count: count,
392
+ expectedCount: expectedCount,
393
+ },
394
+ );
395
+ }
396
+
397
+ if (count > expectedCount) {
398
+ this.throwError(
399
+ "too many arguments" + message,
400
+ Logger.errors.UNEXPECTED_ARGUMENT,
401
+ {
402
+ count: count,
403
+ expectedCount: expectedCount,
404
+ },
405
+ );
406
+ }
407
+ }
408
+
409
+ checkNew(target: any, kind: any): void {
410
+ if (target === Object || target == null) {
411
+ this.throwError("missing new", Logger.errors.MISSING_NEW, {
412
+ name: kind.name,
413
+ });
414
+ }
415
+ }
416
+
417
+ checkAbstract(target: any, kind: any): void {
418
+ if (target === kind) {
419
+ this.throwError(
420
+ "cannot instantiate abstract class " +
421
+ JSON.stringify(kind.name) +
422
+ " directly; use a sub-class",
423
+ Logger.errors.UNSUPPORTED_OPERATION,
424
+ { name: target.name, operation: "new" },
425
+ );
426
+ } else if (target === Object || target == null) {
427
+ this.throwError("missing new", Logger.errors.MISSING_NEW, {
428
+ name: kind.name,
429
+ });
430
+ }
431
+ }
432
+
433
+ static globalLogger(): Logger {
434
+ if (!_globalLogger) {
435
+ _globalLogger = new Logger(version);
436
+ }
437
+ return _globalLogger;
438
+ }
439
+
440
+ static setCensorship(censorship: boolean, permanent?: boolean): void {
441
+ if (!censorship && permanent) {
442
+ this.globalLogger().throwError(
443
+ "cannot permanently disable censorship",
444
+ Logger.errors.UNSUPPORTED_OPERATION,
445
+ {
446
+ operation: "setCensorship",
447
+ },
448
+ );
449
+ }
450
+
451
+ if (_permanentCensorErrors) {
452
+ if (!censorship) {
453
+ return;
454
+ }
455
+ this.globalLogger().throwError(
456
+ "error censorship permanent",
457
+ Logger.errors.UNSUPPORTED_OPERATION,
458
+ {
459
+ operation: "setCensorship",
460
+ },
461
+ );
462
+ }
463
+
464
+ _censorErrors = !!censorship;
465
+ _permanentCensorErrors = !!permanent;
466
+ }
467
+
468
+ static setLogLevel(logLevel: LogLevel): void {
469
+ const level = LogLevels[logLevel.toLowerCase()];
470
+ if (level == null) {
471
+ Logger.globalLogger().warn("invalid log level - " + logLevel);
472
+ return;
473
+ }
474
+ _logLevel = level;
475
+ }
476
+
477
+ static from(version: string): Logger {
478
+ return new Logger(version);
479
+ }
480
+ }
package/src/index.ts ADDED
@@ -0,0 +1,35 @@
1
+ import {
2
+ BopInterface,
3
+ Config,
4
+ bopprotocol,
5
+ BopWsInterface,
6
+ WsConfig,
7
+ bopwsprotocol,
8
+ } from "./bop";
9
+ import {
10
+ SignerByBop,
11
+ ProviderByBop,
12
+ defaultUtils,
13
+ Interface,
14
+ sdkprotocol,
15
+ WsProviderByBop,
16
+ } from "./bop-sdk";
17
+
18
+ export {
19
+ BopInterface,
20
+ Config,
21
+ bopprotocol,
22
+ //ws
23
+ BopWsInterface,
24
+ WsConfig,
25
+ bopwsprotocol,
26
+ };
27
+
28
+ export {
29
+ SignerByBop,
30
+ ProviderByBop,
31
+ defaultUtils,
32
+ Interface,
33
+ sdkprotocol,
34
+ WsProviderByBop,
35
+ };