Terra Station Override

Terra station NPM package :

https://www.npmjs.com/package/@terra-money/wallet-provider

Coin98 Wallet Provider

Library to make React dApps easier using Coin98 Extension with Terra Station.

Quick Start

Use templates to get your projects started quickly

Code Sandbox

If you want to test features quickly, you can simply run them on CodeSandbox without having to download Templates.

And if you need to start your project from local computer, use the templates below. 👇

Create React App

Next.js

Other templates

Community templates (experimental)

You can find more templates in https://templates.terra.money. (This is the beginning stage, so it may not be enough yet)

If you make a different type of template, you can register here.

Basic Usage

First, please add <meta name="terra-wallet" /> on your html page.

Since then, browser extensions (e.g. Terra Station chrome extension) will not attempt to connect in a Web app where this <meta name="terra-wallet"> tag is not found.

If you have used react-router-dom's <BrowserRouter>, useLocation(), you can easily understand it.

First, you need to wrap your React App with the <WalletProvider> component.

Afterwards, you can use React Hooks such as useWallet(), useConnectedWallet() and useLCDClient() anywhere in your app.

API

<WalletProvider>
useWallet()

This is a React Hook that can receive all the information. (Other hooks are functions for the convenience of Wrapping this useWallet())

packages/src/@terra-money/use-wallet/useWallet.ts

useConnectedWallet()
useLCDClient()

Projects for reference

Trouble-shooting guide

wallet-provider contains the original source codes in sourcemaps.

You can check src/@terra-money/wallet-provider/ in the Chrome Devtools / Sources Tab, and you can also use breakpoints here for debug.

(It may not be visible depending on your development settings such as Webpack.)

For Chrome Extension compatible wallet developers

Chrome Extension compatible wallet development guide

1. Create dApp for test

There is the dangerously__chromeExtensionCompatibleBrowserCheck option to allow you to create a test environment for wallet development.

By declaring the dangerously__chromeExtensionCompatibleBrowserCheck, you can make your wallet recognized as the chrome extension.

2. Register your wallet as default allow

If your wallet has been developed,

Please send me your wallet App link (Testlight version is OK)

And send me Pull Request by modifying DEFAULT_CHROME_EXTENSION_COMPATIBLE_BROWSER_CHECK in the packages/src/@terra-money/wallet-provider/env.ts file. (or just make an issue is OK)

Keywords

none

Last updated