Skip to content

Commit

Permalink
Merge pull request #11 from cusma/feat/settlement-asset-info
Browse files Browse the repository at this point in the history
feat: settlement asset info
  • Loading branch information
cusma authored Jan 15, 2025
2 parents dc5361d + 9297438 commit 4a4806f
Show file tree
Hide file tree
Showing 36 changed files with 4,072 additions and 3,060 deletions.
2 changes: 1 addition & 1 deletion docs/include/interface.early-repayment.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"returns": {
"type": "(uint64, uint64, byte[])",
"desc": "Paid principal amount, Payment timestamp, Payment information"
"desc": "Paid principal amount in denomination asset, Payment timestamp, Payment information"
},
"errors": [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/include/interface.get-account-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"returns": {
"type": "(address,uint64,uint64,uint64,bool)",
"desc": "Payment Address, D-ASA units, Unit nominal value, Paid coupons, Suspended"
"desc": "Payment Address, D-ASA units, Unit nominal value in denomination asset, Paid coupons, Suspended"
},
"errors": [
{
Expand Down
4 changes: 2 additions & 2 deletions docs/include/interface.get-asset-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"readonly": true,
"args": [],
"returns": {
"type": "(uint64,uint64,uint64,uint8,uint16,uint64,uint64,uint64, uint64,uint64,uint64,bool,bool)",
"desc": "Denomination Asset ID, Outstanding principal, Unit nominal value, Day-count convention, Interest rate, Total supply, Circulating supply, Primary distribution opening date, Primary distribution closure date, Issuance date, Maturity date, Suspended, Defaulted"
"type": "(uint64,uint64,uint64,uint64,uint8,uint16,uint64,uint64,uint64, uint64,uint64,uint64,bool,bool)",
"desc": "Denomination asset ID, Settlement asset ID, Outstanding principal, Unit nominal value, Day-count convention, Interest rate, Total supply, Circulating supply, Primary distribution opening date, Primary distribution closure date, Issuance date, Maturity date, Suspended, Defaulted"
}
}
2 changes: 1 addition & 1 deletion docs/include/interface.pay-coupon.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"returns": {
"type": "(uint64, uint64, byte[])",
"desc": "Paid coupon amount, Payment timestamp, Payment context"
"desc": "Paid coupon amount in denomination asset, Payment timestamp, Payment context"
},
"errors": [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/include/interface.pay-principal.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"returns": {
"type": "(uint64, uint64, byte[])",
"desc": "Paid principal amount, Payment timestamp, Payment context"
"desc": "Paid principal amount in denomination asset, Payment timestamp, Payment context"
},
"errors": [
{
Expand Down
17 changes: 10 additions & 7 deletions docs/payment-agent.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Payment Agent {#payment-agent}

> Debt instruments' cash flows depend on the payoff, they usually involve:
> Debt instruments' cash flows usually involve:
>
> - *Principal repayment;*
> - *Early repayment options;*
> - *Coupon payments.*
> - *Principal repayment*
> - *Early repayment options*
> - *Coupon payments*
> D-ASA supports both on-chain and off-chain payment agents, depending on the settlement
> asset (see [Settlement](./settlement.md) section).
The D-ASA payment methods **MAY** provide additional information about the payment.

> The payment information could be used to add a unique identifier or external context
> to the payments, enabling external payment system integration in the case of off-chain
> payment agents.
> The payment information could be used, for example, for:
>
> - Adding unique identifiers or external context to the payments
> - Enabling external payment system integration in the case of off-chain settlement
> - Providing information about the settled amount and conversion rate used with
> respect to the denomination asset
7 changes: 1 addition & 6 deletions docs/settlement.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
> Debt instruments cash flows may be settled in a currency different from the denomination.
The D-ASA **MUST** define either in an on-chain or off-chain *settlement asset*
\\([CURS]\\)[^1] to regulate the cash flows.
to regulate the cash flows.

The *settlement asset identifier* (`uint64`) **MUST** be set using the `asset_config`
method.
Expand Down Expand Up @@ -42,8 +42,3 @@ The *settlement asset* **MUST** use the decimal digits specified by the <a href=
>
> - Regulates payments’ approval conditions (e.g. a coupon is due);
> - Notarizes the amounts and timestamps of payments settled off-chain.
---

[^1]: ACTUS only allows ISO 4217 currency identifiers, therefore an on-chain settlement
is not supported by ACTUS.
1 change: 1 addition & 0 deletions smart_contracts/abi_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class AssetInfo(arc4.Struct, kw_only=True):
"""D-ASA Info"""

denomination_asset_id: arc4.UInt64
settlement_asset_id: arc4.UInt64
outstanding_principal: arc4.UInt64
unit_value: arc4.UInt64
day_count_convention: arc4.UInt8
Expand Down
1,041 changes: 629 additions & 412 deletions smart_contracts/artifacts/base_d_asa/BaseDAsa.approval.puya.map

Large diffs are not rendered by default.

Loading

0 comments on commit 4a4806f

Please sign in to comment.