@scallop-io/sui-scallop-sdk 2.3.0-lst-x-oracle-alpha.6 → 2.3.0-lst-x-oracle-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/index.d.mts CHANGED
@@ -119,6 +119,9 @@ declare const X_ORACLE_LIST: Record<string, Record<(typeof X_ORACLE_RULES)[numbe
119
119
  type SupportOracleType = (typeof SUPPORT_ORACLES)[number];
120
120
  type xOracleRuleType = (typeof X_ORACLE_RULES)[number];
121
121
  type xOracleRules = Record<xOracleRuleType, SupportOracleType[]>;
122
+ type xOracleListType = {
123
+ [key in string]: xOracleRules;
124
+ };
122
125
  type SupportedOracleSuiLst = (typeof SUPPORT_SUI_LST)[number];
123
126
 
124
127
  declare const _PACKAGE_NAMES: readonly ["coinDecimalsRegistry", "math", "whitelist", "x", "protocol", "protocolWhitelist", "query", "supra", "pyth", "switchboard", "xOracle", "testCoin"];
@@ -780,6 +783,10 @@ declare class ScallopConstants extends ScallopAddress {
780
783
  readPoolAddresses(): Promise<Record<string, PoolAddress>>;
781
784
  }
782
785
 
786
+ interface BorrowIncentiveAccountKey {
787
+ id: string;
788
+ onwerId: string;
789
+ }
783
790
  type OptionalKeys$4<T> = {
784
791
  [K in keyof T]?: T[K];
785
792
  };
@@ -802,6 +809,30 @@ type BorrowIncentivePool = {
802
809
  stakedValue: number;
803
810
  points: OptionalKeys$4<Record<string, BorrowIncentivePoolPoints>>;
804
811
  };
812
+ type OriginBorrowIncentivePoolPointData = {
813
+ point_type: {
814
+ name: string;
815
+ };
816
+ distributed_point_per_period: string;
817
+ point_distribution_time: string;
818
+ distributed_point: string;
819
+ points: string;
820
+ index: string;
821
+ base_weight: string;
822
+ weighted_amount: string;
823
+ last_update: string;
824
+ created_at: string;
825
+ };
826
+ type OriginBorrowIncentivePoolData = {
827
+ pool_type: {
828
+ name: string;
829
+ };
830
+ points: OriginBorrowIncentivePoolPointData[];
831
+ min_stakes: string;
832
+ max_stakes: string;
833
+ stakes: string;
834
+ created_at: string;
835
+ };
805
836
  type ParsedBorrowIncentivePoolPointData = {
806
837
  pointType: string;
807
838
  distributedPointPerPeriod: number;
@@ -814,6 +845,13 @@ type ParsedBorrowIncentivePoolPointData = {
814
845
  lastUpdate: number;
815
846
  createdAt: number;
816
847
  };
848
+ type ParsedBorrowIncentivePoolData = {
849
+ poolType: string;
850
+ poolPoints: OptionalKeys$4<Record<string, ParsedBorrowIncentivePoolPointData>>;
851
+ minStakes: number;
852
+ maxStakes: number;
853
+ staked: number;
854
+ };
817
855
  type CalculatedBorrowIncentivePoolPointData = {
818
856
  baseWeight: number;
819
857
  weightedStakedAmount: number;
@@ -826,6 +864,23 @@ type CalculatedBorrowIncentivePoolPointData = {
826
864
  rewardApr: number;
827
865
  rewardPerSec: number;
828
866
  };
867
+ type BorrowIncentiveAccounts = OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountData>>;
868
+ type OriginBorrowIncentiveAccountPoolData = {
869
+ point_type: {
870
+ name: string;
871
+ };
872
+ weighted_amount: string;
873
+ points: string;
874
+ total_points: string;
875
+ index: string;
876
+ };
877
+ type OriginBorrowIncentiveAccountData = {
878
+ points_list: OriginBorrowIncentiveAccountPoolData[];
879
+ pool_type: {
880
+ name: string;
881
+ };
882
+ debt_amount: string;
883
+ };
829
884
  type ParsedBorrowIncentiveAccountPoolData = {
830
885
  pointType: string;
831
886
  weightedAmount: number;
@@ -838,12 +893,136 @@ type ParsedBorrowIncentiveAccountData = {
838
893
  poolType: string;
839
894
  debtAmount: number;
840
895
  };
896
+ /**
897
+ * The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
898
+ */
899
+ interface BorrowIncentivePoolsQueryInterface {
900
+ incentive_pools: OriginBorrowIncentivePoolData[];
901
+ }
902
+ /**
903
+ * The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
904
+ */
905
+ interface BorrowIncentiveAccountsQueryInterface {
906
+ pool_records: OriginBorrowIncentiveAccountData[];
907
+ }
841
908
 
842
909
  type OptionalKeys$3<T> = {
843
910
  [K in keyof T]?: T[K];
844
911
  };
845
912
  type MarketPools = OptionalKeys$3<Record<string, MarketPool>>;
846
913
  type MarketCollaterals = OptionalKeys$3<Record<string, MarketCollateral>>;
914
+ type CoinAmounts = OptionalKeys$3<Record<string, number>>;
915
+ type MarketCoinAmounts = OptionalKeys$3<Record<string, number>>;
916
+ type SCoinAmounts = OptionalKeys$3<Record<string, number>>;
917
+ type BalanceSheet = {
918
+ cash: string;
919
+ debt: string;
920
+ market_coin_supply: string;
921
+ revenue: string;
922
+ };
923
+ type BorrowDynamic = {
924
+ borrow_index: string;
925
+ interest_rate: {
926
+ fields: {
927
+ value: string;
928
+ };
929
+ };
930
+ interest_rate_scale: string;
931
+ last_updated: string;
932
+ };
933
+ type BorrowFee = {
934
+ value: string;
935
+ };
936
+ type InterestModel = {
937
+ base_borrow_rate_per_sec: {
938
+ fields: {
939
+ value: string;
940
+ };
941
+ };
942
+ borrow_rate_on_high_kink: {
943
+ fields: {
944
+ value: string;
945
+ };
946
+ };
947
+ borrow_rate_on_mid_kink: {
948
+ fields: {
949
+ value: string;
950
+ };
951
+ };
952
+ borrow_weight: {
953
+ fields: {
954
+ value: string;
955
+ };
956
+ };
957
+ borrow_fee_rate: {
958
+ fields: {
959
+ value: string;
960
+ };
961
+ };
962
+ high_kink: {
963
+ fields: {
964
+ value: string;
965
+ };
966
+ };
967
+ interest_rate_scale: string;
968
+ max_borrow_rate: {
969
+ fields: {
970
+ value: string;
971
+ };
972
+ };
973
+ mid_kink: {
974
+ fields: {
975
+ value: string;
976
+ };
977
+ };
978
+ min_borrow_amount: string;
979
+ revenue_factor: {
980
+ fields: {
981
+ value: string;
982
+ };
983
+ };
984
+ type: {
985
+ fields: {
986
+ name: string;
987
+ };
988
+ };
989
+ };
990
+ type RiskModel = {
991
+ collateral_factor: {
992
+ fields: {
993
+ value: string;
994
+ };
995
+ };
996
+ liquidation_discount: {
997
+ fields: {
998
+ value: string;
999
+ };
1000
+ };
1001
+ liquidation_factor: {
1002
+ fields: {
1003
+ value: string;
1004
+ };
1005
+ };
1006
+ liquidation_penalty: {
1007
+ fields: {
1008
+ value: string;
1009
+ };
1010
+ };
1011
+ liquidation_revenue_factor: {
1012
+ fields: {
1013
+ value: string;
1014
+ };
1015
+ };
1016
+ max_collateral_amount: string;
1017
+ type: {
1018
+ fields: {
1019
+ name: string;
1020
+ };
1021
+ };
1022
+ };
1023
+ type CollateralStat = {
1024
+ amount: string;
1025
+ };
847
1026
  type MarketPool = {
848
1027
  coinName: string;
849
1028
  symbol: string;
@@ -867,6 +1046,52 @@ type MarketCollateral = {
867
1046
  coinPrice: number;
868
1047
  isIsolated: boolean;
869
1048
  } & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPenalty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
1049
+ type OriginMarketPoolData = {
1050
+ type: {
1051
+ name: string;
1052
+ };
1053
+ maxBorrowRate: {
1054
+ value: string;
1055
+ };
1056
+ interestRate: {
1057
+ value: string;
1058
+ };
1059
+ interestRateScale: string;
1060
+ borrowIndex: string;
1061
+ lastUpdated: string;
1062
+ cash: string;
1063
+ debt: string;
1064
+ marketCoinSupply: string;
1065
+ reserve: string;
1066
+ reserveFactor: {
1067
+ value: string;
1068
+ };
1069
+ borrowWeight: {
1070
+ value: string;
1071
+ };
1072
+ borrowFeeRate: {
1073
+ value: string;
1074
+ };
1075
+ baseBorrowRatePerSec: {
1076
+ value: string;
1077
+ };
1078
+ borrowRateOnHighKink: {
1079
+ value: string;
1080
+ };
1081
+ borrowRateOnMidKink: {
1082
+ value: string;
1083
+ };
1084
+ highKink: {
1085
+ value: string;
1086
+ };
1087
+ midKink: {
1088
+ value: string;
1089
+ };
1090
+ minBorrowAmount: string;
1091
+ isIsolated: boolean;
1092
+ supplyLimit: string;
1093
+ borrowLimit: string;
1094
+ };
870
1095
  type ParsedMarketPoolData = {
871
1096
  coinType: string;
872
1097
  maxBorrowRate: number;
@@ -919,6 +1144,29 @@ type CalculatedMarketPoolData = {
919
1144
  maxSupplyCoin: number;
920
1145
  maxBorrowCoin: number;
921
1146
  };
1147
+ type OriginMarketCollateralData = {
1148
+ type: {
1149
+ name: string;
1150
+ };
1151
+ isIsolated: boolean;
1152
+ collateralFactor: {
1153
+ value: string;
1154
+ };
1155
+ liquidationFactor: {
1156
+ value: string;
1157
+ };
1158
+ liquidationDiscount: {
1159
+ value: string;
1160
+ };
1161
+ liquidationPenalty: {
1162
+ value: string;
1163
+ };
1164
+ liquidationReserveFactor: {
1165
+ value: string;
1166
+ };
1167
+ maxCollateralAmount: string;
1168
+ totalCollateralAmount: string;
1169
+ };
922
1170
  type ParsedMarketCollateralData = {
923
1171
  coinType: string;
924
1172
  collateralFactor: number;
@@ -943,7 +1191,7 @@ type Market = {
943
1191
  collaterals: MarketCollaterals;
944
1192
  data?: MarketQueryInterface;
945
1193
  };
946
- type Obligation$1 = {
1194
+ type Obligation = {
947
1195
  id: string;
948
1196
  keyId: string;
949
1197
  locked: boolean;
@@ -1066,6 +1314,42 @@ type Spool = {
1066
1314
  marketCoinPrice: number;
1067
1315
  rewardCoinPrice: number;
1068
1316
  } & Required<Pick<ParsedSpoolData, 'maxPoint' | 'distributedPoint' | 'maxStake'>> & CalculatedSpoolData & SpoolRewardPool;
1317
+ type OriginSpoolData = {
1318
+ stakeType: {
1319
+ fields: {
1320
+ name: string;
1321
+ };
1322
+ };
1323
+ maxDistributedPoint: string;
1324
+ distributedPoint: string;
1325
+ distributedPointPerPeriod: string;
1326
+ pointDistributionTime: string;
1327
+ maxStake: string;
1328
+ stakes: string;
1329
+ index: string;
1330
+ createdAt: string;
1331
+ lastUpdate: string;
1332
+ };
1333
+ type SpoolData = {
1334
+ created_at: string;
1335
+ distributed_point: string;
1336
+ distributed_point_per_period: string;
1337
+ id: {
1338
+ id: string;
1339
+ };
1340
+ index: string;
1341
+ last_update: string;
1342
+ max_distributed_point: string;
1343
+ max_stakes: string;
1344
+ point_distribution_time: string;
1345
+ stake_type: {
1346
+ type: string;
1347
+ fields: {
1348
+ name: string;
1349
+ };
1350
+ };
1351
+ stakes: string;
1352
+ };
1069
1353
  type ParsedSpoolData = {
1070
1354
  stakeType: string;
1071
1355
  maxPoint: number;
@@ -1090,6 +1374,13 @@ type CalculatedSpoolData = {
1090
1374
  endDate: Date;
1091
1375
  };
1092
1376
  type SpoolRewardPool = Required<Pick<ParsedSpoolRewardPoolData, 'exchangeRateNumerator' | 'exchangeRateDenominator'>> & CalculatedSpoolRewardPoolData;
1377
+ type OriginSpoolRewardPoolData = {
1378
+ claimed_rewards: string;
1379
+ exchange_rate_denominator: string;
1380
+ exchange_rate_numerator: string;
1381
+ rewards: string;
1382
+ spool_id: string;
1383
+ };
1093
1384
  type ParsedSpoolRewardPoolData = {
1094
1385
  claimedRewards: number;
1095
1386
  exchangeRateDenominator: number;
@@ -1110,6 +1401,8 @@ type CalculatedSpoolRewardPoolData = {
1110
1401
  claimedRewardValue: number;
1111
1402
  rewardPerSec: number;
1112
1403
  };
1404
+ type StakePools = OptionalKeys$2<Record<string, StakePool>>;
1405
+ type StakeRewardPools = OptionalKeys$2<Record<string, StakeRewardPool>>;
1113
1406
  type StakeAccounts = Record<string, StakeAccount[]>;
1114
1407
  interface StakeAccount {
1115
1408
  id: string;
@@ -1148,6 +1441,8 @@ interface StakeRewardPool {
1148
1441
  type OptionalKeys$1<T> = {
1149
1442
  [K in keyof T]?: T[K];
1150
1443
  };
1444
+ type Lendings = OptionalKeys$1<Record<string, Lending>>;
1445
+ type ObligationAccounts = OptionalKeys$1<Record<string, ObligationAccount>>;
1151
1446
  type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
1152
1447
  supplyApr: number;
1153
1448
  supplyApy: number;
@@ -1270,6 +1565,15 @@ type Vesca = {
1270
1565
  currentVeScaBalance: number;
1271
1566
  unlockAt: number;
1272
1567
  };
1568
+ type VeScaTreasuryFields = {
1569
+ total_ve_sca_amount: string;
1570
+ sca_balance: string;
1571
+ unlock_schedule: {
1572
+ fields: {
1573
+ locked_sca_amount: string;
1574
+ };
1575
+ };
1576
+ };
1273
1577
  type VeScaTreasuryInfo = {
1274
1578
  totalLockedSca: number;
1275
1579
  totalVeSca: number;
@@ -1510,7 +1814,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
1510
1814
  * @param ownerAddress - The owner address.
1511
1815
  * @return Obligations data.
1512
1816
  */
1513
- getObligations(ownerAddress?: string): Promise<Obligation$1[]>;
1817
+ getObligations(ownerAddress?: string): Promise<Obligation[]>;
1514
1818
  /**
1515
1819
  * Query obligation data.
1516
1820
  *
@@ -1963,14 +2267,25 @@ declare class ScallopQuery implements ScallopQueryInterface {
1963
2267
  getSwitchboardOnDemandAggregatorObjectIds(coinName: string[]): Promise<string[]>;
1964
2268
  }
1965
2269
 
2270
+ type CoreIds = {
2271
+ protocolPkg: string;
2272
+ market: string;
2273
+ version: string;
2274
+ coinDecimalsRegistry: string;
2275
+ xOracle: string;
2276
+ };
1966
2277
  type NestedResult = Extract<Argument, {
1967
2278
  $kind: 'NestedResult';
1968
2279
  }>;
1969
- type Obligation = NestedResult;
1970
- type ObligationKey = NestedResult;
1971
- type ObligationHotPotato = NestedResult;
2280
+ type ResultAsObligation = NestedResult;
2281
+ type ResultAsObligationKey = NestedResult;
2282
+ type ResultAsObligationHotPotato = NestedResult;
1972
2283
  type CoreNormalMethods = {
1973
- openObligation: () => [Obligation, ObligationKey, ObligationHotPotato];
2284
+ openObligation: () => [
2285
+ ResultAsObligation,
2286
+ ResultAsObligationKey,
2287
+ ResultAsObligationHotPotato
2288
+ ];
1974
2289
  returnObligation: (obligation: SuiObjectArg, obligationHotPotato: SuiObjectArg) => void;
1975
2290
  openObligationEntry: () => void;
1976
2291
  addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: string) => void;
@@ -1998,7 +2313,18 @@ type CoreQuickMethods = {
1998
2313
  };
1999
2314
  type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
2000
2315
  type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
2316
+ type GenerateCoreNormalMethod = (params: {
2317
+ builder: ScallopBuilder;
2318
+ txBlock: SuiTxBlock;
2319
+ }) => CoreNormalMethods;
2320
+ type GenerateCoreQuickMethod = (params: {
2321
+ builder: ScallopBuilder;
2322
+ txBlock: SuiTxBlockWithCoreNormalMethods;
2323
+ }) => CoreQuickMethods;
2001
2324
 
2325
+ type SpoolIds = {
2326
+ spoolPkg: string;
2327
+ };
2002
2328
  type SpoolNormalMethods = {
2003
2329
  createStakeAccount: (stakeMarketCoinName: string) => TransactionResult;
2004
2330
  stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName: string) => void;
@@ -2012,7 +2338,23 @@ type SpoolQuickMethods = {
2012
2338
  };
2013
2339
  type SuiTxBlockWithSpoolNormalMethods = SuiTxBlock & SuiTxBlockWithSCoin & SpoolNormalMethods;
2014
2340
  type SpoolTxBlock = SuiTxBlockWithSpoolNormalMethods & SpoolQuickMethods;
2341
+ type GenerateSpoolNormalMethod = (params: {
2342
+ builder: ScallopBuilder;
2343
+ txBlock: SuiTxBlock;
2344
+ }) => SpoolNormalMethods;
2345
+ type GenerateSpoolQuickMethod = (params: {
2346
+ builder: ScallopBuilder;
2347
+ txBlock: SuiTxBlockWithSpoolNormalMethods;
2348
+ }) => SpoolQuickMethods;
2015
2349
 
2350
+ type BorrowIncentiveIds = {
2351
+ borrowIncentivePkg: string;
2352
+ query: string;
2353
+ config: string;
2354
+ incentivePools: string;
2355
+ incentiveAccounts: string;
2356
+ obligationAccessStore: string;
2357
+ };
2016
2358
  type BorrowIncentiveNormalMethods = {
2017
2359
  stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
2018
2360
  stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
@@ -2028,6 +2370,14 @@ type BorrowIncentiveQuickMethods = {
2028
2370
  };
2029
2371
  type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiTxBlock & BorrowIncentiveNormalMethods;
2030
2372
  type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
2373
+ type GenerateBorrowIncentiveNormalMethod = (params: {
2374
+ builder: ScallopBuilder;
2375
+ txBlock: SuiTxBlock;
2376
+ }) => BorrowIncentiveNormalMethods;
2377
+ type GenerateBorrowIncentiveQuickMethod = (params: {
2378
+ builder: ScallopBuilder;
2379
+ txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
2380
+ }) => BorrowIncentiveQuickMethods;
2031
2381
 
2032
2382
  type VeScaNormalMethods = {
2033
2383
  lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: number) => TransactionResult;
@@ -2095,6 +2445,14 @@ type VeScaQuickMethods = {
2095
2445
  };
2096
2446
  type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
2097
2447
  type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
2448
+ type GenerateVeScaNormalMethod = (params: {
2449
+ builder: ScallopBuilder;
2450
+ txBlock: SuiTxBlock;
2451
+ }) => VeScaNormalMethods;
2452
+ type GenerateVeScaQuickMethod = (params: {
2453
+ builder: ScallopBuilder;
2454
+ txBlock: SuiTxBlockWithVeScaNormalMethods;
2455
+ }) => VeScaQuickMethods;
2098
2456
 
2099
2457
  type LoyaltyProgramNormalMethods = {
2100
2458
  claimLoyaltyRevenue: (veScaKey: SuiObjectArg) => TransactionResult$1;
@@ -2106,7 +2464,18 @@ type LoyaltyProgramQuickMethods = {
2106
2464
  };
2107
2465
  type SuiTxBlockWithLoyaltyProgramNormalMethods = SuiTxBlock & LoyaltyProgramNormalMethods;
2108
2466
  type LoyaltyProgramTxBlock = SuiTxBlockWithLoyaltyProgramNormalMethods & LoyaltyProgramQuickMethods;
2467
+ type GenerateLoyaltyProgramNormalMethod = (params: {
2468
+ builder: ScallopBuilder;
2469
+ txBlock: SuiTxBlock;
2470
+ }) => LoyaltyProgramNormalMethods;
2471
+ type GenerateLoyaltyProgramQuickMethod = (params: {
2472
+ builder: ScallopBuilder;
2473
+ txBlock: SuiTxBlockWithLoyaltyProgramNormalMethods;
2474
+ }) => LoyaltyProgramQuickMethods;
2109
2475
 
2476
+ type sCoinPkgIds = {
2477
+ pkgId: string;
2478
+ };
2110
2479
  type sCoinNormalMethods = {
2111
2480
  /**
2112
2481
  * Lock marketCoin and return sCoin
@@ -2129,6 +2498,14 @@ type sCoinQuickMethods = {
2129
2498
  };
2130
2499
  type SuiTxBlockWithSCoinNormalMethods = SuiTxBlock & BaseScallopTxBlock & sCoinNormalMethods;
2131
2500
  type SCoinTxBlock = SuiTxBlockWithSCoinNormalMethods & sCoinQuickMethods;
2501
+ type GenerateSCoinNormalMethod = (params: {
2502
+ builder: ScallopBuilder;
2503
+ txBlock: SuiTxBlock;
2504
+ }) => sCoinNormalMethods;
2505
+ type GenerateSCoinQuickMethod = (params: {
2506
+ builder: ScallopBuilder;
2507
+ txBlock: SuiTxBlockWithSCoinNormalMethods;
2508
+ }) => sCoinQuickMethods;
2132
2509
 
2133
2510
  type ReferralNormalMethods = {
2134
2511
  bindToReferral: (veScaKeyId: string) => void;
@@ -2539,7 +2916,7 @@ declare class ScallopClient implements ScallopClientInterface {
2539
2916
  * @param ownerAddress - The owner address.
2540
2917
  * @return Obligations data.
2541
2918
  */
2542
- getObligations(ownerAddress?: string): Promise<Obligation$1[]>;
2919
+ getObligations(ownerAddress?: string): Promise<Obligation[]>;
2543
2920
  /**
2544
2921
  * Query obligation data.
2545
2922
  *
@@ -2866,4 +3243,4 @@ declare class Scallop {
2866
3243
  getScallopConstants(): Promise<ScallopConstants>;
2867
3244
  }
2868
3245
 
2869
- export { API_BASE_URL, DEFAULT_CACHE_OPTIONS, IS_VE_SCA_TEST, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, OLD_BORROW_INCENTIVE_PROTOCOL_ID, RPC_PROVIDERS, SCA_COIN_TYPE, SDK_API_BASE_URL, SUPPORT_ORACLES, SUPPORT_ORACLE_LST, SUPPORT_SUI_LST, Scallop, ScallopAddress, ScallopBuilder, ScallopClient, ScallopConstants, ScallopIndexer, ScallopQuery, ScallopSuiKit, ScallopUtils, TEST_ADDRESSES, TEST_POOL_ADDRESSES, TEST_WHITELIST, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, X_ORACLE_LIST, X_ORACLE_RULES, queryKeys };
3246
+ export { API_BASE_URL, type AddressStringPath, type AddressesInterface, type BalanceSheet, type BasePackage, type BaseScallopTxBlock, type BorrowDynamic, type BorrowFee, type BorrowIncentiveAccountKey, type BorrowIncentiveAccounts, type BorrowIncentiveAccountsQueryInterface, type BorrowIncentiveIds, type BorrowIncentiveNormalMethods, type BorrowIncentivePool, type BorrowIncentivePoolPoints, type BorrowIncentivePools, type BorrowIncentivePoolsQueryInterface, type BorrowIncentiveQuickMethods, type BorrowIncentiveTxBlock, type CalculatedBorrowIncentivePoolPointData, type CalculatedMarketCollateralData, type CalculatedMarketPoolData, type CalculatedSpoolData, type CalculatedSpoolRewardPoolData, type CoinAmounts, type CoinPrices, type CoinWrappedType, type CollateralStat, type CoreIds, type CoreNormalMethods, type CoreQuickMethods, type CoreTxBlock, DEFAULT_CACHE_OPTIONS, type GenerateBorrowIncentiveNormalMethod, type GenerateBorrowIncentiveQuickMethod, type GenerateCoreNormalMethod, type GenerateCoreQuickMethod, type GenerateLoyaltyProgramNormalMethod, type GenerateLoyaltyProgramQuickMethod, type GenerateSCoinNormalMethod, type GenerateSCoinQuickMethod, type GenerateSpoolNormalMethod, type GenerateSpoolQuickMethod, type GenerateVeScaNormalMethod, type GenerateVeScaQuickMethod, IS_VE_SCA_TEST, type InterestModel, type Lending, type Lendings, type LoyaltyProgramInfo, type LoyaltyProgramNormalMethods, type LoyaltyProgramQuickMethods, type LoyaltyProgramTxBlock, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, type Market, type MarketCoinAmounts, type MarketCollateral, type MarketCollaterals, type MarketPool, type MarketPools, type MarketQueryInterface, type NestedResult, OLD_BORROW_INCENTIVE_PROTOCOL_ID, type Obligation, type ObligationAccount, type ObligationAccounts, type ObligationBorrowIncentive, type ObligationBorrowIncentiveReward, type ObligationCollateral, type ObligationDebt, type ObligationQueryInterface, type OptionalKeys, type OracleLst, type OracleLstConfig, type OracleLstPackage, type OriginBorrowIncentiveAccountData, type OriginBorrowIncentiveAccountPoolData, type OriginBorrowIncentivePoolData, type OriginBorrowIncentivePoolPointData, type OriginMarketCollateralData, type OriginMarketPoolData, type OriginSpoolData, type OriginSpoolRewardPoolData, type PackageName, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddress, QueryKeys, type QuickMethodReturnType, RPC_PROVIDERS, type RiskModel, SCA_COIN_TYPE, type SCoinAmounts, type SCoinTxBlock, SDK_API_BASE_URL, SUPPORT_ORACLES, SUPPORT_ORACLE_LST, SUPPORT_SUI_LST, Scallop, ScallopAddress, ScallopBuilder, ScallopClient, ScallopConstants, ScallopIndexer, ScallopQuery, ScallopSuiKit, type ScallopTxBlock, ScallopUtils, type SelectCoinReturnType, type Spool, type SpoolData, type SpoolIds, type SpoolNormalMethods, type SpoolQuickMethods, type SpoolRewardPool, type SpoolTxBlock, type Spools, type StakeAccount, type StakeAccounts, type StakePool, type StakePools, type StakeRewardPool, type StakeRewardPools, type SuiTxBlockWithBorrowIncentiveNormalMethods, type SuiTxBlockWithCoreNormalMethods, type SuiTxBlockWithLoyaltyProgramNormalMethods, type SuiTxBlockWithSCoin, type SuiTxBlockWithSCoinNormalMethods, type SuiTxBlockWithSpool, type SuiTxBlockWithSpoolNormalMethods, type SuiTxBlockWithVeScaNormalMethods, type SupportOracleLst, type SupportOracleType, type SupportedOracleSuiLst, TEST_ADDRESSES, TEST_POOL_ADDRESSES, TEST_WHITELIST, type TotalValueLocked, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, type VeScaLoyaltyProgramInfo, type VeScaNormalMethods, type VeScaQuickMethods, type VeScaTreasuryFields, type VeScaTreasuryInfo, type VeScaTxBlock, type Vesca, type Whitelist, X_ORACLE_LIST, X_ORACLE_RULES, queryKeys, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, type xOracleListType, type xOracleRuleType, type xOracleRules };
package/dist/index.d.ts CHANGED
@@ -119,6 +119,9 @@ declare const X_ORACLE_LIST: Record<string, Record<(typeof X_ORACLE_RULES)[numbe
119
119
  type SupportOracleType = (typeof SUPPORT_ORACLES)[number];
120
120
  type xOracleRuleType = (typeof X_ORACLE_RULES)[number];
121
121
  type xOracleRules = Record<xOracleRuleType, SupportOracleType[]>;
122
+ type xOracleListType = {
123
+ [key in string]: xOracleRules;
124
+ };
122
125
  type SupportedOracleSuiLst = (typeof SUPPORT_SUI_LST)[number];
123
126
 
124
127
  declare const _PACKAGE_NAMES: readonly ["coinDecimalsRegistry", "math", "whitelist", "x", "protocol", "protocolWhitelist", "query", "supra", "pyth", "switchboard", "xOracle", "testCoin"];
@@ -780,6 +783,10 @@ declare class ScallopConstants extends ScallopAddress {
780
783
  readPoolAddresses(): Promise<Record<string, PoolAddress>>;
781
784
  }
782
785
 
786
+ interface BorrowIncentiveAccountKey {
787
+ id: string;
788
+ onwerId: string;
789
+ }
783
790
  type OptionalKeys$4<T> = {
784
791
  [K in keyof T]?: T[K];
785
792
  };
@@ -802,6 +809,30 @@ type BorrowIncentivePool = {
802
809
  stakedValue: number;
803
810
  points: OptionalKeys$4<Record<string, BorrowIncentivePoolPoints>>;
804
811
  };
812
+ type OriginBorrowIncentivePoolPointData = {
813
+ point_type: {
814
+ name: string;
815
+ };
816
+ distributed_point_per_period: string;
817
+ point_distribution_time: string;
818
+ distributed_point: string;
819
+ points: string;
820
+ index: string;
821
+ base_weight: string;
822
+ weighted_amount: string;
823
+ last_update: string;
824
+ created_at: string;
825
+ };
826
+ type OriginBorrowIncentivePoolData = {
827
+ pool_type: {
828
+ name: string;
829
+ };
830
+ points: OriginBorrowIncentivePoolPointData[];
831
+ min_stakes: string;
832
+ max_stakes: string;
833
+ stakes: string;
834
+ created_at: string;
835
+ };
805
836
  type ParsedBorrowIncentivePoolPointData = {
806
837
  pointType: string;
807
838
  distributedPointPerPeriod: number;
@@ -814,6 +845,13 @@ type ParsedBorrowIncentivePoolPointData = {
814
845
  lastUpdate: number;
815
846
  createdAt: number;
816
847
  };
848
+ type ParsedBorrowIncentivePoolData = {
849
+ poolType: string;
850
+ poolPoints: OptionalKeys$4<Record<string, ParsedBorrowIncentivePoolPointData>>;
851
+ minStakes: number;
852
+ maxStakes: number;
853
+ staked: number;
854
+ };
817
855
  type CalculatedBorrowIncentivePoolPointData = {
818
856
  baseWeight: number;
819
857
  weightedStakedAmount: number;
@@ -826,6 +864,23 @@ type CalculatedBorrowIncentivePoolPointData = {
826
864
  rewardApr: number;
827
865
  rewardPerSec: number;
828
866
  };
867
+ type BorrowIncentiveAccounts = OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountData>>;
868
+ type OriginBorrowIncentiveAccountPoolData = {
869
+ point_type: {
870
+ name: string;
871
+ };
872
+ weighted_amount: string;
873
+ points: string;
874
+ total_points: string;
875
+ index: string;
876
+ };
877
+ type OriginBorrowIncentiveAccountData = {
878
+ points_list: OriginBorrowIncentiveAccountPoolData[];
879
+ pool_type: {
880
+ name: string;
881
+ };
882
+ debt_amount: string;
883
+ };
829
884
  type ParsedBorrowIncentiveAccountPoolData = {
830
885
  pointType: string;
831
886
  weightedAmount: number;
@@ -838,12 +893,136 @@ type ParsedBorrowIncentiveAccountData = {
838
893
  poolType: string;
839
894
  debtAmount: number;
840
895
  };
896
+ /**
897
+ * The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
898
+ */
899
+ interface BorrowIncentivePoolsQueryInterface {
900
+ incentive_pools: OriginBorrowIncentivePoolData[];
901
+ }
902
+ /**
903
+ * The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
904
+ */
905
+ interface BorrowIncentiveAccountsQueryInterface {
906
+ pool_records: OriginBorrowIncentiveAccountData[];
907
+ }
841
908
 
842
909
  type OptionalKeys$3<T> = {
843
910
  [K in keyof T]?: T[K];
844
911
  };
845
912
  type MarketPools = OptionalKeys$3<Record<string, MarketPool>>;
846
913
  type MarketCollaterals = OptionalKeys$3<Record<string, MarketCollateral>>;
914
+ type CoinAmounts = OptionalKeys$3<Record<string, number>>;
915
+ type MarketCoinAmounts = OptionalKeys$3<Record<string, number>>;
916
+ type SCoinAmounts = OptionalKeys$3<Record<string, number>>;
917
+ type BalanceSheet = {
918
+ cash: string;
919
+ debt: string;
920
+ market_coin_supply: string;
921
+ revenue: string;
922
+ };
923
+ type BorrowDynamic = {
924
+ borrow_index: string;
925
+ interest_rate: {
926
+ fields: {
927
+ value: string;
928
+ };
929
+ };
930
+ interest_rate_scale: string;
931
+ last_updated: string;
932
+ };
933
+ type BorrowFee = {
934
+ value: string;
935
+ };
936
+ type InterestModel = {
937
+ base_borrow_rate_per_sec: {
938
+ fields: {
939
+ value: string;
940
+ };
941
+ };
942
+ borrow_rate_on_high_kink: {
943
+ fields: {
944
+ value: string;
945
+ };
946
+ };
947
+ borrow_rate_on_mid_kink: {
948
+ fields: {
949
+ value: string;
950
+ };
951
+ };
952
+ borrow_weight: {
953
+ fields: {
954
+ value: string;
955
+ };
956
+ };
957
+ borrow_fee_rate: {
958
+ fields: {
959
+ value: string;
960
+ };
961
+ };
962
+ high_kink: {
963
+ fields: {
964
+ value: string;
965
+ };
966
+ };
967
+ interest_rate_scale: string;
968
+ max_borrow_rate: {
969
+ fields: {
970
+ value: string;
971
+ };
972
+ };
973
+ mid_kink: {
974
+ fields: {
975
+ value: string;
976
+ };
977
+ };
978
+ min_borrow_amount: string;
979
+ revenue_factor: {
980
+ fields: {
981
+ value: string;
982
+ };
983
+ };
984
+ type: {
985
+ fields: {
986
+ name: string;
987
+ };
988
+ };
989
+ };
990
+ type RiskModel = {
991
+ collateral_factor: {
992
+ fields: {
993
+ value: string;
994
+ };
995
+ };
996
+ liquidation_discount: {
997
+ fields: {
998
+ value: string;
999
+ };
1000
+ };
1001
+ liquidation_factor: {
1002
+ fields: {
1003
+ value: string;
1004
+ };
1005
+ };
1006
+ liquidation_penalty: {
1007
+ fields: {
1008
+ value: string;
1009
+ };
1010
+ };
1011
+ liquidation_revenue_factor: {
1012
+ fields: {
1013
+ value: string;
1014
+ };
1015
+ };
1016
+ max_collateral_amount: string;
1017
+ type: {
1018
+ fields: {
1019
+ name: string;
1020
+ };
1021
+ };
1022
+ };
1023
+ type CollateralStat = {
1024
+ amount: string;
1025
+ };
847
1026
  type MarketPool = {
848
1027
  coinName: string;
849
1028
  symbol: string;
@@ -867,6 +1046,52 @@ type MarketCollateral = {
867
1046
  coinPrice: number;
868
1047
  isIsolated: boolean;
869
1048
  } & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPenalty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
1049
+ type OriginMarketPoolData = {
1050
+ type: {
1051
+ name: string;
1052
+ };
1053
+ maxBorrowRate: {
1054
+ value: string;
1055
+ };
1056
+ interestRate: {
1057
+ value: string;
1058
+ };
1059
+ interestRateScale: string;
1060
+ borrowIndex: string;
1061
+ lastUpdated: string;
1062
+ cash: string;
1063
+ debt: string;
1064
+ marketCoinSupply: string;
1065
+ reserve: string;
1066
+ reserveFactor: {
1067
+ value: string;
1068
+ };
1069
+ borrowWeight: {
1070
+ value: string;
1071
+ };
1072
+ borrowFeeRate: {
1073
+ value: string;
1074
+ };
1075
+ baseBorrowRatePerSec: {
1076
+ value: string;
1077
+ };
1078
+ borrowRateOnHighKink: {
1079
+ value: string;
1080
+ };
1081
+ borrowRateOnMidKink: {
1082
+ value: string;
1083
+ };
1084
+ highKink: {
1085
+ value: string;
1086
+ };
1087
+ midKink: {
1088
+ value: string;
1089
+ };
1090
+ minBorrowAmount: string;
1091
+ isIsolated: boolean;
1092
+ supplyLimit: string;
1093
+ borrowLimit: string;
1094
+ };
870
1095
  type ParsedMarketPoolData = {
871
1096
  coinType: string;
872
1097
  maxBorrowRate: number;
@@ -919,6 +1144,29 @@ type CalculatedMarketPoolData = {
919
1144
  maxSupplyCoin: number;
920
1145
  maxBorrowCoin: number;
921
1146
  };
1147
+ type OriginMarketCollateralData = {
1148
+ type: {
1149
+ name: string;
1150
+ };
1151
+ isIsolated: boolean;
1152
+ collateralFactor: {
1153
+ value: string;
1154
+ };
1155
+ liquidationFactor: {
1156
+ value: string;
1157
+ };
1158
+ liquidationDiscount: {
1159
+ value: string;
1160
+ };
1161
+ liquidationPenalty: {
1162
+ value: string;
1163
+ };
1164
+ liquidationReserveFactor: {
1165
+ value: string;
1166
+ };
1167
+ maxCollateralAmount: string;
1168
+ totalCollateralAmount: string;
1169
+ };
922
1170
  type ParsedMarketCollateralData = {
923
1171
  coinType: string;
924
1172
  collateralFactor: number;
@@ -943,7 +1191,7 @@ type Market = {
943
1191
  collaterals: MarketCollaterals;
944
1192
  data?: MarketQueryInterface;
945
1193
  };
946
- type Obligation$1 = {
1194
+ type Obligation = {
947
1195
  id: string;
948
1196
  keyId: string;
949
1197
  locked: boolean;
@@ -1066,6 +1314,42 @@ type Spool = {
1066
1314
  marketCoinPrice: number;
1067
1315
  rewardCoinPrice: number;
1068
1316
  } & Required<Pick<ParsedSpoolData, 'maxPoint' | 'distributedPoint' | 'maxStake'>> & CalculatedSpoolData & SpoolRewardPool;
1317
+ type OriginSpoolData = {
1318
+ stakeType: {
1319
+ fields: {
1320
+ name: string;
1321
+ };
1322
+ };
1323
+ maxDistributedPoint: string;
1324
+ distributedPoint: string;
1325
+ distributedPointPerPeriod: string;
1326
+ pointDistributionTime: string;
1327
+ maxStake: string;
1328
+ stakes: string;
1329
+ index: string;
1330
+ createdAt: string;
1331
+ lastUpdate: string;
1332
+ };
1333
+ type SpoolData = {
1334
+ created_at: string;
1335
+ distributed_point: string;
1336
+ distributed_point_per_period: string;
1337
+ id: {
1338
+ id: string;
1339
+ };
1340
+ index: string;
1341
+ last_update: string;
1342
+ max_distributed_point: string;
1343
+ max_stakes: string;
1344
+ point_distribution_time: string;
1345
+ stake_type: {
1346
+ type: string;
1347
+ fields: {
1348
+ name: string;
1349
+ };
1350
+ };
1351
+ stakes: string;
1352
+ };
1069
1353
  type ParsedSpoolData = {
1070
1354
  stakeType: string;
1071
1355
  maxPoint: number;
@@ -1090,6 +1374,13 @@ type CalculatedSpoolData = {
1090
1374
  endDate: Date;
1091
1375
  };
1092
1376
  type SpoolRewardPool = Required<Pick<ParsedSpoolRewardPoolData, 'exchangeRateNumerator' | 'exchangeRateDenominator'>> & CalculatedSpoolRewardPoolData;
1377
+ type OriginSpoolRewardPoolData = {
1378
+ claimed_rewards: string;
1379
+ exchange_rate_denominator: string;
1380
+ exchange_rate_numerator: string;
1381
+ rewards: string;
1382
+ spool_id: string;
1383
+ };
1093
1384
  type ParsedSpoolRewardPoolData = {
1094
1385
  claimedRewards: number;
1095
1386
  exchangeRateDenominator: number;
@@ -1110,6 +1401,8 @@ type CalculatedSpoolRewardPoolData = {
1110
1401
  claimedRewardValue: number;
1111
1402
  rewardPerSec: number;
1112
1403
  };
1404
+ type StakePools = OptionalKeys$2<Record<string, StakePool>>;
1405
+ type StakeRewardPools = OptionalKeys$2<Record<string, StakeRewardPool>>;
1113
1406
  type StakeAccounts = Record<string, StakeAccount[]>;
1114
1407
  interface StakeAccount {
1115
1408
  id: string;
@@ -1148,6 +1441,8 @@ interface StakeRewardPool {
1148
1441
  type OptionalKeys$1<T> = {
1149
1442
  [K in keyof T]?: T[K];
1150
1443
  };
1444
+ type Lendings = OptionalKeys$1<Record<string, Lending>>;
1445
+ type ObligationAccounts = OptionalKeys$1<Record<string, ObligationAccount>>;
1151
1446
  type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
1152
1447
  supplyApr: number;
1153
1448
  supplyApy: number;
@@ -1270,6 +1565,15 @@ type Vesca = {
1270
1565
  currentVeScaBalance: number;
1271
1566
  unlockAt: number;
1272
1567
  };
1568
+ type VeScaTreasuryFields = {
1569
+ total_ve_sca_amount: string;
1570
+ sca_balance: string;
1571
+ unlock_schedule: {
1572
+ fields: {
1573
+ locked_sca_amount: string;
1574
+ };
1575
+ };
1576
+ };
1273
1577
  type VeScaTreasuryInfo = {
1274
1578
  totalLockedSca: number;
1275
1579
  totalVeSca: number;
@@ -1510,7 +1814,7 @@ declare class ScallopQuery implements ScallopQueryInterface {
1510
1814
  * @param ownerAddress - The owner address.
1511
1815
  * @return Obligations data.
1512
1816
  */
1513
- getObligations(ownerAddress?: string): Promise<Obligation$1[]>;
1817
+ getObligations(ownerAddress?: string): Promise<Obligation[]>;
1514
1818
  /**
1515
1819
  * Query obligation data.
1516
1820
  *
@@ -1963,14 +2267,25 @@ declare class ScallopQuery implements ScallopQueryInterface {
1963
2267
  getSwitchboardOnDemandAggregatorObjectIds(coinName: string[]): Promise<string[]>;
1964
2268
  }
1965
2269
 
2270
+ type CoreIds = {
2271
+ protocolPkg: string;
2272
+ market: string;
2273
+ version: string;
2274
+ coinDecimalsRegistry: string;
2275
+ xOracle: string;
2276
+ };
1966
2277
  type NestedResult = Extract<Argument, {
1967
2278
  $kind: 'NestedResult';
1968
2279
  }>;
1969
- type Obligation = NestedResult;
1970
- type ObligationKey = NestedResult;
1971
- type ObligationHotPotato = NestedResult;
2280
+ type ResultAsObligation = NestedResult;
2281
+ type ResultAsObligationKey = NestedResult;
2282
+ type ResultAsObligationHotPotato = NestedResult;
1972
2283
  type CoreNormalMethods = {
1973
- openObligation: () => [Obligation, ObligationKey, ObligationHotPotato];
2284
+ openObligation: () => [
2285
+ ResultAsObligation,
2286
+ ResultAsObligationKey,
2287
+ ResultAsObligationHotPotato
2288
+ ];
1974
2289
  returnObligation: (obligation: SuiObjectArg, obligationHotPotato: SuiObjectArg) => void;
1975
2290
  openObligationEntry: () => void;
1976
2291
  addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: string) => void;
@@ -1998,7 +2313,18 @@ type CoreQuickMethods = {
1998
2313
  };
1999
2314
  type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
2000
2315
  type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
2316
+ type GenerateCoreNormalMethod = (params: {
2317
+ builder: ScallopBuilder;
2318
+ txBlock: SuiTxBlock;
2319
+ }) => CoreNormalMethods;
2320
+ type GenerateCoreQuickMethod = (params: {
2321
+ builder: ScallopBuilder;
2322
+ txBlock: SuiTxBlockWithCoreNormalMethods;
2323
+ }) => CoreQuickMethods;
2001
2324
 
2325
+ type SpoolIds = {
2326
+ spoolPkg: string;
2327
+ };
2002
2328
  type SpoolNormalMethods = {
2003
2329
  createStakeAccount: (stakeMarketCoinName: string) => TransactionResult;
2004
2330
  stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName: string) => void;
@@ -2012,7 +2338,23 @@ type SpoolQuickMethods = {
2012
2338
  };
2013
2339
  type SuiTxBlockWithSpoolNormalMethods = SuiTxBlock & SuiTxBlockWithSCoin & SpoolNormalMethods;
2014
2340
  type SpoolTxBlock = SuiTxBlockWithSpoolNormalMethods & SpoolQuickMethods;
2341
+ type GenerateSpoolNormalMethod = (params: {
2342
+ builder: ScallopBuilder;
2343
+ txBlock: SuiTxBlock;
2344
+ }) => SpoolNormalMethods;
2345
+ type GenerateSpoolQuickMethod = (params: {
2346
+ builder: ScallopBuilder;
2347
+ txBlock: SuiTxBlockWithSpoolNormalMethods;
2348
+ }) => SpoolQuickMethods;
2015
2349
 
2350
+ type BorrowIncentiveIds = {
2351
+ borrowIncentivePkg: string;
2352
+ query: string;
2353
+ config: string;
2354
+ incentivePools: string;
2355
+ incentiveAccounts: string;
2356
+ obligationAccessStore: string;
2357
+ };
2016
2358
  type BorrowIncentiveNormalMethods = {
2017
2359
  stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
2018
2360
  stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
@@ -2028,6 +2370,14 @@ type BorrowIncentiveQuickMethods = {
2028
2370
  };
2029
2371
  type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiTxBlock & BorrowIncentiveNormalMethods;
2030
2372
  type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
2373
+ type GenerateBorrowIncentiveNormalMethod = (params: {
2374
+ builder: ScallopBuilder;
2375
+ txBlock: SuiTxBlock;
2376
+ }) => BorrowIncentiveNormalMethods;
2377
+ type GenerateBorrowIncentiveQuickMethod = (params: {
2378
+ builder: ScallopBuilder;
2379
+ txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
2380
+ }) => BorrowIncentiveQuickMethods;
2031
2381
 
2032
2382
  type VeScaNormalMethods = {
2033
2383
  lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: number) => TransactionResult;
@@ -2095,6 +2445,14 @@ type VeScaQuickMethods = {
2095
2445
  };
2096
2446
  type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
2097
2447
  type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
2448
+ type GenerateVeScaNormalMethod = (params: {
2449
+ builder: ScallopBuilder;
2450
+ txBlock: SuiTxBlock;
2451
+ }) => VeScaNormalMethods;
2452
+ type GenerateVeScaQuickMethod = (params: {
2453
+ builder: ScallopBuilder;
2454
+ txBlock: SuiTxBlockWithVeScaNormalMethods;
2455
+ }) => VeScaQuickMethods;
2098
2456
 
2099
2457
  type LoyaltyProgramNormalMethods = {
2100
2458
  claimLoyaltyRevenue: (veScaKey: SuiObjectArg) => TransactionResult$1;
@@ -2106,7 +2464,18 @@ type LoyaltyProgramQuickMethods = {
2106
2464
  };
2107
2465
  type SuiTxBlockWithLoyaltyProgramNormalMethods = SuiTxBlock & LoyaltyProgramNormalMethods;
2108
2466
  type LoyaltyProgramTxBlock = SuiTxBlockWithLoyaltyProgramNormalMethods & LoyaltyProgramQuickMethods;
2467
+ type GenerateLoyaltyProgramNormalMethod = (params: {
2468
+ builder: ScallopBuilder;
2469
+ txBlock: SuiTxBlock;
2470
+ }) => LoyaltyProgramNormalMethods;
2471
+ type GenerateLoyaltyProgramQuickMethod = (params: {
2472
+ builder: ScallopBuilder;
2473
+ txBlock: SuiTxBlockWithLoyaltyProgramNormalMethods;
2474
+ }) => LoyaltyProgramQuickMethods;
2109
2475
 
2476
+ type sCoinPkgIds = {
2477
+ pkgId: string;
2478
+ };
2110
2479
  type sCoinNormalMethods = {
2111
2480
  /**
2112
2481
  * Lock marketCoin and return sCoin
@@ -2129,6 +2498,14 @@ type sCoinQuickMethods = {
2129
2498
  };
2130
2499
  type SuiTxBlockWithSCoinNormalMethods = SuiTxBlock & BaseScallopTxBlock & sCoinNormalMethods;
2131
2500
  type SCoinTxBlock = SuiTxBlockWithSCoinNormalMethods & sCoinQuickMethods;
2501
+ type GenerateSCoinNormalMethod = (params: {
2502
+ builder: ScallopBuilder;
2503
+ txBlock: SuiTxBlock;
2504
+ }) => sCoinNormalMethods;
2505
+ type GenerateSCoinQuickMethod = (params: {
2506
+ builder: ScallopBuilder;
2507
+ txBlock: SuiTxBlockWithSCoinNormalMethods;
2508
+ }) => sCoinQuickMethods;
2132
2509
 
2133
2510
  type ReferralNormalMethods = {
2134
2511
  bindToReferral: (veScaKeyId: string) => void;
@@ -2539,7 +2916,7 @@ declare class ScallopClient implements ScallopClientInterface {
2539
2916
  * @param ownerAddress - The owner address.
2540
2917
  * @return Obligations data.
2541
2918
  */
2542
- getObligations(ownerAddress?: string): Promise<Obligation$1[]>;
2919
+ getObligations(ownerAddress?: string): Promise<Obligation[]>;
2543
2920
  /**
2544
2921
  * Query obligation data.
2545
2922
  *
@@ -2866,4 +3243,4 @@ declare class Scallop {
2866
3243
  getScallopConstants(): Promise<ScallopConstants>;
2867
3244
  }
2868
3245
 
2869
- export { API_BASE_URL, DEFAULT_CACHE_OPTIONS, IS_VE_SCA_TEST, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, OLD_BORROW_INCENTIVE_PROTOCOL_ID, RPC_PROVIDERS, SCA_COIN_TYPE, SDK_API_BASE_URL, SUPPORT_ORACLES, SUPPORT_ORACLE_LST, SUPPORT_SUI_LST, Scallop, ScallopAddress, ScallopBuilder, ScallopClient, ScallopConstants, ScallopIndexer, ScallopQuery, ScallopSuiKit, ScallopUtils, TEST_ADDRESSES, TEST_POOL_ADDRESSES, TEST_WHITELIST, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, X_ORACLE_LIST, X_ORACLE_RULES, queryKeys };
3246
+ export { API_BASE_URL, type AddressStringPath, type AddressesInterface, type BalanceSheet, type BasePackage, type BaseScallopTxBlock, type BorrowDynamic, type BorrowFee, type BorrowIncentiveAccountKey, type BorrowIncentiveAccounts, type BorrowIncentiveAccountsQueryInterface, type BorrowIncentiveIds, type BorrowIncentiveNormalMethods, type BorrowIncentivePool, type BorrowIncentivePoolPoints, type BorrowIncentivePools, type BorrowIncentivePoolsQueryInterface, type BorrowIncentiveQuickMethods, type BorrowIncentiveTxBlock, type CalculatedBorrowIncentivePoolPointData, type CalculatedMarketCollateralData, type CalculatedMarketPoolData, type CalculatedSpoolData, type CalculatedSpoolRewardPoolData, type CoinAmounts, type CoinPrices, type CoinWrappedType, type CollateralStat, type CoreIds, type CoreNormalMethods, type CoreQuickMethods, type CoreTxBlock, DEFAULT_CACHE_OPTIONS, type GenerateBorrowIncentiveNormalMethod, type GenerateBorrowIncentiveQuickMethod, type GenerateCoreNormalMethod, type GenerateCoreQuickMethod, type GenerateLoyaltyProgramNormalMethod, type GenerateLoyaltyProgramQuickMethod, type GenerateSCoinNormalMethod, type GenerateSCoinQuickMethod, type GenerateSpoolNormalMethod, type GenerateSpoolQuickMethod, type GenerateVeScaNormalMethod, type GenerateVeScaQuickMethod, IS_VE_SCA_TEST, type InterestModel, type Lending, type Lendings, type LoyaltyProgramInfo, type LoyaltyProgramNormalMethods, type LoyaltyProgramQuickMethods, type LoyaltyProgramTxBlock, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, type Market, type MarketCoinAmounts, type MarketCollateral, type MarketCollaterals, type MarketPool, type MarketPools, type MarketQueryInterface, type NestedResult, OLD_BORROW_INCENTIVE_PROTOCOL_ID, type Obligation, type ObligationAccount, type ObligationAccounts, type ObligationBorrowIncentive, type ObligationBorrowIncentiveReward, type ObligationCollateral, type ObligationDebt, type ObligationQueryInterface, type OptionalKeys, type OracleLst, type OracleLstConfig, type OracleLstPackage, type OriginBorrowIncentiveAccountData, type OriginBorrowIncentiveAccountPoolData, type OriginBorrowIncentivePoolData, type OriginBorrowIncentivePoolPointData, type OriginMarketCollateralData, type OriginMarketPoolData, type OriginSpoolData, type OriginSpoolRewardPoolData, type PackageName, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddress, QueryKeys, type QuickMethodReturnType, RPC_PROVIDERS, type RiskModel, SCA_COIN_TYPE, type SCoinAmounts, type SCoinTxBlock, SDK_API_BASE_URL, SUPPORT_ORACLES, SUPPORT_ORACLE_LST, SUPPORT_SUI_LST, Scallop, ScallopAddress, ScallopBuilder, ScallopClient, ScallopConstants, ScallopIndexer, ScallopQuery, ScallopSuiKit, type ScallopTxBlock, ScallopUtils, type SelectCoinReturnType, type Spool, type SpoolData, type SpoolIds, type SpoolNormalMethods, type SpoolQuickMethods, type SpoolRewardPool, type SpoolTxBlock, type Spools, type StakeAccount, type StakeAccounts, type StakePool, type StakePools, type StakeRewardPool, type StakeRewardPools, type SuiTxBlockWithBorrowIncentiveNormalMethods, type SuiTxBlockWithCoreNormalMethods, type SuiTxBlockWithLoyaltyProgramNormalMethods, type SuiTxBlockWithSCoin, type SuiTxBlockWithSCoinNormalMethods, type SuiTxBlockWithSpool, type SuiTxBlockWithSpoolNormalMethods, type SuiTxBlockWithVeScaNormalMethods, type SupportOracleLst, type SupportOracleType, type SupportedOracleSuiLst, TEST_ADDRESSES, TEST_POOL_ADDRESSES, TEST_WHITELIST, type TotalValueLocked, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, type VeScaLoyaltyProgramInfo, type VeScaNormalMethods, type VeScaQuickMethods, type VeScaTreasuryFields, type VeScaTreasuryInfo, type VeScaTxBlock, type Vesca, type Whitelist, X_ORACLE_LIST, X_ORACLE_RULES, queryKeys, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, type xOracleListType, type xOracleRuleType, type xOracleRules };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "2.3.0-lst-x-oracle-alpha.6",
3
+ "version": "2.3.0-lst-x-oracle-alpha.7",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
package/src/index.ts CHANGED
@@ -10,3 +10,4 @@ export {
10
10
  ScallopIndexer,
11
11
  ScallopUtils,
12
12
  } from './models';
13
+ export * from './types';
@@ -16,12 +16,16 @@ export type CoreIds = {
16
16
  };
17
17
 
18
18
  export type NestedResult = Extract<Argument, { $kind: 'NestedResult' }>;
19
- type Obligation = NestedResult;
20
- type ObligationKey = NestedResult;
21
- type ObligationHotPotato = NestedResult;
19
+ type ResultAsObligation = NestedResult;
20
+ type ResultAsObligationKey = NestedResult;
21
+ type ResultAsObligationHotPotato = NestedResult;
22
22
 
23
23
  export type CoreNormalMethods = {
24
- openObligation: () => [Obligation, ObligationKey, ObligationHotPotato];
24
+ openObligation: () => [
25
+ ResultAsObligation,
26
+ ResultAsObligationKey,
27
+ ResultAsObligationHotPotato,
28
+ ];
25
29
  returnObligation: (
26
30
  obligation: SuiObjectArg,
27
31
  obligationHotPotato: SuiObjectArg
@@ -0,0 +1,5 @@
1
+ export type * from './builder';
2
+ export type * from './constant';
3
+ export type * from './query';
4
+ export type * from './address';
5
+ export type * from './util';