diff --git a/apollo/src/aggregation/aggregation.history.graphql b/apollo/src/aggregation/aggregation.history.graphql index 714d9c4..a56d81b 100644 --- a/apollo/src/aggregation/aggregation.history.graphql +++ b/apollo/src/aggregation/aggregation.history.graphql @@ -107,8 +107,6 @@ type Query { } type Mutation { - updateConfirmedBlock(id: String, block: String): String - lnBridgeHeartBeat(fromChainId: String, toChainId: String, version: String, relayer: String, tokenAddress: String, softTransferLimit: String): String signConfirmedBlock(id: String, relayer: String, block: String, timestamp: Int, signature: String): String signHeartBeat(fromChainId: String, toChainId: String, version: String, relayer: String, tokenAddress: String, softTransferLimit: String, timestamp: Int, signature: String): String signDynamicFee(fromChainId: String, toChainId: String, version: String, relayer: String, tokenAddress: String, dynamicFee: String, dynamicFeeExpire: String, dynamicFeeSignature: String, timestamp: Int, signature: String): String diff --git a/apollo/src/aggregation/aggregation.resolver.ts b/apollo/src/aggregation/aggregation.resolver.ts index 37e9477..2190a6b 100644 --- a/apollo/src/aggregation/aggregation.resolver.ts +++ b/apollo/src/aggregation/aggregation.resolver.ts @@ -18,6 +18,7 @@ export class AggregationResolver { '0x9c02a1a56474247a48f1090070d2817a2a5607d9': '0x0000000cf324fed44fb52e9a519cbb5bd8217f77', '0x44c224d93b0f5e30b1a930d362e2bcfbb7807078': '0x0000000cf324fed44fb52e9a519cbb5bd8217f77', '0x3b9e571adecb0c277486036d6097e9c2cccfa9d9': '0x0b425baaf0443275d40ce854734b06e7e976387d', + '0x2fdec62e57e1a77db6984424c01a3c13fbca7cc1': '0x00000c377b096e0c904d7736be14e653e500481c', }; constructor(private aggregationService: AggregationService) {} @@ -175,59 +176,6 @@ export class AggregationResolver { }); } - /** - * @deprecated instead, please use signConfirmedBlock - **/ - @Mutation() - async updateConfirmedBlock(@Args('id') id: string, @Args('block') block: string) { - await this.aggregationService.updateConfirmedBlock({ - where: { id: id }, - block: block, - }); - } - - /** - * @deprecated instead, please use signHeartBeat - **/ - @Mutation() - async lnBridgeHeartBeat( - @Args('fromChainId') fromChainId: string, - @Args('toChainId') toChainId: string, - @Args('version') version: string, - @Args('relayer') relayer: string, - @Args('tokenAddress') tokenAddress: string, - @Args('softTransferLimit') softTransferLimit: string - ) { - const id = `${version}-${fromChainId}-${toChainId}-${relayer.toLowerCase()}-${tokenAddress.toLowerCase()}`; - const now = Math.floor(Date.now() / 1000); - - const updateData = { - heartbeatTimestamp: now, - }; - - if (softTransferLimit !== undefined && softTransferLimit !== '0') { - // the softTransferLimit is on target chain, transfer it to source chain - const transferLimit = this.aggregationService.targetAmountToSourceAmount({ - amount: softTransferLimit, - sourceChainId: Number(fromChainId), - targetChainId: Number(toChainId), - sourceToken: tokenAddress, - version, - }); - updateData['softTransferLimit'] = transferLimit; - } - - try { - await this.aggregationService.updateLnBridgeRelayInfo({ - where: { id: id }, - data: updateData, - }); - } catch (e) { - console.log(`heart beat failed ${id}, exception: ${e}`); - return; - } - } - @Mutation() async signConfirmedBlock( @Args('id') id: string, diff --git a/apollo/src/graphql.ts b/apollo/src/graphql.ts index 58e3912..4ad13e9 100644 --- a/apollo/src/graphql.ts +++ b/apollo/src/graphql.ts @@ -124,10 +124,6 @@ export abstract class IQuery { } export abstract class IMutation { - abstract updateConfirmedBlock(id?: Nullable, block?: Nullable): Nullable | Promise>; - - abstract lnBridgeHeartBeat(fromChainId?: Nullable, toChainId?: Nullable, version?: Nullable, relayer?: Nullable, tokenAddress?: Nullable, softTransferLimit?: Nullable): Nullable | Promise>; - abstract signConfirmedBlock(id?: Nullable, relayer?: Nullable, block?: Nullable, timestamp?: Nullable, signature?: Nullable): Nullable | Promise>; abstract signHeartBeat(fromChainId?: Nullable, toChainId?: Nullable, version?: Nullable, relayer?: Nullable, tokenAddress?: Nullable, softTransferLimit?: Nullable, timestamp?: Nullable, signature?: Nullable): Nullable | Promise>;