This commit is contained in:
Dark Sun
2023-12-19 22:08:38 +03:00
parent 2303fcea9e
commit 09fb3c0eba
9 changed files with 316 additions and 60 deletions
@@ -12,7 +12,14 @@ export const extendedActions = new Set([
"buyrambytes",
"delegatebw",
"undelegatebw",
"voteproducer"
"voteproducer",
'statement',
'decision',
'batch'
'act',
'exec',
'votefor',
'voteagainst'
]);
export const primaryTerms = [
+59 -59
View File
@@ -186,71 +186,71 @@ export const action = {
},
// eosio::undelegatebw
"@exec": {
"properties": {
"executer": {"type": "keyword"},
"coopname": {"type": "keyword"},
"decision_id": {"type": "long"},
}
},
// "@exec": {
// "properties": {
// "executer": {"type": "keyword"},
// "coopname": {"type": "keyword"},
// "decision_id": {"type": "long"},
// }
// },
"@statement": {
"properties": {
"coopname": {"type": "keyword"},
"username": {"type": "keyword"},
"action": {"type": "keyword"},
"decision_id": {"type": "long"},
"batch_id": {"type": "long"},
"statement": {"enabled": false},
}
},
// "@statement": {
// "properties": {
// "coopname": {"type": "keyword"},
// "username": {"type": "keyword"},
// "action": {"type": "keyword"},
// "decision_id": {"type": "long"},
// "batch_id": {"type": "long"},
// "statement": {"enabled": false},
// }
// },
"@act": {
"properties": {
"coopname": {"type": "keyword"},
"username": {"type": "keyword"},
"action": {"type": "keyword"},
"decision_id": {"type": "long"},
"batch_id": {"type": "long"},
"act": {"enabled": false},
}
},
// "@act": {
// "properties": {
// "coopname": {"type": "keyword"},
// "username": {"type": "keyword"},
// "action": {"type": "keyword"},
// "decision_id": {"type": "long"},
// "batch_id": {"type": "long"},
// "act": {"enabled": false},
// }
// },
"@decision": {
"properties": {
"coopname": {"type": "keyword"},
"username": {"type": "keyword"},
"action": {"type": "keyword"},
"decision_id": {"type": "long"},
"batch_id": {"type": "long"},
"decision": {"enabled": false},
}
},
"@batch": {
"properties": {
"coopname": {"type": "keyword"},
"action": {"type": "keyword"},
"batch_id": {"type": "long"},
}
},
// "@decision": {
// "properties": {
// "coopname": {"type": "keyword"},
// "username": {"type": "keyword"},
// "action": {"type": "keyword"},
// "decision_id": {"type": "long"},
// "batch_id": {"type": "long"},
// "decision": {"enabled": false},
// }
// },
// "@batch": {
// "properties": {
// "coopname": {"type": "keyword"},
// "action": {"type": "keyword"},
// "batch_id": {"type": "long"},
// }
// },
// eosio::votefor
"@votefor": {
"properties": {
"coopname": {"type": "keyword"},
"member": {"type": "keyword"},
"decision_id": {"type": "long"}
}
},
// // eosio::votefor
// "@votefor": {
// "properties": {
// "coopname": {"type": "keyword"},
// "member": {"type": "keyword"},
// "decision_id": {"type": "long"}
// }
// },
"@voteagainst": {
"properties": {
"coopname": {"type": "keyword"},
"member": {"type": "keyword"},
"decision_id": {"type": "long"}
}
}
// "@voteagainst": {
// "properties": {
// "coopname": {"type": "keyword"},
// "member": {"type": "keyword"},
// "decision_id": {"type": "long"}
// }
// }
}
}
};
+39
View File
@@ -0,0 +1,39 @@
const hyperionModule = {
chain: "*",
contract: '*',
action: 'act',
parser_version: ['3.2', '2.1','1.8','1.7'],
defineQueryPrefix: 'act',
mappings: {
action: {
"@act": {
"properties": {
"coopname": {"type": "keyword"},
"username": {"type": "keyword"},
"action": {"type": "keyword"},
"decision_id": {"type": "long"},
"batch_id": {"type": "long"},
"act": {"enabled": false}
}
}
}
},
handler: (action) => {
const data = action['act']['data'];
action['@act'] = {
coopname: data.coopname,
username: data.username,
action: data.action,
decision_id: data.decision_id,
batch_id: data.batch_id,
act: data.act
};
}
};
module.exports = {hyperionModule};
+33
View File
@@ -0,0 +1,33 @@
const hyperionModule = {
chain: "*",
contract: '*',
action: 'batch',
parser_version: ['3.2', '2.1','1.8','1.7'],
defineQueryPrefix: 'batch',
mappings: {
action: {
"@batch": {
"properties": {
"coopname": {"type": "keyword"},
"action": {"type": "keyword"},
"batch_id": {"type": "long"}
}
}
}
},
handler: (action) => {
const data = action['act']['data'];
action['@batch'] = {
coopname: data.coopname,
action: data.action,
batch_id: data.batch_id,
};
}
};
module.exports = {hyperionModule};
+39
View File
@@ -0,0 +1,39 @@
const hyperionModule = {
chain: "*",
contract: '*',
action: 'decision',
parser_version: ['3.2', '2.1','1.8','1.7'],
defineQueryPrefix: 'decision',
mappings: {
action: {
"@decision": {
"properties": {
"coopname": {"type": "keyword"},
"username": {"type": "keyword"},
"action": {"type": "keyword"},
"decision_id": {"type": "long"},
"batch_id": {"type": "long"},
"decision": {"enabled": false}
}
}
}
},
handler: (action) => {
const data = action['act']['data'];
action['@decision'] = {
coopname: data.coopname,
username: data.username,
action: data.action,
decision_id: data.decision_id,
batch_id: data.batch_id,
decision: data.decision
};
}
};
module.exports = {hyperionModule};
+33
View File
@@ -0,0 +1,33 @@
const hyperionModule = {
chain: "*",
contract: '*',
action: 'exec',
parser_version: ['3.2', '2.1','1.8','1.7'],
defineQueryPrefix: 'exec',
mappings: {
action: {
"@exec": {
"properties": {
"executer": {"type": "keyword"},
"coopname": {"type": "keyword"},
"decision_id": {"type": "long"}
}
}
}
},
handler: (action) => {
const data = action['act']['data'];
action['@exec'] = {
executer: data.executer,
coopname: data.coopname,
decision_id: data.decision_id,
};
}
};
module.exports = {hyperionModule};
+39
View File
@@ -0,0 +1,39 @@
const hyperionModule = {
chain: "*",
contract: '*',
action: 'statement',
parser_version: ['3.2', '2.1','1.8','1.7'],
defineQueryPrefix: 'statement',
mappings: {
action: {
"@statement": {
"properties": {
"coopname": {"type": "keyword"},
"username": {"type": "keyword"},
"action": {"type": "keyword"},
"decision_id": {"type": "long"},
"batch_id": {"type": "long"},
"statement": {"enabled": false}
}
}
}
},
handler: (action) => {
const data = action['act']['data'];
action['@statement'] = {
coopname: data.coopname,
username: data.username,
action: data.action,
decision_id: data.decision_id,
batch_id: data.batch_id,
statement: data.statement
};
}
};
module.exports = {hyperionModule};
+33
View File
@@ -0,0 +1,33 @@
const hyperionModule = {
chain: "*",
contract: '*',
action: 'voteagainst',
parser_version: ['3.2', '2.1','1.8','1.7'],
defineQueryPrefix: 'voteagainst',
mappings: {
action: {
"@voteagainst": {
"properties": {
"coopname": {"type": "keyword"},
"member": {"type": "keyword"},
"decision_id": {"type": "long"}
}
}
}
},
handler: (action) => {
const data = action['act']['data'];
action['@voteagainst'] = {
coopname: data.coopname,
member: data.member,
decision_id: decision_id
};
}
};
module.exports = {hyperionModule};
+33
View File
@@ -0,0 +1,33 @@
const hyperionModule = {
chain: "*",
contract: '*',
action: 'votefor',
parser_version: ['3.2', '2.1','1.8','1.7'],
defineQueryPrefix: 'votefor',
mappings: {
action: {
"@votefor": {
"properties": {
"coopname": {"type": "keyword"},
"member": {"type": "keyword"},
"decision_id": {"type": "long"}
}
}
}
},
handler: (action) => {
const data = action['act']['data'];
action['@votefor'] = {
coopname: data.coopname,
member: data.member,
decision_id: decision_id
};
}
};
module.exports = {hyperionModule};