Skip to main content

Create a new contract

Build an unsigned (Cardano) transaction body which opens a new Marlowe contract. This unsigned transaction must be signed by a wallet (such as a CIP-30 or CIP-45 wallet) before being submitted. To submit the signed transaction, use the PUT /contracts/{contractId} endpoint.

Header Parameters
X-Stake-Address string

A cardano stake address, in Bech32 format

Where to send staking rewards for the Marlowe script outputs of this contract.

X-Change-Address string REQUIRED

A cardano address, in Bech32 format

X-Address string

A comma-separated list of values

X-Collateral-UTxO string

A comma-separated list of values

Request Body
contract REQUIRED
metadata object REQUIRED
minUTxODeposit int64

Possible values: value ≤ 18446744073709552000

roles
tags object REQUIRED
threadTokenName string
version string REQUIRED

Possible values: [v1]

A version of the Marlowe language.

Responses
201
Schema OPTIONAL
links object
contract string OPTIONAL
resource object

The "type" property of "tx" must be "Tx BabbageEra" or "Tx ConwayEra"

contractId string

Possible values: Value must match regular expression ^[a-fA-F0-9]{64}#[0-9]+$

A reference to a transaction output with a transaction ID and index.

safetyErrors undefined[] OPTIONAL
account-id OPTIONAL

A participant in a contract

address OPTIONAL

A Plutus address.

addressCredential

A Plutus credential.

addressStakingCredential OPTIONAL

A Plutus staking credential.

bytes integer OPTIONAL
choice-id object OPTIONAL

Refers to a party by role name.

choice_name string
choice_owner

A participant in a contract

cost object OPTIONAL
exBudgetCPU number
exBudgetMemory number
currency-symbol string OPTIONAL
detail string
error string
fatal boolean
hash string OPTIONAL
message string OPTIONAL
role-name string OPTIONAL
token object OPTIONAL

A token with a currency symbol (minting policy ID) and token name.

currency_symbol string
token_name string
token-name string OPTIONAL
transaction OPTIONAL

Information about a Marlowe transaction.

contract

Contract terms specified in Marlowe

input object

Marlowe transaction input.

tx_inputs undefined[]
tx_interval object

Time interval.

from integer
to integer
output

Marlowe transaction output.

state object

The on-chain state of a Marlowe contract.

accounts array[]
boundValues array[]
choices array[]
minTime integer
value-id string OPTIONAL
warning OPTIONAL

A transaction semantics warning.

tx object
cborHex string
description string
type string

What type of data is encoded in the CBOR Hex. Valid values include "Tx era", "TxBody era", and "ShelleyTxWitness era" where era is one of "BabbageEra", "ConwayEra".

400

Invalid X-Collateral-UTxO or X-Address or X-Change-Address or body or X-Stake-Address