Skip to content

Commit

Permalink
Merge branch 'main' of github.com:WalletConnect/web3modal into feat/s…
Browse files Browse the repository at this point in the history
…iwx-flow-improvements
  • Loading branch information
zoruka committed Nov 6, 2024
2 parents 0848b21 + eca773b commit ba93925
Show file tree
Hide file tree
Showing 97 changed files with 1,060 additions and 197 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/publish_canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Publish Canary Image
on:
workflow_dispatch:
push:
branches:
- main

concurrency: ${{ github.workflow }}

env:
TERM: linux

jobs:
push:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ECR_DEPLOYER }}
aws-region: ${{ vars.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
mask-password: 'true'

- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build, tag, and push image to Amazon ECR
uses: docker/build-push-action@v5
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: web3modal-canary
IMAGE_TAG: V4
with:
context: .
file: Dockerfile.canary
push: true
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
26 changes: 26 additions & 0 deletions apps/demo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# @apps/demo

## 1.3.0

### Minor Changes

- [#3186](https://github.com/reown-com/appkit/pull/3186) [`41c0292`](https://github.com/reown-com/appkit/commit/41c02928b9171651da705778891c08cac1b3ae19) Thanks [@enesozturk](https://github.com/enesozturk)! - Updates public component names with appkit prefix

### Patch Changes

- [#3188](https://github.com/reown-com/appkit/pull/3188) [`69e8bde`](https://github.com/reown-com/appkit/commit/69e8bdec3276e35a809912053c27828ab49fc964) Thanks [@magiziz](https://github.com/magiziz)! - Improved error handling for auth and universal provider connectors.

- [#3189](https://github.com/reown-com/appkit/pull/3189) [`db30b41`](https://github.com/reown-com/appkit/commit/db30b4160b130295dfd1e3276627f584e27537bd) Thanks [@magiziz](https://github.com/magiziz)! - Fixes an issue where Coinbase Wallet did not reconnect after refreshing the page when using ethers/ethers5 adapters.

- [#3190](https://github.com/reown-com/appkit/pull/3190) [`d9bb0bb`](https://github.com/reown-com/appkit/commit/d9bb0bb86e872cb0b74a0d2114130f09f89e9ac8) Thanks [@magiziz](https://github.com/magiziz)! - Fixes issue where ethers and ethers5 adapters didn't set the proper caip address when switching accounts manually.

- [#3201](https://github.com/reown-com/appkit/pull/3201) [`48cbfbe`](https://github.com/reown-com/appkit/commit/48cbfbeb7831109ee564d67151715336aa445c1e) Thanks [@tomiir](https://github.com/tomiir)! - Adds clientId to all blockchain api requests on a relay connection

- [#3191](https://github.com/reown-com/appkit/pull/3191) [`a3cf602`](https://github.com/reown-com/appkit/commit/a3cf602e95301e91f27970b9901abab382122080) Thanks [@magiziz](https://github.com/magiziz)! - Fixes an issue where email input validation errors broke the button styles.

- [#3203](https://github.com/reown-com/appkit/pull/3203) [`05feaed`](https://github.com/reown-com/appkit/commit/05feaed87c8181987cad508fe4725ca64ba56ab7) Thanks [@tomiir](https://github.com/tomiir)! - Improves SnackBar styles and routes proper relay messages to it on wc-connecting-view

- [#3193](https://github.com/reown-com/appkit/pull/3193) [`56fe99a`](https://github.com/reown-com/appkit/commit/56fe99ad21cd468a0203b5f2b5dd3bd29d9ba020) Thanks [@tomiir](https://github.com/tomiir)! - Improves UX/UI of multi-account screen for embedded wallet

- Updated dependencies [[`69e8bde`](https://github.com/reown-com/appkit/commit/69e8bdec3276e35a809912053c27828ab49fc964), [`db30b41`](https://github.com/reown-com/appkit/commit/db30b4160b130295dfd1e3276627f584e27537bd), [`d9bb0bb`](https://github.com/reown-com/appkit/commit/d9bb0bb86e872cb0b74a0d2114130f09f89e9ac8), [`41c0292`](https://github.com/reown-com/appkit/commit/41c02928b9171651da705778891c08cac1b3ae19), [`48cbfbe`](https://github.com/reown-com/appkit/commit/48cbfbeb7831109ee564d67151715336aa445c1e), [`a3cf602`](https://github.com/reown-com/appkit/commit/a3cf602e95301e91f27970b9901abab382122080), [`05feaed`](https://github.com/reown-com/appkit/commit/05feaed87c8181987cad508fe4725ca64ba56ab7), [`56fe99a`](https://github.com/reown-com/appkit/commit/56fe99ad21cd468a0203b5f2b5dd3bd29d9ba020)]:
- @reown/appkit-adapter-wagmi@1.3.0
- @reown/appkit@1.3.0

## 1.2.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apps/demo",
"version": "1.2.1",
"version": "1.3.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
26 changes: 26 additions & 0 deletions apps/gallery/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# @apps/gallery

## 1.3.0

### Minor Changes

- [#3186](https://github.com/reown-com/appkit/pull/3186) [`41c0292`](https://github.com/reown-com/appkit/commit/41c02928b9171651da705778891c08cac1b3ae19) Thanks [@enesozturk](https://github.com/enesozturk)! - Updates public component names with appkit prefix

### Patch Changes

- [#3188](https://github.com/reown-com/appkit/pull/3188) [`69e8bde`](https://github.com/reown-com/appkit/commit/69e8bdec3276e35a809912053c27828ab49fc964) Thanks [@magiziz](https://github.com/magiziz)! - Improved error handling for auth and universal provider connectors.

- [#3189](https://github.com/reown-com/appkit/pull/3189) [`db30b41`](https://github.com/reown-com/appkit/commit/db30b4160b130295dfd1e3276627f584e27537bd) Thanks [@magiziz](https://github.com/magiziz)! - Fixes an issue where Coinbase Wallet did not reconnect after refreshing the page when using ethers/ethers5 adapters.

- [#3190](https://github.com/reown-com/appkit/pull/3190) [`d9bb0bb`](https://github.com/reown-com/appkit/commit/d9bb0bb86e872cb0b74a0d2114130f09f89e9ac8) Thanks [@magiziz](https://github.com/magiziz)! - Fixes issue where ethers and ethers5 adapters didn't set the proper caip address when switching accounts manually.

- [#3201](https://github.com/reown-com/appkit/pull/3201) [`48cbfbe`](https://github.com/reown-com/appkit/commit/48cbfbeb7831109ee564d67151715336aa445c1e) Thanks [@tomiir](https://github.com/tomiir)! - Adds clientId to all blockchain api requests on a relay connection

- [#3191](https://github.com/reown-com/appkit/pull/3191) [`a3cf602`](https://github.com/reown-com/appkit/commit/a3cf602e95301e91f27970b9901abab382122080) Thanks [@magiziz](https://github.com/magiziz)! - Fixes an issue where email input validation errors broke the button styles.

- [#3203](https://github.com/reown-com/appkit/pull/3203) [`05feaed`](https://github.com/reown-com/appkit/commit/05feaed87c8181987cad508fe4725ca64ba56ab7) Thanks [@tomiir](https://github.com/tomiir)! - Improves SnackBar styles and routes proper relay messages to it on wc-connecting-view

- [#3193](https://github.com/reown-com/appkit/pull/3193) [`56fe99a`](https://github.com/reown-com/appkit/commit/56fe99ad21cd468a0203b5f2b5dd3bd29d9ba020) Thanks [@tomiir](https://github.com/tomiir)! - Improves UX/UI of multi-account screen for embedded wallet

- Updated dependencies [[`69e8bde`](https://github.com/reown-com/appkit/commit/69e8bdec3276e35a809912053c27828ab49fc964), [`db30b41`](https://github.com/reown-com/appkit/commit/db30b4160b130295dfd1e3276627f584e27537bd), [`d9bb0bb`](https://github.com/reown-com/appkit/commit/d9bb0bb86e872cb0b74a0d2114130f09f89e9ac8), [`41c0292`](https://github.com/reown-com/appkit/commit/41c02928b9171651da705778891c08cac1b3ae19), [`48cbfbe`](https://github.com/reown-com/appkit/commit/48cbfbeb7831109ee564d67151715336aa445c1e), [`a3cf602`](https://github.com/reown-com/appkit/commit/a3cf602e95301e91f27970b9901abab382122080), [`05feaed`](https://github.com/reown-com/appkit/commit/05feaed87c8181987cad508fe4725ca64ba56ab7), [`56fe99a`](https://github.com/reown-com/appkit/commit/56fe99ad21cd468a0203b5f2b5dd3bd29d9ba020)]:
- @reown/appkit-common@1.3.0
- @reown/appkit-ui@1.3.0

## 1.2.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/gallery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apps/gallery",
"version": "1.2.1",
"version": "1.3.0",
"private": true,
"main": "index.js",
"scripts": {
Expand Down
33 changes: 33 additions & 0 deletions apps/laboratory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# @apps/laboratory

## 1.3.0

### Minor Changes

- [#3186](https://github.com/reown-com/appkit/pull/3186) [`41c0292`](https://github.com/reown-com/appkit/commit/41c02928b9171651da705778891c08cac1b3ae19) Thanks [@enesozturk](https://github.com/enesozturk)! - Updates public component names with appkit prefix

### Patch Changes

- [#3188](https://github.com/reown-com/appkit/pull/3188) [`69e8bde`](https://github.com/reown-com/appkit/commit/69e8bdec3276e35a809912053c27828ab49fc964) Thanks [@magiziz](https://github.com/magiziz)! - Improved error handling for auth and universal provider connectors.

- [#3189](https://github.com/reown-com/appkit/pull/3189) [`db30b41`](https://github.com/reown-com/appkit/commit/db30b4160b130295dfd1e3276627f584e27537bd) Thanks [@magiziz](https://github.com/magiziz)! - Fixes an issue where Coinbase Wallet did not reconnect after refreshing the page when using ethers/ethers5 adapters.

- [#3190](https://github.com/reown-com/appkit/pull/3190) [`d9bb0bb`](https://github.com/reown-com/appkit/commit/d9bb0bb86e872cb0b74a0d2114130f09f89e9ac8) Thanks [@magiziz](https://github.com/magiziz)! - Fixes issue where ethers and ethers5 adapters didn't set the proper caip address when switching accounts manually.

- [#3201](https://github.com/reown-com/appkit/pull/3201) [`48cbfbe`](https://github.com/reown-com/appkit/commit/48cbfbeb7831109ee564d67151715336aa445c1e) Thanks [@tomiir](https://github.com/tomiir)! - Adds clientId to all blockchain api requests on a relay connection

- [#3191](https://github.com/reown-com/appkit/pull/3191) [`a3cf602`](https://github.com/reown-com/appkit/commit/a3cf602e95301e91f27970b9901abab382122080) Thanks [@magiziz](https://github.com/magiziz)! - Fixes an issue where email input validation errors broke the button styles.

- [#3203](https://github.com/reown-com/appkit/pull/3203) [`05feaed`](https://github.com/reown-com/appkit/commit/05feaed87c8181987cad508fe4725ca64ba56ab7) Thanks [@tomiir](https://github.com/tomiir)! - Improves SnackBar styles and routes proper relay messages to it on wc-connecting-view

- [#3193](https://github.com/reown-com/appkit/pull/3193) [`56fe99a`](https://github.com/reown-com/appkit/commit/56fe99ad21cd468a0203b5f2b5dd3bd29d9ba020) Thanks [@tomiir](https://github.com/tomiir)! - Improves UX/UI of multi-account screen for embedded wallet

- Updated dependencies [[`69e8bde`](https://github.com/reown-com/appkit/commit/69e8bdec3276e35a809912053c27828ab49fc964), [`db30b41`](https://github.com/reown-com/appkit/commit/db30b4160b130295dfd1e3276627f584e27537bd), [`d9bb0bb`](https://github.com/reown-com/appkit/commit/d9bb0bb86e872cb0b74a0d2114130f09f89e9ac8), [`41c0292`](https://github.com/reown-com/appkit/commit/41c02928b9171651da705778891c08cac1b3ae19), [`48cbfbe`](https://github.com/reown-com/appkit/commit/48cbfbeb7831109ee564d67151715336aa445c1e), [`a3cf602`](https://github.com/reown-com/appkit/commit/a3cf602e95301e91f27970b9901abab382122080), [`05feaed`](https://github.com/reown-com/appkit/commit/05feaed87c8181987cad508fe4725ca64ba56ab7), [`56fe99a`](https://github.com/reown-com/appkit/commit/56fe99ad21cd468a0203b5f2b5dd3bd29d9ba020)]:
- @reown/appkit-adapter-ethers5@1.3.0
- @reown/appkit-adapter-ethers@1.3.0
- @reown/appkit-adapter-solana@1.3.0
- @reown/appkit-adapter-wagmi@1.3.0
- @reown/appkit@1.3.0
- @reown/appkit-experimental@1.3.0
- @reown/appkit-siwe@1.3.0
- @reown/appkit-siwx@1.3.0
- @reown/appkit-wallet@1.3.0

## 1.2.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@apps/laboratory",
"type": "module",
"version": "1.2.1",
"version": "1.3.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
4 changes: 2 additions & 2 deletions apps/laboratory/src/components/AppKitButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export function AppKitButtons() {
<Heading size="xs" textTransform="uppercase" pb="2">
Connect / Account Button
</Heading>
<w3m-button />
<appkit-button />
</Box>
<Box>
<Heading size="xs" textTransform="uppercase" pb="2">
Network Button
</Heading>
<w3m-network-button />
<appkit-network-button />
</Box>
<AppKitHooks />
</Stack>
Expand Down
12 changes: 5 additions & 7 deletions apps/laboratory/src/components/AppKitHooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ export function AppKitHooks() {
Open
</Button>

<Button
data-testid="disconnect-hook-button"
isDisabled={!isConnected}
onClick={() => disconnect()}
>
Disconnect
</Button>
{isConnected && (
<Button data-testid="disconnect-hook-button" onClick={disconnect}>
Disconnect
</Button>
)}

<Button data-testid="switch-network-hook-button" onClick={handleSwitchNetwork}>
Switch Network
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/src/components/AppKitInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function AppKitInfo({ caipAddress, address, chainId, clientId }: AppKitIn
<Heading size="xs" textTransform="uppercase" pb="2">
CAIP Address
</Heading>
<Text data-testid="appkit-caip-address">{caipAddress}</Text>
<Text data-testid="w3m-caip-address">{caipAddress}</Text>
</Box>

<Box>
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/tests/shared/pages/ModalPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export class ModalPage {
}

async switchNetworkWithNetworkButton(networkName: string) {
const networkButton = this.page.getByTestId('w3m-network-button')
const networkButton = this.page.getByTestId('wui-network-button')
await networkButton.click()

const networkToSwitchButton = this.page.getByTestId(`w3m-network-switch-${networkName}`)
Expand Down
8 changes: 4 additions & 4 deletions apps/laboratory/tests/shared/validators/ModalValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class ModalValidator {
constructor(public readonly page: Page) {}

async expectConnected() {
const accountButton = this.page.locator('w3m-account-button')
const accountButton = this.page.locator('appkit-account-button')
await expect(accountButton, 'Account button should be present').toBeAttached({
timeout: MAX_WAIT
})
Expand All @@ -25,7 +25,7 @@ export class ModalValidator {
}

async expectBalanceFetched(currency: 'SOL' | 'ETH') {
const accountButton = this.page.locator('w3m-account-button')
const accountButton = this.page.locator('appkit-account-button')
await expect(accountButton, `Account button should show balance as ${currency}`).toContainText(
`0.000 ${currency}`
)
Expand Down Expand Up @@ -83,7 +83,7 @@ export class ModalValidator {
}

async expectCaipAddressHaveCorrectNetworkId(caipNetworkId: CaipNetworkId) {
const address = this.page.getByTestId('appkit-caip-address')
const address = this.page.getByTestId('w3m-caip-address')
await expect(address, 'Correct CAIP address should be present').toContainText(
caipNetworkId.toString()
)
Expand Down Expand Up @@ -294,7 +294,7 @@ export class ModalValidator {
}

async expectToBeConnectedInstantly() {
const accountButton = this.page.locator('w3m-account-button')
const accountButton = this.page.locator('appkit-account-button')
await expect(accountButton, 'Account button should be present').toBeAttached({
timeout: 1000
})
Expand Down
8 changes: 2 additions & 6 deletions apps/laboratory/tests/smart-account.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ smartAccountTest('it should switch to smart account and sign', async () => {
await page.togglePreferredAccountType()
await validator.expectChangePreferredAccountToShow(EOA)
await page.closeModal()

// Need some time for Lab UI to refresh state
await page.page.waitForTimeout(1000)
await validator.expectAccountButtonReady()

await page.sign()
await page.approveSign()
Expand All @@ -115,9 +113,7 @@ smartAccountTest('it should switch to eoa and sign', async () => {
await page.togglePreferredAccountType()
await validator.expectChangePreferredAccountToShow(SMART_ACCOUNT)
await page.closeModal()

// Need some time for Lab UI to refresh state
await page.page.waitForTimeout(1000)
await validator.expectAccountButtonReady()

await page.sign()
await page.approveSign()
Expand Down
15 changes: 15 additions & 0 deletions dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,18 @@ async function checkChangesetFiles() {
}
}
checkChangesetFiles()

// -- Check Workflows ------------------------------------------------------------
function checkWorkflows() {
const updatedWorkflows = updated_files.filter(f => f.includes('.github/workflows/'))
const deletedWorkflows = deleted_files.filter(f => f.includes('.github/workflows/'))

for (const f of deletedWorkflows) {
fail(`Workflow file(s) ${f} has been deleted`)
}

for (const f of updatedWorkflows) {
warn(`Workflow file ${f} has been modified`)
}
}
checkWorkflows()
4 changes: 2 additions & 2 deletions examples/html-ethers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<div id="app">
<button id="open-connect-modal">Open Modal</button>
<button id="open-network-modal">Open Networks</button>
<w3m-button></w3m-button>
<w3m-network-button></w3m-network-button>
<appkit-button></appkit-button>
<appkit-network-button></appkit-network-button>

<h1>Methods</h1>
<h3>getAddress</h3>
Expand Down
4 changes: 2 additions & 2 deletions examples/html-ethers5/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<div id="app">
<button id="open-connect-modal">Open Modal</button>
<button id="open-network-modal">Open Networks</button>
<w3m-button></w3m-button>
<w3m-network-button></w3m-network-button>
<appkit-button></appkit-button>
<appkit-network-button></appkit-network-button>

<h1>Methods</h1>
<h3>getAddress</h3>
Expand Down
4 changes: 2 additions & 2 deletions examples/html-wagmi-cdn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
<div class="container">
<h1>AppKit CDN Example</h1>
<div class="button-group">
<w3m-button></w3m-button>
<w3m-network-button></w3m-network-button>
<appkit-button></appkit-button>
<appkit-network-button></appkit-network-button>
</div>
<div class="button-group">
<button id="open-appkit">Open AppKit</button>
Expand Down
5 changes: 3 additions & 2 deletions examples/html-wagmi/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Html Wagmi Example</title>
</head>

<body>
<div id="app">
<button id="open-connect-modal">Open Modal</button>
<button id="open-network-modal">Open Networks</button>
<w3m-button></w3m-button>
<w3m-network-button> </w3m-network-button>
<appkit-button />
<appkit-network-button />
</div>
<script type="module" src="/src/main.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/next-ethers/src/components/Connect.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client'

export default function Connect() {
return <w3m-button />
return <appkit-button />
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const ConnectButton = () => {
<div className="column">
<span className="text-black">useAppKitAccount: {compactAddress}</span>
<span className="text-black">useAccount (wagmi): {compactAddressWagmi}</span>
<w3m-button />
<appkit-button />
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const ConnectButton = () => {
<div className="column">
<span className="text-black">useAppKitAccount: {compactAddress}</span>
<span className="text-black">useAccount (wagmi): {compactAddressWagmi}</span>
<w3m-button />
<appkit-button />
</div>
)
}
Loading

0 comments on commit ba93925

Please sign in to comment.