@ercworldio/blockchain-shared 1.0.3-dev.3-PROJ-1296.25 → 1.0.3-dev.3-PROJ-1296.26

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.
@@ -48,7 +48,16 @@
48
48
  "type": "Escrow",
49
49
  "version": "1",
50
50
  "startingBlock": 24496423,
51
- "escrowAlchemyWebhooks": [],
51
+ "escrowAlchemyWebhooks": [
52
+ {
53
+ "chainId": "1",
54
+ "network_symbol": "eth",
55
+ "network": "ETH_MAINNET",
56
+ "type": "GRAPHQL",
57
+ "endpoint": "webhook/alchemy/escrow-events",
58
+ "source": "contract"
59
+ }
60
+ ],
52
61
  "addresses": [
53
62
  "0xB28BE79Ffe7CC1f352a8EFF3E3E8f4faFD05a881"
54
63
  ]
@@ -157,7 +166,16 @@
157
166
  "type": "Escrow",
158
167
  "version": "1",
159
168
  "startingBlock": 82263026,
160
- "escrowAlchemyWebhooks": [],
169
+ "escrowAlchemyWebhooks": [
170
+ {
171
+ "chainId": "56",
172
+ "network_symbol": "bnb",
173
+ "network": "BNB_MAINNET",
174
+ "type": "GRAPHQL",
175
+ "endpoint": "webhook/alchemy/escrow-events",
176
+ "source": "contract"
177
+ }
178
+ ],
161
179
  "addresses": [
162
180
  "0xa4f0f80b1f4b2dBDD7cE553342Ad5542ba7758Ec"
163
181
  ]
@@ -357,7 +375,16 @@
357
375
  "type": "Escrow",
358
376
  "version": "1",
359
377
  "startingBlock": 82937871,
360
- "escrowAlchemyWebhooks": [],
378
+ "escrowAlchemyWebhooks": [
379
+ {
380
+ "chainId": "137",
381
+ "network_symbol": "pol",
382
+ "network": "MATIC_MAINNET",
383
+ "type": "GRAPHQL",
384
+ "endpoint": "webhook/alchemy/escrow-events",
385
+ "source": "contract"
386
+ }
387
+ ],
361
388
  "addresses": [
362
389
  "0x0074D8ed3168bEF415337064670e0bf90981A1F5"
363
390
  ]
@@ -452,7 +479,16 @@
452
479
  "type": "Escrow",
453
480
  "version": "1",
454
481
  "startingBlock": 78523433,
455
- "escrowAlchemyWebhooks": [],
482
+ "escrowAlchemyWebhooks": [
483
+ {
484
+ "chainId": "43114",
485
+ "network_symbol": "avax",
486
+ "network": "AVAX_MAINNET",
487
+ "type": "GRAPHQL",
488
+ "endpoint": "webhook/alchemy/escrow-events",
489
+ "source": "contract"
490
+ }
491
+ ],
456
492
  "addresses": [
457
493
  "0x28DE9CeCd83D9b20Ee6A438d39114Add08ED5FF7"
458
494
  ]
@@ -48,7 +48,16 @@
48
48
  "type": "Escrow",
49
49
  "version": "1",
50
50
  "startingBlock": 24754256,
51
- "escrowAlchemyWebhooks": [],
51
+ "escrowAlchemyWebhooks": [
52
+ {
53
+ "chainId": "1",
54
+ "network_symbol": "eth",
55
+ "network": "ETH_MAINNET",
56
+ "type": "GRAPHQL",
57
+ "endpoint": "webhook/alchemy/escrow-events",
58
+ "source": "contract"
59
+ }
60
+ ],
52
61
  "addresses": [
53
62
  "0xBC88D756b866854C02410c8d3e62E5648279dc70"
54
63
  ]
@@ -157,7 +166,16 @@
157
166
  "type": "Escrow",
158
167
  "version": "1",
159
168
  "startingBlock": 89178576,
