UNPKG

@neynar/nodejs-sdk

Version:

SDK to interact with Neynar APIs (https://docs.neynar.com/reference/quickstart)

590 lines (589 loc) 37.5 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Farcaster API V2 * The Farcaster API allows you to interact with the Farcaster protocol. See the [Neynar docs](https://docs.neynar.com/reference) for more details. * * The version of the OpenAPI document: 2.46.0 * Contact: team@neynar.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeployFungibleFactoryEnum = exports.DeployFungibleNetworkEnum = exports.DeployFungibleMetadataNsfwEnum = exports.OnchainApi = exports.OnchainApiFactory = exports.OnchainApiFp = exports.OnchainApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * OnchainApi - axios parameter creator * @export */ const OnchainApiAxiosParamCreator = function (configuration) { return { /** * Creates a new token. * @summary Deploy fungible * @param {string} owner Ethereum address of the one who is creating the token * @param {string} symbol Symbol/Ticker for the token * @param {string} name Name of the token * @param {File} [metadataMedia] Media file associated with the token. Supported formats are image/jpeg, image/gif and image/png * @param {string} [metadataDescription] Description of the token * @param {DeployFungibleMetadataNsfwEnum} [metadataNsfw] Indicates if the token is NSFW (Not Safe For Work). * @param {string} [metadataWebsiteLink] Website link related to the token * @param {string} [metadataTwitter] Twitter profile link * @param {string} [metadataDiscord] Discord server link * @param {string} [metadataTelegram] Telegram link * @param {DeployFungibleNetworkEnum} [network] Network/Chain name * @param {DeployFungibleFactoryEnum} [factory] Factory name - wow -&gt; [wow.xyz](https://wow.xyz) - clanker -&gt; [clanker.world](https://www.clanker.world) * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeployFungibleResponse>} A promise that resolves to a `DeployFungibleResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/deploy-fungible) * */ deployFungible: async (owner, symbol, name, metadataMedia, metadataDescription, metadataNsfw, metadataWebsiteLink, metadataTwitter, metadataDiscord, metadataTelegram, network, factory, options = {}) => { // verify required parameter 'owner' is not null or undefined (0, common_1.assertParamExists)('deployFungible', 'owner', owner); // verify required parameter 'symbol' is not null or undefined (0, common_1.assertParamExists)('deployFungible', 'symbol', symbol); // verify required parameter 'name' is not null or undefined (0, common_1.assertParamExists)('deployFungible', 'name', name); const localVarPath = `/fungible`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (owner !== undefined) { localVarFormParams.append('owner', owner); } if (symbol !== undefined) { localVarFormParams.append('symbol', symbol); } if (name !== undefined) { localVarFormParams.append('name', name); } if (metadataMedia !== undefined) { localVarFormParams.append('metadata[media]', metadataMedia); } if (metadataDescription !== undefined) { localVarFormParams.append('metadata[description]', metadataDescription); } if (metadataNsfw !== undefined) { localVarFormParams.append('metadata[nsfw]', metadataNsfw); } if (metadataWebsiteLink !== undefined) { localVarFormParams.append('metadata[website_link]', metadataWebsiteLink); } if (metadataTwitter !== undefined) { localVarFormParams.append('metadata[twitter]', metadataTwitter); } if (metadataDiscord !== undefined) { localVarFormParams.append('metadata[discord]', metadataDiscord); } if (metadataTelegram !== undefined) { localVarFormParams.append('metadata[telegram]', metadataTelegram); } if (network !== undefined) { localVarFormParams.append('network', network); } if (factory !== undefined) { localVarFormParams.append('factory', factory); } localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = localVarFormParams; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Fetch a list of relevant owners for a specific FID. This usually shows on a fungible asset page as \"X, Y, Z and N others you know own this asset\". * @summary Relevant owners * @param {string} contractAddress Contract address of the fungible asset * @param {FungibleOwnerRelevantNetwork} network Network of the fungible asset. * @param {number} [viewerFid] If you provide a viewer_fid, the response will include token holders from the user\&#39;s network, respecting their mutes and blocks and including viewer_context; if not provided, the response will show top token holders across the network—both sets can be combined to generate a longer list if desired. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<RelevantFungibleOwnersResponse>} A promise that resolves to a `RelevantFungibleOwnersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-fungible-owners) * */ fetchRelevantFungibleOwners: async (contractAddress, network, viewerFid, options = {}) => { // verify required parameter 'contractAddress' is not null or undefined (0, common_1.assertParamExists)('fetchRelevantFungibleOwners', 'contractAddress', contractAddress); // verify required parameter 'network' is not null or undefined (0, common_1.assertParamExists)('fetchRelevantFungibleOwners', 'network', network); const localVarPath = `/farcaster/fungible/owner/relevant`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (contractAddress !== undefined) { localVarQueryParameter['contract_address'] = contractAddress; } if (network !== undefined) { localVarQueryParameter['network'] = network; } if (viewerFid !== undefined) { localVarQueryParameter['viewer_fid'] = viewerFid; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Fetches the token balances of a user given their FID * @summary Token balance * @param {number} fid FID of the user to fetch * @param {Array<Network>} networks Comma separated list of networks to fetch balances for * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<BalanceResponse>} A promise that resolves to a `BalanceResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-balance) * */ fetchUserBalance: async (fid, networks, options = {}) => { // verify required parameter 'fid' is not null or undefined (0, common_1.assertParamExists)('fetchUserBalance', 'fid', fid); // verify required parameter 'networks' is not null or undefined (0, common_1.assertParamExists)('fetchUserBalance', 'networks', networks); const localVarPath = `/farcaster/user/balance`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (fid !== undefined) { localVarQueryParameter['fid'] = fid; } if (networks) { localVarQueryParameter['networks'] = networks.join(base_1.COLLECTION_FORMATS.csv); } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Register a new farcaster account onchain. Optionally you can pass in signers along to register a new account and create multiple signers in a single transaction * @summary Register Farcaster account onchain * @param {RegisterUserOnChainReqBody} registerUserOnChainReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<RegisterUserOnChainResponse>} A promise that resolves to a `RegisterUserOnChainResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-account-onchain) * */ registerAccountOnchain: async (registerUserOnChainReqBody, options = {}) => { // verify required parameter 'registerUserOnChainReqBody' is not null or undefined (0, common_1.assertParamExists)('registerAccountOnchain', 'registerUserOnChainReqBody', registerUserOnChainReqBody); const localVarPath = `/farcaster/user/register`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(registerUserOnChainReqBody, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Send fungibles in bulk to several farcaster users. A funded wallet is to required use this API. React out to us on the Neynar channel on farcaster to get your wallet address. * @summary Send fungibles * @param {string} xWalletId Wallet ID to use for transactions * @param {TransactionSendFungiblesRequest} transactionSendFungiblesRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<TransactionSendFungiblesResponse>} A promise that resolves to a `TransactionSendFungiblesResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/send-fungibles-to-users) * */ sendFungiblesToUsers: async (xWalletId, transactionSendFungiblesRequest, options = {}) => { // verify required parameter 'xWalletId' is not null or undefined (0, common_1.assertParamExists)('sendFungiblesToUsers', 'xWalletId', xWalletId); // verify required parameter 'transactionSendFungiblesRequest' is not null or undefined (0, common_1.assertParamExists)('sendFungiblesToUsers', 'transactionSendFungiblesRequest', transactionSendFungiblesRequest); const localVarPath = `/farcaster/fungible/send`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication ApiKeyAuth required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "x-api-key", configuration); if (xWalletId != null) { localVarHeaderParameter['x-wallet-id'] = String(xWalletId); } localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(transactionSendFungiblesRequest, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.OnchainApiAxiosParamCreator = OnchainApiAxiosParamCreator; /** * OnchainApi - functional programming interface * @export */ const OnchainApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.OnchainApiAxiosParamCreator)(configuration); return { /** * Creates a new token. * @summary Deploy fungible * @param {string} owner Ethereum address of the one who is creating the token * @param {string} symbol Symbol/Ticker for the token * @param {string} name Name of the token * @param {File} [metadataMedia] Media file associated with the token. Supported formats are image/jpeg, image/gif and image/png * @param {string} [metadataDescription] Description of the token * @param {DeployFungibleMetadataNsfwEnum} [metadataNsfw] Indicates if the token is NSFW (Not Safe For Work). * @param {string} [metadataWebsiteLink] Website link related to the token * @param {string} [metadataTwitter] Twitter profile link * @param {string} [metadataDiscord] Discord server link * @param {string} [metadataTelegram] Telegram link * @param {DeployFungibleNetworkEnum} [network] Network/Chain name * @param {DeployFungibleFactoryEnum} [factory] Factory name - wow -&gt; [wow.xyz](https://wow.xyz) - clanker -&gt; [clanker.world](https://www.clanker.world) * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeployFungibleResponse>} A promise that resolves to a `DeployFungibleResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/deploy-fungible) * */ async deployFungible(owner, symbol, name, metadataMedia, metadataDescription, metadataNsfw, metadataWebsiteLink, metadataTwitter, metadataDiscord, metadataTelegram, network, factory, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.deployFungible(owner, symbol, name, metadataMedia, metadataDescription, metadataNsfw, metadataWebsiteLink, metadataTwitter, metadataDiscord, metadataTelegram, network, factory, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['OnchainApi.deployFungible']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetch a list of relevant owners for a specific FID. This usually shows on a fungible asset page as \"X, Y, Z and N others you know own this asset\". * @summary Relevant owners * @param {string} contractAddress Contract address of the fungible asset * @param {FungibleOwnerRelevantNetwork} network Network of the fungible asset. * @param {number} [viewerFid] If you provide a viewer_fid, the response will include token holders from the user\&#39;s network, respecting their mutes and blocks and including viewer_context; if not provided, the response will show top token holders across the network—both sets can be combined to generate a longer list if desired. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<RelevantFungibleOwnersResponse>} A promise that resolves to a `RelevantFungibleOwnersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-fungible-owners) * */ async fetchRelevantFungibleOwners(contractAddress, network, viewerFid, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.fetchRelevantFungibleOwners(contractAddress, network, viewerFid, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['OnchainApi.fetchRelevantFungibleOwners']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Fetches the token balances of a user given their FID * @summary Token balance * @param {number} fid FID of the user to fetch * @param {Array<Network>} networks Comma separated list of networks to fetch balances for * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<BalanceResponse>} A promise that resolves to a `BalanceResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-balance) * */ async fetchUserBalance(fid, networks, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.fetchUserBalance(fid, networks, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['OnchainApi.fetchUserBalance']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Register a new farcaster account onchain. Optionally you can pass in signers along to register a new account and create multiple signers in a single transaction * @summary Register Farcaster account onchain * @param {RegisterUserOnChainReqBody} registerUserOnChainReqBody * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<RegisterUserOnChainResponse>} A promise that resolves to a `RegisterUserOnChainResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-account-onchain) * */ async registerAccountOnchain(registerUserOnChainReqBody, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.registerAccountOnchain(registerUserOnChainReqBody, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['OnchainApi.registerAccountOnchain']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Send fungibles in bulk to several farcaster users. A funded wallet is to required use this API. React out to us on the Neynar channel on farcaster to get your wallet address. * @summary Send fungibles * @param {string} xWalletId Wallet ID to use for transactions * @param {TransactionSendFungiblesRequest} transactionSendFungiblesRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<TransactionSendFungiblesResponse>} A promise that resolves to a `TransactionSendFungiblesResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/send-fungibles-to-users) * */ async sendFungiblesToUsers(xWalletId, transactionSendFungiblesRequest, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.sendFungiblesToUsers(xWalletId, transactionSendFungiblesRequest, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['OnchainApi.sendFungiblesToUsers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.OnchainApiFp = OnchainApiFp; /** * OnchainApi - factory interface * @export */ const OnchainApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.OnchainApiFp)(configuration); return { /** * Creates a new token. * @summary Deploy fungible * @param {OnchainApiDeployFungibleRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<DeployFungibleResponse>} A promise that resolves to a `DeployFungibleResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/deploy-fungible) * */ deployFungible(requestParameters, options) { return localVarFp.deployFungible(requestParameters.owner, requestParameters.symbol, requestParameters.name, requestParameters.metadataMedia, requestParameters.metadataDescription, requestParameters.metadataNsfw, requestParameters.metadataWebsiteLink, requestParameters.metadataTwitter, requestParameters.metadataDiscord, requestParameters.metadataTelegram, requestParameters.network, requestParameters.factory, options).then((request) => request(axios, basePath)); }, /** * Fetch a list of relevant owners for a specific FID. This usually shows on a fungible asset page as \"X, Y, Z and N others you know own this asset\". * @summary Relevant owners * @param {OnchainApiFetchRelevantFungibleOwnersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<RelevantFungibleOwnersResponse>} A promise that resolves to a `RelevantFungibleOwnersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-fungible-owners) * */ fetchRelevantFungibleOwners(requestParameters, options) { return localVarFp.fetchRelevantFungibleOwners(requestParameters.contractAddress, requestParameters.network, requestParameters.viewerFid, options).then((request) => request(axios, basePath)); }, /** * Fetches the token balances of a user given their FID * @summary Token balance * @param {OnchainApiFetchUserBalanceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<BalanceResponse>} A promise that resolves to a `BalanceResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-balance) * */ fetchUserBalance(requestParameters, options) { return localVarFp.fetchUserBalance(requestParameters.fid, requestParameters.networks, options).then((request) => request(axios, basePath)); }, /** * Register a new farcaster account onchain. Optionally you can pass in signers along to register a new account and create multiple signers in a single transaction * @summary Register Farcaster account onchain * @param {OnchainApiRegisterAccountOnchainRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<RegisterUserOnChainResponse>} A promise that resolves to a `RegisterUserOnChainResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-account-onchain) * */ registerAccountOnchain(requestParameters, options) { return localVarFp.registerAccountOnchain(requestParameters.registerUserOnChainReqBody, options).then((request) => request(axios, basePath)); }, /** * Send fungibles in bulk to several farcaster users. A funded wallet is to required use this API. React out to us on the Neynar channel on farcaster to get your wallet address. * @summary Send fungibles * @param {OnchainApiSendFungiblesToUsersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @returns {Promise<TransactionSendFungiblesResponse>} A promise that resolves to a `TransactionSendFungiblesResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/send-fungibles-to-users) * */ sendFungiblesToUsers(requestParameters, options) { return localVarFp.sendFungiblesToUsers(requestParameters.xWalletId, requestParameters.transactionSendFungiblesRequest, options).then((request) => request(axios, basePath)); }, }; }; exports.OnchainApiFactory = OnchainApiFactory; /** * OnchainApi - object-oriented interface * @export * @class OnchainApi * @extends {BaseAPI} */ class OnchainApi extends base_1.BaseAPI { /** * Creates a new token. * @summary Deploy fungible * @param {OnchainApiDeployFungibleRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OnchainApi * @returns {Promise<DeployFungibleResponse>} A promise that resolves to a `DeployFungibleResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/deploy-fungible) * */ deployFungible(requestParameters, options) { return (0, exports.OnchainApiFp)(this.configuration).deployFungible(requestParameters.owner, requestParameters.symbol, requestParameters.name, requestParameters.metadataMedia, requestParameters.metadataDescription, requestParameters.metadataNsfw, requestParameters.metadataWebsiteLink, requestParameters.metadataTwitter, requestParameters.metadataDiscord, requestParameters.metadataTelegram, requestParameters.network, requestParameters.factory, options).then((request) => request(this.axios, this.basePath)); } /** * Fetch a list of relevant owners for a specific FID. This usually shows on a fungible asset page as \"X, Y, Z and N others you know own this asset\". * @summary Relevant owners * @param {OnchainApiFetchRelevantFungibleOwnersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OnchainApi * @returns {Promise<RelevantFungibleOwnersResponse>} A promise that resolves to a `RelevantFungibleOwnersResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-relevant-fungible-owners) * */ fetchRelevantFungibleOwners(requestParameters, options) { return (0, exports.OnchainApiFp)(this.configuration).fetchRelevantFungibleOwners(requestParameters.contractAddress, requestParameters.network, requestParameters.viewerFid, options).then((request) => request(this.axios, this.basePath)); } /** * Fetches the token balances of a user given their FID * @summary Token balance * @param {OnchainApiFetchUserBalanceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OnchainApi * @returns {Promise<BalanceResponse>} A promise that resolves to a `BalanceResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/fetch-user-balance) * */ fetchUserBalance(requestParameters, options) { return (0, exports.OnchainApiFp)(this.configuration).fetchUserBalance(requestParameters.fid, requestParameters.networks, options).then((request) => request(this.axios, this.basePath)); } /** * Register a new farcaster account onchain. Optionally you can pass in signers along to register a new account and create multiple signers in a single transaction * @summary Register Farcaster account onchain * @param {OnchainApiRegisterAccountOnchainRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OnchainApi * @returns {Promise<RegisterUserOnChainResponse>} A promise that resolves to a `RegisterUserOnChainResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/register-account-onchain) * */ registerAccountOnchain(requestParameters, options) { return (0, exports.OnchainApiFp)(this.configuration).registerAccountOnchain(requestParameters.registerUserOnChainReqBody, options).then((request) => request(this.axios, this.basePath)); } /** * Send fungibles in bulk to several farcaster users. A funded wallet is to required use this API. React out to us on the Neynar channel on farcaster to get your wallet address. * @summary Send fungibles * @param {OnchainApiSendFungiblesToUsersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof OnchainApi * @returns {Promise<TransactionSendFungiblesResponse>} A promise that resolves to a `TransactionSendFungiblesResponse` object * * For more information, refer to the [API documentation](https://docs.neynar.com/reference/send-fungibles-to-users) * */ sendFungiblesToUsers(requestParameters, options) { return (0, exports.OnchainApiFp)(this.configuration).sendFungiblesToUsers(requestParameters.xWalletId, requestParameters.transactionSendFungiblesRequest, options).then((request) => request(this.axios, this.basePath)); } } exports.OnchainApi = OnchainApi; /** * @export */ exports.DeployFungibleMetadataNsfwEnum = { True: 'true', False: 'false' }; /** * @export */ exports.DeployFungibleNetworkEnum = { Base: 'base' }; /** * @export */ exports.DeployFungibleFactoryEnum = { Wow: 'wow', Clanker: 'clanker' };