zo-sdk 0.1.13 → 0.1.15
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/api.cjs +43 -43
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +11 -11
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +11 -11
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +43 -43
- package/dist/api.mjs.map +1 -1
- package/dist/consts/deployments-usdz-mainnet.json +1 -1
- package/dist/consts/deployments-zlp-mainnet.json +1 -1
- package/dist/data.cjs +20 -22
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.cts.map +1 -1
- package/dist/data.d.mts.map +1 -1
- package/dist/data.mjs +20 -22
- package/dist/data.mjs.map +1 -1
- package/dist/implementations/SLPDataAPI.cjs +2 -2
- package/dist/implementations/SLPDataAPI.cjs.map +1 -1
- package/dist/implementations/SLPDataAPI.mjs +2 -2
- package/dist/implementations/SLPDataAPI.mjs.map +1 -1
- package/dist/implementations/USDZAPI.cjs +20 -20
- package/dist/implementations/USDZAPI.cjs.map +1 -1
- package/dist/implementations/USDZAPI.mjs +20 -20
- package/dist/implementations/USDZAPI.mjs.map +1 -1
- package/dist/implementations/USDZDataAPI.cjs +46 -4
- package/dist/implementations/USDZDataAPI.cjs.map +1 -1
- package/dist/implementations/USDZDataAPI.d.cts +6 -1
- package/dist/implementations/USDZDataAPI.d.cts.map +1 -1
- package/dist/implementations/USDZDataAPI.d.mts +6 -1
- package/dist/implementations/USDZDataAPI.d.mts.map +1 -1
- package/dist/implementations/USDZDataAPI.mjs +46 -4
- package/dist/implementations/USDZDataAPI.mjs.map +1 -1
- package/dist/implementations/ZLPAPI.cjs +18 -18
- package/dist/implementations/ZLPAPI.cjs.map +1 -1
- package/dist/implementations/ZLPAPI.mjs +18 -18
- package/dist/implementations/ZLPAPI.mjs.map +1 -1
- package/dist/implementations/ZLPDataAPI.cjs +4 -4
- package/dist/implementations/ZLPDataAPI.cjs.map +1 -1
- package/dist/implementations/ZLPDataAPI.mjs +4 -4
- package/dist/implementations/ZLPDataAPI.mjs.map +1 -1
- package/dist/interfaces/usdz.d.cts +20 -0
- package/dist/interfaces/usdz.d.cts.map +1 -1
- package/dist/interfaces/usdz.d.mts +20 -0
- package/dist/interfaces/usdz.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/api.ts +121 -100
- package/src/consts/deployments-usdz-mainnet.json +1 -1
- package/src/consts/deployments-zlp-mainnet.json +1 -1
- package/src/data.ts +66 -63
- package/src/implementations/SLPDataAPI.ts +2 -2
- package/src/implementations/USDZAPI.ts +20 -20
- package/src/implementations/USDZDataAPI.ts +50 -4
- package/src/implementations/ZLPAPI.ts +18 -18
- package/src/implementations/ZLPDataAPI.ts +4 -4
- package/src/interfaces/usdz.ts +25 -1
|
@@ -189,7 +189,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
189
189
|
const { vaultsValuation, symbolsValuation } = this.dataAPI.valuate(tx)
|
|
190
190
|
|
|
191
191
|
tx.moveCall({
|
|
192
|
-
target: `${this.consts.zoCore.
|
|
192
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::deposit`,
|
|
193
193
|
typeArguments: [`${this.consts.zoCore.package}::zlp::ZLP`, this.consts.coins[coin].module],
|
|
194
194
|
arguments: [
|
|
195
195
|
tx.object(this.consts.zoCore.market),
|
|
@@ -213,7 +213,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
213
213
|
const { vaultsValuation, symbolsValuation } = this.dataAPI.valuate(tx)
|
|
214
214
|
|
|
215
215
|
tx.moveCall({
|
|
216
|
-
target: `${this.consts.zoCore.
|
|
216
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::deposit`,
|
|
217
217
|
typeArguments: [
|
|
218
218
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
219
219
|
this.consts.coins[coin].module,
|
|
@@ -258,7 +258,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
258
258
|
const { vaultsValuation, symbolsValuation } = this.dataAPI.valuate(tx)
|
|
259
259
|
|
|
260
260
|
tx.moveCall({
|
|
261
|
-
target: `${this.consts.zoCore.
|
|
261
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::withdraw`,
|
|
262
262
|
typeArguments: [
|
|
263
263
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
264
264
|
this.consts.coins[coin].module,
|
|
@@ -288,7 +288,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
288
288
|
const vaultsValuation = this.dataAPI.valuateVaults(tx)
|
|
289
289
|
|
|
290
290
|
tx.moveCall({
|
|
291
|
-
target: `${this.consts.zoCore.
|
|
291
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::swap`,
|
|
292
292
|
typeArguments: [
|
|
293
293
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
294
294
|
this.consts.coins[fromToken].module,
|
|
@@ -552,7 +552,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
552
552
|
)
|
|
553
553
|
|
|
554
554
|
tx.moveCall({
|
|
555
|
-
target: `${this.consts.zoCore.
|
|
555
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::decrease_position`,
|
|
556
556
|
typeArguments: [
|
|
557
557
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
558
558
|
this.consts.coins[collateralToken].module,
|
|
@@ -649,7 +649,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
649
649
|
)
|
|
650
650
|
|
|
651
651
|
tx.moveCall({
|
|
652
|
-
target: `${this.consts.zoCore.
|
|
652
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::open_position_with_scard`,
|
|
653
653
|
typeArguments: [
|
|
654
654
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
655
655
|
this.consts.coins[collateralToken].module,
|
|
@@ -759,7 +759,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
759
759
|
)
|
|
760
760
|
|
|
761
761
|
tx.moveCall({
|
|
762
|
-
target: `${this.consts.zoCore.
|
|
762
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::decrease_position_with_scard`,
|
|
763
763
|
typeArguments: [
|
|
764
764
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
765
765
|
this.consts.coins[collateralToken].module,
|
|
@@ -886,7 +886,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
886
886
|
)
|
|
887
887
|
|
|
888
888
|
tx.moveCall({
|
|
889
|
-
target: `${this.consts.zoCore.
|
|
889
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::decrease_position_with_scard`,
|
|
890
890
|
typeArguments: [
|
|
891
891
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
892
892
|
this.consts.coins[collateralToken].module,
|
|
@@ -958,7 +958,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
958
958
|
)
|
|
959
959
|
|
|
960
960
|
tx.moveCall({
|
|
961
|
-
target: `${this.consts.zoCore.
|
|
961
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::pledge_in_position`,
|
|
962
962
|
typeArguments: [
|
|
963
963
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
964
964
|
this.consts.coins[collateralToken].module,
|
|
@@ -992,7 +992,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
992
992
|
const symbol = joinSymbol(long ? 'long' : 'short', indexToken)
|
|
993
993
|
|
|
994
994
|
tx.moveCall({
|
|
995
|
-
target: `${this.consts.zoCore.
|
|
995
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::redeem_from_position`,
|
|
996
996
|
typeArguments: [
|
|
997
997
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
998
998
|
this.consts.coins[collateralToken].module,
|
|
@@ -1040,7 +1040,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
1042
|
tx.moveCall({
|
|
1043
|
-
target: `${this.consts.zoCore.
|
|
1043
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::${functionName}`,
|
|
1044
1044
|
typeArguments: [
|
|
1045
1045
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
1046
1046
|
this.consts.coins[collateralToken].module,
|
|
@@ -1088,7 +1088,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
1088
1088
|
}
|
|
1089
1089
|
|
|
1090
1090
|
tx.moveCall({
|
|
1091
|
-
target: `${this.consts.zoCore.
|
|
1091
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::${functionName}`,
|
|
1092
1092
|
typeArguments: [
|
|
1093
1093
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
1094
1094
|
this.consts.coins[collateralToken].module,
|
|
@@ -1110,7 +1110,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
1110
1110
|
tx: Transaction,
|
|
1111
1111
|
): void {
|
|
1112
1112
|
tx.moveCall({
|
|
1113
|
-
target: `${this.consts.zoCore.
|
|
1113
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::clear_closed_position`,
|
|
1114
1114
|
typeArguments: [
|
|
1115
1115
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
1116
1116
|
this.consts.coins[collateralToken].module,
|
|
@@ -1131,7 +1131,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
1131
1131
|
): void {
|
|
1132
1132
|
const funcName = isV11Order ? 'clear_open_position_order' : 'clear_open_position_order'
|
|
1133
1133
|
tx.moveCall({
|
|
1134
|
-
target: `${this.consts.zoCore.
|
|
1134
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::${funcName}`,
|
|
1135
1135
|
typeArguments: [
|
|
1136
1136
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
1137
1137
|
this.consts.coins[collateralToken].module,
|
|
@@ -1153,7 +1153,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
1153
1153
|
): void {
|
|
1154
1154
|
const funcName = isV11Order ? 'clear_decrease_position_order' : 'clear_decrease_position_order'
|
|
1155
1155
|
tx.moveCall({
|
|
1156
|
-
target: `${this.consts.zoCore.
|
|
1156
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::${funcName}`,
|
|
1157
1157
|
typeArguments: [
|
|
1158
1158
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
1159
1159
|
this.consts.coins[collateralToken].module,
|
|
@@ -1173,7 +1173,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
1173
1173
|
tx = new Transaction()
|
|
1174
1174
|
}
|
|
1175
1175
|
tx.moveCall({
|
|
1176
|
-
target: `${this.consts.zoCore.
|
|
1176
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::add_new_referral`,
|
|
1177
1177
|
typeArguments: [`${this.consts.zoCore.package}::zlp::ZLP`],
|
|
1178
1178
|
arguments: [tx.object(this.consts.zoCore.market), tx.object(referralAddress)],
|
|
1179
1179
|
})
|
|
@@ -1233,7 +1233,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
1233
1233
|
const symbol = joinSymbol(long ? 'long' : 'short', indexToken)
|
|
1234
1234
|
|
|
1235
1235
|
tx.moveCall({
|
|
1236
|
-
target: `${this.consts.zoCore.
|
|
1236
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::force_close_position`,
|
|
1237
1237
|
typeArguments: [
|
|
1238
1238
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
1239
1239
|
this.consts.coins[collateralToken].module,
|
|
@@ -1269,7 +1269,7 @@ export class ZLPAPI extends BaseAPI implements IZLPAPI {
|
|
|
1269
1269
|
tx: Transaction,
|
|
1270
1270
|
): void {
|
|
1271
1271
|
tx.moveCall({
|
|
1272
|
-
target: `${this.consts.zoCore.
|
|
1272
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::force_clear_closed_position`,
|
|
1273
1273
|
typeArguments: [
|
|
1274
1274
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
1275
1275
|
this.consts.coins[collateralToken].module,
|
|
@@ -55,7 +55,7 @@ export class ZLPDataAPI extends BaseDataAPI implements IZLPDataAPI {
|
|
|
55
55
|
*/
|
|
56
56
|
public valuateVaults(tx: Transaction) {
|
|
57
57
|
const vaultsValuation = tx.moveCall({
|
|
58
|
-
target: `${this.consts.zoCore.
|
|
58
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::create_vaults_valuation`,
|
|
59
59
|
typeArguments: [`${this.consts.zoCore.package}::zlp::ZLP`],
|
|
60
60
|
arguments: [
|
|
61
61
|
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
@@ -66,7 +66,7 @@ export class ZLPDataAPI extends BaseDataAPI implements IZLPDataAPI {
|
|
|
66
66
|
for (const key of Object.keys(this.consts.zoCore.vaults)) {
|
|
67
67
|
const vault = this.consts.zoCore.vaults[key]
|
|
68
68
|
tx.moveCall({
|
|
69
|
-
target: `${this.consts.zoCore.
|
|
69
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::valuate_vault`,
|
|
70
70
|
typeArguments: [
|
|
71
71
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
72
72
|
this.consts.coins[key].module,
|
|
@@ -87,7 +87,7 @@ export class ZLPDataAPI extends BaseDataAPI implements IZLPDataAPI {
|
|
|
87
87
|
*/
|
|
88
88
|
public valuateSymbols(tx: Transaction) {
|
|
89
89
|
const symbolsValuation = tx.moveCall({
|
|
90
|
-
target: `${this.consts.zoCore.
|
|
90
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::create_symbols_valuation`,
|
|
91
91
|
typeArguments: [`${this.consts.zoCore.package}::zlp::ZLP`],
|
|
92
92
|
arguments: [
|
|
93
93
|
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
@@ -99,7 +99,7 @@ export class ZLPDataAPI extends BaseDataAPI implements IZLPDataAPI {
|
|
|
99
99
|
const [direction, token] = parseSymbolKey(key)
|
|
100
100
|
const symbol = this.consts.zoCore.symbols[key]
|
|
101
101
|
tx.moveCall({
|
|
102
|
-
target: `${this.consts.zoCore.
|
|
102
|
+
target: `${this.consts.zoCore.upgradedPackage}::market::valuate_symbol`,
|
|
103
103
|
typeArguments: [
|
|
104
104
|
`${this.consts.zoCore.package}::zlp::ZLP`,
|
|
105
105
|
this.consts.coins[token].module,
|
package/src/interfaces/usdz.ts
CHANGED
|
@@ -64,8 +64,32 @@ export interface IUSDZCredential extends IBaseCredential {
|
|
|
64
64
|
// USDZ-specific credential fields can be added here
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
// USDZ Symbol Config interfaces
|
|
68
|
+
export interface IUSDZPositionInstantExitFeeConfig {
|
|
69
|
+
instant_exit_tier_1_duration_threshold: number
|
|
70
|
+
instant_exit_tier_1_fee_bps: number
|
|
71
|
+
instant_exit_tier_1_fee_enabled: boolean
|
|
72
|
+
instant_exit_tier_2_duration_threshold: number
|
|
73
|
+
instant_exit_tier_2_fee_bps: number
|
|
74
|
+
instant_exit_tier_2_fee_enabled: boolean
|
|
75
|
+
instant_exit_tier_3_duration_threshold: number
|
|
76
|
+
instant_exit_tier_3_fee_bps: number
|
|
77
|
+
instant_exit_tier_3_fee_enabled: boolean
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface IUSDZSymbolConfig {
|
|
81
|
+
id: string
|
|
82
|
+
max_opening_size: number
|
|
83
|
+
max_opening_size_enabled: boolean
|
|
84
|
+
max_opening_size_per_position: number
|
|
85
|
+
max_opening_size_per_position_enabled: boolean
|
|
86
|
+
instant_exit_fee_config: IUSDZPositionInstantExitFeeConfig
|
|
87
|
+
}
|
|
88
|
+
|
|
67
89
|
// USDZ-specific data API interface
|
|
68
|
-
export interface IUSDZDataAPI extends IBaseDataAPI {
|
|
90
|
+
export interface IUSDZDataAPI extends IBaseDataAPI {
|
|
91
|
+
getSymbolConfig: (indexToken: string, long: boolean) => Promise<IUSDZSymbolConfig | null>
|
|
92
|
+
}
|
|
69
93
|
|
|
70
94
|
// USDZ-specific API interface
|
|
71
95
|
export interface IUSDZAPI extends IBaseAPI { }
|