Adding full-featured blockchain

Background

TokenPocket wallet now supports adding EVM, Polkadot, and EOSIO technology blockchain through configuration. This document is for project parties who need to integrate their blockchain to TokenPocket. First of all, the blockchain must be EVM, Polkadot, or EOSIO, and projects need to provide information such as nodes, browsers, token information and transaction record services as described in this document, and finally, after reviewed by the TokenPocket official personnel, the blockchain can be quickly integrated to the TokenPocket wallet.

The full-featured blockchain of TokenPocket wallet provides users with rich functions and experiences. Some common functions include displaying a list of supported blockchain, native currency and non-native currency, token price, popular token picklist, transaction records and details. As shown in the figure 1, display the list of blockchain that TokenPocket wallet supports. Users also can quickly select the blockchain in the list to create or import the wallet for asset management.

As shown in the figure, Users can view transaction records and details, and quickly add tokens through the popular Token list.

The above shows some common functions of the full-featured blockchain of TokenPocket wallet. For more functions, please download TokenPocket for experience. The full-featured blockchain provides users with a very good experience. The next chapter will explain how the blockchain project party submits the full-featured blockchain to the TokenPocket wallet.

This section tells that in order to add the blockchain to the TokenPocket wallet, the blockchain project party has to provide data elements and ports. The full-featured blockchain has functions such as displaying the list of supported blockchain, native and non-native tokens, token prices, popular token picklist, transaction records and details. In order to have these functions on the TokenPocket wallet, the project party needs to provide services such as API and RPC for the corresponding functions. At present, TokenPocket wallet has supported the project party to provide corresponding services as follows:

The following describes the port services that need to be submitted respectively.

Get transaction history list and details

At present, TokenPocket wallet already supports the display of blockchain transaction history and details, as shown in the below:

​As shown in the figure above, for the transaction records and details shown on the wallet, the project party needs to provide the port for obtaining the transaction list and details. The port standards are described below.

Get transaction record documentation

As can be seen from the above, in order for users to review the blockchain transaction records and have a better experience, the project party needs to submit the query transaction record service. The service is described as follows:

Get transaction records list (EVM):

  • ​ Functions: get transaction record list

  • ​ Method:get

  • ​ url: /v1/transaction_action/universal_list

List of request parameters:

response data list:

Examples:

request:
https://testtxserver.xxx.com/v1/transaction_action/universal_list?new_way=tp&search=&address=0x0Dd3758c88316723eC434C54BF3e56e733785DFE&blockchain_id=26&count=20&page=0&sort=&contract_address=&type=0

response:
"data": [{
            "decimal": 18,
            "fee": "0.000254",
            "symbol": "ETH",
            "timestamp": 1644481313,
            "block_number": 3393917,
            "gas": "21000",
            "gas_price": "1000000",
            "used_gas": "21000",
            "value": "100000000000000",
            "hash": "0x1305d359d3796a5b9c1f0b3e8e204933a16fdbc9677667cbb6ea8db3f9a83611",
            "nonce": "0x4",
            "block_hash": "0x576634593fabbd92af5af5671f64886cb412b557e2aa465ccd12b340360568a4",
            "log_index": -1,
            "from": "0x0dd3758c88316723ec434c54bf3e56e733785dfe",
            "to": "0x0657659db21230061aae817ae26e5d15de66cf2e",
            "addr_token": "",
            "type": 0,
            "gas_price_bid": "",
            "gas_price_paid": "",
            "result_type": 0,
            "tx_type": 0,
            "input": "0x",
            "input_status": 0,
            "status": 1
}]

Get transaction details(EVM):

  • ​ Functions: Transaction details list query

  • ​ Method: get

  • ​ url: /v1/transaction_action/universal

List of request parameters:

response data list:

​Examples:

request:
https://xxxchaintxserver.xxx.com/v1/transaction_action/universal?blockchain_id=26&block_hash=0xf07696455e6bb138cff50390da1e47eb80745efdbcc16a609e4cec955f6a07af&hash=0x539839a5a2dc3bf4edb3dca041fce0aec0e557811cdf7518007d6712d873726a&log_index=-1&internal_index=

response:
{
    "data": {
        "decimal": 0,
        "fee": "0.000763",
        "symbol": "",
        "timestamp": 1639603935,
        "block_number": 1228952,
        "token_value": "0",
        "gas": "113334",
        "gas_price": "1000000",
        "used_gas": "113334",
        "value": "0",
        "hash": "0x539839a5a2dc3bf4edb3dca041fce0aec0e557811cdf7518007d6712d873726a",
        "nonce": "0x5",
        "block_hash": "0xf07696455e6bb138cff50390da1e47eb80745efdbcc16a609e4cec955f6a07af",
        "log_index": -1,
        "from": "0x389264158278811653",
        "to": "0x389254976595034117",
        "addr_token": "389253055922569221",
        "type": 1,
        "gas_price_bid": "",
        "gas_price_paid": "",
        "result_type": 0,
        "tx_type": 0,
        "input": "0x1ebcfe800000000000000000000000000000000000000000000000000000000000000100",
        "input_status": 0,
        "status": 1
    },
    "message": "success",
    "result": 0
}

