Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn committed Sep 12, 2024
1 parent b050d4f commit e8a6074
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function InvestRedeemLiquidityPoolsProvider({ poolId, trancheId, children
const tranche = pool.tranches.find((t) => t.id === trancheId)
const { data: metadata, isLoading: isMetadataLoading } = usePoolMetadata(pool)
const trancheMeta = metadata?.tranches?.[trancheId]
const chainId = provider?.network.chainId || 1
const chainId = Number(provider?._network.chainId)

if (!tranche) throw new Error(`Token not found. Pool id: ${poolId}, token id: ${trancheId}`)

Expand Down
3 changes: 3 additions & 0 deletions centrifuge-app/src/components/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ export function Root() {
showAdvancedAccounts={debugState.showAdvancedAccounts}
showTestNets={debugState.showTestNets}
showFinoa={debugState.showFinoa}
infuraApiKey={import.meta.env.REACT_APP_INFURA_KEY}
alchemyApiKey={import.meta.env.REACT_APP_ALCHEMY_KEY}
tenderlyApiKey={import.meta.env.REACT_APP_TENDERLY_KEY}
>
<SupportedBrowserBanner />
<OnboardingAuthProvider>
Expand Down
2 changes: 1 addition & 1 deletion centrifuge-js/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Promise.all([
: undefined,
external: Object.keys(pkg.dependencies),
format: 'esm',
target: ['es6'],
target: ['es2020'],
}),
esbuild.build({
entryPoints: ['src/index.ts'],
Expand Down
5 changes: 3 additions & 2 deletions centrifuge-js/src/modules/liquidityPools.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BN from 'bn.js'
import { signERC2612Permit } from 'eth-permit'
import type { TransactionRequest, TransactionResponse } from 'ethers'
import { Contract, Interface, Provider } from 'ethers'
import { Contract, Interface, Provider, ethers } from 'ethers'
import set from 'lodash/set'
import { combineLatestWith, firstValueFrom, from, map, startWith, switchMap } from 'rxjs'
import { Centrifuge } from '../Centrifuge'
Expand Down Expand Up @@ -70,7 +70,8 @@ export function getLiquidityPoolsModule(inst: Centrifuge) {

function centrifugeRouter(chainId: number) {
const centrifugeRouter = getCentrifugeRouterAddress(chainId)
const getEstimate = from(contract(centrifugeRouter, new Interface(ABI.CentrifugeRouter)).estimate([0]))
const bytes = ethers.hexlify(new Uint8Array([0x12]))
const getEstimate = from(contract(centrifugeRouter, new Interface(ABI.CentrifugeRouter)).estimate(bytes))
return getEstimate.pipe(
map((estimate) => {
return { estimate, centrifugeRouter }
Expand Down
9 changes: 9 additions & 0 deletions centrifuge-react/src/components/Provider/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export type ProviderProps = {
walletConnectId?: string
subscanUrl?: string
transactionToastPositionProps?: TransactionToastsProps['positionProps']
infuraApiKey?: string
alchemyApiKey?: string
tenderlyApiKey?: string
}

export function Provider({
Expand All @@ -30,6 +33,9 @@ export function Provider({
walletConnectId,
subscanUrl,
transactionToastPositionProps,
infuraApiKey,
alchemyApiKey,
tenderlyApiKey,
}: ProviderProps) {
return (
<QueryClientProvider client={queryClient}>
Expand All @@ -39,6 +45,9 @@ export function Provider({
evmAdditionalConnectors={evmAdditionalConnectors}
walletConnectId={walletConnectId}
subscanUrl={subscanUrl}
infuraApiKey={infuraApiKey}
alchemyApiKey={alchemyApiKey}
tenderlyApiKey={tenderlyApiKey}
>
<TransactionProvider>
<TransactionToasts positionProps={transactionToastPositionProps} />
Expand Down

0 comments on commit e8a6074

Please sign in to comment.