-
Notifications
You must be signed in to change notification settings - Fork 24
Send and Receive PTN
Parameter format: send address, receive address, quantity, handling fee. For example:
wallet.transferPTN( from, to ,amount ,fee)
For example:
wallet.transferPTN("P1GGRyzx38osMCbuqBALq57E5W4kpejnEKE","P1KngL4CVV2aW65ybUZp9PvicrAeHGpcqXF","12","1")
then will return a txid like:
0xde71e26a5a1de8bf139446f7d167c457923fe8def021346793a0c60979d40a58
Confirm the address and port on the server side first,The default port is 8545. Confirm file of ptn-config.toml, HTTPModules = ["net", "web3", "ptn","wallet"] Open a service of wallet resetful.
Use the POST method to send the following bodydata to the server address and port,Notice the header field of http Content-Type:application/json
{"jsonrpc":"2.0","method":"wallet_transferPTN","params":["P1GGRyzx38osMCbuqBALq57E5W4kpejnEKE","P1KngL4CVV2aW65ybUZp9PvicrAeHGpcqXF",12,1],"id":1}
The result looks like this
{ "jsonrpc": "2.0", "id": 1, "result": "0xde71e26a5a1de8bf139446f7d167c457923fe8def021346793a0c60979d40a58" }
Result is not all 0, indicating that the sending is successful
Parameter format: from Sender address to Receiver address amount limit Get the upper limit of the test coin,The actual number sent is a random value not greater than this value password Sender address password duration Unlock address time
wallet.getPtnTestCoin("P19kW96FMGRwczYGxyizdAY6mWYLckADZdz","P1GBQMq3jSPgTfTDBf2J5mwWWBPHSUtCP8C", "10", "1",10)
{"jsonrpc":"2.0","method":"wallet_getPtnTestCoin","params":["P15GK12gMx7Ei979MqSjsi7GgZf5Y2dn66e","P1GtaPbhCnSnMHpwEYbHYBVv4wMTz3yMUTG","10","1",10],"id":1}
Parameter is the address to be queried:
wallet.getBalance(addresss)
wallet.getBalance("P1GtaPbhCnSnMHpwEYbHYBVv4wMTz3yMUTG")
{"jsonrpc":"2.0","method":"wallet_getBalance","params":["P1GtaPbhCnSnMHpwEYbHYBVv4wMTz3yMUTG"],"id":1}
PalletOne©2018-2019
Home
Getting started
- Install and build
- Create a private chain
- Launch the PalletOne Client
- Create a PalletOne Account
- Send and Receive PTN
- Create and send your token
- Backing up your account and data
- Restoring your account
- Deposit contract
- Mediator Node Installation and Joining
- Howto Become a Mediator
- Howto Run a Unit-producing Mediator
Developer Tools
- Getting PTNs from PalletOne's Testnet Faucet
- Wallet restful and console API Usage
- Third-Party-Wallet-Support
- Third-Party-Wallet-Contract-Invoke
- API Document
FAQ