160
- "escrowAlchemyWebhooks": [],
169
+ "escrowAlchemyWebhooks": [
170
+ {
171
+ "chainId": "56",
172
+ "network_symbol": "bnb",
173
+ "network": "BNB_MAINNET",
174
+ "type": "GRAPHQL",
175
+ "endpoint": "webhook/alchemy/escrow-events",
176
+ "source": "contract"
177
+ }
178
+ ],
161
179
  "addresses": [
162
180
  "0x0074D8ed3168bEF415337064670e0bf90981A1F5"
163
181
  ]
@@ -357,7 +375,16 @@
357
375
  "type": "Escrow",
358
376
  "version": "1",
359
377
  "startingBlock": 84779780,
360
- "escrowAlchemyWebhooks": [],
378
+ "escrowAlchemyWebhooks": [
379
+ {
380
+ "chainId": "137",
381
+ "network_symbol": "pol",
382
+ "network": "MATIC_MAINNET",
383
+ "type": "GRAPHQL",
384
+ "endpoint": "webhook/alchemy/escrow-events",
385
+ "source": "contract"
386
+ }
387
+ ],
361
388
  "addresses": [
362
389
  "0x251824258e218293d79036Be1423388bf3476Ef4"
363
390
  ]
@@ -452,7 +479,16 @@
452
479
  "type": "Escrow",
453
480
  "version": "1",
454
481
  "startingBlock": 81474572,
455
- "escrowAlchemyWebhooks": [],
482
+ "escrowAlchemyWebhooks": [
483
+ {
484
+ "chainId": "43114",
485
+ "network_symbol": "avax",
486
+ "network": "AVAX_MAINNET",
487
+ "type": "GRAPHQL",
488
+ "endpoint": "webhook/alchemy/escrow-events",
489
+ "source": "contract"
490
+ }
491
+ ],
456
492
  "addresses": [
457
493
  "0x6d47B7230F5D466677795E271db3aEE4C59c0B47"
458
494
  ]
@@ -74,6 +74,7 @@ export declare const ErrorMessages: {
74
74
  readonly UNDEFINED_DESTINATION_DETAILS: "Lightning withdrawal has no destination payment details";
75
75
  readonly UNDEFINED_WITHDRAWAL_TOKEN: "Token address does not exist in withdraw request";
76
76
  readonly MISSING_WITHDRAWAL_DETAILS: "Withdraw request details is missing";
77
+ readonly REQUEST_ALREADY_FULFILLED: "Withdraw request is already fulfilled";
77
78
  };
