0.0.0-internal-20230208034629 • Published 3 years ago

@sei-js/react v0.0.0-internal-20230208034629

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@sei-js/react

A set of React hooks for @sei-js/core written in Typescript.

Tutorial

For an in depth tutorial, please see our documentation.

Installation

yarn add @sei-js/react

Hooks

HookParams
useWallet(window: any, config: object)
useQueryClient(rpcAddress: string)
useSigningClient(rpcAddress: string, offlineSigner: any)

useWallet

A hook to connect one of our supported wallets to your application.

Input Props

HookParams
windowThe client side window object which has access to wallet providers injected code.
walletOptionsUseWalletOptions
import { useWallet } from '@sei-js/react';

const { offlineSigner } = useWallet(window, {
  inputWallet: 'leap',
  autoconnect: true,
  chainConfiguration: 'testnet',
});

Return Values

PropertyTypeDescription
connectedWalletstring?The currently connected wallet
connect() => PromiseAsync function to connect to input wallet
disconnect() => voidFunction to disconnect from input wallet
supportedWalletsstring[]List of supported wallets
installedWalletsstring[]List of wallets installed
errorstring?Error message
chainIdstringSei chain id
restUrlstringThe rest url associated with the connected wallet
rpcUrlstringThe rpc url associated with the connected wallet
offlineSignerobject?The offline signer associated with the connected wallet
accountsobject[]?The accounts associated with the connected wallet

useQueryClient

import { useQueryClient } from '@sei-js/react';

const { queryClient, isLoading } = useQueryClient('rest_url');
PropertyTypeDescription
queryClientStargateSigningClient?A stargate signing client.
isLoadingbooleanBoolean value for when the initial loading is happening

useSigningClient

import { useWallet, useSigningClient } from '@sei-js/react';

const { offlineSigner } = useWallet(window, {
  inputWallet: 'keplr',
  autoconnect: true,
  chainConfiguration: 'testnet',
});
const { signingClient, isLoading } = useSigningClient(
  'rpc_address',
  offlineSigner
);
PropertyTypeDescription
signingClientStargateSigningClient?A stargate signing client.
isLoadingbooleanBoolean value for when the initial loading is happening
2.0.3

2 years ago

2.0.2

3 years ago

2.0.5

2 years ago

2.0.4

2 years ago

3.2.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.5

2 years ago

3.0.0

2 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.3.0

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.3

3 years ago

1.0.49

3 years ago

1.0.52

3 years ago

1.0.19

3 years ago

1.0.39

3 years ago

1.0.17

3 years ago

1.0.38

3 years ago

1.0.16

3 years ago

1.0.44

3 years ago

1.0.22

3 years ago

1.0.43

3 years ago

1.0.21

3 years ago

1.0.42

3 years ago

1.0.20

3 years ago

1.0.41

3 years ago

1.0.48

3 years ago

1.0.26

3 years ago

1.0.47

3 years ago

1.0.25

3 years ago

1.0.46

3 years ago

1.0.24

3 years ago

1.0.45

3 years ago

1.0.23

3 years ago

1.0.29

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.37

3 years ago

1.0.15

3 years ago

1.0.36

3 years ago

1.0.14

3 years ago

1.0.35

3 years ago

1.0.13

3 years ago

1.0.34

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago