@scallop-io/sui-scallop-sdk 0.44.17 → 0.44.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builders/borrowIncentiveBuilder.d.ts +7 -0
- package/dist/builders/vescaBuilder.d.ts +24 -0
- package/dist/constants/common.d.ts +7 -4
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/vesca.d.ts +5 -0
- package/dist/index.js +878 -255
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +867 -248
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopClient.d.ts +7 -7
- package/dist/models/scallopUtils.d.ts +16 -14
- package/dist/queries/index.d.ts +1 -0
- package/dist/queries/vescaQuery.d.ts +28 -0
- package/dist/types/address.d.ts +9 -0
- package/dist/types/builder/borrowIncentive.d.ts +9 -6
- package/dist/types/builder/index.d.ts +3 -1
- package/dist/types/builder/vesca.d.ts +33 -0
- package/dist/types/constant/enum.d.ts +1 -1
- package/dist/types/query/borrowIncentive.d.ts +65 -60
- package/dist/types/query/index.d.ts +1 -0
- package/dist/types/query/portfolio.d.ts +12 -6
- package/dist/types/query/vesca.d.ts +7 -0
- package/dist/types/utils.d.ts +1 -2
- package/dist/utils/builder.d.ts +6 -0
- package/dist/utils/query.d.ts +4 -10
- package/dist/utils/util.d.ts +7 -0
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +174 -25
- package/src/builders/index.ts +6 -2
- package/src/builders/vescaBuilder.ts +392 -0
- package/src/constants/common.ts +19 -6
- package/src/constants/enum.ts +9 -3
- package/src/constants/index.ts +1 -0
- package/src/constants/vesca.ts +7 -0
- package/src/models/scallopAddress.ts +9 -1
- package/src/models/scallopClient.ts +29 -20
- package/src/models/scallopUtils.ts +45 -0
- package/src/queries/borrowIncentiveQuery.ts +93 -83
- package/src/queries/coreQuery.ts +19 -20
- package/src/queries/index.ts +1 -0
- package/src/queries/portfolioQuery.ts +79 -41
- package/src/queries/spoolQuery.ts +1 -1
- package/src/queries/vescaQuery.ts +124 -0
- package/src/types/address.ts +9 -0
- package/src/types/builder/borrowIncentive.ts +22 -5
- package/src/types/builder/index.ts +4 -1
- package/src/types/builder/vesca.ts +73 -0
- package/src/types/constant/enum.ts +1 -1
- package/src/types/query/borrowIncentive.ts +195 -74
- package/src/types/query/index.ts +1 -0
- package/src/types/query/portfolio.ts +17 -6
- package/src/types/query/vesca.ts +7 -0
- package/src/types/utils.ts +1 -1
- package/src/utils/builder.ts +141 -0
- package/src/utils/query.ts +227 -131
- package/src/utils/util.ts +28 -0
|
@@ -2,6 +2,13 @@ import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
|
2
2
|
import { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
|
|
3
3
|
import type { ScallopBuilder } from '../models';
|
|
4
4
|
import type { BorrowIncentiveTxBlock, ScallopTxBlock } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Check veSca bind status
|
|
7
|
+
* @param query
|
|
8
|
+
* @param veScaKey
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare const getBindedObligationId: (builder: ScallopBuilder, veScaKey: string) => Promise<string | false>;
|
|
5
12
|
/**
|
|
6
13
|
* Create an enhanced transaction block instance for interaction with borrow incentive modules of the Scallop contract.
|
|
7
14
|
*
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SuiAddressArg, SuiTxBlock, TransactionBlock, SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
|
|
2
|
+
import { ScallopBuilder } from '../models';
|
|
3
|
+
import type { ScallopTxBlock, VeScaTxBlock } from 'src/types';
|
|
4
|
+
/**
|
|
5
|
+
* Check and get veSCA data from transaction block.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* If the veScaKey id is provided, directly return it.
|
|
9
|
+
* Otherwise, automatically get veScaKey from the sender.
|
|
10
|
+
*
|
|
11
|
+
* @param builder - Scallop builder instance.
|
|
12
|
+
* @param txBlock - TxBlock created by SuiKit.
|
|
13
|
+
* @param veScaKey - veSCA key.
|
|
14
|
+
* @return veSCA key, ID, locked amount and unlock at timestamp.
|
|
15
|
+
*/
|
|
16
|
+
export declare const requireVeSca: (builder: ScallopBuilder, SuiTxBlock: SuiTxBlock, veScaKey?: SuiAddressArg | undefined) => Promise<import("src/types").Vesca | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* Create an enhanced transaction block instance for interaction with veSCA modules of the Scallop contract.
|
|
19
|
+
*
|
|
20
|
+
* @param builder - Scallop builder instance.
|
|
21
|
+
* @param initTxBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
|
|
22
|
+
* @return Scallop borrow incentive txBlock.
|
|
23
|
+
*/
|
|
24
|
+
export declare const newVeScaTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | TransactionBlock) => VeScaTxBlock;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
export declare const API_BASE_URL = "https://sui.api.scallop.io";
|
|
2
2
|
export declare const SDK_API_BASE_URL = "https://sdk.api.scallop.io";
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
3
|
+
export declare const IS_VE_SCA_TEST = false;
|
|
4
|
+
export declare const ADDRESSES_ID: "65fb07c39c845425d71d7b18" | "6601955b8b0024600a917079";
|
|
5
|
+
export declare const PROTOCOL_OBJECT_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf";
|
|
6
|
+
export declare const BORROW_FEE_PROTOCOL_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da";
|
|
7
|
+
export declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
|
|
8
|
+
export declare const OLD_BORROW_INCENTIVE_PROTOCOL_ID: "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
|
|
6
9
|
export declare const SUPPORT_POOLS: readonly ["eth", "btc", "usdc", "usdt", "sui", "apt", "sol", "cetus", "afsui", "hasui", "vsui"];
|
|
7
10
|
export declare const SUPPORT_COLLATERALS: readonly ["eth", "btc", "usdc", "usdt", "sui", "apt", "sol", "cetus", "afsui", "hasui", "vsui"];
|
|
8
11
|
export declare const SUPPORT_SPOOLS: readonly ["seth", "ssui", "susdc", "susdt", "scetus", "safsui", "shasui", "svsui"];
|
|
9
12
|
export declare const SUPPORT_SPOOLS_REWARDS: readonly ["sui"];
|
|
10
13
|
export declare const SUPPORT_BORROW_INCENTIVE_POOLS: readonly ["sui", "usdc", "usdt"];
|
|
11
|
-
export declare const SUPPORT_BORROW_INCENTIVE_REWARDS: readonly ["sui"];
|
|
14
|
+
export declare const SUPPORT_BORROW_INCENTIVE_REWARDS: readonly ["sui", "sca"];
|
|
12
15
|
export declare const SUPPORT_ORACLES: readonly ["supra", "switchboard", "pyth"];
|
|
13
16
|
export declare const SUPPORT_PACKAGES: readonly ["coinDecimalsRegistry", "math", "whitelist", "x", "protocol", "protocolWhitelist", "query", "supra", "pyth", "switchboard", "xOracle", "testCoin"];
|