DummyProvider
bitcoinjs-lib / DummyProvider
Class: DummyProvider
Defined in: packages/scrypt-ts-btc/src/providers/dummyProvider.ts:12
A DummyProvider is build for test purpose only, it always returns a dummy utxo for getUtxos
request.
Implements
Constructors
new DummyProvider()
new DummyProvider():
DummyProvider
Defined in: packages/scrypt-ts-btc/src/providers/dummyProvider.ts:18
Returns
Methods
addNewUTXO()
addNewUTXO(
utxo
):void
Defined in: packages/scrypt-ts-btc/src/providers/dummyProvider.ts:39
Add a UTXO to the provider
Parameters
utxo
UTXO
Returns
void
Implementation of
broadcast()
broadcast(
txHex
):Promise
\<string
>
Defined in: packages/scrypt-ts-btc/src/providers/dummyProvider.ts:49
Send a raw transaction hex string.
Parameters
txHex
string
Returns
Promise
\<string
>
A promise which resolves to the hash of the transaction that has been sent.
Implementation of
getConfirmations()
getConfirmations(
_txId
):Promise
\<number
>
Defined in: packages/scrypt-ts-btc/src/providers/dummyProvider.ts:46
Query a transaction confirmation
Parameters
_txId
string
Returns
Promise
\<number
>
Implementation of
ChainProvider
.getConfirmations
getFeeRate()
getFeeRate():
Promise
\<number
>
Defined in: packages/scrypt-ts-btc/src/providers/dummyProvider.ts:43
Query current network fee
Returns
Promise
\<number
>
Implementation of
getRawTransaction()
getRawTransaction(
txId
):Promise
\<string
>
Defined in: packages/scrypt-ts-btc/src/providers/dummyProvider.ts:55
Get a transaction raw hex from the network.
Parameters
txId
string
Returns
Promise
\<string
>
The query result with the transaction raw hex.
Implementation of
ChainProvider
.getRawTransaction
getUtxos()
getUtxos(
address
,_options
?):Promise
\<UTXO
[]>
Defined in: packages/scrypt-ts-btc/src/providers/dummyProvider.ts:19
Get a list of the UTXOs.
Parameters
address
string
The address of the returned UTXOs belongs to.
_options?
Returns
Promise
\<UTXO
[]>
A promise which resolves to a list of UTXO for the query options.
Implementation of
markSpent()
markSpent(
txId
,vout
):void
Defined in: packages/scrypt-ts-btc/src/providers/dummyProvider.ts:32
Mark an outpoint as spent
Parameters
txId
string
vout
number
Returns
void