Get transaction records list (Polkadot):

  • ​ Functions: Get transaction records list

  • ​ Method: get

  • ​ url: /v1/transaction_action/universal_list

​ List of request parameters:

response data list:

​ Examples:

request:
https://testtxserver.xxx.com/v1/transaction_action/universal_list?address=3iM6wt2uixaTdMj7ZQB6LN9qanvCCxWdd56oVwRg7fmj1uFw&search=&blockchain_id=21&count=40&page=0&sort&contract_address&type=0

response:
{
    "data": [
        {
            "decimal": 10,
            "fee": "155000015",
            "tip": "0",
            "symbol": "DOT",
            "comment": "0",
            "timestamp": 1633449756,
            "block_number": 7129105,
            "value": "739595473900",
            "hash": "0xdb4cc8adf2b48a50699abc27ca3461b1c497292c1a7fb34cc73fcdbb2c808cc6",
            "nonce": "0",
            "callIndex": 0,
            "from": "1119Ch5Ezu9fKdcZ9ThBFnTeEkUrhfhT59jHjGjKnvVvmsy",
            "to": "16FLM85x3Q8qSthJ9riL5Xcop8GfRY8SxuaDqvtMeeyrZNNs",
            "status": 1
        },
        {
            "decimal": 10,
            "fee": "156000016",
            "tip": "0",
            "symbol": "DOT",
            "comment": "0",
            "timestamp": 1621620846,
            "block_number": 5163171,
            "value": "28645499945",
            "hash": "0xe1e9bb207610dba7a98bbec411b549d951ddb8d6c27941ee9b1d32b26367831f",
            "nonce": "4",
            "callIndex": 0,
            "from": "14TMRRRqJUJszegEd7C3svLWxLUyMQPzXJ1wA6UYRcdKFRQZ",
            "to": "1119Ch5Ezu9fKdcZ9ThBFnTeEkUrhfhT59jHjGjKnvVvmsy",
            "status": 1
        }
    ],
    "message": "success",
    "result": 0
}

Get transaction details(Polkadot):

  • ​ Functions: Transaction details list query

  • ​ Method: get

  • ​ url: /v1/transaction_action/universal

List of request parameters:

​ response data list:

Examples:

request:
https://xxxtxserver.xxx.com/v1/transaction_action/universal?from=14TMRRRqJUJszegEd7C3svLWxLUyMQPzXJ1wA6UYRcdKFRQZ&blockchain_id=13&block_number=5163171&nonce=4&call_index=0

respose:
{
    "data": {
        "decimal": 10,
        "fee": "156000016",
        "tip": "0",
        "symbol": "DOT",
        "comment": "0",
        "timestamp": 1621620846,
        "block_number": 5163171,
        "value": "28645499945",
        "hash": "0xe1e9bb207610dba7a98bbec411b549d951ddb8d6c27941ee9b1d32b26367831f",
        "nonce": "4",
        "callIndex": 0,
        "from": "14TMRRRqJUJszegEd7C3svLWxLUyMQPzXJ1wA6UYRcdKFRQZ",
        "to": "1119Ch5Ezu9fKdcZ9ThBFnTeEkUrhfhT59jHjGjKnvVvmsy",
        "status": 1
    },
    "message": "success",
    "result": 0
}

Get transaction records list (EOSIO):

  • ​ Functions: Get transaction records list

  • ​ Method: get

  • ​ url: /v1/transaction_action/universal_list

​ List of request parameters:

​ response data list:

​ Examples:

request:
https://xxxtxserver.xxx.com/v1/transaction_action/universal_list?blockchain_id=29&search=&account=eosio.token&count=20&page=0

response:
{
    "data": [
        {
            "hid": "817d47c381f284b269ca372ae6b911804bb7ed50efcf2bc2784c88d2b13e7f8a",
            "producerBlockId": "0a03ac4ea8e00e0898d7410b5c422898d85914bb1c6b94ebbee099b55d02b8ae",
            "receiver": "eosio.token",
            "recvSequence": 0,
            "timestamp": 1645463197,
            "account": "realmnftgame",
            "name": "transfer",
            "from": "whkm2.c.wam",
            "to": "eosio.token",
            "blockNum": 168012878,
            "quantity": "974.9580 RLM",
            "count": "974.9580",
            "symbol": "RLM",
            "memo": "",
            "status": 1
        },
        {
            "hid": "20608e08fbb38618b2021bea05dff84cf27c1cd066c2e1eb006a5ecc0d06c7ee",
            "producerBlockId": "099918c3de0e307403a154f33f5123a29bfd1692df31cd4d44513ae2bcd01a6d",
            "receiver": "eosio.token",
            "recvSequence": 0,
            "timestamp": 1641969324,
            "account": "farmerstoken",
            "name": "transfer",
            "from": "r52zc.wam",
            "to": "eosio.token",
            "blockNum": 161028291,
            "quantity": "10.0000 FWW",
            "count": "10.0000",
            "symbol": "FWW",
            "memo": "e.3.e.c.wam",
            "status": 1
        }
    ],
    "message": "success",
    "result": 0
}

