@microcosmmoney/auth-core 1.5.1 → 2.1.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 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, FragmentBuyInput, FragmentizeInput, FragmentRedeemInput, FragmentBuyoutInitiateInput, FragmentBuyoutAcceptInput, FragmentBuyoutCompleteInput, FragmentBuyoutCancelInput, LendingDepositInput, LendingWithdrawInput, LendingBorrowInput, LendingRepayInput, LendingLiquidateInput, } 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, LendingExtendInput, LendingLiquidateInput, } from './types';
@@ -227,7 +227,7 @@ export declare class MicrocosmAPI {
227
227
  readonly lending: {
228
228
  getPool: () => Promise<ApiRes<any>>;
229
229
  getStats: () => Promise<ApiRes<any>>;
230
- getPosition: (wallet: string) => Promise<ApiRes<any>>;
230
+ getOracle: () => Promise<ApiRes<any>>;
231
231
  deposit: (token: string, data: {
232
232
  wallet: string;
233
233
  amount: number;
@@ -239,17 +239,23 @@ export declare class MicrocosmAPI {
239
239
  borrow: (token: string, data: {
240
240
  wallet: string;
241
241
  amount: number;
242
- collateral_nft_mint: string;
242
+ nft_mint: string;
243
+ duration_type: number;
243
244
  }) => Promise<ApiRes<any>>;
244
245
  repay: (token: string, data: {
245
246
  wallet: string;
246
- loan_id: number;
247
+ nft_mint: string;
247
248
  amount: number;
248
249
  }) => Promise<ApiRes<any>>;
250
+ extend: (token: string, data: {
251
+ wallet: string;
252
+ nft_mint: string;
253
+ new_duration_type: number;
254
+ }) => Promise<ApiRes<any>>;
249
255
  liquidate: (token: string, data: {
250
256
  liquidator_wallet: string;
251
257
  borrower_wallet: string;
252
- loan_id: number;
258
+ nft_mint: string;
253
259
  }) => Promise<ApiRes<any>>;
254
260
  };
255
261
  readonly organizations: {
package/dist/open-api.js CHANGED
@@ -217,11 +217,12 @@ class MicrocosmAPI {
217
217
  this.lending = {
218
218
  getPool: () => request(this.base, '/lending/pool'),
219
219
  getStats: () => request(this.base, '/lending/stats'),
220
- getPosition: (wallet) => request(this.base, `/lending/position/${wallet}`),
220
+ getOracle: () => request(this.base, '/lending/oracle'),
221
221
  deposit: (token, data) => postRequest(this.base, '/lending/deposit/prepare', data, token),
222
222
  withdraw: (token, data) => postRequest(this.base, '/lending/withdraw/prepare', data, token),
223
223
  borrow: (token, data) => postRequest(this.base, '/lending/borrow/prepare', data, token),
224
224
  repay: (token, data) => postRequest(this.base, '/lending/repay/prepare', data, token),
225
+ extend: (token, data) => postRequest(this.base, '/lending/extend/prepare', data, token),
225
226
  liquidate: (token, data) => postRequest(this.base, '/lending/liquidate/prepare', data, token),
226
227
  };
227
228
  this.organizations = {
package/dist/types.d.ts CHANGED
@@ -569,15 +569,21 @@ export interface LendingWithdrawInput {
569
569
  export interface LendingBorrowInput {
570
570
  wallet: string;
571
571
  amount: number;
572
- collateral_nft_mint: string;
572
+ nft_mint: string;
573
+ duration_type: number;
573
574
  }
574
575
  export interface LendingRepayInput {
575
576
  wallet: string;
576
- loan_id: number;
577
+ nft_mint: string;
577
578
  amount: number;
578
579
  }
580
+ export interface LendingExtendInput {
581
+ wallet: string;
582
+ nft_mint: string;
583
+ new_duration_type: number;
584
+ }
579
585
  export interface LendingLiquidateInput {
580
586
  liquidator_wallet: string;
581
587
  borrower_wallet: string;
582
- loan_id: number;
588
+ nft_mint: string;
583
589
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microcosmmoney/auth-core",
3
- "version": "1.5.1",
3
+ "version": "2.1.0",
4
4
  "description": "Microcosm OAuth 2.0 authentication core library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",