Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mj850 committed Jul 16, 2024
1 parent 6eb8629 commit c123ba8
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 28 deletions.
5 changes: 0 additions & 5 deletions .changeset/three-buttons-taste.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ SeiJS consists of smaller NPM packages within the @sei-js namespace. For more de
| [@sei-js/evm](packages/evm) | Typescript library containing helper functions for interacting with the EVM on Sei. |
| [@sei-js/proto](packages/proto) | TypeScript library for Sei protobuf generated using [Telescope](https://github.com/osmosis-labs/telescope) |
| [@sei-js/registry](packages/proto) | TypeScript library exporting constants from the [Sei chain-registry](https://github.com/sei-protocol/chain-registry) and the [community asset list](https://github.com/Sei-Public-Goods/sei-assetlist) |
| [@sei-js/create-sei](packages/create-sei) | CLI Tool used to quickly spin up Sei Projects and dApps in either the cosmos or EVM ecosystem |

## Development
To build all packages and docs, run `yarn install` then `yarn build:all`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function Examples({ chainId }: ExampleProps) {
<p className="card__title">Smart contract interaction</p>
<small>
<a
href="https://cosmos.github.io/cosmjs/latest/stargate/classes/SigningCosmWasmClient.html"
href="https://cosmos.github.io/cosmjs/latest/cosmwasm-stargate/classes/SigningCosmWasmClient.html"
target="_blank">
CosmWasm Clients
</a> example of smart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ const helpItems: HelpItem[] = [
{
title: 'CosmosKit',
description: "Learn about CosmosKit and it's hooks for chain interaction.",
link: 'https://docs.cosmology.zone/cosmos-kit/get-started/'
link: 'https://docs.cosmology.zone/cosmos-kit/get-started'
},
{
title: 'Sei-Js',
description: 'Interact with Sei using Sei-Js.',
title: 'sei-js',
description: 'Interact with Sei using @sei-js/cosmjs.',
link: 'https://sei-protocol.github.io/sei-js/modules/cosmjs.html'
}
];
Expand Down
4 changes: 3 additions & 1 deletion packages/create-sei/templates/next-wagmi-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ This repository includes basic features that allow you to connect to a wallet an

Additionally, basic examples and links to documentation are provided on the example homepage in `src/app/components/Homepage`.

This repository uses helper methods from [@sei-js/evm/viem](https://github.com/sei-protocol/sei-js/tree/main/packages/evm/src/viem)

### Web3 Provider
This component is a Sei specific wrapper around a Wagmi Provider that should wrap the application. Wrapping the application in this provider will enable it to access hooks in Wagmi. These hooks are enable connection to a wallet and interaction with the chain.

Expand All @@ -36,7 +38,7 @@ In addition, this app uses [RainbowKit](https://www.rainbowkit.com/docs/wallet-b
To change the list of supported wallets, as well as connection configurations you can modify the `src/app/components/Web3Provider.tsx` component.

### Changing the Chain
This application connects to the arctic-1 devnet by default
This application connects to the arctic-1 devnet by default, using chain configurations uploaded to viem.

To change the chain the app connects to, edit the `selectedChain` variable in the `chain.ts` file in `src/app/constants`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function Examples() {
const estimatedGas = await publicClient.estimateContractGas(params);

// Call smart contract execute msg
const result = await writeContractAsync({ ...params, gas: estimatedGas});
await writeContractAsync({ ...params, gas: estimatedGas});

// Wait for 1 block to confirm transaction
setTimeout(() => {}, 400);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
'use client';

import { RainbowKitProvider, connectorsForWallets, lightTheme, midnightTheme } from '@rainbow-me/rainbowkit';
import { RainbowKitProvider, connectorsForWallets, lightTheme } from '@rainbow-me/rainbowkit';
import { metaMaskWallet } from '@rainbow-me/rainbowkit/wallets';
import { Buffer } from 'buffer';
import { ReactNode, useMemo } from 'react';
import { WagmiProvider, createConfig, http } from 'wagmi';

import '@rainbow-me/rainbowkit/styles.css';
import { ATLANTIC_2_VIEM_CHAIN } from '@sei-js/evm';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { selectedChain } from '../constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ARCTIC_1_VIEM_CHAIN, ATLANTIC_2_VIEM_CHAIN, PACIFIC_1_VIEM_CHAIN } from '@sei-js/evm';

// Set your selected chain here
// To point to mainnet, use PACIFIC_1_VIEM_CHAIN
export const selectedChain = ARCTIC_1_VIEM_CHAIN
import { seiDevnet } from "viem/chains";

// To point to mainnet, use sei.
// To point to testnet, use seiTestnet.
export const selectedChain = seiDevnet
32 changes: 30 additions & 2 deletions packages/create-sei/templates/next-wagmi-template/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@
"@walletconnect/modal" "2.6.2"
cbw-sdk "npm:@coinbase/wallet-sdk@3.9.3"

"@wagmi/core@2.11.4", "@wagmi/core@^2.9.1":
"@wagmi/core@2.11.4":
version "2.11.4"
resolved "https://registry.yarnpkg.com/@wagmi/core/-/core-2.11.4.tgz#850f53fd399cf3d2cb52144318cafb6cb33f039a"
integrity sha512-vugDoSqHgWFEIIcwnBUFf1VctMfAnq6EK7vIPhVyBtlCdF/9tU0NoH8ayQeP6R6W6mQtnctUU/WM7+mFRnn4OA==
Expand All @@ -940,6 +940,15 @@
mipd "0.0.5"
zustand "4.4.1"

"@wagmi/core@^2.9.1":
version "2.11.7"
resolved "https://registry.yarnpkg.com/@wagmi/core/-/core-2.11.7.tgz#70738a43702dc5f41981aa64550784e136953b12"
integrity sha512-O9bMbh9VebCUwoOgNhn27bX/VU8Lge9noD/ypUw3qpGGDBOv0/kwHyxJsvQipyDn55cKxpqW2KKo/7sIDgqVzA==
dependencies:
eventemitter3 "5.0.1"
mipd "0.0.5"
zustand "4.4.1"

"@walletconnect/core@2.13.0":
version "2.13.0"
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.13.0.tgz#6b79b039930643e8ee85a0f512b143a35fdb8b52"
Expand Down Expand Up @@ -1211,6 +1220,11 @@ abitype@1.0.4:
resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.4.tgz#a817ff44860e8a84e9a37ed22aa9b738dbb51dba"
integrity sha512-UivtYZOGJGE8rsrM/N5vdRkUpqEZVmuTumfTuolm7m/6O09wprd958rx8kUBwVAAAhQDveGAgD0GJdBuR8s6tw==

abitype@1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.5.tgz#29d0daa3eea867ca90f7e4123144c1d1270774b6"
integrity sha512-YzDhti7cjlfaBhHutMaboYB21Ha3rXR9QTkNJFzYC4kC8YclaiwPBBBJY8ejFdu2wnJeZCVZSMlQJ7fi8S6hsw==

abort-controller@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
Expand Down Expand Up @@ -4551,7 +4565,21 @@ viem@^1.0.0, viem@^1.1.4:
isows "1.0.3"
ws "8.13.0"

viem@^2.0.0, viem@^2.15.1:
viem@^2.0.0:
version "2.17.4"
resolved "https://registry.yarnpkg.com/viem/-/viem-2.17.4.tgz#ecdaa35739c547268583610b77b2451b4e4fc9cb"
integrity sha512-6gmBB85I7z1qt/+yPPS+i4L2jNPJqCs+SEb+26WnKVYez13svSzjYMsU9OYYlPFpQmpGSy9dV2bKW6VX68FTgg==
dependencies:
"@adraffy/ens-normalize" "1.10.0"
"@noble/curves" "1.4.0"
"@noble/hashes" "1.4.0"
"@scure/bip32" "1.4.0"
"@scure/bip39" "1.3.0"
abitype "1.0.5"
isows "1.0.4"
ws "8.17.1"

viem@^2.15.1:
version "2.16.0"
resolved "https://registry.yarnpkg.com/viem/-/viem-2.16.0.tgz#646b7a872bc734de210e577f4b3630ffdc110b6d"
integrity sha512-qXakKfshaDOiQFgb3MgROKDa4bfr095GMUqrD2WN6UMdzH7WtlAYJ65vnrpoXpny9jXAyNoirEJeBBUF9KFNIQ==
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function Examples({ chainId }: ExampleProps) {
<p className="card__title">Smart contract interaction</p>
<small>
<a
href="https://cosmos.github.io/cosmjs/latest/stargate/classes/SigningCosmWasmClient.html"
href="https://cosmos.github.io/cosmjs/latest/cosmwasm-stargate/classes/SigningCosmWasmClient.html"
target="_blank">
CosmWasm Clients
</a> example of smart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ const helpItems: HelpItem[] = [
{
title: 'CosmosKit',
description: "Learn about CosmosKit and it's hooks for chain interaction.",
link: 'https://docs.cosmology.zone/cosmos-kit/get-started/'
link: 'https://docs.cosmology.zone/cosmos-kit/get-started'
},
{
title: 'Sei-Js',
description: 'Interact with Sei using Sei-Js.',
title: 'sei-js',
description: 'Interact with Sei using @sei-js/cosmjs.',
link: 'https://sei-protocol.github.io/sei-js/modules/cosmjs.html'
}
];
Expand Down Expand Up @@ -93,7 +93,7 @@ export function Homepage() {
Get started by editing <code>src/App.tsx</code>
</div>
<div className="grid docs">
{helpItems.map((item, index) => (renderHelpItem(item)))}
{helpItems.map((item, _) => (renderHelpItem(item)))}
</div>
</div>
);
Expand Down
4 changes: 3 additions & 1 deletion packages/create-sei/templates/vite-wagmi-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ This repository includes basic features that allow you to connect to a wallet an

Additionally, basic examples and links to documentation are provided on the example homepage in `src/components/Homepage`.

This repository uses helper methods from [@sei-js/evm/viem](https://github.com/sei-protocol/sei-js/tree/main/packages/evm/src/viem)

### Web3 Provider
This component is a Sei specific wrapper around a Wagmi Provider that should wrap the application. Wrapping the application in this provider will enable it to access hooks in Wagmi. These hooks are enable connection to a wallet and interaction with the chain.

Expand All @@ -43,7 +45,7 @@ In addition, this app uses [RainbowKit](https://www.rainbowkit.com/docs/wallet-b
To change the list of supported wallets, as well as connection configurations you can modify the `src/components/Web3Provider.tsx` component.

### Changing the Chain
This application connects to the arctic-1 devnet by default
This application connects to the arctic-1 devnet by default, using chain configurations uploaded to viem.

To change the chain the app connects to, edit the `selectedChain` variable in the `chain.ts` file in `src/app/constants`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function Examples() {
const estimatedGas = await publicClient.estimateContractGas(params);

// Call smart contract execute msg
const result = await writeContractAsync({ ...params, gas: estimatedGas});
await writeContractAsync({ ...params, gas: estimatedGas});

// Wait for 1 block to confirm transaction
setTimeout(() => {}, 400);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { ConnectButton } from '@rainbow-me/rainbowkit';
import Examples from './Examples';
import "./Homepage.css"
Expand Down Expand Up @@ -98,7 +97,7 @@ function Homepage() {
Get started by editing <code>src/App.tsx</code>
</div>
<div className="grid docs">
{helpItems.map((item, index) => (renderHelpItem(item)))}
{helpItems.map((item, _) => (renderHelpItem(item)))}
</div>
</div>
);
Expand Down

0 comments on commit c123ba8

Please sign in to comment.