Creates a Viem transaction serializer which encrypts transactions prior to them being signed. This is compatible with both local wallet clients and injected wallets.
Example
import { defineChain } from 'viem';import { createSapphireSerializer } from '@oasisprotocol/sapphire-viem-v2';defineChain({ serializers: { transaction: createSapphireSerializer(publicClient) }, ...}); Copy
import { defineChain } from 'viem';import { createSapphireSerializer } from '@oasisprotocol/sapphire-viem-v2';defineChain({ serializers: { transaction: createSapphireSerializer(publicClient) }, ...});
Provides upstream access to Sapphire JSON-RPC via .request
.request
Optional
Optional serializer to wrap, otherwise will use default
Sapphire wrapped transaction encryption serializer
Creates a Viem transaction serializer which encrypts transactions prior to them being signed. This is compatible with both local wallet clients and injected wallets.
Example