Merge branch 'develop' of https://github.com/harrellbm/Superalgos into develop
This commit is contained in:
commit
0e6ed30cec
67 files changed
+34094
-14401
No files matched your search
@@ -885,7 +885,10 @@
|
||||
#governance-tab10:checked ~ .governance-search-result-content #content10,
|
||||
#governance-tab11:checked ~ .governance-search-result-content #content11,
|
||||
#governance-tab12:checked ~ .governance-search-result-content #content12,
|
||||
#governance-tab13:checked ~ .governance-search-result-content #content13 {
|
||||
#governance-tab13:checked ~ .governance-search-result-content #content13,
|
||||
#governance-tab14:checked ~ .governance-search-result-content #content14,
|
||||
#governance-tab15:checked ~ .governance-search-result-content #content15,
|
||||
#governance-tab16:checked ~ .governance-search-result-content #content16 {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
+178
-1
@@ -773,7 +773,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> commitMessage = ' + commitMessage)
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> username = ' + username)
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> token = ' + token)
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> token starts with = ' + token.substring(0, 10) + '...')
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> token ends with = ' + '...' + token.substring(token.length - 10))
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> currentBranch = ' + currentBranch)
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> contributionsBranch = ' + contributionsBranch)
|
||||
|
||||
@@ -1018,6 +1019,176 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
}
|
||||
break
|
||||
|
||||
case 'Gov': {
|
||||
switch (requestParameters[2]) { // switch by command
|
||||
case 'getGithubStars': {
|
||||
getProfiles('activity', 'listStargazersForRepo')
|
||||
break
|
||||
}
|
||||
case 'getGithubWatchers': {
|
||||
getProfiles('activity', 'listWatchersForRepo')
|
||||
break
|
||||
}
|
||||
case 'getGithubForks': {
|
||||
getProfiles('repos', 'listForks')
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
function getProfiles(endpoint, method) {
|
||||
try {
|
||||
const GITHUB_API_WAITING_TIME = 250
|
||||
const repository = unescape(requestParameters[3])
|
||||
const username = unescape(requestParameters[4])
|
||||
const token = unescape(requestParameters[5])
|
||||
let error
|
||||
let githubListArray = []
|
||||
|
||||
getRepoInfo()
|
||||
|
||||
async function getRepoInfo() {
|
||||
await doGithub()
|
||||
if (error !== undefined) {
|
||||
|
||||
let docs = {
|
||||
project: 'Governance',
|
||||
category: 'Topic',
|
||||
type: 'Gov Error - Get Repository Information',
|
||||
anchor: undefined,
|
||||
placeholder: {}
|
||||
}
|
||||
|
||||
respondWithDocsObject(docs, error)
|
||||
return
|
||||
}
|
||||
|
||||
respondWithContent(JSON.stringify(githubListArray), httpResponse)
|
||||
}
|
||||
|
||||
async function doGithub() {
|
||||
|
||||
const { Octokit } = require("@octokit/rest")
|
||||
|
||||
const octokit = new Octokit({
|
||||
auth: token,
|
||||
userAgent: 'Superalgos Beta 10'
|
||||
})
|
||||
await getList()
|
||||
|
||||
async function getList() {
|
||||
const repo = repository
|
||||
const owner = 'Superalgos'
|
||||
const per_page = 100 // Max
|
||||
let page = 0
|
||||
let lastPage = false
|
||||
|
||||
while (lastPage === false) {
|
||||
try {
|
||||
page++
|
||||
await sleep(GITHUB_API_WAITING_TIME)
|
||||
let listResponse = await octokit[endpoint][method]({
|
||||
owner,
|
||||
repo,
|
||||
per_page,
|
||||
page
|
||||
});
|
||||
|
||||
if (listResponse.data.length < 100) {
|
||||
lastPage = true
|
||||
}
|
||||
|
||||
for (let i = 0; i < listResponse.data.length; i++) {
|
||||
let listItem = listResponse.data[i]
|
||||
let githubUsername
|
||||
switch(endpoint) {
|
||||
case 'activity' : {
|
||||
githubUsername = listItem.login
|
||||
break
|
||||
}
|
||||
case 'repos' : {
|
||||
githubUsername = listItem.owner.login
|
||||
break
|
||||
}
|
||||
}
|
||||
//console.log(listItem)
|
||||
|
||||
githubListArray.push(githubUsername)
|
||||
}
|
||||
console.log('[INFO] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList -> ' + method + ' Page = ' + page)
|
||||
console.log('[INFO] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList -> ' + method + ' Received = ' + listResponse.data.length)
|
||||
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
|
||||
if (err.stack.indexOf('last page') >= 0) {
|
||||
return
|
||||
} else {
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList ->Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList ->err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList ->repository = ' + repository)
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList ->username = ' + username)
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList ->token starts with = ' + token.substring(0, 10) + '...')
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList ->token ends with = ' + '...' + token.substring(token.length - 10))
|
||||
error = err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> Method call produced an error.')
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> err.stack = ' + err.stack)
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> repository = ' + repository)
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> username = ' + username)
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> token starts with = ' + token.substring(0, 10) + '...')
|
||||
console.log('[ERROR] httpInterface -> Gov -> getRepoInfo -> token ends with = ' + '...' + token.substring(token.length - 10))
|
||||
|
||||
let error = {
|
||||
result: 'Fail Because',
|
||||
message: err.message,
|
||||
stack: err.stack
|
||||
}
|
||||
respondWithContent(JSON.stringify(error), httpResponse)
|
||||
}
|
||||
}
|
||||
function respondWithDocsObject(docs, error) {
|
||||
|
||||
if (error.message !== undefined) {
|
||||
docs.placeholder.errorMessage = {
|
||||
style: 'Error',
|
||||
text: error.message
|
||||
}
|
||||
}
|
||||
if (error.stack !== undefined) {
|
||||
docs.placeholder.errorStack = {
|
||||
style: 'Javascript',
|
||||
text: error.stack
|
||||
}
|
||||
}
|
||||
if (error.code !== undefined) {
|
||||
docs.placeholder.errorCode = {
|
||||
style: 'Json',
|
||||
text: error.code
|
||||
}
|
||||
}
|
||||
|
||||
docs.placeholder.errorDetails = {
|
||||
style: 'Json',
|
||||
text: JSON.stringify(error, undefined, 4)
|
||||
}
|
||||
|
||||
let customResponse = {
|
||||
result: global.CUSTOM_FAIL_RESPONSE.result,
|
||||
docs: docs
|
||||
}
|
||||
|
||||
respondWithContent(JSON.stringify(customResponse), httpResponse)
|
||||
|
||||
}
|
||||
}
|
||||
break
|
||||
|
||||
case 'LegacyPlotter.js':
|
||||
{
|
||||
respondWithFile(global.env.PATH_TO_CLIENT + 'WebServer/LegacyPlotter.js', httpResponse)
|
||||
@@ -1962,4 +2133,10 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
return files.reduce((a, f) => a.concat(f), []);
|
||||
}
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(resolve, ms)
|
||||
})
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -246,7 +246,9 @@ function newWorkspace() {
|
||||
let pluginFile = childNode.pluginFiles[k]
|
||||
|
||||
let saveWithWorkspace = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(pluginFile.payload, 'saveWithWorkspace')
|
||||
UI.projects.foundations.utilities.plugins.savePluginFile(pluginFile)
|
||||
if (saveWithWorkspace === true) {
|
||||
UI.projects.foundations.utilities.plugins.savePluginFile(pluginFile)
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -6,7 +6,7 @@
|
||||
"featureClasses": [
|
||||
{
|
||||
"type": "Feature Class",
|
||||
"name": "Superalgos",
|
||||
"name": "Main Features",
|
||||
"config": "{\n \"description\": \"\", \"relativeWeight\": 0 \n}",
|
||||
"project": "Governance",
|
||||
"featureClasses": [
|
||||
@@ -106,38 +106,7 @@
|
||||
"config": "{\n \"description\": \"\", \"relativeWeight\": 0 \n}",
|
||||
"project": "Governance",
|
||||
"featureClasses": [],
|
||||
"features": [
|
||||
{
|
||||
"type": "Feature",
|
||||
"name": "Feature X",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"featureClasses": [],
|
||||
"features": [],
|
||||
"id": "1b9dd977-f388-4434-a3f9-2e7a10726848",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 35142.58980337503,
|
||||
"y": 38451.171151375485
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 35385.29490168751,
|
||||
"y": 38274.83557568774
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 2,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"features": [],
|
||||
"id": "025c0e15-ad8d-49ae-b501-577bb82c207d",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
@@ -201,7 +170,7 @@
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": true,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 1,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,16 +3,351 @@
|
||||
"name": "Superalgos",
|
||||
"config": "{\"codeName\":\"Superalgos\"}",
|
||||
"project": "Governance",
|
||||
"positionClasss": [],
|
||||
"positions": [
|
||||
"positionClasss": [
|
||||
{
|
||||
"type": "Position",
|
||||
"name": "Project Leader",
|
||||
"config": "{\n \"description\": \"\", \"relativeWeight\": 0 \n}",
|
||||
"type": "Position Class",
|
||||
"name": "Current Positions",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [],
|
||||
"positionClasss": [],
|
||||
"id": "5f694173-4568-46b2-a52c-4244320919f7",
|
||||
"positions": [
|
||||
{
|
||||
"type": "Position",
|
||||
"name": "Project Lead",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [],
|
||||
"positionClasss": [],
|
||||
"id": "0c2e2b7c-3786-4810-9f0f-a287857ca83d",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30490.807621135333,
|
||||
"y": 38220
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30231,
|
||||
"y": 38070
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 2,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"positionClasss": [
|
||||
{
|
||||
"type": "Position Class",
|
||||
"name": "Community Management",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [
|
||||
{
|
||||
"type": "Position",
|
||||
"name": "Moderator",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [],
|
||||
"positionClasss": [],
|
||||
"id": "6e141ab6-cc79-44b6-a58a-60b6480f706e",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30531,
|
||||
"y": 38589.615242270665
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30381,
|
||||
"y": 38329.80762113533
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 1,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"positionClasss": [],
|
||||
"id": "35b790f0-c567-498c-83fd-ac0aacd8720b",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30381,
|
||||
"y": 38329.80762113533
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30231,
|
||||
"y": 38070
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 2,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Position Class",
|
||||
"name": "Marketing",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [
|
||||
{
|
||||
"type": "Position",
|
||||
"name": "Marketing Lead",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [],
|
||||
"positionClasss": [],
|
||||
"id": "59369731-0766-4d13-aec2-db218b5455e4",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30308.645713530757,
|
||||
"y": 38659.77774788672
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30231,
|
||||
"y": 38370
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 3,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Position",
|
||||
"name": "Advisor",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [],
|
||||
"positionClasss": [],
|
||||
"id": "da7c7b94-d675-402e-9178-b219ff9a672c",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30153.354286469243,
|
||||
"y": 38659.77774788672
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30231,
|
||||
"y": 38370
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 3,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"positionClasss": [],
|
||||
"id": "93b22245-d3a2-42d7-9743-8d8a681842e6",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30231,
|
||||
"y": 38370
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30231,
|
||||
"y": 38070
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 2,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Position Class",
|
||||
"name": "Business",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [
|
||||
{
|
||||
"type": "Position",
|
||||
"name": "Business Lead",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [],
|
||||
"positionClasss": [],
|
||||
"id": "b29c3581-089f-41fd-9421-3e9b518a9c7b",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30003.354286469243,
|
||||
"y": 38619.585369022054
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30081,
|
||||
"y": 38329.80762113533
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 3,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Position",
|
||||
"name": "Advisor",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [],
|
||||
"positionClasss": [],
|
||||
"id": "88a25b7c-df9f-4268-8216-5cb4a90a72dc",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 29868.867965644036,
|
||||
"y": 38541.9396554913
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30081,
|
||||
"y": 38329.80762113533
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 3,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"positionClasss": [],
|
||||
"id": "520de537-9ab0-41d6-8bd0-950fe9524e4d",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30081,
|
||||
"y": 38329.80762113533
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30231,
|
||||
"y": 38070
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 2,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Position Class",
|
||||
"name": "Core Team",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [
|
||||
{
|
||||
"type": "Position",
|
||||
"name": "Member",
|
||||
"config": "{}",
|
||||
"project": "Governance",
|
||||
"positions": [],
|
||||
"positionClasss": [],
|
||||
"id": "63bbf7f7-2d71-4075-8498-f09f754d8c0b",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 29711.384757729335,
|
||||
"y": 38370
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 29971.192378864667,
|
||||
"y": 38220
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 1,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"positionClasss": [],
|
||||
"id": "0dc6759d-459b-45ff-83c5-220b7a323f75",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 29971.192378864667,
|
||||
"y": 38220
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30231,
|
||||
"y": 38070
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 2,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"id": "8b29fcb2-3b9a-444f-b3b0-05976da9a18f",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30231,
|
||||
@@ -36,6 +371,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"positions": [],
|
||||
"id": "50c68665-5da2-48a8-b229-7a1563ae82d2",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
@@ -49,7 +385,7 @@
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": true,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 1,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -30,13 +30,15 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"spaceSettings": {
|
||||
"type": "Space Settings",
|
||||
"name": "New Space Settings",
|
||||
"config": "{\n \"node\": {\n \"distancePercentage\": 60,\n \"radiusPercentage\": 85,\n \"massPercentage\": 100,\n \"animationSteps\": 2,\n \"menuItem\": {\n \"widthPercentage\": 100,\n \"heightPercentage\": 60,\n \"radiusPercentage\": 90\n }\n },\n \"physics\": false\n}",
|
||||
"config": "{\n \"node\": {\n \"distancePercentage\": 60,\n \"radiusPercentage\": 85,\n \"massPercentage\": 100,\n \"animationSteps\": 2,\n \"menuItem\": {\n \"widthPercentage\": 100,\n \"heightPercentage\": 60,\n \"radiusPercentage\": 90\n }\n },\n \"physics\": false,\n \"shortcuts\": {\n \"toggleMapMode\": \"M\",\n \"toggleDrawRelationshipLines\": \"R\",\n \"toggleDrawParentLines\": \"C\",\n \"saveWorkspace\": \"S\",\n \"adjustAspectRatio\": \"A\"\n }\n}",
|
||||
"project": "Foundations",
|
||||
"id": "05c9d6d5-24c4-4eec-9aca-9668d6486fdd",
|
||||
"savedPayload": {
|
||||
@@ -56,7 +58,9 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "f8485ce5-67f3-4476-b9e2-80994e49c318",
|
||||
@@ -142,13 +146,15 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"spaceSettings": {
|
||||
"type": "Space Settings",
|
||||
"name": "New Space Settings",
|
||||
"config": "{\n \"indexContent\": false\n}",
|
||||
"config": "{\n \"indexContent\": true\n}",
|
||||
"project": "Foundations",
|
||||
"id": "4124c674-c5fe-41d9-94b9-d669753188b7",
|
||||
"savedPayload": {
|
||||
@@ -168,7 +174,9 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "016e464a-2b86-4c73-b79b-35c95751c339",
|
||||
@@ -221,7 +229,9 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"spaces": {
|
||||
@@ -246,7 +256,9 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"mines": {
|
||||
@@ -271,7 +283,9 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"trading": {
|
||||
@@ -296,7 +310,9 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"learning": {
|
||||
@@ -321,7 +337,9 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"otherHierarchies": {
|
||||
@@ -346,7 +364,9 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "cf9f8b3b-77c6-43c6-b01f-95cf366a91f6",
|
||||
@@ -754,7 +774,7 @@
|
||||
{
|
||||
"type": "Plugin File",
|
||||
"name": "Luis-Fernando-Molina",
|
||||
"config": "{\n \"project\": \"Governance\",\n \"fileName\": \"Luis-Fernando-Molina\",\n \"folderName\": \"User-Profiles\",\n \"nodeType\": \"User Profile\"\n}",
|
||||
"config": "{\n \"project\": \"Governance\",\n \"fileName\": \"Luis-Fernando-Molina\",\n \"folderName\": \"User-Profiles\",\n \"nodeType\": \"User Profile\",\n \"saveWithWorkspace\": true\n}",
|
||||
"project": "Foundations",
|
||||
"id": "cccfce2d-3497-419b-8c32-4cd62fb1b33f",
|
||||
"savedPayload": {
|
||||
@@ -769,7 +789,7 @@
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": true,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 2,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
@@ -848,7 +868,7 @@
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": false,
|
||||
"isCollapsed": true,
|
||||
"angleToParent": 2,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
@@ -905,7 +925,7 @@
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
"isFrozen": false,
|
||||
"isCollapsed": true,
|
||||
"isCollapsed": false,
|
||||
"angleToParent": 2,
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
@@ -1364,17 +1384,17 @@
|
||||
"githubAPI": {
|
||||
"type": "Github API",
|
||||
"name": "New Github API",
|
||||
"config": "{\n \"username\": \"\",\n \"token\": \"\"\n}",
|
||||
"config": "{\n \"username\": \"Luis-Fernando-Molina\",\n \"token\": \"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\"\n}",
|
||||
"project": "Foundations",
|
||||
"id": "90d121ab-9f19-4437-a051-1222287085fc",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30530.125,
|
||||
"y": 10634.899380804953
|
||||
"x": 30499.125000000004,
|
||||
"y": 10694.399380804953
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30230.125,
|
||||
"y": 10634.899380804953
|
||||
"x": 30199.125000000004,
|
||||
"y": 10694.399380804953
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": false,
|
||||
@@ -1384,18 +1404,20 @@
|
||||
"distanceToParent": 3,
|
||||
"arrangementStyle": 0
|
||||
},
|
||||
"uiObject": {}
|
||||
"uiObject": {
|
||||
"isRunning": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "23021bb7-9997-4fe6-8199-71ebf70aef76",
|
||||
"savedPayload": {
|
||||
"position": {
|
||||
"x": 30230.125,
|
||||
"y": 10634.899380804953
|
||||
"x": 30199.125000000004,
|
||||
"y": 10694.399380804953
|
||||
},
|
||||
"targetPosition": {
|
||||
"x": 30230.125,
|
||||
"y": 10634.899380804953
|
||||
"x": 30199.125000000004,
|
||||
"y": 10694.399380804953
|
||||
},
|
||||
"floatingObject": {
|
||||
"isPinned": true,
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"type": "Airdrop Program",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "tokensAwarded",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Add Tokens Awarded",
|
||||
"relatedUiObject": "Tokens Awarded"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{}"
|
||||
},
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Token Power Switch->"
|
||||
},
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
"propertyNameAtParent": "airdropProgram",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "tokensAwarded",
|
||||
"type": "node",
|
||||
"childType": "Tokens Awarded",
|
||||
"autoAdd": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"type": "Github Program",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "tokensAwarded",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Add Tokens Awarded",
|
||||
"relatedUiObject": "Tokens Awarded"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{}"
|
||||
},
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Token Power Switch->"
|
||||
},
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
"propertyNameAtParent": "githubProgram",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "tokensAwarded",
|
||||
"type": "node",
|
||||
"childType": "Tokens Awarded",
|
||||
"autoAdd": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"type": "Influencer Program",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Add User Influencer",
|
||||
"relatedUiObject": "User Influencer"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "tokensAwarded",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Add Tokens Awarded",
|
||||
"relatedUiObject": "Tokens Awarded"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "tokensBonus",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"label": "Add Tokens Bonus",
|
||||
"relatedUiObject": "Tokens Bonus"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{}"
|
||||
},
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Token Power Switch->"
|
||||
},
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
"propertyNameAtParent": "influencerProgram",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
"name": "userInfluencers",
|
||||
"type": "array",
|
||||
"childType": "User Influencer",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "tokensAwarded",
|
||||
"type": "node",
|
||||
"childType": "Tokens Awarded",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "tokensBonus",
|
||||
"type": "node",
|
||||
"childType": "Tokens Bonus",
|
||||
"autoAdd": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -44,9 +44,6 @@
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Pools->Pool Class->"
|
||||
},
|
||||
"referencingRules": {
|
||||
"compatibleTypes": "->Position Class->Position->"
|
||||
},
|
||||
"propertyNameAtParent": "poolClasses",
|
||||
"childrenNodesProperties": [
|
||||
{
|
||||
|
||||
@@ -15,6 +15,24 @@
|
||||
"label": "Add Token Power Switch",
|
||||
"relatedUiObject": "Token Power Switch"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "airdropProgram",
|
||||
"label": "Add Airdrop Program",
|
||||
"relatedUiObject": "Airdrop Program"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "githubProgram",
|
||||
"label": "Add Github Program",
|
||||
"relatedUiObject": "Github Program"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
@@ -42,6 +60,15 @@
|
||||
"label": "Add Mentorship Program",
|
||||
"relatedUiObject": "Mentorship Program"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"actionFunction": "payload.executeAction",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "influencerProgram",
|
||||
"label": "Add Influencer Program",
|
||||
"relatedUiObject": "Influencer Program"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"actionProject": "Foundations",
|
||||
@@ -98,7 +125,7 @@
|
||||
"addLeftIcons": true,
|
||||
"level": 2,
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->User Profile->"
|
||||
"compatibleTypes": "->User Profile->Token Power Switch->"
|
||||
},
|
||||
"propertyNameAtParent": "tokenPowerSwitch",
|
||||
"childrenNodesProperties": [
|
||||
@@ -108,6 +135,18 @@
|
||||
"childType": "Token Power Switch",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "airdropProgram",
|
||||
"type": "node",
|
||||
"childType": "Airdrop Program",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "githubProgram",
|
||||
"type": "node",
|
||||
"childType": "Github Program",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "referralProgram",
|
||||
"type": "node",
|
||||
@@ -126,6 +165,12 @@
|
||||
"childType": "Mentorship Program",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "influencerProgram",
|
||||
"type": "node",
|
||||
"childType": "Influencer Program",
|
||||
"autoAdd": false
|
||||
},
|
||||
{
|
||||
"name": "claimsProgram",
|
||||
"type": "node",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"addLeftIcons": true,
|
||||
"level": 2,
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Referral Program->Mentorship Program->Support Program->Claims Program->Staking Program->"
|
||||
"compatibleTypes": "->Referral Program->Mentorship Program->Support Program->Claims Program->Staking Program->Github Program->Airdrop Program->Influencer Program->"
|
||||
},
|
||||
"propertyNameAtParent": "tokensAwarded"
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
"addLeftIcons": true,
|
||||
"level": 2,
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Referral Program->Mentorship Program->Support Program->Voting Program->"
|
||||
"compatibleTypes": "->Referral Program->Mentorship Program->Support Program->Voting Program->Influencer Program->"
|
||||
},
|
||||
"propertyNameAtParent": "tokensBonus"
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"type": "User Influencer",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"actionProject": "Foundations",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete-entity",
|
||||
"iconPathOff": "delete-entity",
|
||||
"actionFunction": "payload.executeAction"
|
||||
}
|
||||
],
|
||||
"title": [
|
||||
"Use Reference Parent"
|
||||
],
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{}"
|
||||
},
|
||||
"addLeftIcons": true,
|
||||
"level": 2,
|
||||
"attachingRules": {
|
||||
"compatibleTypes": "->Support Program->"
|
||||
},
|
||||
"referencingRules": {
|
||||
"compatibleTypes": "->User Profile->"
|
||||
},
|
||||
"propertyNameAtParent": "userInfluencers"
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"topic": "Gov Commands Errors",
|
||||
"pageNumber": "1",
|
||||
"type": "Gov Error - Pull Requests Not Processed",
|
||||
"definition": {
|
||||
"text": "There was a problem trying to process the pull requests at the Superalgos repository",
|
||||
"updated": 1611129378492
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Check the following section for details on what may have happened. After you fix the issue that prevented the Gov PRs Command to run, you may try again.",
|
||||
"updated": 1611152997869
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Info",
|
||||
"updated": 1611154606702
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section, you will find the information recorded when the error occurred."
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "You will only see the information if you opened this page as a result of the error actually occurring.",
|
||||
"updated": 1611153032408
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the Client:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorMessage"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Stack"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Stack of the Exception that occured at the Client:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorStack"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Code of the Exception that occured at the Client:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Details",
|
||||
"updated": 1611154543778
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following are all the Error details of the Exception that occured at the Client:",
|
||||
"updated": 1611154675224
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails",
|
||||
"updated": 1611154555419
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"topic": "Gov Commands Errors",
|
||||
"pageNumber": "2",
|
||||
"type": "Gov Error - Github Credentials Missing",
|
||||
"definition": {
|
||||
"text": "To manage pull requests from within the app, you must first provide your Github.com credentials so that the Client can get you authenticated when while accessing Github.com.",
|
||||
"updated": 1611129104270
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Anchor",
|
||||
"text": "Anchor Github Credentials Missing",
|
||||
"updated": 1609855373585
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Github Credentials are Missing. Please solve this issue and try again.",
|
||||
"updated": 1620591786589
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "To solve this issue follow the following instructions on how to set up your GitHub.com credentials so that the system can automate the tasks needed to submit your contributions to the main repository of the Superalgos project.",
|
||||
"updated": 1609945787577
|
||||
},
|
||||
{
|
||||
"style": "Anchor",
|
||||
"text": "Anchor Hierarchy APIs Not Found"
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Github Credentials are Missing. The Hierarchy APIs was not found at your workspace. Please create it following the guide below and try again.",
|
||||
"updated": 1620591795457
|
||||
},
|
||||
{
|
||||
"style": "Anchor",
|
||||
"text": "Anchor Github API Node Not Found",
|
||||
"updated": 1610559802944
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Github Credentials are Missing. The Hierarchy APIs does not have a child of type Github API. Please create it following the guide below and try again.",
|
||||
"updated": 1620591802895
|
||||
},
|
||||
{
|
||||
"style": "Anchor",
|
||||
"text": "Anchor Config Property Username Not Found",
|
||||
"updated": 1610559852624
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Github Credentials are Missing. The property username is missing or empty. Please create it following the guide below and try again.",
|
||||
"updated": 1620591810613
|
||||
},
|
||||
{
|
||||
"style": "Anchor",
|
||||
"text": "Anchor Config Property Token Not Found",
|
||||
"updated": 1610559914327
|
||||
},
|
||||
{
|
||||
"style": "Error",
|
||||
"text": "Github Crendentials are Missing. The property token is missing or empty. Please create it following the guide below and try again.",
|
||||
"updated": 1610559900470
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Applies to"
|
||||
},
|
||||
{
|
||||
"style": "List",
|
||||
"text": "Gov PRs Command"
|
||||
},
|
||||
{
|
||||
"style": "Include",
|
||||
"text": "Foundations->Topic->App Contribute Command->Block Authentication",
|
||||
"updated": 1609945833844
|
||||
}
|
||||
]
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"topic": "Gov Commands Errors",
|
||||
"pageNumber": "3",
|
||||
"type": "Gov Error - Pay Failed",
|
||||
"definition": {
|
||||
"text": "There was a problem trying to pay to contributors from the Treasury Account. Check the console for errors.",
|
||||
"updated": 1611129344277
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "Check for the following section for details on what may have happened. After you fix the issue, you may try again.",
|
||||
"updated": 1611152967185
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Error Info",
|
||||
"updated": 1611154641024
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "In the following section, you will find the information recorded when the error occurred."
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "You will only see the information if you opened this page as a result of the error actually occurring.",
|
||||
"updated": 1611151375974
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Message"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Message of the Exception that occured at the Client:",
|
||||
"updated": 1611151299633
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorMessage"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Stack"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Stack of the Exception that occured at the Client:",
|
||||
"updated": 1611151427220
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorStack"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Code"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following is the Error Code of the Exception that occured at the Client:",
|
||||
"updated": 1611151443562
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorCode"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "Error Details"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The following are all the Error details of the Exception that occured at the Client:"
|
||||
},
|
||||
{
|
||||
"style": "Placeholder",
|
||||
"text": "errorDetails"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"topic": "Gov Commands Messages",
|
||||
"pageNumber": "1",
|
||||
"type": "Gov Message - Pull Requests Processed",
|
||||
"definition": {
|
||||
"text": "The pull requests at the main Superalgos repositoryhave been succesfully processed.",
|
||||
"updated": 1611002547907,
|
||||
"translations": [
|
||||
]
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "No further action from you is required. The PRs Processing Rules have been applied and all PRs that could be merged were merged.",
|
||||
"updated": 1611002626154,
|
||||
"translations": [
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"topic": "Gov Commands Messages",
|
||||
"pageNumber": "2",
|
||||
"type": "Gov Message - Processing Pull Requests",
|
||||
"definition": {
|
||||
"text": "Hold on while this process checks all the open PRs at the Superalgos repository at GitHub.com and merges all the ones that can be merged accorfing to the PRs Processing Rules. You will get a new message when the operation is complete.",
|
||||
"updated": 1611002766659,
|
||||
"translations": [
|
||||
]
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "What's next?",
|
||||
"updated": 1609940971059,
|
||||
"translations": [
|
||||
]
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "No further action from you is required. In a few seconds / minutes you should be able to see the result of this process.",
|
||||
"updated": 1611128895749,
|
||||
"translations": [
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"topic": "Gov Commands Messages",
|
||||
"pageNumber": "3",
|
||||
"type": "Gov Message - Paying Contributors",
|
||||
"definition": {
|
||||
"text": "The process to pay contributors has been started. Hold on!",
|
||||
"translations": []
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "You will soon get a notice informing you whether the process succeed to pay all contributors or not.",
|
||||
"translations": [],
|
||||
"updated": 1627203557237
|
||||
}
|
||||
]
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"topic": "Gov Commands Messages",
|
||||
"pageNumber": "4",
|
||||
"type": "Gov Message - All Payments Were Sent",
|
||||
"definition": {
|
||||
"text": "The pay process finished successfully. Payments to all contributors were sent.",
|
||||
"updated": 1611003042937,
|
||||
"translations": [
|
||||
]
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "The process to pay contributors was fully successfull and all payments have been sent.",
|
||||
"updated": 1616081292001,
|
||||
"translations": [
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"topic": "Gov Commands Messages",
|
||||
"pageNumber": "5",
|
||||
"type": "Gov Message - Not All Payments Were Sent",
|
||||
"definition": {
|
||||
"text": "The update pay run but no all the payments were sent. You need to check the process output to fix it and proably run it again.",
|
||||
"updated": 1615458687718,
|
||||
"translations": [
|
||||
]
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "You are up-to-date. No need to reboot the Client or refresh the UI page.",
|
||||
"updated": 1610454271911,
|
||||
"translations": [
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"topic": "App Commands",
|
||||
"pageNumber": "1",
|
||||
"type": "App PRs Command",
|
||||
"definition": {
|
||||
"text": "This command allows you to check all existing PRs and automatically close the ones that do not comply with PRs Rules or merge the ones they do. It also leaves untouched the PRs that are out of the scope of the PRs Rules.",
|
||||
"updated": 1610909304702
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Add more text here.",
|
||||
"updated": 1622028842412
|
||||
}
|
||||
]
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"topic": "App Commands",
|
||||
"pageNumber": "2",
|
||||
"type": "App Pay Command",
|
||||
"definition": {
|
||||
"text": "Use this command to pay to contributors using the Trasury Blockchain Account to do so. If you are not in charge of the Treasury Account you can still run this command to generate the output file of the Pay process.",
|
||||
"updated": 1610449365984
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Syntax",
|
||||
"updated": 1610449451990
|
||||
},
|
||||
{
|
||||
"style": "Json",
|
||||
"text": "gov.pay",
|
||||
"updated": 1615612258411
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Examples"
|
||||
},
|
||||
{
|
||||
"style": "Json",
|
||||
"text": "gov.pay"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
function newGovernanceFunctionLibraryAirdropProgram() {
|
||||
let thisObject = {
|
||||
calculate: calculate
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function calculate(
|
||||
pools,
|
||||
userProfiles
|
||||
) {
|
||||
let programPoolTokenReward
|
||||
/*
|
||||
In order to be able to calculate the share of the Program Pool for each User Profile,
|
||||
we need to accumulate all the Airdrop Power that each User Profile at their Program
|
||||
node has, because with that Power is that each Program node gets a share of the pool.
|
||||
*/
|
||||
let accumulatedProgramPower = 0
|
||||
|
||||
/* Scan Pools Until finding the Mentoship-Program Pool */
|
||||
for (let i = 0; i < pools.length; i++) {
|
||||
let poolsNode = pools[i]
|
||||
programPoolTokenReward = UI.projects.governance.utilities.pools.findPool(poolsNode, "Airdrop-Rewards")
|
||||
}
|
||||
if (programPoolTokenReward === undefined || programPoolTokenReward === 0) { return }
|
||||
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Airdrop Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
|
||||
resetProgram(program)
|
||||
}
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Airdrop Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
|
||||
validateProgram(program, userProfile)
|
||||
}
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Airdrop Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload.airdropProgram.isActive === false) { continue }
|
||||
|
||||
distributeProgram(program)
|
||||
}
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Airdrop Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload.airdropProgram.isActive === false) { continue }
|
||||
|
||||
calculateProgram(program)
|
||||
}
|
||||
|
||||
function resetProgram(node) {
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.airdropProgram === undefined) {
|
||||
node.payload.airdropProgram = {
|
||||
count: 0,
|
||||
percentage: 0,
|
||||
outgoingPower: 0,
|
||||
ownPower: 0,
|
||||
incomingPower: 0,
|
||||
awarded: {
|
||||
tokens: 0,
|
||||
percentage: 0
|
||||
}
|
||||
}
|
||||
} else {
|
||||
node.payload.airdropProgram.count = 0
|
||||
node.payload.airdropProgram.percentage = 0
|
||||
node.payload.airdropProgram.outgoingPower = 0
|
||||
node.payload.airdropProgram.ownPower = 0
|
||||
node.payload.airdropProgram.incomingPower = 0
|
||||
node.payload.airdropProgram.awarded = {
|
||||
tokens: 0,
|
||||
percentage: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function validateProgram(node, userProfile) {
|
||||
/*
|
||||
This program is not going to run unless the Profile has Tokens, and for
|
||||
that users needs to execute the setup procedure of signing their Airdrop
|
||||
username with their private key.
|
||||
*/
|
||||
if (
|
||||
userProfile.payload.blockchainTokens === undefined
|
||||
) {
|
||||
node.payload.airdropProgram.isActive = false
|
||||
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.")
|
||||
return
|
||||
}
|
||||
/*
|
||||
Next thing to do is to validate if the airdrop user profile has a star at the Superalgos repository.
|
||||
*/
|
||||
let profileSignature = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(userProfile.payload, 'signature')
|
||||
if (
|
||||
profileSignature === undefined
|
||||
) {
|
||||
node.payload.airdropProgram.isActive = false
|
||||
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, and produce a signature of your Airdrop Username.")
|
||||
return
|
||||
}
|
||||
|
||||
node.payload.airdropProgram.isActive = true
|
||||
}
|
||||
|
||||
function distributeProgram(programNode) {
|
||||
if (programNode === undefined || programNode.payload === undefined) { return }
|
||||
/*
|
||||
Here we will convert Token Power into Airdrop Power.
|
||||
As per system rules Airdrop Powar = 1000 SA Tokens.
|
||||
*/
|
||||
let programPower = 1000
|
||||
programNode.payload.airdropProgram.ownPower = programPower
|
||||
|
||||
accumulatedProgramPower = accumulatedProgramPower + programPower
|
||||
}
|
||||
|
||||
function calculateProgram(programNode) {
|
||||
/*
|
||||
Here we will calculate which share of the Program Pool this user will get in tokens.
|
||||
To do that, we use the ownPower, to see which proportion of the accumulatedProgramPower
|
||||
represents.
|
||||
*/
|
||||
if (programNode.payload === undefined) { return }
|
||||
/*
|
||||
If the accumulatedProgramPower is not grater the amount of tokens at the Program Pool, then
|
||||
this user will get the exact amount of tokens from the pool as incomingPower he has.
|
||||
|
||||
If the accumulatedProgramPower is grater the amount of tokens at the Program Pool, then
|
||||
the amount ot tokens to be received is a proportional to the share of incomingPower in accumulatedProgramPower.
|
||||
*/
|
||||
let totalPowerRewardRatio = accumulatedProgramPower / programPoolTokenReward
|
||||
if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 }
|
||||
|
||||
if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) {
|
||||
programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.")
|
||||
return
|
||||
}
|
||||
programNode.payload.airdropProgram.awarded.tokens = programNode.payload.airdropProgram.ownPower / totalPowerRewardRatio
|
||||
|
||||
drawProgram(programNode)
|
||||
}
|
||||
|
||||
function drawProgram(node) {
|
||||
if (node.payload !== undefined) {
|
||||
|
||||
const ownPowerText = parseFloat(node.payload.airdropProgram.ownPower.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.statusAngleOffset = 0
|
||||
node.payload.uiObject.statusAtAngle = false
|
||||
|
||||
node.payload.uiObject.setStatus(ownPowerText + ' Airdrop Power')
|
||||
}
|
||||
if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) {
|
||||
|
||||
const tokensAwardedText = parseFloat(node.payload.airdropProgram.awarded.tokens.toFixed(0)).toLocaleString('en')
|
||||
const tokensAwardedBTC = ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(node.payload.airdropProgram.awarded.tokens | 0) + ' BTC'
|
||||
|
||||
node.tokensAwarded.payload.uiObject.valueAngleOffset = 0
|
||||
node.tokensAwarded.payload.uiObject.valueAtAngle = false
|
||||
|
||||
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
|
||||
|
||||
node.tokensAwarded.payload.uiObject.statusAngleOffset = 0
|
||||
node.tokensAwarded.payload.uiObject.statusAtAngle = false
|
||||
|
||||
node.tokensAwarded.payload.uiObject.setStatus('For creating your Superalgos profile!')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ function newGovernanceFunctionLibraryClaimsProgram() {
|
||||
if (
|
||||
node.payload.votingProgram !== undefined &&
|
||||
node.payload.votingProgram.votes !== undefined
|
||||
) {
|
||||
) {
|
||||
node.payload.claimsProgram = {
|
||||
count: 0,
|
||||
votes: 0
|
||||
@@ -440,7 +440,7 @@ function newGovernanceFunctionLibraryClaimsProgram() {
|
||||
|
||||
function drawClaims(node) {
|
||||
let status =
|
||||
parseFloat(node.payload.claimsProgram.awarded.tokens.toFixed(2)).toLocaleString('en') +
|
||||
parseFloat(node.payload.claimsProgram.awarded.tokens.toFixed(0)).toLocaleString('en') +
|
||||
' ' + 'SA Tokens Awarded' + ' - ' +
|
||||
'From Reward: ' + node.payload.claimsProgram.awarded.percentage.toFixed(2) + '%' + ' - ' +
|
||||
'Shared Between: ' + node.payload.claimsProgram.share.count + ' claims' + ' - ' +
|
||||
@@ -452,7 +452,7 @@ function newGovernanceFunctionLibraryClaimsProgram() {
|
||||
function drawProgram(node) {
|
||||
if (node.payload !== undefined) {
|
||||
|
||||
const ownPowerText = parseFloat(node.payload.claimsProgram.ownPower.toFixed(2)).toLocaleString('en')
|
||||
const ownPowerText = parseFloat(node.payload.claimsProgram.ownPower.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.statusAngleOffset = 0
|
||||
node.payload.uiObject.statusAtAngle = false
|
||||
@@ -464,14 +464,15 @@ function newGovernanceFunctionLibraryClaimsProgram() {
|
||||
function drawTokensAwarded(node) {
|
||||
if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) {
|
||||
|
||||
const tokensAwardedText = parseFloat(node.payload.claimsProgram.awarded.tokens.toFixed(2)).toLocaleString('en')
|
||||
const tokensAwardedText = parseFloat(node.payload.claimsProgram.awarded.tokens.toFixed(0)).toLocaleString('en')
|
||||
const tokensAwardedBTC = ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(node.payload.claimsProgram.awarded.tokens | 0) + ' BTC'
|
||||
|
||||
node.tokensAwarded.payload.uiObject.valueAngleOffset = 0
|
||||
node.tokensAwarded.payload.uiObject.valueAtAngle = true
|
||||
node.tokensAwarded.payload.uiObject.statusAngleOffset = 0
|
||||
node.tokensAwarded.payload.uiObject.statusAtAngle = true
|
||||
|
||||
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens')
|
||||
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
|
||||
node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload.claimsProgram.count + ' Claims.')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ function newGovernanceFunctionLibraryDelegationProgram() {
|
||||
let thisObject = {
|
||||
calculate: calculate
|
||||
}
|
||||
const MAX_GENERATIONS = 10
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -45,49 +46,57 @@ function newGovernanceFunctionLibraryDelegationProgram() {
|
||||
)
|
||||
|
||||
function resetProgram(node) {
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.delegationProgram === undefined) {
|
||||
node.payload.delegationProgram = {
|
||||
programPower: 0,
|
||||
ownPower: 0,
|
||||
usedPower: 0
|
||||
resetNode(node, 0)
|
||||
|
||||
function resetNode(node, generation) {
|
||||
|
||||
if (generation >= MAX_GENERATIONS) {
|
||||
return
|
||||
}
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.delegationProgram === undefined) {
|
||||
node.payload.delegationProgram = {
|
||||
programPower: 0,
|
||||
ownPower: 0,
|
||||
usedPower: 0
|
||||
}
|
||||
} else {
|
||||
node.payload.delegationProgram.programPower = 0
|
||||
node.payload.delegationProgram.ownPower = 0
|
||||
node.payload.delegationProgram.usedPower = 0
|
||||
}
|
||||
} else {
|
||||
node.payload.delegationProgram.programPower = 0
|
||||
node.payload.delegationProgram.ownPower = 0
|
||||
node.payload.delegationProgram.usedPower = 0
|
||||
}
|
||||
|
||||
if (node.type === 'User Profile') {
|
||||
return
|
||||
}
|
||||
if (node.payload.referenceParent !== undefined) {
|
||||
resetProgram(node.payload.referenceParent)
|
||||
return
|
||||
}
|
||||
let schemaDocument = getSchemaDocument(node)
|
||||
if (schemaDocument === undefined) { return }
|
||||
if (node.type === 'User Profile') {
|
||||
return
|
||||
}
|
||||
if (node.payload.referenceParent !== undefined) {
|
||||
resetNode(node.payload.referenceParent, generation + 1)
|
||||
return
|
||||
}
|
||||
let schemaDocument = getSchemaDocument(node)
|
||||
if (schemaDocument === undefined) { return }
|
||||
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let property = schemaDocument.childrenNodesProperties[i]
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let property = schemaDocument.childrenNodesProperties[i]
|
||||
|
||||
switch (property.type) {
|
||||
case 'node': {
|
||||
let childNode = node[property.name]
|
||||
resetProgram(childNode)
|
||||
}
|
||||
break
|
||||
case 'array': {
|
||||
let propertyArray = node[property.name]
|
||||
if (propertyArray !== undefined) {
|
||||
for (let m = 0; m < propertyArray.length; m++) {
|
||||
let childNode = propertyArray[m]
|
||||
resetProgram(childNode)
|
||||
switch (property.type) {
|
||||
case 'node': {
|
||||
let childNode = node[property.name]
|
||||
resetNode(childNode, generation)
|
||||
}
|
||||
break
|
||||
case 'array': {
|
||||
let propertyArray = node[property.name]
|
||||
if (propertyArray !== undefined) {
|
||||
for (let m = 0; m < propertyArray.length; m++) {
|
||||
let childNode = propertyArray[m]
|
||||
resetNode(childNode, generation)
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,14 +115,18 @@ function newGovernanceFunctionLibraryDelegationProgram() {
|
||||
The Own Power is the power generated by the same User Profile tokens, not inherited from others.
|
||||
*/
|
||||
programNode.payload.delegationProgram.ownPower = programPower
|
||||
distributeProgramPower(programNode, programNode, programPower)
|
||||
distributeProgramPower(programNode, programNode, programPower, undefined, 0)
|
||||
|
||||
function distributeProgramPower(
|
||||
currentProgramNode,
|
||||
node,
|
||||
programPower,
|
||||
percentage
|
||||
percentage,
|
||||
generation
|
||||
) {
|
||||
if (generation >= MAX_GENERATIONS) {
|
||||
return
|
||||
}
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.delegationProgram === undefined) { return }
|
||||
@@ -138,7 +151,13 @@ function newGovernanceFunctionLibraryDelegationProgram() {
|
||||
node.type === 'User Delegate'
|
||||
) {
|
||||
currentProgramNode.payload.delegationProgram.usedPower = currentProgramNode.payload.delegationProgram.usedPower + programPower
|
||||
distributeProgramPower(currentProgramNode, node.payload.referenceParent, programPower / 10)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
node.payload.referenceParent,
|
||||
programPower / 10,
|
||||
undefined,
|
||||
generation + 1
|
||||
)
|
||||
return
|
||||
}
|
||||
/*
|
||||
@@ -214,7 +233,13 @@ function newGovernanceFunctionLibraryDelegationProgram() {
|
||||
if (percentage === undefined || isNaN(percentage) === true) {
|
||||
percentage = defaultPercentage
|
||||
}
|
||||
distributeProgramPower(currentProgramNode, childNode, programPower * percentage / 100, percentage)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
childNode,
|
||||
programPower * percentage / 100,
|
||||
percentage,
|
||||
generation
|
||||
)
|
||||
}
|
||||
break
|
||||
case 'array': {
|
||||
@@ -228,7 +253,13 @@ function newGovernanceFunctionLibraryDelegationProgram() {
|
||||
if (percentage === undefined || isNaN(percentage) === true) {
|
||||
percentage = defaultPercentage
|
||||
}
|
||||
distributeProgramPower(currentProgramNode, childNode, programPower * percentage / 100, percentage)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
childNode,
|
||||
programPower * percentage / 100,
|
||||
percentage,
|
||||
generation
|
||||
)
|
||||
}
|
||||
}
|
||||
break
|
||||
@@ -262,7 +293,7 @@ function newGovernanceFunctionLibraryDelegationProgram() {
|
||||
node.payload.uiObject.percentageAtAngle = true
|
||||
let powerType = 'Delegate Power'
|
||||
|
||||
const programPowerText = parseFloat(programPower.toFixed(2)).toLocaleString('en') + ' ' + powerType
|
||||
const programPowerText = parseFloat(programPower.toFixed(0)).toLocaleString('en') + ' ' + powerType
|
||||
node.payload.uiObject.setValue(programPowerText)
|
||||
|
||||
if (percentage !== undefined) {
|
||||
@@ -274,7 +305,7 @@ function newGovernanceFunctionLibraryDelegationProgram() {
|
||||
function drawUserNode(node, programPower, percentage) {
|
||||
if (node.payload !== undefined) {
|
||||
|
||||
const outgoingPowerText = parseFloat(programPower.toFixed(2)).toLocaleString('en')
|
||||
const outgoingPowerText = parseFloat(programPower.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.valueAngleOffset = 180
|
||||
node.payload.uiObject.valueAtAngle = true
|
||||
@@ -298,7 +329,7 @@ function newGovernanceFunctionLibraryDelegationProgram() {
|
||||
function drawProgram(node) {
|
||||
if (node.payload !== undefined) {
|
||||
|
||||
const ownPowerText = parseFloat(node.payload.delegationProgram.ownPower.toFixed(2)).toLocaleString('en')
|
||||
const ownPowerText = parseFloat(node.payload.delegationProgram.ownPower.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.statusAngleOffset = 0
|
||||
node.payload.uiObject.statusAtAngle = false
|
||||
|
||||
@@ -75,6 +75,13 @@ function newGovernanceFunctionLibraryDistributionProcess() {
|
||||
userProfiles
|
||||
)
|
||||
/*
|
||||
Run the Influencer Program
|
||||
*/
|
||||
UI.projects.governance.functionLibraries.influencerProgram.calculate(
|
||||
pools,
|
||||
userProfiles
|
||||
)
|
||||
/*
|
||||
Run the Mentorship Program
|
||||
*/
|
||||
UI.projects.governance.functionLibraries.mentorshipProgram.calculate(
|
||||
@@ -98,11 +105,25 @@ function newGovernanceFunctionLibraryDistributionProcess() {
|
||||
userProfiles
|
||||
)
|
||||
/*
|
||||
Run the Github Program
|
||||
*/
|
||||
UI.projects.governance.functionLibraries.githubProgram.calculate(
|
||||
pools,
|
||||
userProfiles
|
||||
)
|
||||
/*
|
||||
Run the Airdrop Program
|
||||
*/
|
||||
UI.projects.governance.functionLibraries.airdropProgram.calculate(
|
||||
pools,
|
||||
userProfiles
|
||||
)
|
||||
/*
|
||||
After all the programs were ran, we can calculate the tokens mining
|
||||
calculation each profile.
|
||||
*/
|
||||
UI.projects.governance.functionLibraries.tokenMining.calculate(
|
||||
userProfiles
|
||||
)
|
||||
userProfiles
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
function newGovernanceFunctionLibraryGithubProgram() {
|
||||
let thisObject = {
|
||||
calculate: calculate
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function calculate(
|
||||
pools,
|
||||
userProfiles
|
||||
) {
|
||||
let programPoolTokenReward
|
||||
/*
|
||||
In order to be able to calculate the share of the Program Pool for each User Profile,
|
||||
we need to accumulate all the Github Power that each User Profile at their Program
|
||||
node has, because with that Power is that each Program node gets a share of the pool.
|
||||
*/
|
||||
let accumulatedProgramPower = 0
|
||||
|
||||
/* Scan Pools Until finding the Mentoship-Program Pool */
|
||||
for (let i = 0; i < pools.length; i++) {
|
||||
let poolsNode = pools[i]
|
||||
programPoolTokenReward = UI.projects.governance.utilities.pools.findPool(poolsNode, "Github-Rewards")
|
||||
}
|
||||
if (programPoolTokenReward === undefined || programPoolTokenReward === 0) { return }
|
||||
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Github Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
|
||||
resetProgram(program)
|
||||
}
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Github Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
|
||||
validateProgram(program, userProfile)
|
||||
}
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Github Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload.githubProgram.isActive === false) { continue }
|
||||
|
||||
distributeProgram(program)
|
||||
}
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Github Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload.githubProgram.isActive === false) { continue }
|
||||
|
||||
calculateProgram(program)
|
||||
}
|
||||
|
||||
function resetProgram(node) {
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.githubProgram === undefined) {
|
||||
node.payload.githubProgram = {
|
||||
count: 0,
|
||||
percentage: 0,
|
||||
outgoingPower: 0,
|
||||
ownPower: 0,
|
||||
incomingPower: 0,
|
||||
awarded: {
|
||||
tokens: 0,
|
||||
percentage: 0
|
||||
}
|
||||
}
|
||||
} else {
|
||||
node.payload.githubProgram.count = 0
|
||||
node.payload.githubProgram.percentage = 0
|
||||
node.payload.githubProgram.outgoingPower = 0
|
||||
node.payload.githubProgram.ownPower = 0
|
||||
node.payload.githubProgram.incomingPower = 0
|
||||
node.payload.githubProgram.awarded = {
|
||||
tokens: 0,
|
||||
percentage: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function validateProgram(node, userProfile) {
|
||||
/*
|
||||
This program is not going to run unless the Profile has Tokens, and for
|
||||
that users needs to execute the setup procedure of signing their Github
|
||||
username with their private key.
|
||||
*/
|
||||
if (
|
||||
userProfile.payload.blockchainTokens === undefined
|
||||
) {
|
||||
node.payload.githubProgram.isActive = false
|
||||
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.")
|
||||
return
|
||||
}
|
||||
/*
|
||||
Next thing to do is to validate if the github user profile has a star at the Superalgos repository.
|
||||
*/
|
||||
let profileSignature = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(userProfile.payload, 'signature')
|
||||
if (
|
||||
profileSignature === undefined
|
||||
) {
|
||||
node.payload.githubProgram.isActive = false
|
||||
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, and produce a signature of your Github Username.")
|
||||
return
|
||||
}
|
||||
let githubUsername = profileSignature.message
|
||||
node.payload.githubProgram.starsCount = UI.projects.governance.spaces.userProfileSpace.githubStars.get(githubUsername)
|
||||
node.payload.githubProgram.watchersCount = UI.projects.governance.spaces.userProfileSpace.githubWatchers.get(githubUsername)
|
||||
node.payload.githubProgram.forksCount = UI.projects.governance.spaces.userProfileSpace.githubForks.get(githubUsername)
|
||||
node.payload.githubProgram.engagement = 0
|
||||
|
||||
if (node.payload.githubProgram.starsCount > 0) { node.payload.githubProgram.engagement = node.payload.githubProgram.engagement + node.payload.githubProgram.starsCount }
|
||||
if (node.payload.githubProgram.watchersCount > 0) { node.payload.githubProgram.engagement = node.payload.githubProgram.engagement + node.payload.githubProgram.watchersCount }
|
||||
if (node.payload.githubProgram.forksCount > 0) { node.payload.githubProgram.engagement = node.payload.githubProgram.engagement + node.payload.githubProgram.forksCount }
|
||||
|
||||
if (
|
||||
node.payload.githubProgram.engagement > 0) {
|
||||
node.payload.githubProgram.isActive = true
|
||||
} else {
|
||||
node.payload.githubProgram.isActive = false
|
||||
}
|
||||
}
|
||||
|
||||
function distributeProgram(programNode) {
|
||||
if (programNode === undefined || programNode.payload === undefined) { return }
|
||||
/*
|
||||
Here we will convert Token Power into Github Power.
|
||||
As per system rules Github Powar = 1200 SA Tokens.
|
||||
*/
|
||||
let programPower = 3000
|
||||
programNode.payload.githubProgram.ownPower = programPower
|
||||
|
||||
accumulatedProgramPower = accumulatedProgramPower + programPower
|
||||
}
|
||||
|
||||
function calculateProgram(programNode) {
|
||||
/*
|
||||
Here we will calculate which share of the Program Pool this user will get in tokens.
|
||||
To do that, we use the ownPower, to see which proportion of the accumulatedProgramPower
|
||||
represents.
|
||||
*/
|
||||
if (programNode.payload === undefined) { return }
|
||||
/*
|
||||
If the accumulatedProgramPower is not grater the amount of tokens at the Program Pool, then
|
||||
this user will get the exact amount of tokens from the pool as incomingPower he has.
|
||||
|
||||
If the accumulatedProgramPower is grater the amount of tokens at the Program Pool, then
|
||||
the amount ot tokens to be received is a proportional to the share of incomingPower in accumulatedProgramPower.
|
||||
*/
|
||||
let totalPowerRewardRatio = accumulatedProgramPower / programPoolTokenReward
|
||||
if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 }
|
||||
|
||||
if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) {
|
||||
programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.")
|
||||
return
|
||||
}
|
||||
const MAX_ENGAGEMENT = 3
|
||||
programNode.payload.githubProgram.awarded.tokens = programNode.payload.githubProgram.ownPower / totalPowerRewardRatio * programNode.payload.githubProgram.engagement / MAX_ENGAGEMENT
|
||||
|
||||
drawProgram(programNode)
|
||||
}
|
||||
|
||||
function drawProgram(node) {
|
||||
if (node.payload !== undefined) {
|
||||
|
||||
const ownPowerText = parseFloat(node.payload.githubProgram.ownPower.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.statusAngleOffset = 0
|
||||
node.payload.uiObject.statusAtAngle = false
|
||||
|
||||
node.payload.uiObject.setStatus(ownPowerText + ' Github Power')
|
||||
}
|
||||
if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) {
|
||||
|
||||
const tokensAwardedText = parseFloat(node.payload.githubProgram.awarded.tokens.toFixed(0)).toLocaleString('en')
|
||||
const tokensAwardedBTC = ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(node.payload.githubProgram.awarded.tokens | 0) + ' BTC'
|
||||
|
||||
node.tokensAwarded.payload.uiObject.valueAngleOffset = 0
|
||||
node.tokensAwarded.payload.uiObject.valueAtAngle = false
|
||||
|
||||
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
|
||||
|
||||
node.tokensAwarded.payload.uiObject.statusAngleOffset = 0
|
||||
node.tokensAwarded.payload.uiObject.statusAtAngle = false
|
||||
|
||||
let extraText = ''
|
||||
if (node.payload.githubProgram.starsCount > 0) {
|
||||
extraText = extraText + ' + 1 Star'
|
||||
}
|
||||
if (node.payload.githubProgram.watchersCount > 0) {
|
||||
extraText = extraText + ' + 1 Watch'
|
||||
}
|
||||
if (node.payload.githubProgram.forksCount > 0) {
|
||||
extraText = extraText + ' + 1 Fork'
|
||||
}
|
||||
|
||||
node.tokensAwarded.payload.uiObject.setStatus('From' + extraText)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
function newGovernanceFunctionLibraryInfluencerProgram() {
|
||||
let thisObject = {
|
||||
calculate: calculate
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function calculate(
|
||||
pools,
|
||||
userProfiles
|
||||
) {
|
||||
UI.projects.governance.utilities.decendentProgram.run(
|
||||
pools,
|
||||
userProfiles,
|
||||
"influencerProgram",
|
||||
"Influencer-Rewards",
|
||||
"Influencer Program",
|
||||
"Influencer Power",
|
||||
"userInfluencerers",
|
||||
"User Influencerer"
|
||||
)
|
||||
|
||||
UI.projects.governance.utilities.bonusProgram.run(
|
||||
pools,
|
||||
userProfiles,
|
||||
"influencerProgram",
|
||||
"Influencer-Bonus",
|
||||
"Influencer Program"
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ function newGovernanceFunctionLibraryStakingProgram() {
|
||||
programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.")
|
||||
return
|
||||
}
|
||||
programNode.payload.stakingProgram.awarded.tokens = programNode.payload.stakingProgram.ownPower * totalPowerRewardRatio
|
||||
programNode.payload.stakingProgram.awarded.tokens = programNode.payload.stakingProgram.ownPower / totalPowerRewardRatio
|
||||
|
||||
drawProgram(programNode)
|
||||
}
|
||||
@@ -152,7 +152,7 @@ function newGovernanceFunctionLibraryStakingProgram() {
|
||||
function drawProgram(node) {
|
||||
if (node.payload !== undefined) {
|
||||
|
||||
const ownPowerText = parseFloat(node.payload.stakingProgram.ownPower.toFixed(2)).toLocaleString('en')
|
||||
const ownPowerText = parseFloat(node.payload.stakingProgram.ownPower.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.statusAngleOffset = 0
|
||||
node.payload.uiObject.statusAtAngle = false
|
||||
@@ -161,12 +161,13 @@ function newGovernanceFunctionLibraryStakingProgram() {
|
||||
}
|
||||
if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) {
|
||||
|
||||
const tokensAwardedText = parseFloat(node.payload.stakingProgram.awarded.tokens.toFixed(2)).toLocaleString('en')
|
||||
const tokensAwardedText = parseFloat(node.payload.stakingProgram.awarded.tokens.toFixed(0)).toLocaleString('en')
|
||||
const tokensAwardedBTC = ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(node.payload.stakingProgram.awarded.tokens | 0) + ' BTC'
|
||||
|
||||
node.tokensAwarded.payload.uiObject.valueAngleOffset = 0
|
||||
node.tokensAwarded.payload.uiObject.valueAtAngle = false
|
||||
|
||||
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens')
|
||||
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,16 @@ function newGovernanceFunctionLibraryTokenMining() {
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Influencer Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
|
||||
calculateProgram(userProfile, program, "influencerProgram")
|
||||
}
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Claims Program")
|
||||
if (program === undefined) { continue }
|
||||
@@ -83,6 +93,26 @@ function newGovernanceFunctionLibraryTokenMining() {
|
||||
|
||||
calculateProgram(userProfile, program, "delegationProgram")
|
||||
}
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Github Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
|
||||
calculateProgram(userProfile, program, "githubProgram")
|
||||
}
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, "Airdrop Program")
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
|
||||
calculateProgram(userProfile, program, "airdropProgram")
|
||||
}
|
||||
|
||||
for (let i = 0; i < userProfiles.length; i++) {
|
||||
let userProfile = userProfiles[i]
|
||||
@@ -136,15 +166,16 @@ function newGovernanceFunctionLibraryTokenMining() {
|
||||
if (userProfile.payload === undefined) { return }
|
||||
if (userProfile.tokensMined === undefined) { return }
|
||||
|
||||
const awarded = parseFloat(userProfile.tokensMined.payload.tokensMined.awarded.toFixed(2)).toLocaleString('en')
|
||||
const bonus = parseFloat(userProfile.tokensMined.payload.tokensMined.bonus.toFixed(2)).toLocaleString('en')
|
||||
const total = parseFloat(userProfile.tokensMined.payload.tokensMined.total.toFixed(2)).toLocaleString('en')
|
||||
const awarded = parseFloat(userProfile.tokensMined.payload.tokensMined.awarded.toFixed(0)).toLocaleString('en')
|
||||
const bonus = parseFloat(userProfile.tokensMined.payload.tokensMined.bonus.toFixed(0)).toLocaleString('en')
|
||||
const total = parseFloat(userProfile.tokensMined.payload.tokensMined.total.toFixed(0)).toLocaleString('en')
|
||||
const tokensAwardedBTC = ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(userProfile.tokensMined.payload.tokensMined.total | 0) + ' BTC'
|
||||
|
||||
userProfile.tokensMined.payload.uiObject.valueAngleOffset = 0
|
||||
userProfile.tokensMined.payload.uiObject.valueAtAngle = true
|
||||
|
||||
userProfile.tokensMined.payload.uiObject.setStatus(awarded + ' Awarded + ' + bonus + ' Bonus')
|
||||
userProfile.tokensMined.payload.uiObject.setValue(total + ' SA Tokens')
|
||||
userProfile.tokensMined.payload.uiObject.setValue(total + ' SA Tokens' + tokensAwardedBTC)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,10 +46,13 @@ function newGovernanceFunctionLibraryTokenPower() {
|
||||
node.type === 'Referral Program' ||
|
||||
node.type === 'Mentorship Program' ||
|
||||
node.type === 'Support Program' ||
|
||||
node.type === 'Influencer Program' ||
|
||||
node.type === 'Voting Program' ||
|
||||
node.type === 'Claims Program' ||
|
||||
node.type === 'Staking Program' ||
|
||||
node.type === 'Delegation Program'
|
||||
node.type === 'Delegation Program' ||
|
||||
node.type === 'Github Program' ||
|
||||
node.type === 'Airdrop Program'
|
||||
) { return }
|
||||
/*
|
||||
We will reset token power of children.
|
||||
@@ -146,10 +149,13 @@ function newGovernanceFunctionLibraryTokenPower() {
|
||||
node.type === 'Referral Program' ||
|
||||
node.type === 'Mentorship Program' ||
|
||||
node.type === 'Support Program' ||
|
||||
node.type === 'Influencer Program' ||
|
||||
node.type === 'Voting Program' ||
|
||||
node.type === 'Claims Program' ||
|
||||
node.type === 'Staking Program' ||
|
||||
node.type === 'Delegation Program'
|
||||
node.type === 'Delegation Program' ||
|
||||
node.type === 'Github Program' ||
|
||||
node.type === 'Airdrop Program'
|
||||
) { return }
|
||||
/*
|
||||
We will redistribute token power among children.
|
||||
@@ -276,8 +282,8 @@ function newGovernanceFunctionLibraryTokenPower() {
|
||||
if (node.type === 'User Profile') {
|
||||
|
||||
let incomingPower = node.payload.tokenPower - node.payload.blockchainTokens
|
||||
const ownPowerText = parseFloat(node.payload.blockchainTokens.toFixed(2)).toLocaleString('en') + ' ' + 'Blockchain Power'
|
||||
const incomingPowerText = parseFloat(incomingPower.toFixed(2)).toLocaleString('en') + ' ' + 'Incoming Delegated Power'
|
||||
const ownPowerText = parseFloat(node.payload.blockchainTokens.toFixed(0)).toLocaleString('en') + ' ' + 'Blockchain Power'
|
||||
const incomingPowerText = parseFloat(incomingPower.toFixed(0)).toLocaleString('en') + ' ' + 'Incoming Delegated Power'
|
||||
|
||||
node.payload.uiObject.valueAngleOffset = 0
|
||||
node.payload.uiObject.valueAtAngle = false
|
||||
@@ -286,7 +292,7 @@ function newGovernanceFunctionLibraryTokenPower() {
|
||||
return
|
||||
}
|
||||
|
||||
const tokenPowerText = parseFloat(tokenPower.toFixed(2)).toLocaleString('en') + ' ' + 'Token Power'
|
||||
const tokenPowerText = parseFloat(tokenPower.toFixed(0)).toLocaleString('en') + ' ' + 'Token Power'
|
||||
|
||||
node.payload.uiObject.valueAngleOffset = 180
|
||||
node.payload.uiObject.valueAtAngle = true
|
||||
|
||||
@@ -164,17 +164,23 @@ function newGovernanceFunctionLibraryTokens() {
|
||||
}
|
||||
|
||||
function drawTokenFlow(node, tokens, weight) {
|
||||
if (tokens.toFixed === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
tokens = tokens | 0
|
||||
let status
|
||||
if (weight !== undefined && weight !== 0) {
|
||||
status = parseFloat(tokens.toFixed(2)).toLocaleString('en')
|
||||
+ ' ' + 'SA Tokens Reward' + ' - ' + 'Weight: ' + (weight * 100).toFixed(2) + " %"
|
||||
status = 'Reward: ' + tokens.toLocaleString('en')
|
||||
+ ' ' + 'SA' + ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(tokens | 0) + ' BTC ' + ' + Weight: ' + (weight * 100).toFixed(2) + " %"
|
||||
node.payload.uiObject.statusAngleOffset = 0
|
||||
node.payload.uiObject.statusAtAngle = true
|
||||
|
||||
node.payload.uiObject.setStatus(status)
|
||||
} else {
|
||||
status = parseFloat(tokens.toFixed(2)).toLocaleString('en')
|
||||
+ ' ' + 'SA Tokens Reward'
|
||||
}
|
||||
status = 'Reward: ' + tokens.toLocaleString('en')
|
||||
+ ' ' + 'SA' + ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(tokens | 0) + ' BTC '
|
||||
|
||||
node.payload.uiObject.statusAngleOffset = 0
|
||||
node.payload.uiObject.statusAtAngle = false
|
||||
|
||||
if (node.payload !== undefined) {
|
||||
node.payload.uiObject.setStatus(status)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
calculate: calculate,
|
||||
installMissingVotes: installMissingVotes
|
||||
}
|
||||
const MAX_GENERATIONS = 10
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -71,100 +72,109 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
)
|
||||
|
||||
function resetVotes(node) {
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.votingProgram === undefined) {
|
||||
node.payload.votingProgram = {
|
||||
votes: 0,
|
||||
ownPower: 0,
|
||||
incomingPower: 0,
|
||||
usedPower: 0
|
||||
}
|
||||
} else {
|
||||
node.payload.votingProgram.votes = 0
|
||||
node.payload.votingProgram.ownPower = 0
|
||||
node.payload.votingProgram.incomingPower = 0
|
||||
node.payload.votingProgram.usedPower = 0
|
||||
resetNode(node, 0)
|
||||
|
||||
}
|
||||
function resetNode(node, generation) {
|
||||
|
||||
/*
|
||||
When we reach certain node types, we will halt the distribution, because these are targets for
|
||||
voting power.
|
||||
*/
|
||||
if (
|
||||
node.type === 'Position' ||
|
||||
node.type === 'Asset' ||
|
||||
node.type === 'Feature' ||
|
||||
node.type === 'Pool' ||
|
||||
node.type === 'Position Contribution Claim' ||
|
||||
node.type === 'Asset Contribution Claim' ||
|
||||
node.type === 'Feature Contribution Claim'
|
||||
) { return }
|
||||
/*
|
||||
For Votes to Profiles there is a special treamtment that needs to be done
|
||||
so that votes can flow from Profiles to the Program without being affected
|
||||
by Percentages.
|
||||
*/
|
||||
switch (node.type) {
|
||||
case 'User Profile Vote': {
|
||||
if (node.payload.referenceParent !== undefined) {
|
||||
resetVotes(node.payload.referenceParent)
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'User Profile': {
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(node, 'Voting Program')
|
||||
if (program === undefined) { return }
|
||||
if (program.payload === undefined) { return }
|
||||
resetVotes(program)
|
||||
if (generation >= MAX_GENERATIONS) {
|
||||
return
|
||||
}
|
||||
}
|
||||
/*
|
||||
If there is a reference parent defined, this means that the voting power is
|
||||
transfered to it and not distributed among children.
|
||||
*/
|
||||
if (
|
||||
node.payload.referenceParent !== undefined &&
|
||||
node.type !== 'Votes Switch' &&
|
||||
node.type !== 'Claim Votes Switch' &&
|
||||
node.type !== 'Weight Votes Switch'
|
||||
) {
|
||||
resetVotes(node.payload.referenceParent)
|
||||
return
|
||||
}
|
||||
/*
|
||||
Here we are inside the Voting Program, so we will crawl all it's children.
|
||||
*/
|
||||
let schemaDocument = getSchemaDocument(node)
|
||||
if (schemaDocument === undefined) { return }
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.votingProgram === undefined) {
|
||||
node.payload.votingProgram = {
|
||||
votes: 0,
|
||||
ownPower: 0,
|
||||
incomingPower: 0,
|
||||
usedPower: 0
|
||||
}
|
||||
} else {
|
||||
node.payload.votingProgram.votes = 0
|
||||
node.payload.votingProgram.ownPower = 0
|
||||
node.payload.votingProgram.incomingPower = 0
|
||||
node.payload.votingProgram.usedPower = 0
|
||||
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let property = schemaDocument.childrenNodesProperties[i]
|
||||
|
||||
if (node.type === 'User Profile' && property.name !== "votingProgram") { continue }
|
||||
|
||||
switch (property.type) {
|
||||
case 'node': {
|
||||
let childNode = node[property.name]
|
||||
if (childNode === undefined) { continue }
|
||||
if (childNode.type === 'Tokens Bonus') { continue }
|
||||
resetVotes(childNode)
|
||||
}
|
||||
|
||||
/*
|
||||
When we reach certain node types, we will halt the distribution, because these are targets for
|
||||
voting power.
|
||||
*/
|
||||
if (
|
||||
node.type === 'Position' ||
|
||||
node.type === 'Asset' ||
|
||||
node.type === 'Feature' ||
|
||||
node.type === 'Pool' ||
|
||||
node.type === 'Position Contribution Claim' ||
|
||||
node.type === 'Asset Contribution Claim' ||
|
||||
node.type === 'Feature Contribution Claim'
|
||||
) { return }
|
||||
/*
|
||||
For Votes to Profiles there is a special treamtment that needs to be done
|
||||
so that votes can flow from Profiles to the Program without being affected
|
||||
by Percentages.
|
||||
*/
|
||||
switch (node.type) {
|
||||
case 'User Profile Vote': {
|
||||
if (node.payload.referenceParent !== undefined) {
|
||||
resetNode(node.payload.referenceParent, generation + 1)
|
||||
return
|
||||
}
|
||||
break
|
||||
case 'array': {
|
||||
let propertyArray = node[property.name]
|
||||
if (propertyArray !== undefined) {
|
||||
for (let m = 0; m < propertyArray.length; m++) {
|
||||
let childNode = propertyArray[m]
|
||||
if (childNode.type === 'Tokens Bonus') { continue }
|
||||
resetVotes(childNode)
|
||||
break
|
||||
}
|
||||
case 'User Profile': {
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(node, 'Voting Program')
|
||||
if (program === undefined) { return }
|
||||
if (program.payload === undefined) { return }
|
||||
resetNode(program, generation)
|
||||
return
|
||||
}
|
||||
}
|
||||
/*
|
||||
If there is a reference parent defined, this means that the voting power is
|
||||
transfered to it and not distributed among children.
|
||||
*/
|
||||
if (
|
||||
node.payload.referenceParent !== undefined &&
|
||||
node.type !== 'Votes Switch' &&
|
||||
node.type !== 'Claim Votes Switch' &&
|
||||
node.type !== 'Weight Votes Switch'
|
||||
) {
|
||||
resetNode(node.payload.referenceParent, generation)
|
||||
return
|
||||
}
|
||||
/*
|
||||
Here we are inside the Voting Program, so we will crawl all it's children.
|
||||
*/
|
||||
let schemaDocument = getSchemaDocument(node)
|
||||
if (schemaDocument === undefined) { return }
|
||||
|
||||
if (schemaDocument.childrenNodesProperties !== undefined) {
|
||||
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
|
||||
let property = schemaDocument.childrenNodesProperties[i]
|
||||
|
||||
if (node.type === 'User Profile' && property.name !== "votingProgram") { continue }
|
||||
|
||||
switch (property.type) {
|
||||
case 'node': {
|
||||
let childNode = node[property.name]
|
||||
if (childNode === undefined) { continue }
|
||||
if (childNode.type === 'Tokens Bonus') { continue }
|
||||
resetNode(childNode, generation)
|
||||
|
||||
}
|
||||
break
|
||||
case 'array': {
|
||||
let propertyArray = node[property.name]
|
||||
if (propertyArray !== undefined) {
|
||||
for (let m = 0; m < propertyArray.length; m++) {
|
||||
let childNode = propertyArray[m]
|
||||
if (childNode.type === 'Tokens Bonus') { continue }
|
||||
resetNode(childNode, generation)
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,14 +191,18 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
Set this initial votes as own power
|
||||
*/
|
||||
programNode.payload.votingProgram.ownPower = votes
|
||||
distributeProgramPower(programNode, programNode, votes)
|
||||
distributeProgramPower(programNode, programNode, votes, undefined, 0)
|
||||
|
||||
function distributeProgramPower(
|
||||
currentProgramNode,
|
||||
node,
|
||||
votes,
|
||||
percentage
|
||||
percentage,
|
||||
generation
|
||||
) {
|
||||
if (generation >= MAX_GENERATIONS) {
|
||||
return
|
||||
}
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload.votingProgram === undefined) { return }
|
||||
@@ -221,7 +235,13 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
case 'User Profile Vote': {
|
||||
if (node.payload.referenceParent !== undefined) {
|
||||
currentProgramNode.payload.votingProgram.usedPower = currentProgramNode.payload.votingProgram.usedPower + votes
|
||||
distributeProgramPower(currentProgramNode, node.payload.referenceParent, votes / 10)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
node.payload.referenceParent,
|
||||
votes / 10,
|
||||
undefined,
|
||||
generation + 1
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -229,7 +249,13 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(node, 'Voting Program')
|
||||
if (program === undefined) { return }
|
||||
if (program.payload === undefined) { return }
|
||||
distributeProgramPower(currentProgramNode, program, votes)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
program,
|
||||
votes,
|
||||
undefined,
|
||||
generation
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -244,7 +270,13 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
node.type !== 'Weight Votes Switch'
|
||||
) {
|
||||
currentProgramNode.payload.votingProgram.usedPower = currentProgramNode.payload.votingProgram.usedPower + votes
|
||||
distributeProgramPower(currentProgramNode, node.payload.referenceParent, votes)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
node.payload.referenceParent,
|
||||
votes,
|
||||
undefined,
|
||||
generation
|
||||
)
|
||||
return
|
||||
}
|
||||
/*
|
||||
@@ -320,7 +352,13 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
if (percentage === undefined || isNaN(percentage) === true) {
|
||||
percentage = defaultPercentage
|
||||
}
|
||||
distributeProgramPower(currentProgramNode, childNode, votes * percentage / 100, percentage)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
childNode,
|
||||
votes * percentage / 100,
|
||||
percentage,
|
||||
generation
|
||||
)
|
||||
}
|
||||
break
|
||||
case 'array': {
|
||||
@@ -334,7 +372,13 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
if (percentage === undefined || isNaN(percentage) === true) {
|
||||
percentage = defaultPercentage
|
||||
}
|
||||
distributeProgramPower(currentProgramNode, childNode, votes * percentage / 100, percentage)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
childNode,
|
||||
votes * percentage / 100,
|
||||
percentage,
|
||||
generation
|
||||
)
|
||||
}
|
||||
}
|
||||
break
|
||||
@@ -402,7 +446,11 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
voteType = 'Claim Support Power'
|
||||
}
|
||||
|
||||
const votesText = parseFloat(votes.toFixed(2)).toLocaleString('en') + ' ' + voteType
|
||||
const votesText = parseFloat(votes.toFixed(0)).toLocaleString('en') + ' ' + voteType
|
||||
|
||||
node.payload.uiObject.valueAngleOffset = 0
|
||||
node.payload.uiObject.valueAtAngle = true
|
||||
|
||||
node.payload.uiObject.setValue(votesText)
|
||||
|
||||
if (percentage !== undefined) {
|
||||
@@ -413,7 +461,7 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
function drawUserNode(node, votes, percentage) {
|
||||
if (node.payload !== undefined) {
|
||||
|
||||
const outgoingPowerText = parseFloat(votes.toFixed(2)).toLocaleString('en')
|
||||
const outgoingPowerText = parseFloat(votes.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.valueAngleOffset = 180
|
||||
node.payload.uiObject.valueAtAngle = true
|
||||
@@ -440,8 +488,8 @@ function newGovernanceFunctionLibraryVotingProgram() {
|
||||
if (node.payload.votingProgram.ownPower === undefined) { return }
|
||||
if (node.payload.votingProgram.incomingPower === undefined) { return }
|
||||
|
||||
const ownPowerText = parseFloat(node.payload.votingProgram.ownPower.toFixed(2)).toLocaleString('en')
|
||||
const incomingPowerText = parseFloat(node.payload.votingProgram.incomingPower.toFixed(2)).toLocaleString('en')
|
||||
const ownPowerText = parseFloat(node.payload.votingProgram.ownPower.toFixed(0)).toLocaleString('en')
|
||||
const incomingPowerText = parseFloat(node.payload.votingProgram.incomingPower.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.statusAngleOffset = 0
|
||||
node.payload.uiObject.statusAtAngle = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function newGovernanceGlobalsReports() {
|
||||
let thisObject = {
|
||||
REPORTS_SPACE_WIDTH: 1150
|
||||
REPORTS_SPACE_WIDTH: 1550
|
||||
}
|
||||
return thisObject
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
function newGovernanceReportsAirdrop() {
|
||||
let thisObject = {
|
||||
addHTML: addHTML,
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function initialize() {
|
||||
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
|
||||
}
|
||||
|
||||
function addHTML(tabIndex, filters) {
|
||||
/*
|
||||
Parameters
|
||||
*/
|
||||
let table = 'airdrop'
|
||||
let programName = 'Airdrop Program'
|
||||
let programPropertyName = 'airdropProgram'
|
||||
/*
|
||||
Setup Filters
|
||||
*/
|
||||
let filtersObject
|
||||
if (filters !== undefined) {
|
||||
try {
|
||||
filtersObject = JSON.parse(filters)
|
||||
} catch (err) { }
|
||||
}
|
||||
/*
|
||||
Other Variables
|
||||
*/
|
||||
let tableRecords = []
|
||||
let tableRecordDefinition = {
|
||||
"properties": [
|
||||
{
|
||||
"name": "name",
|
||||
"label": "User Profile",
|
||||
"type": "string",
|
||||
"order": "ascending",
|
||||
"textAlign": "left"
|
||||
},
|
||||
{
|
||||
"name": "airdropPower",
|
||||
"label": "Airdrop Power",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "2 decimals"
|
||||
},
|
||||
{
|
||||
"name": "tokensAwarded",
|
||||
"label": "Awarded",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "2 decimals"
|
||||
}
|
||||
]
|
||||
}
|
||||
/*
|
||||
Here we get from the workspace all User Profiles.
|
||||
*/
|
||||
let userProfiles = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile')
|
||||
/*
|
||||
Transform the result array into table records.
|
||||
*/
|
||||
for (let j = 0; j < userProfiles.length; j++) {
|
||||
let userProfile = userProfiles[j]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, programName)
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload[programPropertyName] === undefined) { continue }
|
||||
|
||||
let tableRecord = {
|
||||
"name": userProfile.name,
|
||||
"airdropPower": program.payload[programPropertyName].ownPower | 0,
|
||||
"tokensAwarded": program.payload[programPropertyName].awarded.tokens | 0
|
||||
}
|
||||
|
||||
if (UI.projects.governance.utilities.filters.applyFilters(filters, filtersObject, tableRecord) === true) {
|
||||
tableRecords.push(tableRecord)
|
||||
}
|
||||
}
|
||||
/*
|
||||
Get the sorting order for this table.
|
||||
*/
|
||||
let sortingOrder = UI.projects.governance.spaces.reportsSpace.tablesSortingOrders[table]
|
||||
/*
|
||||
Set the default sorting order for this table.
|
||||
*/
|
||||
if (sortingOrder === undefined) {
|
||||
UI.projects.governance.spaces.reportsSpace.tablesSortingOrders[table] = {
|
||||
property: 'tokensAwarded',
|
||||
order: 'descending'
|
||||
}
|
||||
sortingOrder = UI.projects.governance.spaces.reportsSpace.tablesSortingOrders[table]
|
||||
}
|
||||
return UI.projects.governance.utilities.tables.addHTML(
|
||||
table,
|
||||
tableRecords,
|
||||
tableRecordDefinition,
|
||||
sortingOrder,
|
||||
tabIndex
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -76,6 +76,7 @@ function newGovernanceReportsClaims() {
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, programName)
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload[programPropertyName] === undefined) { continue }
|
||||
|
||||
let tableRecord = {
|
||||
"name": userProfile.name,
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
function newGovernanceReportsCommmandInterface() {
|
||||
let thisObject = {
|
||||
command: undefined,
|
||||
detectCommands: detectCommands,
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function initialize() {
|
||||
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
|
||||
}
|
||||
|
||||
function detectCommands() {
|
||||
if (detectGovCommands() === true) { return }
|
||||
|
||||
/* If we can not detect any gov or docs commands, then we assume the users is typing a filter */
|
||||
}
|
||||
|
||||
function detectGovCommands() {
|
||||
if (checkPRsCommand() === undefined) { return true }
|
||||
if (checkPayCommand() === undefined) { return true }
|
||||
|
||||
function checkPRsCommand() {
|
||||
if (UI.projects.governance.spaces.reportsSpace.commandInterface.command.toLowerCase() === 'gov.help gov.prs') {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov PRs Command')
|
||||
return
|
||||
}
|
||||
if (UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf('Gov.PRs') !== 0 && UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf('gov.prs') !== 0) { return 'Not PRs Commands' }
|
||||
|
||||
/* Set up the commit message */
|
||||
let message = UI.projects.governance.spaces.reportsSpace.commandInterface.command.trim().substring(UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf(' ') + 1, UI.projects.governance.spaces.reportsSpace.commandInterface.command.length)
|
||||
if (message.toLowerCase() === 'gov.prs') {
|
||||
message = 'Automated PR merging process.'
|
||||
}
|
||||
|
||||
/* Find the Username and Password */
|
||||
let apisNode = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadByNodeType('APIs')
|
||||
if (apisNode === undefined) {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Error - Github Credentials Missing', 'Anchor Github Credentials Missing')
|
||||
return
|
||||
}
|
||||
if (apisNode.githubAPI === undefined) {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Error - Github Credentials Missing', 'Anchor Github Credentials Missing')
|
||||
return
|
||||
}
|
||||
|
||||
let config = JSON.parse(apisNode.githubAPI.config)
|
||||
if (config.username === undefined || config.username === "") {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Error - Github Credentials Missing', 'Anchor Github Credentials Missing')
|
||||
return
|
||||
}
|
||||
if (config.token === undefined || config.token === "") {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Error - Github Credentials Missing', 'Anchor Github Credentials Missing')
|
||||
return
|
||||
}
|
||||
|
||||
message = message.replaceAll('#', '_HASHTAG_')
|
||||
message = message.replaceAll('/', '_SLASH_')
|
||||
|
||||
httpRequest(
|
||||
undefined,
|
||||
'Gov/PRs/' +
|
||||
message + '/' +
|
||||
config.username + '/' +
|
||||
config.token + '/' +
|
||||
UI.projects.education.spaces.docsSpace.currentBranch + '/' +
|
||||
UI.projects.education.spaces.docsSpace.contributionsBranch
|
||||
, onResponse)
|
||||
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Processing Pull Requests')
|
||||
|
||||
return
|
||||
|
||||
function onResponse(err, data) {
|
||||
/* Lets check the result of the call through the http interface */
|
||||
data = JSON.parse(data)
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Pull Requests Processed')
|
||||
} else {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo(
|
||||
data.docs.project,
|
||||
data.docs.category,
|
||||
data.docs.type,
|
||||
data.docs.anchor,
|
||||
undefined,
|
||||
data.docs.placeholder
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkPayCommand() {
|
||||
if (UI.projects.governance.spaces.reportsSpace.commandInterface.command.toLowerCase() === 'gov.help gov.pay') {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Pay Command')
|
||||
return
|
||||
}
|
||||
if (UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf('Gov.Pay') !== 0 && UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf('gov.pay') !== 0) { return 'Not Pay Commands' }
|
||||
|
||||
httpRequest(undefined, 'Gov/Pay/' + UI.projects.education.spaces.docsSpace.currentBranch, onResponse)
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Paying to Contributors')
|
||||
|
||||
return
|
||||
|
||||
function onResponse(err, data) {
|
||||
/* Lets check the result of the call through the http interface */
|
||||
data = JSON.parse(data)
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.CUSTOM_OK_RESPONSE.result) {
|
||||
if (data.message.summary.changes + data.message.summary.deletions + data.message.summary.insertions > 0) {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Pay Done')
|
||||
} else {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Pay Failed')
|
||||
}
|
||||
} else {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo(
|
||||
data.docs.project,
|
||||
data.docs.category,
|
||||
data.docs.type,
|
||||
data.docs.anchor,
|
||||
undefined,
|
||||
data.docs.placeholder
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,6 +76,7 @@ function newGovernanceReportsDelegation() {
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, programName)
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload[programPropertyName] === undefined) { continue }
|
||||
|
||||
let tableRecord = {
|
||||
"name": userProfile.name,
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
function newGovernanceReportsGithub() {
|
||||
let thisObject = {
|
||||
addHTML: addHTML,
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function initialize() {
|
||||
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
|
||||
}
|
||||
|
||||
function addHTML(tabIndex, filters) {
|
||||
/*
|
||||
Parameters
|
||||
*/
|
||||
let table = 'github'
|
||||
let programName = 'Github Program'
|
||||
let programPropertyName = 'githubProgram'
|
||||
/*
|
||||
Setup Filters
|
||||
*/
|
||||
let filtersObject
|
||||
if (filters !== undefined) {
|
||||
try {
|
||||
filtersObject = JSON.parse(filters)
|
||||
} catch (err) { }
|
||||
}
|
||||
/*
|
||||
Other Variables
|
||||
*/
|
||||
let tableRecords = []
|
||||
let tableRecordDefinition = {
|
||||
"properties": [
|
||||
{
|
||||
"name": "name",
|
||||
"label": "User Profile",
|
||||
"type": "string",
|
||||
"order": "ascending",
|
||||
"textAlign": "left"
|
||||
},
|
||||
{
|
||||
"name": "githubPower",
|
||||
"label": "Github Power",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "2 decimals"
|
||||
},
|
||||
{
|
||||
"name": "stars",
|
||||
"label": "Stars",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "integer"
|
||||
},
|
||||
{
|
||||
"name": "watching",
|
||||
"label": "Watching",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "integer"
|
||||
},
|
||||
{
|
||||
"name": "forks",
|
||||
"label": "Forks",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "integer"
|
||||
},
|
||||
{
|
||||
"name": "tokensAwarded",
|
||||
"label": "Awarded",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "2 decimals"
|
||||
}
|
||||
]
|
||||
}
|
||||
/*
|
||||
Here we get from the workspace all User Profiles.
|
||||
*/
|
||||
let userProfiles = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile')
|
||||
/*
|
||||
Transform the result array into table records.
|
||||
*/
|
||||
for (let j = 0; j < userProfiles.length; j++) {
|
||||
let userProfile = userProfiles[j]
|
||||
|
||||
if (userProfile.tokenPowerSwitch === undefined) { continue }
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, programName)
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload[programPropertyName] === undefined) { continue }
|
||||
|
||||
let tableRecord = {
|
||||
"name": userProfile.name,
|
||||
"githubPower": program.payload[programPropertyName].ownPower | 0,
|
||||
"stars": program.payload[programPropertyName].starsCount | 0,
|
||||
"watching": program.payload[programPropertyName].watchersCount | 0,
|
||||
"forks": program.payload[programPropertyName].forksCount | 0,
|
||||
"tokensAwarded": program.payload[programPropertyName].awarded.tokens | 0
|
||||
}
|
||||
|
||||
if (UI.projects.governance.utilities.filters.applyFilters(filters, filtersObject, tableRecord) === true) {
|
||||
tableRecords.push(tableRecord)
|
||||
}
|
||||
}
|
||||
/*
|
||||
Get the sorting order for this table.
|
||||
*/
|
||||
let sortingOrder = UI.projects.governance.spaces.reportsSpace.tablesSortingOrders[table]
|
||||
/*
|
||||
Set the default sorting order for this table.
|
||||
*/
|
||||
if (sortingOrder === undefined) {
|
||||
UI.projects.governance.spaces.reportsSpace.tablesSortingOrders[table] = {
|
||||
property: 'tokensAwarded',
|
||||
order: 'descending'
|
||||
}
|
||||
sortingOrder = UI.projects.governance.spaces.reportsSpace.tablesSortingOrders[table]
|
||||
}
|
||||
return UI.projects.governance.utilities.tables.addHTML(
|
||||
table,
|
||||
tableRecords,
|
||||
tableRecordDefinition,
|
||||
sortingOrder,
|
||||
tabIndex
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
function newGovernanceReportsInfluencers() {
|
||||
let thisObject = {
|
||||
addHTML: addHTML,
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function initialize() {
|
||||
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
|
||||
}
|
||||
|
||||
function addHTML(tabIndex, filters) {
|
||||
return UI.projects.governance.utilities.decendentTables.addHTML(
|
||||
'influencers',
|
||||
'Influencer Program',
|
||||
'influencerProgram',
|
||||
tabIndex,
|
||||
filters
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ function newGovernanceReportsMining() {
|
||||
"label": "Blockchain Account",
|
||||
"type": "string",
|
||||
"order": "ascending",
|
||||
"textAlign": "left"
|
||||
"textAlign": "center"
|
||||
},
|
||||
{
|
||||
"name": "tokensAwarded",
|
||||
@@ -53,7 +53,7 @@ function newGovernanceReportsMining() {
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "2 decimals"
|
||||
"format": "integer"
|
||||
},
|
||||
{
|
||||
"name": "tokensBonus",
|
||||
@@ -61,7 +61,7 @@ function newGovernanceReportsMining() {
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "2 decimals"
|
||||
"format": "integer"
|
||||
},
|
||||
{
|
||||
"name": "tokensMined",
|
||||
@@ -69,7 +69,15 @@ function newGovernanceReportsMining() {
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "2 decimals"
|
||||
"format": "integer"
|
||||
},
|
||||
{
|
||||
"name": "minedInBTC",
|
||||
"label": "Mined In BTC",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -93,7 +101,8 @@ function newGovernanceReportsMining() {
|
||||
"blockchainAccount": userProfile.payload.blockchainAccount,
|
||||
"tokensAwarded": userProfile.tokensMined.payload.tokensMined.awarded | 0,
|
||||
"tokensBonus": userProfile.tokensMined.payload.tokensMined.bonus | 0,
|
||||
"tokensMined": userProfile.tokensMined.payload.tokensMined.total | 0
|
||||
"tokensMined": userProfile.tokensMined.payload.tokensMined.total | 0,
|
||||
"minedInBTC": UI.projects.governance.utilities.conversions.estimateSATokensInBTC(userProfile.tokensMined.payload.tokensMined.total | 0)
|
||||
}
|
||||
|
||||
if (UI.projects.governance.utilities.filters.applyFilters(filters, filtersObject, tableRecord) === true) {
|
||||
|
||||
@@ -30,7 +30,24 @@ function newGovernanceReportsReportsPage() {
|
||||
buildHTML()
|
||||
|
||||
function buildHTML() {
|
||||
const tabs = ['Profiles', 'Referrals', 'Supporters', 'Mentors', 'Claims', 'Votes', 'Staking', 'Delegation', 'Pools', 'Assets', 'Features', 'Positions', 'Mining']
|
||||
const tabs = [
|
||||
'Profiles',
|
||||
'Airdrop',
|
||||
'Github',
|
||||
'Referrals',
|
||||
'Supporters',
|
||||
'Mentors',
|
||||
'Influencers',
|
||||
'Claims',
|
||||
'Votes',
|
||||
'Staking',
|
||||
'Delegation',
|
||||
'Pools',
|
||||
'Assets',
|
||||
'Features',
|
||||
'Positions',
|
||||
'Mining'
|
||||
]
|
||||
let HTML = ''
|
||||
HTML = HTML + '<section id="governance-report-page-div" class="governance-search-page-container">'
|
||||
HTML = HTML + UI.projects.governance.spaces.reportsSpace.filtersHeader.addFilterHeader()
|
||||
@@ -62,74 +79,92 @@ function newGovernanceReportsReportsPage() {
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Airdrop': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.airdrop.addHTML(2, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Github': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.github.addHTML(3, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Referrals': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.referrals.addHTML(2, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.referrals.addHTML(4, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Supporters': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.supports.addHTML(3, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.supports.addHTML(5, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Mentors': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.mentors.addHTML(4, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.mentors.addHTML(6, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Influencers': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.influencers.addHTML(7, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Claims': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.claims.addHTML(5, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.claims.addHTML(8, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Votes': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.votes.addHTML(6, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.votes.addHTML(9, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Staking': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.staking.addHTML(7, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.staking.addHTML(10, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Delegation': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.delegation.addHTML(8, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.delegation.addHTML(11, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Pools': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.pools.addHTML(9, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.pools.addHTML(12, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Assets': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.assets.addHTML(10, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.assets.addHTML(13, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Features': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.features.addHTML(11, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.features.addHTML(14, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Positions': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.positions.addHTML(12, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.positions.addHTML(15, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
}
|
||||
case 'Mining': {
|
||||
let response = UI.projects.governance.spaces.reportsSpace.mining.addHTML(13, filters)
|
||||
let response = UI.projects.governance.spaces.reportsSpace.mining.addHTML(16, filters)
|
||||
HTML = HTML + response.HTML
|
||||
resultCounter = response.resultCounter
|
||||
break
|
||||
|
||||
@@ -11,10 +11,13 @@ function newGobernanceReportsSpace() {
|
||||
referrals: undefined,
|
||||
supports: undefined,
|
||||
mentors: undefined,
|
||||
influencers: undefined,
|
||||
claims: undefined,
|
||||
votes: undefined,
|
||||
staking: undefined,
|
||||
delegations: undefined,
|
||||
github: undefined,
|
||||
airdrop: undefined,
|
||||
pools: undefined,
|
||||
assets: undefined,
|
||||
features: undefined,
|
||||
@@ -73,6 +76,9 @@ function newGobernanceReportsSpace() {
|
||||
thisObject.mentors.finalize()
|
||||
thisObject.mentors = undefined
|
||||
|
||||
thisObject.influencers.finalize()
|
||||
thisObject.influencers = undefined
|
||||
|
||||
thisObject.claims.finalize()
|
||||
thisObject.claims = undefined
|
||||
|
||||
@@ -85,6 +91,12 @@ function newGobernanceReportsSpace() {
|
||||
thisObject.delegation.finalize()
|
||||
thisObject.delegation = undefined
|
||||
|
||||
thisObject.github.finalize()
|
||||
thisObject.github = undefined
|
||||
|
||||
thisObject.airdrop.finalize()
|
||||
thisObject.airdrop = undefined
|
||||
|
||||
thisObject.pools.finalize()
|
||||
thisObject.pools = undefined
|
||||
|
||||
@@ -104,6 +116,9 @@ function newGobernanceReportsSpace() {
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
/*
|
||||
If the workspace is not related to governance, then we exit the Intialize Function
|
||||
*/
|
||||
let resultsArary = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile')
|
||||
if (resultsArary.length === 0) { return }
|
||||
|
||||
@@ -123,11 +138,14 @@ function newGobernanceReportsSpace() {
|
||||
thisObject.userProfiles = newGovernanceReportsUserProfiles()
|
||||
thisObject.referrals = newGovernanceReportsReferrals()
|
||||
thisObject.supports = newGovernanceReportsSupports()
|
||||
thisObject.influencers = newGovernanceReportsInfluencers()
|
||||
thisObject.mentors = newGovernanceReportsMentors()
|
||||
thisObject.claims = newGovernanceReportsClaims()
|
||||
thisObject.votes = newGovernanceReportsVotes()
|
||||
thisObject.staking = newGovernanceReportsStaking()
|
||||
thisObject.delegation = newGovernanceReportsDelegation()
|
||||
thisObject.github = newGovernanceReportsGithub()
|
||||
thisObject.airdrop = newGovernanceReportsAirdrop()
|
||||
thisObject.pools = newGovernanceReportsPools()
|
||||
thisObject.assets = newGovernanceReportsAssets()
|
||||
thisObject.features = newGovernanceReportsFeatures()
|
||||
@@ -139,11 +157,15 @@ function newGobernanceReportsSpace() {
|
||||
thisObject.filtersHeader.initialize()
|
||||
thisObject.userProfiles.initialize()
|
||||
thisObject.referrals.initialize()
|
||||
thisObject.supports.initialize()
|
||||
thisObject.mentors.initialize()
|
||||
thisObject.influencers.initialize()
|
||||
thisObject.claims.initialize()
|
||||
thisObject.votes.initialize()
|
||||
thisObject.staking.initialize()
|
||||
thisObject.delegation.initialize()
|
||||
thisObject.github.initialize()
|
||||
thisObject.airdrop.initialize()
|
||||
thisObject.pools.initialize()
|
||||
thisObject.assets.initialize()
|
||||
thisObject.features.initialize()
|
||||
|
||||
@@ -45,16 +45,8 @@ function newGovernanceReportsStaking() {
|
||||
"textAlign": "left"
|
||||
},
|
||||
{
|
||||
"name": "ownPower",
|
||||
"label": "Own Power",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "2 decimals"
|
||||
},
|
||||
{
|
||||
"name": "incoming",
|
||||
"label": "Incoming",
|
||||
"name": "stakingPower",
|
||||
"label": "Staking Power",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
@@ -84,11 +76,11 @@ function newGovernanceReportsStaking() {
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, programName)
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload[programPropertyName] === undefined) { continue }
|
||||
|
||||
let tableRecord = {
|
||||
"name": userProfile.name,
|
||||
"ownPower": program.payload[programPropertyName].ownPower | 0,
|
||||
"incoming": program.payload[programPropertyName].incomingPower | 0,
|
||||
"stakingPower": program.payload[programPropertyName].ownPower | 0,
|
||||
"tokensAwarded": program.payload[programPropertyName].awarded.tokens | 0
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ function newGovernanceReportsVotes() {
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, programName)
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload[programPropertyName] === undefined) { continue }
|
||||
|
||||
let tableRecord = {
|
||||
"name": userProfile.name,
|
||||
|
||||
@@ -2,6 +2,9 @@ function newGovernanceUserProfileSpace() {
|
||||
const MODULE_NAME = 'User Profile Space'
|
||||
|
||||
let thisObject = {
|
||||
githubStars: undefined,
|
||||
githubWatchers: undefined,
|
||||
githubForks: undefined,
|
||||
container: undefined,
|
||||
physics: physics,
|
||||
draw: draw,
|
||||
@@ -17,13 +20,123 @@ function newGovernanceUserProfileSpace() {
|
||||
let waitingForResponses = 0
|
||||
let timer = 0
|
||||
|
||||
thisObject.githubStars = new Map()
|
||||
thisObject.githubWatchers = new Map()
|
||||
thisObject.githubForks = new Map()
|
||||
|
||||
return thisObject
|
||||
|
||||
function initialize() {
|
||||
/*
|
||||
Here we will get a list of all github usernames who have a star or fork and are watching the
|
||||
Superalgos Repository. This will later be used to know which user profiles are participating
|
||||
at the Github Program.
|
||||
*/
|
||||
|
||||
/*
|
||||
If the workspace is not related to governance, then we exit the Intialize Function
|
||||
*/
|
||||
let resultsArary = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile')
|
||||
if (resultsArary.length === 0) { return }
|
||||
|
||||
/* Find the Username and Password */
|
||||
let apisNode = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadByNodeType('APIs')
|
||||
if (apisNode === undefined) {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'App Error - Github Credentials Missing', 'Anchor Github Credentials Missing')
|
||||
UI.projects.education.spaces.docsSpace.sidePanelTab.open()
|
||||
return
|
||||
}
|
||||
if (apisNode.githubAPI === undefined) {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'App Error - Github Credentials Missing', 'Anchor Github Credentials Missing')
|
||||
UI.projects.education.spaces.docsSpace.sidePanelTab.open()
|
||||
return
|
||||
}
|
||||
|
||||
let config = JSON.parse(apisNode.githubAPI.config)
|
||||
if (config.username === undefined || config.username === "") {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'App Error - Github Credentials Missing', 'Anchor Github Credentials Missing')
|
||||
UI.projects.education.spaces.docsSpace.sidePanelTab.open()
|
||||
return
|
||||
}
|
||||
if (config.token === undefined || config.token === "") {
|
||||
UI.projects.education.spaces.docsSpace.navigateTo('Foundations', 'Topic', 'App Error - Github Credentials Missing', 'Anchor Github Credentials Missing')
|
||||
UI.projects.education.spaces.docsSpace.sidePanelTab.open()
|
||||
return
|
||||
}
|
||||
|
||||
requestStars()
|
||||
|
||||
function requestStars() {
|
||||
httpRequest(
|
||||
undefined,
|
||||
'Gov/getGithubStars/' +
|
||||
'Superalgos' + '/' +
|
||||
config.username + '/' +
|
||||
config.token
|
||||
, onGithubStarsResponse)
|
||||
}
|
||||
|
||||
function requestWatchers() {
|
||||
httpRequest(
|
||||
undefined,
|
||||
'Gov/getGithubWatchers/' +
|
||||
'Superalgos' + '/' +
|
||||
config.username + '/' +
|
||||
config.token
|
||||
, onGithubWatchersResponse)
|
||||
}
|
||||
|
||||
function requestForks() {
|
||||
httpRequest(
|
||||
undefined,
|
||||
'Gov/getGithubForks/' +
|
||||
'Superalgos' + '/' +
|
||||
config.username + '/' +
|
||||
config.token
|
||||
, onGithubForksResponse)
|
||||
}
|
||||
|
||||
function onGithubStarsResponse(err, githubData) {
|
||||
//console.log(githubData)
|
||||
/* Lets check the result of the call through the http interface */
|
||||
let githubStarsArray = JSON.parse(githubData)
|
||||
|
||||
for (let i = 0; i < githubStarsArray.length; i++) {
|
||||
let githubUsername = githubStarsArray[i]
|
||||
thisObject.githubStars.set(githubUsername, 1)
|
||||
}
|
||||
|
||||
requestWatchers()
|
||||
}
|
||||
|
||||
function onGithubWatchersResponse(err, githubData) {
|
||||
//console.log(githubData)
|
||||
/* Lets check the result of the call through the http interface */
|
||||
let githubWatchersArray = JSON.parse(githubData)
|
||||
|
||||
for (let i = 0; i < githubWatchersArray.length; i++) {
|
||||
let githubUsername = githubWatchersArray[i]
|
||||
thisObject.githubWatchers.set(githubUsername, 1)
|
||||
}
|
||||
|
||||
requestForks()
|
||||
}
|
||||
|
||||
function onGithubForksResponse(err, githubData) {
|
||||
//console.log(githubData)
|
||||
/* Lets check the result of the call through the http interface */
|
||||
let githubForksArray = JSON.parse(githubData)
|
||||
|
||||
for (let i = 0; i < githubForksArray.length; i++) {
|
||||
let githubUsername = githubForksArray[i]
|
||||
thisObject.githubForks.set(githubUsername, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
thisObject.githubStars = undefined
|
||||
|
||||
thisObject.container.finalize()
|
||||
thisObject.container = undefined
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ function newGovernanceUtilitiesBonusProgram() {
|
||||
programNode.payload.uiObject.setErrorMessage("Tokens Bonus Node is needed in order for this Program to get Tokens from the Bonus Program Pool.")
|
||||
return
|
||||
}
|
||||
programNode.payload[programPropertyName].bonus.tokens = programNode.payload[programPropertyName].bonusPower * totalPowerRewardRatio
|
||||
programNode.payload[programPropertyName].bonus.tokens = programNode.payload[programPropertyName].bonusPower / totalPowerRewardRatio
|
||||
|
||||
drawProgram(programNode)
|
||||
}
|
||||
@@ -145,12 +145,13 @@ function newGovernanceUtilitiesBonusProgram() {
|
||||
function drawProgram(node) {
|
||||
if (node.tokensBonus !== undefined && node.tokensBonus.payload !== undefined) {
|
||||
|
||||
const tokensBonusText = parseFloat(node.payload[programPropertyName].bonus.tokens.toFixed(2)).toLocaleString('en')
|
||||
const tokensBonusText = parseFloat(node.payload[programPropertyName].bonus.tokens.toFixed(0)).toLocaleString('en')
|
||||
const tokensAwardedBTC = ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(node.payload[programPropertyName].bonus.tokens | 0) + ' BTC'
|
||||
|
||||
node.tokensBonus.payload.uiObject.valueAngleOffset = 0
|
||||
node.tokensBonus.payload.uiObject.valueAtAngle = true
|
||||
|
||||
node.tokensBonus.payload.uiObject.setValue(tokensBonusText + ' SA Tokens')
|
||||
node.tokensBonus.payload.uiObject.setValue(tokensBonusText + ' SA Tokens' + tokensAwardedBTC)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,15 @@ function newGovernanceUtilitiesCommonTables() {
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "2 decimals"
|
||||
"format": "integer"
|
||||
},
|
||||
{
|
||||
"name": "rewardInBTC",
|
||||
"label": "Reward In BTC",
|
||||
"type": "number",
|
||||
"order": "descending",
|
||||
"textAlign": "center",
|
||||
"format": "8 decimals"
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
@@ -66,12 +74,27 @@ function newGovernanceUtilitiesCommonTables() {
|
||||
*/
|
||||
for (let j = 0; j < nodes.length; j++) {
|
||||
let node = nodes[j]
|
||||
let name = ''
|
||||
if (node.payload.parentNode !== undefined) {
|
||||
if (node.payload.parentNode.payload.parentNode !== undefined) {
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode !== undefined) {
|
||||
if (node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode !== undefined) {
|
||||
name = name + node.payload.parentNode.payload.parentNode.payload.parentNode.payload.parentNode.name + ' - '
|
||||
}
|
||||
name = name + node.payload.parentNode.payload.parentNode.payload.parentNode.name + ' - '
|
||||
}
|
||||
name = name + node.payload.parentNode.payload.parentNode.name + ' - '
|
||||
}
|
||||
name = name + node.payload.parentNode.name + ' - '
|
||||
}
|
||||
name = name + node.name
|
||||
|
||||
let tableRecord = {
|
||||
"name": node.name,
|
||||
"name": name,
|
||||
"tokensReward": node.payload.tokens | 0,
|
||||
"rewardInBTC": UI.projects.governance.utilities.conversions.estimateSATokensInBTC(node.payload.tokens | 0),
|
||||
"weight": node.payload.weight,
|
||||
"weightPower": node.payload.votingProgram.votes
|
||||
"weightPower": node.payload.votingProgram.votes | 0
|
||||
}
|
||||
|
||||
if (UI.projects.governance.utilities.filters.applyFilters(filters, filtersObject, tableRecord) === true) {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
function newGovernanceUtilitiesConversions () {
|
||||
let thisObject = {
|
||||
estimateSATokensInBTC: estimateSATokensInBTC
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function estimateSATokensInBTC(SATokens) {
|
||||
const SA_BTC_BASELINE_EXCHANGE_RATE = 1.5 / 1000000
|
||||
const BTC = SATokens * SA_BTC_BASELINE_EXCHANGE_RATE
|
||||
|
||||
return BTC.toFixed(3)
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
let thisObject = {
|
||||
run: run
|
||||
}
|
||||
const MAX_GENERATIONS = 10
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -87,65 +88,75 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
}
|
||||
|
||||
function resetProgram(node) {
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload[programPropertyName] === undefined) {
|
||||
node.payload[programPropertyName] = {
|
||||
count: 0,
|
||||
percentage: 0,
|
||||
outgoingPower: 0,
|
||||
ownPower: 0,
|
||||
incomingPower: 0,
|
||||
usedPower: 0,
|
||||
awarded: {
|
||||
resetNode(node, 0)
|
||||
|
||||
function resetNode(node, generation) {
|
||||
|
||||
if (generation >= MAX_GENERATIONS) {
|
||||
return
|
||||
}
|
||||
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload[programPropertyName] === undefined) {
|
||||
node.payload[programPropertyName] = {
|
||||
count: 0,
|
||||
percentage: 0,
|
||||
outgoingPower: 0,
|
||||
ownPower: 0,
|
||||
incomingPower: 0,
|
||||
usedPower: 0,
|
||||
awarded: {
|
||||
tokens: 0,
|
||||
percentage: 0
|
||||
}
|
||||
}
|
||||
} else {
|
||||
node.payload[programPropertyName].count = 0
|
||||
node.payload[programPropertyName].percentage = 0
|
||||
node.payload[programPropertyName].outgoingPower = 0
|
||||
node.payload[programPropertyName].ownPower = 0
|
||||
node.payload[programPropertyName].incomingPower = 0
|
||||
node.payload[programPropertyName].usedPower = 0
|
||||
node.payload[programPropertyName].awarded = {
|
||||
tokens: 0,
|
||||
percentage: 0
|
||||
}
|
||||
}
|
||||
} else {
|
||||
node.payload[programPropertyName].count = 0
|
||||
node.payload[programPropertyName].percentage = 0
|
||||
node.payload[programPropertyName].outgoingPower = 0
|
||||
node.payload[programPropertyName].ownPower = 0
|
||||
node.payload[programPropertyName].incomingPower = 0
|
||||
node.payload[programPropertyName].usedPower = 0
|
||||
node.payload[programPropertyName].awarded = {
|
||||
tokens: 0,
|
||||
percentage: 0
|
||||
if (
|
||||
node.type === 'User Profile' &&
|
||||
node.tokenPowerSwitch !== undefined
|
||||
) {
|
||||
resetNode(node.tokenPowerSwitch, generation)
|
||||
return
|
||||
}
|
||||
}
|
||||
if (
|
||||
node.type === 'User Profile' &&
|
||||
node.tokenPowerSwitch !== undefined
|
||||
) {
|
||||
resetProgram(node.tokenPowerSwitch)
|
||||
return
|
||||
}
|
||||
if (
|
||||
node.type === 'Token Power Switch' &&
|
||||
node[programPropertyName] !== undefined
|
||||
) {
|
||||
resetProgram(node[programPropertyName])
|
||||
return
|
||||
}
|
||||
if (
|
||||
node.type === programNodeType &&
|
||||
node[usersArrayPropertyName] !== undefined
|
||||
) {
|
||||
for (let i = 0; i < node[usersArrayPropertyName].length; i++) {
|
||||
resetProgram(node[usersArrayPropertyName][i])
|
||||
if (
|
||||
node.type === 'Token Power Switch' &&
|
||||
node[programPropertyName] !== undefined
|
||||
) {
|
||||
resetNode(node[programPropertyName], generation)
|
||||
return
|
||||
}
|
||||
if (
|
||||
node.type === programNodeType &&
|
||||
node[usersArrayPropertyName] !== undefined
|
||||
) {
|
||||
for (let i = 0; i < node[usersArrayPropertyName].length; i++) {
|
||||
resetNode(node[usersArrayPropertyName][i], generation)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (
|
||||
node.type === userNodeType &&
|
||||
node.payload.referenceParent !== undefined
|
||||
) {
|
||||
resetNode(node.payload.referenceParent, generation + 1)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
if (
|
||||
node.type === userNodeType &&
|
||||
node.payload.referenceParent !== undefined
|
||||
) {
|
||||
resetProgram(node.payload.referenceParent)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function validateProgram(node, userProfile) {
|
||||
/*
|
||||
This program is not going to run unless the Profile has Tokens, and for
|
||||
@@ -185,6 +196,7 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
}
|
||||
|
||||
function distributeProgram(programNode) {
|
||||
|
||||
if (programNode === undefined || programNode.payload === undefined) { return }
|
||||
/*
|
||||
Here we will convert Token Power into programPower.
|
||||
@@ -200,15 +212,19 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
*/
|
||||
programNode.payload[programPropertyName].ownPower = programPower
|
||||
|
||||
distributeProgramPower(programNode, programNode, programPower, count)
|
||||
distributeProgramPower(programNode, programNode, programPower, count, undefined, 0)
|
||||
|
||||
function distributeProgramPower(
|
||||
currentProgramNode,
|
||||
node,
|
||||
programPower,
|
||||
count,
|
||||
percentage
|
||||
percentage,
|
||||
generation
|
||||
) {
|
||||
if (generation >= MAX_GENERATIONS) {
|
||||
return
|
||||
}
|
||||
if (node === undefined) { return }
|
||||
if (node.payload === undefined) { return }
|
||||
if (node.payload[programPropertyName] === undefined) { return }
|
||||
@@ -281,7 +297,14 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
if (percentage === undefined || isNaN(percentage) === true) {
|
||||
percentage = defaultPercentage
|
||||
}
|
||||
distributeProgramPower(currentProgramNode, childNode, programPower * percentage / 100, 0, percentage)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
childNode,
|
||||
programPower * percentage / 100,
|
||||
0,
|
||||
percentage,
|
||||
generation
|
||||
)
|
||||
}
|
||||
}
|
||||
return
|
||||
@@ -299,7 +322,14 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
currentProgramNode.payload[programPropertyName].usedPower = currentProgramNode.payload[programPropertyName].usedPower - previousOutgoing
|
||||
currentProgramNode.payload[programPropertyName].usedPower = currentProgramNode.payload[programPropertyName].usedPower + node.payload[programPropertyName].outgoingPower
|
||||
|
||||
distributeProgramPower(currentProgramNode, node.payload.referenceParent, programPower / 10, 0)
|
||||
distributeProgramPower(
|
||||
currentProgramNode,
|
||||
node.payload.referenceParent,
|
||||
programPower / 10,
|
||||
0,
|
||||
undefined,
|
||||
generation + 1
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -309,7 +339,13 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
if (program.payload === undefined) { return }
|
||||
if (program.payload[programPropertyName].isActive === false) { return }
|
||||
|
||||
distributeProgramPower(program, program, programPower, 0)
|
||||
distributeProgramPower(
|
||||
program,
|
||||
program,
|
||||
programPower,
|
||||
0,
|
||||
undefined,
|
||||
generation)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -337,7 +373,7 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.")
|
||||
return
|
||||
}
|
||||
programNode.payload[programPropertyName].awarded.tokens = programNode.payload[programPropertyName].incomingPower * totalPowerRewardRatio
|
||||
programNode.payload[programPropertyName].awarded.tokens = programNode.payload[programPropertyName].incomingPower / totalPowerRewardRatio
|
||||
|
||||
drawProgram(programNode)
|
||||
}
|
||||
@@ -345,7 +381,7 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
function drawUserNode(node, percentage) {
|
||||
if (node.payload !== undefined) {
|
||||
|
||||
const outgoingPowerText = parseFloat(node.payload[programPropertyName].outgoingPower.toFixed(2)).toLocaleString('en')
|
||||
const outgoingPowerText = parseFloat(node.payload[programPropertyName].outgoingPower.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.valueAngleOffset = 180
|
||||
node.payload.uiObject.valueAtAngle = true
|
||||
@@ -367,8 +403,8 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
function drawProgram(node) {
|
||||
if (node.payload !== undefined) {
|
||||
|
||||
const ownPowerText = parseFloat(node.payload[programPropertyName].ownPower.toFixed(2)).toLocaleString('en')
|
||||
const incomingPowerText = parseFloat(node.payload[programPropertyName].incomingPower.toFixed(2)).toLocaleString('en')
|
||||
const ownPowerText = parseFloat(node.payload[programPropertyName].ownPower.toFixed(0)).toLocaleString('en')
|
||||
const incomingPowerText = parseFloat(node.payload[programPropertyName].incomingPower.toFixed(0)).toLocaleString('en')
|
||||
|
||||
node.payload.uiObject.statusAngleOffset = 0
|
||||
node.payload.uiObject.statusAtAngle = false
|
||||
@@ -377,14 +413,15 @@ function newGovernanceUtilitiesDecendentProgram() {
|
||||
}
|
||||
if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) {
|
||||
|
||||
const tokensAwardedText = parseFloat(node.payload[programPropertyName].awarded.tokens.toFixed(2)).toLocaleString('en')
|
||||
const tokensAwardedText = parseFloat(node.payload[programPropertyName].awarded.tokens.toFixed(0)).toLocaleString('en')
|
||||
const tokensAwardedBTC = ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(node.payload[programPropertyName].awarded.tokens | 0) + ' BTC'
|
||||
|
||||
node.tokensAwarded.payload.uiObject.statusAngleOffset = 0
|
||||
node.tokensAwarded.payload.uiObject.statusAtAngle = true
|
||||
node.tokensAwarded.payload.uiObject.valueAngleOffset = 0
|
||||
node.tokensAwarded.payload.uiObject.valueAtAngle = true
|
||||
|
||||
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens')
|
||||
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
|
||||
node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload[programPropertyName].count + ' Descendants.')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ function newGovernanceUtilitiesDecendentTables() {
|
||||
let program = UI.projects.governance.utilities.validations.onlyOneProgram(userProfile, programName)
|
||||
if (program === undefined) { continue }
|
||||
if (program.payload === undefined) { continue }
|
||||
if (program.payload[programPropertyName] === undefined) { continue }
|
||||
|
||||
let tableRecord = {
|
||||
"name": userProfile.name,
|
||||
|
||||
@@ -141,11 +141,11 @@ function newGovernanceUtilitiesTables() {
|
||||
break
|
||||
}
|
||||
case 'integer': {
|
||||
value = parseFloat(value.toFixed(0)).toLocaleString('en')
|
||||
value = parseFloat(value | 0).toLocaleString('en')
|
||||
break
|
||||
}
|
||||
case '2 decimals': {
|
||||
value = parseFloat(value.toFixed(2)).toLocaleString('en')
|
||||
value = parseFloat(value | 2).toLocaleString('en')
|
||||
break
|
||||
}
|
||||
case 'percentage': {
|
||||
|
||||
@@ -1037,6 +1037,11 @@
|
||||
"propertyName": "supportProgram",
|
||||
"functionName": "newGovernanceFunctionLibrarySupportProgram"
|
||||
},
|
||||
{
|
||||
"name": "Influencer Program",
|
||||
"propertyName": "influencerProgram",
|
||||
"functionName": "newGovernanceFunctionLibraryInfluencerProgram"
|
||||
},
|
||||
{
|
||||
"name": "Mentorship Program",
|
||||
"propertyName": "mentorshipProgram",
|
||||
@@ -1051,6 +1056,16 @@
|
||||
"name": "Profile Constructor",
|
||||
"propertyName": "profileConstructor",
|
||||
"functionName": "newGovernanceFunctionLibraryProfileConstructor"
|
||||
},
|
||||
{
|
||||
"name": "Github Program",
|
||||
"propertyName": "githubProgram",
|
||||
"functionName": "newGovernanceFunctionLibraryGithubProgram"
|
||||
},
|
||||
{
|
||||
"name": "Airdrop Program",
|
||||
"propertyName": "airdropProgram",
|
||||
"functionName": "newGovernanceFunctionLibraryAirdropProgram"
|
||||
}
|
||||
],
|
||||
"utilities": [
|
||||
@@ -1093,6 +1108,11 @@
|
||||
"name": "Filters",
|
||||
"propertyName": "filters",
|
||||
"functionName": "newGovernanceUtilitiesFilters"
|
||||
},
|
||||
{
|
||||
"name": "Conversions",
|
||||
"propertyName": "conversions",
|
||||
"functionName": "newGovernanceUtilitiesConversions"
|
||||
}
|
||||
],
|
||||
"spaces": [
|
||||
|
||||
Reference in new issue
Block a user