> ## Documentation Index
> Fetch the complete documentation index at: https://docs.evav.org/llms.txt
> Use this file to discover all available pages before exploring further.

> Retrieve the collections

# Get

### Get all the collections of the current user

<CodeGroup>
  ```typescript example theme={null}
  import { mkt } from './config'

  const collections = await mkt.getMyCollections()
  ```

  ```typescript definition theme={null}
  import type { Address } from 'viem'
  import type { CollectionResponse } from './interface'

  getMyCollections(): Promise<CollectionResponse[] | null>
  ```

  ```typescript interface.ts theme={null}
  import type { Address } from 'viem'

  export interface CollectionResponse {
    address: Address
    owner: Address
    uri: string
    name: string
    description: string
    image: string
    bannerImage: string
    featuredImage: string
    lastUpdated: string
    metadata: CollectionMetadata
  }

  interface CollectionMetadata {
    name: string
    description: string
    external_link: string
    collaborators: Address[]
    image: string
    banner_image: string
    featured_image: string
  }
  ```

  ```typescript config.ts (dynamic) theme={null}
  import { Marketplace } from '@evav/marketplace'
  import { useDynamicContext, getAuthToken } from '@dynamic-labs/sdk-react-core'

  const { primaryWallet } = useDynamicContext()
  const walletClient = await primaryWallet?.connector?.getWalletClient()
  const publicClient = await primaryWallet?.connector?.getPublicClient()
  const [account] = await walletConnector.getConnectedAccounts()

  // viem is required for the evav sdk
  export const mkt = new Marketplace({
    walletClient,
    publicClient,
    account: account as Address,
    // Optional. If not provided, SIWE will be used instead, and you will be asked to sign a message with your wallet
    accessToken: getAuthToken(),
  })
  ```

  ```typescript config.ts (privy) theme={null}
  import { Marketplace } from '@evav/marketplace'
  import { useWallets, usePrivy } from 'privy'
  import { createWalletClient, createPublicClient, custom } from 'viem'
  import { base } from 'viem/chains'

  const { wallets } = useWallets();
  const { user } = usePrivy();

  const wallet = wallets[0]; // Replace this with your desired wallet
  const provider = await wallet.getEthereumProvider()

  const walletClient = createWalletClient({
    chain: base,
    transport: custom(provider),
  })

  const publicClient = createPublicClient({
    chain: base,
    transport: custom(provider),
  })

  // viem is required for the evav sdk
  export const mkt = new Marketplace({
    walletClient,
    publicClient,
    account: user.linked_accounts[0].address // Replace with your desired account
  })
  ```
</CodeGroup>

### Get collections by id

Does not have to be the collection of the current user.

<CodeGroup>
  ```typescript example theme={null}
  import { Marketplace } from '@evav/marketplace'

  const collection = await Marketplace.getCollectionsByIds('<COLLECTION_ADDRESS>')
  const collections = await Marketplace.getCollectionsByIds(['<COLLECTION_ADDRESS_1>', '<COLLECTION_ADDRESS_2>'])
  ```

  ```typescript definition theme={null}
  import type { Address } from 'viem'
  import type { CollectionResponse } from './interface'

  // Get single collection by the unique ID:
  Marketplace.getCollectionsByIds(id: string): Promise<CollectionResponse | null>

  // Get multiple collections by the array of IDs:
  Marketplace.getCollectionsByIds(ids: string[]): Promise<CollectionResponse[] | null>
  ```

  ```typescript interface.ts theme={null}
  import type { Address } from 'viem'

  export interface CollectionResponse {
    address: Address
    owner: Address
    uri: string
    name: string
    description: string
    image: string
    bannerImage: string
    featuredImage: string
    lastUpdated: string
    metadata: CollectionMetadata
  }

  interface CollectionMetadata {
    name: string
    description: string
    external_link: string
    collaborators: Address[]
    image: string
    banner_image: string
    featured_image: string
  }
  ```

  ```typescript config.ts (dynamic) theme={null}
  import { Marketplace } from '@evav/marketplace'
  import { useDynamicContext, getAuthToken } from '@dynamic-labs/sdk-react-core'

  const { primaryWallet } = useDynamicContext()
  const walletClient = await primaryWallet?.connector?.getWalletClient()
  const publicClient = await primaryWallet?.connector?.getPublicClient()
  const [account] = await walletConnector.getConnectedAccounts()

  // viem is required for the evav sdk
  export const mkt = new Marketplace({
    walletClient,
    publicClient,
    account: account as Address,
    // Optional. If not provided, SIWE will be used instead, and you will be asked to sign a message with your wallet
    accessToken: getAuthToken(),
  })
  ```

  ```typescript config.ts (privy) theme={null}
  import { Marketplace } from '@evav/marketplace'
  import { useWallets, usePrivy } from 'privy'
  import { createWalletClient, createPublicClient, custom } from 'viem'
  import { base } from 'viem/chains'

  const { wallets } = useWallets();
  const { user } = usePrivy();

  const wallet = wallets[0]; // Replace this with your desired wallet
  const provider = await wallet.getEthereumProvider()

  const walletClient = createWalletClient({
    chain: base,
    transport: custom(provider),
  })

  const publicClient = createPublicClient({
    chain: base,
    transport: custom(provider),
  })

  // viem is required for the evav sdk
  export const mkt = new Marketplace({
    walletClient,
    publicClient,
    account: user.linked_accounts[0].address // Replace with your desired account
  })
  ```
</CodeGroup>
