# @anywalletkit/protocol-staking-tonstakers-ton 中文文档

规范地址：https://npmcn.com/package/%40anywalletkit/protocol-staking-tonstakers-ton/

版本：0\.3\.1
npm 元数据更新时间：2026-11-02T20:13:36.597Z
中文译文更新时间：2026-11-06T22:44:38.214Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40anywalletkit/protocol-staking-tonstakers-ton
原文对照：https://npmcn.com/package/%40anywalletkit/protocol-staking-tonstakers-ton/?lang=original
项目主页：https://docs.anywallet.tech/
源码仓库：https://github.com/ultratestbro/anywalletkit

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：80.6 kB，12 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=22
- 运行依赖：3 个
- peer 依赖：@anywalletkit/core 0\.8\.0
- 首次发布：2026-10-24T18:41:43.568Z
- 最新版本发布：2026-11-02T20:13:36.093Z
- 近 30 天下载量：2223（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：12（近 12 个月 12 个）

## 中文简介

一个简单的包,让@anywalletkit/wallet-ton钱包账户通过Tonstakers: sick GRAM → tston, unstake 即时/标准/最高速率,跟踪支付账单,费率和APY.

## 安装

```sh
npm install @anywalletkit/protocol-staking-tonstakers-ton
```

也可以使用：`pnpm add @anywalletkit/protocol-staking-tonstakers-ton`、`yarn add @anywalletkit/protocol-staking-tonstakers-ton`、`bun add @anywalletkit/protocol-staking-tonstakers-ton`

## README

# @anywalletkit/protocol-sking-tonstakers-ton (英语)

