SpringSui Integration

Links to relevant SpringSui codebase.

Typescript monorepo (frontend, sdk, cli): https://github.com/solendprotocol/springsui

Smart contracts: https://github.com/solendprotocol/liquid-staking

The cli has examples of calling every single instruction in the springsui smart contracts.

Click here to access the SpringSui Github repo.

Examples

Minting sSui

const LIQUID_STAKING_INFO = {
  id: "0x15eda7330c8f99c30e430b4d82fd7ab2af3ead4ae17046fcb224aa9bad394f6b",
  type: "0x83556891f4a0f233ce7b05cfe7f957d4020492a34f5405b2cb9377d060bef4bf::spring_sui::SPRING_SUI",
  weightHookId:
    "0xbbafcb2d7399c0846f8185da3f273ad5b26b3b35993050affa44cfa890f1f144",
};

const client = new SuiClient({ url: RPC_URL });
const lstClient = await LstClient.initialize(client, LIQUID_STAKING_INFO);

const tx = new Transaction();
const [sui] = tx.splitCoins(tx.gas, [BigInt(options.amount)]);
const sSui = lstClient.mint(tx, sui);
tx.transferObjects([sSui], keypair.toSuiAddress());

const txResponse = await client.signAndExecuteTransaction({
  transaction: tx,
  signer: keypair,
  options: {
    showEvents: true,
    showEffects: true,
    showObjectChanges: true,
  },
});

Redeeming sSui

Get the exchange rate of sSUI/SUI offchain (using the SDK)

Any other questions? Head to the SpringSui channel on the Suilend Discord.

Last updated