UNPKG

@goplus/sdk-node

Version:
154 lines (149 loc) 6.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LockControllerApi = void 0; var _ApiClient = require("../ApiClient"); var _ResponseWrapperNftLockerResponse = require("../model/ResponseWrapperNftLockerResponse"); var _ResponseWrapperTokenLockerResponse = require("../model/ResponseWrapperTokenLockerResponse"); /* * 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. * */ /** * LockController service. * @module api/LockControllerApi * @version 1.0 */ class LockControllerApi { /** * Constructs a new LockControllerApi. * @alias module:api/LockControllerApi * @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 getNftLockersUsingGET operation. * @callback moduleapi/LockControllerApi~getNftLockersUsingGETCallback * @param {String} error Error message, if any. * @param {module:model/ResponseWrapperNftLockerResponse{ data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get lpv3 locker info * @param {String} chainId chainId * @param {Number} pageNum pageNum * @param {Number} pageSize pageSize * @param {String} poolAddress poolAddress * @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/LockControllerApi~getNftLockersUsingGETCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} */ getNftLockersUsingGET(chainId, pageNum, pageSize, poolAddress, opts, callback) { opts = opts || {}; let postBody = null; // verify the required parameter 'chainId' is set if (chainId === undefined || chainId === null) { throw new Error("Missing the required parameter 'chainId' when calling getNftLockersUsingGET"); } // verify the required parameter 'pageNum' is set if (pageNum === undefined || pageNum === null) { throw new Error("Missing the required parameter 'pageNum' when calling getNftLockersUsingGET"); } // verify the required parameter 'pageSize' is set if (pageSize === undefined || pageSize === null) { throw new Error("Missing the required parameter 'pageSize' when calling getNftLockersUsingGET"); } // verify the required parameter 'poolAddress' is set if (poolAddress === undefined || poolAddress === null) { throw new Error("Missing the required parameter 'poolAddress' when calling getNftLockersUsingGET"); } let pathParams = {}; let queryParams = { 'chainId': chainId, 'pageNum': pageNum, 'pageSize': pageSize, 'poolAddress': poolAddress }; let headerParams = { 'Authorization': opts['Authorization'] }; let formParams = {}; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = _ResponseWrapperNftLockerResponse.ResponseWrapperNftLockerResponse; return this.apiClient.callApi('/open/api/v1/locks/lpv3', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback); } /** * Callback function to receive the result of the getTokenLockersUsingGET operation. * @callback moduleapi/LockControllerApi~getTokenLockersUsingGETCallback * @param {String} error Error message, if any. * @param {module:model/ResponseWrapperTokenLockerResponse{ data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get token locker info * @param {String} chainId chainId * @param {Number} pageNum pageNum * @param {Number} pageSize pageSize * @param {String} tokenAddress tokenAddress * @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/LockControllerApi~getTokenLockersUsingGETCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} */ getTokenLockersUsingGET(chainId, pageNum, pageSize, tokenAddress, opts, callback) { opts = opts || {}; let postBody = null; // verify the required parameter 'chainId' is set if (chainId === undefined || chainId === null) { throw new Error("Missing the required parameter 'chainId' when calling getTokenLockersUsingGET"); } // verify the required parameter 'pageNum' is set if (pageNum === undefined || pageNum === null) { throw new Error("Missing the required parameter 'pageNum' when calling getTokenLockersUsingGET"); } // verify the required parameter 'pageSize' is set if (pageSize === undefined || pageSize === null) { throw new Error("Missing the required parameter 'pageSize' when calling getTokenLockersUsingGET"); } // verify the required parameter 'tokenAddress' is set if (tokenAddress === undefined || tokenAddress === null) { throw new Error("Missing the required parameter 'tokenAddress' when calling getTokenLockersUsingGET"); } let pathParams = {}; let queryParams = { 'chainId': chainId, 'pageNum': pageNum, 'pageSize': pageSize, 'tokenAddress': tokenAddress }; let headerParams = { 'Authorization': opts['Authorization'] }; let formParams = {}; let authNames = []; let contentTypes = []; let accepts = ['*/*']; let returnType = _ResponseWrapperTokenLockerResponse.ResponseWrapperTokenLockerResponse; return this.apiClient.callApi('/open/api/v1/locks/token', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback); } } exports.LockControllerApi = LockControllerApi;