@scallop-io/sui-scallop-sdk 1.5.0-alpha.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3159 -0
- package/dist/index.d.ts +3159 -3
- package/dist/index.js +78 -9966
- package/dist/index.mjs +15 -9892
- package/package.json +5 -6
- package/src/constants/coinGecko.ts +14 -4
- package/src/constants/common.ts +7 -0
- package/src/constants/enum.ts +23 -0
- package/src/constants/poolAddress.ts +112 -1
- package/src/constants/pyth.ts +4 -1
- package/src/constants/testAddress.ts +220 -49
- package/src/constants/xoracle.ts +3 -0
- package/src/models/scallopAddress.ts +9 -0
- package/src/models/scallopQuery.ts +4 -2
- package/src/queries/poolAddressesQuery.ts +2 -2
- package/src/queries/portfolioQuery.ts +7 -8
- package/src/types/address.ts +1 -0
- package/src/utils/util.ts +8 -3
- package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
- package/dist/builders/coreBuilder.d.ts +0 -12
- package/dist/builders/index.d.ts +0 -12
- package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
- package/dist/builders/oracle.d.ts +0 -14
- package/dist/builders/referralBuilder.d.ts +0 -12
- package/dist/builders/sCoinBuilder.d.ts +0 -4
- package/dist/builders/spoolBuilder.d.ts +0 -12
- package/dist/builders/vescaBuilder.d.ts +0 -25
- package/dist/constants/cache.d.ts +0 -14
- package/dist/constants/coinGecko.d.ts +0 -2
- package/dist/constants/common.d.ts +0 -20
- package/dist/constants/enum.d.ts +0 -14
- package/dist/constants/flashloan.d.ts +0 -2
- package/dist/constants/index.d.ts +0 -13
- package/dist/constants/poolAddress.d.ts +0 -27
- package/dist/constants/pyth.d.ts +0 -5
- package/dist/constants/queryKeys.d.ts +0 -54
- package/dist/constants/rpc.d.ts +0 -1
- package/dist/constants/testAddress.d.ts +0 -2
- package/dist/constants/vesca.d.ts +0 -5
- package/dist/constants/xoracle.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/models/index.d.ts +0 -8
- package/dist/models/scallop.d.ts +0 -73
- package/dist/models/scallopAddress.d.ts +0 -150
- package/dist/models/scallopBuilder.d.ts +0 -90
- package/dist/models/scallopCache.d.ts +0 -81
- package/dist/models/scallopClient.d.ts +0 -321
- package/dist/models/scallopIndexer.d.ts +0 -90
- package/dist/models/scallopPrice.d.ts +0 -0
- package/dist/models/scallopQuery.d.ts +0 -704
- package/dist/models/scallopUtils.d.ts +0 -229
- package/dist/models/suiKit.d.ts +0 -2
- package/dist/queries/borrowIncentiveQuery.d.ts +0 -82
- package/dist/queries/borrowLimitQuery.d.ts +0 -9
- package/dist/queries/coreQuery.d.ts +0 -171
- package/dist/queries/index.d.ts +0 -15
- package/dist/queries/isolatedAssetQuery.d.ts +0 -14
- package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
- package/dist/queries/objectsQuery.d.ts +0 -2
- package/dist/queries/poolAddressesQuery.d.ts +0 -29
- package/dist/queries/portfolioQuery.d.ts +0 -143
- package/dist/queries/priceQuery.d.ts +0 -58
- package/dist/queries/referralQuery.d.ts +0 -7
- package/dist/queries/sCoinQuery.d.ts +0 -41
- package/dist/queries/spoolQuery.d.ts +0 -74
- package/dist/queries/supplyLimitQuery.d.ts +0 -9
- package/dist/queries/vescaQuery.d.ts +0 -36
- package/dist/queries/xOracleQuery.d.ts +0 -13
- package/dist/types/address.d.ts +0 -108
- package/dist/types/builder/borrowIncentive.d.ts +0 -35
- package/dist/types/builder/core.d.ts +0 -56
- package/dist/types/builder/index.d.ts +0 -24
- package/dist/types/builder/loyaltyProgram.d.ts +0 -23
- package/dist/types/builder/referral.d.ts +0 -30
- package/dist/types/builder/sCoin.d.ts +0 -37
- package/dist/types/builder/spool.d.ts +0 -29
- package/dist/types/builder/vesca.d.ts +0 -51
- package/dist/types/constant/common.d.ts +0 -24
- package/dist/types/constant/enum.d.ts +0 -48
- package/dist/types/constant/index.d.ts +0 -3
- package/dist/types/constant/xOracle.d.ts +0 -9
- package/dist/types/index.d.ts +0 -6
- package/dist/types/model.d.ts +0 -60
- package/dist/types/query/borrowIncentive.d.ts +0 -124
- package/dist/types/query/core.d.ts +0 -380
- package/dist/types/query/index.d.ts +0 -7
- package/dist/types/query/loyaltyProgram.d.ts +0 -5
- package/dist/types/query/portfolio.d.ts +0 -119
- package/dist/types/query/sCoin.d.ts +0 -1
- package/dist/types/query/spool.d.ts +0 -142
- package/dist/types/query/vesca.d.ts +0 -26
- package/dist/types/utils.d.ts +0 -22
- package/dist/utils/builder.d.ts +0 -15
- package/dist/utils/core.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/indexer.d.ts +0 -17
- package/dist/utils/query.d.ts +0 -62
- package/dist/utils/util.d.ts +0 -27
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SuiTxBlock, Transaction, SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
|
|
2
|
-
import { ScallopBuilder } from '../models';
|
|
3
|
-
import type { SuiObjectArg } from '@scallop-io/sui-kit';
|
|
4
|
-
import type { ScallopTxBlock, VeScaTxBlock } from 'src/types';
|
|
5
|
-
/**
|
|
6
|
-
* Check and get veSCA data from transaction block.
|
|
7
|
-
*
|
|
8
|
-
* @description
|
|
9
|
-
* If the veScaKey id is provided, directly return it.
|
|
10
|
-
* Otherwise, automatically get veScaKey from the sender.
|
|
11
|
-
*
|
|
12
|
-
* @param builder - Scallop builder instance.
|
|
13
|
-
* @param txBlock - TxBlock created by SuiKit.
|
|
14
|
-
* @param veScaKey - veSCA key.
|
|
15
|
-
* @return veSCA key, ID, locked amount and unlock at timestamp.
|
|
16
|
-
*/
|
|
17
|
-
export declare const requireVeSca: (builder: ScallopBuilder, SuiTxBlock: SuiTxBlock, veScaKey?: SuiObjectArg | undefined) => Promise<import("src/types").Vesca | undefined>;
|
|
18
|
-
/**
|
|
19
|
-
* Create an enhanced transaction block instance for interaction with veSCA modules of the Scallop contract.
|
|
20
|
-
*
|
|
21
|
-
* @param builder - Scallop builder instance.
|
|
22
|
-
* @param initTxBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
|
|
23
|
-
* @return Scallop borrow incentive txBlock.
|
|
24
|
-
*/
|
|
25
|
-
export declare const newVeScaTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction) => VeScaTxBlock;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default cache options for the QueryClient.
|
|
3
|
-
* @type {QueryClientConfig}
|
|
4
|
-
* @description Default cache options for the QueryClient
|
|
5
|
-
* We set the default to 5s to prevent duplicate requests from being requested (e.g. query MarketObject, etc.)
|
|
6
|
-
*/
|
|
7
|
-
export declare const DEFAULT_CACHE_OPTIONS: {
|
|
8
|
-
defaultOptions: {
|
|
9
|
-
queries: {
|
|
10
|
-
staleTime: number;
|
|
11
|
-
gcTime: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare const API_BASE_URL: "https://sui.apis.scallop.io";
|
|
2
|
-
export declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
|
|
3
|
-
export declare const IS_VE_SCA_TEST: boolean;
|
|
4
|
-
export declare const USE_TEST_ADDRESS: boolean;
|
|
5
|
-
export declare const ADDRESSES_ID: "65fb07c39c845425d71d7b18" | "675c65cd301dd817ea262e76";
|
|
6
|
-
export declare const PROTOCOL_OBJECT_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf";
|
|
7
|
-
export declare const BORROW_FEE_PROTOCOL_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da";
|
|
8
|
-
export declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
|
|
9
|
-
export declare const OLD_BORROW_INCENTIVE_PROTOCOL_ID: "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
|
|
10
|
-
export declare const SUPPORT_POOLS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fud", "deep", "fdusd", "blub"];
|
|
11
|
-
export declare const SUPPORT_COLLATERALS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fdusd"];
|
|
12
|
-
export declare const SUPPORT_SPOOLS: readonly ["susdc", "sweth", "ssui", "swusdc", "swusdt", "scetus", "safsui", "shasui", "svsui"];
|
|
13
|
-
export declare const SUPPORT_SCOIN: readonly ["susdc", "ssbeth", "ssbusdt", "ssbwbtc", "ssui", "swusdc", "swusdt", "safsui", "shasui", "svsui", "sweth", "ssca", "scetus", "swsol", "swbtc", "sdeep", "sfud", "sfdusd", "sblub"];
|
|
14
|
-
export declare const SUPPORT_SUI_BRIDGE: readonly ["sbeth", "sbusdt", "sbwbtc"];
|
|
15
|
-
export declare const SUPPORT_WORMHOLE: readonly ["wusdc", "wusdt", "weth", "wbtc", "wapt", "wsol"];
|
|
16
|
-
export declare const SUPPORT_SPOOLS_REWARDS: readonly ["sui"];
|
|
17
|
-
export declare const SUPPORT_BORROW_INCENTIVE_POOLS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fud", "deep", "fdusd", "blub"];
|
|
18
|
-
export declare const SUPPORT_BORROW_INCENTIVE_REWARDS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fud", "deep", "fdusd", "blub", "susdc", "ssbeth", "ssbusdt", "ssbwbtc", "ssui", "swusdc", "swusdt", "safsui", "shasui", "svsui", "sweth", "ssca", "scetus", "swsol", "swbtc", "sdeep", "sfud", "sfdusd", "sblub"];
|
|
19
|
-
export declare const SUPPORT_ORACLES: readonly ["supra", "switchboard", "pyth"];
|
|
20
|
-
export declare const SUPPORT_PACKAGES: readonly ["coinDecimalsRegistry", "math", "whitelist", "x", "protocol", "protocolWhitelist", "query", "supra", "pyth", "switchboard", "xOracle", "testCoin"];
|
package/dist/constants/enum.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type * as types from '../types';
|
|
2
|
-
export declare const coinDecimals: types.SupportCoinDecimals;
|
|
3
|
-
export declare const assetCoins: types.AssetCoins;
|
|
4
|
-
export declare const marketCoins: types.MarketCoins;
|
|
5
|
-
export declare const sCoins: types.SCoins;
|
|
6
|
-
export declare const stakeMarketCoins: types.StakeMarketCoins;
|
|
7
|
-
export declare const spoolRewardCoins: types.StakeRewardCoins;
|
|
8
|
-
export declare const suiBridgeCoins: types.SuiBridgeCoins;
|
|
9
|
-
export declare const coinIds: types.AssetCoinIds;
|
|
10
|
-
export declare const wormholeCoinIds: types.WormholeCoinIds;
|
|
11
|
-
export declare const voloCoinIds: types.VoloCoinIds;
|
|
12
|
-
export declare const sCoinIds: types.SCoinIds;
|
|
13
|
-
export declare const sCoinTypeToName: Record<string, "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub">;
|
|
14
|
-
export declare const sCoinRawNameToName: Record<string, "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub">;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from './cache';
|
|
2
|
-
export * from './coinGecko';
|
|
3
|
-
export * from './common';
|
|
4
|
-
export * from './enum';
|
|
5
|
-
export * from './flashloan';
|
|
6
|
-
export * from './poolAddress';
|
|
7
|
-
export * from './pyth';
|
|
8
|
-
export * from './queryKeys';
|
|
9
|
-
export * from './rpc';
|
|
10
|
-
export * from './testAddress';
|
|
11
|
-
export * from './vesca';
|
|
12
|
-
export * from './testAddress';
|
|
13
|
-
export * from './xoracle';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { OptionalKeys, SupportPoolCoins } from 'src/types';
|
|
2
|
-
export declare const POOL_ADDRESSES: OptionalKeys<Record<SupportPoolCoins, {
|
|
3
|
-
coinName: string;
|
|
4
|
-
symbol: string;
|
|
5
|
-
coinType: string;
|
|
6
|
-
lendingPoolAddress: string;
|
|
7
|
-
borrowDynamic: string;
|
|
8
|
-
interestModel: string;
|
|
9
|
-
borrowFeeKey: string;
|
|
10
|
-
coinMetadataId: string;
|
|
11
|
-
decimals: number;
|
|
12
|
-
pythFeed: string;
|
|
13
|
-
pythFeedObjectId: string;
|
|
14
|
-
collateralPoolAddress?: string;
|
|
15
|
-
riskModel?: string;
|
|
16
|
-
supplyLimitKey?: string;
|
|
17
|
-
borrowLimitKey?: string;
|
|
18
|
-
sCoinType?: string;
|
|
19
|
-
sCoinName?: string;
|
|
20
|
-
sCoinSymbol?: string;
|
|
21
|
-
sCoinMetadataId?: string;
|
|
22
|
-
sCoinTreasury?: string;
|
|
23
|
-
isolatedAssetKey?: string;
|
|
24
|
-
spool?: string;
|
|
25
|
-
spoolReward?: string;
|
|
26
|
-
spoolName?: string;
|
|
27
|
-
}>>;
|
package/dist/constants/pyth.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { GetDynamicFieldObjectParams, GetDynamicFieldsParams, GetOwnedObjectsParams, SuiObjectData, SuiObjectDataOptions } from '@mysten/sui/client';
|
|
2
|
-
import type { SuiObjectArg, SuiTxArg } from '@scallop-io/sui-kit';
|
|
3
|
-
export declare const queryKeys: {
|
|
4
|
-
api: {
|
|
5
|
-
getAddresses: (addressesId?: string) => (string | {
|
|
6
|
-
addressesId: string | undefined;
|
|
7
|
-
})[];
|
|
8
|
-
getMarket: () => string[];
|
|
9
|
-
getSpools: () => string[];
|
|
10
|
-
getBorrowIncentivePool: () => string[];
|
|
11
|
-
getTotalValueLocked: () => string[];
|
|
12
|
-
};
|
|
13
|
-
rpc: {
|
|
14
|
-
getInspectTxn: (queryTarget?: string, args?: SuiObjectArg[], typeArgs?: any[]) => (string | {
|
|
15
|
-
queryTarget: string | undefined;
|
|
16
|
-
args: string;
|
|
17
|
-
typeArgs: string | undefined;
|
|
18
|
-
})[];
|
|
19
|
-
getObject: (objectId?: string, options?: SuiObjectDataOptions) => (string | {
|
|
20
|
-
objectId: string | undefined;
|
|
21
|
-
options: SuiObjectDataOptions | undefined;
|
|
22
|
-
})[];
|
|
23
|
-
getObjects: (objectIds?: string[]) => (string | {
|
|
24
|
-
objectIds: string;
|
|
25
|
-
})[];
|
|
26
|
-
getOwnedObjects: (input?: Partial<GetOwnedObjectsParams>) => (string | {
|
|
27
|
-
walletAddress: string | undefined;
|
|
28
|
-
cursor: string | undefined;
|
|
29
|
-
options: SuiObjectDataOptions | undefined;
|
|
30
|
-
filter: string;
|
|
31
|
-
limit: number | undefined;
|
|
32
|
-
})[];
|
|
33
|
-
getDynamicFields: (input?: Partial<GetDynamicFieldsParams>) => (string | {
|
|
34
|
-
parentId: string | undefined;
|
|
35
|
-
cursor: string | undefined;
|
|
36
|
-
limit: number | undefined;
|
|
37
|
-
})[];
|
|
38
|
-
getDynamicFieldObject: (input?: Partial<GetDynamicFieldObjectParams>) => (string | {
|
|
39
|
-
parentId: string | undefined;
|
|
40
|
-
name: string;
|
|
41
|
-
})[];
|
|
42
|
-
getTotalVeScaTreasuryAmount: (refreshArgs?: any[], vescaAmountArgs?: (string | SuiObjectData | SuiTxArg)[]) => (string | {
|
|
43
|
-
refreshArgs: string;
|
|
44
|
-
vescaAmountArgs: string;
|
|
45
|
-
})[];
|
|
46
|
-
getAllCoinBalances: (owner?: string) => (string | {
|
|
47
|
-
owner: string | undefined;
|
|
48
|
-
})[];
|
|
49
|
-
getNormalizedMoveFunction: (target?: string) => (string | undefined)[];
|
|
50
|
-
};
|
|
51
|
-
oracle: {
|
|
52
|
-
getPythLatestPriceFeeds: () => string[];
|
|
53
|
-
};
|
|
54
|
-
};
|
package/dist/constants/rpc.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const RPC_PROVIDERS: string[];
|