账户、基金与策略账簿
原能力
分别管理账户、基金和策略账簿,按权限和环境隔离正式事实。(合同附件 R7 13.1)
首选项目
Formance Ledger(MIT)。 Formance Ledger
匹配范围
多资产双记账与原子转账对象。
源码
Formance Ledger · func (s *Server) handleCreateTransaction(
internal/adapter/http/handlers_create_transaction.go · 13–26 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
func (s *Server) handleCreateTransaction(w http.ResponseWriter, r *http.Request) {
ledgerName, ok := requireLedgerName(w, r)
if !ok {
return
}
// Decode request body into protobuf CreateTransactionPayload.
// The custom UnmarshalJSON in service.pb.json.go drives field naming
// from the public camelCase contract (scriptReference, accountMetadata,
// …) — the default protoc-gen-go tags are snake_case and would silently
// drop multi-word keys (#452).
req := &servicepb.CreateTransactionPayload{}
err := json.UnmarshalRead(r.Body, req)
实现与验收要点
原账户、基金、策略账的权威事实和隔离。