Skip to content

Commit

Permalink
Merge branch 'aptos-labs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
astinz authored Nov 14, 2024
2 parents 5d82983 + aedd31c commit e4d67c0
Show file tree
Hide file tree
Showing 5 changed files with 278 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useData } from 'nextra/hooks'
# Next.js SSG

With Next.js, you can pre-render your page using
[Static Generation (SSG)](https://nextjs.org/docs/basic-features/pages#static-generation-recommended).
[Static Generation (SSG)](https://nextjs.org/docs/pages/building-your-application/rendering/static-site-generation).
Your pages will be generated at build time and statically served to visitors. It
can also be cached by a CDN to maximize the performance.

Expand Down
5 changes: 4 additions & 1 deletion apps/nextra/pages/zh/build/_meta.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export default {
"get-started": "開始",
"get-started": "开始",
cli: "CLI",
apis: "APIs",
guides: "Guides",
indexer: "Indexer",
sdks: "SDKs",
};
40 changes: 40 additions & 0 deletions apps/nextra/pages/zh/build/guides.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "从指南中学习"
---

import { Cards, Card } from '@components/index';

# 指南

选择以下任一指南来学习如何在 Aptos 中实现您的使用场景!

<Cards>
<Card href="guides/first-transaction">
<Card.Title>您的第一笔交易</Card.Title>
<Card.Description>如何生成、提交并验证到 Aptos 区块链的交易。</Card.Description>
</Card>
<Card href="guides/your-first-nft">
<Card.Title>您的第一个 NFT</Card.Title>
<Card.Description>学习 Aptos 代币接口,并使用它来生成您的第一个 NFT。</Card.Description>
</Card>
<Card href="guides/first-fungible-asset">
<Card.Title>您的第一个可替代资产</Card.Title>
<Card.Description>学习如何部署和管理可替代资产。</Card.Description>
</Card>
<Card href="guides/first-coin">
<Card.Title>您的第一个硬币</Card.Title>
<Card.Description>学习如何部署和管理硬币。</Card.Description>
</Card>
<Card href="guides/first-move-module">
<Card.Title>您的第一个 Move 模块</Card.Title>
<Card.Description>为 Aptos 区块链编写您的第一个 Move 模块。</Card.Description>
</Card>
<Card href="guides/build-e2e-dapp">
<Card.Title>您的第一个去中心化应用(Dapp)</Card.Title>
<Card.Description>学习如何构建您的第一个去中心化应用,重点是构建应用的用户界面。</Card.Description>
</Card>
<Card href="guides/first-multisig">
<Card.Title>您的第一个多签操作</Card.Title>
<Card.Description>学习如何使用 K-of-N 多签验证执行各种操作。</Card.Description>
</Card>
</Cards>
126 changes: 126 additions & 0 deletions apps/nextra/pages/zh/build/indexer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
title: "索引器"
---

import { IndexerBetaNotice, ThemedImage, Cards, Card, GraphQLEditor } from '@components/index';
import { Tabs, Callout } from 'nextra/components'

# 索引器

<IndexerBetaNotice />

Aptos 索引器是一个 API,您可以使用它来获取:

1. 聚合数据(例如:有多少 NFTs 存在?)
2. 历史数据(例如:此账户提交了哪些交易?)
3. 从简单的 [Aptos 节点 API](apis/fullnode-rest-api.mdx) 很难获取的数据(例如:哪个账户拥有名为“ExampleToken”的代币?)

例如,您可以使用索引器 API 查询任意账户的可替代资产余额,代码如下:

<GraphQLEditor
query={`query GetFungibleAssetBalances($address: String, $offset: Int) {
current_fungible_asset_balances(
where: {owner_address: {_eq: $address}},
offset: $offset,
limit: 100,
order_by: {amount: desc}
) {
asset_type
amount
__typename
}
}`}
variables={`{
"address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"offset": 0
}`}
/>

<Callout type="info">
索引器会跟踪链上发生的每笔交易,然后通过 GraphQL API 公开这些数据。
</Callout>

## 使用索引器 API

了解如何使用索引器 API、每个表代表的含义,以及如何向索引器添加自定义数据。

<Cards>
<Card href="indexer/aptos-hosted">
<Card.Title>访问 API</Card.Title>
<Card.Description>了解如何查询索引器 API。</Card.Description>
</Card>
<Card href="indexer/indexer-reference">
<Card.Title>索引器表参考</Card.Title>
<Card.Description>详细的索引器表格及其架构参考。</Card.Description>
</Card>
<Card href="indexer/architecture">
<Card.Title>架构</Card.Title>
<Card.Description>索引器架构的详细布局。</Card.Description>
</Card>
</Cards>

### 示例查询

为了帮助您快速入门,以下是索引器常用的一些查询示例。

<Cards>
<Card href="indexer/fungible-asset-balances">
<Card.Title>获取可替代资产余额</Card.Title>
<Card.Description>获取某账户当前拥有的所有可替代资产。</Card.Description>
</Card>
<Card href="indexer/account-transactions">
<Card.Title>获取账户交易</Card.Title>
<Card.Description>获取影响某账户的所有交易记录。</Card.Description>
</Card>
<Card href="indexer/ans-lookup">
<Card.Title>获取 Aptos 名称</Card.Title>
<Card.Description>通过 ANS 检索与某账户关联的 Aptos 名称。</Card.Description>
</Card>
<Card href="indexer/fungible-asset-info">
<Card.Title>获取可替代资产信息</Card.Title>
<Card.Description>获取特定可替代资产的详细信息。</Card.Description>
</Card>
<Card href="indexer/get-nft-collections">
<Card.Title>获取 NFT 集合</Card.Title>
<Card.Description>检索某账户拥有的 NFT 集合。</Card.Description>
</Card>
<Card href="indexer/get-nfts">
<Card.Title>获取 NFT</Card.Title>
<Card.Description>检索某账户拥有的个人 NFT。</Card.Description>
</Card>
<Card href="indexer/token-metadata">
<Card.Title>获取代币元数据</Card.Title>
<Card.Description>获取特定代币的元数据信息。</Card.Description>
</Card>
<Card href="indexer/get-delegators">
<Card.Title>统计质押池中的委托人</Card.Title>
<Card.Description>检索质押池中活跃的委托人数量。</Card.Description>
</Card>
</Cards>

## 自定义索引器(进阶)

如果托管的索引器 API 不够用,您可以自定义并托管自己的索引器版本。

<Cards>
<Card href="indexer/architecture">
<Card.Title>架构</Card.Title>
<Card.Description>索引器架构的详细布局。</Card.Description>
</Card>
<Card href="indexer/custom-processors">
<Card.Title>自定义处理器</Card.Title>
<Card.Description>自定义索引器中数据处理和共享的方式。</Card.Description>
</Card>
<Card href="indexer/txn-stream">
<Card.Title>交易流服务</Card.Title>
<Card.Description>索引器使用的 GRPC 交易流服务。</Card.Description>
</Card>
<Card href="indexer/self-hosted">
<Card.Title>自托管索引器 API</Card.Title>
<Card.Description>托管您自己的索引器 API。</Card.Description>
</Card>
</Cards>

## 旧版索引器

在此处查找旧版索引器的相关信息 [here](indexer/legacy.mdx).
107 changes: 107 additions & 0 deletions apps/nextra/pages/zh/build/sdks.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import { Card, Cards } from '@components/index'

# 官方 SDK
使用这些 Aptos 软件开发工具包 (SDK),结合 [Aptos CLI](cli.mdx) 进行 Aptos 区块链的开发。

<Cards className="xl:grid-cols-2">
<Card href="./sdks/ts-sdk" className="flex flex-row gap-4">
<Card.Image src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Typescript_logo_2020.svg/2048px-Typescript_logo_2020.svg.png" />
<div className="flex flex-col gap-2">
<Card.Title>Typescript SDK</Card.Title>
<Card.Description>
Aptos Typescript SDK (推荐)
```sh
pnpm i @aptos-labs/ts-sdk
```
</Card.Description>
</div>
</Card>
<Card href="./sdks/python-sdk" className="flex flex-row gap-4">
<Card.Image src="https://upload.wikimedia.org/wikipedia/commons/archive/c/c3/20220730085403%21Python-logo-notext.svg" />
<div className="flex flex-col gap-2">
<Card.Title>Python SDK</Card.Title>
<Card.Description>
Aptos Python SDK
```sh
pip3 install aptos-sdk
```
</Card.Description>
</div>
</Card>
<Card href="./sdks/go-sdk" className="flex flex-row gap-4">
<Card.Image src="https://go.dev/blog/go-brand/Go-Logo/PNG/Go-Logo_Blue.png" />
<div className="flex flex-col gap-2">
<Card.Title>Go SDK</Card.Title>
<Card.Description>
Aptos Go SDK
</Card.Description>
</div>
</Card>
<Card href="./sdks/dotnet-sdk" className="flex flex-row gap-4">
<Card.Image src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Microsoft_.NET_logo.svg/800px-Microsoft_.NET_logo.svg.png" />
<div className="flex flex-col gap-2">
<Card.Title>C#/.NET SDK</Card.Title>
<Card.Description>
Aptos .NET SDK
```sh
dotnet add package Aptos
```
</Card.Description>
</div>
</Card>
<Card href="./sdks/rust-sdk" className="flex flex-row gap-4">
<Card.Image className="dark:invert" src="https://upload.wikimedia.org/wikipedia/commons/d/d5/Rust_programming_language_black_logo.svg" />
<div className="flex flex-col gap-2">
<Card.Title>Rust SDK</Card.Title>
<Card.Description>Aptos Rust SDK</Card.Description>
</div>
</Card>
<Card href="./sdks/cpp-sdk" className="flex flex-row gap-4">
<Card.Image className="object-contain" src="https://upload.wikimedia.org/wikipedia/commons/1/18/ISO_C%2B%2B_Logo.svg" />
<div className="flex flex-col gap-2">
<Card.Title>C++ / Unreal SDK</Card.Title>
<Card.Description>Aptos C++ / Unreal SDK</Card.Description>
</div>
</Card>
<Card href="./sdks/unity-sdk" className="flex flex-row gap-4">
<Card.Image src="https://cdn-icons-png.freepik.com/512/5969/5969346.png" />
<div className="flex flex-col gap-2">
<Card.Title>Unity SDK</Card.Title>
<Card.Description>Aptos Unity SDK</Card.Description>
</div>
</Card>
<Card href="./sdks/wallet-adapter" className="flex flex-row gap-4">
<Card.Image src="/docs/wallet-adapter.svg" className="dark:invert" />
<div className="flex flex-col gap-2">
<Card.Title>Wallet Adapter</Card.Title>
<Card.Description>
Aptos Wallet Adapter
</Card.Description>
</div>
</Card>
</Cards>

## [社区 SDK](./sdks/community-sdks.mdx)

由社区提供的 Aptos SDK。这些 SDK 可能未经过 Aptos 团队的完全审查,且可能仍在开发中。它们仍然作为所有开发者的资源提供。

<Cards className="xl:grid-cols-2">
<Card href="./sdks/community-sdks/kotlin-sdk" className="flex flex-row gap-4">
<Card.Image className="object-contain" src="https://upload.wikimedia.org/wikipedia/commons/3/37/Kotlin_Icon_2021.svg" />
<div className="flex flex-col gap-2">
<Card.Title>Kotlin SDK</Card.Title>
<Card.Description>
Aptos Kotlin Multiplatform SDK by Kaptos
</Card.Description>
</div>
</Card>
<Card href="./sdks/community-sdks/swift-sdk" classname="flex flex-row gap-4">
<Card.Image classname="object-contain" src="https://developer.apple.com/swift/images/swift-og.png" />
<div className="flex flex-col gap-2">
<Card.Title>Swift SDK</Card.Title>
<Card.Description>
Aptos Swift SDK by Alcove
</Card.Description>
</div>
</Card>
</Cards>

0 comments on commit e4d67c0

Please sign in to comment.