Skip to content

Commit

Permalink
Removed trash code
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarkhatsko committed Dec 17, 2023
1 parent 340acb1 commit 155cbf1
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/common/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class Wallet extends ethers.Wallet {
} else if (options.privateKey !== "") {
super(options.privateKey, connection);
} else if (options.mnemonic && options.mnemonic.phrase.length > 1) {
super(ethers.Wallet.fromPhrase(options.mnemonic.phrase.join(" ")).privateKey, connection); // options.mnemonic.derivePath
super(ethers.Wallet.fromPhrase(options.mnemonic.phrase.join(" ")).privateKey, connection);
} else {
throw new Error("");
}
Expand Down
1 change: 0 additions & 1 deletion lib/ethers.constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// export const ETHERS_MODULE_OPTIONS = "ETHERS_MODULE_OPTIONS";
export const ETHERS_WALLET_BUILDER_OPTIONS = "ETHERS_WALLET_BUILDER_OPTIONS";
export const ETHERS_CONTRACT_BUILDER_OPTIONS = "ETHERS_CONTRACT_BUILDER_OPTIONS";
export const ETHERS_LISTENER_TYPE = "ETHERS_LISTENER_TYPE";
Expand Down
12 changes: 0 additions & 12 deletions lib/ethers.orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import { OnBlockMetadata } from "./intefaces/on-block-metadata.interface";
import { OnEventMetadata } from "./intefaces/on-event-metadata.interface";
import { BlockListener } from "./listeners/block.listener";
import { EventListener } from "./listeners/event.listener";

// import { ListnerFactory } from "./common/listener-factory";
import { wrapFuncFilterArgs } from "./utils/tools.util";
import { ETHERS_CONNECTION } from "./ethers.constants";
// import { ListnerType } from "./enums/listener-type.enum";

type TargetHost = { target: any };
type RefHost<T> = { ref?: T };
Expand Down Expand Up @@ -41,10 +38,6 @@ export class EthersOrchestrator implements OnApplicationBootstrap, OnApplication
private subscribeOnBlocks() {
for (const key in this.onBlocks) {
const options = this.onBlocks[key];
// options.ref = ListnerFactory.createListener(ListnerType.BLOCK, {
// connection: this.connection,
// callback: data => wrapFuncFilterArgs(data, options.target, options.args),
// });
options.ref = new BlockListener({
connection: this.connection,
callback: (data) => wrapFuncFilterArgs(data, options.target, options.args),
Expand All @@ -56,11 +49,6 @@ export class EthersOrchestrator implements OnApplicationBootstrap, OnApplication
private subscribeOnEvents() {
for (const key in this.onEvents) {
const options = this.onEvents[key];
// options.ref = ListnerFactory.createListener(ListnerType.EVENT, {
// connection: this.connection,
// filter: options.options,
// callback: (data) => wrapFuncFilterArgs(data, options.target, options.args),
// });
options.ref = new EventListener({
connection: this.connection,
filter: options.options,
Expand Down
5 changes: 0 additions & 5 deletions lib/intefaces/ethers-options.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ export interface EthersModuleOptionsContract {
name: string;
contract: typeof Contract;
}

// export interface EthersModuleAsyncOptions extends Pick<ModuleMetadata, "imports" | "providers" | "exports"> {
// inject?: any[];
// useFactory?: (...args: any[]) => EthersModuleOptions | Promise<EthersModuleOptions>;
// }
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nesthers",
"version": "1.0.0",
"version": "0.9.0",
"description": "Nesthers is a convenient integration of the ethers.js library for NestJS",
"author": "Nazar Khatsko <https://github.com/nazarkhatsko>",
"license": "MIT",
Expand Down

0 comments on commit 155cbf1

Please sign in to comment.