Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #30 from kenryu42/fix-memory-leaks
Browse files Browse the repository at this point in the history
Fix memory leaks
  • Loading branch information
kenryu42 authored Feb 19, 2023
2 parents 05938ec + 934b8b0 commit 604d5e4
Show file tree
Hide file tree
Showing 23 changed files with 714 additions and 687 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,37 @@ npm install enft
- Alchemy API Key - [apply here](https://auth.alchemyapi.io/signup) (**Recommended**)
- **OR**
- Infura NFT (Open Beta) API Key and API Key Secret - [apply here](https://www.infura.io/resources/apis/nft-api-beta-signup)
- [fontconfig](https://www.freedesktop.org/software/fontconfig/fontconfig-user.html) is also required for generating image with text. If your system doesn't have it, please install it first.

**Ubuntu/Debian:**

```bash
sudo apt-get install fontconfig
```

**Fedora/RHEL/CentOS:**

```bash
sudo yum install fontconfig
```

**Arch Linux:**

```bash
sudo pacman -S fontconfig
```

**MacOS (Homebrew):**

```bash
brew install fontconfig
```

**Windows (Chocolatey):**

```bash
choco install fontconfig
```

## Optional

Expand Down
37 changes: 34 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ enft / [Exports](modules.md)
<div id="top"></div>

![GitHub contributors](https://img.shields.io/github/contributors-anon/kenryu42/ethereum-nft-sales-bot)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/kenryu42/ethereum-nft-sales-bot/run-test.yml?branch=main)
[![CI](https://github.com/kenryu42/ethereum-nft-sales-bot/actions/workflows/CI.yml/badge.svg)](https://github.com/kenryu42/ethereum-nft-sales-bot/actions/workflows/CI.yml)
[![Release](https://github.com/kenryu42/ethereum-nft-sales-bot/actions/workflows/release.yml/badge.svg)](https://github.com/kenryu42/ethereum-nft-sales-bot/actions/workflows/release.yml)
![GitHub issues](https://img.shields.io/github/issues-raw/kenryu42/ethereum-nft-sales-bot)
![GitHub pull requests](https://img.shields.io/github/issues-pr/kenryu42/ethereum-nft-sales-bot)
[![GitHub license](https://img.shields.io/github/license/kenryu42/ethereum-nft-sales-bot)](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/main/LICENSE)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

<div align="center">

Expand Down Expand Up @@ -74,6 +74,37 @@ npm install enft
- Alchemy API Key - [apply here](https://auth.alchemyapi.io/signup) (**Recommended**)
- **OR**
- Infura NFT (Open Beta) API Key and API Key Secret - [apply here](https://www.infura.io/resources/apis/nft-api-beta-signup)
- [fontconfig](https://www.freedesktop.org/software/fontconfig/fontconfig-user.html) is also required for generating image with text. If your system doesn't have it, please install it first.

**Ubuntu/Debian:**

```bash
sudo apt-get install fontconfig
```

**Fedora/RHEL/CentOS:**

```bash
sudo yum install fontconfig
```

**Arch Linux:**

```bash
sudo pacman -S fontconfig
```

**MacOS (Homebrew):**

```bash
brew install fontconfig
```

**Windows (Chocolatey):**

```bash
choco install fontconfig
```

## Optional

Expand Down Expand Up @@ -203,7 +234,7 @@ enft.onItemSold({
## Twitter
- [Murakami.Flowers Sales](https://twitter.com/mftm_sales)
- [ENFT SDK](https://twitter.com/enft_sdk)
## Discord
Expand Down
14 changes: 8 additions & 6 deletions docs/classes/Auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@

**new Auth**(`opts`)

The main class for the Auth library.

#### Parameters

| Name | Type |
| :------ | :------ |
| `opts` | [`AuthOptions`](../modules.md#authoptions) |
| Name | Type | Description |
| :------ | :------ | :------ |
| `opts` | [`AuthOptions`](../modules.md#authoptions) | An object containing the authentication options for the Ethereum API providers. |

#### Defined in

Auth/Auth.ts:18
[Auth/Auth.ts:29](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/Auth/Auth.ts#L29)

## Methods

Expand All @@ -52,7 +54,7 @@ Retrieves the API authentication data for the Ethereum API providers.

#### Defined in

Auth/Auth.ts:47
[Auth/Auth.ts:58](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/Auth/Auth.ts#L58)

___

Expand All @@ -72,4 +74,4 @@ Retrieves the Ethereum provider.

#### Defined in

Auth/Auth.ts:38
[Auth/Auth.ts:49](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/Auth/Auth.ts#L49)
18 changes: 13 additions & 5 deletions docs/classes/ENFT.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#### Defined in

ENFT/ENFT.ts:29
[ENFT/ENFT.ts:29](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/ENFT/ENFT.ts#L29)

## Methods

Expand All @@ -45,6 +45,10 @@ Debugs a transaction on the Ethereum blockchain using the provided options.

If the "opts" parameter is missing required properties.

**`Throws`**

If the "transactionHash" property is missing from the "opts" parameter.

#### Parameters

| Name | Type | Description |
Expand All @@ -60,7 +64,7 @@ A promise that resolves with the transaction data if available, otherwise null o

#### Defined in

ENFT/ENFT.ts:80
[ENFT/ENFT.ts:96](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/ENFT/ENFT.ts#L96)

___

Expand All @@ -74,12 +78,16 @@ Subscribes to the sales event of an NFT contract.

**`Function`**

**`Throws`**

If the "opts" parameter is missing required properties.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `opts` | [`ClientOptions`](../interfaces/ClientOptions.md) | Options for the client. |
| `callback?` | [`Callback`](../modules.md#callback)<[`TransactionData`](../modules.md#transactiondata)\> | Callback for the transaction data. |
| `opts` | [`ClientOptions`](../interfaces/ClientOptions.md) | An object containing the options to subscribe to the sales event. |
| `callback?` | [`Callback`](../modules.md#callback)<[`TransactionData`](../modules.md#transactiondata)\> | An optional callback function to execute after the transaction is debugged. |

#### Returns

Expand All @@ -89,4 +97,4 @@ Returns a promise that resolves to a function.

#### Defined in

ENFT/ENFT.ts:46
[ENFT/ENFT.ts:54](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/ENFT/ENFT.ts#L54)
12 changes: 6 additions & 6 deletions docs/enums/ItemType.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#### Defined in

types/enums/seaport.enum.ts:12
[types/enums/seaport.enum.ts:12](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/enums/seaport.enum.ts#L12)

___

Expand All @@ -31,7 +31,7 @@ ___

#### Defined in

types/enums/seaport.enum.ts:18
[types/enums/seaport.enum.ts:18](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/enums/seaport.enum.ts#L18)

___

Expand All @@ -41,7 +41,7 @@ ___

#### Defined in

types/enums/seaport.enum.ts:6
[types/enums/seaport.enum.ts:6](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/enums/seaport.enum.ts#L6)

___

Expand All @@ -51,7 +51,7 @@ ___

#### Defined in

types/enums/seaport.enum.ts:9
[types/enums/seaport.enum.ts:9](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/enums/seaport.enum.ts#L9)

___

Expand All @@ -61,7 +61,7 @@ ___

#### Defined in

types/enums/seaport.enum.ts:15
[types/enums/seaport.enum.ts:15](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/enums/seaport.enum.ts#L15)

___

Expand All @@ -71,4 +71,4 @@ ___

#### Defined in

types/enums/seaport.enum.ts:3
[types/enums/seaport.enum.ts:3](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/enums/seaport.enum.ts#L3)
24 changes: 15 additions & 9 deletions docs/interfaces/ApiOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Interface: ApiOptions

An object containing the authentication options for the Ethereum API providers.

## Table of contents

### Properties
Expand All @@ -15,29 +17,33 @@

`Optional` **alchemy**: `Object`

Alchemy object with API key (required if no Infura key is provided)

#### Type declaration

| Name | Type |
| :------ | :------ |
| `apiKey` | `string` |
| Name | Type | Description |
| :------ | :------ | :------ |
| `apiKey` | `string` | The Alchemy API key. |

#### Defined in

types/interfaces/auth.interface.ts:22
[types/interfaces/auth.interface.ts:26](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/interfaces/auth.interface.ts#L26)

___

### infura

`Optional` **infura**: `Object`

Infura object with API key and secret (required if no Alchemy key is provided)

#### Type declaration

| Name | Type |
| :------ | :------ |
| `apiKey` | `string` |
| `apiKeySecret` | `string` |
| Name | Type | Description |
| :------ | :------ | :------ |
| `apiKey` | `string` | The Infura API key. |
| `apiKeySecret` | `string` | The Infura API key secret. |

#### Defined in

types/interfaces/auth.interface.ts:25
[types/interfaces/auth.interface.ts:31](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/interfaces/auth.interface.ts#L31)
28 changes: 21 additions & 7 deletions docs/interfaces/ClientOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,66 +20,80 @@

**contractAddress**: `string`

NFT contract address (required)

#### Defined in

types/interfaces/enft.interface.ts:9
[types/interfaces/enft.interface.ts:10](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/interfaces/enft.interface.ts#L10)

___

### discordWebhook

`Optional` **discordWebhook**: `string`

Discord webhook for built-in notification (optional)

#### Defined in

types/interfaces/enft.interface.ts:12
[types/interfaces/enft.interface.ts:16](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/interfaces/enft.interface.ts#L16)

___

### etherscanApiKey

`Optional` **etherscanApiKey**: `string`

Etherscan api key for eth to usd conversion (optional)

#### Defined in

types/interfaces/enft.interface.ts:14
[types/interfaces/enft.interface.ts:20](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/interfaces/enft.interface.ts#L20)

___

### test

`Optional` **test**: `boolean`

Test mode (optional)

#### Defined in

types/interfaces/enft.interface.ts:15
[types/interfaces/enft.interface.ts:22](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/interfaces/enft.interface.ts#L22)

___

### tokenType

`Optional` **tokenType**: [`TokenType`](../modules.md#tokentype)

Token type <ERC721, ERC1155> (optional)

#### Defined in

types/interfaces/enft.interface.ts:11
[types/interfaces/enft.interface.ts:14](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/interfaces/enft.interface.ts#L14)

___

### transactionHash

`Optional` **transactionHash**: `string`

Transaction hash (only required for debugTransaction)

#### Defined in

types/interfaces/enft.interface.ts:10
[types/interfaces/enft.interface.ts:12](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/interfaces/enft.interface.ts#L12)

___

### twitterConfig

`Optional` **twitterConfig**: [`TwitterConfig`](TwitterConfig.md)

Twitter api config for built-in notification (optional)

#### Defined in

types/interfaces/enft.interface.ts:13
[types/interfaces/enft.interface.ts:18](https://github.com/kenryu42/ethereum-nft-sales-bot/blob/a276033/src/types/interfaces/enft.interface.ts#L18)
Loading

0 comments on commit 604d5e4

Please sign in to comment.