@suilend/sdk 1.1.78 → 1.1.79
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/lib/strategyOwnerCap.d.ts +2 -1
- package/lib/strategyOwnerCap.js +22 -7
- package/package.json +1 -1
|
@@ -7,7 +7,8 @@ export declare const STRATEGY_WRAPPER_PACKAGE_ID_V1 = "0xba97dc73a07638d03d77ad2
|
|
|
7
7
|
export declare enum StrategyType {
|
|
8
8
|
sSUI_SUI_LOOPING = "1",
|
|
9
9
|
stratSUI_SUI_LOOPING = "2",
|
|
10
|
-
USDC_sSUI_SUI_LOOPING = "3"
|
|
10
|
+
USDC_sSUI_SUI_LOOPING = "3",
|
|
11
|
+
AUSD_sSUI_SUI_LOOPING = "4"
|
|
11
12
|
}
|
|
12
13
|
export declare const STRATEGY_TYPE_INFO_MAP: Record<StrategyType, {
|
|
13
14
|
queryParam: string;
|
package/lib/strategyOwnerCap.js
CHANGED
|
@@ -20,12 +20,13 @@ const sui_fe_1 = require("@suilend/sui-fe");
|
|
|
20
20
|
const client_1 = require("../client");
|
|
21
21
|
const types_1 = require("./types");
|
|
22
22
|
exports.STRATEGY_WRAPPER_PACKAGE_ID_V1 = "0xba97dc73a07638d03d77ad2161484eb21db577edc9cadcd7035fef4b4f2f6fa1";
|
|
23
|
-
const
|
|
23
|
+
const STRATEGY_WRAPPER_PACKAGE_ID_V6 = "0xb4e22255bb2ef58c4451eaf5a93135bb9acac58951b1755f1d2aaaad675a0f47";
|
|
24
24
|
var StrategyType;
|
|
25
25
|
(function (StrategyType) {
|
|
26
26
|
StrategyType["sSUI_SUI_LOOPING"] = "1";
|
|
27
27
|
StrategyType["stratSUI_SUI_LOOPING"] = "2";
|
|
28
28
|
StrategyType["USDC_sSUI_SUI_LOOPING"] = "3";
|
|
29
|
+
StrategyType["AUSD_sSUI_SUI_LOOPING"] = "4";
|
|
29
30
|
})(StrategyType || (exports.StrategyType = StrategyType = {}));
|
|
30
31
|
exports.STRATEGY_TYPE_INFO_MAP = {
|
|
31
32
|
[StrategyType.sSUI_SUI_LOOPING]: {
|
|
@@ -70,9 +71,23 @@ exports.STRATEGY_TYPE_INFO_MAP = {
|
|
|
70
71
|
currencyCoinTypes: [sui_fe_1.NORMALIZED_USDC_COINTYPE],
|
|
71
72
|
defaultCurrencyCoinType: sui_fe_1.NORMALIZED_USDC_COINTYPE,
|
|
72
73
|
},
|
|
74
|
+
[StrategyType.AUSD_sSUI_SUI_LOOPING]: {
|
|
75
|
+
queryParam: "AUSD-sSUI-SUI-looping",
|
|
76
|
+
header: {
|
|
77
|
+
coinTypes: [sui_fe_1.NORMALIZED_AUSD_COINTYPE],
|
|
78
|
+
title: "AUSD sSUI/SUI",
|
|
79
|
+
tooltip: "Sets up an AUSD sSUI/SUI Looping strategy by depositing AUSD and looping sSUI/SUI to the desired leverage",
|
|
80
|
+
type: "Looping",
|
|
81
|
+
},
|
|
82
|
+
depositBaseCoinType: sui_fe_1.NORMALIZED_AUSD_COINTYPE,
|
|
83
|
+
depositLstCoinType: sui_fe_1.NORMALIZED_sSUI_COINTYPE,
|
|
84
|
+
borrowCoinType: sui_fe_1.NORMALIZED_SUI_COINTYPE,
|
|
85
|
+
currencyCoinTypes: [sui_fe_1.NORMALIZED_AUSD_COINTYPE],
|
|
86
|
+
defaultCurrencyCoinType: sui_fe_1.NORMALIZED_AUSD_COINTYPE,
|
|
87
|
+
},
|
|
73
88
|
};
|
|
74
89
|
const strategyDeposit = (coin, coinType, strategyOwnerCap, reserveArrayIndex, transaction) => transaction.moveCall({
|
|
75
|
-
target: `${
|
|
90
|
+
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V6}::strategy_wrapper::deposit_liquidity_and_deposit_into_obligation`,
|
|
76
91
|
typeArguments: [client_1.LENDING_MARKET_TYPE, coinType],
|
|
77
92
|
arguments: [
|
|
78
93
|
transaction.object(strategyOwnerCap),
|
|
@@ -85,7 +100,7 @@ const strategyDeposit = (coin, coinType, strategyOwnerCap, reserveArrayIndex, tr
|
|
|
85
100
|
exports.strategyDeposit = strategyDeposit;
|
|
86
101
|
const strategyBorrow = (coinType, strategyOwnerCap, reserveArrayIndex, value, transaction) => (0, sui_fe_1.isSui)(coinType)
|
|
87
102
|
? transaction.moveCall({
|
|
88
|
-
target: `${
|
|
103
|
+
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V6}::strategy_wrapper::borrow_sui_from_obligation`,
|
|
89
104
|
typeArguments: [client_1.LENDING_MARKET_TYPE],
|
|
90
105
|
arguments: [
|
|
91
106
|
transaction.object(strategyOwnerCap),
|
|
@@ -97,7 +112,7 @@ const strategyBorrow = (coinType, strategyOwnerCap, reserveArrayIndex, value, tr
|
|
|
97
112
|
],
|
|
98
113
|
})
|
|
99
114
|
: transaction.moveCall({
|
|
100
|
-
target: `${
|
|
115
|
+
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V6}::strategy_wrapper::borrow_from_obligation`,
|
|
101
116
|
typeArguments: [client_1.LENDING_MARKET_TYPE, coinType],
|
|
102
117
|
arguments: [
|
|
103
118
|
transaction.object(strategyOwnerCap),
|
|
@@ -109,7 +124,7 @@ const strategyBorrow = (coinType, strategyOwnerCap, reserveArrayIndex, value, tr
|
|
|
109
124
|
});
|
|
110
125
|
exports.strategyBorrow = strategyBorrow;
|
|
111
126
|
const strategyWithdraw = (coinType, strategyOwnerCap, reserveArrayIndex, value, transaction) => transaction.moveCall({
|
|
112
|
-
target: `${
|
|
127
|
+
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V6}::strategy_wrapper::withdraw_from_obligation_and_redeem`,
|
|
113
128
|
typeArguments: [client_1.LENDING_MARKET_TYPE, coinType],
|
|
114
129
|
arguments: [
|
|
115
130
|
transaction.object(strategyOwnerCap),
|
|
@@ -121,7 +136,7 @@ const strategyWithdraw = (coinType, strategyOwnerCap, reserveArrayIndex, value,
|
|
|
121
136
|
});
|
|
122
137
|
exports.strategyWithdraw = strategyWithdraw;
|
|
123
138
|
const strategyClaimRewards = (coinType, strategyOwnerCap, reserveArrayIndex, rewardIndex, side, transaction) => transaction.moveCall({
|
|
124
|
-
target: `${
|
|
139
|
+
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V6}::strategy_wrapper::claim_rewards`,
|
|
125
140
|
typeArguments: [client_1.LENDING_MARKET_TYPE, coinType],
|
|
126
141
|
arguments: [
|
|
127
142
|
transaction.object(strategyOwnerCap),
|
|
@@ -310,7 +325,7 @@ const createStrategyOwnerCapIfNoneExists = (strategyType, strategyOwnerCap, tran
|
|
|
310
325
|
strategyOwnerCapId = strategyOwnerCap.id;
|
|
311
326
|
else {
|
|
312
327
|
strategyOwnerCapId = transaction.moveCall({
|
|
313
|
-
target: `${
|
|
328
|
+
target: `${STRATEGY_WRAPPER_PACKAGE_ID_V6}::strategy_wrapper::create_strategy_owner_cap`,
|
|
314
329
|
typeArguments: [client_1.LENDING_MARKET_TYPE],
|
|
315
330
|
arguments: [
|
|
316
331
|
transaction.object(client_1.LENDING_MARKET_ID),
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sdk","version":"1.1.
|
|
1
|
+
{"name":"@suilend/sdk","version":"1.1.79","private":false,"description":"A TypeScript SDK for interacting with the Suilend program","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./client":"./client.js","./api/events":"./api/events.js","./api":"./api/index.js","./lib/constants":"./lib/constants.js","./lib":"./lib/index.js","./lib/initialize":"./lib/initialize.js","./lib/liquidityMining":"./lib/liquidityMining.js","./lib/strategyOwnerCap":"./lib/strategyOwnerCap.js","./lib/transactions":"./lib/transactions.js","./lib/types":"./lib/types.js","./parsers/apiReserveAssetDataEvent":"./parsers/apiReserveAssetDataEvent.js","./parsers":"./parsers/index.js","./parsers/lendingMarket":"./parsers/lendingMarket.js","./parsers/obligation":"./parsers/obligation.js","./parsers/rateLimiter":"./parsers/rateLimiter.js","./parsers/reserve":"./parsers/reserve.js","./swap":"./swap/index.js","./swap/quote":"./swap/quote.js","./swap/transaction":"./swap/transaction.js","./utils/events":"./utils/events.js","./utils":"./utils/index.js","./utils/obligation":"./utils/obligation.js","./utils/simulate":"./utils/simulate.js","./_generated/_framework/reified":"./_generated/_framework/reified.js","./_generated/_framework/util":"./_generated/_framework/util.js","./_generated/_framework/vector":"./_generated/_framework/vector.js","./_generated/suilend":"./_generated/suilend/index.js","./_generated/suilend/cell/structs":"./_generated/suilend/cell/structs.js","./_generated/suilend/decimal/structs":"./_generated/suilend/decimal/structs.js","./_generated/suilend/lending-market/functions":"./_generated/suilend/lending-market/functions.js","./_generated/suilend/lending-market/structs":"./_generated/suilend/lending-market/structs.js","./_generated/suilend/lending-market-registry/functions":"./_generated/suilend/lending-market-registry/functions.js","./_generated/suilend/liquidity-mining/structs":"./_generated/suilend/liquidity-mining/structs.js","./_generated/suilend/obligation/structs":"./_generated/suilend/obligation/structs.js","./_generated/suilend/rate-limiter/functions":"./_generated/suilend/rate-limiter/functions.js","./_generated/suilend/rate-limiter/structs":"./_generated/suilend/rate-limiter/structs.js","./_generated/suilend/reserve/structs":"./_generated/suilend/reserve/structs.js","./_generated/suilend/reserve-config/functions":"./_generated/suilend/reserve-config/functions.js","./_generated/suilend/reserve-config/structs":"./_generated/suilend/reserve-config/structs.js","./_generated/_dependencies/source/0x1":"./_generated/_dependencies/source/0x1/index.js","./_generated/_dependencies/source/0x2":"./_generated/_dependencies/source/0x2/index.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.js","./_generated/_dependencies/source/0x1/ascii/structs":"./_generated/_dependencies/source/0x1/ascii/structs.js","./_generated/_dependencies/source/0x1/option/structs":"./_generated/_dependencies/source/0x1/option/structs.js","./_generated/_dependencies/source/0x1/type-name/structs":"./_generated/_dependencies/source/0x1/type-name/structs.js","./_generated/_dependencies/source/0x2/bag/structs":"./_generated/_dependencies/source/0x2/bag/structs.js","./_generated/_dependencies/source/0x2/balance/structs":"./_generated/_dependencies/source/0x2/balance/structs.js","./_generated/_dependencies/source/0x2/object/structs":"./_generated/_dependencies/source/0x2/object/structs.js","./_generated/_dependencies/source/0x2/object-table/structs":"./_generated/_dependencies/source/0x2/object-table/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/suilend-fe-public.git"},"bugs":{"url":"https://github.com/suilend/suilend-fe-public/issues"},"dependencies":{"@7kprotocol/sdk-ts":"^3.4.0","@cetusprotocol/aggregator-sdk":"^1.1.2","@flowx-finance/sdk":"^1.11.3","@pythnetwork/pyth-sui-js":"^2.2.0","aftermath-ts-sdk":"^1.3.14","bignumber.js":"^9.1.2","bn.js":"^5.2.2","crypto-js":"^4.2.0","lodash":"^4.17.21","p-limit":"3.1.0","uuid":"^11.0.3"},"devDependencies":{"@types/bn.js":"^5.2.0","@types/lodash":"^4.17.20","ts-node":"^10.9.2"},"peerDependencies":{"@mysten/bcs":"1.6.0","@mysten/sui":"1.28.2","@suilend/sui-fe":"^0.3.29"}}
|