Browse Source

Moved documentation from docs/guide to docs directory, in preparation for combined submodule documentation.

patch-2
Braydon Fuller 10 years ago
parent
commit
86819a8f6d
  1. 4
      docs/README.md
  2. 0
      docs/address.md
  3. 56
      docs/api/index.md
  4. 0
      docs/block.md
  5. 0
      docs/browser.md
  6. 0
      docs/crypto.md
  7. 0
      docs/encoding.md
  8. 0
      docs/hierarchical.md
  9. 0
      docs/index.md
  10. 0
      docs/networks.md
  11. 0
      docs/privatekey.md
  12. 0
      docs/publickey.md
  13. 0
      docs/script.md
  14. 0
      docs/transaction.md
  15. 0
      docs/unit.md
  16. 0
      docs/unspentoutput.md
  17. 0
      docs/uri.md

4
docs/README.md

@ -1,4 +0,0 @@
Bitcore API Reference
=======
This site contains the reference docs for the bitcore library.

0
docs/guide/address.md → docs/address.md

56
docs/api/index.md

@ -1,56 +0,0 @@
title: Bitcore Examples
description: Sample code for the most common task in any bitcoin application.
---
# Examples
## Create a Private Key
```javascript
var privKey = new bitcore.PrivateKey();
```
## Create an Address
```javascript
var privKey = new bitcore.PrivateKey();
var address = privKey.toAddress();
```
## Create a Multisig Address
```javascript
// Build a 2-of-3 address from public keys
var P2SHAddress = new bitcore.Address([publicKey1, publicKey2, publicKey3], 2);
```
## Request a Payment
```javascript
var paymentInfo = {
address: '1DNtTk4PUCGAdiNETAzQFWZiy2fCHtGnPx',
amount: 120000 //satoshis
};
var uri = new bitcore.URI(paymentInfo).toString();
```
## Create a Transaction
```javascript
var transaction = new Transaction()
.from(utxos) // Feed information about what unspend outputs one can use
.to(address, amount) // Add an output with the given amount of satoshis
.change(address) // Sets up a change address where the rest of the funds will go
.sign(privkeySet) // Signs all the inputs it can
```
## Connect to the Network
```javascript
var peer = new Peer('5.9.85.34');
peer.on('inv', function(message) {
// new invetory
});
peer.connect();
```

0
docs/guide/block.md → docs/block.md

0
docs/guide/browser.md → docs/browser.md

0
docs/guide/crypto.md → docs/crypto.md

0
docs/guide/encoding.md → docs/encoding.md

0
docs/guide/hierarchical.md → docs/hierarchical.md

0
docs/guide/index.md → docs/index.md

0
docs/guide/networks.md → docs/networks.md

0
docs/guide/privatekey.md → docs/privatekey.md

0
docs/guide/publickey.md → docs/publickey.md

0
docs/guide/script.md → docs/script.md

0
docs/guide/transaction.md → docs/transaction.md

0
docs/guide/unit.md → docs/unit.md

0
docs/guide/unspentoutput.md → docs/unspentoutput.md

0
docs/guide/uri.md → docs/uri.md

Loading…
Cancel
Save