transact

Thực hiện một giao dịch CVM trên mạng Convex. Sử dụng khi người dùng muốn sửa đổi trạng thái trên chuỗi, gọi hàm actor, hoặc định nghĩa giá trị.

npx skills add https://github.com/convex-dev/convex --skill transact

Execute a Convex Transaction

Transactions modify global state atomically. They consume juice, paid in copper by the origin account, and must be signed.

Source: $ARGUMENTS

See the convex-lisp skill for CVM conventions and error codes.

Authorisation

A transaction requires a key. You have one only if the user has supplied it — a signing-service passphrase, or a raw seed. There is no ambient authority here, so:

  1. User has a key in the signing service — use the MCP signingTransact tool with their address and passphrase.
  2. User has a raw seed — use the MCP transact tool with address and seed.
  3. Neither — you cannot execute. Use prepare to build the unsigned transaction, or the CLI below, and hand it back for the user to sign.

Do not treat case 3 as a blocker to work around. Preparing the transaction and returning it is the correct outcome.

Via the CLI

Works from a built convex.jar and needs no MCP server:

java -jar convex.jar client transact -a #13 '(def my-var 42)'
java -jar convex.jar client transact -a #13 -k <key> -p <keypass> '(transfer #42 1000000000)'

-k / --key selects the key from the keystore and -p / --keypass is its passphrase; --keystore and --storepass select the keystore itself. Add --host / --port for a non-default network.

Common Patterns

TaskSource
Transfer coins(transfer #DEST AMOUNT)
Define a value(def my-var 42)
Call an actor(call #ACTOR (function-name arg1 arg2))
Call a library(@convex.fungible/transfer #TOKEN #DEST AMOUNT)
Set controller(set-controller #ADDR)

Confirm source, destination and amount with the user before executing anything that moves value or changes account control. State what will happen in CVM units, not copper.

Thêm skills từ convex-dev

account
convex-dev
Tạo hoặc kiểm tra các account Convex. Sử dụng khi người dùng muốn thiết lập account mới, kiểm tra chi tiết account, hoặc quản lý keys.
account
convex-dev
Tạo hoặc kiểm tra tài khoản Convex. Sử dụng khi người dùng muốn thiết lập tài khoản mới, kiểm tra chi tiết tài khoản hoặc quản lý khóa.
token
convex-dev
Tạo và quản lý token có thể thay thế trên Convex. Sử dụng khi người dùng muốn tạo token mới, kiểm tra số dư token, hoặc quản lý nguồn cung token.
build-convex
convex-dev
Xây dựng dự án Convex từ mã nguồn. Sử dụng khi một người đóng góp muốn biên dịch, kiểm thử hoặc đóng gói Convex.
convex-db
convex-dev
Sử dụng Convex DB — cơ sở dữ liệu SQL hỗ trợ lattice. Sử dụng khi giúp người dùng viết truy vấn, kết nối qua JDBC hoặc máy khách PostgreSQL, tạo bảng, chèn/truy vấn dữ liệu,…
convex-lisp
convex-dev
Tài liệu tham khảo ngôn ngữ Convex Lisp — quy ước CVM, gọi mã thư viện, định nghĩa actor, mã juice và lỗi. Sử dụng khi viết hoặc gỡ lỗi mã nguồn CVM cho…
deploy
convex-dev
Triển khai một actor (hợp đồng thông minh) lên mạng Convex. Sử dụng khi người dùng muốn tạo một actor trên chuỗi mới với các hàm được xuất.
ecosystem
convex-dev
Định hướng trong hệ sinh thái Convex — thứ gì nằm trong repository nào, specs và docs ở đâu, và những thư viện client nào tồn tại. Sử dụng khi bạn cần ngữ cảnh…