@scallop-io/sui-scallop-sdk 1.5.0-alpha.1 → 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.mts +3159 -0
- package/dist/index.d.ts +3159 -3
- package/dist/index.js +78 -9966
- package/dist/index.mjs +15 -9892
- package/package.json +5 -6
- package/src/constants/coinGecko.ts +14 -4
- package/src/constants/common.ts +7 -0
- package/src/constants/enum.ts +23 -0
- package/src/constants/poolAddress.ts +112 -1
- package/src/constants/pyth.ts +4 -1
- package/src/constants/testAddress.ts +220 -49
- package/src/constants/xoracle.ts +3 -0
- package/src/models/scallopAddress.ts +9 -0
- package/src/models/scallopQuery.ts +4 -2
- package/src/queries/poolAddressesQuery.ts +2 -2
- package/src/queries/portfolioQuery.ts +7 -8
- package/src/types/address.ts +1 -0
- package/src/utils/util.ts +8 -3
- package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
- package/dist/builders/coreBuilder.d.ts +0 -12
- package/dist/builders/index.d.ts +0 -12
- package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
- package/dist/builders/oracle.d.ts +0 -14
- package/dist/builders/referralBuilder.d.ts +0 -12
- package/dist/builders/sCoinBuilder.d.ts +0 -4
- package/dist/builders/spoolBuilder.d.ts +0 -12
- package/dist/builders/vescaBuilder.d.ts +0 -25
- package/dist/constants/cache.d.ts +0 -14
- package/dist/constants/coinGecko.d.ts +0 -2
- package/dist/constants/common.d.ts +0 -20
- package/dist/constants/enum.d.ts +0 -14
- package/dist/constants/flashloan.d.ts +0 -2
- package/dist/constants/index.d.ts +0 -13
- package/dist/constants/poolAddress.d.ts +0 -27
- package/dist/constants/pyth.d.ts +0 -5
- package/dist/constants/queryKeys.d.ts +0 -54
- package/dist/constants/rpc.d.ts +0 -1
- package/dist/constants/testAddress.d.ts +0 -2
- package/dist/constants/vesca.d.ts +0 -5
- package/dist/constants/xoracle.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/models/index.d.ts +0 -8
- package/dist/models/scallop.d.ts +0 -73
- package/dist/models/scallopAddress.d.ts +0 -150
- package/dist/models/scallopBuilder.d.ts +0 -90
- package/dist/models/scallopCache.d.ts +0 -81
- package/dist/models/scallopClient.d.ts +0 -321
- package/dist/models/scallopIndexer.d.ts +0 -90
- package/dist/models/scallopPrice.d.ts +0 -0
- package/dist/models/scallopQuery.d.ts +0 -704
- package/dist/models/scallopUtils.d.ts +0 -229
- package/dist/models/suiKit.d.ts +0 -2
- package/dist/queries/borrowIncentiveQuery.d.ts +0 -82
- package/dist/queries/borrowLimitQuery.d.ts +0 -9
- package/dist/queries/coreQuery.d.ts +0 -171
- package/dist/queries/index.d.ts +0 -15
- package/dist/queries/isolatedAssetQuery.d.ts +0 -14
- package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
- package/dist/queries/objectsQuery.d.ts +0 -2
- package/dist/queries/poolAddressesQuery.d.ts +0 -29
- package/dist/queries/portfolioQuery.d.ts +0 -143
- package/dist/queries/priceQuery.d.ts +0 -58
- package/dist/queries/referralQuery.d.ts +0 -7
- package/dist/queries/sCoinQuery.d.ts +0 -41
- package/dist/queries/spoolQuery.d.ts +0 -74
- package/dist/queries/supplyLimitQuery.d.ts +0 -9
- package/dist/queries/vescaQuery.d.ts +0 -36
- package/dist/queries/xOracleQuery.d.ts +0 -13
- package/dist/types/address.d.ts +0 -108
- package/dist/types/builder/borrowIncentive.d.ts +0 -35
- package/dist/types/builder/core.d.ts +0 -56
- package/dist/types/builder/index.d.ts +0 -24
- package/dist/types/builder/loyaltyProgram.d.ts +0 -23
- package/dist/types/builder/referral.d.ts +0 -30
- package/dist/types/builder/sCoin.d.ts +0 -37
- package/dist/types/builder/spool.d.ts +0 -29
- package/dist/types/builder/vesca.d.ts +0 -51
- package/dist/types/constant/common.d.ts +0 -24
- package/dist/types/constant/enum.d.ts +0 -48
- package/dist/types/constant/index.d.ts +0 -3
- package/dist/types/constant/xOracle.d.ts +0 -9
- package/dist/types/index.d.ts +0 -6
- package/dist/types/model.d.ts +0 -60
- package/dist/types/query/borrowIncentive.d.ts +0 -124
- package/dist/types/query/core.d.ts +0 -380
- package/dist/types/query/index.d.ts +0 -7
- package/dist/types/query/loyaltyProgram.d.ts +0 -5
- package/dist/types/query/portfolio.d.ts +0 -119
- package/dist/types/query/sCoin.d.ts +0 -1
- package/dist/types/query/spool.d.ts +0 -142
- package/dist/types/query/vesca.d.ts +0 -26
- package/dist/types/utils.d.ts +0 -22
- package/dist/utils/builder.d.ts +0 -15
- package/dist/utils/core.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/indexer.d.ts +0 -17
- package/dist/utils/query.d.ts +0 -62
- package/dist/utils/util.d.ts +0 -27
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { SuiObjectArg, SuiTxBlock as SuiKitTxBlock, TransactionResult } from '@scallop-io/sui-kit';
|
|
2
|
-
import { SupportSCoin } from '../constant';
|
|
3
|
-
import { ScallopBuilder } from 'src/models';
|
|
4
|
-
import { BaseScallopTxBlock } from '.';
|
|
5
|
-
export type sCoinPkgIds = {
|
|
6
|
-
pkgId: string;
|
|
7
|
-
};
|
|
8
|
-
export type sCoinNormalMethods = {
|
|
9
|
-
/**
|
|
10
|
-
* Lock marketCoin and return sCoin
|
|
11
|
-
* @param marketCoinName
|
|
12
|
-
* @param marketCoin
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
mintSCoin: (marketCoinName: SupportSCoin, marketCoin: SuiObjectArg) => TransactionResult;
|
|
16
|
-
/**
|
|
17
|
-
* Burn sCoin and return marketCoin
|
|
18
|
-
* @param sCoinName
|
|
19
|
-
* @param sCoin
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
burnSCoin: (sCoinName: SupportSCoin, sCoin: SuiObjectArg) => TransactionResult;
|
|
23
|
-
};
|
|
24
|
-
export type sCoinQuickMethods = {
|
|
25
|
-
mintSCoinQuick: (marketCoinName: SupportSCoin, amount: number) => Promise<TransactionResult>;
|
|
26
|
-
burnSCoinQuick: (sCoinName: SupportSCoin, amount: number) => Promise<TransactionResult>;
|
|
27
|
-
};
|
|
28
|
-
export type SuiTxBlockWithSCoinNormalMethods = SuiKitTxBlock & BaseScallopTxBlock & sCoinNormalMethods;
|
|
29
|
-
export type SCoinTxBlock = SuiTxBlockWithSCoinNormalMethods & sCoinQuickMethods;
|
|
30
|
-
export type GenerateSCoinNormalMethod = (params: {
|
|
31
|
-
builder: ScallopBuilder;
|
|
32
|
-
txBlock: SuiKitTxBlock;
|
|
33
|
-
}) => sCoinNormalMethods;
|
|
34
|
-
export type GenerateSCoinQuickMethod = (params: {
|
|
35
|
-
builder: ScallopBuilder;
|
|
36
|
-
txBlock: SuiTxBlockWithSCoinNormalMethods;
|
|
37
|
-
}) => sCoinQuickMethods;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { SuiTxBlock as SuiKitTxBlock, SuiAddressArg, SuiObjectArg } from '@scallop-io/sui-kit';
|
|
2
|
-
import type { TransactionResult } from '@mysten/sui/transactions';
|
|
3
|
-
import type { ScallopBuilder } from '../../models';
|
|
4
|
-
import type { SupportStakeMarketCoins } from '../constant';
|
|
5
|
-
import { SuiTxBlockWithSCoin } from '.';
|
|
6
|
-
export type SpoolIds = {
|
|
7
|
-
spoolPkg: string;
|
|
8
|
-
};
|
|
9
|
-
export type SpoolNormalMethods = {
|
|
10
|
-
createStakeAccount: (stakeMarketCoinName: SupportStakeMarketCoins) => TransactionResult;
|
|
11
|
-
stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName: SupportStakeMarketCoins) => void;
|
|
12
|
-
unstake: (stakeAccount: SuiAddressArg, amount: number, stakeMarketCoinName: SupportStakeMarketCoins) => TransactionResult;
|
|
13
|
-
claim: (stakeAccount: SuiAddressArg, stakeMarketCoinName: SupportStakeMarketCoins) => TransactionResult;
|
|
14
|
-
};
|
|
15
|
-
export type SpoolQuickMethods = {
|
|
16
|
-
stakeQuick(amountOrMarketCoin: SuiObjectArg | number, stakeMarketCoinName: SupportStakeMarketCoins, stakeAccountId?: SuiAddressArg): Promise<void>;
|
|
17
|
-
unstakeQuick(amount: number, stakeMarketCoinName: SupportStakeMarketCoins, stakeAccountId?: SuiAddressArg, returnSCoin?: boolean): Promise<TransactionResult | undefined>;
|
|
18
|
-
claimQuick(stakeMarketCoinName: SupportStakeMarketCoins, stakeAccountId?: SuiAddressArg): Promise<TransactionResult[]>;
|
|
19
|
-
};
|
|
20
|
-
export type SuiTxBlockWithSpoolNormalMethods = SuiKitTxBlock & SuiTxBlockWithSCoin & SpoolNormalMethods;
|
|
21
|
-
export type SpoolTxBlock = SuiTxBlockWithSpoolNormalMethods & SpoolQuickMethods;
|
|
22
|
-
export type GenerateSpoolNormalMethod = (params: {
|
|
23
|
-
builder: ScallopBuilder;
|
|
24
|
-
txBlock: SuiKitTxBlock;
|
|
25
|
-
}) => SpoolNormalMethods;
|
|
26
|
-
export type GenerateSpoolQuickMethod = (params: {
|
|
27
|
-
builder: ScallopBuilder;
|
|
28
|
-
txBlock: SuiTxBlockWithSpoolNormalMethods;
|
|
29
|
-
}) => SpoolQuickMethods;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { SuiTxBlock as SuiKitTxBlock, SuiObjectArg } from '@scallop-io/sui-kit';
|
|
2
|
-
import type { TransactionResult } from '@mysten/sui/transactions';
|
|
3
|
-
import { ScallopBuilder } from 'src/models';
|
|
4
|
-
export type VescaIds = {
|
|
5
|
-
pkgId: string;
|
|
6
|
-
table: string;
|
|
7
|
-
treasury: string;
|
|
8
|
-
config: string;
|
|
9
|
-
};
|
|
10
|
-
export type VeScaNormalMethods = {
|
|
11
|
-
lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: number) => TransactionResult;
|
|
12
|
-
extendLockPeriod: (veScaKey: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
|
|
13
|
-
extendLockAmount: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg) => void;
|
|
14
|
-
renewExpiredVeSca: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
|
|
15
|
-
redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
|
|
16
|
-
mintEmptyVeSca: () => TransactionResult;
|
|
17
|
-
};
|
|
18
|
-
export type RedeemScaQuickReturnType<T extends boolean> = T extends true ? void : TransactionResult | undefined;
|
|
19
|
-
export type VeScaQuickMethods = {
|
|
20
|
-
/**
|
|
21
|
-
* Quick methods to automate
|
|
22
|
-
* lock initial SCA, extend lock period, lock more SCA, renew expired VeSCA, and redeem SCA
|
|
23
|
-
*
|
|
24
|
-
* **Flow:**
|
|
25
|
-
* - If only `amountOrCoin` is provided, it will lock the amount of existing not expired veSCA
|
|
26
|
-
* - If only `lockPeriodInDays` is provided, it will extend the lock period of existing not expired veSCA
|
|
27
|
-
*
|
|
28
|
-
* **Note:**
|
|
29
|
-
* - If one or both flow above is used on a expired veSCA, it will claim the unlocked SCA
|
|
30
|
-
* and renew the veSCA first, and then flow continues
|
|
31
|
-
* - If users has no veSCA yet, they need to provide both `amountOrCoin` and `lockPeriodInDays` for initial lock
|
|
32
|
-
* @param amountOrCoin
|
|
33
|
-
* @param lockPeriodInDays
|
|
34
|
-
* @param autoCheck
|
|
35
|
-
*/
|
|
36
|
-
lockScaQuick(amountOrCoin?: SuiObjectArg | number, lockPeriodInDays?: number, autoCheck?: boolean): Promise<void>;
|
|
37
|
-
extendLockPeriodQuick: (lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
|
|
38
|
-
extendLockAmountQuick: (scaAmount: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
|
|
39
|
-
renewExpiredVeScaQuick: (scaAmount: number, lockPeriodInDays: number, veScaKey?: SuiObjectArg, autoCheck?: boolean) => Promise<void>;
|
|
40
|
-
redeemScaQuick: <T extends boolean>(veSCaKey?: SuiObjectArg, transferSca?: T) => Promise<RedeemScaQuickReturnType<T>>;
|
|
41
|
-
};
|
|
42
|
-
export type SuiTxBlockWithVeScaNormalMethods = SuiKitTxBlock & VeScaNormalMethods;
|
|
43
|
-
export type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
|
|
44
|
-
export type GenerateVeScaNormalMethod = (params: {
|
|
45
|
-
builder: ScallopBuilder;
|
|
46
|
-
txBlock: SuiKitTxBlock;
|
|
47
|
-
}) => VeScaNormalMethods;
|
|
48
|
-
export type GenerateVeScaQuickMethod = (params: {
|
|
49
|
-
builder: ScallopBuilder;
|
|
50
|
-
txBlock: SuiTxBlockWithVeScaNormalMethods;
|
|
51
|
-
}) => VeScaQuickMethods;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SUPPORT_POOLS, SUPPORT_COLLATERALS, SUPPORT_ORACLES, SUPPORT_PACKAGES, SUPPORT_SPOOLS, SUPPORT_SPOOLS_REWARDS, SUPPORT_BORROW_INCENTIVE_POOLS, SUPPORT_BORROW_INCENTIVE_REWARDS, SUPPORT_SCOIN, SUPPORT_SUI_BRIDGE, SUPPORT_WORMHOLE } from '../../constants';
|
|
2
|
-
type ParseMarketCoins<T extends string> = `s${T}`;
|
|
3
|
-
type ParseCoins<T extends string> = T extends `s${infer R}` ? R : never;
|
|
4
|
-
export type SupportCoins = SupportAssetCoins | SupportMarketCoins | SupportStakeMarketCoins | SupportSCoin;
|
|
5
|
-
export type SupportAssetCoins = SupportPoolCoins | SupportCollateralCoins | SupportStakeRewardCoins;
|
|
6
|
-
export type SupportPoolCoins = (typeof SUPPORT_POOLS)[number];
|
|
7
|
-
export type SupportCollateralCoins = (typeof SUPPORT_COLLATERALS)[number];
|
|
8
|
-
export type SupportMarketCoins = ParseMarketCoins<SupportPoolCoins> | SupportStakeMarketCoins;
|
|
9
|
-
export type SupportStakeMarketCoins = (typeof SUPPORT_SPOOLS)[number];
|
|
10
|
-
export type SupportSuiBridgeCoins = (typeof SUPPORT_SUI_BRIDGE)[number];
|
|
11
|
-
export type SupportWormholeCoins = (typeof SUPPORT_WORMHOLE)[number];
|
|
12
|
-
export type SupportStakeCoins = Extract<SupportPoolCoins, ParseCoins<SupportStakeMarketCoins>>;
|
|
13
|
-
export type SupportStakeRewardCoins = (typeof SUPPORT_SPOOLS_REWARDS)[number];
|
|
14
|
-
export type SupportBorrowIncentiveCoins = (typeof SUPPORT_BORROW_INCENTIVE_POOLS)[number];
|
|
15
|
-
export type SupportBorrowIncentiveRewardCoins = (typeof SUPPORT_BORROW_INCENTIVE_REWARDS)[number];
|
|
16
|
-
export type SupportSCoin = (typeof SUPPORT_SCOIN)[number];
|
|
17
|
-
export type SupportOracleType = (typeof SUPPORT_ORACLES)[number];
|
|
18
|
-
export type SupportPackageType = (typeof SUPPORT_PACKAGES)[number];
|
|
19
|
-
export type SupportCoinDecimals = Record<SupportCoins, number>;
|
|
20
|
-
export type CoinWrappedType = {
|
|
21
|
-
from: string;
|
|
22
|
-
type: string;
|
|
23
|
-
} | undefined;
|
|
24
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { SupportCoins, SupportAssetCoins, SupportMarketCoins, SupportStakeMarketCoins, SupportStakeRewardCoins, SupportBorrowIncentiveCoins, SupportBorrowIncentiveRewardCoins, SupportSCoin, SupportSuiBridgeCoins } from './common';
|
|
2
|
-
export type Coins = {
|
|
3
|
-
[K in SupportCoins]: K;
|
|
4
|
-
};
|
|
5
|
-
export type AssetCoins = {
|
|
6
|
-
[K in SupportAssetCoins]: K;
|
|
7
|
-
};
|
|
8
|
-
export type MarketCoins = {
|
|
9
|
-
[K in SupportMarketCoins]: K;
|
|
10
|
-
};
|
|
11
|
-
export type SCoins = {
|
|
12
|
-
[K in SupportSCoin]: K;
|
|
13
|
-
};
|
|
14
|
-
export type StakeMarketCoins = {
|
|
15
|
-
[K in SupportStakeMarketCoins]: K;
|
|
16
|
-
};
|
|
17
|
-
export type StakeRewardCoins = {
|
|
18
|
-
[key in SupportStakeMarketCoins]: SupportStakeRewardCoins;
|
|
19
|
-
};
|
|
20
|
-
export type SuiBridgeCoins = {
|
|
21
|
-
[K in SupportSuiBridgeCoins]: K;
|
|
22
|
-
};
|
|
23
|
-
export type BorrowIncentiveRewardCoins = {
|
|
24
|
-
[key in SupportBorrowIncentiveCoins]: SupportBorrowIncentiveRewardCoins[];
|
|
25
|
-
};
|
|
26
|
-
export type AssetCoinIds = {
|
|
27
|
-
[key in SupportAssetCoins]: string;
|
|
28
|
-
};
|
|
29
|
-
export type SCoinIds = {
|
|
30
|
-
[key in SupportSCoin]: string;
|
|
31
|
-
};
|
|
32
|
-
export type SCoinTreasuryCaps = {
|
|
33
|
-
[key in SupportSCoin]: string;
|
|
34
|
-
};
|
|
35
|
-
export type SCoinConverterTreasury = {
|
|
36
|
-
[key in SupportSCoin]: string;
|
|
37
|
-
};
|
|
38
|
-
type PickFromUnion<T, K extends string> = K extends T ? K : never;
|
|
39
|
-
export type WormholeCoinIds = {
|
|
40
|
-
[key in PickFromUnion<SupportAssetCoins, 'weth' | 'wbtc' | 'wusdc' | 'wusdt' | 'wapt' | 'wsol'>]: string;
|
|
41
|
-
};
|
|
42
|
-
export type VoloCoinIds = {
|
|
43
|
-
[key in PickFromUnion<SupportAssetCoins, 'vsui'>]: string;
|
|
44
|
-
};
|
|
45
|
-
export type SuiBridgedCoinPackageIds = {
|
|
46
|
-
[key in SupportSuiBridgeCoins]: string;
|
|
47
|
-
};
|
|
48
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SupportAssetCoins, SupportOracleType } from './common';
|
|
2
|
-
export type xOracleRules = {
|
|
3
|
-
primary: SupportOracleType[];
|
|
4
|
-
secondary: SupportOracleType[];
|
|
5
|
-
};
|
|
6
|
-
export type xOracleRuleType = keyof xOracleRules;
|
|
7
|
-
export type xOracleListType = {
|
|
8
|
-
[key in SupportAssetCoins]: xOracleRules;
|
|
9
|
-
};
|
package/dist/types/index.d.ts
DELETED
package/dist/types/model.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
2
|
-
import type { Transaction, TransactionResult } from '@mysten/sui/transactions';
|
|
3
|
-
import type { SuiKit, SuiKitParams, NetworkType } from '@scallop-io/sui-kit';
|
|
4
|
-
import type { ScallopAddress, ScallopQuery, ScallopUtils, ScallopBuilder, ScallopIndexer } from '../models';
|
|
5
|
-
import { ScallopCache } from 'src/models/scallopCache';
|
|
6
|
-
import { AddressesInterface } from './address';
|
|
7
|
-
import { QueryClient, QueryClientConfig } from '@tanstack/query-core';
|
|
8
|
-
export type ScallopClientFnReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : Transaction;
|
|
9
|
-
export type ScallopClientVeScaReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : {
|
|
10
|
-
tx: Transaction;
|
|
11
|
-
scaCoin: TransactionResult;
|
|
12
|
-
};
|
|
13
|
-
export type ScallopBaseInstanceParams = {
|
|
14
|
-
suiKit?: SuiKit;
|
|
15
|
-
};
|
|
16
|
-
export type ScallopCacheInstanceParams = ScallopBaseInstanceParams & {
|
|
17
|
-
queryClient?: QueryClient;
|
|
18
|
-
};
|
|
19
|
-
export type ScallopAddressInstanceParams = ScallopBaseInstanceParams & {
|
|
20
|
-
cache?: ScallopCache;
|
|
21
|
-
};
|
|
22
|
-
export type ScallopIndexerInstanceParams = {
|
|
23
|
-
cache?: ScallopCache;
|
|
24
|
-
};
|
|
25
|
-
export type ScallopUtilsInstanceParams = ScallopBaseInstanceParams & {
|
|
26
|
-
address?: ScallopAddress;
|
|
27
|
-
};
|
|
28
|
-
export type ScallopQueryInstanceParams = ScallopBaseInstanceParams & {
|
|
29
|
-
utils?: ScallopUtils;
|
|
30
|
-
indexer?: ScallopIndexer;
|
|
31
|
-
};
|
|
32
|
-
export type ScallopBuilderInstanceParams = ScallopBaseInstanceParams & {
|
|
33
|
-
query?: ScallopQuery;
|
|
34
|
-
};
|
|
35
|
-
export type ScallopClientInstanceParams = ScallopBaseInstanceParams & {
|
|
36
|
-
builder?: ScallopBuilder;
|
|
37
|
-
};
|
|
38
|
-
export type ScallopAddressParams = {
|
|
39
|
-
id: string;
|
|
40
|
-
auth?: string;
|
|
41
|
-
network?: NetworkType;
|
|
42
|
-
forceInterface?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
43
|
-
};
|
|
44
|
-
export type ScallopParams = {
|
|
45
|
-
addressesId?: string;
|
|
46
|
-
forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
47
|
-
walletAddress?: string;
|
|
48
|
-
} & SuiKitParams;
|
|
49
|
-
export type ScallopClientParams = ScallopParams & ScallopBuilderParams & ScallopQueryParams & ScallopUtilsParams & ScallopCacheParams;
|
|
50
|
-
export type ScallopBuilderParams = ScallopParams & {
|
|
51
|
-
pythEndpoints?: string[];
|
|
52
|
-
usePythPullModel?: boolean;
|
|
53
|
-
} & ScallopQueryParams;
|
|
54
|
-
export type ScallopQueryParams = ScallopParams & ScallopUtilsParams;
|
|
55
|
-
export type ScallopUtilsParams = ScallopParams & {
|
|
56
|
-
pythEndpoints?: string[];
|
|
57
|
-
};
|
|
58
|
-
export type ScallopCacheParams = Omit<ScallopParams, 'addressId' | 'forceAddressesInterface'> & {
|
|
59
|
-
cacheOptions?: QueryClientConfig;
|
|
60
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import type { SupportBorrowIncentiveCoins, SupportBorrowIncentiveRewardCoins } from '../constant';
|
|
2
|
-
export interface BorrowIncentiveAccountKey {
|
|
3
|
-
id: string;
|
|
4
|
-
onwerId: string;
|
|
5
|
-
}
|
|
6
|
-
type OptionalKeys<T> = {
|
|
7
|
-
[K in keyof T]?: T[K];
|
|
8
|
-
};
|
|
9
|
-
export type BorrowIncentivePools = OptionalKeys<Record<SupportBorrowIncentiveCoins, BorrowIncentivePool>>;
|
|
10
|
-
export type BorrowIncentivePoolPoints = {
|
|
11
|
-
symbol: string;
|
|
12
|
-
coinName: SupportBorrowIncentiveRewardCoins;
|
|
13
|
-
coinType: string;
|
|
14
|
-
coinDecimal: number;
|
|
15
|
-
coinPrice: number;
|
|
16
|
-
} & Required<Pick<ParsedBorrowIncentivePoolPointData, 'points' | 'distributedPoint' | 'weightedAmount'>> & CalculatedBorrowIncentivePoolPointData;
|
|
17
|
-
export type BorrowIncentivePool = {
|
|
18
|
-
coinName: SupportBorrowIncentiveCoins;
|
|
19
|
-
symbol: string;
|
|
20
|
-
coinType: string;
|
|
21
|
-
coinDecimal: number;
|
|
22
|
-
coinPrice: number;
|
|
23
|
-
stakedAmount: number;
|
|
24
|
-
stakedCoin: number;
|
|
25
|
-
stakedValue: number;
|
|
26
|
-
points: OptionalKeys<Record<SupportBorrowIncentiveRewardCoins, BorrowIncentivePoolPoints>>;
|
|
27
|
-
};
|
|
28
|
-
export type OriginBorrowIncentivePoolPointData = {
|
|
29
|
-
point_type: {
|
|
30
|
-
name: string;
|
|
31
|
-
};
|
|
32
|
-
distributed_point_per_period: string;
|
|
33
|
-
point_distribution_time: string;
|
|
34
|
-
distributed_point: string;
|
|
35
|
-
points: string;
|
|
36
|
-
index: string;
|
|
37
|
-
base_weight: string;
|
|
38
|
-
weighted_amount: string;
|
|
39
|
-
last_update: string;
|
|
40
|
-
created_at: string;
|
|
41
|
-
};
|
|
42
|
-
export type OriginBorrowIncentivePoolData = {
|
|
43
|
-
pool_type: {
|
|
44
|
-
name: string;
|
|
45
|
-
};
|
|
46
|
-
points: OriginBorrowIncentivePoolPointData[];
|
|
47
|
-
min_stakes: string;
|
|
48
|
-
max_stakes: string;
|
|
49
|
-
stakes: string;
|
|
50
|
-
created_at: string;
|
|
51
|
-
};
|
|
52
|
-
export type ParsedBorrowIncentivePoolPointData = {
|
|
53
|
-
pointType: string;
|
|
54
|
-
distributedPointPerPeriod: number;
|
|
55
|
-
period: number;
|
|
56
|
-
distributedPoint: number;
|
|
57
|
-
points: number;
|
|
58
|
-
index: number;
|
|
59
|
-
baseWeight: number;
|
|
60
|
-
weightedAmount: number;
|
|
61
|
-
lastUpdate: number;
|
|
62
|
-
createdAt: number;
|
|
63
|
-
};
|
|
64
|
-
export type ParsedBorrowIncentivePoolData = {
|
|
65
|
-
poolType: string;
|
|
66
|
-
poolPoints: OptionalKeys<Record<SupportBorrowIncentiveRewardCoins, ParsedBorrowIncentivePoolPointData>>;
|
|
67
|
-
minStakes: number;
|
|
68
|
-
maxStakes: number;
|
|
69
|
-
staked: number;
|
|
70
|
-
};
|
|
71
|
-
export type CalculatedBorrowIncentivePoolPointData = {
|
|
72
|
-
baseWeight: number;
|
|
73
|
-
weightedStakedAmount: number;
|
|
74
|
-
weightedStakedCoin: number;
|
|
75
|
-
weightedStakedValue: number;
|
|
76
|
-
distributedPointPerSec: number;
|
|
77
|
-
accumulatedPoints: number;
|
|
78
|
-
currentPointIndex: number;
|
|
79
|
-
currentTotalDistributedPoint: number;
|
|
80
|
-
rewardApr: number;
|
|
81
|
-
rewardPerSec: number;
|
|
82
|
-
};
|
|
83
|
-
export type BorrowIncentiveAccounts = OptionalKeys<Record<SupportBorrowIncentiveCoins, ParsedBorrowIncentiveAccountData>>;
|
|
84
|
-
export type OriginBorrowIncentiveAccountPoolData = {
|
|
85
|
-
point_type: {
|
|
86
|
-
name: string;
|
|
87
|
-
};
|
|
88
|
-
weighted_amount: string;
|
|
89
|
-
points: string;
|
|
90
|
-
total_points: string;
|
|
91
|
-
index: string;
|
|
92
|
-
};
|
|
93
|
-
export type OriginBorrowIncentiveAccountData = {
|
|
94
|
-
points_list: OriginBorrowIncentiveAccountPoolData[];
|
|
95
|
-
pool_type: {
|
|
96
|
-
name: string;
|
|
97
|
-
};
|
|
98
|
-
debt_amount: string;
|
|
99
|
-
};
|
|
100
|
-
export type ParsedBorrowIncentiveAccountPoolData = {
|
|
101
|
-
pointType: string;
|
|
102
|
-
weightedAmount: number;
|
|
103
|
-
points: number;
|
|
104
|
-
totalPoints: number;
|
|
105
|
-
index: number;
|
|
106
|
-
};
|
|
107
|
-
export type ParsedBorrowIncentiveAccountData = {
|
|
108
|
-
pointList: OptionalKeys<Record<SupportBorrowIncentiveRewardCoins, ParsedBorrowIncentiveAccountPoolData>>;
|
|
109
|
-
poolType: string;
|
|
110
|
-
debtAmount: number;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
|
|
114
|
-
*/
|
|
115
|
-
export interface BorrowIncentivePoolsQueryInterface {
|
|
116
|
-
incentive_pools: OriginBorrowIncentivePoolData[];
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
|
|
120
|
-
*/
|
|
121
|
-
export interface BorrowIncentiveAccountsQueryInterface {
|
|
122
|
-
pool_records: OriginBorrowIncentiveAccountData[];
|
|
123
|
-
}
|
|
124
|
-
export {};
|