The Alice and Bob parties have been created and exist on different Daml-Driver-for-Corda participant nodes and do not currently know about each other.
I want to use Daml script to allow Alice to send a contract to Bob once Bob has shared his party identifier (‘D:bob:O:Tribeca:L:New York:C:US’) with Alice.
The problem is that there appears to be no way to parse a text string into a Party.
Hi @simon,
For most usecases, I would recommend that you accept the parties you intend to reference as an argument instead of hardcoding them in your script. You can then specify those parties via --input-file as described in the documentation. That makes your script easily portable and not dependent on your particular ledger setup and the corresponding party ids.
That said, if you really do want to hardcode the party ids you can use partyFromText : Text -> Optional Party.
I actually wrote a full example that uses partyFromText by reading the parties (as Text) from input files here. I guess what @cocreature means is you could type the inputs as Party directly and thus avoid the call to partyFromText.
Using an input-file worked great when when I was using a single parameter, when I changed my script to accept three arguments the daml script stopped working:
This is because the input file only populates the first parameter, the solution is ensure that all parameters are structured into a single argument, like:
This way a json array containing the arguments can be used in the input-file.