jkhaui / react-terra

Composable hooks and components to build the future of finance. πŸš€

Home Page:https://react-terra.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@react-terra

Conventional Commits JavaScript Style Guide code style: prettier TypeScript>=4


react-terra logo


⚠️Warning! This library is in a highly experimental state. It is not currently recommended for production use.

Furthermore, react-terra has not been updated for Terra 2.0 and is currently in broken state due to outdated dependencies.

However, contributions are welcome and encouraged πŸš€βš οΈ

πŸ‘‰ Visit react-terra.dev for full docs


Installation

[Hooks only at the moment. Component library coming soon]

  yarn add @react-terra/hooks @terra-money/terra.js 
  @terra-money/wallet-provider rxjs

Follow the instructions from https://github.com/terra-money/wallet-provider to wrap your app in the wallet provider:

import {
  NetworkInfo,
  WalletProvider,
  WalletStatus,
  getChainOptions,
} from '@terra-money/wallet-provider';
import React from 'react';
import ReactDOM from 'react-dom';

// getChainOptions(): Promise<{ defaultNetwork, walletConnectChainIds }>
getChainOptions().then((chainOptions) => {
  ReactDOM.render(
    <WalletProvider {...chainOptions}>
      <YOUR_APP />
    </WalletProvider>,
    document.getElementById('root'),
  );
});

Run in Dev Mode

n.b. you need to have the Terra Station extension for Chrome/Brave installed, along with a wallet address.

  • From the root directory, run yarn

  • In a terminal window, run the following command:

    yarn start:hooks

  • Then, in a second terminal:

    cd into example;

    Run the following command:

    yarn start

About

Composable hooks and components to build the future of finance. πŸš€

https://react-terra.dev


Languages

Language:TypeScript 91.4%Language:CSS 5.2%Language:HTML 2.6%Language:JavaScript 0.8%Language:Shell 0.0%