Deitos-Network / deitos-node

GNU General Public License v3.0
1 stars 1 forks source link

Create runtime API to calculate the amount to lock for each installment. #13

Open hbulgarini opened 7 months ago

kalaninja commented 7 months ago

@hbulgarini can you provide any details please?

hbulgarini commented 7 months ago

the description needs more development but:

At the moment the vec PaymentPlan stored in the Agreements storage item only tracks the block number. Then on each installment this is calculated on the fly as soon as i understand when the extrinsic consumer_prepay_installment.

So, how a consumer query the amount of each installment? we might do some off chain calculation yes .. but i wonder if some runtime API can calculate this.