n8n-nodes-fxcm
Version:
n8n node for FXCM trading integration
23 lines (22 loc) • 697 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.execute = execute;
const FxcmClient_1 = require("../../Fxcm/FxcmClient");
async function execute() {
const credentials = await this.getCredentials('fxcmApi');
const client = new FxcmClient_1.FxcmClient(credentials);
try {
const positions = await client.getPositions();
return [{
json: { positions },
}];
}
catch (error) {
if (error instanceof Error) {
throw new Error(`Failed to get positions: ${error.message}`);
}
else {
throw new Error('Failed to get positions: Unknown error');
}
}
}