Help me check my transfer api
$data = array( 'assetId' => 'asset id here', 'feeAssetId' => 'asset id here', 'sender' => 'address', 'recipient' => 'addres', 'amount' => 1000000000, 'fee' => 100000, 'attachment' => '', 'timestamp' => time() * 1000 );
$curl = new Curl(); $curl->setHeader('Content-Type', 'application/json'); $curl->setHeader('api_key', 'WavesKey'); $curl->setHeader('X-Api-Key', 'WavesKey'); $curl->post('xxx.xx.xxx.xx:6869/assets/transfer', $data); Show Error 404 => Error: 400: HTTP/1.1 400 Bad Request
I use the lasted version of node.
Hi @nmjay, what lib did you use, could you compare your json format with our docs https://docs.wavesplatform.com/en/development-and-api/waves-node-rest-api/transactions.html. May be you've missed some field.
- Private API for transferring assets:
- Some documentation: https://docs.wavesplatform.com/en/development-and-api/waves-node-rest-api/asset-transactions/private-functions.html#post-assetstransfer
- Swagger https://nodes.wavesnodes.com/api-docs/index.html#!/assets/transfer - just replace
https://nodes.wavesnodes.comwithhttp://your_domainorhttps://your_domaindepending on your situation
- About
$data:
feeAssetId=> …-feeAssetIdis optional and works only iffeeAssetId` is sponsored asset;attachment- you can leave this field if doesn't send the payload;'timestamp' => time() * 1000- right, the Node requires timestamp in milliseconds.
$curl->post('xxx.xx.xxx.xx:6869/assets/transfer', $data):
- Doesn't sure, this will work. If not, try to specify the protocol:
$curl->post('http:// - Does this PHP library serializes
$datato JSON? If not, tryjson_encode($data)