Skip to content

Commit

Permalink
Merge branch 'main' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsdls authored Jan 17, 2024
2 parents b19a56b + 0efd0f9 commit 0bca9ca
Show file tree
Hide file tree
Showing 57 changed files with 1,511 additions and 105 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-clouds-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/sdk": patch
---

ZkSync Sepolia addresses
5 changes: 5 additions & 0 deletions .changeset/cool-parents-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/react-native": patch
---

Reports only react-nativec
17 changes: 17 additions & 0 deletions .changeset/five-walls-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@thirdweb-dev/react": patch
---

Add prop `switchNetworkBtnTitle` to `ConnectWallet` and `Web3Button` components to allow changing the "Switch Network" label on the button which is displayed when user needs to switch the network in the connected wallet.

```tsx
<ConnectWallet switchNetworkBtnTitle="Switch Chain" />
```

```tsx
<Web3Button
switchNetworkBtnTitle="Switch Chain"
contractAddress="0x..."
action={someAction}
/>
```
5 changes: 5 additions & 0 deletions .changeset/poor-kids-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/chains": patch
---

synced chains package with chains db
33 changes: 33 additions & 0 deletions .changeset/serious-ears-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
"@thirdweb-dev/react": patch
---

add `useSetWalletModalConfig` hook to customize the ConnectWallet Modal to programmatically open the modal without using the `ConnectWallet` component along with `useSetIsWalletModalOpen`

```tsx
import {
useSetWalletModalConfig,
useSetIsWalletModalOpen,
} from "@thirdweb-dev/react";

function Example() {
const setWalletModalConfig = useSetWalletModalConfig();
const setIsWalletModalOpen = useSetIsWalletModalOpen();

return (
<button
onClick={() => {
// customize the modal
setWalletModalConfig({
modalSize: "wide",
theme: "light",
});
// open the modal
setIsWalletModalOpen(true);
}}
>
open connect modal
</button>
);
}
```
24 changes: 24 additions & 0 deletions .changeset/smart-ads-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
"@thirdweb-dev/react-native": patch
---

Exports standalone ConnectEmbed UI

Devs can now show the Connect modal UI directly into their apps.
This component will render the wallets defined in our ThirdwebProvider.

```tsx
<ConnectEmbed
modalTitleIconUrl="<my-icon-url>"
modalTitle="Sign In"
theme={"light"}
onConnect={() => {
console.log("wallet connected");
}}
container={{
paddingVertical: "md",
marginHorizontal: "md",
borderRadius: "md",
}}
/>
```
65 changes: 65 additions & 0 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# On the Version Packages branch
# Generate and Commit the Typedoc JSON files and the Snippets JSON files

name: Commit Release Artifacts

on:
push:
branches:
- changeset-release/main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
release-artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3

# bun setup is required, because pnpm typdoc will run pnpm build and some packages uses bun for build
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.21

- name: Install
uses: ./.github/composite-actions/install

- name: Build
run: pnpm build

- name: Typedoc
run: pnpm typedoc

- name: Generate Docs
run: |
cd packages/sdk
pnpm generate-docs
cd ../react-core
pnpm generate-docs
cd ../react
pnpm generate-docs
cd ../..
- name: Generate Snippets
run: pnpm generate-snippets

- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git status
git add packages/react/typedoc/documentation.json
git add packages/react-core/typedoc/documentation.json
git add packages/sdk/typedoc/documentation.json
git add packages/storage/typedoc/documentation.json
git add packages/wallets/typedoc/documentation.json
git add snippets/feature_snippets_react.json
git add snippets/feature_snippets_sdk.json
git add snippets/snippets.json
git commit -m "Commit Release Artifacts [skip ci]"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 7 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Using CUSTOM_GITHUB_TOKEN instead of GITHUB_TOKEN is required to trigger workflows in "Version Packages" PR created by changesets/action
# CUSTOM_GITHUB_TOKEN should be a PAT with write access to the repo and has to be created and set as a secret in the repo manually

name: Release Nightly & Stable

on:
Expand Down Expand Up @@ -25,6 +28,8 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
# Do not use the GITHUB_TOKEN by default
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

- name: Setup bun
uses: oven-sh/setup-bun@v1
Expand All @@ -46,7 +51,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

