@scallop-io/sui-scallop-sdk 2.3.0-lst-x-oracle-alpha.5 → 2.3.0-lst-x-oracle-alpha.6
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 +67 -36
- package/dist/index.d.ts +67 -36
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +1 -1
- package/src/builders/coreBuilder.ts +1 -1
- package/src/builders/loyaltyProgramBuilder.ts +1 -1
- package/src/builders/oracles/index.ts +1 -1
- package/src/builders/oracles/oraclePackageRegistry.ts +2 -3
- package/src/builders/oracles/priceFeedUpdater.ts +1 -1
- package/src/builders/oracles/xOracleUpdateStrategy.ts +1 -1
- package/src/builders/oracles/xOracleUpdater.ts +1 -1
- package/src/builders/referralBuilder.ts +1 -1
- package/src/builders/sCoinBuilder.ts +1 -1
- package/src/builders/spoolBuilder.ts +1 -1
- package/src/builders/vescaBuilder.ts +2 -2
- package/src/queries/coreQuery.ts +1 -1
- package/src/queries/loyaltyProgramQuery.ts +1 -1
- package/src/queries/poolAddressesQuery.ts +3 -1
- package/src/queries/priceQuery.ts +3 -2
- package/src/queries/sCoinQuery.ts +1 -1
- package/src/queries/spoolQuery.ts +4 -4
- package/src/queries/vescaQuery.ts +1 -1
- package/src/queries/xOracleQuery.ts +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
|
|
2
|
-
import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef } from '@mysten/sui/dist/cjs/client';
|
|
2
|
+
import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef as SuiObjectRef$1 } from '@mysten/sui/dist/cjs/client';
|
|
3
3
|
import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
|
|
4
4
|
import { SuiObjectArg, SuiTxArg, NetworkType, SuiKit, SuiKitParams, Transaction, SuiTxBlock, DerivePathParams, SuiAddressArg, TransactionResult as TransactionResult$1, SuiVecTxArg, SuiAmountsArg } from '@scallop-io/sui-kit';
|
|
5
5
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
6
6
|
import { QueryClient, QueryClientConfig, QueryKey } from '@tanstack/query-core';
|
|
7
7
|
import { AxiosInstance, AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
8
|
-
import { SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
8
|
+
import { SuiObjectRef, SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
9
9
|
import { Argument, TransactionResult, Transaction as Transaction$1, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
10
10
|
|
|
11
11
|
declare const API_BASE_URL: "https://sui.apis.scallop.io";
|
|
@@ -462,7 +462,7 @@ declare const MAX_LOCK_DURATION: number;
|
|
|
462
462
|
declare const MIN_INITIAL_LOCK_AMOUNT: 10000000000;
|
|
463
463
|
declare const MIN_TOP_UP_AMOUNT: 1000000000;
|
|
464
464
|
|
|
465
|
-
type PoolAddress
|
|
465
|
+
type PoolAddress = {
|
|
466
466
|
coinName: string;
|
|
467
467
|
symbol: string;
|
|
468
468
|
coinType: string;
|
|
@@ -722,10 +722,10 @@ type ScallopConstantsParams = {
|
|
|
722
722
|
poolAddresses?: string[];
|
|
723
723
|
whitelist?: string[];
|
|
724
724
|
};
|
|
725
|
-
forcePoolAddressInterface?: Record<string, PoolAddress
|
|
725
|
+
forcePoolAddressInterface?: Record<string, PoolAddress>;
|
|
726
726
|
forceWhitelistInterface?: Whitelist | Record<string, any>;
|
|
727
727
|
defaultValues?: {
|
|
728
|
-
poolAddresses?: Record<string, PoolAddress
|
|
728
|
+
poolAddresses?: Record<string, PoolAddress>;
|
|
729
729
|
whitelist?: Whitelist | Record<string, any>;
|
|
730
730
|
};
|
|
731
731
|
} & ScallopAddressParams;
|
|
@@ -760,9 +760,9 @@ declare class ScallopConstants extends ScallopAddress {
|
|
|
760
760
|
get protocolObjectId(): string;
|
|
761
761
|
get isInitialized(): boolean;
|
|
762
762
|
get whitelist(): Whitelist;
|
|
763
|
-
get poolAddresses(): Record<string, PoolAddress
|
|
763
|
+
get poolAddresses(): Record<string, PoolAddress | undefined>;
|
|
764
764
|
get defaultValues(): ({
|
|
765
|
-
poolAddresses?: Record<string, PoolAddress
|
|
765
|
+
poolAddresses?: Record<string, PoolAddress>;
|
|
766
766
|
whitelist?: Whitelist | Record<string, any>;
|
|
767
767
|
} & {
|
|
768
768
|
addresses?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
@@ -777,13 +777,13 @@ declare class ScallopConstants extends ScallopAddress {
|
|
|
777
777
|
}): Promise<void>;
|
|
778
778
|
private initConstants;
|
|
779
779
|
readWhiteList(): Promise<Whitelist>;
|
|
780
|
-
readPoolAddresses(): Promise<Record<string, PoolAddress
|
|
780
|
+
readPoolAddresses(): Promise<Record<string, PoolAddress>>;
|
|
781
781
|
}
|
|
782
782
|
|
|
783
|
-
type OptionalKeys$
|
|
783
|
+
type OptionalKeys$4<T> = {
|
|
784
784
|
[K in keyof T]?: T[K];
|
|
785
785
|
};
|
|
786
|
-
type BorrowIncentivePools = OptionalKeys$
|
|
786
|
+
type BorrowIncentivePools = OptionalKeys$4<Record<string, BorrowIncentivePool>>;
|
|
787
787
|
type BorrowIncentivePoolPoints = {
|
|
788
788
|
symbol: string;
|
|
789
789
|
coinName: string;
|
|
@@ -800,7 +800,7 @@ type BorrowIncentivePool = {
|
|
|
800
800
|
stakedAmount: number;
|
|
801
801
|
stakedCoin: number;
|
|
802
802
|
stakedValue: number;
|
|
803
|
-
points: OptionalKeys$
|
|
803
|
+
points: OptionalKeys$4<Record<string, BorrowIncentivePoolPoints>>;
|
|
804
804
|
};
|
|
805
805
|
type ParsedBorrowIncentivePoolPointData = {
|
|
806
806
|
pointType: string;
|
|
@@ -834,16 +834,16 @@ type ParsedBorrowIncentiveAccountPoolData = {
|
|
|
834
834
|
index: number;
|
|
835
835
|
};
|
|
836
836
|
type ParsedBorrowIncentiveAccountData = {
|
|
837
|
-
pointList: OptionalKeys$
|
|
837
|
+
pointList: OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountPoolData>>;
|
|
838
838
|
poolType: string;
|
|
839
839
|
debtAmount: number;
|
|
840
840
|
};
|
|
841
841
|
|
|
842
|
-
type OptionalKeys$
|
|
842
|
+
type OptionalKeys$3<T> = {
|
|
843
843
|
[K in keyof T]?: T[K];
|
|
844
844
|
};
|
|
845
|
-
type MarketPools = OptionalKeys$
|
|
846
|
-
type MarketCollaterals = OptionalKeys$
|
|
845
|
+
type MarketPools = OptionalKeys$3<Record<string, MarketPool>>;
|
|
846
|
+
type MarketCollaterals = OptionalKeys$3<Record<string, MarketCollateral>>;
|
|
847
847
|
type MarketPool = {
|
|
848
848
|
coinName: string;
|
|
849
849
|
symbol: string;
|
|
@@ -1037,10 +1037,22 @@ interface ObligationQueryInterface {
|
|
|
1037
1037
|
}[];
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
|
-
type
|
|
1040
|
+
type LoyaltyProgramInfo = {
|
|
1041
|
+
pendingReward: number;
|
|
1042
|
+
totalPoolReward: number;
|
|
1043
|
+
isClaimEnabled: boolean;
|
|
1044
|
+
};
|
|
1045
|
+
type VeScaLoyaltyProgramInfo = {
|
|
1046
|
+
pendingVeScaReward: number;
|
|
1047
|
+
pendingScaReward: number;
|
|
1048
|
+
totalPoolReward: number;
|
|
1049
|
+
isClaimEnabled: boolean;
|
|
1050
|
+
};
|
|
1051
|
+
|
|
1052
|
+
type OptionalKeys$2<T> = {
|
|
1041
1053
|
[K in keyof T]?: T[K];
|
|
1042
1054
|
};
|
|
1043
|
-
type Spools = OptionalKeys$
|
|
1055
|
+
type Spools = OptionalKeys$2<Record<string, Spool>>;
|
|
1044
1056
|
type Spool = {
|
|
1045
1057
|
marketCoinName: string;
|
|
1046
1058
|
symbol: string;
|
|
@@ -1133,7 +1145,7 @@ interface StakeRewardPool {
|
|
|
1133
1145
|
claimedRewards: number;
|
|
1134
1146
|
}
|
|
1135
1147
|
|
|
1136
|
-
type OptionalKeys$
|
|
1148
|
+
type OptionalKeys$1<T> = {
|
|
1137
1149
|
[K in keyof T]?: T[K];
|
|
1138
1150
|
};
|
|
1139
1151
|
type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
|
|
@@ -1178,9 +1190,9 @@ type ObligationAccount = {
|
|
|
1178
1190
|
totalDepositedPools: number;
|
|
1179
1191
|
totalBorrowedPools: number;
|
|
1180
1192
|
totalRewardedPools: number;
|
|
1181
|
-
collaterals: OptionalKeys$
|
|
1182
|
-
debts: OptionalKeys$
|
|
1183
|
-
borrowIncentives: OptionalKeys$
|
|
1193
|
+
collaterals: OptionalKeys$1<Record<string, ObligationCollateral>>;
|
|
1194
|
+
debts: OptionalKeys$1<Record<string, ObligationDebt>>;
|
|
1195
|
+
borrowIncentives: OptionalKeys$1<Record<string, ObligationBorrowIncentive>>;
|
|
1184
1196
|
};
|
|
1185
1197
|
type ObligationCollateral = {
|
|
1186
1198
|
coinName: string;
|
|
@@ -1248,6 +1260,23 @@ type TotalValueLocked = {
|
|
|
1248
1260
|
totalValueChangeRatio?: number;
|
|
1249
1261
|
};
|
|
1250
1262
|
|
|
1263
|
+
type Vesca = {
|
|
1264
|
+
id: string;
|
|
1265
|
+
keyId: string;
|
|
1266
|
+
keyObject?: SuiObjectRef;
|
|
1267
|
+
object: SuiObjectRef;
|
|
1268
|
+
lockedScaAmount: string;
|
|
1269
|
+
lockedScaCoin: number;
|
|
1270
|
+
currentVeScaBalance: number;
|
|
1271
|
+
unlockAt: number;
|
|
1272
|
+
};
|
|
1273
|
+
type VeScaTreasuryInfo = {
|
|
1274
|
+
totalLockedSca: number;
|
|
1275
|
+
totalVeSca: number;
|
|
1276
|
+
averageLockingPeriod: number;
|
|
1277
|
+
averageLockingPeriodUnit: string;
|
|
1278
|
+
};
|
|
1279
|
+
|
|
1251
1280
|
type ScallopIndexerParams = {
|
|
1252
1281
|
indexerApiUrl?: string;
|
|
1253
1282
|
} & ScallopAxiosParams;
|
|
@@ -1326,10 +1355,10 @@ declare class ScallopIndexer extends ScallopAxios {
|
|
|
1326
1355
|
getCoinPrices(): Promise<Record<string, number>>;
|
|
1327
1356
|
}
|
|
1328
1357
|
|
|
1329
|
-
type OptionalKeys
|
|
1358
|
+
type OptionalKeys<T> = {
|
|
1330
1359
|
[K in keyof T]?: T[K];
|
|
1331
1360
|
};
|
|
1332
|
-
type CoinPrices = OptionalKeys
|
|
1361
|
+
type CoinPrices = OptionalKeys<Record<string, number>>;
|
|
1333
1362
|
|
|
1334
1363
|
type QueryInspectTxnParams = {
|
|
1335
1364
|
queryTarget: string;
|
|
@@ -1645,7 +1674,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1645
1674
|
* @param ownerAddress - The owner address.
|
|
1646
1675
|
* @return Borrow incentive accounts data.
|
|
1647
1676
|
*/
|
|
1648
|
-
getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?: string[]): Promise<{
|
|
1677
|
+
getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef$1, coinNames?: string[]): Promise<{
|
|
1649
1678
|
[x: string]: ParsedBorrowIncentiveAccountData | undefined;
|
|
1650
1679
|
}>;
|
|
1651
1680
|
/**
|
|
@@ -1725,7 +1754,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1725
1754
|
* @param veScaKey
|
|
1726
1755
|
* @returns veSca
|
|
1727
1756
|
*/
|
|
1728
|
-
getVeSca(veScaKey: string | SuiObjectData): Promise<
|
|
1757
|
+
getVeSca(veScaKey: string | SuiObjectData): Promise<Vesca | undefined>;
|
|
1729
1758
|
/**
|
|
1730
1759
|
* Get all veSca from walletAdddress
|
|
1731
1760
|
* @param walletAddress
|
|
@@ -1739,7 +1768,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1739
1768
|
* Get total vesca treasury with movecall
|
|
1740
1769
|
* @returns Promise<string | undefined>
|
|
1741
1770
|
*/
|
|
1742
|
-
getVeScaTreasuryInfo(): Promise<
|
|
1771
|
+
getVeScaTreasuryInfo(): Promise<VeScaTreasuryInfo | null>;
|
|
1743
1772
|
/**
|
|
1744
1773
|
* Return binded referrer veScaKeyId of referee walletAddress if exist
|
|
1745
1774
|
* @param walletAddress
|
|
@@ -1763,13 +1792,13 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1763
1792
|
* @param veScaKey
|
|
1764
1793
|
* @returns Loyalty program information
|
|
1765
1794
|
*/
|
|
1766
|
-
getLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<
|
|
1795
|
+
getLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<LoyaltyProgramInfo | null>;
|
|
1767
1796
|
/**
|
|
1768
1797
|
* Get user's veSCA rewards informations from loyalty program
|
|
1769
1798
|
* @param veScaKey
|
|
1770
1799
|
* @returns Loyalty program information
|
|
1771
1800
|
*/
|
|
1772
|
-
getVeScaLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<
|
|
1801
|
+
getVeScaLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<VeScaLoyaltyProgramInfo | null>;
|
|
1773
1802
|
/**
|
|
1774
1803
|
* Get total supply of sCoin
|
|
1775
1804
|
* @param sCoinName - Supported sCoin name
|
|
@@ -1834,7 +1863,9 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1834
1863
|
marketPools?: MarketPools;
|
|
1835
1864
|
coinPrices?: CoinPrices;
|
|
1836
1865
|
indexer?: boolean;
|
|
1837
|
-
}): Promise<
|
|
1866
|
+
}): Promise<{
|
|
1867
|
+
[x: string]: number | undefined;
|
|
1868
|
+
}>;
|
|
1838
1869
|
/**
|
|
1839
1870
|
* Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
|
|
1840
1871
|
* @returns
|
|
@@ -1900,13 +1931,13 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1900
1931
|
borrowIncentives: any;
|
|
1901
1932
|
};
|
|
1902
1933
|
veScas: {
|
|
1903
|
-
veScaKey:
|
|
1904
|
-
coinPrice:
|
|
1905
|
-
lockedScaInCoin:
|
|
1934
|
+
veScaKey: string;
|
|
1935
|
+
coinPrice: number;
|
|
1936
|
+
lockedScaInCoin: number;
|
|
1906
1937
|
lockedScaInUsd: number;
|
|
1907
|
-
currentVeScaBalance:
|
|
1938
|
+
currentVeScaBalance: number;
|
|
1908
1939
|
remainingLockPeriodInDays: number;
|
|
1909
|
-
unlockAt:
|
|
1940
|
+
unlockAt: number;
|
|
1910
1941
|
}[];
|
|
1911
1942
|
totalDebtValue: number;
|
|
1912
1943
|
totalCollateralValue: number;
|
|
@@ -2415,7 +2446,7 @@ declare class ScallopUtils implements ScallopUtilsInterface {
|
|
|
2415
2446
|
* @param assetCoinNames - Specific an array of support asset coin name.
|
|
2416
2447
|
* @return Asset coin price.
|
|
2417
2448
|
*/
|
|
2418
|
-
getCoinPrices(coinNames?: string[]): Promise<OptionalKeys
|
|
2449
|
+
getCoinPrices(coinNames?: string[]): Promise<OptionalKeys<Record<string, number>>>;
|
|
2419
2450
|
/**
|
|
2420
2451
|
* Convert apr to apy.
|
|
2421
2452
|
*
|
|
@@ -2450,7 +2481,7 @@ declare class ScallopUtils implements ScallopUtilsInterface {
|
|
|
2450
2481
|
* Get detailed contract address and price id information for supported pool in Scallop
|
|
2451
2482
|
* @returns Supported pool informations
|
|
2452
2483
|
*/
|
|
2453
|
-
getSupportedPoolAddresses(): PoolAddress
|
|
2484
|
+
getSupportedPoolAddresses(): PoolAddress[];
|
|
2454
2485
|
}
|
|
2455
2486
|
|
|
2456
2487
|
type ScallopClientParams = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _mysten_sui_dist_cjs_client from '@mysten/sui/dist/cjs/client';
|
|
2
|
-
import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef } from '@mysten/sui/dist/cjs/client';
|
|
2
|
+
import { SuiObjectDataOptions, GetOwnedObjectsParams, GetDynamicFieldsParams, GetDynamicFieldObjectParams, SuiObjectData, SuiObjectRef as SuiObjectRef$1 } from '@mysten/sui/dist/cjs/client';
|
|
3
3
|
import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
|
|
4
4
|
import { SuiObjectArg, SuiTxArg, NetworkType, SuiKit, SuiKitParams, Transaction, SuiTxBlock, DerivePathParams, SuiAddressArg, TransactionResult as TransactionResult$1, SuiVecTxArg, SuiAmountsArg } from '@scallop-io/sui-kit';
|
|
5
5
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
6
6
|
import { QueryClient, QueryClientConfig, QueryKey } from '@tanstack/query-core';
|
|
7
7
|
import { AxiosInstance, AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
8
|
-
import { SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
8
|
+
import { SuiObjectRef, SuiObjectDataOptions as SuiObjectDataOptions$1, SuiObjectResponse, SuiObjectData as SuiObjectData$1, GetOwnedObjectsParams as GetOwnedObjectsParams$1, GetDynamicFieldsParams as GetDynamicFieldsParams$1, DynamicFieldPage, GetDynamicFieldObjectParams as GetDynamicFieldObjectParams$1, CoinBalance, GetBalanceParams, DevInspectResults, SuiTransactionBlockResponse } from '@mysten/sui/client';
|
|
9
9
|
import { Argument, TransactionResult, Transaction as Transaction$1, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
10
10
|
|
|
11
11
|
declare const API_BASE_URL: "https://sui.apis.scallop.io";
|
|
@@ -462,7 +462,7 @@ declare const MAX_LOCK_DURATION: number;
|
|
|
462
462
|
declare const MIN_INITIAL_LOCK_AMOUNT: 10000000000;
|
|
463
463
|
declare const MIN_TOP_UP_AMOUNT: 1000000000;
|
|
464
464
|
|
|
465
|
-
type PoolAddress
|
|
465
|
+
type PoolAddress = {
|
|
466
466
|
coinName: string;
|
|
467
467
|
symbol: string;
|
|
468
468
|
coinType: string;
|
|
@@ -722,10 +722,10 @@ type ScallopConstantsParams = {
|
|
|
722
722
|
poolAddresses?: string[];
|
|
723
723
|
whitelist?: string[];
|
|
724
724
|
};
|
|
725
|
-
forcePoolAddressInterface?: Record<string, PoolAddress
|
|
725
|
+
forcePoolAddressInterface?: Record<string, PoolAddress>;
|
|
726
726
|
forceWhitelistInterface?: Whitelist | Record<string, any>;
|
|
727
727
|
defaultValues?: {
|
|
728
|
-
poolAddresses?: Record<string, PoolAddress
|
|
728
|
+
poolAddresses?: Record<string, PoolAddress>;
|
|
729
729
|
whitelist?: Whitelist | Record<string, any>;
|
|
730
730
|
};
|
|
731
731
|
} & ScallopAddressParams;
|
|
@@ -760,9 +760,9 @@ declare class ScallopConstants extends ScallopAddress {
|
|
|
760
760
|
get protocolObjectId(): string;
|
|
761
761
|
get isInitialized(): boolean;
|
|
762
762
|
get whitelist(): Whitelist;
|
|
763
|
-
get poolAddresses(): Record<string, PoolAddress
|
|
763
|
+
get poolAddresses(): Record<string, PoolAddress | undefined>;
|
|
764
764
|
get defaultValues(): ({
|
|
765
|
-
poolAddresses?: Record<string, PoolAddress
|
|
765
|
+
poolAddresses?: Record<string, PoolAddress>;
|
|
766
766
|
whitelist?: Whitelist | Record<string, any>;
|
|
767
767
|
} & {
|
|
768
768
|
addresses?: Partial<Record<NetworkType, AddressesInterface>>;
|
|
@@ -777,13 +777,13 @@ declare class ScallopConstants extends ScallopAddress {
|
|
|
777
777
|
}): Promise<void>;
|
|
778
778
|
private initConstants;
|
|
779
779
|
readWhiteList(): Promise<Whitelist>;
|
|
780
|
-
readPoolAddresses(): Promise<Record<string, PoolAddress
|
|
780
|
+
readPoolAddresses(): Promise<Record<string, PoolAddress>>;
|
|
781
781
|
}
|
|
782
782
|
|
|
783
|
-
type OptionalKeys$
|
|
783
|
+
type OptionalKeys$4<T> = {
|
|
784
784
|
[K in keyof T]?: T[K];
|
|
785
785
|
};
|
|
786
|
-
type BorrowIncentivePools = OptionalKeys$
|
|
786
|
+
type BorrowIncentivePools = OptionalKeys$4<Record<string, BorrowIncentivePool>>;
|
|
787
787
|
type BorrowIncentivePoolPoints = {
|
|
788
788
|
symbol: string;
|
|
789
789
|
coinName: string;
|
|
@@ -800,7 +800,7 @@ type BorrowIncentivePool = {
|
|
|
800
800
|
stakedAmount: number;
|
|
801
801
|
stakedCoin: number;
|
|
802
802
|
stakedValue: number;
|
|
803
|
-
points: OptionalKeys$
|
|
803
|
+
points: OptionalKeys$4<Record<string, BorrowIncentivePoolPoints>>;
|
|
804
804
|
};
|
|
805
805
|
type ParsedBorrowIncentivePoolPointData = {
|
|
806
806
|
pointType: string;
|
|
@@ -834,16 +834,16 @@ type ParsedBorrowIncentiveAccountPoolData = {
|
|
|
834
834
|
index: number;
|
|
835
835
|
};
|
|
836
836
|
type ParsedBorrowIncentiveAccountData = {
|
|
837
|
-
pointList: OptionalKeys$
|
|
837
|
+
pointList: OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountPoolData>>;
|
|
838
838
|
poolType: string;
|
|
839
839
|
debtAmount: number;
|
|
840
840
|
};
|
|
841
841
|
|
|
842
|
-
type OptionalKeys$
|
|
842
|
+
type OptionalKeys$3<T> = {
|
|
843
843
|
[K in keyof T]?: T[K];
|
|
844
844
|
};
|
|
845
|
-
type MarketPools = OptionalKeys$
|
|
846
|
-
type MarketCollaterals = OptionalKeys$
|
|
845
|
+
type MarketPools = OptionalKeys$3<Record<string, MarketPool>>;
|
|
846
|
+
type MarketCollaterals = OptionalKeys$3<Record<string, MarketCollateral>>;
|
|
847
847
|
type MarketPool = {
|
|
848
848
|
coinName: string;
|
|
849
849
|
symbol: string;
|
|
@@ -1037,10 +1037,22 @@ interface ObligationQueryInterface {
|
|
|
1037
1037
|
}[];
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
|
-
type
|
|
1040
|
+
type LoyaltyProgramInfo = {
|
|
1041
|
+
pendingReward: number;
|
|
1042
|
+
totalPoolReward: number;
|
|
1043
|
+
isClaimEnabled: boolean;
|
|
1044
|
+
};
|
|
1045
|
+
type VeScaLoyaltyProgramInfo = {
|
|
1046
|
+
pendingVeScaReward: number;
|
|
1047
|
+
pendingScaReward: number;
|
|
1048
|
+
totalPoolReward: number;
|
|
1049
|
+
isClaimEnabled: boolean;
|
|
1050
|
+
};
|
|
1051
|
+
|
|
1052
|
+
type OptionalKeys$2<T> = {
|
|
1041
1053
|
[K in keyof T]?: T[K];
|
|
1042
1054
|
};
|
|
1043
|
-
type Spools = OptionalKeys$
|
|
1055
|
+
type Spools = OptionalKeys$2<Record<string, Spool>>;
|
|
1044
1056
|
type Spool = {
|
|
1045
1057
|
marketCoinName: string;
|
|
1046
1058
|
symbol: string;
|
|
@@ -1133,7 +1145,7 @@ interface StakeRewardPool {
|
|
|
1133
1145
|
claimedRewards: number;
|
|
1134
1146
|
}
|
|
1135
1147
|
|
|
1136
|
-
type OptionalKeys$
|
|
1148
|
+
type OptionalKeys$1<T> = {
|
|
1137
1149
|
[K in keyof T]?: T[K];
|
|
1138
1150
|
};
|
|
1139
1151
|
type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
|
|
@@ -1178,9 +1190,9 @@ type ObligationAccount = {
|
|
|
1178
1190
|
totalDepositedPools: number;
|
|
1179
1191
|
totalBorrowedPools: number;
|
|
1180
1192
|
totalRewardedPools: number;
|
|
1181
|
-
collaterals: OptionalKeys$
|
|
1182
|
-
debts: OptionalKeys$
|
|
1183
|
-
borrowIncentives: OptionalKeys$
|
|
1193
|
+
collaterals: OptionalKeys$1<Record<string, ObligationCollateral>>;
|
|
1194
|
+
debts: OptionalKeys$1<Record<string, ObligationDebt>>;
|
|
1195
|
+
borrowIncentives: OptionalKeys$1<Record<string, ObligationBorrowIncentive>>;
|
|
1184
1196
|
};
|
|
1185
1197
|
type ObligationCollateral = {
|
|
1186
1198
|
coinName: string;
|
|
@@ -1248,6 +1260,23 @@ type TotalValueLocked = {
|
|
|
1248
1260
|
totalValueChangeRatio?: number;
|
|
1249
1261
|
};
|
|
1250
1262
|
|
|
1263
|
+
type Vesca = {
|
|
1264
|
+
id: string;
|
|
1265
|
+
keyId: string;
|
|
1266
|
+
keyObject?: SuiObjectRef;
|
|
1267
|
+
object: SuiObjectRef;
|
|
1268
|
+
lockedScaAmount: string;
|
|
1269
|
+
lockedScaCoin: number;
|
|
1270
|
+
currentVeScaBalance: number;
|
|
1271
|
+
unlockAt: number;
|
|
1272
|
+
};
|
|
1273
|
+
type VeScaTreasuryInfo = {
|
|
1274
|
+
totalLockedSca: number;
|
|
1275
|
+
totalVeSca: number;
|
|
1276
|
+
averageLockingPeriod: number;
|
|
1277
|
+
averageLockingPeriodUnit: string;
|
|
1278
|
+
};
|
|
1279
|
+
|
|
1251
1280
|
type ScallopIndexerParams = {
|
|
1252
1281
|
indexerApiUrl?: string;
|
|
1253
1282
|
} & ScallopAxiosParams;
|
|
@@ -1326,10 +1355,10 @@ declare class ScallopIndexer extends ScallopAxios {
|
|
|
1326
1355
|
getCoinPrices(): Promise<Record<string, number>>;
|
|
1327
1356
|
}
|
|
1328
1357
|
|
|
1329
|
-
type OptionalKeys
|
|
1358
|
+
type OptionalKeys<T> = {
|
|
1330
1359
|
[K in keyof T]?: T[K];
|
|
1331
1360
|
};
|
|
1332
|
-
type CoinPrices = OptionalKeys
|
|
1361
|
+
type CoinPrices = OptionalKeys<Record<string, number>>;
|
|
1333
1362
|
|
|
1334
1363
|
type QueryInspectTxnParams = {
|
|
1335
1364
|
queryTarget: string;
|
|
@@ -1645,7 +1674,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1645
1674
|
* @param ownerAddress - The owner address.
|
|
1646
1675
|
* @return Borrow incentive accounts data.
|
|
1647
1676
|
*/
|
|
1648
|
-
getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?: string[]): Promise<{
|
|
1677
|
+
getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef$1, coinNames?: string[]): Promise<{
|
|
1649
1678
|
[x: string]: ParsedBorrowIncentiveAccountData | undefined;
|
|
1650
1679
|
}>;
|
|
1651
1680
|
/**
|
|
@@ -1725,7 +1754,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1725
1754
|
* @param veScaKey
|
|
1726
1755
|
* @returns veSca
|
|
1727
1756
|
*/
|
|
1728
|
-
getVeSca(veScaKey: string | SuiObjectData): Promise<
|
|
1757
|
+
getVeSca(veScaKey: string | SuiObjectData): Promise<Vesca | undefined>;
|
|
1729
1758
|
/**
|
|
1730
1759
|
* Get all veSca from walletAdddress
|
|
1731
1760
|
* @param walletAddress
|
|
@@ -1739,7 +1768,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1739
1768
|
* Get total vesca treasury with movecall
|
|
1740
1769
|
* @returns Promise<string | undefined>
|
|
1741
1770
|
*/
|
|
1742
|
-
getVeScaTreasuryInfo(): Promise<
|
|
1771
|
+
getVeScaTreasuryInfo(): Promise<VeScaTreasuryInfo | null>;
|
|
1743
1772
|
/**
|
|
1744
1773
|
* Return binded referrer veScaKeyId of referee walletAddress if exist
|
|
1745
1774
|
* @param walletAddress
|
|
@@ -1763,13 +1792,13 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1763
1792
|
* @param veScaKey
|
|
1764
1793
|
* @returns Loyalty program information
|
|
1765
1794
|
*/
|
|
1766
|
-
getLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<
|
|
1795
|
+
getLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<LoyaltyProgramInfo | null>;
|
|
1767
1796
|
/**
|
|
1768
1797
|
* Get user's veSCA rewards informations from loyalty program
|
|
1769
1798
|
* @param veScaKey
|
|
1770
1799
|
* @returns Loyalty program information
|
|
1771
1800
|
*/
|
|
1772
|
-
getVeScaLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<
|
|
1801
|
+
getVeScaLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<VeScaLoyaltyProgramInfo | null>;
|
|
1773
1802
|
/**
|
|
1774
1803
|
* Get total supply of sCoin
|
|
1775
1804
|
* @param sCoinName - Supported sCoin name
|
|
@@ -1834,7 +1863,9 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1834
1863
|
marketPools?: MarketPools;
|
|
1835
1864
|
coinPrices?: CoinPrices;
|
|
1836
1865
|
indexer?: boolean;
|
|
1837
|
-
}): Promise<
|
|
1866
|
+
}): Promise<{
|
|
1867
|
+
[x: string]: number | undefined;
|
|
1868
|
+
}>;
|
|
1838
1869
|
/**
|
|
1839
1870
|
* Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
|
|
1840
1871
|
* @returns
|
|
@@ -1900,13 +1931,13 @@ declare class ScallopQuery implements ScallopQueryInterface {
|
|
|
1900
1931
|
borrowIncentives: any;
|
|
1901
1932
|
};
|
|
1902
1933
|
veScas: {
|
|
1903
|
-
veScaKey:
|
|
1904
|
-
coinPrice:
|
|
1905
|
-
lockedScaInCoin:
|
|
1934
|
+
veScaKey: string;
|
|
1935
|
+
coinPrice: number;
|
|
1936
|
+
lockedScaInCoin: number;
|
|
1906
1937
|
lockedScaInUsd: number;
|
|
1907
|
-
currentVeScaBalance:
|
|
1938
|
+
currentVeScaBalance: number;
|
|
1908
1939
|
remainingLockPeriodInDays: number;
|
|
1909
|
-
unlockAt:
|
|
1940
|
+
unlockAt: number;
|
|
1910
1941
|
}[];
|
|
1911
1942
|
totalDebtValue: number;
|
|
1912
1943
|
totalCollateralValue: number;
|
|
@@ -2415,7 +2446,7 @@ declare class ScallopUtils implements ScallopUtilsInterface {
|
|
|
2415
2446
|
* @param assetCoinNames - Specific an array of support asset coin name.
|
|
2416
2447
|
* @return Asset coin price.
|
|
2417
2448
|
*/
|
|
2418
|
-
getCoinPrices(coinNames?: string[]): Promise<OptionalKeys
|
|
2449
|
+
getCoinPrices(coinNames?: string[]): Promise<OptionalKeys<Record<string, number>>>;
|
|
2419
2450
|
/**
|
|
2420
2451
|
* Convert apr to apy.
|
|
2421
2452
|
*
|
|
@@ -2450,7 +2481,7 @@ declare class ScallopUtils implements ScallopUtilsInterface {
|
|
|
2450
2481
|
* Get detailed contract address and price id information for supported pool in Scallop
|
|
2451
2482
|
* @returns Supported pool informations
|
|
2452
2483
|
*/
|
|
2453
|
-
getSupportedPoolAddresses(): PoolAddress
|
|
2484
|
+
getSupportedPoolAddresses(): PoolAddress[];
|
|
2454
2485
|
}
|
|
2455
2486
|
|
|
2456
2487
|
type ScallopClientParams = {
|