@btc-vision/transaction 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +58 -12
- package/README.md +8 -7
- package/browser/_version.d.ts +1 -1
- package/browser/index.js +2 -2
- package/browser/tests/Regtest.d.ts +3 -0
- package/browser/tests/test.d.ts +1 -0
- package/browser/transaction/builders/TransactionBuilder.d.ts +2 -1
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/tests/Regtest.d.ts +3 -0
- package/build/tests/Regtest.js +29 -0
- package/build/tests/test.d.ts +1 -0
- package/build/tests/test.js +74 -0
- package/build/transaction/builders/TransactionBuilder.d.ts +2 -1
- package/build/transaction/builders/TransactionBuilder.js +5 -3
- package/docs/classes/BitcoinUtils.html +182 -182
- package/docs/classes/CalldataGenerator.html +210 -210
- package/docs/classes/Compressor.html +184 -184
- package/docs/classes/ContractBaseMetadata.html +181 -181
- package/docs/classes/DeploymentGenerator.html +199 -199
- package/docs/classes/EcKeyPair.html +279 -279
- package/docs/classes/FundingTransaction.html +315 -292
- package/docs/classes/Generator.html +198 -198
- package/docs/classes/InteractionTransaction.html +387 -364
- package/docs/classes/TransactionBuilder.html +325 -302
- package/docs/classes/TransactionFactory.html +179 -179
- package/docs/classes/TweakedSigner.html +180 -180
- package/docs/classes/UTXOManager.html +186 -186
- package/docs/classes/Wallet.html +190 -190
- package/docs/classes/wBTC.html +188 -188
- package/docs/enums/TransactionType.html +178 -178
- package/docs/index.html +9 -9
- package/docs/interfaces/FetchUTXOParams.html +177 -177
- package/docs/interfaces/IFundingTransactionParameters.html +181 -181
- package/docs/interfaces/IInteractionParameters.html +184 -184
- package/docs/interfaces/ITransactionDataContractDeployment.html +183 -183
- package/docs/interfaces/ITransactionDataContractInteractionWrap.html +185 -185
- package/docs/interfaces/ITransactionParameters.html +180 -180
- package/docs/interfaces/IWallet.html +180 -180
- package/docs/interfaces/NetworkInformation.html +175 -175
- package/docs/interfaces/PsbtInputExtended.html +193 -193
- package/docs/interfaces/PsbtOutputExtendedAddress.html +182 -182
- package/docs/interfaces/PsbtOutputExtendedScript.html +182 -182
- package/docs/interfaces/RawUTXOResponse.html +177 -177
- package/docs/interfaces/TapLeafScript.html +176 -176
- package/docs/interfaces/TweakSettings.html +178 -178
- package/docs/interfaces/UTXO.html +177 -177
- package/docs/interfaces/UpdateInput.html +174 -174
- package/docs/types/PsbtOutputExtended.html +173 -173
- package/docs/variables/version.html +173 -173
- package/package.json +4 -4
- package/src/_version.ts +1 -1
- package/src/scripts/Regtest.ts +19 -19
- package/src/scripts/test.ts +98 -98
- package/src/tests/Regtest.ts +36 -0
- package/src/tests/test.ts +102 -0
- package/src/transaction/builders/TransactionBuilder.ts +606 -603
- package/tests/TransactionBuilder.test.ts +58 -58
- package/tsconfig.webpack.json +8 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,8 @@ import { TransactionType } from '../enums/TransactionType.js';
|
|
|
5
5
|
import { IFundingTransactionParameters, ITransactionParameters } from '../interfaces/ITransactionParameters.js';
|
|
6
6
|
import { Address } from '@btc-vision/bsi-binary';
|
|
7
7
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
8
|
-
|
|
8
|
+
import { Logger } from '@btc-vision/logger';
|
|
9
|
+
export declare abstract class TransactionBuilder<T extends TransactionType> extends Logger {
|
|
9
10
|
protected static readonly LOCK_LEAF_SCRIPT: Buffer;
|
|
10
11
|
protected static readonly MINIMUM_DUST: bigint;
|
|
11
12
|
abstract readonly type: T;
|
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.2";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.0.
|
|
1
|
+
export const version = '1.0.2';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BitcoinNetwork } from '@btc-vision/bsi-common';
|
|
2
|
+
export const Regtest = {
|
|
3
|
+
wallet: {
|
|
4
|
+
address: 'bcrt1qfqsr3m7vjxheghcvw4ks0fryqxfq8qzjf8fxes',
|
|
5
|
+
publicKey: '020373626d317ae8788ce3280b491068610d840c23ecb64c14075bbb9f670af52c',
|
|
6
|
+
privateKey: 'cRCiYAgCBrU7hSaJBRuPqKVYXQqM5CKXbMfWHb25X4FDAWJ8Ai92',
|
|
7
|
+
},
|
|
8
|
+
config: {
|
|
9
|
+
BITCOIND_NETWORK: BitcoinNetwork.Regtest,
|
|
10
|
+
BITCOIND_HOST: '51.81.67.34',
|
|
11
|
+
BITCOIND_PORT: 9242,
|
|
12
|
+
BITCOIND_USERNAME: 'HJSiowseujhs',
|
|
13
|
+
BITCOIND_PASSWORD: 'YHEFHSDJ23JOIhjjef2ied9u290efu2930u90U',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export const Testnet = {
|
|
17
|
+
wallet: {
|
|
18
|
+
address: 'tb1qcfszz8dcvsz9mcp70ezw5zy2r3ydr0cfz60d3t',
|
|
19
|
+
privateKey: 'cSZU2QB9aUYvaL6ukU9d3DKq7QaxTRms1BCQnx5vqXbxBk4bdBc4',
|
|
20
|
+
publicKey: '026764d622f083d78f47c2f2a007ab08e96edf398de74acc0251a7bba202ffb92b',
|
|
21
|
+
},
|
|
22
|
+
config: {
|
|
23
|
+
BITCOIND_NETWORK: BitcoinNetwork.TestNet,
|
|
24
|
+
BITCOIND_HOST: '51.81.67.34',
|
|
25
|
+
BITCOIND_PORT: 9237,
|
|
26
|
+
BITCOIND_USERNAME: 'HJSiowseujhs',
|
|
27
|
+
BITCOIND_PASSWORD: 'YHEFHSDJ23JOIhjjef2ied9u290efu2930u90U',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { wBTC } from '../metadata/contracts/wBTC.js';
|
|
2
|
+
import { Wallet } from '../keypair/Wallet.js';
|
|
3
|
+
import { Testnet } from './Regtest.js';
|
|
4
|
+
import { UTXOManager } from '../utxo/UTXOManager.js';
|
|
5
|
+
import { networks } from 'bitcoinjs-lib';
|
|
6
|
+
import { TransactionFactory } from '../transaction/TransactionFactory.js';
|
|
7
|
+
import { BitcoinRPC } from '@btc-vision/bsi-bitcoin-rpc';
|
|
8
|
+
import { ABICoder, BinaryWriter } from '@btc-vision/bsi-binary';
|
|
9
|
+
const network = networks.testnet;
|
|
10
|
+
const rpc = new BitcoinRPC();
|
|
11
|
+
const wBtc = new wBTC(network);
|
|
12
|
+
const wallet = new Wallet(Testnet.wallet, network);
|
|
13
|
+
const utxoManager = new UTXOManager('https://testnet.opnet.org');
|
|
14
|
+
const factory = new TransactionFactory();
|
|
15
|
+
const abiCoder = new ABICoder();
|
|
16
|
+
const transferSelector = Number(`0x` + abiCoder.encodeSelector('transfer'));
|
|
17
|
+
function getTransferToCalldata(to, amount) {
|
|
18
|
+
const addCalldata = new BinaryWriter();
|
|
19
|
+
addCalldata.writeSelector(transferSelector);
|
|
20
|
+
addCalldata.writeAddress(to);
|
|
21
|
+
addCalldata.writeU256(amount);
|
|
22
|
+
return Buffer.from(addCalldata.getBuffer());
|
|
23
|
+
}
|
|
24
|
+
const shouldMineBlock = false;
|
|
25
|
+
async function mineBlock() {
|
|
26
|
+
const ok = await rpc.generateToAddress(1, wallet.p2wpkh, 'default');
|
|
27
|
+
if (!ok) {
|
|
28
|
+
throw new Error('Could not mine block');
|
|
29
|
+
}
|
|
30
|
+
console.log(`Mined block`, ok);
|
|
31
|
+
return !!ok.length;
|
|
32
|
+
}
|
|
33
|
+
(async () => {
|
|
34
|
+
await rpc.init(Testnet.config);
|
|
35
|
+
const utxoSetting = {
|
|
36
|
+
address: wallet.p2wpkh,
|
|
37
|
+
minAmount: 10000n,
|
|
38
|
+
requestedAmount: 100000n,
|
|
39
|
+
};
|
|
40
|
+
const utxos = await utxoManager.fetchUTXO(utxoSetting);
|
|
41
|
+
console.log(`UTXOs:`, utxos);
|
|
42
|
+
if (!utxos) {
|
|
43
|
+
throw new Error('No UTXOs found');
|
|
44
|
+
}
|
|
45
|
+
const calldata = getTransferToCalldata('tb1pt3ncc5ktfzpry2uvnag06v3jkv4quvmdydf09q8fx6rkgd7f5s8q3aenuk', 5000000n);
|
|
46
|
+
const interactionParameters = {
|
|
47
|
+
from: wallet.p2wpkh,
|
|
48
|
+
to: wBtc.getAddress(),
|
|
49
|
+
utxos: utxos,
|
|
50
|
+
signer: wallet.keypair,
|
|
51
|
+
network: network,
|
|
52
|
+
feeRate: 150,
|
|
53
|
+
priorityFee: 50000n,
|
|
54
|
+
calldata: calldata,
|
|
55
|
+
};
|
|
56
|
+
const finalTx = factory.signInteraction(interactionParameters);
|
|
57
|
+
const firstTxBroadcast = await rpc.sendRawTransaction({
|
|
58
|
+
hexstring: finalTx[0],
|
|
59
|
+
});
|
|
60
|
+
console.log(`First transaction broadcasted: ${firstTxBroadcast}`);
|
|
61
|
+
if (!firstTxBroadcast) {
|
|
62
|
+
throw new Error('Could not broadcast first transaction');
|
|
63
|
+
}
|
|
64
|
+
const secondTxBroadcast = await rpc.sendRawTransaction({
|
|
65
|
+
hexstring: finalTx[1],
|
|
66
|
+
});
|
|
67
|
+
console.log(`Second transaction broadcasted: ${secondTxBroadcast}`);
|
|
68
|
+
if (!secondTxBroadcast) {
|
|
69
|
+
throw new Error('Could not broadcast second transaction');
|
|
70
|
+
}
|
|
71
|
+
if (shouldMineBlock) {
|
|
72
|
+
await mineBlock();
|
|
73
|
+
}
|
|
74
|
+
})();
|
|
@@ -5,7 +5,8 @@ import { TransactionType } from '../enums/TransactionType.js';
|
|
|
5
5
|
import { IFundingTransactionParameters, ITransactionParameters } from '../interfaces/ITransactionParameters.js';
|
|
6
6
|
import { Address } from '@btc-vision/bsi-binary';
|
|
7
7
|
import { UTXO } from '../../utxo/interfaces/IUTXO.js';
|
|
8
|
-
|
|
8
|
+
import { Logger } from '@btc-vision/logger';
|
|
9
|
+
export declare abstract class TransactionBuilder<T extends TransactionType> extends Logger {
|
|
9
10
|
protected static readonly LOCK_LEAF_SCRIPT: Buffer;
|
|
10
11
|
protected static readonly MINIMUM_DUST: bigint;
|
|
11
12
|
abstract readonly type: T;
|
|
@@ -3,7 +3,8 @@ import { varuint } from 'bitcoinjs-lib/src/bufferutils.js';
|
|
|
3
3
|
import { toXOnly } from 'bitcoinjs-lib/src/psbt/bip371.js';
|
|
4
4
|
import * as ecc from 'tiny-secp256k1';
|
|
5
5
|
import { EcKeyPair } from '../../keypair/EcKeyPair.js';
|
|
6
|
-
|
|
6
|
+
import { Logger } from '@btc-vision/logger';
|
|
7
|
+
export class TransactionBuilder extends Logger {
|
|
7
8
|
static LOCK_LEAF_SCRIPT = script.compile([opcodes.OP_0]);
|
|
8
9
|
static MINIMUM_DUST = 330n;
|
|
9
10
|
logColor = '#785def';
|
|
@@ -26,6 +27,7 @@ export class TransactionBuilder {
|
|
|
26
27
|
from;
|
|
27
28
|
_maximumFeeRate = 100000000;
|
|
28
29
|
constructor(parameters) {
|
|
30
|
+
super();
|
|
29
31
|
this.signer = parameters.signer;
|
|
30
32
|
this.network = parameters.network;
|
|
31
33
|
this.feeRate = parameters.feeRate;
|
|
@@ -121,7 +123,7 @@ export class TransactionBuilder {
|
|
|
121
123
|
});
|
|
122
124
|
return;
|
|
123
125
|
}
|
|
124
|
-
|
|
126
|
+
this.warn(`Amount to send back is less than the minimum dust, will be consumed in fees instead.`);
|
|
125
127
|
}
|
|
126
128
|
getTransactionOPNetFee() {
|
|
127
129
|
if (this.priorityFee > TransactionBuilder.MINIMUM_DUST) {
|
|
@@ -265,7 +267,7 @@ export class TransactionBuilder {
|
|
|
265
267
|
}
|
|
266
268
|
catch (e) {
|
|
267
269
|
const err = e;
|
|
268
|
-
|
|
270
|
+
this.error(`[internalBuildTransaction] Something went wrong while getting building the transaction: ${err.stack}`);
|
|
269
271
|
}
|
|
270
272
|
return false;
|
|
271
273
|
}
|
|
@@ -1,183 +1,183 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BitcoinUtils | OPNet</title><meta name="description" content="Documentation for OPNet"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><style>
|
|
2
|
-
@media (prefers-color-scheme: dark) {
|
|
3
|
-
:root {
|
|
4
|
-
--md-sys-color-primary: #f6be46;
|
|
5
|
-
--md-sys-color-on-primary: #412d00;
|
|
6
|
-
--md-sys-color-primary-container: #5d4200;
|
|
7
|
-
--md-sys-color-on-primary-container: #ffdea3;
|
|
8
|
-
--md-sys-color-secondary: #d9c4a0;
|
|
9
|
-
--md-sys-color-on-secondary: #3b2f15;
|
|
10
|
-
--md-sys-color-secondary-container: #53452a;
|
|
11
|
-
--md-sys-color-on-secondary-container: #f6e0bb;
|
|
12
|
-
--md-sys-color-tertiary: #b2cfa8;
|
|
13
|
-
--md-sys-color-on-tertiary: #1e361a;
|
|
14
|
-
--md-sys-color-tertiary-container: #344d2f;
|
|
15
|
-
--md-sys-color-on-tertiary-container: #cdebc2;
|
|
16
|
-
--md-sys-color-error: #ffb4ab;
|
|
17
|
-
--md-sys-color-on-error: #690005;
|
|
18
|
-
--md-sys-color-error-container: #93000a;
|
|
19
|
-
--md-sys-color-on-error-container: #ffb4ab;
|
|
20
|
-
--md-sys-color-background: #1e1b16;
|
|
21
|
-
--md-sys-color-on-background: #e9e1d9;
|
|
22
|
-
--md-sys-color-surface: #1e1b16;
|
|
23
|
-
--md-sys-color-on-surface: #e9e1d9;
|
|
24
|
-
--md-sys-color-surface-variant: #4e4639;
|
|
25
|
-
--md-sys-color-on-surface-variant: #d1c5b4;
|
|
26
|
-
--md-sys-color-outline: #9a8f80;
|
|
27
|
-
--md-sys-color-outline-variant: #4e4639;
|
|
28
|
-
--md-sys-color-shadow: #000000;
|
|
29
|
-
--md-sys-color-scrim: #000000;
|
|
30
|
-
--md-sys-color-inverse-surface: #e9e1d9;
|
|
31
|
-
--md-sys-color-inverse-on-surface: #34302a;
|
|
32
|
-
--md-sys-color-inverse-primary: #7a5900;
|
|
33
|
-
--md-sys-color-surface-dim: #16130e;
|
|
34
|
-
--md-sys-color-surface-bright: #3d3933;
|
|
35
|
-
--md-sys-color-surface-container-lowest: #110e09;
|
|
36
|
-
--md-sys-color-surface-container-low: #1e1b16;
|
|
37
|
-
--md-sys-color-surface-container: #221f1a;
|
|
38
|
-
--md-sys-color-surface-container-high: #2d2924;
|
|
39
|
-
--md-sys-color-surface-container-highest: #38342e
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
:root[data-theme="dark"] {
|
|
43
|
-
--md-sys-color-primary: #f6be46;
|
|
44
|
-
--md-sys-color-on-primary: #412d00;
|
|
45
|
-
--md-sys-color-primary-container: #5d4200;
|
|
46
|
-
--md-sys-color-on-primary-container: #ffdea3;
|
|
47
|
-
--md-sys-color-secondary: #d9c4a0;
|
|
48
|
-
--md-sys-color-on-secondary: #3b2f15;
|
|
49
|
-
--md-sys-color-secondary-container: #53452a;
|
|
50
|
-
--md-sys-color-on-secondary-container: #f6e0bb;
|
|
51
|
-
--md-sys-color-tertiary: #b2cfa8;
|
|
52
|
-
--md-sys-color-on-tertiary: #1e361a;
|
|
53
|
-
--md-sys-color-tertiary-container: #344d2f;
|
|
54
|
-
--md-sys-color-on-tertiary-container: #cdebc2;
|
|
55
|
-
--md-sys-color-error: #ffb4ab;
|
|
56
|
-
--md-sys-color-on-error: #690005;
|
|
57
|
-
--md-sys-color-error-container: #93000a;
|
|
58
|
-
--md-sys-color-on-error-container: #ffb4ab;
|
|
59
|
-
--md-sys-color-background: #1e1b16;
|
|
60
|
-
--md-sys-color-on-background: #e9e1d9;
|
|
61
|
-
--md-sys-color-surface: #1e1b16;
|
|
62
|
-
--md-sys-color-on-surface: #e9e1d9;
|
|
63
|
-
--md-sys-color-surface-variant: #4e4639;
|
|
64
|
-
--md-sys-color-on-surface-variant: #d1c5b4;
|
|
65
|
-
--md-sys-color-outline: #9a8f80;
|
|
66
|
-
--md-sys-color-outline-variant: #4e4639;
|
|
67
|
-
--md-sys-color-shadow: #000000;
|
|
68
|
-
--md-sys-color-scrim: #000000;
|
|
69
|
-
--md-sys-color-inverse-surface: #e9e1d9;
|
|
70
|
-
--md-sys-color-inverse-on-surface: #34302a;
|
|
71
|
-
--md-sys-color-inverse-primary: #7a5900;
|
|
72
|
-
--md-sys-color-surface-dim: #16130e;
|
|
73
|
-
--md-sys-color-surface-bright: #3d3933;
|
|
74
|
-
--md-sys-color-surface-container-lowest: #110e09;
|
|
75
|
-
--md-sys-color-surface-container-low: #1e1b16;
|
|
76
|
-
--md-sys-color-surface-container: #221f1a;
|
|
77
|
-
--md-sys-color-surface-container-high: #2d2924;
|
|
78
|
-
--md-sys-color-surface-container-highest: #38342e
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
@media (prefers-color-scheme: light) {
|
|
82
|
-
:root {
|
|
83
|
-
--md-sys-color-primary: #7a5900;
|
|
84
|
-
--md-sys-color-on-primary: #ffffff;
|
|
85
|
-
--md-sys-color-primary-container: #ffdea3;
|
|
86
|
-
--md-sys-color-on-primary-container: #261900;
|
|
87
|
-
--md-sys-color-secondary: #6c5c3f;
|
|
88
|
-
--md-sys-color-on-secondary: #ffffff;
|
|
89
|
-
--md-sys-color-secondary-container: #f6e0bb;
|
|
90
|
-
--md-sys-color-on-secondary-container: #251a04;
|
|
91
|
-
--md-sys-color-tertiary: #4b6545;
|
|
92
|
-
--md-sys-color-on-tertiary: #ffffff;
|
|
93
|
-
--md-sys-color-tertiary-container: #cdebc2;
|
|
94
|
-
--md-sys-color-on-tertiary-container: #092007;
|
|
95
|
-
--md-sys-color-error: #ba1a1a;
|
|
96
|
-
--md-sys-color-on-error: #ffffff;
|
|
97
|
-
--md-sys-color-error-container: #ffdad6;
|
|
98
|
-
--md-sys-color-on-error-container: #410002;
|
|
99
|
-
--md-sys-color-background: #fffbff;
|
|
100
|
-
--md-sys-color-on-background: #1e1b16;
|
|
101
|
-
--md-sys-color-surface: #fffbff;
|
|
102
|
-
--md-sys-color-on-surface: #1e1b16;
|
|
103
|
-
--md-sys-color-surface-variant: #ede1cf;
|
|
104
|
-
--md-sys-color-on-surface-variant: #4e4639;
|
|
105
|
-
--md-sys-color-outline: #7f7667;
|
|
106
|
-
--md-sys-color-outline-variant: #d1c5b4;
|
|
107
|
-
--md-sys-color-shadow: #000000;
|
|
108
|
-
--md-sys-color-scrim: #000000;
|
|
109
|
-
--md-sys-color-inverse-surface: #34302a;
|
|
110
|
-
--md-sys-color-inverse-on-surface: #f8efe7;
|
|
111
|
-
--md-sys-color-inverse-primary: #f6be46;
|
|
112
|
-
--md-sys-color-surface-dim: #e1d9d0;
|
|
113
|
-
--md-sys-color-surface-bright: #fff8f2;
|
|
114
|
-
--md-sys-color-surface-container-lowest: #ffffff;
|
|
115
|
-
--md-sys-color-surface-container-low: #fbf2e9;
|
|
116
|
-
--md-sys-color-surface-container: #f5ede4;
|
|
117
|
-
--md-sys-color-surface-container-high: #efe7de;
|
|
118
|
-
--md-sys-color-surface-container-highest: #e9e1d9
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
:root[data-theme="light"] {
|
|
122
|
-
--md-sys-color-primary: #7a5900;
|
|
123
|
-
--md-sys-color-on-primary: #ffffff;
|
|
124
|
-
--md-sys-color-primary-container: #ffdea3;
|
|
125
|
-
--md-sys-color-on-primary-container: #261900;
|
|
126
|
-
--md-sys-color-secondary: #6c5c3f;
|
|
127
|
-
--md-sys-color-on-secondary: #ffffff;
|
|
128
|
-
--md-sys-color-secondary-container: #f6e0bb;
|
|
129
|
-
--md-sys-color-on-secondary-container: #251a04;
|
|
130
|
-
--md-sys-color-tertiary: #4b6545;
|
|
131
|
-
--md-sys-color-on-tertiary: #ffffff;
|
|
132
|
-
--md-sys-color-tertiary-container: #cdebc2;
|
|
133
|
-
--md-sys-color-on-tertiary-container: #092007;
|
|
134
|
-
--md-sys-color-error: #ba1a1a;
|
|
135
|
-
--md-sys-color-on-error: #ffffff;
|
|
136
|
-
--md-sys-color-error-container: #ffdad6;
|
|
137
|
-
--md-sys-color-on-error-container: #410002;
|
|
138
|
-
--md-sys-color-background: #fffbff;
|
|
139
|
-
--md-sys-color-on-background: #1e1b16;
|
|
140
|
-
--md-sys-color-surface: #fffbff;
|
|
141
|
-
--md-sys-color-on-surface: #1e1b16;
|
|
142
|
-
--md-sys-color-surface-variant: #ede1cf;
|
|
143
|
-
--md-sys-color-on-surface-variant: #4e4639;
|
|
144
|
-
--md-sys-color-outline: #7f7667;
|
|
145
|
-
--md-sys-color-outline-variant: #d1c5b4;
|
|
146
|
-
--md-sys-color-shadow: #000000;
|
|
147
|
-
--md-sys-color-scrim: #000000;
|
|
148
|
-
--md-sys-color-inverse-surface: #34302a;
|
|
149
|
-
--md-sys-color-inverse-on-surface: #f8efe7;
|
|
150
|
-
--md-sys-color-inverse-primary: #f6be46;
|
|
151
|
-
--md-sys-color-surface-dim: #e1d9d0;
|
|
152
|
-
--md-sys-color-surface-bright: #fff8f2;
|
|
153
|
-
--md-sys-color-surface-container-lowest: #ffffff;
|
|
154
|
-
--md-sys-color-surface-container-low: #fbf2e9;
|
|
155
|
-
--md-sys-color-surface-container: #f5ede4;
|
|
156
|
-
--md-sys-color-surface-container-high: #efe7de;
|
|
157
|
-
--md-sys-color-surface-container-highest: #e9e1d9
|
|
158
|
-
}
|
|
159
|
-
</style><link rel="stylesheet" href="../assets/material-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">OPNet</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">OPNet</a></li><li><a href="BitcoinUtils.html">BitcoinUtils</a></li></ul><h1>Class BitcoinUtils</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Utility class for Bitcoin related functions</p>
|
|
160
|
-
</div><div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/btc-vision/transaction/blob/
|
|
161
|
-
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="BitcoinUtils.html#btcToSatoshi" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>btc<wbr/>To<wbr/>Satoshi</span></a>
|
|
162
|
-
<a href="BitcoinUtils.html#rndBytes" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>rnd<wbr/>Bytes</span></a>
|
|
163
|
-
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_BitcoinUtils" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Bitcoin<wbr/>Utils</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="BitcoinUtils.html" class="tsd-signature-type tsd-kind-class">BitcoinUtils</a><a href="#constructor.new_BitcoinUtils" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="BitcoinUtils.html" class="tsd-signature-type tsd-kind-class">BitcoinUtils</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member"><a id="btcToSatoshi" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>btc<wbr/>To<wbr/>Satoshi</span><a href="#btcToSatoshi" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="btcToSatoshi.btcToSatoshi-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">btc<wbr/>To<wbr/>Satoshi</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">btc</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">BigInt</span><a href="#btcToSatoshi.btcToSatoshi-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Converts satoshi to BTC</p>
|
|
164
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">btc</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The amount in BTC</p>
|
|
165
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">BigInt</span></h4><p>The amount in satoshi</p>
|
|
166
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/btc-vision/transaction/blob/
|
|
167
|
-
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Buffer</span></h4><p>The random bytes</p>
|
|
168
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/btc-vision/transaction/blob/
|
|
169
|
-
try {
|
|
170
|
-
const generateLinkElement = document.querySelector(".tsd-generator a");
|
|
171
|
-
const link = document.createElement("a");
|
|
172
|
-
Object.assign(link, {
|
|
173
|
-
href: "https://github.com/dmnsgn/typedoc-material-theme",
|
|
174
|
-
target: "_blank",
|
|
175
|
-
rel: "noreferrer",
|
|
176
|
-
innerText: "typedoc-material-theme."
|
|
177
|
-
});
|
|
178
|
-
generateLinkElement.insertAdjacentElement("afterend", link);
|
|
179
|
-
generateLinkElement.insertAdjacentText("afterend", " with ");
|
|
180
|
-
} catch (error) {
|
|
181
|
-
|
|
182
|
-
}
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BitcoinUtils | OPNet</title><meta name="description" content="Documentation for OPNet"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><style>
|
|
2
|
+
@media (prefers-color-scheme: dark) {
|
|
3
|
+
:root {
|
|
4
|
+
--md-sys-color-primary: #f6be46;
|
|
5
|
+
--md-sys-color-on-primary: #412d00;
|
|
6
|
+
--md-sys-color-primary-container: #5d4200;
|
|
7
|
+
--md-sys-color-on-primary-container: #ffdea3;
|
|
8
|
+
--md-sys-color-secondary: #d9c4a0;
|
|
9
|
+
--md-sys-color-on-secondary: #3b2f15;
|
|
10
|
+
--md-sys-color-secondary-container: #53452a;
|
|
11
|
+
--md-sys-color-on-secondary-container: #f6e0bb;
|
|
12
|
+
--md-sys-color-tertiary: #b2cfa8;
|
|
13
|
+
--md-sys-color-on-tertiary: #1e361a;
|
|
14
|
+
--md-sys-color-tertiary-container: #344d2f;
|
|
15
|
+
--md-sys-color-on-tertiary-container: #cdebc2;
|
|
16
|
+
--md-sys-color-error: #ffb4ab;
|
|
17
|
+
--md-sys-color-on-error: #690005;
|
|
18
|
+
--md-sys-color-error-container: #93000a;
|
|
19
|
+
--md-sys-color-on-error-container: #ffb4ab;
|
|
20
|
+
--md-sys-color-background: #1e1b16;
|
|
21
|
+
--md-sys-color-on-background: #e9e1d9;
|
|
22
|
+
--md-sys-color-surface: #1e1b16;
|
|
23
|
+
--md-sys-color-on-surface: #e9e1d9;
|
|
24
|
+
--md-sys-color-surface-variant: #4e4639;
|
|
25
|
+
--md-sys-color-on-surface-variant: #d1c5b4;
|
|
26
|
+
--md-sys-color-outline: #9a8f80;
|
|
27
|
+
--md-sys-color-outline-variant: #4e4639;
|
|
28
|
+
--md-sys-color-shadow: #000000;
|
|
29
|
+
--md-sys-color-scrim: #000000;
|
|
30
|
+
--md-sys-color-inverse-surface: #e9e1d9;
|
|
31
|
+
--md-sys-color-inverse-on-surface: #34302a;
|
|
32
|
+
--md-sys-color-inverse-primary: #7a5900;
|
|
33
|
+
--md-sys-color-surface-dim: #16130e;
|
|
34
|
+
--md-sys-color-surface-bright: #3d3933;
|
|
35
|
+
--md-sys-color-surface-container-lowest: #110e09;
|
|
36
|
+
--md-sys-color-surface-container-low: #1e1b16;
|
|
37
|
+
--md-sys-color-surface-container: #221f1a;
|
|
38
|
+
--md-sys-color-surface-container-high: #2d2924;
|
|
39
|
+
--md-sys-color-surface-container-highest: #38342e
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
:root[data-theme="dark"] {
|
|
43
|
+
--md-sys-color-primary: #f6be46;
|
|
44
|
+
--md-sys-color-on-primary: #412d00;
|
|
45
|
+
--md-sys-color-primary-container: #5d4200;
|
|
46
|
+
--md-sys-color-on-primary-container: #ffdea3;
|
|
47
|
+
--md-sys-color-secondary: #d9c4a0;
|
|
48
|
+
--md-sys-color-on-secondary: #3b2f15;
|
|
49
|
+
--md-sys-color-secondary-container: #53452a;
|
|
50
|
+
--md-sys-color-on-secondary-container: #f6e0bb;
|
|
51
|
+
--md-sys-color-tertiary: #b2cfa8;
|
|
52
|
+
--md-sys-color-on-tertiary: #1e361a;
|
|
53
|
+
--md-sys-color-tertiary-container: #344d2f;
|
|
54
|
+
--md-sys-color-on-tertiary-container: #cdebc2;
|
|
55
|
+
--md-sys-color-error: #ffb4ab;
|
|
56
|
+
--md-sys-color-on-error: #690005;
|
|
57
|
+
--md-sys-color-error-container: #93000a;
|
|
58
|
+
--md-sys-color-on-error-container: #ffb4ab;
|
|
59
|
+
--md-sys-color-background: #1e1b16;
|
|
60
|
+
--md-sys-color-on-background: #e9e1d9;
|
|
61
|
+
--md-sys-color-surface: #1e1b16;
|
|
62
|
+
--md-sys-color-on-surface: #e9e1d9;
|
|
63
|
+
--md-sys-color-surface-variant: #4e4639;
|
|
64
|
+
--md-sys-color-on-surface-variant: #d1c5b4;
|
|
65
|
+
--md-sys-color-outline: #9a8f80;
|
|
66
|
+
--md-sys-color-outline-variant: #4e4639;
|
|
67
|
+
--md-sys-color-shadow: #000000;
|
|
68
|
+
--md-sys-color-scrim: #000000;
|
|
69
|
+
--md-sys-color-inverse-surface: #e9e1d9;
|
|
70
|
+
--md-sys-color-inverse-on-surface: #34302a;
|
|
71
|
+
--md-sys-color-inverse-primary: #7a5900;
|
|
72
|
+
--md-sys-color-surface-dim: #16130e;
|
|
73
|
+
--md-sys-color-surface-bright: #3d3933;
|
|
74
|
+
--md-sys-color-surface-container-lowest: #110e09;
|
|
75
|
+
--md-sys-color-surface-container-low: #1e1b16;
|
|
76
|
+
--md-sys-color-surface-container: #221f1a;
|
|
77
|
+
--md-sys-color-surface-container-high: #2d2924;
|
|
78
|
+
--md-sys-color-surface-container-highest: #38342e
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (prefers-color-scheme: light) {
|
|
82
|
+
:root {
|
|
83
|
+
--md-sys-color-primary: #7a5900;
|
|
84
|
+
--md-sys-color-on-primary: #ffffff;
|
|
85
|
+
--md-sys-color-primary-container: #ffdea3;
|
|
86
|
+
--md-sys-color-on-primary-container: #261900;
|
|
87
|
+
--md-sys-color-secondary: #6c5c3f;
|
|
88
|
+
--md-sys-color-on-secondary: #ffffff;
|
|
89
|
+
--md-sys-color-secondary-container: #f6e0bb;
|
|
90
|
+
--md-sys-color-on-secondary-container: #251a04;
|
|
91
|
+
--md-sys-color-tertiary: #4b6545;
|
|
92
|
+
--md-sys-color-on-tertiary: #ffffff;
|
|
93
|
+
--md-sys-color-tertiary-container: #cdebc2;
|
|
94
|
+
--md-sys-color-on-tertiary-container: #092007;
|
|
95
|
+
--md-sys-color-error: #ba1a1a;
|
|
96
|
+
--md-sys-color-on-error: #ffffff;
|
|
97
|
+
--md-sys-color-error-container: #ffdad6;
|
|
98
|
+
--md-sys-color-on-error-container: #410002;
|
|
99
|
+
--md-sys-color-background: #fffbff;
|
|
100
|
+
--md-sys-color-on-background: #1e1b16;
|
|
101
|
+
--md-sys-color-surface: #fffbff;
|
|
102
|
+
--md-sys-color-on-surface: #1e1b16;
|
|
103
|
+
--md-sys-color-surface-variant: #ede1cf;
|
|
104
|
+
--md-sys-color-on-surface-variant: #4e4639;
|
|
105
|
+
--md-sys-color-outline: #7f7667;
|
|
106
|
+
--md-sys-color-outline-variant: #d1c5b4;
|
|
107
|
+
--md-sys-color-shadow: #000000;
|
|
108
|
+
--md-sys-color-scrim: #000000;
|
|
109
|
+
--md-sys-color-inverse-surface: #34302a;
|
|
110
|
+
--md-sys-color-inverse-on-surface: #f8efe7;
|
|
111
|
+
--md-sys-color-inverse-primary: #f6be46;
|
|
112
|
+
--md-sys-color-surface-dim: #e1d9d0;
|
|
113
|
+
--md-sys-color-surface-bright: #fff8f2;
|
|
114
|
+
--md-sys-color-surface-container-lowest: #ffffff;
|
|
115
|
+
--md-sys-color-surface-container-low: #fbf2e9;
|
|
116
|
+
--md-sys-color-surface-container: #f5ede4;
|
|
117
|
+
--md-sys-color-surface-container-high: #efe7de;
|
|
118
|
+
--md-sys-color-surface-container-highest: #e9e1d9
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
:root[data-theme="light"] {
|
|
122
|
+
--md-sys-color-primary: #7a5900;
|
|
123
|
+
--md-sys-color-on-primary: #ffffff;
|
|
124
|
+
--md-sys-color-primary-container: #ffdea3;
|
|
125
|
+
--md-sys-color-on-primary-container: #261900;
|
|
126
|
+
--md-sys-color-secondary: #6c5c3f;
|
|
127
|
+
--md-sys-color-on-secondary: #ffffff;
|
|
128
|
+
--md-sys-color-secondary-container: #f6e0bb;
|
|
129
|
+
--md-sys-color-on-secondary-container: #251a04;
|
|
130
|
+
--md-sys-color-tertiary: #4b6545;
|
|
131
|
+
--md-sys-color-on-tertiary: #ffffff;
|
|
132
|
+
--md-sys-color-tertiary-container: #cdebc2;
|
|
133
|
+
--md-sys-color-on-tertiary-container: #092007;
|
|
134
|
+
--md-sys-color-error: #ba1a1a;
|
|
135
|
+
--md-sys-color-on-error: #ffffff;
|
|
136
|
+
--md-sys-color-error-container: #ffdad6;
|
|
137
|
+
--md-sys-color-on-error-container: #410002;
|
|
138
|
+
--md-sys-color-background: #fffbff;
|
|
139
|
+
--md-sys-color-on-background: #1e1b16;
|
|
140
|
+
--md-sys-color-surface: #fffbff;
|
|
141
|
+
--md-sys-color-on-surface: #1e1b16;
|
|
142
|
+
--md-sys-color-surface-variant: #ede1cf;
|
|
143
|
+
--md-sys-color-on-surface-variant: #4e4639;
|
|
144
|
+
--md-sys-color-outline: #7f7667;
|
|
145
|
+
--md-sys-color-outline-variant: #d1c5b4;
|
|
146
|
+
--md-sys-color-shadow: #000000;
|
|
147
|
+
--md-sys-color-scrim: #000000;
|
|
148
|
+
--md-sys-color-inverse-surface: #34302a;
|
|
149
|
+
--md-sys-color-inverse-on-surface: #f8efe7;
|
|
150
|
+
--md-sys-color-inverse-primary: #f6be46;
|
|
151
|
+
--md-sys-color-surface-dim: #e1d9d0;
|
|
152
|
+
--md-sys-color-surface-bright: #fff8f2;
|
|
153
|
+
--md-sys-color-surface-container-lowest: #ffffff;
|
|
154
|
+
--md-sys-color-surface-container-low: #fbf2e9;
|
|
155
|
+
--md-sys-color-surface-container: #f5ede4;
|
|
156
|
+
--md-sys-color-surface-container-high: #efe7de;
|
|
157
|
+
--md-sys-color-surface-container-highest: #e9e1d9
|
|
158
|
+
}
|
|
159
|
+
</style><link rel="stylesheet" href="../assets/material-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">OPNet</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">OPNet</a></li><li><a href="BitcoinUtils.html">BitcoinUtils</a></li></ul><h1>Class BitcoinUtils</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Utility class for Bitcoin related functions</p>
|
|
160
|
+
</div><div class="tsd-comment tsd-typography"></div></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/btc-vision/transaction/blob/f011dd0deb54f4443a605e608559283edd672d6a/src/utils/BitcoinUtils.ts#L4">src/utils/BitcoinUtils.ts:4</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="BitcoinUtils.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
161
|
+
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="BitcoinUtils.html#btcToSatoshi" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>btc<wbr/>To<wbr/>Satoshi</span></a>
|
|
162
|
+
<a href="BitcoinUtils.html#rndBytes" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>rnd<wbr/>Bytes</span></a>
|
|
163
|
+
</div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_BitcoinUtils" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Bitcoin<wbr/>Utils</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="BitcoinUtils.html" class="tsd-signature-type tsd-kind-class">BitcoinUtils</a><a href="#constructor.new_BitcoinUtils" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="BitcoinUtils.html" class="tsd-signature-type tsd-kind-class">BitcoinUtils</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member"><a id="btcToSatoshi" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>btc<wbr/>To<wbr/>Satoshi</span><a href="#btcToSatoshi" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="btcToSatoshi.btcToSatoshi-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">btc<wbr/>To<wbr/>Satoshi</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">btc</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">BigInt</span><a href="#btcToSatoshi.btcToSatoshi-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Converts satoshi to BTC</p>
|
|
164
|
+
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">btc</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The amount in BTC</p>
|
|
165
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">BigInt</span></h4><p>The amount in satoshi</p>
|
|
166
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/btc-vision/transaction/blob/f011dd0deb54f4443a605e608559283edd672d6a/src/utils/BitcoinUtils.ts#L10">src/utils/BitcoinUtils.ts:10</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="rndBytes" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>rnd<wbr/>Bytes</span><a href="#rndBytes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="rndBytes.rndBytes-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">rnd<wbr/>Bytes</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Buffer</span><a href="#rndBytes.rndBytes-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Generates random bytes.</p>
|
|
167
|
+
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Buffer</span></h4><p>The random bytes</p>
|
|
168
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/btc-vision/transaction/blob/f011dd0deb54f4443a605e608559283edd672d6a/src/utils/BitcoinUtils.ts#L19">src/utils/BitcoinUtils.ts:19</a></li></ul></aside></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a><a href="#btcToSatoshi" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>btc<wbr/>To<wbr/>Satoshi</span></a><a href="#rndBytes" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>rnd<wbr/>Bytes</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>OPNet</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div><script>
|
|
169
|
+
try {
|
|
170
|
+
const generateLinkElement = document.querySelector(".tsd-generator a");
|
|
171
|
+
const link = document.createElement("a");
|
|
172
|
+
Object.assign(link, {
|
|
173
|
+
href: "https://github.com/dmnsgn/typedoc-material-theme",
|
|
174
|
+
target: "_blank",
|
|
175
|
+
rel: "noreferrer",
|
|
176
|
+
innerText: "typedoc-material-theme."
|
|
177
|
+
});
|
|
178
|
+
generateLinkElement.insertAdjacentElement("afterend", link);
|
|
179
|
+
generateLinkElement.insertAdjacentText("afterend", " with ");
|
|
180
|
+
} catch (error) {
|
|
181
|
+
|
|
182
|
+
}
|
|
183
183
|
</script></body></html>
|