-
Notifications
You must be signed in to change notification settings - Fork 26
docs: align TS SDK docs with post-FA APT patterns (aptos-ts-sdk #852) #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -159,6 +159,8 @@ import { Aside, Steps, TabItem, Tabs } from '@astrojs/starlight/components'; | |||||||
| function: "0x1::aptos_account::transfer", | ||||||||
| functionArguments: [bob.accountAddress, 100], | ||||||||
| }, | ||||||||
| // Lower default gas fits typical devnet faucet funding (1 APT) | ||||||||
|
||||||||
| // Lower default gas fits typical devnet faucet funding (1 APT) | |
| // Gas unit cap suitable for typical devnet faucet funding (for example, 1 APT); | |
| // actual max fee paid is maxGasAmount * gasUnitPrice (in octas) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -42,18 +42,27 @@ const tokens = await aptos.getAccountOwnedTokens({ accountAddress: "0x123" }); | |||||
|
|
||||||
| ## 使用通用查询 | ||||||
|
|
||||||
| 某些查询设计上是宽泛的,但这可能使得推断正确的返回类型变得困难.为了适应这种情况,像 `getAccountResources` 这样的广泛请求允许你指定预期的响应类型. | ||||||
| 某些查询设计上是宽泛的,但这可能使得推断正确的返回类型变得困难.为了适应这种情况,像 `getAccountResources` 这样的广泛请求允许你在使用 `getAccountResource` 时指定预期的响应类型. | ||||||
|
||||||
| 某些查询设计上是宽泛的,但这可能使得推断正确的返回类型变得困难.为了适应这种情况,像 `getAccountResources` 这样的广泛请求允许你在使用 `getAccountResource` 时指定预期的响应类型. | |
| 某些查询在设计上是宽泛的,但这可能使得推断正确的返回类型变得困难.为了解决这一问题,你可以在调用 `getAccountResource<T>` 时通过泛型类型参数 `T` 明确指定预期的响应类型,从而让 TypeScript 正确推断返回值. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -155,6 +155,8 @@ import { Aside, Steps, TabItem, Tabs } from '@astrojs/starlight/components'; | |||||
| function: "0x1::aptos_account::transfer", | ||||||
| functionArguments: [bob.accountAddress, 100], | ||||||
| }, | ||||||
| // 降低默认 gas 上限以适配常见 devnet 水龙头额度(1 APT) | ||||||
|
||||||
| // 降低默认 gas 上限以适配常见 devnet 水龙头额度(1 APT) | |
| // 将默认 gas 上限设为 100_000 个 gas 单位。实际最高手续费为 maxGasAmount * gasUnitPrice(以 octa 计),请根据账户余额(例如 devnet 常见的 1 APT 水龙头额度)调整。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording here is internally inconsistent: it cites
getAccountResourcesas the “broad request”, but then says you specify the expected type “when you usegetAccountResource”. Since the example isgetAccountResource<T>(...), consider rephrasing to describegetAccountResource(or show an example forgetAccountResources) to avoid confusing readers about which API supports generic typing.