diff --git a/.eslintrc b/.eslintrc index c4f7b53..dce959c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,6 +5,7 @@ "node": true, "mocha": true }, + "parser": "@typescript-eslint/parser", "extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"], "plugins": ["@typescript-eslint"], "rules": { diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 481ae07..083370b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,3 @@ # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners -@0xShisui +@0xShisui @0xhiroshi diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..4dbb73a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,24 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "" +labels: "" +assignees: "" +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/change_request.md b/.github/ISSUE_TEMPLATE/change_request.md new file mode 100644 index 0000000..49d96ba --- /dev/null +++ b/.github/ISSUE_TEMPLATE/change_request.md @@ -0,0 +1,19 @@ +--- +name: Change request +about: Suggest a change +title: "" +labels: "" +assignees: "" +--- + +**Please describe your problem** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/technical_question.md b/.github/ISSUE_TEMPLATE/technical_question.md new file mode 100644 index 0000000..a5f0443 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/technical_question.md @@ -0,0 +1,13 @@ +--- +name: Technical question +about: Technical question about the SDK, how does it work, how to implement, etc... +title: "" +labels: "" +assignees: "" +--- + +**If you couldn't find your answer in the doc** + +- Explain your problem as clearly a possible +- Explain what you tried to do to solve it +- Share your code diff --git a/.nycrc.json b/.nycrc.json index 54e83e9..ee196b2 100644 --- a/.nycrc.json +++ b/.nycrc.json @@ -2,5 +2,6 @@ "extends": "@istanbuljs/nyc-config-typescript", "all": true, "include": ["src/**"], + "exclude": ["src/__tests__/**", "src/constants/**", "src/index.ts", "src/typechain/**"], "reporter": ["html", "text"] } diff --git a/hardhat.config.ts b/hardhat.config.ts index badddde..bdff0f3 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -61,12 +61,12 @@ const config: HardhatUserConfig = { except: ["contracts/tests/*", "@rari-capital"], }, typechain: { - outDir: "typechain", + outDir: "src/typechain", target: "ethers-v5", }, paths: { tests: "src/__tests__", - artifacts: "artifacts", + artifacts: "src/artifacts", sources: "src/contracts", }, }; diff --git a/package.json b/package.json index f7017cc..5fb9ef7 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.11", "main": "dist/index.cjs.js", "module": "dist/index.esm.js", - "types": "dist/src/index.d.ts", + "types": "dist/index.d.ts", "files": [ "dist" ], @@ -14,7 +14,7 @@ }, "scripts": { "doc": "typedoc --plugin typedoc-plugin-markdown", - "prebuild": "rm -rf ./dist && rm -rf artifacts && rm -rf typechain", + "prebuild": "rm -rf ./dist && rm -rf src/artifacts && rm -rf src/typechain", "build:ts": "rollup -c && tsc -d", "build:sc": "hardhat compile", "build": "yarn build:sc && yarn build:ts", diff --git a/src/__tests__/helpers/setup.ts b/src/__tests__/helpers/setup.ts index 132bbb9..21bb2c3 100644 --- a/src/__tests__/helpers/setup.ts +++ b/src/__tests__/helpers/setup.ts @@ -3,19 +3,19 @@ import chai from "chai"; import chaiAsPromised from "chai-as-promised"; import { ethers } from "hardhat"; import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import type { LooksRareAggregator } from "../../../typechain/@looksrare/contracts-aggregator/contracts/LooksRareAggregator"; -import type { ERC20EnabledLooksRareAggregator } from "../../../typechain/@looksrare/contracts-aggregator/contracts/ERC20EnabledLooksRareAggregator"; -import type { LooksRareProxy } from "../../../typechain/@looksrare/contracts-aggregator/contracts/proxies/LooksRareProxy"; -import type { LooksRareV2Proxy } from "../../../typechain/@looksrare/contracts-aggregator/contracts/proxies/LooksRareV2Proxy"; -import type { SeaportProxy } from "../../../typechain/@looksrare/contracts-aggregator/contracts/proxies/SeaportProxy"; -import type { MockERC721 } from "../../../typechain/src/contracts/tests/MockERC721"; -import type { MockERC1155 } from "../../../typechain/src/contracts/tests/MockERC1155"; -import type { MockERC20 } from "../../../typechain/src/contracts/tests/MockERC20"; +import type { LooksRareAggregator } from "../../typechain/@looksrare/contracts-aggregator/contracts/LooksRareAggregator"; +import type { ERC20EnabledLooksRareAggregator } from "../../typechain/@looksrare/contracts-aggregator/contracts/ERC20EnabledLooksRareAggregator"; +import type { LooksRareProxy } from "../../typechain/@looksrare/contracts-aggregator/contracts/proxies/LooksRareProxy"; +import type { LooksRareV2Proxy } from "../../typechain/@looksrare/contracts-aggregator/contracts/proxies/LooksRareV2Proxy"; +import type { SeaportProxy } from "../../typechain/@looksrare/contracts-aggregator/contracts/proxies/SeaportProxy"; +import type { MockERC721 } from "../../typechain/src/contracts/tests/MockERC721"; +import type { MockERC1155 } from "../../typechain/src/contracts/tests/MockERC1155"; +import type { MockERC20 } from "../../typechain/src/contracts/tests/MockERC20"; import { PROXY_EXECUTE_SELECTOR } from "../../constants/selectors"; import { CROSS_CHAIN_SEAPORT_ADDRESS } from "@opensea/seaport-js/lib/constants"; import { addressesByNetwork, SupportedChainId } from "@looksrare/sdk"; -import { TransferManager } from "../../../typechain/@looksrare/contracts-exchange-v2/contracts/TransferManager"; -import { LooksRareProtocol } from "../../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; +import { TransferManager } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/TransferManager"; +import { LooksRareProtocol } from "../../typechain/@looksrare/contracts-exchange-v2/contracts/LooksRareProtocol"; import { Addresses } from "../../constants/addresses"; chai.use(chaiAsPromised); diff --git a/src/utils/calls/aggregator.ts b/src/utils/calls/aggregator.ts index 57dc29a..42a94b9 100644 --- a/src/utils/calls/aggregator.ts +++ b/src/utils/calls/aggregator.ts @@ -1,7 +1,7 @@ import { BigNumber, Contract, PayableOverrides, Signer } from "ethers"; import { TradeData } from "../../types"; import abiLooksRareAggregator from "../../abis/LooksRareAggregator.json"; -import { LooksRareAggregator } from "../../../typechain"; +import { LooksRareAggregator } from "../../typechain"; export const executeETHOrders = async ( signer: Signer, diff --git a/src/utils/calls/erc20.ts b/src/utils/calls/erc20.ts index 66a085d..03f90ec 100644 --- a/src/utils/calls/erc20.ts +++ b/src/utils/calls/erc20.ts @@ -1,6 +1,6 @@ import { BigNumberish, Contract, ethers, Overrides, Signer } from "ethers"; import abiIERC20 from "../../abis/IERC20.json"; -import { IERC20 } from "../../../typechain"; +import { IERC20 } from "../../typechain"; const allowance = ( signerOrProvider: ethers.providers.Provider | Signer, diff --git a/src/utils/calls/erc20EnabledAggregator.ts b/src/utils/calls/erc20EnabledAggregator.ts index 83f13a3..7a4f563 100644 --- a/src/utils/calls/erc20EnabledAggregator.ts +++ b/src/utils/calls/erc20EnabledAggregator.ts @@ -1,7 +1,7 @@ import { BigNumber, Contract, PayableOverrides, Signer } from "ethers"; import { TokenTransfer, TradeData } from "../../types"; import abiERC20EnabledLooksRareAggregator from "../../abis/ERC20EnabledLooksRareAggregator.json"; -import { ERC20EnabledLooksRareAggregator } from "../../../typechain"; +import { ERC20EnabledLooksRareAggregator } from "../../typechain"; export const executeERC20Orders = async ( signer: Signer, diff --git a/tsconfig.json b/tsconfig.json index 60bbaac..a0540a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -99,5 +99,7 @@ /* Completeness */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } + }, + "include": ["src/**/*"], + "exclude": ["src/__tests__/**/*", "src/contracts/**/*", "src/artifacts/**/*"] }