Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refrain from using third party api's #54

Closed
gr0kchain opened this issue Aug 30, 2018 · 0 comments
Closed

Refrain from using third party api's #54

gr0kchain opened this issue Aug 30, 2018 · 0 comments

Comments

@gr0kchain
Copy link
Contributor

https://github.com/ConsenSys/chainabstractionlayer/blob/e922f712a99c457ccddf607b597ec3e854a393ea/src/providers/bitcoin/BitcoinLedgerProvider.js#L37

This can be replaced with (note this will only return information assuming you've used the importaddress rpc call)

listunspent ( minconf maxconf ["addresses",...] [include_unsafe] [query_options])

Returns array of unspent transaction outputs
with between minconf and maxconf (inclusive) confirmations.
Optionally filter to only include txouts paid to specified addresses.

Arguments:

  1. minconf (numeric, optional, default=1) The minimum confirmations to filter
  2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter
  3. "addresses" (string) A json array of bitcoin addresses to filter
    [
    "address" (string) bitcoin address
    ,...
    ]
  4. include_unsafe (bool, optional, default=true) Include outputs that are not safe to spend
    See description of "safe" attribute below.
  5. query_options (json, optional) JSON with query options
    {
    "minimumAmount" (numeric or string, default=0) Minimum value of each UTXO in BTC
    "maximumAmount" (numeric or string, default=unlimited) Maximum value of each UTXO in BTC
    "maximumCount" (numeric or string, default=unlimited) Maximum number of UTXOs
    "minimumSumAmount" (numeric or string, default=unlimited) Minimum sum value of all UTXOs in BTC
    }

Result
[ (array of json object)
{
"txid" : "txid", (string) the transaction id
"vout" : n, (numeric) the vout value
"address" : "address", (string) the bitcoin address
"account" : "account", (string) DEPRECATED. The associated account, or "" for the default account
"scriptPubKey" : "key", (string) the script key
"amount" : x.xxx, (numeric) the transaction output amount in BTC
"confirmations" : n, (numeric) The number of confirmations
"redeemScript" : n (string) The redeemScript if scriptPubKey is P2SH
"spendable" : xxx, (bool) Whether we have the private keys to spend this output
"solvable" : xxx, (bool) Whether we know how to spend this output, ignoring the lack of keys
"safe" : xxx (bool) Whether this output is considered safe to spend. Unconfirmed transactions
from outside keys and unconfirmed replacement transactions are considered unsafe
and are not eligible for spending by fundrawtransaction and sendtoaddress.
}
,...
]

@gr0kchain gr0kchain changed the title Don't use third party api's Refrain from using third party api's Aug 30, 2018
@harshjv harshjv mentioned this issue Sep 28, 2018
6 tasks
@harshjv harshjv closed this as completed Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants