btc-wallet 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,9 +1,63 @@
1
- # Particle BTC Connect
1
+ # BTC Wallet
2
2
 
3
- First Account Abstraction Protocol on Bitcoin
3
+ BTC Wallet is a toolkit that enables the use of Bitcoin on the NEAR blockchain through the Satoshi protocol. It provides seamless integration for managing Bitcoin transactions and interactions within the NEAR ecosystem.
4
4
 
5
- ## Learn More
5
+ ## Features
6
6
 
7
- - [Documentation](https://docs.particle.network/developers/btc-connect)
8
- - [Website](https://particle.network)
9
- - [Dashbord](https://dashboard.particle.network)
7
+ - **NEAR Integration**: Leverage the Satoshi protocol to use Bitcoin on the NEAR blockchain.
8
+
9
+ ## Installation
10
+
11
+ Install `btc-wallet` using npm or yarn:
12
+
13
+ ```bash
14
+ pnpm install btc-wallet
15
+ or
16
+ yarn add btc-wallet
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ### Initialize BTC Wallet
22
+
23
+ To use BTC Wallet in your project, wrap your application with the `BtcWalletSelectorContextProvider`:
24
+
25
+ ```javascript
26
+ import BtcWalletSelectorContextProvider from 'btc-wallet';
27
+ function App() {
28
+ return (
29
+ <BtcWalletSelectorContextProvider>
30
+ {/* Your application components */}
31
+ </BtcWalletSelectorContextProvider>
32
+ );
33
+ }
34
+ ```
35
+
36
+ ### Setup Wallet Selector
37
+
38
+ Integrate BTC Wallet with NEAR's wallet selector:
39
+
40
+ ```javascript
41
+ import { setupWalletSelector } from '@near-wallet-selector/core';
42
+ import { setupBTCWallet } from 'btc-wallet';
43
+ setupWalletSelector({
44
+ network: 'mainnet', // or 'testnet'
45
+ modules: [setupBTCWallet()],
46
+ });
47
+ ```
48
+
49
+ ### Execute Burrow Supply
50
+
51
+ To execute a Burrow supply operation, use the `executeBurrowSupply` function:
52
+
53
+ ```javascript
54
+ import { executeBurrowSupply } from 'btc-wallet';
55
+ executeBurrowSupply({
56
+ amount: '0.01', // BTC amount
57
+ environment: 'mainnet', // or 'testnet'
58
+ }).then(() => {
59
+ console.log('Burrow supply executed successfully');
60
+ }).catch((error) => {
61
+ console.error('Error executing Burrow supply:', error);
62
+ });
63
+ ```
@@ -1,4 +1,4 @@
1
- declare const SignModal: ({ open, onClose, onOpen }: {
1
+ declare const SignModal: ({ open, onClose, onOpen, }: {
2
2
  open: boolean;
3
3
  onClose: () => void;
4
4
  onOpen: () => void;
@@ -1,7 +1,6 @@
1
1
  import { SmartAccount, type AAOptions, type AccountContract } from '@particle-network/aa';
2
2
  import { type WalletOption } from '@particle-network/wallet';
3
3
  import { type BaseConnector } from '../connector/base';
4
- import type { AccountInfo } from '../types/accountInfo';
5
4
  interface GlobalState {
6
5
  connectorId?: string;
7
6
  setConnectorId: (connectorId?: string) => void;
@@ -24,7 +23,6 @@ interface GlobalState {
24
23
  }) => Promise<string>;
25
24
  accountContract: AccountContract;
26
25
  setAccountContract: (accountContract: AccountContract) => void;
27
- getSmartAccountInfo: () => Promise<AccountInfo | undefined>;
28
26
  }
29
27
  interface ConnectOptions {
30
28
  projectId: string;
@@ -0,0 +1,10 @@
1
+ interface ExecuteBurrowSupplyParams {
2
+ /** btc amount, e.g. 0.01 */
3
+ amount: string;
4
+ /** fee rate, if not provided, will use the recommended fee rate from the btc node */
5
+ feeRate?: number;
6
+ /** environment, default is mainnet */
7
+ environment?: 'dev' | 'testnet' | 'mainnet';
8
+ }
9
+ export declare function executeBurrowSupply({ amount, feeRate, environment, }: ExecuteBurrowSupplyParams): Promise<void>;
10
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { InjectedWallet, WalletModuleFactory } from '@near-wallet-selector/core';
2
- import type { useBtcWalletSelector } from './../components/btcWalletSelectorContext';
2
+ import type { useBtcWalletSelector } from './btcWalletSelectorContext';
3
3
  declare global {
4
4
  interface Window {
5
5
  btcContext: ReturnType<typeof useBtcWalletSelector>;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  export * from './connector';
2
2
  export { ConnectProvider } from './context';
3
3
  export * from './hooks';
4
- export * from './components/btcWalletSelectorContext';
5
- export * from './utils/setupBTCWallet';
6
- export * from './components/hook';
7
- export * from './utils/bridgeSupplyUtils';
4
+ export * from './core/btcWalletSelectorContext';
5
+ export * from './core/setupBTCWallet';
6
+ export * from './core/bridgeSupplyUtils';
8
7
  export declare const getVersion: () => string;