remove whitespace, add js language identifiers
This commit is contained in:
parent
3e43d79b6e
commit
fe4bbf3d72
104
examples.md
104
examples.md
@ -1,6 +1,8 @@
|
|||||||
#Address.js
|
#Address.js
|
||||||
'use strict';
|
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
// Replace '../bitcore' with 'bitcore' if you use this code elsewhere.
|
// Replace '../bitcore' with 'bitcore' if you use this code elsewhere.
|
||||||
@ -28,7 +30,12 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#Armory.js
|
#Armory.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var Armory = require('../lib/Armory');
|
var Armory = require('../lib/Armory');
|
||||||
var Address = require('../lib/Address');
|
var Address = require('../lib/Address');
|
||||||
|
|
||||||
@ -95,7 +102,12 @@
|
|||||||
b = b.next();
|
b = b.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#ConnectionTor.js
|
#ConnectionTor.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var Peer = require('../lib/Peer');
|
var Peer = require('../lib/Peer');
|
||||||
var Connection = require('../lib/Connection');
|
var Connection = require('../lib/Connection');
|
||||||
var dns = require('dns');
|
var dns = require('dns');
|
||||||
@ -134,7 +146,12 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#CreateAndSignTx-Multisig.js
|
#CreateAndSignTx-Multisig.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
||||||
var networks = require('../networks');
|
var networks = require('../networks');
|
||||||
@ -239,10 +256,14 @@
|
|||||||
} else {
|
} else {
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
////
|
////
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#CreateAndSignTx-PayToPubkeyHash.js
|
#CreateAndSignTx-PayToPubkeyHash.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
||||||
|
|
||||||
@ -313,10 +334,14 @@
|
|||||||
} else {
|
} else {
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
////
|
////
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#CreateAndSignTx-PayToScriptHash.js
|
#CreateAndSignTx-PayToScriptHash.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
||||||
var networks = require('../networks');
|
var networks = require('../networks');
|
||||||
@ -467,11 +492,14 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#CreateKey.js
|
#CreateKey.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
// replace '../bitcore' with 'bitcore' if you use this code elsewhere.
|
// replace '../bitcore' with 'bitcore' if you use this code elsewhere.
|
||||||
var bitcore = require('../bitcore');
|
var bitcore = require('../bitcore');
|
||||||
@ -517,7 +545,12 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#CreateScript.js
|
#CreateScript.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
@ -595,7 +628,12 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#ECIES.js
|
#ECIES.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
||||||
|
|
||||||
@ -627,7 +665,12 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#ElectrumMPK.js
|
#ElectrumMPK.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var Electrum = require('../lib/Electrum');
|
var Electrum = require('../lib/Electrum');
|
||||||
var Address = require('../lib/Address');
|
var Address = require('../lib/Address');
|
||||||
|
|
||||||
@ -640,7 +683,12 @@
|
|||||||
|
|
||||||
console.log(addr0.as('base58'));
|
console.log(addr0.as('base58'));
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#HierarchicalKey.js
|
#HierarchicalKey.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
bitcore = typeof(bitcore) === 'undefined' ? require('../bitcore') : bitcore;
|
||||||
var HierarchicalKey = bitcore.HierarchicalKey;
|
var HierarchicalKey = bitcore.HierarchicalKey;
|
||||||
@ -725,7 +773,12 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#PayToScriptHashAddress.js
|
#PayToScriptHashAddress.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var bitcore = require('../bitcore');
|
var bitcore = require('../bitcore');
|
||||||
var Address = bitcore.Address;
|
var Address = bitcore.Address;
|
||||||
var bitcoreUtil = bitcore.util;
|
var bitcoreUtil = bitcore.util;
|
||||||
@ -744,7 +797,12 @@
|
|||||||
// This outputs the "address" of thescript
|
// This outputs the "address" of thescript
|
||||||
console.log(addrStr);
|
console.log(addrStr);
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#PeerDiscovery.js
|
#PeerDiscovery.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
var PeerManager = require('../lib/PeerManager');
|
var PeerManager = require('../lib/PeerManager');
|
||||||
var peerman = new PeerManager();
|
var peerman = new PeerManager();
|
||||||
|
|
||||||
@ -752,7 +810,12 @@
|
|||||||
limit: 12
|
limit: 12
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#PeerManager.js
|
#PeerManager.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
@ -801,7 +864,12 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#Rpc.js
|
#Rpc.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
@ -835,7 +903,12 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#Script.js
|
#Script.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
@ -889,7 +962,12 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#SendTx.js
|
#SendTx.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
@ -982,7 +1060,7 @@
|
|||||||
// finally, send transaction to the bitcoin network
|
// finally, send transaction to the bitcoin network
|
||||||
conn.sendTx(tx);
|
conn.sendTx(tx);
|
||||||
|
|
||||||
// for now, the network won't respond in any case
|
// for now, the network will not respond in any case
|
||||||
// (transaction accepted, transaction rejected)
|
// (transaction accepted, transaction rejected)
|
||||||
// in the future, we may listen to 'reject' message
|
// in the future, we may listen to 'reject' message
|
||||||
// see https://gist.github.com/gavinandresen/7079034
|
// see https://gist.github.com/gavinandresen/7079034
|
||||||
@ -998,7 +1076,12 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
#SimpleP2Pmonitor.js
|
#SimpleP2Pmonitor.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a simple script that will display network messages.
|
* This is a simple script that will display network messages.
|
||||||
* It users the Peer / Connection classes directly instead of
|
* It users the Peer / Connection classes directly instead of
|
||||||
@ -1072,9 +1155,13 @@
|
|||||||
console.log(event.message.invs);
|
console.log(event.message.invs);
|
||||||
});
|
});
|
||||||
|
|
||||||
#VanityAddress.js
|
```
|
||||||
'use strict';
|
|
||||||
|
|
||||||
|
#VanityAddress.js
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
// Replace '../bitcore' with 'bitcore' if you use this code elsewhere.
|
// Replace '../bitcore' with 'bitcore' if you use this code elsewhere.
|
||||||
@ -1102,3 +1189,4 @@
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user