forked from apxtri/apxtrib
36 lines
1.0 KiB
JavaScript
36 lines
1.0 KiB
JavaScript
|
/*
|
||
|
Town contract:town_base
|
||
|
*/
|
||
|
|
||
|
const Contract={
|
||
|
object:"town",
|
||
|
id:"town_base",
|
||
|
version:"0.0.0",
|
||
|
dt_create:"20230307",
|
||
|
dt_update:"",
|
||
|
info:"https://apxtrib.crabdance.com/town_base.html",
|
||
|
};
|
||
|
|
||
|
Contract.trigger = ()=>{
|
||
|
// Identification of rule to trig
|
||
|
// Create token for a tribe =>
|
||
|
}
|
||
|
|
||
|
Contract.druidAllowedtoCreateToken = (tokenconf, hashtokenconf)=>{
|
||
|
/*
|
||
|
@tokenconf ={
|
||
|
tokenvalue: float value in apxtr,
|
||
|
quantity: int number of token,
|
||
|
druidId: uuid,
|
||
|
costrequest: float cost of this in apxtr to the mayorId
|
||
|
}
|
||
|
Check balance druid wallet
|
||
|
@return {status:200, data:{transacId:blocktimestamp,tokens:[token1, token2, ...]}
|
||
|
{status:<>200, info:'error message'}
|
||
|
Store transaction in open block with transacId
|
||
|
A token = druidUuid_hash(with blockchain elected privatekey)
|
||
|
Druid can sale his token with his rules at a tribe level but any user that request an exchange ffrom a token
|
||
|
*/
|
||
|
}
|
||
|
|
||
|
module.exports = Contract;
|