# MempoolBitcoinRpc

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:65](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L65)

Bitcoin RPC implementation via Mempool.space API

## Implements

* [`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md)<`MempoolBitcoinBlock`>
* [`LightningNetworkApi`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/LightningNetworkApi.md)

## Constructors

### Constructor

```
new MempoolBitcoinRpc(urlOrMempoolApi, network): MempoolBitcoinRpc;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:70](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L70)

#### Parameters

| Parameter         | Type                                                                                                                           | Default value            |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------ |
| `urlOrMempoolApi` | `string` \| `string`\[] \| [`MempoolApi`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/MempoolApi.md) | `undefined`              |
| `network`         | [`BitcoinNetwork`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/enumerations/BitcoinNetwork.md)               | `BitcoinNetwork.MAINNET` |

#### Returns

`MempoolBitcoinRpc`

## Properties

### api

```
api: MempoolApi;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:67](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L67)

***

### network

```
network: BTC_NETWORK;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:68](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L68)

## Methods

### checkAddressTxos()

```
checkAddressTxos(address, txoHash): Promise<{

  tx: Omit<BtcTxWithBlockheight, "hex" | "raw">;

  vout: number;

}>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:294](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L294)

Checks if an address received the transaction with the required txoHash, returns info about that specific transaction if found, or null if not found

#### Parameters

| Parameter | Type     | Description                                 |
| --------- | -------- | ------------------------------------------- |
| `address` | `string` | Address that should receive the transaction |
| `txoHash` | `Buffer` | Required output txoHash                     |

#### Returns

`Promise`<{ `tx`: `Omit`<`BtcTxWithBlockheight`, `"hex"` | `"raw"`>; `vout`: `number`; }>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`checkAddressTxos`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#checkaddresstxos)

***

### getAddressBalances()

```
getAddressBalances(address): Promise<{

  confirmedBalance: bigint;

  unconfirmedBalance: bigint;

}>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:467](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L467)

Returns confirmed & unconfirmed balances for a given wallet address

#### Parameters

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `address` | `string` |             |

#### Returns

`Promise`<{ `confirmedBalance`: `bigint`; `unconfirmedBalance`: `bigint`; }>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getAddressBalances`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getaddressbalances)

***

### getAddressUTXOs()

```
getAddressUTXOs(address): Promise<object[]>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:477](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L477)

Returns UTXOs owned by the given wallet address

#### Parameters

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `address` | `string` |             |

#### Returns

`Promise`<`object`\[]>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getAddressUTXOs`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getaddressutxos)

***

### getBlockhash()

```
getBlockhash(height): Promise<string>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:260](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L260)

Returns blockhash of a block at a given block height

#### Parameters

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `height`  | `number` |             |

#### Returns

`Promise`<`string`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getBlockhash`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getblockhash)

***

### getBlockHeader()

```
getBlockHeader(blockhash): Promise<MempoolBitcoinBlock>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:218](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L218)

Gets the bitcoin blockheader as identifier by the passed blockhash

#### Parameters

| Parameter   | Type     | Description |
| ----------- | -------- | ----------- |
| `blockhash` | `string` |             |

#### Returns

`Promise`<`MempoolBitcoinBlock`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getBlockHeader`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getblockheader)

***

### getBlockWithTransactions()

```
getBlockWithTransactions(blockhash): Promise<BtcBlockWithTxs>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:267](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L267)

Returns Bitcoin block with all the transactions based on blockhash

#### Parameters

| Parameter   | Type     | Description |
| ----------- | -------- | ----------- |
| `blockhash` | `string` |             |

#### Returns

`Promise`<`BtcBlockWithTxs`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getBlockWithTransactions`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getblockwithtransactions)

***

### getConfirmationDelay()

```
getConfirmationDelay(tx, requiredConfirmations): Promise<number>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:120](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L120)

Returns an estimate after which time the tx will confirm with the required amount of confirmations, confirmationDelay of -1 means the transaction won't confirm in the near future

#### Parameters

| Parameter               | Type                                              | Description |
| ----------------------- | ------------------------------------------------- | ----------- |
| `tx`                    | { `confirmations?`: `number`; `txid`: `string`; } |             |
| `tx.confirmations?`     | `number`                                          | -           |
| `tx.txid`               | `string`                                          | -           |
| `requiredConfirmations` | `number`                                          |             |

#### Returns

`Promise`<`number`>

