Files
n8n-nodes-strike/CLAUDE.MD
Martien 7e99c8fee7 Add Event resource and update branding
- Add Event resource with get and getAll operations
- Implement event tracking for Strike API events
- Update node icon from strike.svg to strike.png
- Add comprehensive README.md with disclaimer about AI-assisted development
- Update CLAUDE.MD documentation with Event resource details
- Build dist files with new Event operations

Changes include:
- New EventDescription.ts with event operations
- Updated Strike.node.ts to handle event resource
- Icon changed to PNG format for better compatibility
- Production-ready README with usage examples and warnings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-10 11:23:37 +01:00

223 lines
6.3 KiB
Markdown

# n8n-nodes-strike
n8n community node for Strike API - Bitcoin payments and Lightning Network integration.
## Project Overview
This is an n8n community node package that provides integration with the Strike API, enabling Bitcoin and Lightning Network payment operations within n8n workflows.
### Key Features
- **Bitcoin & Lightning Network Payments**: Send and receive Bitcoin payments via Lightning Network
- **Invoice Management**: Create and manage Strike invoices
- **Account Operations**: Query account profiles, balances, and limits
- **Currency Exchange**: Convert between different currencies using Strike's exchange service
- **Deposit & Payout Management**: Handle deposits and payouts with fee estimation
- **Payment Methods**: Manage bank account payment methods
- **Rate Information**: Access real-time exchange rates and ticker data
- **Event Tracking**: Monitor and retrieve Strike events for your account
## Project Structure
```
n8n-nodes-strike/
├── credentials/
│ └── StrikeApi.credentials.ts # Strike API authentication
├── nodes/
│ └── Strike/
│ ├── Strike.node.ts # Main node implementation
│ ├── StrikeApi.ts # API request handlers
│ └── descriptions/ # Resource operation descriptions
│ ├── AccountDescription.ts
│ ├── BalanceDescription.ts
│ ├── CurrencyExchangeDescription.ts
│ ├── DepositDescription.ts
│ ├── EventDescription.ts
│ ├── InvoiceDescription.ts
│ ├── PaymentDescription.ts
│ ├── PaymentMethodDescription.ts
│ ├── PayoutDescription.ts
│ ├── RatesDescription.ts
│ └── index.ts
├── dist/ # Built files (generated)
├── package.json
├── tsconfig.json
├── gulpfile.js
└── .eslintrc.js
```
## Resources & Operations
### Account
- `getProfile`: Get account profile by account ID
- `getProfileByHandle`: Get account profile by Strike handle
- `getLimits`: Get account limits
### Balance
- `get`: Get current account balances
### Currency Exchange
- `createQuote`: Create a currency exchange quote
- `getQuote`: Get a currency exchange quote by ID
- `executeQuote`: Execute a currency exchange quote
### Deposit
- `create`: Create a deposit
- `get`: Get deposit by ID
- `getAll`: Get all deposits with optional filters
- `estimateFee`: Estimate deposit fee
### Event
- `get`: Get event by ID
- `getAll`: Get all events with optional filters
### Invoice
- `create`: Create a new invoice
- `get`: Get invoice by ID
- `getAll`: Get all invoices with optional filters
- `createQuote`: Create a quote for an invoice
- `cancel`: Cancel an invoice
### Payment
- `get`: Get payment by ID
- `createLightningQuote`: Create a Lightning Network payment quote
- `createOnchainQuote`: Create an on-chain Bitcoin payment quote
- `createLnurlQuote`: Create a LNURL payment quote
- `getLnurlDetails`: Get LNURL details
- `executeQuote`: Execute a payment quote
### Payment Method
- `createBank`: Add a bank account payment method
- `get`: Get payment method by ID
- `getAll`: Get all payment methods
- `delete`: Delete a payment method
### Payout
- `create`: Create a payout
- `get`: Get payout by ID
- `getAll`: Get all payouts with optional filters
- `initiate`: Initiate a payout
### Rates
- `getTicker`: Get exchange rate ticker for a currency pair
## Technical Details
### Authentication
The node uses Bearer token authentication with the Strike API. Users configure:
- **API Key**: Strike API key from the Strike Dashboard
- **Environment**: Production or Sandbox
Base URL: `https://api.strike.me/v1`
### API Request Implementation
Located in `nodes/Strike/StrikeApi.ts`:
- `strikeApiRequest`: Standard API request handler
- `strikeApiRequestAllItems`: Pagination handler for list endpoints
### Node Implementation Pattern
The main node (`Strike.node.ts`) follows n8n's standard patterns:
1. User selects a **Resource** (e.g., invoice, payment)
2. User selects an **Operation** for that resource (e.g., create, get)
3. Operation-specific parameters are displayed
4. Node executes the operation via the Strike API
Error handling includes:
- Try/catch blocks for each operation
- Support for "continue on fail" mode
- Proper execution metadata construction
## Development
### Build Commands
```bash
npm run build # Build TypeScript and icons
npm run dev # Watch mode for development
npm run format # Format code with Prettier
npm run lint # Lint with ESLint
npm run lintfix # Auto-fix linting issues
```
### Dependencies
- **n8n-workflow**: ^1.22.0 (peer dependency)
- **TypeScript**: ^5.3.0
- **ESLint**: ^8.56.0
- **Prettier**: ^3.1.0
- **Gulp**: ^4.0.2
### Build Output
The build process:
1. Compiles TypeScript files from `nodes/` and `credentials/` to `dist/`
2. Processes icons with Gulp
3. Outputs to `dist/` directory which is published to npm
## Package Configuration
### n8n Integration
```json
"n8n": {
"n8nNodesApiVersion": 1,
"credentials": ["dist/credentials/StrikeApi.credentials.js"],
"nodes": ["dist/nodes/Strike/Strike.node.js"]
}
```
### Keywords
- n8n-community-node-package
- strike
- bitcoin
- lightning
- payments
## Installation
```bash
npm install n8n-nodes-strike
```
Or install directly in n8n via the Community Nodes menu.
## Usage Notes
- All monetary amounts are handled as strings in the API to maintain precision
- Currency codes follow ISO standards (USD, BTC, etc.)
- Lightning Network operations support both invoices and LNURL
- Pagination is supported for list operations (deposits, invoices, payouts, payment methods)
- OData query parameters are used for filtering and sorting list operations
## API Documentation
Strike API Documentation: https://docs.strike.me/api/
## Repository
- **Homepage**: https://github.com/yourusername/n8n-nodes-strike
- **Repository**: https://github.com/yourusername/n8n-nodes-strike.git
## License
MIT
## Current Status
- Version: 0.1.0
- Node API Version: 1
- Status: Development
## Future Enhancements
Potential areas for expansion:
- Webhook support for payment notifications
- Subscription/recurring payment support
- Additional Strike API endpoints as they become available
- Enhanced error messages and validation
- Test coverage