Skip to content

Commit

Permalink
Remove unused Relayer functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sudeepb02 committed Jan 3, 2025
1 parent 466237b commit 902b340
Showing 1 changed file with 1 addition and 59 deletions.
60 changes: 1 addition & 59 deletions src/relayers/pimlico/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import 'dotenv/config';
import { RelayerConfig, RpcConfig, SubgraphConfig } from '../../interfaces';
import { executeTxUsingPimlico, getPimlicoSmartAccountClient } from './utils';
import { executeTxUsingPimlico, getPimlicoSmartAccountClient } from './utils';
import { SmartAccount } from 'permissionless/accounts';
import { Chain, Hex, Transport } from 'viem';
import { EntryPoint } from 'permissionless/types/entrypoint';
import { SmartAccountClient } from 'permissionless';
import { getPositionsToRefresh, getPublicSubgraphEndpoint } from '../../subgraph';
import { getPythClient } from '../../pyth/pyth';
import { generatePrivateKey } from 'viem/accounts';

import { contracts as parifiContracts } from '@parifi/references';
import { getSubgraphHelperInstance } from '../../utils/subgraph-helper';

export class Pimlico {
/// Pimlico Class variables
public isInitialized: boolean;
Expand Down Expand Up @@ -61,57 +56,4 @@ export class Pimlico {
public executeTxUsingPimlico = async (targetContractAddress: string, txData: string) => {
return await executeTxUsingPimlico(this.smartAccountClient, targetContractAddress, txData);
};

// Batch settle orders using Pimlico for OrderIds
// public batchSettleOrdersUsingPimlico = async (orderIds: string[]): Promise<{ txHash: string }> => {
// const chainId = this.rpcConfig.chainId;
// const subgraphEndpoint = this.subgraphConfig.subgraphEndpoint ?? getPublicSubgraphEndpoint(chainId);

// const pythClient = await getPythClient();

// // Get Settle orders transaction data for execution
// const { txData } = await getBatchSettleTxData(chainId, subgraphEndpoint, pythClient, orderIds);

// const parifiUtilsAddress = parifiContracts[chainId].ParifiUtils.address;

// return await executeTxUsingPimlico(this.smartAccountClient, parifiUtilsAddress, txData);
// };

// Batch settle orders using Pimlico for OrderIds
// public batchLiquidatePositionsUsingPimlico = async (positionIds: string[]): Promise<{ txHash: string }> => {
// const chainId = this.rpcConfig.chainId;
// const subgraphEndpoint = this.subgraphConfig.subgraphEndpoint ?? getPublicSubgraphEndpoint(chainId);

// const pythClient = await getPythClient();

// // Get Settle orders transaction data for execution
// const { txData } = await getBatchLiquidateTxData(chainId, subgraphEndpoint, pythClient, positionIds);

// const parifiUtilsAddress = parifiContracts[chainId].ParifiUtils.address;

// return await executeTxUsingPimlico(this.smartAccountClient, parifiUtilsAddress, txData);
// };

// Batch settle orders using Pimlico for OrderIds
// public batchSettleAndRefreshUsingPimlico = async (orderIds: string[]): Promise<{ txHash: string }> => {
// const chainId = this.rpcConfig.chainId;
// const subgraphEndpoint = this.subgraphConfig.subgraphEndpoint ?? getPublicSubgraphEndpoint(chainId);

// const pythClient = await getPythClient();

// // Get Settle orders transaction data for execution
// const targetContract1 = parifiContracts[chainId].ParifiUtils.address;
// const { txData: txData1 } = await getBatchSettleTxData(chainId, subgraphEndpoint, pythClient, orderIds);

// // Tx data to refresh positions
// // @todo Need to fix the references library to allow chainId as ArbSepolia has some issues
// const targetContract2 = parifiContracts[42161].SubgraphHelper.address;
// const { txData: txData2 } = await getPositionRefreshTxData(chainId, subgraphEndpoint);

// return await executeBatchTxsUsingPimlico(
// this.smartAccountClient,
// [targetContract1, targetContract2],
// [txData1, txData2],
// );
// };
}

0 comments on commit 902b340

Please sign in to comment.