- name: Create @nightly release
if: steps.changesets.outputs.published != 'true'
Expand All @@ -56,19 +61,4 @@ jobs:
pnpm release:nightly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate docs
if: steps.changesets.outputs.published == 'true'
run: |
pnpm typedoc
pnpm build
pnpm generate-docs
pnpm generate-snippets
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "doc automation: update JSON files [skip ci]"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"e2e": "turbo run e2e",
"build": "turbo run build --filter=./packages/*",
"typedoc": "turbo run typedoc",
"generate-docs": "turbo run generate-docs",
"generate-snippets": "node ./scripts/generate-snippets/index.mjs",
"build:release": "turbo run build --force --filter=./packages/*",
"dev": "turbo run dev --no-cache --parallel --continue",
Expand Down
2 changes: 1 addition & 1 deletion packages/chains/chains/1001.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export default {
"shortName": "Baobab",
"slip44": 1,
"slug": "klaytn-testnet-baobab",
"testnet": false
"testnet": true
} as const satisfies Chain;
14 changes: 10 additions & 4 deletions packages/chains/chains/11297108099.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ export default {
"chainId": 11297108099,
"explorers": [
{
"name": "Palm Testnet Explorer",
"url": "https://explorer.palm-uat.xyz",
"name": "Chainlens",
"url": "https://testnet.palm.chainlens.com",
"standard": "EIP3091"
},
{
"name": "Dora",
"url": "https://www.ondora.xyz/network/palm-testnet",
"standard": "none"
}
],
"faucets": [],
Expand All @@ -16,7 +21,7 @@ export default {
"height": 72,
"format": "svg"
},
"infoURL": "https://palm.io",
"infoURL": "https://palm.network",
"name": "Palm Testnet",
"nativeCurrency": {
"name": "PALM",
Expand All @@ -27,7 +32,8 @@ export default {
"rpc": [
"https://palm-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://11297108099.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://palm-testnet.infura.io/v3/${INFURA_API_KEY}"
"https://palm-testnet.infura.io/v3/${INFURA_API_KEY}",
"https://palm-testnet.public.blastapi.io"
],
"shortName": "tpalm",
"slip44": 1,
Expand Down
14 changes: 10 additions & 4 deletions packages/chains/chains/11297108109.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ export default {
"chainId": 11297108109,
"explorers": [
{
"name": "Palm Explorer",
"url": "https://explorer.palm.io",
"name": "Chainlens",
"url": "https://palm.chainlens.com",
"standard": "EIP3091"
},
{
"name": "Dora",
"url": "https://www.ondora.xyz/network/palm",
"standard": "none"
}
],
"faucets": [],
Expand All @@ -16,7 +21,7 @@ export default {
"height": 72,
"format": "svg"
},
"infoURL": "https://palm.io",
"infoURL": "https://palm.network",
"name": "Palm",
"nativeCurrency": {
"name": "PALM",
Expand All @@ -27,7 +32,8 @@ export default {
"rpc": [
"https://palm.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://11297108109.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://palm-mainnet.infura.io/v3/${INFURA_API_KEY}"
"https://palm-mainnet.infura.io/v3/${INFURA_API_KEY}",
"https://palm-mainnet.public.blastapi.io"
],
"shortName": "palm",
"slug": "palm",
Expand Down
37 changes: 37 additions & 0 deletions packages/chains/chains/129.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { Chain } from "../src/types";
export default {
"chain": "Jumbo",
"chainId": 129,
"explorers": [
{
"name": "ProtoJumbo",
"url": "https://protojumbo.jumbochain.org",
"standard": "EIP3091"
}
],
"faucets": [
"https://protojumbo.jumbochain.org/faucet-smart"
],
"features": [
{
"name": "EIP155"
}
],
"infoURL": "https://jumbochain.org",
"name": "ProtoJumbo Testnet",
"nativeCurrency": {
"name": "JNFTC",
"symbol": "JNFTC",
"decimals": 18
},
"networkId": 129,
"rpc": [
"https://protojumbo-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://129.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://testnode.jumbochain.org"
],
"shortName": "ProtoJumbo",
"slip44": 1,
"slug": "protojumbo-testnet",
"testnet": true
} as const satisfies Chain;
2 changes: 1 addition & 1 deletion packages/chains/chains/1731313.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
"rpc": [
"https://turkey-demo-dev.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://1731313.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://blockscout-poa.huabeizhenxuan.com"
"https://devchain-poa.huabeizhenxuan.com"
],
"shortName": "TDD",
"slug": "turkey-demo-dev",
Expand Down
31 changes: 31 additions & 0 deletions packages/chains/chains/18303.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 18303,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "Zeroone Testnet",
"nativeCurrency": {
"name": "Zeroone Testnet Token",
"symbol": "ZERO",
"decimals": 18
},
"networkId": 18303,
"redFlags": [],
"rpc": [
"https://zeroone-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://18303.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/zeroonetes/testnet/rpc"
],
"shortName": "Zeroone Testnet",
"slug": "zeroone-testnet",
"testnet": true
} as const satisfies Chain;
Loading

0 comments on commit 0bca9ca

Please sign in to comment.