diff --git a/doc/README.md b/doc/README.md index 6a01435c7549872c237ecfb9abf55518b8a67147..c2da52042bc0cc8e3c10a0b09a06f89b3f7ed3d6 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1766,6 +1766,21 @@ hive.broadcast.convert(wif, owner, requestid, amount, function(err, result) { console.log(err, result); }); ``` +### Collateralized Convert + +```js +hive.broadcast.collateralizedConvert(wif, owner, requestid, amount, function(err, result) { + console.log(err, result); +}); +``` +|Parameter|Datatype|Description| +|---------|--------|-----------| +|wif|string|Active private key. "5xx...xxxx"| +|owner|string|Hive username. "guest123"| +|requestid|integer|Identifier for the conversion transactions from same account. 1| +|amount|string|Hive to be used as collateral for the conversion. "100.000 HIVE"| +|callback|function|function(err, data) {/*code*/}| + ### Curate Reward ```js hive.broadcast.curateReward(wif, curator, reward, commentAuthor, commentPermlink, function(err, result) { diff --git a/src/auth/serializer/src/operations.js b/src/auth/serializer/src/operations.js index 335276ade43669215479a3a89248cee6170a410e..8881c2c066aad5796f5dfe4d3b91704ea21cd2ea 100644 --- a/src/auth/serializer/src/operations.js +++ b/src/auth/serializer/src/operations.js @@ -301,6 +301,14 @@ let convert = new Serializer( } ); +let collateralized_convert = new Serializer( + "collateralized_convert",{ + owner: string, + requestid: uint32, + amount: asset +} +); + var authority = new Serializer( "authority", { weight_threshold: uint32, @@ -999,6 +1007,7 @@ operation.st_operations = [ update_proposal_votes, remove_proposal, update_proposal, + collateralized_convert, claim_reward_balance2, vote2, smt_setup, diff --git a/src/broadcast/operations.js b/src/broadcast/operations.js index 0735ed14e2c9b17ffa2c6cb471365d1d663ef702..5fa6d598ae7099f28d80bcbf92e7ec9db9bae10e 100644 --- a/src/broadcast/operations.js +++ b/src/broadcast/operations.js @@ -96,6 +96,15 @@ module.exports = [ "amount" ] }, + { + "roles": ["active","owner"], + "operation": "collateralized_convert", + "params": [ + "owner", + "requestid", + "amount" + ] + }, { "roles": ["active", "owner"], "operation": "account_create",