@ercworldio/blockchain-shared 1.0.3-dev.3-PROJ-1296.13 → 1.0.3-dev.3-PROJ-1296.15

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.
@@ -44,7 +44,7 @@ declare class EscrowInteraction extends Errors {
44
44
  transactionHash: null;
45
45
  receipt: null;
46
46
  error: {
47
- name: "ContractBusy" | "ContractPaused" | "DepositOnlyERC20" | "EtherDirectTransferNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "InvalidSignature" | "NotAdmin" | "NotAuthorized" | "RequestAlreadyFulfilled" | "SignatureAlreadyUsed" | "TokenNotAllowed" | "TransferError" | "ZeroAddress" | "ZeroValue" | "UnknownError";
47
+ name: "ContractBusy" | "ContractPaused" | "InvalidSignature" | "SignatureAlreadyUsed" | "ZeroValue" | "ZeroAddress" | "RequestAlreadyFulfilled" | "EtherDirectTransferNotAllowed" | "DepositOnlyERC20" | "TokenNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "TransferError" | "NotAdmin" | "NotAuthorized" | "UnknownError";
48
48
  message: string;
49
49
  data?: any;
50
50
  };
@@ -61,7 +61,7 @@ declare class EscrowInteraction extends Errors {
61
61
  transactionHash: null;
62
62
  receipt: null;
63
63
  error: {
64
- name: "ContractBusy" | "ContractPaused" | "DepositOnlyERC20" | "EtherDirectTransferNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "InvalidSignature" | "NotAdmin" | "NotAuthorized" | "RequestAlreadyFulfilled" | "SignatureAlreadyUsed" | "TokenNotAllowed" | "TransferError" | "ZeroAddress" | "ZeroValue" | "UnknownError";
64
+ name: "ContractBusy" | "ContractPaused" | "InvalidSignature" | "SignatureAlreadyUsed" | "ZeroValue" | "ZeroAddress" | "RequestAlreadyFulfilled" | "EtherDirectTransferNotAllowed" | "DepositOnlyERC20" | "TokenNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "TransferError" | "NotAdmin" | "NotAuthorized" | "UnknownError";
65
65
  message: string;
66
66
  data?: any;
67
67
  };
@@ -108,7 +108,7 @@ declare class EscrowInteraction extends Errors {
108
108
  receipt: null;
109
109
  executed_at: Date;
110
110
  error: {
111
- name: "ContractBusy" | "ContractPaused" | "DepositOnlyERC20" | "EtherDirectTransferNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "InvalidSignature" | "NotAdmin" | "NotAuthorized" | "RequestAlreadyFulfilled" | "SignatureAlreadyUsed" | "TokenNotAllowed" | "TransferError" | "ZeroAddress" | "ZeroValue" | "UnknownError";
111
+ name: "ContractBusy" | "ContractPaused" | "InvalidSignature" | "SignatureAlreadyUsed" | "ZeroValue" | "ZeroAddress" | "RequestAlreadyFulfilled" | "EtherDirectTransferNotAllowed" | "DepositOnlyERC20" | "TokenNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "TransferError" | "NotAdmin" | "NotAuthorized" | "UnknownError";
112
112
  message: string;
113
113
  data?: any;
114
114
  };
@@ -148,7 +148,7 @@ declare class EscrowInteraction extends Errors {
148
148
  transactionHash: null;
149
149
  receipt: null;
150
150
  error: {
151
- name: "ContractBusy" | "ContractPaused" | "DepositOnlyERC20" | "EtherDirectTransferNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "InvalidSignature" | "NotAdmin" | "NotAuthorized" | "RequestAlreadyFulfilled" | "SignatureAlreadyUsed" | "TokenNotAllowed" | "TransferError" | "ZeroAddress" | "ZeroValue" | "UnknownError";
151
+ name: "ContractBusy" | "ContractPaused" | "InvalidSignature" | "SignatureAlreadyUsed" | "ZeroValue" | "ZeroAddress" | "RequestAlreadyFulfilled" | "EtherDirectTransferNotAllowed" | "DepositOnlyERC20" | "TokenNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "TransferError" | "NotAdmin" | "NotAuthorized" | "UnknownError";
152
152
  message: string;
153
153
  data?: any;
154
154
  };
@@ -24,7 +24,11 @@ export interface Signature {
24
24
  }
25
25
  export declare enum OperationType {
26
26
  DEPOSIT = 0,
27
- WITHDRAW = 1
27
+ WITHDRAW = 1,
28
+ SETTLE = 2,
29
+ ADMIN_WITHDRAWAL = 3,
30
+ MANAGE_MULTISIG = 4,// Admin conf: Configure Withdrawal and Admin withdrawal thresholds
31
+ CONFIG_TIMELOCK = 5
28
32
  }
29
33
  export type OpType = "DEPOSIT" | "WITHDRAW";
30
34
  export interface DepositResult {
@@ -1 +1 @@
1
- {"version":3,"file":"escrow.d.ts","sourceRoot":"","sources":["../../../src/contracts/types/escrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,oBAAY,SAAS;IACjB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,KAAK;CACb;AAED,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,oBAAY,iBAAiB;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;CACpB;AAED,MAAM,WAAW,SAAS;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAGD,oBAAY,aAAa;IACrB,OAAO,IAAI;IACX,QAAQ,IAAI;CACf;AAGD,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC,0BAA0B,GAAG,IAAI,CAAC;IAClD,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,MAAM,CA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,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CAC3B"}
@@ -17,4 +17,8 @@ var OperationType;
17
17
  (function (OperationType) {
18
18
  OperationType[OperationType["DEPOSIT"] = 0] = "DEPOSIT";
19
19
  OperationType[OperationType["WITHDRAW"] = 1] = "WITHDRAW";
20
+ OperationType[OperationType["SETTLE"] = 2] = "SETTLE";
21
+ OperationType[OperationType["ADMIN_WITHDRAWAL"] = 3] = "ADMIN_WITHDRAWAL";
22
+ OperationType[OperationType["MANAGE_MULTISIG"] = 4] = "MANAGE_MULTISIG";
23
+ OperationType[OperationType["CONFIG_TIMELOCK"] = 5] = "CONFIG_TIMELOCK";
20
24
  })(OperationType || (exports.OperationType = OperationType = {}));
@@ -1,17 +1,26 @@
1
1
  import { Pool } from "pg";
2
2
  import { GetAdminOperationThreshold, UpsertAdminOperationThreshold, GetGlobalTimelock, UpsertGlobalTimelock, GetGranularTimelock, UpsertGranularTimelock, GetTokenExecutionThreshold, UpsertTokenExecutionThreshold } from "../../types";
3
+ import { OperationType } from "../../../contracts/types/escrow";
3
4
  /**
4
5
  * Adapter class for interfacing the DB functions
5
6
  * related to escrow multisig threshold execution settings
6
7
  */
7
8
  declare class MultisigService {
9
+ /** Returns all admin operation signature thresholds for the given escrow. */
8
10
  static fn_get_admin_operation_thresholds(pool: Pool, blockchain: string, chainId: string, escrow_address: string): Promise<GetAdminOperationThreshold[]>;
9
- static fn_upsert_admin_operation_threshold(pool: Pool, blockchain: string, chainId: string, escrow_address: string, sigs_manager: number, sigs_executive: number): Promise<UpsertAdminOperationThreshold>;
11
+ /** Inserts or updates the manager/executive signature thresholds for the given escrow. */
12
+ static fn_upsert_admin_operation_threshold(pool: Pool, blockchain: string, chainId: string, escrow_address: string, operation_type: OperationType, sigs_manager: number, sigs_executive: number): Promise<UpsertAdminOperationThreshold>;
13
+ /** Returns all global timelock configs for the given escrow. */
10
14
  static fn_get_global_timelock(pool: Pool, blockchain: string, chainId: string, escrow_address: string): Promise<GetGlobalTimelock[]>;
15
+ /** Inserts or updates the global timelock durations for a token/escrow pair. */
11
16
  static fn_upsert_global_timelock(pool: Pool, blockchain: string, chainId: string, escrow_address: string, token_address: string, threshold_amount: number, duration_below_seconds: number, duration_above_seconds: number): Promise<UpsertGlobalTimelock>;
17
+ /** Returns all granular timelock configs for the given escrow. */
12
18
  static fn_get_granular_timelock(pool: Pool, blockchain: string, chainId: string, escrow_address: string): Promise<GetGranularTimelock[]>;
19
+ /** Inserts or updates the timelock duration for a specific receiver address. */
13
20
  static fn_upsert_granular_timelock(pool: Pool, blockchain: string, chainId: string, escrow_address: string, receiver_address: string, duration_seconds: number): Promise<UpsertGranularTimelock>;
21
+ /** Returns all per-token execution signature thresholds for the given escrow. */
14
22
  static fn_get_token_execution_thresholds(pool: Pool, blockchain: string, chainId: string, escrow_address: string): Promise<GetTokenExecutionThreshold[]>;
23
+ /** Inserts or updates the above/below signature thresholds for a token/escrow pair. */
15
24
  static fn_upsert_token_execution_threshold(pool: Pool, blockchain: string, chainId: string, escrow_address: string, token_address: string, threshold_amount: number, sigs_executive_below: number, sigs_executive_above: number, sigs_manager_below: number, sigs_manager_above: number): Promise<UpsertTokenExecutionThreshold>;
16
25
  }
17
26
  export default MultisigService;
@@ -1 +1 @@
1
- {"version":3,"file":"MultisigService.d.ts","sourceRoot":"","sources":["../../../../src/services/db/multisig/MultisigService.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,OAAO,EACH,0BAA0B,EAC1B,6BAA6B,EAC7B,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAChC,MAAM,aAAa,CAAC;AAGrB;;;GAGG;AACH,cAAM,eAAe;WAEJ,iCAAiC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,O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AE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAS/P,kEAAkE;WACrD,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAS9I,gFAAgF;WACnE,2BAA2B,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IActM,iFAAiF;WACpE,iCAAiC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAS9J,uFAAuF;WAC1E,mCAAmC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC;CASzU;AAED,eAAe,eAAe,CAAC"}
@@ -14,6 +14,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  * related to escrow multisig threshold execution settings
15
15
  */
16
16
  class MultisigService {
17
+ ///////////////////////////////////////////
18
+ /// Admin Operation Execution Thresholds
19
+ ///////////////////////////////////////////
20
+ /** Returns all admin operation signature thresholds for the given escrow. */
17
21
  static fn_get_admin_operation_thresholds(pool, blockchain, chainId, escrow_address) {
18
22
  return __awaiter(this, void 0, void 0, function* () {
19
23
  const result = yield pool.query(`SELECT multisig.fn_get_admin_operation_thresholds($1::text,$2::text,$3::text)`, [blockchain, chainId, escrow_address]);
@@ -22,14 +26,19 @@ class MultisigService {
22
26
  return result.rows[0].fn_get_admin_operation_thresholds;
23
27
  });
24
28
  }
25
- static fn_upsert_admin_operation_threshold(pool, blockchain, chainId, escrow_address, sigs_manager, sigs_executive) {
29
+ /** Inserts or updates the manager/executive signature thresholds for the given escrow. */
30
+ static fn_upsert_admin_operation_threshold(pool, blockchain, chainId, escrow_address, operation_type, sigs_manager, sigs_executive) {
26
31
  return __awaiter(this, void 0, void 0, function* () {
27
- const result = yield pool.query(`SELECT multisig.fn_upsert_admin_operation_threshold($1::text,$2::text,$3::text,$4::integer,$5::integer)`, [blockchain, chainId, escrow_address, sigs_manager, sigs_executive]);
32
+ const result = yield pool.query(`SELECT multisig.fn_upsert_admin_operation_threshold($1::text,$2::text,$3::text,$4::integer,$5::integer,$6::integer)`, [blockchain, chainId, escrow_address, operation_type, sigs_manager, sigs_executive]);
28
33
  if (!result)
29
34
  throw new Error(`DB FN error: multisig.fn_upsert_admin_operation_threshold()`);
30
35
  return result.rows[0].fn_upsert_admin_operation_threshold;
31
36
  });
32
37
  }
38
+ ///////////////////////////////////////////
39
+ /// Timelock Durations
40
+ ///////////////////////////////////////////
41
+ /** Returns all global timelock configs for the given escrow. */
33
42
  static fn_get_global_timelock(pool, blockchain, chainId, escrow_address) {
34
43
  return __awaiter(this, void 0, void 0, function* () {
35
44
  const result = yield pool.query(`SELECT multisig.fn_get_global_timelock($1::text,$2::text,$3::text)`, [blockchain, chainId, escrow_address]);
@@ -38,6 +47,7 @@ class MultisigService {
38
47
  return result.rows[0].fn_get_global_timelock;
39
48
  });
40
49
  }
50
+ /** Inserts or updates the global timelock durations for a token/escrow pair. */
41
51
  static fn_upsert_global_timelock(pool, blockchain, chainId, escrow_address, token_address, threshold_amount, duration_below_seconds, duration_above_seconds) {
42
52
  return __awaiter(this, void 0, void 0, function* () {
43
53
  const result = yield pool.query(`SELECT multisig.fn_upsert_global_timelock($1::text,$2::text,$3::text,$4::text,$5::numeric,$6::bigint,$7::bigint)`, [blockchain, chainId, escrow_address, token_address, threshold_amount, duration_below_seconds, duration_above_seconds]);
@@ -46,6 +56,7 @@ class MultisigService {
46
56
  return result.rows[0].fn_upsert_global_timelock;
47
57
  });
48
58
  }
59
+ /** Returns all granular timelock configs for the given escrow. */
49
60
  static fn_get_granular_timelock(pool, blockchain, chainId, escrow_address) {
50
61
  return __awaiter(this, void 0, void 0, function* () {
51
62
  const result = yield pool.query(`SELECT multisig.fn_get_granular_timelock($1::text,$2::text,$3::text)`, [blockchain, chainId, escrow_address]);
@@ -54,6 +65,7 @@ class MultisigService {
54
65
  return result.rows[0].fn_get_granular_timelock;
55
66
  });
56
67
  }
68
+ /** Inserts or updates the timelock duration for a specific receiver address. */
57
69
  static fn_upsert_granular_timelock(pool, blockchain, chainId, escrow_address, receiver_address, duration_seconds) {
58
70
  return __awaiter(this, void 0, void 0, function* () {
59
71
  const result = yield pool.query(`SELECT multisig.fn_upsert_granular_timelock($1::text,$2::text,$3::text,$4::text,$5::bigint)`, [blockchain, chainId, escrow_address, receiver_address, duration_seconds]);
@@ -62,6 +74,10 @@ class MultisigService {
62
74
  return result.rows[0].fn_upsert_granular_timelock;
63
75
  });
64
76
  }
77
+ ///////////////////////////////////////////
78
+ /// Token Execution Thresholds
79
+ ///////////////////////////////////////////
80
+ /** Returns all per-token execution signature thresholds for the given escrow. */
65
81
  static fn_get_token_execution_thresholds(pool, blockchain, chainId, escrow_address) {
66
82
  return __awaiter(this, void 0, void 0, function* () {
67
83
  const result = yield pool.query(`SELECT multisig.fn_get_token_execution_thresholds($1::text,$2::text,$3::text)`, [blockchain, chainId, escrow_address]);
@@ -70,6 +86,7 @@ class MultisigService {
70
86
  return result.rows[0].fn_get_token_execution_thresholds;
71
87
  });
72
88
  }
89
+ /** Inserts or updates the above/below signature thresholds for a token/escrow pair. */
73
90
  static fn_upsert_token_execution_threshold(pool, blockchain, chainId, escrow_address, token_address, threshold_amount, sigs_executive_below, sigs_executive_above, sigs_manager_below, sigs_manager_above) {
74
91
  return __awaiter(this, void 0, void 0, function* () {
75
92
  const result = yield pool.query(`SELECT multisig.fn_upsert_token_execution_threshold($1::text,$2::text,$3::text,$4::text,$5::numeric,$6::bigint,$7::bigint,$8::bigint,$9::bigint)`, [blockchain, chainId, escrow_address, token_address, threshold_amount, sigs_executive_below, sigs_executive_above, sigs_manager_below, sigs_manager_above]);
@@ -1,5 +1,7 @@
1
+ import { OperationType } from "../../../contracts/types/escrow";
1
2
  export interface GetAdminOperationThreshold {
2
3
  id: number;
4
+ operationTypeId: number;
3
5
  blockchain: string;
4
6
  chainId: number;
5
7
  escrowAddress: string;
@@ -11,6 +13,7 @@ export interface GetAdminOperationThreshold {
11
13
  export interface UpsertAdminOperationThreshold {
12
14
  id: number;
13
15
  blockchain: string;
16
+ operationTypeId: OperationType;
14
17
  chainId: string;
15
18
  escrowAddress: string;
16
19
  sigsManager: number;
@@ -1 +1 @@
1
- {"version":3,"file":"multisig_service.d.ts","sourceRoot":"","sources":["../../../../src/services/types/db/multisig_service.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE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;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC5B"}
1
+ {"version":3,"file":"multisig_service.d.ts","sourceRoot":"","sources":["../../../../src/services/types/db/multisig_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,MAAM,WAAW,0BAA0B;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,UAAU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CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,0BAA0B;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ercworldio/blockchain-shared",
3
- "version": "1.0.3-dev.3-PROJ-1296.13",
3
+ "version": "1.0.3-dev.3-PROJ-1296.15",
4
4
  "description": "Shared library for blockchain projects",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",