estimated confirmation delay, -1 if the transaction won't confirm in the near future, null if the transaction was replaced or was confirmed in the meantime

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getConfirmationDelay`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getconfirmationdelay)

***

### getCPFPData()

```
getCPFPData(txId): Promise<{

  adjustedVsize: number;

  effectiveFeePerVsize: number;

}>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:500](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L500)

Returns CPFP (children-pay-for-parent) data for a given transaction, or null if transaction is not found or already confirmed

#### Parameters

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `txId`    | `string` |             |

#### Returns

`Promise`<{ `adjustedVsize`: `number`; `effectiveFeePerVsize`: `number`; }>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getCPFPData`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getcpfpdata)

***

### getEffectiveFeeRate()

```
getEffectiveFeeRate(btcTx): Promise<{

  fee: number;

  feeRate: number;

  vsize: number;

}>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:453](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L453)

Returns an effective fee rate of the provided bitcoin transaction, this takes into consideration the current fee rates of the potential unconfirmed inputs of the transaction that are already in the mempool

#### Parameters

| Parameter | Type    | Description |
| --------- | ------- | ----------- |
| `btcTx`   | `BtcTx` |             |

#### Returns

`Promise`<{ `fee`: `number`; `feeRate`: `number`; `vsize`: `number`; }>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getEffectiveFeeRate`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#geteffectivefeerate)

***

### getFeeRate()

```
getFeeRate(): Promise<number>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:460](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L460)

Returns the current fee rate required for submitted bitcoin transactions in sats/vB

#### Returns

`Promise`<`number`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getFeeRate`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getfeerate)

***

### getLNNodeLiquidity()

```
getLNNodeLiquidity(pubkey): Promise<LNNodeLiquidity>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:399](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L399)

Returns the lightning network's node liquidity as identified by an identity public key

#### Parameters

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `pubkey`  | `string` |             |

#### Returns

`Promise`<`LNNodeLiquidity`>

#### Implementation of

[`LightningNetworkApi`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/LightningNetworkApi.md).[`getLNNodeLiquidity`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/LightningNetworkApi.md#getlnnodeliquidity)

***

### getMerkleProof()

```
getMerkleProof(txId, blockhash): Promise<{

  blockheight: number;

  merkle: Buffer<ArrayBufferLike>[];

  pos: number;

  reversedTxId: Buffer;

}>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:225](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L225)

Returns a merkle proof for a given transaction

#### Parameters

| Parameter   | Type     | Description                                         |
| ----------- | -------- | --------------------------------------------------- |
| `txId`      | `string` | Identifies the transaction                          |
| `blockhash` | `string` | The blockhash in which the transaction was included |

#### Returns

`Promise`<{ `blockheight`: `number`; `merkle`: `Buffer`<`ArrayBufferLike`>\[]; `pos`: `number`; `reversedTxId`: `Buffer`; }>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getMerkleProof`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getmerkleproof)

***

### getSyncInfo()

```
getSyncInfo(): Promise<BtcSyncInfo>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:274](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L274)

Returns the synchronization information of the underlying bitcoin RPC

#### Returns

`Promise`<`BtcSyncInfo`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getSyncInfo`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#getsyncinfo)

***

### getTipHeight()

```
getTipHeight(): Promise<number>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:211](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L211)

Returns the current tip blockheight of bitcoin

#### Returns

`Promise`<`number`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getTipHeight`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#gettipheight)

***

### getTransaction()

```
getTransaction(txId): Promise<BtcTxWithBlockheight>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:243](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L243)

Returns the bitcoin transaction as identified by its txId

#### Parameters

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `txId`    | `string` |             |

#### Returns

`Promise`<`BtcTxWithBlockheight`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`getTransaction`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#gettransaction)

***

### isInMainChain()

```
isInMainChain(blockhash): Promise<boolean>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:252](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L252)

Checks whether a given blockhash is part of the canonical chain

#### Parameters

| Parameter   | Type     | Description |
| ----------- | -------- | ----------- |
| `blockhash` | `string` |             |

#### Returns

`Promise`<`boolean`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`isInMainChain`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#isinmainchain)

***

### isSpent()

```
isSpent(utxo, confirmed?): Promise<boolean>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:426](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L426)

Returns whether a given UTXO is spent or not, returns `false` for non-existing UTXOs

#### Parameters

| Parameter    | Type      | Description                                                         |
| ------------ | --------- | ------------------------------------------------------------------- |
| `utxo`       | `string`  | The UTXO to check, should be in format \[txId]:\[vout]              |
| `confirmed?` | `boolean` | Whether the spent has to be confirmed or can also be in the mempool |

#### Returns

`Promise`<`boolean`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`isSpent`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#isspent)

***

### outputScriptToAddress()

```
outputScriptToAddress(outputScriptHex): Promise<string>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:512](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L512)

