Hi,
I am working on api of blocktrade. Here is the link https://blocktrades.us/api/v2/explorer. I am facing some issues. Like I used method /wallets/{walletType}/address-validator. In wallet method I used each and every address of my wallet(bitshares.openledger.info) which is on deposit/withdraw > blocktrades screen but it returns false. Similarly when I used this function /simple-api/transactions and enter input address I got empty array every time.
Did I make any mistake to invoke that API. Please give me any idea. Thanks
To use the address-validator API, you would first want to use the /wallets api function to get a list of the walletTypes:
https://blocktrades.us:443/api/v2/wallets
Currently, this returns:
[
{
"walletType": "muse",
"name": "MUSE"
},
{
"walletType": "dash",
"name": "Dash"
},
{
"walletType": "bitcoin",
"name": "Bitcoin"
},
{
"walletType": "bitshares2",
"name": "BitShares 2.0"
},
{
"walletType": "dogecoin",
"name": "Dogecoin"
},
{
"walletType": "peercoin",
"name": "Peercoin"
},
{
"walletType": "nushares",
"name": "NuShares"
},
{
"walletType": "nubits",
"name": "NuBits"
},
{
"walletType": "litecoin",
"name": "Litecoin"
}
]
So, to validate a bitcoin address of 152f1muMCNa7goXYhYAQC61hxEgGacmncB (I got this one randomly from blockchain.info), use:
https://blocktrades.us:443/api/v2/wallets/bitcoin/address-validator?address=152f1muMCNa7goXYhYAQC61hxEgGacmncB
This returns:
{
"isValid": true,
"isAccount": false
}
Similarly, to validate a bitshares2 address, use:
https://blocktrades.us:443/api/v2/wallets/bitshares2/address-validator?address=blocktrades
This returns:
{
"isValid": true,
"isAccount": false
}
Note that isAccount is currently meaningless for bitshares2 and should be ignored. This only had meaning in bitshares1 (which is no longer supported). isValid is the important return value.
For getting a list of transactions created by the simpleAPI (this is almost certainly the API you will want to use), you will first need to use simpleAPI/initiatieTrade to get an input address (and if you want a non-empty list, you will also need to send some coin to the input address).
1) To get an input address:
https://blocktrades.us:443/api/v2/simple-api/initiate-trade
{
"inputCoinType": "btc",
"outputCoinType": "bts",
"outputAddress": "btsnow",
"outputMemo": ""
}
Returns something like:
{
"inputAddress": "1FDgyw6NSdErYbowNty8EPxY6fHCVRCwWd",
"inputCoinType": "btc",
"outputAddress": "btsnow",
"outputCoinType": "bts",
"refundAddress": null
}
2) Send some bitcoin to inputAddress
3) To check on status of the trx from step2:
https://blocktrades.us:443/api/v2/simple-api/transactions?inputAddress=1FDgyw6NSdErYbowNty8EPxY6fHCVRCwWd
I have checked this api. It is working. Thanks for the help. It gives me input address which I want. I have question in the following request. What is
outputAddress?https://blocktrades.us:443/api/v2/simple-api/initiate-trade
{
"inputCoinType": "btc",
"outputCoinType": "bts",
"outputAddress": "btsnow",
"outputMemo": ""
}
I have account on https://bitshares.openledger.info. For instance these are the address of my account. How can I deposit to these account?
Symbol | Deposit to |
BTC | 12NbSB3X25XgrTHT3LFyjWESpe1JZsyDtN |
LTC | LQfeVhR1K274zWWr6ym1ZsZxQVbz7DrAub |
DOGE | D5CTahPejracpJuDbzBsSRrvp2ZhapJu1o |
As I mention above I use initiate-trade api and I am able to generate new input address every time. So I have a question where can I use old input address mentioned above?
Quote from: sharique-knysys on February 08, 2016, 06:17:57 AM
I have checked this api. It is working. Thanks for the help. It gives me input address which I want. I have question in the following request. What is outputAddress?
https://blocktrades.us:443/api/v2/simple-api/initiate-trade
{
"inputCoinType": "btc",
"outputCoinType": "bts",
"outputAddress": "btsnow",
"outputMemo": ""
}
It is the address that will receive the Bitshares whenever you use the inputAddress that initiate-trade generates.
That call means, "Give me a Bitcoin address where I can send Bitcoin to Blocktrades. When Blocktrades gets my bitcoin, convert it into Bitshares at the current rate, and send it to the account named btsnow". In bitshares-speak, you're asking Blocktrades to act as a bridge, doing an instant conversion from Bitcoin to Bitshares.
Quote from: sharique-knysys on February 08, 2016, 06:17:57 AM
I have account on https://bitshares.openledger.info. For instance these are the address of my account. How can I deposit to these account?
Symbol | Deposit to |
BTC | 12NbSB3X25XgrTHT3LFyjWESpe1JZsyDtN |
LTC | LQfeVhR1K274zWWr6ym1ZsZxQVbz7DrAub |
DOGE | D5CTahPejracpJuDbzBsSRrvp2ZhapJu1o |
As I mention above I use initiate-trade api and I am able to generate new input address every time. So I have a question where can I use old input address mentioned above?
These look like addresses you copied from the "Gateway" section of the deposit page. Those addresses are addresses owned by Blocktrades that are linked to your Bitshares account. Whenever you send Bitcoin to the address 12NbSB.., it will send the same amount of TRADE.BTC to your account (the account displayed in the left hand side of the screen under the identicon). You could generate these deposit addresses through the api like this:
{
"inputCoinType": "btc",
"outputCoinType": "trade.btc",
"outputAddress": "my-account-name-here"
}
You can reuse those addresses as many times as you like for as long as you like. You don't ever *need* to generate a new one, unless you want a new address for accounting reasons. Even though the wallet only shows you the most recent address, any of the previous addresses will continue to work as well.
Thanks for the information