Is there a way to take a market address and get the whole market contract back?

For example, I have the following sellToken function:

export const sellTokens = async (_market) => { await gnosis.sellOutcomeTokens({ market: _market, outcomeTokenIndex: 1, outcomeTokenCount: 1000 }); };

I have the market address at 0x… but I need to pass in the whole market contract, not just the address.

I’m not the person who created the market, I just want to bet on it, and all I am given is the market address string.

Basically, what I think I need is a function that takes a market address and gives me the whole market contract back. Is that a thing or am I thinking about this the wrong way?

Please let me know if I can clarify further. It’s hard to ask clear questions when you don’t fully understand the problem.

const gnosis = await Gnosis.create({
ethereum: window.web3.currentProvider
});

const importedMarket = await gnosis.contracts.Market.at( );