@ercworldio/blockchain-shared 1.0.3-dev.3-PROJ-1296.28 → 1.0.3-dev.3-PROJ-1296.30
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/EscrowErrors.d.ts +84 -0
- package/build/contracts/EscrowErrors.d.ts.map +1 -1
- package/build/contracts/EscrowErrors.js +57 -16
- package/build/services/db/timelock/ScheduleTransactionService.d.ts +1 -1
- package/build/services/db/timelock/ScheduleTransactionService.d.ts.map +1 -1
- package/build/services/db/timelock/ScheduleTransactionService.js +4 -43
- package/build/services/types/db/timelock.d.ts +20 -3
- package/build/services/types/db/timelock.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -59,6 +59,90 @@ export interface NotAuthorizedError {
|
|
|
59
59
|
name: "NotAuthorized";
|
|
60
60
|
args: [];
|
|
61
61
|
}
|
|
62
|
+
export interface ExceedsLimitError {
|
|
63
|
+
name: "ExceedsLimit";
|
|
64
|
+
args: [];
|
|
65
|
+
}
|
|
66
|
+
export interface ExceedsMaxError {
|
|
67
|
+
name: "ExceedsMax";
|
|
68
|
+
args: [];
|
|
69
|
+
}
|
|
70
|
+
export interface UnknownError {
|
|
71
|
+
name: "UnknownError";
|
|
72
|
+
args: [];
|
|
73
|
+
}
|
|
74
|
+
export interface InvalidNonceError {
|
|
75
|
+
name: "InvalidNonce";
|
|
76
|
+
args: [];
|
|
77
|
+
}
|
|
78
|
+
export interface TimelockConfigGroupNotSetError {
|
|
79
|
+
name: "TimelockConfigGroupNotSet";
|
|
80
|
+
args: [];
|
|
81
|
+
}
|
|
82
|
+
export interface ConfigGroupNotSetError {
|
|
83
|
+
name: "ConfigGroupNotSet";
|
|
84
|
+
args: [];
|
|
85
|
+
}
|
|
86
|
+
export interface TimelockConfigNotSetError {
|
|
87
|
+
name: "TimelockConfigNotSet";
|
|
88
|
+
args: [];
|
|
89
|
+
}
|
|
90
|
+
export interface CommitmentNotFoundError {
|
|
91
|
+
name: "CommitmentNotFound";
|
|
92
|
+
args: [string];
|
|
93
|
+
}
|
|
94
|
+
export interface AlreadyCreatedTransactionError {
|
|
95
|
+
name: "AlreadyCreatedTransaction";
|
|
96
|
+
args: [number];
|
|
97
|
+
}
|
|
98
|
+
export interface AccountAlreadyHasSignerRoleError {
|
|
99
|
+
name: "AccountAlreadyHasSignerRole";
|
|
100
|
+
args: [string];
|
|
101
|
+
}
|
|
102
|
+
export interface InvalidOperationError {
|
|
103
|
+
name: "InvalidOperation";
|
|
104
|
+
args: [];
|
|
105
|
+
}
|
|
106
|
+
export interface InvalidConfigError {
|
|
107
|
+
name: "InvalidConfig";
|
|
108
|
+
args: [];
|
|
109
|
+
}
|
|
110
|
+
export interface InvalidSignaturesError {
|
|
111
|
+
name: "InvalidSignatures";
|
|
112
|
+
args: [];
|
|
113
|
+
}
|
|
114
|
+
export interface AdminMultisigConfigNotSetError {
|
|
115
|
+
name: "AdminMultisigConfigNotSet";
|
|
116
|
+
args: [];
|
|
117
|
+
}
|
|
118
|
+
export interface MultisigConfigNotSetError {
|
|
119
|
+
name: "MultisigConfigNotSet";
|
|
120
|
+
args: [];
|
|
121
|
+
}
|
|
122
|
+
export interface RequireTreasuryReceiverRoleError {
|
|
123
|
+
name: "RequireTreasuryReceiverRole";
|
|
124
|
+
args: [];
|
|
125
|
+
}
|
|
126
|
+
export interface InvalidMultiSigError {
|
|
127
|
+
name: "InvalidMultiSig";
|
|
128
|
+
args: [];
|
|
129
|
+
}
|
|
130
|
+
export interface RequireMultiSigError {
|
|
131
|
+
name: "RequireMultiSig";
|
|
132
|
+
args: [];
|
|
133
|
+
}
|
|
134
|
+
export interface TimelockNotExpiredError {
|
|
135
|
+
name: "TimelockNotExpired";
|
|
136
|
+
args: [number];
|
|
137
|
+
}
|
|
138
|
+
export interface InsufficientExecutiveSigsError {
|
|
139
|
+
name: "InsufficientExecutiveSigs";
|
|
140
|
+
args: [number, number];
|
|
141
|
+
}
|
|
142
|
+
export interface InsufficientManagerSigsError {
|
|
143
|
+
name: "InsufficientManagerSigs";
|
|
144
|
+
args: [number, number];
|
|
145
|
+
}
|
|
62
146
|
type ErrorName = "NotAuthorized" | "NotAdmin" | "TransferError" | "InsufficientReserves" | "InsufficientBalance" | "TokenNotAllowed" | "DepositOnlyERC20" | "EtherDirectTransferNotAllowed" | "RequestAlreadyFulfilled" | "ZeroAddress" | "ZeroValue" | "SignatureAlreadyUsed" | "InvalidSignature" | "ContractPaused" | "ContractBusy" | "ExceedsLimit" | "ExceedsMax" | "UnknownError" | "InvalidNonce" | "TimelockConfigGroupNotSet" | "ConfigGroupNotSet" | "TimelockConfigNotSet" | "CommitmentNotFound" | "AlreadyCreatedTransaction" | "AccountAlreadyHasSignerRole" | "InvalidOperation" | "InvalidConfig" | "InvalidSignatures" | "AdminMultisigConfigNotSet" | "MultisigConfigNotSet" | "RequireTreasuryReceiverRole" | "InvalidMultiSig" | "RequireMultiSig" | "TimelockNotExpired" | "InsufficientExecutiveSigs" | "InsufficientManagerSigs";
|
|
63
147
|
export interface EscrowErrorMessage {
|
|
64
148
|
name: ErrorName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EscrowErrors.d.ts","sourceRoot":"","sources":["../../src/contracts/EscrowErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,EAAE,CAAC;CACZ;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,EAAE,CAAC;CACZ;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,EAAE,CAAC;CACZ;AAED,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,IAAI,EAAE,EAAE,CAAC;CACZ;AAED,M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ChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,GAAI,cAAc,gBAAgB,KAAG,kBAuFlE,CAAC"}
|
|
@@ -6,23 +6,25 @@ const parseDecodedError = (decodedError) => {
|
|
|
6
6
|
case "ContractPaused":
|
|
7
7
|
return { name: decodedError.name, message: `Contract is currently paused by the administrators.` };
|
|
8
8
|
case "ContractBusy":
|
|
9
|
-
return { name: decodedError.name, message: `Contract is busy with another
|
|
10
|
-
case "ContractBusy":
|
|
11
|
-
return { name: decodedError.name, message: `Contract is busy with another tranasction.` };
|
|
9
|
+
return { name: decodedError.name, message: `Contract is busy with another transaction.` };
|
|
12
10
|
case "DepositOnlyERC20":
|
|
13
|
-
return { name: decodedError.name, message: `Only ERC20
|
|
11
|
+
return { name: decodedError.name, message: `Only ERC20 token deposits are allowed.` };
|
|
14
12
|
case "EtherDirectTransferNotAllowed":
|
|
15
|
-
return {
|
|
16
|
-
name: decodedError.name,
|
|
17
|
-
message: `Direct transfer of native token to the contract is not allowed. Please use the deposit methods instead.`
|
|
18
|
-
};
|
|
13
|
+
return { name: decodedError.name, message: `Direct transfer of native token to the contract is not allowed. Please use the deposit methods instead.` };
|
|
19
14
|
case "InvalidSignature":
|
|
20
15
|
return { name: decodedError.name, message: `Transaction signature does not match.` };
|
|
16
|
+
case "InvalidSignatures":
|
|
17
|
+
return { name: decodedError.name, message: `One or more signatures are invalid.` };
|
|
21
18
|
case "InsufficientReserves":
|
|
22
19
|
return { name: decodedError.name, message: `Contract token balance is low.` };
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
case "InsufficientExecutiveSigs": {
|
|
21
|
+
const [required, provided] = decodedError.args;
|
|
22
|
+
return { name: decodedError.name, message: `Insufficient executive signatures. Required: ${required}, provided: ${provided}.` };
|
|
23
|
+
}
|
|
24
|
+
case "InsufficientManagerSigs": {
|
|
25
|
+
const [required, provided] = decodedError.args;
|
|
26
|
+
return { name: decodedError.name, message: `Insufficient manager signatures. Required: ${required}, provided: ${provided}.` };
|
|
27
|
+
}
|
|
26
28
|
case "NotAuthorized":
|
|
27
29
|
return { name: decodedError.name, message: `User is not authorized for this action.` };
|
|
28
30
|
case "NotAdmin":
|
|
@@ -33,19 +35,58 @@ const parseDecodedError = (decodedError) => {
|
|
|
33
35
|
return { name: decodedError.name, message: `Token transfer failed.` };
|
|
34
36
|
case "SignatureAlreadyUsed":
|
|
35
37
|
return { name: decodedError.name, message: `Transaction cannot be repeated.` };
|
|
36
|
-
case "TokenNotAllowed":
|
|
38
|
+
case "TokenNotAllowed": {
|
|
37
39
|
const [tokenAddress] = decodedError.args;
|
|
38
40
|
return { name: decodedError.name, message: `Transfer of token ${tokenAddress} is not allowed.` };
|
|
41
|
+
}
|
|
39
42
|
case "ZeroAddress":
|
|
40
|
-
return { name: decodedError.name, message: `Transfer to the Ethereum
|
|
43
|
+
return { name: decodedError.name, message: `Transfer to the Ethereum zero address is not allowed.` };
|
|
41
44
|
case "ZeroValue":
|
|
42
45
|
return { name: decodedError.name, message: `Token amount cannot be zero.` };
|
|
43
46
|
case "ExceedsMax":
|
|
44
|
-
return { name: decodedError.name, message:
|
|
47
|
+
return { name: decodedError.name, message: `Funding amount exceeded hard limit.` };
|
|
45
48
|
case "ExceedsLimit":
|
|
46
|
-
return { name: decodedError.name, message:
|
|
49
|
+
return { name: decodedError.name, message: `Batch exceeds max limit.` };
|
|
50
|
+
case "InvalidNonce":
|
|
51
|
+
return { name: decodedError.name, message: `Invalid transaction nonce.` };
|
|
52
|
+
case "InvalidOperation":
|
|
53
|
+
return { name: decodedError.name, message: `Operation type is not valid.` };
|
|
54
|
+
case "InvalidConfig":
|
|
55
|
+
return { name: decodedError.name, message: `Contract configuration is invalid.` };
|
|
56
|
+
case "InvalidMultiSig":
|
|
57
|
+
return { name: decodedError.name, message: `Multisig configuration or signatures are invalid.` };
|
|
58
|
+
case "RequireMultiSig":
|
|
59
|
+
return { name: decodedError.name, message: `This operation requires multisig approval.` };
|
|
60
|
+
case "RequireTreasuryReceiverRole":
|
|
61
|
+
return { name: decodedError.name, message: `Receiver address does not have the required treasury receiver role.` };
|
|
62
|
+
case "TimelockConfigGroupNotSet":
|
|
63
|
+
return { name: decodedError.name, message: `Timelock config group is not configured for this escrow.` };
|
|
64
|
+
case "TimelockConfigNotSet":
|
|
65
|
+
return { name: decodedError.name, message: `Timelock configuration is not set.` };
|
|
66
|
+
case "ConfigGroupNotSet":
|
|
67
|
+
return { name: decodedError.name, message: `Configuration group is not set for this escrow.` };
|
|
68
|
+
case "AdminMultisigConfigNotSet":
|
|
69
|
+
return { name: decodedError.name, message: `Admin multisig configuration is not set.` };
|
|
70
|
+
case "MultisigConfigNotSet":
|
|
71
|
+
return { name: decodedError.name, message: `Multisig configuration is not set.` };
|
|
72
|
+
case "TimelockNotExpired": {
|
|
73
|
+
const [unlockAt] = decodedError.args;
|
|
74
|
+
return { name: decodedError.name, message: `Timelock has not expired yet. Unlocks at: ${unlockAt}.` };
|
|
75
|
+
}
|
|
76
|
+
case "CommitmentNotFound": {
|
|
77
|
+
const [commitmentHash] = decodedError.args;
|
|
78
|
+
return { name: decodedError.name, message: `Commitment not found: ${commitmentHash}.` };
|
|
79
|
+
}
|
|
80
|
+
case "AlreadyCreatedTransaction": {
|
|
81
|
+
const [requestId] = decodedError.args;
|
|
82
|
+
return { name: decodedError.name, message: `Transaction already created for request id: ${requestId}.` };
|
|
83
|
+
}
|
|
84
|
+
case "AccountAlreadyHasSignerRole": {
|
|
85
|
+
const [signerAddress] = decodedError.args;
|
|
86
|
+
return { name: decodedError.name, message: `Account ${signerAddress} already has the signer role.` };
|
|
87
|
+
}
|
|
47
88
|
default:
|
|
48
|
-
return { name: "UnknownError", message: "Unexpected error
|
|
89
|
+
return { name: "UnknownError", message: "Unexpected error occurred." };
|
|
49
90
|
}
|
|
50
91
|
};
|
|
51
92
|
exports.parseDecodedError = parseDecodedError;
|
|
@@ -5,7 +5,7 @@ import { OperationType } from "../../../contracts/types/escrow";
|
|
|
5
5
|
import { MarkCompleteScheduleJob, ScheduleTransactionJobWithDetails } from "../../types/db";
|
|
6
6
|
declare class ScheduleTransactionService {
|
|
7
7
|
static get_and_lock_available_jobs: (pool: Pool, limit?: number, job_ttl_s?: number, lock_metadata?: ClaimJobLockMetadata) => Promise<ScheduleTransactionJob[]>;
|
|
8
|
-
/**
|
|
8
|
+
/** Locks and returns available jobs with full withdrawal details via DB function. */
|
|
9
9
|
static get_and_lock_available_jobs_with_details: (pool: Pool, limit?: number, job_ttl_s?: number, lock_metadata?: ClaimJobLockMetadata) => Promise<ScheduleTransactionJobWithDetails[]>;
|
|
10
10
|
/**
|
|
11
11
|
* Requeues all jobs in the given status to "queued"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScheduleTransactionService.d.ts","sourceRoot":"","sources":["../../../../src/services/db/timelock/ScheduleTransactionService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AAE5F,cAAM,0BAA0B;IAE5B,MAAM,CAAC,2BAA2B,GAAU,MAAM,IAAI,EAAE,QAAO,MAAW,EAAE,YAAW,MAAY,EAAE,gBAAe,oBAA0F,KAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC,CA4CjP;IAGD,
|
|
1
|
+
{"version":3,"file":"Schedu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GF,MAAM,CAAC,qCAAqC,GACxC,MAAM,IAAI,EACV,gBAAgB,aAAa,EAC7B,MAAM;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,iBAAiB,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,EAAE,KACzG,OAAO,CAAC,IAAI,CAAC,CA8Bf;IAGD,MAAM,CAAC,0BAA0B,GAC7B,MAAM,IAAI,EACV,MAAM;QAAE,cAAc,EAAE,aAAa,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,IAAI,CAAA;KAAE,EAAE,KAC9F,OAAO,CAAC,IAAI,CAAC,CAwBd;IAGF,MAAM,CAAC,aAAa,GAAU,MAAM,IAAI,EAAE,UAAU,uBAAuB,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CAmB5F;CAEJ;AAED,eAAe,0BAA0B,CAAC"}
|
|
@@ -52,50 +52,11 @@ ScheduleTransactionService.get_and_lock_available_jobs = (pool_1, ...args_1) =>
|
|
|
52
52
|
`, [limit, ttlSeconds, lock_metadata.lock_owner, lock_metadata.lock_reason]);
|
|
53
53
|
return res.rows;
|
|
54
54
|
});
|
|
55
|
-
/**
|
|
55
|
+
/** Locks and returns available jobs with full withdrawal details via DB function. */
|
|
56
56
|
ScheduleTransactionService.get_and_lock_available_jobs_with_details = (pool_1, ...args_1) => __awaiter(void 0, [pool_1, ...args_1], void 0, function* (pool, limit = 10, job_ttl_s = 120, lock_metadata = { lock_owner: "schedule-tx-worker", lock_reason: "process_queued" }) {
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
SELECT
|
|
61
|
-
MAX(CASE WHEN status = 'queued' THEN id END) AS queued_id,
|
|
62
|
-
MAX(CASE WHEN status = 'processing' THEN id END) AS processing_id
|
|
63
|
-
FROM multisig.schedule_job_statuses
|
|
64
|
-
),
|
|
65
|
-
candidates AS (
|
|
66
|
-
SELECT cj.id
|
|
67
|
-
FROM multisig.schedule_transaction_jobs cj, status_ids
|
|
68
|
-
WHERE cj.status_id = status_ids.queued_id
|
|
69
|
-
AND (cj.lock_expires_at IS NULL OR cj.lock_expires_at < now())
|
|
70
|
-
ORDER BY cj.blockchain, cj.chain_id ASC
|
|
71
|
-
LIMIT $1
|
|
72
|
-
FOR UPDATE SKIP LOCKED
|
|
73
|
-
),
|
|
74
|
-
updated AS (
|
|
75
|
-
UPDATE multisig.schedule_transaction_jobs cj
|
|
76
|
-
SET
|
|
77
|
-
status_id = si.processing_id,
|
|
78
|
-
locked_at = now(),
|
|
79
|
-
lock_expires_at = now() + ($2 || ' seconds')::interval,
|
|
80
|
-
metadata = jsonb_set(
|
|
81
|
-
jsonb_set(
|
|
82
|
-
coalesce(cj.metadata, '{}'::jsonb),
|
|
83
|
-
'{lock_owner}',
|
|
84
|
-
to_jsonb($3::text)
|
|
85
|
-
),
|
|
86
|
-
'{lock_reason}',
|
|
87
|
-
to_jsonb($4::text)
|
|
88
|
-
),
|
|
89
|
-
updated_at = now()
|
|
90
|
-
FROM candidates c, status_ids si
|
|
91
|
-
WHERE cj.id = c.id
|
|
92
|
-
RETURNING cj.*
|
|
93
|
-
)
|
|
94
|
-
SELECT u.*, sjs.status, accounting.fn_get_crypto_withdrawal_details(u.request_id) AS withdrawal_details
|
|
95
|
-
FROM updated u
|
|
96
|
-
JOIN multisig.schedule_job_statuses sjs ON sjs.id = u.status_id
|
|
97
|
-
`, [limit, ttlSeconds, lock_metadata.lock_owner, lock_metadata.lock_reason]);
|
|
98
|
-
return res.rows;
|
|
57
|
+
var _b;
|
|
58
|
+
const result = yield pool.query(`SELECT multisig.fn_get_available_schedule_jobs_with_details($1::int, $2::int, $3::text, $4::text)`, [limit, job_ttl_s, lock_metadata.lock_owner, lock_metadata.lock_reason]);
|
|
59
|
+
return (_b = result.rows[0].fn_get_available_schedule_jobs_with_details) !== null && _b !== void 0 ? _b : [];
|
|
99
60
|
});
|
|
100
61
|
/**
|
|
101
62
|
* Requeues all jobs in the given status to "queued"
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import { OperationType } from "../../../contracts/types/escrow";
|
|
2
|
-
import { ScheduleTransactionJob } from "../../../entities/ScheduleTransactionJob";
|
|
3
2
|
import { WithdrawRequestDetails } from "../claim";
|
|
4
3
|
export interface MarkCompleteScheduleJob {
|
|
5
4
|
requestId: number;
|
|
6
5
|
operationType: OperationType;
|
|
7
6
|
}
|
|
8
|
-
export interface ScheduleTransactionJobWithDetails
|
|
9
|
-
|
|
7
|
+
export interface ScheduleTransactionJobWithDetails {
|
|
8
|
+
id: number;
|
|
9
|
+
requestId: number;
|
|
10
|
+
operationType: OperationType;
|
|
11
|
+
status: string;
|
|
12
|
+
blockchain: string;
|
|
13
|
+
chainId: string;
|
|
14
|
+
batchGroupId: string;
|
|
15
|
+
lockExpiresAt: string | null;
|
|
16
|
+
lockedAt: string | null;
|
|
17
|
+
txHash: string | null;
|
|
18
|
+
sentAt: string | null;
|
|
19
|
+
confirmedAt: string | null;
|
|
20
|
+
retryCount: number;
|
|
21
|
+
errorMessage: string | null;
|
|
22
|
+
lastErrorAt: string | null;
|
|
23
|
+
metadata: Record<string, unknown> | null;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
withdrawalDetails: WithdrawRequestDetails | null;
|
|
10
27
|
}
|
|
11
28
|
//# sourceMappingURL=timelock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timelock.d.ts","sourceRoot":"","sources":["../../../../src/services/types/db/timelock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"timelock.d.ts","sourceRoot":"","sources":["../../../../src/services/types/db/timelock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,aAAa,CAAC;CAChC;AAED,MAAM,WAAW,iCAAiC;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACpD"}
|
package/package.json
CHANGED