@ercworldio/blockchain-shared 1.0.1-dev.16 → 1.0.1-dev.17

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.
@@ -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,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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GAAG,kBAAkB;IAO5F,mBAAmB,IAAI,MAAM,EAAE;IAI/B,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAOhF;;;;OAIG;YACW,wBAAwB;YAoBxB,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"}
@@ -12,11 +12,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ const web3_js_1 = require("@solana/web3.js");
16
+ const constants_1 = require("../../constants");
15
17
  const errors_1 = __importDefault(require("../../errors/errors"));
16
18
  const ChainManager_1 = __importDefault(require("../ChainManager"));
17
19
  const DepositAddressService_1 = __importDefault(require("../DepositAddressService"));
18
20
  const QuicknodeWebhookSignature_1 = __importDefault(require("../QuicknodeWebhookSignature"));
19
21
  const QnNotificationsApi_1 = __importDefault(require("./QnNotificationsApi"));
22
+ const Wallets_1 = require("../../utils/Wallets");
23
+ const __1 = require("../..");
20
24
  const ADDRESS_SYNC_BATCH_SIZE = 500;
21
25
  const ADDRESS_LOG_THRESHOLD = 1000;
22
26
  class SetupNotifications extends errors_1.default {
@@ -62,6 +66,15 @@ class SetupNotifications extends errors_1.default {
62
66
  }
63
67
  const chain_manager = ChainManager_1.default.getInstance(this.config);
64
68
  const escrow_config = chain_manager.getEscrowContractForChain(notif_config.chain_id);
69
+ // Derive vault authority for solana escrow program
70
+ if (notif_config.chain_id !== undefined && notif_config.blockchain === constants_1.BLOCKCHAINS.SOLANA) {
71
+ const chain_manager = ChainManager_1.default.getInstance(this.config);
72
+ const escrow_config = chain_manager.getEscrowContractForChain(parseInt(notif_config.chain_id.toString()));
73
+ // TODO handle multiple escrow contracts on solana
74
+ const escrow_program_pubkey = new web3_js_1.PublicKey((0, Wallets_1.normalizeAddress)(escrow_config.addresses[0], "solana"));
75
+ const vault_authority = __1.EscrowService.findVaultAuthorityPda(escrow_program_pubkey);
76
+ return [vault_authority.toString()];
77
+ }
65
78
  return (_a = escrow_config === null || escrow_config === void 0 ? void 0 : escrow_config.addresses) !== null && _a !== void 0 ? _a : [];
66
79
  });
67
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ercworldio/blockchain-shared",
3
- "version": "1.0.1-dev.16",
3
+ "version": "1.0.1-dev.17",
4
4
  "description": "Shared library for blockchain projects",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",