zo-sdk 0.1.2 → 0.1.4

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.
Files changed (183) hide show
  1. package/dist/abstract/BaseAPI.cjs +3 -4
  2. package/dist/abstract/BaseAPI.cjs.map +1 -1
  3. package/dist/abstract/BaseAPI.d.cts +13 -13
  4. package/dist/abstract/BaseAPI.d.cts.map +1 -1
  5. package/dist/abstract/BaseAPI.d.mts +13 -13
  6. package/dist/abstract/BaseAPI.d.mts.map +1 -1
  7. package/dist/abstract/BaseAPI.mjs +3 -4
  8. package/dist/abstract/BaseAPI.mjs.map +1 -1
  9. package/dist/abstract/BaseDataAPI.cjs +2 -2
  10. package/dist/abstract/BaseDataAPI.cjs.map +1 -1
  11. package/dist/abstract/BaseDataAPI.d.cts +2 -2
  12. package/dist/abstract/BaseDataAPI.d.cts.map +1 -1
  13. package/dist/abstract/BaseDataAPI.d.mts +2 -2
  14. package/dist/abstract/BaseDataAPI.d.mts.map +1 -1
  15. package/dist/abstract/BaseDataAPI.mjs +2 -2
  16. package/dist/abstract/BaseDataAPI.mjs.map +1 -1
  17. package/dist/abstract/index.cjs +3 -3
  18. package/dist/abstract/index.cjs.map +1 -1
  19. package/dist/abstract/index.d.cts +1 -1
  20. package/dist/abstract/index.d.cts.map +1 -1
  21. package/dist/abstract/index.d.mts +1 -1
  22. package/dist/abstract/index.d.mts.map +1 -1
  23. package/dist/abstract/index.mjs +1 -1
  24. package/dist/abstract/index.mjs.map +1 -1
  25. package/dist/api.cjs +2 -1
  26. package/dist/api.cjs.map +1 -1
  27. package/dist/api.d.cts.map +1 -1
  28. package/dist/api.d.mts.map +1 -1
  29. package/dist/api.mjs +2 -1
  30. package/dist/api.mjs.map +1 -1
  31. package/dist/bcs.cjs.map +1 -1
  32. package/dist/bcs.d.cts.map +1 -1
  33. package/dist/bcs.d.mts.map +1 -1
  34. package/dist/bcs.mjs.map +1 -1
  35. package/dist/consts/deployments-slp-mainnet.json +0 -70
  36. package/dist/consts/deployments-usdz-mainnet.json +1 -133
  37. package/dist/consts/index.cjs +56 -15
  38. package/dist/consts/index.cjs.map +1 -1
  39. package/dist/consts/index.d.cts.map +1 -1
  40. package/dist/consts/index.d.mts.map +1 -1
  41. package/dist/consts/index.mjs +56 -15
  42. package/dist/consts/index.mjs.map +1 -1
  43. package/dist/factory/SDKFactory.cjs +21 -14
  44. package/dist/factory/SDKFactory.cjs.map +1 -1
  45. package/dist/factory/SDKFactory.d.cts +4 -4
  46. package/dist/factory/SDKFactory.d.cts.map +1 -1
  47. package/dist/factory/SDKFactory.d.mts +4 -4
  48. package/dist/factory/SDKFactory.d.mts.map +1 -1
  49. package/dist/factory/SDKFactory.mjs +22 -15
  50. package/dist/factory/SDKFactory.mjs.map +1 -1
  51. package/dist/implementations/SLPAPI.cjs +143 -110
  52. package/dist/implementations/SLPAPI.cjs.map +1 -1
  53. package/dist/implementations/SLPAPI.d.cts +49 -47
  54. package/dist/implementations/SLPAPI.d.cts.map +1 -1
  55. package/dist/implementations/SLPAPI.d.mts +49 -47
  56. package/dist/implementations/SLPAPI.d.mts.map +1 -1
  57. package/dist/implementations/SLPAPI.mjs +143 -110
  58. package/dist/implementations/SLPAPI.mjs.map +1 -1
  59. package/dist/implementations/SLPDataAPI.cjs +98 -89
  60. package/dist/implementations/SLPDataAPI.cjs.map +1 -1
  61. package/dist/implementations/SLPDataAPI.d.cts +21 -21
  62. package/dist/implementations/SLPDataAPI.d.cts.map +1 -1
  63. package/dist/implementations/SLPDataAPI.d.mts +21 -21
  64. package/dist/implementations/SLPDataAPI.d.mts.map +1 -1
  65. package/dist/implementations/SLPDataAPI.mjs +98 -89
  66. package/dist/implementations/SLPDataAPI.mjs.map +1 -1
  67. package/dist/implementations/USDZAPI.cjs +128 -84
  68. package/dist/implementations/USDZAPI.cjs.map +1 -1
  69. package/dist/implementations/USDZAPI.d.cts +46 -45
  70. package/dist/implementations/USDZAPI.d.cts.map +1 -1
  71. package/dist/implementations/USDZAPI.d.mts +46 -45
  72. package/dist/implementations/USDZAPI.d.mts.map +1 -1
  73. package/dist/implementations/USDZAPI.mjs +128 -84
  74. package/dist/implementations/USDZAPI.mjs.map +1 -1
  75. package/dist/implementations/USDZDataAPI.cjs +48 -47
  76. package/dist/implementations/USDZDataAPI.cjs.map +1 -1
  77. package/dist/implementations/USDZDataAPI.d.cts +19 -19
  78. package/dist/implementations/USDZDataAPI.d.cts.map +1 -1
  79. package/dist/implementations/USDZDataAPI.d.mts +19 -19
  80. package/dist/implementations/USDZDataAPI.d.mts.map +1 -1
  81. package/dist/implementations/USDZDataAPI.mjs +49 -48
  82. package/dist/implementations/USDZDataAPI.mjs.map +1 -1
  83. package/dist/implementations/ZLPAPI.cjs +137 -89
  84. package/dist/implementations/ZLPAPI.cjs.map +1 -1
  85. package/dist/implementations/ZLPAPI.d.cts +50 -48
  86. package/dist/implementations/ZLPAPI.d.cts.map +1 -1
  87. package/dist/implementations/ZLPAPI.d.mts +50 -48
  88. package/dist/implementations/ZLPAPI.d.mts.map +1 -1
  89. package/dist/implementations/ZLPAPI.mjs +137 -89
  90. package/dist/implementations/ZLPAPI.mjs.map +1 -1
  91. package/dist/implementations/ZLPDataAPI.cjs +62 -63
  92. package/dist/implementations/ZLPDataAPI.cjs.map +1 -1
  93. package/dist/implementations/ZLPDataAPI.d.cts +19 -19
  94. package/dist/implementations/ZLPDataAPI.d.cts.map +1 -1
  95. package/dist/implementations/ZLPDataAPI.d.mts +19 -19
  96. package/dist/implementations/ZLPDataAPI.d.mts.map +1 -1
  97. package/dist/implementations/ZLPDataAPI.mjs +63 -64
  98. package/dist/implementations/ZLPDataAPI.mjs.map +1 -1
  99. package/dist/implementations/index.cjs +5 -5
  100. package/dist/implementations/index.cjs.map +1 -1
  101. package/dist/implementations/index.d.cts +2 -2
  102. package/dist/implementations/index.d.cts.map +1 -1
  103. package/dist/implementations/index.d.mts +2 -2
  104. package/dist/implementations/index.d.mts.map +1 -1
  105. package/dist/implementations/index.mjs +2 -2
  106. package/dist/implementations/index.mjs.map +1 -1
  107. package/dist/index.cjs +9 -9
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.d.cts +6 -6
  110. package/dist/index.d.cts.map +1 -1
  111. package/dist/index.d.mts +6 -6
  112. package/dist/index.d.mts.map +1 -1
  113. package/dist/index.mjs +6 -6
  114. package/dist/index.mjs.map +1 -1
  115. package/dist/interfaces/base.cjs +0 -1
  116. package/dist/interfaces/base.cjs.map +1 -1
  117. package/dist/interfaces/base.d.cts +57 -57
  118. package/dist/interfaces/base.d.cts.map +1 -1
  119. package/dist/interfaces/base.d.mts +57 -57
  120. package/dist/interfaces/base.d.mts.map +1 -1
  121. package/dist/interfaces/base.mjs +1 -1
  122. package/dist/interfaces/base.mjs.map +1 -1
  123. package/dist/interfaces/index.d.cts +4 -4
  124. package/dist/interfaces/index.d.cts.map +1 -1
  125. package/dist/interfaces/index.d.mts +4 -4
  126. package/dist/interfaces/index.d.mts.map +1 -1
  127. package/dist/interfaces/slp.cjs +0 -2
  128. package/dist/interfaces/slp.cjs.map +1 -1
  129. package/dist/interfaces/slp.d.cts +5 -5
  130. package/dist/interfaces/slp.d.cts.map +1 -1
  131. package/dist/interfaces/slp.d.mts +5 -5
  132. package/dist/interfaces/slp.d.mts.map +1 -1
  133. package/dist/interfaces/slp.mjs +1 -2
  134. package/dist/interfaces/slp.mjs.map +1 -1
  135. package/dist/interfaces/usdz.d.cts +1 -1
  136. package/dist/interfaces/usdz.d.cts.map +1 -1
  137. package/dist/interfaces/usdz.d.mts +1 -1
  138. package/dist/interfaces/usdz.d.mts.map +1 -1
  139. package/dist/interfaces/zlp.d.cts +5 -5
  140. package/dist/interfaces/zlp.d.cts.map +1 -1
  141. package/dist/interfaces/zlp.d.mts +5 -5
  142. package/dist/interfaces/zlp.d.mts.map +1 -1
  143. package/dist/oracle.cjs +12 -2
  144. package/dist/oracle.cjs.map +1 -1
  145. package/dist/oracle.d.cts +4 -3
  146. package/dist/oracle.d.cts.map +1 -1
  147. package/dist/oracle.d.mts +4 -3
  148. package/dist/oracle.d.mts.map +1 -1
  149. package/dist/oracle.mjs +13 -3
  150. package/dist/oracle.mjs.map +1 -1
  151. package/dist/utils.cjs +1 -1
  152. package/dist/utils.cjs.map +1 -1
  153. package/dist/utils.d.cts.map +1 -1
  154. package/dist/utils.d.mts.map +1 -1
  155. package/dist/utils.mjs +1 -1
  156. package/dist/utils.mjs.map +1 -1
  157. package/eslint.config.mjs +18 -0
  158. package/package.json +16 -15
  159. package/src/abstract/BaseAPI.ts +55 -49
  160. package/src/abstract/BaseDataAPI.ts +19 -17
  161. package/src/abstract/index.ts +1 -1
  162. package/src/api.ts +3 -1
  163. package/src/bcs.ts +9 -9
  164. package/src/consts/deployments-slp-mainnet.json +0 -70
  165. package/src/consts/deployments-usdz-mainnet.json +1 -133
  166. package/src/consts/index.ts +61 -16
  167. package/src/factory/SDKFactory.ts +49 -41
  168. package/src/implementations/SLPAPI.ts +299 -210
  169. package/src/implementations/SLPDataAPI.ts +163 -146
  170. package/src/implementations/USDZAPI.ts +238 -133
  171. package/src/implementations/USDZDataAPI.ts +79 -74
  172. package/src/implementations/ZLPAPI.ts +296 -174
  173. package/src/implementations/ZLPDataAPI.ts +93 -88
  174. package/src/implementations/index.ts +3 -3
  175. package/src/index.ts +17 -17
  176. package/src/interfaces/base.ts +123 -116
  177. package/src/interfaces/index.ts +14 -17
  178. package/src/interfaces/slp.ts +20 -19
  179. package/src/interfaces/usdz.ts +13 -13
  180. package/src/interfaces/zlp.ts +22 -21
  181. package/src/oracle.ts +25 -5
  182. package/src/utils.ts +9 -9
  183. package/tsconfig.json +1 -1
