Initial commit: n8n Strike API node
- Add Strike API credentials configuration - Implement Strike node with 9 resources (Account, Balance, Currency Exchange, Deposit, Invoice, Payment, Payment Method, Payout, Rates) - Add comprehensive operation descriptions for all resources - Include CLAUDE.MD documentation - Set up build configuration with TypeScript, ESLint, and Prettier 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
216
CLAUDE.MD
Normal file
216
CLAUDE.MD
Normal file
@ -0,0 +1,216 @@
|
||||
# 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
|
||||
|
||||
## 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
|
||||
│ ├── 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
|
||||
|
||||
### 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
|
||||
Reference in New Issue
Block a user