diff options
Diffstat (limited to 'design-documents/046-mumimo-contracts.rst')
-rw-r--r-- | design-documents/046-mumimo-contracts.rst | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/design-documents/046-mumimo-contracts.rst b/design-documents/046-mumimo-contracts.rst index 8cb35316..3b581b3e 100644 --- a/design-documents/046-mumimo-contracts.rst +++ b/design-documents/046-mumimo-contracts.rst @@ -107,13 +107,6 @@ The contract terms v1 will have the following structure: // encoded in it (such as a short product identifier and timestamp). order_id: string; - // Price to be paid for the transaction. Could be 0. - // The price is in addition to other instruments, - // such as rations and tokens. - // The exchange will subtract deposit fees from that amount - // before transferring it to the merchant. - price: Amount; - // URL where the same contract could be ordered again (if // available). Returned also at the public order endpoint // for people other than the actual buyer (hence public, @@ -216,9 +209,6 @@ The contract terms v1 will have the following structure: // contract without storing it separately in their database. extra?: any; - // Maximum total deposit fee accepted by the merchant for this contract. - max_fee: Amount; - // Exchanges that the merchant accepts for this currency. exchanges: Exchange[]; @@ -228,6 +218,13 @@ The contract terms v1 will have the following structure: interface ContractChoice { + // Price to be paid for this choice. Could be 0. + // The price is in addition to other instruments, + // such as rations and tokens. + // The exchange will subtract deposit fees from that amount + // before transferring it to the merchant. + amount: Amount; + // List of inputs the wallet must provision (all of them) to // satisfy the conditions for the contract. inputs: ContractInput[]; @@ -236,6 +233,9 @@ The contract terms v1 will have the following structure: // once the contract is paid. outputs: ContractOutput[]; + // Maximum total deposit fee accepted by the merchant for this contract. + max_fee: Amount; + } .. ts:def:: ContractInput @@ -269,9 +269,13 @@ The contract terms v1 will have the following structure: type: "token"; // Slug of the token family in the - // 'token_families' map on the top-level. + // 'token_families' map on the order. token_family_slug: string; + // Start of the validity period of the token. This is used to find the + // matching public key within the token family. + valid_after: Timestamp; + // Number of tokens of this type required. // Defaults to one if the field is not provided. number?: Integer; @@ -323,10 +327,11 @@ The contract terms v1 will have the following structure: // 'token_families' map on the top-level. token_family_slug: string; - // Start of the validity period of the token. + // Start of the validity period of the token. This is used to find the + // matching public key within the token family. valid_after: Timestamp; - // Number of tokens to be yelded. + // Number of tokens to be issued. // Defaults to one if the field is not provided. number?: Integer; @@ -428,7 +433,7 @@ The contract terms v1 will have the following structure: rsa_pub: RsaPublicKey; // Start time of this key's validity period. - valid_after?: Timestamp; + valid_after: Timestamp; // End time of this key's validity period. valid_before: Timestamp; @@ -445,7 +450,7 @@ The contract terms v1 will have the following structure: cs_pub: Cs25519Point; // Start time of this key's validity period. - valid_after?: Timestamp; + valid_after: Timestamp; // End time of this key's validity period. valid_before: Timestamp; |