AladdinDAO/fx-sdk ? reverse-engineered prompt

Reverse engineered prompt

Build me a TypeScript SDK for the f(x) Protocol on Ethereum.

I want it to make it easy to open, manage, and close leveraged positions for ETH and BTC, and to work with fxUSD and fxSAVE too. It should let me get a user’s positions, increase a position, reduce or close it, change leverage, deposit and mint, repay and withdraw, and handle bridging between Ethereum and Base by first getting a fee quote and then building the transaction to send.

Please include a simple main entry point, useful token addresses, and a few examples that show how to use it with a wallet and RPC URL. If there are any current protocol or chain details that need checking, look them up online first. Make it feel clean and practical, with the important defaults ready to go for mainnet.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab