@microcosmmoney/auth-core 1.4.0 → 1.5.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.
- package/dist/index.d.ts +1 -1
- package/dist/open-api.d.ts +50 -0
- package/dist/open-api.js +12 -0
- package/dist/types.d.ts +50 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export { ApiClient } from './api-client';
|
|
|
5
5
|
export { MicrocosmAPI } from './open-api';
|
|
6
6
|
export type { MicrocosmAPIConfig } from './open-api';
|
|
7
7
|
export { UserRank } from './types';
|
|
8
|
-
export type { MicrocosmAuthConfig, ResolvedConfig, User, TokenData, AuthState, LoginOptions, TokenExchangeResponse, UserProfileResponse, ApiResponse, MCDBalance, MCCBalance, MCCWalletBalance, MCCPrice, Wallet, TokenPortfolio, MCCLock, MiningRatio, MiningDistribution, BuybackQuote, BuybackRecord, Territory, TerritorySummary, TerritoryStats, TerritoryMember, Proposal, ProposalDetail, VoteResult, VotePower, AuctionBid, MCDTransaction, MCDReward, MiningRequest, MiningConfirmData, MiningRequestResult, MiningConfig, BuybackRecordInput, ReincarnationConfig, MCCHistoryRecord, CycleHistory, AuctionHistory, PaginatedResult, MCCStats, MiningStats, TechTreeNode, TechTree, TechTreeBonus, UserStats, Organization, OrganizationTreeNode, MiningRecord, MiningHistoryItem, PriceHistoryPoint, Auction, AuctionDetail, AuctionCreateInput, TerritoryIncome, TerritoryKPI, UserLevel, DashboardMarketSummary, DashboardUserSummary, PublicMiningRequest, UnitType, Notification, OrganizationSummary, TerritoryDetailedStats, ManagerIncomeRecord, TeamCustodySummary, } from './types';
|
|
8
|
+
export type { MicrocosmAuthConfig, ResolvedConfig, User, TokenData, AuthState, LoginOptions, TokenExchangeResponse, UserProfileResponse, ApiResponse, MCDBalance, MCCBalance, MCCWalletBalance, MCCPrice, Wallet, TokenPortfolio, MCCLock, MiningRatio, MiningDistribution, BuybackQuote, BuybackRecord, Territory, TerritorySummary, TerritoryStats, TerritoryMember, Proposal, ProposalDetail, VoteResult, VotePower, AuctionBid, MCDTransaction, MCDReward, MiningRequest, MiningConfirmData, MiningRequestResult, MiningConfig, BuybackRecordInput, ReincarnationConfig, MCCHistoryRecord, CycleHistory, AuctionHistory, PaginatedResult, MCCStats, MiningStats, TechTreeNode, TechTree, TechTreeBonus, UserStats, Organization, OrganizationTreeNode, MiningRecord, MiningHistoryItem, PriceHistoryPoint, Auction, AuctionDetail, AuctionCreateInput, TerritoryIncome, TerritoryKPI, UserLevel, DashboardMarketSummary, DashboardUserSummary, PublicMiningRequest, UnitType, Notification, OrganizationSummary, TerritoryDetailedStats, ManagerIncomeRecord, TeamCustodySummary, FragmentBuyInput, FragmentizeInput, FragmentRedeemInput, FragmentBuyoutInitiateInput, FragmentBuyoutAcceptInput, FragmentBuyoutCompleteInput, FragmentBuyoutCancelInput, LendingDepositInput, LendingWithdrawInput, LendingBorrowInput, LendingRepayInput, LendingLiquidateInput, } from './types';
|
package/dist/open-api.d.ts
CHANGED
|
@@ -196,11 +196,61 @@ export declare class MicrocosmAPI {
|
|
|
196
196
|
getConfig: () => Promise<ApiRes<any>>;
|
|
197
197
|
getVaults: () => Promise<ApiRes<any>>;
|
|
198
198
|
getVault: (id: number) => Promise<ApiRes<any>>;
|
|
199
|
+
buy: (token: string, data: {
|
|
200
|
+
nft_mint: string;
|
|
201
|
+
amount: number;
|
|
202
|
+
max_price_per_fragment_usdc?: number;
|
|
203
|
+
}) => Promise<ApiRes<any>>;
|
|
204
|
+
fragmentize: (token: string, data: {
|
|
205
|
+
nft_mint: string;
|
|
206
|
+
fragment_count: number;
|
|
207
|
+
}) => Promise<ApiRes<any>>;
|
|
208
|
+
redeem: (token: string, data: {
|
|
209
|
+
nft_mint: string;
|
|
210
|
+
}) => Promise<ApiRes<any>>;
|
|
211
|
+
initiateBuyout: (token: string, data: {
|
|
212
|
+
nft_mint: string;
|
|
213
|
+
price_per_fragment_usdc: number;
|
|
214
|
+
}) => Promise<ApiRes<any>>;
|
|
215
|
+
acceptBuyout: (token: string, data: {
|
|
216
|
+
nft_mint: string;
|
|
217
|
+
initiator: string;
|
|
218
|
+
fragment_amount: number;
|
|
219
|
+
}) => Promise<ApiRes<any>>;
|
|
220
|
+
completeBuyout: (token: string, data: {
|
|
221
|
+
nft_mint: string;
|
|
222
|
+
}) => Promise<ApiRes<any>>;
|
|
223
|
+
cancelBuyout: (token: string, data: {
|
|
224
|
+
nft_mint: string;
|
|
225
|
+
}) => Promise<ApiRes<any>>;
|
|
199
226
|
};
|
|
200
227
|
readonly lending: {
|
|
201
228
|
getPool: () => Promise<ApiRes<any>>;
|
|
202
229
|
getStats: () => Promise<ApiRes<any>>;
|
|
203
230
|
getPosition: (wallet: string) => Promise<ApiRes<any>>;
|
|
231
|
+
deposit: (token: string, data: {
|
|
232
|
+
wallet: string;
|
|
233
|
+
amount: number;
|
|
234
|
+
}) => Promise<ApiRes<any>>;
|
|
235
|
+
withdraw: (token: string, data: {
|
|
236
|
+
wallet: string;
|
|
237
|
+
lp_amount: number;
|
|
238
|
+
}) => Promise<ApiRes<any>>;
|
|
239
|
+
borrow: (token: string, data: {
|
|
240
|
+
wallet: string;
|
|
241
|
+
amount: number;
|
|
242
|
+
collateral_nft_mint: string;
|
|
243
|
+
}) => Promise<ApiRes<any>>;
|
|
244
|
+
repay: (token: string, data: {
|
|
245
|
+
wallet: string;
|
|
246
|
+
loan_id: number;
|
|
247
|
+
amount: number;
|
|
248
|
+
}) => Promise<ApiRes<any>>;
|
|
249
|
+
liquidate: (token: string, data: {
|
|
250
|
+
liquidator_wallet: string;
|
|
251
|
+
borrower_wallet: string;
|
|
252
|
+
loan_id: number;
|
|
253
|
+
}) => Promise<ApiRes<any>>;
|
|
204
254
|
};
|
|
205
255
|
readonly organizations: {
|
|
206
256
|
getList: (token: string) => Promise<ApiRes<any>>;
|
package/dist/open-api.js
CHANGED
|
@@ -206,11 +206,23 @@ class MicrocosmAPI {
|
|
|
206
206
|
getConfig: () => request(this.base, '/fragment/config'),
|
|
207
207
|
getVaults: () => request(this.base, '/fragment/vaults'),
|
|
208
208
|
getVault: (id) => request(this.base, `/fragment/vault/${id}`),
|
|
209
|
+
buy: (token, data) => postRequest(this.base, '/fragment/buy/prepare', data, token),
|
|
210
|
+
fragmentize: (token, data) => postRequest(this.base, '/fragment/fragmentize/prepare', data, token),
|
|
211
|
+
redeem: (token, data) => postRequest(this.base, '/fragment/redeem/prepare', data, token),
|
|
212
|
+
initiateBuyout: (token, data) => postRequest(this.base, '/fragment/buyout/initiate/prepare', data, token),
|
|
213
|
+
acceptBuyout: (token, data) => postRequest(this.base, '/fragment/buyout/accept/prepare', data, token),
|
|
214
|
+
completeBuyout: (token, data) => postRequest(this.base, '/fragment/buyout/complete/prepare', data, token),
|
|
215
|
+
cancelBuyout: (token, data) => postRequest(this.base, '/fragment/buyout/cancel/prepare', data, token),
|
|
209
216
|
};
|
|
210
217
|
this.lending = {
|
|
211
218
|
getPool: () => request(this.base, '/lending/pool'),
|
|
212
219
|
getStats: () => request(this.base, '/lending/stats'),
|
|
213
220
|
getPosition: (wallet) => request(this.base, `/lending/position/${wallet}`),
|
|
221
|
+
deposit: (token, data) => postRequest(this.base, '/lending/deposit/prepare', data, token),
|
|
222
|
+
withdraw: (token, data) => postRequest(this.base, '/lending/withdraw/prepare', data, token),
|
|
223
|
+
borrow: (token, data) => postRequest(this.base, '/lending/borrow/prepare', data, token),
|
|
224
|
+
repay: (token, data) => postRequest(this.base, '/lending/repay/prepare', data, token),
|
|
225
|
+
liquidate: (token, data) => postRequest(this.base, '/lending/liquidate/prepare', data, token),
|
|
214
226
|
};
|
|
215
227
|
this.organizations = {
|
|
216
228
|
getList: (token) => request(this.base, '/organizations', token),
|
package/dist/types.d.ts
CHANGED
|
@@ -531,3 +531,53 @@ export interface TeamCustodySummary {
|
|
|
531
531
|
address: string;
|
|
532
532
|
}[];
|
|
533
533
|
}
|
|
534
|
+
export interface FragmentBuyInput {
|
|
535
|
+
nft_mint: string;
|
|
536
|
+
amount: number;
|
|
537
|
+
max_price_per_fragment_usdc?: number;
|
|
538
|
+
}
|
|
539
|
+
export interface FragmentizeInput {
|
|
540
|
+
nft_mint: string;
|
|
541
|
+
fragment_count: number;
|
|
542
|
+
}
|
|
543
|
+
export interface FragmentRedeemInput {
|
|
544
|
+
nft_mint: string;
|
|
545
|
+
}
|
|
546
|
+
export interface FragmentBuyoutInitiateInput {
|
|
547
|
+
nft_mint: string;
|
|
548
|
+
price_per_fragment_usdc: number;
|
|
549
|
+
}
|
|
550
|
+
export interface FragmentBuyoutAcceptInput {
|
|
551
|
+
nft_mint: string;
|
|
552
|
+
initiator: string;
|
|
553
|
+
fragment_amount: number;
|
|
554
|
+
}
|
|
555
|
+
export interface FragmentBuyoutCompleteInput {
|
|
556
|
+
nft_mint: string;
|
|
557
|
+
}
|
|
558
|
+
export interface FragmentBuyoutCancelInput {
|
|
559
|
+
nft_mint: string;
|
|
560
|
+
}
|
|
561
|
+
export interface LendingDepositInput {
|
|
562
|
+
wallet: string;
|
|
563
|
+
amount: number;
|
|
564
|
+
}
|
|
565
|
+
export interface LendingWithdrawInput {
|
|
566
|
+
wallet: string;
|
|
567
|
+
lp_amount: number;
|
|
568
|
+
}
|
|
569
|
+
export interface LendingBorrowInput {
|
|
570
|
+
wallet: string;
|
|
571
|
+
amount: number;
|
|
572
|
+
collateral_nft_mint: string;
|
|
573
|
+
}
|
|
574
|
+
export interface LendingRepayInput {
|
|
575
|
+
wallet: string;
|
|
576
|
+
loan_id: number;
|
|
577
|
+
amount: number;
|
|
578
|
+
}
|
|
579
|
+
export interface LendingLiquidateInput {
|
|
580
|
+
liquidator_wallet: string;
|
|
581
|
+
borrower_wallet: string;
|
|
582
|
+
loan_id: number;
|
|
583
|
+
}
|