Skip to content

Commit

Permalink
Update readmes (#142)
Browse files Browse the repository at this point in the history
* chore: update readme

* chore: change readme
  • Loading branch information
darrenvechain authored Dec 5, 2023
1 parent 4bb94f2 commit d2ad512
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ yarn build
## Publishing

```bash
git clone [email protected]:vechainfoundation/vechain-dapp-kit.git
cd vechain-dapp-kit
git checkout X.Y.Z
yarn install:all
yarn build
yarn changeset publish
Expand Down
11 changes: 3 additions & 8 deletions packages/dapp-kit-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const { vendor, thor } = useConnex();
- Use the `ConnectWalletButton` component to display a modal with the available wallets

```typescript jsx
import { ConnectWalletButton } from '@vechain/dapp-kit-react';
import { ConnectButtonWithModal } from '@vechain/dapp-kit-react';
import { useWallet } from '@vechain/dapp-kit-react';

const MyComponent = (): JSX.Element => {
Expand All @@ -105,7 +105,7 @@ const MyComponent = (): JSX.Element => {

return (
<>
<ConnectWalletButton />
<ConnectButtonWithModal />
</>
);
};
Expand All @@ -116,11 +116,7 @@ const MyComponent = (): JSX.Element => {
- Use the `ConnectWalletModal` component to display a modal with the available wallets

```typescript jsx
import {
ConnectWalletModal,
useWallet,
useWalletModal,
} from '@vechain/dapp-kit-react';
import { useWallet, useWalletModal } from '@vechain/dapp-kit-react';

export const MyComponent = (): JSX.Element => {
const { account } = useWallet();
Expand All @@ -135,7 +131,6 @@ export const MyComponent = (): JSX.Element => {
return (
<>
<button onClick={open}>Connect Wallet</button>
<ConnectWalletModal />
</>
);
};
Expand Down
1 change: 0 additions & 1 deletion packages/dapp-kit-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@vechain/dapp-kit-react",
"version": "0.0.1",
"private": false,
"repository": "https://github.com/vechainfoundation/vechain-dapp-kit",
"license": "MIT",
"sideEffects": false,
"type": "module",
Expand Down
4 changes: 1 addition & 3 deletions packages/dapp-kit-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ yarn add @vechain/dapp-kit-ui
- In your root `main.ts`

```typescript
import type { WalletConnectOptions } from '@vechain/dapp-kit';
import type { Options } from '@vechain/connex';
import { configureThorModal } from '@vechain/dapp-kit-ui';
import type { WalletConnectOptions, DAppKitOptions } from '@vechain/dapp-kit';
import { DAppKitUI } from '@vechain/dapp-kit-ui';

const walletConnectOptions: WalletConnectOptions = {
Expand Down
1 change: 0 additions & 1 deletion packages/dapp-kit-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"typescript",
"lit"
],
"repository": "https://github.com/vechainfoundation/vechain-dapp-kit",
"license": "MIT",
"author": "Davide Carpini",
"type": "module",
Expand Down
13 changes: 11 additions & 2 deletions packages/dapp-kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

## Installation

- See the full doc
- See the parent [README](../../README.md) for installation instructions.

### Build
Expand Down Expand Up @@ -44,6 +45,8 @@ const walletConnectOptions: WalletConnectOptions = {
error. See the next step to finalise the setup.

```typescript
import { DAppKit } from '@vechain/dapp-kit';

const { thor, vendor, wallet } = new DAppKit({
nodeUrl: 'https://sync-testnet.vechain.org/', //Required
genesis: 'main', //Optional - "main" | "test" | Connex.Thor.Block
Expand All @@ -70,6 +73,12 @@ wallet.setSource('veworld');
```typescript
const {account, verified} = await wallet.connect();

const tx = await thor.account("0x...123").method(...).transact().signer(account).request();
const certRes = await vendor.sign("cert", {...}).requset();
const tx = await thor.account("0x...123")
.method(...)
.transact()
.signer(account)
.request();

const certRes = await vendor.sign("cert", {...})
.requset();
```
1 change: 0 additions & 1 deletion packages/dapp-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "@vechain/dapp-kit",
"version": "0.0.1",
"private": false,
"repository": "https://github.com/vechainfoundation/vechain-dapp-kit",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down

0 comments on commit d2ad512

Please sign in to comment.