@ercworldio/blockchain-shared 1.0.1-dev.14 → 1.0.1-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.
@@ -125,6 +125,11 @@
125
125
  "name": "qn-custodial-webhook-sol-dev",
126
126
  "network": "solana-devnet",
127
127
  "template": "solanaWalletFilter"
128
+ },
129
+ {
130
+ "name": "qn-custodial-webhook-sol-local",
131
+ "network": "solana-devnet",
132
+ "template": "solanaWalletFilter"
128
133
  }
129
134
  ],
130
135
  "contracts": [
@@ -211,6 +216,11 @@
211
216
  "name": "qn-custodial-webhook-bsc-dev",
212
217
  "network": "bnbchain-testnet",
213
218
  "template": "evmWalletFilter"
219
+ },
220
+ {
221
+ "name": "qn-custodial-webhook-bsc-local",
222
+ "network": "bnbchain-testnet",
223
+ "template": "evmWalletFilter"
214
224
  }
215
225
  ],
216
226
  "contracts": [
@@ -370,6 +380,11 @@
370
380
  "name": "qn-custodial-webhook-avax-dev",
371
381
  "network": "avalanche-fuji",
372
382
  "template": "evmWalletFilter"
383
+ },
384
+ {
385
+ "name": "qn-custodial-webhook-avax-local",
386
+ "network": "avalanche-fuji",
387
+ "template": "evmWalletFilter"
373
388
  }
374
389
  ],
375
390
  "contracts": [
@@ -471,6 +486,11 @@
471
486
  "name": "qn-custodial-webhook-eth-dev",
472
487
  "network": "ethereum-sepolia",
473
488
  "template": "evmWalletFilter"
489
+ },
490
+ {
491
+ "name": "qn-custodial-webhook-eth-local",
492
+ "network": "ethereum-sepolia",
493
+ "template": "evmWalletFilter"
474
494
  }
475
495
  ],
476
496
  "contracts": [
@@ -558,6 +578,11 @@
558
578
  "name": "qn-custodial-webhook-pol-dev",
559
579
  "network": "polygon-amoy",
560
580
  "template": "evmWalletFilter"
581
+ },
582
+ {
583
+ "name": "qn-custodial-webhook-pol-local",
584
+ "network": "polygon-amoy",
585
+ "template": "evmWalletFilter"
561
586
  }
562
587
  ],
563
588
  "contracts": [
@@ -644,6 +669,11 @@
644
669
  "name": "qn-custodial-webhook-mon-dev",
645
670
  "network": "monad-testnet",
646
671
  "template": "evmWalletFilter"
672
+ },
673
+ {
674
+ "name": "qn-custodial-webhook-mon-local",
675
+ "network": "monad-testnet",
676
+ "template": "evmWalletFilter"
647
677
  }
648
678
  ],
