Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Create a seller · Boson Protocol
Skip to content

Create a seller

A seller account is a one-time on-chain registration. Every wallet that publishes offers needs one. It mints the seller entity and an associated voucher (rNFT) collection.

SDK
import { CoreSDK } from "@bosonprotocol/core-sdk"
import { EthersAdapter } from "@bosonprotocol/ethers-sdk"
import { ethers } from "ethers"
 
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider)
 
const sdk = CoreSDK.fromDefaultConfig({
  web3Lib: new EthersAdapter(provider, wallet),
  envName: "production",
  configId: "production-137-0",
})
 
const tx = await sdk.createSeller({
  assistant: wallet.address,
  admin: wallet.address,
  treasury: wallet.address,
  contractUri: "ipfs://Qm…",     // OpenSea-style collection metadata URI
  royaltyPercentage: "0",        // basis points × 100 (0 = none)
  authTokenId: "0",              // "0" if not using auth tokens (admin field is enough)
  authTokenType: 0,              // 0 = None, 1 = Lens profile NFT
  metadataUri: "ipfs://Qm…",     // seller-level metadata
})
const receipt = await tx.wait()
await sdk.waitForGraphNodeIndexing(receipt.blockNumber)
 
const seller = (await sdk.getSellersByAddress(wallet.address))[0]
console.log("seller.id =", seller.id)

Inputs explained

  • assistant — the operational signer. Calls createOffer, voidOffer, etc.
  • admin — privileged. Updates the seller's config. (When using auth tokens, set to 0x0…0 and use authTokenId / authTokenType instead.)
  • treasury — recipient of offer proceeds. Can be different from assistant/admin.
  • contractUri — IPFS URI for OpenSea-style collection metadata. Required, can be an empty placeholder.
  • royaltyPercentage — basis points × 100 (so 500 = 5 %). For secondary-sale royalties.
  • authTokenId — token id used as the admin auth token (e.g. a Lens profile id). "0" if not used.
  • authTokenType0 (None) or 1 (Lens profile NFT).
  • metadataUri — seller-level metadata (separate from contractUri, which is collection-level).

The deprecated clerk role is no longer settable; the protocol now stores address(0) for it internally.

What gets created

EntityWhat
Seller (on-chain)Seller struct, retrievable by getSellersByAddress(wallet)
Voucher collectionA new ERC-721 contract; one per seller (or many with multi-collection)

Common gotchas

  • Each wallet can only have one seller. Attempting to call createSeller twice from the same admin reverts.
  • The treasury can be a smart contract. Useful for routing funds through a multisig.
  • Setting royaltyPercentage here doesn't enforce it. Royalty enforcement depends on the marketplace; the on-chain field is informational. See Royalties.

Next