|
18 | 18 |
|
19 | 19 | /** |
20 | 20 | * @author Ub - H. MARTEAU |
21 | | - * @version 2.0 |
| 21 | + * @version 4.4 |
22 | 22 | */ |
23 | 23 | public class IssueCommand extends QueryBuilderIssue { |
24 | 24 |
|
@@ -178,8 +178,11 @@ public String issue(String address, AssetParams assets, float quantity, float un |
178 | 178 | * @return |
179 | 179 | * @throws MultichainException |
180 | 180 | */ |
181 | | - public String issue(String address, String assetName, float quantity, float unit, float amount) |
182 | | - throws MultichainException { |
| 181 | + public String issue(String address, |
| 182 | + String assetName, |
| 183 | + float quantity, |
| 184 | + float unit, |
| 185 | + float amount) throws MultichainException { |
183 | 186 | return issue(address, assetName, quantity, unit, amount, null); |
184 | 187 | } |
185 | 188 |
|
@@ -220,8 +223,11 @@ public String issue(String address, String assetName, float quantity, float unit |
220 | 223 | * @return |
221 | 224 | * @throws MultichainException |
222 | 225 | */ |
223 | | - public String issue(String address, AssetParams assets, float quantity, float unit, float amount) |
224 | | - throws MultichainException { |
| 226 | + public String issue(String address, |
| 227 | + AssetParams assets, |
| 228 | + float quantity, |
| 229 | + float unit, |
| 230 | + float amount) throws MultichainException { |
225 | 231 | return issue(address, assets, quantity, unit, amount, null); |
226 | 232 | } |
227 | 233 |
|
@@ -263,8 +269,12 @@ public String issue(String address, AssetParams assets, float quantity, float un |
263 | 269 | * @return |
264 | 270 | * @throws MultichainException |
265 | 271 | */ |
266 | | - public String issue(String address, String assetName, float quantity, float unit, float amount, |
267 | | - List<CustomParamString> customFields) throws MultichainException { |
| 272 | + public String issue(String address, |
| 273 | + String assetName, |
| 274 | + float quantity, |
| 275 | + float unit, |
| 276 | + float amount, |
| 277 | + List<CustomParamString> customFields) throws MultichainException { |
268 | 278 | String issue = ""; |
269 | 279 |
|
270 | 280 | Object objectIssue = executeIssue(address, assetName, quantity, unit, amount, customFields); |
@@ -314,8 +324,12 @@ public String issue(String address, String assetName, float quantity, float unit |
314 | 324 | * @return |
315 | 325 | * @throws MultichainException |
316 | 326 | */ |
317 | | - public String issue(String address, AssetParams assets, float quantity, float unit, float amount, |
318 | | - List<CustomParamString> customFields) throws MultichainException { |
| 327 | + public String issue(String address, |
| 328 | + AssetParams assets, |
| 329 | + float quantity, |
| 330 | + float unit, |
| 331 | + float amount, |
| 332 | + List<CustomParamString> customFields) throws MultichainException { |
319 | 333 | String issue = ""; |
320 | 334 |
|
321 | 335 | Object objectIssue = executeIssue(address, assets, quantity, unit, amount, customFields); |
@@ -362,11 +376,63 @@ public String issue(String address, AssetParams assets, float quantity, float un |
362 | 376 | * @return |
363 | 377 | * @throws MultichainException |
364 | 378 | */ |
365 | | - public String issueFrom(String fromAddress, String toAddress, String assetName, int quantity, float unit) |
366 | | - throws MultichainException { |
| 379 | + public String issueFrom(String fromAddress, |
| 380 | + String toAddress, |
| 381 | + String assetName, |
| 382 | + int quantity, |
| 383 | + float unit) throws MultichainException { |
| 384 | + return issueFrom(fromAddress, toAddress, assetName, quantity, unit, 0, null); |
| 385 | + } |
| 386 | + |
| 387 | + /** |
| 388 | + * This works like issue, but with control over the from-address used to |
| 389 | + * issue the asset. If there are multiple addresses with asset issuing |
| 390 | + * permissions on one node, this allows control over which address is used. |
| 391 | + * |
| 392 | + * issuefrom "from-address" "to-address" asset-name|asset-params quantity ( |
| 393 | + * smallest-unit native-amount custom-fields ) |
| 394 | + * |
| 395 | + * Issue asset using specific address |
| 396 | + * |
| 397 | + * Arguments: 1. "from-address" (string, required) Address used for issuing. |
| 398 | + * 2. "to-address" (string, required) The address to send newly created |
| 399 | + * asset to. 3. "asset-name" (string, required) Asset name, if not "" should |
| 400 | + * be unique. or 3. "asset-params" (object, required) A json object of with |
| 401 | + * asset params { "name" : "asset-name" (string, optional) Asset name "open" |
| 402 | + * : true|false (boolean, optional, default false) True if follow-on issues |
| 403 | + * are allowed ,... } 4. "quantity" (numeric, required) The asset total |
| 404 | + * amount in display units. eg. 1234.56 5. "smallest-unit" (numeric, |
| 405 | + * optional, default=1) Number of raw units in one displayed unit, eg 0.01 |
| 406 | + * for cents 6. "native-amount" (numeric, optional) native currency amount |
| 407 | + * to send. eg 0.1, Default: minimum-per-output. 7 "custom-fields" (object, |
| 408 | + * optional) a json object with custom fields { "param-name": "param-value" |
| 409 | + * (strings, required) The key is the parameter name, the value is parameter |
| 410 | + * value ,... } |
| 411 | + * |
| 412 | + * Result: "transactionid" (string) The transaction id. |
| 413 | + * |
| 414 | + * @param toAddress |
| 415 | + * @param assetName |
| 416 | + * @param open |
| 417 | + * @param quantity |
| 418 | + * @param unit |
| 419 | + * the smallest transactable unit is given by units, e.g. 0.01. |
| 420 | + * @param amount |
| 421 | + * @param customFields |
| 422 | + * @return |
| 423 | + * @throws MultichainException |
| 424 | + */ |
| 425 | + public String issueFrom(String fromAddress, |
| 426 | + String toAddress, |
| 427 | + String assetName, |
| 428 | + int quantity, |
| 429 | + float unit, |
| 430 | + float amount, |
| 431 | + List<CustomParamString> customFields) throws MultichainException { |
367 | 432 | String issueFrom = ""; |
368 | 433 |
|
369 | | - Object objectIssueFrom = executeIssueFrom(fromAddress, toAddress, assetName, quantity, unit); |
| 434 | + Object objectIssueFrom = executeIssueFrom(fromAddress, toAddress, assetName, quantity, unit, amount, |
| 435 | + customFields); |
370 | 436 | if (verifyInstance(objectIssueFrom, String.class)) { |
371 | 437 | issueFrom = (String) objectIssueFrom; |
372 | 438 | } |
@@ -410,11 +476,62 @@ public String issueFrom(String fromAddress, String toAddress, String assetName, |
410 | 476 | * @return |
411 | 477 | * @throws MultichainException |
412 | 478 | */ |
413 | | - public String issueFrom(String fromAddress, String toAddress, List<AssetParams> assets, int quantity, float unit) |
414 | | - throws MultichainException { |
| 479 | + public String issueFrom(String fromAddress, |
| 480 | + String toAddress, |
| 481 | + AssetParams assets, |
| 482 | + float quantity, |
| 483 | + float unit) throws MultichainException { |
| 484 | + return issueFrom(fromAddress, toAddress, assets, quantity, unit, 0, null); |
| 485 | + } |
| 486 | + |
| 487 | + /** |
| 488 | + * This works like issue, but with control over the from-address used to |
| 489 | + * issue the asset. If there are multiple addresses with asset issuing |
| 490 | + * permissions on one node, this allows control over which address is used. |
| 491 | + * |
| 492 | + * issuefrom "from-address" "to-address" asset-name|asset-params quantity ( |
| 493 | + * smallest-unit native-amount custom-fields ) |
| 494 | + * |
| 495 | + * Issue asset using specific address |
| 496 | + * |
| 497 | + * Arguments: 1. "from-address" (string, required) Address used for issuing. |
| 498 | + * 2. "to-address" (string, required) The address to send newly created |
| 499 | + * asset to. 3. "asset-name" (string, required) Asset name, if not "" should |
| 500 | + * be unique. or 3. "asset-params" (object, required) A json object of with |
| 501 | + * asset params { "name" : "asset-name" (string, optional) Asset name "open" |
| 502 | + * : true|false (boolean, optional, default false) True if follow-on issues |
| 503 | + * are allowed ,... } 4. "quantity" (numeric, required) The asset total |
| 504 | + * amount in display units. eg. 1234.56 5. "smallest-unit" (numeric, |
| 505 | + * optional, default=1) Number of raw units in one displayed unit, eg 0.01 |
| 506 | + * for cents 6. "native-amount" (numeric, optional) native currency amount |
| 507 | + * to send. eg 0.1, Default: minimum-per-output. 7 "custom-fields" (object, |
| 508 | + * optional) a json object with custom fields { "param-name": "param-value" |
| 509 | + * (strings, required) The key is the parameter name, the value is parameter |
| 510 | + * value ,... } |
| 511 | + * |
| 512 | + * Result: "transactionid" (string) The transaction id. |
| 513 | + * |
| 514 | + * @param toAddress |
| 515 | + * @param assetName |
| 516 | + * @param open |
| 517 | + * @param quantity |
| 518 | + * @param unit |
| 519 | + * the smallest transactable unit is given by units, e.g. 0.01. |
| 520 | + * @param amount |
| 521 | + * @param customFields |
| 522 | + * @return |
| 523 | + * @throws MultichainException |
| 524 | + */ |
| 525 | + public String issueFrom(String fromAddress, |
| 526 | + String toAddress, |
| 527 | + AssetParams assets, |
| 528 | + float quantity, |
| 529 | + float unit, |
| 530 | + float amount, |
| 531 | + List<CustomParamString> customFields) throws MultichainException { |
415 | 532 | String issueFrom = ""; |
416 | 533 |
|
417 | | - Object objectIssueFrom = executeIssueFrom(fromAddress, toAddress, assets, quantity, unit); |
| 534 | + Object objectIssueFrom = executeIssueFrom(fromAddress, toAddress, assets, quantity, unit, amount, customFields); |
418 | 535 | if (verifyInstance(objectIssueFrom, String.class)) { |
419 | 536 | issueFrom = (String) objectIssueFrom; |
420 | 537 | } |
@@ -488,8 +605,10 @@ public String issueMore(String address, String assetName, int quantity) throws M |
488 | 605 | * @return |
489 | 606 | * @throws MultichainException |
490 | 607 | */ |
491 | | - public String issueMoreFrom(String fromAddress, String toAddress, String assetName, int quantity) |
492 | | - throws MultichainException { |
| 608 | + public String issueMoreFrom(String fromAddress, |
| 609 | + String toAddress, |
| 610 | + String assetName, |
| 611 | + int quantity) throws MultichainException { |
493 | 612 | String issueMoreFrom = ""; |
494 | 613 |
|
495 | 614 | Object objectIssueMoreFrom = executeIssueMoreFrom(fromAddress, toAddress, assetName, quantity); |
@@ -576,8 +695,10 @@ public List<BalanceAsset> listAssets(String asset) throws MultichainException { |
576 | 695 | * @return |
577 | 696 | * @throws MultichainException |
578 | 697 | */ |
579 | | - public String sendAssetFrom(String fromAddress, String toAddress, String assetName, float quantity) |
580 | | - throws MultichainException { |
| 698 | + public String sendAssetFrom(String fromAddress, |
| 699 | + String toAddress, |
| 700 | + String assetName, |
| 701 | + float quantity) throws MultichainException { |
581 | 702 | String sendAssetFrom = ""; |
582 | 703 |
|
583 | 704 | Object objectSendAssetFrom = executeSendAssetFrom(fromAddress, toAddress, assetName, quantity); |
|
0 commit comments