Skip to content

Commit 174f217

Browse files
committed
tp extension explain
1 parent ce502ca commit 174f217

File tree

1 file changed

+83
-9
lines changed

1 file changed

+83
-9
lines changed

README.md

Lines changed: 83 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,40 @@
1+
## 背景
2+
3+
TokenPocket是一款深受全球用户喜爱的多链钱包,简单好用, 多链多资产,方便用户管理主流底层链资产,现已支持**比特币、以太坊、EOS、波卡、波场、BSC、HECO、IOST、Cosmos、Binance、BOS、MOAC和Jingtum**等主流项目链。
4+
5+
TokenPocket钱包现已支持通过配置即可完成添加支持**EVM(以太系),Polkadot(波卡系),EOSIO**技术系的链。**EVM,Polkadot,EOSIO**技术系的项目方如果希望TokenPocket钱包支持其链项目。按照本文档描述提供必要的网络信息,由TokenPocket官方人员审核完成后, 即可在TokenPocket钱包快速集成项目方的链。更多详细信息请参考[TokenPocket官方开发者文档](https://help.tokenpocket.pro/tp-developer/network/chains/addchain-multifunction)
6+
7+
TokenPocket Chainlist is a list of EVM(ethereum)/Polkadot/EOSIO networks. Users can use the information to connect their wallets and Web3 middleware providers to the appropriate Chain ID and Network ID to connect to the correct chain.
8+
19
## How to add a new chain
210

311
Fork this repo and add your evm chain info into `chains.json`
412

13+
| Field | Describe | Remark |
14+
| -------------- | --------------- | ------------------------------------------------------------ |
15+
| name | name | full name of chain |
16+
| chainId | chain id | chain id exists in ethereum evm networks |
17+
| namespace | namespace | TokenPocket Wallet Extension, available value ethereum/polkadot/eosio |
18+
| shortName | short name | short name of chain |
19+
| network | network | |
20+
| networkId | network id | |
21+
| nativeCurrency | native currency | |
22+
| rpc | rpc | |
23+
| faucets | faucets | |
24+
| infoURL | info URL | |
25+
| appResource | app resource | TokenPocket Wallet Extension |
26+
27+
**chainId & networkId:** Ethereum networks have two identifiers, a network ID and a chain ID. Although they often have the same value, they have different uses.Peer-to-peer communication between nodes uses the *network ID*, while the transaction signature process uses the *chain ID*.
28+
29+
30+
531
Example:
632

733
```javascript
834
{
935
"name": "xDAI Chain",
1036
"chainId": 100,
37+
"namespace": "ethereum",
1138
"shortName": "xdai",
1239
"chain": "XDAI",
1340
"network": "mainnet",
@@ -28,20 +55,67 @@ Example:
2855
],
2956
"faucets": [],
3057
"infoURL": "https://forum.poa.network/c/xdai-chain",
31-
"app_resource": {
32-
"ic_chain_select": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png",
33-
"ic_chain_unselect": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/0.png",
34-
"color_chain_bg": "0x58B2AF"
58+
"appResource": {
59+
"icChainSelect": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png",
60+
"icChainUnselect": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/0.png",
61+
"colorChainBg": "0x58B2AF",
62+
"txUrl":" https://xxxchaintxserver.xxx.xxx",
63+
"browserInfo": [{
64+
"name": "Xscan",
65+
"icon": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png",
66+
"addr": "https://xxx1scan.io/"
67+
},{
68+
"name": "xDAIscan",
69+
"icon": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png",
70+
"addr": "https://xxx2can.io/"
71+
}]
3572
}
3673
}
3774
```
3875

39-
`app_resource` is optional, which is only affect the appearance in TokenPocket Wallet. You can follow the standard below:
4076

4177

42-
![standard](https://tp-statics.tokenpocket.pro/images/custom-chains-standard-1.png)
43-
![standard](https://tp-statics.tokenpocket.pro/images/custom-chains-standard-2.png)
44-
![standard](https://tp-statics.tokenpocket.pro/images/custom-chains-standard-3.png)
45-
![standard](https://tp-statics.tokenpocket.pro/images/custom-chains-standard-4.png)
78+
### appResource
79+
80+
`appResource` is optional, which is only affect the appearance in TokenPocket Wallet. You can follow the standard below:
81+
82+
![image-01](https://tp-statics.tokenpocket.pro/images/chain-element/01.png)
83+
84+
85+
86+
#### icon & color
87+
88+
icChainSelect, icChainUnselect, colorChainBg 配置用来控制链在TokenPokect钱包选中、没有选中该链时候显示使用的图标和该链账户背景颜色。如下图所示:
89+
90+
![image-02](https://tp-statics.tokenpocket.pro/images/chain-element/02.png)
91+
92+
icon大小规格如下图所示:
93+
94+
![image-03](https://tp-statics.tokenpocket.pro/images/chain-element/03.png)
95+
96+
colorChainBg是该链账号背景颜色,颜色不能太亮以免影响内容文字的显示效果,如下图所示:
97+
98+
![image-04](https://tp-statics.tokenpocket.pro/images/chain-element/04.png)
99+
100+
101+
102+
#### namespace & txUrl
103+
104+
​ TokenPocket钱包现已支持提交配置即可完成添加支持**EVM(以太系),Polkadot(波卡系),EOSIO**技术系的链。项目方链提供如果是**EVM,Polkadot,EOSIO**技术系的链, 同时希望提交链在TokenPocket钱包显示交易记录,则提交需要namespace和txUrl配置项。namespace是说明链所属技术体系,txUrl是交易记录提供服务的地址,关于txUrl交易记录服务更多详细信息请参考[TokenPocket官方开发者文档](https://help.tokenpocket.pro/tp-developer/network/chains/addchain-multifunction)。支持交易记录链钱包中显示效果如下图所示:
105+
106+
![image-05](https://tp-statics.tokenpocket.pro/images/chain-element/05.png)
107+
108+
109+
110+
##### browserInfo
111+
112+
browserInfo主要用于在TokenPocket钱包显示和跳转到官方浏览器。浏览器在TokenPocket中其中一个用途,如下入图所示:
113+
114+
![image-06](https://tp-statics.tokenpocket.pro/images/chain-element/06.png)
115+
116+
117+
118+
## more
119+
46120
![standard](https://tp-statics.tokenpocket.pro/images/custom-chains-standard-5.png)
47121

0 commit comments

Comments
 (0)