Compare commits

...
Author SHA1 Message Date
github-actions[bot]GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
7c3f050883 Version Packages (#609)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-22 13:59:28 -08:00
8b68f20678 refactor: Release to Publish (#567)
Co-authored-by: Jonas Daniels <[email protected]>
2023-02-22 21:36:03 +00:00
Jonas DanielsandGitHub 3d644fb8cb [react] - add mediarenderer prop (#608) 2023-02-21 10:30:21 +00:00
github-actions[bot]GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
690ff925c3 Version Packages (#603)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-20 20:13:14 -08:00
Jonas DanielsandGitHub 4fe6797427 clean up remaining workflows (#605) 2023-02-19 02:12:39 +00:00
Jonas DanielsandGitHub f3408d05d8 [sdk] - fix possible crash in StaticJsonRpcBatchProvider (#604) 2023-02-19 01:47:29 +00:00
Jonas Daniels 845e818c66 CI all in one? 2023-02-18 14:55:51 -08:00
Jonas Daniels 5178256e84 try out new ci action 2023-02-18 14:40:23 -08:00
Jonas DanielsandGitHub 66cf1fb5c2 [various] - upgrade dependencies (#601) 2023-02-18 22:10:45 +00:00
Jonas Daniels df792f0b81 make merge queue work 2023-02-18 14:10:16 -08:00
Jonas Daniels ae0f967356 make platform own everything by default 2023-02-18 13:55:33 -08:00
Jonas Daniels 076718112f devrel should not own changeset markdown files 2023-02-18 13:54:00 -08:00
Jonas Daniels 7c9f86cc44 improve codeowners 2023-02-18 13:51:56 -08:00
Jonas DanielsandGitHub 9c90371426 Jd/add codeowners (#602) 2023-02-18 13:49:09 -08:00
88 changed files with 6019 additions and 6479 deletions
+29
View File
@@ -0,0 +1,29 @@
# Order is important; the last matching pattern takes the most precedence.
# Platform team owns everything by default
* @thirdweb-dev/platform
# Devrel owns all markdown files (README etc.)
*.md @thirdweb-dev/devrel
.changeset/
# Shared ownership of the react and react-core packages
packages/react/ @thirdweb-dev/product @thirdweb-dev/platform
packages/react-core/ @thirdweb-dev/product @thirdweb-dev/platform
# Shared ownership of the CLI
packages/cli/ @thirdweb-dev/product @thirdweb-dev/platform
# Chains is owned specifically by jonas for now
packages/chains/ @jnsdls
# .github folder + .changeset + turbo config is owned by joaquim and jonas for now
.github/ @jnsdls @joaquim-verges
.changeset/config.json @jnsdls @joaquim-verges
turbo.json @joaquim-verges @jnsdls
+1 -1
View File
@@ -13,6 +13,6 @@ runs:
- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile
run: yarn
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
-34
View File
@@ -1,34 +0,0 @@
name: CI
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and Test
timeout-minutes: 30
runs-on: ubuntu-latest-16
# To use Remote Caching, uncomment the next lines and follow the steps below.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install
uses: ./.github/composite-actions/install
# this already builds anything that changed...
- name: Build & Test
run: yarn test
+142
View File
@@ -0,0 +1,142 @@
name: Build, Lint & Test
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]
# trigger on merge group as well (merge queue)
merge_group:
types: [checks_requested]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# To use Remote Caching, uncomment the next lines and follow the steps below.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
build:
name: Build
runs-on: ubuntu-latest-16
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 25
- name: Install
uses: ./.github/composite-actions/install
- run: yarn build
# We use week in the turbo cache key to keep the cache from infinitely growing
- id: get-week
run: echo "WEEK=$(date +%U)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
timeout-minutes: 5
id: cache-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
lint:
name: Lint Packages
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: yarn lint
test:
name: Unit Tests
runs-on: ubuntu-latest-16
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: yarn test
e2e:
name: E2E Tests
runs-on: ubuntu-latest-16
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run e2e tests
run: yarn e2e
env:
NODE_OPTIONS: "--max_old_space_size=4096"
size:
name: Size Comparison
runs-on: ubuntu-latest-8
needs: build
timeout-minutes: 30
# only run on pull requests that are targeting main
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: preactjs/compressed-size-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
strip-hash: "\\-(\\w{8})(?:\\.esm|\\.cjs)"
minimum-change-threshold: 100
# exclude source maps, node modules and any test related files
exclude: "{**/*.map,**/node_modules/**,**/test/**}"
-29
View File
@@ -1,29 +0,0 @@
name: Integration tests
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
integration-tests:
timeout-minutes: 30
runs-on: ubuntu-latest-16
steps:
- uses: actions/checkout@v3
- name: Install
uses: ./.github/composite-actions/install
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run e2e tests
run: yarn e2e
env:
NODE_OPTIONS: "--max_old_space_size=4096"
-33
View File
@@ -1,33 +0,0 @@
name: Lint
on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
timeout-minutes: 15
runs-on: ubuntu-latest
# To use Remote Caching, uncomment the next lines and follow the steps below.
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install
uses: ./.github/composite-actions/install
- name: Lint
run: yarn lint
-20
View File
@@ -1,20 +0,0 @@
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest-8
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: preactjs/compressed-size-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
strip-hash: "\\-(\\w{8})(?:\\.esm|\\.cjs)"
minimum-change-threshold: 100
# exclude source maps, node modules and any test related files
exclude: "{**/*.map,**/node_modules/**,**/test/**}"
+1 -1
View File
@@ -13,7 +13,7 @@
]
},
"scripts": {
"test": "turbo run test test:evm test:solana",
"test": "turbo run test test:evm test:solana --filter=./packages/*",
"e2e": "turbo run e2e",
"build": "turbo run build --filter=./packages/*",
"build:release": "turbo run build --force --filter=./packages/*",
+6
View File
@@ -1,5 +1,11 @@
# @thirdweb-dev/auth
## 3.0.6
### Patch Changes
- [#601](https://github.com/thirdweb-dev/js/pull/601) [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19) Thanks [@jnsdls](https://github.com/jnsdls)! - upgrade dependencies
## 3.0.5
### Patch Changes
+2 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/auth",
"version": "3.0.5",
"version": "3.0.6",
"main": "dist/thirdweb-dev-auth.cjs.js",
"module": "dist/thirdweb-dev-auth.esm.js",
"exports": {
@@ -50,9 +50,6 @@
"evm/index.ts",
"solana/index.ts"
],
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"exports": true
},
"exports": true
},
"devDependencies": {
@@ -138,4 +135,4 @@
"uuid": "^9.0.0",
"zod": "^3.20.2"
}
}
}
+12
View File
@@ -1,5 +1,17 @@
# @thirdweb-dev/chains
## 0.1.3
### Patch Changes
- [#608](https://github.com/thirdweb-dev/js/pull/608) [`3d644fb`](https://github.com/thirdweb-dev/js/commit/3d644fb8cbae8bc3ee624505831b9f5c6996898a) Thanks [@jnsdls](https://github.com/jnsdls)! - update chains
## 0.1.2
### Patch Changes
- [#601](https://github.com/thirdweb-dev/js/pull/601) [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19) Thanks [@jnsdls](https://github.com/jnsdls)! - upgrade dependencies
## 0.1.1
### Patch Changes
+33
View File
@@ -0,0 +1,33 @@
export default {
"name": "Arcology Testnet",
"chain": "Arcology",
"icon": {
"url": "ipfs://QmRD7itMvaZutfBjyA7V9xkMGDtsZiJSagPwd3ijqka8kE",
"width": 288,
"height": 288,
"format": "png"
},
"rpc": [
"https://arcology-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://testnet.arcology.network/rpc"
],
"faucets": [],
"nativeCurrency": {
"name": "Arcology Coin",
"symbol": "Acol",
"decimals": 18
},
"infoURL": "https://arcology.network/",
"shortName": "arcology",
"chainId": 118,
"networkId": 118,
"explorers": [
{
"name": "arcology",
"url": "https://testnet.arcology.network/explorer",
"standard": "none"
}
],
"testnet": true,
"slug": "arcology-testnet"
} as const;
+28
View File
@@ -0,0 +1,28 @@
export default {
"name": "BLG Testnet",
"chain": "BLG",
"icon": {
"url": "ipfs://QmUN5j2cre8GHKv52JE8ag88aAnRmuHMGFxePPvKMogisC",
"width": 512,
"height": 512,
"format": "svg"
},
"rpc": [
"https://blg-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.blgchain.com"
],
"faucets": [
"https://faucet.blgchain.com"
],
"nativeCurrency": {
"name": "Blg",
"symbol": "BLG",
"decimals": 18
},
"infoURL": "https://blgchain.com",
"shortName": "blgchain",
"chainId": 12321,
"networkId": 12321,
"testnet": true,
"slug": "blg-testnet"
} as const;
-1
View File
@@ -10,7 +10,6 @@ export default {
"rpc": [
"https://songbird-canary-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://songbird-api.flare.network/ext/C/rpc",
"https://songbird.towolabs.com/ext/C/rpc",
"https://sgb.ftso.com.au/ext/bc/C/rpc",
"https://sgb.lightft.so/rpc",
"https://sgb-rpc.ftso.eu"
+33
View File
@@ -0,0 +1,33 @@
export default {
"name": "Hika Devnet",
"chain": "Hika Network Testnet",
"icon": {
"url": "ipfs://QmW44FPm3CMM2JDs8BQxLNvUtykkUtrGkQkQsUDJSi3Gmp",
"width": 350,
"height": 84,
"format": "png"
},
"rpc": [
"https://hika-devnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc-testnet.hika.network/"
],
"faucets": [],
"nativeCurrency": {
"name": "Hik Token",
"symbol": "HIK",
"decimals": 18
},
"infoURL": "https://hika.network/",
"shortName": "hik",
"chainId": 5729,
"networkId": 5729,
"explorers": [
{
"name": "Hika Network Testnet Explorer",
"url": "https://scan-testnet.hika.network",
"standard": "none"
}
],
"testnet": true,
"slug": "hika-devnet"
} as const;
+27
View File
@@ -0,0 +1,27 @@
export default {
"name": "Graphlinq Blockchain Mainnet",
"chain": "GLQ Blockchain",
"rpc": [
"https://graphlinq-blockchain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://glq-dataseed.graphlinq.io"
],
"faucets": [],
"nativeCurrency": {
"name": "GLQ",
"symbol": "GLQ",
"decimals": 18
},
"infoURL": "https://graphlinq.io",
"shortName": "glq",
"chainId": 614,
"networkId": 614,
"explorers": [
{
"name": "GLQ Explorer",
"url": "https://explorer.graphlinq.io",
"standard": "none"
}
],
"testnet": false,
"slug": "graphlinq-blockchain"
} as const;
+3 -1
View File
@@ -11,7 +11,9 @@ export default {
"https://bear-network-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://brnkc-test.bearnetwork.net"
],
"faucets": [],
"faucets": [
"https://faucet.bearnetwork.net"
],
"nativeCurrency": {
"name": "Bear Network Chain Testnet Token",
"symbol": "tBRNKC",
+7 -2
View File
@@ -24,8 +24,13 @@ export default {
"standard": "none"
},
{
"name": "Canto Cosmos Explorer (BigDipper)",
"url": "https://cosmos.explorer.canto.io",
"name": "Canto Cosmos Explorer",
"url": "https://cosmos-explorers.neobase.one",
"standard": "none"
},
{
"name": "Canto EVM Explorer (Blockscout)",
"url": "https://tuber.build",
"standard": "none"
}
],
+33
View File
@@ -0,0 +1,33 @@
export default {
"name": "MARO Blockchain Mainnet",
"chain": "MARO Blockchain",
"icon": {
"url": "ipfs://bafkreig47k53aipns6nu3u5fxpysp7mogzk6zyvatgpbam7yut3yvtuefa",
"width": 160,
"height": 160,
"format": "png"
},
"rpc": [
"https://maro-blockchain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc-mainnet.ma.ro"
],
"faucets": [],
"nativeCurrency": {
"name": "MARO",
"symbol": "MARO",
"decimals": 18
},
"infoURL": "https://ma.ro/",
"shortName": "maro",
"chainId": 8848,
"networkId": 8848,
"explorers": [
{
"name": "MARO Scan",
"url": "https://scan.ma.ro/#",
"standard": "none"
}
],
"testnet": false,
"slug": "maro-blockchain"
} as const;
+38
View File
@@ -0,0 +1,38 @@
export default {
"name": "Bitkub Chain",
"chain": "BKC",
"icon": {
"url": "ipfs://QmYFYwyquipwc9gURQGcEd4iAq7pq15chQrJ3zJJe9HuFT",
"width": 1000,
"height": 1000,
"format": "png"
},
"rpc": [
"https://bitkub-chain.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.bitkubchain.io",
"wss://wss.bitkubchain.io"
],
"faucets": [],
"nativeCurrency": {
"name": "Bitkub Coin",
"symbol": "KUB",
"decimals": 18
},
"infoURL": "https://www.bitkubchain.com/",
"shortName": "bkc",
"chainId": 96,
"networkId": 96,
"explorers": [
{
"name": "Bitkub Chain Explorer",
"url": "https://bkcscan.com",
"standard": "none",
"icon": "bkc"
}
],
"redFlags": [
"reusedChainId"
],
"testnet": false,
"slug": "bitkub-chain"
} as const;
+1 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/chains",
"version": "0.1.1",
"version": "0.1.3",
"main": "dist/thirdweb-dev-chains.cjs.js",
"module": "dist/thirdweb-dev-chains.esm.js",
"exports": {
@@ -24,9 +24,6 @@
"entrypoints": [
"index.ts"
],
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"exports": true
},
"exports": true
},
"sideEffects": false,
File diff suppressed because one or more lines are too long
+16
View File
@@ -1,5 +1,21 @@
# thirdweb
## 0.9.23
### Patch Changes
- [#567](https://github.com/thirdweb-dev/js/pull/567) [`8b68f20`](https://github.com/thirdweb-dev/js/commit/8b68f206789f478c9a2198ad8c277329583bdc31) Thanks [@shift4id](https://github.com/shift4id)! - `thirdweb release` is deprecated, use `thirdweb publish` instead
- Updated dependencies []:
- @thirdweb-dev/sdk@3.9.3
## 0.9.22
### Patch Changes
- Updated dependencies [[`f3408d0`](https://github.com/thirdweb-dev/js/commit/f3408d05d84ff8418a3f76961367e47565ed32b4), [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19)]:
- @thirdweb-dev/sdk@3.9.2
## 0.9.21
### Patch Changes
+7 -5
View File
@@ -41,10 +41,10 @@ Deploying contracts this way gives you access to:
## Releasing your contract
```shell
npx thirdweb@latest release
npx thirdweb@latest publish
```
Creates an official release of your contract, along with:
Creates an official published contract, along with:
- author attribution
- contract information
@@ -52,9 +52,9 @@ Creates an official release of your contract, along with:
- versioning
- release notes
Creating releases this way gives you shareable URL to let others to deploy your contracts in one click. It lets you manage released versions and get attribution for deployed contracts. Contract releases are registered on-chain (Polygon) and IPFS, for free (gasless).
Publishing contracts this way gives you shareable URL to let others deploy your contracts in one click. It lets you manage published versions and get attribution for deployed contracts. Published contracts are registered on-chain (Polygon) and IPFS, for free (gasless).
Deploying released contracts give deployers access to automatic SDKs to integrate into their app and dashboards to manage and monitor the deployed contracts.
Deploying published contracts give deployers access to automatic SDKs to integrate into their app and dashboards to manage and monitor the deployed contracts.
## Detecting contract extensions
@@ -94,7 +94,7 @@ Clone the repo and run this command after installing the CLI tool:
```bash
$ cd examples/hardhat
$ npx thirdweb@latest release
$ npx thirdweb@latest publish
```
## Local Development
@@ -106,11 +106,13 @@ The simplest way to work on the CLI locally is to:
```bash
git clone https://github.com/thirdweb-dev/js.git
```
2. From the project root run
```bash
yarn && yarn build
```
3. From inside `js/packages/cli` Run the `build:watch` command to compile any changes in real time
```bash
+4 -4
View File
@@ -6,8 +6,8 @@ import { resolve } from "path";
// 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 () => {
describe("npx thirdweb publish", () => {
it("should return publish page url", async () => {
const { spawn, cleanup, exists, path } = await prepareEnvironment();
await copyFile(
@@ -16,7 +16,7 @@ describe("npx thirdweb release", () => {
);
const { waitForText, waitForFinish, getExitCode, writeText, getStderr } =
await spawn("node", "./dist/cli/index.js release");
await spawn("node", "./dist/cli/index.js publish");
expect(await exists("BasicContract.sol")).toEqual(true);
@@ -27,7 +27,7 @@ describe("npx thirdweb release", () => {
await waitForFinish();
expect(getStderr().at(-1)).toContain(
"https://thirdweb.com/contracts/release/",
"https://thirdweb.com/contracts/publish/",
);
// the process should exit with code 0
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "thirdweb",
"main": "dist/cli/index.js",
"version": "0.9.21",
"version": "0.9.23",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
+33 -5
View File
@@ -266,7 +266,7 @@ const main = async () => {
)
.option(
"-n, --name [name]",
"Name of the pre-built or released contract (such as nft-drop)",
"Name of the pre-built or published contract (such as nft-drop)",
)
.option(
"-f, --file [name]",
@@ -278,7 +278,7 @@ const main = async () => {
)
.option(
"-cv, --contract-version [version]",
"Version of the released contract",
"Version of the published contract",
)
.option("--app", "Deploy a web app to decentralized storage")
.option("--contract", "Deploy a smart contract to blockchains")
@@ -291,8 +291,36 @@ const main = async () => {
program
.command("release")
.description("[Deprecated] use 'publish' instead.")
.option("-p, --path <project-path>", "path to project", ".")
.option(
"-f, --file [name]",
"Filter for contract files that contain the file name",
)
.option(
"-cn, --contract-name [name]",
"Filter for contracts that contain this contract name",
)
.option("--dry-run", "dry run (skip actually publishing)")
.option("-d, --debug", "show debug logs")
.option("--ci", "Continuous Integration mode")
.action(async (options) => {
logger.warn(
"'release' is deprecated and will be removed in a future update. Please use 'publish' instead.",
);
const url = await processProject(options, "publish");
info(
`Open this link to publish your contracts: ${chalk.blueBright(
url.toString(),
)}`,
);
open(url.toString());
});
program
.command("publish")
.description(
"Release your protocol so other devs can deploy them and unlock SDKs, Dashboards and Analytics",
"Publish your protocol so other devs can deploy them and unlock SDKs, Dashboards and Analytics",
)
.option("-p, --path <project-path>", "path to project", ".")
.option(
@@ -307,9 +335,9 @@ const main = async () => {
.option("-d, --debug", "show debug logs")
.option("--ci", "Continuous Integration mode")
.action(async (options) => {
const url = await processProject(options, "release");
const url = await processProject(options, "publish");
info(
`Open this link to release your contracts: ${chalk.blueBright(
`Open this link to publish your contracts: ${chalk.blueBright(
url.toString(),
)}`,
);
+1 -1
View File
@@ -13,7 +13,7 @@ import path from "path";
export async function processProject(
options: any,
command: "deploy" | "release",
command: "deploy" | "publish",
) {
// TODO: allow overriding the default storage
const storage = new ThirdwebStorage();
@@ -211,9 +211,9 @@ export async function createContractProject({
console.log(" Deploys your contracts with the thirdweb deploy flow.");
console.log();
console.log(
chalk.cyan(` ${packageManager}${useYarn ? "" : " run"} release`),
chalk.cyan(` ${packageManager}${useYarn ? "" : " run"} publish`),
);
console.log(" Releases your contracts with the thirdweb release flow.");
console.log(" Publishes your contracts with the thirdweb publish flow.");
console.log();
console.log("We suggest that you begin by typing:");
console.log();
@@ -3,7 +3,7 @@ export default function generateDashboardUrl(
version: string | undefined,
): string | undefined {
const splitName = name.split("/");
// Released contract
// Published contract
if (splitName.length > 1) {
return `https://thirdweb.com/dashboard/${splitName[0]}/${splitName[1]}${
version ? `/${version}` : ""
+6
View File
@@ -1,5 +1,11 @@
# @thirdweb-dev/pay
## 0.1.1
### Patch Changes
- [#601](https://github.com/thirdweb-dev/js/pull/601) [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19) Thanks [@jnsdls](https://github.com/jnsdls)! - upgrade dependencies
## 0.1.0
### Minor Changes
+1 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/pay",
"version": "0.1.0",
"version": "0.1.1",
"main": "dist/thirdweb-dev-pay.cjs.js",
"module": "dist/thirdweb-dev-pay.esm.js",
"exports": {
@@ -29,9 +29,6 @@
"index.ts",
"integrations/**"
],
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"exports": true
},
"exports": true
},
"sideEffects": false,
+17
View File
@@ -1,5 +1,22 @@
# @thirdweb-dev/react-core
## 3.9.3
### Patch Changes
- Updated dependencies [[`3d644fb`](https://github.com/thirdweb-dev/js/commit/3d644fb8cbae8bc3ee624505831b9f5c6996898a)]:
- @thirdweb-dev/chains@0.1.3
## 3.9.2
### Patch Changes
- [#601](https://github.com/thirdweb-dev/js/pull/601) [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19) Thanks [@jnsdls](https://github.com/jnsdls)! - upgrade dependencies
- Updated dependencies [[`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19)]:
- @thirdweb-dev/chains@0.1.2
- @thirdweb-dev/auth@3.0.6
## 3.9.1
### Patch Changes
+2 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react-core",
"version": "3.9.1",
"version": "3.9.3",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -33,9 +33,6 @@
"solana/index.ts",
"evm/index.ts"
],
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"exports": true
},
"exports": true
},
"private": false,
@@ -103,4 +100,4 @@
"optional": true
}
}
}
}
+13 -13
View File
@@ -41,9 +41,9 @@ type AddEthereumChainParameter = {
export type Chain = {
id: number;
name: AddEthereumChainParameter['chainName'];
nativeCurrency?: AddEthereumChainParameter['nativeCurrency'];
rpcUrls: AddEthereumChainParameter['rpcUrls'];
name: AddEthereumChainParameter["chainName"];
nativeCurrency?: AddEthereumChainParameter["nativeCurrency"];
rpcUrls: AddEthereumChainParameter["rpcUrls"];
blockExplorers?: {
name: string;
url: string;
@@ -256,16 +256,16 @@ export type ExecuteAuctionSale = {
export type BuyNowParams<TListingType = ListingType> =
TListingType extends ListingType.Direct
? {
id: BigNumberish;
type: ListingType.Direct;
buyAmount: BigNumberish;
buyForWallet?: WalletAddress;
}
: {
id: BigNumberish;
type: ListingType.Auction;
};
? {
id: BigNumberish;
type: ListingType.Direct;
buyAmount: BigNumberish;
buyForWallet?: WalletAddress;
}
: {
id: BigNumberish;
type: ListingType.Auction;
};
// TOKEN DROP //
+21
View File
@@ -1,5 +1,26 @@
# @thirdweb-dev/react-native
## 0.1.3
### Patch Changes
- Updated dependencies [[`3d644fb`](https://github.com/thirdweb-dev/js/commit/3d644fb8cbae8bc3ee624505831b9f5c6996898a)]:
- @thirdweb-dev/chains@0.1.3
- @thirdweb-dev/react-core@3.9.3
- @thirdweb-dev/sdk@3.9.3
## 0.1.2
### Patch Changes
- [#601](https://github.com/thirdweb-dev/js/pull/601) [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19) Thanks [@jnsdls](https://github.com/jnsdls)! - upgrade dependencies
- Updated dependencies [[`f3408d0`](https://github.com/thirdweb-dev/js/commit/f3408d05d84ff8418a3f76961367e47565ed32b4), [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19)]:
- @thirdweb-dev/sdk@3.9.2
- @thirdweb-dev/react-core@3.9.2
- @thirdweb-dev/storage@1.0.10
- @thirdweb-dev/chains@0.1.2
## 0.1.1
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react-native",
"version": "0.1.1",
"version": "0.1.3",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -1,13 +1,10 @@
import invariant from "tiny-invariant";
import {
useAccount as useWagmiAccount,
useClient
} from "wagmi";
import { useAccount as useWagmiAccount, useClient } from "wagmi";
/**
* @internal
*/
export function useAccount() {
export function useAccount(): ReturnType<typeof useWagmiAccount> {
const wagmiContext = useClient();
invariant(
wagmiContext,
@@ -1,8 +1,5 @@
import invariant from "tiny-invariant";
import {
useNetwork as useWagmiNetwork,
useClient
} from "wagmi";
import { useNetwork as useWagmiNetwork, useClient } from "wagmi";
/**
* Hook for getting metadata about the network the current wallet is connected to and switching networks
@@ -28,7 +25,7 @@ import {
* @public
*/
export function useNetwork() {
export function useNetwork(): ReturnType<typeof useWagmiNetwork> {
const wagmiContext = useClient();
invariant(
wagmiContext,
+22
View File
@@ -1,5 +1,27 @@
# @thirdweb-dev/react
## 3.9.3
### Patch Changes
- [#608](https://github.com/thirdweb-dev/js/pull/608) [`3d644fb`](https://github.com/thirdweb-dev/js/commit/3d644fb8cbae8bc3ee624505831b9f5c6996898a) Thanks [@jnsdls](https://github.com/jnsdls)! - `<MediaRenderer />` now accepts an optional mime type prop
- Updated dependencies [[`3d644fb`](https://github.com/thirdweb-dev/js/commit/3d644fb8cbae8bc3ee624505831b9f5c6996898a)]:
- @thirdweb-dev/chains@0.1.3
- @thirdweb-dev/react-core@3.9.3
- @thirdweb-dev/wallets@0.2.4
## 3.9.2
### Patch Changes
- [#601](https://github.com/thirdweb-dev/js/pull/601) [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19) Thanks [@jnsdls](https://github.com/jnsdls)! - upgrade dependencies
- Updated dependencies [[`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19)]:
- @thirdweb-dev/react-core@3.9.2
- @thirdweb-dev/wallets@0.2.3
- @thirdweb-dev/chains@0.1.2
## 3.9.1
### Patch Changes
+89 -83
View File
@@ -309,107 +309,113 @@ const KitchenSinkExample = () => {
## Available hooks
### Main hooks
| Hook | Description |
| --- | --- |
| [`useSDK`](https://portal.thirdweb.com/react/react.usesdk) | Access the instance of the thirdweb SDK created by the ThirdwebProvider. |
| [`useContract`](https://portal.thirdweb.com/react/react.usecontract) | Use this resolve a contract address to a smart contract instance. |
| [`useContractWrite`](https://portal.thirdweb.com/react/react.usecontractwrite) | Use this to get data from a contract read-function call. |
| [`useContractRead`](https://portal.thirdweb.com/react/react.usecontractread) | Use this to get a function to make a write call to your contract. |
| [`useContractEvents`](https://portal.thirdweb.com/react/react.usecontractevents) | Use this to get the contract metadata for a (built-in or custom) contract. |
| Hook | Description |
| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| [`useSDK`](https://portal.thirdweb.com/react/react.usesdk) | Access the instance of the thirdweb SDK created by the ThirdwebProvider. |
| [`useContract`](https://portal.thirdweb.com/react/react.usecontract) | Use this resolve a contract address to a smart contract instance. |
| [`useContractWrite`](https://portal.thirdweb.com/react/react.usecontractwrite) | Use this to get data from a contract read-function call. |
| [`useContractRead`](https://portal.thirdweb.com/react/react.usecontractread) | Use this to get a function to make a write call to your contract. |
| [`useContractEvents`](https://portal.thirdweb.com/react/react.usecontractevents) | Use this to get the contract metadata for a (built-in or custom) contract. |
| [`useContractMetadata`](https://portal.thirdweb.com/react/react.usecontractmetadata) | Use this to get the contract metadata for a (built-in or custom) contract. |
### Wallet connection
| Hook | Description |
| --- | --- |
| [`useAddress`](https://portal.thirdweb.com/react/react.useaddress) | Hook for accessing the address of the connected wallet. |
| [`useMetamask`](https://portal.thirdweb.com/react/react.usemetamask) | Hook for connecting to a Metamask wallet. |
| [`useWalletConnect`](https://portal.thirdweb.com/react/react.usewalletconnect) | Hook for connecting to a mobile wallet with Wallet Connect. |
| [`useCoinbaseWallet`](https://portal.thirdweb.com/react/react.usecoinbasewallet) | Hook for connecting to a Coinbase wallet. |
| [`useMagic`](https://portal.thirdweb.com/react/react.usemagic) | Hook for connecting to an email wallet using magic link. |
| [`useGnosis`](https://portal.thirdweb.com/react/react.usegnosis) | Hook for connecting to a Gnosis Safe. |
| [`useDisconnect`](https://portal.thirdweb.com/react/react.usedisconnect) | Hook for disconnecting the currently connected wallet. |
| Hook | Description |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [`useAddress`](https://portal.thirdweb.com/react/react.useaddress) | Hook for accessing the address of the connected wallet. |
| [`useMetamask`](https://portal.thirdweb.com/react/react.usemetamask) | Hook for connecting to a Metamask wallet. |
| [`useWalletConnect`](https://portal.thirdweb.com/react/react.usewalletconnect) | Hook for connecting to a mobile wallet with Wallet Connect. |
| [`useCoinbaseWallet`](https://portal.thirdweb.com/react/react.usecoinbasewallet) | Hook for connecting to a Coinbase wallet. |
| [`useMagic`](https://portal.thirdweb.com/react/react.usemagic) | Hook for connecting to an email wallet using magic link. |
| [`useGnosis`](https://portal.thirdweb.com/react/react.usegnosis) | Hook for connecting to a Gnosis Safe. |
| [`useDisconnect`](https://portal.thirdweb.com/react/react.usedisconnect) | Hook for disconnecting the currently connected wallet. |
### Network connection
| Hook | Description |
| --- | --- |
| [`useChainId`](https://portal.thirdweb.com/react/react.usechainid) | Hook for accessing the chain ID of the network the current wallet is connected to |
| [`useNetwork`](https://portal.thirdweb.com/react/react.usenetwork) | Hook for getting metadata about the network the current wallet is connected to and switching networks. |
| Hook | Description |
| ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| [`useChainId`](https://portal.thirdweb.com/react/react.usechainid) | Hook for accessing the chain ID of the network the current wallet is connected to |
| [`useNetwork`](https://portal.thirdweb.com/react/react.usenetwork) | Hook for getting metadata about the network the current wallet is connected to and switching networks. |
| [`useNetworkMismatch`](https://portal.thirdweb.com/react/react.usenetworkmismatch) | Hook for checking whether the connected wallet is on the correct network specified by the desiredChainId passed to the <ThirdwebProvider />. |
### NFT
| Hook | Description |
| --- | --- |
| [`useNFT`](https://portal.thirdweb.com/react/react.usenft) | Use this to get an individual NFT token of your NFTContract. |
| [`useNFTs`](https://portal.thirdweb.com/react/react.usenfts) | Use this to get a list of NFT tokens of your NFTContract. |
| [`useTotalCirculatingSupply`](https://portal.thirdweb.com/react/react.usetotalcirculatingsupply) | Use this to get a the total (minted) supply of your NFTContract. |
| [`useOwnedNFTs`](https://portal.thirdweb.com/react/react.useownednfts) | Use this to get a the owned NFTs for a specific Erc721OrErc1155 and wallet address. |
| [`useNFTBalance`](https://portal.thirdweb.com/react/react.usenftbalance) | Use this to get a the total balance of a NFTContract and wallet address. |
| [`useTotalCount`](https://portal.thirdweb.com/react/react.usetotalcount) | Use this to get the total count of NFT tokens of your NFTContract. |
| [`useMintNFT`](https://portal.thirdweb.com/react/react.usemintnft) | Use this to mint a new NFT on your Erc721OrErc1155. |
| [`useMintNFTSupply`](https://portal.thirdweb.com/react/react.usemintnftsupply) | Use this mint extra supply on your Erc1155. |
| [`useTransferNFT`](https://portal.thirdweb.com/react/react.usetransfernft) | Use this to transfer tokens on your NFTContract. |
| [`useAirdropNFT`](https://portal.thirdweb.com/react/react.useairdropnft) | Use this to airdrop tokens on your Erc1155. |
| [`useBurnNFT`](https://portal.thirdweb.com/react/react.useburnnft) | Use this to burn an NFT on your Erc721OrErc1155. |
| Hook | Description |
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
| [`useNFT`](https://portal.thirdweb.com/react/react.usenft) | Use this to get an individual NFT token of your NFTContract. |
| [`useNFTs`](https://portal.thirdweb.com/react/react.usenfts) | Use this to get a list of NFT tokens of your NFTContract. |
| [`useTotalCirculatingSupply`](https://portal.thirdweb.com/react/react.usetotalcirculatingsupply) | Use this to get a the total (minted) supply of your NFTContract. |
| [`useOwnedNFTs`](https://portal.thirdweb.com/react/react.useownednfts) | Use this to get a the owned NFTs for a specific Erc721OrErc1155 and wallet address. |
| [`useNFTBalance`](https://portal.thirdweb.com/react/react.usenftbalance) | Use this to get a the total balance of a NFTContract and wallet address. |
| [`useTotalCount`](https://portal.thirdweb.com/react/react.usetotalcount) | Use this to get the total count of NFT tokens of your NFTContract. |
| [`useMintNFT`](https://portal.thirdweb.com/react/react.usemintnft) | Use this to mint a new NFT on your Erc721OrErc1155. |
| [`useMintNFTSupply`](https://portal.thirdweb.com/react/react.usemintnftsupply) | Use this mint extra supply on your Erc1155. |
| [`useTransferNFT`](https://portal.thirdweb.com/react/react.usetransfernft) | Use this to transfer tokens on your NFTContract. |
| [`useAirdropNFT`](https://portal.thirdweb.com/react/react.useairdropnft) | Use this to airdrop tokens on your Erc1155. |
| [`useBurnNFT`](https://portal.thirdweb.com/react/react.useburnnft) | Use this to burn an NFT on your Erc721OrErc1155. |
### Token
| Hook | Description |
| --- | --- |
| [`useTokenSupply`](https://portal.thirdweb.com/react/react.usetokensupply) | Use this to get a the total supply of your contract. |
| [`useTokenBalance`](https://portal.thirdweb.com/react/react.usetokenbalance) | Use this to get the balance of your contract for a given address. |
| [`useTokenDecimals`](https://portal.thirdweb.com/react/react.usetokendecimals) | Use this to get the decimals of your contract for a given address. |
| [`useMintToken`](https://portal.thirdweb.com/react/react.useminttoken) | Use this to mint new tokens on your contract. |
| [`useClaimToken`](https://portal.thirdweb.com/react/react.useclaimtoken) | Use this to claim tokens from your contract. |
| [`useTransferToken`](https://portal.thirdweb.com/react/react.usetransfertoken) | Use this to transfer tokens on your contract. |
| [`useTransferBatchToken`](https://portal.thirdweb.com/react/react.usetransferbatchtoken) | Use this to transfer batch tokens on your contract. |
| [`useBurnToken`](https://portal.thirdweb.com/react/react.useburntoken) | Use this to burn tokens on your contract. |
| Hook | Description |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [`useTokenSupply`](https://portal.thirdweb.com/react/react.usetokensupply) | Use this to get a the total supply of your contract. |
| [`useTokenBalance`](https://portal.thirdweb.com/react/react.usetokenbalance) | Use this to get the balance of your contract for a given address. |
| [`useTokenDecimals`](https://portal.thirdweb.com/react/react.usetokendecimals) | Use this to get the decimals of your contract for a given address. |
| [`useMintToken`](https://portal.thirdweb.com/react/react.useminttoken) | Use this to mint new tokens on your contract. |
| [`useClaimToken`](https://portal.thirdweb.com/react/react.useclaimtoken) | Use this to claim tokens from your contract. |
| [`useTransferToken`](https://portal.thirdweb.com/react/react.usetransfertoken) | Use this to transfer tokens on your contract. |
| [`useTransferBatchToken`](https://portal.thirdweb.com/react/react.usetransferbatchtoken) | Use this to transfer batch tokens on your contract. |
| [`useBurnToken`](https://portal.thirdweb.com/react/react.useburntoken) | Use this to burn tokens on your contract. |
### Marketplace
| Hook | Description |
| --- | --- |
| [`useListing`](https://portal.thirdweb.com/react/react.uselisting) | Use this to get a specific listing from the marketplace. |
| [`useListings`](https://portal.thirdweb.com/react/react.uselistings) | Use this to get a list all listings from your marketplace contract. |
| [`useListingsCount`](https://portal.thirdweb.com/react/react.uselistingscount) | Use this to get a count of all listings on your marketplace contract. |
| [`useActiveListings`](https://portal.thirdweb.com/react/react.useactivelistings) | Use this to get a list active listings from your marketplace contract. |
| [`useWinningBid`](https://portal.thirdweb.com/react/react.usewinningbid) | Use this to get a the winning bid for an auction listing from your marketplace contract. |
| [`useAuctionWinner`](https://portal.thirdweb.com/react/react.useauctionwinner) | Use this to get the winner of an auction listing from your marketplace contract. |
| [`useBidBuffer`](https://portal.thirdweb.com/react/react.usebidbuffer) | Use this to get the buffer in basis points between offers from your marketplace contract. |
| [`useCreateDirectListing`](https://portal.thirdweb.com/react/react.usecreatedirectlisting) | Use this to create a new Direct Listing on your marketplace contract. |
| [`useCreateAuctionListing`](https://portal.thirdweb.com/react/react.usecreateauctionlisting) | Use this to create a new Auction Listing on your marketplace contract. |
| [`useCancelListing`](https://portal.thirdweb.com/react/react.usecancellisting) | Use this to cancel a listing on your marketplace contract. |
| [`useMakeBid`](https://portal.thirdweb.com/react/react.usemakebid) | Use this to place a bid on an auction listing from your marketplace contract. |
| [`useBuyNow`](https://portal.thirdweb.com/react/react.usebuynow) | Use this to buy out an auction listing from your marketplace contract. |
| Hook | Description |
| -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| [`useListing`](https://portal.thirdweb.com/react/react.uselisting) | Use this to get a specific listing from the marketplace. |
| [`useListings`](https://portal.thirdweb.com/react/react.uselistings) | Use this to get a list all listings from your marketplace contract. |
| [`useListingsCount`](https://portal.thirdweb.com/react/react.uselistingscount) | Use this to get a count of all listings on your marketplace contract. |
| [`useActiveListings`](https://portal.thirdweb.com/react/react.useactivelistings) | Use this to get a list active listings from your marketplace contract. |
| [`useWinningBid`](https://portal.thirdweb.com/react/react.usewinningbid) | Use this to get a the winning bid for an auction listing from your marketplace contract. |
| [`useAuctionWinner`](https://portal.thirdweb.com/react/react.useauctionwinner) | Use this to get the winner of an auction listing from your marketplace contract. |
| [`useBidBuffer`](https://portal.thirdweb.com/react/react.usebidbuffer) | Use this to get the buffer in basis points between offers from your marketplace contract. |
| [`useCreateDirectListing`](https://portal.thirdweb.com/react/react.usecreatedirectlisting) | Use this to create a new Direct Listing on your marketplace contract. |
| [`useCreateAuctionListing`](https://portal.thirdweb.com/react/react.usecreateauctionlisting) | Use this to create a new Auction Listing on your marketplace contract. |
| [`useCancelListing`](https://portal.thirdweb.com/react/react.usecancellisting) | Use this to cancel a listing on your marketplace contract. |
| [`useMakeBid`](https://portal.thirdweb.com/react/react.usemakebid) | Use this to place a bid on an auction listing from your marketplace contract. |
| [`useBuyNow`](https://portal.thirdweb.com/react/react.usebuynow) | Use this to buy out an auction listing from your marketplace contract. |
### Permissions Controls
| Hook | Description |
| --- | --- |
| [`useAllRoleMembers`](https://portal.thirdweb.com/react/react.useallrolemembers) | Use this to get the roles of all members. |
| [`useRoleMembers`](https://portal.thirdweb.com/react/react.userolemembers) | Use this to get the members of a role. |
| [`useIsAddressRole`](https://portal.thirdweb.com/react/react.useisaddressrole) | Use this to check if a WalletAddress is a member of a role. |
| Hook | Description |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| [`useAllRoleMembers`](https://portal.thirdweb.com/react/react.useallrolemembers) | Use this to get the roles of all members. |
| [`useRoleMembers`](https://portal.thirdweb.com/react/react.userolemembers) | Use this to get the members of a role. |
| [`useIsAddressRole`](https://portal.thirdweb.com/react/react.useisaddressrole) | Use this to check if a WalletAddress is a member of a role. |
| [`useSetAllRoleMembers`](https://portal.thirdweb.com/react/react.usesetallrolemembers) | Use this to OVERWRITE the list of addresses that are members of specific roles. |
| [`useGrantRole`](https://portal.thirdweb.com/react/react.usegrantrole) | Use this to grant a WalletAddress a specific role. |
| [`useRevokeRole`](https://portal.thirdweb.com/react/react.userevokerole) | Use this to revoke a WalletAddress a specific role. |
| [`useGrantRole`](https://portal.thirdweb.com/react/react.usegrantrole) | Use this to grant a WalletAddress a specific role. |
| [`useRevokeRole`](https://portal.thirdweb.com/react/react.userevokerole) | Use this to revoke a WalletAddress a specific role. |
### Drop
| Hook | Description |
| --- | --- |
| [`useUnclaimedNFTs`](https://portal.thirdweb.com/react/react.useunclaimednfts) | Use this to get a list of unclaimed NFT tokens of your ERC721 Drop contract. |
| [`useClaimedNFTs`](https://portal.thirdweb.com/react/react.useclaimednfts) | Use this to get a list of claimed (minted) NFT tokens of your ERC721 Drop contract.. |
| [`useUnclaimedNFTSupply`](https://portal.thirdweb.com/react/react.useunclaimednftsupply) | Use this to get the total unclaimed NFT supply of your ERC721 Drop contract. |
| [`useClaimedNFTSupply`](https://portal.thirdweb.com/react/react.useclaimednftsupply) | Use this to get the total claimed (minted) NFT supply of your ERC721 Drop contract. |
| [`useBatchesToReveal`](https://portal.thirdweb.com/react/react.usebatchestoreveal) | Use this to get a list of batches that are ready to be revealed. |
| [`useClaimNFT`](https://portal.thirdweb.com/react/react.useclaimnft) | Use this to claim a NFT on your DropContract |
| [`useLazyMint`](https://portal.thirdweb.com/react/react.uselazymint) | Use this to lazy mint a batch of NFTs on your DropContract. |
| [`useDelayedRevealLazyMint`](https://portal.thirdweb.com/react/react.usedelayedreveallazymint) | Use this to lazy mint a batch of delayed reveal NFTs on your DropContract. |
| [`useRevealLazyMint`](https://portal.thirdweb.com/react/react.usereveallazymint) | Use this to reveal a batch of delayed reveal NFTs on your RevealableContract. |
| Hook | Description |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [`useUnclaimedNFTs`](https://portal.thirdweb.com/react/react.useunclaimednfts) | Use this to get a list of unclaimed NFT tokens of your ERC721 Drop contract. |
| [`useClaimedNFTs`](https://portal.thirdweb.com/react/react.useclaimednfts) | Use this to get a list of claimed (minted) NFT tokens of your ERC721 Drop contract.. |
| [`useUnclaimedNFTSupply`](https://portal.thirdweb.com/react/react.useunclaimednftsupply) | Use this to get the total unclaimed NFT supply of your ERC721 Drop contract. |
| [`useClaimedNFTSupply`](https://portal.thirdweb.com/react/react.useclaimednftsupply) | Use this to get the total claimed (minted) NFT supply of your ERC721 Drop contract. |
| [`useBatchesToReveal`](https://portal.thirdweb.com/react/react.usebatchestoreveal) | Use this to get a list of batches that are ready to be revealed. |
| [`useClaimNFT`](https://portal.thirdweb.com/react/react.useclaimnft) | Use this to claim a NFT on your DropContract |
| [`useLazyMint`](https://portal.thirdweb.com/react/react.uselazymint) | Use this to lazy mint a batch of NFTs on your DropContract. |
| [`useDelayedRevealLazyMint`](https://portal.thirdweb.com/react/react.usedelayedreveallazymint) | Use this to lazy mint a batch of delayed reveal NFTs on your DropContract. |
| [`useRevealLazyMint`](https://portal.thirdweb.com/react/react.usereveallazymint) | Use this to reveal a batch of delayed reveal NFTs on your RevealableContract. |
### Claim Conditions
| Hook | Description |
| --- | --- |
| [`useActiveClaimCondition`](https://portal.thirdweb.com/react/react.useactiveclaimcondition) | Use this to get the active claim condition for ERC20, ERC721 or ERC1155 based contracts. |
| [`useClaimConditions`](https://portal.thirdweb.com/react/react.useclaimconditions) | Use this to get all claim conditions for ERC20, ERC721 or ERC1155 based contracts. |
| Hook | Description |
| ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| [`useActiveClaimCondition`](https://portal.thirdweb.com/react/react.useactiveclaimcondition) | Use this to get the active claim condition for ERC20, ERC721 or ERC1155 based contracts. |
| [`useClaimConditions`](https://portal.thirdweb.com/react/react.useclaimconditions) | Use this to get all claim conditions for ERC20, ERC721 or ERC1155 based contracts. |
| [`useClaimIneligibilityReasons`](https://portal.thirdweb.com/react/react.useclaimineligibilityreasons) | Use this to check for reasons that prevent claiming for either ERC20, ERC721 or ERC1155 based contracts. |
| [`useSetClaimConditions`](https://portal.thirdweb.com/react/react.usesetclaimconditions) | Use this to set claim conditions on your DropContract. |
| [`useResetClaimConditions`](https://portal.thirdweb.com/react/react.useresetclaimconditions) | Use this to reset claim conditions on your DropContract. |
| [`useSetClaimConditions`](https://portal.thirdweb.com/react/react.usesetclaimconditions) | Use this to set claim conditions on your DropContract. |
| [`useResetClaimConditions`](https://portal.thirdweb.com/react/react.useresetclaimconditions) | Use this to reset claim conditions on your DropContract. |
+1 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react",
"version": "3.9.1",
"version": "3.9.3",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -42,9 +42,6 @@
"evm/index.ts",
"evm/connectors/**.ts"
],
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"exports": true
},
"exports": true
},
"private": false,
@@ -36,6 +36,8 @@ export interface SharedMediaProps {
controls?: HTMLVideoElement["controls"];
children?: ReactNode;
mimeType?: string;
}
/**
@@ -65,7 +67,7 @@ interface PlayButtonProps {
isPlaying: boolean;
}
const PlayButton: React.VFC<PlayButtonProps> = ({ onClick, isPlaying }) => {
const PlayButton: React.FC<PlayButtonProps> = ({ onClick, isPlaying }) => {
const [isHovering, setIsHovering] = useState(false);
const onMouseEnter = () => setIsHovering(true);
const onMouseLeave = () => setIsHovering(false);
@@ -295,10 +297,7 @@ const IframePlayer = React.forwardRef<HTMLIFrameElement, MediaRendererProps>(
const [playing, setPlaying] = useState(!requireInteraction);
return (
<div
style={{ position: "relative", ...style }}
{...restProps}
>
<div style={{ position: "relative", ...style }} {...restProps}>
<iframe
src={playing ? src ?? undefined : undefined}
ref={ref}
@@ -432,6 +431,7 @@ export const MediaRenderer = React.forwardRef<
width = "300px",
height = "300px",
style,
mimeType,
...restProps
},
ref,
@@ -442,7 +442,7 @@ export const MediaRenderer = React.forwardRef<
height,
...style,
};
const videoOrImageSrc = useResolvedMediaType(src ?? undefined);
const videoOrImageSrc = useResolvedMediaType(src ?? undefined, mimeType);
const possiblePosterSrc = useResolvedMediaType(poster ?? undefined);
if (!videoOrImageSrc.mimeType) {
@@ -563,13 +563,14 @@ export interface MediaType {
* }
* ```
*/
export function useResolvedMediaType(uri?: string) {
export function useResolvedMediaType(uri?: string, mimeType?: string) {
const resolvedUrl = useMemo(() => resolveIpfsUri(uri), [uri]);
const resolvedMimType = useQuery(
["mime-type", resolvedUrl],
() => resolveMimeType(resolvedUrl),
{
enabled: !!resolvedUrl,
enabled: !!resolvedUrl && !mimeType,
initialData: mimeType,
},
);
@@ -21,7 +21,7 @@ export const ModelViewer = React.forwardRef<HTMLDivElement, MediaRendererProps>(
alt={alt || "3D Model"}
camera-controls
poster={poster ? poster : null}
style={{ width: '100%', height: '100%'} as CSSStyleDeclaration}
style={{ width: "100%", height: "100%" } as CSSStyleDeclaration}
/>
) : null}
</div>
@@ -18,7 +18,7 @@ export interface ThirdwebNftMediaProps extends SharedMediaProps {
* This component can be used to render NFTs from the thirdweb SDK.
* It will render the animation_url if it exists, otherwise it will render the image.
* The default size is 300px by 300px, but this can be changed using the `width` and `height` props.
*
*
* Props: {@link ThirdwebNftMediaProps}
*
* @example
@@ -43,7 +43,7 @@ export interface ThirdwebNftMediaProps extends SharedMediaProps {
export const ThirdwebNftMedia = React.forwardRef<
HTMLMediaElement,
ThirdwebNftMediaProps
>(({ metadata, width = "300px", height = "300px", style, ...props }, ref) => {
>(({ metadata, width = "300px", height = "300px", style, ...props }, ref) => {
return (
<MediaRenderer
src={metadata.animation_url || metadata.image}
@@ -52,7 +52,7 @@ export const ThirdwebNftMedia = React.forwardRef<
ref={ref}
width={width}
height={height}
style={{ ...style }}
style={{ ...style }}
{...props}
/>
);
@@ -9,13 +9,16 @@ import {
*
* @example
* ```javascript
* import { useNetwork, ChainId } from "@thirdweb-dev/react";
* import { useNetwork } from "@thirdweb-dev/react";
*
* const App = () => {
* const [, switchNetwork] = useNetwork();
*
*
* return (
* <button onClick={() => switchNetwork(ChainId.Polygon)}>
* // switchNetwork is undefined if the wallet does not support programmatic network switching
* // 137 is the chainId for Polygon in this example
* <button onClick={() => switchNetwork(137)}>
* Switch Network
* </button>
* );
+19
View File
@@ -1,5 +1,24 @@
# @thirdweb-dev/sdk
## 3.9.3
### Patch Changes
- Updated dependencies [[`3d644fb`](https://github.com/thirdweb-dev/js/commit/3d644fb8cbae8bc3ee624505831b9f5c6996898a)]:
- @thirdweb-dev/chains@0.1.3
## 3.9.2
### Patch Changes
- [#604](https://github.com/thirdweb-dev/js/pull/604) [`f3408d0`](https://github.com/thirdweb-dev/js/commit/f3408d05d84ff8418a3f76961367e47565ed32b4) Thanks [@jnsdls](https://github.com/jnsdls)! - fix possible crash in StaticJsonRpcBatchProvider
- [#601](https://github.com/thirdweb-dev/js/pull/601) [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19) Thanks [@jnsdls](https://github.com/jnsdls)! - upgrade dependencies
- Updated dependencies [[`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19)]:
- @thirdweb-dev/storage@1.0.10
- @thirdweb-dev/chains@0.1.2
## 3.9.1
### Patch Changes
+1 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/sdk",
"version": "3.9.1",
"version": "3.9.3",
"description": "The main thirdweb SDK.",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
"license": "Apache-2.0",
@@ -38,9 +38,6 @@
"solana/index.ts",
"solana/server/index.ts"
],
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"exports": true
},
"exports": true
},
"sideEffects": false,
+1 -1
View File
@@ -1,5 +1,5 @@
import { NATIVE_TOKENS, SUPPORTED_CHAIN_ID } from "../constants";
import { Feature } from "../constants/contract-features";
import { NATIVE_TOKENS, SUPPORTED_CHAIN_ID } from "../constants/index";
import { ContractSource } from "../schema";
import { BigNumber, BigNumberish, ethers, providers } from "ethers";
@@ -446,7 +446,7 @@ export async function fetchPreDeployMetadata(
}
/**
* Fetch and parse the full metadata AFTER creating a release, with all the extra information (version, readme, etc)
* Fetch and parse the full metadata AFTER publishing a contract, with all the extra information (version, readme, etc)
* @internal
* @param publishMetadataUri
* @param storage
+1 -4
View File
@@ -74,10 +74,7 @@ async function getDomainSeperator(signer: Signer, contractAddress: string) {
try {
return await contract.getDomainSeperator();
} catch (err2) {
console.error(
'Error getting domain separator',
err2
)
console.error("Error getting domain separator", err2);
}
}
}
@@ -258,7 +258,6 @@ export class ShardedMerkleTree {
sort: true,
});
} catch (e) {
console.warn("No merkle entry found for address", address);
return null;
}
}
+1 -1
View File
@@ -171,7 +171,7 @@ type DropContract = Extract<
"nft-drop" | "token-drop" | "edition-drop" | "signature-drop"
>;
// @deprecated - should not be needed anymore, rely on the release data instead
// @deprecated - should not be needed anymore, rely on the publish data instead
export const APPROVED_IMPLEMENTATIONS: Record<
SUPPORTED_CHAIN_ID,
Record<DropContract, string>
+13 -13
View File
@@ -71,7 +71,7 @@ export const EditionDropInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
const contractInfo = await getContractInfo(address, provider);
return !contractInfo || contractInfo.version > 2
? (await import("@thirdweb-dev/contracts-js/dist/abis/DropERC1155.json"))
@@ -117,7 +117,7 @@ export const EditionInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
return (
await import("@thirdweb-dev/contracts-js/dist/abis/TokenERC1155.json")
).default;
@@ -158,7 +158,7 @@ export const MarketplaceInitializer = {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
return (
await import("@thirdweb-dev/contracts-js/dist/abis/Marketplace.json")
).default;
@@ -199,7 +199,7 @@ export const MarketplaceV3Initializer = {
return await getCompositePluginABI(address, abi, provider, {}, storage);
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
const localAbi = (
await import("@thirdweb-dev/contracts-js/dist/abis/MarketplaceV3.json")
).default;
@@ -246,7 +246,7 @@ export const MultiwrapInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
return (await import("@thirdweb-dev/contracts-js/dist/abis/Multiwrap.json"))
.default;
},
@@ -286,7 +286,7 @@ export const NFTCollectionInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
return (
await import("@thirdweb-dev/contracts-js/dist/abis/TokenERC721.json")
).default;
@@ -326,7 +326,7 @@ export const NFTDropInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
const contractInfo = await getContractInfo(address, provider);
return !contractInfo || contractInfo.version > 3
? (await import("@thirdweb-dev/contracts-js/dist/abis/DropERC721.json"))
@@ -373,7 +373,7 @@ export const PackInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
return (await import("@thirdweb-dev/contracts-js/dist/abis/Pack.json"))
.default;
},
@@ -413,7 +413,7 @@ export const SignatureDropInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
const contractInfo = await getContractInfo(address, provider);
return !contractInfo || contractInfo.version > 4
? (
@@ -463,7 +463,7 @@ export const SplitInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
return (await import("@thirdweb-dev/contracts-js/dist/abis/Split.json"))
.default;
},
@@ -503,7 +503,7 @@ export const TokenDropInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
const contractInfo = await getContractInfo(address, provider);
return !contractInfo || contractInfo.version > 2
? (await import("@thirdweb-dev/contracts-js/dist/abis/DropERC20.json"))
@@ -546,7 +546,7 @@ export const TokenInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
return (
await import("@thirdweb-dev/contracts-js/dist/abis/TokenERC20.json")
).default;
@@ -587,7 +587,7 @@ export const VoteInitializer = {
if (abi) {
return abi;
}
// Deprecated - only needed for backwards compatibility with non-released contracts - should remove in v4
// Deprecated - only needed for backwards compatibility with non-published contracts - should remove in v4
return (await import("@thirdweb-dev/contracts-js/dist/abis/VoteERC20.json"))
.default;
},
@@ -1,12 +1,16 @@
import { getDeployArguments } from "../../common/deploy";
import {
extractConstructorParamsFromAbi,
extractFunctionParamsFromAbi,
fetchExtendedReleaseMetadata,
fetchPreDeployMetadata,
} from "../../common/index";
import { ChainId, EventType, getNativeTokenByChainId } from "../../constants";
import { getContractAddressByChainId } from "../../constants/addresses";
} from "../../common";
import { getDeployArguments } from "../../common/deploy";
import {
ChainId,
EventType,
getContractAddressByChainId,
getNativeTokenByChainId,
} from "../../constants";
import {
EditionDropInitializer,
EditionInitializer,
@@ -24,9 +28,12 @@ import {
TokenInitializer,
VoteInitializer,
} from "../../contracts";
import { SDKOptions } from "../../schema/sdk-options";
import { DeployEvent, DeployEvents } from "../../types";
import { SDKOptions } from "../../schema";
import {
DeployEvent,
DeployEvents,
DeployMetadata,
DeployOptions,
MarketplaceContractDeployMetadata,
MarketplaceV3ContractDeployMetadata,
MultiwrapContractDeployMetadata,
@@ -34,11 +41,7 @@ import {
SplitContractDeployMetadata,
TokenContractDeployMetadata,
VoteContractDeployMetadata,
} from "../../types/deploy/deploy-metadata";
import {
DeployMetadata,
DeployOptions,
} from "../../types/deploy/deploy-options";
} from "../../types";
import { ThirdwebSDK } from "../sdk";
import {
ContractType,
@@ -477,7 +480,7 @@ export class ContractDeployer extends RPCConnectionHandler {
return deployedAddress;
}
// For all other chains, fetch from released contracts
// For all other chains, fetch from published contracts
// resolve contract name from type
const contractName = getContractName(contractType);
invariant(contractName, "Contract name not found");
@@ -492,15 +495,15 @@ export class ContractDeployer extends RPCConnectionHandler {
);
const activeChainId = (await this.getProvider().getNetwork()).chainId;
// fetch the release URI from the ContractPublisher contract
const release = await this.fetchReleaseFromPolygon(
// fetch the publish URI from the ContractPublisher contract
const publishedContract = await this.fetchPublishedContractFromPolygon(
THIRDWEB_DEPLOYER,
contractName,
version,
);
// fetch the deploy metadata from the release URI
// fetch the deploy metadata from the publish URI
const deployMeta = await this.fetchAndCacheDeployMetadata(
release.metadataUri,
publishedContract.metadataUri,
);
let implementationAddress =
deployMeta.extendedMetadata?.factoryDeploymentData
@@ -508,11 +511,11 @@ export class ContractDeployer extends RPCConnectionHandler {
if (implementationAddress) {
// implementation exists on the current chain, continue with normal flow
return this.deployContractFromUri(release.metadataUri, constructorParams);
return this.deployContractFromUri(publishedContract.metadataUri, constructorParams);
} else {
// implementation does NOT exist on chain, deploy the implementation first, then deploy a proxy
implementationAddress = await this.deployContractFromUri(
release.metadataUri,
publishedContract.metadataUri,
this.getConstructorParamsForImplementation(contractType, activeChainId),
{
forceDirectDeploy: true,
@@ -542,25 +545,25 @@ export class ContractDeployer extends RPCConnectionHandler {
}
/**
* Deploy any released contract by its name
* @param releaserAddress the address of the releaser
* Deploy any published contract by its name
* @param publisherAddress the address of the publisher
* @param contractName the name of the contract to deploy
* @param constructorParams the constructor params to pass to the contract
*/
public async deployReleasedContract(
releaserAddress: string,
publisherAddress: string,
contractName: string,
constructorParams: any[],
version = "latest",
options?: DeployOptions,
): Promise<string> {
const release = await this.fetchReleaseFromPolygon(
releaserAddress,
const publishedContract = await this.fetchPublishedContractFromPolygon(
publisherAddress,
contractName,
version,
);
return await this.deployContractFromUri(
release.metadataUri,
publishedContract.metadataUri,
constructorParams,
options,
);
@@ -896,20 +899,20 @@ export class ContractDeployer extends RPCConnectionHandler {
return data;
}
private async fetchReleaseFromPolygon(
releaserAddress: string,
private async fetchPublishedContractFromPolygon(
publisherAddress: string,
contractName: string,
version: string,
) {
const release = await new ThirdwebSDK("polygon")
const publishedContract = await new ThirdwebSDK("polygon")
.getPublisher()
.getVersion(releaserAddress, contractName, version);
if (!release) {
.getVersion(publisherAddress, contractName, version);
if (!publishedContract) {
throw new Error(
`No release found for '${contractName}' at version '${version}' by '${releaserAddress}'`,
`No published contract found for '${contractName}' at version '${version}' by '${publisherAddress}'`,
);
}
return release;
return publishedContract;
}
private getConstructorParamsForImplementation(
@@ -1,5 +1,5 @@
import { EventType } from "../../constants";
import { ContractEvent, EventQueryOptions } from "../../types/index";
import { ContractEvent, EventQueryOptions } from "../../types";
import { ContractWrapper } from "./contract-wrapper";
import { EventFragment } from "@ethersproject/abi";
import { BaseContract, Event, providers } from "ethers";
@@ -6,9 +6,9 @@ import {
fetchPreDeployMetadata,
fetchRawPredeployMetadata,
fetchSourceFilesFromMetadata,
isIncrementalVersion,
resolveContractUriFromAddress,
} from "../../common";
import { isIncrementalVersion } from "../../common/version-checker";
import { getContractPublisherAddress } from "../../constants";
import {
AbiFunction,
@@ -24,8 +24,8 @@ import {
PublishedContract,
PublishedContractFetched,
PublishedContractSchema,
} from "../../schema/contracts/custom";
import { SDKOptions } from "../../schema/sdk-options";
SDKOptions,
} from "../../schema";
import { NetworkInput, TransactionResult } from "../types";
import { ContractWrapper } from "./contract-wrapper";
import { RPCConnectionHandler } from "./rpc-connection-handler";
@@ -309,7 +309,7 @@ export class ContractPublisher extends RPCConnectionHandler {
(metadata) => metadata.publishedMetadata.version === version,
);
invariant(versionMatch, "Contract version not found");
// match the version back to the contract based on the release timestamp
// match the version back to the contract based on the published timestamp
return allVersions.find(
(contract) => contract.timestamp === versionMatch.publishedTimestamp,
);
@@ -1,3 +1,4 @@
import { TransactionResult, TransactionResultWithId } from "..";
import {
CommonNFTInput,
NFTMetadata,
@@ -9,13 +10,11 @@ import {
getBaseUriFromBatch,
} from "../../common/nft";
import { FeatureName } from "../../constants/contract-features";
import { BatchToReveal } from "../../types/delayed-reveal";
import { BatchToReveal, UploadProgressEvent } from "../../types";
import {
BaseDelayedRevealERC1155,
BaseDelayedRevealERC721,
} from "../../types/eips";
import { UploadProgressEvent } from "../../types/events";
import { TransactionResult, TransactionResultWithId } from "../index";
import { ContractWrapper } from "./contract-wrapper";
import type {
DropERC721_V3,
@@ -1,4 +1,9 @@
import { includesErrorMessage } from "../../common";
import { TransactionResult, TransactionTask } from "..";
import {
detectContractFeature,
hasFunction,
includesErrorMessage,
} from "../../common";
import {
abstractContractModelToLegacy,
abstractContractModelToNew,
@@ -11,10 +16,6 @@ import {
updateExistingClaimConditions,
} from "../../common/claim-conditions";
import { isNativeToken } from "../../common/currency";
import {
detectContractFeature,
hasFunction,
} from "../../common/feature-detection";
import { SnapshotFormatVersion } from "../../common/sharded-merkle-tree";
import { isNode } from "../../common/utils";
import { ClaimEligibility } from "../../enums";
@@ -34,7 +35,6 @@ import {
BaseClaimConditionERC1155,
PrebuiltEditionDrop,
} from "../../types/eips";
import { TransactionResult, TransactionTask } from "../index";
import { ContractMetadata } from "./contract-metadata";
import { ContractWrapper } from "./contract-wrapper";
import type {
+1 -1
View File
@@ -21,8 +21,8 @@ import {
FEATURE_NFT_TIERED_DROP,
FEATURE_NFT_SIGNATURE_MINTABLE_V2,
} from "../../constants/erc721-features";
import { ClaimOptions, UploadProgressEvent } from "../../types";
import { BaseDropERC721, BaseERC721 } from "../../types/eips";
import { ClaimOptions, UploadProgressEvent } from "../../types/index";
import { DetectableFeature } from "../interfaces/DetectableFeature";
import { UpdateableNetwork } from "../interfaces/contract";
import {
+4 -5
View File
@@ -1,4 +1,4 @@
import { fetchCurrencyValue } from "../common/currency";
import { fetchCurrencyValue } from "../common";
import { getCompositePluginABI } from "../common/plugin";
import { getChainProvider, NATIVE_TOKEN_ADDRESS } from "../constants";
import {
@@ -6,10 +6,9 @@ import {
PREBUILT_CONTRACTS_MAP,
} from "../contracts";
import { SmartContract } from "../contracts/smart-contract";
import { AbiSchema } from "../schema";
import { SDKOptions } from "../schema/sdk-options";
import { ContractWithMetadata, CurrencyValue } from "../types/index";
import { ContractDeployer } from "./classes/contract-deployer";
import { AbiSchema, SDKOptions } from "../schema";
import { ContractWithMetadata, CurrencyValue } from "../types";
import { ContractDeployer } from "./classes";
import { ContractPublisher } from "./classes/contract-publisher";
import { MultichainRegistry } from "./classes/multichain-registry";
import {
+15 -6
View File
@@ -66,13 +66,22 @@ export class StaticJsonRpcBatchProvider extends providers.StaticJsonRpcProvider
// on whether it was a success or error
batch.forEach((inflightRequest_, index) => {
const payload = result[index];
if (payload.error) {
const error = new Error(payload.error.message);
(error as any).code = payload.error.code;
(error as any).data = payload.error.data;
inflightRequest_.reject(error);
// there may *not* be a payload for a given request (typically RPC error level)
if (payload) {
// if there is a payload, check for an error
if (payload.error) {
const error = new Error(payload.error.message);
(error as any).code = payload.error.code;
(error as any).data = payload.error.data;
inflightRequest_.reject(error);
} else {
// if there's no error resolve the request
inflightRequest_.resolve(payload.result);
}
} else {
inflightRequest_.resolve(payload.result);
// if there is no payload, reject the request
inflightRequest_.reject(new Error("No response for request"));
}
});
},
@@ -1,5 +1,5 @@
import { FileOrBufferOrStringSchema } from "../../../core/schema/shared";
import { toSemver } from "../../common/index";
import { toSemver } from "../../common";
import {
AddressSchema,
BigNumberishSchema,
+1 -1
View File
@@ -9,7 +9,7 @@ export * from "./programs/token";
// sdk
export * from "./sdk";
// types
export * from "./types/index";
export * from "./types";
export * from "./types/common";
export * from "./types/programs";
export * from "./types/programs/nft-drop";
+1 -1
View File
@@ -1,5 +1,5 @@
import { ThirdwebSDK } from "../sdk";
import { Network } from "../types/index";
import { Network } from "../types";
import { getPayer } from "./local-config";
import { KeypairSigner } from "@metaplex-foundation/js";
import { ThirdwebStorage } from "@thirdweb-dev/storage";
+1 -1
View File
@@ -1,5 +1,5 @@
import { getRpcUrl } from "../../core/constants/urls";
import { Network } from "../types/index";
import { Network } from "../types";
import { Metaplex } from "@metaplex-foundation/js";
import { Cluster, clusterApiUrl } from "@solana/web3.js";
-1
View File
@@ -7,7 +7,6 @@ import {
EditionDropInitializer,
EditionInitializer,
getNativeTokenByChainId,
LOCAL_NODE_PKEY,
MarketplaceInitializer,
MultiwrapInitializer,
NFTCollectionInitializer,
@@ -1,4 +1,4 @@
import { NFTMetadata, NFTMetadataInput } from "../../src/core/schema/nft";
import { NFTMetadataInput, NFTMetadataOrUri } from "../../src/core/schema/nft";
import {
ClaimEligibility,
EditionDrop,
@@ -6,12 +6,11 @@ import {
NATIVE_TOKEN_ADDRESS,
TokenInitializer,
} from "../../src/evm";
import { expectError, sdk, signers, storage } from "./before-setup";
import { expectError, sdk, signers } from "./before-setup";
import { AddressZero } from "@ethersproject/constants";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { DropERC1155_V2__factory } from "@thirdweb-dev/contracts-js";
import { assert, expect, use } from "chai";
import { BigNumber, ethers } from "ethers";
import { BigNumber } from "ethers";
import invariant from "tiny-invariant";
global.fetch = require("cross-fetch");
@@ -74,7 +73,6 @@ describe("Edition Drop Contract (V2)", async () => {
1,
);
const cost2 = await claimTx.estimateGasCostInEther();
console.log("cost2", cost2);
expect(parseFloat(cost2)).gt(0);
});
@@ -117,7 +115,7 @@ describe("Edition Drop Contract (V2)", async () => {
});
it("comprehensive test with allowlist", async () => {
const metadata = [];
const metadata: NFTMetadataOrUri[] = [];
for (let i = 0; i < 6; i++) {
metadata.push({ name: `test${i}`, description: `desc${i}` });
}
+1 -4
View File
@@ -8,10 +8,7 @@ import {
import { sdk, signers } from "./before-setup";
import { AddressZero } from "@ethersproject/constants";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import {
MockContractPublisher__factory,
TWFactory__factory,
} from "@thirdweb-dev/contracts-js";
import { MockContractPublisher__factory } from "@thirdweb-dev/contracts-js";
import { expect } from "chai";
import { ethers } from "ethers";
+1 -2
View File
@@ -1,6 +1,6 @@
/* eslint-disable turbo/no-undeclared-env-vars */
import { ThirdwebSDK } from "../../src/evm";
import { assert, expect } from "chai";
import { assert } from "chai";
import { ethers, Wallet } from "ethers";
const RPC_URL = "https://rpc-mumbai.maticvigil.com/";
@@ -25,7 +25,6 @@ describe("Gasless Forwarder", async () => {
});
it.skip("should use sdk with openzeppelin defender", async () => {
const NFT_COLLECTION_ADDRESS = "0x24A5aB2878B63716B001aa9AbE816c2662192B12";
const provider = ethers.getDefaultProvider(RPC_URL);
const wallet = Wallet.createRandom().connect(provider);
const sdk = new ThirdwebSDK(wallet, {
+8 -11
View File
@@ -172,7 +172,6 @@ describe("Marketplace V3", async () => {
endTimestamp: Date = new Date(
startTimestamp.getTime() + 5 * 24 * 60 * 60 * 1000,
),
reservePricePerToken = 0.05,
): Promise<BigNumber> => {
return (
await marketplaceContract.englishAuctions.createAuction({
@@ -789,7 +788,7 @@ describe("Marketplace V3", async () => {
it("should distribute the tokens when an auction closes", async () => {
await sdk.updateSignerOrProvider(adminWallet);
const auctionId = (
const auctionId2 = (
await marketplaceContract.englishAuctions.createAuction({
assetContractAddress: dummyNftContract.getAddress(),
tokenId: "2",
@@ -806,7 +805,7 @@ describe("Marketplace V3", async () => {
await sdk.updateSignerOrProvider(bobWallet);
await marketplaceContract.englishAuctions.makeBid(auctionId, 2);
await marketplaceContract.englishAuctions.makeBid(auctionId2, 2);
await fastForwardTime(60 * 60 * 24);
@@ -820,7 +819,7 @@ describe("Marketplace V3", async () => {
"The buyer should have no tokens to start",
);
await marketplaceContract.englishAuctions.closeAuctionForBidder(
auctionId,
auctionId2,
);
const balance = await dummyNftContract.balanceOf(bobWallet.address);
@@ -844,7 +843,7 @@ describe("Marketplace V3", async () => {
);
await marketplaceContract.englishAuctions.closeAuctionForSeller(
auctionId,
auctionId2,
);
const newTokenBalance = await customTokenContract.balanceOf(
@@ -917,8 +916,6 @@ describe("Marketplace V3", async () => {
"0",
"The buyer should start with no tokens",
);
// await marketplaceContract.makeOffer(directListingId, 0.05, 1);
const offerId = await makeOffer(dummyNftContract.getAddress(), 0, 1);
await marketplaceContract.directListings.buyFromListing(
directListingId,
@@ -934,10 +931,10 @@ describe("Marketplace V3", async () => {
it("should allow offers to be made for listed tokens", async () => {
sdk.updateSignerOrProvider(bobWallet);
const bobOfferId = await makeOffer(dummyNftContract.getAddress(), 0, 1);
await makeOffer(dummyNftContract.getAddress(), 0, 1);
sdk.updateSignerOrProvider(samWallet);
const samOfferId = await makeOffer(dummyNftContract.getAddress(), 0, 1);
await makeOffer(dummyNftContract.getAddress(), 0, 1);
let offers = await marketplaceContract.offers.getAll({
start: 0,
@@ -969,11 +966,11 @@ describe("Marketplace V3", async () => {
it("should return all offers for a token when queried", async () => {
// make an offer as bob
sdk.updateSignerOrProvider(bobWallet);
const bobOfferId = await makeOffer(dummyNftContract.getAddress(), 0, 1);
await makeOffer(dummyNftContract.getAddress(), 0, 1);
// make an offer as sam
sdk.updateSignerOrProvider(samWallet);
const samOfferId = await makeOffer(dummyNftContract.getAddress(), 0, 1);
await makeOffer(dummyNftContract.getAddress(), 0, 1);
// fetch all offers for the token
sdk.updateSignerOrProvider(adminWallet);
+8 -8
View File
@@ -1,4 +1,4 @@
import { NFTMetadataInput } from "../../src/core/schema/nft";
import { NFTMetadataInput, NFTMetadataOrUri } from "../../src/core/schema/nft";
import {
ClaimEligibility,
NATIVE_TOKEN_ADDRESS,
@@ -41,9 +41,9 @@ describe("NFT Drop Contract (v3)", async () => {
platform_fee_basis_points: 10,
platform_fee_recipient: AddressZero,
},
3,
"3",
);
dropContract = await sdk.getNFTDrop(address);
dropContract = await sdk.getContract(address, "nft-drop");
});
it("should lazy mint with URI", async () => {
@@ -57,7 +57,7 @@ describe("NFT Drop Contract (v3)", async () => {
});
it("comprehensive test", async () => {
const metadata = [];
const metadata: NFTMetadataOrUri[] = [];
for (let i = 0; i < 10; i++) {
metadata.push({ name: `test${i}`, description: `desc${i}` });
}
@@ -95,7 +95,7 @@ describe("NFT Drop Contract (v3)", async () => {
});
it("comprehensive test with allowlist", async () => {
const metadata = [];
const metadata: NFTMetadataOrUri[] = [];
for (let i = 0; i < 10; i++) {
metadata.push({ name: `test${i}`, description: `desc${i}` });
}
@@ -211,12 +211,12 @@ describe("NFT Drop Contract (v3)", async () => {
let proof = await dropContract.claimConditions.getClaimerProofs(
bobWallet.address,
);
expect(proof.address).to.eq(bobWallet.address);
expect(proof?.address).to.eq(bobWallet.address);
proof = await dropContract.claimConditions.getClaimerProofs(
bobWallet.address,
0,
);
expect(proof.address).to.eq(bobWallet.address);
expect(proof?.address).to.eq(bobWallet.address);
proof = await dropContract.claimConditions.getClaimerProofs(
samWallet.address,
);
@@ -225,7 +225,7 @@ describe("NFT Drop Contract (v3)", async () => {
samWallet.address,
0,
);
expect(proof.address).to.eq(samWallet.address);
expect(proof?.address).to.eq(samWallet.address);
});
it("should return snapshot data on claim conditions", async () => {
+4 -7
View File
@@ -1,4 +1,4 @@
import { NFTMetadataInput } from "../../src/core/schema/nft";
import { NFTMetadataInput, NFTMetadataOrUri } from "../../src/core/schema/nft";
import {
ClaimEligibility,
NATIVE_TOKEN_ADDRESS,
@@ -50,7 +50,7 @@ describe("NFT Drop Contract (v4)", async () => {
});
it("comprehensive test", async () => {
const metadata = [];
const metadata: NFTMetadataOrUri[] = [];
for (let i = 0; i < 10; i++) {
metadata.push({ name: `test${i}`, description: `desc${i}` });
}
@@ -91,7 +91,7 @@ describe("NFT Drop Contract (v4)", async () => {
});
it("comprehensive test with allowlist and price override", async () => {
const metadata = [];
const metadata: NFTMetadataOrUri[] = [];
for (let i = 0; i < 10; i++) {
metadata.push({ name: `test${i}`, description: `desc${i}` });
}
@@ -106,14 +106,11 @@ describe("NFT Drop Contract (v4)", async () => {
],
},
]);
console.log(
await dropContract.claimConditions.getClaimIneligibilityReasons(1),
);
await dropContract.claim(1);
});
it("comprehensive test with allowlist", async () => {
const metadata = [];
const metadata: NFTMetadataOrUri[] = [];
for (let i = 0; i < 10; i++) {
metadata.push({ name: `test${i}`, description: `desc${i}` });
}
-6
View File
@@ -1,4 +1,3 @@
import { getMultichainRegistryAddress, ThirdwebSDK } from "../../src/evm";
import { joinABIs } from "../../src/evm/common/plugin";
import { MultichainRegistry } from "../../src/evm/core/classes/multichain-registry";
import { ContractRegistry } from "../../src/evm/core/classes/registry";
@@ -22,12 +21,7 @@ describe("Contract Registry", () => {
it("multichain registry", async () => {
sdk.updateSignerOrProvider(adminWallet);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
multichainRegistry = sdk.multiChainRegistry;
console.log(
"multichain registry address: ",
getMultichainRegistryAddress(),
);
address = await sdk.deployer.deployNFTCollection({
name: "Test1",
+1 -1
View File
@@ -1,8 +1,8 @@
import { createSnapshot, SnapshotEntryInput } from "../../src";
import {
ShardedMerkleTree,
SnapshotFormatVersion,
} from "../../src/evm/common/sharded-merkle-tree";
import { createSnapshot, SnapshotEntryInput } from "../../src/evm/index";
import { sdk, signers, storage } from "./before-setup";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { BigNumber, ethers } from "ethers";
+3 -3
View File
@@ -11,10 +11,10 @@ describe("Tiered Drop Contract", async () => {
let claimerWallet: SignerWithAddress;
async function deployTieredDrop() {
// This needs to match the release for the currently used ABI
const releaseUri =
// This needs to match the published contract for the currently used ABI
const publishUri =
"ipfs://QmXu9ezFNgXBX1juLZ7kwdf5KpTD1x9GPHnk14QB2NpUvK/0";
const address = await sdk.deployer.deployContractFromUri(releaseUri, [], {
const address = await sdk.deployer.deployContractFromUri(publishUri, [], {
forceDirectDeploy: true,
});
+3 -3
View File
@@ -5,7 +5,7 @@ import {
TokenDropInitializer,
TokenInitializer,
} from "../../src/evm";
import { expectError, sdk, signers, storage } from "./before-setup";
import { expectError, sdk, signers } from "./before-setup";
import { AddressZero } from "@ethersproject/constants";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import { assert, expect } from "chai";
@@ -39,9 +39,9 @@ describe("Token Drop Contract (v2)", async () => {
platform_fee_basis_points: 10,
platform_fee_recipient: AddressZero,
},
2,
"2",
);
dropContract = await sdk.getTokenDrop(address);
dropContract = await sdk.getContract(address, "token-drop");
});
it("comprehensive test", async () => {
+1 -1
View File
@@ -42,7 +42,7 @@ describe("Token Drop Contract (v4)", async () => {
TokenDropInitializer.contractType,
),
);
dropContract = await sdk.getTokenDrop(address);
dropContract = await sdk.getContract(address, "token-drop");
});
it("should allow a snapshot to be set", async () => {
+6
View File
@@ -1,5 +1,11 @@
# @thirdweb-dev/storage
## 1.0.10
### Patch Changes
- [#601](https://github.com/thirdweb-dev/js/pull/601) [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19) Thanks [@jnsdls](https://github.com/jnsdls)! - upgrade dependencies
## 1.0.9
### Patch Changes
+1 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/storage",
"version": "1.0.9",
"version": "1.0.10",
"main": "dist/thirdweb-dev-storage.cjs.js",
"module": "dist/thirdweb-dev-storage.esm.js",
"exports": {
@@ -29,9 +29,6 @@
"dist/"
],
"preconstruct": {
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"exports": true
},
"exports": true
},
"devDependencies": {
+19
View File
@@ -1,5 +1,24 @@
# @thirdweb-dev/unity-js-bridge
## 0.2.11
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/sdk@3.9.3
- @thirdweb-dev/wallets@0.2.4
## 0.2.10
### Patch Changes
- Updated dependencies [[`f3408d0`](https://github.com/thirdweb-dev/js/commit/f3408d05d84ff8418a3f76961367e47565ed32b4), [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19)]:
- @thirdweb-dev/sdk@3.9.2
- @thirdweb-dev/storage@1.0.10
- @thirdweb-dev/wallets@0.2.3
- @thirdweb-dev/auth@3.0.6
- @thirdweb-dev/pay@0.1.1
## 0.2.9
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/unity-js-bridge",
"version": "0.2.9",
"version": "0.2.11",
"main": "dist/thirdweb-unity-bridge.js",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
"license": "Apache-2.0",
+8
View File
@@ -1,5 +1,13 @@
# @thirdweb-dev/wallets
## 0.2.4
## 0.2.3
### Patch Changes
- [#601](https://github.com/thirdweb-dev/js/pull/601) [`66cf1fb`](https://github.com/thirdweb-dev/js/commit/66cf1fb5c2e8deb486543ee028d786bb8eef6c19) Thanks [@jnsdls](https://github.com/jnsdls)! - upgrade dependencies
## 0.2.2
## 0.2.1
+1 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/wallets",
"version": "0.2.2",
"version": "0.2.4",
"main": "dist/thirdweb-dev-wallets.cjs.js",
"module": "dist/thirdweb-dev-wallets.esm.js",
"exports": {
@@ -134,9 +134,6 @@
"solana/index.ts",
"solana/wallets/**"
],
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"exports": true
},
"exports": true
},
"sideEffects": false,
-2
View File
@@ -38,8 +38,6 @@ packages.forEach((pkg) => {
}
});
console.log(packageJson);
if (!process.env.CI) {
console.error(
`Not in CI, skipping writing package.json for: "${pkg.packageJson.name}"`,
+1 -1
View File
@@ -11,7 +11,7 @@
"react-scripts": "^5"
},
"scripts": {
"build": "react-scripts build",
"build": "GENERATE_SOURCEMAP=false react-scripts build",
"e2e": "npx playwright test"
},
"browserslist": {
+21 -6
View File
@@ -80,18 +80,33 @@
"inputs": ["src/**"],
"dependsOn": ["build"]
},
"e2e:e2e-cra-5": {
"outputs": ["build"],
"e2e-cra-5#build": {
"outputs": ["build/**"],
"inputs": ["src/**", "fixtures/**"],
"dependsOn": ["^build"]
},
"e2e-next-12#build": {
"outputs": [".next/**"],
"inputs": ["src/**", "fixtures/**"],
"dependsOn": ["^build"]
},
"e2e-vite-3#build": {
"outputs": ["dist/**"],
"inputs": ["src/**", "fixtures/**"],
"dependsOn": ["^build"]
},
"e2e-cra-5#e2e": {
"outputs": ["playwright-report/**"],
"inputs": ["src/**", "fixtures/**"],
"dependsOn": ["build"]
},
"e2e:e2e-next-12": {
"outputs": [".next"],
"e2e-next-12#e2e": {
"outputs": ["playwright-report/**"],
"inputs": ["src/**", "fixtures/**"],
"dependsOn": ["build"]
},
"e2e:e2e-vite-3": {
"outputs": ["dist"],
"e2e-vite-3#e2e": {
"outputs": ["playwright-report/**"],
"inputs": ["src/**", "fixtures/**"],
"dependsOn": ["build"]
},
+5142 -6035
View File
File diff suppressed because it is too large Load Diff