diff --git a/docs/base-chain/quickstart/builder-codes.mdx b/docs/base-chain/quickstart/builder-codes.mdx index 39b65a75..d4b4ea5c 100644 --- a/docs/base-chain/quickstart/builder-codes.mdx +++ b/docs/base-chain/quickstart/builder-codes.mdx @@ -21,11 +21,83 @@ Once your app is registered on [Base.dev](http://base.dev/), the Base App will a ## For App Developers -When you register on [base.dev](https://base.dev/), you will receive a **Builder Code**—a random string (e.g., `k3p9da`) that you'll use to generate your attribution suffix. +When you register on [base.dev](https://base.dev/), you will receive a **Builder Code**—a random string (e.g., `bc_b7k3p9da` ) that you'll use to generate your attribution suffix. -You can find your code anytime under **Settings** → **Builder Code**. + + You can find your code anytime under **Settings** → **Builder Code**. + + + + + +This will allow you to append the encoded version of your builder code. + + ```bash Terminal + npm i ox + ``` + + + + Navigate to **base.dev > Settings > Builder Codes** to find your unique builder code. + + + + Use the `Attribution.toDataSuffix` method from the `ox` library to encode your builder code: -Manual appending outside of the Base app is coming soon. + ```ts App.tsx + import { Attribution } from "ox/erc8021"; + + const DATA_SUFFIX = Attribution.toDataSuffix({ + codes: ["YOUR-BUILDER-CODE"], // obtained from base.dev > Settings > Builder Codes + }); + ``` + + + + Use Wagmi's `useSendCalls` hook with the `dataSuffix` capability to append attribution data to your transactions. + + ```ts App.tsx + import { useSendCalls } from "wagmi"; + import { parseEther } from "viem"; + import { Attribution } from "ox/erc8021"; + + const DATA_SUFFIX = Attribution.toDataSuffix({ + codes: ["YOUR-BUILDER-CODE"], + }); + + function App() { + const { sendCalls } = useSendCalls(); + + return ( + + ); + } + ``` + + ## For Wallet Developers