@ercworldio/blockchain-shared 1.0.2-dev-PROJ-1265.1 → 1.0.2-dev-PROJ-1265.1.fix

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 (142) hide show
  1. package/build/chains/networks_dev copy.json +793 -0
  2. package/build/chains/networks_prod-ab120.json +644 -0
  3. package/build/chains/networks_prod-dz-v1.json +727 -0
  4. package/build/chains/networks_prod-sh.json +645 -0
  5. package/build/chains/networks_prod-yb.json +645 -0
  6. package/build/chains/networks_stg-ab120-mainnet.json +681 -0
  7. package/build/chains/networks_stg-ab120.json +597 -0
  8. package/build/chains/networks_stg-bu-v1.json +635 -0
  9. package/build/chains/networks_stg-yb-v1.json +574 -0
  10. package/build/contracts/typechain-types/contracts/lib/Events.d.ts +394 -0
  11. package/build/contracts/typechain-types/contracts/lib/Events.d.ts.map +1 -0
  12. package/build/contracts/typechain-types/contracts/lib/Events.js +2 -0
  13. package/build/contracts/typechain-types/contracts/lib/MultisigLib.d.ts +21 -0
  14. package/build/contracts/typechain-types/contracts/lib/MultisigLib.d.ts.map +1 -0
  15. package/build/contracts/typechain-types/contracts/lib/MultisigLib.js +2 -0
  16. package/build/contracts/typechain-types/contracts/lib/index.d.ts +3 -0
  17. package/build/contracts/typechain-types/contracts/lib/index.d.ts.map +1 -0
  18. package/build/contracts/typechain-types/contracts/lib/index.js +2 -0
  19. package/build/contracts/typechain-types/contracts/mock/ReentrantReceiver.d.ts +54 -0
  20. package/build/contracts/typechain-types/contracts/mock/ReentrantReceiver.d.ts.map +1 -0
  21. package/build/contracts/typechain-types/contracts/mock/ReentrantReceiver.js +2 -0
  22. package/build/contracts/typechain-types/contracts/mock/SelfDestructForcer.d.ts +26 -0
  23. package/build/contracts/typechain-types/contracts/mock/SelfDestructForcer.d.ts.map +1 -0
  24. package/build/contracts/typechain-types/contracts/mock/SelfDestructForcer.js +2 -0
  25. package/build/contracts/typechain-types/contracts/test/DelegatecallProbe.d.ts +30 -0
  26. package/build/contracts/typechain-types/contracts/test/DelegatecallProbe.d.ts.map +1 -0
  27. package/build/contracts/typechain-types/contracts/test/DelegatecallProbe.js +2 -0
  28. package/build/contracts/typechain-types/contracts/test/index.d.ts +2 -0
  29. package/build/contracts/typechain-types/contracts/test/index.d.ts.map +1 -0
  30. package/build/contracts/typechain-types/contracts/test/index.js +2 -0
  31. package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.d.ts +373 -0
  32. package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.d.ts.map +1 -0
  33. package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.js +474 -0
  34. package/build/contracts/typechain-types/factories/contracts/lib/MultisigLib__factory.d.ts +99 -0
  35. package/build/contracts/typechain-types/factories/contracts/lib/MultisigLib__factory.d.ts.map +1 -0
  36. package/build/contracts/typechain-types/factories/contracts/lib/MultisigLib__factory.js +140 -0
  37. package/build/contracts/typechain-types/factories/contracts/lib/index.d.ts +3 -0
  38. package/build/contracts/typechain-types/factories/contracts/lib/index.d.ts.map +1 -0
  39. package/build/contracts/typechain-types/factories/contracts/lib/index.js +10 -0
  40. package/build/contracts/typechain-types/factories/contracts/mock/ReentrantReceiver__factory.d.ts +112 -0
  41. package/build/contracts/typechain-types/factories/contracts/mock/ReentrantReceiver__factory.d.ts.map +1 -0
  42. package/build/contracts/typechain-types/factories/contracts/mock/ReentrantReceiver__factory.js +156 -0
  43. package/build/contracts/typechain-types/factories/contracts/mock/SelfDestructForcer__factory.d.ts +37 -0
  44. package/build/contracts/typechain-types/factories/contracts/mock/SelfDestructForcer__factory.d.ts.map +1 -0
  45. package/build/contracts/typechain-types/factories/contracts/mock/SelfDestructForcer__factory.js +57 -0
  46. package/build/contracts/typechain-types/factories/contracts/test/DelegatecallProbe__factory.d.ts +55 -0
  47. package/build/contracts/typechain-types/factories/contracts/test/DelegatecallProbe__factory.d.ts.map +1 -0
  48. package/build/contracts/typechain-types/factories/contracts/test/DelegatecallProbe__factory.js +81 -0
  49. package/build/contracts/typechain-types/factories/contracts/test/index.d.ts +2 -0
  50. package/build/contracts/typechain-types/factories/contracts/test/index.d.ts.map +1 -0
  51. package/build/contracts/typechain-types/factories/contracts/test/index.js +8 -0
  52. package/build/entities/AdminOperationThresholds.d.ts +11 -0
  53. package/build/entities/AdminOperationThresholds.d.ts.map +1 -0
  54. package/build/entities/AdminOperationThresholds.js +52 -0
  55. package/build/entities/AdminWithdrawal.d.ts +20 -0
  56. package/build/entities/AdminWithdrawal.d.ts.map +1 -0
  57. package/build/entities/AdminWithdrawal.js +88 -0
  58. package/build/entities/CryptoOperationType.d.ts +18 -0
  59. package/build/entities/CryptoOperationType.d.ts.map +1 -0
  60. package/build/entities/CryptoOperationType.js +50 -0
  61. package/build/entities/EscrowRoles.d.ts +12 -0
  62. package/build/entities/EscrowRoles.d.ts.map +1 -0
  63. package/build/entities/EscrowRoles.js +57 -0
  64. package/build/entities/GlobalTimelock.d.ts +13 -0
  65. package/build/entities/GlobalTimelock.d.ts.map +1 -0
  66. package/build/entities/GlobalTimelock.js +60 -0
  67. package/build/entities/GranularTimelock .d.ts +12 -0
  68. package/build/entities/GranularTimelock .d.ts.map +1 -0
  69. package/build/entities/GranularTimelock .js +56 -0
  70. package/build/entities/GranularTimelock.d.ts +11 -0
  71. package/build/entities/GranularTimelock.d.ts.map +1 -0
  72. package/build/entities/GranularTimelock.js +52 -0
  73. package/build/entities/OperationType.d.ts +18 -0
  74. package/build/entities/OperationType.d.ts.map +1 -0
  75. package/build/entities/OperationType.js +50 -0
  76. package/build/entities/RoleHash.d.ts +11 -0
  77. package/build/entities/RoleHash.d.ts.map +1 -0
  78. package/build/entities/RoleHash.js +52 -0
  79. package/build/entities/ScheduleTransactionJob.d.ts +23 -0
  80. package/build/entities/ScheduleTransactionJob.d.ts.map +1 -0
  81. package/build/entities/ScheduleTransactionJob.js +89 -0
  82. package/build/entities/ScheduleTransactionJobHistory.d.ts +17 -0
  83. package/build/entities/ScheduleTransactionJobHistory.d.ts.map +1 -0
  84. package/build/entities/ScheduleTransactionJobHistory.js +66 -0
  85. package/build/entities/Signatures.d.ts +16 -0
  86. package/build/entities/Signatures.d.ts.map +1 -0
  87. package/build/entities/Signatures.js +72 -0
  88. package/build/entities/TokenExecutionThresholds.d.ts +15 -0
  89. package/build/entities/TokenExecutionThresholds.d.ts.map +1 -0
  90. package/build/entities/TokenExecutionThresholds.js +68 -0
  91. package/build/entities/WithdrawalCommitment.d.ts +15 -0
  92. package/build/entities/WithdrawalCommitment.d.ts.map +1 -0
  93. package/build/entities/WithdrawalCommitment.js +64 -0
  94. package/build/entities/index.d.ts +22 -0
  95. package/build/entities/index.d.ts.map +1 -0
  96. package/build/entities/index.js +37 -0
  97. package/build/services/AccountingService.d.ts +2 -0
  98. package/build/services/AccountingService.d.ts.map +1 -1
  99. package/build/services/AccountingService.js +35 -6
  100. package/build/services/AccountingServiceStatic.d.ts +14 -0
  101. package/build/services/AccountingServiceStatic.d.ts.map +1 -0
  102. package/build/services/AccountingServiceStatic.js +38 -0
  103. package/build/services/ClaimJobServiceStatic.d.ts +9 -0
  104. package/build/services/ClaimJobServiceStatic.d.ts.map +1 -0
  105. package/build/services/ClaimJobServiceStatic.js +54 -0
  106. package/build/services/WithdrawalService.d.ts +10 -0
  107. package/build/services/WithdrawalService.d.ts.map +1 -0
  108. package/build/services/WithdrawalService.js +38 -0
  109. package/build/services/db/multisig/MultisigService.d.ts +31 -0
  110. package/build/services/db/multisig/MultisigService.d.ts.map +1 -0
  111. package/build/services/db/multisig/MultisigService.js +134 -0
  112. package/build/services/db/roles/ContractRoles.d.ts +54 -0
  113. package/build/services/db/roles/ContractRoles.d.ts.map +1 -0
  114. package/build/services/db/roles/ContractRoles.js +87 -0
  115. package/build/services/db/timelock/ScheduleTransactionJobHistoryService.d.ts +14 -0
  116. package/build/services/db/timelock/ScheduleTransactionJobHistoryService.d.ts.map +1 -0
  117. package/build/services/db/timelock/ScheduleTransactionJobHistoryService.js +63 -0
  118. package/build/services/db/timelock/ScheduleTransactionService.d.ts +46 -0
  119. package/build/services/db/timelock/ScheduleTransactionService.d.ts.map +1 -0
  120. package/build/services/db/timelock/ScheduleTransactionService.js +476 -0
  121. package/build/services/rpc/RPC.d.ts +20 -0
  122. package/build/services/rpc/RPC.d.ts.map +1 -0
  123. package/build/services/rpc/RPC.js +49 -0
  124. package/build/services/solana/escrow/services/TreasuryWithdrawalSignature.d.ts +58 -0
  125. package/build/services/solana/escrow/services/TreasuryWithdrawalSignature.d.ts.map +1 -0
  126. package/build/services/solana/escrow/services/TreasuryWithdrawalSignature.js +109 -0
  127. package/build/services/types/db/index.d.ts +3 -0
  128. package/build/services/types/db/index.d.ts.map +1 -0
  129. package/build/services/types/db/index.js +18 -0
  130. package/build/services/types/db/multisig_service.d.ts +154 -0
  131. package/build/services/types/db/multisig_service.d.ts.map +1 -0
  132. package/build/services/types/db/multisig_service.js +2 -0
  133. package/build/services/types/db/timelock.d.ts +84 -0
  134. package/build/services/types/db/timelock.d.ts.map +1 -0
  135. package/build/services/types/db/timelock.js +2 -0
  136. package/build/services/types/db/withdrawal_service.d.ts +16 -0
  137. package/build/services/types/db/withdrawal_service.d.ts.map +1 -0
  138. package/build/services/types/db/withdrawal_service.js +2 -0
  139. package/build/services/types/watchdog.d.ts +9 -0
  140. package/build/services/types/watchdog.d.ts.map +1 -0
  141. package/build/services/types/watchdog.js +2 -0
  142. package/package.json +1 -1
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.buildWithdrawalApprovalMessage = buildWithdrawalApprovalMessage;
7
+ exports.decodeEd25519Signature = decodeEd25519Signature;
8
+ exports.buildTreasuryEd25519Instruction = buildTreasuryEd25519Instruction;
9
+ const web3_js_1 = require("@solana/web3.js");
10
+ const bs58_1 = __importDefault(require("bs58"));
11
+ /**
12
+ * Builds the UTF-8 approval message a treasury signer approves. MUST match the program's
13
+ * `build_withdrawal_message` byte for byte, or verification fails.
14
+ *
15
+ * Withdrawal Approval
16
+ * Version: 1
17
+ * Chain: <chainId>
18
+ * Request: <requestId>
19
+ * Recipient: <recipient base58>
20
+ * Token: <mint base58>
21
+ * Amount: <committed amount, raw base units>
22
+ *
23
+ * `Amount` is the committed (approved) amount — the net paid out is chosen later by the backend
24
+ * and bounded on-chain by TreasuryConfig.max_fee_delta. The title + Version line domain-separate
25
+ * the signature; bump Version in lockstep with the program on any format change.
26
+ */
27
+ function buildWithdrawalApprovalMessage(params) {
28
+ const text = "Withdrawal Approval\n" +
29
+ "Version: 1\n" +
30
+ `Chain: ${params.chainId}\n` +
31
+ `Request: ${params.requestId}\n` +
32
+ `Recipient: ${params.recipient.toBase58()}\n` +
33
+ `Token: ${params.tokenMint.toBase58()}\n` +
34
+ `Amount: ${params.committedAmount}`;
35
+ return Buffer.from(text, "utf8");
36
+ }
37
+ /** Decode a 64-byte Ed25519 signature from base64, hex (0x-optional), or base58. */
38
+ function decodeEd25519Signature(s) {
39
+ const b64 = Buffer.from(s, "base64");
40
+ if (b64.length === 64)
41
+ return b64;
42
+ const hex = s.startsWith("0x") ? s.slice(2) : s;
43
+ if (/^[0-9a-fA-F]{128}$/.test(hex))
44
+ return Buffer.from(hex, "hex");
45
+ try {
46
+ const b58 = bs58_1.default.decode(s);
47
+ if (b58.length === 64)
48
+ return b58;
49
+ }
50
+ catch ( /* fallthrough */_a) { /* fallthrough */ }
51
+ throw new Error("Invalid Ed25519 signature encoding (expected 64 bytes as base64/hex/base58)");
52
+ }
53
+ /**
54
+ * Builds a single Ed25519SigVerify instruction carrying `entries` self-contained signatures
55
+ * (each entry's pubkey, signature and message live in this instruction's own data). This is the
56
+ * compact layout the program scans in `verify_treasury_threshold`; one instruction for the whole
57
+ * batch keeps the transaction far smaller than one instruction per signature.
58
+ *
59
+ * Identical messages are stored ONCE and shared by every signature over them, since the offsets
60
+ * table lets multiple entries point at the same message region. This matters: the N signers who
61
+ * approve one withdrawal all sign the same ~194-byte payload, so without sharing, a 2-of-N
62
+ * approval would spend an extra ~194 bytes and overflow Solana's 1232-byte transaction limit.
63
+ */
64
+ function buildTreasuryEd25519Instruction(entries) {
65
+ const N = entries.length;
66
+ const OFFSETS_SIZE = 14;
67
+ const ENTRY_SIZE = 32 + 64; // pubkey + signature
68
+ const header = 2 + N * OFFSETS_SIZE;
69
+ const msgStart = header + N * ENTRY_SIZE;
70
+ // Deduplicate message blobs by content; remember where each unique one lands.
71
+ const uniqueMessages = [];
72
+ const messageOffsets = [];
73
+ const seen = new Map();
74
+ let cursor = msgStart;
75
+ for (const entry of entries) {
76
+ const key = Buffer.from(entry.message).toString("base64");
77
+ let offset = seen.get(key);
78
+ if (offset === undefined) {
79
+ offset = cursor;
80
+ seen.set(key, offset);
81
+ uniqueMessages.push(entry.message);
82
+ cursor += entry.message.length;
83
+ }
84
+ messageOffsets.push(offset);
85
+ }
86
+ const data = Buffer.alloc(cursor);
87
+ data[0] = N; // number of signatures
88
+ data[1] = 0; // padding
89
+ for (let i = 0; i < N; i++) {
90
+ const base = 2 + i * OFFSETS_SIZE;
91
+ const pkOffset = header + i * ENTRY_SIZE;
92
+ const sigOffset = pkOffset + 32;
93
+ data.writeUInt16LE(sigOffset, base + 0); // signature_offset
94
+ data.writeUInt16LE(0xffff, base + 2); // signature_instruction_index (self)
95
+ data.writeUInt16LE(pkOffset, base + 4); // public_key_offset
96
+ data.writeUInt16LE(0xffff, base + 6); // public_key_instruction_index (self)
97
+ data.writeUInt16LE(messageOffsets[i], base + 8); // message_data_offset (may be shared)
98
+ data.writeUInt16LE(entries[i].message.length, base + 10); // message_data_size
99
+ data.writeUInt16LE(0xffff, base + 12); // message_instruction_index (self)
100
+ data.set(entries[i].publicKey, pkOffset);
101
+ data.set(entries[i].signature, sigOffset);
102
+ }
103
+ // Write each unique message once, at the offset its first referrer recorded.
104
+ for (let i = 0, offset = msgStart; i < uniqueMessages.length; i++) {
105
+ data.set(uniqueMessages[i], offset);
106
+ offset += uniqueMessages[i].length;
107
+ }
108
+ return new web3_js_1.TransactionInstruction({ keys: [], programId: web3_js_1.Ed25519Program.programId, data });
109
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./multisig_service";
2
+ export * from "./timelock";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/types/db/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./multisig_service"), exports);
18
+ __exportStar(require("./timelock"), exports);
@@ -0,0 +1,154 @@
1
+ import { OperationType } from "../../../contracts/types/escrow";
2
+ export interface GetAdminOperationThreshold {
3
+ id: number;
4
+ operationTypeId: number;
5
+ blockchain: string;
6
+ chainId: number;
7
+ escrowAddress: string;
8
+ sigsManager: number;
9
+ sigsExecutive: number;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ }
13
+ export interface UpsertAdminOperationThreshold {
14
+ id: number;
15
+ blockchain: string;
16
+ operationTypeId: OperationType;
17
+ chainId: string;
18
+ escrowAddress: string;
19
+ sigsManager: number;
20
+ sigsExecutive: number;
21
+ }
22
+ export interface GetGlobalTimelock {
23
+ id: number;
24
+ blockchain: string;
25
+ chainId: string;
26
+ escrowAddress: string;
27
+ tokenAddress: string;
28
+ thresholdAmount: number;
29
+ durationBelowSeconds: number;
30
+ durationAboveSeconds: number;
31
+ createdAt: string;
32
+ updatedAt: string;
33
+ }
34
+ export interface UpsertGlobalTimelock {
35
+ id: number;
36
+ blockchain: string;
37
+ chainId: string;
38
+ escrowAddress: string;
39
+ tokenAddress: string;
40
+ thresholdAmount: number;
41
+ durationBelowSeconds: number;
42
+ durationAboveSeconds: number;
43
+ }
44
+ export interface GetGranularTimelock {
45
+ id: number;
46
+ blockchain: string;
47
+ chainId: string;
48
+ escrowAddress: string;
49
+ receiverAddress: string;
50
+ durationSeconds: number;
51
+ createdAt: string;
52
+ updatedAt: string;
53
+ }
54
+ export interface UpsertGranularTimelock {
55
+ id: number;
56
+ blockchain: string;
57
+ chainId: string;
58
+ escrowAddress: string;
59
+ receiverAddress: string;
60
+ durationSeconds: number;
61
+ }
62
+ export interface GetTokenExecutionThreshold {
63
+ id: number;
64
+ blockchain: string;
65
+ chainId: string;
66
+ escrowAddress: string;
67
+ tokenAddress: string;
68
+ thresholdAmount: number;
69
+ sigsExecutiveBelow: number;
70
+ sigsExecutiveAbove: number;
71
+ sigsManagerBelow: number;
72
+ sigsManagerAbove: number;
73
+ createdAt: string;
74
+ updatedAt: string;
75
+ }
76
+ export interface UpsertTokenExecutionThreshold {
77
+ id: number;
78
+ blockchain: string;
79
+ chainId: string;
80
+ escrowAddress: string;
81
+ tokenAddress: string;
82
+ thresholdAmount: number;
83
+ sigsExecutiveBelow: number;
84
+ sigsExecutiveAbove: number;
85
+ sigsManagerBelow: number;
86
+ sigsManagerAbove: number;
87
+ }
88
+ interface WithdrawalCommitment {
89
+ id: number;
90
+ blockchain: string;
91
+ chainId: string;
92
+ escrowContract: string;
93
+ commitmentHash: string;
94
+ requestId: number;
95
+ statusId: number;
96
+ status: string;
97
+ txHash: string | null;
98
+ }
99
+ export interface FnWithdrawalScheduledPayload {
100
+ p_blockchain: string;
101
+ p_chain_id: string;
102
+ p_escrow_contract: string;
103
+ p_commitment_hash: string;
104
+ p_request_id: number;
105
+ p_execute_at: number;
106
+ p_amount: number;
107
+ p_token_address: string;
108
+ p_receiver_address: string;
109
+ p_confirmed: boolean;
110
+ p_caller: string;
111
+ p_sender: string;
112
+ p_tx_hash: string;
113
+ p_timestamp: number;
114
+ p_block_number: number;
115
+ p_gas_used: number;
116
+ }
117
+ export interface FnWithdrawalScheduledResult extends WithdrawalCommitment {
118
+ executeAt: Date | null;
119
+ }
120
+ export interface FnWithdrawalExecutedPayload {
121
+ p_blockchain: string;
122
+ p_chain_id: string;
123
+ p_escrow_contract: string;
124
+ p_commitment_hash: string;
125
+ p_request_id: number;
126
+ p_confirmed: boolean;
127
+ p_caller: string;
128
+ p_sender: string;
129
+ p_tx_hash: string;
130
+ p_timestamp: number;
131
+ p_block_number: number;
132
+ p_gas_used: number;
133
+ }
134
+ export interface FnWithdrawalExecutedResult extends WithdrawalCommitment {
135
+ finalizedAt: Date;
136
+ }
137
+ export interface FnWithdrawalCancelledPayload extends FnWithdrawalExecutedPayload {
138
+ }
139
+ export interface FnWithdrawalCancelledResult extends FnWithdrawalExecutedResult {
140
+ }
141
+ export interface FnGetWithdrawalCommitmentsPayload {
142
+ p_blockchain: string;
143
+ p_chain_id: string;
144
+ p_escrow_contract: string;
145
+ p_status: string;
146
+ }
147
+ export interface FnGetWithdrawalCommitmentsResult extends WithdrawalCommitment {
148
+ finalizedAt: Date | null;
149
+ executeAt: Date | null;
150
+ createdAt: Date | null;
151
+ updatedAt: Date | null;
152
+ }
153
+ export {};
154
+ //# sourceMappingURL=multisig_service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multisig_service.d.ts","sourceRoot":"","sources":["../../../../src/services/types/db/multisig_service.ts"],"names":[],"mappings":"AAAA,OAAO,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ACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACpE,WAAW,EAAE,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,4BAA6B,SAAQ,2BAA2B;CAAI;AACrF,MAAM,WAAW,2BAA4B,SAAQ,0BAA0B;CAAI;AAGnF,MAAM,WAAW,iCAAiC;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gCAAiC,SAAQ,oBAAoB;IAC1E,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,84 @@
1
+ import { OperationType } from "../../../contracts/types/escrow";
2
+ import { WithdrawRequestDetails } from "../claim";
3
+ import { ScheduleJobStatus } from "../../../entities/ScheduleTransactionJob";
4
+ export interface MarkCompleteScheduleJob {
5
+ requestId: number;
6
+ operationType: OperationType;
7
+ }
8
+ /** Filters for listing current schedule-transaction jobs (BO read view). */
9
+ export interface ScheduleJobFilters {
10
+ status?: ScheduleJobStatus;
11
+ blockchain?: string;
12
+ chainId?: string;
13
+ operationType?: OperationType;
14
+ requestId?: number;
15
+ txHash?: string;
16
+ }
17
+ /** A schedule-transaction job row for the BO read view (status resolved to text). */
18
+ export interface ScheduleJobListItem {
19
+ id: number;
20
+ requestId: number;
21
+ operationType: OperationType;
22
+ status: ScheduleJobStatus;
23
+ blockchain: string;
24
+ chainId: string;
25
+ txHash: string | null;
26
+ lockedAt: Date | null;
27
+ lockExpiresAt: Date | null;
28
+ sentAt: Date | null;
29
+ confirmedAt: Date | null;
30
+ retryCount: number;
31
+ errorMessage: string | null;
32
+ lastErrorAt: Date | null;
33
+ metadata: Record<string, unknown> | null;
34
+ createdAt: Date;
35
+ updatedAt: Date;
36
+ receiverAddress: string | null;
37
+ tokenAddress: string | null;
38
+ amount: string | null;
39
+ }
40
+ /** Filters for the schedule-transaction job history (BO read view). */
41
+ export interface ScheduleJobHistoryFilters {
42
+ jobId?: number;
43
+ requestId?: number;
44
+ operationType?: OperationType;
45
+ status?: ScheduleJobStatus;
46
+ blockchain?: string;
47
+ chainId?: string;
48
+ }
49
+ /** A schedule-transaction job history row for the BO read view. */
50
+ export interface ScheduleJobHistoryItem {
51
+ id: number;
52
+ jobId: number;
53
+ requestId: number;
54
+ operationType: OperationType;
55
+ status: ScheduleJobStatus;
56
+ blockchain: string;
57
+ chainId: string;
58
+ txHash: string | null;
59
+ retryCount: number;
60
+ errorMessage: string | null;
61
+ createdAt: Date;
62
+ }
63
+ export interface ScheduleTransactionJobWithDetails {
64
+ id: number;
65
+ requestId: number;
66
+ operationType: OperationType;
67
+ status: string;
68
+ blockchain: string;
69
+ chainId: string;
70
+ batchGroupId: string;
71
+ lockExpiresAt: string | null;
72
+ lockedAt: string | null;
73
+ txHash: string | null;
74
+ sentAt: string | null;
75
+ confirmedAt: string | null;
76
+ retryCount: number;
77
+ errorMessage: string | null;
78
+ lastErrorAt: string | null;
79
+ metadata: Record<string, unknown> | null;
80
+ createdAt: string;
81
+ updatedAt: string;
82
+ withdrawalDetails: WithdrawRequestDetails | null;
83
+ }
84
+ //# sourceMappingURL=timelock.d.ts.map
@@ -0,0 +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,UAAU,CAAC;AAClD,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AC;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"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ export interface WithdrawalCommitment {
2
+ id: number;
3
+ blockchain: string;
4
+ chainId: string;
5
+ escrowContract: string;
6
+ commitmentHash: string;
7
+ requestId: number;
8
+ statusId: number;
9
+ status: string;
10
+ txHash: string | null;
11
+ finalizedAt: Date | null;
12
+ executeAt: Date;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ }
16
+ //# sourceMappingURL=withdrawal_service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawal_service.d.ts","sourceRoot":"","sources":["../../../../src/services/types/db/withdrawal_service.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export interface RequeueJobConfiguration<T> {
2
+ watch_status: T;
3
+ freeze_ttl_seconds: number;
4
+ limit: number;
5
+ lock_owner: string;
6
+ lock_reason: string;
7
+ max_retries: number;
8
+ }
9
+ //# sourceMappingURL=watchdog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../../src/services/types/watchdog.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACtC,YAAY,EAAE,CAAC,CAAC;IAChB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ercworldio/blockchain-shared",
3
- "version": "1.0.2-dev-PROJ-1265.1",
3
+ "version": "1.0.2-dev-PROJ-1265.1.fix",
4
4
  "description": "Shared library for blockchain projects",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",