Get transaction details(EOSIO):

  • ​ Functions: Transaction details list query

  • ​ Method: get

  • ​ url: /v1/transaction_action/universal

List of request parameters:

response data list:

​ Examples:

request:
https://xxxtxserver.xxx.com/v1/transaction_action/universal?blockchain_id=29&producer_block_Id=0a03ac4ea8e00e0898d7410b5c422898d85914bb1c6b94ebbee099b55d02b8ae&receiver=eosio.token&recv_sequence=0

response:
{
    "data": {
        "hid": "817d47c381f284b269ca372ae6b911804bb7ed50efcf2bc2784c88d2b13e7f8a",
        "producerBlockId": "0a03ac4ea8e00e0898d7410b5c422898d85914bb1c6b94ebbee099b55d02b8ae",
        "receiver": "eosio.token",
        "recvSequence": 0,
        "timestamp": 1645463197,
        "account": "realmnftgame",
        "name": "transfer",
        "from": "whkm2.c.wam",
        "to": "eosio.token",
        "blockNum": 168012878,
        "quantity": "974.9580 RLM",
        "count": "974.9580",
        "symbol": "RLM",
        "memo": "",
        "status": 1
    },
    "message": "success",
    "result": 0
}

Provide information format:

"txUrl":" https://xxxchaintxserver.xxx.xxx"

Node infomation

The node is the request address for the wallet to initiate transactions and query price and contract information. Therefore, the project party needs to provide more than one available node. The node information is displayed in the wallet as below:

Provide information format:

rpc: [
	"https://rpc.api.xxxx.network", 
	"https://rpc.api2.xxxxx.network"
]

Blockchain browser

The browser is a tool for querying transaction information and has a certain degree of data analysis. Therefore, it is very important for the project party to provide browsers to query transaction information. One of the uses of the browser in the wallet is shown below

Provide information format:

The browser needs to support the following format query:
https://blockscout.moonbeam.network/tx/{hash}/internal-transactions
https://blockscout.moonbeam.network/address/{account}/transactions

"browserInfo": [{
    "name": "Xscan", 
    "icon": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png", 
    "addr": "https://xxx1scan.io/"
},{
    "name": "xDAIscan", 
    "icon": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png", 
    "addr": "https://xxx2can.io/"
}]

Submit blockchain information template

Based on the descriptions in the above chapters, we can know that the transaction record service address, node information and browser information are required. The standard template of information to be submitted is as follows, please submit it following this template.

{
    "name": "xDAI Chain",
    "chainId": 100,
    "namespace": "ethereum",  
    "shortName": "xdai",
    "chain": "XDAI",
    "network": "mainnet",
    "networkId": 100,
    "nativeCurrency": {
        "name": "xDAI",
        "symbol": "xDAI",
        "decimals": 18
    },
    "rpc": [
        "https://rpc.xdaichain.com",
        "https://xdai.poanetwork.dev",
        "wss://rpc.xdaichain.com/wss",
        "wss://xdai.poanetwork.dev/wss",
        "http://xdai.poanetwork.dev",
        "https://dai.poa.network",
        "ws://xdai.poanetwork.dev:8546"
    ],
    "faucets": [],
    "infoURL": "https://forum.poa.network/c/xdai-chain",
    "appResource": {
        "icChainSelect": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png",
        "icChainUnselect": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/0.png",
        "colorChainBg": "0x58B2AF",
        "txUrl":" https://xxxchaintxserver.xxx.xxx", 
        "browserInfo": [{
            "name": "Xscan", 
            "icon": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png", 
            "addr": "https://xxx1scan.io/"
        },{
            "name": "xDAIscan", 
            "icon": "https://tp-upload.cdn.bcebos.com/v1/blockChain/xDAI/1.png", 
            "addr": "https://xxx2can.io/"
        }],
        "projectContactInfo": {
    	    "officialWebsite": "https://xxx.network.com",
    	    "phone": "02x-223xxx12",
    	    "email": "xxx.xxx@xxx.com",
        }
    }
}

The above information needs to be submitted to networklist-org

Last updated