Skip to content

Commit

Permalink
wagmi: build supports alpha release now
Browse files Browse the repository at this point in the history
  • Loading branch information
CedarMist authored and aefhm committed Jul 15, 2024
1 parent 912e4f3 commit 9983bdd
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
29 changes: 29 additions & 0 deletions examples/wagmi-v2/README.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion integrations/viem-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion integrations/wagmi-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 9983bdd

Please sign in to comment.