@b3dotfun/sdk 0.0.5-alpha.2 → 0.0.5-alpha.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.5-alpha.2",
3
+ "version": "0.0.5-alpha.3",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -25,9 +25,8 @@ AnySpend handles the complexity of cross-chain operations, gas management, and p
25
25
 
26
26
  ### Prerequisites
27
27
 
28
- - Node.js v18.0.0+
28
+ - Node.js v20.15.0+
29
29
  - React 18/19
30
- - B3 Global Accounts integration (for authentication)
31
30
 
32
31
  ### Installation
33
32
 
@@ -40,16 +39,11 @@ pnpm add @b3dotfun/sdk
40
39
  ### Basic Setup
41
40
 
42
41
  ```tsx
43
- import { B3Provider } from "@b3dotfun/sdk/global-account/react";
44
42
  import { AnySpendProvider } from "@b3dotfun/sdk/anyspend/react";
45
43
  import "@b3dotfun/sdk/index.css";
46
44
 
47
45
  function App() {
48
- return (
49
- <B3Provider environment="production" theme="light">
50
- <AnySpendProvider>{/* Your app components */}</AnySpendProvider>
51
- </B3Provider>
52
- );
46
+ return <AnySpendProvider>{/* Your app components */}</AnySpendProvider>;
53
47
  }
54
48
  ```
55
49
 
@@ -88,31 +82,6 @@ function NFTMinting() {
88
82
  }
89
83
  ```
90
84
 
91
- ## 🔐 Authentication
92
-
93
- AnySpend requires B3 Global Accounts for user authentication. Users must be signed in before they can create orders.
94
-
95
- ```tsx
96
- import { SignInWithB3, useB3 } from "@b3dotfun/sdk/global-account/react";
97
-
98
- function AuthenticatedAnySpend() {
99
- const { account, isAuthenticated } = useB3();
100
-
101
- if (!isAuthenticated) {
102
- return (
103
- <SignInWithB3
104
- chain={{ id: 8333, name: "B3" /* ... */ }}
105
- partnerId="your-partner-id"
106
- sessionKeyAddress="0x..."
107
- onLoginSuccess={account => console.log("Authenticated!", account)}
108
- />
109
- );
110
- }
111
-
112
- return <AnySpendNFTButton nftContract={nftContract} recipientAddress={account.address} />;
113
- }
114
- ```
115
-
116
85
  ## 📚 API Reference
117
86
 
118
87
  ### Components
@@ -338,9 +307,6 @@ const order = await anyspendService.createOrder({
338
307
  ```bash
339
308
  # Optional: Custom AnySpend API endpoints
340
309
  NEXT_PUBLIC_ANYSPEND_BASE_URL=https://your-custom-anyspend-api.com
341
-
342
- # Required for B3 Global Accounts
343
- NEXT_PUBLIC_GLOBAL_ACCOUNTS_PARTNER_ID=your-partner-id
344
310
  ```
345
311
 
346
312
  ### Network Configuration
@@ -484,13 +450,12 @@ enum OrderStatus {
484
450
 
485
451
  ### Common Error Codes
486
452
 
487
- | Error Code | Description | Recovery Strategy |
488
- | ------------------------- | --------------------------------- | ------------------------------------ |
489
- | `SLIPPAGE` | Price movement exceeded tolerance | Retry with higher slippage tolerance |
490
- | `INSUFFICIENT_BALANCE` | User doesn't have enough tokens | Request user to add funds |
491
- | `NETWORK_ERROR` | RPC or network issues | Retry after a delay |
492
- | `QUOTE_EXPIRED` | Price quote is no longer valid | Get a fresh quote |
493
- | `AUTHENTICATION_REQUIRED` | User not signed in | Prompt user to authenticate |
453
+ | Error Code | Description | Recovery Strategy |
454
+ | ---------------------- | --------------------------------- | ------------------------------------ |
455
+ | `SLIPPAGE` | Price movement exceeded tolerance | Retry with higher slippage tolerance |
456
+ | `INSUFFICIENT_BALANCE` | User doesn't have enough tokens | Request user to add funds |
457
+ | `NETWORK_ERROR` | RPC or network issues | Retry after a delay |
458
+ | `QUOTE_EXPIRED` | Price quote is no longer valid | Get a fresh quote |
494
459
 
495
460
  ### Error Handling Best Practices
496
461
 
@@ -607,18 +572,6 @@ Check that:
607
572
  Orders will auto-refund after 30 minutes if no deposit is detected.
608
573
  ```
609
574
 
610
- **Q: "Authentication required" error**
611
-
612
- ```
613
- A: User needs to sign in with B3 Global Accounts first:
614
-
615
- <SignInWithB3
616
- chain={{ id: 8333, name: "B3" }}
617
- partnerId="your-partner-id"
618
- sessionKeyAddress="0x..."
619
- />
620
- ```
621
-
622
575
  **Q: React Native build issues**
623
576
 
624
577
  ```
@@ -649,8 +602,8 @@ const quote = await anyspendService.getQuote(true, quoteRequest);
649
602
  ### Support Channels
650
603
 
651
604
  - **Documentation**: [https://docs.b3.fun](https://docs.b3.fun)
652
- - **GitHub Issues**: [https://github.com/b3-fun](https://github.com/b3-fun)
653
- - **Discord**: [https://discord.gg/b3fun](https://discord.gg/b3fun)
605
+ - **GitHub Issues**: [https://github.com/b3-fun/b3/issues](https://github.com/b3-fun/b3/issues)
606
+ - **Discord**: [https://discord.gg/b3dotfun](https://discord.gg/b3dotfun)
654
607
 
655
608
  ## 🤝 Contributing
656
609
 
@@ -668,8 +621,8 @@ We welcome contributions! Here's how to get started:
668
621
 
669
622
  ```bash
670
623
  # Clone the repo
671
- git clone https://github.com/b3-fun/b3-monorepo.git
672
- cd b3-monorepo
624
+ git clone https://github.com/b3-fun/b3.git
625
+ cd b3
673
626
 
674
627
  # Install dependencies
675
628
  pnpm install
@@ -679,16 +632,4 @@ pnpm dev
679
632
 
680
633
  # Build the SDK
681
634
  pnpm sdk:build
682
-
683
- # Test in example apps
684
- cd apps/login-minimal-example
685
- pnpm dev
686
635
  ```
687
-
688
- ## 📄 License
689
-
690
- This project is licensed under the MIT License. See the [LICENSE](../../../LICENSE) file for details.
691
-
692
- ---
693
-
694
- **Ready to get started?** Check out our [Quick Start Guide](https://docs.b3.fun/anyspend/quickstart) or explore the [example applications](../../../apps/) in this repository.