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>
This commit is contained in:
2025-12-10 11:23:37 +01:00
parent 5605b9b49a
commit 7e99c8fee7
11 changed files with 521 additions and 2 deletions

View File

@ -15,6 +15,7 @@ This is an n8n community node package that provides integration with the Strike
- **Deposit & Payout Management**: Handle deposits and payouts with fee estimation - **Deposit & Payout Management**: Handle deposits and payouts with fee estimation
- **Payment Methods**: Manage bank account payment methods - **Payment Methods**: Manage bank account payment methods
- **Rate Information**: Access real-time exchange rates and ticker data - **Rate Information**: Access real-time exchange rates and ticker data
- **Event Tracking**: Monitor and retrieve Strike events for your account
## Project Structure ## Project Structure
@ -31,6 +32,7 @@ n8n-nodes-strike/
│ ├── BalanceDescription.ts │ ├── BalanceDescription.ts
│ ├── CurrencyExchangeDescription.ts │ ├── CurrencyExchangeDescription.ts
│ ├── DepositDescription.ts │ ├── DepositDescription.ts
│ ├── EventDescription.ts
│ ├── InvoiceDescription.ts │ ├── InvoiceDescription.ts
│ ├── PaymentDescription.ts │ ├── PaymentDescription.ts
│ ├── PaymentMethodDescription.ts │ ├── PaymentMethodDescription.ts
@ -65,6 +67,10 @@ n8n-nodes-strike/
- `getAll`: Get all deposits with optional filters - `getAll`: Get all deposits with optional filters
- `estimateFee`: Estimate deposit fee - `estimateFee`: Estimate deposit fee
### Event
- `get`: Get event by ID
- `getAll`: Get all events with optional filters
### Invoice ### Invoice
- `create`: Create a new invoice - `create`: Create a new invoice
- `get`: Get invoice by ID - `get`: Get invoice by ID

209
README.md Normal file
View File

