|
| 1 | + |
| 2 | +# [addRemainder](https://github.com/iotaledger/iota-java/blob/dev/jota/src/main/java/jota/IotaAPI.java#L1299) |
| 3 | + List<String> addRemainder(String seed, int security, List<[Input](https://github.com/iotaledger/iota-java/blob/dev/jota/src/main/java/jota/model/Input.java)> inputs, [Bundle](https://github.com/iotaledger/iota-java/blob/dev/jota/src/main/java/jota/model/Bundle.java) bundle, String tag, long totalValue, String remainderAddress, List<String> signatureFragments) |
| 4 | + |
| 5 | + |
| 6 | +> **Important note:** This API is currently in Beta and is subject to change. Use of these APIs in production applications is not supported. |
| 7 | +
|
| 8 | +## Input |
| 9 | +| Parameter | Type | Required or Optional | Description | |
| 10 | +|:---------------|:--------|:--------| :--------| |
| 11 | +| seed | String | Required | Tryte-encoded seed. | |
| 12 | +| security | int | Required | The security level of private key / seed. | |
| 13 | +| inputs | List<[Input](https://github.com/iotaledger/iota-java/blob/dev/jota/src/main/java/jota/model/Input.java)> | Required | List of inputs used for funding the transfer. | |
| 14 | +| bundle | [Bundle](https://github.com/iotaledger/iota-java/blob/dev/jota/src/main/java/jota/model/Bundle.java) | Required | To be populated. | |
| 15 | +| tag | String | Required | The tag. | |
| 16 | +| totalValue | long | Required | The total value. | |
| 17 | +| remainderAddress | String | Required | If defined, this address will be used for sending the remainder value (of the inputs) to. | |
| 18 | +| signatureFragments | List<String> | Required | The signature fragments. | |
| 19 | + |
| 20 | +## Output |
| 21 | +| Return type | Description | |
| 22 | +|--|--| |
| 23 | + |
| 24 | +## Exceptions |
| 25 | +| Exceptions | Description | |
| 26 | +|:---------------|:--------| |
| 27 | +| [ArgumentException](https://github.com/iotaledger/iota-java/blob/dev/jota/src/main/java/jota/error/ArgumentException.java) | is thrown when an invalid argument is provided. | |
| 28 | +| IllegalStateException | is thrown when a transfer fails because their is not enough balance to perform the transfer. | |
| 29 | + |
| 30 | + |
| 31 | + ## Example |
| 32 | + |
| 33 | + ```Java |
| 34 | + IotaAPI iotaAPI = new IotaAPI.Builder().build(); |
| 35 | + |
| 36 | +try { |
| 37 | + List response = iotaAPI.addRemainder("AYJZVRRTSOYEYTZFIYUHRRIZYLRPFANPSUVJLWWZEAPHGTYAWZUSGDQVMCGBNBRUADYKFAH9SQHZTWAVX", "971", ["inputs", "inputs"], "bundle", "9VTDKZZXPCVOXYRQXTBGHUIAOBX9BLCKKWYIUGMRRIHZWGOZHRFCFEPUVXJQAZPIKPILVHOLBAAKMNVFX", "totalvalue", "OXCBNAGRJGGNBQRVNOXWXBUSJVJFNLLAV9NGBIGVBKKIAFTNPLLWHOEIYHWTJRXNYAVWADOKCA9FCYVVDTGSJXZ9LNITEYOJKVYDICMYU9CXTMJNAZNREKV9TMTPRUSOIZV9NFVOYBRVLYYPUFXZASTMXRWXVTAFMW", ["TLRSOFSKXIDJCUESREXRVL9ZFUROUDFCTIUYXCQCUKLNRFQFHSFDXPEGNGPYFGYRNWHQAEHTGRMHVZKNI", "PLQUYNPORYJDZLOTEGWVOEXNEKRVCXBBLHNYUDLNUGPIXGUSKCKINXIWXOY9BS9QJOTOMRBIKPLQBPARK"]); |
| 38 | +} catch (ArgumentException e) { |
| 39 | + // Handle error |
| 40 | + e.printStackTrace(); |
| 41 | +} |
| 42 | + ``` |
0 commit comments