From 2b38e6928cf551b9f6bcb18fbc3fdedfb2aed5ff Mon Sep 17 00:00:00 2001 From: Filippo Date: Mon, 29 Jan 2024 16:09:01 +0100 Subject: [PATCH 1/7] 183 fix collect tracking for evm lp investors (#195) * feat: include investmentManages EVM calls * chore: upgrade subql cli * feat: collect tracking for EVM LP investors Fixes #183 * feat: fix collect tracking for EVM LP investors Fixes #183 * fix: skipping logic * fix: update skip logic for redeem * feat: update tranche balances on LP_COLLECT * chore: getNodeChainId() helper * fix: skip foreign EVM investors * fix: missing save for CurrencyBalance * refactor: check for evm addresses * fix: update tests * fix: id notation --- .envrc | 1 + erc20.abi.json => abi/erc20.abi.json | 0 abi/investmentManager.abi.json | 15 + .../poolManager.abi.json | 0 chains-cfg/centrifuge.yaml | 2 +- chains-cfg/development-embrio.yaml | 2 +- chains-evm/_root.yaml | 6 +- chains-evm/eth/centrifuge.yaml | 6 +- package.json | 2 +- schema.graphql | 9 +- src/@types/gobal.d.ts | 4 + src/index.ts | 10 + src/mappings/handlers/evmHandlers.ts | 80 +++- src/mappings/handlers/investmentsHandlers.ts | 17 +- src/mappings/services/accountService.test.ts | 1 + src/mappings/services/accountService.ts | 11 +- src/mappings/services/blockchainService.ts | 10 +- .../services/currencyBalanceService.ts | 4 +- src/mappings/services/currencyService.ts | 9 +- src/mappings/services/epochService.ts | 3 - .../services/investorTransactionService.ts | 38 +- src/mappings/services/poolService.ts | 1 + src/mappings/services/trancheService.ts | 16 +- yarn.lock | 364 ++++++++++-------- 24 files changed, 401 insertions(+), 210 deletions(-) rename erc20.abi.json => abi/erc20.abi.json (100%) create mode 100644 abi/investmentManager.abi.json rename poolManager.abi.json => abi/poolManager.abi.json (100%) create mode 100644 src/@types/gobal.d.ts diff --git a/.envrc b/.envrc index 04bc0338..dfa3c81b 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,4 @@ +export COMPOSE_PROFILES=subql export DB_USER=postgres export DB_PASS=postgres export DB_DATABASE=postgres diff --git a/erc20.abi.json b/abi/erc20.abi.json similarity index 100% rename from erc20.abi.json rename to abi/erc20.abi.json diff --git a/abi/investmentManager.abi.json b/abi/investmentManager.abi.json new file mode 100644 index 00000000..56164969 --- /dev/null +++ b/abi/investmentManager.abi.json @@ -0,0 +1,15 @@ +[ + { + "inputs": [], + "name": "userEscrow", + "outputs": [ + { + "internalType": "contract UserEscrowLike", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/poolManager.abi.json b/abi/poolManager.abi.json similarity index 100% rename from poolManager.abi.json rename to abi/poolManager.abi.json diff --git a/chains-cfg/centrifuge.yaml b/chains-cfg/centrifuge.yaml index f49eb892..b76857d3 100644 --- a/chains-cfg/centrifuge.yaml +++ b/chains-cfg/centrifuge.yaml @@ -7,4 +7,4 @@ network: file: ./dist/chaintypes.js dataSources: - kind: substrate/Runtime - startBlock: 3824709 # block first pool was created at + startBlock: 3858140 # block first pool was created at diff --git a/chains-cfg/development-embrio.yaml b/chains-cfg/development-embrio.yaml index 9e43cf01..c83c784c 100644 --- a/chains-cfg/development-embrio.yaml +++ b/chains-cfg/development-embrio.yaml @@ -2,7 +2,7 @@ name: 'centrifuge-subql' repository: 'https://github.com/embrio-tech/centrifuge-subql' network: endpoint: wss://fullnode.demo.k-f.dev/public-ws - chainId: '0x27d6bdae3ea8fc7021792f3ccea5ee62fee37641c6f69d6e8530cfb45ef57a64' + chainId: '0xe0e40f62affe742eb92d75c07830671ef3e0cc6efc1ecaf81cf34a28148e91f0' chaintypes: file: ./dist/chaintypes.js dataSources: diff --git a/chains-evm/_root.yaml b/chains-evm/_root.yaml index 22ff290c..29e92a32 100644 --- a/chains-evm/_root.yaml +++ b/chains-evm/_root.yaml @@ -18,7 +18,9 @@ dataSources: abi: poolManager assets: poolManager: - file: './poolManager.abi.json' + file: './abi/poolManager.abi.json' + investmentManager: + file: './abi/investmentManager.abi.json' mapping: file: './dist/index.js' handlers: @@ -34,7 +36,7 @@ templates: abi: erc20 assets: erc20: - file: './erc20.abi.json' + file: './abi/erc20.abi.json' mapping: file: ./dist/index.js handlers: diff --git a/chains-evm/eth/centrifuge.yaml b/chains-evm/eth/centrifuge.yaml index 272dc220..b9ed03af 100644 --- a/chains-evm/eth/centrifuge.yaml +++ b/chains-evm/eth/centrifuge.yaml @@ -2,8 +2,12 @@ network: chainId: '1' # Ethereum Mainnet endpoint: "https://mainnet.infura.io/v3/a4ba76cd4be643618572e7467a444e3a" dictionary: "https://gx.api.subquery.network/sq/subquery/eth-dictionary" + bypassBlocks: + - "18721040-18735450" + - "18735460-18747630" + - "18747640-18763940" dataSources: - kind: ethereum/Runtime - startBlock: 18721000 + startBlock: 18721030 options: address: '0x78E9e622A57f70F1E0Ec652A4931E4e278e58142' diff --git a/package.json b/package.json index 7175d02d..47a96efd 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@jest/globals": "^29.2.0", "@polkadot/api": "^10", "@polkadot/typegen": "^10", - "@subql/cli": "latest", + "@subql/cli": "^4.2.5", "@subql/testing": "latest", "@subql/types": "latest", "@types/jest": "^29.1.2", diff --git a/schema.graphql b/schema.graphql index 005b7eae..cf001290 100644 --- a/schema.graphql +++ b/schema.graphql @@ -98,7 +98,7 @@ type Tranche @entity { interestRatePerSec: BigInt minRiskBuffer: BigInt - isActive: Boolean @index + isActive: Boolean! @index tokenSupply: BigInt tokenPrice: BigInt @@ -194,6 +194,8 @@ enum InvestorTransactionType { TRANSFER_OUT INVEST_COLLECT REDEEM_COLLECT + INVEST_LP_COLLECT + REDEEM_LP_COLLECT } type OutstandingOrder @entity { @@ -210,7 +212,7 @@ type OutstandingOrder @entity { } type InvestorTransaction @entity { - id: ID! # extrinsic hash - epoch number - transaction type + id: ID! # extrinsic hash - epoch number ( or 0 for EVM ) - transaction type hash: String! account: Account! @index #Account @index pool: Pool! @index @@ -366,12 +368,13 @@ type Proxy @entity { } type Currency @entity { - id: ID! #TODO: chainId - currencyType - [currencySpec] + id: ID! # chainId - currencySpec - [currencySpec] chain: Blockchain! decimals: Int! tokenAddress: String escrowAddress: String + userEscrowAddress: String pool: Pool tranche: Tranche diff --git a/src/@types/gobal.d.ts b/src/@types/gobal.d.ts new file mode 100644 index 00000000..b15d6902 --- /dev/null +++ b/src/@types/gobal.d.ts @@ -0,0 +1,4 @@ +export {} +declare global { + function getNodeChainId(): Promise +} diff --git a/src/index.ts b/src/index.ts index 4dc154d9..96c80da4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,17 @@ import '@polkadot/api-augment' import { atob } from 'abab' +import type { u64 } from '@polkadot/types' +import type { Provider } from '@ethersproject/providers' + +const cfgChainIdProm = 'query' in api ? (api.query.evmChainId.chainId() as Promise) : null +const ethNetworkProm = + typeof (api as unknown as Provider).getNetwork === 'function' ? (api as unknown as Provider).getNetwork() : null global.atob = atob +global.getNodeChainId = async function () { + if(cfgChainIdProm) return (await cfgChainIdProm).toString(10) + if(ethNetworkProm) return (await ethNetworkProm).chainId.toString(10) +} export * from './mappings/handlers/blockHandlers' export * from './mappings/handlers/poolsHandlers' diff --git a/src/mappings/handlers/evmHandlers.ts b/src/mappings/handlers/evmHandlers.ts index 0638dc13..5ca98579 100644 --- a/src/mappings/handlers/evmHandlers.ts +++ b/src/mappings/handlers/evmHandlers.ts @@ -9,13 +9,18 @@ import { InvestorTransactionData, InvestorTransactionService } from '../services import { CurrencyService } from '../services/currencyService' import { BlockchainService } from '../services/blockchainService' import { CurrencyBalanceService } from '../services/currencyBalanceService' -import { PoolManagerAbi__factory } from '../../types/contracts' +import { InvestmentManagerAbi__factory, PoolManagerAbi__factory } from '../../types/contracts' +import type { Provider } from '@ethersproject/abstract-provider' +import { TrancheBalanceService } from '../services/trancheBalanceService' + +const ethApi = api as unknown as Provider +//const networkPromise = typeof ethApi.getNetwork === 'function' ? ethApi.getNetwork() : null export const handleEvmDeployTranche = errorHandler(_handleEvmDeployTranche) async function _handleEvmDeployTranche(event: DeployTrancheLog): Promise { const [_poolId, _trancheId, tokenAddress] = event.args - const chainId = parseInt(event.transaction.chainId, 16).toString(10) + const chainId = await getNodeChainId() //(await networkPromise).chainId.toString(10) const blockchain = await BlockchainService.getOrInit(chainId) const poolId = _poolId.toString() @@ -29,10 +34,14 @@ async function _handleEvmDeployTranche(event: DeployTrancheLog): Promise { const tranche = await TrancheService.getOrSeed(pool.id, trancheId) const currency = await CurrencyService.getOrInitEvm(blockchain.id, tokenAddress) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const poolManager = PoolManagerAbi__factory.connect(event.address, api as any) + const poolManager = PoolManagerAbi__factory.connect(event.address, ethApi) const escrowAddress = await poolManager.escrow() - await currency.initEvmDetails(tokenAddress, escrowAddress, tranche.poolId, tranche.trancheId) + + const investmentManagerAddress = await poolManager.investmentManager() + const investmentManager = InvestmentManagerAbi__factory.connect(investmentManagerAddress, ethApi) + const userEscrowAddress = await investmentManager.userEscrow() + + await currency.initEvmDetails(tokenAddress, escrowAddress, userEscrowAddress, tranche.poolId, tranche.trancheId) await currency.save() await createTrancheTrackerDatasource({ address: tokenAddress }) @@ -46,14 +55,20 @@ async function _handleEvmTransfer(event: TransferLog): Promise { logger.info(`Transfer ${fromEvmAddress}-${toEvmAddress} of ${amount.toString()} at block: ${event.blockNumber}`) const evmTokenAddress = event.address - const chainId = parseInt(event.transaction.chainId, 16).toString(10) + const chainId = await getNodeChainId() //(await networkPromise).chainId.toString(10) const blockchain = await BlockchainService.getOrInit(chainId) const evmToken = await CurrencyService.getOrInitEvm(blockchain.id, evmTokenAddress) - const escrowAddress = evmToken.escrowAddress + const { escrowAddress, userEscrowAddress } = evmToken + const serviceAddresses = [evmTokenAddress, escrowAddress, userEscrowAddress, nullAddress] + + const isFromUserAddress = !serviceAddresses.includes(fromEvmAddress) + const isToUserAddress = !serviceAddresses.includes(toEvmAddress) + const isFromEscrow = fromEvmAddress === escrowAddress + const _isFromUserEscrow = fromEvmAddress === userEscrowAddress const orderData: Omit = { poolId: evmToken.poolId, - trancheId: evmToken.trancheId, + trancheId: evmToken.trancheId.split('-')[1], //epochNumber: pool.currentEpoch, hash: event.transactionHash, timestamp: new Date(Number(event.block.timestamp) * 1000), @@ -61,26 +76,53 @@ async function _handleEvmTransfer(event: TransferLog): Promise { amount: amount.toBigInt(), } - if (fromEvmAddress !== evmTokenAddress && fromEvmAddress !== escrowAddress && fromEvmAddress !== nullAddress) { - const fromAddress = AccountService.evmToSubstrate(fromEvmAddress, blockchain.id) - const fromAccount = await AccountService.getOrInit(fromAddress) + let fromAddress: string = null, + fromAccount: AccountService = null + if (isFromUserAddress) { + fromAddress = AccountService.evmToSubstrate(fromEvmAddress, blockchain.id) + fromAccount = await AccountService.getOrInit(fromAddress) + } - const txOut = InvestorTransactionService.transferOut({ ...orderData, address: fromAccount.id }) - await txOut.save() + let toAddress: string = null, + toAccount: AccountService = null + if (isToUserAddress) { + toAddress = AccountService.evmToSubstrate(toEvmAddress, blockchain.id) + toAccount = await AccountService.getOrInit(toAddress) + } + // Handle Currency Balance Updates + if (isToUserAddress) { + const toBalance = await CurrencyBalanceService.getOrInitEvm(toAddress, evmToken.id) + await toBalance.credit(amount.toBigInt()) + await toBalance.save() + } + + if (isFromUserAddress) { const fromBalance = await CurrencyBalanceService.getOrInitEvm(fromAddress, evmToken.id) await fromBalance.debit(amount.toBigInt()) await fromBalance.save() } - if (toEvmAddress !== evmTokenAddress && toEvmAddress !== escrowAddress && toEvmAddress !== nullAddress) { - const toAddress = AccountService.evmToSubstrate(toEvmAddress, blockchain.id) - const toAccount = await AccountService.getOrInit(toAddress) + // Handle INVEST_LP_COLLECT + if (isFromEscrow && isToUserAddress) { + const investLpCollect = InvestorTransactionService.collectLpInvestOrder({ ...orderData, address: toAccount.id }) + await investLpCollect.save() + + const trancheBalance = await TrancheBalanceService.getOrInit(toAccount.id, orderData.poolId, orderData.trancheId) + await trancheBalance.investCollect(orderData.amount) + await trancheBalance.save() + } + // TODO: Handle REDEEM_LP_COLLECT + // if (isFromUserEscrow && isToUserAddress) { + // const redeemLpCollect = InvestorTransactionService.collectLpRedeemOrder() + // } + + // Handle Transfer In and Out + if (isFromUserAddress && isToUserAddress) { const txIn = InvestorTransactionService.transferIn({ ...orderData, address: toAccount.id }) await txIn.save() - const toBalance = await CurrencyBalanceService.getOrInitEvm(toAddress, blockchain.id) - await toBalance.credit(amount.toBigInt()) - await toBalance.save() + const txOut = InvestorTransactionService.transferOut({ ...orderData, address: fromAccount.id }) + await txOut.save() } } diff --git a/src/mappings/handlers/investmentsHandlers.ts b/src/mappings/handlers/investmentsHandlers.ts index a87718a2..095d30a7 100644 --- a/src/mappings/handlers/investmentsHandlers.ts +++ b/src/mappings/handlers/investmentsHandlers.ts @@ -139,14 +139,17 @@ async function _handleInvestOrdersCollected(event: SubstrateEvent Promise.resolve('2030') // eslint-disable-next-line @typescript-eslint/no-explicit-any api.query['evmChainId'] = { chainId: jest.fn(() => ({ toString: () => '2030' })) } as any diff --git a/src/mappings/services/accountService.ts b/src/mappings/services/accountService.ts index 2dfa407d..b80be242 100644 --- a/src/mappings/services/accountService.ts +++ b/src/mappings/services/accountService.ts @@ -4,7 +4,7 @@ import { BlockchainService } from './blockchainService' const EVM_SUFFIX = '45564d00' export class AccountService extends Account { - static async init(address: string, blockchainService = BlockchainService) { + static async init(address: string) { logger.info(`Initialising new account: ${address}`) if (this.isEvm(address)) { const chainId = this.readEvmChainId(address) @@ -12,13 +12,13 @@ export class AccountService extends Account { account.evmAddress = address.substring(0, 42) return account } else { - return new this(address, await blockchainService.getThisChainId()) + return new this(address, await getNodeChainId()) } } static async getOrInit(address: string, blockchainService = BlockchainService): Promise { let account = (await this.get(address)) as AccountService - if (account === undefined) { + if (!account) { account = await this.init(address) await blockchainService.getOrInit(account.chainId) await account.save() @@ -39,6 +39,11 @@ export class AccountService extends Account { return address.length === 66 && address.endsWith(EVM_SUFFIX) } + public async isForeignEvm() { + const nodeChainId = await getNodeChainId() + return this.chainId !== nodeChainId + } + public isEvm() { return AccountService.isEvm(this.id) } diff --git a/src/mappings/services/blockchainService.ts b/src/mappings/services/blockchainService.ts index 6cabee3a..4b9ea1de 100644 --- a/src/mappings/services/blockchainService.ts +++ b/src/mappings/services/blockchainService.ts @@ -1,5 +1,5 @@ import { Blockchain } from '../../types/models/Blockchain' -import { u64 } from '@polkadot/types' +//import { u64 } from '@polkadot/types' export class BlockchainService extends Blockchain { static init(chainId: string) { logger.info(`Initialising new blockchain with evm Id ${chainId}`) @@ -7,7 +7,7 @@ export class BlockchainService extends Blockchain { } static async getOrInit(_chainId?: string) { - const chainId = _chainId ?? await this.getThisChainId() + const chainId = _chainId ?? await getNodeChainId()//(await this.getThisChainId()) let blockchain = await this.get(chainId) if (!blockchain) { blockchain = this.init(chainId) @@ -16,7 +16,7 @@ export class BlockchainService extends Blockchain { return blockchain as BlockchainService } - static async getThisChainId() { - return ((await api.query.evmChainId.chainId()) as u64).toString(10) - } + // static async getThisChainId() { + // return ((await api.query.evmChainId.chainId()) as u64).toString(10) + // } } diff --git a/src/mappings/services/currencyBalanceService.ts b/src/mappings/services/currencyBalanceService.ts index 2a23958f..be97bac6 100644 --- a/src/mappings/services/currencyBalanceService.ts +++ b/src/mappings/services/currencyBalanceService.ts @@ -17,7 +17,7 @@ export class CurrencyBalanceService extends CurrencyBalance { static async getOrInit(address: string, currency: string) { let currencyBalance = await this.getById(address, currency) - if (currencyBalance === undefined) { + if (!currencyBalance) { currencyBalance = this.init(address, currency) await currencyBalance.getBalance() await currencyBalance.save() @@ -27,7 +27,7 @@ export class CurrencyBalanceService extends CurrencyBalance { static async getOrInitEvm(address: string, currency: string) { let currencyBalance = await this.getById(address, currency) - if (currencyBalance === undefined) { + if (!currencyBalance) { currencyBalance = this.init(address, currency) await currencyBalance.save() } diff --git a/src/mappings/services/currencyService.ts b/src/mappings/services/currencyService.ts index a54720cc..c88fd095 100644 --- a/src/mappings/services/currencyService.ts +++ b/src/mappings/services/currencyService.ts @@ -37,9 +37,16 @@ export class CurrencyService extends Currency { return currency as CurrencyService } - public initEvmDetails(tokenAddress: string, escrowAddress: string, poolId: string, trancheId: string) { + public initEvmDetails( + tokenAddress: string, + escrowAddress: string, + userEscrowAddress: string, + poolId: string, + trancheId: string + ) { this.tokenAddress = tokenAddress this.escrowAddress = escrowAddress + this.userEscrowAddress = userEscrowAddress this.poolId = poolId this.trancheId = `${poolId}-${trancheId}` } diff --git a/src/mappings/services/epochService.ts b/src/mappings/services/epochService.ts index e969f6ef..0f56698b 100644 --- a/src/mappings/services/epochService.ts +++ b/src/mappings/services/epochService.ts @@ -89,9 +89,6 @@ export class EpochService extends Epoch { ), ]) - logger.info(JSON.stringify(investOrderFulfillment)) - logger.info(JSON.stringify(redeemOrderFulfillment)) - if (investOrderFulfillment.isNone || redeemOrderFulfillment.isNone) throw new Error('Failed to fetch epoch solutions') diff --git a/src/mappings/services/investorTransactionService.ts b/src/mappings/services/investorTransactionService.ts index 89daeb92..a65dd77e 100644 --- a/src/mappings/services/investorTransactionService.ts +++ b/src/mappings/services/investorTransactionService.ts @@ -14,6 +14,7 @@ const tokenTypes = [ InvestorTransactionType.REDEEM_ORDER_CANCEL, InvestorTransactionType.REDEEM_EXECUTION, InvestorTransactionType.INVEST_COLLECT, + InvestorTransactionType.INVEST_LP_COLLECT, InvestorTransactionType.TRANSFER_IN, InvestorTransactionType.TRANSFER_OUT, ] @@ -33,8 +34,9 @@ export interface InvestorTransactionData { export class InvestorTransactionService extends InvestorTransaction { static init(data: InvestorTransactionData, type: InvestorTransactionType) { + const epochRef = data.epochNumber ? data.epochNumber.toString() : '0' const tx = new this( - `${data.hash}-${data.epochNumber.toString()}-${type.toString()}`, + `${data.hash}-${epochRef}-${type.toString()}`, data.hash, data.address, data.poolId, @@ -84,29 +86,63 @@ export class InvestorTransactionService extends InvestorTransaction { } static updateInvestOrder(data: InvestorTransactionData) { + logger.info( + `Executing invest order update for address ${data.address} in pool ${data.poolId} tranche ${data.trancheId} ` + + `with amount: ${data.amount}` + ) return this.init(data, InvestorTransactionType.INVEST_ORDER_UPDATE) } static updateRedeemOrder(data: InvestorTransactionData) { + logger.info( + `Executing redeem order update for address ${data.address} in pool ${data.poolId} tranche ${data.trancheId} ` + + `with amount: ${data.amount}` + ) return this.init(data, InvestorTransactionType.REDEEM_ORDER_UPDATE) } static cancelInvestOrder(data: InvestorTransactionData) { + logger.info( + `Executing invest order cancel for address ${data.address} in pool ${data.poolId} tranche ${data.trancheId} ` + ) return this.init(data, InvestorTransactionType.INVEST_ORDER_CANCEL) } static cancelRedeemOrder(data: InvestorTransactionData) { + logger.info( + `Executing redeem order cancel for address ${data.address} in pool ${data.poolId} tranche ${data.trancheId} ` + ) return this.init(data, InvestorTransactionType.REDEEM_ORDER_CANCEL) } static collectInvestOrder(data: InvestorTransactionData) { + logger.info( + `Executing invest order collect for address ${data.address} in pool ${data.poolId} tranche ${data.trancheId} ` + ) return this.init(data, InvestorTransactionType.INVEST_COLLECT) } static collectRedeemOrder(data: InvestorTransactionData) { + logger.info( + `Executing redeem order collect for address ${data.address} in pool ${data.poolId} tranche ${data.trancheId} ` + ) return this.init(data, InvestorTransactionType.REDEEM_COLLECT) } + static collectLpInvestOrder(data: InvestorTransactionData) { + logger.info( + `Executing LP invest order collect for address ${data.address} in pool ${data.poolId} tranche ${data.trancheId} ` + ) + return this.init(data, InvestorTransactionType.INVEST_LP_COLLECT) + } + + static collectLpRedeemOrder(data: InvestorTransactionData) { + logger.info( + `Executing LP redeem order collect for address ${data.address} in pool ${data.poolId} tranche ${data.trancheId} ` + ) + return this.init(data, InvestorTransactionType.REDEEM_LP_COLLECT) + } + static transferIn(data: InvestorTransactionData) { logger.info( `Transfer In for address ${data.address} in pool ${data.poolId} tranche ${data.trancheId} ` + diff --git a/src/mappings/services/poolService.ts b/src/mappings/services/poolService.ts index 6bc749b8..c8f94c65 100644 --- a/src/mappings/services/poolService.ts +++ b/src/mappings/services/poolService.ts @@ -61,6 +61,7 @@ export class PoolService extends Pool { this.sumNumberOfLoans = BigInt(0) this.currencyId = currencyId + logger.info(this.currencyId) return this } diff --git a/src/mappings/services/trancheService.ts b/src/mappings/services/trancheService.ts index 04389092..8e2979fd 100644 --- a/src/mappings/services/trancheService.ts +++ b/src/mappings/services/trancheService.ts @@ -4,22 +4,16 @@ import { paginatedGetter } from '../../helpers/paginatedGetter' import { WAD } from '../../config' import { ExtendedRpc, TrancheDetails } from '../../helpers/types' import { Tranche, TrancheSnapshot } from '../../types' -import { TrancheProps } from '../../types/models/Tranche' +import { TrancheProps } from '../../types/models/Tranche' export class TrancheService extends Tranche { - static seed(poolId: string, trancheId: string) { - return new this( - `${poolId}-${trancheId}`, - 'ALL', - poolId, - trancheId - ) + return new this(`${poolId}-${trancheId}`, 'ALL', poolId, trancheId, false) } static async getOrSeed(poolId: string, trancheId: string) { let tranche = await this.getById(poolId, trancheId) - if(!tranche) { + if (!tranche) { tranche = this.seed(poolId, trancheId) await tranche.save() } @@ -29,8 +23,8 @@ export class TrancheService extends Tranche { public init(index: number, trancheData: TrancheDetails) { this.index = index this.isResidual = trancheData.trancheType.isResidual - ;(this.seniority = trancheData.seniority.toNumber()), (this.isActive = true) - + this.seniority = trancheData.seniority.toNumber() + this.isActive = true this.sumOutstandingInvestOrdersByPeriod = BigInt(0) this.sumOutstandingRedeemOrdersByPeriod = BigInt(0) this.sumOutstandingRedeemOrdersCurrencyByPeriod = BigInt(0) diff --git a/yarn.lock b/yarn.lock index c22e2c20..b497c60b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -71,19 +71,19 @@ semver "^6.3.0" "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.6.tgz#8be77cd77c55baadcc1eae1c33df90ab6d2151d4" - integrity sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw== + version "7.23.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.7.tgz#4d8016e06a14b5f92530a13ed0561730b5c6483f" + integrity sha512-+UpDgowcmqe36d4NwqvKsyPMlOLNGMsfMmQ5WGCu+siCe3t3dfe9njrzGfdN4qq+bcNUt0+Vw6haRxBOycs4dw== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.23.5" "@babel/generator" "^7.23.6" "@babel/helper-compilation-targets" "^7.23.6" "@babel/helper-module-transforms" "^7.23.3" - "@babel/helpers" "^7.23.6" + "@babel/helpers" "^7.23.7" "@babel/parser" "^7.23.6" "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.6" + "@babel/traverse" "^7.23.7" "@babel/types" "^7.23.6" convert-source-map "^2.0.0" debug "^4.1.0" @@ -146,9 +146,9 @@ semver "^6.3.1" "@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0", "@babel/helper-create-class-features-plugin@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.6.tgz#b04d915ce92ce363666f816a884cdcfc9be04953" - integrity sha512-cBXU1vZni/CpGF29iTu4YRbOZt3Wat6zCoMDxRF1MayiEc4URxOj31tT65HUM0CRpMowA3HCJaAOVOUnMf96cw== + version "7.23.7" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.7.tgz#b2e6826e0e20d337143655198b79d58fdc9bd43d" + integrity sha512-xCoqR/8+BoNnXOY7RVSgv6X+o7pmT5q1d+gGcRlXYkI+9B31glE4jeejhKVpA04O1AtzOt7OSQ6VYKP5FcRl9g== dependencies: "@babel/helper-annotate-as-pure" "^7.22.5" "@babel/helper-environment-visitor" "^7.22.20" @@ -301,13 +301,13 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.22.19" -"@babel/helpers@^7.18.9", "@babel/helpers@^7.21.0", "@babel/helpers@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.6.tgz#d03af2ee5fb34691eec0cda90f5ecbb4d4da145a" - integrity sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA== +"@babel/helpers@^7.18.9", "@babel/helpers@^7.21.0", "@babel/helpers@^7.23.7": + version "7.23.8" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.8.tgz#fc6b2d65b16847fd50adddbd4232c76378959e34" + integrity sha512-KDqYz4PiOWvDFrdHLPhKtCThtIcKVy6avWD2oG4GEvyQ+XDZwHD4YQd+H2vNMnq2rkdxsDkU82T+Vk8U/WXHRQ== dependencies: "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.6" + "@babel/traverse" "^7.23.7" "@babel/types" "^7.23.6" "@babel/highlight@^7.23.4": @@ -664,15 +664,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-classes@^7.18.9", "@babel/plugin-transform-classes@^7.21.0": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.5.tgz#e7a75f815e0c534cc4c9a39c56636c84fc0d64f2" - integrity sha512-jvOTR4nicqYC9yzOHIhXG5emiFEOpappSJAl73SDSEDcybD+Puuze8Tnpb9p9qEyYup24tq891gkaygIFvWDqg== + version "7.23.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.8.tgz#d08ae096c240347badd68cdf1b6d1624a6435d92" + integrity sha512-yAYslGsY1bX6Knmg46RjiCiNSwJKv2IUC8qOdYKqMMr0491SXFhcHqOdRDeCRohOOIzwN/90C6mQ9qAKgrP7dg== dependencies: "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-compilation-targets" "^7.23.6" "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-function-name" "^7.23.0" - "@babel/helper-optimise-call-expression" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-replace-supers" "^7.22.20" "@babel/helper-split-export-declaration" "^7.22.6" @@ -1118,9 +1117,9 @@ integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== "@babel/runtime@^7.11.2", "@babel/runtime@^7.18.9", "@babel/runtime@^7.21.0", "@babel/runtime@^7.8.4": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.6.tgz#c05e610dc228855dc92ef1b53d07389ed8ab521d" - integrity sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ== + version "7.23.8" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.8.tgz#8ee6fe1ac47add7122902f257b8ddf55c898f650" + integrity sha512-Y7KbAP984rn1VGMbGqKmBLio9V7y5Je9GvU4rQPCPinCyNfUcToxIXl06d59URp/F3LwinvODxab5N/G6qggkw== dependencies: regenerator-runtime "^0.14.0" @@ -1165,10 +1164,10 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.18.10", "@babel/traverse@^7.21.4", "@babel/traverse@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" - integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== +"@babel/traverse@^7.18.10", "@babel/traverse@^7.21.4", "@babel/traverse@^7.23.7": + version "7.23.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.7.tgz#9a7bf285c928cb99b5ead19c3b1ce5b310c9c305" + integrity sha512-tY3mM8rH9jM0YHFGyfC0/xf+SB5eKUu7HPj7/k3fpi9dAlsMc5YbQvDi0Sh2QTPXqMhyaAtzAr807TIyfQrmyg== dependencies: "@babel/code-frame" "^7.23.5" "@babel/generator" "^7.23.6" @@ -1685,9 +1684,9 @@ wasm-ast-types "^0.25.0" "@cosmwasm/ts-codegen@^0.35.3": - version "0.35.3" - resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.35.3.tgz#58f34683f7eb318b022f0418252fb710df69c293" - integrity sha512-L7T4yjAQIWJ/h0YmqVjihzv78ZbqGD/f0G8EJTwccsPXqWzbcnXzQKsvtFXpDp6AzaJKVMchFHfp6ZPRP3boUQ== + version "0.35.7" + resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.35.7.tgz#b88c03b732824113fc765d560504516faca6f23b" + integrity sha512-qbOAYJPe5O5AjoWytZcsVvM0SBA39sMpiqnVIIgjJiqp4G4D5GjR2/UV3ePpygnIxxKZWMnOpPPUvLMjflblCw== dependencies: "@babel/core" "7.18.10" "@babel/generator" "7.18.12" @@ -1715,7 +1714,7 @@ parse-package-name "1.0.0" rimraf "3.0.2" shelljs "0.8.5" - wasm-ast-types "^0.26.2" + wasm-ast-types "^0.26.4" "@cspotcode/source-map-support@^0.8.0": version "0.8.1" @@ -2099,9 +2098,9 @@ "@ethersproject/strings" "^5.7.0" "@grpc/grpc-js@^1.3.4": - version "1.9.13" - resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.9.13.tgz#ad9b7dbb6089c462469653c809996f13e46aa1cd" - integrity sha512-OEZZu9v9AA+7/tghMDE8o5DAMD5THVnwSqDWuh7PPYO5287rTyqy0xEHT6/e4pbqSrhyLPdQFsam4TwFQVVIIw== + version "1.9.14" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.9.14.tgz#236378822876cbf7903f9d61a0330410e8dcc5a1" + integrity sha512-nOpuzZ2G3IuMFN+UPPpKrC6NsLmWsTqSsm66IRfnBt1D4pwTqE27lmbpcPM+l2Ua4gE7PfjRHI6uedAy7hoXUw== dependencies: "@grpc/proto-loader" "^0.7.8" "@types/node" ">=12.12.47" @@ -2466,7 +2465,7 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18": version "0.3.20" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== @@ -2474,6 +2473,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.22" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c" + integrity sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" @@ -3191,17 +3198,17 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@subql/cli@latest": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@subql/cli/-/cli-4.2.4.tgz#389b2f06986d45e2871e3d6cb9b3364c97e6aef9" - integrity sha512-jkO9z4JusJMQR6TRh5EsERyre/2lvLHqBpAu9LQGIU0mlIUsb0EQFUuioghani8DsPTwwwdyodgszDPdYjz9Jw== +"@subql/cli@^4.2.5": + version "4.2.5" + resolved "https://registry.yarnpkg.com/@subql/cli/-/cli-4.2.5.tgz#390bce655c3496731bd431abff7727a6ccffa6dc" + integrity sha512-6gRqwbeCUHL9hcgjPnLM/HGL3i7gp2D2wOgOwAf3VFmdQ5yKOB6/Zyj4FPVtY4EV4aFQmAOd8mFvx04v+7+nmw== dependencies: "@oclif/core" "^2.15.0" "@subql/common" "3.3.1" "@subql/common-algorand" "^3.1.0" "@subql/common-concordium" "^3.3.2" "@subql/common-cosmos" "^4.0.0" - "@subql/common-ethereum" "^3.1.0" + "@subql/common-ethereum" "^3.1.2" "@subql/common-flare" "^3.1.0" "@subql/common-near" "^3.0.1" "@subql/common-stellar" "^3.0.0" @@ -3279,27 +3286,29 @@ js-yaml "^4.1.0" reflect-metadata "^0.1.13" -"@subql/common-ethereum@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@subql/common-ethereum/-/common-ethereum-3.1.0.tgz#ed46c4e8b6747e8b5c02d6037c588af8b01f179c" - integrity sha512-8ym5/6VAXnLBncDl/4kJ/fy1QkhH3CsPCuVa9atHJvHeYSdJc0qsyHaVBO0IEPt0ilcuI5nxUIDrisc2LGpGDQ== +"@subql/common-ethereum@^3.1.2": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@subql/common-ethereum/-/common-ethereum-3.2.0.tgz#00b8e41d3973901cbc8d065a6b88a8ef1f679719" + integrity sha512-/wAgX0/p9IO28CVlfme/Xg0V55BWqno+O/V4s+UBUJuumjTcEHouX0jbuyoTVI+xsYvglK3kpYcim58oHVk+pA== dependencies: - "@subql/common" "^3.3.0" - "@subql/types-ethereum" "3.2.0" + "@subql/common" "^3.3.1" + "@subql/types-ethereum" "3.2.1" "@typechain/ethers-v5" "^11.1.1" + "@zilliqa-js/crypto" "^3.5.0" js-yaml "^4.1.0" pino "^6.13.3" reflect-metadata "^0.1.13" typechain "^8.3.1" "@subql/common-flare@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@subql/common-flare/-/common-flare-3.1.0.tgz#635553381203be4023afbabef24f8c44ae570ab0" - integrity sha512-1YzIoYEAdlYVEyw6rXNesoM8WP4fBpEcova6kwWBF2oWlUYyY5tXpwPxeztjV6EpW1rNBJ2xjoWXElb+Vkaj+Q== + version "3.2.0" + resolved "https://registry.yarnpkg.com/@subql/common-flare/-/common-flare-3.2.0.tgz#7fac14f97b5e9f26c572744717f927ae46f8f755" + integrity sha512-HAaq9QbQKmkHJrQOU07Xufgm0RFm0fW937o+hHaJk7yWRcIZ3x7ARmq6BkeK8QlDFVbabKFJKvIqTZVIxRIrNg== dependencies: - "@subql/common" "^3.3.0" - "@subql/types-flare" "3.2.0" + "@subql/common" "^3.3.1" + "@subql/types-flare" "3.2.1" "@typechain/ethers-v5" "^11.1.1" + "@zilliqa-js/crypto" "^3.5.0" js-yaml "^4.1.0" pino "^6.13.3" reflect-metadata "^0.1.13" @@ -3420,21 +3429,21 @@ "@cosmjs/stargate" "^0.30.1" "@subql/types-core" "^0.4.0" -"@subql/types-ethereum@3.2.0": - version "3.2.0" - resolved "https://registry.yarnpkg.com/@subql/types-ethereum/-/types-ethereum-3.2.0.tgz#63a18d2c6f07b82aef737ddf38396ceabc98a875" - integrity sha512-TEv/RS0gr0I5MVGXLRMvz7HhJYPnvwjX7KuOHmZysxne4tcyoyscABhzzeHo7GYEDwzl7ECnuK0HVASy90wpSg== +"@subql/types-ethereum@3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@subql/types-ethereum/-/types-ethereum-3.2.1.tgz#32543d76c863734b67c5396f7802e1faa9b34a19" + integrity sha512-OXEWQb/G1dngGF6rsS6qjH2F56UZG7fk67BjMxZ0C52g93fVdVu5X5/nxXd7oNgQkoLrEuMED606YGscNpVP9A== dependencies: "@ethersproject/abstract-provider" "^5.6.1" - "@subql/types-core" "^0.3.0" + "@subql/types-core" "^0.4.0" -"@subql/types-flare@3.2.0": - version "3.2.0" - resolved "https://registry.yarnpkg.com/@subql/types-flare/-/types-flare-3.2.0.tgz#f6383c2fc88517dc4568a94eef63fdc95d129874" - integrity sha512-I2UteI8e2axDoBYGmShvYYInrTiZZWyJvboBNcyqwSsSJXL7Y+/VY3Bux5pv+fh0AlR+glghQnGW5BDhpXbK5Q== +"@subql/types-flare@3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@subql/types-flare/-/types-flare-3.2.1.tgz#9fc1228c296afbf1222853a5ce9654b32517f6a2" + integrity sha512-I5lYjgqUfsWxtJnkOShJxoBUqRBN8iBYIqCf3yJR37t8gAn2WUkI/Qejf7JaseS3Hi4ftLqjYAS5UyFv3Il9iA== dependencies: "@ethersproject/abstract-provider" "^5.6.1" - "@subql/types-core" "^0.3.0" + "@subql/types-core" "^0.4.0" "@subql/types-near@3.0.1": version "3.0.1" @@ -3517,9 +3526,9 @@ smoldot "2.0.7" "@substrate/ss58-registry@^1.44.0": - version "1.44.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.44.0.tgz#54f214e2a44f450b7bbc9252891c1879a54e0606" - integrity sha512-7lQ/7mMCzVNSEfDS4BCqnRnKCFKpcOaPrxMeGTXHX1YQzM/m2BBHjbK2C3dJvjv7GYxMiaTq/HdWQj1xS6ss+A== + version "1.46.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.46.0.tgz#bfe3e6a30d39929f57ecc178acde4e74a773e2b6" + integrity sha512-rBvWnlrBeFTd5LVG7oX3rOHzR16yqyffOFHKmUiVcblpXI3D89CXOvAljW9tWlA1H/2/FegaZnHPhdObPsvi+w== "@szmarczak/http-timer@^1.1.2": version "1.1.2" @@ -3619,9 +3628,9 @@ "@types/estree" "*" "@types/eslint@*": - version "8.44.9" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.9.tgz#5799663009645637bd1c45b2e1a7c8f4caf89534" - integrity sha512-6yBxcvwnnYoYT1Uk2d+jvIfsuP4mb2EdIxFnrPABj5a/838qe5bGkNLFOiipX4ULQ7XVQvTxOh7jO+BTAiqsEw== + version "8.56.2" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.2.tgz#1c72a9b794aa26a8b94ad26d5b9aa51c8a6384bb" + integrity sha512-uQDwm1wFHmbBbCZCqAlq6Do9LYwByNZHWzXppSnay9SuwJ+VRbjkbLABer54kcPnMSlG6Fdiy2yaFXm/z9Z5gw== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -3714,9 +3723,9 @@ integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g== "@types/node@*", "@types/node@>= 8", "@types/node@>=12.12.47", "@types/node@>=13.7.0": - version "20.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.5.tgz#47ad460b514096b7ed63a1dae26fad0914ed3ab2" - integrity sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== + version "20.11.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.5.tgz#be10c622ca7fcaa3cf226cf80166abc31389d86e" + integrity sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w== dependencies: undici-types "~5.26.4" @@ -3762,10 +3771,10 @@ resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.25.tgz#ac92b53e674c3b108decdbe88dc5f444a2f42f6a" integrity sha512-XOfUup9r3Y06nFAZh3WvO0rBU4OtlfPB/vgxpjg+NRdGU6CN6djdc6OEiH+PcqHCY6eFLo9Ista73uarf4gnBg== -"@types/validator@^13.7.1", "@types/validator@^13.7.10": - version "13.11.7" - resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.11.7.tgz#99e19760297667ae46b7069ec8b96cbfe0a08b98" - integrity sha512-q0JomTsJ2I5Mv7dhHhQLGjMvX0JJm5dyZ1DXQySIUzU1UlwzB8bt+R6+LODUbz0UDIOvEzGc28tk27gBJw2N8Q== +"@types/validator@^13.11.8", "@types/validator@^13.7.1": + version "13.11.8" + resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.11.8.tgz#bb1162ec0fe6f87c95ca812f15b996fcc5e1e2dc" + integrity sha512-c/hzNDBh7eRF+KbCf+OoZxKbnkpaK/cKp9iLQWqB7muXtM+MtL9SUUH8vCFcLn6dH1Qm05jiexK0ofWY7TfOhQ== "@types/yargs-parser@*": version "21.0.3" @@ -4000,6 +4009,34 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== +"@zilliqa-js/crypto@^3.5.0": + version "3.5.0" + resolved "https://registry.yarnpkg.com/@zilliqa-js/crypto/-/crypto-3.5.0.tgz#62288e660d737f8d256288f58d2d5cde39db29b7" + integrity sha512-KMTY4hREh706k0oqCJ7KTFCEgPvgWuckv7z1SkOc9UDjJnnfOD8KxGWrleaKMZOw+EjKJRybxgewPUvSZ+o7Mw== + dependencies: + "@zilliqa-js/util" "3.5.0" + aes-js "^3.1.1" + buffer "^6.0.3" + crypto-js "^4.2.0" + elliptic "^6.5.0" + hash.js "^1.1.5" + hmac-drbg "^1.0.1" + pbkdf2 "^3.0.16" + scrypt-js "^3.0.1" + scryptsy "^2.1.0" + tslib "2.3.1" + uuid "8.3.2" + +"@zilliqa-js/util@3.5.0": + version "3.5.0" + resolved "https://registry.yarnpkg.com/@zilliqa-js/util/-/util-3.5.0.tgz#ee76b7129dc4754ed754923b2c4e2f64b42630eb" + integrity sha512-YT8OhYAv2nCIrRTMMwXLDEqyV/O0jbtfc5Uvlb0qkIx56a4OeneebIJtBlTwf9ld7MZlU5LvvDOEJyljQErz6w== + dependencies: + bn.js "^4.11.8" + camelcase "^5.0.0" + long "^4.0.0" + tslib "2.3.1" + JSONStream@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -4031,11 +4068,16 @@ acorn-jsx@^5.3.2: integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-walk@^8.1.1: - version "8.3.1" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.1.tgz#2f10f5b69329d90ae18c58bf1fa8fccd8b959a43" - integrity sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw== + version "8.3.2" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" + integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== + +acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2: + version "8.11.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" + integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== -acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: +acorn@^8.9.0: version "8.11.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== @@ -4050,6 +4092,11 @@ aes-js@3.0.0: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== +aes-js@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" + integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== + ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" @@ -4319,11 +4366,11 @@ axios@^0.27.2: form-data "^4.0.0" axios@^1.4.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2" - integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A== + version "1.6.5" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.5.tgz#2c090da14aeeab3770ad30c3a1461bc970fb0cd8" + integrity sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg== dependencies: - follow-redirects "^1.15.0" + follow-redirects "^1.15.4" form-data "^4.0.0" proxy-from-env "^1.1.0" @@ -4492,7 +4539,7 @@ bn.js@5.2.1, bn.js@^5.0.0, bn.js@^5.2.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.8, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== @@ -4725,7 +4772,7 @@ camelcase-keys@^6.2.2: map-obj "^4.0.0" quick-lru "^4.0.1" -camelcase@^5.3.1: +camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -4736,9 +4783,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001565: - version "1.0.30001570" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz#b4e5c1fa786f733ab78fc70f592df6b3f23244ca" - integrity sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw== + version "1.0.30001579" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001579.tgz#45c065216110f46d6274311a4b3fcf6278e0852a" + integrity sha512-u5AUVkixruKHJjw/pj9wISlcMpgFWzSrczLZbrqBSxukQixmg0SJ5sZTpvaFvxU0HoQKd4yoyAogyrAz9pzJnA== capability@^0.2.5: version "0.2.5" @@ -4858,13 +4905,13 @@ class-validator@^0.13.2: validator "^13.7.0" class-validator@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.14.0.tgz#40ed0ecf3c83b2a8a6a320f4edb607be0f0df159" - integrity sha512-ct3ltplN8I9fOwUd8GrP8UQixwff129BkEtuWDKL5W45cQuLd19xqmTLu5ge78YDm/fdje6FMt0hGOhl0lii3A== + version "0.14.1" + resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.14.1.tgz#ff2411ed8134e9d76acfeb14872884448be98110" + integrity sha512-2VEG9JICxIqTpoK1eMzZqaV+u/EiwEJkMGzTrZf6sU/fwsnOITVgYJ8yojSy6CaXtO9V0Cc6ZQZ8h8m4UBuLwQ== dependencies: - "@types/validator" "^13.7.10" - libphonenumber-js "^1.10.14" - validator "^13.7.0" + "@types/validator" "^13.11.8" + libphonenumber-js "^1.10.53" + validator "^13.9.0" clean-stack@^3.0.0, clean-stack@^3.0.1: version "3.0.1" @@ -5147,9 +5194,9 @@ convert-source-map@^2.0.0: integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== core-js-compat@^3.21.0, core-js-compat@^3.22.1, core-js-compat@^3.25.1: - version "3.34.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.34.0.tgz#61a4931a13c52f8f08d924522bba65f8c94a5f17" - integrity sha512-4ZIyeNbW/Cn1wkMMDy+mvrRUxrwFNjKwbhCfQpDd+eLgYipDqp8oGFGtLmhh18EDPKA0g3VUBYOxQGGwvWLVpA== + version "3.35.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.35.1.tgz#215247d7edb9e830efa4218ff719beb2803555e2" + integrity sha512-sftHa5qUJY3rs9Zht1WEnmkvXputCyDBczPnr7QDgL8n3qrF3CMXY4VPSYtOLLiOUJcah2WNXREd48iOl6mQIw== dependencies: browserslist "^4.22.2" @@ -5277,6 +5324,11 @@ crypto-browserify@^3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" +crypto-js@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631" + integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== + crypto-random-string@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" @@ -5550,11 +5602,11 @@ electron-fetch@^1.7.2: encoding "^0.1.13" electron-to-chromium@^1.4.601: - version "1.4.615" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.615.tgz#b1c41839962d2e4e63dca05519da9040e34848c2" - integrity sha512-/bKPPcgZVUziECqDc+0HkT87+0zhaWSZHNXqF8FLd2lQcptpmUFwoCSWjCdOng9Gdq+afKArPdEg/0ZW461Eng== + version "1.4.642" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.642.tgz#eb380fa8b58e515c641d642ba452fa2c453c2e4f" + integrity sha512-M4+u22ZJGpk4RY7tne6W+APkZhnnhmAH48FNl8iEFK2lEgob+U5rUQsIqQhvAwCXYpfd3H20pHK/ENsCvwTbsA== -elliptic@6.5.4, elliptic@^6.5.3, elliptic@^6.5.4: +elliptic@6.5.4, elliptic@^6.5.0, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -6125,10 +6177,10 @@ flatted@^3.2.5, flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== -follow-redirects@^1.14.0, follow-redirects@^1.14.7, follow-redirects@^1.14.9, follow-redirects@^1.15.0: - version "1.15.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" - integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== +follow-redirects@^1.14.0, follow-redirects@^1.14.7, follow-redirects@^1.14.9, follow-redirects@^1.15.4: + version "1.15.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" + integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== foreground-child@^3.1.0: version "3.1.1" @@ -6525,7 +6577,7 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.5, hash.js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -7931,10 +7983,10 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -libphonenumber-js@^1.10.14, libphonenumber-js@^1.9.43: - version "1.10.52" - resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.10.52.tgz#786d7743e75aba1996824057b60003bb539f8daa" - integrity sha512-6vCuCHgem+OW1/VCAKgkasfegItCea8zIT7s9/CG/QxdCMIM7GfzbEBG5d7lGO3rzipjt5woOQL3DiHa8Fy78Q== +libphonenumber-js@^1.10.53, libphonenumber-js@^1.9.43: + version "1.10.54" + resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.10.54.tgz#8dfba112f49d1b9c2a160e55f9697f22e50f0841" + integrity sha512-P+38dUgJsmh0gzoRDoM4F5jLbyfztkU6PY6eSK6S5HwTi/LPvnwXqVCQZlAy1FxZ5c48q25QhxGQ0pq+WQcSlQ== libsodium-wrappers@^0.7.6: version "0.7.13" @@ -8406,16 +8458,16 @@ mock-socket@^9.3.1: integrity sha512-qxBgB7Qa2sEQgHFjj0dSigq7fX4k6Saisd5Nelwp2q8mlbAFh5dHV9JTTlF8viYJLSSWgMCZFUom8PJcMNBoJw== moment-timezone@^0.5.35: - version "0.5.43" - resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.43.tgz#3dd7f3d0c67f78c23cd1906b9b2137a09b3c4790" - integrity sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ== + version "0.5.44" + resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.44.tgz#a64a4e47b68a43deeab5ae4eb4f82da77cdf595f" + integrity sha512-nv3YpzI/8lkQn0U6RkLd+f0W/zy/JnoR5/EyPz/dNkPTBjA2jNLCVxaiQ8QpeLymhSZvX0wCL5s27NQWdOPwAw== dependencies: moment "^2.29.4" moment@^2.29.1, moment@^2.29.4: - version "2.29.4" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" - integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== + version "2.30.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" + integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== ms@2.0.0: version "2.0.0" @@ -8574,9 +8626,9 @@ node-fetch@^3.3.2: resolved "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz#1b5d62978f2ed07b99444f64f0df39f960a6d34d" node-gyp-build@^4.3.0, node-gyp-build@^4.6.0: - version "4.7.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.7.1.tgz#cd7d2eb48e594874053150a9418ac85af83ca8f7" - integrity sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg== + version "4.8.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.0.tgz#3fee9c1731df4581a3f9ead74664369ff00d26dd" + integrity sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og== node-int64@^0.4.0: version "0.4.0" @@ -8879,7 +8931,7 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pbkdf2@^3.0.3: +pbkdf2@^3.0.16, pbkdf2@^3.0.3: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== @@ -9032,9 +9084,9 @@ protobufjs@^6.10.2, protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: long "^4.0.0" protobufjs@^7.2.4: - version "7.2.5" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.5.tgz#45d5c57387a6d29a17aab6846dcc283f9b8e7f2d" - integrity sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A== + version "7.2.6" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.6.tgz#4a0ccd79eb292717aacf07530a07e0ed20278215" + integrity sha512-dgJaEDDL6x8ASUZ1YqWciTRrdOuYNzoOf27oHNfdyvKqHr5i0FV7FSLU+aIeFjyFgVxrpTOtQUi0BLLBymZaBw== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -9411,9 +9463,9 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: inherits "^2.0.1" rotating-file-stream@^3.0.2: - version "3.1.1" - resolved "https://registry.yarnpkg.com/rotating-file-stream/-/rotating-file-stream-3.1.1.tgz#1c126ab2d34ab19c703909922182468b66d6b893" - integrity sha512-PNF1iDkxcZG+T87uUzLlcO4aquTCyY8yl+Q/OTK4dMwhwWDYWU4ZATYeIXHmYVGIzqZ2MrpY4WIkYc9Bsc3Nzw== + version "3.2.1" + resolved "https://registry.yarnpkg.com/rotating-file-stream/-/rotating-file-stream-3.2.1.tgz#1d0a536d75884eedc3a677f5b0871fdc69f97d22" + integrity sha512-n2B18CJb+n2VA5Tdle+1NP2toEcRv68CjAOBjHmwcyswNwMVsrN3gVRZ9ymH3sapaiGY8jc9OhhV5b6I5rAeiA== run-applescript@^5.0.0: version "5.0.0" @@ -9479,11 +9531,16 @@ schema-utils@^3.1.1, schema-utils@^3.2.0: ajv "^6.12.5" ajv-keywords "^3.5.2" -scrypt-js@3.0.1: +scrypt-js@3.0.1, scrypt-js@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== +scryptsy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-2.1.0.tgz#8d1e8d0c025b58fdd25b6fa9a0dc905ee8faa790" + integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== + semver-diff@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" @@ -9514,9 +9571,9 @@ sequelize-pool@^7.1.0: integrity sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg== serialize-javascript@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" - integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w== + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== dependencies: randombytes "^2.1.0" @@ -9572,9 +9629,9 @@ signal-exit@^4.0.1: integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== simple-git@^3.16.0: - version "3.21.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.21.0.tgz#fb7b42749f53e7a53dfd213540d78b74e0aabe13" - integrity sha512-oTzw9248AF5bDTMk9MrxsRzEzivMlY+DWH0yWS4VYpMhNLhDWnN06pCtaUyPnqv/FpsdeNmRqmZugMABHRPdDA== + version "3.22.0" + resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.22.0.tgz#616d41c661e30f9c65778956317d422b1729a242" + integrity sha512-6JujwSs0ac82jkGjMHiCnTifvf1crOiY/+tfs/Pqih6iow7VrpNKRRNdWm6RtaXpvvv/JGNYhlUtLhGFqHF+Yw== dependencies: "@kwsites/file-exists" "^1.1.1" "@kwsites/promise-deferred" "^1.1.1" @@ -9622,9 +9679,9 @@ sodium-native@^3.3.0: node-gyp-build "^4.3.0" sodium-native@^4.0.1: - version "4.0.4" - resolved "https://registry.yarnpkg.com/sodium-native/-/sodium-native-4.0.4.tgz#561b7c39c97789f8202d6fd224845fe2e8cd6879" - integrity sha512-faqOKw4WQKK7r/ybn6Lqo1F9+L5T6NlBJJYvpxbZPetpWylUVqz449mvlwIBKBqxEHbWakWuOlUt8J3Qpc4sWw== + version "4.0.5" + resolved "https://registry.yarnpkg.com/sodium-native/-/sodium-native-4.0.5.tgz#76f6c742027df2db074725fedcb85d542a0c842c" + integrity sha512-YGimGhy7Ho6pTAAvuNdn3Tv9C2MD7HP89X1omReHat0Fd1mMnapGqwzb5YoHTAbIEh8tQmKP6+uLlwYCkf+EOA== dependencies: node-gyp-build "^4.6.0" @@ -9987,20 +10044,20 @@ tar@^6.1.11: yallist "^4.0.0" terser-webpack-plugin@^5.3.7: - version "5.3.9" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz#832536999c51b46d468067f9e37662a3b96adfe1" - integrity sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA== + version "5.3.10" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" + integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w== dependencies: - "@jridgewell/trace-mapping" "^0.3.17" + "@jridgewell/trace-mapping" "^0.3.20" jest-worker "^27.4.5" schema-utils "^3.1.1" serialize-javascript "^6.0.1" - terser "^5.16.8" + terser "^5.26.0" -terser@^5.16.8: - version "5.26.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.26.0.tgz#ee9f05d929f4189a9c28a0feb889d96d50126fe1" - integrity sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ== +terser@^5.26.0: + version "5.27.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.27.0.tgz#70108689d9ab25fef61c4e93e808e9fd092bf20c" + integrity sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" @@ -10219,6 +10276,11 @@ ts-node@^8.6.2: source-map-support "^0.5.17" yn "3.1.1" +tslib@2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" + integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== + tslib@^1.10.0, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -10458,11 +10520,11 @@ util@^0.10.3: inherits "2.0.3" utility-types@^3.7.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b" - integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg== + version "3.11.0" + resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.11.0.tgz#607c40edb4f258915e901ea7995607fdf319424c" + integrity sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw== -uuid@^8.3.2: +uuid@8.3.2, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== @@ -10489,7 +10551,7 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -validator@^13.7.0: +validator@^13.7.0, validator@^13.9.0: version "13.11.0" resolved "https://registry.yarnpkg.com/validator/-/validator-13.11.0.tgz#23ab3fd59290c61248364eabf4067f04955fbb1b" integrity sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ== @@ -10536,10 +10598,10 @@ wasm-ast-types@^0.25.0: case "1.6.3" deepmerge "4.2.2" -wasm-ast-types@^0.26.2: - version "0.26.2" - resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.26.2.tgz#704b40c5d2374ccb56354bf7c57cde9a1969d1d9" - integrity sha512-DM34W0Sexd/BreN4g1ZjfaDC8hkKIw3FykV7vT9KdhCoroH+Qncz+jvSEI0fEDqbtJkWiP9Z+u61a5LPObHKaA== +wasm-ast-types@^0.26.4: + version "0.26.4" + resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.26.4.tgz#cade0616c7158a0d05df8d6b8cac5cc098385fd1" + integrity sha512-bMxkQzc/+e7s5W+EBfurl/Y7KnTm0YPeg/cXjyio3PHULKWQULMREgyuJXJWaIa+8sKI1+OI61YeFSJBilm9YQ== dependencies: "@babel/runtime" "^7.18.9" "@babel/types" "7.18.10" From e0a4f21ac077ac8f7b79fdb5ddcbbb8cb49d727c Mon Sep 17 00:00:00 2001 From: Filippo Fontana Date: Mon, 29 Jan 2024 22:16:43 +0100 Subject: [PATCH 2/7] fix: init tranche currency details on tranche creation --- src/mappings/handlers/evmHandlers.ts | 2 +- src/mappings/handlers/poolsHandlers.ts | 13 ++++++++++++- src/mappings/services/currencyService.ts | 16 ++++++++-------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/mappings/handlers/evmHandlers.ts b/src/mappings/handlers/evmHandlers.ts index 5ca98579..a772d553 100644 --- a/src/mappings/handlers/evmHandlers.ts +++ b/src/mappings/handlers/evmHandlers.ts @@ -41,7 +41,7 @@ async function _handleEvmDeployTranche(event: DeployTrancheLog): Promise { const investmentManager = InvestmentManagerAbi__factory.connect(investmentManagerAddress, ethApi) const userEscrowAddress = await investmentManager.userEscrow() - await currency.initEvmDetails(tokenAddress, escrowAddress, userEscrowAddress, tranche.poolId, tranche.trancheId) + await currency.initTrancheDetails(tranche.poolId, tranche.trancheId, tokenAddress, escrowAddress, userEscrowAddress) await currency.save() await createTrancheTrackerDatasource({ address: tokenAddress }) diff --git a/src/mappings/handlers/poolsHandlers.ts b/src/mappings/handlers/poolsHandlers.ts index 4ffe5266..ed3a731b 100644 --- a/src/mappings/handlers/poolsHandlers.ts +++ b/src/mappings/handlers/poolsHandlers.ts @@ -52,6 +52,10 @@ async function _handlePoolCreated(event: SubstrateEvent): Prom await tranche.init(index, trancheData[tranche.trancheId].data) await tranche.updateSupply() await tranche.save() + + const currency = await CurrencyService.getOrInit(blockchain.id, 'Tranche', pool.id, tranche.trancheId) + await currency.initTrancheDetails(pool.id, tranche.trancheId) + await currency.save() } // Initialise Epoch @@ -65,8 +69,11 @@ async function _handlePoolUpdated(event: SubstrateEvent): Prom const [poolId] = event.event.data logger.info(`Pool ${poolId.toString()} updated on block ${event.block.block.header.number}`) + const chainId = await getNodeChainId() + const blockchain = await BlockchainService.getOrInit(chainId) + const pool = await PoolService.getById(poolId.toString()) - if (pool === undefined) throw missingPool + if (!pool) throw missingPool await pool.initData() await pool.save() @@ -88,6 +95,10 @@ async function _handlePoolUpdated(event: SubstrateEvent): Prom await trancheService.updateSupply() await trancheService.updateDebt(tranche.data.debt.toBigInt()) await trancheService.save() + + const currency = await CurrencyService.getOrInit(blockchain.id, 'Tranche', pool.id, trancheService.trancheId) + await currency.initTrancheDetails(pool.id, trancheService.trancheId) + await currency.save() } } diff --git a/src/mappings/services/currencyService.ts b/src/mappings/services/currencyService.ts index c88fd095..d269bab3 100644 --- a/src/mappings/services/currencyService.ts +++ b/src/mappings/services/currencyService.ts @@ -37,18 +37,18 @@ export class CurrencyService extends Currency { return currency as CurrencyService } - public initEvmDetails( - tokenAddress: string, - escrowAddress: string, - userEscrowAddress: string, + public initTrancheDetails( poolId: string, - trancheId: string + trancheId: string, + evmTokenAddress?: string, + evmEscrowAddress?: string, + evmUserEscrowAddress?: string ) { - this.tokenAddress = tokenAddress - this.escrowAddress = escrowAddress - this.userEscrowAddress = userEscrowAddress this.poolId = poolId this.trancheId = `${poolId}-${trancheId}` + this.tokenAddress = evmTokenAddress + this.escrowAddress = evmEscrowAddress + this.userEscrowAddress = evmUserEscrowAddress } } From 76ec367ffcdd5fb21d813aea0e8b4bfbd3d7038a Mon Sep 17 00:00:00 2001 From: Filippo Fontana Date: Tue, 30 Jan 2024 14:08:22 +0100 Subject: [PATCH 3/7] fix: currency balance offset --- src/mappings/handlers/evmHandlers.ts | 5 ++--- src/mappings/handlers/ormlTokensHandlers.ts | 17 +++++++-------- .../services/currencyBalanceService.ts | 21 +++++++++---------- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/mappings/handlers/evmHandlers.ts b/src/mappings/handlers/evmHandlers.ts index a772d553..5c4661a1 100644 --- a/src/mappings/handlers/evmHandlers.ts +++ b/src/mappings/handlers/evmHandlers.ts @@ -46,7 +46,6 @@ async function _handleEvmDeployTranche(event: DeployTrancheLog): Promise { await createTrancheTrackerDatasource({ address: tokenAddress }) } - const nullAddress = '0x0000000000000000000000000000000000000000' export const handleEvmTransfer = errorHandler(_handleEvmTransfer) @@ -92,13 +91,13 @@ async function _handleEvmTransfer(event: TransferLog): Promise { // Handle Currency Balance Updates if (isToUserAddress) { - const toBalance = await CurrencyBalanceService.getOrInitEvm(toAddress, evmToken.id) + const toBalance = await CurrencyBalanceService.getOrInit(toAddress, evmToken.id) await toBalance.credit(amount.toBigInt()) await toBalance.save() } if (isFromUserAddress) { - const fromBalance = await CurrencyBalanceService.getOrInitEvm(fromAddress, evmToken.id) + const fromBalance = await CurrencyBalanceService.getOrInit(fromAddress, evmToken.id) await fromBalance.debit(amount.toBigInt()) await fromBalance.save() } diff --git a/src/mappings/handlers/ormlTokensHandlers.ts b/src/mappings/handlers/ormlTokensHandlers.ts index c900f359..a1fb18b4 100644 --- a/src/mappings/handlers/ormlTokensHandlers.ts +++ b/src/mappings/handlers/ormlTokensHandlers.ts @@ -16,6 +16,7 @@ async function _handleTokenTransfer(event: SubstrateEvent): // Skip token transfers from and to excluded addresses const fromAddress = String.fromCharCode(...from.toU8a()) const toAddress = String.fromCharCode(...to.toU8a()) + logger.info(`fromAddress: ${fromAddress} toAddress: ${toAddress}`) const isFromExcludedAddress = fromAddress.startsWith('pool') || fromAddress.startsWith('invs') || fromAddress.startsWith('domn') const isToExcludedAddress = @@ -26,12 +27,6 @@ async function _handleTokenTransfer(event: SubstrateEvent): AccountService.getOrInit(to.toHex()), ]) - const pool = _currency.isTranche ? await PoolService.getById(_currency.asTranche[0].toString()) : null - if (pool === undefined) throw missingPool - - const tranche = _currency.isTranche ? await TrancheService.getById(pool.id, _currency.asTranche[1].toString()) : null - if (tranche === undefined) throw new Error('Tranche not found!') - const blockchain = await BlockchainService.getOrInit() const currency = await CurrencyService.getOrInit( blockchain.id, @@ -41,6 +36,12 @@ async function _handleTokenTransfer(event: SubstrateEvent): // TRANCHE TOKEN TRANSFERS BETWEEN INVESTORS if (_currency.isTranche && !isFromExcludedAddress && !isToExcludedAddress) { + const pool = await PoolService.getById(_currency.asTranche[0].toString()) + if(!pool) throw missingPool + + const tranche = await TrancheService.getById(pool.id, _currency.asTranche[1].toString()) + if(!tranche) throw missingPool + logger.info( `Tranche Token transfer between investors tor tranche: ${pool.id}-${tranche.trancheId}. ` + `from: ${from.toHex()} to: ${to.toHex()} amount: ${amount.toString()} ` + @@ -73,19 +74,17 @@ async function _handleTokenTransfer(event: SubstrateEvent): // TRACK CURRENCY TOKEN TRANSFER logger.info( - `Currency transfer ${currency.id} from: ${from.toHex()} to: ${to.toHex()} amount: ${amount.toString()} ` + + `Currency transfer ${currency.id} from: ${fromAccount.id} to: ${toAccount.id} amount: ${amount.toString()} ` + `at block ${event.block.block.header.number.toString()}` ) if (!isFromExcludedAddress) { - const fromAccount = await AccountService.getOrInit(from.toHex()) const fromCurrencyBalance = await CurrencyBalanceService.getOrInit(fromAccount.id, currency.id) await fromCurrencyBalance.debit(amount.toBigInt()) await fromCurrencyBalance.save() } if (!isToExcludedAddress) { - const toAccount = await AccountService.getOrInit(to.toHex()) const toCurrencyBalance = await CurrencyBalanceService.getOrInit(toAccount.id, currency.id) await toCurrencyBalance.credit(amount.toBigInt()) await toCurrencyBalance.save() diff --git a/src/mappings/services/currencyBalanceService.ts b/src/mappings/services/currencyBalanceService.ts index be97bac6..89439814 100644 --- a/src/mappings/services/currencyBalanceService.ts +++ b/src/mappings/services/currencyBalanceService.ts @@ -4,7 +4,7 @@ import { formatEnumPayload } from './currencyService' export class CurrencyBalanceService extends CurrencyBalance { static init(address: string, currency: string) { - logger.info(`Initialising new CurrencyBalance: ${address}-${currency}`) + logger.info(`Initialising new CurrencyBalance: ${address}-${currency} to 0`) const currencyBalance = new this(`${address}-${currency}`, address, currency, BigInt(0)) return currencyBalance } @@ -16,16 +16,6 @@ export class CurrencyBalanceService extends CurrencyBalance { } static async getOrInit(address: string, currency: string) { - let currencyBalance = await this.getById(address, currency) - if (!currencyBalance) { - currencyBalance = this.init(address, currency) - await currencyBalance.getBalance() - await currencyBalance.save() - } - return currencyBalance - } - - static async getOrInitEvm(address: string, currency: string) { let currencyBalance = await this.getById(address, currency) if (!currencyBalance) { currencyBalance = this.init(address, currency) @@ -39,13 +29,22 @@ export class CurrencyBalanceService extends CurrencyBalance { const enumPayload = formatEnumPayload(currencyType, ...currencySpec) const balanceResponse = await api.query.ormlTokens.accounts(this.accountId, enumPayload) this.amount = balanceResponse.free.toBigInt() + logger.info(`Fetched initial balance of for CurrencyBalance ${this.id} of ${this.amount.toString(10)}`) } public credit(amount: bigint) { + logger.info( + `Crediting CurrencyBalance ${this.id} with balance: ${this.amount.toString(10)} for amount: ${amount.toString( + 10 + )}` + ) this.amount += amount } public debit(amount: bigint) { + logger.info( + `Debiting CurrencyBalance ${this.id} with balance: ${this.amount.toString(10)} for amount: ${amount.toString(10)}` + ) this.amount -= amount } } From 810f887537c763f3ccfc92eb917bc6050627e9a4 Mon Sep 17 00:00:00 2001 From: Filippo Fontana Date: Tue, 30 Jan 2024 14:18:35 +0100 Subject: [PATCH 4/7] fix: pool seeding reference warnings --- src/mappings/handlers/poolsHandlers.ts | 2 +- src/mappings/services/poolService.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mappings/handlers/poolsHandlers.ts b/src/mappings/handlers/poolsHandlers.ts index ed3a731b..09117f97 100644 --- a/src/mappings/handlers/poolsHandlers.ts +++ b/src/mappings/handlers/poolsHandlers.ts @@ -26,7 +26,7 @@ async function _handlePoolCreated(event: SubstrateEvent): Prom ) // Initialise Pool - const pool = await PoolService.getOrSeed(poolId.toString()) + const pool = await PoolService.getOrSeed(poolId.toString(), false) await pool.init( currency.id, essence.maxReserve.toBigInt(), diff --git a/src/mappings/services/poolService.ts b/src/mappings/services/poolService.ts index c8f94c65..09f0b8f8 100644 --- a/src/mappings/services/poolService.ts +++ b/src/mappings/services/poolService.ts @@ -11,11 +11,11 @@ export class PoolService extends Pool { return new this(`${poolId}`, 'ALL', false) } - static async getOrSeed(poolId: string) { + static async getOrSeed(poolId: string, saveSeed = true) { let pool = await this.getById(poolId) if(!pool) { pool = this.seed(poolId) - await pool.save() + if(saveSeed) await pool.save() } return pool } @@ -61,7 +61,6 @@ export class PoolService extends Pool { this.sumNumberOfLoans = BigInt(0) this.currencyId = currencyId - logger.info(this.currencyId) return this } From 053048bd8ea6357c4d88645b24aac301dfa75357 Mon Sep 17 00:00:00 2001 From: Filippo Fontana Date: Wed, 31 Jan 2024 11:36:10 +0100 Subject: [PATCH 5/7] chore: commenting --- src/mappings/services/blockchainService.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mappings/services/blockchainService.ts b/src/mappings/services/blockchainService.ts index 4b9ea1de..018a66e7 100644 --- a/src/mappings/services/blockchainService.ts +++ b/src/mappings/services/blockchainService.ts @@ -15,8 +15,4 @@ export class BlockchainService extends Blockchain { } return blockchain as BlockchainService } - - // static async getThisChainId() { - // return ((await api.query.evmChainId.chainId()) as u64).toString(10) - // } } From 9f11cc697ef478d49ae14139bfa186aafb3e7290 Mon Sep 17 00:00:00 2001 From: Filippo Date: Wed, 31 Jan 2024 12:17:10 +0100 Subject: [PATCH 6/7] 187 add celo indexing (#196) * feat: add celo indexing Fixes #187 * chore: set startBlock close to tranche deploy * ci: fix gh actions --- .github/workflows/subql_deploy_workflow.yaml | 1 + .github/workflows/test.yml | 1 + chains-evm/celo/centrifuge.yaml | 9 +++++++++ subquery-multichain.yaml | 1 + 4 files changed, 12 insertions(+) create mode 100644 chains-evm/celo/centrifuge.yaml diff --git a/.github/workflows/subql_deploy_workflow.yaml b/.github/workflows/subql_deploy_workflow.yaml index 94e726b0..67f80beb 100644 --- a/.github/workflows/subql_deploy_workflow.yaml +++ b/.github/workflows/subql_deploy_workflow.yaml @@ -52,6 +52,7 @@ jobs: cp chains-evm/_root.yaml project-centrifuge.yaml cp chains-evm/_root.yaml project-ethereum.yaml cp chains-evm/_root.yaml project-base.yaml + cp chains-evm/_root.yaml project-celo.yaml yarn codegen - name: SubQL CLI Version run: yarn subql --version diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4d4221a3..bb3f493c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,7 @@ jobs: cp chains-evm/_root.yaml project-centrifuge.yaml cp chains-evm/_root.yaml project-ethereum.yaml cp chains-evm/_root.yaml project-base.yaml + cp chains-evm/_root.yaml project-celo.yaml yarn codegen - name: Build run: yarn build diff --git a/chains-evm/celo/centrifuge.yaml b/chains-evm/celo/centrifuge.yaml new file mode 100644 index 00000000..8917a0d2 --- /dev/null +++ b/chains-evm/celo/centrifuge.yaml @@ -0,0 +1,9 @@ +network: + chainId: '42220' #Celo Mainnet + endpoint: https://celo-mainnet.infura.io/v3/ed5e0e19bcbc427cbf8f661736d44516 + #dictionary: "" +dataSources: + - kind: ethereum/Runtime + startBlock: 23428180 + options: + address: '0x78E9e622A57f70F1E0Ec652A4931E4e278e58142' \ No newline at end of file diff --git a/subquery-multichain.yaml b/subquery-multichain.yaml index 2314fd31..a2c465ac 100644 --- a/subquery-multichain.yaml +++ b/subquery-multichain.yaml @@ -6,3 +6,4 @@ projects: - project-centrifuge.yaml - project-base.yaml - project-ethereum.yaml + - project-celo.yaml From 533b091b6426cfb63590ac15c7912169aa9de2be Mon Sep 17 00:00:00 2001 From: Filippo Fontana Date: Wed, 31 Jan 2024 12:34:52 +0100 Subject: [PATCH 7/7] fix: nodes versions --- .github/workflows/subql_deploy_workflow.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/subql_deploy_workflow.yaml b/.github/workflows/subql_deploy_workflow.yaml index 67f80beb..eef7a724 100644 --- a/.github/workflows/subql_deploy_workflow.yaml +++ b/.github/workflows/subql_deploy_workflow.yaml @@ -28,9 +28,9 @@ jobs: subql_deploy_workflow: runs-on: ubuntu-latest env: - SUBQL_INDEXER_VERSION: v3.4.10 - SUBQL_ETH_INDEXER_VERSION: v3.1.2 - SUBQL_QUERY_VERSION: v2.8.0 + SUBQL_INDEXER_VERSION: v3.5.0 + SUBQL_ETH_INDEXER_VERSION: v3.7.0 + SUBQL_QUERY_VERSION: v2.9.0 CHAIN_ID: ${{ inputs.chainId }} SUBQL_ACCESS_TOKEN: ${{ secrets.accessToken }} SUBQL_PROJ_ORG: ${{ inputs.projOrg }}