@scallop-io/sui-scallop-sdk 1.5.0-alpha.1 → 1.5.1
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 +3161 -0
- package/dist/index.d.ts +3161 -3
- package/dist/index.js +78 -9966
- package/dist/index.mjs +15 -9892
- package/package.json +5 -6
- package/src/builders/coreBuilder.ts +10 -14
- package/src/builders/oracle.ts +10 -2
- package/src/constants/coinGecko.ts +14 -4
- package/src/constants/common.ts +8 -1
- package/src/constants/enum.ts +28 -57
- package/src/constants/poolAddress.ts +294 -344
- package/src/constants/pyth.ts +4 -1
- package/src/constants/testAddress.ts +487 -61
- package/src/constants/xoracle.ts +18 -16
- package/src/models/scallopAddress.ts +54 -0
- package/src/models/scallopQuery.ts +8 -12
- package/src/queries/coreQuery.ts +4 -4
- package/src/queries/poolAddressesQuery.ts +2 -2
- package/src/queries/portfolioQuery.ts +7 -8
- package/src/queries/xOracleQuery.ts +15 -7
- package/src/types/address.ts +5 -0
- package/src/types/model.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,143 +0,0 @@
|
|
|
1
|
-
import type { ScallopQuery } from '../models';
|
|
2
|
-
import type { Market, SupportPoolCoins, MarketPool, Spool, StakeAccount, Lending, ObligationAccount, CoinAmounts, CoinPrices, TotalValueLocked, MarketPools, MarketCollaterals } from '../types';
|
|
3
|
-
import { SuiObjectRef } from '@mysten/sui/client';
|
|
4
|
-
/**
|
|
5
|
-
* Get user lending infomation for specific pools.
|
|
6
|
-
*
|
|
7
|
-
* @param query - The ScallopQuery instance.
|
|
8
|
-
* @param poolCoinNames - Specific an array of support pool coin name.
|
|
9
|
-
* @param ownerAddress - The owner address.
|
|
10
|
-
* @param indexer - Whether to use indexer.
|
|
11
|
-
* @return User lending infomation for specific pools.
|
|
12
|
-
*/
|
|
13
|
-
export declare const getLendings: (query: ScallopQuery, poolCoinNames?: SupportPoolCoins[], ownerAddress?: string, marketPools?: MarketPools, coinPrices?: CoinPrices, indexer?: boolean) => Promise<{
|
|
14
|
-
usdc?: Lending | undefined;
|
|
15
|
-
sbeth?: Lending | undefined;
|
|
16
|
-
sbusdt?: Lending | undefined;
|
|
17
|
-
sbwbtc?: Lending | undefined;
|
|
18
|
-
weth?: Lending | undefined;
|
|
19
|
-
wbtc?: Lending | undefined;
|
|
20
|
-
wusdc?: Lending | undefined;
|
|
21
|
-
wusdt?: Lending | undefined;
|
|
22
|
-
sui?: Lending | undefined;
|
|
23
|
-
wapt?: Lending | undefined;
|
|
24
|
-
wsol?: Lending | undefined;
|
|
25
|
-
cetus?: Lending | undefined;
|
|
26
|
-
afsui?: Lending | undefined;
|
|
27
|
-
hasui?: Lending | undefined;
|
|
28
|
-
vsui?: Lending | undefined;
|
|
29
|
-
sca?: Lending | undefined;
|
|
30
|
-
fud?: Lending | undefined;
|
|
31
|
-
deep?: Lending | undefined;
|
|
32
|
-
fdusd?: Lending | undefined;
|
|
33
|
-
blub?: Lending | undefined;
|
|
34
|
-
}>;
|
|
35
|
-
/**
|
|
36
|
-
* Get user lending infomation for specific pool.
|
|
37
|
-
*
|
|
38
|
-
* @description
|
|
39
|
-
* The lending information includes the spool information extended by it.
|
|
40
|
-
*
|
|
41
|
-
* @param query - The ScallopQuery instance.
|
|
42
|
-
* @param poolCoinName - Specific support coin name.
|
|
43
|
-
* @param ownerAddress - The owner address.
|
|
44
|
-
* @param indexer - Whether to use indexer.
|
|
45
|
-
* @param marketPool - The market pool data.
|
|
46
|
-
* @param spool - The spool data.
|
|
47
|
-
* @param stakeAccounts - The stake accounts data.
|
|
48
|
-
* @param coinAmount - The coin amount.
|
|
49
|
-
* @param marketCoinAmount - The market coin amount.
|
|
50
|
-
* @return User lending infomation for specific pool.
|
|
51
|
-
*/
|
|
52
|
-
export declare const getLending: (query: ScallopQuery, poolCoinName: SupportPoolCoins, ownerAddress?: string, indexer?: boolean, marketPool?: MarketPool, spool?: Spool, stakeAccounts?: StakeAccount[], coinAmount?: number, marketCoinAmount?: number, coinPrice?: number, sCoinAmount?: number) => Promise<Lending>;
|
|
53
|
-
/**
|
|
54
|
-
* Get all obligation accounts data.
|
|
55
|
-
*
|
|
56
|
-
* @param query - The Scallop query instance.
|
|
57
|
-
* @param ownerAddress - The owner address.
|
|
58
|
-
* @param indexer - Whether to use indexer.
|
|
59
|
-
* @return All obligation accounts data.
|
|
60
|
-
*/
|
|
61
|
-
export declare const getObligationAccounts: (query: ScallopQuery, ownerAddress?: string, market?: {
|
|
62
|
-
pools: MarketPools;
|
|
63
|
-
collaterals: MarketCollaterals;
|
|
64
|
-
}, coinPrices?: CoinPrices, indexer?: boolean) => Promise<{
|
|
65
|
-
[x: string]: ObligationAccount | undefined;
|
|
66
|
-
}>;
|
|
67
|
-
/**
|
|
68
|
-
* Get obligation account data.
|
|
69
|
-
*
|
|
70
|
-
* @param query - The Scallop query instance.
|
|
71
|
-
* @param obligation - The obligation id.
|
|
72
|
-
* @param indexer - Whether to use indexer.
|
|
73
|
-
* @return Obligation account data.
|
|
74
|
-
*/
|
|
75
|
-
export declare const getObligationAccount: (query: ScallopQuery, obligation: string | SuiObjectRef, ownerAddress?: string, indexer?: boolean, market?: Market, coinPrices?: CoinPrices, coinAmounts?: CoinAmounts) => Promise<ObligationAccount>;
|
|
76
|
-
/**
|
|
77
|
-
* Get total value locked data.
|
|
78
|
-
*
|
|
79
|
-
* @param query - The Scallop query instance.
|
|
80
|
-
* @param indexer - Whether to use indexer.
|
|
81
|
-
* @return Total value locked data.
|
|
82
|
-
*/
|
|
83
|
-
export declare const getTotalValueLocked: (query: ScallopQuery, indexer?: boolean) => Promise<TotalValueLocked>;
|
|
84
|
-
/**
|
|
85
|
-
* Get user portfolio by wallet address
|
|
86
|
-
*/
|
|
87
|
-
export declare const getUserPortfolio: (query: ScallopQuery, walletAddress: string, indexer?: boolean) => Promise<{
|
|
88
|
-
totalLockedScaValue: number;
|
|
89
|
-
lendings: {
|
|
90
|
-
suppliedCoin: number;
|
|
91
|
-
suppliedValue: number;
|
|
92
|
-
stakedCoin: number;
|
|
93
|
-
coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub";
|
|
94
|
-
symbol: string;
|
|
95
|
-
coinType: string;
|
|
96
|
-
coinPrice: number;
|
|
97
|
-
coinDecimals: number;
|
|
98
|
-
supplyApr: number;
|
|
99
|
-
supplyApy: number;
|
|
100
|
-
incentiveApr: number;
|
|
101
|
-
}[];
|
|
102
|
-
borrowings: {
|
|
103
|
-
obligationId: string;
|
|
104
|
-
totalDebtsInUsd: number;
|
|
105
|
-
totalCollateralInUsd: number;
|
|
106
|
-
riskLevel: number;
|
|
107
|
-
availableCollateralInUsd: number;
|
|
108
|
-
totalUnhealthyCollateralInUsd: number;
|
|
109
|
-
borrowedPools: {
|
|
110
|
-
coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub";
|
|
111
|
-
symbol: string;
|
|
112
|
-
coinDecimals: number;
|
|
113
|
-
coinType: string;
|
|
114
|
-
coinPrice: number;
|
|
115
|
-
borrowedCoin: number;
|
|
116
|
-
borrowedValueInUsd: number;
|
|
117
|
-
borrowApr: number | undefined;
|
|
118
|
-
borrowApy: number | undefined;
|
|
119
|
-
incentiveInfos: {
|
|
120
|
-
coinName: "usdc" | "sbeth" | "sbusdt" | "sbwbtc" | "weth" | "wbtc" | "wusdc" | "wusdt" | "sui" | "wapt" | "wsol" | "cetus" | "afsui" | "hasui" | "vsui" | "sca" | "fud" | "deep" | "fdusd" | "blub" | "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub";
|
|
121
|
-
symbol: string;
|
|
122
|
-
coinType: string;
|
|
123
|
-
incentiveApr: number;
|
|
124
|
-
}[];
|
|
125
|
-
}[];
|
|
126
|
-
}[];
|
|
127
|
-
pendingRewards: {
|
|
128
|
-
lendings: any;
|
|
129
|
-
borrowIncentives: any;
|
|
130
|
-
};
|
|
131
|
-
veScas: {
|
|
132
|
-
veScaKey: string;
|
|
133
|
-
coinPrice: number;
|
|
134
|
-
lockedScaInCoin: number;
|
|
135
|
-
lockedScaInUsd: number;
|
|
136
|
-
currentVeScaBalance: number;
|
|
137
|
-
remainingLockPeriodInDays: number;
|
|
138
|
-
unlockAt: number;
|
|
139
|
-
}[];
|
|
140
|
-
totalDebtValue: number;
|
|
141
|
-
totalCollateralValue: number;
|
|
142
|
-
totalSupplyValue: number;
|
|
143
|
-
}>;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { SuiObjectData } from '@mysten/sui/client';
|
|
2
|
-
import type { ScallopAddress, ScallopQuery } from '../models';
|
|
3
|
-
import type { CoinPrices, MarketPools, SupportAssetCoins } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Get price from pyth fee object.
|
|
6
|
-
*
|
|
7
|
-
* @param query - The Scallop query instance.
|
|
8
|
-
* @param assetCoinName - Specific support asset coin name.
|
|
9
|
-
* @return Asset coin price.
|
|
10
|
-
*/
|
|
11
|
-
export declare const getPythPrice: ({ address, }: {
|
|
12
|
-
address: ScallopAddress;
|
|
13
|
-
}, assetCoinName: SupportAssetCoins, priceFeedObject?: SuiObjectData | null) => Promise<number>;
|
|
14
|
-
export declare const getPythPrices: ({ address, }: {
|
|
15
|
-
address: ScallopAddress;
|
|
16
|
-
}, assetCoinNames: SupportAssetCoins[]) => Promise<Record<SupportAssetCoins, number>>;
|
|
17
|
-
export declare const getAllCoinPrices: (query: ScallopQuery, marketPools?: MarketPools, coinPrices?: CoinPrices, indexer?: boolean) => Promise<{
|
|
18
|
-
susdc?: number | undefined;
|
|
19
|
-
ssbeth?: number | undefined;
|
|
20
|
-
ssbusdt?: number | undefined;
|
|
21
|
-
ssbwbtc?: number | undefined;
|
|
22
|
-
sweth?: number | undefined;
|
|
23
|
-
swbtc?: number | undefined;
|
|
24
|
-
swusdc?: number | undefined;
|
|
25
|
-
swusdt?: number | undefined;
|
|
26
|
-
ssui?: number | undefined;
|
|
27
|
-
swsol?: number | undefined;
|
|
28
|
-
scetus?: number | undefined;
|
|
29
|
-
safsui?: number | undefined;
|
|
30
|
-
shasui?: number | undefined;
|
|
31
|
-
svsui?: number | undefined;
|
|
32
|
-
ssca?: number | undefined;
|
|
33
|
-
sfud?: number | undefined;
|
|
34
|
-
sdeep?: number | undefined;
|
|
35
|
-
sfdusd?: number | undefined;
|
|
36
|
-
sblub?: number | undefined;
|
|
37
|
-
usdc?: number | undefined;
|
|
38
|
-
sbeth?: number | undefined;
|
|
39
|
-
sbusdt?: number | undefined;
|
|
40
|
-
sbwbtc?: number | undefined;
|
|
41
|
-
weth?: number | undefined;
|
|
42
|
-
wbtc?: number | undefined;
|
|
43
|
-
wusdc?: number | undefined;
|
|
44
|
-
wusdt?: number | undefined;
|
|
45
|
-
sui?: number | undefined;
|
|
46
|
-
wapt?: number | undefined;
|
|
47
|
-
wsol?: number | undefined;
|
|
48
|
-
cetus?: number | undefined;
|
|
49
|
-
afsui?: number | undefined;
|
|
50
|
-
hasui?: number | undefined;
|
|
51
|
-
vsui?: number | undefined;
|
|
52
|
-
sca?: number | undefined;
|
|
53
|
-
fud?: number | undefined;
|
|
54
|
-
deep?: number | undefined;
|
|
55
|
-
fdusd?: number | undefined;
|
|
56
|
-
blub?: number | undefined;
|
|
57
|
-
swapt?: number | undefined;
|
|
58
|
-
}>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ScallopAddress } from 'src/models';
|
|
2
|
-
/**
|
|
3
|
-
* Query the veScaKeyId from the referral bindings table using the borrower address
|
|
4
|
-
* @param query
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export declare const queryVeScaKeyIdFromReferralBindings: (address: ScallopAddress, refereeAddress: string) => Promise<string | null>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ScallopQuery, ScallopUtils } from 'src/models';
|
|
2
|
-
import { OptionalKeys, SupportSCoin, sCoinBalance } from 'src/types';
|
|
3
|
-
/**
|
|
4
|
-
* Get total supply of sCoin
|
|
5
|
-
* @param query
|
|
6
|
-
* @param sCoinName
|
|
7
|
-
* @returns `number`
|
|
8
|
-
*/
|
|
9
|
-
export declare const getSCoinTotalSupply: ({ utils, }: {
|
|
10
|
-
utils: ScallopUtils;
|
|
11
|
-
}, sCoinName: SupportSCoin) => Promise<sCoinBalance>;
|
|
12
|
-
/**
|
|
13
|
-
* Query all owned sCoin amount.
|
|
14
|
-
*
|
|
15
|
-
* @param query - The Scallop query instance.
|
|
16
|
-
* @param sCoinNames - Specific an array of support sCoin name.
|
|
17
|
-
* @param ownerAddress - The owner address.
|
|
18
|
-
* @return All owned sCoins amount.
|
|
19
|
-
*/
|
|
20
|
-
export declare const getSCoinAmounts: ({ utils, }: {
|
|
21
|
-
utils: ScallopUtils;
|
|
22
|
-
}, sCoinNames?: SupportSCoin[], ownerAddress?: string) => Promise<OptionalKeys<Record<"susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub", number>>>;
|
|
23
|
-
/**
|
|
24
|
-
* Query owned sCoin amount.
|
|
25
|
-
*
|
|
26
|
-
* @param query - The Scallop query instance.
|
|
27
|
-
* @param sCoinNames - Specific support sCoin name.
|
|
28
|
-
* @param ownerAddress - The owner address.
|
|
29
|
-
* @return Owned sCoin amount.
|
|
30
|
-
*/
|
|
31
|
-
export declare const getSCoinAmount: ({ utils, }: {
|
|
32
|
-
utils: ScallopUtils;
|
|
33
|
-
}, sCoinName: SupportSCoin, ownerAddress?: string) => Promise<number>;
|
|
34
|
-
/**
|
|
35
|
-
* Get swap rate from sCoin A to sCoin B.
|
|
36
|
-
* @param fromSCoin
|
|
37
|
-
* @param toSCoin
|
|
38
|
-
* @param underlyingCoinPrice - The price of the underlying coin. For example, if fromSCoin is sSUI and toSCoin is sUSDC, then underlyingCoinPrice represents the price of 1 SUI in USDC.
|
|
39
|
-
* @returns number
|
|
40
|
-
*/
|
|
41
|
-
export declare const getSCoinSwapRate: (query: ScallopQuery, fromSCoin: SupportSCoin, toSCoin: SupportSCoin, underlyingCoinPrice?: number) => Promise<number>;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { SuiObjectData } from '@mysten/sui/client';
|
|
2
|
-
import type { ScallopQuery, ScallopUtils } from '../models';
|
|
3
|
-
import type { Spool, StakePool, StakeRewardPool, StakeAccounts, SupportStakeMarketCoins, CoinPrices, MarketPools } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Get spools data.
|
|
6
|
-
*
|
|
7
|
-
* @param query - The Scallop query instance.
|
|
8
|
-
* @param marketCoinNames - Specific an array of support stake market coin name.
|
|
9
|
-
* @param indexer - Whether to use indexer.
|
|
10
|
-
* @return Spools data.
|
|
11
|
-
*/
|
|
12
|
-
export declare const getSpools: (query: ScallopQuery, stakeMarketCoinNames?: SupportStakeMarketCoins[], indexer?: boolean, marketPools?: MarketPools, coinPrices?: CoinPrices) => Promise<{
|
|
13
|
-
susdc?: Spool | undefined;
|
|
14
|
-
sweth?: Spool | undefined;
|
|
15
|
-
swusdc?: Spool | undefined;
|
|
16
|
-
swusdt?: Spool | undefined;
|
|
17
|
-
ssui?: Spool | undefined;
|
|
18
|
-
scetus?: Spool | undefined;
|
|
19
|
-
safsui?: Spool | undefined;
|
|
20
|
-
shasui?: Spool | undefined;
|
|
21
|
-
svsui?: Spool | undefined;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Get spool data.
|
|
25
|
-
*
|
|
26
|
-
* @param query - The Scallop query instance.
|
|
27
|
-
* @param marketCoinName - Specific support stake market coin name.
|
|
28
|
-
* @param indexer - Whether to use indexer.
|
|
29
|
-
* @param marketPool - The market pool data.
|
|
30
|
-
* @param coinPrices - The coin prices.
|
|
31
|
-
* @return Spool data.
|
|
32
|
-
*/
|
|
33
|
-
export declare const getSpool: (query: ScallopQuery, marketCoinName: SupportStakeMarketCoins, indexer?: boolean, coinPrices?: CoinPrices, requiredObjects?: {
|
|
34
|
-
spool: SuiObjectData;
|
|
35
|
-
spoolReward: SuiObjectData;
|
|
36
|
-
}) => Promise<Spool>;
|
|
37
|
-
/**
|
|
38
|
-
* Get all stake accounts of the owner.
|
|
39
|
-
*
|
|
40
|
-
* @param query - The Scallop query instance.
|
|
41
|
-
* @param ownerAddress - Owner address.
|
|
42
|
-
* @return Stake accounts.
|
|
43
|
-
*/
|
|
44
|
-
export declare const getStakeAccounts: ({ utils, }: {
|
|
45
|
-
utils: ScallopUtils;
|
|
46
|
-
}, ownerAddress?: string) => Promise<StakeAccounts>;
|
|
47
|
-
/**
|
|
48
|
-
* Get stake pool data.
|
|
49
|
-
*
|
|
50
|
-
* @description
|
|
51
|
-
* For backward compatible, it is recommended to use `getSpool` method
|
|
52
|
-
* to get stake pool info in spool data.
|
|
53
|
-
*
|
|
54
|
-
* @param query - The Scallop query instance.
|
|
55
|
-
* @param marketCoinName - Specific support stake market coin name.
|
|
56
|
-
* @return Stake pool data.
|
|
57
|
-
*/
|
|
58
|
-
export declare const getStakePool: ({ utils, }: {
|
|
59
|
-
utils: ScallopUtils;
|
|
60
|
-
}, marketCoinName: SupportStakeMarketCoins) => Promise<StakePool | undefined>;
|
|
61
|
-
/**
|
|
62
|
-
* Get stake reward pool of the owner.
|
|
63
|
-
*
|
|
64
|
-
* @description
|
|
65
|
-
* For backward compatible, it is recommended to use `getSpool` method
|
|
66
|
-
* to get reward info in spool data.
|
|
67
|
-
*
|
|
68
|
-
* @param query - The Scallop query instance.
|
|
69
|
-
* @param marketCoinName - Specific support stake market coin name.
|
|
70
|
-
* @return Stake reward pool.
|
|
71
|
-
*/
|
|
72
|
-
export declare const getStakeRewardPool: ({ utils, }: {
|
|
73
|
-
utils: ScallopUtils;
|
|
74
|
-
}, marketCoinName: SupportStakeMarketCoins) => Promise<StakeRewardPool | undefined>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ScallopUtils } from 'src/models';
|
|
2
|
-
import { SupportPoolCoins } from 'src/types';
|
|
3
|
-
/**
|
|
4
|
-
* Return supply limit of a pool (including the decimals)
|
|
5
|
-
* @param utils
|
|
6
|
-
* @param poolName
|
|
7
|
-
* @returns supply limit (decimals included)
|
|
8
|
-
*/
|
|
9
|
-
export declare const getSupplyLimit: (utils: ScallopUtils, poolName: SupportPoolCoins) => Promise<string | null>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { VeScaTreasuryInfo, Vesca } from '../types';
|
|
2
|
-
import { type SuiObjectData } from '@mysten/sui/client';
|
|
3
|
-
import type { ScallopUtils } from '../models';
|
|
4
|
-
/**
|
|
5
|
-
* Query all owned veSca key.
|
|
6
|
-
*
|
|
7
|
-
* @param query - The Scallop query instance.
|
|
8
|
-
* @param ownerAddress - The owner address.
|
|
9
|
-
* @return Owned veSca key.
|
|
10
|
-
*/
|
|
11
|
-
export declare const getVescaKeys: (utils: ScallopUtils, ownerAddress?: string) => Promise<SuiObjectData[]>;
|
|
12
|
-
/**
|
|
13
|
-
* Query all owned veSca.
|
|
14
|
-
*
|
|
15
|
-
* @param query - The Scallop query instance.
|
|
16
|
-
* @param ownerAddress - The owner address.
|
|
17
|
-
* @return Owned veScas.
|
|
18
|
-
*/
|
|
19
|
-
export declare const getVeScas: ({ utils, }: {
|
|
20
|
-
utils: ScallopUtils;
|
|
21
|
-
}, ownerAddress: string, excludeEmpty?: boolean) => Promise<Vesca[]>;
|
|
22
|
-
/**
|
|
23
|
-
* Get veSca data.
|
|
24
|
-
*
|
|
25
|
-
* @param query - The Scallop query instance.
|
|
26
|
-
* @param veScaKey - The vesca key id.
|
|
27
|
-
* @param ownerAddress - The owner address.
|
|
28
|
-
* @returns Vesca data.
|
|
29
|
-
*/
|
|
30
|
-
export declare const getVeSca: (utils: ScallopUtils, veScaKey: string | SuiObjectData) => Promise<Vesca | undefined>;
|
|
31
|
-
/**
|
|
32
|
-
* Get veSCA treasury informations
|
|
33
|
-
* @param query
|
|
34
|
-
* @returns VeScaTreasuryInfo
|
|
35
|
-
*/
|
|
36
|
-
export declare const getVeScaTreasuryInfo: (utils: ScallopUtils) => Promise<VeScaTreasuryInfo | null>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SuiObjectResponse } from '@mysten/sui/client';
|
|
2
|
-
import { ScallopAddress, ScallopUtils } from 'src/models';
|
|
3
|
-
import { SupportAssetCoins, SupportOracleType, xOracleRuleType } from 'src/types';
|
|
4
|
-
/**
|
|
5
|
-
* Query the price update policy table ids. Usually the value for these table will be constant.
|
|
6
|
-
* @param query
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare const getPriceUpdatePolicies: (address: ScallopAddress) => Promise<{
|
|
10
|
-
primary: SuiObjectResponse | null;
|
|
11
|
-
secondary: SuiObjectResponse | null;
|
|
12
|
-
}>;
|
|
13
|
-
export declare const getAssetOracles: (utils: ScallopUtils, ruleType: xOracleRuleType) => Promise<Record<SupportAssetCoins, SupportOracleType[]>>;
|
package/dist/types/address.d.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { SUPPORT_ORACLES } from '../constants';
|
|
2
|
-
import type { SupportAssetCoins, SupportOracleType, SupportPackageType, SupportSCoin, SupportStakeMarketCoins } from './constant';
|
|
3
|
-
export interface AddressesInterface {
|
|
4
|
-
core: {
|
|
5
|
-
version: string;
|
|
6
|
-
versionCap: string;
|
|
7
|
-
object: string;
|
|
8
|
-
market: string;
|
|
9
|
-
adminCap: string;
|
|
10
|
-
coinDecimalsRegistry: string;
|
|
11
|
-
obligationAccessStore: string;
|
|
12
|
-
coins: Partial<Record<SupportAssetCoins, {
|
|
13
|
-
id: string;
|
|
14
|
-
treasury: string;
|
|
15
|
-
metaData: string;
|
|
16
|
-
oracle: {
|
|
17
|
-
[K in SupportOracleType]: K extends (typeof SUPPORT_ORACLES)[0] ? string : K extends (typeof SUPPORT_ORACLES)[1] ? string : K extends (typeof SUPPORT_ORACLES)[2] ? {
|
|
18
|
-
feed: string;
|
|
19
|
-
feedObject: string;
|
|
20
|
-
} : never;
|
|
21
|
-
};
|
|
22
|
-
}>>;
|
|
23
|
-
oracles: {
|
|
24
|
-
[K in SupportOracleType]: K extends (typeof SUPPORT_ORACLES)[0] ? {
|
|
25
|
-
registry: string;
|
|
26
|
-
registryCap: string;
|
|
27
|
-
holder: string;
|
|
28
|
-
} : K extends (typeof SUPPORT_ORACLES)[1] ? {
|
|
29
|
-
registry: string;
|
|
30
|
-
registryCap: string;
|
|
31
|
-
} : K extends (typeof SUPPORT_ORACLES)[2] ? {
|
|
32
|
-
registry: string;
|
|
33
|
-
registryCap: string;
|
|
34
|
-
state: string;
|
|
35
|
-
wormhole: string;
|
|
36
|
-
wormholeState: string;
|
|
37
|
-
} : never;
|
|
38
|
-
} & {
|
|
39
|
-
xOracle: string;
|
|
40
|
-
xOracleCap: string;
|
|
41
|
-
};
|
|
42
|
-
packages: Partial<Record<SupportPackageType, {
|
|
43
|
-
id: string;
|
|
44
|
-
object?: string;
|
|
45
|
-
upgradeCap: string;
|
|
46
|
-
}>>;
|
|
47
|
-
};
|
|
48
|
-
spool: {
|
|
49
|
-
id: string;
|
|
50
|
-
adminCap: string;
|
|
51
|
-
object: string;
|
|
52
|
-
config: string;
|
|
53
|
-
pools: Partial<Record<SupportStakeMarketCoins, {
|
|
54
|
-
id: string;
|
|
55
|
-
rewardPoolId: string;
|
|
56
|
-
}>>;
|
|
57
|
-
};
|
|
58
|
-
borrowIncentive: {
|
|
59
|
-
id: string;
|
|
60
|
-
adminCap: string;
|
|
61
|
-
object: string;
|
|
62
|
-
query: string;
|
|
63
|
-
config: string;
|
|
64
|
-
incentivePools: string;
|
|
65
|
-
incentiveAccounts: string;
|
|
66
|
-
};
|
|
67
|
-
vesca: {
|
|
68
|
-
id: string;
|
|
69
|
-
object: string;
|
|
70
|
-
adminCap: string;
|
|
71
|
-
tableId: string;
|
|
72
|
-
table: string;
|
|
73
|
-
treasury: string;
|
|
74
|
-
config: string;
|
|
75
|
-
};
|
|
76
|
-
referral: {
|
|
77
|
-
id: string;
|
|
78
|
-
version: string;
|
|
79
|
-
object: string;
|
|
80
|
-
adminCap: string;
|
|
81
|
-
referralBindings: string;
|
|
82
|
-
bindingTableId: string;
|
|
83
|
-
referralRevenuePool: string;
|
|
84
|
-
revenueTableId: string;
|
|
85
|
-
referralTiers: string;
|
|
86
|
-
tiersTableId: string;
|
|
87
|
-
authorizedWitnessList: string;
|
|
88
|
-
};
|
|
89
|
-
loyaltyProgram: {
|
|
90
|
-
id: string;
|
|
91
|
-
object: string;
|
|
92
|
-
rewardPool: string;
|
|
93
|
-
userRewardTableId: string;
|
|
94
|
-
};
|
|
95
|
-
scoin: {
|
|
96
|
-
id: string;
|
|
97
|
-
coins: Partial<Record<SupportSCoin, {
|
|
98
|
-
coinType: string;
|
|
99
|
-
treasury: string;
|
|
100
|
-
}>>;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
type AddressPathsProps<T> = T extends string ? [] : {
|
|
104
|
-
[K in Extract<keyof T, string>]: [K, ...AddressPathsProps<T[K]>];
|
|
105
|
-
}[Extract<keyof T, string>];
|
|
106
|
-
type Join<T extends string[], D extends string> = T extends [] ? never : T extends [infer F] ? F : T extends [infer F, ...infer R] ? F extends string ? `${F}${D}${Join<Extract<R, string[]>, D>}` : never : string;
|
|
107
|
-
export type AddressStringPath = Join<AddressPathsProps<AddressesInterface>, '.'>;
|
|
108
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { SuiTxBlock as SuiKitTxBlock, SuiObjectArg } from '@scallop-io/sui-kit';
|
|
2
|
-
import type { TransactionResult } from '@mysten/sui/transactions';
|
|
3
|
-
import type { ScallopBuilder } from '../../models';
|
|
4
|
-
import type { SupportBorrowIncentiveRewardCoins } from '../constant';
|
|
5
|
-
export type BorrowIncentiveIds = {
|
|
6
|
-
borrowIncentivePkg: string;
|
|
7
|
-
query: string;
|
|
8
|
-
config: string;
|
|
9
|
-
incentivePools: string;
|
|
10
|
-
incentiveAccounts: string;
|
|
11
|
-
obligationAccessStore: string;
|
|
12
|
-
};
|
|
13
|
-
export type BorrowIncentiveNormalMethods = {
|
|
14
|
-
stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
|
|
15
|
-
stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
|
|
16
|
-
unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
|
|
17
|
-
claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, rewardType: SupportBorrowIncentiveRewardCoins) => TransactionResult;
|
|
18
|
-
deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
|
|
19
|
-
};
|
|
20
|
-
export type BorrowIncentiveQuickMethods = {
|
|
21
|
-
stakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
|
|
22
|
-
stakeObligationWithVeScaQuick(obligation?: string, obligationKey?: string, veScaKey?: string): Promise<void>;
|
|
23
|
-
unstakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
|
|
24
|
-
claimBorrowIncentiveQuick(rewardType: SupportBorrowIncentiveRewardCoins, obligation?: string, obligationKey?: string): Promise<TransactionResult>;
|
|
25
|
-
};
|
|
26
|
-
export type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiKitTxBlock & BorrowIncentiveNormalMethods;
|
|
27
|
-
export type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
|
|
28
|
-
export type GenerateBorrowIncentiveNormalMethod = (params: {
|
|
29
|
-
builder: ScallopBuilder;
|
|
30
|
-
txBlock: SuiKitTxBlock;
|
|
31
|
-
}) => BorrowIncentiveNormalMethods;
|
|
32
|
-
export type GenerateBorrowIncentiveQuickMethod = (params: {
|
|
33
|
-
builder: ScallopBuilder;
|
|
34
|
-
txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
|
|
35
|
-
}) => BorrowIncentiveQuickMethods;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { SuiTxBlock as SuiKitTxBlock, SuiObjectArg, SuiTxArg } from '@scallop-io/sui-kit';
|
|
2
|
-
import type { Argument, TransactionResult } from '@mysten/sui/transactions';
|
|
3
|
-
import type { ScallopBuilder } from '../../models';
|
|
4
|
-
import type { SupportCollateralCoins, SupportPoolCoins, SupportAssetCoins } from '../constant';
|
|
5
|
-
import { SuiTxBlockWithSpool } from '.';
|
|
6
|
-
export type CoreIds = {
|
|
7
|
-
protocolPkg: string;
|
|
8
|
-
market: string;
|
|
9
|
-
version: string;
|
|
10
|
-
coinDecimalsRegistry: string;
|
|
11
|
-
xOracle: string;
|
|
12
|
-
};
|
|
13
|
-
export type NestedResult = Extract<Argument, {
|
|
14
|
-
$kind: 'NestedResult';
|
|
15
|
-
}>;
|
|
16
|
-
type Obligation = NestedResult;
|
|
17
|
-
type ObligationKey = NestedResult;
|
|
18
|
-
type ObligationHotPotato = NestedResult;
|
|
19
|
-
export type CoreNormalMethods = {
|
|
20
|
-
openObligation: () => [Obligation, ObligationKey, ObligationHotPotato];
|
|
21
|
-
returnObligation: (obligation: SuiObjectArg, obligationHotPotato: SuiObjectArg) => void;
|
|
22
|
-
openObligationEntry: () => void;
|
|
23
|
-
addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: SupportCollateralCoins) => void;
|
|
24
|
-
takeCollateral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, collateralCoinName: SupportCollateralCoins) => TransactionResult;
|
|
25
|
-
deposit: (coin: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
26
|
-
depositEntry: (coin: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
27
|
-
withdraw: (marketCoin: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
28
|
-
withdrawEntry: (marketCoin: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
29
|
-
borrow: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
30
|
-
borrowWithReferral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, borrowReferral: SuiObjectArg, amount: number | SuiTxArg, poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
31
|
-
borrowEntry: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
32
|
-
repay: (obligation: SuiObjectArg, coin: SuiObjectArg, poolCoinName: SupportPoolCoins) => void;
|
|
33
|
-
borrowFlashLoan: (amount: number | SuiTxArg, poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
34
|
-
repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName: SupportPoolCoins) => void;
|
|
35
|
-
};
|
|
36
|
-
export type CoreQuickMethods = {
|
|
37
|
-
addCollateralQuick: (amount: number, collateralCoinName: SupportCollateralCoins, obligationId?: SuiObjectArg) => Promise<void>;
|
|
38
|
-
takeCollateralQuick: (amount: number, collateralCoinName: SupportCollateralCoins, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
|
|
39
|
-
borrowQuick: (amount: number, poolCoinName: SupportPoolCoins, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
|
|
40
|
-
borrowWithReferralQuick: (amount: number, poolCoinName: SupportPoolCoins, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg) => Promise<TransactionResult>;
|
|
41
|
-
depositQuick: (amount: number, poolCoinName: SupportPoolCoins, returnSCoin?: boolean) => Promise<TransactionResult>;
|
|
42
|
-
withdrawQuick: (amount: number, poolCoinName: SupportPoolCoins) => Promise<TransactionResult>;
|
|
43
|
-
repayQuick: (amount: number, poolCoinName: SupportPoolCoins, obligationId?: SuiObjectArg) => Promise<void>;
|
|
44
|
-
updateAssetPricesQuick: (assetCoinNames?: SupportAssetCoins[]) => Promise<void>;
|
|
45
|
-
};
|
|
46
|
-
export type SuiTxBlockWithCoreNormalMethods = SuiKitTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
|
|
47
|
-
export type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
|
|
48
|
-
export type GenerateCoreNormalMethod = (params: {
|
|
49
|
-
builder: ScallopBuilder;
|
|
50
|
-
txBlock: SuiKitTxBlock;
|
|
51
|
-
}) => CoreNormalMethods;
|
|
52
|
-
export type GenerateCoreQuickMethod = (params: {
|
|
53
|
-
builder: ScallopBuilder;
|
|
54
|
-
txBlock: SuiTxBlockWithCoreNormalMethods;
|
|
55
|
-
}) => CoreQuickMethods;
|
|
56
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { CoreTxBlock, NestedResult } from './core';
|
|
2
|
-
import type { SpoolTxBlock } from './spool';
|
|
3
|
-
import type { BorrowIncentiveTxBlock } from './borrowIncentive';
|
|
4
|
-
import type { VeScaTxBlock } from './vesca';
|
|
5
|
-
import type { ReferralTxBlock } from './referral';
|
|
6
|
-
import { LoyaltyProgramTxBlock } from './loyaltyProgram';
|
|
7
|
-
import { SCoinTxBlock } from './sCoin';
|
|
8
|
-
import { SupportAssetCoins } from '../constant';
|
|
9
|
-
export type * from './core';
|
|
10
|
-
export type * from './spool';
|
|
11
|
-
export type * from './borrowIncentive';
|
|
12
|
-
export type * from './vesca';
|
|
13
|
-
export type * from './loyaltyProgram';
|
|
14
|
-
export type * from './sCoin';
|
|
15
|
-
export type BaseScallopTxBlock = ReferralTxBlock & LoyaltyProgramTxBlock & BorrowIncentiveTxBlock & VeScaTxBlock;
|
|
16
|
-
export type SuiTxBlockWithSCoin = BaseScallopTxBlock & SCoinTxBlock;
|
|
17
|
-
export type SuiTxBlockWithSpool = SuiTxBlockWithSCoin & SpoolTxBlock;
|
|
18
|
-
export type ScallopTxBlock = SuiTxBlockWithSpool & CoreTxBlock;
|
|
19
|
-
export type SelectCoinReturnType<T extends SupportAssetCoins> = T extends 'sui' ? {
|
|
20
|
-
takeCoin: NestedResult;
|
|
21
|
-
} : {
|
|
22
|
-
takeCoin: NestedResult;
|
|
23
|
-
leftCoin: NestedResult;
|
|
24
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SuiObjectArg, SuiTxBlock as SuiKitTxBlock, TransactionResult } from '@scallop-io/sui-kit';
|
|
2
|
-
import { type ScallopBuilder } from 'src/models';
|
|
3
|
-
export type LoyaltyProgramIds = {
|
|
4
|
-
loyaltyProgramPkgId: string;
|
|
5
|
-
rewardPool: string;
|
|
6
|
-
userRewardTableId: string;
|
|
7
|
-
};
|
|
8
|
-
export type LoyaltyProgramNormalMethods = {
|
|
9
|
-
claimLoyaltyRevenue: (veScaKey: SuiObjectArg) => TransactionResult;
|
|
10
|
-
};
|
|
11
|
-
export type LoyaltyProgramQuickMethods = {
|
|
12
|
-
claimLoyaltyRevenueQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
|
|
13
|
-
};
|
|
14
|
-
export type SuiTxBlockWithLoyaltyProgramNormalMethods = SuiKitTxBlock & LoyaltyProgramNormalMethods;
|
|
15
|
-
export type LoyaltyProgramTxBlock = SuiTxBlockWithLoyaltyProgramNormalMethods & LoyaltyProgramQuickMethods;
|
|
16
|
-
export type GenerateLoyaltyProgramNormalMethod = (params: {
|
|
17
|
-
builder: ScallopBuilder;
|
|
18
|
-
txBlock: SuiKitTxBlock;
|
|
19
|
-
}) => LoyaltyProgramNormalMethods;
|
|
20
|
-
export type GenerateLoyaltyProgramQuickMethod = (params: {
|
|
21
|
-
builder: ScallopBuilder;
|
|
22
|
-
txBlock: SuiTxBlockWithLoyaltyProgramNormalMethods;
|
|
23
|
-
}) => LoyaltyProgramQuickMethods;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SuiObjectArg, TransactionResult, SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
|
|
2
|
-
import { ScallopBuilder } from 'src/models';
|
|
3
|
-
import { SupportPoolCoins } from '../constant';
|
|
4
|
-
export type ReferralIds = {
|
|
5
|
-
referralPgkId: string;
|
|
6
|
-
referralBindings: string;
|
|
7
|
-
referralRevenuePool: string;
|
|
8
|
-
referralTiers: string;
|
|
9
|
-
authorizedWitnessList: string;
|
|
10
|
-
version: string;
|
|
11
|
-
};
|
|
12
|
-
export type ReferralNormalMethods = {
|
|
13
|
-
bindToReferral: (veScaKeyId: string) => void;
|
|
14
|
-
claimReferralTicket: (poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
15
|
-
burnReferralTicket: (ticket: SuiObjectArg, poolCoinName: SupportPoolCoins) => void;
|
|
16
|
-
claimReferralRevenue: (veScaKey: SuiObjectArg, poolCoinName: SupportPoolCoins) => TransactionResult;
|
|
17
|
-
};
|
|
18
|
-
export type ReferralQuickMethods = {
|
|
19
|
-
claimReferralRevenueQuick: (veScaKey: SuiObjectArg, coinNames: SupportPoolCoins[]) => Promise<void>;
|
|
20
|
-
};
|
|
21
|
-
export type SuiTxBlockWithReferralNormalMethods = SuiKitTxBlock & ReferralNormalMethods;
|
|
22
|
-
export type ReferralTxBlock = SuiTxBlockWithReferralNormalMethods & ReferralQuickMethods;
|
|
23
|
-
export type GenerateReferralNormalMethod = (params: {
|
|
24
|
-
builder: ScallopBuilder;
|
|
25
|
-
txBlock: SuiKitTxBlock;
|
|
26
|
-
}) => ReferralNormalMethods;
|
|
27
|
-
export type GenerateReferralQuickMethod = (params: {
|
|
28
|
-
builder: ScallopBuilder;
|
|
29
|
-
txBlock: SuiTxBlockWithReferralNormalMethods;
|
|
30
|
-
}) => ReferralQuickMethods;
|