Blockstream / gdk

Blockstream Green Development Kit
Other
163 stars 64 forks source link

Validation error when creating subaccount in Java #131

Closed nicofuccella closed 3 years ago

nicofuccella commented 3 years ago

I'm trying to use the create_subaccount method from Java wrapper. This is the JSON I'm trying to use:

{ name: "test", type: “2of2” }

Unfortunately I get [Error: [json.exception.type_error.302] type must be number, but is object] during the execution. I tried to use a number like 0 or 1 for type and I get this error: [Error: [json.exception.type_error.302] type must be string, but is number]. What is a valid value for type?

LeoComandini commented 3 years ago

As discussed privately, if you are using electrum based network, admissible types are:

And changing the type to one of those fixes the issue.

Still the error is not nice and must be improved. That should be addressed in an upcoming change.