Path: Learning Path > 13 Owner Console + Admin Flows
The UI includes owner-only flows to create and manage shops, listings, currencies, and discounts.
- Understand how the UI detects shop ownership.
- Map each owner action to a Move entry function.
- See which UI components own each management flow.
- Find the buyer flow doc for checkout and receipts.
- Localnet running.
sui_oracle_marketpublished.- A Shop ID and an owner wallet that holds the ShopOwnerCap.
packages/ui/.env.localconfigured.
pnpm ui dev- Create shop ->
shop::create_shop- UI:
packages/ui/src/app/components/CreateShopModal.tsx - Hook:
packages/ui/src/app/hooks/useCreateShopModalState.ts
- UI:
- Add listing ->
shop::add_item_listing- UI:
packages/ui/src/app/components/AddItemModal.tsx - Hook:
packages/ui/src/app/hooks/useAddItemModalState.ts
- UI:
- Remove listing ->
shop::remove_item_listing- UI:
packages/ui/src/app/components/RemoveItemModal.tsx - Hook:
packages/ui/src/app/hooks/useRemoveItemModalState.ts
- UI:
- Add currency ->
shop::add_accepted_currency- UI:
packages/ui/src/app/components/AddCurrencyModal.tsx - Hook:
packages/ui/src/app/hooks/useAddCurrencyModalState.ts
- UI:
- Remove currency ->
shop::remove_accepted_currency- UI:
packages/ui/src/app/components/RemoveCurrencyModal.tsx - Hook:
packages/ui/src/app/hooks/useRemoveCurrencyModalState.ts
- UI:
- Create discount ->
shop::create_discount- UI:
packages/ui/src/app/components/AddDiscountModal.tsx - Hook:
packages/ui/src/app/hooks/useAddDiscountModalState.ts
- UI:
- Remove/disable discount ->
shop::remove_discount/shop::toggle_discount- UI:
packages/ui/src/app/components/RemoveDiscountModal.tsx - Hook:
packages/ui/src/app/hooks/useRemoveDiscountModalState.ts
- UI:
Buyer flows live in docs/12-buyer-ui.md.
- The UI treats the wallet as the owner when
walletAddress == shopOwnerAddress. - The shop owner address is loaded from the Shop object via
useShopDashboardData. - This mirrors the on-chain rule that ownership is encoded in the Shop object and enforced by the ShopOwnerCap during mutations.
- UI gating is convenience only; on-chain enforcement always requires the
ShopOwnerCapobject.
Code:
packages/ui/src/app/hooks/useStoreDashboardViewModel.ts(isShopOwner logic)packages/ui/src/app/hooks/useShopDashboardData.tsx(shop overview load)packages/dapp/contracts/oracle-market/sources/shop.move(Shop.owner field)
Code spotlight: Shop owner is stored on-chain
packages/dapp/contracts/oracle-market/sources/shop.move
public fun update_shop_owner(
shop: &mut Shop,
owner_cap: &ShopOwnerCap,
new_owner: address
) {
assert!(owner_cap.shop_id == shop.id(), EInvalidOwnerCap);
let previous_owner = shop.owner;
shop.owner = new_owner;
events::emit_shop_owner_updated(shop.id(), owner_cap.id.to_inner(), previous_owner);
}- Connect a non-owner wallet and confirm the owner controls are hidden. Expected outcome: only buyer actions are visible.
- Connect the owner wallet and create a listing. Expected outcome: the new listing appears in the storefront.
- https://docs.sui.io/guides/developer/objects/object-model
- https://docs.sui.io/concepts/sui-move-concepts
- Previous: 12 Buyer Flow + UI
- Next: 14 Advanced (execution model + upgrades)
- Back to map: Learning Path Map