Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - runestone

Pages: 1 [2]
16
Technical Support / Re: pybitshares how to withdraw to external wallet
« on: April 05, 2018, 01:46:44 pm »
Get list of all coins at Openledger. Here you'll see "intermediateAccount" which contains the destination account name:
Code: [Select]
url = "https://ol-api1.openledger.info/api/v0/ol/support/coins"
r = requests.get(url).json()

This checks if the address you're about to send to is valid.
Code: [Select]
url = "https://ol-api1.openledger.info/api/v0/ol/support/wallets/"+asset+"/address-validator?address="+address
r = requests.get(url).json()

Memo is usually:
Code: [Select]
{{asset}}:{{address_where_openledger_should_transfer_to}}
Once you have all this, you can make your bitshares.transfer() call.

17
Technical Support / Re: List all assets using python-bitshares
« on: March 29, 2018, 02:40:38 pm »
Alright, I'll play around with BitShares().rpc.CALLNAME().

One more question. What's the syntax for e.g. openledger's assets? I'd like to make market orders (buy/sell) with for example open.LTC ? (hence, the reason why I was looking for a full list of asset name/IDs)

18
Technical Support / Re: List all assets using python-bitshares
« on: March 29, 2018, 01:23:25 pm »
I was looking at BlockchainObject but the documentation for this class if rather limited. It's expecting "data", but what kind of data exactly? A few examples would be great.

19
Technical Support / List all assets using python-bitshares
« on: March 29, 2018, 01:42:29 am »
Question 1) What's the best way to get a list of all asset symbols/ids using python-bitshares?

Question 2) The code below return an unexpected error: AttributeError: 'BlockchainObject' object has no attribute 'refresh'
Code: [Select]
from bitshares.blockchainobject import BlockchainObject
obj = BlockchainObject({}, use_cache=False)
print(obj.items())
Why?

20
Thanks! :)

21
Thanks, I got it working now. One more question.

When running this:
Code: [Select]
from bitshares.account import Account
account = Account("xeroc")
history = account.history(exclude_ops=[6])
data = [trans for trans in history]
return data

The following is returned:
Code: [Select]
[
    {
        "id": "1.11.158994520",
        "op": [
            6,
            {
                "fee": {
                    "amount": 1666,
                    "asset_id": "1.3.0"
                },
                "account": "1.2.282",
                "new_options": {
                    "memo_key": "BTS5TPTziKkLexhVKsQKtSpo4bAv5RnB8oXcG4sMHEwCcTf3r7dqE",
                    "voting_account": "1.2.5",
                    "num_witness": 21,
...SNIPPET...

It seems like the exclude_ops dosen't work. The same thing applies to only_ops, or what am I doing wrong?

22
Hi, can someone help me convert the generator object returned by history() to JSON?

Code: [Select]
>>from bitshares.account import Account
>>account = Account("test")
>>history = account.history()
>>print(history)
<bound method Account.history of <Account 1.2.1516>>

Reference: http://docs.pybitshares.com/en/latest/bitshares.account.html

24
In this case specifically, I'm just playing around with pybitshares, to get a better understanding on how BitShares and the python lib works. To solve the issue below, I decided to setup a private testnet instead, which will solve the issue with WIF keys starting with 6.

But, then I got another issue when connecting to my testnet using uptick/pybitshares:
Code: [Select]
Connecting to unknown network!
My best guess here was that its because uptick/pybitshares is not using the correct chain-id. To solve this, I did this:
Code: [Select]
./cli_wallet --wallet-file=my-wallet.json --chain-id=e08d...12c0 --server-rpc-endpoint=ws://127.0.0.1:8090 --rpc-endpoint=0.0.0.0:8092 --rpc-http-endpoint=0.0.0.0:8093 -d
Now, I'm able to reach the rpc-endpoint through cli_wallet (without specifying the chain-id). But, then my code returned another error:
Code: [Select]
from bitshares import BitShares
bitshares = BitShares("ws://testnet:8092", nobroadcast=False, debug=True)

raise exceptions.UnhandledRPCError(msg)
    bitsharesapi.exceptions.UnhandledRPCError: Assert Exception: _local_apis.size() > api_id:

What's going wrong here?

25
Technical Support / Re: Password Specifications
« on: March 05, 2018, 05:30:39 pm »
Here is a password suggested when you create a new account: P5JvYDTLX5Hh4d6y7hN1JUGKrSdmdxyYQAv9BBo1yNv2P

The password is always pre-fixed with P5 (but it doesn't have to be).

26
Uptick is only working with WIF keys pre-fixed with 5.
Code: [Select]
uptick --node wss://node.testnet.bitshares.eu addkey 6PR...
Current Wallet Passphrase:
Invalid Private Key Format. Please use WIF!

uptick --node wss://node.testnet.bitshares.eu addkey 5JV...
Current Wallet Passphrase:

Similarly, pybitshares will also fail here:
Code: [Select]
from bitshares import BitShares
bitshares = BitShares("wss://node.testnet.bitshares.eu", nobroadcast=False)
bitshares.wallet.unlock("wallet-password")
accName = bitshares.wallet.getAccountFromPrivateKey("6PR...")

Where should a bug like this be reported?

Pages: 1 [2]