Registration

Before using the SDK, it’s necessary to create an account at EVAV. Once you have an account, you can start using the SDK with the same wallet address.

Init and Auth your SDK requests

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(),
})