### Vite Configuration Example
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/index.html
A basic example of a Vite configuration file using TypeScript. This setup is common for modern web projects.
```typescript
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
});
```
--------------------------------
### Monorepo Development Setup
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes/README.md
Instructions for setting up the development environment for the @omnisat/lasereyes monorepo. This includes installing all project dependencies and running the development build.
```bash
pnpm install
pnpm dev
```
--------------------------------
### Create React App Scripts
Source: https://github.com/omnisat/lasereyes-mono/blob/main/apps/react-ui/README.md
Provides an overview of the standard scripts available in a Create React App project for managing the development lifecycle. These scripts are typically executed using npm or yarn.
```bash
npm start
# Runs the app in the development mode.
# Open http://localhost:3000 to view it in the browser.
npm test
# Launches the test runner in the interactive watch mode.
npm run build
# Builds the app for production to the `build` folder.
npm run eject
# Note: this is a one-way operation. Once you `eject`, you can’t go back!
```
--------------------------------
### Install Lasereyes Package
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/README.md
Installs the core Lasereyes library, which includes all necessary components for wallet integration.
```bash
npm install @omnisat/lasereyes
# OR
yarn add @omnisat/lasereyes
```
--------------------------------
### Install Dependencies
Source: https://github.com/omnisat/lasereyes-mono/blob/main/apps/demo.lasereyes.build/README.md
Installs the project dependencies using pnpm. This is a prerequisite for running the demo application locally.
```bash
pnpm install
```
--------------------------------
### Install @omnisat/lasereyes
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes/README.md
Installs the main @omnisat/lasereyes package using Yarn.
```bash
yarn add @omnisat/lasereyes
```
--------------------------------
### Sending Bitcoin Example
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Provides an example of sending Bitcoin, including getting recipient address and amount from input fields, and displaying the transaction ID or error.
```typescript
document.getElementById('send-button').addEventListener('click', async () => {
const recipient = document.getElementById('recipient').value;
const amountSats = parseInt(document.getElementById('amount').value);
try {
const txId = await client.sendBTC(recipient, amountSats);
document.getElementById('tx-display').textContent = `Transaction sent: ${txId}`;
} catch (error) {
console.error('Send error:', error);
}
});
```
--------------------------------
### Install Lasereyes UI Package
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/README.md
Installs the Lasereyes UI package, providing the modal interface and associated styles. This is recommended for direct modal integration.
```bash
npm install @omnisat/lasereyes-ui
# OR
yarn add @omnisat/lasereyes-ui
```
--------------------------------
### Basic Wallet Connection Example
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Illustrates how to initialize the LaserEyes client, connect to a wallet (e.g., UNISAT), and display the connected wallet address.
```typescript
import { LaserEyesClient, createStores, UNISAT } from '@omnisat/lasereyes-core';
const client = new LaserEyesClient(createStores());
client.initialize();
document.getElementById('connect-button').addEventListener('click', async () => {
try {
await client.connect(UNISAT);
const address = client.$store.get().address;
document.getElementById('address-display').textContent = address;
} catch (error) {
console.error('Connection error:', error);
}
});
```
--------------------------------
### Installation
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Installs the @omnisat/lasereyes-core package using different package managers.
```bash
# NPM
npm install @omnisat/lasereyes-core
# Yarn
yarn add @omnisat/lasereyes-core
# PNPM
pnpm install @omnisat/lasereyes-core
# Bun
bun install @omnisat/lasereyes-core
```
--------------------------------
### App Entry Point
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-react/index.html
The main application file that renders the root React component into the DOM.
```typescript
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './index.css';
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
);
```
--------------------------------
### Install @omnisat/lasereyes
Source: https://github.com/omnisat/lasereyes-mono/blob/main/prompts/lasereyes.md
Installs the main `@omnisat/lasereyes` package using pnpm. This package bundles both the core and React functionalities.
```bash
pnpm add @omnisat/lasereyes
```
--------------------------------
### App Entry Point
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/index.html
The main application file that renders the root React component into the DOM.
```typescript
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './index.css';
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
);
```
--------------------------------
### Basic React Component with TypeScript
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/index.html
An example of a simple functional React component written in TypeScript, demonstrating props and state management.
```typescript
import React, { useState } from 'react';
interface GreetingProps {
name: string;
}
const Greeting: React.FC = ({ name }) => {
const [count, setCount] = useState(0);
return (
Hello, {name}!
You clicked {count} times
);
};
export default Greeting;
```
--------------------------------
### Basic React Component with TypeScript
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-react/index.html
An example of a simple functional React component written in TypeScript, demonstrating props and state management.
```typescript
import React, { useState } from 'react';
interface GreetingProps {
name: string;
}
const Greeting: React.FC = ({ name }) => {
const [count, setCount] = useState(0);
return (
Hello, {name}!
You clicked {count} times
);
};
export default Greeting;
```
--------------------------------
### Demo Scripts
Source: https://github.com/omnisat/lasereyes-mono/blob/main/apps/demo.lasereyes.build/README.md
Provides common scripts for managing the demo application, including development, building for production, starting the server, and linting.
```bash
pnpm dev
pnpm build
pnpm start
pnpm lint
```
--------------------------------
### Create Vite Project with React and TypeScript
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/index.html
This command initializes a new project using Vite, a build tool that provides a fast development experience. It scaffolds a React project with TypeScript support.
```bash
npm create vite@latest lasereyes-mono --template react-ts
cd lasereyes-mono
npm install
npm run dev
```
--------------------------------
### Create Vite Project with React and TypeScript
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-react/index.html
This command initializes a new project using Vite, a build tool that provides a fast development experience. It scaffolds a React project with TypeScript support.
```bash
npm create vite@latest lasereyes-mono --template react-ts
cd lasereyes-mono
npm install
npm run dev
```
--------------------------------
### Error Handling Example
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Demonstrates how to handle errors when interacting with wallet operations using a try-catch block. Includes connecting to a wallet and fetching balance.
```typescript
try {
await client.connect(XVERSE);
const balance = await client.getBalance();
console.log('Balance:', balance.toString());
} catch (error) {
console.error('Wallet error:', error);
}
```
--------------------------------
### Working with Inscriptions
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Provides examples for creating an inscription with specified content and text type, and retrieving all inscriptions for the connected wallet.
```typescript
// Create an inscription
const content = Buffer.from('Hello, Ordinals!').toString('base64');
const txId = await client.inscribe(content, TEXT_PLAIN);
console.log('Inscription transaction ID:', txId);
// Get all inscriptions for the connected wallet
const inscriptions = await client.getInscriptions();
console.log('Inscriptions:', inscriptions);
```
--------------------------------
### Git Diff Command Example
Source: https://github.com/omnisat/lasereyes-mono/blob/main/prompts/ci-cd.md
An example of using `git diff` to check for changes in a specific directory. This command is fundamental to identifying which packages have been modified in the monorepo.
```Bash
git diff --name-only HEAD~1 HEAD | grep '^packages/lasereyes/'
```
--------------------------------
### React Wallet Integration Example
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes/README.md
Demonstrates how to integrate Bitcoin wallets in a React application using @omnisat/lasereyes-react. It shows setting up the LaserEyesProvider and using the useLaserEyes hook to connect to a wallet like Unisat.
```typescript
import { LaserEyesProvider, useLaserEyes, UNISAT, MAINNET } from '@omnisat/lasereyes-react';
function App() {
return (
);
}
function WalletInfo() {
const { address, connect } = useLaserEyes();
return (
{address ? (
Connected: {address}
) : (
)}
);
}
```
--------------------------------
### Update LaserEyes Installation Command
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This snippet demonstrates a change in the recommended package manager for installing the LaserEyes package. It reflects a shift from pnpm to yarn.
```bash
pnpm add @omnisat/lasereyes
```
```bash
yarn add @omnisat/lasereyes
```
--------------------------------
### Basic Wallet Operations
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Demonstrates basic operations with a connected Bitcoin wallet, including requesting accounts, getting balance, sending BTC, and signing messages.
```typescript
// Connect to a wallet
await client.connect(XVERSE);
// Request wallet accounts
const accounts = await client.requestAccounts();
console.log('Accounts:', accounts);
// Get wallet balance
const balance = await client.getBalance();
console.log('Balance:', balance.toString());
// Send Bitcoin
const txId = await client.sendBTC('recipient-address', 10000); // 10,000 satoshis
console.log('Transaction ID:', txId);
// Sign a message
const signature = await client.signMessage('Hello, LaserEyes!');
console.log('Signature:', signature);
// Disconnect
client.disconnect();
```
--------------------------------
### Basic robots.txt Configuration
Source: https://github.com/omnisat/lasereyes-mono/blob/main/apps/react-ui/public/robots.txt
This is a basic example of a robots.txt file that allows all web crawlers (*), and does not disallow any paths.
```robotstxt
User-agent: *
Disallow:
```
--------------------------------
### TypeScript React Component
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/index.html
An example of a simple React component written in TypeScript. It demonstrates basic props and state management.
```typescript
import React, { useState } from 'react';
interface GreetingProps {
name: string;
}
const Greeting: React.FC = ({ name }) => {
const [count, setCount] = useState(0);
return (
Hello, {name}!
You clicked {count} times
);
};
export default Greeting;
```
--------------------------------
### Package Version Update in package.json
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This snippet shows an example of how the package version is updated in the package.json file for the @omnisat/lasereyes package. It specifically highlights the change to a release candidate version.
```json
{
"name": "@omnisat/lasereyes",
"version": "0.0.28-rc.0",
"private": false,
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.mjs"
}
```
--------------------------------
### Setting up LaserEyesProvider
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-react/README.md
Wraps your React application with the LaserEyesProvider to provide access to wallet functionality via React context. Requires the 'network' prop.
```typescript
import { LaserEyesProvider } from '@omnisat/lasereyes-react';
function App() {
return (
{/* Rest of your application */}
);
}
```
--------------------------------
### LaserEyesClient API Reference
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Provides detailed documentation for the LaserEyesClient class, including its constructor, properties, and methods for interacting with Bitcoin wallets.
```APIDOC
LaserEyesClient:
constructor(stores: {
readonly $store: MapStore
readonly $network: WritableAtom
}, readonly config?: Config)
- Initializes the client with stores and optional configuration.
Properties:
- $store: MapStore - Tracks the application state.
- $network: WritableAtom - Tracks the current network type.
Methods:
- initialize(): void
- Initializes the client and checks for wallet providers.
- Example: client.initialize();
- connect(defaultWallet: ProviderType): Promise
- Connects to the specified wallet provider.
- Example: await client.connect(XVERSE);
- disconnect(): void
- Disconnects from the currently connected wallet provider.
- Example: client.disconnect();
- requestAccounts(): Promise
- Requests accounts from the connected wallet provider.
- Example: const accounts = await client.requestAccounts();
- getNetwork(): Promise
- Gets the current network for the connected wallet provider.
- Example: const network = await client.getNetwork();
- switchNetwork(network: NetworkType): Promise
- Switches the network for the connected wallet provider.
- Example: await client.switchNetwork('testnet');
- getBalance(): Promise
- Gets the balance of the connected wallet.
- Example: const balance = await client.getBalance();
- sendBTC(to: string, amount: number): Promise
- Sends Bitcoin to the specified address.
- Parameters:
- to: The recipient's Bitcoin address.
- amount: The amount of satoshis to send.
- Example: const txId = await client.sendBTC('recipientAddress', 10000);
- signMessage(message: string, toSignAddressOrOptions?: string | SignMessageOptions): Promise
- Signs a message with the connected wallet.
- Example: const signature = await client.signMessage('Hello, LaserEyes!');
- signPsbt(tx: string, finalize?: boolean, broadcast?: boolean): Promise
- Signs a Partially Signed Bitcoin Transaction (PSBT).
- Example: const result = await client.signPsbt(psbtHex, true, false);
- pushPsbt(tx: string): Promise
- Pushes a PSBT to the network.
- Example: const txId = await client.pushPsbt(psbtHex);
- getPublicKey(): Promise
- Gets the public key from the connected wallet.
- Example: const publicKey = await client.getPublicKey();
- getInscriptions(offset?: number, limit?: number): Promise
- Gets inscriptions (NFTs) associated with the connected wallet.
- Example: const inscriptions = await client.getInscriptions();
```
--------------------------------
### Development and Build Commands
Source: https://github.com/omnisat/lasereyes-mono/blob/main/prompts/lasereyes.md
Key commands for managing the lasereyes monorepo using turbo and pnpm. These commands cover development, building, and running specific applications.
```bash
pnpm dev
pnpm build
pnpm dev:demo
pnpm dev:react
```
--------------------------------
### Initialize and Connect Client
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Initializes the LaserEyesClient and connects to a specified wallet provider (e.g., Xverse).
```typescript
import { LaserEyesClient, createStores, createConfig, XVERSE } from '@omnisat/lasereyes-core';
// Create stores for state management
const stores = createStores();
// Optional: Create configuration with network setting
const config = createConfig({ network: 'mainnet' });
// Initialize the client
const client = new LaserEyesClient(stores, config);
client.initialize();
// Connect to a wallet (e.g., Xverse)
client.connect(XVERSE).then(() => {
console.log('Connected to Xverse wallet');
});
```
--------------------------------
### Basic App Integration with ConnectWalletButton
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/README.md
Shows a basic React application structure wrapped with `LaserEyesModalProvider` and includes the `ConnectWalletButton` for initiating the wallet connection flow. Requires importing the default styles.
```tsx
import { ConnectWalletButton, LaserEyesModalProvider } from '@omnisat/lasereyes/ui';
import '@omnisat/lasereyes/ui/style.css';
function App() {
return (
Welcome
);
}
export default App;
```
--------------------------------
### Unified Dependencies with workspace:*
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This snippet demonstrates how dependencies for @omnisat/lasereyes-core and @omnisat/lasereyes-react are now managed using the `workspace:*` syntax, ensuring version consistency across the project.
```javascript
Now, remember those `@omnisat/lasereyes-core` and `@omnisat/lasereyes-react` dependencies? They're now secured with the power of `workspace:*`, unifying versions across your project like never before.
```
--------------------------------
### Working with Runes
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Demonstrates sending Runes assets with specific rune IDs, amounts, and network configurations, as well as fetching rune balances.
```typescript
import { RUNES } from '@omnisat/lasereyes-core';
// Send runes
const txId = await client.send(RUNES, {
runeId: '123456:78',
fromAddress: 'senderAddress',
toAddress: 'recipientAddress',
amount: 100,
network: 'mainnet'
});
// Get rune balances
const runeBalances = await client.getMetaBalances(RUNES);
```
--------------------------------
### Home Component: Implement switchNet function for network switching
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
The 'Home' component now includes a new function, 'switchNet', to facilitate easy switching between mainnet and testnet. This function is also called within the 'App' component to ensure seamless navigation across different network options.
```javascript
function Home() {
const switchNet = (network) => {
// Logic to switch network
console.log(`Switching to ${network} network`);
};
return (
{/* ... component content ... */}
);
}
function App() {
// ... other App logic ...
return (
{/* ... other components ... */}
);
}
```
--------------------------------
### Import LaserEyesModalProvider
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/README.md
Demonstrates how to import the `LaserEyesModalProvider` component, which is essential for enabling wallet functionality within a React application.
```tsx
import { LaserEyesModalProvider } from '@omnisat/lasereyes/ui';
```
--------------------------------
### OpNetProvider Re-enabled and Refactored
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
The `OpNetProvider` has been re-enabled in the core client. Its internal code has undergone refactoring to address previous implementation concerns.
```plaintext
But the pièce de résistance of this update - the `OpNetProvider`. After hours of soul-searching, we've reenabled it in our core client. Also, we beat around the bush in its code, because let's not lie, we all have those 'what was I thinking?' moments. I mean come on, we're coders, not fortune tellers.
```
--------------------------------
### useLaserEyesModal Hook API
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/README.md
Defines the interface for the `useLaserEyesModal` hook, outlining the available properties and methods for interacting with the modal's state and configuration.
```APIDOC
useLaserEyesModal(): LaserEyesModalContext
LaserEyesModalContext:
isOpen: boolean - Indicates if the modal is currently open.
isLoading: boolean - Indicates if a wallet connection is in progress.
showModal: () => void - Function to open the wallet connection modal.
hideModal: () => void - Function to close the wallet connection modal.
config: LaserEyesModalConfig - The current configuration of the modal.
setConfig: (config: LaserEyesModalConfig) => void - Function to update the modal's configuration.
```
--------------------------------
### Documentation Updates: README Files
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This section covers modifications made to README.md files within different packages. Changes include adding empty lines, test paragraphs, and test lines to the end of these files.
```bash
# Add two empty line spaces to the end of @omnisat/lasereyes-react README.md
# (Example command, actual implementation might vary)
# echo "\n" >> packages/lasereyes-react/README.md
```
```bash
# Add a test line to the README.md in the lasereyes-core package folder
# echo "test line" >> packages/lasereyes-core/README.md
```
```bash
# Insert a new paragraph "test" at the end of the README file in lasereyes-core package
# echo "\n\ntest\n" >> packages/lasereyes-core/README.md
```
```bash
# Add another paragraph named "test" at the end of the README file in lasereyes-react package
# echo "\n\ntest\n" >> packages/lasereyes-react/README.md
```
```bash
# Add an additional test line to the README.md of lasereyes-react
# echo "additional test line" >> packages/lasereyes-react/README.md
```
--------------------------------
### Package.json and Package-lock.json Updates
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This entry details updates made to `package.json` and `package-lock.json` files for specific packages. It includes version changes and the transition to workspace dependencies.
```json
{
"name": "lasereyes-react",
"version": "0.0.0-rc.18",
"dependencies": {
"@omnisat/lasereyes-core": "workspace:*"
}
}
```
```json
{
"name": "lasereyes",
"version": "0.0.37-rc.17",
"dependencies": {
"@omnisat/lasereyes-core": "workspace:*"
}
}
```
```json
{
"name": "lasereyes-react",
"version": "0.0.5-rc.0"
}
```
```json
{
"name": "@omnisat/lasereyes",
"version": "0.0.37-rc.0"
}
```
--------------------------------
### Manual Modal Control with ConnectWalletModal
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/README.md
Demonstrates how to manually control the visibility of the wallet connection modal using the `ConnectWalletModal` component and React's `useState` hook. The `open` prop controls visibility, and `onClose` handles dismissal.
```tsx
import { useState } from 'react';
import { ConnectWalletModal } from '@omnisat/lasereyes/ui';
function ManualModalExample() {
const [isOpen, setIsOpen] = useState(false);
return (
<>
setIsOpen(false)} />
>
);
}
```
--------------------------------
### LaserEyes Usage with React Hooks
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This snippet shows the transition from using `useWallet` to `useLaserEyes` in React components for managing connection status. It also details changes in the `connect` function and the return value for connection status.
```javascript
We replaced `useWallet` with `useLaserEyes`.
We still kept the `connect` function but have it now accept `UNISAT` as a parameter.
The connection status confirmation is now given through `address` instead of `wallet`.
```
--------------------------------
### Wallet Providers Constants
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Imports various wallet provider constants from the '@omnisat/lasereyes-core' library.
```typescript
import {
LEATHER,
MAGIC_EDEN,
OKX,
OP_NET,
ORANGE,
OYL,
PHANTOM,
SPARROW,
UNISAT,
WIZZ,
XVERSE
} from '@omnisat/lasereyes-core';
```
--------------------------------
### GitHub Action Workflow: Git User Configuration
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
Configuration of the git user within the GitHub workflow release.yml file. This sets the user email to 'github-actions[bot]@users.noreply.github.com' and the username to 'github-actions[bot]' for commits made by the action.
```yaml
name: Release Workflow
...
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git User
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
# ... rest of the workflow
```
--------------------------------
### Provider Enumerator Update and OP_NET Support
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
The provider enumerator has been updated, and the `OP_NET` is now included as a supported wallet.
```plaintext
And guess what? We even updated the provider enumerator and added the `OP_NET` in supported wallets. Yes, hold your breaths – we are revolutionary like that.
```
--------------------------------
### ConnectWalletModal Component Props
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/README.md
Details the props available for the `ConnectWalletModal` component, which allow for controlling its visibility and handling close events.
```APIDOC
ConnectWalletModal:
props:
open: boolean - Controls whether the modal is visible. Required.
onClose: function - Callback function invoked when the modal should be closed. Required.
```
--------------------------------
### Add Phantom Wallet Provider
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This update introduces support for the Phantom wallet provider within the `ProviderEnumMap` in the `lasereyes-core` package. Users can now integrate Phantom wallet functionality. The official download link is provided for user convenience.
```text
ProviderEnumMap:
Add 'phantom' to the list of supported wallet providers.
Download Phantom wallet from: https://phantom.app/download
```
--------------------------------
### Custom Button with useLaserEyesModal Hook
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-ui/README.md
Illustrates how to use the `useLaserEyesModal` hook to create a custom button that triggers the wallet connection modal. The hook provides access to modal control functions like `showModal`.
```tsx
import { useLaserEyesModal } from '@omnisat/lasereyes/ui';
function CustomWalletButton() {
const { showModal } = useLaserEyesModal();
return ;
}
```
--------------------------------
### Release Candidate Versioning Convention
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
Illustrates the common convention for versioning release candidates in JavaScript packages, indicated by the '-rc.X' suffix.
```javascript
const currentVersion = "0.0.26-rc.0";
// This indicates a release candidate for version 0.0.26.
```
--------------------------------
### Dependency Management: Workspace* Usage
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This change involves updating dependencies in the `lasereyes` package to use `workspace:*` for `@omnisat/lasereyes-core` and `@omnisat/lasereyes-react`. This signifies the use of local versions of these packages, potentially speeding up development by making local changes immediately available.
```json
{
"name": "lasereyes",
"version": "0.0.103-rc.18",
"dependencies": {
"@omnisat/lasereyes-core": "workspace:*",
```
```json
"@omnisat/lasereyes-react": "workspace:*"
}
}
```
--------------------------------
### Sign and Broadcast PSBT
Source: https://github.com/omnisat/lasereyes-mono/blob/main/packages/lasereyes-core/README.md
Shows how to sign a Partially Signed Bitcoin Transaction (PSBT) and optionally broadcast it. Handles cases where immediate broadcasting is not performed.
```typescript
// Sign a PSBT
const { signedPsbtHex, signedPsbtBase64, txId } = await client.signPsbt(
psbtHex, // PSBT in hex format
true, // finalize
true // broadcast
);
// If not broadcasting immediately, push the PSBT later
if (!txId) {
const broadcastTxId = await client.pushPsbt(signedPsbtHex);
console.log('Broadcast transaction ID:', broadcastTxId);
}
```
--------------------------------
### Update README.md GIF Source
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
The source link for the 'herding_cats.gif' file in the README.md has been updated to resolve potential 404 errors and ensure the image loads correctly. This is a minor fix to improve documentation integrity.
```text
README.md:
Update the source link for the herding_cats.gif file.
```
--------------------------------
### Merge `main` into `dev` and Bump Next RC
Source: https://github.com/omnisat/lasereyes-mono/blob/main/prompts/ci-cd.md
This job runs after promoting versions to stable in `main`. It merges the `main` branch into the `dev` branch to keep `dev` up-to-date. Subsequently, it bumps the next RC version for packages in the `dev` branch, ensuring sequential processing to avoid conflicts.
```YAML
merge-main-into-dev:
runs-on: ubuntu-latest
needs: promote-to-stable-in-main
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Merge main into dev
run: |
git checkout dev
git pull origin dev
git merge main --no-ff -m "CI: Merge main into dev"
# Handle potential conflicts using stash if necessary
# git stash push -m "CI stash before merge"
# git merge main --no-ff
# git stash pop
git push origin HEAD:dev
- name: Bump next RC versions in dev
run: |
# Logic to bump the next RC versions after merge
# Example: npm version --preid rc --no-git-tag-version prerelease
echo "Bumping next RC versions in dev after merge..."
# Placeholder for actual version bumping commands
# git add .
# git commit -m "CI: Bump next RC versions"
# git push origin HEAD:dev
```
--------------------------------
### GitHub Release Syntax Update
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
Updates the GitHub release syntax from using 'github.ref' to 'github.ref_name'. This change is reflected in the release note generation process.
```APIDOC
GitHub Release Syntax:
- Deprecated: github.ref
- Recommended: github.ref_name
```
--------------------------------
### pnpm-lock.yaml: Dependency lock file
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
The pnpm-lock.yaml file manages the exact versions of project dependencies, ensuring reproducible builds. Specific changes within this file are not detailed in the release notes as per project agreement.
```yaml
# pnpm-lock.yaml content detailing dependency versions
lockfileVersion: 5.3
importers:
.:
dependencies:
react: 18.2.0
react-dom: 18.2.0
packages:
react@18.2.0:
resolution:
integrity: sha512-...
react-dom@18.2.0:
resolution:
integrity: sha512-...
# ... other dependencies ...
```
--------------------------------
### Create .npmrc file in GH Actions
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This snippet illustrates a step in a GitHub Actions workflow that creates an .npmrc file. It includes writing the NPM_TOKEN for registry authentication.
```yaml
- name: Create .npmrc file
if: success()
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
```
--------------------------------
### App.tsx and WalletCard.tsx Code Structure Improvement
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
Improvements made to the code structure within `App.tsx` and `WalletCard.tsx` files to enhance maintainability and organization.
```plaintext
To start, we improved the code structure in `App.tsx` and `WalletCard.tsx`. It's not like you'd notice, but we spent a bazillion cups of coffee to tweak that, so humor us. It was also necessary due to life-or-death alignment issues that lasted for approximately millimeters.
```
--------------------------------
### GitHub Action Workflow: Rebasing Main Branch
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This snippet describes a change in the GitHub Actions workflow for releases. A new command has been added to rebase the main branch from origin after the release notes commit. This ensures the main branch is synchronized with new commits made during the build process before the subsequent push.
```yaml
name: Release Workflow
...
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: pnpm install
- name: Build packages
run: pnpm run build
- name: Create Release Notes Commit
id: bump-versions-main
uses: ./github/actions/bump-versions-main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# ... other inputs
- name: Rebase main from origin
run: |
git checkout main
git pull origin main
git rebase main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish packages
run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# ... other steps
```
--------------------------------
### Package Version Updates
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
This section details various package version updates across different releases. It includes updates for `lasereyes-core`, `lasereyes-react`, and `lasereyes`, with some versions transitioning to a release candidate (rc) format.
```json
{
"name": "@omnisat/lasereyes-core",
"version": "0.0.33-rc.3"
}
```
```json
{
"name": "lasereyes-react",
"version": "0.0.26-rc.7"
}
```
```json
{
"name": "lasereyes",
"version": "0.0.103-rc.18"
}
```
```json
{
"name": "@omnisat/lasereyes-core",
"version": "0.0.0-rc.3"
}
```
```json
{
"name": "lasereyes",
"version": "0.0.37-rc.19"
}
```
```json
{
"name": "lasereyes-react",
"version": "0.0.0-rc.18"
}
```
```json
{
"name": "lasereyes",
"version": "0.0.37-rc.17"
}
```
```json
{
"name": "@omnisat/lasereyes-core",
"version": "0.0.7-rc.0"
}
```
```json
{
"name": "lasereyes-react",
"version": "0.0.5-rc.0"
}
```
```json
{
"name": "@omnisat/lasereyes",
"version": "0.0.37-rc.0"
}
```
--------------------------------
### Promote RC to Stable Versions in `main` Branch
Source: https://github.com/omnisat/lasereyes-mono/blob/main/prompts/ci-cd.md
This job executes on pushes to the `main` branch. It promotes the current RC versions of the packages to stable patch releases. The changes are then committed and pushed to the `main` branch.
```YAML
promote-to-stable-in-main:
runs-on: ubuntu-latest
needs: check-package-changes
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Promote RC to stable
run: |
# Logic to promote RC versions to stable patch versions
# Example: npm version patch --no-git-tag-version
echo "Promoting RC versions to stable in main branch..."
# Placeholder for actual version promotion commands
# git add .
# git commit -m "CI: Promote RC to stable"
# git push origin HEAD:main
```
--------------------------------
### Package Version Updates (v0.0.33)
Source: https://github.com/omnisat/lasereyes-mono/blob/main/RELEASE_NOTES.md
Details package version updates for @omnisat/lasereyes-core, lasereyes-react, and @omnisat/lasereyes in version v0.0.33. Includes version increments and notes on file updates.
```text
@omnisat/lasereyes-core: v0.0.5-rc.2 -> v0.0.5-rc.3
lasereyes-react: v0.0.3-rc.1 -> v0.0.3-rc.2 (package-lock.json, package.json updated)
@omnisat/lasereyes: v0.0.33 -> v0.0.34-rc.0
```