How to get bitcoin balance in smart contract - solidity

I am making a smart contract and want to know the bitcoin balance of a metamask address.How can I do this? Since BTC is not ERC-20.

Have you considered using a block explorer (something like blockstream.info)
All you need to know is the address you want to query.
I assume want to do automate this, and in this case you can search for an api - http://blockchain.info/api
You will have to implement the API, but that's the only way as far as I know from a smart contract running on Etherium.

Related

How can I use SQL data and smart contracts together?

I want to write a smart contract on Solidity for a product tracking DApp. But all the data will come from SQL Server. So my question is how can I send these data to my smart contract?
Should I write an API in Node.js or another languages? Is there any other alternatives that you can suggest?

How to send multi-transaction of Binance smart chain programatically?

I need to send multi-transaction of Binance smart chain.
It means different amounts to different wallets but for only one transaction fee.
I know that it is technically possible. Do you know in which language should it be written?
Thank you

Automate sending info to the blockchain once an specific number of entries is reached?

It's a music website, the idea is to record on the blockchain every time a song is played.
Since we don't want to force users to install metamask so they can sign transactions, the idea is to store in an array, so that the smart contract sends it to the blockchain every 100 plays for example.
What's the best way to achieve this?
Please explain better, what technology do you use for your website? .net asp?
when you say "send to the blockchain" do you mean to a smart contract?
and an array of what do you want to send?
If you want to send something from a website to a smart contract on the blockchain you can use Nethereum thru .net asp.
Shouldn't be hard to write a c# code to send something every X times.
Just remember that storing new data on the blockchain cost gas (money).

Kraken Exchange AddOrder API call

I'm writing a small java app that will allow me to trade on Kraken without using their web front-end.
I have most of the calls working, but can't seem to get AddOrder working..
No matter what I send, Kraken replies with EGeneral:Invalid arguments
I'm able to do an AccountBalance call which is also a private call that needs my API-key and API-Sign. So I'm pretty sure I'm creating the API-Sign properly.
For a simple market order to buy 12 ETH in USD, I would send:
https://api.kraken.com/0/private/AddOrder?pair=XETHZUSD&type=buy&ordertype=market&volume=12.00000
Has anyone used this API? Can point out something I might be missing?
Thanks!

Bitcoin Api (only found 1)

I need to use a bitcoin api, and only have found CoinBox. The problem is that coinbox is limited to only a few sites and isnt open to everyone so I cant use it. Are there any good alternatives to coinbox.me? Thanks.
There are actually quite a few apis. First there is coinbase which is my favorite since they pay the transaction fees for transactions over 0.001 BTC and all internal transactions are absolutely free (and instant). You can see their api. (https://coinbase.com/docs/api/overview). What they lack is that it is hard to grab the TX id's and any other specific information. There is also blockchain.info which is the most feature full, but the downside is that you have to pay all of the fees and it can get to be very expensive. You can see the api. (https://blockchain.info/api). There are a lot more but the problem is that they are very buggy. I hope this helps!
It is not necessary to use web wallets to create addresses. You can install your own bitcoin server/daemon and act like your own bank.
This is the place to start if you want to know how to do it (https://en.bitcoin.it/wiki/Main_Page).
Bitcoin can be queried using JSON RPC methods. So if you are running a bitcoin daemon locally you can just query them. The documentation for the same is located at
Running Bitcoin - https://en.bitcoin.it/wiki/Running_Bitcoin
API Reference - https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)
API Call List - https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
Hope this helps.