summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-03-05 11:56:58 +0100
committerChristian Grothoff <christian@grothoff.org>2022-03-05 11:56:58 +0100
commit4835ddf60b80a720657d42e2de57a79f258328cd (patch)
tree0126bd1a22c1732090922a7932c3180a29e655a7 /src/include
parent3a1f4186038783844bca225fd3892d91714b9b5f (diff)
downloadexchange-4835ddf60b80a720657d42e2de57a79f258328cd.tar.gz
exchange-4835ddf60b80a720657d42e2de57a79f258328cd.tar.bz2
exchange-4835ddf60b80a720657d42e2de57a79f258328cd.zip
introduce sets for wire fees and global fees
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_crypto_lib.h146
1 files changed, 146 insertions, 0 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index c23de3576..d81f5a71d 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -647,6 +647,57 @@ struct TALER_DenomFeeSetNBOP
};
+/**
+ * Set of the fees applying for a given
+ * time-range and wire method.
+ */
+struct TALER_WireFeeSetNBOP
+{
+
+ /**
+ * The fee the exchange charges for wiring funds
+ * to a merchant.
+ */
+ struct TALER_AmountNBO wire;
+
+ /**
+ * The fee the exchange charges for closing a reserve
+ * and wiring the funds back to the origin account.
+ */
+ struct TALER_AmountNBO closing;
+
+ /**
+ * The fee the exchange charges for cross-exchange
+ * P2P payments.
+ */
+ struct TALER_AmountNBO wad;
+
+};
+
+
+/**
+ * Set of the fees applying globally for a given
+ * time-range.
+ */
+struct TALER_GlobalFeeSetNBOP
+{
+
+ /**
+ * The fee the exchange charges for returning the
+ * history of a reserve or account.
+ */
+ struct TALER_AmountNBO history;
+
+ /**
+ * The fee the exchange charges for performing a
+ * KYC check on a reserve to turn it into an account
+ * that can be used for P2P payments.
+ */
+ struct TALER_AmountNBO kyc;
+
+};
+
+
GNUNET_NETWORK_STRUCT_END
@@ -685,6 +736,57 @@ struct TALER_DenomFeeSet
/**
+ * Set of the fees applying for a given
+ * time-range and wire method.
+ */
+struct TALER_WireFeeSet
+{
+
+ /**
+ * The fee the exchange charges for wiring funds
+ * to a merchant.
+ */
+ struct TALER_Amount wire;
+
+ /**
+ * The fee the exchange charges for closing a reserve
+ * and wiring the funds back to the origin account.
+ */
+ struct TALER_Amount closing;
+
+ /**
+ * The fee the exchange charges for cross-exchange
+ * P2P payments.
+ */
+ struct TALER_Amount wad;
+
+};
+
+
+/**
+ * Set of the fees applying globally for a given
+ * time-range.
+ */
+struct TALER_GlobalFeeSet
+{
+
+ /**
+ * The fee the exchange charges for returning the
+ * history of a reserve or account.
+ */
+ struct TALER_Amount history;
+
+ /**
+ * The fee the exchange charges for performing a
+ * KYC check on a reserve to turn it into an account
+ * that can be used for P2P payments.
+ */
+ struct TALER_Amount kyc;
+
+};
+
+
+/**
* Convert fee set from host to network byte order.
*
* @param[out] nbo where to write the result
@@ -707,6 +809,50 @@ TALER_denom_fee_set_ntoh (struct TALER_DenomFeeSet *fees,
/**
+ * Convert global fee set from host to network byte order.
+ *
+ * @param[out] nbo where to write the result
+ * @param fees fee set to convert
+ */
+void
+TALER_global_fee_set_hton (struct TALER_GlobalFeeSetNBOP *nbo,
+ const struct TALER_GlobalFeeSet *fees);
+
+
+/**
+ * Convert global fee set from network to host network byte order.
+ *
+ * @param[out] fees where to write the result
+ * @param nbo fee set to convert
+ */
+void
+TALER_global_fee_set_ntoh (struct TALER_GlobalFeeSet *fees,
+ const struct TALER_GlobalFeeSetNBOP *nbo);
+
+
+/**
+ * Convert wire fee set from host to network byte order.
+ *
+ * @param[out] nbo where to write the result
+ * @param fees fee set to convert
+ */
+void
+TALER_wire_fee_set_hton (struct TALER_WireFeeSetNBOP *nbo,
+ const struct TALER_WireFeeSet *fees);
+
+
+/**
+ * Convert wire fee set from network to host network byte order.
+ *
+ * @param[out] fees where to write the result
+ * @param nbo fee set to convert
+ */
+void
+TALER_wire_fee_set_ntoh (struct TALER_WireFeeSet *fees,
+ const struct TALER_WireFeeSetNBOP *nbo);
+
+
+/**
* Hash @a rsa.
*
* @param rsa key to hash