Skip to content

UpdateAccountAssetConfig#67

Open
mihaimarcu2004 wants to merge 1 commit intomainfrom
UpdateAccountAssetConfig
Open

UpdateAccountAssetConfig#67
mihaimarcu2004 wants to merge 1 commit intomainfrom
UpdateAccountAssetConfig

Conversation

@mihaimarcu2004
Copy link
Copy Markdown
Contributor

@mihaimarcu2004 mihaimarcu2004 commented Apr 24, 2026

Summary

Adds a new L2 transaction type, UpdateAccountAssetConfig (tx type 42), which lets an account toggle whether a given asset is used as margin.

Changes:

  • types/txtypes/update_account_asset_config.go: new L2UpdateAccountAssetConfigTxInfo implementing TxInfo — fields AccountIndex, ApiKeyIndex, AssetIndex, AssetMarginMode, ExpiredAt, Nonce, plus validation and Poseidon2 hashing over the standard tx header + asset fields.
  • types/txtypes/constants.go: new TxTypeL2UpdateAccountAssetConfig = 42, plus AccountAssetMarginMode_MarginDisabled = 0 / AccountAssetMarginMode_MarginEnabled = 1.
  • types/txtypes/errors.go: new ErrInvalidAssetMarginMode.
  • types/tx_request.go: new UpdateAccountAssetConfigTxReq request struct and ConstructUpdateAccountAssetConfigTx / ConvertUpdateAccountAssetConfigTx helpers that build, validate, hash, and sign the tx.
  • client/tx_get.go: new TxClient.GetUpdateAccountAssetConfigTransaction entry point.
  • sharedlib/main.go: exports SignUpdateAccountAssetConfig C binding (consumed by the Python SDK).
  • wasm/main.go: exports SignUpdateAccountAssetConfig JS binding with 6 args (assetIndex, assetMarginMode, skipNonce, nonce, apiKeyIndex, accountIndex).

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.

2 participants