@ercworldio/blockchain-shared 1.0.0-dev.14 → 1.0.0-dev.15
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.
|
@@ -49,16 +49,7 @@
|
|
|
49
49
|
"rpcBaseUrl": "https://api.nileex.io",
|
|
50
50
|
"rpcBaseUrlWss": "",
|
|
51
51
|
"targetConfirmations": 20,
|
|
52
|
-
"quicknodeStreams": [
|
|
53
|
-
{
|
|
54
|
-
"network": "tron-mainnet",
|
|
55
|
-
"dataset": "logs",
|
|
56
|
-
"name": "tron-custodial-transfers",
|
|
57
|
-
"listConfig": {
|
|
58
|
-
"key": "custodial-addresses"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
],
|
|
52
|
+
"quicknodeStreams": [],
|
|
62
53
|
"custodialAlchemyWebhooks": [],
|
|
63
54
|
"contracts": [
|
|
64
55
|
{
|
|
@@ -131,7 +122,7 @@
|
|
|
131
122
|
],
|
|
132
123
|
"quicknodeNotificationConfig": [
|
|
133
124
|
{
|
|
134
|
-
"name": "qn-custodial-webhook-sol",
|
|
125
|
+
"name": "qn-custodial-webhook-sol-dev",
|
|
135
126
|
"network": "solana-devnet",
|
|
136
127
|
"template": "solanaWalletFilter"
|
|
137
128
|
}
|
|
@@ -215,6 +206,13 @@
|
|
|
215
206
|
"source": "wallet"
|
|
216
207
|
}
|
|
217
208
|
],
|
|
209
|
+
"quicknodeNotificationConfig": [
|
|
210
|
+
{
|
|
211
|
+
"name": "qn-custodial-webhook-bsc-dev",
|
|
212
|
+
"network": "bnbchain-testnet",
|
|
213
|
+
"template": "evmWalletFilter"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
218
216
|
"contracts": [
|
|
219
217
|
{
|
|
220
218
|
"type": "Escrow",
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { DepositAddress } from "../entities/DepositAddress";
|
|
2
2
|
import { BlockchainType } from "../interfaces";
|
|
3
3
|
import { IDatabasePool } from "../interfaces/database";
|
|
4
|
+
import { Paginated } from "./types/claim_job_service";
|
|
5
|
+
export interface DepositAddressSearchFilters {
|
|
6
|
+
user_id?: number;
|
|
7
|
+
blockchain?: string;
|
|
8
|
+
address?: string;
|
|
9
|
+
}
|
|
4
10
|
interface CreateDepositResult {
|
|
5
11
|
id: number;
|
|
6
12
|
userId: number;
|
|
@@ -35,6 +41,8 @@ declare class DepositAddressService {
|
|
|
35
41
|
status: boolean;
|
|
36
42
|
address: string;
|
|
37
43
|
}>;
|
|
44
|
+
private paginate;
|
|
45
|
+
getDepositAddressesPaginated(page: number, page_size: number | undefined, filters: DepositAddressSearchFilters): Promise<Paginated<DepositAddress[]>>;
|
|
38
46
|
getDepositAddressByAddress(blockchain: BlockchainType, address: string): Promise<DepositAddress | null>;
|
|
39
47
|
findByBlockchainAndAddressRaw(blockchain: BlockchainType, address: string): Promise<DepositAddress | null>;
|
|
40
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepositAddressService.d.ts","sourceRoot":"","sources":["../../src/services/DepositAddressService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"DepositAddressService.d.ts","sourceRoot":"","sources":["../../src/services/DepositAddressService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,WAAW,2BAA2B;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;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E,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;YA4B/F,QAAQ;IAwBhB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAK,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC;IAI9I,0BAA0B,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAkBvG,6BAA6B,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;CAanH;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -242,6 +242,36 @@ class DepositAddressService {
|
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
+
paginate(page, page_size, filters) {
|
|
246
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
247
|
+
const repo = this.dbPool.accountsRepo;
|
|
248
|
+
if (!repo)
|
|
249
|
+
throw new Error(`Db Driver appDataSource is not initialized.`);
|
|
250
|
+
if (page === 0)
|
|
251
|
+
page = 1;
|
|
252
|
+
const [items, totalCount] = yield Promise.all([
|
|
253
|
+
repo.find({
|
|
254
|
+
take: page_size,
|
|
255
|
+
skip: (page - 1) * page_size,
|
|
256
|
+
where: Object.assign({}, filters),
|
|
257
|
+
order: { created_at: "DESC" }
|
|
258
|
+
}),
|
|
259
|
+
repo.count({ where: Object.assign({}, filters) })
|
|
260
|
+
]);
|
|
261
|
+
return {
|
|
262
|
+
total_count: totalCount,
|
|
263
|
+
pages_count: Math.ceil(totalCount / page_size),
|
|
264
|
+
has_next: totalCount > page * page_size,
|
|
265
|
+
current_page: page,
|
|
266
|
+
items: items || []
|
|
267
|
+
};
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
getDepositAddressesPaginated(page_1) {
|
|
271
|
+
return __awaiter(this, arguments, void 0, function* (page, page_size = 10, filters) {
|
|
272
|
+
return this.paginate(page, page_size, filters);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
245
275
|
getDepositAddressByAddress(blockchain, address) {
|
|
246
276
|
return __awaiter(this, void 0, void 0, function* () {
|
|
247
277
|
try {
|