Skip to content

Commit 5b46e32

Browse files
committed
tp extension explain
1 parent ce502ca commit 5b46e32

File tree

1 file changed

+82
-10
lines changed

1 file changed

+82
-10
lines changed

README.md

Lines changed: 82 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,38 @@
1+
## Introduction
2+
3+
[TokenPocket](https://www.tokenpocket.pro) is the world’s leading multi-chain self-custodial wallet, which supports mainstream public chains including BTC, ETH, BSC, Polygon, Solana, HECO, Klaytn, Avalanche, Tron, OEC, HSC, Fantom, Polkadot, Kusama, EOS, etc. The private key is stored in the user’s own device and never uploaded to the server, so the user can fully control crypto assets. TokenPocket has provided reliable services for over 10 million users around the world. The number of monthly active users exceeds 5 million and the users are located in more than 200 countries around the world.
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

3-
Fork this repo and add your evm chain info into `chains.json`
11+
Fork this repo and add your evm/polkadot/eosio chain info into `chains.json`
12+
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*.
428

529
Example:
630

731
```javascript
832
{
933
"name": "xDAI Chain",
1034
"chainId": 100,
35+
"namespace": "ethereum",
1136
"shortName": "xdai",
1237
"chain": "XDAI",
1338
"network": "mainnet",
@@ -28,20 +53,67 @@ Example:
2853
],
2954
"faucets": [],
3055
"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"
56+
"appResource": {
57+
"icChainSelect": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png",
58+
"icChainUnselect": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/0.png",
59+
"colorChainBg": "0x58B2AF",
60+
"txUrl":" https://xxxchaintxserver.xxx.xxx",
61+
"browserInfo": [{
62+
"name": "Xscan",
63+
"icon": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png",
64+
"addr": "https://xxx1scan.io/"
65+
},{
66+
"name": "xDAIscan",
67+
"icon": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png",
68+
"addr": "https://xxx2can.io/"
69+
}]
3570
}
3671
}
3772
```
3873

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

4175

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

0 commit comments

Comments
 (0)