You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom export formats will allow communities to create token distribution files etc without having to rely on separate tools such as RAD.
To begin with we will make a simple setup where we allow for one custom export format.
A custom export takes the raw period receiver data and transforms it into another format. The custom format transformer (map) should also accept parameters (context) such as:
Raw data is the summarized period receiver data. No individual praise items included but the summarised score for the period in question.
Three global settings:
CUSTOM_EXPORT_MAP: url pointing to a JSON object containing the export map/transformer. We will want to setup a separate repo for the transformers to allow for the community to contribute new transformers.
CUSTOM_EXPORT_CONTEXT: JSON object with the default inputs used by the transform
CUSTOM_EXPORT_CSV_FORMAT: Boolean
true: Export in csv format
false: Export in JSON format
Period settings: map, context and format:
Period settings inherit and override global defaults
These settings should not be locked when quantification has begun
Button on the period summary page: Custom export
First transformer
Let's start with creating a transform to the csv format needed by Aragon Finance.
totalPraiseScore is added to the context by the transformer at runtime along with other parameters that might be needed by the transform: receiverCount, … what else?
The text was updated successfully, but these errors were encountered:
The following needs to be added to the context object by the system.
totalPraiseScore // sum of all praise scores for a period)
csWalletAddress // Address to send CS support payment to
csSupportPercentage // The percentage amount to support CS with
UI
Button next to Export on Period page: "Distribute"
Dialog
Message: TBD..
Allow admin to change amount to support CS with. Default: 2%
@nebs-dev perhaps also include context defaults in the JSON map? These can be used before transform starts to verify that transform has all values it needs.
Custom export formats will allow communities to create token distribution files etc without having to rely on separate tools such as RAD.
To begin with we will make a simple setup where we allow for one custom export format.
A custom export takes the raw period receiver data and transforms it into another format. The custom format transformer (map) should also accept parameters (context) such as:
I believe we might be able to use this library to perform the transform: https://github.com/bozzltron/node-json-transform
Specs
CUSTOM_EXPORT_MAP
: url pointing to a JSON object containing the export map/transformer. We will want to setup a separate repo for the transformers to allow for the community to contribute new transformers.CUSTOM_EXPORT_CONTEXT
: JSON object with the default inputs used by the transformCUSTOM_EXPORT_CSV_FORMAT
: BooleanCustom export
First transformer
Let's start with creating a transform to the csv format needed by Aragon Finance.
Output CSV:
Context:
ADDRESS
: Praise receiver addressAMOUNT
:praiseScore / context.totalPraiseScore * context.budget
TOKEN
:context.token
totalPraiseScore
is added to the context by the transformer at runtime along with other parameters that might be needed by the transform:receiverCount
, … what else?The text was updated successfully, but these errors were encountered: