stellar / js-stellar-sdk

Main Stellar client library for the JavaScript language.
https://stellar.github.io/js-stellar-sdk/
Apache License 2.0
642 stars 312 forks source link

createClaimableBalance: create claimant predicate from JSON object #588

Open quietbits opened 4 years ago

quietbits commented 4 years ago

Currently, all claimant predicate creation helpers are functions in createClaimableBalance, which makes it harder to dynamically compose them. It would be great if there was an option to pass a JSON object instead.

abuiles commented 4 years ago

Here's a reference implementation in go https://github.com/stellar/go/blob/master/xdr/json.go#L84 -- this is actually how predicates are shown in Horizon