Skip to content

Conversation

@TetrisIsCute
Copy link

@TetrisIsCute TetrisIsCute commented Dec 27, 2025

Summary

  • Add a new Safe wallet example script examples/safeWallet/placeLimitOrder.ts.
  • Demonstrate building a limit order and submitting it via a Safe transaction using the existing helpers and constants.
    Notes
  • Example is configuration-only: users must provide their own RPC URL, private key, Safe address, and market token id in .env/script.
  • No changes to shared library code or existing examples.

Note

Adds a runnable Safe wallet example for placing a limit order.

  • New examples/safeWallet/placeLimitOrder.ts builds a limit order with buildLimitOrder and executes it via signAndExecuteSafeTransaction
  • Uses EXCHANGE_PROXY_ADDRESS, CHAIN_ID, and CLOB_API_URL; constructs SafeTransaction with order calldata
  • Requires user-provided env/config: RPC_URL, PK, safeAddress, and marketTokenId

Written by Cursor Bugbot for commit 4f24f21. This will update automatically on new commits. Configure here.

safe,
tx,
apiUrl: CLOB_API_URL,
});
Copy link

Choose a reason for hiding this comment

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

Wrong function signature for signAndExecuteSafeTransaction call

The signAndExecuteSafeTransaction function is called with an object argument, but the actual function in src/safe-helpers/index.ts expects positional arguments: (signer: Wallet, safe: Contract, txn: SafeTransaction, overrides?). All other examples in the codebase correctly call it as signAndExecuteSafeTransaction(wallet, safe, safeTxn, {gasPrice: ...}). The new code is missing the signer/wallet argument entirely and incorrectly passes an object with non-existent properties like apiUrl. This will cause the script to fail at runtime.

Fix in Cursor Fix in Web

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.

1 participant