-
# A Pipe Client for Marlowe Runtime
-
This [Marlowe Runtime](../marlowe-runtime) client reads JSON requests from standard input and writes JSON responses to standard output. The service may be used with any Marlowe contract.
-
marlowe-pipe << EOI 2> /dev/null
-
{"request" : "get", "contractId" : "f06e4b760f2d9578c8088ea5289ba6276e68ae3cbaf5ad27bcfc77dc413890db#1"}
-
{"creation":{"output":{"address":"706a9391d6aa51af28dd876ebb5565b69d1e83e5ac7861506bd29b56b0","assets":{"ada":3000000,"tokens":[]},"datum":{"marloweContract":{"timeout":1667314499000,"timeout_continuation":"close","when":[{"case":{"deposits":{"negate":{"negate":100000000}},"into_account":{"address":"addr_test1vpwu7nklk38f3tp4yr759lssakgwhtmyprhaexlvd3aj9xs7ud88k"},"of_token":{"currency_symbol":"","token_name":""},"party":{"address":"addr_test1vpwu7nklk38f3tp4yr759lssakgwhtmyprhaexlvd3aj9xs7ud88k"}},"then":{"from_account":{"address":"addr_test1vpwu7nklk38f3tp4yr759lssakgwhtmyprhaexlvd3aj9xs7ud88k"},"pay":100000000,"then":{"timeout":1667314799000,"timeout_continuation":"close","when":[{"case":{"deposits":2000000,"into_account":{"address":"addr_test1vrzx2ys48s6k03f5hq0mc4vuwuuxq2sj3p8gsnk47z27qdqzjjmup"},"of_token":{"currency_symbol":"","token_name":""},"party":{"address":"addr_test1vrzx2ys48s6k03f5hq0mc4vuwuuxq2sj3p8gsnk47z27qdqzjjmup"}},"then":{"from_account":{"address":"addr_test1vrzx2ys48s6k03f5hq0mc4vuwuuxq2sj3p8gsnk47z27qdqzjjmup"},"pay":2000000,"then":{"timeout":1667314799000,"timeout_continuation":"close","when":[{"case":{"deposits":100000000,"into_account":{"address":"addr_test1vrzx2ys48s6k03f5hq0mc4vuwuuxq2sj3p8gsnk47z27qdqzjjmup"},"of_token":{"currency_symbol":"","token_name":""},"party":{"address":"addr_test1vrzx2ys48s6k03f5hq0mc4vuwuuxq2sj3p8gsnk47z27qdqzjjmup"}},"then":{"from_account":{"address":"addr_test1vrzx2ys48s6k03f5hq0mc4vuwuuxq2sj3p8gsnk47z27qdqzjjmup"},"pay":100000000,"then":"close","to":{"party":{"address":"addr_test1vpwu7nklk38f3tp4yr759lssakgwhtmyprhaexlvd3aj9xs7ud88k"}},"token":{"currency_symbol":"","token_name":""}}}]},"to":{"party":{"address":"addr_test1vpwu7nklk38f3tp4yr759lssakgwhtmyprhaexlvd3aj9xs7ud88k"}},"token":{"currency_symbol":"","token_name":""}}}]},"to":{"party":{"address":"addr_test1vrzx2ys48s6k03f5hq0mc4vuwuuxq2sj3p8gsnk47z27qdqzjjmup"}},"token":{"currency_symbol":"","token_name":""}}}]},"marloweParams":{"rolesCurrency":""},"marloweState":{"accounts":[[[{"address":"addr_test1vpwu7nklk38f3tp4yr759lssakgwhtmyprhaexlvd3aj9xs7ud88k"},{"currency_symbol":"","token_name":""}],3000000]],"boundValues":[],"choices":[],"minTime":0}},"utxo":{"txId":"f06e4b760f2d9578c8088ea5289ba6276e68ae3cbaf5ad27bcfc77dc413890db","txIx":1}},"payoutValidatorHash":"49076eab20243dc9462511fb98a9cfb719f86e9692288139b7c91df3"},"response":"info","steps":[{"contractId":"f06e4b760f2d9578c8088ea5289ba6276e68ae3cbaf5ad27bcfc77dc413890db#1","payouts":[],"redeemer":[],"scriptOutput":null,"step":"apply","txId":"5a3ed57653b4635c76d2949558f3718e34324a8a1ffc740360ae7d85839de6d9"}]}
-
The JSON API for Marlowe Lambda contains the following requests and responses.
-
|-------------------------------------|---------------------------|
-
| [`list`](#list-contracts-ids) | [`contracts`](#contracts) |
-
| [`headers`](#list-contract-headers) | [`headers`](#headers) |
-
| [`get`](#get) | [`info`](#info) |
-
| [`create`](#create) | [`body`](#body) |
-
| [`apply`](#apply) | [`body`](#body) |
-
| [`withdraw`](#withdraw) | [`body`](#body) |
-
| [`sign`](#sign) | [`tx`](#tx) |
-
| [`submit`](#submit) | [`txId`](#txid) |
-
| [`wait`](#wait) | [`txInfo`](#txinfo) |
-
List all Marlowe contract IDs on the blockchain.
-
The response is [Contracts](#contracts).
-
#### List Contract Headers
-
List all Marlowe contract headers on the blockchain.
-
The response is [Headers](#headers).
-
Fetch the history of a Marlowe contract.
-
, "contractId" : "66e4af5ec99f09c28c6378e1d9d9508d95544e258fd8c8e7f3ff168a73e7b656#1"
-
The response is [Info](#info).
-
Build a transaction that creates a new Marlowe contract.
-
, "contract" : "/* the serialized Marlowe contract to be created */"
-
, "minUtxo" : "/* the number of lovelace to send to store in the contract when it is created */"
-
, "roles" : "/* an object that maps role names to the addresses to which the corresponding role tokens should be sent after it is minted */"
-
, "metadata" : "/* the transaction metadata in JSON format */"
-
, "addresses" : "/* the list of addresses, in addition to the change address, where UTxOs can be used as input to the transaction */"
-
, "change" : "/* the address to which change from the transaction will be sent */"
-
, "collateral" : "/* the list of UTxOs that may be used for collateral, or an empty list if any UTxO may be used for collateral */"
-
See `Contract` in https://github.com/input-output-hk/marlowe/blob/master/isabelle/haskell/MarloweCoreJson.lhs for definition of the JSON format of a Marlowe contract.
-
The response is [Body](#body).
-
Build a transaction that applies input to a Marlowe contract.
-
, "contractId" : "/* the contract ID to which inputs will be applied */"
-
, "inputs" : "/* the inputs that will be applied to the contract */"
-
, "validityLowerBound" : "/* the POSIX time in integer milliseconds before which the transaction is not valid */"
-
, "validityUpperBound" : "/* the POSIX time in integer milliseconds after which the transaction is not valid */"
-
, "metadata" : "/* the transaction metadata in JSON format */"
-
, "addresses" : "/* the list of addresses, in addition to the change address, where UTxOs can be used as input to the transaction */"
-
, "change" : "/* the address to which change from the transaction will be sent */"
-
, "collateral" : "/* the list of UTxOs that may be used for collateral, or an empty list if any UTxO may be used for collateral */"
-
See `Input` in https://github.com/input-output-hk/marlowe/blob/master/isabelle/haskell/MarloweCoreJson.lhs for definition of the JSON format of inputs to a Marlowe contract.
-
The response is [Body](#body).
-
Build a transaction that withdraws funds paid by a Marlowe contract.
-
, "contractId" : "/* the contract ID from which funds will be withdrawn */"
-
, "role" : "/* the name of the role making the withdrawal */"
-
, "addresses" : "/* the list of addresses, in addition to the change address, where UTxOs can be used as input to the transaction */"
-
, "change" : "/* the address to which change from the transaction will be sent */"
-
, "collateral" : "/* the list of UTxOs that may be used for collateral, or an empty list if any UTxO may be used for collateral */"
-
The response is [Body](#body).
-
Sign a transaction body with payment keys.
-
DO NOT USE THIS FUNCTION TO SIGN TRANSACTIONS BECAUSE IT TRANSMITS PRIVATE (SIGNING) KEYS.
-
, "body" : "/* the transaction body in Cardano text-envelope format */"
-
, "paymentKeys" : "/* list of payment keys, in Cardano text-envelope format, that should sign the transaction */"
-
, "paymentExtendedKeys" : "/* a list of payment extended keys, in Cardano text-envelope format, that should sign the transaction */"
-
The response is [Tx](#tx).
-
Submit a signed transaction to the Cardano node.
-
, "tx" : "/* the transaction in Cardano text-envelope format */"
-
The response is [TxId](#txid).
-
Wait for the first confirmation of a transaction on the Cardano node.
-
, "txId" : "/* the identifier of the transaction */"
-
, "pollingSeconds" : "/* the number of seconds to wait between pollings of the Cardano node for confirmation */"
-
The response is [TxInfo](#txinfo).
-
This response is a list of contract IDs.
-
"response" : "contracts"
-
"f06e4b760f2d9578c8088ea5289ba6276e68ae3cbaf5ad27bcfc77dc413890db#1"