|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | + * you may not use this file except in compliance with the License. |
| 4 | + * You may obtain a copy of the License at |
| 5 | + * |
| 6 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | + * |
| 8 | + * Unless required by applicable law or agreed to in writing, software |
| 9 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | + * See the License for the specific language governing permissions and |
| 12 | + * limitations under the License. |
| 13 | + */ |
| 14 | + |
| 15 | +// requires: concerto-core:>= 1.0.0-alpha.3 |
| 16 | + |
| 17 | +namespace org.accordproject.runtime |
| 18 | + |
| 19 | +import org.accordproject.contract.Party from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto |
| 20 | +import org.accordproject.contract.ContractData from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto |
| 21 | + |
| 22 | +/** |
| 23 | + * Runtime API |
| 24 | + * -- Describes input and output of calls to a contract's clause |
| 25 | + */ |
| 26 | + |
| 27 | +/* A request is a transaction */ |
| 28 | +transaction Request { |
| 29 | +} |
| 30 | + |
| 31 | +/* A response is a transaction */ |
| 32 | +transaction Response { |
| 33 | +} |
| 34 | + |
| 35 | +/* An Error is a concept */ |
| 36 | +abstract concept ErrorResponse { |
| 37 | +} |
| 38 | + |
| 39 | +/* An event that represents an obligation that needs to be fulfilled */ |
| 40 | +abstract event Obligation { |
| 41 | + /* A back reference to the governing contract that emitted this obligation */ |
| 42 | + --> ContractData contractData |
| 43 | + |
| 44 | + /* The party that is obligated */ |
| 45 | + --> Party promisor |
| 46 | + |
| 47 | + /* The party that receives the performance */ |
| 48 | + --> Party promisee |
| 49 | + |
| 50 | + /* The time before which the obligation is fulfilled */ |
| 51 | + o DateTime deadline optional |
| 52 | +} |
| 53 | + |
| 54 | +/* A contract state is an asset -- The runtime state of the contract */ |
| 55 | +asset ContractState { |
| 56 | + --> Obligation[] obligations // Should we allow for a standard way to store obligations on the contract in the state? |
| 57 | +} |
0 commit comments