[![npm](https://img.shields.io/npm/v/@anywalletkit/protocol-staking-tonstakers-ton?label=npm)](https://www.npmjs.com/package/@anywalletkit/protocol-staking-tonstakers-ton)

一个简单的软件包 `@anywalletkit/wallet-ton` 钱包账户赌注 结束 [收货人](https://tonstakers.com/): 赌注GRAM ~ tston, 退出 即时/标准/最高比率、跟踪付款账单、阅读率、APY和 收入.

## 安装

```sh
npm install @anywalletkit/protocol-staking-tonstakers-ton @anywalletkit/core
# or: pnpm add @anywalletkit/protocol-staking-tonstakers-ton @anywalletkit/core  ·  yarn add @anywalletkit/protocol-staking-tonstakers-ton @anywalletkit/core
```

时间: [@anywalletkit/protocol-sking-tonstakers-ton (英语)](https://www.npmjs.com/package/@anywalletkit/protocol-staking-tonstakers-ton)发表于 [发布工作流程](https://github.com/ultratestbro/anywalletkit/blob/main/RELEASING.md) 与出处.

建为 **第三次审查会议 `StakingProtocol` 类型** 内 `@anywalletkit/core` - 在Lido(ETH液体吸取)和SSV(抽取)之后 与冷却)——和第一个关闭EVM. 基础类在 `src/staking-protocol.js` 是同一文件, 字节相同; 一个 TON 液体 切入协议是关键:类型是连锁不可知的.

机械师从一个生产钱包取出(反应土著/赫尔姆斯) 在那里,每笔资金都是用实际资金进行的.

## 收钱人和TSTON是什么

开放网络的原生代号是 **图像** (Toncoin更名为Gram on 2026-06-15; 链条保留了TON名称. [收货人](https://tonstakers.com/) 是TON最大的取出液池(~128M GRAM,~140k 的利害关系人): 合同向验证人借出存入的GRAM **锡通** 是非基于 接收喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气式喷气气式喷气式喷气气管式喷气管式喷气管式喷气管式喷气管式喷气式喷气管式喷气式喷气式喷气式喷气气式喷气式喷气管式喷气管式喷气式喷气式喷气式喷气式喷气气式喷气式喷气气式喷气式喷气式喷气式喷气雾式喷气式喷气式喷气式喷气式喷气式喷气式喷气式 游泳池在喷气管供应上的平衡 并且每次验证一次 圆(~18h). 退出以三种模式之一刻录 tsTON : **标准** (现付) 足够的时候,从游泳池的免费流动资金, 否则支付账单 在圆圆之后, **即时** (现在支付,或消息反弹—— 从来没有法案, **最高比率** (总是一个账单,在圆末解决) (预计费率) 账单是NFT 游泳池自己支付,什么都没有 以权利主张.

## 使用量

```js
import WalletManagerTon from '@anywalletkit/wallet-ton'
import TonstakersProtocolTon from '@anywalletkit/protocol-staking-tonstakers-ton'

const wallet = new WalletManagerTon(seed, { tonClient: { url: 'https://toncenter.com/api/v2/jsonRPC' } })
const account = await wallet.getAccount(0)

const tonstakers = new TonstakersProtocolTon(account, {
  partnerCode: 0x…n // optional: Tonstakers partner code for referral attribution
})

// Stake — tsTON lands at the pool rate; the message carries +1 GRAM the pool refunds
const { hash, fee } = await tonstakers.stake({ amount: 10n ** 9n })

// Exit: standard (default), instant (fill-or-kill) or bestRate (round-end rate)
await tonstakers.requestWithdrawal({ amount: 10n ** 9n, mode: 'instant' })

// Bills waiting for their round (settled automatically — nothing to claim)
const { requests, pendingAmount } = await tonstakers.getWithdrawalRequests()

// Views
await tonstakers.getStakedBalance()   // { balance: tsTON, rate: GRAM per tsTON, total: GRAM value }
await tonstakers.getApr()             // 12.86 (percent, tonapi)
```

界面外的吨位接收器特异性外加:

```js
await tonstakers.getPoolData()         // halted, depositsOpen, balances, minter, payout collection, rates
await tonstakers.getRates()            // { rate, projectedRate } — GRAM per tsTON, 1e9 fixed
await tonstakers.getInstantLiquidity() // GRAM the pool can pay instant exits from
await tonstakers.getJettonWallet()     // the account's tsTON jetton wallet (derived, checked against the minter)
await tonstakers.getTokenBalance()     // tsTON held
await tonstakers.getRewards()          // earned GRAM = (rate − weighted entry rate) × tsTON
```

## 它如何映射到界面上

| `IStakingProtocol` | 收货人 |
| --- | --- |
| `stake({ amount })` | 给游泳池的一条信息: `amount + 1 GRAM`数字 `op 0x47d54391 · query_id 1 · partner code` |
| `requestWithdrawal({ amount, mode })` | 刻入帐号TSTON喷气式钱包: `1.05 GRAM` 附录,正文 `op 0x595f07bc · amount · owner · {wait_till_round_end, fill_or_kill}` |
| `getWithdrawalRequests()` | 该账户的付款单 NFT 在游泳池的活出收款(`claimable` 总是虚假的) |
| `claimWithdrawals()` | **拒绝** - 账单由现金池结算,没有索赔 |
| `getStakedBalance()` | tSTON平衡, `rate` (gRAM/TSTON, `total` = GRAM 数值 |
| `getApr()` | tonapi 的取景池视图( 取景者显示的数字) |

三个诚实的偏差,记录在方法上而不是纸上: 出口已经 **模式** (额外) `mode` 第二阶段是 **自动** (这样) `claimWithdrawals` 拒绝而不是假装),并且 `total` 是该位置的 **在 GRAM 中的值** 对于无根据的收据 GRAM值是表示任何东西的数字.

## 为什么它看起来是这样

-   **SDK官方只说通Connect** (单位:千美元)`tonstakers-sdk` 建造和 通过连接器发送;不导出有效载荷)。 此模块构建相同 电文——业务代码、费用储备、有效载荷布局、字节字节——和 自己开的 `sendTransaction({ to, value, body })`,在本地签名.
-   **电线上的友好地址**: 模块交出账户 `EQ…` 窗体,带有回弹旗 `0:…` 喷气式钱包地址 携带无.
-   **池状态在链上读取** (单位:千美元)`get_pool_full_data`,已校验布局 与主网相对,通过账户的通克通 与故障跨越 配置客户端 。 公共指针节点间歇回答退出代码 -13,所以每个客户都有两次尝试.
-   **即时出口已预先检查** 与游泳池的自由平衡 但反弹没有可读的理由.
-   **REST是装饰**账单和APY来自官方指数 SDK读取(tonapi、Tonstakes' payout API),可压倒性或可禁用 `config.endpoints`连锁流动从不依赖它们 `getRewards` 降解为无效.
-   **没有 `AbortSignal.timeout` 编号 : `.any`**,没有 `process.env` - 赫尔墨斯和赤裸 亲切. 主网和测试网 船池和TSTON minter默认.
-   **喷气式钱包来源于而非信任**帐号是TSTON喷气式飞机 钱包——每个未取出的 1.05 GRAM 的去向在 由薄荷薄荷薄荷薄荷码制成的设备(`TONSTAKERS_JETTON_WALLET_CODES`, (中文(简体) ), `deriveTonstakersJettonWallet`),和"薄荷"(薄荷) `get_wallet_address` 必须 同意,否则拒绝打电话 无被绑定代码的薄荷( 习惯) `addresses.jetton`需求 `jettonWalletCode`,或明示 `allowUnverifiedJettonWallet: true` 相信节点的答案.

## 配置

```js
new TonstakersProtocolTon(account, {
  tonClient,     // TonClient | { url, secretKey } | array of either; defaults to the account's
  network,       // '-239' mainnet (default) or '-3' testnet
  addresses,     // { pool, jetton }
  jettonWalletCode,            // Cell | base64 BOC — wallet code of a minter not pinned in the package
  allowUnverifiedJettonWallet, // true: no known code, trust get_wallet_address (off by default)
  partnerCode,   // referral attribution in stake payloads
  endpoints      // { tonapi, withdrawalPayouts } — null disables the feature
})
```

主网合同(核实直播):游泳池 `EQCkWxfyhAkim3g2DjKQQg8T5P4g-Q1-K_jErGcDJZ4i-vqR`,TSTON 薄荷 `EQC98_qAmNEptUtPc7W6xdHh_ZHrBUFpw5Ft_IzNU20QAJav`。 。 。 .

## 测试

```
npm test              # offline unit tests (node:test, stubbed TonClient + account)
npm run verify:live   # read-only checks against mainnet (pool getter, jetton wallet, APY, bills, message builders)
```

## 活动

`describeActivity(tx, { own })` 标签 钱包历史的Tonstakers 交易, 离线和同步, 与部署相对应( 集合 + tsTON 喷射器主机; 地址按原始比较) `wc:hex` 形式,所以友好而原始的拼写都吻合). 三个形状:一个消息 **到游泳池时** 其行动是 `OP_STAKE` 0x47d54391(或未解码) `stake` “Staked GRAM” (净GRAM出局——净值为净值的集合收益——tsTON定值入局); a **燃烧** (临 时 `OP_UNSTAKE` 0x595f07bc,读自 `call.data` 作为十六进制/ 十进制或从 `call.method`用TSTON喷气管转移离开钱包 `unstake` (目的地是钱包本身的喷气式钱包,无法静态知晓,所以喷气式运动就是证据) **收到** 载有 GRAM 的池中的消息( op 0x0a77535c) `tonstake_pool_withdrawal` 当解码时,没有我们的电话 `claim` "收到未带走的GRAM". 字幕 `"Tonstakers · TON"`, (中文(简体) ), `counterparty` 游泳池。 游泳池。 其他一切——普通GRAM或喷气管转移,其他集合——都是无效的.

装入 `fixtures/activity/` 是测试钱包的注资运行(取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取; `negatives/` 持有GRAM转帐和USD 喷气式飞机转帐.

## 常见问题

### @anywalletkit/protocol-staking-tonstakers-ton 是什么？

一个简单的包,让@anywalletkit/wallet-ton钱包账户通过Tonstakers: sick GRAM → tston, unstake 即时/标准/最高速率,跟踪支付账单,费率和APY\.

### 如何安装 @anywalletkit/protocol-staking-tonstakers-ton？

在项目目录运行 npm install @anywalletkit/protocol-staking-tonstakers-ton，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@anywalletkit/core（0\.8\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @anywalletkit/protocol-staking-tonstakers-ton 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @anywalletkit/protocol-staking-tonstakers-ton 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @anywalletkit/protocol-staking-tonstakers-ton 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @anywalletkit/protocol-staking-tonstakers-ton 可以商用吗？

@anywalletkit/protocol-staking-tonstakers-ton 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @anywalletkit/protocol-staking-tonstakers-ton 的下载量有多少？

根据 npm 官方下载统计，@anywalletkit/protocol-staking-tonstakers-ton 在 2026/10/06 – 2026/11/04 这 30 天内被下载 2,223 次，日均约 74 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @anywalletkit/protocol-staking-tonstakers-ton 还在维护吗？

最新版本 0\.3\.1 发布于 2026/11/03（5 天前）；至今共发布 12 个版本，其中过去 12 个月发布了 12 个；首次发布于 2026/10/25。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

