npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cetusprotocol/cetus-xcetus-sdk

v0.0.2

Published

SDK for cetus xcetus

Downloads

208

Readme

xCETUS Docs

xCETUS Platform equity tokens are non-circulating currencies and cannot be transferred by default. They are recorded in the user's veNFT account in the form of points. How to obtain them:

  1. Convert 1 CETUS to 1 xCETUS Mint.
  2. LP NFT lock-up mining rewards released. xCETUS can be transferred under certain circumstances: to prevent special circumstances, only the platform has this permission.

veNFT Store xCETUS in NFT (non-transferable) form under user account Holding xCETUS can participate in cetus reward dividends, which will be distributed according to the proportion of the number of xCETUS in the wallet account veNFT to the total xCETUS in the market.

xCETUS SDK - TS

Github Link: https://github.com/CetusProtocol/cetus-xcetus-sdk

NPM Link: @cetusprotocol/cetus-xcetus-sdk

features

1. mint VeNFT.

    sdk.XCetusModule.mintVeNFTPayload()

2. getOwnerVeNFT.

    const ownerVeNFT = await sdk.XCetusModule.getOwnerVeNFT(sendKeypair.getPublicKey().toSuiAddress())

    // ownerVeNFT
    {
        creator: 'Cetus',
        escription: "A non-transferrable NFT storing Cetus Escrowed Token xCETUS that represents a user's governance power on Cetus Protocol.",
        image_url: 'https://x77unmxbojk6nincdlzd57hhk5qgp5223rrrxrsplqqcs23vu5ja.arweave.net/v_9GsuFyVeahohryPvznV2Bn91rcYxvGT1wgKWt1p1I',
        link: 'https://app.cetus.zone',
        name: 'Cetus veNFT #14562',
        project_url: 'https://www.cetus.zone',
        id: '0x12adbc7e726cf2a5a9d4c4f0bdd08b6a49c876be99b2e650778a68d3891584bc',
        index: '14562',
        type: '0x9e69acc50ca03bc943c4f7c5304c2a6002d507b51c11913b247159c60422c606::xcetus::VeNFT',
        xcetus_balance: '1000000000'
    }

2. Convert Cetus to Xcetus

    sdk.XCetusModule.convertPayload({amount: '10000000000',venft_id})

3. redeemLock

    const lock_day = 15
    const amountInput = 20000
    const amount = await sdk.XCetusModule.redeemNum(amountInput, n)
    sdk.XCetusModule.redeemLockPayload({
      venft_id: venft_id,
      amount,
      lock_day,
    })

4. getOwnerRedeemLockList

    sdk.XCetusModule.getOwnerRedeemLockList(sendKeypair.getPublicKey().toSuiAddress())

    RedeemLockList:  [
      {
        id: '0x005ba9202a5d9e41c73155a1b4e473a0283191954fb47fe3f927c7026aefec40',
        type: '0x9e69acc50ca03bc943c4f7c5304c2a6002d507b51c11913b247159c60422c606::lock_coin::LockedCoin<0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS>',
        locked_start_time: 1730442744,
        locked_until_time: 1745994744,
        cetus_amount: '500000000',
        xcetus_amount: '500000000',
        lock_day: 180
      }
    ]

5. redeem

    const lock_id = '0x005ba9202a5d9e41c73155a1b4e473a0283191954fb47fe3f927c7026aefec40'
    const lockCetus = await sdk.XCetusModule.getLockCetus(lock_id)

    if (lockCetus && XCetusUtil.isLocked(lockCetus)) {
      const payload = sdk.XCetusModule.redeemPayload({
        venft_id: venft_id,
        lock_id: lock_id,
      })
    }

6. cancelRedeemPayload

    const lock_id = '0x005ba9202a5d9e41c73155a1b4e473a0283191954fb47fe3f927c7026aefec40'
    const lockCetus = await sdk.XCetusModule.getLockCetus(lock_id)

    if (lockCetus && XCetusUtil.isLocked(lockCetus)) {
      const payload = sdk.XCetusModule.cancelRedeemPayload({
        venft_id: venft_id,
        lock_id: lock_id,
      })
    }

7. getVeNFTDividendInfo

   const { venft_dividends_id_v2 } = getPackagerConfigs(sdk.sdkOptions.xcetus_dividends)

   const dividendManager = await sdk.XCetusModule.getDividendManager()
   const veNFTDividendInfo = await sdk.XCetusModule.getVeNFTDividendInfo(
     dividendManager.venft_dividends.id,
     venft_dividends_id_v2,
     venft_id
   )

8. redeemDividendV3Payload

  const dividendManager = await sdk.XCetusModule.getDividendManager()
  const { venft_dividends_id_v2 } = getPackagerConfigs(sdk.sdkOptions.xcetus_dividends)

  const veNFTDividendInfo: any = await sdk.XCetusModule.getVeNFTDividendInfo(
    dividendManager.venft_dividends.id,
    venft_dividends_id_v2,
    venft_id
  )

  const bonus_types = XCetusUtil.buildDividendRewardTypeList(veNFTDividendInfo.rewards)
  const bonus_types_v2 = XCetusUtil.buildDividendRewardTypeListV2(veNFTDividendInfo.rewards)

  const phases: any = []
  veNFTDividendInfo.rewards.forEach((reward: any) => {
    if (reward.vesrion == 'v2') {
        phases.push(reward.period)
    }
  })
  await sdk.XCetusModule.redeemDividendV3Payload(phases, venft_id, bonus_types,bonus_types_v2, [
    sdk.XCetusModule.buileXTokenCoinType(),
  ])