Merge pull request #982 from braydonf/docs/prepare-for-submodule
Moved documentation from docs/guide to docs directory
This commit is contained in:
commit
28ad62c9d7
|
@ -1,4 +0,0 @@
|
||||||
Bitcore API Reference
|
|
||||||
=======
|
|
||||||
|
|
||||||
This site contains the reference docs for the bitcore library.
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Address
|
title: Address
|
||||||
description: A simple interface to generate and validate a bitcoin address.
|
description: A simple interface to generate and validate a bitcoin address.
|
||||||
---
|
---
|
|
@ -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();
|
|
||||||
```
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Block
|
title: Block
|
||||||
description: A simple interface to parse and validate a bitcoin blocks.
|
description: A simple interface to parse and validate a bitcoin blocks.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Browser Builds
|
title: Browser Builds
|
||||||
description: Guide to writing modules and optimizing browser bundles.
|
description: Guide to writing modules and optimizing browser bundles.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Crypto
|
title: Crypto
|
||||||
description: Primitives and tools to deal with bitcoin cryptography.
|
description: Primitives and tools to deal with bitcoin cryptography.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Encoding
|
title: Encoding
|
||||||
description: Utilities for encoding information in bitcoin standard formats.
|
description: Utilities for encoding information in bitcoin standard formats.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: HDKeys
|
title: HDKeys
|
||||||
description: Lets you create and derive extended public and private keys according to the BIP32 standard for Hierarchical Deterministic (HD) keys.
|
description: Lets you create and derive extended public and private keys according to the BIP32 standard for Hierarchical Deterministic (HD) keys.
|
||||||
---
|
---
|
|
@ -36,7 +36,7 @@ To get started, just `npm install bitcore` or `bower install bitcore`.
|
||||||
Some functionality is implemented as a module that can be installed seperately:
|
Some functionality is implemented as a module that can be installed seperately:
|
||||||
|
|
||||||
* [Payment Protocol Support](https://github.com/bitpay/bitcore-payment-protocol)
|
* [Payment Protocol Support](https://github.com/bitpay/bitcore-payment-protocol)
|
||||||
* [Peer to Peer Networking](https://github.com/bitpay/bitcore-payment-protocol)
|
* [Peer to Peer Networking](https://github.com/bitpay/bitcore-p2p)
|
||||||
* [Bitcoin Core JSON-RPC](https://github.com/bitpay/bitcoind-rpc)
|
* [Bitcoin Core JSON-RPC](https://github.com/bitpay/bitcoind-rpc)
|
||||||
* [Payment Channels](https://github.com/bitpay/bitcore-channel)
|
* [Payment Channels](https://github.com/bitpay/bitcore-channel)
|
||||||
* [Mnemonics](https://github.com/bitpay/bitcore-mnemonic)
|
* [Mnemonics](https://github.com/bitpay/bitcore-mnemonic)
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Networks
|
title: Networks
|
||||||
description: A simple interface to handle livenet and testnet bitcoin networks.
|
description: A simple interface to handle livenet and testnet bitcoin networks.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Private Key
|
title: Private Key
|
||||||
description: A simple interface to generate, import and handle private keys.
|
description: A simple interface to generate, import and handle private keys.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Public Key
|
title: Public Key
|
||||||
description: A simple interface for handling private keys.
|
description: A simple interface for handling private keys.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Script
|
title: Script
|
||||||
description: A powerful interface to create, parse and validate bitcoin scripts.
|
description: A powerful interface to create, parse and validate bitcoin scripts.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Transaction
|
title: Transaction
|
||||||
description: A robust interface to create, parse and validate bitcoin transactions.
|
description: A robust interface to create, parse and validate bitcoin transactions.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Bitcoin Units
|
title: Bitcoin Units
|
||||||
description: Utility to easily convert between bitcoin units.
|
description: Utility to easily convert between bitcoin units.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: UnspentOutput
|
title: UnspentOutput
|
||||||
description: A stateless model to represent an unspent output and associated information.
|
description: A stateless model to represent an unspent output and associated information.
|
||||||
---
|
---
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
title: Bitcoin URIs
|
title: Bitcoin URIs
|
||||||
description: Utility to parse and create standard bitcoin URIs.
|
description: Utility to parse and create standard bitcoin URIs.
|
||||||
---
|
---
|
Loading…
Reference in New Issue