Submits signed transaction template for inclusion into a block. @param client client object which makes server requests @param template transaction template @return submit responses @throws APIException This exception is raised if the api returns errors while submitting a transaction. @throws BadURL
(Client client, Template template)
| 534 | * @throws JSONException This exception is raised due to malformed json requests or responses. |
| 535 | */ |
| 536 | public static SubmitResponse submit(Client client, Template template) throws ChainException { |
| 537 | HashMap<String, Object> body = new HashMap<>(); |
| 538 | body.put("transactions", Arrays.asList(template)); |
| 539 | return client.singletonBatchRequest( |
| 540 | "submit-transaction", body, SubmitResponse.class, APIException.class); |
| 541 | } |
| 542 | |
| 543 | /** |
| 544 | * Submits signed transaction template for inclusion into a block. |