Skip to content

Conversation

@jackburrus
Copy link
Contributor

@jackburrus jackburrus commented Feb 7, 2025

This PR updates the SDK to keep track of close long positions handled by the zap contract.

@changeset-bot
Copy link

changeset-bot bot commented Feb 7, 2025

🦋 Changeset detected

Latest commit: a68de25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@delvtech/hyperdrive-js Patch
@delvtech/hyperdrive-viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hyperdrive-mainnet-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 9:00pm
hyperdrive-sepolia-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 9:00pm
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
hyperdrive-js ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2025 9:00pm
hyperdrive-mainnet-production ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2025 9:00pm
hyperdrive-sepolia-production ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2025 9:00pm
testnet-v1 ⬜️ Ignored (Inspect) Feb 7, 2025 9:00pm
testnet-v1.0.6 ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2025 9:00pm
trading-competition ⬜️ Ignored (Inspect) Visit Preview Feb 7, 2025 9:00pm


export const publicClient: PublicClient = createPublicClient({
transport: http(process.env.RPC_URL),
chain: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like the update to viem now requires an explicit chain.

Copy link
Contributor

@DannyDelott DannyDelott left a comment

Choose a reason for hiding this comment

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

Nice!

/**
* The optional address of an auxiliary contract such as a zap contract.
*/
readonly auxiliaryContractAddress?: Address;
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Since this is only used for zapping logic, let's just call this zapContractAddress so it's more clear for now.

});

const longsReceived = transfersReceived.filter((event) => {
const isLongEvent = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be broken out to a function in module scope?

@jackburrus jackburrus merged commit 722047a into main Feb 7, 2025
15 checks passed
@jackburrus jackburrus deleted the sdk-updates-for-zaps branch February 7, 2025 21:02
@DannyDelott DannyDelott mentioned this pull request Feb 10, 2025
3 tasks
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