78
79
  export declare const ErrorCodes: {
79
80
  readonly INTERNAL_SERVER: "error.internal_server_error";
@@ -144,6 +145,7 @@ export declare const ErrorCodes: {
144
145
  readonly UNDEFINED_DESTINATION_DETAILS: "error.undefined_destination_details";
145
146
  readonly UNDEFINED_WITHDRAWAL_TOKEN: "error.undefined_withdrawawal_token";
146
147
  readonly MISSING_WITHDRAWAL_DETAILS: "error.invalid_withdraw_request";
148
+ readonly REQUEST_ALREADY_FULFILLED: "error.request_already_fulfilled";
147
149
  };
148
150
  export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
149
151
  export interface ErrorCodeEntry {
@@ -238,6 +240,7 @@ declare class BaseErrors {
238
240
  MissingWithdrawDetails(): "Withdraw request details is missing";
239
241
  UndefinedWithdrawalToken(): "Token address does not exist in withdraw request";
240
242
  UndefinedDestinationDetails(): "Lightning withdrawal has no destination payment details";
243
+ RequestAlreadyFulfilled(): "Withdraw request is already fulfilled";
241
244
  /** Handler methods */
242
245
  handle_error: (error: any, source_method: string) => ErrorHandlerResponse;
243
246
  get_error_code_base: (message: string) => ErrorCodeEntry | null;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors/errors.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqFtB,2BAA2B;;;;IAK3B,sBAAsB;;;;;;;;;;;;;;;;;;;CA0BhB,CAAC;AAEX,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFb,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEnE,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,CAAC;CACzB;AAED,UAAU,oBAAoB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,cAAc,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,cAAc;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,UAAU,EAAE,SAAS,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACjB;AAGD,cAAM,UAAU;IACL,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQX;IAED,yDAAyD;IAClD,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG;IACpB,gBAAgB,CAAC,CAAC,CAAC,EAAE,GAAG;IACxB,YAAY,CAAC,CAAC,CAAC,EAA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YAAY,GAAI,OAAO,GAAG,EAAE,eAAe,MAAM,KAAG,oBAAoB,CAuB9E;IAEM,mBAAmB,GAAI,SAAS,MAAM,KAAG,cAAc,GAAG,IAAI,CA8CpE;CACJ;AAED,eAAe,UAAU,CAAC"}
@@ -113,6 +113,7 @@ exports.ErrorMessages = {
113
113
  UNDEFINED_DESTINATION_DETAILS: `Lightning withdrawal has no destination payment details`,
114
114
  UNDEFINED_WITHDRAWAL_TOKEN: `Token address does not exist in withdraw request`,
115
115
  MISSING_WITHDRAWAL_DETAILS: `Withdraw request details is missing`,
116
+ REQUEST_ALREADY_FULFILLED: `Withdraw request is already fulfilled`,
116
117
  };
117
118
  exports.ErrorCodes = {
118
119
  INTERNAL_SERVER: 'error.internal_server_error',
@@ -190,6 +191,7 @@ exports.ErrorCodes = {
190
191
  UNDEFINED_DESTINATION_DETAILS: `error.undefined_destination_details`,
191
192
  UNDEFINED_WITHDRAWAL_TOKEN: `error.undefined_withdrawawal_token`,
192
193
  MISSING_WITHDRAWAL_DETAILS: `error.invalid_withdraw_request`,
194
+ REQUEST_ALREADY_FULFILLED: `error.request_already_fulfilled`,
193
195
  };
194
196
  class BaseErrors {
195
197
  constructor() {
@@ -313,6 +315,8 @@ class BaseErrors {
313
315
  return Object.assign(Object.assign({}, this.codes[500]), { error_code: exports.ErrorCodes.UNDEFINED_WITHDRAWAL_TOKEN });
314
316
  if (message.includes(exports.ErrorMessages.MISSING_WITHDRAWAL_DETAILS))
315
317
  return Object.assign(Object.assign({}, this.codes[500]), { error_code: exports.ErrorCodes.MISSING_WITHDRAWAL_DETAILS });
318
+ if (message.includes(exports.ErrorMessages.REQUEST_ALREADY_FULFILLED))
319
+ return Object.assign(Object.assign({}, this.codes[500]), { error_code: exports.ErrorCodes.REQUEST_ALREADY_FULFILLED });
316
320
  return null;
317
321
  };
318
322
  }
@@ -400,5 +404,8 @@ class BaseErrors {
400
404
  UndefinedWithdrawalToken() { return exports.ErrorMessages.UNDEFINED_WITHDRAWAL_TOKEN; }
401
405
  ;
402
406
  UndefinedDestinationDetails() { return exports.ErrorMessages.UNDEFINED_DESTINATION_DETAILS; }
407
+ ;
408
+ RequestAlreadyFulfilled() { return exports.ErrorMessages.REQUEST_ALREADY_FULFILLED; }
409
+ ;
403
410
  }
404
411
  exports.default = BaseErrors;
@@ -19,7 +19,13 @@ declare class ScheduleTransactionService {
19
19
  */
20
20
  static requeue_expired_jobs: (pool: Pool, current_status: ScheduleJobStatus, limit: number, lock_owner: string, lock_reason: string, max_retries: number) => Promise<ScheduleTransactionJob[]>;
21
21
  static batch_update_status: (pool: Pool, operation_type: OperationType, request_ids: number[], new_status: ScheduleJobStatus) => Promise<void>;
22
- static batch_update_failed_jobs: (pool: Pool, request_ids: number[], new_status: ScheduleJobStatus, error_message?: string, retryable?: boolean) => Promise<void>;
22
+ static batch_update_failed_jobs: (pool: Pool, operation_type: OperationType, request_ids: number[], new_status: ScheduleJobStatus, error_message?: string, retryable?: boolean) => Promise<void>;
23
+ static batch_update_failed_jobs_custom_error: (pool: Pool, operation_type: OperationType, jobs: {
24
+ request_id: number;
25
+ new_status: ScheduleJobStatus;
26
+ error_message: string;
27
+ retryable: boolean;
28
+ }[]) => Promise<void>;
23
29
  static batch_update_executed_jobs: (pool: Pool, data: {
24
30
  operation_type: OperationType;
25
31
  request_id: number;
@@ -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,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qC,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,CA6Bf;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,CAyBd;IAKF,MAAM,CAAC,aAAa,GAAU,MAAM,IAAI,EAAE,UAAU,uBAAuB,EAAE,mBAuB5E;CAGJ;AAED,eAAe,0BAA0B,CAAC"}
@@ -146,7 +146,7 @@ ScheduleTransactionService.batch_update_status = (pool, operation_type, request_
146
146
  `, [status, operation_type, request_ids]);
147
147
  return;
148
148
  });
149
- ScheduleTransactionService.batch_update_failed_jobs = (pool, request_ids, new_status, error_message, retryable) => __awaiter(void 0, void 0, void 0, function* () {
149
+ ScheduleTransactionService.batch_update_failed_jobs = (pool, operation_type, request_ids, new_status, error_message, retryable) => __awaiter(void 0, void 0, void 0, function* () {
150
150
  yield pool.query(`
151
151
  UPDATE multisig.schedule_transaction_jobs
152
152
  SET
@@ -161,14 +161,41 @@ ScheduleTransactionService.batch_update_failed_jobs = (pool, request_ids, new_st
161
161
  WHEN $3 = true THEN retry_count + 1
162
162
  ELSE retry_count
163
163
  END
164
- WHERE request_id = ANY($4)
164
+ WHERE operation_type = $5 AND request_id = ANY($4)
165
165
  `, [
166
166
  new_status,
167
167
  error_message || null,
168
168
  retryable === true,
169
- request_ids
169
+ request_ids,
170
+ operation_type
170
171
  ]);
171
172
  });
173
+ ScheduleTransactionService.batch_update_failed_jobs_custom_error = (pool, operation_type, jobs) => __awaiter(void 0, void 0, void 0, function* () {
174
+ const operationTypes = jobs.map(() => operation_type);
175
+ const requestIds = jobs.map(j => j.request_id);
176
+ const newStatuses = jobs.map(j => j.new_status);
177
+ const errorMessages = jobs.map(j => j.error_message);
178
+ const retryables = jobs.map(j => j.retryable);
179
+ yield pool.query(`
180
+ UPDATE multisig.schedule_transaction_jobs AS t
181
+ SET
182
+ status = c.status,
183
+ error_message = c.error_message,
184
+ last_error_at = CURRENT_TIMESTAMP,
185
+ retry_count = CASE WHEN c.retryable THEN t.retry_count + 1 ELSE t.retry_count END,
186
+ updated_at = CURRENT_TIMESTAMP
187
+ FROM (
188
+ SELECT
189
+ UNNEST($1::int[]) AS operation_type,
190
+ UNNEST($2::int[]) AS request_id,
191
+ UNNEST($3::text[]) AS status,
192
+ UNNEST($4::text[]) AS error_message,
193
+ UNNEST($5::boolean[]) AS retryable
194
+ ) AS c
195
+ WHERE t.operation_type = c.operation_type
196
+ AND t.request_id = c.request_id
197
+ `, [operationTypes, requestIds, newStatuses, errorMessages, retryables]);
198
+ });
172
199
  ScheduleTransactionService.batch_update_executed_jobs = (pool, data) => __awaiter(void 0, void 0, void 0, function* () {
173
200
  const requestIds = data.map(d => d.request_id);
174
201
  const operationTypes = data.map(d => d.operation_type);
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.25",
3
+ "version": "1.0.3-dev.3-PROJ-1296.26",
4
4
  "description": "Shared library for blockchain projects",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",