Parses a bitcoin address from the passed output script in hexadecimal format

#### Parameters

| Parameter         | Type     | Description |
| ----------------- | -------- | ----------- |
| `outputScriptHex` | `string` |             |

#### Returns

`Promise`<`string`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`outputScriptToAddress`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#outputscripttoaddress)

***

### parseTransaction()

```
parseTransaction(rawTx): Promise<BtcTx>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:440](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L440)

Parses a raw bitcoin transaction

#### Parameters

| Parameter | Type     | Description                             |
| --------- | -------- | --------------------------------------- |
| `rawTx`   | `string` | Hexadecimal-encoded bitcoin transaction |

#### Returns

`Promise`<`BtcTx`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`parseTransaction`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#parsetransaction)

***

### sendRawPackage()

```
sendRawPackage(rawTx): Promise<string[]>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:419](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L419)

Sends a Bitcoin transaction package composed of multiple individual transactions at the same time

#### Parameters

| Parameter | Type        | Description                                          |
| --------- | ----------- | ---------------------------------------------------- |
| `rawTx`   | `string`\[] | An array of hexadecimal-encoded bitcoin transactions |

#### Returns

`Promise`<`string`\[]>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`sendRawPackage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#sendrawpackage)

***

### sendRawTransaction()

```
sendRawTransaction(rawTx): Promise<string>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:412](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L412)

Sends a single raw transaction

#### Parameters

| Parameter | Type     | Description                               |
| --------- | -------- | ----------------------------------------- |
| `rawTx`   | `string` | A hexadecimal-encoded bitcoin transaction |

#### Returns

`Promise`<`string`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`sendRawTransaction`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#sendrawtransaction)

***

### waitForAddressTxo()

```
waitForAddressTxo(

   address, 

   txoHash, 

   requiredConfirmations, 

   stateUpdateCbk, 

   abortSignal?, 

   intervalSeconds?): Promise<{

  tx: Omit<BtcTxWithBlockheight, "hex" | "raw">;

  vout: number;

}>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:326](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L326)

Waits till the address receives a transaction containing a specific txoHash

#### Parameters

| Parameter               | Type                                      | Description                                 |
| ----------------------- | ----------------------------------------- | ------------------------------------------- |
| `address`               | `string`                                  | Address that should receive the transaction |
| `txoHash`               | `Buffer`                                  | Required output txoHash                     |
| `requiredConfirmations` | `number`                                  | Required confirmations of the transaction   |
| `stateUpdateCbk`        | (`btcTx?`, `vout?`, `txEtaMS?`) => `void` | Callback for transaction state updates      |
| `abortSignal?`          | `AbortSignal`                             | Abort signal                                |
| `intervalSeconds?`      | `number`                                  | How often to check new transaction          |

#### Returns

`Promise`<{ `tx`: `Omit`<`BtcTxWithBlockheight`, `"hex"` | `"raw"`>; `vout`: `number`; }>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`waitForAddressTxo`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#waitforaddresstxo)

***

### waitForTransaction()

```
waitForTransaction(

   txId, 

   requiredConfirmations, 

   stateUpdateCbk, 

   abortSignal?, 

intervalSeconds?): Promise<BtcTxWithBlockheight>;
```

Defined in: [atomiq-btc-mempool/src/mempool/MempoolBitcoinRpc.ts:366](https://github.com/atomiqlabs/atomiq-btc-mempool/blob/e49f5f2f2386b969113005e717dd2c9a6de4c47d/src/mempool/MempoolBitcoinRpc.ts#L366)

Awaits till the given transaction gets confirmed

#### Parameters

| Parameter               | Type                             | Description                                                                        |
| ----------------------- | -------------------------------- | ---------------------------------------------------------------------------------- |
| `txId`                  | `string`                         | Transaction ID to monitor                                                          |
| `requiredConfirmations` | `number`                         | Required number of confirmations                                                   |
| `stateUpdateCbk`        | (`btcTx?`, `txEtaMS?`) => `void` | Optional update callback called with the current status of the bitcoin transaction |
| `abortSignal?`          | `AbortSignal`                    |                                                                                    |
| `intervalSeconds?`      | `number`                         | How often to poll                                                                  |

#### Returns

`Promise`<`BtcTxWithBlockheight`>

#### Implementation of

[`BitcoinRpcWithAddressIndex`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md).[`waitForTransaction`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/BitcoinRpcWithAddressIndex.md#waitfortransaction)
