@scallop-io/sui-scallop-sdk 1.3.4-alpha.5 → 1.3.4-alpha.7
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/builders/borrowIncentiveBuilder.d.ts +1 -1
- package/dist/builders/coreBuilder.d.ts +2 -2
- package/dist/builders/index.d.ts +2 -2
- package/dist/builders/oracle.d.ts +2 -2
- package/dist/builders/referralBuilder.d.ts +1 -1
- package/dist/builders/spoolBuilder.d.ts +2 -2
- package/dist/builders/vescaBuilder.d.ts +2 -2
- package/dist/constants/coinGecko.d.ts +1 -1
- package/dist/constants/enum.d.ts +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/index.js +96 -96
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -96
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallop.d.ts +1 -1
- package/dist/models/scallopAddress.d.ts +1 -1
- package/dist/models/scallopBuilder.d.ts +1 -1
- package/dist/models/scallopClient.d.ts +8 -8
- package/dist/models/scallopIndexer.d.ts +1 -1
- package/dist/models/scallopQuery.d.ts +96 -96
- package/dist/models/scallopUtils.d.ts +2 -2
- package/dist/queries/borrowIncentiveQuery.d.ts +12 -12
- package/dist/queries/coreQuery.d.ts +2 -2
- package/dist/queries/isolatedAssetQuery.d.ts +2 -2
- package/dist/queries/portfolioQuery.d.ts +2 -2
- package/dist/queries/priceQuery.d.ts +2 -2
- package/dist/queries/spoolQuery.d.ts +2 -2
- package/dist/queries/supplyLimitQuery.d.ts +2 -2
- package/dist/queries/vescaQuery.d.ts +2 -2
- package/dist/types/address.d.ts +1 -1
- package/dist/types/builder/borrowIncentive.d.ts +2 -2
- package/dist/types/builder/core.d.ts +2 -2
- package/dist/types/builder/index.d.ts +4 -5
- package/dist/types/builder/referral.d.ts +1 -1
- package/dist/types/builder/sCoin.d.ts +1 -1
- package/dist/types/builder/spool.d.ts +2 -2
- package/dist/types/constant/common.d.ts +1 -1
- package/dist/types/model.d.ts +2 -2
- package/dist/types/query/borrowIncentive.d.ts +1 -1
- package/dist/types/query/core.d.ts +1 -1
- package/dist/types/query/portfolio.d.ts +1 -1
- package/dist/types/query/spool.d.ts +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/query.d.ts +2 -2
- package/dist/utils/util.d.ts +2 -2
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +8 -8
- package/src/builders/coreBuilder.ts +5 -5
- package/src/builders/index.ts +2 -2
- package/src/builders/oracle.ts +4 -4
- package/src/builders/referralBuilder.ts +1 -1
- package/src/builders/spoolBuilder.ts +6 -6
- package/src/builders/vescaBuilder.ts +4 -4
- package/src/constants/coinGecko.ts +1 -1
- package/src/constants/enum.ts +1 -1
- package/src/constants/index.ts +1 -1
- package/src/models/scallop.ts +5 -5
- package/src/models/scallopAddress.ts +6 -9
- package/src/models/scallopBuilder.ts +5 -4
- package/src/models/scallopCache.ts +4 -4
- package/src/models/scallopClient.ts +4 -4
- package/src/models/scallopIndexer.ts +4 -3
- package/src/models/scallopQuery.ts +4 -8
- package/src/models/scallopUtils.ts +8 -11
- package/src/models/suiKit.ts +1 -1
- package/src/queries/borrowIncentiveQuery.ts +5 -5
- package/src/queries/coreQuery.ts +4 -4
- package/src/queries/isolatedAssetQuery.ts +2 -2
- package/src/queries/portfolioQuery.ts +4 -4
- package/src/queries/priceQuery.ts +2 -2
- package/src/queries/spoolQuery.ts +5 -5
- package/src/queries/supplyLimitQuery.ts +2 -2
- package/src/queries/vescaQuery.ts +2 -2
- package/src/types/address.ts +1 -1
- package/src/types/builder/borrowIncentive.ts +3 -3
- package/src/types/builder/core.ts +3 -3
- package/src/types/builder/index.ts +4 -5
- package/src/types/builder/referral.ts +1 -1
- package/src/types/builder/sCoin.ts +1 -1
- package/src/types/builder/spool.ts +2 -2
- package/src/types/constant/common.ts +1 -1
- package/src/types/model.ts +2 -2
- package/src/types/query/borrowIncentive.ts +2 -2
- package/src/types/query/core.ts +1 -1
- package/src/types/query/portfolio.ts +2 -2
- package/src/types/query/spool.ts +1 -1
- package/src/utils/builder.ts +1 -1
- package/src/utils/index.ts +2 -2
- package/src/utils/query.ts +3 -3
- package/src/utils/tokenBucket.ts +1 -1
- package/src/utils/util.ts +4 -4
- package/dist/test.d.ts +0 -0
- package/src/test.ts +0 -30
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
SUPPORT_COLLATERALS,
|
|
5
5
|
SUPPORT_POOLS,
|
|
6
6
|
SUPPORT_SPOOLS,
|
|
7
|
-
} from '
|
|
7
|
+
} from '../constants';
|
|
8
8
|
import { minBigNumber, estimatedFactor } from 'src/utils';
|
|
9
|
-
import type { ScallopQuery } from '
|
|
10
|
-
import {
|
|
9
|
+
import type { ScallopQuery } from '../models';
|
|
10
|
+
import type {
|
|
11
11
|
Market,
|
|
12
12
|
SupportPoolCoins,
|
|
13
13
|
MarketPool,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
SupportBorrowIncentiveCoins,
|
|
27
27
|
ObligationBorrowIcentiveReward,
|
|
28
28
|
SupportBorrowIncentiveRewardCoins,
|
|
29
|
-
} from '
|
|
29
|
+
} from '../types';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Get user lending infomation for specific pools.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SuiObjectData } from '@mysten/sui/client';
|
|
2
|
-
import type { ScallopAddress } from '
|
|
3
|
-
import { SupportAssetCoins } from '
|
|
2
|
+
import type { ScallopAddress } from '../models';
|
|
3
|
+
import type { SupportAssetCoins } from '../types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Get price from pyth fee object.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { normalizeStructTag } from '@mysten/sui/utils';
|
|
2
|
-
import { SUPPORT_SPOOLS } from '
|
|
2
|
+
import { SUPPORT_SPOOLS } from '../constants';
|
|
3
3
|
import {
|
|
4
4
|
parseOriginSpoolData,
|
|
5
5
|
calculateSpoolData,
|
|
6
6
|
parseOriginSpoolRewardPoolData,
|
|
7
7
|
calculateSpoolRewardPoolData,
|
|
8
8
|
isMarketCoin,
|
|
9
|
-
} from '
|
|
9
|
+
} from '../utils';
|
|
10
10
|
import type { SuiObjectResponse } from '@mysten/sui/client';
|
|
11
|
-
import type { ScallopQuery, ScallopUtils } from '
|
|
12
|
-
import {
|
|
11
|
+
import type { ScallopQuery, ScallopUtils } from '../models';
|
|
12
|
+
import type {
|
|
13
13
|
MarketPool,
|
|
14
14
|
Spools,
|
|
15
15
|
Spool,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
SupportStakeCoins,
|
|
21
21
|
CoinPrices,
|
|
22
22
|
MarketPools,
|
|
23
|
-
} from '
|
|
23
|
+
} from '../types';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Get spools data.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { VeScaTreasuryFields, VeScaTreasuryInfo, Vesca } from '../types';
|
|
2
3
|
import {
|
|
3
4
|
type SuiObjectResponse,
|
|
4
5
|
type SuiObjectData,
|
|
5
6
|
DevInspectResults,
|
|
6
7
|
} from '@mysten/sui/client';
|
|
7
|
-
import type { ScallopUtils } from '
|
|
8
|
+
import type { ScallopUtils } from '../models';
|
|
8
9
|
import { MAX_LOCK_DURATION } from 'src/constants';
|
|
9
10
|
import { SUI_CLOCK_OBJECT_ID, SuiTxBlock } from '@scallop-io/sui-kit';
|
|
10
11
|
import { bcs } from '@mysten/sui/bcs';
|
|
11
12
|
import { z as zod } from 'zod';
|
|
12
13
|
import { queryKeys } from 'src/constants';
|
|
13
14
|
import assert from 'assert';
|
|
14
|
-
import { Vesca, VeScaTreasuryFields, VeScaTreasuryInfo } from 'src/types';
|
|
15
15
|
/**
|
|
16
16
|
* Query all owned veSca key.
|
|
17
17
|
*
|
package/src/types/address.ts
CHANGED
|
@@ -3,11 +3,11 @@ import type {
|
|
|
3
3
|
SuiObjectArg,
|
|
4
4
|
} from '@scallop-io/sui-kit';
|
|
5
5
|
import type { TransactionResult } from '@mysten/sui/transactions';
|
|
6
|
-
import type { ScallopBuilder } from '
|
|
7
|
-
import {
|
|
6
|
+
import type { ScallopBuilder } from '../../models';
|
|
7
|
+
import type {
|
|
8
8
|
SupportBorrowIncentiveCoins,
|
|
9
9
|
SupportBorrowIncentiveRewardCoins,
|
|
10
|
-
} from '
|
|
10
|
+
} from '../constant';
|
|
11
11
|
|
|
12
12
|
export type BorrowIncentiveIds = {
|
|
13
13
|
borrowIncentivePkg: string;
|
|
@@ -3,12 +3,12 @@ import type {
|
|
|
3
3
|
SuiObjectArg,
|
|
4
4
|
} from '@scallop-io/sui-kit';
|
|
5
5
|
import type { Argument, TransactionResult } from '@mysten/sui/transactions';
|
|
6
|
-
import type { ScallopBuilder } from '
|
|
7
|
-
import {
|
|
6
|
+
import type { ScallopBuilder } from '../../models';
|
|
7
|
+
import type {
|
|
8
8
|
SupportCollateralCoins,
|
|
9
9
|
SupportPoolCoins,
|
|
10
10
|
SupportAssetCoins,
|
|
11
|
-
} from '
|
|
11
|
+
} from '../constant';
|
|
12
12
|
import { SuiTxBlockWithSpool } from '.';
|
|
13
13
|
|
|
14
14
|
export type CoreIds = {
|
|
@@ -5,15 +5,14 @@ import type { VeScaTxBlock } from './vesca';
|
|
|
5
5
|
import type { ReferralTxBlock } from './referral';
|
|
6
6
|
import { LoyaltyProgramTxBlock } from './loyaltyProgram';
|
|
7
7
|
import { SCoinTxBlock } from './sCoin';
|
|
8
|
-
import { SupportAssetCoins } from '
|
|
8
|
+
import { SupportAssetCoins } from '../constant';
|
|
9
9
|
|
|
10
|
-
export type * from './borrowIncentive';
|
|
11
10
|
export type * from './core';
|
|
12
|
-
export type * from './loyaltyProgram';
|
|
13
|
-
export type * from './referral';
|
|
14
|
-
export type * from './sCoin';
|
|
15
11
|
export type * from './spool';
|
|
12
|
+
export type * from './borrowIncentive';
|
|
16
13
|
export type * from './vesca';
|
|
14
|
+
export type * from './loyaltyProgram';
|
|
15
|
+
export type * from './sCoin';
|
|
17
16
|
|
|
18
17
|
export type BaseScallopTxBlock = ReferralTxBlock &
|
|
19
18
|
LoyaltyProgramTxBlock &
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
SuiTxBlock as SuiKitTxBlock,
|
|
5
5
|
} from '@scallop-io/sui-kit';
|
|
6
6
|
import { ScallopBuilder } from 'src/models';
|
|
7
|
-
import { SupportPoolCoins } from '
|
|
7
|
+
import { SupportPoolCoins } from '../constant';
|
|
8
8
|
|
|
9
9
|
export type ReferralIds = {
|
|
10
10
|
referralPgkId: string;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
SuiTxBlock as SuiKitTxBlock,
|
|
4
4
|
TransactionResult,
|
|
5
5
|
} from '@scallop-io/sui-kit';
|
|
6
|
-
import { SupportSCoin } from '
|
|
6
|
+
import { SupportSCoin } from '../constant';
|
|
7
7
|
import { ScallopBuilder } from 'src/models';
|
|
8
8
|
import { BaseScallopTxBlock } from '.';
|
|
9
9
|
|
|
@@ -4,8 +4,8 @@ import type {
|
|
|
4
4
|
SuiObjectArg,
|
|
5
5
|
} from '@scallop-io/sui-kit';
|
|
6
6
|
import type { TransactionResult } from '@mysten/sui/transactions';
|
|
7
|
-
import type { ScallopBuilder } from '
|
|
8
|
-
import { SupportStakeMarketCoins } from '
|
|
7
|
+
import type { ScallopBuilder } from '../../models';
|
|
8
|
+
import type { SupportStakeMarketCoins } from '../constant';
|
|
9
9
|
import { SuiTxBlockWithSCoin } from '.';
|
|
10
10
|
|
|
11
11
|
export type SpoolIds = {
|
package/src/types/model.ts
CHANGED
|
@@ -7,8 +7,8 @@ import type {
|
|
|
7
7
|
ScallopUtils,
|
|
8
8
|
ScallopBuilder,
|
|
9
9
|
ScallopIndexer,
|
|
10
|
-
} from '
|
|
11
|
-
import { ScallopCache } from 'src/models';
|
|
10
|
+
} from '../models';
|
|
11
|
+
import { ScallopCache } from 'src/models/scallopCache';
|
|
12
12
|
import { AddressesInterface } from './address';
|
|
13
13
|
|
|
14
14
|
export type ScallopClientFnReturnType<T extends boolean> = T extends true
|
package/src/types/query/core.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { MarketPool } from './core';
|
|
2
2
|
import type { Spool } from './spool';
|
|
3
|
-
import {
|
|
3
|
+
import type {
|
|
4
4
|
SupportPoolCoins,
|
|
5
5
|
SupportCollateralCoins,
|
|
6
6
|
SupportBorrowIncentiveRewardCoins,
|
|
7
|
-
} from '
|
|
7
|
+
} from '../constant';
|
|
8
8
|
|
|
9
9
|
type OptionalKeys<T> = {
|
|
10
10
|
[K in keyof T]?: T[K];
|
package/src/types/query/spool.ts
CHANGED
package/src/utils/builder.ts
CHANGED
package/src/utils/index.ts
CHANGED
package/src/utils/query.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { normalizeStructTag, parseStructTag } from '@mysten/sui/utils';
|
|
3
|
-
import type { ScallopUtils } from '
|
|
4
|
-
import {
|
|
3
|
+
import type { ScallopUtils } from '../models';
|
|
4
|
+
import type {
|
|
5
5
|
OriginMarketPoolData,
|
|
6
6
|
ParsedMarketPoolData,
|
|
7
7
|
CalculatedMarketPoolData,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
OriginBorrowIncentiveAccountPoolData,
|
|
27
27
|
ParsedBorrowIncentiveAccountPoolData,
|
|
28
28
|
SupportBorrowIncentiveRewardCoins,
|
|
29
|
-
} from '
|
|
29
|
+
} from '../types';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Parse origin market pool data to a more readable format.
|
package/src/utils/tokenBucket.ts
CHANGED
package/src/utils/util.ts
CHANGED
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
SUPPORT_SCOIN,
|
|
9
9
|
SUPPORT_SUI_BRIDGE,
|
|
10
10
|
SUPPORT_WORMHOLE,
|
|
11
|
-
} from '
|
|
12
|
-
import type { ScallopAddress } from '
|
|
13
|
-
import {
|
|
11
|
+
} from '../constants';
|
|
12
|
+
import type { ScallopAddress } from '../models';
|
|
13
|
+
import type {
|
|
14
14
|
SupportAssetCoins,
|
|
15
15
|
SupportCoins,
|
|
16
16
|
SupportMarketCoins,
|
|
17
17
|
SupportSCoin,
|
|
18
18
|
SupportSuiBridgeCoins,
|
|
19
19
|
SupportWormholeCoins,
|
|
20
|
-
} from '
|
|
20
|
+
} from '../types';
|
|
21
21
|
|
|
22
22
|
const COIN_SET = Array.from(
|
|
23
23
|
new Set([
|
package/dist/test.d.ts
DELETED
|
File without changes
|
package/src/test.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// import { ScallopQuery } from './models';
|
|
2
|
-
// const main = async () => {
|
|
3
|
-
// try {
|
|
4
|
-
// const query = new ScallopQuery({
|
|
5
|
-
// walletAddress:
|
|
6
|
-
// '0x61819c99588108d9f7710047e6ad8f2da598de8e98a26ea62bd7ad9847f5123c',
|
|
7
|
-
// });
|
|
8
|
-
// await query.init();
|
|
9
|
-
// const { suppliedValue: haSuiLendingValue } =
|
|
10
|
-
// await query.getLending('hasui');
|
|
11
|
-
// const obligations = await query.getObligationAccounts();
|
|
12
|
-
|
|
13
|
-
// const haSuiCollateralUsdValue = Object.values(obligations).reduce(
|
|
14
|
-
// (acc, obligation) => {
|
|
15
|
-
// acc += obligation?.collaterals.hasui?.depositedValue ?? 0;
|
|
16
|
-
// return acc;
|
|
17
|
-
// },
|
|
18
|
-
// 0
|
|
19
|
-
// );
|
|
20
|
-
|
|
21
|
-
// const totalStaked = haSuiCollateralUsdValue + haSuiLendingValue;
|
|
22
|
-
// console.log(totalStaked);
|
|
23
|
-
// } catch (e) {
|
|
24
|
-
// console.error(e);
|
|
25
|
-
// } finally {
|
|
26
|
-
// process.exit(0);
|
|
27
|
-
// }
|
|
28
|
-
// };
|
|
29
|
-
|
|
30
|
-
// main();
|