UNPKG

n8n-nodes-wax

Version:

n8n Community Node Package for the WAX Blockchain

56 lines 2.14 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")); const util_1 = require("../Wax/resources/util"); 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 = (0, util_1.requireAccountName)(this, this.getNodeParameter('account', i), 'Account Name'); const rawEndpoint = this.getNodeParameter('endpoint', i); const endpoint = (0, util_1.validateEndpoint)(this, rawEndpoint); const response = await axios_1.default.post((0, util_1.buildUrl)(endpoint, '/v1/chain/get_account'), { account_name: account }); returnData.push({ json: response.data }); } return [returnData]; } } exports.WaxGetAccountInfo = WaxGetAccountInfo; //# sourceMappingURL=WaxGetAccountInfo.node.js.map