Skip to main content
Version: 1.2.0

SignTool

Overview

The SignTool is used to sign single or multiple withdrawal transactions offline, expediting the process of broadcasting transactions to the blockchain.

Install SignTool

1. Download SignTool source files

By cloning the code from GitHub, you will get a java package PayTool.jar, Dockerfile, and an environment file signer.env.

GitHub Repository: https://github.com/PayProtocol-Network/SignTool.git

2. Build Docker image

Run the following command to build a Docker image named 'signer:1.0'.

$ docker build -t signer:1.0 .

3. Configure environment variables

The following environment variables need to be configured in the file signer.env:

  • The private key of the owner wallet of the contract
  • Your API key pair

The private key is used exclusively within the SignTool for signing transactions and will never be exposed outside of the SignTool.

SPRING_PROFILES_ACTIVE=test (for testnet) / prod (for mainnet)

MER_API_KEY=Your API Key
MER_API_SECRET=Your API Secret

EVM_PRIVATE_KEY=Private key of the owner wallet of the contract on EVM.
TVM_PRIVATE_KEY=Private key of the owner wallet of the contract on TVM.

# Batch transfer contract address
EVM_BATCH_TRANSFER= EVM(Ethereum) batch transfer contract address
TVM_BATCH_TRANSFER= TVM(Tron) batch transfer contract address

# Multisg contract address
EVM_MULTI_SIG_COLD= EVM(Ethereum) multisig cold contract address
TVM_MULTI_SIG_COLD= TVM(Tron) multisig cold contract address

# You will no need to modify them by default
TEST_TX_PARAM_URL=https://api-sandbox.payprotocol.network/api/mer/withdraw/transactionDetail
TEST_CURRENCY_URL=https://api-sandbox.payprotocol.network/api/mer/conf/list/currency
TEST_ESTIMATION_URL=https://api-sandbox.payprotocol.network/api/mer/transaction/estimate
TEST_WITHDRAWAL_URL=https://api-sandbox.payprotocol.network/api/mer/withdraw/submit
TEST_REBALANCE_URL=https://api-sandbox.payprotocol.network/api/mer/balance/submit

# You will no need to modify them by default
TX_PARAM_URL=https://api.payprotocol.network/api/mer/withdraw/transactionDetail
CURRENCY_URL=https://api.payprotocol.network/api/mer/conf/list/currency
ESTIMATION_URL=https://api.payprotocol.network/api/mer/transaction/estimate
WITHDRAWAL_URL=https://api.payprotocol.network/api/mer/withdraw/submit
REBALANCE_URL=https://api.payprotocol.network/api/mer/balance/submit

Please ensure that the owner wallet has TRX/ETH on Tron/Ethereum as it will need to sign transactions and pay a certain amount of network fees after the transaction is broadcasted.

4. Create SignTool Docker container

Run the following command in the directory where the signer.env file is located (and you can replace the external port 8080 with any other port number):

$ docker run --env-file ./signer.env -p 8080:9980 -d --name signer signer:1.0

Now a Docker containner of the SignTool is running, to check the status of the containner you can run:

$ docker ps

The output should include a record about the container you just created. For example:

CONTAINER ID  IMAGE       COMMAND                 CREATED       STATUS       PORTS                                       NAMES
dcd43bbe138a signer:1.0 "java -jar /home/jav…" 4 seconds ago Up 3 seconds 0.0.0.0:8080->9980/tcp, :::8080->9980/tcp signer

Signing withdraw transactions by SignTool

  1. Retrieve the list of pending withdrawal orders, refering to Query Withdraw Order List.
  2. Submit the list of pending withdrawal orders by calling the API (SignTool API Doc) provided by SignTool, then you can get signing result from the response.

Signing rebalance transactions by SignTool

  1. Get the balance of the current address for each currency, please refer to the Merchant API Get Balance.
  2. Determine if rebalancing is needed based on the currency balances. If rebalancing is needed, call the relevant interfaces of the SignTool (SignTool API Doc) to sign the rebalancing transactions.