From 9983bdd34a6cfb4acbe316b5b5befe57d15d8f2c Mon Sep 17 00:00:00 2001 From: CedarMist <134699267+CedarMist@users.noreply.github.com> Date: Sat, 6 Apr 2024 09:39:49 +0100 Subject: [PATCH] wagmi: build supports alpha release now --- .github/workflows/publish.yaml | 22 ++++++++++++++++++---- examples/wagmi-v2/README.md | 29 +++++++++++++++++++++++++++++ integrations/viem-v2/package.json | 2 +- integrations/wagmi-v2/package.json | 2 +- 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 499c5ff0..b859cf51 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -3,9 +3,11 @@ name: publish on: push: tags: - - clients/js/v[0-9].[0-9]+.[0-9]+ - - contracts/v[0-9].[0-9]+.[0-9]+ - - integrations/hardhat/v[0-9].[0-9]+.[0-9]+ + - clients/js/v[0-9]\.[0-9]+\.[0-9]+(-(alpha|beta|rc)(\.[0-9]+)?)? + - contracts/v[0-9]\.[0-9]+\.[0-9]+(-(alpha|beta|rc)(\.[0-9]+)?)? + - integrations/hardhat/v[0-9]\.[0-9]+\.[0-9]+(-(alpha|beta|rc)(\.[0-9]+)?)? + - integrations/viem-v2/v[0-9]\.[0-9]+\.[0-9]+(-(alpha|beta|rc)(\.[0-9]+)?)? + - integrations/wagmi-v2/v[0-9]\.[0-9]+\.[0-9]+(-(alpha|beta|rc)(\.[0-9]+)?)? jobs: publish: @@ -21,10 +23,22 @@ jobs: with: version: 8 run_install: true + - name: Build JS client + working-directory: clients/js + run: pnpm build + - name: Build hardhat integration + working-directory: integrations/hardhat + run: pnpm build + - name: Build Viem integration + working-directory: integrations/viem-v2 + run: pnpm build + - name: Build Wagmi integration + working-directory: integrations/wagmi-v2 + run: pnpm build - name: Extract package from tag id: extract-tag run: | - echo "NPM_PACKAGE=$(echo ${{ github.ref_name }} | grep -oE '(clients/js|contracts|integrations/hardhat)')" >> $GITHUB_OUTPUT + echo "NPM_PACKAGE=$(echo ${{ github.ref_name }} | grep -oE '(clients/js|contracts|integrations/(hardhat|wagmi-v2|viem-v2))')" >> $GITHUB_OUTPUT - name: Publish ${{ github.ref_name }} to NPM uses: JS-DevTools/npm-publish@v3 with: diff --git a/examples/wagmi-v2/README.md b/examples/wagmi-v2/README.md index 15f6f795..871e0274 100644 --- a/examples/wagmi-v2/README.md +++ b/examples/wagmi-v2/README.md @@ -1 +1,30 @@ This is a [Vite](https://vitejs.dev) project bootstrapped with [`create-wagmi`](https://github.com/wevm/wagmi/tree/main/packages/create-wagmi). + +It uses the Sapphire wrapper to encrypt contract deployments, transactions, +view calls & gas estimations using the `injectedWithSapphire()` connector and +`sapphireTransport` adapter configured in `src/wagmi.ts`: + +The connector and transport must be configured to use Sapphire to ensure +that both transactions and view calls are encrypted. + +```typescript +import { injectedWithSapphire, + sapphireTransport, + sapphireLocalnet } from "@oasisprotocol/sapphire-wagmi-v2"; + +export const config = createConfig({ + multiInjectedProviderDiscovery: false, + chains: [sapphire, sapphireTestnet, sapphireLocalnet], + connectors: [injectedWithSapphire()], + transports: { + [sapphire.id]: sapphireTransport(), + [sapphireTestnet.id]: sapphireTransport(), + [sapphireLocalnet.id]: sapphireTransport(), + }, +}); +``` + +Please note that `multiInjectedProviderDiscovery` is disabled, as [EIP-6963] is +not yet supported by the Sapphire Wagmi integration. + +[EIP-6963]: https://eips.ethereum.org/EIPS/eip-6963 diff --git a/integrations/viem-v2/package.json b/integrations/viem-v2/package.json index 4122331f..3c056cb5 100644 --- a/integrations/viem-v2/package.json +++ b/integrations/viem-v2/package.json @@ -2,7 +2,7 @@ "type": "module", "name": "@oasisprotocol/sapphire-viem-v2", "license": "Apache-2.0", - "version": "2.0.0", + "version": "2.0.0-alpha.0", "description": "Viem support for the Oasis Sapphire ParaTime.", "homepage": "https://github.com/oasisprotocol/sapphire-paratime/tree/main/integrations/viem-v2", "repository": { diff --git a/integrations/wagmi-v2/package.json b/integrations/wagmi-v2/package.json index fd49fc48..3bf55dbb 100644 --- a/integrations/wagmi-v2/package.json +++ b/integrations/wagmi-v2/package.json @@ -2,7 +2,7 @@ "type": "module", "name": "@oasisprotocol/sapphire-wagmi-v2", "license": "Apache-2.0", - "version": "2.0.0", + "version": "2.0.0-alpha.0", "description": "Wagmi & Viem support for the Oasis Sapphire ParaTime.", "homepage": "https://github.com/oasisprotocol/sapphire-paratime/tree/main/integrations/wagmi-v2", "repository": {