@@ -3,12 +3,12 @@
3
3
  * This file defines the common contracts that all LP token SDKs must implement
4
4
  */
5
5
 
6
+ import type { KioskClient, KioskOwnerCap } from '@mysten/kiosk'
6
7
  import type { SuiClient } from '@mysten/sui/client'
7
8
  import type { Transaction } from '@mysten/sui/transactions'
8
9
  import type { PriceFeed } from '@pythnetwork/pyth-sui-js'
9
10
 
10
- import type { IConsts, Network, LPToken } from '../consts'
11
- import { KioskClient, KioskOwnerCap } from '@mysten/kiosk'
11
+ import type { IConsts, LPToken, Network } from '../consts'
12
12
 
13
13
  // Common data interfaces
14
14
  export interface IBaseMarketValuationInfo {
@@ -218,90 +218,95 @@ export interface IBaseDataAPI {
218
218
  readonly consts: IConsts
219
219
 
220
220
  // Core valuation methods
221
- valuateVaults(tx: Transaction): any
222
- valuateSymbols(tx: Transaction): any
223
- valuate(tx: Transaction): { vaultsValuation: any; symbolsValuation: any }
224
- valuateMarket(): Promise<IBaseMarketValuationInfo>
221
+ valuateVaults: (tx: Transaction) => any
222
+ valuateSymbols: (tx: Transaction) => any
223
+ valuate: (tx: Transaction) => { vaultsValuation: any, symbolsValuation: any }
224
+ valuateMarket: () => Promise<IBaseMarketValuationInfo>
225
225
 
226
226
  // Fee methods
227
- fundingFeeRate(indexToken: string, long: boolean, sender?: string): Promise<number>
228
- rebaseFeeRate(collateralToken: string, increase: boolean, amount: number, sender?: string): Promise<number>
229
- reservingFeeRate(collateralToken: string, amount: number, sender?: string): Promise<number>
227
+ fundingFeeRate: (indexToken: string, long: boolean, sender?: string) => Promise<number>
228
+ rebaseFeeRate: (collateralToken: string, increase: boolean, amount: number, sender?: string) => Promise<number>
229
+ reservingFeeRate: (collateralToken: string, amount: number, sender?: string) => Promise<number>
230
230
 
231
231
  // Market data methods
232
- getMarketInfo(): Promise<IBaseMarketInfo>
233
- getVaultInfo(vault: string): Promise<IBaseVaultInfo>
234
- getSymbolInfo(tokenId: string, long: boolean): Promise<IBaseSymbolInfo>
235
- getPositionConfig(indexToken: string, long: boolean): Promise<IBasePositionConfig>
236
- getOpenPositions(batchSize: number, symbol: string): Promise<IBasePositionInfo[]>
232
+ getMarketInfo: () => Promise<IBaseMarketInfo>
233
+ getVaultInfo: (vault: string) => Promise<IBaseVaultInfo>
234
+ getSymbolInfo: (tokenId: string, long: boolean) => Promise<IBaseSymbolInfo>
235
+ getPositionConfig: (indexToken: string, long: boolean) => Promise<IBasePositionConfig>
236
+ getOpenPositions: (batchSize: number, symbol: string) => Promise<IBasePositionInfo[]>
237
237
 
238
238
  // User data methods
239
- getPositionCapInfoList(owner: string): Promise<IBasePositionCapInfo[]>
240
- getPositionInfoList(positionCapInfoList: IBasePositionCapInfo[], owner: string): Promise<IBasePositionInfo[]>
241
- getOrderCapInfoList(owner: string): Promise<IBaseOrderCapInfo[]>
242
- getOrderInfoList(orderCapInfoList: IBaseOrderCapInfo[], owner: string): Promise<IBaseOrderInfo[]>
243
- getHistory(trader: string, page: number, limit: number, orderType?: string, symbol?: string): Promise<IBaseHistoryResponse>
239
+ getPositionCapInfoList: (owner: string) => Promise<IBasePositionCapInfo[]>
240
+ getPositionInfoList: (positionCapInfoList: IBasePositionCapInfo[], owner: string) => Promise<IBasePositionInfo[]>
241
+ getOrderCapInfoList: (owner: string) => Promise<IBaseOrderCapInfo[]>
242
+ getOrderInfoList: (orderCapInfoList: IBaseOrderCapInfo[], owner: string) => Promise<IBaseOrderInfo[]>
243
+ getHistory: (trader: string, page: number, limit: number, orderType?: string, symbol?: string) => Promise<IBaseHistoryResponse>
244
244
 
245
245
  // Staking methods
246
- getStaked(owner: string): Promise<IBaseStaked>
247
- getStakePool(): Promise<IBaseStakePool>
246
+ getStaked: (owner: string) => Promise<IBaseStaked>
247
+ getStakePool: () => Promise<IBaseStakePool>
248
248
 
249
249
  // Referral methods
250
- hasReferral(referree: string): Promise<boolean>
251
- getReferralData(referree: string): Promise<any>
250
+ hasReferral: (referree: string) => Promise<boolean>
251
+ getReferralData: (referree: string) => Promise<any>
252
252
 
253
253
  // Oracle methods
254
- getOraclePrice(tokenId: string): Promise<PriceFeed>
255
- getOraclePrices(tokens: string[]): Promise<PriceFeed[]>
256
- subOraclePrices(tokens: string[], callback: (price: PriceFeed) => void): Promise<() => void>
257
- initOracleTxb(tokens: string[], tx?: Transaction): Promise<Transaction>
254
+ getOraclePrice: (tokenId: string) => Promise<PriceFeed>
255
+ getOraclePrices: (tokens: string[]) => Promise<PriceFeed[]>
256
+ subOraclePrices: (tokens: string[], callback: (price: PriceFeed) => void) => Promise<() => void>
257
+ initOracleTxb: (tokens: string[], tx?: Transaction) => Promise<Transaction>
258
258
 
259
259
  // Utility methods
260
- validateCache(): void
260
+ validateCache: () => void
261
261
  }
262
262
 
263
263
  export interface IBaseAPI {
264
264
  // LP operations
265
- deposit(
265
+ deposit: (
266
266
  coin: string,
267
267
  coinObjects: string[],
268
268
  amount: number,
269
269
  minAmountOut?: number,
270
270
  referralAddress?: string,
271
- sender?: string
272
- ): Promise<Transaction>
271
+ sender?: string,
272
+ sponsoredTx?: boolean,
273
+ suiCoinObjectsForPythUpdate?: string[],
274
+ isDepositingSui?: boolean,
275
+ ) => Promise<Transaction>
273
276
 
274
- withdraw(
277
+ withdraw: (
275
278
  coin: string,
276
279
  lpCoinObjects: string[],
277
280
  amount: number,
278
- minAmountOut?: number
279
- ): Promise<Transaction>
281
+ minAmountOut?: number,
282
+ sponsoredTx?: boolean,
283
+ suiCoinObjectsForPythUpdate?: string[],
284
+ ) => Promise<Transaction>
280
285
 
281
- swap(
286
+ swap: (
282
287
  fromToken: string,
283
288
  toToken: string,
284
289
  fromAmount: bigint,
285
290
  fromCoinObjects: string[],
286
- ): Promise<Transaction>
291
+ ) => Promise<Transaction>
287
292
 
288
293
  // Staking
289
- stake(
294
+ stake: (
290
295
  lpCoinObjects: string[],
291
296
  amount: bigint,
292
297
  pool: string,
293
298
  tx?: Transaction
294
- ): Promise<Transaction>
299
+ ) => Transaction
295
300
 
296
- unstake(
301
+ unstake: (
297
302
  credentials: IBaseCredential[],
298
303
  amount: bigint,
299
304
  pool: string,
300
305
  tx?: Transaction
301
- ): Promise<Transaction>
306
+ ) => Transaction
302
307
 
303
308
  // Trading operations
304
- openPosition(
309
+ openPosition: (
305
310
  collateralToken: string,
306
311
  indexToken: string,
307
312
  size: bigint,
@@ -318,9 +323,9 @@ export interface IBaseAPI {
318
323
  relayerFee?: bigint,
319
324
  referralAddress?: string,
320
325
  sender?: string
321
- ): Promise<Transaction>
326
+ ) => Promise<Transaction>
322
327
 
323
- decreasePosition(
328
+ decreasePosition: (
324
329
  pcpId: string,
325
330
  collateralToken: string,
326
331
  indexToken: string,
@@ -335,92 +340,94 @@ export interface IBaseAPI {
335
340
  collateralSlippage?: number,
336
341
  relayerFee?: bigint,
337
342
  coinObjects?: string[]
338
- ): Promise<Transaction>
343
+ ) => Promise<Transaction>
339
344
 
340
- decreaseMultiPositions(
345
+ decreaseMultiPositions: (
341
346
  positions: Array<{
342
- pcpId: string,
343
- collateralToken: string,
344
- indexToken: string,
345
- amount: bigint,
346
- long: boolean,
347
- indexPrice: number,
348
- collateralPrice: number,
349
- isTriggerOrder?: boolean,
350
- isTakeProfitOrder?: boolean,
351
- isIocOrder?: boolean,
352
- pricesSlippage?: number,
353
- collateralSlippage?: number,
354
- relayerFee?: bigint,
347
+ pcpId: string
348
+ collateralToken: string
349
+ indexToken: string
350
+ amount: bigint
351
+ long: boolean
352
+ indexPrice: number
353
+ collateralPrice: number
354
+ isTriggerOrder?: boolean
355
+ isTakeProfitOrder?: boolean
356
+ isIocOrder?: boolean
357
+ pricesSlippage?: number
358
+ collateralSlippage?: number
359
+ relayerFee?: bigint
355
360
  coinObjects?: string[]
356
- }>, tx?: Transaction
357
- ): Promise<Transaction>
361
+ }>,
362
+ tx?: Transaction
363
+ ) => Promise<Transaction>
358
364
 
359
- pledgeInPosition(
365
+ pledgeInPosition: (
360
366
  pcpId: string,
361
367
  collateralToken: string,
362
368
  indexToken: string,
363
369
  amount: number,
364
370
  coinObjects: string[],
365
371
  long: boolean
366
- ): Promise<Transaction>
372
+ ) => Promise<Transaction>
367
373
 
368
- redeemFromPosition(
374
+ redeemFromPosition: (
369
375
  pcpId: string,
370
376
  collateralToken: string,
371
377
  indexToken: string,
372
378
  amount: number,
373
379
  long: boolean
374
- ): Promise<Transaction>
380
+ ) => Promise<Transaction>
375
381
 
376
- cancelOrder(
382
+ cancelOrder: (
377
383
  orderCapId: string,
378
384
  collateralToken: string,
379
385
  indexToken: string,
380
386
  long: boolean,
381
387
  type: string,
382
388
  isV11Order?: boolean
383
- ): Promise<Transaction>
389
+ ) => Transaction
384
390
 
385
- cancelMultiOrders(
391
+ cancelMultiOrders: (
386
392
  orders: Array<{
387
- orderCapId: string,
388
- collateralToken: string,
389
- indexToken: string,
390
- long: boolean,
391
- type: string,
393
+ orderCapId: string
394
+ collateralToken: string
395
+ indexToken: string
396
+ long: boolean
397
+ type: string
392
398
  isV11Order?: boolean
393
- }>, tx?: Transaction
394
- ): Promise<Transaction>
399
+ }>,
400
+ tx?: Transaction
401
+ ) => Transaction
395
402
 
396
- clearClosedPosition(
403
+ clearClosedPosition: (
397
404
  pcpId: string,
398
405
  collateralToken: string,
399
406
  indexToken: string,
400
407
  long: boolean,
401
408
  tx: Transaction,
402
- ): void
409
+ ) => void
403
410
 
404
- clearOpenPositionOrder(
411
+ clearOpenPositionOrder: (
405
412
  orderCapId: string,
406
413
  collateralToken: string,
407
414
  indexToken: string,
408
415
  long: boolean,
409
416
  tx: Transaction,
410
417
  isV11Order?: boolean
411
- ): void
418
+ ) => void
412
419
 
413
- clearDecreasePositionOrder(
420
+ clearDecreasePositionOrder: (
414
421
  orderCapId: string,
415
422
  collateralToken: string,
416
423
  indexToken: string,
417
424
  long: boolean,
418
425
  tx: Transaction,
419
426
  isV11Order?: boolean
420
- ): void
427
+ ) => void
421
428
 
422
429
  // S Card operations
423
- openPositionWithSCard(
430
+ openPositionWithSCard: (
424
431
  collateralToken: string,
425
432
  indexToken: string,
426
433
  size: bigint,
@@ -440,9 +447,9 @@ export interface IBaseAPI {
440
447
  relayerFee?: bigint,
441
448
  referralAddress?: string,
442
449
  sender?: string,
443
- ): Promise<Transaction>
450
+ ) => Promise<Transaction>
444
451
 
445
- decreasePositionWithSCard(
452
+ decreasePositionWithSCard: (
446
453
  pcpId: string,
447
454
  collateralToken: string,
448
455
  indexToken: string,
@@ -460,60 +467,60 @@ export interface IBaseAPI {
460
467
  collateralSlippage?: number,
461
468
  relayerFee?: bigint,
462
469
  coinObjects?: string[]
463
- ): Promise<Transaction>
470
+ ) => Promise<Transaction>
464
471
 
465
- decreaseMultiPositionsWithSCard(
472
+ decreaseMultiPositionsWithSCard: (
466
473
  positions: Array<{
467
- pcpId: string,
468
- collateralToken: string,
469
- indexToken: string,
470
- amount: bigint,
471
- long: boolean,
472
- indexPrice: number,
473
- collateralPrice: number,
474
- isTriggerOrder?: boolean,
475
- isTakeProfitOrder?: boolean,
476
- isIocOrder?: boolean,
477
- pricesSlippage?: number,
478
- collateralSlippage?: number,
479
- relayerFee?: bigint,
474
+ pcpId: string
475
+ collateralToken: string
476
+ indexToken: string
477
+ amount: bigint
478
+ long: boolean
479
+ indexPrice: number
480
+ collateralPrice: number
481
+ isTriggerOrder?: boolean
482
+ isTakeProfitOrder?: boolean
483
+ isIocOrder?: boolean
484
+ pricesSlippage?: number
485
+ collateralSlippage?: number
486
+ relayerFee?: bigint
480
487
  coinObjects?: string[]
481
488
  }>,
482
489
  kioskClient: KioskClient,
483
490
  kioskCap: KioskOwnerCap,
484
491
  scard: string,
485
492
  tx?: Transaction
486
- ): Promise<Transaction>
493
+ ) => Promise<Transaction>
487
494
 
488
- claimTokenFromSCard(
495
+ claimTokenFromSCard: (
489
496
  token: string,
490
497
  coinObjects: string[],
491
498
  kioskClient: KioskClient,
492
499
  kioskCap: KioskOwnerCap,
493
500
  scard: string,
494
- ): Promise<Transaction>
501
+ ) => Transaction
495
502
 
496
503
  // Miscellaneous
497
- addReferral(
504
+ addReferral: (
498
505
  referrer: string,
499
506
  tx?: Transaction
500
- ): Transaction
507
+ ) => Transaction
501
508
 
502
509
  // Admin operations
503
- adminUpdatePriceFeed(
510
+ adminUpdatePriceFeed: (
504
511
  collateralToken: string,
505
512
  indexToken: string
506
- ): Promise<Transaction>
513
+ ) => Promise<Transaction>
507
514
 
508
- adminSettlePosition(
515
+ adminSettlePosition: (
509
516
  positionId: string,
510
517
  owner: string,
511
518
  collateralToken: string,
512
519
  indexToken: string,
513
520
  long: boolean,
514
- ): Promise<Transaction>
521
+ ) => Transaction
515
522
 
516
- adminDecreasePosition(
523
+ adminDecreasePosition: (
517
524
  positionId: string,
518
525
  owner: string,
519
526
  collateralToken: string,
@@ -524,33 +531,33 @@ export interface IBaseAPI {
524
531
  collateralPrice?: number,
525
532
  collateralSlippage?: number,
526
533
  relayerFee?: bigint
527
- ): Promise<Transaction>
534
+ ) => Transaction
528
535
 
529
- adminClearClosedPosition(
536
+ adminClearClosedPosition: (
530
537
  positionId: string,
531
538
  owner: string,
532
539
  collateralToken: string,
533
540
  indexToken: string,
534
541
  long: boolean,
535
542
  tx: Transaction
536
- ): Promise<void>
543
+ ) => void
537
544
  }
538
545
 
539
546
  // Factory interface for creating SDK instances
540
547
  export interface ISDKFactory {
541
- createDataAPI(
548
+ createDataAPI: (
542
549
  network: Network,
543
550
  provider: SuiClient,
544
551
  apiEndpoint: string,
545
552
  connectionURL: string,
546
553
  lpToken: LPToken
547
- ): IBaseDataAPI
554
+ ) => IBaseDataAPI
548
555
 
549
- createAPI(
556
+ createAPI: (
550
557
  network: Network,
551
558
  provider: SuiClient,
552
559
  apiEndpoint: string,
553
560
  connectionURL: string,
554
561
  lpToken: LPToken
555
- ): IBaseAPI
556
- }
562
+ ) => IBaseAPI
563
+ }
@@ -17,29 +17,26 @@ export * from './usdz'
17
17
 
18
18
  // Re-export commonly used types for convenience
19
19
  export type {
20
- IBaseMarketValuationInfo,
21
- IBaseDataAPI,
22
20
  IBaseAPI,
23
- ISDKFactory
21
+ IBaseDataAPI,
22
+ IBaseMarketValuationInfo,
23
+ ISDKFactory,
24
24
  } from './base'
25
-
26
25
  export type {
27
- IZLPMarketValuationInfo,
28
- IZLPDataAPI,
29
- IZLPAPI
30
- } from './zlp'
31
-
32
- export type {
33
- ISLPMarketValuationInfo,
34
- ISLPDataAPI,
35
26
  ISLPAPI,
27
+ ISLPDataAPI,
28
+ ISLPMarketValuationInfo,
36
29
  ISudoMarket,
30
+ ISudoSymbol,
37
31
  ISudoVault,
38
- ISudoSymbol
39
32
  } from './slp'
40
-
41
33
  export type {
42
- IUSDZMarketValuationInfo,
34
+ IUSDZAPI,
43
35
  IUSDZDataAPI,
44
- IUSDZAPI
45
- } from './usdz'
36
+ IUSDZMarketValuationInfo,
37
+ } from './usdz'
38
+ export type {
39
+ IZLPAPI,
40
+ IZLPDataAPI,
41
+ IZLPMarketValuationInfo,
42
+ } from './zlp'
@@ -3,28 +3,29 @@
3
3
  * Extends base interfaces with SLP-specific implementations for Sudo SDK
4
4
  */
5
5
 
6
- import { Transaction } from '@mysten/sui/transactions'
6
+ import type { KioskClient, KioskOwnerCap } from '@mysten/kiosk'
7
+ import type { Transaction } from '@mysten/sui/transactions'
8
+
7
9
  import type {
8
- IBaseMarketValuationInfo,
9
- IBaseVaultInfo,
10
- IBaseSymbolInfo,
11
- IBaseMarketInfo,
12
- IBasePositionInfo,
13
- IBaseOrderInfo,
14
- IBaseHistory,
15
- IBaseStakePool,
10
+ IBaseAPI,
16
11
  IBaseCredential,
17
12
  IBaseDataAPI,
18
- IBaseAPI,
19
- IBasePositionCapInfo,
13
+ IBaseFundingFeeModel,
14
+ IBaseHistory,
15
+ IBaseMarketInfo,
16
+ IBaseMarketValuationInfo,
20
17
  IBaseOrderCapInfo,
21
- IBaseStaked,
18
+ IBaseOrderInfo,
19
+ IBasePositionCapInfo,
22
20
  IBasePositionConfig,
23
- IBaseFundingFeeModel,
21
+ IBasePositionInfo,
22
+ IBaseRebaseFeeModel,
24
23
  IBaseReservingFeeModel,
25
- IBaseRebaseFeeModel
24
+ IBaseStaked,
25
+ IBaseStakePool,
26
+ IBaseSymbolInfo,
27
+ IBaseVaultInfo,
26
28
  } from './base'
27
- import { KioskClient, KioskOwnerCap } from '@mysten/kiosk'
28
29
 
29
30
  // SLP-specific interfaces
30
31
  export interface ISLPMarketValuationInfo extends IBaseMarketValuationInfo { }
@@ -140,17 +141,17 @@ export interface ISudoStakeCredential {
140
141
  // SLP-specific data API interface
141
142
  export interface ISLPDataAPI extends IBaseDataAPI {
142
143
  // SLP-specific data api methods can be added here
143
- getCumulativeApr(): Promise<number>
144
+ getCumulativeApr: () => Promise<number>
144
145
  }
145
146
 
146
147
  // SLP-specific API interface
147
148
  export interface ISLPAPI extends IBaseAPI {
148
149
  // SLP-specific api methods can be added here
149
- claimTokenFromSCard(
150
+ claimTokenFromSCard: (
150
151
  token: string,
151
152
  coinObjects: string[],
152
153
  kioskClient: KioskClient,
153
154
  kioskCap: KioskOwnerCap,
154
155
  scard: string
155
- ): Promise<Transaction>
156
- }
156
+ ) => Transaction
157
+ }
@@ -4,23 +4,23 @@
4
4
  */
5
5
 
6
6
  import type {
7
- IBaseMarketValuationInfo,
8
- IBaseVaultInfo,
9
- IBaseSymbolInfo,
10
- IBaseMarketInfo,
11
- IBasePositionInfo,
12
- IBaseOrderInfo,
13
- IBaseHistory,
14
- IBaseStakePool,
7
+ IBaseAPI,
15
8
  IBaseCredential,
16
9
  IBaseDataAPI,
17
- IBaseAPI,
18
10
  IBaseFundingFeeModel,
19
- IBasePositionConfig,
11
+ IBaseHistory,
12
+ IBaseMarketInfo,
13
+ IBaseMarketValuationInfo,
14
+ IBaseOrderCapInfo,
15
+ IBaseOrderInfo,
20
16
  IBasePositionCapInfo,
17
+ IBasePositionConfig,
18
+ IBasePositionInfo,
19
+ IBaseRebaseFeeModel,
21
20
  IBaseReservingFeeModel,
22
- IBaseOrderCapInfo,
23
- IBaseRebaseFeeModel
21
+ IBaseStakePool,
22
+ IBaseSymbolInfo,
23
+ IBaseVaultInfo,
24
24
  } from './base'
25
25
 
26
26
  // USDZ-specific interfaces
@@ -68,4 +68,4 @@ export interface IUSDZCredential extends IBaseCredential {
68
68
  export interface IUSDZDataAPI extends IBaseDataAPI { }
69
69
 
70
70
  // USDZ-specific API interface
71
- export interface IUSDZAPI extends IBaseAPI { }
71
+ export interface IUSDZAPI extends IBaseAPI { }
@@ -4,24 +4,25 @@
4
4
  */
5
5
 
6
6
  import type { Transaction } from '@mysten/sui/transactions'
7
+
7
8
  import type {
8
- IBaseMarketValuationInfo,
9
- IBaseVaultInfo,
10
- IBaseSymbolInfo,
11
- IBaseMarketInfo,
12
- IBasePositionInfo,
13
- IBaseOrderInfo,
14
- IBaseHistory,
15
- IBaseStakePool,
9
+ IBaseAPI,
16
10
  IBaseCredential,
17
11
  IBaseDataAPI,
18
- IBaseAPI,
19
12
  IBaseFundingFeeModel,
20
- IBasePositionConfig,
13
+ IBaseHistory,
14
+ IBaseMarketInfo,
15
+ IBaseMarketValuationInfo,
16
+ IBaseOrderCapInfo,
17
+ IBaseOrderInfo,
21
18
  IBasePositionCapInfo,
19
+ IBasePositionConfig,
20
+ IBasePositionInfo,
21
+ IBaseRebaseFeeModel,
22
22
  IBaseReservingFeeModel,
23
- IBaseOrderCapInfo,
24
- IBaseRebaseFeeModel
23
+ IBaseStakePool,
24
+ IBaseSymbolInfo,
25
+ IBaseVaultInfo,
25
26
  } from './base'
26
27
 
27
28
  // ZLP-specific interfaces
@@ -70,27 +71,27 @@ export interface IZLPDataAPI extends IBaseDataAPI { }
70
71
 
71
72
  // ZLP-specific API interface
72
73
  export interface IZLPAPI extends IBaseAPI {
73
- adminIssueLootbox(
74
+ adminIssueLootbox: (
74
75
  coin: string,
75
76
  tiers: number[],
76
77
  beneficiaries: string[],
77
78
  amounts: number[],
78
79
  tx: Transaction,
79
- ): Promise<void>
80
+ ) => void
80
81
 
81
- depositToPrizePool(
82
+ depositToPrizePool: (
82
83
  coin: string,
83
84
  coinObjects: string[],
84
85
  amount: number,
85
- ): Promise<Transaction>
86
+ ) => Transaction
86
87
 
87
- withdrawFromPricePool(
88
+ withdrawFromPricePool: (
88
89
  coin: string,
89
90
  amount: number
90
- ): Promise<Transaction>
91
+ ) => Transaction
91
92
 
92
- openLootbox(
93
+ openLootbox: (
93
94
  coin: string,
94
95
  lootbox: string
95
- ): Promise<Transaction>
96
- }
96
+ ) => Transaction
97
+ }