Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8954b8c5b6 | ||
|
|
3287c2b0f2 | ||
|
|
a5cdd85c77 | ||
|
|
e9e71cfcd8 | ||
|
|
27b3475d64 | ||
|
|
6ba9cad8d8 | ||
|
|
a5ad3d6828 | ||
|
|
9c817de558 |
@@ -17,9 +17,12 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install
|
||||
- name: Install
|
||||
uses: ./.github/composite-actions/install
|
||||
|
||||
- name: Install Playwright
|
||||
run: npx playwright install --with-deps
|
||||
|
||||
- name: Run e2e tests
|
||||
run: yarn e2e
|
||||
env:
|
||||
|
||||
@@ -75,6 +75,6 @@ jobs:
|
||||
- name: Deploy pre-release
|
||||
run: |
|
||||
yarn changeset version --snapshot pr${{ github.event.issue.number }}
|
||||
yarn yarn changeset publish --tag pr${{ github.event.issue.number }} --no-git-tag
|
||||
yarn changeset publish --tag pr${{ github.event.issue.number }} --no-git-tag
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -32,6 +32,7 @@ jobs:
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
publish: yarn release
|
||||
version: yarn version-packages
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
@@ -41,7 +42,7 @@ jobs:
|
||||
if: steps.changesets.outputs.published != 'true'
|
||||
run: |
|
||||
git checkout main
|
||||
yarn version:nightly
|
||||
yarn version-packages:nightly
|
||||
yarn release:nightly
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
+20
-16
@@ -2,7 +2,7 @@
|
||||
"name": "@thirdweb-dev/js",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"repository": "git@github.com:thirdweb-dev/js.git",
|
||||
"repository": "https://github.com/thirdweb-dev/js",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
@@ -11,30 +11,20 @@
|
||||
"packages/*"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/changelog-github": "^0.4.6",
|
||||
"@changesets/cli": "^2.24.3",
|
||||
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
|
||||
"eslint": "^8.23.0",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"prettier": "^2.7.1",
|
||||
"turbo": "latest",
|
||||
"yarn-deduplicate": "^5.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "yarn-deduplicate yarn.lock",
|
||||
"test": "turbo run test",
|
||||
"e2e": "turbo run e2e",
|
||||
"build": "turbo run build",
|
||||
"build:release": "turbo run build --force",
|
||||
"dev": "turbo run dev --no-cache --parallel --continue",
|
||||
"fix:repo": "manypkg fix",
|
||||
"lint": "turbo run lint",
|
||||
"clean": "turbo run clean && rm -rf node_modules",
|
||||
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
||||
"changeset": "changeset",
|
||||
"version": "changeset version",
|
||||
"release": "changeset publish",
|
||||
"version:nightly": "changeset version --snapshot nightly",
|
||||
"version-packages": "changeset version",
|
||||
"release": "node ./scripts/pre-release.mjs && changeset publish",
|
||||
"version-packages:nightly": "changeset version --snapshot nightly",
|
||||
"release:nightly": "changeset publish --tag nightly"
|
||||
},
|
||||
"preconstruct": {
|
||||
@@ -42,5 +32,19 @@
|
||||
"packages/*"
|
||||
]
|
||||
},
|
||||
"packageManager": "[email protected]"
|
||||
"packageManager": "[email protected]",
|
||||
"dependencies": {
|
||||
"@changesets/changelog-github": "^0.4.6",
|
||||
"@changesets/cli": "^2.24.3",
|
||||
"@manypkg/cli": "^0.19.1",
|
||||
"@manypkg/get-packages": "^1.1.3",
|
||||
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
|
||||
"eslint": "^8.21.0",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"prettier": "^2.7.1",
|
||||
"turbo": "latest"
|
||||
},
|
||||
"manypkg": {
|
||||
"defaultBranch": "main"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @thirdweb-dev/auth
|
||||
|
||||
## 1.0.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#61](https://github.com/thirdweb-dev/js/pull/61) [`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6) Thanks [@jnsdls](https://github.com/jnsdls)! - fix versions in dependencies before releasing stable
|
||||
|
||||
- Updated dependencies [[`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6)]:
|
||||
- @thirdweb-dev/sdk@2.4.8
|
||||
|
||||
## 1.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6ba9cad`](https://github.com/thirdweb-dev/js/commit/6ba9cad8d8b933256599dc3b147601cd4828c89b)]:
|
||||
- @thirdweb-dev/sdk@2.4.7
|
||||
|
||||
## 1.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/auth",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.7",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
"./express": {
|
||||
@@ -16,11 +16,7 @@
|
||||
"default": "./next-auth/dist/thirdweb-dev-auth-next-auth.cjs.js"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"directory": "packages/auth",
|
||||
"type": "git",
|
||||
"url": "https://github.com/thirdweb-dev/js.git"
|
||||
},
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/auth",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -54,12 +50,12 @@
|
||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
||||
"@typescript-eslint/parser": "^5.33.0",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-inclusive-language": "^2.2.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-tsdoc": "^0.2.16",
|
||||
"ethers": ">=5.5.1",
|
||||
"ethers": "^5.7.0",
|
||||
"express": "^4.18.1",
|
||||
"next": "12.2.0",
|
||||
"next-auth": "^4.10.3",
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# thirdweb
|
||||
|
||||
## 0.7.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#61](https://github.com/thirdweb-dev/js/pull/61) [`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6) Thanks [@jnsdls](https://github.com/jnsdls)! - fix versions in dependencies before releasing stable
|
||||
|
||||
- [#56](https://github.com/thirdweb-dev/js/pull/56) [`e9e71cf`](https://github.com/thirdweb-dev/js/commit/e9e71cfcd892611cd653431dc433b27532e9e3cc) Thanks [@nachoiacovino](https://github.com/nachoiacovino)! - Add basic tests
|
||||
|
||||
- Updated dependencies [[`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6)]:
|
||||
- @thirdweb-dev/sdk@2.4.8
|
||||
|
||||
## 0.7.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6ba9cad`](https://github.com/thirdweb-dev/js/commit/6ba9cad8d8b933256599dc3b147601cd4828c89b)]:
|
||||
- @thirdweb-dev/sdk@2.4.7
|
||||
|
||||
## 0.7.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
export const CREATE_MESSAGES = {
|
||||
typeOfProject: "What type of project do you want to create?",
|
||||
projectName: "What is your project named?",
|
||||
framework: "What framework do you want to use?",
|
||||
language: "What language do you want to use?",
|
||||
contract: "What contract do you want to start from?",
|
||||
} as const;
|
||||
|
||||
export const ERROR_MESSAGES = {
|
||||
noConfiguration: "Failed to find a supported project configuration file in current directory"
|
||||
}
|
||||
@@ -1,36 +1,34 @@
|
||||
import { prepareEnvironment } from "@gmrchk/cli-testing-library";
|
||||
import { CREATE_MESSAGES } from "../constants/constants";
|
||||
|
||||
// this creates an app, can take some time that's fine
|
||||
jest.setTimeout(120_000);
|
||||
|
||||
describe("npx thirdweb create", () => {
|
||||
it("should create app successfully", async () => {
|
||||
it("should create app (CRA) successfully", async () => {
|
||||
const { spawn, cleanup, exists } = await prepareEnvironment();
|
||||
const {
|
||||
// wait,
|
||||
waitForText,
|
||||
waitForFinish,
|
||||
// getStdout,
|
||||
// getStderr,
|
||||
getExitCode,
|
||||
// debug,
|
||||
pressKey,
|
||||
} = await spawn("node", "./dist/cli/index.js create");
|
||||
|
||||
await waitForText("What type of project do you want to create?");
|
||||
await waitForText(CREATE_MESSAGES.typeOfProject);
|
||||
await pressKey("enter");
|
||||
await waitForText("What is your project named?");
|
||||
await waitForText(CREATE_MESSAGES.projectName);
|
||||
await pressKey("enter");
|
||||
await waitForText("What framework do you want to use?");
|
||||
await waitForText(CREATE_MESSAGES.framework);
|
||||
// select CRA
|
||||
await pressKey("arrowDown");
|
||||
await pressKey("enter");
|
||||
await waitForText("What language do you want to use?");
|
||||
await waitForText(CREATE_MESSAGES.language);
|
||||
await pressKey("enter");
|
||||
|
||||
// wait for program to finish
|
||||
await waitForFinish();
|
||||
|
||||
//check if the app was created
|
||||
// check if the app was created
|
||||
expect(await exists("thirdweb-app/package.json")).toEqual(true);
|
||||
|
||||
// the process should exit with code 0
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import { prepareEnvironment } from "@gmrchk/cli-testing-library";
|
||||
import { copyFile } from "fs/promises";
|
||||
import { resolve } from "path";
|
||||
import { ERROR_MESSAGES } from "../constants/constants";
|
||||
|
||||
// this creates an app, can take some time that's fine
|
||||
jest.setTimeout(120_000);
|
||||
|
||||
describe("npx thirdweb deploy", () => {
|
||||
it("should return deploy page url", async () => {
|
||||
const { spawn, cleanup, exists, path } = await prepareEnvironment();
|
||||
|
||||
await copyFile(resolve("./e2e/files/BasicContract.sol"), `${path}/BasicContract.sol`);
|
||||
|
||||
const {
|
||||
waitForText,
|
||||
waitForFinish,
|
||||
getExitCode,
|
||||
writeText,
|
||||
getStdout,
|
||||
} = await spawn("node", "./dist/cli/index.js deploy");
|
||||
|
||||
expect(await exists("BasicContract.sol")).toEqual(true);
|
||||
|
||||
await waitForText(ERROR_MESSAGES.noConfiguration);
|
||||
await writeText("y")
|
||||
|
||||
// wait for program to finish
|
||||
await waitForFinish();
|
||||
|
||||
expect(getStdout().at(-1)).toContain("https://thirdweb.com/contracts/deploy/");
|
||||
|
||||
// the process should exit with code 0
|
||||
expect(getExitCode()).toEqual(0);
|
||||
|
||||
await cleanup(); // cleanup after test
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,84 @@
|
||||
import { CREATE_MESSAGES } from "../constants/constants";
|
||||
import { prepareEnvironment } from "@gmrchk/cli-testing-library";
|
||||
|
||||
// this creates an app, can take some time that's fine
|
||||
jest.setTimeout(120_000);
|
||||
|
||||
describe("npx thirdweb detect", () => {
|
||||
it("should detect ERC721Base extensions", async () => {
|
||||
const { spawn, cleanup, exists, path } = await prepareEnvironment();
|
||||
const create = await spawn("node", "./dist/cli/index.js create");
|
||||
|
||||
await create.waitForText(CREATE_MESSAGES.typeOfProject);
|
||||
// select contract
|
||||
await create.pressKey("arrowDown");
|
||||
await create.pressKey("enter");
|
||||
await create.waitForText(CREATE_MESSAGES.projectName);
|
||||
// use default name
|
||||
await create.pressKey("enter");
|
||||
await create.waitForText(CREATE_MESSAGES.framework);
|
||||
// select hardhat
|
||||
await create.pressKey("enter");
|
||||
await create.waitForText(CREATE_MESSAGES.contract);
|
||||
// select ERC721Base
|
||||
await create.pressKey("arrowDown");
|
||||
await create.pressKey("enter");
|
||||
|
||||
// wait for program to finish
|
||||
await create.waitForFinish();
|
||||
|
||||
// the process should exit with code 0
|
||||
expect(create.getExitCode()).toEqual(0);
|
||||
|
||||
// check if the contract was created
|
||||
expect(await exists("thirdweb-contracts/contracts/Contract.sol")).toEqual(
|
||||
true,
|
||||
);
|
||||
|
||||
// check that hardhat config exists
|
||||
expect(await exists("thirdweb-contracts/hardhat.config.js")).toEqual(true);
|
||||
|
||||
await create.writeText("cd thirdweb-contracts");
|
||||
await create.pressKey("enter");
|
||||
await create.writeText("npm install");
|
||||
await create.pressKey("enter");
|
||||
|
||||
const detect = await spawn(
|
||||
"node",
|
||||
"./dist/cli/index.js detect",
|
||||
"./thirdweb-contracts",
|
||||
);
|
||||
|
||||
// wait for program to finish
|
||||
await detect.waitForFinish();
|
||||
|
||||
const lines = detect.getStdout();
|
||||
|
||||
// Detected extensions
|
||||
expect(lines.findIndex((line) => line.includes("ERC721"))).toBeGreaterThan(
|
||||
-1,
|
||||
);
|
||||
expect(
|
||||
lines.findIndex((line) => line.includes("ERC721Burnable")),
|
||||
).toBeGreaterThan(-1);
|
||||
expect(
|
||||
lines.findIndex((line) => line.includes("ERC721Mintable")),
|
||||
).toBeGreaterThan(-1);
|
||||
|
||||
// Suggested extensions
|
||||
expect(
|
||||
lines.findIndex((line) => line.includes("- ERC721Enumerable")),
|
||||
).toBeGreaterThan(-1);
|
||||
expect(
|
||||
lines.findIndex((line) => line.includes("- ERC721Droppable")),
|
||||
).toBeGreaterThan(-1);
|
||||
expect(
|
||||
lines.findIndex((line) => line.includes("- ERC721SignatureMint")),
|
||||
).toBeGreaterThan(-1);
|
||||
|
||||
// the process should exit with code 0
|
||||
expect(detect.getExitCode()).toEqual(0);
|
||||
|
||||
await cleanup(); // cleanup after test
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
contract BasicContract {
|
||||
constructor() {}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import { prepareEnvironment } from "@gmrchk/cli-testing-library";
|
||||
import { copyFile } from "fs/promises";
|
||||
import { resolve } from "path";
|
||||
import { ERROR_MESSAGES } from "../constants/constants";
|
||||
|
||||
// this creates an app, can take some time that's fine
|
||||
jest.setTimeout(120_000);
|
||||
|
||||
describe("npx thirdweb release", () => {
|
||||
it("should return release page url", async () => {
|
||||
const { spawn, cleanup, exists, path } = await prepareEnvironment();
|
||||
|
||||
await copyFile(resolve("./e2e/files/BasicContract.sol"), `${path}/BasicContract.sol`);
|
||||
|
||||
const {
|
||||
waitForText,
|
||||
waitForFinish,
|
||||
getExitCode,
|
||||
writeText,
|
||||
getStdout,
|
||||
} = await spawn("node", "./dist/cli/index.js release");
|
||||
|
||||
expect(await exists("BasicContract.sol")).toEqual(true);
|
||||
|
||||
await waitForText(ERROR_MESSAGES.noConfiguration);
|
||||
await writeText("y")
|
||||
|
||||
// wait for program to finish
|
||||
await waitForFinish();
|
||||
|
||||
expect(getStdout().at(-1)).toContain("https://thirdweb.com/contracts/release/");
|
||||
|
||||
// the process should exit with code 0
|
||||
expect(getExitCode()).toEqual(0);
|
||||
|
||||
await cleanup(); // cleanup after test
|
||||
});
|
||||
});
|
||||
@@ -1,12 +1,8 @@
|
||||
{
|
||||
"name": "thirdweb",
|
||||
"main": "dist/cli/index.js",
|
||||
"version": "0.7.7",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com:thirdweb-dev/js.git",
|
||||
"directory": "packages/cli"
|
||||
},
|
||||
"version": "0.7.9",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
@@ -26,12 +22,12 @@
|
||||
"@types/validate-npm-package-name": "^4.0.0",
|
||||
"hardhat": "^2.9.3",
|
||||
"jest": "^29.0.1",
|
||||
"prettier": "^2.6.2",
|
||||
"prettier": "^2.7.1",
|
||||
"ts-jest": "^28.0.8",
|
||||
"ts-node": "^10.7.0",
|
||||
"tsc": "^2.0.4",
|
||||
"tsup": "^6.2.3",
|
||||
"typescript": "^4.6.3"
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@thirdweb-dev/sdk": "*",
|
||||
@@ -40,7 +36,7 @@
|
||||
"commander": "^9.1.0",
|
||||
"cpy": "^9.0.1",
|
||||
"enquirer": "^2.3.6",
|
||||
"ethers": "^5.6.9",
|
||||
"ethers": "^5.7.0",
|
||||
"form-data": "^4.0.0",
|
||||
"got": "11.8.5",
|
||||
"inquirer": "^8.2.3",
|
||||
@@ -56,7 +52,7 @@
|
||||
"update-check": "^1.5.4",
|
||||
"update-notifier": "^6.0.2",
|
||||
"validate-npm-package-name": "^4.0.0",
|
||||
"yaml": "^2.0.1"
|
||||
"yaml": "^2.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"thirdweb": "./dist/cli/index.js"
|
||||
|
||||
@@ -28,7 +28,7 @@ $$$$$$\\ $$$$$$$\\ $$\\ $$$$$$\\ $$$$$$$ |$$\\ $$\\ $$\\ $$$$$$\\ $$$$
|
||||
updateNotifier({
|
||||
pkg,
|
||||
shouldNotifyInNpmScript: true,
|
||||
//check every time while we're still building the CLI
|
||||
// check every time while we're still building the CLI
|
||||
updateCheckInterval: 0,
|
||||
}).notify();
|
||||
});
|
||||
|
||||
@@ -101,7 +101,7 @@ export async function detectExtensions(options: any) {
|
||||
`Detected extension on ${chalk.blueBright(contractWithFeatures.name)}`,
|
||||
).stopAndPersist({ symbol: "🔎" });
|
||||
contractWithFeatures.enabledFeatures.map((feature) => {
|
||||
info(`${chalk.green(feature.name)}`);
|
||||
logger.info(`✔️ ${chalk.green(feature.name)}`);
|
||||
});
|
||||
}
|
||||
logger.info(``);
|
||||
|
||||
@@ -5,6 +5,7 @@ import FoundryDetector from "./foundry";
|
||||
import HardhatDetector from "./hardhat";
|
||||
import TruffleDetector from "./truffle";
|
||||
import inquirer from "inquirer";
|
||||
import { ERROR_MESSAGES } from "../../../constants/constants";
|
||||
|
||||
const { Confirm } = require("enquirer");
|
||||
|
||||
@@ -25,7 +26,7 @@ export default async function detect(
|
||||
|
||||
//if there is no project returned at all then just return unknown}
|
||||
if (!possibleProjectTypes.length) {
|
||||
warn("Failed to find a supported project configuration file in current directory " + path);
|
||||
warn(`${ERROR_MESSAGES.noConfiguration} ${path}`);
|
||||
const prompt = new Confirm({
|
||||
name: "continue",
|
||||
message: "Do you want to continue and compile this project with solc instead?",
|
||||
|
||||
@@ -8,6 +8,7 @@ import { validateNpmName } from "./helpers/validate-pkg";
|
||||
import chalk from "chalk";
|
||||
import path from "path";
|
||||
import prompts from "prompts";
|
||||
import { CREATE_MESSAGES } from "../../constants/constants";
|
||||
|
||||
let projectType: string = "";
|
||||
let projectPath: string = "";
|
||||
@@ -65,7 +66,7 @@ export async function twCreate(options: any) {
|
||||
const res = await prompts({
|
||||
type: "select",
|
||||
name: "projectType",
|
||||
message: "What type of project do you want to create?",
|
||||
message: CREATE_MESSAGES.typeOfProject,
|
||||
choices: [
|
||||
{ title: "App", value: "app" },
|
||||
{ title: "Contract", value: "contract" },
|
||||
@@ -87,7 +88,7 @@ export async function twCreate(options: any) {
|
||||
const res = await prompts({
|
||||
type: "text",
|
||||
name: "path",
|
||||
message: "What is your project named?",
|
||||
message: CREATE_MESSAGES.projectName,
|
||||
initial: options.template || defaultName,
|
||||
validate: (name) => {
|
||||
const validation = validateNpmName(path.basename(path.resolve(name)));
|
||||
@@ -123,7 +124,7 @@ export async function twCreate(options: any) {
|
||||
const res = await prompts({
|
||||
type: "select",
|
||||
name: "framework",
|
||||
message: "What framework do you want to use?",
|
||||
message: CREATE_MESSAGES.framework,
|
||||
choices: [
|
||||
{ title: "Next.js", value: "next" },
|
||||
{ title: "Create React App", value: "cra" },
|
||||
@@ -140,7 +141,7 @@ export async function twCreate(options: any) {
|
||||
const res = await prompts({
|
||||
type: "select",
|
||||
name: "language",
|
||||
message: "What language do you want to use?",
|
||||
message: CREATE_MESSAGES.language,
|
||||
choices: [
|
||||
{ title: "JavaScript", value: "javascript" },
|
||||
{ title: "TypeScript", value: "typescript" },
|
||||
@@ -160,7 +161,7 @@ export async function twCreate(options: any) {
|
||||
const res = await prompts({
|
||||
type: "select",
|
||||
name: "framework",
|
||||
message: "What framework do you want to use?",
|
||||
message: CREATE_MESSAGES.framework,
|
||||
choices: [
|
||||
{ title: "Hardhat", value: "hardhat" },
|
||||
{ title: "Forge", value: "forge" },
|
||||
@@ -177,7 +178,7 @@ export async function twCreate(options: any) {
|
||||
const res = await prompts({
|
||||
type: "select",
|
||||
name: "baseContract",
|
||||
message: "What contract do you want to start from?",
|
||||
message: CREATE_MESSAGES.contract,
|
||||
choices: [
|
||||
{ title: "Empty Contract", value: "" },
|
||||
{ title: "ERC721 Base", value: "ERC721Base" },
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
(BigInt.prototype as any).toJSON = function () {
|
||||
return this.toString();
|
||||
};
|
||||
|
||||
console.log(`__tw__${JSON.stringify((globalThis as any).config)}__tw__`);
|
||||
|
||||
export {};
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"extends": "@thirdweb-dev/tsconfig/sdk.json",
|
||||
"include": ["src"],
|
||||
"exclude": ["dist", "build", "node_modules"]
|
||||
"exclude": ["dist", "build", "node_modules"],
|
||||
"compilerOptions": {
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
abis
|
||||
@@ -1,5 +1,17 @@
|
||||
# @thirdweb-dev/contracts-js
|
||||
|
||||
## 1.1.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#61](https://github.com/thirdweb-dev/js/pull/61) [`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6) Thanks [@jnsdls](https://github.com/jnsdls)! - fix versions in dependencies before releasing stable
|
||||
|
||||
## 1.1.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#59](https://github.com/thirdweb-dev/js/pull/59) [`6ba9cad`](https://github.com/thirdweb-dev/js/commit/6ba9cad8d8b933256599dc3b147601cd4828c89b) Thanks [@jnsdls](https://github.com/jnsdls)! - move `abis` from top level into `dist` in contracts-js
|
||||
|
||||
## 1.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/contracts-js",
|
||||
"version": "1.1.5",
|
||||
"version": "1.1.7",
|
||||
"main": "dist/thirdweb-dev-contracts-js.cjs.js",
|
||||
"module": "dist/thirdweb-dev-contracts-js.esm.js",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"directory": "packages/contracts-js",
|
||||
"type": "git",
|
||||
"url": "https://github.com/thirdweb-dev/js.git"
|
||||
},
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/contracts-js",
|
||||
"dependencies": {
|
||||
"@thirdweb-dev/contracts": "3.1.6-1"
|
||||
},
|
||||
@@ -18,23 +14,17 @@
|
||||
"@preconstruct/cli": "^2.2.1",
|
||||
"ethers": "^5.7.0",
|
||||
"typechain": "^8.1.0",
|
||||
"typescript": "^4.8.2"
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"ethers": "^5.7.0"
|
||||
},
|
||||
"files": [
|
||||
"abis/",
|
||||
"dist/"
|
||||
],
|
||||
"preconstruct": {
|
||||
"entrypoints": [
|
||||
"index.ts"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"typechain": "rm -rf ./src && typechain --target ethers-v5 --out-dir src '../../node_modules/@thirdweb-dev/contracts/abi/*.json'",
|
||||
"extract-abi": "node ./scripts/extract-abis.mjs",
|
||||
"build": "yarn typechain && yarn extract-abi && tsc && yarn preconstruct build"
|
||||
"build": "yarn typechain && tsc && yarn preconstruct build && yarn extract-abi"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ const main = () => {
|
||||
"node_modules",
|
||||
"@thirdweb-dev/contracts/abi",
|
||||
);
|
||||
const destinationFolder = "./abis";
|
||||
const destinationFolder = "./dist/abis";
|
||||
if (existsSync(destinationFolder)) {
|
||||
rmSync(destinationFolder, { recursive: true });
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ export interface ERC721MultiwrapInterface extends utils.Interface {
|
||||
"TRANSFER_ROLE()": FunctionFragment;
|
||||
"approve(address,uint256)": FunctionFragment;
|
||||
"balanceOf(address)": FunctionFragment;
|
||||
"bundle(uint256)": FunctionFragment;
|
||||
"contractURI()": FunctionFragment;
|
||||
"getApproved(uint256)": FunctionFragment;
|
||||
"getDefaultRoyaltyInfo()": FunctionFragment;
|
||||
@@ -100,6 +101,7 @@ export interface ERC721MultiwrapInterface extends utils.Interface {
|
||||
| "TRANSFER_ROLE"
|
||||
| "approve"
|
||||
| "balanceOf"
|
||||
| "bundle"
|
||||
| "contractURI"
|
||||
| "getApproved"
|
||||
| "getDefaultRoyaltyInfo"
|
||||
@@ -156,6 +158,10 @@ export interface ERC721MultiwrapInterface extends utils.Interface {
|
||||
values: [string, BigNumberish]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "balanceOf", values: [string]): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "bundle",
|
||||
values: [BigNumberish]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "contractURI",
|
||||
values?: undefined
|
||||
@@ -319,6 +325,7 @@ export interface ERC721MultiwrapInterface extends utils.Interface {
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "bundle", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "contractURI",
|
||||
data: BytesLike
|
||||
@@ -673,6 +680,11 @@ export interface ERC721Multiwrap extends BaseContract {
|
||||
|
||||
balanceOf(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
getApproved(
|
||||
@@ -904,6 +916,11 @@ export interface ERC721Multiwrap extends BaseContract {
|
||||
|
||||
balanceOf(owner: string, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
getApproved(
|
||||
@@ -1129,6 +1146,11 @@ export interface ERC721Multiwrap extends BaseContract {
|
||||
|
||||
balanceOf(owner: string, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
getApproved(
|
||||
@@ -1484,6 +1506,8 @@ export interface ERC721Multiwrap extends BaseContract {
|
||||
|
||||
balanceOf(owner: string, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
bundle(arg0: BigNumberish, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
getApproved(
|
||||
@@ -1722,6 +1746,11 @@ export interface ERC721Multiwrap extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
getApproved(
|
||||
|
||||
@@ -50,6 +50,7 @@ export interface MultiwrapInterface extends utils.Interface {
|
||||
"DEFAULT_ADMIN_ROLE()": FunctionFragment;
|
||||
"approve(address,uint256)": FunctionFragment;
|
||||
"balanceOf(address)": FunctionFragment;
|
||||
"bundle(uint256)": FunctionFragment;
|
||||
"contractType()": FunctionFragment;
|
||||
"contractURI()": FunctionFragment;
|
||||
"contractVersion()": FunctionFragment;
|
||||
@@ -100,6 +101,7 @@ export interface MultiwrapInterface extends utils.Interface {
|
||||
| "DEFAULT_ADMIN_ROLE"
|
||||
| "approve"
|
||||
| "balanceOf"
|
||||
| "bundle"
|
||||
| "contractType"
|
||||
| "contractURI"
|
||||
| "contractVersion"
|
||||
@@ -154,6 +156,10 @@ export interface MultiwrapInterface extends utils.Interface {
|
||||
values: [string, BigNumberish]
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "balanceOf", values: [string]): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "bundle",
|
||||
values: [BigNumberish]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "contractType",
|
||||
values?: undefined
|
||||
@@ -321,6 +327,7 @@ export interface MultiwrapInterface extends utils.Interface {
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "bundle", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "contractType",
|
||||
data: BytesLike
|
||||
@@ -665,6 +672,11 @@ export interface Multiwrap extends BaseContract {
|
||||
|
||||
balanceOf(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
contractType(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<[string]>;
|
||||
@@ -910,6 +922,11 @@ export interface Multiwrap extends BaseContract {
|
||||
|
||||
balanceOf(owner: string, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
contractType(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<string>;
|
||||
@@ -1145,6 +1162,11 @@ export interface Multiwrap extends BaseContract {
|
||||
|
||||
balanceOf(owner: string, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
contractType(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<string>;
|
||||
@@ -1505,6 +1527,8 @@ export interface Multiwrap extends BaseContract {
|
||||
|
||||
balanceOf(owner: string, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
bundle(arg0: BigNumberish, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
contractType(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
@@ -1753,6 +1777,11 @@ export interface Multiwrap extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
contractType(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
contractURI(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
@@ -51,6 +51,7 @@ export interface PackInterface extends utils.Interface {
|
||||
"addPackContents(uint256,(address,uint8,uint256,uint256)[],uint256[],address)": FunctionFragment;
|
||||
"balanceOf(address,uint256)": FunctionFragment;
|
||||
"balanceOfBatch(address[],uint256[])": FunctionFragment;
|
||||
"bundle(uint256)": FunctionFragment;
|
||||
"canUpdatePack(uint256)": FunctionFragment;
|
||||
"contractType()": FunctionFragment;
|
||||
"contractURI()": FunctionFragment;
|
||||
@@ -59,8 +60,6 @@ export interface PackInterface extends utils.Interface {
|
||||
"getDefaultRoyaltyInfo()": FunctionFragment;
|
||||
"getPackContents(uint256)": FunctionFragment;
|
||||
"getRoleAdmin(bytes32)": FunctionFragment;
|
||||
"getRoleMember(bytes32,uint256)": FunctionFragment;
|
||||
"getRoleMemberCount(bytes32)": FunctionFragment;
|
||||
"getRoyaltyInfoForToken(uint256)": FunctionFragment;
|
||||
"getTokenCountOfBundle(uint256)": FunctionFragment;
|
||||
"getTokenOfBundle(uint256,uint256)": FunctionFragment;
|
||||
@@ -101,6 +100,7 @@ export interface PackInterface extends utils.Interface {
|
||||
| "addPackContents"
|
||||
| "balanceOf"
|
||||
| "balanceOfBatch"
|
||||
| "bundle"
|
||||
| "canUpdatePack"
|
||||
| "contractType"
|
||||
| "contractURI"
|
||||
@@ -109,8 +109,6 @@ export interface PackInterface extends utils.Interface {
|
||||
| "getDefaultRoyaltyInfo"
|
||||
| "getPackContents"
|
||||
| "getRoleAdmin"
|
||||
| "getRoleMember"
|
||||
| "getRoleMemberCount"
|
||||
| "getRoyaltyInfoForToken"
|
||||
| "getTokenCountOfBundle"
|
||||
| "getTokenOfBundle"
|
||||
@@ -161,6 +159,10 @@ export interface PackInterface extends utils.Interface {
|
||||
functionFragment: "balanceOfBatch",
|
||||
values: [string[], BigNumberish[]]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "bundle",
|
||||
values: [BigNumberish]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "canUpdatePack",
|
||||
values: [BigNumberish]
|
||||
@@ -200,14 +202,6 @@ export interface PackInterface extends utils.Interface {
|
||||
functionFragment: "getRoleAdmin",
|
||||
values: [BytesLike]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "getRoleMember",
|
||||
values: [BytesLike, BigNumberish]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "getRoleMemberCount",
|
||||
values: [BytesLike]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "getRoyaltyInfoForToken",
|
||||
values: [BigNumberish]
|
||||
@@ -335,6 +329,7 @@ export interface PackInterface extends utils.Interface {
|
||||
functionFragment: "balanceOfBatch",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(functionFragment: "bundle", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "canUpdatePack",
|
||||
data: BytesLike
|
||||
@@ -364,14 +359,6 @@ export interface PackInterface extends utils.Interface {
|
||||
functionFragment: "getRoleAdmin",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "getRoleMember",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "getRoleMemberCount",
|
||||
data: BytesLike
|
||||
): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "getRoyaltyInfoForToken",
|
||||
data: BytesLike
|
||||
@@ -718,6 +705,11 @@ export interface Pack extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber[]]>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
canUpdatePack(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -753,17 +745,6 @@ export interface Pack extends BaseContract {
|
||||
|
||||
getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
getRoleMember(
|
||||
role: BytesLike,
|
||||
index: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[string] & { member: string }>;
|
||||
|
||||
getRoleMemberCount(
|
||||
role: BytesLike,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber] & { count: BigNumber }>;
|
||||
|
||||
getRoyaltyInfoForToken(
|
||||
_tokenId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -971,6 +952,11 @@ export interface Pack extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber[]>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
canUpdatePack(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -1006,17 +992,6 @@ export interface Pack extends BaseContract {
|
||||
|
||||
getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
getRoleMember(
|
||||
role: BytesLike,
|
||||
index: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
getRoleMemberCount(
|
||||
role: BytesLike,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
getRoyaltyInfoForToken(
|
||||
_tokenId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -1229,6 +1204,11 @@ export interface Pack extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber[]>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
canUpdatePack(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -1266,17 +1246,6 @@ export interface Pack extends BaseContract {
|
||||
|
||||
getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
getRoleMember(
|
||||
role: BytesLike,
|
||||
index: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<string>;
|
||||
|
||||
getRoleMemberCount(
|
||||
role: BytesLike,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
getRoyaltyInfoForToken(
|
||||
_tokenId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -1631,6 +1600,8 @@ export interface Pack extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
bundle(arg0: BigNumberish, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
canUpdatePack(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -1664,17 +1635,6 @@ export interface Pack extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
getRoleMember(
|
||||
role: BytesLike,
|
||||
index: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
getRoleMemberCount(
|
||||
role: BytesLike,
|
||||
overrides?: CallOverrides
|
||||
): Promise<BigNumber>;
|
||||
|
||||
getRoyaltyInfoForToken(
|
||||
_tokenId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -1883,6 +1843,11 @@ export interface Pack extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
canUpdatePack(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -1918,17 +1883,6 @@ export interface Pack extends BaseContract {
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
getRoleMember(
|
||||
role: BytesLike,
|
||||
index: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
getRoleMemberCount(
|
||||
role: BytesLike,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
getRoyaltyInfoForToken(
|
||||
_tokenId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
|
||||
@@ -40,6 +40,7 @@ export declare namespace ITokenBundle {
|
||||
|
||||
export interface TokenBundleInterface extends utils.Interface {
|
||||
functions: {
|
||||
"bundle(uint256)": FunctionFragment;
|
||||
"getTokenCountOfBundle(uint256)": FunctionFragment;
|
||||
"getTokenOfBundle(uint256,uint256)": FunctionFragment;
|
||||
"getUriOfBundle(uint256)": FunctionFragment;
|
||||
@@ -47,11 +48,16 @@ export interface TokenBundleInterface extends utils.Interface {
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "bundle"
|
||||
| "getTokenCountOfBundle"
|
||||
| "getTokenOfBundle"
|
||||
| "getUriOfBundle"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "bundle",
|
||||
values: [BigNumberish]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "getTokenCountOfBundle",
|
||||
values: [BigNumberish]
|
||||
@@ -65,6 +71,7 @@ export interface TokenBundleInterface extends utils.Interface {
|
||||
values: [BigNumberish]
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "bundle", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "getTokenCountOfBundle",
|
||||
data: BytesLike
|
||||
@@ -108,6 +115,11 @@ export interface TokenBundle extends BaseContract {
|
||||
removeListener: OnEvent<this>;
|
||||
|
||||
functions: {
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -125,6 +137,11 @@ export interface TokenBundle extends BaseContract {
|
||||
): Promise<[string]>;
|
||||
};
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -142,6 +159,11 @@ export interface TokenBundle extends BaseContract {
|
||||
): Promise<string>;
|
||||
|
||||
callStatic: {
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -162,6 +184,8 @@ export interface TokenBundle extends BaseContract {
|
||||
filters: {};
|
||||
|
||||
estimateGas: {
|
||||
bundle(arg0: BigNumberish, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -180,6 +204,11 @@ export interface TokenBundle extends BaseContract {
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
|
||||
@@ -42,6 +42,7 @@ export declare namespace ITokenBundle {
|
||||
|
||||
export interface TokenStoreInterface extends utils.Interface {
|
||||
functions: {
|
||||
"bundle(uint256)": FunctionFragment;
|
||||
"getTokenCountOfBundle(uint256)": FunctionFragment;
|
||||
"getTokenOfBundle(uint256,uint256)": FunctionFragment;
|
||||
"getUriOfBundle(uint256)": FunctionFragment;
|
||||
@@ -53,6 +54,7 @@ export interface TokenStoreInterface extends utils.Interface {
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "bundle"
|
||||
| "getTokenCountOfBundle"
|
||||
| "getTokenOfBundle"
|
||||
| "getUriOfBundle"
|
||||
@@ -62,6 +64,10 @@ export interface TokenStoreInterface extends utils.Interface {
|
||||
| "supportsInterface"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
functionFragment: "bundle",
|
||||
values: [BigNumberish]
|
||||
): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "getTokenCountOfBundle",
|
||||
values: [BigNumberish]
|
||||
@@ -91,6 +97,7 @@ export interface TokenStoreInterface extends utils.Interface {
|
||||
values: [BytesLike]
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "bundle", data: BytesLike): Result;
|
||||
decodeFunctionResult(
|
||||
functionFragment: "getTokenCountOfBundle",
|
||||
data: BytesLike
|
||||
@@ -150,6 +157,11 @@ export interface TokenStore extends BaseContract {
|
||||
removeListener: OnEvent<this>;
|
||||
|
||||
functions: {
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -198,6 +210,11 @@ export interface TokenStore extends BaseContract {
|
||||
): Promise<[boolean]>;
|
||||
};
|
||||
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -246,6 +263,11 @@ export interface TokenStore extends BaseContract {
|
||||
): Promise<boolean>;
|
||||
|
||||
callStatic: {
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<[BigNumber, string] & { count: BigNumber; uri: string }>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -297,6 +319,8 @@ export interface TokenStore extends BaseContract {
|
||||
filters: {};
|
||||
|
||||
estimateGas: {
|
||||
bundle(arg0: BigNumberish, overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
@@ -346,6 +370,11 @@ export interface TokenStore extends BaseContract {
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
bundle(
|
||||
arg0: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
): Promise<PopulatedTransaction>;
|
||||
|
||||
getTokenCountOfBundle(
|
||||
_bundleId: BigNumberish,
|
||||
overrides?: CallOverrides
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -8,6 +8,30 @@ import type { Provider } from "@ethersproject/providers";
|
||||
import { Contract, Signer, utils } from "ethers";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "bundle",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "count",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "string",
|
||||
name: "uri",
|
||||
type: "string",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
|
||||
@@ -19,6 +19,30 @@ const _abi = [
|
||||
stateMutability: "nonpayable",
|
||||
type: "constructor",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "",
|
||||
type: "uint256",
|
||||
},
|
||||
],
|
||||
name: "bundle",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "uint256",
|
||||
name: "count",
|
||||
type: "uint256",
|
||||
},
|
||||
{
|
||||
internalType: "string",
|
||||
name: "uri",
|
||||
type: "string",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
@@ -237,7 +261,7 @@ const _abi = [
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x60a060405234801561001057600080fd5b5060405161080a38038061080a83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b608051610782610088600039600050506107826000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806361195e941161005b57806361195e9414610101578063bc197c8114610121578063d0d2fe2514610140578063f23a6e611461016e57600080fd5b806301ffc9a714610082578063150b7a02146100aa5780631da799c9146100e1575b600080fd5b61009561009036600461031a565b61018d565b60405190151581526020015b60405180910390f35b6100c86100b836600461041e565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016100a1565b6100f46100ef366004610486565b6101c4565b6040516100a191906104be565b61011461010f366004610514565b610275565b6040516100a1919061052d565b6100c861012f366004610602565b63bc197c8160e01b95945050505050565b61016061014e366004610514565b60009081526020819052604090205490565b6040519081526020016100a1565b6100c861017c3660046106ac565b63f23a6e6160e01b95945050505050565b60006001600160e01b03198216630271189760e51b14806101be57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6101f0604080516080810190915260008082526020820190815260200160008152602001600081525090565b600083815260208181526040808320858452600290810183529281902081516080810190925280546001600160a01b038116835291939092840191600160a01b900460ff1690811115610245576102456104a8565b6002811115610256576102566104a8565b8152600182015460208201526002909101546040909101529392505050565b600081815260208190526040902060010180546060919061029590610711565b80601f01602080910402602001604051908101604052809291908181526020018280546102c190610711565b801561030e5780601f106102e35761010080835404028352916020019161030e565b820191906000526020600020905b8154815290600101906020018083116102f157829003601f168201915b50505050509050919050565b60006020828403121561032c57600080fd5b81356001600160e01b03198116811461034457600080fd5b9392505050565b80356001600160a01b038116811461036257600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156103a6576103a6610367565b604052919050565b600082601f8301126103bf57600080fd5b813567ffffffffffffffff8111156103d9576103d9610367565b6103ec601f8201601f191660200161037d565b81815284602083860101111561040157600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561043457600080fd5b61043d8561034b565b935061044b6020860161034b565b925060408501359150606085013567ffffffffffffffff81111561046e57600080fd5b61047a878288016103ae565b91505092959194509250565b6000806040838503121561049957600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b81516001600160a01b0316815260208201516080820190600381106104f357634e487b7160e01b600052602160045260246000fd5b80602084015250604083015160408301526060830151606083015292915050565b60006020828403121561052657600080fd5b5035919050565b600060208083528351808285015260005b8181101561055a5785810183015185820160400152820161053e565b8181111561056c576000604083870101525b50601f01601f1916929092016040019392505050565b600082601f83011261059357600080fd5b8135602067ffffffffffffffff8211156105af576105af610367565b8160051b6105be82820161037d565b92835284810182019282810190878511156105d857600080fd5b83870192505b848310156105f7578235825291830191908301906105de565b979650505050505050565b600080600080600060a0868803121561061a57600080fd5b6106238661034b565b94506106316020870161034b565b9350604086013567ffffffffffffffff8082111561064e57600080fd5b61065a89838a01610582565b9450606088013591508082111561067057600080fd5b61067c89838a01610582565b9350608088013591508082111561069257600080fd5b5061069f888289016103ae565b9150509295509295909350565b600080600080600060a086880312156106c457600080fd5b6106cd8661034b565b94506106db6020870161034b565b93506040860135925060608601359150608086013567ffffffffffffffff81111561070557600080fd5b61069f888289016103ae565b600181811c9082168061072557607f821691505b6020821081141561074657634e487b7160e01b600052602260045260246000fd5b5091905056fea264697066735822122063ab22b3a48b1c53655cbbcd318d8135a52905b628edc24f4e92b2d632f6938b64736f6c634300080c0033";
|
||||
"0x60a060405234801561001057600080fd5b5060405161090738038061090783398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161087f6100886000396000505061087f6000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c806361195e941161005b57806361195e941461012d578063bc197c811461014d578063d0d2fe251461016c578063f23a6e611461019a57600080fd5b806301ffc9a71461008d57806313578f26146100b5578063150b7a02146100d65780631da799c91461010d575b600080fd5b6100a061009b3660046103eb565b6101b9565b60405190151581526020015b60405180910390f35b6100c86100c336600461041c565b6101f0565b6040516100ac929190610482565b6100f46100e4366004610576565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016100ac565b61012061011b3660046105de565b610295565b6040516100ac9190610616565b61014061013b36600461041c565b610346565b6040516100ac919061066c565b6100f461015b3660046106ff565b63bc197c8160e01b95945050505050565b61018c61017a36600461041c565b60009081526020819052604090205490565b6040519081526020016100ac565b6100f46101a83660046107a9565b63f23a6e6160e01b95945050505050565b60006001600160e01b03198216630271189760e51b14806101ea57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600060208190529081526040902080546001820180549192916102129061080e565b80601f016020809104026020016040519081016040528092919081815260200182805461023e9061080e565b801561028b5780601f106102605761010080835404028352916020019161028b565b820191906000526020600020905b81548152906001019060200180831161026e57829003601f168201915b5050505050905082565b6102c1604080516080810190915260008082526020820190815260200160008152602001600081525090565b600083815260208181526040808320858452600290810183529281902081516080810190925280546001600160a01b038116835291939092840191600160a01b900460ff169081111561031657610316610600565b600281111561032757610327610600565b8152600182015460208201526002909101546040909101529392505050565b60008181526020819052604090206001018054606091906103669061080e565b80601f01602080910402602001604051908101604052809291908181526020018280546103929061080e565b80156103df5780601f106103b4576101008083540402835291602001916103df565b820191906000526020600020905b8154815290600101906020018083116103c257829003601f168201915b50505050509050919050565b6000602082840312156103fd57600080fd5b81356001600160e01b03198116811461041557600080fd5b9392505050565b60006020828403121561042e57600080fd5b5035919050565b6000815180845260005b8181101561045b5760208185018101518683018201520161043f565b8181111561046d576000602083870101525b50601f01601f19169290920160200192915050565b82815260406020820152600061049b6040830184610435565b949350505050565b80356001600160a01b03811681146104ba57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156104fe576104fe6104bf565b604052919050565b600082601f83011261051757600080fd5b813567ffffffffffffffff811115610531576105316104bf565b610544601f8201601f19166020016104d5565b81815284602083860101111561055957600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561058c57600080fd5b610595856104a3565b93506105a3602086016104a3565b925060408501359150606085013567ffffffffffffffff8111156105c657600080fd5b6105d287828801610506565b91505092959194509250565b600080604083850312156105f157600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b81516001600160a01b03168152602082015160808201906003811061064b57634e487b7160e01b600052602160045260246000fd5b80602084015250604083015160408301526060830151606083015292915050565b6020815260006104156020830184610435565b600082601f83011261069057600080fd5b8135602067ffffffffffffffff8211156106ac576106ac6104bf565b8160051b6106bb8282016104d5565b92835284810182019282810190878511156106d557600080fd5b83870192505b848310156106f4578235825291830191908301906106db565b979650505050505050565b600080600080600060a0868803121561071757600080fd5b610720866104a3565b945061072e602087016104a3565b9350604086013567ffffffffffffffff8082111561074b57600080fd5b61075789838a0161067f565b9450606088013591508082111561076d57600080fd5b61077989838a0161067f565b9350608088013591508082111561078f57600080fd5b5061079c88828901610506565b9150509295509295909350565b600080600080600060a086880312156107c157600080fd5b6107ca866104a3565b94506107d8602087016104a3565b93506040860135925060608601359150608086013567ffffffffffffffff81111561080257600080fd5b61079c88828901610506565b600181811c9082168061082257607f821691505b6020821081141561084357634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220324cd20076ad68aa254becad4b9035c8aeb9c4049f395a2e323eafa4e4b4b6a864736f6c634300080c0033";
|
||||
|
||||
type TokenStoreConstructorParams =
|
||||
| [signer?: Signer]
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# eslint-config-thirdweb
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#61](https://github.com/thirdweb-dev/js/pull/61) [`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6) Thanks [@jnsdls](https://github.com/jnsdls)! - fix versions in dependencies before releasing stable
|
||||
|
||||
## 0.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
{
|
||||
"name": "eslint-config-thirdweb",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"main": "index.js",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"eslint-config-next": "^12.0.8",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-react": "^7.28.0",
|
||||
"eslint-config-turbo": "latest"
|
||||
"eslint-config-turbo": "latest",
|
||||
"eslint-plugin-react": "^7.28.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
},
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/eslint-config-thirdweb"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
# @thirdweb-dev/react
|
||||
|
||||
## 2.9.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#61](https://github.com/thirdweb-dev/js/pull/61) [`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6) Thanks [@jnsdls](https://github.com/jnsdls)! - fix versions in dependencies before releasing stable
|
||||
|
||||
- Updated dependencies [[`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6)]:
|
||||
- @thirdweb-dev/sdk@2.4.8
|
||||
- @thirdweb-dev/storage@0.2.7
|
||||
|
||||
## 2.9.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6ba9cad`](https://github.com/thirdweb-dev/js/commit/6ba9cad8d8b933256599dc3b147601cd4828c89b)]:
|
||||
- @thirdweb-dev/sdk@2.4.7
|
||||
|
||||
## 2.9.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
+14
-18
@@ -1,11 +1,7 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react",
|
||||
"version": "2.9.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com:thirdweb-dev/js.git",
|
||||
"directory": "packages/react"
|
||||
},
|
||||
"version": "2.9.6",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
"main": "dist/thirdweb-dev-react.cjs.js",
|
||||
@@ -32,8 +28,8 @@
|
||||
"@babel/preset-env": "^7.18.10",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@microsoft/api-documenter": "^7.15.3",
|
||||
"@microsoft/api-extractor": "^7.19.4",
|
||||
"@microsoft/api-documenter": "^7.19.4",
|
||||
"@microsoft/api-extractor": "^7.29.2",
|
||||
"@microsoft/tsdoc": "^0.14.1",
|
||||
"@playwright/experimental-ct-react": "^1.25.1",
|
||||
"@playwright/test": "^1.25.1",
|
||||
@@ -42,19 +38,19 @@
|
||||
"@types/mime": "^3.0.1",
|
||||
"@types/react": "^18.0.5",
|
||||
"@types/react-dom": "^18.0.6",
|
||||
"@typescript-eslint/eslint-plugin": "^5.2.0",
|
||||
"@typescript-eslint/parser": "^5.2.0",
|
||||
"eslint": "^8.9.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
||||
"@typescript-eslint/parser": "^5.33.0",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-inclusive-language": "^2.1.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-tsdoc": "^0.2.14",
|
||||
"ethers": "^5.6.1",
|
||||
"prettier": "^2.5.1",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-inclusive-language": "^2.2.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-tsdoc": "^0.2.16",
|
||||
"ethers": "^5.7.0",
|
||||
"prettier": "^2.7.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"typescript": "^4.6.2"
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.10.0",
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extension": ["ts"],
|
||||
"require": ["@swc-node/register", "./test/hooks.ts"]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
node_modules/
|
||||
@@ -1,5 +1,24 @@
|
||||
# @thirdweb-dev/sdk
|
||||
|
||||
## 2.4.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#61](https://github.com/thirdweb-dev/js/pull/61) [`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6) Thanks [@jnsdls](https://github.com/jnsdls)! - fix versions in dependencies before releasing stable
|
||||
|
||||
- Updated dependencies [[`3287c2b`](https://github.com/thirdweb-dev/js/commit/3287c2b0f233332fe4a095f973deed8efab91db6)]:
|
||||
- @thirdweb-dev/contracts-js@1.1.7
|
||||
- @thirdweb-dev/storage@0.2.7
|
||||
|
||||
## 2.4.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#59](https://github.com/thirdweb-dev/js/pull/59) [`6ba9cad`](https://github.com/thirdweb-dev/js/commit/6ba9cad8d8b933256599dc3b147601cd4828c89b) Thanks [@jnsdls](https://github.com/jnsdls)! - move `abis` from top level into `dist` in contracts-js
|
||||
|
||||
- Updated dependencies [[`6ba9cad`](https://github.com/thirdweb-dev/js/commit/6ba9cad8d8b933256599dc3b147601cd4828c89b)]:
|
||||
- @thirdweb-dev/contracts-js@1.1.6
|
||||
|
||||
## 2.4.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -3,13 +3,9 @@
|
||||
|
||||
SHELL := /bin/bash
|
||||
|
||||
build:
|
||||
yarn run build
|
||||
|
||||
test: FORCE
|
||||
docker start hh-node || docker run --name hh-node -d -p 8545:8545 ethereumoptimism/hardhat
|
||||
./test/scripts/waitForHardhatNode.sh
|
||||
yarn run build
|
||||
yarn run test:all
|
||||
|
||||
FORCE: ;
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import { prepareEnvironment } from "@gmrchk/cli-testing-library";
|
||||
import { expect } from "chai";
|
||||
|
||||
describe("node", () => {
|
||||
it("getContract().metadata.get()", async () => {
|
||||
const { execute, cleanup } = await prepareEnvironment();
|
||||
|
||||
const { code, stdout, stderr } = await execute(
|
||||
"node",
|
||||
"./e2e/node-scripts/basic.js",
|
||||
);
|
||||
|
||||
console.log("stderr", stderr);
|
||||
|
||||
expect(code).to.equal(0);
|
||||
expect(stdout[0]).to.contain("mintED Toasts");
|
||||
expect(stderr.length).to.equal(0);
|
||||
|
||||
await cleanup();
|
||||
});
|
||||
});
|
||||
@@ -1,7 +0,0 @@
|
||||
const { ThirdwebSDK } = require("../..");
|
||||
|
||||
(async function () {
|
||||
const sdk = new ThirdwebSDK("rinkeby");
|
||||
const c = await sdk.getContract("0x10fDF181eDceAEF044328BeF07979FfaE209023f");
|
||||
console.log(await c.metadata.get());
|
||||
})();
|
||||
+22
-29
@@ -1,12 +1,8 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/sdk",
|
||||
"version": "2.4.6",
|
||||
"version": "2.4.8",
|
||||
"description": "The main thirdweb SDK.",
|
||||
"repository": {
|
||||
"directory": "packages/sdk",
|
||||
"type": "git",
|
||||
"url": "https://github.com/thirdweb-dev/js.git"
|
||||
},
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
||||
"license": "Apache-2.0",
|
||||
"main": "dist/thirdweb-dev-sdk.cjs.js",
|
||||
"module": "dist/thirdweb-dev-sdk.esm.js",
|
||||
@@ -25,48 +21,46 @@
|
||||
"generate-docs": "yarn full-build && yarn generate-md-docs",
|
||||
"generate-snippets": "node ./scripts/generate-snippets.mjs && node ./scripts/generate-feature-snippets.mjs",
|
||||
"build": "tsc && preconstruct build",
|
||||
"test:all": "ts-mocha --parallel --paths -t 120000 -r esm -p tsconfig.testing.json './test/**/*.test.ts'",
|
||||
"test:all": "SWC_NODE_PROJECT=./tsconfig.test.json mocha --timeout 30000 --parallel './test/**/*.test.ts'",
|
||||
"test": "make test",
|
||||
"test:single": "ts-mocha --paths -t 120000 -r esm -p tsconfig.testing.json",
|
||||
"e2e": "ts-mocha --parallel --paths -t 120000 -r esm -p tsconfig.testing.json './e2e/**/*.test.ts'"
|
||||
"test:single": "SWC_NODE_PROJECT=./tsconfig.test.json mocha --timeout 30000 --"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cbor": "^8.1.0",
|
||||
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
|
||||
"@gmrchk/cli-testing-library": "^0.1.2",
|
||||
"@microsoft/api-documenter": "^7.13.53",
|
||||
"@microsoft/api-extractor": "^7.18.10",
|
||||
"@microsoft/api-documenter": "^7.19.4",
|
||||
"@microsoft/api-extractor": "^7.29.2",
|
||||
"@microsoft/tsdoc": "^0.14.1",
|
||||
"@nomiclabs/hardhat-ethers": "2.0.5",
|
||||
"@preconstruct/cli": "^2.2.1",
|
||||
"@swc-node/register": "^1.5.1",
|
||||
"@swc/core": "^1.2.177",
|
||||
"@typechain/ethers-v5": "10.0.0",
|
||||
"@types/chai": "^4.3.1",
|
||||
"@types/chai": "^4.3.3",
|
||||
"@types/deep-equal-in-any-order": "^1.0.1",
|
||||
"@types/expect": "^24.3.0",
|
||||
"@types/mocha": "^9.1.1",
|
||||
"@types/node": "^17.0.0",
|
||||
"@types/node": "^18.0.0",
|
||||
"@types/uuid": "^8.3.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.2.0",
|
||||
"@typescript-eslint/parser": "^5.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
||||
"@typescript-eslint/parser": "^5.33.0",
|
||||
"cbor": "^8.1.0",
|
||||
"chai": "^4.3.6",
|
||||
"deep-equal-in-any-order": "^1.1.18",
|
||||
"eslint": "^8",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-inclusive-language": "^2.1.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-tsdoc": "^0.2.14",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-inclusive-language": "^2.2.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-tsdoc": "^0.2.16",
|
||||
"esm": "^3.2.25",
|
||||
"ethers": "^5.6.2",
|
||||
"hardhat": "2.9.3",
|
||||
"ethers": "^5.7.0",
|
||||
"hardhat": "^2.9.3",
|
||||
"mocha": "^10.0.0",
|
||||
"node-stdlib-browser": "^1.2.0",
|
||||
"prettier": "^2.4.1",
|
||||
"ts-mocha": "^10.0.0",
|
||||
"ts-node": "^10.7.0",
|
||||
"typechain": "^8.0.0",
|
||||
"typescript": "^4.6.2"
|
||||
"prettier": "^2.7.1",
|
||||
"typechain": "^8.1.0",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"ethers": "^5"
|
||||
@@ -93,6 +87,5 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/thirdweb-dev/js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/thirdweb-dev/js/blob/main/packages/sdk/README.md",
|
||||
"author": "thirdweb eng <[email protected]>"
|
||||
}
|
||||
|
||||
@@ -112,6 +112,14 @@ export async function prepareClaim(
|
||||
};
|
||||
}
|
||||
|
||||
type Snapshot =
|
||||
| {
|
||||
address: string;
|
||||
proof: string[];
|
||||
maxClaimable: string;
|
||||
}[]
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param merkleRoot
|
||||
@@ -122,12 +130,12 @@ export async function fetchSnapshot(
|
||||
merkleRoot: string,
|
||||
merkleMetadata: Record<string, string> | undefined,
|
||||
storage: IStorage,
|
||||
) {
|
||||
): Promise<Snapshot> {
|
||||
if (!merkleMetadata) {
|
||||
return undefined;
|
||||
}
|
||||
const snapshotUri = merkleMetadata[merkleRoot];
|
||||
let snapshot = undefined;
|
||||
let snapshot: Snapshot = undefined;
|
||||
if (snapshotUri) {
|
||||
const raw = await storage.get(snapshotUri);
|
||||
const snapshotData = SnapshotSchema.parse(raw);
|
||||
@@ -203,7 +211,11 @@ export async function getClaimerProofs(
|
||||
merkleMetadata: Record<string, string>,
|
||||
storage: IStorage,
|
||||
): Promise<{ maxClaimable: BigNumber; proof: string[] }> {
|
||||
const claims = await fetchSnapshot(merkleRoot, merkleMetadata, storage);
|
||||
const claims: Snapshot = await fetchSnapshot(
|
||||
merkleRoot,
|
||||
merkleMetadata,
|
||||
storage,
|
||||
);
|
||||
if (claims === undefined) {
|
||||
return {
|
||||
proof: [],
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
import {
|
||||
getNativeTokenByChainId,
|
||||
NATIVE_TOKEN_ADDRESS,
|
||||
} from "../constants/currency";
|
||||
import { ContractWrapper } from "../core/classes/contract-wrapper";
|
||||
import { AmountSchema } from "../schema/shared";
|
||||
import { Amount, Currency, CurrencyValue, Price } from "../types/currency";
|
||||
import { BaseERC20 } from "../types/eips";
|
||||
import { IERC20, IERC20Metadata } from "@thirdweb-dev/contracts-js";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC20.json";
|
||||
import ERC20MetadataAbi from "@thirdweb-dev/contracts-js/dist/abis/IERC20Metadata.json";
|
||||
import {
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
@@ -8,16 +18,6 @@ import {
|
||||
utils,
|
||||
ethers,
|
||||
} from "ethers";
|
||||
import {
|
||||
getNativeTokenByChainId,
|
||||
NATIVE_TOKEN_ADDRESS,
|
||||
} from "../constants/currency";
|
||||
import { Amount, Currency, CurrencyValue, Price } from "../types/currency";
|
||||
import { AmountSchema } from "../schema/shared";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/abis/IERC20.json";
|
||||
import ERC20MetadataAbi from "@thirdweb-dev/contracts-js/abis/IERC20Metadata.json";
|
||||
import { BaseERC20 } from "../types/eips";
|
||||
import { IERC20, IERC20Metadata } from "@thirdweb-dev/contracts-js";
|
||||
|
||||
export function isNativeToken(tokenAddress: string): boolean {
|
||||
return (
|
||||
|
||||
@@ -293,7 +293,7 @@ function hexToBytes(hex: string | number) {
|
||||
throw new Error(`Given value "${hex}" is not a valid hex string.`);
|
||||
}
|
||||
hex = hex.replace(/^0x/i, "");
|
||||
const bytes = [];
|
||||
const bytes: number[] = [];
|
||||
for (let c = 0; c < hex.length; c += 2) {
|
||||
bytes.push(parseInt(hex.slice(c, c + 2), 16));
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { BigNumber, BigNumberish, Contract, providers } from "ethers";
|
||||
import {
|
||||
InterfaceId_IERC1155,
|
||||
InterfaceId_IERC721,
|
||||
} from "../constants/contract";
|
||||
import { ContractWrapper } from "../core/classes/contract-wrapper";
|
||||
import { SignerOrProvider } from "../core";
|
||||
import { ContractWrapper } from "../core/classes/contract-wrapper";
|
||||
import { MAX_BPS } from "../schema/shared";
|
||||
import {
|
||||
NewAuctionListing,
|
||||
NewDirectListing,
|
||||
Offer,
|
||||
} from "../types/marketplace";
|
||||
import invariant from "tiny-invariant";
|
||||
import { fetchCurrencyValue } from "./currency";
|
||||
import { MAX_BPS } from "../schema/shared";
|
||||
import { IERC1155, IERC165, IERC721 } from "@thirdweb-dev/contracts-js";
|
||||
import ERC1155Abi from "@thirdweb-dev/contracts-js/abis/IERC1155.json";
|
||||
import ERC721Abi from "@thirdweb-dev/contracts-js/abis/IERC721.json";
|
||||
import ERC165Abi from "@thirdweb-dev/contracts-js/abis/IERC165.json";
|
||||
import ERC165Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC165.json";
|
||||
import ERC721Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC721.json";
|
||||
import ERC1155Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC1155.json";
|
||||
import { BigNumber, BigNumberish, Contract, providers } from "ethers";
|
||||
import invariant from "tiny-invariant";
|
||||
|
||||
/**
|
||||
* This method checks if the given token is approved for the transferrerContractAddress contract.
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { BigNumber, BigNumberish, Contract, ethers, providers } from "ethers";
|
||||
import {
|
||||
InterfaceId_IERC1155,
|
||||
InterfaceId_IERC721,
|
||||
} from "../constants/contract";
|
||||
import {
|
||||
CommonNFTInput,
|
||||
CommonNFTOutput,
|
||||
@@ -6,17 +9,18 @@ import {
|
||||
NFTMetadataInput,
|
||||
NFTMetadataOrUri,
|
||||
} from "../schema/tokens/common";
|
||||
import type { IStorage } from "@thirdweb-dev/storage";
|
||||
import { IERC1155Metadata, IERC165, IERC721Metadata } from "@thirdweb-dev/contracts-js";
|
||||
import { UploadProgressEvent } from "../types/index";
|
||||
import { NotFoundError } from "./error";
|
||||
import {
|
||||
InterfaceId_IERC1155,
|
||||
InterfaceId_IERC721,
|
||||
} from "../constants/contract";
|
||||
import ERC721MetadataAbi from "@thirdweb-dev/contracts-js/abis/IERC721Metadata.json";
|
||||
import ERC1155MetadataAbi from "@thirdweb-dev/contracts-js/abis/IERC1155Metadata.json";
|
||||
import ERC165MetadataAbi from "@thirdweb-dev/contracts-js/abis/IERC165.json";
|
||||
import { UploadProgressEvent } from "../types/index";
|
||||
IERC1155Metadata,
|
||||
IERC165,
|
||||
IERC721Metadata,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import ERC165MetadataAbi from "@thirdweb-dev/contracts-js/dist/abis/IERC165.json";
|
||||
import ERC721MetadataAbi from "@thirdweb-dev/contracts-js/dist/abis/IERC721Metadata.json";
|
||||
import ERC1155MetadataAbi from "@thirdweb-dev/contracts-js/dist/abis/IERC1155Metadata.json";
|
||||
import type { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, BigNumberish, Contract, ethers, providers } from "ethers";
|
||||
|
||||
const FALLBACK_METADATA = {
|
||||
name: "Failed to load NFT metadata",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import DelayedRevealAbi from "@thirdweb-dev/contracts-js/abis/DelayedReveal.json";
|
||||
import DropSinglePhase1155 from "@thirdweb-dev/contracts-js/abis/DropSinglePhase1155.json";
|
||||
import IBurnableERC1155Abi from "@thirdweb-dev/contracts-js/abis/IBurnableERC1155.json";
|
||||
import Erc1155Abi from "@thirdweb-dev/contracts-js/abis/IERC1155.json";
|
||||
import Erc1155EnumerableAbi from "@thirdweb-dev/contracts-js/abis/IERC1155Enumerable.json";
|
||||
import ILazyMintAbi from "@thirdweb-dev/contracts-js/abis/ILazyMint.json";
|
||||
import IMintableERC1155Abi from "@thirdweb-dev/contracts-js/abis/IMintableERC1155.json";
|
||||
import MulticallAbi from "@thirdweb-dev/contracts-js/abis/IMulticall.json";
|
||||
import ISignatureMintERC1155Abi from "@thirdweb-dev/contracts-js/abis/ISignatureMintERC1155.json";
|
||||
import DelayedRevealAbi from "@thirdweb-dev/contracts-js/dist/abis/DelayedReveal.json";
|
||||
import DropSinglePhase1155 from "@thirdweb-dev/contracts-js/dist/abis/DropSinglePhase1155.json";
|
||||
import IBurnableERC1155Abi from "@thirdweb-dev/contracts-js/dist/abis/IBurnableERC1155.json";
|
||||
import Erc1155Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC1155.json";
|
||||
import Erc1155EnumerableAbi from "@thirdweb-dev/contracts-js/dist/abis/IERC1155Enumerable.json";
|
||||
import ILazyMintAbi from "@thirdweb-dev/contracts-js/dist/abis/ILazyMint.json";
|
||||
import IMintableERC1155Abi from "@thirdweb-dev/contracts-js/dist/abis/IMintableERC1155.json";
|
||||
import MulticallAbi from "@thirdweb-dev/contracts-js/dist/abis/IMulticall.json";
|
||||
import ISignatureMintERC1155Abi from "@thirdweb-dev/contracts-js/dist/abis/ISignatureMintERC1155.json";
|
||||
|
||||
export const FEATURE_EDITION_BURNABLE = {
|
||||
name: "ERC1155Burnable",
|
||||
@@ -114,6 +114,7 @@ export const FEATURE_EDITION = {
|
||||
[FEATURE_EDITION_MINTABLE.name]: FEATURE_EDITION_MINTABLE,
|
||||
[FEATURE_EDITION_DROPPABLE.name]: FEATURE_EDITION_DROPPABLE,
|
||||
[FEATURE_EDITION_REVEALABLE.name]: FEATURE_EDITION_REVEALABLE,
|
||||
[FEATURE_EDITION_SIGNATURE_MINTABLE.name]: FEATURE_EDITION_SIGNATURE_MINTABLE,
|
||||
[FEATURE_EDITION_SIGNATURE_MINTABLE.name]:
|
||||
FEATURE_EDITION_SIGNATURE_MINTABLE,
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import IBurnableERC20Abi from "@thirdweb-dev/contracts-js/abis/IBurnableERC20.json";
|
||||
import IDropSinglePhase from "@thirdweb-dev/contracts-js/abis/IDropSinglePhase.json";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/abis/IERC20.json";
|
||||
import IMintableERC20Abi from "@thirdweb-dev/contracts-js/abis/IMintableERC20.json";
|
||||
import MulticallAbi from "@thirdweb-dev/contracts-js/abis/IMulticall.json";
|
||||
import ISignatureMintERC20Abi from "@thirdweb-dev/contracts-js/abis/ISignatureMintERC20.json";
|
||||
import IBurnableERC20Abi from "@thirdweb-dev/contracts-js/dist/abis/IBurnableERC20.json";
|
||||
import IDropSinglePhase from "@thirdweb-dev/contracts-js/dist/abis/IDropSinglePhase.json";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC20.json";
|
||||
import IMintableERC20Abi from "@thirdweb-dev/contracts-js/dist/abis/IMintableERC20.json";
|
||||
import MulticallAbi from "@thirdweb-dev/contracts-js/dist/abis/IMulticall.json";
|
||||
import ISignatureMintERC20Abi from "@thirdweb-dev/contracts-js/dist/abis/ISignatureMintERC20.json";
|
||||
|
||||
export const FEATURE_TOKEN_DROPPABLE = {
|
||||
name: "ERC20Droppable",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import Erc721Abi from "@thirdweb-dev/contracts-js/abis/IERC721.json";
|
||||
import Erc721EnumerableAbi from "@thirdweb-dev/contracts-js/abis/IERC721Enumerable.json";
|
||||
import Erc721SupplyAbi from "@thirdweb-dev/contracts-js/abis/IERC721Supply.json";
|
||||
import IMintableERC721Abi from "@thirdweb-dev/contracts-js/abis/IMintableERC721.json";
|
||||
import MulticallAbi from "@thirdweb-dev/contracts-js/abis/IMulticall.json";
|
||||
import DelayedRevealAbi from "@thirdweb-dev/contracts-js/abis/IDelayedReveal.json";
|
||||
import ILazyMintAbi from "@thirdweb-dev/contracts-js/abis/ILazyMint.json";
|
||||
import IDropSinglePhase from "@thirdweb-dev/contracts-js/abis/IDropSinglePhase.json";
|
||||
import SignatureMintERC721Abi from "@thirdweb-dev/contracts-js/abis/SignatureMintERC721.json";
|
||||
import IBurnableERC721Abi from "@thirdweb-dev/contracts-js/abis/IBurnableERC721.json";
|
||||
import IBurnableERC721Abi from "@thirdweb-dev/contracts-js/dist/abis/IBurnableERC721.json";
|
||||
import DelayedRevealAbi from "@thirdweb-dev/contracts-js/dist/abis/IDelayedReveal.json";
|
||||
import IDropSinglePhase from "@thirdweb-dev/contracts-js/dist/abis/IDropSinglePhase.json";
|
||||
import Erc721Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC721.json";
|
||||
import Erc721EnumerableAbi from "@thirdweb-dev/contracts-js/dist/abis/IERC721Enumerable.json";
|
||||
import Erc721SupplyAbi from "@thirdweb-dev/contracts-js/dist/abis/IERC721Supply.json";
|
||||
import ILazyMintAbi from "@thirdweb-dev/contracts-js/dist/abis/ILazyMint.json";
|
||||
import IMintableERC721Abi from "@thirdweb-dev/contracts-js/dist/abis/IMintableERC721.json";
|
||||
import MulticallAbi from "@thirdweb-dev/contracts-js/dist/abis/IMulticall.json";
|
||||
import SignatureMintERC721Abi from "@thirdweb-dev/contracts-js/dist/abis/SignatureMintERC721.json";
|
||||
|
||||
export const FEATURE_NFT_BURNABLE = {
|
||||
name: "ERC721Burnable",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import IContractMetadataAbi from "@thirdweb-dev/contracts-js/abis/IContractMetadata.json";
|
||||
import IPermissionsAbi from "@thirdweb-dev/contracts-js/abis/IPermissions.json";
|
||||
import IThirdwebPlatformFeeAbi from "@thirdweb-dev/contracts-js/abis/IPlatformFee.json";
|
||||
import IThirdwebPrimarySaleAbi from "@thirdweb-dev/contracts-js/abis/IPrimarySale.json";
|
||||
import IThirdwebRoyaltyAbi from "@thirdweb-dev/contracts-js/abis/IRoyalty.json";
|
||||
import IContractMetadataAbi from "@thirdweb-dev/contracts-js/dist/abis/IContractMetadata.json";
|
||||
import IPermissionsAbi from "@thirdweb-dev/contracts-js/dist/abis/IPermissions.json";
|
||||
import IThirdwebPlatformFeeAbi from "@thirdweb-dev/contracts-js/dist/abis/IPlatformFee.json";
|
||||
import IThirdwebPrimarySaleAbi from "@thirdweb-dev/contracts-js/dist/abis/IPrimarySale.json";
|
||||
import IThirdwebRoyaltyAbi from "@thirdweb-dev/contracts-js/dist/abis/IRoyalty.json";
|
||||
|
||||
export const FEATURE_ROYALTY = {
|
||||
name: "Royalty",
|
||||
|
||||
@@ -28,7 +28,7 @@ import { SDKOptions } from "../schema/sdk-options";
|
||||
import { NFTMetadata, NFTMetadataOrUri } from "../schema/tokens/common";
|
||||
import { QueryAllParams, UploadProgressEvent } from "../types";
|
||||
import { DropERC1155 } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/DropERC1155.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/DropERC1155.json";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, BigNumberish, constants } from "ethers";
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
} from "../schema/tokens/edition";
|
||||
import { QueryAllParams } from "../types";
|
||||
import { TokenERC1155 } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/TokenERC1155.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/TokenERC1155.json";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, BigNumberish, constants } from "ethers";
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { NFTCollection } from "./nft-collection";
|
||||
import { EditionDrop } from "./edition-drop";
|
||||
import { Edition } from "./edition";
|
||||
import { Token } from "./token";
|
||||
import { Vote } from "./vote";
|
||||
import { Split } from "./split";
|
||||
import { EditionDrop } from "./edition-drop";
|
||||
import { Marketplace } from "./marketplace";
|
||||
import { Pack } from "./pack";
|
||||
import { NFTDrop } from "./nft-drop";
|
||||
import { TokenDrop } from "./token-drop";
|
||||
import { SmartContract } from "./smart-contract";
|
||||
import { SignatureDrop } from "./signature-drop";
|
||||
import { Multiwrap } from "./multiwrap";
|
||||
import { NFTCollection } from "./nft-collection";
|
||||
import { NFTDrop } from "./nft-drop";
|
||||
import { Pack } from "./pack";
|
||||
import { SignatureDrop } from "./signature-drop";
|
||||
import { SmartContract } from "./smart-contract";
|
||||
import { Split } from "./split";
|
||||
import { Token } from "./token";
|
||||
import { TokenDrop } from "./token-drop";
|
||||
import { Vote } from "./vote";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
||||
@@ -19,7 +19,7 @@ import { DEFAULT_QUERY_ALL_COUNT } from "../types/QueryParams";
|
||||
import { AuctionListing, DirectListing } from "../types/marketplace";
|
||||
import { MarketplaceFilter } from "../types/marketplace/MarketPlaceFilter";
|
||||
import { Marketplace as MarketplaceContract } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/Marketplace.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/Marketplace.json";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, BigNumberish, constants } from "ethers";
|
||||
import invariant from "tiny-invariant";
|
||||
@@ -404,7 +404,7 @@ export class Marketplace implements UpdateableNetwork {
|
||||
* @param contractAddress - the NFT contract address
|
||||
*/
|
||||
public async allowListingFromSpecificAssetOnly(contractAddress: string) {
|
||||
const encoded = [];
|
||||
const encoded: string[] = [];
|
||||
const members = await this.roles.get("asset");
|
||||
if (members.includes(constants.AddressZero)) {
|
||||
encoded.push(
|
||||
@@ -425,7 +425,7 @@ export class Marketplace implements UpdateableNetwork {
|
||||
* Allow listings from any NFT contract
|
||||
*/
|
||||
public async allowListingFromAnyAsset() {
|
||||
const encoded = [];
|
||||
const encoded: string[] = [];
|
||||
const members = await this.roles.get("asset");
|
||||
for (const addr in members) {
|
||||
encoded.push(
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
WrappedTokens,
|
||||
} from "../types/multiwrap";
|
||||
import { Multiwrap as MultiwrapContract } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/Multiwrap.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/Multiwrap.json";
|
||||
import {
|
||||
ITokenBundle,
|
||||
TokensWrappedEvent,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { getRoleHash } from "../common";
|
||||
import { Erc721WithQuantitySignatureMintable } from "../core";
|
||||
import { ContractEncoder } from "../core/classes/contract-encoder";
|
||||
import { ContractEvents } from "../core/classes/contract-events";
|
||||
import { ContractInterceptor } from "../core/classes/contract-interceptor";
|
||||
@@ -15,6 +14,7 @@ import { Erc721Burnable } from "../core/classes/erc-721-burnable";
|
||||
import { Erc721Enumerable } from "../core/classes/erc-721-enumerable";
|
||||
import { Erc721Mintable } from "../core/classes/erc-721-mintable";
|
||||
import { Erc721Supply } from "../core/classes/erc-721-supply";
|
||||
import { Erc721WithQuantitySignatureMintable } from "../core/classes/erc-721-with-quantity-signature-mintable";
|
||||
import { GasCostEstimator } from "../core/classes/gas-cost-estimator";
|
||||
import type {
|
||||
NetworkOrSignerOrProvider,
|
||||
@@ -26,7 +26,7 @@ import { TokenErc721ContractSchema } from "../schema/contracts/token-erc721";
|
||||
import { SDKOptions } from "../schema/sdk-options";
|
||||
import { QueryAllParams } from "../types";
|
||||
import { TokenERC721 } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/TokenERC721.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/TokenERC721.json";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, BigNumberish, constants } from "ethers";
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import { ClaimVerification } from "../types";
|
||||
import { DEFAULT_QUERY_ALL_COUNT, QueryAllParams } from "../types/QueryParams";
|
||||
import { UploadProgressEvent } from "../types/events";
|
||||
import { DropERC721 } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/DropERC721.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/DropERC721.json";
|
||||
import {
|
||||
TokensClaimedEvent,
|
||||
TokensLazyMintedEvent,
|
||||
@@ -442,7 +442,7 @@ export class NFTDrop extends Erc721<DropERC721> {
|
||||
);
|
||||
const startingIndex = event[0].args.startTokenId;
|
||||
const endingIndex = event[0].args.endTokenId;
|
||||
const results = [];
|
||||
const results: TransactionResultWithId<NFTMetadata>[] = [];
|
||||
for (let id = startingIndex; id.lte(endingIndex); id = id.add(1)) {
|
||||
results.push({
|
||||
id,
|
||||
@@ -523,7 +523,7 @@ export class NFTDrop extends Erc721<DropERC721> {
|
||||
);
|
||||
const startingIndex: BigNumber = event[0].args.startTokenId;
|
||||
const endingIndex = startingIndex.add(quantity);
|
||||
const results = [];
|
||||
const results: TransactionResultWithId<NFTMetadataOwner>[] = [];
|
||||
for (let id = startingIndex; id.lt(endingIndex); id = id.add(1)) {
|
||||
results.push({
|
||||
id,
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
} from "../schema/tokens/pack";
|
||||
import { QueryAllParams } from "../types";
|
||||
import { Pack as PackContract } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/Pack.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/Pack.json";
|
||||
import {
|
||||
ITokenBundle,
|
||||
PackCreatedEvent,
|
||||
@@ -207,9 +207,9 @@ export class Pack extends Erc1155<PackContract> {
|
||||
const { contents, perUnitAmounts } =
|
||||
await this.contractWrapper.readContract.getPackContents(packId);
|
||||
|
||||
const erc20Rewards = [];
|
||||
const erc721Rewards = [];
|
||||
const erc1155Rewards = [];
|
||||
const erc20Rewards: PackRewardsOutput["erc20Rewards"] = [];
|
||||
const erc721Rewards: PackRewardsOutput["erc721Rewards"] = [];
|
||||
const erc1155Rewards: PackRewardsOutput["erc1155Rewards"] = [];
|
||||
|
||||
for (let i = 0; i < contents.length; i++) {
|
||||
const reward = contents[i];
|
||||
@@ -435,9 +435,9 @@ export class Pack extends Erc1155<PackContract> {
|
||||
}
|
||||
const rewards = event[0].args.rewardUnitsDistributed;
|
||||
|
||||
const erc20Rewards = [];
|
||||
const erc721Rewards = [];
|
||||
const erc1155Rewards = [];
|
||||
const erc20Rewards: PackRewards["erc20Rewards"] = [];
|
||||
const erc721Rewards: PackRewards["erc721Rewards"] = [];
|
||||
const erc1155Rewards: PackRewards["erc1155Rewards"] = [];
|
||||
|
||||
for (const reward of rewards) {
|
||||
switch (reward.tokenType) {
|
||||
@@ -485,7 +485,7 @@ export class Pack extends Erc1155<PackContract> {
|
||||
|
||||
private async toPackContentArgs(metadataWithRewards: PackMetadataOutput) {
|
||||
const contents: ITokenBundle.TokenStruct[] = [];
|
||||
const numOfRewardUnits = [];
|
||||
const numOfRewardUnits: string[] = [];
|
||||
const { erc20Rewards, erc721Rewards, erc1155Rewards } = metadataWithRewards;
|
||||
|
||||
const provider = this.contractWrapper.getProvider();
|
||||
@@ -544,7 +544,7 @@ export class Pack extends Erc1155<PackContract> {
|
||||
);
|
||||
}
|
||||
|
||||
numOfRewardUnits.push(1);
|
||||
numOfRewardUnits.push("1");
|
||||
contents.push({
|
||||
assetContract: erc721.contractAddress,
|
||||
tokenType: 1,
|
||||
|
||||
@@ -10,18 +10,16 @@ import { ContractRoles } from "../core/classes/contract-roles";
|
||||
import { ContractRoyalty } from "../core/classes/contract-royalty";
|
||||
import { ContractPrimarySale } from "../core/classes/contract-sales";
|
||||
import { ContractWrapper } from "../core/classes/contract-wrapper";
|
||||
import { DelayedReveal } from "../core/classes/delayed-reveal";
|
||||
import { DropClaimConditions } from "../core/classes/drop-claim-conditions";
|
||||
import { Erc721 } from "../core/classes/erc-721";
|
||||
import { Erc721Burnable } from "../core/classes/erc-721-burnable";
|
||||
import { Erc721Claimable } from "../core/classes/erc-721-claimable";
|
||||
import { Erc721Droppable } from "../core/classes/erc-721-droppable";
|
||||
import { Erc721Enumerable } from "../core/classes/erc-721-enumerable";
|
||||
import { Erc721Supply } from "../core/classes/erc-721-supply";
|
||||
import { Erc721WithQuantitySignatureMintable } from "../core/classes/erc-721-with-quantity-signature-mintable";
|
||||
import { GasCostEstimator } from "../core/classes/gas-cost-estimator";
|
||||
import {
|
||||
DelayedReveal,
|
||||
DropClaimConditions,
|
||||
Erc721Claimable,
|
||||
Erc721Droppable,
|
||||
} from "../core/index";
|
||||
import {
|
||||
NetworkOrSignerOrProvider,
|
||||
TransactionResult,
|
||||
@@ -37,7 +35,7 @@ import {
|
||||
import { UploadProgressEvent } from "../types";
|
||||
import { DEFAULT_QUERY_ALL_COUNT, QueryAllParams } from "../types/QueryParams";
|
||||
import { SignatureDrop as SignatureDropContract } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/SignatureDrop.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/SignatureDrop.json";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, BigNumberish, constants } from "ethers";
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import { SDKOptions } from "../schema/sdk-options";
|
||||
import { SplitRecipient } from "../types/SplitRecipient";
|
||||
import { CurrencyValue } from "../types/currency";
|
||||
import { IERC20, Split as SplitContract } from "@thirdweb-dev/contracts-js";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/abis/IERC20.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/Split.json";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC20.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/Split.json";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, Contract } from "ethers";
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import { DropErc20ContractSchema } from "../schema/contracts/drop-erc20";
|
||||
import { SDKOptions } from "../schema/sdk-options";
|
||||
import { Amount, CurrencyValue } from "../types";
|
||||
import { DropERC20 } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/DropERC20.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/DropERC20.json";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { constants } from "ethers";
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import { SDKOptions } from "../schema/sdk-options";
|
||||
import { TokenMintInput } from "../schema/tokens/token";
|
||||
import { Amount, CurrencyValue } from "../types";
|
||||
import { TokenERC20 } from "@thirdweb-dev/contracts-js";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/TokenERC20.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/TokenERC20.json";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { constants } from "ethers";
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ import {
|
||||
VoteSettings,
|
||||
} from "../types/vote";
|
||||
import { IERC20, VoteERC20 } from "@thirdweb-dev/contracts-js";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/abis/IERC20.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/abis/VoteERC20.json";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC20.json";
|
||||
import ABI from "@thirdweb-dev/contracts-js/dist/abis/VoteERC20.json";
|
||||
import { ProposalCreatedEvent } from "@thirdweb-dev/contracts-js/dist/declarations/src/VoteERC20";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, BigNumberish, Contract, ethers } from "ethers";
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
ContractPublisher as OnChainContractPublisher,
|
||||
IContractPublisher,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import ContractPublisherAbi from "@thirdweb-dev/contracts-js/abis/ContractPublisher.json";
|
||||
import ContractPublisherAbi from "@thirdweb-dev/contracts-js/dist/abis/ContractPublisher.json";
|
||||
import { ContractPublishedEvent } from "@thirdweb-dev/contracts-js/dist/declarations/src/ContractPublisher";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { constants, utils } from "ethers";
|
||||
@@ -245,15 +245,15 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
publisherAddress,
|
||||
);
|
||||
// since we can fetch from multiple publisher contracts, just keep the latest one in the list
|
||||
const map = data.reduce<
|
||||
Record<string, IContractPublisher.CustomContractInstanceStruct>
|
||||
>((acc, curr) => {
|
||||
const map = data.reduce((acc, curr) => {
|
||||
// replaces the previous contract with the latest one
|
||||
acc[curr.contractId] = curr;
|
||||
return acc;
|
||||
}, {});
|
||||
}, {} as Record<string, IContractPublisher.CustomContractInstanceStruct>);
|
||||
return Object.entries(map).map(([_, struct]) =>
|
||||
this.toPublishedContract(struct),
|
||||
this.toPublishedContract(
|
||||
struct as IContractPublisher.CustomContractInstanceStruct,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +1,28 @@
|
||||
import { BigNumber, BigNumberish, ethers } from "ethers";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { DropERC721, IThirdwebContract, SignatureDrop } from "@thirdweb-dev/contracts-js";
|
||||
import { hasFunction } from "../../common";
|
||||
import { fetchTokenMetadataForContract } from "../../common/nft";
|
||||
import { FeatureName } from "../../constants/contract-features";
|
||||
import {
|
||||
CommonNFTInput,
|
||||
NFTMetadata,
|
||||
NFTMetadataInput,
|
||||
} from "../../schema/tokens/common";
|
||||
import { TransactionResult, TransactionResultWithId } from "../index";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { fetchTokenMetadataForContract } from "../../common/nft";
|
||||
import { BatchToReveal } from "../../types/delayed-reveal";
|
||||
import { UploadProgressEvent } from "../../types/events";
|
||||
import {
|
||||
BaseDelayedRevealERC1155,
|
||||
BaseDelayedRevealERC721,
|
||||
} from "../../types/eips";
|
||||
import { hasFunction } from "../../common";
|
||||
import DeprecatedAbi from "@thirdweb-dev/contracts-js/abis/IDelayedRevealDeprecated.json";
|
||||
import { FeatureName } from "../../constants/contract-features";
|
||||
import { UploadProgressEvent } from "../../types/events";
|
||||
import { TransactionResult, TransactionResultWithId } from "../index";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import {
|
||||
DropERC721,
|
||||
IThirdwebContract,
|
||||
SignatureDrop,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import DeprecatedAbi from "@thirdweb-dev/contracts-js/dist/abis/IDelayedRevealDeprecated.json";
|
||||
import { TokensLazyMintedEvent } from "@thirdweb-dev/contracts-js/dist/declarations/src/DropERC721";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, BigNumberish, ethers } from "ethers";
|
||||
|
||||
/**
|
||||
* Handles delayed reveal logic
|
||||
@@ -156,7 +160,7 @@ export class DelayedReveal<
|
||||
);
|
||||
const startingIndex = events[0].args.startTokenId;
|
||||
const endingIndex = events[0].args.endTokenId;
|
||||
const results = [];
|
||||
const results: TransactionResultWithId[] = [];
|
||||
for (let id = startingIndex; id.lte(endingIndex); id = id.add(1)) {
|
||||
results.push({
|
||||
id,
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { includesErrorMessage } from "../../common";
|
||||
import {
|
||||
getClaimerProofs,
|
||||
prepareClaim,
|
||||
processClaimConditionInputs,
|
||||
transformResultToClaimCondition,
|
||||
updateExistingClaimConditions,
|
||||
} from "../../common/claim-conditions";
|
||||
import { isNativeToken } from "../../common/currency";
|
||||
import {
|
||||
detectContractFeature,
|
||||
hasFunction,
|
||||
} from "../../common/feature-detection";
|
||||
import { isNode } from "../../common/utils";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../../constants/index";
|
||||
import { ClaimEligibility } from "../../enums";
|
||||
import { AmountSchema } from "../../schema";
|
||||
import {
|
||||
Amount,
|
||||
ClaimCondition,
|
||||
ClaimConditionInput,
|
||||
ClaimVerification,
|
||||
} from "../../types";
|
||||
import { BaseClaimConditionERC721, BaseDropERC20 } from "../../types/eips";
|
||||
import { TransactionResult } from "../types";
|
||||
import { ContractMetadata } from "./contract-metadata";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import {
|
||||
ContractMetadata as ContractMetadataContract,
|
||||
DropERC20,
|
||||
@@ -9,36 +34,11 @@ import {
|
||||
IERC20Metadata,
|
||||
SignatureDrop,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import { BigNumber, BigNumberish, constants, ethers, utils } from "ethers";
|
||||
import { isNativeToken } from "../../common/currency";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import {
|
||||
Amount,
|
||||
ClaimCondition,
|
||||
ClaimConditionInput,
|
||||
ClaimVerification,
|
||||
} from "../../types";
|
||||
import { ClaimEligibility } from "../../enums";
|
||||
import { TransactionResult } from "../types";
|
||||
import {
|
||||
getClaimerProofs,
|
||||
prepareClaim,
|
||||
processClaimConditionInputs,
|
||||
transformResultToClaimCondition,
|
||||
updateExistingClaimConditions,
|
||||
} from "../../common/claim-conditions";
|
||||
import {
|
||||
detectContractFeature,
|
||||
hasFunction,
|
||||
} from "../../common/feature-detection";
|
||||
import { AmountSchema } from "../../schema";
|
||||
import { includesErrorMessage } from "../../common";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/abis/IERC20.json";
|
||||
import { isNode } from "../../common/utils";
|
||||
import deepEqual from "fast-deep-equal";
|
||||
import { BaseClaimConditionERC721, BaseDropERC20 } from "../../types/eips";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../../constants/index";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC20.json";
|
||||
import { IDropClaimCondition } from "@thirdweb-dev/contracts-js/dist/declarations/src/DropERC20";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { BigNumber, BigNumberish, constants, ethers, utils } from "ethers";
|
||||
import deepEqual from "fast-deep-equal";
|
||||
|
||||
/**
|
||||
* Manages claim conditions for NFT Drop contracts
|
||||
@@ -113,7 +113,7 @@ export class DropClaimConditions<
|
||||
};
|
||||
const startId = claimCondition.currentStartId.toNumber();
|
||||
const count = claimCondition.count.toNumber();
|
||||
const conditions = [];
|
||||
const conditions: IDropClaimCondition.ClaimConditionStructOutput[] = [];
|
||||
for (let i = startId; i < startId + count; i++) {
|
||||
conditions.push(
|
||||
await this.contractWrapper.readContract.getClaimConditionById(i),
|
||||
@@ -411,7 +411,7 @@ export class DropClaimConditions<
|
||||
merkleInfo[s.merkleRoot] = s.snapshotUri;
|
||||
});
|
||||
const metadata = await this.metadata.get();
|
||||
const encoded = [];
|
||||
const encoded: string[] = [];
|
||||
|
||||
// upload new merkle roots to snapshot URIs if updated
|
||||
if (!deepEqual(metadata.merkle, merkleInfo)) {
|
||||
|
||||
@@ -110,7 +110,7 @@ export class DropErc1155ClaimConditions<
|
||||
};
|
||||
const startId = claimCondition.currentStartId.toNumber();
|
||||
const count = claimCondition.count.toNumber();
|
||||
const conditions = [];
|
||||
const conditions: IDropClaimCondition.ClaimConditionStructOutput[] = [];
|
||||
for (let i = startId; i < startId + count; i++) {
|
||||
conditions.push(
|
||||
await this.contractWrapper.readContract.getClaimConditionById(
|
||||
@@ -471,7 +471,7 @@ export class DropErc1155ClaimConditions<
|
||||
);
|
||||
|
||||
const metadata = await this.metadata.get();
|
||||
const encoded = [];
|
||||
const encoded: string[] = [];
|
||||
|
||||
// keep the old merkle roots from other tokenIds
|
||||
for (const key of Object.keys(metadata.merkle || {})) {
|
||||
|
||||
@@ -163,7 +163,7 @@ export class Erc1155Droppable implements DetectableFeature {
|
||||
);
|
||||
const startingIndex = event[0].args.startTokenId;
|
||||
const endingIndex = event[0].args.endTokenId;
|
||||
const results = [];
|
||||
const results: TransactionResultWithId<NFTMetadata>[] = [];
|
||||
for (let id = startingIndex; id.lte(endingIndex); id = id.add(1)) {
|
||||
results.push({
|
||||
id,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { IMintableERC20, IMulticall } from "@thirdweb-dev/contracts-js";
|
||||
import { Erc20 } from "./erc-20";
|
||||
import { TokenMintInput } from "../../schema";
|
||||
import { TransactionResult } from "../types";
|
||||
import { FEATURE_TOKEN_BATCH_MINTABLE } from "../../constants/erc20-features";
|
||||
import { TokenMintInput } from "../../schema";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { TransactionResult } from "../types";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { Erc20 } from "./erc-20";
|
||||
import { IMintableERC20, IMulticall } from "@thirdweb-dev/contracts-js";
|
||||
|
||||
/**
|
||||
* Mint Many ERC20 Tokens at once
|
||||
@@ -52,7 +52,7 @@ export class Erc20BatchMintable implements DetectableFeature {
|
||||
* ```
|
||||
*/
|
||||
public async to(args: TokenMintInput[]): Promise<TransactionResult> {
|
||||
const encoded = [];
|
||||
const encoded: string[] = [];
|
||||
for (const arg of args) {
|
||||
encoded.push(
|
||||
this.contractWrapper.readContract.interface.encodeFunctionData(
|
||||
|
||||
@@ -159,7 +159,7 @@ export class Erc721Claimable implements DetectableFeature {
|
||||
);
|
||||
const startingIndex: BigNumber = event[0].args.startTokenId;
|
||||
const endingIndex = startingIndex.add(quantity);
|
||||
const results = [];
|
||||
const results: TransactionResultWithId<NFTMetadataOwner>[] = [];
|
||||
for (let id = startingIndex; id.lt(endingIndex); id = id.add(1)) {
|
||||
results.push({
|
||||
id,
|
||||
|
||||
@@ -156,7 +156,7 @@ export class Erc721Droppable implements DetectableFeature {
|
||||
);
|
||||
const startingIndex = event[0].args.startTokenId;
|
||||
const endingIndex = event[0].args.endTokenId;
|
||||
const results = [];
|
||||
const results: TransactionResultWithId<NFTMetadata>[] = [];
|
||||
for (let id = startingIndex; id.lte(endingIndex); id = id.add(1)) {
|
||||
results.push({
|
||||
id,
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
import { ListingNotFoundError, WrongListingTypeError } from "../../common";
|
||||
import {
|
||||
fetchCurrencyValue,
|
||||
isNativeToken,
|
||||
normalizePriceValue,
|
||||
setErc20Allowance,
|
||||
} from "../../common/currency";
|
||||
import {
|
||||
handleTokenApproval,
|
||||
isTokenApprovedForTransfer,
|
||||
mapOffer,
|
||||
validateNewListingParam,
|
||||
} from "../../common/marketplace";
|
||||
import { fetchTokenMetadataForContract } from "../../common/nft";
|
||||
import {
|
||||
InterfaceId_IERC1155,
|
||||
InterfaceId_IERC721,
|
||||
} from "../../constants/contract";
|
||||
import { ListingType } from "../../enums";
|
||||
import { Price } from "../../types/currency";
|
||||
import {
|
||||
DirectListing,
|
||||
NewDirectListing,
|
||||
Offer,
|
||||
} from "../../types/marketplace";
|
||||
import { TransactionResult, TransactionResultWithId } from "../types";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import {
|
||||
IERC1155,
|
||||
@@ -6,6 +32,11 @@ import {
|
||||
IMarketplace,
|
||||
Marketplace,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import ERC165Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC165.json";
|
||||
import ERC721Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC721.json";
|
||||
import ERC1155Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC1155.json";
|
||||
import { ListingAddedEvent } from "@thirdweb-dev/contracts-js/dist/declarations/src/Marketplace";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import {
|
||||
BigNumber,
|
||||
BigNumberish,
|
||||
@@ -14,38 +45,7 @@ import {
|
||||
constants,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import {
|
||||
DirectListing,
|
||||
NewDirectListing,
|
||||
Offer,
|
||||
} from "../../types/marketplace";
|
||||
import { ListingNotFoundError, WrongListingTypeError } from "../../common";
|
||||
import { ListingType } from "../../enums";
|
||||
import { TransactionResult, TransactionResultWithId } from "../types";
|
||||
import {
|
||||
fetchCurrencyValue,
|
||||
isNativeToken,
|
||||
normalizePriceValue,
|
||||
setErc20Allowance,
|
||||
} from "../../common/currency";
|
||||
import { Price } from "../../types/currency";
|
||||
import { fetchTokenMetadataForContract } from "../../common/nft";
|
||||
import {
|
||||
InterfaceId_IERC1155,
|
||||
InterfaceId_IERC721,
|
||||
} from "../../constants/contract";
|
||||
import {
|
||||
handleTokenApproval,
|
||||
isTokenApprovedForTransfer,
|
||||
mapOffer,
|
||||
validateNewListingParam,
|
||||
} from "../../common/marketplace";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import invariant from "tiny-invariant";
|
||||
import ERC1155Abi from "@thirdweb-dev/contracts-js/abis/IERC1155.json";
|
||||
import ERC721Abi from "@thirdweb-dev/contracts-js/abis/IERC721.json";
|
||||
import ERC165Abi from "@thirdweb-dev/contracts-js/abis/IERC165.json";
|
||||
import { ListingAddedEvent } from "@thirdweb-dev/contracts-js/dist/declarations/src/Marketplace";
|
||||
|
||||
/**
|
||||
* Handles direct listings
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { RPCConnectionHandler } from "../classes/rpc-connection-handler";
|
||||
import { NetworkOrSignerOrProvider, TransactionResult } from "../types";
|
||||
import { SDKOptions } from "../../schema";
|
||||
import invariant from "tiny-invariant";
|
||||
import { Amount, CurrencyValue } from "../../types";
|
||||
import {
|
||||
fetchCurrencyValue,
|
||||
isNativeToken,
|
||||
normalizePriceValue,
|
||||
} from "../../common/currency";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../../constants";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/abis/IERC20.json";
|
||||
import { SDKOptions } from "../../schema";
|
||||
import { Amount, CurrencyValue } from "../../types";
|
||||
import { ContractWrapper } from "../classes/contract-wrapper";
|
||||
import { RPCConnectionHandler } from "../classes/rpc-connection-handler";
|
||||
import { NetworkOrSignerOrProvider, TransactionResult } from "../types";
|
||||
import { IERC20 } from "@thirdweb-dev/contracts-js";
|
||||
import ERC20Abi from "@thirdweb-dev/contracts-js/dist/abis/IERC20.json";
|
||||
import { ethers, BigNumber, providers } from "ethers";
|
||||
import invariant from "tiny-invariant";
|
||||
|
||||
/**
|
||||
* Connect and Interact with a user wallet
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { signers } from "./before-setup";
|
||||
import { expect } from "chai";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { ThirdwebSDK } from "../src";
|
||||
import { signers } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { expect } from "chai";
|
||||
|
||||
describe("Wallet Authentication", async () => {
|
||||
let adminWallet: SignerWithAddress,
|
||||
|
||||
@@ -1,250 +0,0 @@
|
||||
import {
|
||||
CONTRACTS_MAP,
|
||||
ContractType,
|
||||
DEFAULT_IPFS_GATEWAY,
|
||||
Edition,
|
||||
EditionDrop,
|
||||
getNativeTokenByChainId,
|
||||
Marketplace,
|
||||
Multiwrap,
|
||||
NFTCollection,
|
||||
NFTDrop,
|
||||
Pack,
|
||||
SignatureDrop,
|
||||
Split,
|
||||
ThirdwebSDK,
|
||||
Token,
|
||||
TokenDrop,
|
||||
Vote,
|
||||
} from "../src";
|
||||
import { ChainId } from "../src/constants/chains";
|
||||
import { MockStorage } from "./mock/MockStorage";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import {
|
||||
ContractPublisher,
|
||||
ContractPublisher__factory,
|
||||
DropERC1155__factory,
|
||||
DropERC20__factory,
|
||||
DropERC721__factory,
|
||||
Marketplace__factory,
|
||||
MockContractPublisher,
|
||||
MockContractPublisher__factory,
|
||||
Multiwrap__factory,
|
||||
Pack__factory,
|
||||
SignatureDrop__factory,
|
||||
Split__factory,
|
||||
TokenERC1155__factory,
|
||||
TokenERC20__factory,
|
||||
TokenERC721__factory,
|
||||
TWFactory,
|
||||
TWFactory__factory,
|
||||
TWFee__factory,
|
||||
TWRegistry,
|
||||
TWRegistry__factory,
|
||||
VoteERC20__factory,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { ethers } from "ethers";
|
||||
//@ts-expext-error TS2551: Cannot find name 'ethers'.
|
||||
import { ethers as hardhatEthers } from "hardhat";
|
||||
|
||||
const RPC_URL = "http://localhost:8545";
|
||||
|
||||
const jsonProvider = new ethers.providers.JsonRpcProvider(RPC_URL);
|
||||
const defaultProvider = hardhatEthers.provider;
|
||||
|
||||
let registryAddress: string;
|
||||
let sdk: ThirdwebSDK;
|
||||
const ipfsGatewayUrl = DEFAULT_IPFS_GATEWAY;
|
||||
let signer: SignerWithAddress;
|
||||
let signers: SignerWithAddress[];
|
||||
let storage: IStorage;
|
||||
let implementations: { [key in ContractType]?: string };
|
||||
|
||||
const fastForwardTime = async (timeInSeconds: number): Promise<void> => {
|
||||
const now = Math.floor(Date.now() / 1000);
|
||||
await defaultProvider.send("evm_mine", [now + timeInSeconds]);
|
||||
};
|
||||
|
||||
export const expectError = (e: unknown, message: string) => {
|
||||
if (e instanceof Error) {
|
||||
if (!e.message.includes(message)) {
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
||||
before(async () => {
|
||||
signers = await hardhatEthers.getSigners();
|
||||
implementations = {};
|
||||
|
||||
[signer] = signers;
|
||||
|
||||
const trustedForwarderAddress = "0xc82BbE41f2cF04e3a8efA18F7032BDD7f6d98a81";
|
||||
await jsonProvider.send("hardhat_reset", []);
|
||||
|
||||
const registry = (await new ethers.ContractFactory(
|
||||
TWRegistry__factory.abi,
|
||||
TWRegistry__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy(trustedForwarderAddress)) as TWRegistry;
|
||||
const registryContract = await registry.deployed();
|
||||
|
||||
const thirdwebFactoryDeployer = (await new ethers.ContractFactory(
|
||||
TWFactory__factory.abi,
|
||||
TWFactory__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy(trustedForwarderAddress, registry.address)) as TWFactory;
|
||||
|
||||
const deployTxFactory = thirdwebFactoryDeployer.deployTransaction;
|
||||
await deployTxFactory.wait();
|
||||
const thirdwebRegistryAddress = await thirdwebFactoryDeployer.registry();
|
||||
registryAddress = thirdwebFactoryDeployer.address;
|
||||
|
||||
await registryContract.grantRole(
|
||||
await registryContract.OPERATOR_ROLE(),
|
||||
thirdwebFactoryDeployer.address,
|
||||
);
|
||||
|
||||
const thirdwebFeeDeployer = await new ethers.ContractFactory(
|
||||
TWFee__factory.abi,
|
||||
TWFee__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy(trustedForwarderAddress, thirdwebFactoryDeployer.address);
|
||||
await thirdwebFactoryDeployer.deployed();
|
||||
|
||||
// Mock publisher for tests
|
||||
const mockPublisher = (await new ethers.ContractFactory(
|
||||
MockContractPublisher__factory.abi,
|
||||
MockContractPublisher__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy()) as MockContractPublisher;
|
||||
const contractPublisher = (await new ethers.ContractFactory(
|
||||
ContractPublisher__factory.abi,
|
||||
ContractPublisher__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy(
|
||||
trustedForwarderAddress,
|
||||
mockPublisher.address,
|
||||
)) as ContractPublisher; // TODO needs MockPublisher here
|
||||
await contractPublisher.deployed();
|
||||
|
||||
async function deployContract(
|
||||
contractFactory: ethers.ContractFactory,
|
||||
contractType: ContractType,
|
||||
): Promise<ethers.Contract> {
|
||||
switch (contractType) {
|
||||
case Marketplace.contractType:
|
||||
case Multiwrap.contractType:
|
||||
const nativeTokenWrapperAddress = getNativeTokenByChainId(
|
||||
ChainId.Hardhat,
|
||||
).wrapped.address;
|
||||
return await contractFactory.deploy(nativeTokenWrapperAddress);
|
||||
case Pack.contractType:
|
||||
const addr = getNativeTokenByChainId(ChainId.Hardhat).wrapped.address;
|
||||
return await contractFactory.deploy(addr, trustedForwarderAddress);
|
||||
default:
|
||||
return await contractFactory.deploy();
|
||||
}
|
||||
}
|
||||
|
||||
for (const contractType in CONTRACTS_MAP) {
|
||||
if (contractType === "custom") {
|
||||
continue;
|
||||
}
|
||||
let factory;
|
||||
switch (contractType) {
|
||||
case Token.contractType:
|
||||
factory = TokenERC20__factory;
|
||||
break;
|
||||
case TokenDrop.contractType:
|
||||
factory = DropERC20__factory;
|
||||
break;
|
||||
case NFTCollection.contractType:
|
||||
factory = TokenERC721__factory;
|
||||
break;
|
||||
case NFTDrop.contractType:
|
||||
factory = DropERC721__factory;
|
||||
break;
|
||||
case SignatureDrop.contractType:
|
||||
factory = SignatureDrop__factory;
|
||||
break;
|
||||
case Edition.contractType:
|
||||
factory = TokenERC1155__factory;
|
||||
break;
|
||||
case EditionDrop.contractType:
|
||||
factory = DropERC1155__factory;
|
||||
break;
|
||||
case Split.contractType:
|
||||
factory = Split__factory;
|
||||
break;
|
||||
case Vote.contractType:
|
||||
factory = VoteERC20__factory;
|
||||
break;
|
||||
case Marketplace.contractType:
|
||||
factory = Marketplace__factory;
|
||||
break;
|
||||
case Pack.contractType:
|
||||
factory = Pack__factory;
|
||||
break;
|
||||
case Multiwrap.contractType:
|
||||
factory = Multiwrap__factory;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`No factory for contract: ${contractType}`);
|
||||
}
|
||||
|
||||
const contractFactory = new ethers.ContractFactory(
|
||||
factory.abi,
|
||||
factory.bytecode,
|
||||
).connect(signer);
|
||||
|
||||
const deployedContract: ethers.Contract = await deployContract(
|
||||
contractFactory,
|
||||
contractType as ContractType,
|
||||
);
|
||||
|
||||
await deployedContract.deployed();
|
||||
const tx = await thirdwebFactoryDeployer.addImplementation(
|
||||
deployedContract.address,
|
||||
);
|
||||
await tx.wait();
|
||||
implementations[contractType as ContractType] = deployedContract.address;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
process.env.registryAddress = thirdwebRegistryAddress;
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
process.env.factoryAddress = thirdwebFactoryDeployer.address;
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
process.env.contractPublisherAddress = contractPublisher.address;
|
||||
|
||||
storage = new MockStorage();
|
||||
sdk = new ThirdwebSDK(
|
||||
signer,
|
||||
{
|
||||
gasSettings: {
|
||||
maxPriceInGwei: 10000,
|
||||
},
|
||||
},
|
||||
storage,
|
||||
);
|
||||
});
|
||||
export {
|
||||
ipfsGatewayUrl,
|
||||
sdk,
|
||||
signers,
|
||||
jsonProvider,
|
||||
defaultProvider,
|
||||
registryAddress,
|
||||
fastForwardTime,
|
||||
storage,
|
||||
implementations,
|
||||
};
|
||||
@@ -1,21 +1,20 @@
|
||||
import { expectError, signers } from "./before-setup";
|
||||
import { assert, expect } from "chai";
|
||||
import invariant from "tiny-invariant";
|
||||
import {
|
||||
TokenERC20__factory,
|
||||
TokenERC721__factory,
|
||||
VoteERC20__factory,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import {
|
||||
NATIVE_TOKEN_ADDRESS,
|
||||
PayloadToSign20,
|
||||
SignedPayload721WithQuantitySignature,
|
||||
ThirdwebSDK,
|
||||
} from "../src";
|
||||
import { expectError, signers } from "./hooks";
|
||||
import "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import {
|
||||
TokenERC20__factory,
|
||||
TokenERC721__factory,
|
||||
VoteERC20__factory,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import { assert, expect } from "chai";
|
||||
import { ethers } from "ethers";
|
||||
|
||||
require("./before-setup");
|
||||
import invariant from "tiny-invariant";
|
||||
|
||||
global.fetch = require("cross-fetch");
|
||||
|
||||
@@ -34,7 +33,7 @@ describe("Custom Contracts", async () => {
|
||||
let sdk: ThirdwebSDK;
|
||||
let simpleContractUri: string;
|
||||
|
||||
before(async () => {
|
||||
beforeAll(async () => {
|
||||
[adminWallet, samWallet, bobWallet] = signers;
|
||||
sdk = new ThirdwebSDK(adminWallet);
|
||||
simpleContractUri =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import { ClaimEligibility } from "../src/enums";
|
||||
import { EditionDrop, Token } from "../src/index";
|
||||
import { expectError, sdk, signers } from "./before-setup";
|
||||
import { expectError, sdk, signers } from "./hooks";
|
||||
import { AddressZero } from "@ethersproject/constants";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect, use } from "chai";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Edition } from "../src/index";
|
||||
import { expectError, sdk, signers, storage } from "./before-setup";
|
||||
import { expectError, sdk, signers, storage } from "./hooks";
|
||||
import { AddressZero } from "@ethersproject/constants";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ethers, Wallet } from "ethers";
|
||||
import { sdk, signers } from "./before-setup";
|
||||
import { expect } from "chai";
|
||||
import { ContractEvent, NFTDrop, NFTCollection } from "../src";
|
||||
import { sdk, signers } from "./hooks";
|
||||
import { AddressZero } from "@ethersproject/constants";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { expect } from "chai";
|
||||
import { ethers, Wallet } from "ethers";
|
||||
|
||||
global.fetch = require("cross-fetch");
|
||||
|
||||
@@ -35,17 +35,17 @@ describe("Events", async () => {
|
||||
);
|
||||
|
||||
dropContract2 = sdk.getNFTDrop(
|
||||
await sdk.deployer.deployBuiltInContract(NFTDrop.contractType, {
|
||||
name: `Testing drop from SDK`,
|
||||
description: "Test contract from tests",
|
||||
image:
|
||||
"https://pbs.twimg.com/profile_images/1433508973215367176/XBCfBn3g_400x400.jpg",
|
||||
primary_sale_recipient: AddressZero,
|
||||
seller_fee_basis_points: 500,
|
||||
fee_recipient: AddressZero,
|
||||
platform_fee_basis_points: 10,
|
||||
platform_fee_recipient: AddressZero,
|
||||
}),
|
||||
await sdk.deployer.deployBuiltInContract(NFTDrop.contractType, {
|
||||
name: `Testing drop from SDK`,
|
||||
description: "Test contract from tests",
|
||||
image:
|
||||
"https://pbs.twimg.com/profile_images/1433508973215367176/XBCfBn3g_400x400.jpg",
|
||||
primary_sale_recipient: AddressZero,
|
||||
seller_fee_basis_points: 500,
|
||||
fee_recipient: AddressZero,
|
||||
platform_fee_basis_points: 10,
|
||||
platform_fee_recipient: AddressZero,
|
||||
}),
|
||||
);
|
||||
|
||||
nftContract = sdk.getNFTCollection(
|
||||
@@ -79,9 +79,12 @@ describe("Events", async () => {
|
||||
|
||||
it("should emit Contract events", async () => {
|
||||
const events: ContractEvent[] = [];
|
||||
const remove = dropContract.events.addEventListener("TokensLazyMinted", (event) => {
|
||||
events.push(event);
|
||||
});
|
||||
const remove = dropContract.events.addEventListener(
|
||||
"TokensLazyMinted",
|
||||
(event) => {
|
||||
events.push(event);
|
||||
},
|
||||
);
|
||||
await dropContract.createBatch([
|
||||
{
|
||||
name: "1",
|
||||
@@ -110,7 +113,7 @@ describe("Events", async () => {
|
||||
},
|
||||
]);
|
||||
await dropContract2.claimConditions.set([{}]);
|
||||
await dropContract2.claim(1)
|
||||
await dropContract2.claim(1);
|
||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||
remove();
|
||||
expect(events.length).to.be.gt(0);
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
import {
|
||||
CONTRACTS_MAP,
|
||||
ContractType,
|
||||
DEFAULT_IPFS_GATEWAY,
|
||||
Edition,
|
||||
EditionDrop,
|
||||
getNativeTokenByChainId,
|
||||
Marketplace,
|
||||
Multiwrap,
|
||||
NFTCollection,
|
||||
NFTDrop,
|
||||
Pack,
|
||||
SignatureDrop,
|
||||
Split,
|
||||
ThirdwebSDK,
|
||||
Token,
|
||||
TokenDrop,
|
||||
Vote,
|
||||
} from "../src";
|
||||
import { ChainId } from "../src/constants/chains";
|
||||
import { MockStorage } from "./mock/MockStorage";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import {
|
||||
ContractPublisher,
|
||||
ContractPublisher__factory,
|
||||
DropERC1155__factory,
|
||||
DropERC20__factory,
|
||||
DropERC721__factory,
|
||||
Marketplace__factory,
|
||||
MockContractPublisher,
|
||||
MockContractPublisher__factory,
|
||||
Multiwrap__factory,
|
||||
Pack__factory,
|
||||
SignatureDrop__factory,
|
||||
Split__factory,
|
||||
TokenERC1155__factory,
|
||||
TokenERC20__factory,
|
||||
TokenERC721__factory,
|
||||
TWFactory,
|
||||
TWFactory__factory,
|
||||
TWFee__factory,
|
||||
TWRegistry,
|
||||
TWRegistry__factory,
|
||||
VoteERC20__factory,
|
||||
} from "@thirdweb-dev/contracts-js";
|
||||
import { IStorage } from "@thirdweb-dev/storage";
|
||||
import { ethers } from "ethers";
|
||||
//@ts-expext-error TS2551: Cannot find name 'ethers'.
|
||||
import { ethers as hardhatEthers } from "hardhat";
|
||||
|
||||
const RPC_URL = "http://localhost:8545";
|
||||
|
||||
const jsonProvider = new ethers.providers.JsonRpcProvider(RPC_URL);
|
||||
const defaultProvider = hardhatEthers.provider;
|
||||
|
||||
let registryAddress: string;
|
||||
let sdk: ThirdwebSDK;
|
||||
const ipfsGatewayUrl = DEFAULT_IPFS_GATEWAY;
|
||||
let signer: SignerWithAddress;
|
||||
let signers: SignerWithAddress[];
|
||||
let storage: IStorage;
|
||||
let implementations: { [key in ContractType]?: string };
|
||||
|
||||
const fastForwardTime = async (timeInSeconds: number): Promise<void> => {
|
||||
const now = Math.floor(Date.now() / 1000);
|
||||
await defaultProvider.send("evm_mine", [now + timeInSeconds]);
|
||||
};
|
||||
|
||||
export const expectError = (e: unknown, message: string) => {
|
||||
if (e instanceof Error) {
|
||||
if (!e.message.includes(message)) {
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
||||
export const mochaHooks = {
|
||||
beforeAll: async () => {
|
||||
signers = await hardhatEthers.getSigners();
|
||||
implementations = {};
|
||||
|
||||
[signer] = signers;
|
||||
|
||||
const trustedForwarderAddress =
|
||||
"0xc82BbE41f2cF04e3a8efA18F7032BDD7f6d98a81";
|
||||
await jsonProvider.send("hardhat_reset", []);
|
||||
|
||||
const registry = (await new ethers.ContractFactory(
|
||||
TWRegistry__factory.abi,
|
||||
TWRegistry__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy(trustedForwarderAddress)) as TWRegistry;
|
||||
const registryContract = await registry.deployed();
|
||||
|
||||
const thirdwebFactoryDeployer = (await new ethers.ContractFactory(
|
||||
TWFactory__factory.abi,
|
||||
TWFactory__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy(trustedForwarderAddress, registry.address)) as TWFactory;
|
||||
|
||||
const deployTxFactory = thirdwebFactoryDeployer.deployTransaction;
|
||||
await deployTxFactory.wait();
|
||||
const thirdwebRegistryAddress = await thirdwebFactoryDeployer.registry();
|
||||
registryAddress = thirdwebFactoryDeployer.address;
|
||||
|
||||
await registryContract.grantRole(
|
||||
await registryContract.OPERATOR_ROLE(),
|
||||
thirdwebFactoryDeployer.address,
|
||||
);
|
||||
|
||||
const thirdwebFeeDeployer = await new ethers.ContractFactory(
|
||||
TWFee__factory.abi,
|
||||
TWFee__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy(trustedForwarderAddress, thirdwebFactoryDeployer.address);
|
||||
await thirdwebFactoryDeployer.deployed();
|
||||
|
||||
// Mock publisher for tests
|
||||
const mockPublisher = (await new ethers.ContractFactory(
|
||||
MockContractPublisher__factory.abi,
|
||||
MockContractPublisher__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy()) as MockContractPublisher;
|
||||
const contractPublisher = (await new ethers.ContractFactory(
|
||||
ContractPublisher__factory.abi,
|
||||
ContractPublisher__factory.bytecode,
|
||||
)
|
||||
.connect(signer)
|
||||
.deploy(
|
||||
trustedForwarderAddress,
|
||||
mockPublisher.address,
|
||||
)) as ContractPublisher; // TODO needs MockPublisher here
|
||||
await contractPublisher.deployed();
|
||||
|
||||
async function deployContract(
|
||||
contractFactory: ethers.ContractFactory,
|
||||
contractType: ContractType,
|
||||
): Promise<ethers.Contract> {
|
||||
switch (contractType) {
|
||||
case Marketplace.contractType:
|
||||
case Multiwrap.contractType:
|
||||
const nativeTokenWrapperAddress = getNativeTokenByChainId(
|
||||
ChainId.Hardhat,
|
||||
).wrapped.address;
|
||||
return await contractFactory.deploy(nativeTokenWrapperAddress);
|
||||
case Pack.contractType:
|
||||
const addr = getNativeTokenByChainId(ChainId.Hardhat).wrapped.address;
|
||||
return await contractFactory.deploy(addr, trustedForwarderAddress);
|
||||
default:
|
||||
return await contractFactory.deploy();
|
||||
}
|
||||
}
|
||||
|
||||
for (const contractType in CONTRACTS_MAP) {
|
||||
if (contractType === "custom") {
|
||||
continue;
|
||||
}
|
||||
let factory;
|
||||
switch (contractType) {
|
||||
case Token.contractType:
|
||||
factory = TokenERC20__factory;
|
||||
break;
|
||||
case TokenDrop.contractType:
|
||||
factory = DropERC20__factory;
|
||||
break;
|
||||
case NFTCollection.contractType:
|
||||
factory = TokenERC721__factory;
|
||||
break;
|
||||
case NFTDrop.contractType:
|
||||
factory = DropERC721__factory;
|
||||
break;
|
||||
case SignatureDrop.contractType:
|
||||
factory = SignatureDrop__factory;
|
||||
break;
|
||||
case Edition.contractType:
|
||||
factory = TokenERC1155__factory;
|
||||
break;
|
||||
case EditionDrop.contractType:
|
||||
factory = DropERC1155__factory;
|
||||
break;
|
||||
case Split.contractType:
|
||||
factory = Split__factory;
|
||||
break;
|
||||
case Vote.contractType:
|
||||
factory = VoteERC20__factory;
|
||||
break;
|
||||
case Marketplace.contractType:
|
||||
factory = Marketplace__factory;
|
||||
break;
|
||||
case Pack.contractType:
|
||||
factory = Pack__factory;
|
||||
break;
|
||||
case Multiwrap.contractType:
|
||||
factory = Multiwrap__factory;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`No factory for contract: ${contractType}`);
|
||||
}
|
||||
|
||||
const contractFactory = new ethers.ContractFactory(
|
||||
factory.abi,
|
||||
factory.bytecode,
|
||||
).connect(signer);
|
||||
|
||||
const deployedContract: ethers.Contract = await deployContract(
|
||||
contractFactory,
|
||||
contractType as ContractType,
|
||||
);
|
||||
|
||||
await deployedContract.deployed();
|
||||
const tx = await thirdwebFactoryDeployer.addImplementation(
|
||||
deployedContract.address,
|
||||
);
|
||||
await tx.wait();
|
||||
implementations[contractType as ContractType] = deployedContract.address;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
process.env.registryAddress = thirdwebRegistryAddress;
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
process.env.factoryAddress = thirdwebFactoryDeployer.address;
|
||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||
process.env.contractPublisherAddress = contractPublisher.address;
|
||||
|
||||
storage = new MockStorage();
|
||||
sdk = new ThirdwebSDK(
|
||||
signer,
|
||||
{
|
||||
gasSettings: {
|
||||
maxPriceInGwei: 10000,
|
||||
},
|
||||
},
|
||||
storage,
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export {
|
||||
ipfsGatewayUrl,
|
||||
sdk,
|
||||
signers,
|
||||
jsonProvider,
|
||||
defaultProvider,
|
||||
registryAddress,
|
||||
fastForwardTime,
|
||||
storage,
|
||||
implementations,
|
||||
};
|
||||
@@ -1,14 +1,12 @@
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { BigNumber, BigNumberish, ethers } from "ethers";
|
||||
import {
|
||||
AuctionAlreadyStartedError,
|
||||
ListingNotFoundError,
|
||||
WrongListingTypeError,
|
||||
} from "../src/common/error";
|
||||
import { isWinningBid } from "../src/common/marketplace";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import { ListingType } from "../src/enums/marketplace";
|
||||
import { Edition, Marketplace, NFTCollection, Token } from "../src/contracts";
|
||||
import { ListingType } from "../src/enums/marketplace";
|
||||
import { AuctionListing, DirectListing, Offer } from "../src/types/marketplace";
|
||||
import {
|
||||
expectError,
|
||||
@@ -16,8 +14,10 @@ import {
|
||||
jsonProvider,
|
||||
sdk,
|
||||
signers,
|
||||
} from "./before-setup";
|
||||
import { isWinningBid } from "../src/common/marketplace";
|
||||
} from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { BigNumber, BigNumberish, ethers } from "ethers";
|
||||
import { ethers as hardhatEthers } from "hardhat";
|
||||
|
||||
global.fetch = require("cross-fetch");
|
||||
@@ -215,7 +215,7 @@ describe("Marketplace Contract", async () => {
|
||||
assert.isDefined(listingId);
|
||||
});
|
||||
|
||||
it("should be able to restrict listing", async () => {
|
||||
it.skip("should be able to restrict listing", async () => {
|
||||
await marketplaceContract.allowListingFromSpecificAssetOnly(
|
||||
dummyBundleContract.getAddress(),
|
||||
);
|
||||
@@ -1087,9 +1087,7 @@ describe("Marketplace Contract", async () => {
|
||||
try {
|
||||
await marketplaceContract.direct.buyoutListing(directListingId, 1);
|
||||
assert.fail("should have thrown");
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
}
|
||||
} catch (err: any) {}
|
||||
});
|
||||
|
||||
it("should not return invalid direct listings", async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { sdk, signers } from "./before-setup";
|
||||
import { Edition, Multiwrap, NFTCollection, Token } from "../src/contracts";
|
||||
import { sdk, signers } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { expect } from "chai";
|
||||
|
||||
describe("Multiwrap Contract", async () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { NFTDrop, NFTMetadata, NFTMetadataInput, Token } from "../src";
|
||||
import { createSnapshot } from "../src/common";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import { ClaimEligibility } from "../src/enums";
|
||||
import { expectError, sdk, signers, storage } from "./before-setup";
|
||||
import { expectError, sdk, signers, storage } from "./hooks";
|
||||
import { AddressZero } from "@ethersproject/constants";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NFTMetadataInput } from "../src";
|
||||
import { NFTCollection } from "../src/contracts";
|
||||
import { sdk, signers, storage } from "./before-setup";
|
||||
import { sdk, signers, storage } from "./hooks";
|
||||
import { AddressZero } from "@ethersproject/constants";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { EditionMetadataInput, Pack, Edition } from "../src";
|
||||
import { sdk, signers } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { sdk, signers } from "./before-setup";
|
||||
|
||||
import { assert } from "chai";
|
||||
import { BigNumber } from "ethers";
|
||||
import { EditionMetadataInput, Pack, Edition } from "../src";
|
||||
|
||||
global.fetch = require("cross-fetch");
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
resolveContractUriFromAddress,
|
||||
ThirdwebSDK,
|
||||
} from "../src";
|
||||
import { implementations, signers } from "./before-setup";
|
||||
import { implementations, signers } from "./hooks";
|
||||
import { AddressZero } from "@ethersproject/constants";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { sdk, signers } from "./before-setup";
|
||||
import { expect } from "chai";
|
||||
import { ContractRegistry } from "../src/core/classes/registry";
|
||||
import { sdk, signers } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { expect } from "chai";
|
||||
|
||||
describe("Contract Registry", () => {
|
||||
let registry: ContractRegistry;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { Edition } from "../src/index";
|
||||
import { sdk, signers } from "./before-setup";
|
||||
|
||||
import { assert } from "chai";
|
||||
import { sdk, signers } from "./hooks";
|
||||
import { AddressZero } from "@ethersproject/constants";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert } from "chai";
|
||||
|
||||
global.fetch = require("cross-fetch");
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { Edition } from "../src/index";
|
||||
import { sdk, signers } from "./before-setup";
|
||||
|
||||
import { sdk, signers } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
|
||||
global.fetch = require("cross-fetch");
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from "../src";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import { SignedPayload721WithQuantitySignature } from "../src/schema/contracts/common/signature";
|
||||
import { expectError, sdk, signers, storage } from "./before-setup";
|
||||
import { expectError, sdk, signers, storage } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { BigNumber, ethers } from "ethers";
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { BigNumber, ethers } from "ethers";
|
||||
import { Edition, Token } from "../src";
|
||||
import { sdk, signers, storage } from "./before-setup";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import {
|
||||
PayloadToSign1155,
|
||||
SignedPayload1155,
|
||||
} from "../src/schema/contracts/common/signature";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import { sdk, signers, storage } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { BigNumber, ethers } from "ethers";
|
||||
|
||||
global.fetch = require("cross-fetch");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PayloadToSign20, SignedPayload20, Token } from "../src";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import { sdk, signers } from "./before-setup";
|
||||
import { sdk, signers } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { BigNumber } from "ethers";
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
Token,
|
||||
} from "../src";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import { sdk, signers, storage } from "./before-setup";
|
||||
import { sdk, signers, storage } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { BigNumber } from "ethers";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Split, Token } from "../src";
|
||||
import { sdk, signers } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { sdk, signers } from "./before-setup";
|
||||
import { Split, Token } from "../src";
|
||||
import { ethers } from "ethers";
|
||||
|
||||
global.fetch = require("cross-fetch");
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Token } from "../src";
|
||||
import { createSnapshot } from "../src/common";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import { TokenDrop } from "../src/contracts/token-drop";
|
||||
import { ClaimEligibility } from "../src/enums";
|
||||
import { expectError, sdk, signers, storage } from "./hooks";
|
||||
import { AddressZero } from "@ethersproject/constants";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { BigNumber, ethers } from "ethers";
|
||||
import { MerkleTree } from "merkletreejs";
|
||||
import { expectError, sdk, signers, storage } from "./before-setup";
|
||||
import { createSnapshot } from "../src/common";
|
||||
import { ClaimEligibility } from "../src/enums";
|
||||
import { Token } from "../src";
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../src/constants/currency";
|
||||
import invariant from "tiny-invariant";
|
||||
import { TokenDrop } from "../src/contracts/token-drop";
|
||||
|
||||
global.fetch = require("cross-fetch");
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { assert, expect } from "chai";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { Token } from "../src";
|
||||
import { sdk, signers } from "./before-setup";
|
||||
import { ethers } from "ethers";
|
||||
import { TokenMintInput } from "../src/schema/tokens/token";
|
||||
import { sdk, signers } from "./hooks";
|
||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||
import { assert, expect } from "chai";
|
||||
import { ethers } from "ethers";
|
||||
|
||||
// global.fetch = require("cross-fetch");
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user