Skip to content

Commit

Permalink
integrations/viem: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
CedarMist authored and aefhm committed Sep 10, 2024
1 parent a2d117e commit c34b198
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions integrations/viem-v2/scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,28 @@ prevent Node from exiting cleanly.
See: https://github.com/oasisprotocol/sapphire-paratime/pull/383
*/

import {
createSapphireSerializer,
sapphireHttpTransport,
sapphireLocalnet,
} from "@oasisprotocol/sapphire-viem-v2";
import { createPublicClient, defineChain } from "viem";
import { sapphireHttpTransport, sapphireLocalnet, createSapphireSerializer } from '@oasisprotocol/sapphire-viem-v2';

const transport = sapphireHttpTransport();
const chain = sapphireLocalnet;
const publicClient = createPublicClient({ chain, transport });
defineChain({
id: 0x5afd,
name: "Oasis Sapphire Localnet",
network: "sapphire-localnet",
nativeCurrency: { name: "Sapphire Local Rose", symbol: "TEST", decimals: 18 },
rpcUrls: {
default: {
http: ["http://localhost:8545"],
},
},
serializers: {
transaction: await createSapphireSerializer(publicClient)
},
testnet: true,
id: 0x5afd,
name: "Oasis Sapphire Localnet",
network: "sapphire-localnet",
nativeCurrency: { name: "Sapphire Local Rose", symbol: "TEST", decimals: 18 },
rpcUrls: {
default: {
http: ["http://localhost:8545"],
},
},
serializers: {
transaction: await createSapphireSerializer(publicClient),
},
testnet: true,
});

0 comments on commit c34b198

Please sign in to comment.