@xoxno/sdk-js 0.1.355 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,290 +0,0 @@
1
- import type { ISocials } from './collection';
2
- import type { ActivityChain, NftData, Owner } from './nft';
3
- import type { StakingSummaryPools } from './staking';
4
- export interface BulkAccount {
5
- address: string;
6
- nonce: number;
7
- username?: string;
8
- balance: string;
9
- balanceShort: number;
10
- }
11
- export interface IUserProfileSearch {
12
- address: string;
13
- isVerified: boolean;
14
- profile: string;
15
- herotag: string;
16
- addressTrimmed: string;
17
- chain?: ActivityChain;
18
- }
19
- export interface IUserSettings {
20
- dataType: 'userSettings';
21
- emailNotifications: {
22
- enabled: boolean;
23
- emailAddress: string;
24
- isEmailVerificationPending: boolean;
25
- isEmailVerified: boolean;
26
- isWeb2User: boolean;
27
- timestamp?: number;
28
- };
29
- notificationPreferences: {
30
- sales: boolean;
31
- bids: boolean;
32
- offersReceived: boolean;
33
- offersAccepted: boolean;
34
- offersRejected: boolean;
35
- deposits: boolean;
36
- };
37
- address: string;
38
- id: string;
39
- _ts: number;
40
- }
41
- export interface IUserProfile {
42
- dataType: 'userProfile';
43
- hasKYC?: boolean;
44
- address: string;
45
- isBanned: boolean;
46
- isVerified: boolean;
47
- socials: ISocials;
48
- favorites: string[];
49
- joinedDate: number;
50
- id: string;
51
- profile: string;
52
- banner: string;
53
- description: string;
54
- herotag: string;
55
- isCreator: boolean;
56
- creatorInfo: {
57
- contractAddress?: string;
58
- name?: string;
59
- };
60
- isPoolOwner: boolean;
61
- followedCollections: string[];
62
- userDeposit: UserDeposit[];
63
- _ts: number;
64
- shard: number;
65
- followCount: number;
66
- userSettings?: IUserSettings;
67
- chain?: ActivityChain;
68
- }
69
- export interface UserDeposit {
70
- balanceShort: number;
71
- balance: string;
72
- paymentToken: string;
73
- paymentTokenNonce: number;
74
- usdPrice: number;
75
- }
76
- export interface UserInventory {
77
- collection: string;
78
- inventoryCount: number;
79
- listedCount: number;
80
- stakedCount: number;
81
- floorPrice: number;
82
- name: string;
83
- isVerified: boolean;
84
- profile: string;
85
- banner: string;
86
- value: number;
87
- chain?: ActivityChain;
88
- }
89
- export interface OfferBody {
90
- dataType: string;
91
- identifier: string;
92
- collection: string;
93
- offerId: number;
94
- paymentToken: string;
95
- paymentTokenNonce: number;
96
- price: string;
97
- priceShort: number;
98
- deadline: number;
99
- timestamp: number;
100
- owner: Owner;
101
- quantity: number;
102
- marketplace: string;
103
- id: string;
104
- _ts: number;
105
- nftInfo: NftData;
106
- isActive: boolean;
107
- usdValue: number;
108
- floorPriceMargin: number;
109
- floorPrice: number;
110
- chain?: ActivityChain;
111
- }
112
- export declare enum Type {
113
- NonFungibleESDT = "NonFungibleESDT"
114
- }
115
- export type TickerElement = {
116
- ticker: string;
117
- name: string;
118
- };
119
- export type UserTokenInventory = {
120
- tokens: EsdtToken[];
121
- esdts: TokenWorth;
122
- stables: TokenWorth;
123
- wallet: TokenWorth;
124
- chain?: ActivityChain;
125
- };
126
- export type TokenWorth = {
127
- usdValue: number;
128
- egldValue: number;
129
- weight: number;
130
- };
131
- export type UserNetworkAccount = {
132
- address: string;
133
- nonce: number;
134
- balance: string;
135
- balanceShort: number;
136
- usdValue: number;
137
- username?: string;
138
- shard: number;
139
- guarded: boolean;
140
- activeGuardian: ActiveGuardian;
141
- };
142
- export type ActiveGuardian = {
143
- activationEpoch: number;
144
- address: string;
145
- serviceUID: string;
146
- };
147
- export interface SuiCoinObject {
148
- objectId: string;
149
- balance: string;
150
- digest: string;
151
- version: string;
152
- }
153
- export type EsdtToken = {
154
- nonce: number;
155
- identifier: string;
156
- decimals: number;
157
- balance: string;
158
- ticker: string;
159
- name: string;
160
- shortBalance: number;
161
- usdPrice: number;
162
- usdValue: number;
163
- egldValue: number;
164
- assets: Assets;
165
- isAshSupported: boolean;
166
- weight: number;
167
- objects?: SuiCoinObject[];
168
- };
169
- export type Assets = {
170
- pngUrl: string;
171
- svgUrl: string;
172
- };
173
- export type CreatorProfile = {
174
- name: string;
175
- profile: string;
176
- banner: string;
177
- description?: string;
178
- socials?: ISocials;
179
- joinedDate?: number;
180
- contractAddress: string;
181
- ticketingContractAddress?: string;
182
- address: string;
183
- followCount: number;
184
- creatorTag: string;
185
- _ts: number;
186
- };
187
- export interface RewardStakinSummary {
188
- tokenIdentifier: string;
189
- tokenNonce: number;
190
- amount: string;
191
- amountShort: number;
192
- usdValue: number;
193
- }
194
- export interface RewardAvaiblePools {
195
- tokenIdentifier: string;
196
- tokenNonce: number;
197
- rewardPerEpochShort: number;
198
- rewardBalanceShort: number;
199
- rewardBalance: string;
200
- rewardPerDayPerNft: number;
201
- usdValue: number;
202
- }
203
- export interface UserPoolStakingInfo {
204
- nftDocs: NftData[];
205
- poolDoc: StakingSummaryPools;
206
- }
207
- export interface UserAnalyticSummary {
208
- Purchase: Purchase;
209
- Sale: Purchase;
210
- }
211
- export interface Purchase {
212
- count: number;
213
- volume: number;
214
- min: Max;
215
- max: Max;
216
- avg: Avg;
217
- }
218
- export interface Avg {
219
- price: number;
220
- }
221
- export interface Max {
222
- price: number;
223
- txHash: string;
224
- timestamp: number;
225
- identifier: string;
226
- }
227
- export interface UserStats {
228
- wallet: Wallet & {
229
- isCreator: boolean;
230
- owned: number;
231
- listed: number;
232
- followCount: number;
233
- };
234
- totalVolume: number;
235
- totalTrades: number;
236
- totalCollections: number;
237
- totalNfts: number;
238
- totalPartners: number;
239
- buyerVolume: number;
240
- buyerTrades: number;
241
- buyerNfts: number;
242
- buyerCollections: number;
243
- buyerPartners: number;
244
- buyerMaxPriceData: PriceData | null;
245
- buyerMinPriceData: PriceData | null;
246
- sellerVolume: number;
247
- sellerTrades: number;
248
- sellerNfts: number;
249
- sellerCollections: number;
250
- sellerPartners: number;
251
- sellerMaxPriceData: PriceData;
252
- sellerMinPriceData: PriceData;
253
- }
254
- export interface PriceData {
255
- price: number;
256
- timestamp: number;
257
- identifier: string;
258
- txHash: string;
259
- usdValue: number;
260
- nftInfo: Pick<NftData, 'identifier' | 'collection' | 'name' | 'metadata' | 'url' | 'wasProcessed' | 'media'>;
261
- }
262
- export interface StakingCreatorInfo {
263
- address: string;
264
- ownedPools: number[];
265
- ownedCollections: string[];
266
- cutFee: number;
267
- _ts: number;
268
- }
269
- export interface UserXOXNODrop {
270
- wallet: Wallet;
271
- rank: number;
272
- tokenAllocation: number;
273
- totalScore: number;
274
- }
275
- export interface Wallet {
276
- address: string;
277
- addressTrimmed: string;
278
- profile: string;
279
- username: string;
280
- isVerified: boolean;
281
- chain?: ActivityChain;
282
- }
283
- export interface IOwnerInfo {
284
- registered: string[];
285
- availableForRegister: string[];
286
- }
287
- export type IApiShareholder = {
288
- address: string;
289
- share: number;
290
- };
@@ -1,201 +0,0 @@
1
- import type { FilterQueryDto, GetUserOffersResponseDto, GlobalSearchResponseDto, NftCosmosResponse, NftDocFilter } from '@xoxno/types';
2
- import type { ArgsQueryTop, ArgsUserOffers, CollectionCreatorInfo, CreatorInfo, EventCreatorInfo, PublicOnly, StakingStatus, StakingSummaryPools, StakingSummaryPoolsSlim, StatusResponse } from '../types';
3
- import type { BulkAccount, CreatorProfile, IApiShareholder, IOwnerInfo, IUserProfile, StakingCreatorInfo, UserAnalyticSummary, UserInventory, UserNetworkAccount, UserPoolStakingInfo, UserStats, UserTokenInventory, UserXOXNODrop } from '../types/user';
4
- export declare class UserModule {
5
- private api;
6
- private collection;
7
- constructor();
8
- /**
9
- * Returns the user profile
10
- *
11
- * @param {String} address - Address of the user
12
- * @returns {IUserProfile}
13
- */
14
- getUserProfile: (address: string) => Promise<IUserProfile>;
15
- /**
16
- * Returns the wallet accounts
17
- *
18
- * @param {String[]} addresses - Addresses of the user
19
- * @returns {BulkAccount[]}
20
- */
21
- getBulkAccounts: (addresses: string[]) => Promise<BulkAccount[]>;
22
- /**
23
- * Returns the user account info that inclues nonce, guardian data, esdtTokens
24
- *
25
- * @param {String} address - Address of the user
26
- * @returns {UserAccountInfo}
27
- */
28
- getUserAccount: (address: string) => Promise<UserNetworkAccount>;
29
- /**
30
- * Returns the user account info that inclues nonce, guardian data, esdtTokens
31
- *
32
- * @param {String} address - Address of the user
33
- * @returns {UserAccountInfo}
34
- */
35
- getUserTokenInventory: (address: string) => Promise<UserTokenInventory>;
36
- /**
37
- * Gets user's inventory
38
- *
39
- * @param {String} address - User's address
40
- * @returns {UserInventory} User's inventory
41
- */
42
- getUserSummaryInventory: (address: string, activeAuctions?: boolean) => Promise<UserInventory[]>;
43
- /**
44
- * Fetches the user's NFTs listed on the marketplaces
45
- * @param address - The user's address
46
- * @returns {UserInventory} - A list of token ids and the price
47
- */
48
- getUserNFTs: (args: PublicOnly<NftDocFilter>) => Promise<NftCosmosResponse>;
49
- /**
50
- * @name getUserOffers
51
- * @description Fetches all offers sent or received associated with a user address
52
- * @param {ArgsUserOffers} address - The user's wallet address
53
- * @returns {UserOffers} - The user's listings
54
- */
55
- getUserOffers: ({ identifier: address, ...args }: ArgsUserOffers) => Promise<GetUserOffersResponseDto>;
56
- /**
57
- * @public
58
- * @async
59
- * @function suggestUsers
60
- * @param {SuggestNFTsArgs} args - An object containing the necessary parameters to fetch suggested users results.
61
- * @returns {Promise<SuggestResults>} A promise that resolves to the fetched users results.
62
- *
63
- * This function fetches suggested users results based on the provided arguments. It takes an object with the following properties:
64
- * - name (string): The name to search for (required).
65
- * - top (number, optional): The maximum number of results to return (default is 35, cannot be greater than 100).
66
- * - skip (number, optional): The number of results to skip (default is 0).
67
- *
68
- * Finally, it returns a promise that resolves to the fetched users results.
69
- */
70
- suggestUsers: (args: PublicOnly<FilterQueryDto>) => Promise<GlobalSearchResponseDto>;
71
- /** Gets user's creator profile
72
- * @param {String} address - User's address
73
- * @returns {CreatorProfile} User's creator profile struct
74
- * @throws {Error} Throws an error if the address is invalid
75
- * */
76
- getUserCreatorProfile: (address: string) => Promise<CreatorProfile>;
77
- /** Gets user's creator profile
78
- * @param {String} address - User's address
79
- * @returns {IMintInfo[]} User's creator profile struct
80
- * @throws {Error} Throws an error if the address is invalid
81
- * */
82
- getCreatorListings: (address: string) => Promise<CollectionCreatorInfo>;
83
- /** Gets user's creator info
84
- * @param {String} address - User's address
85
- * @returns {EventCreatorInfo} User's creator info
86
- * @throws {Error} Throws an error if the address is invalid
87
- * */
88
- getCreatorEvents: (address: string, extra?: RequestInit) => Promise<EventCreatorInfo>;
89
- /** Gets user's staking info
90
- * @param {String} address - User's address
91
- * @returns {UserStakingSummary[]} User's staking info
92
- * @throws {Error} Throws an error if the address is invalid
93
- * */
94
- getUserStakingSummary: (address: string) => Promise<StakingSummaryPoolsSlim[]>;
95
- /** Gets user's staking info
96
- * @param {String} address - User's address
97
- * @returns {UserStakingAvaiblePools[]} User's staking info
98
- * @throws {Error} Throws an error if the address is invalid
99
- * */
100
- getUserStakingAailable: (address: string) => Promise<StakingSummaryPools[]>;
101
- /** Gets user's creator info
102
- * @param {String} address - User's address
103
- * @returns {CreatorInfo} User's creator info
104
- * @throws {Error} Throws an error if the address is invalid
105
- * */
106
- getUserCreatorInfo: (address: string, extra?: RequestInit) => Promise<CreatorInfo>;
107
- /** Gets pool details
108
- * @param {String} address - User's address
109
- * @param {String} collection - Collection ticker
110
- * @returns {UserCollectionStaking} User's creator info
111
- * @throws {Error} Throws an error if the address is invalid
112
- * */
113
- getUserCollectionStaking: (address: string, collection: string) => Promise<StakingSummaryPools[]>;
114
- /** Gets pool details
115
- * @param {number} poolId - User's address
116
- * @returns {CreatoPoolDetailsrInfo} User's creator info
117
- * @throws {Error} Throws an error if the address is invalid
118
- * */
119
- getUserPoolStaking: (address: string, poolId: number, status: StakingStatus) => Promise<UserPoolStakingInfo>;
120
- /** Gets owned pools by address
121
- * @param {string} address - User's address
122
- * @returns {StakingSummaryPools[]} User pools
123
- * @throws {Error} Throws an error if the address is invalid
124
- * */
125
- getOwnedPoolsByAddress: (address: string) => Promise<StakingSummaryPools[]>;
126
- /**
127
- * Gets user's analytics summary
128
- *
129
- * @param {String} address - User's address
130
- * @returns {UserAnalyticSummary} User's analytics summary
131
- */
132
- getUserAnalyticsSummary: (address: string) => Promise<UserAnalyticSummary>;
133
- /** Gets user's favorite NFTs
134
- * @param {String} address - User's address
135
- * @param {number} top - Top
136
- * @param {number} skip - Skip
137
- * @returns {NftDoc[]} Array of NFTs
138
- * @throws {Error} Throws an error if the address is invalid
139
- * */
140
- getUserFavoriteNFTs: ({ identifier: address, ...args }: ArgsQueryTop) => Promise<NftCosmosResponse>;
141
- /** Gets user's favorite collection tickers
142
- * @param {String} address - User's address
143
- * @returns {String[]} Array of tickers
144
- * @throws {Error} Throws an error if the address is invalid
145
- * */
146
- getUserFavoriteCollectionTickers: (address: string) => Promise<string[]>;
147
- /** Get if the creator tag is registered already
148
- * @param {String} creatorTag - The creator tag that needs to be checked
149
- * @returns {StatusResponse} True or false
150
- * */
151
- getIsCreatorRegistered: (creatorTag: string) => Promise<StatusResponse>;
152
- /**
153
- * @public
154
- * @async
155
- * @function getUsersStats
156
- * @returns {Promise<UserStats[]>} A promise that resolves to the fetched users results.
157
- */
158
- getUsersStats: ({ top, skip, orderBy, orderDirection, }: {
159
- top: number;
160
- skip: number;
161
- orderBy: string;
162
- orderDirection?: string;
163
- }) => Promise<UserStats[]>;
164
- /**
165
- * @public
166
- * @async
167
- * @function getStakingCreatorInfo
168
- * @param {String} address - The user's address.
169
- * @returns {Promise<StakingCreatorInfo>} A promise that resolves to the fetched staking creator info.
170
- */
171
- getStakingCreatorInfo: (address: string) => Promise<StakingCreatorInfo>;
172
- /**
173
- * @public
174
- * @async
175
- * @function getUsersDrop
176
- * @returns {Promise<UserXOXNODrop[]>} A promise that resolves to the fetched users results.
177
- */
178
- getUsersDrop: ({ top, skip, address, }: {
179
- top: number;
180
- skip: number;
181
- address?: string;
182
- }) => Promise<UserXOXNODrop[]>;
183
- /** Gets user's creator info
184
- * @param {String} address - User's address
185
- * @returns {IOwnerInfo} User's creator info
186
- * @throws {Error} Throws an error if the address is invalid
187
- * */
188
- getUserOwnerCollections: (address: string) => Promise<IOwnerInfo>;
189
- /** Gets royalties shares creator info
190
- * @param {String} address - User's address
191
- * @returns {IApiShareholder[]} Royalties shares creator info
192
- * @throws {Error} Throws an error if the address is invalid
193
- * */
194
- getRoyaltiesSharesCreator: (address: string) => Promise<IApiShareholder[]>;
195
- /** Gets mint shares creator info
196
- * @param {String} address - User's address
197
- * @returns {IApiShareholder[]} Mint revenue shares creator info
198
- * @throws {Error} Throws an error if the address is invalid
199
- * */
200
- getMintSharesCreator: (address: string, collectionTag: string) => Promise<IApiShareholder[]>;
201
- }