Upgraded from "@mysten/sui.js": "0.54.1" to "@mysten/sui": "1.3.0"
Parameter Updates:
Removed: size, collateralAmount, reserveAmount (all bigint)
size
collateralAmount
reserveAmount
Added: leverage (number), collateral (number), positionConfig (IPositionConfig)
leverage
collateral
positionConfig
Calculation Approach:
Position size and reserve amount now calculated internally based on leverage and collateral
Return Type:
Changed from Promise<TransactionBlock> to implicit Promise<Transaction>
Promise<TransactionBlock>
Promise<Transaction>
More intuitive position opening with leverage-based calculations
Increased flexibility with positionConfig
Less pre-processing and calculation required from the caller
Potential breaking changes due to major Sui SDK upgrade
Last updated 1 year ago