|
1 | 1 | import { multiMapper } from "../helpers/multiMapper"; |
2 | 2 | import { logEvent, serviceError } from "../helpers/logger"; |
3 | | -import { WhitelistedInvestorService, TokenService, PoolSpokeBlockchainService } from "../services"; |
| 3 | +import { |
| 4 | + WhitelistedInvestorService, |
| 5 | + TokenService, |
| 6 | + PoolSpokeBlockchainService, |
| 7 | + PoolManagerService, |
| 8 | + AccountService, |
| 9 | +} from "../services"; |
4 | 10 |
|
5 | 11 | multiMapper("hub:NotifyPool", async ({ event, context }) => { |
6 | 12 | logEvent(event, context, "hub:NotifyPool"); |
@@ -66,6 +72,30 @@ multiMapper("hub:UpdateRestriction", async ({ event, context }) => { |
66 | 72 | } |
67 | 73 | }); |
68 | 74 |
|
| 75 | +multiMapper("hub:UpdateBalanceSheetManager", async ({ event, context }) => { |
| 76 | + logEvent(event, context, "hub:UpdateBalanceSheetManager"); |
| 77 | + const { poolId, manager: _manager, canManage, centrifugeId: spokeCentrifugeId } = event.args; |
| 78 | + const manager = _manager.toLowerCase().substring(0, 42) as `0x${string}`; |
| 79 | + |
| 80 | + const _account = (await AccountService.getOrInit( |
| 81 | + context, |
| 82 | + { |
| 83 | + address: manager, |
| 84 | + }, |
| 85 | + event |
| 86 | + )) as AccountService; |
| 87 | + |
| 88 | + const poolManager = (await PoolManagerService.getOrInit( |
| 89 | + context, |
| 90 | + { poolId, centrifugeId: spokeCentrifugeId.toString(), address: manager }, |
| 91 | + event, |
| 92 | + undefined, |
| 93 | + true |
| 94 | + )) as PoolManagerService; |
| 95 | + poolManager.setCrosschainInProgress(canManage ? `CanManage` : `CanNotManage`); |
| 96 | + await poolManager.save(event); |
| 97 | +}); |
| 98 | + |
69 | 99 | enum RestrictionType { |
70 | 100 | "Invalid", |
71 | 101 | "Member", |
|
0 commit comments