@ercworldio/blockchain-shared 1.0.3-dev.3-PROJ-1296.13 → 1.0.3-dev.3-PROJ-1296.14
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/build/contracts/types/escrow.d.ts +5 -1
- package/build/contracts/types/escrow.d.ts.map +1 -1
- package/build/contracts/types/escrow.js +4 -0
- package/build/services/db/multisig/MultisigService.d.ts +8 -0
- package/build/services/db/multisig/MultisigService.d.ts.map +1 -1
- package/build/services/db/multisig/MultisigService.js +8 -0
- package/package.json +1 -1
|
@@ -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;A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ClD,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,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 = {}));
|
|
@@ -5,13 +5,21 @@ import { GetAdminOperationThreshold, UpsertAdminOperationThreshold, GetGlobalTim
|
|
|
5
5
|
* related to escrow multisig threshold execution settings
|
|
6
6
|
*/
|
|
7
7
|
declare class MultisigService {
|
|
8
|
+
/** Returns all admin operation signature thresholds for the given escrow. */
|
|
8
9
|
static fn_get_admin_operation_thresholds(pool: Pool, blockchain: string, chainId: string, escrow_address: string): Promise<GetAdminOperationThreshold[]>;
|
|
10
|
+
/** Inserts or updates the manager/executive signature thresholds for the given escrow. */
|
|
9
11
|
static fn_upsert_admin_operation_threshold(pool: Pool, blockchain: string, chainId: string, escrow_address: string, sigs_manager: number, sigs_executive: number): Promise<UpsertAdminOperationThreshold>;
|
|
12
|
+
/** Returns all global timelock configs for the given escrow. */
|
|
10
13
|
static fn_get_global_timelock(pool: Pool, blockchain: string, chainId: string, escrow_address: string): Promise<GetGlobalTimelock[]>;
|
|
14
|
+
/** Inserts or updates the global timelock durations for a token/escrow pair. */
|
|
11
15
|
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>;
|
|
16
|
+
/** Returns all granular timelock configs for the given escrow. */
|
|
12
17
|
static fn_get_granular_timelock(pool: Pool, blockchain: string, chainId: string, escrow_address: string): Promise<GetGranularTimelock[]>;
|
|
18
|
+
/** Inserts or updates the timelock duration for a specific receiver address. */
|
|
13
19
|
static fn_upsert_granular_timelock(pool: Pool, blockchain: string, chainId: string, escrow_address: string, receiver_address: string, duration_seconds: number): Promise<UpsertGranularTimelock>;
|
|
20
|
+
/** Returns all per-token execution signature thresholds for the given escrow. */
|
|
14
21
|
static fn_get_token_execution_thresholds(pool: Pool, blockchain: string, chainId: string, escrow_address: string): Promise<GetTokenExecutionThreshold[]>;
|
|
22
|
+
/** Inserts or updates the above/below signature thresholds for a token/escrow pair. */
|
|
15
23
|
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
24
|
}
|
|
17
25
|
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;
|
|
1
|
+
{"version":3,"file":"MultisigService.d.ts","sourceRoot":"","sources":["../../../../src/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AC;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;IAStM,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,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
* related to escrow multisig threshold execution settings
|
|
15
15
|
*/
|
|
16
16
|
class MultisigService {
|
|
17
|
+
/** Returns all admin operation signature thresholds for the given escrow. */
|
|
17
18
|
static fn_get_admin_operation_thresholds(pool, blockchain, chainId, escrow_address) {
|
|
18
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
20
|
const result = yield pool.query(`SELECT multisig.fn_get_admin_operation_thresholds($1::text,$2::text,$3::text)`, [blockchain, chainId, escrow_address]);
|
|
@@ -22,6 +23,7 @@ class MultisigService {
|
|
|
22
23
|
return result.rows[0].fn_get_admin_operation_thresholds;
|
|
23
24
|
});
|
|
24
25
|
}
|
|
26
|
+
/** Inserts or updates the manager/executive signature thresholds for the given escrow. */
|
|
25
27
|
static fn_upsert_admin_operation_threshold(pool, blockchain, chainId, escrow_address, sigs_manager, sigs_executive) {
|
|
26
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
29
|
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]);
|
|
@@ -30,6 +32,7 @@ class MultisigService {
|
|
|
30
32
|
return result.rows[0].fn_upsert_admin_operation_threshold;
|
|
31
33
|
});
|
|
32
34
|
}
|
|
35
|
+
/** Returns all global timelock configs for the given escrow. */
|
|
33
36
|
static fn_get_global_timelock(pool, blockchain, chainId, escrow_address) {
|
|
34
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
38
|
const result = yield pool.query(`SELECT multisig.fn_get_global_timelock($1::text,$2::text,$3::text)`, [blockchain, chainId, escrow_address]);
|
|
@@ -38,6 +41,7 @@ class MultisigService {
|
|
|
38
41
|
return result.rows[0].fn_get_global_timelock;
|
|
39
42
|
});
|
|
40
43
|
}
|
|
44
|
+
/** Inserts or updates the global timelock durations for a token/escrow pair. */
|
|
41
45
|
static fn_upsert_global_timelock(pool, blockchain, chainId, escrow_address, token_address, threshold_amount, duration_below_seconds, duration_above_seconds) {
|
|
42
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
47
|
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 +50,7 @@ class MultisigService {
|
|
|
46
50
|
return result.rows[0].fn_upsert_global_timelock;
|
|
47
51
|
});
|
|
48
52
|
}
|
|
53
|
+
/** Returns all granular timelock configs for the given escrow. */
|
|
49
54
|
static fn_get_granular_timelock(pool, blockchain, chainId, escrow_address) {
|
|
50
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
56
|
const result = yield pool.query(`SELECT multisig.fn_get_granular_timelock($1::text,$2::text,$3::text)`, [blockchain, chainId, escrow_address]);
|
|
@@ -54,6 +59,7 @@ class MultisigService {
|
|
|
54
59
|
return result.rows[0].fn_get_granular_timelock;
|
|
55
60
|
});
|
|
56
61
|
}
|
|
62
|
+
/** Inserts or updates the timelock duration for a specific receiver address. */
|
|
57
63
|
static fn_upsert_granular_timelock(pool, blockchain, chainId, escrow_address, receiver_address, duration_seconds) {
|
|
58
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
65
|
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 +68,7 @@ class MultisigService {
|
|
|
62
68
|
return result.rows[0].fn_upsert_granular_timelock;
|
|
63
69
|
});
|
|
64
70
|
}
|
|
71
|
+
/** Returns all per-token execution signature thresholds for the given escrow. */
|
|
65
72
|
static fn_get_token_execution_thresholds(pool, blockchain, chainId, escrow_address) {
|
|
66
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
74
|
const result = yield pool.query(`SELECT multisig.fn_get_token_execution_thresholds($1::text,$2::text,$3::text)`, [blockchain, chainId, escrow_address]);
|
|
@@ -70,6 +77,7 @@ class MultisigService {
|
|
|
70
77
|
return result.rows[0].fn_get_token_execution_thresholds;
|
|
71
78
|
});
|
|
72
79
|
}
|
|
80
|
+
/** Inserts or updates the above/below signature thresholds for a token/escrow pair. */
|
|
73
81
|
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
82
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
83
|
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]);
|
package/package.json
CHANGED