PyWAVES: simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

97 views Asked by At
import pywaves as pw

def main():
    node = "https://nodes.wavesnodes.com"
    chain = "mainnet"

    pw.setNode(node=node, chain=chain)

    private_key = #############
    my_address_statement = pw.Address(privateKey=private_key)
    WAVES_balance = my_address_statement.balance()

    print("Your WAVES balance is: %d." % WAVES_balance)
    main()

main()

Eventually this code produces the error indicated in the title. How can this be avoided?

1

There are 1 answers

0
Joseph O Polanco On BEST ANSWER

As it turns out this segment of code is redundant:

node = "https://nodes.wavesnodes.com"
chain = "mainnet"

pw.setNode(node=node, chain=chain)

Refactoring without it resolved the issue.