-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCoba.py
25 lines (22 loc) · 847 Bytes
/
Coba.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from Savoir import Savoir
from requests import ReadTimeout, ConnectTimeout, HTTPError, Timeout, ConnectionError
rpcuser = 'multichainrpc'
rpcpasswd = '8kwZ4sS9oSGxdiFLK2TwMf2zqxPwfLr9XkUdkgU9upwL'
rpchost = '139.59.105.130'
rpcport = '6264'
chainname = 'virkillchain'
api = Savoir(rpcuser, rpcpasswd, rpchost, rpcport, chainname)
# newaddress=api.createkeypairs()
# tryimport=api.importaddress(newaddress[0]['address'],'',bool(''))
# api.grant(newaddress[0]['address'],'send')
# api.grant(newaddress[0]['address'],'receive')
sendasset=api.sendasset('18MCconQFj2EgqsvUWcn1uGXVvNBPjP9yHK5pv','KUDO',1000)
try:
if sendasset.has_key('error'):
errormsg=sendasset['error']['message']
print({'result':'false','error':errormsg})
except AttributeError:
print({'result':'true','error':''})
# print(sendasset)
# print(newaddress)
# print(tryimport)