0.2.5 • Published 2 years ago

test-bitcoinkit-test v0.2.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 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

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago