summaryrefslogtreecommitdiff
path: root/design-documents
diff options
context:
space:
mode:
authorChristian Blättler <blatc2@bfh.ch>2024-03-05 22:13:54 +0100
committerChristian Blättler <blatc2@bfh.ch>2024-03-05 22:13:54 +0100
commit9b0678d5fb4b7ffafae92539797858a84680c656 (patch)
treed192d356126803f325c03bcc856b044e2b19b4bf /design-documents
parenta018517be52b08a20cfeed20f8416cd33f4974e5 (diff)
downloaddocs-9b0678d5fb4b7ffafae92539797858a84680c656.tar.gz
docs-9b0678d5fb4b7ffafae92539797858a84680c656.tar.bz2
docs-9b0678d5fb4b7ffafae92539797858a84680c656.zip
dd46: shared type TokenClass for input and output tokens
Diffstat (limited to 'design-documents')
-rw-r--r--design-documents/046-mumimo-contracts.rst54
1 files changed, 29 insertions, 25 deletions
diff --git a/design-documents/046-mumimo-contracts.rst b/design-documents/046-mumimo-contracts.rst
index 9c693b01..5f1d1d98 100644
--- a/design-documents/046-mumimo-contracts.rst
+++ b/design-documents/046-mumimo-contracts.rst
@@ -188,7 +188,7 @@ The contract terms v1 will have the following structure:
extra?: any;
// Fee limits and wire account details by currency.
- limits: { [currency:string] : CurrencyLimit };
+ limits: { [currency: string]: CurrencyLimit };
}
.. ts:def:: CurrencyLimit
@@ -303,9 +303,9 @@ The contract terms v1 will have the following structure:
type: "token";
- // Hash over the public key used to sign the
- // type of subscription token required.
- h_issuer: HashCode;
+ // Label of the token authority in the
+ // 'token_types' map on the top-level.
+ authority_label: string;
// Number of tokens of this type required.
// Defaults to one if the field is not provided.
@@ -316,17 +316,17 @@ The contract terms v1 will have the following structure:
.. ts:def:: ContractOutput
type ContractOutput =
- | ContractOutputCurrency
- | ContractOutputTaxReceipt
- | ContractOutputToken;
+ ContractOutputCoin |
+ ContractOutputTaxReceipt |
+ ContractOutputToken;
-.. ts:def:: ContractOutputCurrency
+.. ts:def:: ContractOutputCoin
- interface ContractOutputCurrency {
+ interface ContractOutputCoin {
- type: "currency";
+ type: "coins";
- // Amount of currency that will be yielded.
+ // Amount of coins that will be yielded.
// This excludes any applicable withdraw fees.
brutto_yield: Amount;
@@ -358,24 +358,21 @@ The contract terms v1 will have the following structure:
// 'token_types' map on the top-level.
authority_label: string;
- // Must a wallet understand this token type to
- // process contracts that consume or yield it?
- critical: boolean;
+ // Number of tokens to be yelded.
+ // Defaults to one if the field is not provided.
+ number?: Integer;
- // Information about the class of token that will
- // be yielded.
- details: OutputTokenClass;
}
-.. ts:def:: OutputTokenClass
+.. ts:def:: TokenClass
- type OutputTokenClass =
- | OutputTokenClassSubscription
- | OutputTokenClassDiscount
+ type TokenClass =
+ TokenClassSubscription
+ | TokenClassDiscount
-.. ts:def:: OutputTokenClassSubscription
+.. ts:def:: TokenClassSubscription
- interface OutputTokenClassSubscription {
+ interface TokenClassSubscription {
class: "subscription";
@@ -394,9 +391,9 @@ The contract terms v1 will have the following structure:
};
-.. ts:def:: OutputTokenClassDiscount
+.. ts:def:: TokenClassDiscount
- interface OutputTokenClassDiscount {
+ interface TokenClassDiscount {
class: "discount";
@@ -431,6 +428,13 @@ The contract terms v1 will have the following structure:
// When will tokens signed by this key expire?
token_expiration: Timestamp;
+ // Class-specific information of the token
+ details: TokenClass;
+
+ // Must a wallet understand this token type to
+ // process contracts that consume or yield it?
+ critical: boolean;
+
// Number of tokens issued according to ASS authority
// FIXME: this is still rather speculative in the design...
ass?: Integer;