diff --git a/README.md b/README.md index 5c2ed0a..df56ec5 100644 --- a/README.md +++ b/README.md @@ -403,6 +403,16 @@ address = pw.Address(privateKey = '') tx = address.invokeScript('3N5Wq22bLSf3gt5VwHTCRbRnETeSwpuT8kK', 'fundRecipient', [{"type": "integer", "value": 100, }, { "type": "string", "value": "test" }, { "type": "boolean", "value": True }], [ { "amount": 100, "assetId": "BGNVLgPKLwiBiZ7vWLcy3r92MzpPCU2DuUb4tv9W6gMi" } ]) ``` +#### Working with contracts +```python +import pywaves as pw + +pw.setNode(node = '', 'T') + +contract = pw.Contract('3N7XfieeJ8dHyMJfs7amukzxKB1PfMXzHzi', '') +contract.faucet() +``` + #### Playing with Waves Matcher node (DEX): ```python import pywaves as pw diff --git a/contract.py b/contract.py index c7896d2..9d1a1fc 100644 --- a/contract.py +++ b/contract.py @@ -5,7 +5,6 @@ class Contract(object): def __init__(self, contractAddress, seed): self.contractAddress = contractAddress - self.node = pywaves.NODE metaInfo = self.parseContractAddress() extractedMethods = metaInfo.keys() @@ -16,7 +15,7 @@ def __init__(self, contractAddress, seed): def parseContractAddress(self): - metaInfo = requests.get(self.node + '/addresses/scriptInfo/' + self.contractAddress + '/meta').json() + metaInfo = requests.get(pw.NODE + '/addresses/scriptInfo/' + self.contractAddress + '/meta').json() return metaInfo['meta']['callableFuncTypes']