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. CallscreateOffer,voidOffer, etc.admin— privileged. Updates the seller's config. (When using auth tokens, set to0x0…0and useauthTokenId/authTokenTypeinstead.)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 (so500= 5 %). For secondary-sale royalties.authTokenId— token id used as the admin auth token (e.g. a Lens profile id)."0"if not used.authTokenType—0(None) or1(Lens profile NFT).metadataUri— seller-level metadata (separate fromcontractUri, which is collection-level).
The deprecated
clerkrole is no longer settable; the protocol now storesaddress(0)for it internally.
What gets created
| Entity | What |
|---|---|
| Seller (on-chain) | Seller struct, retrievable by getSellersByAddress(wallet) |
| Voucher collection | A new ERC-721 contract; one per seller (or many with multi-collection) |
Common gotchas
- Each wallet can only have one seller. Attempting to call
createSellertwice from the sameadminreverts. - The treasury can be a smart contract. Useful for routing funds through a multisig.
- Setting
royaltyPercentagehere doesn't enforce it. Royalty enforcement depends on the marketplace; the on-chain field is informational. See Royalties.