@acentswap/chains 中文文档教程
@acentswap/chains
@acentswap/chains
将所有其他链包导入到一个包中。
Adding chains
Requirements
在为 AcentJS 编写链处理程序之前,它应该已经被 多链存储库 和darknode 存储库。
Implementation
可以在 ../../interfaces/src/chain.ts
。 有两种类型的链——锁链和铸币链,每种都需要不同的处理程序接口。 锁链处理器适用于资金被锁定在 AcentVM 控制下的链——例如比特币或 Zcash。 薄荷链处理程序用于创建包装令牌的链 - 例如以太坊。
如果一条链是另一个受支持链的分叉,建议处理程序扩展分叉链的处理程序。
如果一条链有多种资产(例如 ETH 和 ERC20),建议编写一个支持所有相关资产的处理程序。
@acentswap/chains
@acentswap/chains
imports all the other chain packages into a single package.
Adding chains
Requirements
Before a chain handler is written for AcentJS, it should have already been accepted into both the multichain repository and the darknode repository.
Implementation
The expected interface can be found in ../../interfaces/src/chain.ts
. There are two types of chains - lock chains and mint chains, each requiring a different handler interface. Lock chain handlers are for chains where funds are locked up under AcentVM's control - e.g. Bitcoin or Zcash. A mint chain handler is for the chain where the wrapped tokens are created - e.g. Ethereum.
If a chain is a fork of another supported chain, it's recommended that the handler extends the forked chain's handler.
If a chain has multiple assets (e.g. ETH and ERC20s), it's recommended that a single handler is written that supports all the relevant assets.