@xoxno/sdk-js
Version:
The SDK to interact with the XOXNO Protocol!
209 lines • 9.67 kB
TypeScript
import type { CollectionCreatorInfo, CreatorInfo, EventCreatorInfo, GetNFTsArgs, SearchNFTsResponse, StakingStatus, StakingSummaryPools, StakingSummaryPoolsSlim, StatusResponse, SuggestNFTsArgs, SuggestResults, TradincActivityArgs, TradingActivityResponse } from '../types';
import type { ArgsUserOffers, BulkAccount, CreatorProfile, IApiShareholder, IOwnerInfo, IUserProfile, StakingCreatorInfo, UserAnalyticSummary, UserInventory, UserNetworkAccount, UserOffers, UserPoolStakingInfo, UserStats, UserTokenInventory, UserXOXNODrop } from '../types/user';
export declare class UserModule {
private api;
private collection;
constructor();
/**
* Returns the user profile
*
* @param {String} address - Address of the user
* @returns {IUserProfile}
*/
getUserProfile: (address: string) => Promise<IUserProfile>;
/**
* Returns the wallet accounts
*
* @param {String[]} addresses - Addresses of the user
* @returns {BulkAccount[]}
*/
getBulkAccounts: (addresses: string[]) => Promise<BulkAccount[]>;
/**
* Returns the user account info that inclues nonce, guardian data, esdtTokens
*
* @param {String} address - Address of the user
* @returns {UserAccountInfo}
*/
getUserAccount: (address: string) => Promise<UserNetworkAccount>;
/**
* Returns the user account info that inclues nonce, guardian data, esdtTokens
*
* @param {String} address - Address of the user
* @returns {UserAccountInfo}
*/
getUserTokenInventory: (address: string) => Promise<UserTokenInventory>;
/**
* Gets user's inventory
*
* @param {String} address - User's address
* @returns {UserInventory} User's inventory
*/
getUserSummaryInventory: (address: string, activeAuctions?: boolean) => Promise<UserInventory[]>;
/**
* Fetches the user's NFTs listed on the marketplaces
* @param address - The user's address
* @returns {UserInventory} - A list of token ids and the price
*/
getUserNFTs: (args: GetNFTsArgs) => Promise<SearchNFTsResponse>;
/**
* @name getUserOffers
* @description Fetches all offers sent or received associated with a user address
* @param {String} address - The user's wallet address
* @returns {UserOffers} - The user's listings
*/
getUserOffers: (args: ArgsUserOffers) => Promise<UserOffers>;
/**
* @public
* @async
* @function suggestUsers
* @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested users results.
* @returns {Promise<SuggestResults>} A promise that resolves to the fetched users results.
*
* This function fetches suggested users results based on the provided arguments. It takes an object with the following properties:
* - name (string): The name to search for (required).
* - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 100).
* - skip (number, optional): The number of results to skip (default is 0).
*
* Finally, it returns a promise that resolves to the fetched users results.
*/
suggestUsers: (args: SuggestNFTsArgs) => Promise<SuggestResults>;
/**
* Retrieves trading history based on the provided arguments.
*
* @param {TradincActivityArgs} args - The arguments for filtering the trading activity.
* @returns {Promise<TradingActivityResponse>} A promise resolving to a TradingActivityResponse object containing the activity.
* @throws {Error} Throws an error if the 'top' argument is greater than 100.
*/
getTradingActivity: (args: TradincActivityArgs) => Promise<TradingActivityResponse>;
/** Gets user's creator profile
* @param {String} address - User's address
* @returns {CreatorProfile} User's creator profile struct
* @throws {Error} Throws an error if the address is invalid
* */
getUserCreatorProfile: (address: string) => Promise<CreatorProfile>;
/** Gets user's creator profile
* @param {String} address - User's address
* @returns {IMintInfo[]} User's creator profile struct
* @throws {Error} Throws an error if the address is invalid
* */
getCreatorListings: (address: string) => Promise<CollectionCreatorInfo>;
/** Gets user's creator info
* @param {String} address - User's address
* @returns {EventCreatorInfo} User's creator info
* @throws {Error} Throws an error if the address is invalid
* */
getCreatorEvents: (address: string, extra?: RequestInit) => Promise<EventCreatorInfo>;
/** Gets user's staking info
* @param {String} address - User's address
* @returns {UserStakingSummary[]} User's staking info
* @throws {Error} Throws an error if the address is invalid
* */
getUserStakingSummary: (address: string) => Promise<StakingSummaryPoolsSlim[]>;
/** Gets user's staking info
* @param {String} address - User's address
* @returns {UserStakingAvaiblePools[]} User's staking info
* @throws {Error} Throws an error if the address is invalid
* */
getUserStakingAailable: (address: string) => Promise<StakingSummaryPools[]>;
/** Gets user's creator info
* @param {String} address - User's address
* @returns {CreatorInfo} User's creator info
* @throws {Error} Throws an error if the address is invalid
* */
getUserCreatorInfo: (address: string, extra?: RequestInit) => Promise<CreatorInfo>;
/** Gets pool details
* @param {String} address - User's address
* @param {String} collection - Collection ticker
* @returns {UserCollectionStaking} User's creator info
* @throws {Error} Throws an error if the address is invalid
* */
getUserCollectionStaking: (address: string, collection: string) => Promise<StakingSummaryPools[]>;
/** Gets pool details
* @param {number} poolId - User's address
* @returns {CreatoPoolDetailsrInfo} User's creator info
* @throws {Error} Throws an error if the address is invalid
* */
getUserPoolStaking: (address: string, poolId: number, status: StakingStatus) => Promise<UserPoolStakingInfo>;
/** Gets owned pools by address
* @param {string} address - User's address
* @returns {StakingSummaryPools[]} User pools
* @throws {Error} Throws an error if the address is invalid
* */
getOwnedPoolsByAddress: (address: string) => Promise<StakingSummaryPools[]>;
/**
* Gets user's analytics summary
*
* @param {String} address - User's address
* @returns {UserAnalyticSummary} User's analytics summary
*/
getUserAnalyticsSummary: (address: string) => Promise<UserAnalyticSummary>;
/** Gets user's favorite NFTs
* @param {String} address - User's address
* @param {number} top - Top
* @param {number} skip - Skip
* @returns {NftData[]} Array of NFTs
* @throws {Error} Throws an error if the address is invalid
* */
getUserFavoriteNFTs: (address: string, top: number, skip: number) => Promise<SearchNFTsResponse>;
/** Gets user's favorite collection tickers
* @param {String} address - User's address
* @returns {String[]} Array of tickers
* @throws {Error} Throws an error if the address is invalid
* */
getUserFavoriteCollectionTickers: (address: string) => Promise<string[]>;
/** Get if the creator tag is registered already
* @param {String} creatorTag - The creator tag that needs to be checked
* @returns {StatusResponse} True or false
* */
getIsCreatorRegistered: (creatorTag: string) => Promise<StatusResponse>;
/**
* @public
* @async
* @function getUsersStats
* @returns {Promise<UserStats[]>} A promise that resolves to the fetched users results.
*/
getUsersStats: ({ top, skip, orderBy, orderDirection, }: {
top: number;
skip: number;
orderBy: string;
orderDirection?: string;
}) => Promise<UserStats[]>;
/**
* @public
* @async
* @function getStakingCreatorInfo
* @param {String} address - The user's address.
* @returns {Promise<StakingCreatorInfo>} A promise that resolves to the fetched staking creator info.
*/
getStakingCreatorInfo: (address: string) => Promise<StakingCreatorInfo>;
/**
* @public
* @async
* @function getUsersDrop
* @returns {Promise<UserXOXNODrop[]>} A promise that resolves to the fetched users results.
*/
getUsersDrop: ({ top, skip, address, }: {
top: number;
skip: number;
address?: string;
}) => Promise<UserXOXNODrop[]>;
/** Gets user's creator info
* @param {String} address - User's address
* @returns {IOwnerInfo} User's creator info
* @throws {Error} Throws an error if the address is invalid
* */
getUserOwnerCollections: (address: string) => Promise<IOwnerInfo>;
/** Gets royalties shares creator info
* @param {String} address - User's address
* @returns {IApiShareholder[]} Royalties shares creator info
* @throws {Error} Throws an error if the address is invalid
* */
getRoyaltiesSharesCreator: (address: string) => Promise<IApiShareholder[]>;
/** Gets mint shares creator info
* @param {String} address - User's address
* @returns {IApiShareholder[]} Mint revenue shares creator info
* @throws {Error} Throws an error if the address is invalid
* */
getMintSharesCreator: (address: string, collectionTag: string) => Promise<IApiShareholder[]>;
}
//# sourceMappingURL=index.d.ts.map