@ -0,0 +1,209 @@
# n8n-nodes-strike
![Strike Logo](https://strike.me/assets/images/logo.png)
This is an n8n community node for integrating with the [Strike API](https://strike.me), enabling Bitcoin and Lightning Network payment operations within your n8n workflows.
## ⚠️ Important Disclaimer
**This node has been AI-assisted ("vibe coded") and is not fully tested in production environments. Use at your own risk.**
- This package is provided "as-is" without any warranties or guarantees
- Not all API endpoints have been thoroughly tested
- Error handling may not cover all edge cases
- Always test thoroughly in a sandbox/development environment before using in production
- The maintainer is not responsible for any financial losses or issues arising from the use of this node
## Installation
### Community Nodes (Recommended)
1. Open n8n
2. Go to **Settings****Community Nodes**
3. Click **Install a community node**
4. Enter: `n8n-nodes-strike`
5. Click **Install**
### Manual Installation
```bash
npm install n8n-nodes-strike
```
## Prerequisites
- n8n installed (version 0.200.0 or higher recommended)
- A Strike account ([sign up here](https://strike.me))
- Strike API key (obtain from your [Strike Dashboard](https://dashboard.strike.me))
## Configuration
### Strike API Credentials
1. In n8n, create a new **Strike API** credential
2. Enter your **API Key** from the Strike Dashboard
3. Select the **Environment**:
- **Production**: For live transactions
- **Sandbox**: For testing (recommended for initial setup)
## Supported Resources & Operations
### Account
- **Get Profile**: Retrieve account profile by account ID
- **Get Profile by Handle**: Retrieve account profile by Strike handle
- **Get Limits**: Retrieve account limits
### Balance
- **Get**: Retrieve current account balances
### Currency Exchange
- **Create Quote**: Create a currency exchange quote
- **Get Quote**: Retrieve a currency exchange quote
- **Execute Quote**: Execute a currency exchange quote
### Deposit
- **Create**: Create a deposit
- **Get**: Retrieve a deposit by ID
- **Get Many**: Retrieve multiple deposits with filtering
- **Estimate Fee**: Estimate deposit fee
### Event
- **Get**: Retrieve an event by ID
- **Get Many**: Retrieve multiple events with filtering
### Invoice
- **Create**: Create a new invoice
- **Get**: Retrieve an invoice by ID
- **Get Many**: Retrieve multiple invoices with filtering
- **Create Quote**: Generate a quote for an invoice
- **Cancel**: Cancel an unpaid invoice
### Payment
- **Get**: Retrieve a payment by ID
- **Create Lightning Quote**: Create a Lightning Network payment quote
- **Create Onchain Quote**: Create an on-chain Bitcoin payment quote
- **Create LNURL Quote**: Create a LNURL payment quote
- **Get LNURL Details**: Retrieve LNURL details
- **Execute Quote**: Execute a payment quote
### Payment Method
- **Create Bank**: Add a bank account payment method
- **Get**: Retrieve a payment method by ID
- **Get Many**: Retrieve all payment methods
- **Delete**: Remove a payment method
### Payout
- **Create**: Create a payout
- **Get**: Retrieve a payout by ID
- **Get Many**: Retrieve multiple payouts with filtering
- **Initiate**: Initiate a payout
### Rates
- **Get Ticker**: Retrieve exchange rate ticker for a currency pair
## Features
-**Lightning Network Support**: Send and receive Lightning Network payments
- 🪙 **Bitcoin On-chain**: Support for on-chain Bitcoin transactions
- 💱 **Currency Exchange**: Convert between BTC, USD, EUR, GBP, and more
- 📊 **Pagination Support**: Handle large datasets with automatic pagination
- 🔍 **OData Filtering**: Advanced filtering and sorting capabilities
- 🔐 **Secure Authentication**: Bearer token authentication with environment selection
## Example Workflows
### Create and Monitor an Invoice
1. **Create Invoice Node**
- Resource: Invoice
- Operation: Create
- Amount: 10
- Currency: USD
- Description: Payment for services
2. **Wait for Payment** (using a webhook or polling)
3. **Get Invoice Status**
- Resource: Invoice
- Operation: Get
- Invoice ID: `{{ $json.invoiceId }}`
### Send Lightning Payment
1. **Create Lightning Quote**
- Resource: Payment
- Operation: Create Lightning Quote
- Lightning Invoice: `lnbc1...`
- Source Currency: USD
2. **Execute Quote**
- Resource: Payment
- Operation: Execute Quote
- Payment Quote ID: `{{ $json.paymentQuoteId }}`
### Monitor Account Events
1. **Get Events**
- Resource: Event
- Operation: Get Many
- Return All: true
- Filter: `eventType eq 'invoice.created'`
## API Documentation
For detailed API information, refer to the [official Strike API documentation](https://docs.strike.me/api/).
## Known Limitations
- Not all Strike API endpoints are implemented
- Webhook support is not included (use polling as a workaround)
- Limited error handling for specific edge cases
- Test coverage is minimal
## Contributing
Contributions are welcome! If you find bugs or want to add features:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Test thoroughly
5. Submit a pull request
**Repository**: https://github.com/yourusername/n8n-nodes-strike
## Support
- **Issues**: Report bugs on [GitHub Issues](https://github.com/yourusername/n8n-nodes-strike/issues)
- **Strike API**: [Strike API Documentation](https://docs.strike.me/api/)
- **n8n Community**: [n8n Community Forum](https://community.n8n.io/)
## Changelog
### 0.1.0 (Initial Release)
- Support for 10 Strike API resources
- 30+ operations across all resources
- Production and Sandbox environment support
- Event tracking capabilities
- OData filtering and pagination
## License
MIT License - see LICENSE file for details
## Disclaimer (Again, for Emphasis)
**USE THIS NODE AT YOUR OWN RISK.** This is experimental software that handles financial transactions. Always:
- Test in sandbox mode first
- Start with small amounts
- Monitor transactions closely
- Keep your API keys secure
- Review all operations before executing
- Have a backup plan
The authors and contributors are not liable for any losses, damages, or issues that may arise from using this node.
---
Made with ❤️ and AI assistance | Not officially affiliated with Strike

View File

@ -8,7 +8,7 @@ class Strike {
this.description = { this.description = {
displayName: 'Strike', displayName: 'Strike',
name: 'strike', name: 'strike',
icon: 'file:strike.svg', icon: 'file:strike.png',
group: ['transform'], group: ['transform'],
version: 1, version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
@ -47,6 +47,10 @@ class Strike {
name: 'Deposit', name: 'Deposit',
value: 'deposit', value: 'deposit',
}, },
{
name: 'Event',
value: 'event',
},
{ {
name: 'Invoice', name: 'Invoice',
value: 'invoice', value: 'invoice',
@ -79,6 +83,8 @@ class Strike {
...descriptions_1.currencyExchangeFields, ...descriptions_1.currencyExchangeFields,
...descriptions_1.depositOperations, ...descriptions_1.depositOperations,
...descriptions_1.depositFields, ...descriptions_1.depositFields,
...descriptions_1.eventOperations,
...descriptions_1.eventFields,
...descriptions_1.invoiceOperations, ...descriptions_1.invoiceOperations,
...descriptions_1.invoiceFields, ...descriptions_1.invoiceFields,
...descriptions_1.paymentOperations, ...descriptions_1.paymentOperations,
@ -153,6 +159,35 @@ class Strike {
} }
} }
// ---------------------------------------- // ----------------------------------------
// event
// ----------------------------------------
if (resource === 'event') {
if (operation === 'get') {
const eventId = this.getNodeParameter('eventId', i);
responseData = await StrikeApi_1.strikeApiRequest.call(this, 'GET', `/events/${eventId}`);
}
else if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i);
const filters = this.getNodeParameter('filters', i);
const query = {};
if (filters.filter) {
query.$filter = filters.filter;
}
if (filters.orderBy) {
query.$orderby = filters.orderBy;
}
if (returnAll) {
responseData = await StrikeApi_1.strikeApiRequestAllItems.call(this, 'GET', '/events', {}, query);
}
else {
const limit = this.getNodeParameter('limit', i);
query.$top = limit;
responseData = await StrikeApi_1.strikeApiRequest.call(this, 'GET', '/events', {}, query);
responseData = responseData.items || responseData;
}
}
}
// ----------------------------------------
// deposit // deposit
// ---------------------------------------- // ----------------------------------------
if (resource === 'deposit') { if (resource === 'deposit') {

View File

@ -0,0 +1,3 @@
import type { INodeProperties } from 'n8n-workflow';
export declare const eventOperations: INodeProperties[];
export declare const eventFields: INodeProperties[];

View File

@ -0,0 +1,112 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.eventFields = exports.eventOperations = void 0;
exports.eventOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['event'],
},
},
options: [
{
name: 'Get',
value: 'get',
description: 'Get an event by ID',
action: 'Get an event',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many events',
action: 'Get many events',
},
],
default: 'getAll',
},
];
exports.eventFields = [
// ----------------------------------
// event:get
// ----------------------------------
{
displayName: 'Event ID',
name: 'eventId',
type: 'string',
required: true,
default: '',
description: 'The ID of the event to retrieve',
displayOptions: {
show: {
resource: ['event'],
operation: ['get'],
},
},
},
// ----------------------------------
// event:getAll
// ----------------------------------
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
description: 'Whether to return all results or only up to a given limit',
displayOptions: {
show: {
resource: ['event'],
operation: ['getAll'],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
displayOptions: {
show: {
resource: ['event'],
operation: ['getAll'],
returnAll: [false],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['event'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Filter (OData)',
name: 'filter',
type: 'string',
default: '',
description: 'OData filter expression (e.g., eventType eq \'invoice.created\')',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'string',
default: 'created desc',
description: 'OData orderby expression',
},
],
},
];

View File

@ -7,3 +7,4 @@ export * from './CurrencyExchangeDescription';
export * from './RatesDescription'; export * from './RatesDescription';
export * from './AccountDescription'; export * from './AccountDescription';
export * from './PaymentMethodDescription'; export * from './PaymentMethodDescription';
export * from './EventDescription';

View File

@ -23,3 +23,4 @@ __exportStar(require("./CurrencyExchangeDescription"), exports);
__exportStar(require("./RatesDescription"), exports); __exportStar(require("./RatesDescription"), exports);
__exportStar(require("./AccountDescription"), exports); __exportStar(require("./AccountDescription"), exports);
__exportStar(require("./PaymentMethodDescription"), exports); __exportStar(require("./PaymentMethodDescription"), exports);
__exportStar(require("./EventDescription"), exports);

View File

@ -27,13 +27,15 @@ import {
accountFields, accountFields,
paymentMethodOperations, paymentMethodOperations,
paymentMethodFields, paymentMethodFields,
eventOperations,
eventFields,
} from './descriptions'; } from './descriptions';
export class Strike implements INodeType { export class Strike implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {
displayName: 'Strike', displayName: 'Strike',
name: 'strike', name: 'strike',
icon: 'file:strike.svg', icon: 'file:strike.png',
group: ['transform'], group: ['transform'],
version: 1, version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
@ -72,6 +74,10 @@ export class Strike implements INodeType {
name: 'Deposit', name: 'Deposit',
value: 'deposit', value: 'deposit',
}, },
{
name: 'Event',
value: 'event',
},
{ {
name: 'Invoice', name: 'Invoice',
value: 'invoice', value: 'invoice',
@ -104,6 +110,8 @@ export class Strike implements INodeType {
...currencyExchangeFields, ...currencyExchangeFields,
...depositOperations, ...depositOperations,
...depositFields, ...depositFields,
...eventOperations,
...eventFields,
...invoiceOperations, ...invoiceOperations,
...invoiceFields, ...invoiceFields,
...paymentOperations, ...paymentOperations,
@ -180,6 +188,36 @@ export class Strike implements INodeType {
} }
} }
// ----------------------------------------
// event
// ----------------------------------------
if (resource === 'event') {
if (operation === 'get') {
const eventId = this.getNodeParameter('eventId', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/events/${eventId}`);
} else if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const filters = this.getNodeParameter('filters', i) as IDataObject;
const query: IDataObject = {};
if (filters.filter) {
query.$filter = filters.filter;
}
if (filters.orderBy) {
query.$orderby = filters.orderBy;
}
if (returnAll) {
responseData = await strikeApiRequestAllItems.call(this, 'GET', '/events', {}, query);
} else {
const limit = this.getNodeParameter('limit', i) as number;
query.$top = limit;
responseData = await strikeApiRequest.call(this, 'GET', '/events', {}, query);
responseData = responseData.items || responseData;
}
}
}
// ---------------------------------------- // ----------------------------------------
// deposit // deposit
// ---------------------------------------- // ----------------------------------------

View File

@ -0,0 +1,113 @@
import type { INodeProperties } from 'n8n-workflow';
export const eventOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['event'],
},
},
options: [
{
name: 'Get',
value: 'get',
description: 'Get an event by ID',
action: 'Get an event',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many events',
action: 'Get many events',
},
],
default: 'getAll',
},
];
export const eventFields: INodeProperties[] = [
// ----------------------------------
// event:get
// ----------------------------------
{
displayName: 'Event ID',
name: 'eventId',
type: 'string',
required: true,
default: '',
description: 'The ID of the event to retrieve',
displayOptions: {
show: {
resource: ['event'],
operation: ['get'],
},
},
},
// ----------------------------------
// event:getAll
// ----------------------------------
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
description: 'Whether to return all results or only up to a given limit',
displayOptions: {
show: {
resource: ['event'],
operation: ['getAll'],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
displayOptions: {
show: {
resource: ['event'],
operation: ['getAll'],
returnAll: [false],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['event'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Filter (OData)',
name: 'filter',
type: 'string',
default: '',
description: 'OData filter expression (e.g., eventType eq \'invoice.created\')',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'string',
default: 'created desc',
description: 'OData orderby expression',
},
],
},
];

View File

@ -7,3 +7,4 @@ export * from './CurrencyExchangeDescription';
export * from './RatesDescription'; export * from './RatesDescription';
export * from './AccountDescription'; export * from './AccountDescription';
export * from './PaymentMethodDescription'; export * from './PaymentMethodDescription';
export * from './EventDescription';

BIN
nodes/Strike/strike.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB