Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c3f050883 | ||
|
|
8b68f20678 | ||
|
|
3d644fb8cb | ||
|
|
690ff925c3 | ||
|
|
4fe6797427 | ||
|
|
f3408d05d8 | ||
|
|
845e818c66 | ||
|
|
5178256e84 | ||
|
|
66cf1fb5c2 | ||
|
|
df792f0b81 | ||
|
|
ae0f967356 | ||
|
|
076718112f | ||
|
|
7c9f86cc44 | ||
|
|
9c90371426 |
@@ -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
|
||||||
@@ -13,6 +13,6 @@ runs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn install --frozen-lockfile
|
run: yarn
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -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/**}"
|
||||||
@@ -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"
|
|
||||||
@@ -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
|
|
||||||
@@ -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
@@ -13,7 +13,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "turbo run test test:evm test:solana",
|
"test": "turbo run test test:evm test:solana --filter=./packages/*",
|
||||||
"e2e": "turbo run e2e",
|
"e2e": "turbo run e2e",
|
||||||
"build": "turbo run build --filter=./packages/*",
|
"build": "turbo run build --filter=./packages/*",
|
||||||
"build:release": "turbo run build --force --filter=./packages/*",
|
"build:release": "turbo run build --force --filter=./packages/*",
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @thirdweb-dev/auth
|
# @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
|
## 3.0.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/auth",
|
"name": "@thirdweb-dev/auth",
|
||||||
"version": "3.0.5",
|
"version": "3.0.6",
|
||||||
"main": "dist/thirdweb-dev-auth.cjs.js",
|
"main": "dist/thirdweb-dev-auth.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-auth.esm.js",
|
"module": "dist/thirdweb-dev-auth.esm.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
@@ -50,9 +50,6 @@
|
|||||||
"evm/index.ts",
|
"evm/index.ts",
|
||||||
"solana/index.ts"
|
"solana/index.ts"
|
||||||
],
|
],
|
||||||
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
|
|
||||||
"exports": true
|
|
||||||
},
|
|
||||||
"exports": true
|
"exports": true
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -138,4 +135,4 @@
|
|||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
"zod": "^3.20.2"
|
"zod": "^3.20.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# @thirdweb-dev/chains
|
# @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
|
## 0.1.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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;
|
||||||
@@ -10,7 +10,6 @@ export default {
|
|||||||
"rpc": [
|
"rpc": [
|
||||||
"https://songbird-canary-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://songbird-canary-network.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://songbird-api.flare.network/ext/C/rpc",
|
"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.ftso.com.au/ext/bc/C/rpc",
|
||||||
"https://sgb.lightft.so/rpc",
|
"https://sgb.lightft.so/rpc",
|
||||||
"https://sgb-rpc.ftso.eu"
|
"https://sgb-rpc.ftso.eu"
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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;
|
||||||
@@ -11,7 +11,9 @@ export default {
|
|||||||
"https://bear-network-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://bear-network-chain-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"https://brnkc-test.bearnetwork.net"
|
"https://brnkc-test.bearnetwork.net"
|
||||||
],
|
],
|
||||||
"faucets": [],
|
"faucets": [
|
||||||
|
"https://faucet.bearnetwork.net"
|
||||||
|
],
|
||||||
"nativeCurrency": {
|
"nativeCurrency": {
|
||||||
"name": "Bear Network Chain Testnet Token",
|
"name": "Bear Network Chain Testnet Token",
|
||||||
"symbol": "tBRNKC",
|
"symbol": "tBRNKC",
|
||||||
|
|||||||
@@ -24,8 +24,13 @@ export default {
|
|||||||
"standard": "none"
|
"standard": "none"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Canto Cosmos Explorer (BigDipper)",
|
"name": "Canto Cosmos Explorer",
|
||||||
"url": "https://cosmos.explorer.canto.io",
|
"url": "https://cosmos-explorers.neobase.one",
|
||||||
|
"standard": "none"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Canto EVM Explorer (Blockscout)",
|
||||||
|
"url": "https://tuber.build",
|
||||||
"standard": "none"
|
"standard": "none"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/chains",
|
"name": "@thirdweb-dev/chains",
|
||||||
"version": "0.1.1",
|
"version": "0.1.3",
|
||||||
"main": "dist/thirdweb-dev-chains.cjs.js",
|
"main": "dist/thirdweb-dev-chains.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-chains.esm.js",
|
"module": "dist/thirdweb-dev-chains.esm.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
@@ -24,9 +24,6 @@
|
|||||||
"entrypoints": [
|
"entrypoints": [
|
||||||
"index.ts"
|
"index.ts"
|
||||||
],
|
],
|
||||||
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
|
|
||||||
"exports": true
|
|
||||||
},
|
|
||||||
"exports": true
|
"exports": true
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,21 @@
|
|||||||
# thirdweb
|
# 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
|
## 0.9.21
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ Deploying contracts this way gives you access to:
|
|||||||
## Releasing your contract
|
## Releasing your contract
|
||||||
|
|
||||||
```shell
|
```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
|
- author attribution
|
||||||
- contract information
|
- contract information
|
||||||
@@ -52,9 +52,9 @@ Creates an official release of your contract, along with:
|
|||||||
- versioning
|
- versioning
|
||||||
- release notes
|
- 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
|
## Detecting contract extensions
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ Clone the repo and run this command after installing the CLI tool:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd examples/hardhat
|
$ cd examples/hardhat
|
||||||
$ npx thirdweb@latest release
|
$ npx thirdweb@latest publish
|
||||||
```
|
```
|
||||||
|
|
||||||
## Local Development
|
## Local Development
|
||||||
@@ -106,11 +106,13 @@ The simplest way to work on the CLI locally is to:
|
|||||||
```bash
|
```bash
|
||||||
git clone https://github.com/thirdweb-dev/js.git
|
git clone https://github.com/thirdweb-dev/js.git
|
||||||
```
|
```
|
||||||
|
|
||||||
2. From the project root run
|
2. From the project root run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn && yarn build
|
yarn && yarn build
|
||||||
```
|
```
|
||||||
|
|
||||||
3. From inside `js/packages/cli` Run the `build:watch` command to compile any changes in real time
|
3. From inside `js/packages/cli` Run the `build:watch` command to compile any changes in real time
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import { resolve } from "path";
|
|||||||
// this creates an app, can take some time that's fine
|
// this creates an app, can take some time that's fine
|
||||||
jest.setTimeout(120_000);
|
jest.setTimeout(120_000);
|
||||||
|
|
||||||
describe("npx thirdweb release", () => {
|
describe("npx thirdweb publish", () => {
|
||||||
it("should return release page url", async () => {
|
it("should return publish page url", async () => {
|
||||||
const { spawn, cleanup, exists, path } = await prepareEnvironment();
|
const { spawn, cleanup, exists, path } = await prepareEnvironment();
|
||||||
|
|
||||||
await copyFile(
|
await copyFile(
|
||||||
@@ -16,7 +16,7 @@ describe("npx thirdweb release", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const { waitForText, waitForFinish, getExitCode, writeText, getStderr } =
|
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);
|
expect(await exists("BasicContract.sol")).toEqual(true);
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ describe("npx thirdweb release", () => {
|
|||||||
await waitForFinish();
|
await waitForFinish();
|
||||||
|
|
||||||
expect(getStderr().at(-1)).toContain(
|
expect(getStderr().at(-1)).toContain(
|
||||||
"https://thirdweb.com/contracts/release/",
|
"https://thirdweb.com/contracts/publish/",
|
||||||
);
|
);
|
||||||
|
|
||||||
// the process should exit with code 0
|
// the process should exit with code 0
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "thirdweb",
|
"name": "thirdweb",
|
||||||
"main": "dist/cli/index.js",
|
"main": "dist/cli/index.js",
|
||||||
"version": "0.9.21",
|
"version": "0.9.23",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ const main = async () => {
|
|||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
"-n, --name [name]",
|
"-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(
|
.option(
|
||||||
"-f, --file [name]",
|
"-f, --file [name]",
|
||||||
@@ -278,7 +278,7 @@ const main = async () => {
|
|||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
"-cv, --contract-version [version]",
|
"-cv, --contract-version [version]",
|
||||||
"Version of the released contract",
|
"Version of the published contract",
|
||||||
)
|
)
|
||||||
.option("--app", "Deploy a web app to decentralized storage")
|
.option("--app", "Deploy a web app to decentralized storage")
|
||||||
.option("--contract", "Deploy a smart contract to blockchains")
|
.option("--contract", "Deploy a smart contract to blockchains")
|
||||||
@@ -291,8 +291,36 @@ const main = async () => {
|
|||||||
|
|
||||||
program
|
program
|
||||||
.command("release")
|
.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(
|
.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("-p, --path <project-path>", "path to project", ".")
|
||||||
.option(
|
.option(
|
||||||
@@ -307,9 +335,9 @@ const main = async () => {
|
|||||||
.option("-d, --debug", "show debug logs")
|
.option("-d, --debug", "show debug logs")
|
||||||
.option("--ci", "Continuous Integration mode")
|
.option("--ci", "Continuous Integration mode")
|
||||||
.action(async (options) => {
|
.action(async (options) => {
|
||||||
const url = await processProject(options, "release");
|
const url = await processProject(options, "publish");
|
||||||
info(
|
info(
|
||||||
`Open this link to release your contracts: ${chalk.blueBright(
|
`Open this link to publish your contracts: ${chalk.blueBright(
|
||||||
url.toString(),
|
url.toString(),
|
||||||
)}`,
|
)}`,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import path from "path";
|
|||||||
|
|
||||||
export async function processProject(
|
export async function processProject(
|
||||||
options: any,
|
options: any,
|
||||||
command: "deploy" | "release",
|
command: "deploy" | "publish",
|
||||||
) {
|
) {
|
||||||
// TODO: allow overriding the default storage
|
// TODO: allow overriding the default storage
|
||||||
const storage = new ThirdwebStorage();
|
const storage = new ThirdwebStorage();
|
||||||
|
|||||||
@@ -211,9 +211,9 @@ export async function createContractProject({
|
|||||||
console.log(" Deploys your contracts with the thirdweb deploy flow.");
|
console.log(" Deploys your contracts with the thirdweb deploy flow.");
|
||||||
console.log();
|
console.log();
|
||||||
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();
|
||||||
console.log("We suggest that you begin by typing:");
|
console.log("We suggest that you begin by typing:");
|
||||||
console.log();
|
console.log();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ export default function generateDashboardUrl(
|
|||||||
version: string | undefined,
|
version: string | undefined,
|
||||||
): string | undefined {
|
): string | undefined {
|
||||||
const splitName = name.split("/");
|
const splitName = name.split("/");
|
||||||
// Released contract
|
// Published contract
|
||||||
if (splitName.length > 1) {
|
if (splitName.length > 1) {
|
||||||
return `https://thirdweb.com/dashboard/${splitName[0]}/${splitName[1]}${
|
return `https://thirdweb.com/dashboard/${splitName[0]}/${splitName[1]}${
|
||||||
version ? `/${version}` : ""
|
version ? `/${version}` : ""
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @thirdweb-dev/pay
|
# @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
|
## 0.1.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/pay",
|
"name": "@thirdweb-dev/pay",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"main": "dist/thirdweb-dev-pay.cjs.js",
|
"main": "dist/thirdweb-dev-pay.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-pay.esm.js",
|
"module": "dist/thirdweb-dev-pay.esm.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
@@ -29,9 +29,6 @@
|
|||||||
"index.ts",
|
"index.ts",
|
||||||
"integrations/**"
|
"integrations/**"
|
||||||
],
|
],
|
||||||
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
|
|
||||||
"exports": true
|
|
||||||
},
|
|
||||||
"exports": true
|
"exports": true
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
@@ -1,5 +1,22 @@
|
|||||||
# @thirdweb-dev/react-core
|
# @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
|
## 3.9.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-core",
|
"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",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -33,9 +33,6 @@
|
|||||||
"solana/index.ts",
|
"solana/index.ts",
|
||||||
"evm/index.ts"
|
"evm/index.ts"
|
||||||
],
|
],
|
||||||
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
|
|
||||||
"exports": true
|
|
||||||
},
|
|
||||||
"exports": true
|
"exports": true
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@@ -103,4 +100,4 @@
|
|||||||
"optional": true
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ type AddEthereumChainParameter = {
|
|||||||
|
|
||||||
export type Chain = {
|
export type Chain = {
|
||||||
id: number;
|
id: number;
|
||||||
name: AddEthereumChainParameter['chainName'];
|
name: AddEthereumChainParameter["chainName"];
|
||||||
nativeCurrency?: AddEthereumChainParameter['nativeCurrency'];
|
nativeCurrency?: AddEthereumChainParameter["nativeCurrency"];
|
||||||
rpcUrls: AddEthereumChainParameter['rpcUrls'];
|
rpcUrls: AddEthereumChainParameter["rpcUrls"];
|
||||||
blockExplorers?: {
|
blockExplorers?: {
|
||||||
name: string;
|
name: string;
|
||||||
url: string;
|
url: string;
|
||||||
@@ -256,16 +256,16 @@ export type ExecuteAuctionSale = {
|
|||||||
|
|
||||||
export type BuyNowParams<TListingType = ListingType> =
|
export type BuyNowParams<TListingType = ListingType> =
|
||||||
TListingType extends ListingType.Direct
|
TListingType extends ListingType.Direct
|
||||||
? {
|
? {
|
||||||
id: BigNumberish;
|
id: BigNumberish;
|
||||||
type: ListingType.Direct;
|
type: ListingType.Direct;
|
||||||
buyAmount: BigNumberish;
|
buyAmount: BigNumberish;
|
||||||
buyForWallet?: WalletAddress;
|
buyForWallet?: WalletAddress;
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
id: BigNumberish;
|
id: BigNumberish;
|
||||||
type: ListingType.Auction;
|
type: ListingType.Auction;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TOKEN DROP //
|
// TOKEN DROP //
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# @thirdweb-dev/react-native
|
# @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
|
## 0.1.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-native",
|
"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",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
import invariant from "tiny-invariant";
|
import invariant from "tiny-invariant";
|
||||||
import {
|
import { useAccount as useWagmiAccount, useClient } from "wagmi";
|
||||||
useAccount as useWagmiAccount,
|
|
||||||
useClient
|
|
||||||
} from "wagmi";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export function useAccount() {
|
export function useAccount(): ReturnType<typeof useWagmiAccount> {
|
||||||
const wagmiContext = useClient();
|
const wagmiContext = useClient();
|
||||||
invariant(
|
invariant(
|
||||||
wagmiContext,
|
wagmiContext,
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import invariant from "tiny-invariant";
|
import invariant from "tiny-invariant";
|
||||||
import {
|
import { useNetwork as useWagmiNetwork, useClient } from "wagmi";
|
||||||
useNetwork as useWagmiNetwork,
|
|
||||||
useClient
|
|
||||||
} from "wagmi";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook for getting metadata about the network the current wallet is connected to and switching networks
|
* Hook for getting metadata about the network the current wallet is connected to and switching networks
|
||||||
@@ -28,7 +25,7 @@ import {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export function useNetwork() {
|
export function useNetwork(): ReturnType<typeof useWagmiNetwork> {
|
||||||
const wagmiContext = useClient();
|
const wagmiContext = useClient();
|
||||||
invariant(
|
invariant(
|
||||||
wagmiContext,
|
wagmiContext,
|
||||||
|
|||||||
@@ -1,5 +1,27 @@
|
|||||||
# @thirdweb-dev/react
|
# @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
|
## 3.9.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
+89
-83
@@ -309,107 +309,113 @@ const KitchenSinkExample = () => {
|
|||||||
## Available hooks
|
## Available hooks
|
||||||
|
|
||||||
### Main hooks
|
### Main hooks
|
||||||
| Hook | Description |
|
|
||||||
| --- | --- |
|
| 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. |
|
| [`useSDK`](https://portal.thirdweb.com/react/react.usesdk) | Access the instance of the thirdweb SDK created by the ThirdwebProvider. |
|
||||||
| [`useContractWrite`](https://portal.thirdweb.com/react/react.usecontractwrite) | Use this to get data from a contract read-function call. |
|
| [`useContract`](https://portal.thirdweb.com/react/react.usecontract) | Use this resolve a contract address to a smart contract instance. |
|
||||||
| [`useContractRead`](https://portal.thirdweb.com/react/react.usecontractread) | Use this to get a function to make a write call to your contract. |
|
| [`useContractWrite`](https://portal.thirdweb.com/react/react.usecontractwrite) | Use this to get data from a contract read-function call. |
|
||||||
| [`useContractEvents`](https://portal.thirdweb.com/react/react.usecontractevents) | Use this to get the contract metadata for a (built-in or custom) contract. |
|
| [`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. |
|
| [`useContractMetadata`](https://portal.thirdweb.com/react/react.usecontractmetadata) | Use this to get the contract metadata for a (built-in or custom) contract. |
|
||||||
|
|
||||||
### Wallet connection
|
### Wallet connection
|
||||||
| Hook | Description |
|
|
||||||
| --- | --- |
|
| 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. |
|
| [`useAddress`](https://portal.thirdweb.com/react/react.useaddress) | Hook for accessing the address of the connected wallet. |
|
||||||
| [`useWalletConnect`](https://portal.thirdweb.com/react/react.usewalletconnect) | Hook for connecting to a mobile wallet with Wallet Connect. |
|
| [`useMetamask`](https://portal.thirdweb.com/react/react.usemetamask) | Hook for connecting to a Metamask wallet. |
|
||||||
| [`useCoinbaseWallet`](https://portal.thirdweb.com/react/react.usecoinbasewallet) | Hook for connecting to a Coinbase wallet. |
|
| [`useWalletConnect`](https://portal.thirdweb.com/react/react.usewalletconnect) | Hook for connecting to a mobile wallet with Wallet Connect. |
|
||||||
| [`useMagic`](https://portal.thirdweb.com/react/react.usemagic) | Hook for connecting to an email wallet using magic link. |
|
| [`useCoinbaseWallet`](https://portal.thirdweb.com/react/react.usecoinbasewallet) | Hook for connecting to a Coinbase wallet. |
|
||||||
| [`useGnosis`](https://portal.thirdweb.com/react/react.usegnosis) | Hook for connecting to a Gnosis Safe. |
|
| [`useMagic`](https://portal.thirdweb.com/react/react.usemagic) | Hook for connecting to an email wallet using magic link. |
|
||||||
| [`useDisconnect`](https://portal.thirdweb.com/react/react.usedisconnect) | Hook for disconnecting the currently connected wallet. |
|
| [`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
|
### Network connection
|
||||||
| Hook | Description |
|
|
||||||
| --- | --- |
|
| 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. |
|
| [`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 />. |
|
| [`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
|
### 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
|
### Token
|
||||||
| Hook | Description |
|
|
||||||
| --- | --- |
|
| 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. |
|
| [`useTokenSupply`](https://portal.thirdweb.com/react/react.usetokensupply) | Use this to get a the total supply of your contract. |
|
||||||
| [`useTokenDecimals`](https://portal.thirdweb.com/react/react.usetokendecimals) | Use this to get the decimals of your contract for a given address. |
|
| [`useTokenBalance`](https://portal.thirdweb.com/react/react.usetokenbalance) | Use this to get the balance of your contract for a given address. |
|
||||||
| [`useMintToken`](https://portal.thirdweb.com/react/react.useminttoken) | Use this to mint new tokens on your contract. |
|
| [`useTokenDecimals`](https://portal.thirdweb.com/react/react.usetokendecimals) | Use this to get the decimals of your contract for a given address. |
|
||||||
| [`useClaimToken`](https://portal.thirdweb.com/react/react.useclaimtoken) | Use this to claim tokens from your contract. |
|
| [`useMintToken`](https://portal.thirdweb.com/react/react.useminttoken) | Use this to mint new tokens on your contract. |
|
||||||
| [`useTransferToken`](https://portal.thirdweb.com/react/react.usetransfertoken) | Use this to transfer tokens on your contract. |
|
| [`useClaimToken`](https://portal.thirdweb.com/react/react.useclaimtoken) | Use this to claim tokens from your contract. |
|
||||||
| [`useTransferBatchToken`](https://portal.thirdweb.com/react/react.usetransferbatchtoken) | Use this to transfer batch tokens on your contract. |
|
| [`useTransferToken`](https://portal.thirdweb.com/react/react.usetransfertoken) | Use this to transfer tokens on your contract. |
|
||||||
| [`useBurnToken`](https://portal.thirdweb.com/react/react.useburntoken) | Use this to burn 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
|
### Marketplace
|
||||||
| Hook | Description |
|
|
||||||
| --- | --- |
|
| 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. |
|
| [`useListing`](https://portal.thirdweb.com/react/react.uselisting) | Use this to get a specific listing from the marketplace. |
|
||||||
| [`useListingsCount`](https://portal.thirdweb.com/react/react.uselistingscount) | Use this to get a count of all listings on your marketplace contract. |
|
| [`useListings`](https://portal.thirdweb.com/react/react.uselistings) | Use this to get a list all listings from your marketplace contract. |
|
||||||
| [`useActiveListings`](https://portal.thirdweb.com/react/react.useactivelistings) | Use this to get a list active 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. |
|
||||||
| [`useWinningBid`](https://portal.thirdweb.com/react/react.usewinningbid) | Use this to get a the winning bid for an auction listing from your marketplace contract. |
|
| [`useActiveListings`](https://portal.thirdweb.com/react/react.useactivelistings) | Use this to get a list active listings 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. |
|
| [`useWinningBid`](https://portal.thirdweb.com/react/react.usewinningbid) | Use this to get a the winning bid for 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. |
|
| [`useAuctionWinner`](https://portal.thirdweb.com/react/react.useauctionwinner) | Use this to get the winner of an auction listing from your marketplace contract. |
|
||||||
| [`useCreateDirectListing`](https://portal.thirdweb.com/react/react.usecreatedirectlisting) | Use this to create a new Direct Listing on 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. |
|
||||||
| [`useCreateAuctionListing`](https://portal.thirdweb.com/react/react.usecreateauctionlisting) | Use this to create a new Auction Listing on your marketplace contract. |
|
| [`useCreateDirectListing`](https://portal.thirdweb.com/react/react.usecreatedirectlisting) | Use this to create a new Direct Listing on your marketplace contract. |
|
||||||
| [`useCancelListing`](https://portal.thirdweb.com/react/react.usecancellisting) | Use this to cancel a 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. |
|
||||||
| [`useMakeBid`](https://portal.thirdweb.com/react/react.usemakebid) | Use this to place a bid on an auction listing from your marketplace contract. |
|
| [`useCancelListing`](https://portal.thirdweb.com/react/react.usecancellisting) | Use this to cancel a listing on your marketplace contract. |
|
||||||
| [`useBuyNow`](https://portal.thirdweb.com/react/react.usebuynow) | Use this to buy out an auction listing from 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
|
### Permissions Controls
|
||||||
| Hook | Description |
|
|
||||||
| --- | --- |
|
| 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. |
|
| [`useAllRoleMembers`](https://portal.thirdweb.com/react/react.useallrolemembers) | Use this to get the roles of all members. |
|
||||||
| [`useIsAddressRole`](https://portal.thirdweb.com/react/react.useisaddressrole) | Use this to check if a WalletAddress is a member of a role. |
|
| [`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. |
|
| [`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. |
|
| [`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. |
|
| [`useRevokeRole`](https://portal.thirdweb.com/react/react.userevokerole) | Use this to revoke a WalletAddress a specific role. |
|
||||||
|
|
||||||
### Drop
|
### Drop
|
||||||
| Hook | Description |
|
|
||||||
| --- | --- |
|
| 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.. |
|
| [`useUnclaimedNFTs`](https://portal.thirdweb.com/react/react.useunclaimednfts) | Use this to get a list of unclaimed 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. |
|
| [`useClaimedNFTs`](https://portal.thirdweb.com/react/react.useclaimednfts) | Use this to get a list of claimed (minted) NFT tokens 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. |
|
| [`useUnclaimedNFTSupply`](https://portal.thirdweb.com/react/react.useunclaimednftsupply) | Use this to get the total unclaimed 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. |
|
| [`useClaimedNFTSupply`](https://portal.thirdweb.com/react/react.useclaimednftsupply) | Use this to get the total claimed (minted) NFT supply of your ERC721 Drop contract. |
|
||||||
| [`useClaimNFT`](https://portal.thirdweb.com/react/react.useclaimnft) | Use this to claim a NFT on your DropContract |
|
| [`useBatchesToReveal`](https://portal.thirdweb.com/react/react.usebatchestoreveal) | Use this to get a list of batches that are ready to be revealed. |
|
||||||
| [`useLazyMint`](https://portal.thirdweb.com/react/react.uselazymint) | Use this to lazy mint a batch of NFTs on your DropContract. |
|
| [`useClaimNFT`](https://portal.thirdweb.com/react/react.useclaimnft) | Use this to claim a NFT 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. |
|
| [`useLazyMint`](https://portal.thirdweb.com/react/react.uselazymint) | Use this to lazy mint a batch of 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. |
|
| [`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
|
### Claim Conditions
|
||||||
| Hook | Description |
|
|
||||||
| --- | --- |
|
| 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. |
|
| [`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. |
|
| [`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. |
|
| [`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. |
|
| [`useResetClaimConditions`](https://portal.thirdweb.com/react/react.useresetclaimconditions) | Use this to reset claim conditions on your DropContract. |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react",
|
"name": "@thirdweb-dev/react",
|
||||||
"version": "3.9.1",
|
"version": "3.9.3",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -42,9 +42,6 @@
|
|||||||
"evm/index.ts",
|
"evm/index.ts",
|
||||||
"evm/connectors/**.ts"
|
"evm/connectors/**.ts"
|
||||||
],
|
],
|
||||||
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
|
|
||||||
"exports": true
|
|
||||||
},
|
|
||||||
"exports": true
|
"exports": true
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ export interface SharedMediaProps {
|
|||||||
controls?: HTMLVideoElement["controls"];
|
controls?: HTMLVideoElement["controls"];
|
||||||
|
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
|
|
||||||
|
mimeType?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,7 +67,7 @@ interface PlayButtonProps {
|
|||||||
isPlaying: boolean;
|
isPlaying: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PlayButton: React.VFC<PlayButtonProps> = ({ onClick, isPlaying }) => {
|
const PlayButton: React.FC<PlayButtonProps> = ({ onClick, isPlaying }) => {
|
||||||
const [isHovering, setIsHovering] = useState(false);
|
const [isHovering, setIsHovering] = useState(false);
|
||||||
const onMouseEnter = () => setIsHovering(true);
|
const onMouseEnter = () => setIsHovering(true);
|
||||||
const onMouseLeave = () => setIsHovering(false);
|
const onMouseLeave = () => setIsHovering(false);
|
||||||
@@ -295,10 +297,7 @@ const IframePlayer = React.forwardRef<HTMLIFrameElement, MediaRendererProps>(
|
|||||||
const [playing, setPlaying] = useState(!requireInteraction);
|
const [playing, setPlaying] = useState(!requireInteraction);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div style={{ position: "relative", ...style }} {...restProps}>
|
||||||
style={{ position: "relative", ...style }}
|
|
||||||
{...restProps}
|
|
||||||
>
|
|
||||||
<iframe
|
<iframe
|
||||||
src={playing ? src ?? undefined : undefined}
|
src={playing ? src ?? undefined : undefined}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
@@ -432,6 +431,7 @@ export const MediaRenderer = React.forwardRef<
|
|||||||
width = "300px",
|
width = "300px",
|
||||||
height = "300px",
|
height = "300px",
|
||||||
style,
|
style,
|
||||||
|
mimeType,
|
||||||
...restProps
|
...restProps
|
||||||
},
|
},
|
||||||
ref,
|
ref,
|
||||||
@@ -442,7 +442,7 @@ export const MediaRenderer = React.forwardRef<
|
|||||||
height,
|
height,
|
||||||
...style,
|
...style,
|
||||||
};
|
};
|
||||||
const videoOrImageSrc = useResolvedMediaType(src ?? undefined);
|
const videoOrImageSrc = useResolvedMediaType(src ?? undefined, mimeType);
|
||||||
const possiblePosterSrc = useResolvedMediaType(poster ?? undefined);
|
const possiblePosterSrc = useResolvedMediaType(poster ?? undefined);
|
||||||
|
|
||||||
if (!videoOrImageSrc.mimeType) {
|
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 resolvedUrl = useMemo(() => resolveIpfsUri(uri), [uri]);
|
||||||
const resolvedMimType = useQuery(
|
const resolvedMimType = useQuery(
|
||||||
["mime-type", resolvedUrl],
|
["mime-type", resolvedUrl],
|
||||||
() => resolveMimeType(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"}
|
alt={alt || "3D Model"}
|
||||||
camera-controls
|
camera-controls
|
||||||
poster={poster ? poster : null}
|
poster={poster ? poster : null}
|
||||||
style={{ width: '100%', height: '100%'} as CSSStyleDeclaration}
|
style={{ width: "100%", height: "100%" } as CSSStyleDeclaration}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export interface ThirdwebNftMediaProps extends SharedMediaProps {
|
|||||||
* This component can be used to render NFTs from the thirdweb SDK.
|
* 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.
|
* 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.
|
* The default size is 300px by 300px, but this can be changed using the `width` and `height` props.
|
||||||
*
|
*
|
||||||
* Props: {@link ThirdwebNftMediaProps}
|
* Props: {@link ThirdwebNftMediaProps}
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
@@ -43,7 +43,7 @@ export interface ThirdwebNftMediaProps extends SharedMediaProps {
|
|||||||
export const ThirdwebNftMedia = React.forwardRef<
|
export const ThirdwebNftMedia = React.forwardRef<
|
||||||
HTMLMediaElement,
|
HTMLMediaElement,
|
||||||
ThirdwebNftMediaProps
|
ThirdwebNftMediaProps
|
||||||
>(({ metadata, width = "300px", height = "300px", style, ...props }, ref) => {
|
>(({ metadata, width = "300px", height = "300px", style, ...props }, ref) => {
|
||||||
return (
|
return (
|
||||||
<MediaRenderer
|
<MediaRenderer
|
||||||
src={metadata.animation_url || metadata.image}
|
src={metadata.animation_url || metadata.image}
|
||||||
@@ -52,7 +52,7 @@ export const ThirdwebNftMedia = React.forwardRef<
|
|||||||
ref={ref}
|
ref={ref}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={height}
|
||||||
style={{ ...style }}
|
style={{ ...style }}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,13 +9,16 @@ import {
|
|||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```javascript
|
* ```javascript
|
||||||
* import { useNetwork, ChainId } from "@thirdweb-dev/react";
|
* import { useNetwork } from "@thirdweb-dev/react";
|
||||||
*
|
*
|
||||||
* const App = () => {
|
* const App = () => {
|
||||||
* const [, switchNetwork] = useNetwork();
|
* const [, switchNetwork] = useNetwork();
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* return (
|
* 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
|
* Switch Network
|
||||||
* </button>
|
* </button>
|
||||||
* );
|
* );
|
||||||
|
|||||||
@@ -1,5 +1,24 @@
|
|||||||
# @thirdweb-dev/sdk
|
# @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
|
## 3.9.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/sdk",
|
"name": "@thirdweb-dev/sdk",
|
||||||
"version": "3.9.1",
|
"version": "3.9.3",
|
||||||
"description": "The main thirdweb SDK.",
|
"description": "The main thirdweb SDK.",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@@ -38,9 +38,6 @@
|
|||||||
"solana/index.ts",
|
"solana/index.ts",
|
||||||
"solana/server/index.ts"
|
"solana/server/index.ts"
|
||||||
],
|
],
|
||||||
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
|
|
||||||
"exports": true
|
|
||||||
},
|
|
||||||
"exports": true
|
"exports": true
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import { NATIVE_TOKENS, SUPPORTED_CHAIN_ID } from "../constants";
|
||||||
import { Feature } from "../constants/contract-features";
|
import { Feature } from "../constants/contract-features";
|
||||||
import { NATIVE_TOKENS, SUPPORTED_CHAIN_ID } from "../constants/index";
|
|
||||||
import { ContractSource } from "../schema";
|
import { ContractSource } from "../schema";
|
||||||
import { BigNumber, BigNumberish, ethers, providers } from "ethers";
|
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
|
* @internal
|
||||||
* @param publishMetadataUri
|
* @param publishMetadataUri
|
||||||
* @param storage
|
* @param storage
|
||||||
|
|||||||
@@ -74,10 +74,7 @@ async function getDomainSeperator(signer: Signer, contractAddress: string) {
|
|||||||
try {
|
try {
|
||||||
return await contract.getDomainSeperator();
|
return await contract.getDomainSeperator();
|
||||||
} catch (err2) {
|
} catch (err2) {
|
||||||
console.error(
|
console.error("Error getting domain separator", err2);
|
||||||
'Error getting domain separator',
|
|
||||||
err2
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,7 +258,6 @@ export class ShardedMerkleTree {
|
|||||||
sort: true,
|
sort: true,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("No merkle entry found for address", address);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ type DropContract = Extract<
|
|||||||
"nft-drop" | "token-drop" | "edition-drop" | "signature-drop"
|
"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<
|
export const APPROVED_IMPLEMENTATIONS: Record<
|
||||||
SUPPORTED_CHAIN_ID,
|
SUPPORTED_CHAIN_ID,
|
||||||
Record<DropContract, string>
|
Record<DropContract, string>
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export const EditionDropInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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);
|
const contractInfo = await getContractInfo(address, provider);
|
||||||
return !contractInfo || contractInfo.version > 2
|
return !contractInfo || contractInfo.version > 2
|
||||||
? (await import("@thirdweb-dev/contracts-js/dist/abis/DropERC1155.json"))
|
? (await import("@thirdweb-dev/contracts-js/dist/abis/DropERC1155.json"))
|
||||||
@@ -117,7 +117,7 @@ export const EditionInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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 (
|
return (
|
||||||
await import("@thirdweb-dev/contracts-js/dist/abis/TokenERC1155.json")
|
await import("@thirdweb-dev/contracts-js/dist/abis/TokenERC1155.json")
|
||||||
).default;
|
).default;
|
||||||
@@ -158,7 +158,7 @@ export const MarketplaceInitializer = {
|
|||||||
return 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 (
|
return (
|
||||||
await import("@thirdweb-dev/contracts-js/dist/abis/Marketplace.json")
|
await import("@thirdweb-dev/contracts-js/dist/abis/Marketplace.json")
|
||||||
).default;
|
).default;
|
||||||
@@ -199,7 +199,7 @@ export const MarketplaceV3Initializer = {
|
|||||||
return await getCompositePluginABI(address, abi, provider, {}, storage);
|
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 = (
|
const localAbi = (
|
||||||
await import("@thirdweb-dev/contracts-js/dist/abis/MarketplaceV3.json")
|
await import("@thirdweb-dev/contracts-js/dist/abis/MarketplaceV3.json")
|
||||||
).default;
|
).default;
|
||||||
@@ -246,7 +246,7 @@ export const MultiwrapInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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"))
|
return (await import("@thirdweb-dev/contracts-js/dist/abis/Multiwrap.json"))
|
||||||
.default;
|
.default;
|
||||||
},
|
},
|
||||||
@@ -286,7 +286,7 @@ export const NFTCollectionInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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 (
|
return (
|
||||||
await import("@thirdweb-dev/contracts-js/dist/abis/TokenERC721.json")
|
await import("@thirdweb-dev/contracts-js/dist/abis/TokenERC721.json")
|
||||||
).default;
|
).default;
|
||||||
@@ -326,7 +326,7 @@ export const NFTDropInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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);
|
const contractInfo = await getContractInfo(address, provider);
|
||||||
return !contractInfo || contractInfo.version > 3
|
return !contractInfo || contractInfo.version > 3
|
||||||
? (await import("@thirdweb-dev/contracts-js/dist/abis/DropERC721.json"))
|
? (await import("@thirdweb-dev/contracts-js/dist/abis/DropERC721.json"))
|
||||||
@@ -373,7 +373,7 @@ export const PackInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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"))
|
return (await import("@thirdweb-dev/contracts-js/dist/abis/Pack.json"))
|
||||||
.default;
|
.default;
|
||||||
},
|
},
|
||||||
@@ -413,7 +413,7 @@ export const SignatureDropInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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);
|
const contractInfo = await getContractInfo(address, provider);
|
||||||
return !contractInfo || contractInfo.version > 4
|
return !contractInfo || contractInfo.version > 4
|
||||||
? (
|
? (
|
||||||
@@ -463,7 +463,7 @@ export const SplitInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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"))
|
return (await import("@thirdweb-dev/contracts-js/dist/abis/Split.json"))
|
||||||
.default;
|
.default;
|
||||||
},
|
},
|
||||||
@@ -503,7 +503,7 @@ export const TokenDropInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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);
|
const contractInfo = await getContractInfo(address, provider);
|
||||||
return !contractInfo || contractInfo.version > 2
|
return !contractInfo || contractInfo.version > 2
|
||||||
? (await import("@thirdweb-dev/contracts-js/dist/abis/DropERC20.json"))
|
? (await import("@thirdweb-dev/contracts-js/dist/abis/DropERC20.json"))
|
||||||
@@ -546,7 +546,7 @@ export const TokenInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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 (
|
return (
|
||||||
await import("@thirdweb-dev/contracts-js/dist/abis/TokenERC20.json")
|
await import("@thirdweb-dev/contracts-js/dist/abis/TokenERC20.json")
|
||||||
).default;
|
).default;
|
||||||
@@ -587,7 +587,7 @@ export const VoteInitializer = {
|
|||||||
if (abi) {
|
if (abi) {
|
||||||
return 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"))
|
return (await import("@thirdweb-dev/contracts-js/dist/abis/VoteERC20.json"))
|
||||||
.default;
|
.default;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
import { getDeployArguments } from "../../common/deploy";
|
|
||||||
import {
|
import {
|
||||||
extractConstructorParamsFromAbi,
|
extractConstructorParamsFromAbi,
|
||||||
extractFunctionParamsFromAbi,
|
extractFunctionParamsFromAbi,
|
||||||
fetchExtendedReleaseMetadata,
|
fetchExtendedReleaseMetadata,
|
||||||
fetchPreDeployMetadata,
|
fetchPreDeployMetadata,
|
||||||
} from "../../common/index";
|
} from "../../common";
|
||||||
import { ChainId, EventType, getNativeTokenByChainId } from "../../constants";
|
import { getDeployArguments } from "../../common/deploy";
|
||||||
import { getContractAddressByChainId } from "../../constants/addresses";
|
import {
|
||||||
|
ChainId,
|
||||||
|
EventType,
|
||||||
|
getContractAddressByChainId,
|
||||||
|
getNativeTokenByChainId,
|
||||||
|
} from "../../constants";
|
||||||
import {
|
import {
|
||||||
EditionDropInitializer,
|
EditionDropInitializer,
|
||||||
EditionInitializer,
|
EditionInitializer,
|
||||||
@@ -24,9 +28,12 @@ import {
|
|||||||
TokenInitializer,
|
TokenInitializer,
|
||||||
VoteInitializer,
|
VoteInitializer,
|
||||||
} from "../../contracts";
|
} from "../../contracts";
|
||||||
import { SDKOptions } from "../../schema/sdk-options";
|
import { SDKOptions } from "../../schema";
|
||||||
import { DeployEvent, DeployEvents } from "../../types";
|
|
||||||
import {
|
import {
|
||||||
|
DeployEvent,
|
||||||
|
DeployEvents,
|
||||||
|
DeployMetadata,
|
||||||
|
DeployOptions,
|
||||||
MarketplaceContractDeployMetadata,
|
MarketplaceContractDeployMetadata,
|
||||||
MarketplaceV3ContractDeployMetadata,
|
MarketplaceV3ContractDeployMetadata,
|
||||||
MultiwrapContractDeployMetadata,
|
MultiwrapContractDeployMetadata,
|
||||||
@@ -34,11 +41,7 @@ import {
|
|||||||
SplitContractDeployMetadata,
|
SplitContractDeployMetadata,
|
||||||
TokenContractDeployMetadata,
|
TokenContractDeployMetadata,
|
||||||
VoteContractDeployMetadata,
|
VoteContractDeployMetadata,
|
||||||
} from "../../types/deploy/deploy-metadata";
|
} from "../../types";
|
||||||
import {
|
|
||||||
DeployMetadata,
|
|
||||||
DeployOptions,
|
|
||||||
} from "../../types/deploy/deploy-options";
|
|
||||||
import { ThirdwebSDK } from "../sdk";
|
import { ThirdwebSDK } from "../sdk";
|
||||||
import {
|
import {
|
||||||
ContractType,
|
ContractType,
|
||||||
@@ -477,7 +480,7 @@ export class ContractDeployer extends RPCConnectionHandler {
|
|||||||
return deployedAddress;
|
return deployedAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For all other chains, fetch from released contracts
|
// For all other chains, fetch from published contracts
|
||||||
// resolve contract name from type
|
// resolve contract name from type
|
||||||
const contractName = getContractName(contractType);
|
const contractName = getContractName(contractType);
|
||||||
invariant(contractName, "Contract name not found");
|
invariant(contractName, "Contract name not found");
|
||||||
@@ -492,15 +495,15 @@ export class ContractDeployer extends RPCConnectionHandler {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const activeChainId = (await this.getProvider().getNetwork()).chainId;
|
const activeChainId = (await this.getProvider().getNetwork()).chainId;
|
||||||
// fetch the release URI from the ContractPublisher contract
|
// fetch the publish URI from the ContractPublisher contract
|
||||||
const release = await this.fetchReleaseFromPolygon(
|
const publishedContract = await this.fetchPublishedContractFromPolygon(
|
||||||
THIRDWEB_DEPLOYER,
|
THIRDWEB_DEPLOYER,
|
||||||
contractName,
|
contractName,
|
||||||
version,
|
version,
|
||||||
);
|
);
|
||||||
// fetch the deploy metadata from the release URI
|
// fetch the deploy metadata from the publish URI
|
||||||
const deployMeta = await this.fetchAndCacheDeployMetadata(
|
const deployMeta = await this.fetchAndCacheDeployMetadata(
|
||||||
release.metadataUri,
|
publishedContract.metadataUri,
|
||||||
);
|
);
|
||||||
let implementationAddress =
|
let implementationAddress =
|
||||||
deployMeta.extendedMetadata?.factoryDeploymentData
|
deployMeta.extendedMetadata?.factoryDeploymentData
|
||||||
@@ -508,11 +511,11 @@ export class ContractDeployer extends RPCConnectionHandler {
|
|||||||
|
|
||||||
if (implementationAddress) {
|
if (implementationAddress) {
|
||||||
// implementation exists on the current chain, continue with normal flow
|
// implementation exists on the current chain, continue with normal flow
|
||||||
return this.deployContractFromUri(release.metadataUri, constructorParams);
|
return this.deployContractFromUri(publishedContract.metadataUri, constructorParams);
|
||||||
} else {
|
} else {
|
||||||
// implementation does NOT exist on chain, deploy the implementation first, then deploy a proxy
|
// implementation does NOT exist on chain, deploy the implementation first, then deploy a proxy
|
||||||
implementationAddress = await this.deployContractFromUri(
|
implementationAddress = await this.deployContractFromUri(
|
||||||
release.metadataUri,
|
publishedContract.metadataUri,
|
||||||
this.getConstructorParamsForImplementation(contractType, activeChainId),
|
this.getConstructorParamsForImplementation(contractType, activeChainId),
|
||||||
{
|
{
|
||||||
forceDirectDeploy: true,
|
forceDirectDeploy: true,
|
||||||
@@ -542,25 +545,25 @@ export class ContractDeployer extends RPCConnectionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deploy any released contract by its name
|
* Deploy any published contract by its name
|
||||||
* @param releaserAddress the address of the releaser
|
* @param publisherAddress the address of the publisher
|
||||||
* @param contractName the name of the contract to deploy
|
* @param contractName the name of the contract to deploy
|
||||||
* @param constructorParams the constructor params to pass to the contract
|
* @param constructorParams the constructor params to pass to the contract
|
||||||
*/
|
*/
|
||||||
public async deployReleasedContract(
|
public async deployReleasedContract(
|
||||||
releaserAddress: string,
|
publisherAddress: string,
|
||||||
contractName: string,
|
contractName: string,
|
||||||
constructorParams: any[],
|
constructorParams: any[],
|
||||||
version = "latest",
|
version = "latest",
|
||||||
options?: DeployOptions,
|
options?: DeployOptions,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const release = await this.fetchReleaseFromPolygon(
|
const publishedContract = await this.fetchPublishedContractFromPolygon(
|
||||||
releaserAddress,
|
publisherAddress,
|
||||||
contractName,
|
contractName,
|
||||||
version,
|
version,
|
||||||
);
|
);
|
||||||
return await this.deployContractFromUri(
|
return await this.deployContractFromUri(
|
||||||
release.metadataUri,
|
publishedContract.metadataUri,
|
||||||
constructorParams,
|
constructorParams,
|
||||||
options,
|
options,
|
||||||
);
|
);
|
||||||
@@ -896,20 +899,20 @@ export class ContractDeployer extends RPCConnectionHandler {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async fetchReleaseFromPolygon(
|
private async fetchPublishedContractFromPolygon(
|
||||||
releaserAddress: string,
|
publisherAddress: string,
|
||||||
contractName: string,
|
contractName: string,
|
||||||
version: string,
|
version: string,
|
||||||
) {
|
) {
|
||||||
const release = await new ThirdwebSDK("polygon")
|
const publishedContract = await new ThirdwebSDK("polygon")
|
||||||
.getPublisher()
|
.getPublisher()
|
||||||
.getVersion(releaserAddress, contractName, version);
|
.getVersion(publisherAddress, contractName, version);
|
||||||
if (!release) {
|
if (!publishedContract) {
|
||||||
throw new Error(
|
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(
|
private getConstructorParamsForImplementation(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { EventType } from "../../constants";
|
import { EventType } from "../../constants";
|
||||||
import { ContractEvent, EventQueryOptions } from "../../types/index";
|
import { ContractEvent, EventQueryOptions } from "../../types";
|
||||||
import { ContractWrapper } from "./contract-wrapper";
|
import { ContractWrapper } from "./contract-wrapper";
|
||||||
import { EventFragment } from "@ethersproject/abi";
|
import { EventFragment } from "@ethersproject/abi";
|
||||||
import { BaseContract, Event, providers } from "ethers";
|
import { BaseContract, Event, providers } from "ethers";
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import {
|
|||||||
fetchPreDeployMetadata,
|
fetchPreDeployMetadata,
|
||||||
fetchRawPredeployMetadata,
|
fetchRawPredeployMetadata,
|
||||||
fetchSourceFilesFromMetadata,
|
fetchSourceFilesFromMetadata,
|
||||||
|
isIncrementalVersion,
|
||||||
resolveContractUriFromAddress,
|
resolveContractUriFromAddress,
|
||||||
} from "../../common";
|
} from "../../common";
|
||||||
import { isIncrementalVersion } from "../../common/version-checker";
|
|
||||||
import { getContractPublisherAddress } from "../../constants";
|
import { getContractPublisherAddress } from "../../constants";
|
||||||
import {
|
import {
|
||||||
AbiFunction,
|
AbiFunction,
|
||||||
@@ -24,8 +24,8 @@ import {
|
|||||||
PublishedContract,
|
PublishedContract,
|
||||||
PublishedContractFetched,
|
PublishedContractFetched,
|
||||||
PublishedContractSchema,
|
PublishedContractSchema,
|
||||||
} from "../../schema/contracts/custom";
|
SDKOptions,
|
||||||
import { SDKOptions } from "../../schema/sdk-options";
|
} from "../../schema";
|
||||||
import { NetworkInput, TransactionResult } from "../types";
|
import { NetworkInput, TransactionResult } from "../types";
|
||||||
import { ContractWrapper } from "./contract-wrapper";
|
import { ContractWrapper } from "./contract-wrapper";
|
||||||
import { RPCConnectionHandler } from "./rpc-connection-handler";
|
import { RPCConnectionHandler } from "./rpc-connection-handler";
|
||||||
@@ -309,7 +309,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
(metadata) => metadata.publishedMetadata.version === version,
|
(metadata) => metadata.publishedMetadata.version === version,
|
||||||
);
|
);
|
||||||
invariant(versionMatch, "Contract version not found");
|
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(
|
return allVersions.find(
|
||||||
(contract) => contract.timestamp === versionMatch.publishedTimestamp,
|
(contract) => contract.timestamp === versionMatch.publishedTimestamp,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { TransactionResult, TransactionResultWithId } from "..";
|
||||||
import {
|
import {
|
||||||
CommonNFTInput,
|
CommonNFTInput,
|
||||||
NFTMetadata,
|
NFTMetadata,
|
||||||
@@ -9,13 +10,11 @@ import {
|
|||||||
getBaseUriFromBatch,
|
getBaseUriFromBatch,
|
||||||
} from "../../common/nft";
|
} from "../../common/nft";
|
||||||
import { FeatureName } from "../../constants/contract-features";
|
import { FeatureName } from "../../constants/contract-features";
|
||||||
import { BatchToReveal } from "../../types/delayed-reveal";
|
import { BatchToReveal, UploadProgressEvent } from "../../types";
|
||||||
import {
|
import {
|
||||||
BaseDelayedRevealERC1155,
|
BaseDelayedRevealERC1155,
|
||||||
BaseDelayedRevealERC721,
|
BaseDelayedRevealERC721,
|
||||||
} from "../../types/eips";
|
} from "../../types/eips";
|
||||||
import { UploadProgressEvent } from "../../types/events";
|
|
||||||
import { TransactionResult, TransactionResultWithId } from "../index";
|
|
||||||
import { ContractWrapper } from "./contract-wrapper";
|
import { ContractWrapper } from "./contract-wrapper";
|
||||||
import type {
|
import type {
|
||||||
DropERC721_V3,
|
DropERC721_V3,
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import { includesErrorMessage } from "../../common";
|
import { TransactionResult, TransactionTask } from "..";
|
||||||
|
import {
|
||||||
|
detectContractFeature,
|
||||||
|
hasFunction,
|
||||||
|
includesErrorMessage,
|
||||||
|
} from "../../common";
|
||||||
import {
|
import {
|
||||||
abstractContractModelToLegacy,
|
abstractContractModelToLegacy,
|
||||||
abstractContractModelToNew,
|
abstractContractModelToNew,
|
||||||
@@ -11,10 +16,6 @@ import {
|
|||||||
updateExistingClaimConditions,
|
updateExistingClaimConditions,
|
||||||
} from "../../common/claim-conditions";
|
} from "../../common/claim-conditions";
|
||||||
import { isNativeToken } from "../../common/currency";
|
import { isNativeToken } from "../../common/currency";
|
||||||
import {
|
|
||||||
detectContractFeature,
|
|
||||||
hasFunction,
|
|
||||||
} from "../../common/feature-detection";
|
|
||||||
import { SnapshotFormatVersion } from "../../common/sharded-merkle-tree";
|
import { SnapshotFormatVersion } from "../../common/sharded-merkle-tree";
|
||||||
import { isNode } from "../../common/utils";
|
import { isNode } from "../../common/utils";
|
||||||
import { ClaimEligibility } from "../../enums";
|
import { ClaimEligibility } from "../../enums";
|
||||||
@@ -34,7 +35,6 @@ import {
|
|||||||
BaseClaimConditionERC1155,
|
BaseClaimConditionERC1155,
|
||||||
PrebuiltEditionDrop,
|
PrebuiltEditionDrop,
|
||||||
} from "../../types/eips";
|
} from "../../types/eips";
|
||||||
import { TransactionResult, TransactionTask } from "../index";
|
|
||||||
import { ContractMetadata } from "./contract-metadata";
|
import { ContractMetadata } from "./contract-metadata";
|
||||||
import { ContractWrapper } from "./contract-wrapper";
|
import { ContractWrapper } from "./contract-wrapper";
|
||||||
import type {
|
import type {
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import {
|
|||||||
FEATURE_NFT_TIERED_DROP,
|
FEATURE_NFT_TIERED_DROP,
|
||||||
FEATURE_NFT_SIGNATURE_MINTABLE_V2,
|
FEATURE_NFT_SIGNATURE_MINTABLE_V2,
|
||||||
} from "../../constants/erc721-features";
|
} from "../../constants/erc721-features";
|
||||||
|
import { ClaimOptions, UploadProgressEvent } from "../../types";
|
||||||
import { BaseDropERC721, BaseERC721 } from "../../types/eips";
|
import { BaseDropERC721, BaseERC721 } from "../../types/eips";
|
||||||
import { ClaimOptions, UploadProgressEvent } from "../../types/index";
|
|
||||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||||
import { UpdateableNetwork } from "../interfaces/contract";
|
import { UpdateableNetwork } from "../interfaces/contract";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { fetchCurrencyValue } from "../common/currency";
|
import { fetchCurrencyValue } from "../common";
|
||||||
import { getCompositePluginABI } from "../common/plugin";
|
import { getCompositePluginABI } from "../common/plugin";
|
||||||
import { getChainProvider, NATIVE_TOKEN_ADDRESS } from "../constants";
|
import { getChainProvider, NATIVE_TOKEN_ADDRESS } from "../constants";
|
||||||
import {
|
import {
|
||||||
@@ -6,10 +6,9 @@ import {
|
|||||||
PREBUILT_CONTRACTS_MAP,
|
PREBUILT_CONTRACTS_MAP,
|
||||||
} from "../contracts";
|
} from "../contracts";
|
||||||
import { SmartContract } from "../contracts/smart-contract";
|
import { SmartContract } from "../contracts/smart-contract";
|
||||||
import { AbiSchema } from "../schema";
|
import { AbiSchema, SDKOptions } from "../schema";
|
||||||
import { SDKOptions } from "../schema/sdk-options";
|
import { ContractWithMetadata, CurrencyValue } from "../types";
|
||||||
import { ContractWithMetadata, CurrencyValue } from "../types/index";
|
import { ContractDeployer } from "./classes";
|
||||||
import { ContractDeployer } from "./classes/contract-deployer";
|
|
||||||
import { ContractPublisher } from "./classes/contract-publisher";
|
import { ContractPublisher } from "./classes/contract-publisher";
|
||||||
import { MultichainRegistry } from "./classes/multichain-registry";
|
import { MultichainRegistry } from "./classes/multichain-registry";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -66,13 +66,22 @@ export class StaticJsonRpcBatchProvider extends providers.StaticJsonRpcProvider
|
|||||||
// on whether it was a success or error
|
// on whether it was a success or error
|
||||||
batch.forEach((inflightRequest_, index) => {
|
batch.forEach((inflightRequest_, index) => {
|
||||||
const payload = result[index];
|
const payload = result[index];
|
||||||
if (payload.error) {
|
|
||||||
const error = new Error(payload.error.message);
|
// there may *not* be a payload for a given request (typically RPC error level)
|
||||||
(error as any).code = payload.error.code;
|
if (payload) {
|
||||||
(error as any).data = payload.error.data;
|
// if there is a payload, check for an error
|
||||||
inflightRequest_.reject(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 {
|
} 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 { FileOrBufferOrStringSchema } from "../../../core/schema/shared";
|
||||||
import { toSemver } from "../../common/index";
|
import { toSemver } from "../../common";
|
||||||
import {
|
import {
|
||||||
AddressSchema,
|
AddressSchema,
|
||||||
BigNumberishSchema,
|
BigNumberishSchema,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export * from "./programs/token";
|
|||||||
// sdk
|
// sdk
|
||||||
export * from "./sdk";
|
export * from "./sdk";
|
||||||
// types
|
// types
|
||||||
export * from "./types/index";
|
export * from "./types";
|
||||||
export * from "./types/common";
|
export * from "./types/common";
|
||||||
export * from "./types/programs";
|
export * from "./types/programs";
|
||||||
export * from "./types/programs/nft-drop";
|
export * from "./types/programs/nft-drop";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ThirdwebSDK } from "../sdk";
|
import { ThirdwebSDK } from "../sdk";
|
||||||
import { Network } from "../types/index";
|
import { Network } from "../types";
|
||||||
import { getPayer } from "./local-config";
|
import { getPayer } from "./local-config";
|
||||||
import { KeypairSigner } from "@metaplex-foundation/js";
|
import { KeypairSigner } from "@metaplex-foundation/js";
|
||||||
import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { getRpcUrl } from "../../core/constants/urls";
|
import { getRpcUrl } from "../../core/constants/urls";
|
||||||
import { Network } from "../types/index";
|
import { Network } from "../types";
|
||||||
import { Metaplex } from "@metaplex-foundation/js";
|
import { Metaplex } from "@metaplex-foundation/js";
|
||||||
import { Cluster, clusterApiUrl } from "@solana/web3.js";
|
import { Cluster, clusterApiUrl } from "@solana/web3.js";
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
EditionDropInitializer,
|
EditionDropInitializer,
|
||||||
EditionInitializer,
|
EditionInitializer,
|
||||||
getNativeTokenByChainId,
|
getNativeTokenByChainId,
|
||||||
LOCAL_NODE_PKEY,
|
|
||||||
MarketplaceInitializer,
|
MarketplaceInitializer,
|
||||||
MultiwrapInitializer,
|
MultiwrapInitializer,
|
||||||
NFTCollectionInitializer,
|
NFTCollectionInitializer,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { NFTMetadata, NFTMetadataInput } from "../../src/core/schema/nft";
|
import { NFTMetadataInput, NFTMetadataOrUri } from "../../src/core/schema/nft";
|
||||||
import {
|
import {
|
||||||
ClaimEligibility,
|
ClaimEligibility,
|
||||||
EditionDrop,
|
EditionDrop,
|
||||||
@@ -6,12 +6,11 @@ import {
|
|||||||
NATIVE_TOKEN_ADDRESS,
|
NATIVE_TOKEN_ADDRESS,
|
||||||
TokenInitializer,
|
TokenInitializer,
|
||||||
} from "../../src/evm";
|
} from "../../src/evm";
|
||||||
import { expectError, sdk, signers, storage } from "./before-setup";
|
import { expectError, sdk, signers } from "./before-setup";
|
||||||
import { AddressZero } from "@ethersproject/constants";
|
import { AddressZero } from "@ethersproject/constants";
|
||||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||||
import { DropERC1155_V2__factory } from "@thirdweb-dev/contracts-js";
|
|
||||||
import { assert, expect, use } from "chai";
|
import { assert, expect, use } from "chai";
|
||||||
import { BigNumber, ethers } from "ethers";
|
import { BigNumber } from "ethers";
|
||||||
import invariant from "tiny-invariant";
|
import invariant from "tiny-invariant";
|
||||||
|
|
||||||
global.fetch = require("cross-fetch");
|
global.fetch = require("cross-fetch");
|
||||||
@@ -74,7 +73,6 @@ describe("Edition Drop Contract (V2)", async () => {
|
|||||||
1,
|
1,
|
||||||
);
|
);
|
||||||
const cost2 = await claimTx.estimateGasCostInEther();
|
const cost2 = await claimTx.estimateGasCostInEther();
|
||||||
console.log("cost2", cost2);
|
|
||||||
expect(parseFloat(cost2)).gt(0);
|
expect(parseFloat(cost2)).gt(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -117,7 +115,7 @@ describe("Edition Drop Contract (V2)", async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("comprehensive test with allowlist", async () => {
|
it("comprehensive test with allowlist", async () => {
|
||||||
const metadata = [];
|
const metadata: NFTMetadataOrUri[] = [];
|
||||||
for (let i = 0; i < 6; i++) {
|
for (let i = 0; i < 6; i++) {
|
||||||
metadata.push({ name: `test${i}`, description: `desc${i}` });
|
metadata.push({ name: `test${i}`, description: `desc${i}` });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ import {
|
|||||||
import { sdk, signers } from "./before-setup";
|
import { sdk, signers } from "./before-setup";
|
||||||
import { AddressZero } from "@ethersproject/constants";
|
import { AddressZero } from "@ethersproject/constants";
|
||||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||||
import {
|
import { MockContractPublisher__factory } from "@thirdweb-dev/contracts-js";
|
||||||
MockContractPublisher__factory,
|
|
||||||
TWFactory__factory,
|
|
||||||
} from "@thirdweb-dev/contracts-js";
|
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import { ethers } from "ethers";
|
import { ethers } from "ethers";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable turbo/no-undeclared-env-vars */
|
/* eslint-disable turbo/no-undeclared-env-vars */
|
||||||
import { ThirdwebSDK } from "../../src/evm";
|
import { ThirdwebSDK } from "../../src/evm";
|
||||||
import { assert, expect } from "chai";
|
import { assert } from "chai";
|
||||||
import { ethers, Wallet } from "ethers";
|
import { ethers, Wallet } from "ethers";
|
||||||
|
|
||||||
const RPC_URL = "https://rpc-mumbai.maticvigil.com/";
|
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 () => {
|
it.skip("should use sdk with openzeppelin defender", async () => {
|
||||||
const NFT_COLLECTION_ADDRESS = "0x24A5aB2878B63716B001aa9AbE816c2662192B12";
|
|
||||||
const provider = ethers.getDefaultProvider(RPC_URL);
|
const provider = ethers.getDefaultProvider(RPC_URL);
|
||||||
const wallet = Wallet.createRandom().connect(provider);
|
const wallet = Wallet.createRandom().connect(provider);
|
||||||
const sdk = new ThirdwebSDK(wallet, {
|
const sdk = new ThirdwebSDK(wallet, {
|
||||||
|
|||||||
@@ -172,7 +172,6 @@ describe("Marketplace V3", async () => {
|
|||||||
endTimestamp: Date = new Date(
|
endTimestamp: Date = new Date(
|
||||||
startTimestamp.getTime() + 5 * 24 * 60 * 60 * 1000,
|
startTimestamp.getTime() + 5 * 24 * 60 * 60 * 1000,
|
||||||
),
|
),
|
||||||
reservePricePerToken = 0.05,
|
|
||||||
): Promise<BigNumber> => {
|
): Promise<BigNumber> => {
|
||||||
return (
|
return (
|
||||||
await marketplaceContract.englishAuctions.createAuction({
|
await marketplaceContract.englishAuctions.createAuction({
|
||||||
@@ -789,7 +788,7 @@ describe("Marketplace V3", async () => {
|
|||||||
|
|
||||||
it("should distribute the tokens when an auction closes", async () => {
|
it("should distribute the tokens when an auction closes", async () => {
|
||||||
await sdk.updateSignerOrProvider(adminWallet);
|
await sdk.updateSignerOrProvider(adminWallet);
|
||||||
const auctionId = (
|
const auctionId2 = (
|
||||||
await marketplaceContract.englishAuctions.createAuction({
|
await marketplaceContract.englishAuctions.createAuction({
|
||||||
assetContractAddress: dummyNftContract.getAddress(),
|
assetContractAddress: dummyNftContract.getAddress(),
|
||||||
tokenId: "2",
|
tokenId: "2",
|
||||||
@@ -806,7 +805,7 @@ describe("Marketplace V3", async () => {
|
|||||||
|
|
||||||
await sdk.updateSignerOrProvider(bobWallet);
|
await sdk.updateSignerOrProvider(bobWallet);
|
||||||
|
|
||||||
await marketplaceContract.englishAuctions.makeBid(auctionId, 2);
|
await marketplaceContract.englishAuctions.makeBid(auctionId2, 2);
|
||||||
|
|
||||||
await fastForwardTime(60 * 60 * 24);
|
await fastForwardTime(60 * 60 * 24);
|
||||||
|
|
||||||
@@ -820,7 +819,7 @@ describe("Marketplace V3", async () => {
|
|||||||
"The buyer should have no tokens to start",
|
"The buyer should have no tokens to start",
|
||||||
);
|
);
|
||||||
await marketplaceContract.englishAuctions.closeAuctionForBidder(
|
await marketplaceContract.englishAuctions.closeAuctionForBidder(
|
||||||
auctionId,
|
auctionId2,
|
||||||
);
|
);
|
||||||
|
|
||||||
const balance = await dummyNftContract.balanceOf(bobWallet.address);
|
const balance = await dummyNftContract.balanceOf(bobWallet.address);
|
||||||
@@ -844,7 +843,7 @@ describe("Marketplace V3", async () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await marketplaceContract.englishAuctions.closeAuctionForSeller(
|
await marketplaceContract.englishAuctions.closeAuctionForSeller(
|
||||||
auctionId,
|
auctionId2,
|
||||||
);
|
);
|
||||||
|
|
||||||
const newTokenBalance = await customTokenContract.balanceOf(
|
const newTokenBalance = await customTokenContract.balanceOf(
|
||||||
@@ -917,8 +916,6 @@ describe("Marketplace V3", async () => {
|
|||||||
"0",
|
"0",
|
||||||
"The buyer should start with no tokens",
|
"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(
|
await marketplaceContract.directListings.buyFromListing(
|
||||||
directListingId,
|
directListingId,
|
||||||
@@ -934,10 +931,10 @@ describe("Marketplace V3", async () => {
|
|||||||
|
|
||||||
it("should allow offers to be made for listed tokens", async () => {
|
it("should allow offers to be made for listed tokens", async () => {
|
||||||
sdk.updateSignerOrProvider(bobWallet);
|
sdk.updateSignerOrProvider(bobWallet);
|
||||||
const bobOfferId = await makeOffer(dummyNftContract.getAddress(), 0, 1);
|
await makeOffer(dummyNftContract.getAddress(), 0, 1);
|
||||||
|
|
||||||
sdk.updateSignerOrProvider(samWallet);
|
sdk.updateSignerOrProvider(samWallet);
|
||||||
const samOfferId = await makeOffer(dummyNftContract.getAddress(), 0, 1);
|
await makeOffer(dummyNftContract.getAddress(), 0, 1);
|
||||||
|
|
||||||
let offers = await marketplaceContract.offers.getAll({
|
let offers = await marketplaceContract.offers.getAll({
|
||||||
start: 0,
|
start: 0,
|
||||||
@@ -969,11 +966,11 @@ describe("Marketplace V3", async () => {
|
|||||||
it("should return all offers for a token when queried", async () => {
|
it("should return all offers for a token when queried", async () => {
|
||||||
// make an offer as bob
|
// make an offer as bob
|
||||||
sdk.updateSignerOrProvider(bobWallet);
|
sdk.updateSignerOrProvider(bobWallet);
|
||||||
const bobOfferId = await makeOffer(dummyNftContract.getAddress(), 0, 1);
|
await makeOffer(dummyNftContract.getAddress(), 0, 1);
|
||||||
|
|
||||||
// make an offer as sam
|
// make an offer as sam
|
||||||
sdk.updateSignerOrProvider(samWallet);
|
sdk.updateSignerOrProvider(samWallet);
|
||||||
const samOfferId = await makeOffer(dummyNftContract.getAddress(), 0, 1);
|
await makeOffer(dummyNftContract.getAddress(), 0, 1);
|
||||||
|
|
||||||
// fetch all offers for the token
|
// fetch all offers for the token
|
||||||
sdk.updateSignerOrProvider(adminWallet);
|
sdk.updateSignerOrProvider(adminWallet);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { NFTMetadataInput } from "../../src/core/schema/nft";
|
import { NFTMetadataInput, NFTMetadataOrUri } from "../../src/core/schema/nft";
|
||||||
import {
|
import {
|
||||||
ClaimEligibility,
|
ClaimEligibility,
|
||||||
NATIVE_TOKEN_ADDRESS,
|
NATIVE_TOKEN_ADDRESS,
|
||||||
@@ -41,9 +41,9 @@ describe("NFT Drop Contract (v3)", async () => {
|
|||||||
platform_fee_basis_points: 10,
|
platform_fee_basis_points: 10,
|
||||||
platform_fee_recipient: AddressZero,
|
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 () => {
|
it("should lazy mint with URI", async () => {
|
||||||
@@ -57,7 +57,7 @@ describe("NFT Drop Contract (v3)", async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("comprehensive test", async () => {
|
it("comprehensive test", async () => {
|
||||||
const metadata = [];
|
const metadata: NFTMetadataOrUri[] = [];
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
metadata.push({ name: `test${i}`, description: `desc${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 () => {
|
it("comprehensive test with allowlist", async () => {
|
||||||
const metadata = [];
|
const metadata: NFTMetadataOrUri[] = [];
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
metadata.push({ name: `test${i}`, description: `desc${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(
|
let proof = await dropContract.claimConditions.getClaimerProofs(
|
||||||
bobWallet.address,
|
bobWallet.address,
|
||||||
);
|
);
|
||||||
expect(proof.address).to.eq(bobWallet.address);
|
expect(proof?.address).to.eq(bobWallet.address);
|
||||||
proof = await dropContract.claimConditions.getClaimerProofs(
|
proof = await dropContract.claimConditions.getClaimerProofs(
|
||||||
bobWallet.address,
|
bobWallet.address,
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
expect(proof.address).to.eq(bobWallet.address);
|
expect(proof?.address).to.eq(bobWallet.address);
|
||||||
proof = await dropContract.claimConditions.getClaimerProofs(
|
proof = await dropContract.claimConditions.getClaimerProofs(
|
||||||
samWallet.address,
|
samWallet.address,
|
||||||
);
|
);
|
||||||
@@ -225,7 +225,7 @@ describe("NFT Drop Contract (v3)", async () => {
|
|||||||
samWallet.address,
|
samWallet.address,
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
expect(proof.address).to.eq(samWallet.address);
|
expect(proof?.address).to.eq(samWallet.address);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return snapshot data on claim conditions", async () => {
|
it("should return snapshot data on claim conditions", async () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { NFTMetadataInput } from "../../src/core/schema/nft";
|
import { NFTMetadataInput, NFTMetadataOrUri } from "../../src/core/schema/nft";
|
||||||
import {
|
import {
|
||||||
ClaimEligibility,
|
ClaimEligibility,
|
||||||
NATIVE_TOKEN_ADDRESS,
|
NATIVE_TOKEN_ADDRESS,
|
||||||
@@ -50,7 +50,7 @@ describe("NFT Drop Contract (v4)", async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("comprehensive test", async () => {
|
it("comprehensive test", async () => {
|
||||||
const metadata = [];
|
const metadata: NFTMetadataOrUri[] = [];
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
metadata.push({ name: `test${i}`, description: `desc${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 () => {
|
it("comprehensive test with allowlist and price override", async () => {
|
||||||
const metadata = [];
|
const metadata: NFTMetadataOrUri[] = [];
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
metadata.push({ name: `test${i}`, description: `desc${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);
|
await dropContract.claim(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("comprehensive test with allowlist", async () => {
|
it("comprehensive test with allowlist", async () => {
|
||||||
const metadata = [];
|
const metadata: NFTMetadataOrUri[] = [];
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
metadata.push({ name: `test${i}`, description: `desc${i}` });
|
metadata.push({ name: `test${i}`, description: `desc${i}` });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { getMultichainRegistryAddress, ThirdwebSDK } from "../../src/evm";
|
|
||||||
import { joinABIs } from "../../src/evm/common/plugin";
|
import { joinABIs } from "../../src/evm/common/plugin";
|
||||||
import { MultichainRegistry } from "../../src/evm/core/classes/multichain-registry";
|
import { MultichainRegistry } from "../../src/evm/core/classes/multichain-registry";
|
||||||
import { ContractRegistry } from "../../src/evm/core/classes/registry";
|
import { ContractRegistry } from "../../src/evm/core/classes/registry";
|
||||||
@@ -22,12 +21,7 @@ describe("Contract Registry", () => {
|
|||||||
|
|
||||||
it("multichain registry", async () => {
|
it("multichain registry", async () => {
|
||||||
sdk.updateSignerOrProvider(adminWallet);
|
sdk.updateSignerOrProvider(adminWallet);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
multichainRegistry = sdk.multiChainRegistry;
|
multichainRegistry = sdk.multiChainRegistry;
|
||||||
console.log(
|
|
||||||
"multichain registry address: ",
|
|
||||||
getMultichainRegistryAddress(),
|
|
||||||
);
|
|
||||||
|
|
||||||
address = await sdk.deployer.deployNFTCollection({
|
address = await sdk.deployer.deployNFTCollection({
|
||||||
name: "Test1",
|
name: "Test1",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import { createSnapshot, SnapshotEntryInput } from "../../src";
|
||||||
import {
|
import {
|
||||||
ShardedMerkleTree,
|
ShardedMerkleTree,
|
||||||
SnapshotFormatVersion,
|
SnapshotFormatVersion,
|
||||||
} from "../../src/evm/common/sharded-merkle-tree";
|
} from "../../src/evm/common/sharded-merkle-tree";
|
||||||
import { createSnapshot, SnapshotEntryInput } from "../../src/evm/index";
|
|
||||||
import { sdk, signers, storage } from "./before-setup";
|
import { sdk, signers, storage } from "./before-setup";
|
||||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||||
import { BigNumber, ethers } from "ethers";
|
import { BigNumber, ethers } from "ethers";
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ describe("Tiered Drop Contract", async () => {
|
|||||||
let claimerWallet: SignerWithAddress;
|
let claimerWallet: SignerWithAddress;
|
||||||
|
|
||||||
async function deployTieredDrop() {
|
async function deployTieredDrop() {
|
||||||
// This needs to match the release for the currently used ABI
|
// This needs to match the published contract for the currently used ABI
|
||||||
const releaseUri =
|
const publishUri =
|
||||||
"ipfs://QmXu9ezFNgXBX1juLZ7kwdf5KpTD1x9GPHnk14QB2NpUvK/0";
|
"ipfs://QmXu9ezFNgXBX1juLZ7kwdf5KpTD1x9GPHnk14QB2NpUvK/0";
|
||||||
const address = await sdk.deployer.deployContractFromUri(releaseUri, [], {
|
const address = await sdk.deployer.deployContractFromUri(publishUri, [], {
|
||||||
forceDirectDeploy: true,
|
forceDirectDeploy: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
TokenDropInitializer,
|
TokenDropInitializer,
|
||||||
TokenInitializer,
|
TokenInitializer,
|
||||||
} from "../../src/evm";
|
} from "../../src/evm";
|
||||||
import { expectError, sdk, signers, storage } from "./before-setup";
|
import { expectError, sdk, signers } from "./before-setup";
|
||||||
import { AddressZero } from "@ethersproject/constants";
|
import { AddressZero } from "@ethersproject/constants";
|
||||||
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
||||||
import { assert, expect } from "chai";
|
import { assert, expect } from "chai";
|
||||||
@@ -39,9 +39,9 @@ describe("Token Drop Contract (v2)", async () => {
|
|||||||
platform_fee_basis_points: 10,
|
platform_fee_basis_points: 10,
|
||||||
platform_fee_recipient: AddressZero,
|
platform_fee_recipient: AddressZero,
|
||||||
},
|
},
|
||||||
2,
|
"2",
|
||||||
);
|
);
|
||||||
dropContract = await sdk.getTokenDrop(address);
|
dropContract = await sdk.getContract(address, "token-drop");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("comprehensive test", async () => {
|
it("comprehensive test", async () => {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ describe("Token Drop Contract (v4)", async () => {
|
|||||||
TokenDropInitializer.contractType,
|
TokenDropInitializer.contractType,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
dropContract = await sdk.getTokenDrop(address);
|
dropContract = await sdk.getContract(address, "token-drop");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should allow a snapshot to be set", async () => {
|
it("should allow a snapshot to be set", async () => {
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @thirdweb-dev/storage
|
# @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
|
## 1.0.9
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/storage",
|
"name": "@thirdweb-dev/storage",
|
||||||
"version": "1.0.9",
|
"version": "1.0.10",
|
||||||
"main": "dist/thirdweb-dev-storage.cjs.js",
|
"main": "dist/thirdweb-dev-storage.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-storage.esm.js",
|
"module": "dist/thirdweb-dev-storage.esm.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
@@ -29,9 +29,6 @@
|
|||||||
"dist/"
|
"dist/"
|
||||||
],
|
],
|
||||||
"preconstruct": {
|
"preconstruct": {
|
||||||
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
|
|
||||||
"exports": true
|
|
||||||
},
|
|
||||||
"exports": true
|
"exports": true
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,5 +1,24 @@
|
|||||||
# @thirdweb-dev/unity-js-bridge
|
# @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
|
## 0.2.9
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/unity-js-bridge",
|
"name": "@thirdweb-dev/unity-js-bridge",
|
||||||
"version": "0.2.9",
|
"version": "0.2.11",
|
||||||
"main": "dist/thirdweb-unity-bridge.js",
|
"main": "dist/thirdweb-unity-bridge.js",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# @thirdweb-dev/wallets
|
# @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.2
|
||||||
|
|
||||||
## 0.2.1
|
## 0.2.1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/wallets",
|
"name": "@thirdweb-dev/wallets",
|
||||||
"version": "0.2.2",
|
"version": "0.2.4",
|
||||||
"main": "dist/thirdweb-dev-wallets.cjs.js",
|
"main": "dist/thirdweb-dev-wallets.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-wallets.esm.js",
|
"module": "dist/thirdweb-dev-wallets.esm.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
@@ -134,9 +134,6 @@
|
|||||||
"solana/index.ts",
|
"solana/index.ts",
|
||||||
"solana/wallets/**"
|
"solana/wallets/**"
|
||||||
],
|
],
|
||||||
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
|
|
||||||
"exports": true
|
|
||||||
},
|
|
||||||
"exports": true
|
"exports": true
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ packages.forEach((pkg) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(packageJson);
|
|
||||||
|
|
||||||
if (!process.env.CI) {
|
if (!process.env.CI) {
|
||||||
console.error(
|
console.error(
|
||||||
`Not in CI, skipping writing package.json for: "${pkg.packageJson.name}"`,
|
`Not in CI, skipping writing package.json for: "${pkg.packageJson.name}"`,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"react-scripts": "^5"
|
"react-scripts": "^5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "react-scripts build",
|
"build": "GENERATE_SOURCEMAP=false react-scripts build",
|
||||||
"e2e": "npx playwright test"
|
"e2e": "npx playwright test"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
|
|||||||
+21
-6
@@ -80,18 +80,33 @@
|
|||||||
"inputs": ["src/**"],
|
"inputs": ["src/**"],
|
||||||
"dependsOn": ["build"]
|
"dependsOn": ["build"]
|
||||||
},
|
},
|
||||||
"e2e:e2e-cra-5": {
|
"e2e-cra-5#build": {
|
||||||
"outputs": ["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/**"],
|
"inputs": ["src/**", "fixtures/**"],
|
||||||
"dependsOn": ["build"]
|
"dependsOn": ["build"]
|
||||||
},
|
},
|
||||||
"e2e:e2e-next-12": {
|
"e2e-next-12#e2e": {
|
||||||
"outputs": [".next"],
|
"outputs": ["playwright-report/**"],
|
||||||
"inputs": ["src/**", "fixtures/**"],
|
"inputs": ["src/**", "fixtures/**"],
|
||||||
"dependsOn": ["build"]
|
"dependsOn": ["build"]
|
||||||
},
|
},
|
||||||
"e2e:e2e-vite-3": {
|
"e2e-vite-3#e2e": {
|
||||||
"outputs": ["dist"],
|
"outputs": ["playwright-report/**"],
|
||||||
"inputs": ["src/**", "fixtures/**"],
|
"inputs": ["src/**", "fixtures/**"],
|
||||||
"dependsOn": ["build"]
|
"dependsOn": ["build"]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user