This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Transfer transfer = Transfer( | |
from: AccountName('megatester'), | |
to: AccountName('second.megatester'), | |
amount: VizAsset.fromString('2.000 VIZ'), | |
memo: Memo('Test VT :)')); | |
Map<String, Object> gdp = await getDGP(); | |
Transaction transaction = Transaction( | |
expiration: TimePointSec(getTime(gdp).add(Duration(minutes: 10))), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var response = await http.post( | |
'https://solox.world/', //Прописываем какую-нибудь публичную ноду | |
body: json.encode({ | |
'jsonrpc': "2.0", | |
'method': "call", | |
'params': [ | |
"network_broadcast_api", | |
"broadcast_transaction_synchronous", | |
[transaction.toJsonableObject()] | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<String, Object> gdp = await getDGP(); | |
Transaction transaction = Transaction( | |
expiration: TimePointSec(getTime(gdp).add(Duration(minutes: 10))), | |
refBlockNum: getRefBockNum(gdp), | |
refBlockPrefix: getRefBockPrefix(gdp), | |
operations: [transfer]); | |
transaction.sign(['5KN3JswdW53BR6qd9NzN7U98neM5tRW8pL9mgyTSUTtjRFyHcau']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int getRefBockNum(Map<String, Object> gdp) { | |
return BlockchainUtils.getRefBlockNum(gdp['head_block_number']); | |
} | |
int getRefBockPrefix(Map<String, Object> gdp) { | |
return BlockchainUtils.getRefBlockPrefix(gdp['head_block_id']); | |
} | |
DateTime getTime(Map<String, Object> gdp) { | |
return DateTime.parse('${gdp['time']}+00:00'); //Укажем, что время в utc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<Map<String, Object>> getDGP() async { | |
var response = await http.post( | |
'https://solox.world/', //Прописываем какую-нибудь публичную ноду | |
body: json.encode({ | |
'jsonrpc': "2.0", | |
'method': "call", | |
'params': ["database_api", "get_dynamic_global_properties", []], | |
'id': 1 | |
})); //Формируем jsonrpc запрос |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Transfer transfer = Transfer( | |
from: AccountName('megatester'), | |
to: AccountName('second.megatester'), | |
amount: VizAsset.fromString('2.000 VIZ'), | |
memo: Memo('Test VT :)')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viz.config.set('websocket',' https://rpc.viz.lexai.host'); | |
var count = 0; | |
var countMax = 10001; | |
var lastBlockNum = 0; | |
var lastPrice = 0; | |
var diffSum = 0; | |
var lastDiff = 0; | |
var averageDiff = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viz.config.set('websocket',' https://rpc.viz.lexai.host'); | |
var saveUrl; | |
async function look(){ | |
console.log('Getting a list of all accounts. Wait...'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var genContentOp = function (permlink, title, tags, images, body) | |
{ | |
var curationPercent = 5000; | |
var author = 'viz-tower'; | |
var jsonMetdata = { | |
tags: tags.concat('liveblogs'), | |
app: 'liveblogs.space', | |
format: "markdown", | |
image: images | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = ''; //Username | |
var password = ''; //New password(ex. MyBestPassword1234567890) | |
var ownerWif = '' //Owner private key | |
var roles = ['owner', 'active', 'posting', 'memo']; // roles DON'T EDIT | |
var newKeys = viz.auth.generateKeys(name, password, roles); | |
viz.api.getAccounts([name], function (err, res) | |
{ | |
if (!err) | |
{ |
NewerOlder