@ercworldio/blockchain-shared 1.0.5-dev.8-PLAT134.2 → 1.0.5-dev.8-PLAT134.6
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/chains/networks_dev.json +0 -10
- package/build/chains/networks_prod-bu.json +14 -0
- package/build/chains/networks_prod-dz.json +1 -22
- package/build/contracts/artifacts/Escrow.json +0 -13
- package/build/contracts/contract-events/EscrowEvents.d.ts +2 -16
- package/build/contracts/contract-events/EscrowEvents.d.ts.map +1 -1
- package/build/contracts/contract-events/EscrowEvents.js +0 -5
- package/build/contracts/contract-events/types/events.d.ts +1 -5
- package/build/contracts/contract-events/types/events.d.ts.map +1 -1
- package/build/contracts/typechain-types/contracts/escrow/Escrow.d.ts +1 -15
- package/build/contracts/typechain-types/contracts/escrow/Escrow.d.ts.map +1 -1
- package/build/contracts/typechain-types/contracts/lib/Events.d.ts +1 -15
- package/build/contracts/typechain-types/contracts/lib/Events.d.ts.map +1 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.d.ts +1 -11
- package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.d.ts.map +1 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.js +1 -14
- package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.d.ts +1 -11
- package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.d.ts.map +1 -1
- package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.js +1 -14
- package/build/index.d.ts +0 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -4
- package/build/services/AlchemyService.d.ts.map +1 -1
- package/build/services/AlchemyService.js +3 -2
- package/build/services/AzureEventHubHandler.d.ts.map +1 -1
- package/build/services/AzureEventHubHandler.js +1 -4
- package/build/services/ClaimJobService.d.ts.map +1 -1
- package/build/services/ClaimJobService.js +5 -12
- package/build/services/Redis.js +2 -2
- package/build/services/RedisPubSub.js +1 -1
- package/build/services/db/timelock/ScheduleTransactionService.d.ts +2 -16
- package/build/services/db/timelock/ScheduleTransactionService.d.ts.map +1 -1
- package/build/services/db/timelock/ScheduleTransactionService.js +1 -265
- package/build/services/solana/escrow/idl/escrow.json +1206 -32
- package/build/services/solana/escrow/types/escrow.d.ts +1205 -31
- package/build/services/solana/escrow/types/escrow.d.ts.map +1 -1
- package/build/services/types/azure_event_hub_handler.d.ts +1 -3
- package/build/services/types/azure_event_hub_handler.d.ts.map +1 -1
- package/build/services/types/azure_event_hub_handler.js +0 -3
- package/build/services/types/claim.d.ts +0 -1
- package/build/services/types/claim.d.ts.map +1 -1
- package/build/services/types/db/timelock.d.ts +0 -56
- package/build/services/types/db/timelock.d.ts.map +1 -1
- package/build/utils/solana.d.ts.map +1 -1
- package/build/utils/solana.js +3 -5
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ export declare class Events__factory extends ContractFactory {
|
|
|
14
14
|
deploymentTransaction(): ContractTransactionResponse;
|
|
15
15
|
}>;
|
|
16
16
|
connect(runner: ContractRunner | null): Events__factory;
|
|
17
|
-
static readonly bytecode = "
|
|
17
|
+
static readonly bytecode = "0x6080806040523460175760399081601c823930815050f35b5f80fdfe5f80fdfea26469706673582212204136e6da03e26851e6e0de3252d2833ac0aede7f166b6316294b30b014b0c09464736f6c634300081c0033";
|
|
18
18
|
static readonly abi: readonly [{
|
|
19
19
|
readonly anonymous: false;
|
|
20
20
|
readonly inputs: readonly [{
|
|
@@ -175,16 +175,6 @@ export declare class Events__factory extends ContractFactory {
|
|
|
175
175
|
}];
|
|
176
176
|
readonly name: "LowReserves";
|
|
177
177
|
readonly type: "event";
|
|
178
|
-
}, {
|
|
179
|
-
readonly anonymous: false;
|
|
180
|
-
readonly inputs: readonly [{
|
|
181
|
-
readonly indexed: false;
|
|
182
|
-
readonly internalType: "uint256";
|
|
183
|
-
readonly name: "amount";
|
|
184
|
-
readonly type: "uint256";
|
|
185
|
-
}];
|
|
186
|
-
readonly name: "SetMaxFunding";
|
|
187
|
-
readonly type: "event";
|
|
188
178
|
}, {
|
|
189
179
|
readonly anonymous: false;
|
|
190
180
|
readonly inputs: readonly [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Events__factory.d.ts","sourceRoot":"","sources":["../../../../../../src/contracts/typechain-types/factories/contracts/lib/Events__factory.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,eAAe,EACf,2BAA2B,EAE5B,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAE,MAAM,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"Events__factory.d.ts","sourceRoot":"","sources":["../../../../../../src/contracts/typechain-types/factories/contracts/lib/Events__factory.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,eAAe,EACf,2BAA2B,EAE5B,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAE,MAAM,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA8a7E,KAAK,uBAAuB,GACxB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GACjB,qBAAqB,CAAC,OAAO,eAAe,CAAC,CAAC;AAMlD,qBAAa,eAAgB,SAAQ,eAAe;gBACtC,GAAG,IAAI,EAAE,uBAAuB;IAQnC,oBAAoB,CAC3B,SAAS,CAAC,EAAE,mBAAmB,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC,yBAAyB,CAAC;IAG5B,MAAM,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GACzB,OAAO,CAC7C,MAAM,GAAG;QACP,qBAAqB,IAAI,2BAA2B,CAAC;KACtD,CACF;IAEM,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,eAAe;IAIhE,MAAM,CAAC,QAAQ,CAAC,QAAQ,kLAAa;IACrC,MAAM,CAAC,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAQ;IAC3B,MAAM,CAAC,eAAe,IAAI,eAAe;IAGzC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,MAAM;CAGxE"}
|
|
@@ -204,19 +204,6 @@ const _abi = [
|
|
|
204
204
|
name: "LowReserves",
|
|
205
205
|
type: "event",
|
|
206
206
|
},
|
|
207
|
-
{
|
|
208
|
-
anonymous: false,
|
|
209
|
-
inputs: [
|
|
210
|
-
{
|
|
211
|
-
indexed: false,
|
|
212
|
-
internalType: "uint256",
|
|
213
|
-
name: "amount",
|
|
214
|
-
type: "uint256",
|
|
215
|
-
},
|
|
216
|
-
],
|
|
217
|
-
name: "SetMaxFunding",
|
|
218
|
-
type: "event",
|
|
219
|
-
},
|
|
220
207
|
{
|
|
221
208
|
anonymous: false,
|
|
222
209
|
inputs: [
|
|
@@ -442,7 +429,7 @@ const _abi = [
|
|
|
442
429
|
type: "event",
|
|
443
430
|
},
|
|
444
431
|
];
|
|
445
|
-
const _bytecode = "
|
|
432
|
+
const _bytecode = "0x6080806040523460175760399081601c823930815050f35b5f80fdfe5f80fdfea26469706673582212204136e6da03e26851e6e0de3252d2833ac0aede7f166b6316294b30b014b0c09464736f6c634300081c0033";
|
|
446
433
|
const isSuperArgs = (xs) => xs.length > 1;
|
|
447
434
|
class Events__factory extends ethers_1.ContractFactory {
|
|
448
435
|
constructor(...args) {
|
package/build/index.d.ts
CHANGED
|
@@ -28,7 +28,6 @@ export { default as RedisQueue } from './services/RedisQueue';
|
|
|
28
28
|
export { default as RedisListQueue } from './services/RedisListQueue';
|
|
29
29
|
export { default as RedisPubSub } from './services/RedisPubSub';
|
|
30
30
|
export { default as RpcLimiter } from "./utils/RpcLimiter";
|
|
31
|
-
export { default as RPCManager } from "./services/rpc/RPC";
|
|
32
31
|
export { default as TimerManager } from './services/TimerManager';
|
|
33
32
|
export { default as TronSigner } from './services/tron/services/TronSigner';
|
|
34
33
|
export { default as TronTransaction } from './services/tron/services/Transactions';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,O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,OAAO,IAAI,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAEnF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAChF,cAAc,uCAAuC,CAAC;AACtD,cAAc,yBAAyB,CAAC;AAIxC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAG/I,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGtD,cAAc,cAAc,CAAC;AAG7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -40,8 +40,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
40
40
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
41
|
};
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.WithdrawalService = exports.WithdrawalManager = exports.WalletManagerHelper = exports.WalletManager = exports.WalletIndexService = exports.SweepHistoryService = exports.SweepJobService = exports.StorageService = exports.ProviderManager = exports.Provider = exports.ScheduleTransactionJobHistoryService = exports.ScheduleTransactionService = exports.TronFundingWallet = exports.TronCustodialWallet = exports.TronHotWallet = exports.TronHelper = exports.TronTransaction = exports.TronSigner = exports.TimerManager = exports.
|
|
44
|
-
exports.AppErrors = exports.EscrowIdl = exports.CoverageInfo = exports.EscrowEvents = exports.Erc20Events = exports.AccessControlEvents = exports.ERC20Abi = exports.ErrorAbi = exports.EscrowAbi = exports.ERC20MockAbi = exports.BaseErrors = exports.VoltageErrors = exports.AlchemyErrors = exports.WalletErrors = exports.DatabaseErrors = exports.BalanceErrors = exports.AdminErrors = exports.TransactionsErrors = exports.EscrowInteraction = exports.QnWebhookAddressManager = exports.SetupNotifications = exports.QnNotificationsApi = exports.QuicknodeWebhookSignature =
|
|
43
|
+
exports.Worker = exports.WithdrawalService = exports.WithdrawalManager = exports.WalletManagerHelper = exports.WalletManager = exports.WalletIndexService = exports.SweepHistoryService = exports.SweepJobService = exports.StorageService = exports.ProviderManager = exports.Provider = exports.ScheduleTransactionJobHistoryService = exports.ScheduleTransactionService = exports.TronFundingWallet = exports.TronCustodialWallet = exports.TronHotWallet = exports.TronHelper = exports.TronTransaction = exports.TronSigner = exports.TimerManager = exports.RpcLimiter = exports.RedisPubSub = exports.RedisListQueue = exports.RedisQueue = exports.Redis = exports.MultisigService = exports.MemoryMonitor = exports.Logger = exports.KeyVaultHandler = exports.InvoiceQueue = exports.EscrowService = exports.EventsService = exports.EventsHandler = exports.ElasticSearch = exports.DepositAddressArchiveService = exports.DepositAddressService = exports.ClaimJobServiceStatic = exports.ClaimJobService = exports.ClaimHistoryService = exports.ContractRoles = exports.ChainManager = exports.BalanceService = exports.AlchemyWebhookSignature = exports.AlchemyWebhooks = exports.AlchemyWebhookAddressManager = exports.AlchemyService = exports.AccountingService = exports.AzureEventHubHandler = exports.AsyncTTLCache = exports.AsyncRateLimiter = void 0;
|
|
44
|
+
exports.AppErrors = exports.EscrowIdl = exports.CoverageInfo = exports.EscrowEvents = exports.Erc20Events = exports.AccessControlEvents = exports.ERC20Abi = exports.ErrorAbi = exports.EscrowAbi = exports.ERC20MockAbi = exports.BaseErrors = exports.VoltageErrors = exports.AlchemyErrors = exports.WalletErrors = exports.DatabaseErrors = exports.BalanceErrors = exports.AdminErrors = exports.TransactionsErrors = exports.EscrowInteraction = exports.QnWebhookAddressManager = exports.SetupNotifications = exports.QnNotificationsApi = exports.QuicknodeWebhookSignature = void 0;
|
|
45
45
|
// Services
|
|
46
46
|
var AsyncRateLimiter_1 = require("./utils/AsyncRateLimiter");
|
|
47
47
|
Object.defineProperty(exports, "AsyncRateLimiter", { enumerable: true, get: function () { return __importDefault(AsyncRateLimiter_1).default; } });
|
|
@@ -102,8 +102,6 @@ var RedisPubSub_1 = require("./services/RedisPubSub");
|
|
|
102
102
|
Object.defineProperty(exports, "RedisPubSub", { enumerable: true, get: function () { return __importDefault(RedisPubSub_1).default; } });
|
|
103
103
|
var RpcLimiter_1 = require("./utils/RpcLimiter");
|
|
104
104
|
Object.defineProperty(exports, "RpcLimiter", { enumerable: true, get: function () { return __importDefault(RpcLimiter_1).default; } });
|
|
105
|
-
var RPC_1 = require("./services/rpc/RPC");
|
|
106
|
-
Object.defineProperty(exports, "RPCManager", { enumerable: true, get: function () { return __importDefault(RPC_1).default; } });
|
|
107
105
|
var TimerManager_1 = require("./services/TimerManager");
|
|
108
106
|
Object.defineProperty(exports, "TimerManager", { enumerable: true, get: function () { return __importDefault(TimerManager_1).default; } });
|
|
109
107
|
var TronSigner_1 = require("./services/tron/services/TronSigner");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlchemyService.d.ts","sourceRoot":"","sources":["../../src/services/AlchemyService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EACH,yBAAyB,EAEzB,yBAAyB,EACzB,oBAAoB,EAEpB,oBAAoB,EACpB,6BAA6B,EAC7B,8BAA8B,EAI9B,8BAA8B,EAC9B,uBAAuB,EACvB,0BAA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,EAAE,SAAS,uBAAuB,KAAG,OAAO,CAAC,OAAO,CAAC,CAK7H;IAEM,oBAAoB,GAAU,cAAc,yBAAyB,EAAE,SAAS,yBAAyB,KAAG,OAAO,CAAC,OAAO,CAAC,CAIlI;IACM,qBAAqB,GAAU,cAAc,yBAAyB,EAAE,SAAS,0BAA0B,KAAG,OAAO,CAAC,WAAW,CAAC,CAKxI;IACM,cAAc,GAAU,cAAc,yBAAyB,EAAE,SAAS,oBAAoB,KAAG,OAAO,CAAC,OAAO,CAAC,CAKvH;IACD,OAAO,CAAC,IAAI,CA+CX;CACJ;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -56,6 +56,7 @@ class AlchemyService {
|
|
|
56
56
|
this.logger.info(`${all_webhooks.length} webhooks available in subscription: ${subscription}`);
|
|
57
57
|
const address_activity_webhooks = all_webhooks.filter(w => w.webhook_type === "ADDRESS_ACTIVITY" && w.webhook_url.includes(`address-activity`) && w.webhook_url.includes(subscription));
|
|
58
58
|
this.logger.info(`Found ${address_activity_webhooks.length} ADDRESS_ACTIVITY webhooks`);
|
|
59
|
+
this.logger.info(`ADDRESS_ACTIVITY webhooks`, { address_activity_webhooks });
|
|
59
60
|
const webhook_ids = address_activity_webhooks.map((webhook) => webhook.id);
|
|
60
61
|
const promises = yield Promise.allSettled(webhook_ids.map((id) => __awaiter(this, void 0, void 0, function* () {
|
|
61
62
|
try {
|
|
@@ -66,8 +67,8 @@ class AlchemyService {
|
|
|
66
67
|
};
|
|
67
68
|
const is_added_removed = yield this.add_remove_addresses(subscription, payload);
|
|
68
69
|
if (!is_added_removed)
|
|
69
|
-
this.logger.info(`Failed to add/remove addresses.`, { data: { webhook_ids, add: payload.addresses_to_add
|
|
70
|
-
this.logger.info(`Added/removed:`, { added: payload.addresses_to_add
|
|
70
|
+
this.logger.info(`Failed to add/remove addresses.`, { data: { webhook_ids, add: payload.addresses_to_add, remove: payload.addresses_to_remove } });
|
|
71
|
+
this.logger.info(`Added/removed:`, { added: payload.addresses_to_add, remove: payload.addresses_to_remove });
|
|
71
72
|
return {
|
|
72
73
|
status: is_added_removed,
|
|
73
74
|
webhook_id: id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureEventHubHandler.d.ts","sourceRoot":"","sources":["../../src/services/AzureEventHubHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAsB,MAAM,SAAS,CAAC;AAI/D,MAAM,CAAC,OAAO,OAAO,oBAAoB;IAC9B,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACrC,OAAO,CAAC,MAAM,CAAU;IACjB,4BAA4B,EAAE,aAAa,EAAE,CAAC;IAC9C,4BAA4B,EAAE,MAAM,CAAC,MAAM,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACnF,OAAO,CAAC,MAAM,CAAS;gBAGX,OAAO,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"AzureEventHubHandler.d.ts","sourceRoot":"","sources":["../../src/services/AzureEventHubHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAsB,MAAM,SAAS,CAAC;AAI/D,MAAM,CAAC,OAAO,OAAO,oBAAoB;IAC9B,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACrC,OAAO,CAAC,MAAM,CAAU;IACjB,4BAA4B,EAAE,aAAa,EAAE,CAAC;IAC9C,4BAA4B,EAAE,MAAM,CAAC,MAAM,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACnF,OAAO,CAAC,MAAM,CAAS;gBAGX,OAAO,EAAE,OAAO;IAyC5B,OAAO,CAAC,yBAAyB;IAajC,gBAAgB;;;;IAchB;;;;OAIG;IACG,SAAS,CAAC,SAAS,EAAE,UAAU;IAwC/B,cAAc,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,sBAAsB;IAwB7E;;;;;OAKG;IACG,iBAAiB,CAAC,SAAS,EAAE,MAAM,gBAAgB;CAe5D"}
|
|
@@ -27,7 +27,6 @@ class AzureEventHubHandler {
|
|
|
27
27
|
|| !this.config.config.transferLogsRawEventHubName)
|
|
28
28
|
throw new Error(`Event hub names not initialized in config`);
|
|
29
29
|
// Event hub names
|
|
30
|
-
// Map an escrow event name to Azure event hub name
|
|
31
30
|
this.event_name_to_event_hub_name = {
|
|
32
31
|
Deposit: this.config.config.depositEventHubName,
|
|
33
32
|
Withdrawal: this.config.config.withdrawalEventHubName,
|
|
@@ -43,9 +42,7 @@ class AzureEventHubHandler {
|
|
|
43
42
|
SetTokenTimelock: 'rawtransferlogs',
|
|
44
43
|
ConfigureAdminMultisig: 'rawtransferlogs',
|
|
45
44
|
ConfigureTokenMultisig: 'rawtransferlogs',
|
|
46
|
-
AdminWithdraw: 'rawtransferlogs'
|
|
47
|
-
SetMaxFunding: 'rawtransferlogs',
|
|
48
|
-
Transfer: 'rawtransferlogs'
|
|
45
|
+
AdminWithdraw: 'rawtransferlogs'
|
|
49
46
|
};
|
|
50
47
|
this.logger = (0, Logger_1.createLogger)("AzureEventHubHandler", this.config.pipelineConfig.azureAppName);
|
|
51
48
|
this.initializeEventHubClients();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClaimJobService.d.ts","sourceRoot":"","sources":["../../src/services/ClaimJobService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,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,YAAY,OAAO,KACpB,OAAO,CAAC,IAAI,CAAC,CAwBd;IAIK,aAAa,GAAU,UAAU,mBAAmB,EAAE,+BA+C5D;IAEM,0BAA0B,GAC7B,MAAM;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,IAAI,CAAA;KAAE,EAAE,KAC/D,OAAO,CAAC,IAAI,CAAC,CAwBd;IAGK,mCAAmC,GACtC,MAAM,SAAS,EAAE,EACjB,WAAW,OAAO,KACnB,OAAO,CAAC,IAAI,CAAC,CAsBf;IAIM,gBAAgB,GAAU,YAAY,QAAQ,GAAG,KAAK,EAAE,UAAU,OAAO,qBAI/E;IAEM,oBAAoB,GAAU,YAAY,QAAQ,GAAG,KAAK,GAAG,MAAM,EAAE,UAAU,OAAO,EAAE,cAAU,KAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAW/H;IAEM,iBAAiB,GAAU,aAAa,MAAM,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CAQrE;IAEK,gBAAgB,GAAU,YAAY,MAAM,6CAGlD;IAED,OAAO,CAAC,YAAY,CAenB;CAEJ;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -108,8 +108,7 @@ class ClaimJobsService {
|
|
|
108
108
|
'operationType', cs.operation_type,
|
|
109
109
|
'v', cs.v,
|
|
110
110
|
'r', cs.r,
|
|
111
|
-
's', cs.s
|
|
112
|
-
'signature', cs.signature
|
|
111
|
+
's', cs.s
|
|
113
112
|
)), '[]'::json)
|
|
114
113
|
FROM multisig.crypto_signatures cs
|
|
115
114
|
LEFT JOIN multisig.crypto_escrow_roles cer
|
|
@@ -119,10 +118,9 @@ class ClaimJobsService {
|
|
|
119
118
|
AND LOWER(cer.contract_address) = LOWER(cs.contract_address)
|
|
120
119
|
LEFT JOIN multisig.crypto_role cr ON cr.id = cer.role_id
|
|
121
120
|
WHERE cs.reference_id = u.request_id
|
|
122
|
-
AND
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
)
|
|
121
|
+
AND cs.v IS NOT NULL
|
|
122
|
+
AND cs.r IS NOT NULL
|
|
123
|
+
AND cs.s IS NOT NULL
|
|
126
124
|
) AS multisig_signatures
|
|
127
125
|
FROM updated u;
|
|
128
126
|
`, [limit, job_ttl_s, (0, uuid_1.v4)(), lock_metadata.lock_owner, lock_metadata.lock_reason, max_retry_count]);
|
|
@@ -187,8 +185,7 @@ class ClaimJobsService {
|
|
|
187
185
|
'operationType', cs.operation_type,
|
|
188
186
|
'v', cs.v,
|
|
189
187
|
'r', cs.r,
|
|
190
|
-
's', cs.s
|
|
191
|
-
'signature', cs.signature
|
|
188
|
+
's', cs.s
|
|
192
189
|
)), '[]'::json)
|
|
193
190
|
FROM multisig.crypto_signatures cs
|
|
194
191
|
LEFT JOIN multisig.crypto_escrow_roles cer
|
|
@@ -198,10 +195,6 @@ class ClaimJobsService {
|
|
|
198
195
|
AND LOWER(cer.contract_address) = LOWER(cs.contract_address)
|
|
199
196
|
LEFT JOIN multisig.crypto_role cr ON cr.id = cer.role_id
|
|
200
197
|
WHERE cs.reference_id = u.request_id
|
|
201
|
-
AND (
|
|
202
|
-
(cs.v IS NOT NULL AND cs.r IS NOT NULL AND cs.s IS NOT NULL)
|
|
203
|
-
OR cs.signature IS NOT NULL
|
|
204
|
-
)
|
|
205
198
|
) AS multisig_signatures
|
|
206
199
|
FROM updated u
|
|
207
200
|
LEFT JOIN multisig.crypto_withdrawal_commitment cwc ON cwc.request_id = u.request_id;
|
package/build/services/Redis.js
CHANGED
|
@@ -277,7 +277,7 @@ class Redis {
|
|
|
277
277
|
try {
|
|
278
278
|
const pref = `${this.prefix}-`;
|
|
279
279
|
const normalizedKey = expiredKey.startsWith(pref) ? expiredKey.slice(pref.length) : expiredKey;
|
|
280
|
-
|
|
280
|
+
this.logger.info(`Redis: key expired: ${normalizedKey}`);
|
|
281
281
|
let value = null;
|
|
282
282
|
try {
|
|
283
283
|
value = yield this.get_object(expiredKey);
|
|
@@ -381,7 +381,7 @@ class Redis {
|
|
|
381
381
|
get_object(_key_1) {
|
|
382
382
|
return __awaiter(this, arguments, void 0, function* (_key, use_prefix = true) {
|
|
383
383
|
const key = this.get_key(_key, use_prefix);
|
|
384
|
-
|
|
384
|
+
this.logger.info(`Redis: Getting object with key: ${key}`);
|
|
385
385
|
const raw = yield this._get(key);
|
|
386
386
|
return raw ? JSON.parse(raw) : null;
|
|
387
387
|
});
|
|
@@ -110,7 +110,7 @@ class RedisPubSub {
|
|
|
110
110
|
this.logger.info(`RedisPubSub: pSubscribe: Subscribed to pattern: ${pattern}`);
|
|
111
111
|
yield this.subscriber.pSubscribe(pattern, (eventKey) => __awaiter(this, void 0, void 0, function* () {
|
|
112
112
|
try {
|
|
113
|
-
|
|
113
|
+
this.logger.info(`RedisPubSub: pSubscribe: Received subscriber event: ${event.eventName}. eventkey: ${eventKey}`);
|
|
114
114
|
// Get the value before it expires (if possible) or use the key
|
|
115
115
|
const pref = `${this.prefix}-`;
|
|
116
116
|
if (eventKey.startsWith(pref))
|
|
@@ -2,15 +2,12 @@ import { ScheduleJobStatus, ScheduleTransactionJob } from "../../../entities/Sch
|
|
|
2
2
|
import { ClaimJobLockMetadata } from "../../types";
|
|
3
3
|
import { Pool } from "pg";
|
|
4
4
|
import { OperationType } from "../../../contracts/types/escrow";
|
|
5
|
-
import { MarkCompleteScheduleJob, ScheduleTransactionJobWithDetails
|
|
6
|
-
import { Paginated } from "../../types/claim_job_service";
|
|
5
|
+
import { MarkCompleteScheduleJob, ScheduleTransactionJobWithDetails } from "../../types/db";
|
|
7
6
|
import { RequeueJobConfiguration } from "../../types/watchdog";
|
|
8
7
|
declare class ScheduleTransactionService {
|
|
9
8
|
static get_and_lock_available_jobs: (pool: Pool, limit?: number, job_ttl_s?: number, lock_metadata?: ClaimJobLockMetadata) => Promise<ScheduleTransactionJob[]>;
|
|
10
|
-
/** Locks and returns available jobs with full withdrawal details via inline SQL (bypasses DB function). */
|
|
11
|
-
static get_and_lock_available_jobs_with_details: (pool: Pool, limit?: number, job_ttl_s?: number, lock_metadata?: ClaimJobLockMetadata) => Promise<ScheduleTransactionJobWithDetails[]>;
|
|
12
9
|
/** Locks and returns available jobs with full withdrawal details via DB function. */
|
|
13
|
-
static
|
|
10
|
+
static get_and_lock_available_jobs_with_details: (pool: Pool, limit?: number, job_ttl_s?: number, lock_metadata?: ClaimJobLockMetadata) => Promise<ScheduleTransactionJobWithDetails[]>;
|
|
14
11
|
/**
|
|
15
12
|
* Requeues all jobs in the given status to "queued"
|
|
16
13
|
*/
|
|
@@ -30,17 +27,6 @@ declare class ScheduleTransactionService {
|
|
|
30
27
|
sent_at: Date;
|
|
31
28
|
}[]) => Promise<void>;
|
|
32
29
|
static mark_complete: (pool: Pool, payloads: MarkCompleteScheduleJob[]) => Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Paginated list of current schedule-transaction jobs, newest first, with the
|
|
35
|
-
* status resolved to text and (for withdrawal operation types) the receiver/token/
|
|
36
|
-
* amount joined in. All filters are optional and combine with AND.
|
|
37
|
-
*/
|
|
38
|
-
static list_jobs_paginated: (pool: Pool, page: number, page_size?: number, filters?: ScheduleJobFilters) => Promise<Paginated<ScheduleJobListItem[]>>;
|
|
39
|
-
/**
|
|
40
|
-
* Paginated schedule-transaction job history (append-only status transitions),
|
|
41
|
-
* newest first. All filters are optional and combine with AND.
|
|
42
|
-
*/
|
|
43
|
-
static list_history_paginated: (pool: Pool, page: number, page_size?: number, filters?: ScheduleJobHistoryFilters) => Promise<Paginated<ScheduleJobHistoryItem[]>>;
|
|
44
30
|
}
|
|
45
31
|
export default ScheduleTransactionService;
|
|
46
32
|
//# sourceMappingURL=ScheduleTransactionService.d.ts.map
|
|
@@ -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,
|
|
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;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,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,qFAAqF;IACrF,MAAM,CAAC,wCAAwC,GAC3C,MAAM,IAAI,EACV,QAAO,MAAW,EAClB,YAAW,MAAY,EACvB,gBAAe,oBAA0F,KAC1G,OAAO,CAAC,iCAAiC,EAAE,CAAC,CAQ9C;IAGD;;OAEG;IACH,MAAM,CAAC,oBAAoB,GACvB,MAAM,IAAI,EACV,MAAM,uBAAuB,CAAC,iBAAiB,CAAC,KACjD,OAAO,CAAC,sBAAsB,EAAE,CAAC,CA8ClC;IAGF,MAAM,CAAC,mBAAmB,GAAU,MAAM,IAAI,EAAE,gBAAgB,aAAa,EAAE,aAAa,MAAM,EAAE,EAAE,YAAY,iBAAiB,KAAG,OAAO,CAAC,IAAI,CAAC,CASjJ;IAGF,MAAM,CAAC,wBAAwB,GAC3B,MAAM,IAAI,EACV,gBAAgB,aAAa,EAC7B,aAAa,MAAM,EAAE,EACrB,YAAY,iBAAiB,EAC7B,gBAAgB,MAAM,EACtB,YAAY,OAAO,KACpB,OAAO,CAAC,IAAI,CAAC,CAwBd;IAGF,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,123 +52,8 @@ 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
|
-
/** Locks and returns available jobs with full withdrawal details via inline SQL (bypasses DB function). */
|
|
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
|
-
var _b, _c;
|
|
58
|
-
const result = yield pool.query(`
|
|
59
|
-
WITH status_ids AS (
|
|
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 id
|
|
67
|
-
FROM multisig.schedule_transaction_jobs, status_ids
|
|
68
|
-
WHERE status_id = status_ids.queued_id
|
|
69
|
-
AND (lock_expires_at IS NULL OR lock_expires_at < NOW())
|
|
70
|
-
ORDER BY blockchain, chain_id ASC
|
|
71
|
-
LIMIT $1
|
|
72
|
-
FOR UPDATE SKIP LOCKED
|
|
73
|
-
),
|
|
74
|
-
updated AS (
|
|
75
|
-
UPDATE multisig.schedule_transaction_jobs j
|
|
76
|
-
SET status_id = si.processing_id,
|
|
77
|
-
locked_at = NOW(),
|
|
78
|
-
lock_expires_at = NOW() + ($2 || ' seconds')::INTERVAL,
|
|
79
|
-
batch_group_id = gen_random_uuid(),
|
|
80
|
-
metadata = jsonb_set(
|
|
81
|
-
jsonb_set(
|
|
82
|
-
COALESCE(j.metadata, '{}'::jsonb),
|
|
83
|
-
'{lock_owner}', to_jsonb($3::text)
|
|
84
|
-
),
|
|
85
|
-
'{lock_reason}', to_jsonb($4::text)
|
|
86
|
-
),
|
|
87
|
-
updated_at = NOW()
|
|
88
|
-
FROM candidates c, status_ids si
|
|
89
|
-
WHERE j.id = c.id
|
|
90
|
-
RETURNING j.*
|
|
91
|
-
)
|
|
92
|
-
SELECT COALESCE(json_agg(json_build_object(
|
|
93
|
-
'id', u.id,
|
|
94
|
-
'requestId', u.request_id,
|
|
95
|
-
'operationType', u.operation_type,
|
|
96
|
-
'status', sjs.status,
|
|
97
|
-
'blockchain', u.blockchain,
|
|
98
|
-
'chainId', u.chain_id,
|
|
99
|
-
'batchGroupId', u.batch_group_id,
|
|
100
|
-
'lockExpiresAt', u.lock_expires_at,
|
|
101
|
-
'lockedAt', u.locked_at,
|
|
102
|
-
'txHash', u.tx_hash,
|
|
103
|
-
'sentAt', u.sent_at,
|
|
104
|
-
'confirmedAt', u.confirmed_at,
|
|
105
|
-
'retryCount', u.retry_count,
|
|
106
|
-
'errorMessage', u.error_message,
|
|
107
|
-
'lastErrorAt', u.last_error_at,
|
|
108
|
-
'metadata', u.metadata,
|
|
109
|
-
'createdAt', u.created_at,
|
|
110
|
-
'updatedAt', u.updated_at,
|
|
111
|
-
'withdrawalDetails', json_build_object(
|
|
112
|
-
'id', cw.id,
|
|
113
|
-
'userId', cw.user_id,
|
|
114
|
-
'status', LOWER(cws.status),
|
|
115
|
-
'blockchain', LOWER(cwbt.blockchain),
|
|
116
|
-
'receiver', cw.receiver_address,
|
|
117
|
-
'receiverAddress', cw.receiver_address,
|
|
118
|
-
'paymentType', LOWER(cwpt.type),
|
|
119
|
-
'chainId', cw.chain_id,
|
|
120
|
-
'token', cw.token_address,
|
|
121
|
-
'amount', cw.amount,
|
|
122
|
-
'amountInUsd', cw.amount * cr.rate,
|
|
123
|
-
'destinationChainId', cw.destination_chain_id,
|
|
124
|
-
'destinationToken', cw.destination_token_address,
|
|
125
|
-
'destinationBlockchain', cw.destination_blockchain,
|
|
126
|
-
'sigsExecutiveRequired', cw.sigs_executive_required,
|
|
127
|
-
'sigsManagerRequired', cw.sigs_manager_required,
|
|
128
|
-
'timeLockSeconds', cw.timelock_seconds,
|
|
129
|
-
'multisigSignatures', (
|
|
130
|
-
SELECT COALESCE(json_agg(json_build_object(
|
|
131
|
-
'name', COALESCE(role.role_alias, ''),
|
|
132
|
-
'signerAddress', cs.signer_address,
|
|
133
|
-
'contractAddress', cs.contract_address,
|
|
134
|
-
'createdAt', cs.created_at,
|
|
135
|
-
'updatedAt', cs.updated_at,
|
|
136
|
-
'operationType', cs.operation_type,
|
|
137
|
-
'v', cs.v,
|
|
138
|
-
'r', cs.r,
|
|
139
|
-
's', cs.s,
|
|
140
|
-
'signature', cs.signature
|
|
141
|
-
)), '[]'::json)
|
|
142
|
-
FROM multisig.crypto_signatures cs
|
|
143
|
-
LEFT JOIN multisig.crypto_escrow_roles cer
|
|
144
|
-
ON LOWER(cer.wallet_address) = LOWER(cs.signer_address)
|
|
145
|
-
AND LOWER(cer.blockchain) = LOWER(cs.blockchain)
|
|
146
|
-
AND cer.chain_id = cs.chain_id
|
|
147
|
-
AND LOWER(cer.contract_address) = LOWER(cs.contract_address)
|
|
148
|
-
LEFT JOIN multisig.crypto_role role ON role.id = cer.role_id
|
|
149
|
-
WHERE cs.reference_id = cw.id
|
|
150
|
-
AND cs.operation_type = 1
|
|
151
|
-
AND (
|
|
152
|
-
(cs.v IS NOT NULL AND cs.r IS NOT NULL AND cs.s IS NOT NULL)
|
|
153
|
-
OR cs.signature IS NOT NULL
|
|
154
|
-
)
|
|
155
|
-
)
|
|
156
|
-
)
|
|
157
|
-
)), '[]'::json) AS result
|
|
158
|
-
FROM updated u
|
|
159
|
-
JOIN multisig.schedule_job_statuses sjs ON sjs.id = u.status_id
|
|
160
|
-
JOIN accounting.crypto_withdrawals cw ON cw.id = u.request_id
|
|
161
|
-
LEFT JOIN accounting.crypto_withdrawal_status cws ON cws.id = cw.status_id
|
|
162
|
-
LEFT JOIN accounting.crypto_withdrawal_blockchain_types cwbt ON cwbt.id = cw.blockchain_id
|
|
163
|
-
LEFT JOIN accounting.crypto_withdrawal_payment_types cwpt ON cwpt.id = cw.payment_type_id
|
|
164
|
-
LEFT JOIN usersmanagement.user_currency_mappings ucm ON ucm.currency_specific_user_id = cw.currency_specific_user_id
|
|
165
|
-
LEFT JOIN public.currencies cur ON cur.currencyid = ucm.currency_id
|
|
166
|
-
LEFT JOIN accounting.currencyrates cr ON cr.symbol = UPPER(cur.currency_code || 'USD')
|
|
167
|
-
`, [limit, job_ttl_s, lock_metadata.lock_owner, lock_metadata.lock_reason]);
|
|
168
|
-
return (_c = (_b = result.rows[0]) === null || _b === void 0 ? void 0 : _b.result) !== null && _c !== void 0 ? _c : [];
|
|
169
|
-
});
|
|
170
55
|
/** Locks and returns available jobs with full withdrawal details via DB function. */
|
|
171
|
-
ScheduleTransactionService.
|
|
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" }) {
|
|
172
57
|
var _b;
|
|
173
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]);
|
|
174
59
|
return (_b = result.rows[0].fn_get_available_schedule_jobs_with_details) !== null && _b !== void 0 ? _b : [];
|
|
@@ -324,153 +209,4 @@ ScheduleTransactionService.mark_complete = (pool, payloads) => __awaiter(void 0,
|
|
|
324
209
|
AND t.operation_type = c.operation_type
|
|
325
210
|
`, [requestIds, operationTypes]);
|
|
326
211
|
});
|
|
327
|
-
// ── BO read views ────────────────────────────────────────────────────────
|
|
328
|
-
/**
|
|
329
|
-
* Paginated list of current schedule-transaction jobs, newest first, with the
|
|
330
|
-
* status resolved to text and (for withdrawal operation types) the receiver/token/
|
|
331
|
-
* amount joined in. All filters are optional and combine with AND.
|
|
332
|
-
*/
|
|
333
|
-
ScheduleTransactionService.list_jobs_paginated = (pool_1, page_1, ...args_1) => __awaiter(void 0, [pool_1, page_1, ...args_1], void 0, function* (pool, page, page_size = 20, filters = {}) {
|
|
334
|
-
var _b, _c;
|
|
335
|
-
if (page < 1)
|
|
336
|
-
page = 1;
|
|
337
|
-
const clauses = [];
|
|
338
|
-
const params = [];
|
|
339
|
-
let i = 1;
|
|
340
|
-
if (filters.status) {
|
|
341
|
-
clauses.push(`sjs.status = $${i++}`);
|
|
342
|
-
params.push(filters.status);
|
|
343
|
-
}
|
|
344
|
-
if (filters.blockchain) {
|
|
345
|
-
clauses.push(`j.blockchain = $${i++}`);
|
|
346
|
-
params.push(filters.blockchain);
|
|
347
|
-
}
|
|
348
|
-
if (filters.chainId) {
|
|
349
|
-
clauses.push(`j.chain_id = $${i++}`);
|
|
350
|
-
params.push(filters.chainId);
|
|
351
|
-
}
|
|
352
|
-
if (filters.operationType !== undefined) {
|
|
353
|
-
clauses.push(`j.operation_type = $${i++}`);
|
|
354
|
-
params.push(filters.operationType);
|
|
355
|
-
}
|
|
356
|
-
if (filters.requestId !== undefined) {
|
|
357
|
-
clauses.push(`j.request_id = $${i++}`);
|
|
358
|
-
params.push(filters.requestId);
|
|
359
|
-
}
|
|
360
|
-
if (filters.txHash) {
|
|
361
|
-
clauses.push(`j.tx_hash = $${i++}`);
|
|
362
|
-
params.push(filters.txHash);
|
|
363
|
-
}
|
|
364
|
-
const where = clauses.length ? `WHERE ${clauses.join(" AND ")}` : "";
|
|
365
|
-
const countRes = yield pool.query(`SELECT COUNT(*)::bigint AS count
|
|
366
|
-
FROM multisig.schedule_transaction_jobs j
|
|
367
|
-
JOIN multisig.schedule_job_statuses sjs ON sjs.id = j.status_id
|
|
368
|
-
${where}`, params);
|
|
369
|
-
const total_count = Number((_c = (_b = countRes.rows[0]) === null || _b === void 0 ? void 0 : _b.count) !== null && _c !== void 0 ? _c : 0);
|
|
370
|
-
const limitParam = i++;
|
|
371
|
-
const offsetParam = i++;
|
|
372
|
-
const rowsRes = yield pool.query(`SELECT
|
|
373
|
-
j.id,
|
|
374
|
-
j.request_id AS "requestId",
|
|
375
|
-
j.operation_type AS "operationType",
|
|
376
|
-
sjs.status AS status,
|
|
377
|
-
j.blockchain,
|
|
378
|
-
j.chain_id AS "chainId",
|
|
379
|
-
j.tx_hash AS "txHash",
|
|
380
|
-
j.locked_at AS "lockedAt",
|
|
381
|
-
j.lock_expires_at AS "lockExpiresAt",
|
|
382
|
-
j.sent_at AS "sentAt",
|
|
383
|
-
j.confirmed_at AS "confirmedAt",
|
|
384
|
-
j.retry_count AS "retryCount",
|
|
385
|
-
j.error_message AS "errorMessage",
|
|
386
|
-
j.last_error_at AS "lastErrorAt",
|
|
387
|
-
j.metadata,
|
|
388
|
-
j.created_at AS "createdAt",
|
|
389
|
-
j.updated_at AS "updatedAt",
|
|
390
|
-
cw.receiver_address AS "receiverAddress",
|
|
391
|
-
cw.token_address AS "tokenAddress",
|
|
392
|
-
cw.amount AS "amount"
|
|
393
|
-
FROM multisig.schedule_transaction_jobs j
|
|
394
|
-
JOIN multisig.schedule_job_statuses sjs ON sjs.id = j.status_id
|
|
395
|
-
LEFT JOIN accounting.crypto_withdrawals cw
|
|
396
|
-
ON cw.id = j.request_id AND j.operation_type IN (1, 3)
|
|
397
|
-
${where}
|
|
398
|
-
ORDER BY j.created_at DESC
|
|
399
|
-
LIMIT $${limitParam} OFFSET $${offsetParam}`, [...params, page_size, (page - 1) * page_size]);
|
|
400
|
-
return {
|
|
401
|
-
total_count,
|
|
402
|
-
pages_count: Math.ceil(total_count / page_size),
|
|
403
|
-
current_page: page,
|
|
404
|
-
has_next: total_count > page * page_size,
|
|
405
|
-
items: rowsRes.rows
|
|
406
|
-
};
|
|
407
|
-
});
|
|
408
|
-
/**
|
|
409
|
-
* Paginated schedule-transaction job history (append-only status transitions),
|
|
410
|
-
* newest first. All filters are optional and combine with AND.
|
|
411
|
-
*/
|
|
412
|
-
ScheduleTransactionService.list_history_paginated = (pool_1, page_1, ...args_1) => __awaiter(void 0, [pool_1, page_1, ...args_1], void 0, function* (pool, page, page_size = 20, filters = {}) {
|
|
413
|
-
var _b, _c;
|
|
414
|
-
if (page < 1)
|
|
415
|
-
page = 1;
|
|
416
|
-
const clauses = [];
|
|
417
|
-
const params = [];
|
|
418
|
-
let i = 1;
|
|
419
|
-
if (filters.jobId !== undefined) {
|
|
420
|
-
clauses.push(`h.job_id = $${i++}`);
|
|
421
|
-
params.push(filters.jobId);
|
|
422
|
-
}
|
|
423
|
-
if (filters.requestId !== undefined) {
|
|
424
|
-
clauses.push(`h.request_id = $${i++}`);
|
|
425
|
-
params.push(filters.requestId);
|
|
426
|
-
}
|
|
427
|
-
if (filters.operationType !== undefined) {
|
|
428
|
-
clauses.push(`h.operation_type = $${i++}`);
|
|
429
|
-
params.push(filters.operationType);
|
|
430
|
-
}
|
|
431
|
-
if (filters.status) {
|
|
432
|
-
clauses.push(`sjs.status = $${i++}`);
|
|
433
|
-
params.push(filters.status);
|
|
434
|
-
}
|
|
435
|
-
if (filters.blockchain) {
|
|
436
|
-
clauses.push(`h.blockchain = $${i++}`);
|
|
437
|
-
params.push(filters.blockchain);
|
|
438
|
-
}
|
|
439
|
-
if (filters.chainId) {
|
|
440
|
-
clauses.push(`h.chain_id = $${i++}`);
|
|
441
|
-
params.push(filters.chainId);
|
|
442
|
-
}
|
|
443
|
-
const where = clauses.length ? `WHERE ${clauses.join(" AND ")}` : "";
|
|
444
|
-
const countRes = yield pool.query(`SELECT COUNT(*)::bigint AS count
|
|
445
|
-
FROM multisig.schedule_transaction_jobs_history h
|
|
446
|
-
JOIN multisig.schedule_job_statuses sjs ON sjs.id = h.status_id
|
|
447
|
-
${where}`, params);
|
|
448
|
-
const total_count = Number((_c = (_b = countRes.rows[0]) === null || _b === void 0 ? void 0 : _b.count) !== null && _c !== void 0 ? _c : 0);
|
|
449
|
-
const limitParam = i++;
|
|
450
|
-
const offsetParam = i++;
|
|
451
|
-
const rowsRes = yield pool.query(`SELECT
|
|
452
|
-
h.id,
|
|
453
|
-
h.job_id AS "jobId",
|
|
454
|
-
h.request_id AS "requestId",
|
|
455
|
-
h.operation_type AS "operationType",
|
|
456
|
-
sjs.status AS status,
|
|
457
|
-
h.blockchain,
|
|
458
|
-
h.chain_id AS "chainId",
|
|
459
|
-
h.tx_hash AS "txHash",
|
|
460
|
-
h.retry_count AS "retryCount",
|
|
461
|
-
h.error_message AS "errorMessage",
|
|
462
|
-
h.created_at AS "createdAt"
|
|
463
|
-
FROM multisig.schedule_transaction_jobs_history h
|
|
464
|
-
JOIN multisig.schedule_job_statuses sjs ON sjs.id = h.status_id
|
|
465
|
-
${where}
|
|
466
|
-
ORDER BY h.created_at DESC
|
|
467
|
-
LIMIT $${limitParam} OFFSET $${offsetParam}`, [...params, page_size, (page - 1) * page_size]);
|
|
468
|
-
return {
|
|
469
|
-
total_count,
|
|
470
|
-
pages_count: Math.ceil(total_count / page_size),
|
|
471
|
-
current_page: page,
|
|
472
|
-
has_next: total_count > page * page_size,
|
|
473
|
-
items: rowsRes.rows
|
|
474
|
-
};
|
|
475
|
-
});
|
|
476
212
|
exports.default = ScheduleTransactionService;
|