基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Hawwal/Osherai --skill thirdweb命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
ERC-8004 Agent Trust Protocol for AI agent identity, reputation, and validation on Celo. Use when building AI agents that need identity registration, reputation tracking, or trust verification across organizational boundaries.
Bridge assets to and from Celo. Use when transferring tokens between Celo and other chains like Ethereum.
Scaffold Celo dApps with Celo Composer. Use when starting new Celo projects, creating MiniPay apps, or setting up development environments.
| name | thirdweb |
| description | Use thirdweb SDK for Celo development. Includes wallet connection, contract deployment, and pre-built UI components. |
| license | Apache-2.0 |
| metadata | {"author":"celo-org","version":"1.0.0"} |
Thirdweb is a full-stack Web3 development platform with SDK support for Celo.
Source: https://docs.celo.org/tooling/libraries-sdks/thirdweb-sdk/index.md
npm install thirdweb
Or create a new project:
npx thirdweb create app
import { createThirdwebClient } from "thirdweb";
export const client = createThirdwebClient({
clientId: process.env.NEXT_PUBLIC_THIRDWEB_CLIENT_ID!,
});
For server-side usage:
const client = createThirdwebClient({
secretKey: process.env.THIRDWEB_SECRET_KEY!,
});
Source: https://portal.thirdweb.com/typescript/v5/getting-started
import { celo } from "thirdweb/chains";
// Use directly
const chain = celo;
import { defineChain } from "thirdweb";
const celoChain = defineChain(42220);
// Or with custom RPC
const celoCustom = defineChain({
id: 42220,
rpc: "https://forno.celo.org",
});
Source: https://portal.thirdweb.com/typescript/v5/chain
import { ThirdwebProvider } from "thirdweb/react";
function App({ children }: { children: React.ReactNode }) {
return (
<ThirdwebProvider>
{children}
</ThirdwebProvider>
);
}
import { ConnectButton } from "thirdweb/react";
import { celo } from "thirdweb/chains";
import { client } from "./client";
function WalletConnect() {
return (
<ConnectButton
client={client}
chain={celo}
/>
);
}
import { ConnectButton } from "thirdweb/react";
import { createWallet } from "thirdweb/wallets";
const wallets = [
createWallet("io.metamask"),
createWallet("com.coinbase.wallet"),
createWallet("app.valora"),
];
function WalletConnect() {
return (
<ConnectButton
client={client}
wallets={wallets}
/>
);
}
import { getContract } from "thirdweb";
import { celo } from "thirdweb/chains";
const contract = getContract({
client,
chain: celo,
address: "0x...",
});
import { useReadContract } from "thirdweb/react";
import { balanceOf } from "thirdweb/extensions/erc20";
function TokenBalance({ address }: { address: string }) {
const { data, isLoading } = useReadContract(
balanceOf,
{
contract,
address,
}
);
if (isLoading) return <div>Loading...</div>;
return <div>Balance: {data?.toString()}</div>;
}
import { useSendTransaction } from "thirdweb/react";
import { transfer } from "thirdweb/extensions/erc20";
function TransferTokens() {
const { mutate: sendTransaction, isPending } = useSendTransaction();
async function handleTransfer() {
const transaction = transfer({
contract,
to: "0x...",
amount: "10",
});
sendTransaction(transaction);
}
return (
<button onClick={handleTransfer} disabled={isPending}>
Transfer
</button>
);
}
import { useActiveAccount } from "thirdweb/react";
function Account() {
const account = useActiveAccount();
if (!account) return <div>Not connected</div>;
return <div>Connected: {account.address}</div>;
}
import { useWalletBalance } from "thirdweb/react";
import { celo } from "thirdweb/chains";
function Balance() {
const account = useActiveAccount();
const { data, isLoading } = useWalletBalance({
client,
chain: celo,
address: account?.address,
});
if (isLoading) return <div>Loading...</div>;
return <div>{data?.displayValue} {data?.symbol}</div>;
}
import { createThirdwebClient } from "thirdweb";
import { getContract } from "thirdweb";
import { celo } from "thirdweb/chains";
import { getNFTs } from "thirdweb/extensions/erc1155";
const client = createThirdwebClient({
secretKey: process.env.THIRDWEB_SECRET_KEY!,
});
const contract = getContract({
client,
chain: celo,
address: "0x...",
});
const nfts = await getNFTs({ contract });
Thirdweb provides type-safe extensions for common contracts:
| Extension | Import Path |
|---|---|
| ERC20 | thirdweb/extensions/erc20 |
| ERC721 | thirdweb/extensions/erc721 |
| ERC1155 | thirdweb/extensions/erc1155 |
Deploy to decentralized storage:
npx thirdweb deploy --app
# .env
NEXT_PUBLIC_THIRDWEB_CLIENT_ID=your_client_id
THIRDWEB_SECRET_KEY=your_secret_key # Server-side only
{
"dependencies": {
"thirdweb": "^5.0.0"
}
}