diff --git a/.changeset/six-pumpkins-suffer.md b/.changeset/six-pumpkins-suffer.md new file mode 100644 index 0000000000..4686e36bbf --- /dev/null +++ b/.changeset/six-pumpkins-suffer.md @@ -0,0 +1,24 @@ +--- +'@reown/appkit-adapter-wagmi': patch +'@reown/appkit-scaffold-ui': patch +'@apps/laboratory': patch +'@reown/appkit': patch +'@reown/appkit-ui': patch +'@apps/demo': patch +'@apps/gallery': patch +'@reown/appkit-adapter-ethers': patch +'@reown/appkit-adapter-ethers5': patch +'@reown/appkit-adapter-polkadot': patch +'@reown/appkit-adapter-solana': patch +'@reown/appkit-utils': patch +'@reown/appkit-cdn': patch +'@reown/appkit-common': patch +'@reown/appkit-core': patch +'@reown/appkit-experimental': patch +'@reown/appkit-polyfills': patch +'@reown/appkit-siwe': patch +'@reown/appkit-siwx': patch +'@reown/appkit-wallet': patch +--- + +Adds clientId to all blockchain api requests on a relay connection diff --git a/.changeset/twelve-pianos-count.md b/.changeset/twelve-pianos-count.md new file mode 100644 index 0000000000..df52d54e05 --- /dev/null +++ b/.changeset/twelve-pianos-count.md @@ -0,0 +1,24 @@ +--- +'@reown/appkit-scaffold-ui': patch +'@apps/laboratory': patch +'@reown/appkit-ui': patch +'@apps/demo': patch +'@apps/gallery': patch +'@reown/appkit-adapter-ethers': patch +'@reown/appkit-adapter-ethers5': patch +'@reown/appkit-adapter-polkadot': patch +'@reown/appkit-adapter-solana': patch +'@reown/appkit-adapter-wagmi': patch +'@reown/appkit': patch +'@reown/appkit-utils': patch +'@reown/appkit-cdn': patch +'@reown/appkit-common': patch +'@reown/appkit-core': patch +'@reown/appkit-experimental': patch +'@reown/appkit-polyfills': patch +'@reown/appkit-siwe': patch +'@reown/appkit-siwx': patch +'@reown/appkit-wallet': patch +--- + +Improves SnackBar styles and routes proper relay messages to it on wc-connecting-view diff --git a/.changeset/wet-bulldogs-move.md b/.changeset/wet-bulldogs-move.md new file mode 100644 index 0000000000..f88fb55268 --- /dev/null +++ b/.changeset/wet-bulldogs-move.md @@ -0,0 +1,24 @@ +--- +'@reown/appkit-scaffold-ui': patch +'@apps/laboratory': patch +'@reown/appkit': patch +'@reown/appkit-ui': patch +'@apps/demo': patch +'@apps/gallery': patch +'@reown/appkit-adapter-ethers': patch +'@reown/appkit-adapter-ethers5': patch +'@reown/appkit-adapter-polkadot': patch +'@reown/appkit-adapter-solana': patch +'@reown/appkit-adapter-wagmi': patch +'@reown/appkit-utils': patch +'@reown/appkit-cdn': patch +'@reown/appkit-common': patch +'@reown/appkit-core': patch +'@reown/appkit-experimental': patch +'@reown/appkit-polyfills': patch +'@reown/appkit-siwe': patch +'@reown/appkit-siwx': patch +'@reown/appkit-wallet': patch +--- + +Improves UX/UI of multi-account screen for embedded wallet diff --git a/.github/workflows/publish_canary.yml b/.github/workflows/publish_canary.yml new file mode 100644 index 0000000000..f32d14503e --- /dev/null +++ b/.github/workflows/publish_canary.yml @@ -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 diff --git a/apps/laboratory/tests/smart-account.spec.ts b/apps/laboratory/tests/smart-account.spec.ts index a83217c425..3a00c379de 100644 --- a/apps/laboratory/tests/smart-account.spec.ts +++ b/apps/laboratory/tests/smart-account.spec.ts @@ -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() @@ -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() diff --git a/dangerfile.ts b/dangerfile.ts index 7f85bb9304..93a92384e6 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -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() diff --git a/packages/appkit/src/networks/solana/solana.ts b/packages/appkit/src/networks/solana/solana.ts index a64538ca7b..4dc6ee7030 100644 --- a/packages/appkit/src/networks/solana/solana.ts +++ b/packages/appkit/src/networks/solana/solana.ts @@ -11,5 +11,6 @@ export const solana = defineChain({ blockExplorers: { default: { name: 'Solscan', url: 'https://solscan.io' } }, testnet: false, chainNamespace: 'solana', - caipNetworkId: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp' + caipNetworkId: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', + deprecatedCaipNetworkId: 'solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ' }) diff --git a/packages/appkit/src/networks/solana/solanaDevnet.ts b/packages/appkit/src/networks/solana/solanaDevnet.ts index ae24a51503..b7d9fc9c03 100644 --- a/packages/appkit/src/networks/solana/solanaDevnet.ts +++ b/packages/appkit/src/networks/solana/solanaDevnet.ts @@ -11,5 +11,6 @@ export const solanaDevnet = defineChain({ blockExplorers: { default: { name: 'Solscan', url: 'https://solscan.io' } }, testnet: true, chainNamespace: 'solana', - caipNetworkId: 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1' + caipNetworkId: 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1', + deprecatedCaipNetworkId: 'solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K' }) diff --git a/packages/appkit/src/tests/mocks/AppKit.ts b/packages/appkit/src/tests/mocks/AppKit.ts index cb44a03669..36330011b8 100644 --- a/packages/appkit/src/tests/mocks/AppKit.ts +++ b/packages/appkit/src/tests/mocks/AppKit.ts @@ -19,7 +19,8 @@ export const mockAppKit = { getPreferredAccountType: vi.fn().mockReturnValue('eoa'), getCaipNetwork: vi.fn().mockReturnValue(mainnet), setApprovedCaipNetworksData: vi.fn(), - getAddress: vi.fn().mockReturnValue('0xE62a3eD41B21447b67a63880607CD2E746A0E35d') + getAddress: vi.fn().mockReturnValue('0xE62a3eD41B21447b67a63880607CD2E746A0E35d'), + setClientId: vi.fn() } as unknown as AppKit export default mockAppKit diff --git a/packages/appkit/src/tests/mocks/UniversalProvider.ts b/packages/appkit/src/tests/mocks/UniversalProvider.ts index 9bc3138b6f..fca3d0b872 100644 --- a/packages/appkit/src/tests/mocks/UniversalProvider.ts +++ b/packages/appkit/src/tests/mocks/UniversalProvider.ts @@ -33,7 +33,10 @@ export const mockProvider = { } }, solana: { - chains: ['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'], + chains: [ + 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', + 'solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ' + ], methods: [ 'solana_signMessage', 'solana_signTransaction', @@ -96,7 +99,8 @@ export const mockProvider = { keychain: { has: vi.fn().mockResolvedValue(true), set: vi.fn() - } + }, + getClientId: vi.fn().mockReturnValue('mock_client_id') }, relayer: { subscriber: { diff --git a/packages/appkit/src/tests/utils/HelpersUtil.test.ts b/packages/appkit/src/tests/utils/HelpersUtil.test.ts index acf0e7fe17..1677bd14d7 100644 --- a/packages/appkit/src/tests/utils/HelpersUtil.test.ts +++ b/packages/appkit/src/tests/utils/HelpersUtil.test.ts @@ -139,7 +139,10 @@ describe('WcHelpersUtil', () => { 'solana_signAndSendTransaction' ], events: ['accountsChanged', 'chainChanged'], - chains: ['solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'], + chains: [ + 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', + 'solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ' + ], rpcMap: { '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp': 'https://api.mainnet-beta.solana.com' } diff --git a/packages/appkit/src/utils/HelpersUtil.ts b/packages/appkit/src/utils/HelpersUtil.ts index 97285f8d82..327fc91263 100644 --- a/packages/appkit/src/utils/HelpersUtil.ts +++ b/packages/appkit/src/utils/HelpersUtil.ts @@ -2,6 +2,7 @@ import type { NamespaceConfig, Namespace } from '@walletconnect/universal-provid import type { CaipNetwork, CaipNetworkId, ChainNamespace } from '@reown/appkit-common' import type { SessionTypes } from '@walletconnect/types' import { EnsController } from '@reown/appkit-core' +import { solana, solanaDevnet } from '../networks/index.js' export const WcHelpersUtil = { getMethodsByChainNamespace(chainNamespace: ChainNamespace): string[] { @@ -61,6 +62,17 @@ export const WcHelpersUtil = { namespace.chains.push(caipNetworkId) + // Workaround for wallets that only support deprecated Solana network ID + switch (caipNetworkId) { + case solana.caipNetworkId: + namespace.chains.push(solana.deprecatedCaipNetworkId) + break + case solanaDevnet.deprecatedCaipNetworkId: + namespace.chains.push(solanaDevnet.deprecatedCaipNetworkId) + break + default: + } + if (namespace?.rpcMap && rpcUrl) { namespace.rpcMap[id] = rpcUrl } diff --git a/packages/scaffold-ui/src/views/w3m-connecting-wc-view/index.ts b/packages/scaffold-ui/src/views/w3m-connecting-wc-view/index.ts index 4346f6d24e..260fd7128a 100644 --- a/packages/scaffold-ui/src/views/w3m-connecting-wc-view/index.ts +++ b/packages/scaffold-ui/src/views/w3m-connecting-wc-view/index.ts @@ -83,9 +83,11 @@ export class W3mConnectingWcView extends LitElement { }) ConnectionController.setWcError(true) if (CoreHelperUtil.isAllowedRetry(this.lastRetry)) { - SnackController.showError('Declined') + SnackController.showError((error as BaseError).message ?? 'Declined') this.lastRetry = Date.now() this.initializeConnection(true) + } else { + SnackController.showError((error as BaseError).message ?? 'Connection error') } } } diff --git a/packages/scaffold-ui/src/views/w3m-profile-view/index.ts b/packages/scaffold-ui/src/views/w3m-profile-view/index.ts index de125128be..9c9729387c 100644 --- a/packages/scaffold-ui/src/views/w3m-profile-view/index.ts +++ b/packages/scaffold-ui/src/views/w3m-profile-view/index.ts @@ -1,6 +1,7 @@ import { AccountController, ChainController, + ConnectionController, ConnectorController, CoreHelperUtil, ModalController, @@ -31,6 +32,8 @@ export class W3mProfileView extends LitElement { @state() private accounts = AccountController.state.allAccounts + @state() private loading = false + public constructor() { super() this.usubscribe.push( @@ -126,14 +129,14 @@ export class W3mProfileView extends LitElement { } private async onSwitchAccount(account: AccountType) { - AccountController.setShouldUpdateToAddress(account.address, ChainController.state.activeChain) + this.loading = true const emailConnector = ConnectorController.getAuthConnector() - if (!emailConnector) { - return + if (emailConnector) { + await ConnectionController.setPreferredAccountType(account.type) } - await emailConnector.provider.setPreferredAccount(account.type) - await emailConnector.provider.connect() + AccountController.setShouldUpdateToAddress(account.address, ChainController.state.activeChain) + this.loading = false } private accountTemplate(account: AccountType) { @@ -146,6 +149,7 @@ export class W3mProfileView extends LitElement { size="md" variant="accent" @click=${() => this.onSwitchAccount(account)} + .loading=${this.loading} >Switch`} ` diff --git a/packages/ui/src/composites/wui-list-account/index.ts b/packages/ui/src/composites/wui-list-account/index.ts index 21ea2ba7ea..8d359d6873 100644 --- a/packages/ui/src/composites/wui-list-account/index.ts +++ b/packages/ui/src/composites/wui-list-account/index.ts @@ -102,10 +102,10 @@ export class WuiListAccount extends LitElement { > + ${this.fetchingBalance ? html`` : html` $${this.balance.toFixed(2)}`} - ` diff --git a/packages/ui/src/composites/wui-snackbar/styles.ts b/packages/ui/src/composites/wui-snackbar/styles.ts index f362c11668..7279f6d061 100644 --- a/packages/ui/src/composites/wui-snackbar/styles.ts +++ b/packages/ui/src/composites/wui-snackbar/styles.ts @@ -3,17 +3,18 @@ import { css } from 'lit' export default css` :host { display: flex; - column-gap: var(--wui-spacing-xs); + column-gap: var(--wui-spacing-s); align-items: center; padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs); - border-radius: var(--wui-border-radius-3xl); + border-radius: var(--wui-border-radius-s); border: 1px solid var(--wui-color-gray-glass-005); box-sizing: border-box; - max-height: 40px; background-color: var(--wui-color-bg-175); box-shadow: 0px 14px 64px -4px rgba(0, 0, 0, 0.15), 0px 8px 22px -6px rgba(0, 0, 0, 0.15); + + max-width: 300px; } :host wui-loading-spinner {