UNPKG

@goplus/sdk-node

Version:
87 lines (83 loc) 3.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DefiControllerApi = void 0; var _ApiClient = require("../ApiClient"); var _GetDefiInfoResponse = require("../model/GetDefiInfoResponse"); /* * GoPlus Security API Document * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: 1.0 * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * * Swagger Codegen version: 3.0.45 * * Do not edit the class manually. * */ /** * DefiController service. * @module api/DefiControllerApi * @version 1.0 */ class DefiControllerApi { /** * Constructs a new DefiControllerApi. * @alias module:api/DefiControllerApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instanc e} if unspecified. */ constructor(apiClient) { this.apiClient = apiClient || _ApiClient.ApiClient.instance; } /** * Callback function to receive the result of the getDefiInfoUsingGET operation. * @callback moduleapi/DefiControllerApi~getDefiInfoUsingGETCallback * @param {String} error Error message, if any. * @param {module:model/GetDefiInfoResponse{ data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Rug-pull Detection API Beta * @param {String} contract_addresses Defi protocol address * @param {String} chain_id Chain id, (eth: 1, bsc: 56) * @param {Object} opts Optional parameters * @param {String} opts.Authorization Authorization token in the format: Bearer &lt;token&gt; (e.g., Bearer eyJsZXZlbCI6NSwiYXBwTmFtZSI6ImF2cyIsImFwcEtleSI6IjFaW...) * @param {module:api/DefiControllerApi~getDefiInfoUsingGETCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} */ getDefiInfoUsingGET(contract_addresses, chain_id, opts, callback) { opts = opts || {}; let postBody = null; // verify the required parameter 'contract_addresses' is set if (contract_addresses === undefined || contract_addresses === null) { throw new Error("Missing the required parameter 'contract_addresses' when calling getDefiInfoUsingGET"); } // verify the required parameter 'chain_id' is set if (chain_id === undefined || chain_id === null) { throw new Error("Missing the required parameter 'chain_id' when calling getDefiInfoUsingGET"); } let pathParams = { 'chain_id': chain_id }; let queryParams = { 'contract_addresses': contract_addresses }; let headerParams = { 'Authorization': opts['Authorization'] }; let formParams = {}; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = _GetDefiInfoResponse.GetDefiInfoResponse; return this.apiClient.callApi('/api/v1/rugpull_detecting/{chain_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback); } } exports.DefiControllerApi = DefiControllerApi;