UNPKG

n8n-nodes-wax

Version:

n8n Community Node Package for the WAX Blockchain

54 lines 1.93 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.WaxGetAccountInfo = void 0; const axios_1 = __importDefault(require("axios")); class WaxGetAccountInfo { constructor() { this.description = { hidden: true, displayName: 'WAX Get Account Info', name: 'waxGetAccountInfo', icon: 'file:wax.svg', group: ['transform'], version: 1, description: 'Fetch account details from the WAX blockchain', defaults: { name: 'Get Account Info', }, inputs: ['main'], outputs: ['main'], properties: [ { displayName: 'Account Name', name: 'account', type: 'string', default: '', required: true, }, { displayName: 'API Endpoint', name: 'endpoint', type: 'string', default: 'https://wax.greymass.com', required: true, } ], }; } async execute() { const items = this.getInputData(); const returnData = []; for (let i = 0; i < items.length; i++) { const account = this.getNodeParameter('account', i); const endpoint = this.getNodeParameter('endpoint', i); const response = await axios_1.default.post(`${endpoint}/v1/chain/get_account`, { account_name: account }); returnData.push({ json: response.data }); } return [returnData]; } } exports.WaxGetAccountInfo = WaxGetAccountInfo; //# sourceMappingURL=WaxGetAccountInfo.node.js.map