649
679
  "contracts": [
@@ -27,6 +27,7 @@ declare class SetupNotifications extends BaseErrors {
27
27
  * The `blockchain` filter value in DepositAddressService is the string stored
28
28
  * in the DB — e.g. "solana", "evm", "ethereum", etc.
29
29
  */
30
+ private fetch_contract_addresses;
30
31
  private fetch_all_db_addresses;
31
32
  /**
32
33
  * Register a newly-created webhook entry in the internal maps.
@@ -1 +1 @@
1
- {"version":3,"file":"SetupNotifications.d.ts","sourceRoot":"","sources":["../../../src/services/quicknode-notifications/SetupNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAiB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAQlE,MAAM,WAAW,wBAAwB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,cAAc,CAAC;IAC3B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAWD,cAAM,kBAAmB,SAAQ,UAAU;IACvC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAqB;IAC5C,OAAO,CAAC,GAAG,CAAqB;IAEhC,OAAO,CAAC,WAAW,CAAoD;IAEvE,OAAO,CAAC,aAAa,CAA8D;IAEnF,OAAO,CAAC,eAAe,CAAqD;IAC5E,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,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hC,OAAO,CAAC,WAAW,CAAoD;IAEvE,OAAO,CAAC,aAAa,CAA8D;IAEnF,OAAO,CAAC,eAAe,CAAqD;IAC5E,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,EAAE,CAAgB;IAC1B,OAAO;IAOP,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,kBAAkB,GAAG,kBAAkB;IAO5F,mBAAmB,IAAI,MAAM,EAAE;IAI/B,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAOhF;;;;OAIG;YACW,wBAAwB;YAUxB,sBAAsB;IAuBpC;;OAEG;IACH,OAAO,CAAC,cAAc;IAOT,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA0H3B,WAAW,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyDvE,cAAc,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAe1F;AAED,eAAe,kBAAkB,CAAC"}
@@ -53,6 +53,18 @@ class SetupNotifications extends errors_1.default {
53
53
  * The `blockchain` filter value in DepositAddressService is the string stored
54
54
  * in the DB — e.g. "solana", "evm", "ethereum", etc.
55
55
  */
56
+ fetch_contract_addresses(notif_config) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ var _a;
59
+ if (!notif_config.chain_id) {
60
+ console.warn(`SetupNotifications: source='contract' but no chain_id set for ${notif_config.name} — skipping`);
61
+ return [];
62
+ }
63
+ const chain_manager = ChainManager_1.default.getInstance(this.config);
64
+ const escrow_config = chain_manager.getEscrowContractForChain(notif_config.chain_id);
65
+ return (_a = escrow_config === null || escrow_config === void 0 ? void 0 : escrow_config.addresses) !== null && _a !== void 0 ? _a : [];
66
+ });
67
+ }
56
68
  fetch_all_db_addresses(blockchain) {
57
69
  return __awaiter(this, void 0, void 0, function* () {
58
70
  const service = new DepositAddressService_1.default(this.db);
@@ -117,8 +129,10 @@ class SetupNotifications extends errors_1.default {
117
129
  return ((_a = w.name) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === notif_config.name.toLowerCase() &&
118
130
  ((_b = w.network) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === notif_config.network.toLowerCase();
119
131
  });
120
- // Fetch current addresses from the DB for this blockchain
121
- const db_addresses = yield this.fetch_all_db_addresses(notif_config.blockchain);
132
+ // Fetch addresses — contract source uses escrow addresses, wallet source uses DB deposit addresses
133
+ const db_addresses = notif_config.source === 'contract'
134
+ ? yield this.fetch_contract_addresses(notif_config)
135
+ : yield this.fetch_all_db_addresses(notif_config.blockchain);
122
136
  console.log(`SetupNotifications: ${db_addresses.length} DB addresses for blockchain=${notif_config.blockchain}`);
123
137
  let webhook_id;
124
138
  if (existing) {
@@ -12,6 +12,10 @@ export type QuicknodeNotificationConfig = {
12
12
  name: string;
13
13
  network: string;
14
14
  template: 'solanaWalletFilter' | 'evmWalletFilter';
15
+ /** 'wallet' (default) = custodial deposit addresses; 'contract' = escrow contract addresses */
16
+ source?: 'wallet' | 'contract';
17
+ /** Required when source === 'contract' — the chain ID to look up the escrow contract */
18
+ chain_id?: number;
15
19
  };
16
20
  export type QuicknodeStreamConfig = {
17
21
  network: string;
@@ -1 +1 @@
1
- {"version":3,"file":"chain_manager.d.ts","sourceRoot":"","sources":["../../../src/services/types/chain_manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,6BAA6B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,qBAAqB,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;I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E,MAAM,CAAC;IACtB,qBAAqB,EAAE,0BAA0B,EAAE,CAAC;IACpD,SAAS,EAAE,MAAM,EAAE,CAAC;CACvB,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,qBAAqB,CAAC;IAC/B,IAAI,EAAE,SAAS,GAAG,kBAAkB,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,GAAG,QAAQ,CAAA;CAChC,CAAA;AAGD,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,MAAM,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0BAA0B,EAAE,MAAM,CAAC;IACnC,0BAA0B,EAAE,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,UAAU;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ercworldio/blockchain-shared",
3
- "version": "1.0.1-dev.14",
3
+ "version": "1.0.1-dev.15",
4
4
  "description": "Shared library for blockchain projects",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",