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:
2025-12-10 11:00:38 +01:00
commit 5605b9b49a
8925 changed files with 1417728 additions and 0 deletions

BIN
nodes/.DS_Store vendored Normal file

Binary file not shown.

493
nodes/Strike/Strike.node.ts Normal file
View File

@ -0,0 +1,493 @@
import type {
IExecuteFunctions,
IDataObject,
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import { strikeApiRequest, strikeApiRequestAllItems } from './StrikeApi';
import {
balanceOperations,
balanceFields,
invoiceOperations,
invoiceFields,
paymentOperations,
paymentFields,
depositOperations,
depositFields,
payoutOperations,
payoutFields,
currencyExchangeOperations,
currencyExchangeFields,
ratesOperations,
ratesFields,
accountOperations,
accountFields,
paymentMethodOperations,
paymentMethodFields,
} from './descriptions';
export class Strike implements INodeType {
description: INodeTypeDescription = {
displayName: 'Strike',
name: 'strike',
icon: 'file:strike.svg',
group: ['transform'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Interact with Strike API for Bitcoin and Lightning payments',
defaults: {
name: 'Strike',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'strikeApi',
required: true,
},
],
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Account',
value: 'account',
},
{
name: 'Balance',
value: 'balance',
},
{
name: 'Currency Exchange',
value: 'currencyExchange',
},
{
name: 'Deposit',
value: 'deposit',
},
{
name: 'Invoice',
value: 'invoice',
},
{
name: 'Payment',
value: 'payment',
},
{
name: 'Payment Method',
value: 'paymentMethod',
},
{
name: 'Payout',
value: 'payout',
},
{
name: 'Rates',
value: 'rates',
},
],
default: 'balance',
},
// Operations and fields for each resource
...accountOperations,
...accountFields,
...balanceOperations,
...balanceFields,
...currencyExchangeOperations,
...currencyExchangeFields,
...depositOperations,
...depositFields,
...invoiceOperations,
...invoiceFields,
...paymentOperations,
...paymentFields,
...paymentMethodOperations,
...paymentMethodFields,
...payoutOperations,
...payoutFields,
...ratesOperations,
...ratesFields,
],
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
const resource = this.getNodeParameter('resource', 0) as string;
const operation = this.getNodeParameter('operation', 0) as string;
for (let i = 0; i < items.length; i++) {
try {
let responseData: any;
// ----------------------------------------
// account
// ----------------------------------------
if (resource === 'account') {
if (operation === 'getProfile') {
const accountId = this.getNodeParameter('accountId', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/accounts/${accountId}/profile`);
} else if (operation === 'getProfileByHandle') {
const handle = this.getNodeParameter('handle', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/accounts/handle/${handle}/profile`);
} else if (operation === 'getLimits') {
responseData = await strikeApiRequest.call(this, 'GET', '/accounts/limits');
}
}
// ----------------------------------------
// balance
// ----------------------------------------
if (resource === 'balance') {
if (operation === 'get') {
responseData = await strikeApiRequest.call(this, 'GET', '/balances');
}
}
// ----------------------------------------
// currencyExchange
// ----------------------------------------
if (resource === 'currencyExchange') {
if (operation === 'createQuote') {
const sell = this.getNodeParameter('sell', i) as string;
const buy = this.getNodeParameter('buy', i) as string;
const amount = this.getNodeParameter('amount', i) as number;
const amountCurrency = this.getNodeParameter('amountCurrency', i) as string;
const body: IDataObject = {
sell,
buy,
amount: {
amount: amount.toString(),
currency: amountCurrency === 'sell' ? sell : buy,
},
};
responseData = await strikeApiRequest.call(this, 'POST', '/currency-exchange-quotes', body);
} else if (operation === 'getQuote') {
const quoteId = this.getNodeParameter('quoteId', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/currency-exchange-quotes/${quoteId}`);
} else if (operation === 'executeQuote') {
const quoteId = this.getNodeParameter('quoteId', i) as string;
responseData = await strikeApiRequest.call(this, 'PATCH', `/currency-exchange-quotes/${quoteId}/execute`);
}
}
// ----------------------------------------
// deposit
// ----------------------------------------
if (resource === 'deposit') {
if (operation === 'create') {
const paymentMethodId = this.getNodeParameter('paymentMethodId', i) as string;
const amount = this.getNodeParameter('amount', i) as number;
const currency = this.getNodeParameter('currency', i) as string;
const body: IDataObject = {
paymentMethodId,
amount: {
amount: amount.toString(),
currency,
},
};
responseData = await strikeApiRequest.call(this, 'POST', '/deposits', body);
} else if (operation === 'get') {
const depositId = this.getNodeParameter('depositId', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/deposits/${depositId}`);
} 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', '/deposits', {}, query);
} else {
const limit = this.getNodeParameter('limit', i) as number;
query.$top = limit;
responseData = await strikeApiRequest.call(this, 'GET', '/deposits', {}, query);
responseData = responseData.items || responseData;
}
} else if (operation === 'estimateFee') {
const amount = this.getNodeParameter('amount', i) as number;
const currency = this.getNodeParameter('currency', i) as string;
const feePolicy = this.getNodeParameter('feePolicy', i) as string;
const body: IDataObject = {
amount: {
amount: amount.toString(),
currency,
},
feePolicy,
};
responseData = await strikeApiRequest.call(this, 'POST', '/deposits/fee', body);
}
}
// ----------------------------------------
// invoice
// ----------------------------------------
if (resource === 'invoice') {
if (operation === 'create') {
const correlationId = this.getNodeParameter('correlationId', i) as string;
const description = this.getNodeParameter('description', i) as string;
const amount = this.getNodeParameter('amount', i) as number;
const currency = this.getNodeParameter('currency', i) as string;
const body: IDataObject = {};
if (correlationId) {
body.correlationId = correlationId;
}
if (description) {
body.description = description;
}
if (amount > 0) {
body.amount = {
amount: amount.toString(),
currency,
};
}
responseData = await strikeApiRequest.call(this, 'POST', '/invoices', body);
} else if (operation === 'get') {
const invoiceId = this.getNodeParameter('invoiceId', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/invoices/${invoiceId}`);
} 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', '/invoices', {}, query);
} else {
const limit = this.getNodeParameter('limit', i) as number;
query.$top = limit;
responseData = await strikeApiRequest.call(this, 'GET', '/invoices', {}, query);
responseData = responseData.items || responseData;
}
} else if (operation === 'createQuote') {
const invoiceId = this.getNodeParameter('invoiceId', i) as string;
const descriptionHash = this.getNodeParameter('descriptionHash', i) as string;
const body: IDataObject = {};
if (descriptionHash) {
body.descriptionHash = descriptionHash;
}
responseData = await strikeApiRequest.call(this, 'POST', `/invoices/${invoiceId}/quote`, body);
} else if (operation === 'cancel') {
const invoiceId = this.getNodeParameter('invoiceId', i) as string;
responseData = await strikeApiRequest.call(this, 'PATCH', `/invoices/${invoiceId}/cancel`);
}
}
// ----------------------------------------
// payment
// ----------------------------------------
if (resource === 'payment') {
if (operation === 'get') {
const paymentId = this.getNodeParameter('paymentId', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/payments/${paymentId}`);
} else if (operation === 'createLightningQuote') {
const lnInvoice = this.getNodeParameter('lnInvoice', i) as string;
const sourceCurrency = this.getNodeParameter('sourceCurrency', i) as string;
const body: IDataObject = {
lnInvoice,
sourceCurrency,
};
responseData = await strikeApiRequest.call(this, 'POST', '/payment-quotes/lightning', body);
} else if (operation === 'createOnchainQuote') {
const btcAddress = this.getNodeParameter('btcAddress', i) as string;
const sourceCurrency = this.getNodeParameter('sourceCurrency', i) as string;
const amount = this.getNodeParameter('amount', i) as number;
const amountCurrency = this.getNodeParameter('amountCurrency', i) as string;
const body: IDataObject = {
btcAddress,
sourceCurrency,
amount: {
amount: amount.toString(),
currency: amountCurrency,
},
};
responseData = await strikeApiRequest.call(this, 'POST', '/payment-quotes/onchain', body);
} else if (operation === 'createLnurlQuote') {
const lnAddressOrUrl = this.getNodeParameter('lnAddressOrUrl', i) as string;
const amount = this.getNodeParameter('amount', i) as number;
const amountCurrency = this.getNodeParameter('amountCurrency', i) as string;
const sourceCurrency = this.getNodeParameter('sourceCurrency', i) as string;
const body: IDataObject = {
lnAddressOrUrl,
sourceCurrency,
amount: {
amount: amount.toString(),
currency: amountCurrency,
},
};
responseData = await strikeApiRequest.call(this, 'POST', '/payment-quotes/lightning/lnurl', body);
} else if (operation === 'getLnurlDetails') {
const lnAddressOrUrl = this.getNodeParameter('lnAddressOrUrl', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/payment-quotes/lightning/lnurl/${encodeURIComponent(lnAddressOrUrl)}`);
} else if (operation === 'executeQuote') {
const paymentQuoteId = this.getNodeParameter('paymentQuoteId', i) as string;
responseData = await strikeApiRequest.call(this, 'PATCH', `/payment-quotes/${paymentQuoteId}/execute`);
}
}
// ----------------------------------------
// paymentMethod
// ----------------------------------------
if (resource === 'paymentMethod') {
if (operation === 'createBank') {
const accountNumber = this.getNodeParameter('accountNumber', i) as string;
const routingNumber = this.getNodeParameter('routingNumber', i) as string;
const accountType = this.getNodeParameter('accountType', i) as string;
const body: IDataObject = {
accountNumber,
routingNumber,
accountType,
};
responseData = await strikeApiRequest.call(this, 'POST', '/payment-methods/bank', body);
} else if (operation === 'get') {
const paymentMethodId = this.getNodeParameter('paymentMethodId', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/payment-methods/bank/${paymentMethodId}`);
} else if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const options = this.getNodeParameter('options', i) as IDataObject;
const query: IDataObject = {};
if (options.depositEligible) {
query.depositEligible = true;
}
if (returnAll) {
responseData = await strikeApiRequestAllItems.call(this, 'GET', '/payment-methods/bank', {}, query);
} else {
const limit = this.getNodeParameter('limit', i) as number;
query.$top = limit;
responseData = await strikeApiRequest.call(this, 'GET', '/payment-methods/bank', {}, query);
responseData = responseData.items || responseData;
}
} else if (operation === 'delete') {
const paymentMethodId = this.getNodeParameter('paymentMethodId', i) as string;
responseData = await strikeApiRequest.call(this, 'DELETE', `/payment-methods/bank/${paymentMethodId}`);
responseData = { success: true };
}
}
// ----------------------------------------
// payout
// ----------------------------------------
if (resource === 'payout') {
if (operation === 'create') {
const paymentMethodId = this.getNodeParameter('paymentMethodId', i) as string;
const amount = this.getNodeParameter('amount', i) as number;
const currency = this.getNodeParameter('currency', i) as string;
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
const body: IDataObject = {
paymentMethodId,
amount: {
amount: amount.toString(),
currency,
},
};
if (additionalFields.feePolicy) {
body.feePolicy = additionalFields.feePolicy;
}
if (additionalFields.originatorId) {
body.originatorId = additionalFields.originatorId;
}
responseData = await strikeApiRequest.call(this, 'POST', '/payouts', body);
} else if (operation === 'get') {
const payoutId = this.getNodeParameter('payoutId', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/payouts/${payoutId}`);
} 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', '/payouts', {}, query);
} else {
const limit = this.getNodeParameter('limit', i) as number;
query.$top = limit;
responseData = await strikeApiRequest.call(this, 'GET', '/payouts', {}, query);
responseData = responseData.items || responseData;
}
} else if (operation === 'initiate') {
const payoutId = this.getNodeParameter('payoutId', i) as string;
responseData = await strikeApiRequest.call(this, 'PATCH', `/payouts/${payoutId}/initiate`);
}
}
// ----------------------------------------
// rates
// ----------------------------------------
if (resource === 'rates') {
if (operation === 'getTicker') {
const currencyPair = this.getNodeParameter('currencyPair', i) as string;
responseData = await strikeApiRequest.call(this, 'GET', `/rates/ticker/${currencyPair}`);
}
}
// Return data
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
} catch (error) {
if (this.continueOnFail()) {
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray({ error: (error as Error).message }),
{ itemData: { item: i } },
);
returnData.push(...executionData);
continue;
}
throw error;
}
}
return [returnData];
}
}

61
nodes/Strike/StrikeApi.ts Normal file
View File

@ -0,0 +1,61 @@
import type { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-workflow';
import type { IDataObject, IHttpRequestMethods, IHttpRequestOptions } from 'n8n-workflow';
export async function strikeApiRequest(
this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions,
method: IHttpRequestMethods,
endpoint: string,
body: IDataObject = {},
query: IDataObject = {},
): Promise<any> {
const credentials = await this.getCredentials('strikeApi');
const baseUrl = credentials.environment === 'sandbox'
? 'https://api.strike.me'
: 'https://api.strike.me';
const options: IHttpRequestOptions = {
method,
url: `${baseUrl}/v1${endpoint}`,
headers: {
'Content-Type': 'application/json',
},
body,
qs: query,
json: true,
};
if (Object.keys(body).length === 0) {
delete options.body;
}
if (Object.keys(query).length === 0) {
delete options.qs;
}
return this.helpers.requestWithAuthentication.call(this, 'strikeApi', options);
}
export async function strikeApiRequestAllItems(
this: IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
endpoint: string,
body: IDataObject = {},
query: IDataObject = {},
): Promise<any[]> {
const returnData: any[] = [];
let responseData;
query.$top = query.$top || 100;
query.$skip = 0;
do {
responseData = await strikeApiRequest.call(this, method, endpoint, body, query);
const items = responseData.items || responseData;
if (Array.isArray(items)) {
returnData.push(...items);
}
query.$skip += query.$top as number;
} while (responseData.items && responseData.items.length === query.$top);
return returnData;
}

View File

@ -0,0 +1,74 @@
import type { INodeProperties } from 'n8n-workflow';
export const accountOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['account'],
},
},
options: [
{
name: 'Get Profile',
value: 'getProfile',
description: 'Get account profile by ID',
action: 'Get account profile',
},
{
name: 'Get Profile by Handle',
value: 'getProfileByHandle',
description: 'Get account profile by handle',
action: 'Get account profile by handle',
},
{
name: 'Get Limits',
value: 'getLimits',
description: 'Get account limits',
action: 'Get account limits',
},
],
default: 'getLimits',
},
];
export const accountFields: INodeProperties[] = [
// ----------------------------------
// account:getProfile
// ----------------------------------
{
displayName: 'Account ID',
name: 'accountId',
type: 'string',
required: true,
default: '',
description: 'The ID of the account',
displayOptions: {
show: {
resource: ['account'],
operation: ['getProfile'],
},
},
},
// ----------------------------------
// account:getProfileByHandle
// ----------------------------------
{
displayName: 'Handle',
name: 'handle',
type: 'string',
required: true,
default: '',
description: 'The handle of the account (username)',
displayOptions: {
show: {
resource: ['account'],
operation: ['getProfileByHandle'],
},
},
},
];

View File

@ -0,0 +1,26 @@
import type { INodeProperties } from 'n8n-workflow';
export const balanceOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['balance'],
},
},
options: [
{
name: 'Get',
value: 'get',
description: 'Get account balances',
action: 'Get account balances',
},
],
default: 'get',
},
];
export const balanceFields: INodeProperties[] = [];

View File

@ -0,0 +1,132 @@
import type { INodeProperties } from 'n8n-workflow';
export const currencyExchangeOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['currencyExchange'],
},
},
options: [
{
name: 'Create Quote',
value: 'createQuote',
description: 'Create a currency exchange quote',
action: 'Create a currency exchange quote',
},
{
name: 'Get Quote',
value: 'getQuote',
description: 'Get a currency exchange quote',
action: 'Get a currency exchange quote',
},
{
name: 'Execute Quote',
value: 'executeQuote',
description: 'Execute a currency exchange quote',
action: 'Execute a currency exchange quote',
},
],
default: 'createQuote',
},
];
export const currencyExchangeFields: INodeProperties[] = [
// ----------------------------------
// currencyExchange:createQuote
// ----------------------------------
{
displayName: 'Sell Currency',
name: 'sell',
type: 'options',
options: [
{ name: 'BTC', value: 'BTC' },
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'USD',
description: 'Currency to sell',
displayOptions: {
show: {
resource: ['currencyExchange'],
operation: ['createQuote'],
},
},
},
{
displayName: 'Buy Currency',
name: 'buy',
type: 'options',
options: [
{ name: 'BTC', value: 'BTC' },
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'BTC',
description: 'Currency to buy',
displayOptions: {
show: {
resource: ['currencyExchange'],
operation: ['createQuote'],
},
},
},
{
displayName: 'Amount',
name: 'amount',
type: 'number',
typeOptions: {
numberPrecision: 8,
},
required: true,
default: 0,
description: 'Amount to exchange',
displayOptions: {
show: {
resource: ['currencyExchange'],
operation: ['createQuote'],
},
},
},
{
displayName: 'Amount Currency',
name: 'amountCurrency',
type: 'options',
options: [
{ name: 'Sell Currency', value: 'sell' },
{ name: 'Buy Currency', value: 'buy' },
],
default: 'sell',
description: 'Which currency the amount is specified in',
displayOptions: {
show: {
resource: ['currencyExchange'],
operation: ['createQuote'],
},
},
},
// ----------------------------------
// currencyExchange:getQuote & executeQuote
// ----------------------------------
{
displayName: 'Quote ID',
name: 'quoteId',
type: 'string',
required: true,
default: '',
description: 'The ID of the currency exchange quote',
displayOptions: {
show: {
resource: ['currencyExchange'],
operation: ['getQuote', 'executeQuote'],
},
},
},
];

View File

@ -0,0 +1,199 @@
import type { INodeProperties } from 'n8n-workflow';
export const depositOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['deposit'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Initiate a deposit',
action: 'Create a deposit',
},
{
name: 'Get',
value: 'get',
description: 'Get a deposit by ID',
action: 'Get a deposit',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many deposits',
action: 'Get many deposits',
},
{
name: 'Estimate Fee',
value: 'estimateFee',
description: 'Estimate deposit fees',
action: 'Estimate deposit fee',
},
],
default: 'getAll',
},
];
export const depositFields: INodeProperties[] = [
// ----------------------------------
// deposit:create
// ----------------------------------
{
displayName: 'Payment Method ID',
name: 'paymentMethodId',
type: 'string',
required: true,
default: '',
description: 'The ID of the payment method to deposit from',
displayOptions: {
show: {
resource: ['deposit'],
operation: ['create'],
},
},
},
{
displayName: 'Amount',
name: 'amount',
type: 'number',
typeOptions: {
numberPrecision: 2,
},
required: true,
default: 0,
description: 'Amount to deposit',
displayOptions: {
show: {
resource: ['deposit'],
operation: ['create', 'estimateFee'],
},
},
},
{
displayName: 'Currency',
name: 'currency',
type: 'options',
options: [
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'USD',
description: 'Currency of the deposit',
displayOptions: {
show: {
resource: ['deposit'],
operation: ['create', 'estimateFee'],
},
},
},
// ----------------------------------
// deposit:get
// ----------------------------------
{
displayName: 'Deposit ID',
name: 'depositId',
type: 'string',
required: true,
default: '',
description: 'The ID of the deposit to retrieve',
displayOptions: {
show: {
resource: ['deposit'],
operation: ['get'],
},
},
},
// ----------------------------------
// deposit: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: ['deposit'],
operation: ['getAll'],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
displayOptions: {
show: {
resource: ['deposit'],
operation: ['getAll'],
returnAll: [false],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['deposit'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Filter (OData)',
name: 'filter',
type: 'string',
default: '',
description: 'OData filter expression',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'string',
default: 'created desc',
description: 'OData orderby expression',
},
],
},
// ----------------------------------
// deposit:estimateFee
// ----------------------------------
{
displayName: 'Fee Policy',
name: 'feePolicy',
type: 'options',
options: [
{ name: 'Inclusive', value: 'INCLUSIVE' },
{ name: 'Exclusive', value: 'EXCLUSIVE' },
],
default: 'EXCLUSIVE',
description: 'Whether fee is included in or added to the amount',
displayOptions: {
show: {
resource: ['deposit'],
operation: ['estimateFee'],
},
},
},
];

View File

@ -0,0 +1,213 @@
import type { INodeProperties } from 'n8n-workflow';
export const invoiceOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['invoice'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create an invoice',
action: 'Create an invoice',
},
{
name: 'Get',
value: 'get',
description: 'Get an invoice by ID',
action: 'Get an invoice',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many invoices',
action: 'Get many invoices',
},
{
name: 'Create Quote',
value: 'createQuote',
description: 'Generate a quote for an invoice',
action: 'Create quote for an invoice',
},
{
name: 'Cancel',
value: 'cancel',
description: 'Cancel an unpaid invoice',
action: 'Cancel an invoice',
},
],
default: 'getAll',
},
];
export const invoiceFields: INodeProperties[] = [
// ----------------------------------
// invoice:create
// ----------------------------------
{
displayName: 'Correlation ID',
name: 'correlationId',
type: 'string',
default: '',
description: 'Unique identifier for idempotency',
displayOptions: {
show: {
resource: ['invoice'],
operation: ['create'],
},
},
},
{
displayName: 'Description',
name: 'description',
type: 'string',
default: '',
description: 'Description of the invoice',
displayOptions: {
show: {
resource: ['invoice'],
operation: ['create'],
},
},
},
{
displayName: 'Amount',
name: 'amount',
type: 'number',
typeOptions: {
numberPrecision: 8,
},
default: 0,
description: 'Amount for the invoice (leave empty for any amount)',
displayOptions: {
show: {
resource: ['invoice'],
operation: ['create'],
},
},
},
{
displayName: 'Currency',
name: 'currency',
type: 'options',
options: [
{ name: 'BTC', value: 'BTC' },
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'USD',
description: 'Currency for the invoice amount',
displayOptions: {
show: {
resource: ['invoice'],
operation: ['create'],
},
},
},
// ----------------------------------
// invoice:get
// ----------------------------------
{
displayName: 'Invoice ID',
name: 'invoiceId',
type: 'string',
required: true,
default: '',
description: 'The ID of the invoice to retrieve',
displayOptions: {
show: {
resource: ['invoice'],
operation: ['get', 'createQuote', 'cancel'],
},
},
},
// ----------------------------------
// invoice: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: ['invoice'],
operation: ['getAll'],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
displayOptions: {
show: {
resource: ['invoice'],
operation: ['getAll'],
returnAll: [false],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['invoice'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Filter (OData)',
name: 'filter',
type: 'string',
default: '',
description: 'OData filter expression (e.g., state eq \'UNPAID\')',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'string',
default: 'created desc',
description: 'OData orderby expression',
},
],
},
// ----------------------------------
// invoice:createQuote
// ----------------------------------
{
displayName: 'Description Hash',
name: 'descriptionHash',
type: 'string',
default: '',
description: 'Optional description hash for the quote',
displayOptions: {
show: {
resource: ['invoice'],
operation: ['createQuote'],
},
},
},
];

View File

@ -0,0 +1,275 @@
import type { INodeProperties } from 'n8n-workflow';
export const paymentOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['payment'],
},
},
options: [
{
name: 'Get',
value: 'get',
description: 'Get a payment by ID',
action: 'Get a payment',
},
{
name: 'Create Lightning Quote',
value: 'createLightningQuote',
description: 'Create a lightning payment quote',
action: 'Create a lightning payment quote',
},
{
name: 'Create On-Chain Quote',
value: 'createOnchainQuote',
description: 'Create an on-chain payment quote',
action: 'Create an on-chain payment quote',
},
{
name: 'Create LNURL Quote',
value: 'createLnurlQuote',
description: 'Create a payment quote for LN Address or LNURL',
action: 'Create an LNURL payment quote',
},
{
name: 'Get LNURL Details',
value: 'getLnurlDetails',
description: 'Get details for an LN Address or LNURL',
action: 'Get LNURL details',
},
{
name: 'Execute Quote',
value: 'executeQuote',
description: 'Execute a payment quote',
action: 'Execute a payment quote',
},
],
default: 'get',
},
];
export const paymentFields: INodeProperties[] = [
// ----------------------------------
// payment:get
// ----------------------------------
{
displayName: 'Payment ID',
name: 'paymentId',
type: 'string',
required: true,
default: '',
description: 'The ID of the payment to retrieve',
displayOptions: {
show: {
resource: ['payment'],
operation: ['get'],
},
},
},
// ----------------------------------
// payment:createLightningQuote
// ----------------------------------
{
displayName: 'Lightning Invoice (BOLT11)',
name: 'lnInvoice',
type: 'string',
required: true,
default: '',
description: 'The BOLT11 lightning invoice to pay',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createLightningQuote'],
},
},
},
{
displayName: 'Source Currency',
name: 'sourceCurrency',
type: 'options',
options: [
{ name: 'BTC', value: 'BTC' },
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'USD',
description: 'Currency to pay from',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createLightningQuote'],
},
},
},
// ----------------------------------
// payment:createOnchainQuote
// ----------------------------------
{
displayName: 'Bitcoin Address',
name: 'btcAddress',
type: 'string',
required: true,
default: '',
description: 'The Bitcoin address to send to',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createOnchainQuote'],
},
},
},
{
displayName: 'Source Currency',
name: 'sourceCurrency',
type: 'options',
options: [
{ name: 'BTC', value: 'BTC' },
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'USD',
description: 'Currency to pay from',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createOnchainQuote'],
},
},
},
{
displayName: 'Amount',
name: 'amount',
type: 'number',
typeOptions: {
numberPrecision: 8,
},
required: true,
default: 0,
description: 'Amount to send',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createOnchainQuote'],
},
},
},
{
displayName: 'Amount Currency',
name: 'amountCurrency',
type: 'options',
options: [
{ name: 'BTC', value: 'BTC' },
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'BTC',
description: 'Currency of the amount',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createOnchainQuote'],
},
},
},
// ----------------------------------
// payment:createLnurlQuote
// ----------------------------------
{
displayName: 'LN Address or LNURL',
name: 'lnAddressOrUrl',
type: 'string',
required: true,
default: '',
description: 'Lightning Address (user@domain.com) or LNURL',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createLnurlQuote', 'getLnurlDetails'],
},
},
},
{
displayName: 'Amount',
name: 'amount',
type: 'number',
typeOptions: {
numberPrecision: 8,
},
required: true,
default: 0,
description: 'Amount to send',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createLnurlQuote'],
},
},
},
{
displayName: 'Amount Currency',
name: 'amountCurrency',
type: 'options',
options: [
{ name: 'BTC', value: 'BTC' },
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'USD',
description: 'Currency of the amount',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createLnurlQuote'],
},
},
},
{
displayName: 'Source Currency',
name: 'sourceCurrency',
type: 'options',
options: [
{ name: 'BTC', value: 'BTC' },
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'USD',
description: 'Currency to pay from',
displayOptions: {
show: {
resource: ['payment'],
operation: ['createLnurlQuote'],
},
},
},
// ----------------------------------
// payment:executeQuote
// ----------------------------------
{
displayName: 'Payment Quote ID',
name: 'paymentQuoteId',
type: 'string',
required: true,
default: '',
description: 'The ID of the payment quote to execute',
displayOptions: {
show: {
resource: ['payment'],
operation: ['executeQuote'],
},
},
},
];

View File

@ -0,0 +1,167 @@
import type { INodeProperties } from 'n8n-workflow';
export const paymentMethodOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['paymentMethod'],
},
},
options: [
{
name: 'Create Bank Account',
value: 'createBank',
description: 'Create a bank payment method',
action: 'Create a bank payment method',
},
{
name: 'Get',
value: 'get',
description: 'Get a bank payment method by ID',
action: 'Get a bank payment method',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many bank payment methods',
action: 'Get many bank payment methods',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a bank payment method',
action: 'Delete a bank payment method',
},
],
default: 'getAll',
},
];
export const paymentMethodFields: INodeProperties[] = [
// ----------------------------------
// paymentMethod:createBank
// ----------------------------------
{
displayName: 'Account Number',
name: 'accountNumber',
type: 'string',
required: true,
default: '',
description: 'Bank account number',
displayOptions: {
show: {
resource: ['paymentMethod'],
operation: ['createBank'],
},
},
},
{
displayName: 'Routing Number',
name: 'routingNumber',
type: 'string',
required: true,
default: '',
description: 'Bank routing number',
displayOptions: {
show: {
resource: ['paymentMethod'],
operation: ['createBank'],
},
},
},
{
displayName: 'Account Type',
name: 'accountType',
type: 'options',
options: [
{ name: 'Checking', value: 'CHECKING' },
{ name: 'Savings', value: 'SAVINGS' },
],
default: 'CHECKING',
description: 'Type of bank account',
displayOptions: {
show: {
resource: ['paymentMethod'],
operation: ['createBank'],
},
},
},
// ----------------------------------
// paymentMethod:get & delete
// ----------------------------------
{
displayName: 'Payment Method ID',
name: 'paymentMethodId',
type: 'string',
required: true,
default: '',
description: 'The ID of the payment method',
displayOptions: {
show: {
resource: ['paymentMethod'],
operation: ['get', 'delete'],
},
},
},
// ----------------------------------
// paymentMethod: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: ['paymentMethod'],
operation: ['getAll'],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
displayOptions: {
show: {
resource: ['paymentMethod'],
operation: ['getAll'],
returnAll: [false],
},
},
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
displayOptions: {
show: {
resource: ['paymentMethod'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Deposit Eligible Only',
name: 'depositEligible',
type: 'boolean',
default: false,
description: 'Whether to only return deposit-eligible payment methods',
},
],
},
];

View File

@ -0,0 +1,211 @@
import type { INodeProperties } from 'n8n-workflow';
export const payoutOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['payout'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a payout',
action: 'Create a payout',
},
{
name: 'Get',
value: 'get',
description: 'Get a payout by ID',
action: 'Get a payout',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many payouts',
action: 'Get many payouts',
},
{
name: 'Initiate',
value: 'initiate',
description: 'Initiate a payout',
action: 'Initiate a payout',
},
],
default: 'getAll',
},
];
export const payoutFields: INodeProperties[] = [
// ----------------------------------
// payout:create
// ----------------------------------
{
displayName: 'Payment Method ID',
name: 'paymentMethodId',
type: 'string',
required: true,
default: '',
description: 'The ID of the payment method to payout to',
displayOptions: {
show: {
resource: ['payout'],
operation: ['create'],
},
},
},
{
displayName: 'Amount',
name: 'amount',
type: 'number',
typeOptions: {
numberPrecision: 2,
},
required: true,
default: 0,
description: 'Amount to payout',
displayOptions: {
show: {
resource: ['payout'],
operation: ['create'],
},
},
},
{
displayName: 'Currency',
name: 'currency',
type: 'options',
options: [
{ name: 'USD', value: 'USD' },
{ name: 'EUR', value: 'EUR' },
{ name: 'GBP', value: 'GBP' },
],
default: 'USD',
description: 'Currency of the payout',
displayOptions: {
show: {
resource: ['payout'],
operation: ['create'],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['payout'],
operation: ['create'],
},
},
options: [
{
displayName: 'Fee Policy',
name: 'feePolicy',
type: 'options',
options: [
{ name: 'Inclusive', value: 'INCLUSIVE' },
{ name: 'Exclusive', value: 'EXCLUSIVE' },
],
default: 'EXCLUSIVE',
description: 'Whether fee is included in or added to the amount',
},
{
displayName: 'Originator ID',
name: 'originatorId',
type: 'string',
default: '',
description: 'ID of the payout originator',
},
],
},
// ----------------------------------
// payout:get
// ----------------------------------
{
displayName: 'Payout ID',
name: 'payoutId',
type: 'string',
required: true,
default: '',
description: 'The ID of the payout to retrieve',
displayOptions: {
show: {
resource: ['payout'],
operation: ['get', 'initiate'],
},
},
},
// ----------------------------------
// payout: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: ['payout'],
operation: ['getAll'],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 50,
description: 'Max number of results to return',
displayOptions: {
show: {
resource: ['payout'],
operation: ['getAll'],
returnAll: [false],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['payout'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Filter (OData)',
name: 'filter',
type: 'string',
default: '',
description: 'OData filter expression',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'string',
default: 'created desc',
description: 'OData orderby expression',
},
],
},
];

View File

@ -0,0 +1,48 @@
import type { INodeProperties } from 'n8n-workflow';
export const ratesOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['rates'],
},
},
options: [
{
name: 'Get Ticker',
value: 'getTicker',
description: 'Get current exchange rates',
action: 'Get exchange rates',
},
],
default: 'getTicker',
},
];
export const ratesFields: INodeProperties[] = [
// ----------------------------------
// rates:getTicker
// ----------------------------------
{
displayName: 'Currency Pair',
name: 'currencyPair',
type: 'options',
options: [
{ name: 'BTC/USD', value: 'BTCUSD' },
{ name: 'BTC/EUR', value: 'BTCEUR' },
{ name: 'BTC/GBP', value: 'BTCGBP' },
],
default: 'BTCUSD',
description: 'Currency pair for the ticker',
displayOptions: {
show: {
resource: ['rates'],
operation: ['getTicker'],
},
},
},
];

View File

@ -0,0 +1,9 @@
export * from './BalanceDescription';
export * from './InvoiceDescription';
export * from './PaymentDescription';
export * from './DepositDescription';
export * from './PayoutDescription';
export * from './CurrencyExchangeDescription';
export * from './RatesDescription';
export * from './AccountDescription';
export * from './PaymentMethodDescription';

4
nodes/Strike/strike.svg Normal file
View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
<rect width="32" height="32" rx="4" fill="#000000"/>
<path d="M22 10H14L12 16H18L10 22L20 14H14L16 10H22Z" fill="#CCFF00"/>
</svg>

After

Width:  |  Height:  |  Size: 208 B