@bestinslot/wallet-kit 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +108 -0
  2. package/dist/balances-BQiaAIaq.js +9627 -0
  3. package/dist/browser.js +205 -0
  4. package/dist/core.js +39 -0
  5. package/dist/mint-BXVHw4CQ.js +70722 -0
  6. package/dist/node.js +1787 -0
  7. package/dist/react.js +14 -0
  8. package/dist/register-browser-providers-CLLT6W6P.js +499 -0
  9. package/dist/types/adapters/react/use-network.d.ts +8 -0
  10. package/dist/types/adapters/react/use-wallet.d.ts +15 -0
  11. package/dist/types/adapters/vue/use-network.d.ts +12 -0
  12. package/dist/types/api/balances.d.ts +52 -0
  13. package/dist/types/api/brc20.d.ts +110 -0
  14. package/dist/types/api/helpers.d.ts +3 -0
  15. package/dist/types/api/mint.d.ts +57 -0
  16. package/dist/types/api/modal.d.ts +3 -0
  17. package/dist/types/api/swap.d.ts +122 -0
  18. package/dist/types/api/wallet.browser.d.ts +2 -0
  19. package/dist/types/api/wallet.d.ts +6 -0
  20. package/dist/types/api/wallet.node.d.ts +4 -0
  21. package/dist/types/browser.d.ts +10 -0
  22. package/dist/types/components/Dev.vue.d.ts +11 -0
  23. package/dist/types/components/connect-modal-view.d.ts +28 -0
  24. package/dist/types/components/dev/BRC20.vue.d.ts +2 -0
  25. package/dist/types/components/dev/Button.vue.d.ts +17 -0
  26. package/dist/types/components/dev/Input.vue.d.ts +12 -0
  27. package/dist/types/components/dev/Label.vue.d.ts +17 -0
  28. package/dist/types/components/dev/Select.vue.d.ts +17 -0
  29. package/dist/types/components/dev/SessionInfo.vue.d.ts +6 -0
  30. package/dist/types/core/bis.d.ts +21 -0
  31. package/dist/types/core/bis_swap.d.ts +622 -0
  32. package/dist/types/core/brc20.d.ts +229 -0
  33. package/dist/types/core/connect-modal.d.ts +15 -0
  34. package/dist/types/core/helpers.d.ts +212 -0
  35. package/dist/types/core/mint.d.ts +364 -0
  36. package/dist/types/core/modal.d.ts +21 -0
  37. package/dist/types/core/providers.d.ts +90 -0
  38. package/dist/types/core/register-browser-providers.d.ts +1 -0
  39. package/dist/types/core/register-local-provider.d.ts +1 -0
  40. package/dist/types/core/storage.d.ts +19 -0
  41. package/dist/types/core/store-network.d.ts +20 -0
  42. package/dist/types/core/store.d.ts +39 -0
  43. package/dist/types/core.d.ts +10 -0
  44. package/dist/types/lib/bitcoin.d.ts +8 -0
  45. package/dist/types/lib/dev-worker.d.ts +1 -0
  46. package/dist/types/lib/dev.d.ts +9 -0
  47. package/dist/types/lib/swap-constants.d.ts +7 -0
  48. package/dist/types/lib/swap-reporting.d.ts +80 -0
  49. package/dist/types/lib/uniswap_ops.d.ts +238 -0
  50. package/dist/types/lib/web3.d.ts +7 -0
  51. package/dist/types/node.d.ts +9 -0
  52. package/dist/types/provider/api.d.ts +97 -0
  53. package/dist/types/provider/leather.d.ts +2 -0
  54. package/dist/types/provider/local.d.ts +39 -0
  55. package/dist/types/provider/okx.d.ts +2 -0
  56. package/dist/types/provider/unisat.d.ts +2 -0
  57. package/dist/types/provider/xverse.d.ts +2 -0
  58. package/dist/types/react.d.ts +3 -0
  59. package/dist/types/types/common.d.ts +33 -0
  60. package/dist/types/types/global.d.ts +26 -0
  61. package/dist/types/types/inscription.d.ts +147 -0
  62. package/dist/types/types/vite-env.d.ts +7 -0
  63. package/dist/types/types/wallet.d.ts +50 -0
  64. package/dist/types/vue.d.ts +2 -0
  65. package/dist/vue.js +13 -0
  66. package/package.json +133 -0
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # ๐ŸŸ  Best in Slot โ€“ Bitcoin Wallet Kit
2
+
3
+ ![Best in Slot](https://blog.bestinslot.xyz/img/og.png)
4
+
5
+ A lightweight JavaScript library for connecting Bitcoin wallets with a unified API. Perfect for
6
+ Bitcoin-native dApps and web apps needing simple, multi-wallet support.
7
+
8
+ ## ๐Ÿ”Œ Supported Wallets
9
+
10
+ - โœ… OKX
11
+ - โœ… Unisat
12
+ - โœ… Xverse
13
+ - โœ… Leather
14
+
15
+ ## ๐Ÿ“š Documentation
16
+
17
+ Full guides and an API reference live in [`docs/`](./docs/README.md):
18
+
19
+ - [Getting started](./docs/getting-started.md)
20
+ - [Wallet connection](./docs/wallet-connection.md)
21
+ - [Inscriptions](./docs/inscriptions.md) ยท [BRC-2.0](./docs/brc20.md) ยท [Swap](./docs/swap.md) ยท
22
+ [Balances](./docs/balances.md)
23
+ - [Testing](./docs/testing.md)
24
+
25
+ The full **API reference** is published at
26
+ <https://bestinslot-xyz.github.io/bis-wallet-kit/> (regenerated from source on
27
+ every push to `main`). To build it locally, run `pnpm docs:api` (output in
28
+ `docs/api/`).
29
+
30
+ ## ๐Ÿ“ฆ Entry points
31
+
32
+ | Import | Use it for |
33
+ | -------------------------------- | ---------------------------------------------------------------------- |
34
+ | `@bestinslot/wallet-kit` | Full browser build: extension wallets + connect modal (framework-free) |
35
+ | `@bestinslot/wallet-kit/browser` | Explicit alias of the default entry โ€” the full browser build |
36
+ | `@bestinslot/wallet-kit/core` | Browser features without the modal โ€” bring your own connect UI |
37
+ | `@bestinslot/wallet-kit/node` | Server build: local (WIF) wallet, no modal, no Vue |
38
+ | `@bestinslot/wallet-kit/react` | React hooks: `useNetwork`, `useWallet` |
39
+ | `@bestinslot/wallet-kit/vue` | Vue composable: `useNetwork` |
40
+
41
+ The connect modal no longer depends on Vue, so React and vanilla apps can call `modal.connect()`
42
+ without installing Vue.
43
+
44
+ ## ๐Ÿš€ Development & Build
45
+
46
+ Built with Vite, Vue 3, TypeScript and Tailwind CSS 4.
47
+
48
+ - [Vite](https://vite.dev/)
49
+ - [Vue 3](https://vuejs.org/)
50
+ - [Tailwind CSS](https://tailwindcss.com/)
51
+
52
+ The template uses Vue 3 `<script setup>` SFCs, check out the
53
+ [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
54
+
55
+ ```bash
56
+ # Install dependencies
57
+ pnpm install
58
+
59
+ # Start development server
60
+ pnpm dev
61
+
62
+ # Build for production
63
+ pnpm build
64
+
65
+ # Preview production build
66
+ pnpm preview
67
+
68
+ # Publish
69
+ npm pack --dry-run
70
+
71
+ pnpm build
72
+ pnpm publish
73
+ ```
74
+
75
+ ## ๐Ÿ“ƒ Examples
76
+
77
+ ```ts
78
+ import { modal, wallet } from '@bestinslot/wallet-kit'
79
+
80
+ // Connect wallet
81
+ try {
82
+ const data = await modal.connect()
83
+
84
+ console.warn('Connected to wallet: ', data)
85
+ }
86
+ catch (e) {
87
+ console.error('Connection failed: ', e)
88
+ }
89
+
90
+ // Disconnect from the wallet and clear session
91
+ modal.disconnect()
92
+
93
+ // Get stored wallet data
94
+ const data = wallet.getSession()
95
+
96
+ // Get Payment wallet
97
+ const paymentWallet = wallet.getPaymentWallet()
98
+ console.warn(paymentWallet?.address)
99
+
100
+ // Get BTC network
101
+ const network = wallet.getNetwork()
102
+
103
+ // Set BTC network
104
+ wallet.setNetwork('testnet') // defaults to mainnet
105
+
106
+ // Theme - defaults to 'system'
107
+ modal.setTheme('dark') // system, dark, light
108
+ ```