diff --git a/.gitignore b/.gitignore index 516d899dfa..9ef8025bcb 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ site/ build -.docusaurus \ No newline at end of file +.docusaurus + +.venv/ \ No newline at end of file diff --git a/docs/assets/js/custom.js b/docs/assets/js/custom.js index 84799e95a9..903570b1f5 100644 --- a/docs/assets/js/custom.js +++ b/docs/assets/js/custom.js @@ -6,4 +6,26 @@ document.addEventListener("DOMContentLoaded", function() { link.setAttribute("target", "_blank"); } }); + + // Copy-to-clipboard for install command pills. + document.addEventListener("click", function(event) { + var btn = event.target.closest(".copy-btn[data-copy]"); + if (!btn) return; + event.preventDefault(); + var text = btn.getAttribute("data-copy"); + var done = function() { + btn.classList.add("is-copied"); + setTimeout(function() { btn.classList.remove("is-copied"); }, 1500); + }; + if (navigator.clipboard && navigator.clipboard.writeText) { + navigator.clipboard.writeText(text).then(done).catch(function() {}); + } else { + var ta = document.createElement("textarea"); + ta.value = text; + document.body.appendChild(ta); + ta.select(); + try { document.execCommand("copy"); done(); } catch (e) {} + document.body.removeChild(ta); + } + }); }); \ No newline at end of file diff --git a/docs/assets/style/components/developer-kit.css b/docs/assets/style/components/developer-kit.css new file mode 100644 index 0000000000..477557c90f --- /dev/null +++ b/docs/assets/style/components/developer-kit.css @@ -0,0 +1,274 @@ +.dk-page { + display: flex; + flex-direction: column; + gap: 48px; + padding: 8px 0 16px; +} + +/* Hero */ +.dk-hero { + display: flex; + flex-direction: column; + gap: 14px; + max-width: 760px; +} + +.md-typeset .dk-hero__title { + font-size: 2.2em; + line-height: 1.15; + font-weight: 700; + color: var(--doc-text-primary); + margin: 0; +} + +.dk-hero__subtitle { + font-size: 17px; + line-height: 1.5; + color: var(--doc-text-secondary); + margin: 0; +} + +.dk-block { + display: flex; + flex-direction: column; + gap: 20px; +} + +.dk-block__header { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: 16px; +} + +.md-typeset .dk-block__title { + font-size: 1.4em; + font-weight: 700; + color: var(--doc-text-primary); + margin: 0; +} + +.dk-block__count { + font-size: 13px; + color: var(--doc-text-tertiary); +} + +/* Featured tools */ +.dk-featured { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16px; +} + +.dk-featured-card { + display: flex; + flex-direction: column; + gap: 10px; + padding: 20px; + border-radius: 16px; + border: 1px solid var(--doc-border-2); + background: var(--doc-layer-2); + transition: border-color .15s, background .15s, transform .15s; +} + +.dk-featured-card:hover, +.dk-featured-card:focus { + border-color: var(--doc-border-4); + background: var(--doc-layer-3); + text-decoration: none; + transform: translateY(-2px); +} + +.md-typeset .dk-featured-card__name { + font-size: 16px; + font-weight: 700; + color: var(--doc-text-primary); +} + +.dk-featured-card__desc { + font-size: 14px; + line-height: 1.45; + color: var(--doc-text-secondary); + flex: 1 0 auto; +} + +/* Install command pill */ +.install-cmd { + display: inline-flex; + align-items: center; + gap: 8px; + width: 100%; + padding: 8px 8px 8px 12px; + border-radius: 8px; + border: 1px solid var(--doc-border-3); + background: var(--doc-bg-1); +} + +.install-cmd__prompt { + flex-shrink: 0; + font-family: var(--md-code-font-family, monospace); + font-size: 13px; + font-weight: 700; + color: var(--doc-text-brand); +} + +.md-typeset .install-cmd code, +.install-cmd code { + flex: 1 1 auto; + font-family: var(--md-code-font-family, monospace); + font-size: 13px; + color: var(--doc-text-primary); + background: none; + padding: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.copy-btn { + display: inline-flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + flex-shrink: 0; + border-radius: 6px; + border: none; + background: transparent; + color: var(--doc-text-tertiary); + cursor: pointer; + transition: background .15s, color .15s; +} + +.copy-btn:hover { + background: var(--doc-layer-4); + color: var(--doc-text-primary); +} + +.copy-btn svg { + width: 16px; + height: 16px; + fill: currentColor; +} + +.copy-btn.is-copied { + color: #00d957; +} + +/* All developer tools table */ +.dk-table-wrap { + border: 1px solid var(--doc-border-2); + border-radius: 16px; + overflow: hidden; +} + +.md-typeset .dk-table { + width: 100%; + border-collapse: collapse; + margin: 0; + font-size: 14px; + border: none; + display: table; +} + +.md-typeset .dk-table th, +.md-typeset .dk-table td { + text-align: left; + padding: 14px 18px; + border: none; + border-bottom: 1px solid var(--doc-border-2); + vertical-align: middle; +} + +.md-typeset .dk-table thead th { + font-size: 12px; + font-weight: 600; + letter-spacing: 0.6px; + text-transform: uppercase; + color: var(--doc-text-tertiary); + background: var(--doc-layer-2); +} + +.md-typeset .dk-table tbody tr:last-child td { + border-bottom: none; +} + +.md-typeset .dk-table tbody tr:hover { + background: var(--doc-layer-2); +} + +.md-typeset .dk-table td a { + color: var(--doc-text-primary); + font-weight: 600; +} + +.md-typeset .dk-table td a:hover { + color: var(--doc-text-brand); +} + +.dk-chip { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 2px 10px; + border-radius: 999px; + border: 1px solid var(--doc-border-3); + font-size: 12px; + color: var(--doc-text-secondary); + white-space: nowrap; +} + +.dk-chip::before { + content: ""; + width: 6px; + height: 6px; + border-radius: 50%; + background: var(--doc-text-tertiary); + flex-shrink: 0; +} + +.dk-chip[data-chain="bsc"]::before { + background: #f0b90b; +} + +.dk-chip[data-chain="opbnb"]::before { + background: #ff8a38; +} + +.dk-chip[data-chain="greenfield"]::before { + background: #00d957; +} + +.dk-table__action-col { + width: 48px; +} + +.md-typeset .dk-table__action { + text-align: right; +} + +.md-typeset .dk-table__action a { + color: var(--doc-text-tertiary); + font-size: 18px; +} + +.md-typeset .dk-table__action a:hover { + color: var(--doc-text-brand); +} + +/* Responsive */ +@media (max-width: 1024px) { + .dk-featured { + grid-template-columns: 1fr; + } +} + +@media (max-width: 768px) { + .dk-table-wrap { + overflow-x: auto; + } + + .md-typeset .dk-table { + min-width: 560px; + } +} diff --git a/docs/assets/style/components/home.css b/docs/assets/style/components/home.css new file mode 100644 index 0000000000..812101682d --- /dev/null +++ b/docs/assets/style/components/home.css @@ -0,0 +1,303 @@ +.home-page { + display: flex; + flex-direction: column; + gap: 56px; + padding: 24px 0 16px; +} + +/* Hero */ +.home-hero { + display: flex; + flex-direction: column; + gap: 16px; + max-width: 720px; +} + +.md-typeset .home-hero__title { + font-size: 2.6em; + line-height: 1.1; + font-weight: 700; + color: var(--doc-text-primary); + margin: 0; +} + +.home-hero__subtitle { + font-size: 18px; + line-height: 1.5; + color: var(--doc-text-secondary); + margin: 0; +} + +/* Section headings */ +.home-block { + display: flex; + flex-direction: column; + gap: 20px; +} + +.md-typeset .home-block__title { + font-size: 1.5em; + font-weight: 700; + color: var(--doc-text-primary); + margin: 0; +} + +/* Start building grid */ +.build-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16px; +} + +.build-card { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 8px; + padding: 20px; + border-radius: 16px; + border: 1px solid var(--doc-border-2); + background: var(--doc-layer-2); + transition: border-color .15s, background .15s, transform .15s; +} + +.build-card:hover, +.build-card:focus { + border-color: var(--doc-border-4); + background: var(--doc-layer-3); + text-decoration: none; + transform: translateY(-2px); +} + +.build-card__icon { + display: inline-flex; + align-items: center; + justify-content: center; + width: 36px; + height: 36px; + border-radius: 8px; + margin-bottom: 4px; + background: var(--doc-layer-3); + color: var(--doc-text-secondary); +} + +.build-card__icon svg { + width: 22px; + height: 22px; + fill: currentColor; +} + +.md-typeset .build-card__title { + font-size: 16px; + font-weight: 700; + color: var(--doc-text-primary); +} + +.build-card__desc { + font-size: 14px; + line-height: 1.45; + color: var(--doc-text-secondary); +} + +.build-card__link { + margin-top: auto; + padding-top: 6px; + display: inline-flex; + align-items: center; + gap: 6px; + font-size: 14px; + font-weight: 600; + color: var(--doc-text-brand); +} + +.build-card:hover .build-card__link, +.build-card:focus .build-card__link { + text-decoration: underline; +} + +/* Icon tile variants */ +.chain-card__icon[data-variant="brand"] { + background: color-mix(in srgb, var(--doc-text-brand) 12%, transparent); + color: var(--doc-text-brand); +} + +.chain-card__icon[data-variant="green"] { + background: rgba(0, 255, 103, 0.08); + color: #00d957; +} + +.chain-card__icon[data-variant="opbnb"] { + background: rgba(255, 138, 56, 0.06); + color: #FF8A38; +} + +.build-card__icon svg, +.chain-card__icon svg { + fill: currentColor; +} + +/* Choose the right chain */ +.chain-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 16px; +} + +.chain-card { + display: flex; + flex-direction: column; + gap: 20px; + padding: 25px; + border-radius: 16px; + border: 1px solid var(--doc-border-2); + background: var(--doc-layer-2); +} + +.chain-card__head { + display: flex; + align-items: flex-start; + gap: 12px; +} + +.chain-card__icon { + display: inline-flex; + align-items: center; + justify-content: center; + width: 36px; + height: 36px; + border-radius: 8px; + flex-shrink: 0; +} + +.chain-card__icon svg { + width: 24px; + height: 24px; +} + +.chain-card__titles { + display: flex; + flex-direction: column; + gap: 2px; +} + +.md-typeset .chain-card__name { + font-size: 20px; + line-height: 28px; + font-weight: 700; + color: var(--doc-text-primary); + margin: 0; +} + +.chain-card__tag { + font-size: 14px; + line-height: 20px; + color: var(--doc-text-tertiary); + margin: 0; +} + +.chain-card__divider { + height: 1px; + width: 100%; + background: var(--doc-border-2); +} + +.chain-card__body { + display: flex; + flex-direction: column; + gap: 8px; +} + +.chain-card__label { + font-size: 12px; + line-height: 14px; + font-weight: 500; + letter-spacing: 1.1px; + text-transform: uppercase; + color: var(--doc-text-tertiary); + margin: 0; +} + +.chain-card__desc { + font-size: 14px; + line-height: 20px; + color: var(--doc-text-secondary); + margin: 0; +} + +.chain-card__stats { + display: flex; + align-items: stretch; +} + +.chain-card__stat { + flex: 1 0 0; + display: flex; + flex-direction: column; + align-items: center; + gap: 2px; + padding: 4px 0; +} + +.chain-card__stat.is-middle { + border-left: 1px solid var(--doc-border-2); + border-right: 1px solid var(--doc-border-2); +} + +.chain-card__stat-value { + font-size: 14px; + line-height: 16px; + font-weight: 700; + color: var(--doc-text-primary); + text-align: center; +} + +.chain-card__stat-label { + font-size: 10px; + line-height: 14px; + color: var(--doc-text-tertiary); + text-align: center; +} + +/* CTA */ +.home-block--cta { + align-items: flex-end; +} + +.home-announce { + display: inline-flex; + align-items: center; + gap: 8px; + font-size: 15px; + font-weight: 600; + color: var(--doc-text-primary); +} + +.home-announce:hover { + color: var(--doc-text-brand); + text-decoration: none; +} + +/* Responsive */ +@media (max-width: 1024px) { + .build-grid { + grid-template-columns: repeat(2, 1fr); + } + + .chain-grid { + grid-template-columns: 1fr; + } +} + +@media (max-width: 600px) { + .home-page { + gap: 40px; + } + + .build-grid { + grid-template-columns: 1fr; + } + + .md-typeset .home-hero__title { + font-size: 2em; + } +} diff --git a/docs/assets/style/components/nav.css b/docs/assets/style/components/nav.css index 70fe85ccff..8a28a55579 100644 --- a/docs/assets/style/components/nav.css +++ b/docs/assets/style/components/nav.css @@ -31,6 +31,76 @@ .md-header__title .md-header__site_name { font-weight: 500; color: var(--doc-dark-text-secondary); + text-transform: uppercase; + letter-spacing: 1.5px; +} + +/* Header actions: Settings + Get help */ +.md-header__actions { + display: flex; + align-items: center; + gap: 8px; + margin-left: 16px; +} + +.md-header-action { + display: inline-flex; + align-items: center; + gap: 6px; + height: 36px; + padding: 0 14px; + border-radius: 8px; + border: 1px solid var(--doc-border-3); + background: var(--doc-layer-3); + color: var(--doc-text-secondary); + font-size: 14px; + font-weight: 500; + line-height: 1; + cursor: pointer; + text-decoration: none; + transition: background .15s, border-color .15s, color .15s; +} + +.md-header-action:hover, +.md-header-action:focus { + background: var(--doc-layer-4); + color: var(--doc-text-primary); +} + +.md-header-action svg { + width: 18px; + height: 18px; + fill: currentColor; + flex-shrink: 0; +} + +.md-header-action--primary { + background: var(--doc-dark-bg-1); + border-color: var(--doc-dark-border-4); + color: #fff; +} + +.md-header-action--primary:hover, +.md-header-action--primary:focus { + background: var(--doc-dark-bg-2); + border-color: var(--doc-dark-text-tertiary); + color: #fff; +} + +@media (max-width: 1219px) { + .md-header-action__label { + display: none; + } + + .md-header-action { + padding: 0 10px; + } +} + +@media (max-width: 767px) { + .md-header__actions { + display: none; + } } .md-search__icon[for=__search] { @@ -192,10 +262,6 @@ color: var(--doc-text-primary); } -.md-header__button { - margin: 0 0.8rem; -} - .md-option[data-md-color-media] ~ .md-icon svg { width: 24px; height: 24px; @@ -308,4 +374,95 @@ .md-nav--primary .md-nav__item--active>.md-nav__link { color: var(--doc-text-brand); } +} + +/* Centered, stretched search bar (matches Figma) */ +@media screen and (min-width: 60em) { + .md-header__title { + flex-grow: 0; + margin-right: 8px; + } + + .md-search { + flex: 1 1 auto; + padding: 0 24px; + } + + .md-search__inner { + float: none; + width: 100%; + max-width: 760px; + margin: 0 auto; + } + + .md-search__form { + width: 100%; + } + + .md-search__inner .md-search__input { + width: 100%; + } +} + +/* RESOURCE: flat, always-visible section with external arrow links */ +.md-nav__item--resource > label.md-nav__link { + text-transform: uppercase; + letter-spacing: 0.6px; + font-size: 14px; + line-height: 24px; + color: var(--doc-text-tertiary); + pointer-events: none; + cursor: default; + margin-top: 20px; +} + +.md-nav__item--resource > label.md-nav__link .md-nav__icon { + display: none; +} + +.md-nav__item--resource > .md-nav { + display: block; +} + +.md-nav__item--resource > .md-nav > .md-nav__list { + display: block; +} + +.md-nav__item--resource .md-nav__list .md-nav__link { + display: inline-flex; + align-items: center; + gap: 6px; + font-size: 16px; + line-height: 24px; + color: var(--doc-text-secondary); +} + +.md-nav__item--resource .md-nav__list .md-nav__link:hover { + color: var(--doc-text-brand); +} + +.md-nav__item--resource .md-nav__list .md-nav__link::after { + content: ""; + width: 16px; + height: 16px; + flex-shrink: 0; + background-color: var(--doc-text-tertiary); + -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M9%205v2h6.59L4%2018.59%205.41%2020%2017%208.41V15h2V5z'/%3E%3C/svg%3E") center / 14px 14px no-repeat; + mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M9%205v2h6.59L4%2018.59%205.41%2020%2017%208.41V15h2V5z'/%3E%3C/svg%3E") center / 14px 14px no-repeat; +} + +/* Tab bar divider between "Developer Kit" and "BNB Smart Chain" */ +.md-tabs__list > .md-tabs__item:nth-child(3) { + position: relative; +} + +.md-tabs__list > .md-tabs__item:nth-child(3)::before { + content: ""; + position: absolute; + left: -20px; + top: 50%; + transform: translateY(-50%); + width: 1px; + height: 18px; + background: var(--doc-border-4); } \ No newline at end of file diff --git a/docs/developer-kit/index.md b/docs/developer-kit/index.md index 8bf25b3289..641b70b12d 100644 --- a/docs/developer-kit/index.md +++ b/docs/developer-kit/index.md @@ -1,17 +1,161 @@ --- title: BNB Chain Developer Kit +hide: + - toc --- -# BNB Chain Developer Kit +
The official collection of SDKs, MCP servers, and developer tools for building on BSC, opBNB, and Greenfield. Pick a tool, follow the quickstart, and ship.
+pip install bnbagent
+
+
+
+
+
+ BNBChain Studio
+ AI-native workspace for writing, testing, and deploying smart contracts faster.
+
+ $
+ pip install bnbagent-studio
+
+
+
+
+
+ Greenfield SDK
+ Programmable, S3-compatible decentralized storage with on-chain access control.
+
+ $
+ go get github.com/bnb-chain/greenfield-go-sdk
+
+
+
+
+ | Tool | +Chains | +Install | ++ |
|---|---|---|---|
| BNBAgent SDK | +BSC opBNB | +
+
+ $
+ pip install bnbagent
+
+
+ |
+ → | +
| BNBChain Studio | +BSC | +
+
+ $
+ pip install bnbagent-studio
+
+
+ |
+ → | +
| Greenfield SDK | +Greenfield | +
+
+ $
+ go get github.com/bnb-chain/greenfield-go-sdk
+
+
+ |
+ → | +
| MCP & Ask AI | +BSC opBNB Greenfield | +
+
+ $
+ npx @bnb-chain/mcp@latest
+
+
+ |
+ → | +
| MPP SDK | +BSC opBNB | +
+
+ $
+ https://api.superintern.ai/agent/async/mcp/mcp
+
+
+ |
+ → | +
| Scaled UI Amount (ERC-8056) | +BSC | +
+
+ $
+ ERC-8056 interface
+
+ |
+ → | +
| Privacy at Scale | +BSC | +
+
+ $
+ pnpm add @bnb-chain/mpp viem
+
+
+ |
+ → | +
The blockchain with superior scalability and deep liquidity, built for global instant and low-cost transactions for the next billion users.
+BNB Smart Chain (BSC) is a high-performance blockchain platform designed to enable the development of scalable and user-friendly decentralized applications (DApps). As a core component of the BNB Chain ecosystem, BSC offers a robust infrastructure for building a wide range of applications, particularly in the decentralized finance (DeFi) space.
- +A layer-2 scaling solution for BNB Smart Chain that significantly increases transaction speed and reduces fees. It achieves this by leveraging Optimistic Rollups technology, making BNB Chain even more suitable for high-throughput applications.
- - - -A decentralized storage infrastructure designed to provide a secure and scalable platform for storing and managing data on the blockchain. It enables users to store files, NFTs, and other digital assets in a decentralized manner, promoting data ownership and control.
- - - -Share your project with BNB Chain Ecosystem or seeking for cooperations. We want to make it as easy as possible for prjects to get more exposure in BNB Chain Ecosystem or ask for support from the team.
- -BNB Smart Chain
+EVM-compatible L1
+Best for
+DeFi protocols, AI agents, stablecoins, RWA, and general EVM dApps — with the deepest liquidity outside Ethereum.
+opBNB
+OP-Stack L2 on BSC
+Best for
+GameFi, high-frequency trading, and apps that need thousands of interactions per second at negligible cost.
+BNB Greenfield
+Decentralized storage
+Best for
+NFT metadata, RWA data layers, AI training sets, and apps needing programmable, cross-chain storage.
+