-
Notifications
You must be signed in to change notification settings - Fork 567
[Docs] Update pregenerate wallets API endpoint and request format #7791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] Update pregenerate wallets API endpoint and request format #7791
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe documentation for the wallet pregeneration API was updated to reflect a new endpoint, revised request and response formats, updated HTTP headers, and changes in parameter naming and allowed values. Example payloads and response structures were revised, and minor textual corrections were applied. Additionally, the custom authentication documentation was enhanced with new HTTP request examples for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7791 +/- ##
==========================================
+ Coverage 56.34% 56.35% +0.01%
==========================================
Files 905 905
Lines 58788 58796 +8
Branches 4141 4143 +2
==========================================
+ Hits 33122 33135 +13
+ Misses 25561 25556 -5
Partials 105 105
🚀 New features to boost your workflow:
|
``` | ||
https://in-app-wallet.thirdweb.com/api/v1/pregenerate | ||
```http | ||
POST https://in-app-wallet.thirdweb.com/v1/wallets/user/pregenerate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API endpoint hostname in this example doesn't match the one used in the curl example below (line 99). For consistency, this should be updated to https://api.thirdweb.com/v1/wallets/user/pregenerate
instead of https://in-app-wallet.thirdweb.com/v1/wallets/user/pregenerate
to align with both the curl example and the updated endpoint mentioned in the PR description.
POST https://in-app-wallet.thirdweb.com/v1/wallets/user/pregenerate | |
POST https://api.thirdweb.com/v1/wallets/user/pregenerate |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
"address": "string", | ||
"createdAt": "string", | ||
"profile": "object[]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation of the profile
field should be aligned with the address
and createdAt
fields for consistent formatting in the JSON response example. Consider adjusting to:
{
"result": {
"address": "string",
"createdAt": "string",
"profile": "object[]"
}
}
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
``` | ||
|
||
### Custom user id based wallets | ||
|
||
``` | ||
{ strategy: "custom_auth_endpoint", userId: "some_user_id" } | ||
{ type: "custom_auth_endpoint", userId: "some_user_id" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an inconsistency in the parameter naming for custom user ID based wallets. In the request body description (line 60), the parameter is referred to as user
, but in the example JSON (line 70), it's shown as userId
. These should be aligned to provide clear documentation. Consider standardizing on one parameter name throughout the documentation.
{ type: "custom_auth_endpoint", userId: "some_user_id" } | |
{ type: "custom_auth_endpoint", user: "some_user_id" } |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
apps/portal/src/app/wallets/pregenerate-wallets/page.mdx (2)
123-127
: Clarifyprofile
field type
"profile": "object[]"
reads as a string literal, not a JSON type. Use an array notation to prevent ambiguity.- "profile": "object[]" + "profile": [ /* user profile objects */ ]
36-36
: Minor typo: duplicated word
wallet wallet
➜wallet
-To pregenerate an in-app or ecosystem wallet wallet, you can make a `POST` request to the following endpoint: +To pregenerate an in-app or ecosystem wallet, you can make a `POST` request to the following endpoint:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
(4 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
📚 Learning: applies to packages/thirdweb/src/wallets/** : eip-1193, eip-5792, eip-7702 standard support in walle...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Applied to files:
apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
📚 Learning: applies to packages/thirdweb/src/wallets/** : support for in-app wallets (social/email login)...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)
Applied to files:
apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
📚 Learning: applies to test/src/test-wallets.ts : predefined test accounts are in `test/src/test-wallets.ts`...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in `test/src/test-wallets.ts`
Applied to files:
apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
📚 Learning: applies to packages/thirdweb/src/wallets/** : unified `wallet` and `account` interfaces in wallet ar...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Unified `Wallet` and `Account` interfaces in wallet architecture
Applied to files:
apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
📚 Learning: surface breaking changes prominently in pr descriptions...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Applied to files:
apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
📚 Learning: applies to packages/thirdweb/src/wallets/** : smart wallets with account abstraction...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Smart wallets with account abstraction
Applied to files:
apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
🪛 Gitleaks (8.27.2)
apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
102-102: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Size
- GitHub Check: Analyze (javascript)
size-limit report 📦
|
c1ee34b
to
b3d9076
Compare
b3d9076
to
5b8417b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
apps/portal/src/app/wallets/custom-auth/page.mdx (1)
97-103
: Clarify “strategy” vs “type” naming difference.In SDK snippets the property is still called
strategy
, whereas raw HTTP examples usetype
. If this is an intentional API/SDK divergence, add a one-liner explaining the difference; otherwise align the field names to prevent confusion.
🧹 Nitpick comments (1)
apps/portal/src/app/wallets/custom-auth/page.mdx (1)
32-33
: Correct typo: “OICD” → “OIDC”.The abbreviation is misspelled in the tab label, which can confuse readers searching the page for OIDC-related content.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/portal/src/app/wallets/custom-auth/page.mdx
(5 hunks)apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/portal/src/app/wallets/pregenerate-wallets/page.mdx
🧰 Additional context used
🧠 Learnings (24)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : use `authorization: bearer` header – neve...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use `Authorization: Bearer` header – never embed tokens in URLs
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to packages/thirdweb/src/wallets/** : eip-1193, eip-5792, eip-7702 standard support in walle...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : always call `getauthtoken()` to retrieve ...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Always call `getAuthToken()` to retrieve JWT from cookies on server side
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to packages/thirdweb/src/wallets/** : support for in-app wallets (social/email login)...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/api/**/*.{ts,tsx} : always call `getauthtoken()` to get the jwt from cookies...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/api/**/*.{ts,tsx} : Always call `getAuthToken()` to get the JWT from cookies.
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to test/src/test-wallets.ts : predefined test accounts are in `test/src/test-wallets.ts`...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to test/src/test-wallets.ts : Predefined test accounts are in `test/src/test-wallets.ts`
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/api/**/*.{ts,tsx} : pass the token in the `authorization: bearer` header – n...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/api/**/*.{ts,tsx} : Pass the token in the `Authorization: Bearer` header – never embed it in the URL.
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/*client.tsx : create light wrappers (e.g. `fetchjson`) that automatically at...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Create light wrappers (e.g. `fetchJson`) that automatically attach the JWT from cookies/session when calling internal API routes.
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : keep tokens secret via internal api route...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Keep tokens secret via internal API routes or server actions
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/*client.tsx : interactive ui that relies on hooks (`usestate`, `useeffect`, ...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : use `navlink` for internal navigation wit...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use `NavLink` for internal navigation with automatic active states in dashboard and playground apps
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/*client.tsx : anything that consumes hooks from `@tanstack/react-query` or t...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from `@tanstack/react-query` or thirdweb SDKs.
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : prefer composable primitives over custom markup: `button`, `in...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Prefer composable primitives over custom markup: `Button`, `Input`, `Select`, `Tabs`, `Card`, `Sidebar`, `Separator`, `Badge`.
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : import ui primitives from `@/components/u...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : use design system tokens (e.g., `bg-card`...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Use design system tokens (e.g., `bg-card`, `border-border`, `text-muted-foreground`)
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/*.{tsx,jsx} : use `navlink` (`@/components/ui/navlink`) for internal navigat...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Use `NavLink` (`@/components/ui/NavLink`) for internal navigation so active states are handled automatically.
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/*client.tsx : pages requiring fast transitions where data is prefetched on t...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Pages requiring fast transitions where data is prefetched on the client.
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/*.{ts,tsx} : redirect logic using `redirect()` from `next/navigation`....
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{ts,tsx} : Redirect logic using `redirect()` from `next/navigation`.
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : wrap client-side data fetching calls in r...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Wrap client-side data fetching calls in React Query (`@tanstack/react-query`)
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to packages/thirdweb/src/wallets/** : unified `wallet` and `account` interfaces in wallet ar...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Unified `Wallet` and `Account` interfaces in wallet architecture
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to packages/thirdweb/src/wallets/** : smart wallets with account abstraction...
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Smart wallets with account abstraction
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: in the thirdweb/js project, the react namespace is available for type annotations (like react.fc) wi...
Learnt from: MananTank
PR: thirdweb-dev/js#7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
📚 Learning: applies to dashboard/**/*client.tsx : when you need access to browser apis (localstorage, window, in...
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).
Applied to files:
apps/portal/src/app/wallets/custom-auth/page.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Unit Tests
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Lint Packages
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/portal/src/app/wallets/custom-auth/page.mdx (1)
72-74
: Verify endpoint correctness (/generic-auth
for JWT flow).The JWT example points to
POST https://in-app-wallet.thirdweb.com/v1/wallets/user/generic-auth
.Is the JWT strategy really intended to hit the same generic-auth route, or should this be a dedicated
/jwt-auth
(or similar) endpoint? Confirm against the backend contract to avoid 4xx surprises.
5b8417b
to
e1d9564
Compare
e1d9564
to
13eccc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes BLD-47
PR-Codex overview
This PR updates the documentation for the
wallets
feature in thethirdweb
portal, refining usage examples and correcting endpoint details for authentication and wallet pregeneration.Detailed summary
typescript
tohttp
in usage examples.<your-jwt-token>
to<your-jwt>
.Summary by CodeRabbit