0.2.5 • Published 3 years ago

test-bitcoinkit-test v0.2.5

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

BitcoinKit

The easiest way to connect a bitcoin wallet BitcoinKit is a React library that makes it fast and easy to connect your dapp with bitcoin network

Installation

npm install test-bitcoinkit-test
# or
pnpm install test-bitcoinkit-test
# or
yarn add test-bitcoinkit-test
#or
bun install test-bitcoinkit-test

Import

App

// "use client" if you are using next.js
import React from "react"
import { BitcoinKitProvider } from "test-bitcoinkit-test"
import "test-bitcoinkit-test/dist/index.css"

export default function App() {
return (
	<BitcoinKitProvider>
		<YourApp />
	</BitcoinKitProvider>
	)
}

Wallet Options

Available wallets: {ordinalSafe, unisat, xverse, other} from "test-bitcoinkit-test"

BitcoinKitProvider({ children, options }: {
    children: React.ReactNode;
    options?: {
        wallets?: Wallet[];
    };
}):

ConnectButton

// "use client" if you are using next.js
import { ConnectButton } from "test-bitcoinkit-test"

export default function YourApp() {
	return <ConnectButton />
}

useBitcoinKit Hook

useBitcoinKit(): {
	account: Account;
	signBip322: (message: string) =>  Promise<string>;
	verifyBip322: (message: string, signature: string, address: string) => Promise<boolean>;
	authenticateWithBip322: (message: string) => Promise<boolean>;
	authenticateWithGivenSignature: (message: string, signature: string, address: string) => Promise<boolean>;
};

Account type

type  Account = {
	connected: boolean;
	address: string | null;
	balance: number;
	network: "livenet" | "testnet" | null;
	authenticated: boolean;
};
0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago