diff --git a/apollo/.env.test b/apollo/.env.test index 4f90efa7..684ce13c 100644 --- a/apollo/.env.test +++ b/apollo/.env.test @@ -20,6 +20,6 @@ LN_ARBITRUM_DEFAULT_ENDPOINT = https://api.studio.thegraph.com/query/61328/ln-de LN_ARBITRUM_OPPOSITE_ENDPOINT = https://api.studio.thegraph.com/query/61328/ln-opposite-arbisepolia/version/latest LN_ZKSYNC_DEFAULT_ENDPOINT = https://api.studio.thegraph.com/query/61328/ln-default-zksepolia/version/latest -ETHEREUM_LNV3_ENDPOINT=https://api.studio.thegraph.com/query/61328/lnv3-sepolia/v1.0.3 -ARBITRUM_LNV3_ENDPOINT=https://api.studio.thegraph.com/query/61328/lnv3-arbitrum-sepolia/v1.0.3 -ZKSYNC_LNV3_ENDPOINT=https://api.studio.thegraph.com/query/61328/lnv3-zksepolia/v1.0.3 +ETHEREUM_LNV3_ENDPOINT=https://api.studio.thegraph.com/query/61328/lnv3-sepolia/v1.0.5 +ARBITRUM_LNV3_ENDPOINT=https://api.studio.thegraph.com/query/61328/lnv3-arbitrum-sepolia/v1.0.5 +ZKSYNC_LNV3_ENDPOINT=https://api.studio.thegraph.com/query/61328/lnv3-zksepolia/v1.0.5 diff --git a/apollo/src/aggregation/aggregation.resolver.ts b/apollo/src/aggregation/aggregation.resolver.ts index d2061ac4..fd853266 100644 --- a/apollo/src/aggregation/aggregation.resolver.ts +++ b/apollo/src/aggregation/aggregation.resolver.ts @@ -79,8 +79,8 @@ export class AggregationResolver { const isValid = (item) => !Object.values(item).some((value) => isUndefined(value) || isNull(value) || value === ''); - const accFilters = [{ sender: sender.toLowerCase() }, { recipient }].filter(isValid); - const relayerFilters = [{ relayer: relayer.toLowerCase() }, { needWithdrawLiquidity }].filter(isValid); + const accFilters = [{ sender: sender?.toLowerCase() }, { recipient }].filter(isValid); + const relayerFilters = [{ relayer: relayer?.toLowerCase() }, { needWithdrawLiquidity }].filter(isValid); const accountCondition = accFilters.length ? { OR: accFilters } : {}; const relayerCondition = relayerFilters.length ? { AND: relayerFilters } : {}; const resultCondition = results && results.length ? { result: { in: results } } : {}; @@ -89,7 +89,7 @@ export class AggregationResolver { const toChainCondition = toChains && toChains.length ? { toChain: { in: toChains } } : {}; const bridgeCondition = bridges && bridges.length ? { bridge: { in: bridges } } : {}; const recvTokenCondition = - recvTokenAddress && recvTokenAddress.length ? { recvTokenAddress: recvTokenAddress.toLowerCase() } : {}; + recvTokenAddress && recvTokenAddress.length ? { recvTokenAddress: recvTokenAddress?.toLowerCase() } : {}; const chainConditions = { AND: { ...resultCondition, diff --git a/subgraph/lnv3/generate.sh b/subgraph/lnv3/generate.sh index ed997be7..5ba243d1 100644 --- a/subgraph/lnv3/generate.sh +++ b/subgraph/lnv3/generate.sh @@ -35,6 +35,7 @@ dataSources: handler: handleSlashRequest - event: TransferFilled(bytes32,address) handler: handleTransferFilled + receipt: true - event: LnProviderPaused(address,uint256,address,address,bool) handler: handleLnProviderPaused - event: LiquidityWithdrawn(bytes32[],address,uint256) diff --git a/subgraph/lnv3/schema.graphql b/subgraph/lnv3/schema.graphql index 2976e364..3538f4fd 100644 --- a/subgraph/lnv3/schema.graphql +++ b/subgraph/lnv3/schema.graphql @@ -27,6 +27,7 @@ type Lnv3RelayRecord @entity { relayer: Bytes! transactionHash: Bytes! timestamp: BigInt! + fee: BigInt slashed: Boolean! requestWithdrawTimestamp: BigInt } diff --git a/subgraph/lnv3/src/HelixLnBridgeV3.ts b/subgraph/lnv3/src/HelixLnBridgeV3.ts index 3c20f312..0ad5660a 100644 --- a/subgraph/lnv3/src/HelixLnBridgeV3.ts +++ b/subgraph/lnv3/src/HelixLnBridgeV3.ts @@ -29,6 +29,7 @@ export function handleTransferFilled(event: TransferFilled): void { entity.relayer = event.params.provider; entity.transactionHash = event.transaction.hash; entity.slashed = false; + entity.fee = event.receipt!.gasUsed * event.transaction.gasPrice; entity.save(); }