From e1f47e0680ffe46feb705e83d63730ccfcdf82cb Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Thu, 8 Dec 2022 15:24:05 -0700 Subject: [PATCH] feat: remove dead investor-foxy code --- packages/investor-foxy/src/api/api.ts | 50 --------------------------- 1 file changed, 50 deletions(-) diff --git a/packages/investor-foxy/src/api/api.ts b/packages/investor-foxy/src/api/api.ts index 1ae72318a..b591df8e6 100644 --- a/packages/investor-foxy/src/api/api.ts +++ b/packages/investor-foxy/src/api/api.ts @@ -42,7 +42,6 @@ import { TokeClaimIpfs, TokenAddressInput, TxInput, - TxInputWithoutAmount, TxInputWithoutAmountAndWallet, TxReceipt, WithdrawEstimateGasInput, @@ -264,22 +263,6 @@ export class FoxyApi { } } - async estimateSendWithdrawalRequestsGas(input: TxInputWithoutAmountAndWallet): Promise { - const { userAddress, contractAddress } = input - this.verifyAddresses([userAddress, contractAddress]) - - const stakingContract = this.getStakingContract(contractAddress) - - try { - const estimatedGas = await stakingContract.estimateGas.sendWithdrawalRequests([], { - from: userAddress, - }) - return estimatedGas.toString() - } catch (e) { - throw new Error(`Failed to get gas ${e}`) - } - } - async estimateAddLiquidityGas(input: EstimateGasTxInput): Promise { const { amountDesiredCryptoBaseUnit, userAddress, contractAddress } = input this.verifyAddresses([userAddress, contractAddress]) @@ -717,39 +700,6 @@ export class FoxyApi { return isTimeToRequest && isCorrectIndex && hasAmount } - async sendWithdrawalRequests(input: TxInputWithoutAmount): Promise { - const { bip44Params, dryRun = false, contractAddress, userAddress, wallet } = input - this.verifyAddresses([userAddress, contractAddress]) - if (!wallet || !contractAddress) throw new Error('Missing inputs') - - let estimatedGas: string - try { - estimatedGas = await this.estimateSendWithdrawalRequestsGas(input) - } catch (e) { - throw new Error(`Estimate Gas Error: ${e}`) - } - - const stakingContract = this.getStakingContract(contractAddress) - - const canSendRequest = await this.canSendWithdrawalRequest({ stakingContract }) - if (!canSendRequest) throw new Error('Not ready to send request') - - const data: string = stakingContract.interface.encodeFunctionData('sendWithdrawalRequests') - const { nonce, gasPrice } = await this.getGasPriceAndNonce(userAddress) - const chainReferenceAsNumber = Number(this.ethereumChainReference) - const payload = { - bip44Params, - chainId: chainReferenceAsNumber, - data, - estimatedGas, - gasPrice, - nonce, - to: contractAddress, - value: '0', - } - return this.signAndBroadcastTx({ payload, wallet, dryRun }) - } - // not a user facing function // utility function for the dao to add liquidity to the lrContract for instantUnstaking async addLiquidity(input: TxInput): Promise {