Skip to content

Conversation

tejasbadadare
Copy link
Contributor

Summary

Create a Lazer Sui SDK to enable users to create txns to parse and verify Lazer payloads on-chain.

  • Current limitation: Since the Lazer Sui contract doesn't support upgradeability yet, the packageId isn't automatically handled by the SDK. This will be added once we handle upgrades in the Sui contract.

Testing

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code
    • Tested local build, will e2e test when the Lazer Sui contract is ready to test on devnet

devin-ai-integration bot and others added 17 commits August 29, 2025 23:00
…dsa_update; add workspace entry and docs

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…ModuleInterop/skipLibCheck

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…t-config

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…int-config

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…-config path

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…JS and eslint.config.js in lint

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…fig and in-file ignores

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…; fix types/imports; remove deprecated .eslintignore

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
… Lazer update -> Sui PTB composition

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…dd runnable example instructions

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…tion to SuiRelay example

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…x imports and README flags

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…te script and README

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
@tejasbadadare tejasbadadare requested a review from a team as a code owner September 4, 2025 01:45
Copy link

vercel bot commented Sep 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
api-reference Error Error Sep 5, 2025 0:21am
component-library Ready Ready Preview Comment Sep 5, 2025 0:21am
developer-hub Ready Ready Preview Comment Sep 5, 2025 0:21am
entropy-explorer Ready Ready Preview Comment Sep 5, 2025 0:21am
insights Ready Ready Preview Comment Sep 5, 2025 0:21am
proposals Ready Ready Preview Comment Sep 5, 2025 0:21am
staking Ready Ready Preview Comment Sep 5, 2025 0:21am

@vercel vercel bot temporarily deployed to Preview – staking September 4, 2025 01:49 Inactive
@vercel vercel bot temporarily deployed to Preview – api-reference September 4, 2025 01:49 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer September 4, 2025 01:49 Inactive
@vercel vercel bot temporarily deployed to Preview – insights September 4, 2025 01:49 Inactive
@vercel vercel bot temporarily deployed to Preview – developer-hub September 4, 2025 01:49 Inactive
@vercel vercel bot temporarily deployed to Preview – component-library September 4, 2025 01:49 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals September 4, 2025 01:49 Inactive
@tejasbadadare tejasbadadare changed the title feat(lazer/sui/js): Init Lazer Sui SDK feat(pyth-lazer-sui-js): Init Lazer Sui SDK Sep 4, 2025
Copy link
Collaborator

@cprussin cprussin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest referring to a newer package like the component library or the sessions sdk for a good example of scaffolding a new package. It looks like a lot of what's in this PR is copied out of legacy packages that aren't well configured and have a lot of small issues. Let me know if it would help to pair up on this and I'm happy to lend a hand

@vercel vercel bot temporarily deployed to Preview – api-reference September 4, 2025 23:10 Inactive
@vercel vercel bot temporarily deployed to Preview – staking September 4, 2025 23:10 Inactive
@vercel vercel bot temporarily deployed to Preview – insights September 4, 2025 23:10 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer September 4, 2025 23:10 Inactive
@vercel vercel bot temporarily deployed to Preview – component-library September 4, 2025 23:10 Inactive
@vercel vercel bot temporarily deployed to Preview – developer-hub September 4, 2025 23:10 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals September 4, 2025 23:10 Inactive
Copy link
Collaborator

@cprussin cprussin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to change the subpath exports so that you're also exporting the cjs you build but other than that looks great!

import { Transaction } from "@mysten/sui/transactions";
import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";

const MAX_ARGUMENT_SIZE = 16 * 1024;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super minor and not worth changing, but one thing I really like to do with consts like this is break them down with units so it's super easy to understand where the numbers come from, e.g. something like this:

const ONE_KIBIBYTE_IN_BYTES = 1024;
const MAX_ARGUMENT_SIZE_IN_BYTES = 16 * ONE_KIBIBYTE_IN_BYTES;

(I'm assuming that's where 1024 comes from but I don't know where 16 comes from)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually realized this might be an old requirement imposed by WH, idt we need it anymore

tx: Transaction;
packageId: string;
stateObjectId: string;
updateBytes: Buffer;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that Buffer is not available in browsers without a polyfill, you might want to consider using Uint8Array instead which is a superclass of Buffer and would make the code more easily isomorphic, if that's something you care about and you aren't using anything specific to Buffer (I don't think you are)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh ok cool. Sui examples use Buffer but idt it's actually needed by their API.

Copy link
Collaborator

@ali-behjati ali-behjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants