MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / Router

Method Router

api/api.go:42–144  ·  view source on GitHub ↗

Router sets up the routes for the API and returns the router instance. Responses: - 200 OK: When the router is successfully set up.

()

Source from the content-addressed store, hash-verified

40// Responses:
41// - 200 OK: When the router is successfully set up.
42func (a Api) Router() *gin.Engine {
43 router := a.router
44
45 // Apply auth middleware to all routes
46 router.Use(a.auth.Authenticate())
47
48 // Ledger routes
49 router.POST("/ledgers", a.CreateLedger)
50 router.GET("/ledgers/:id", a.GetLedger)
51 router.GET("/ledgers", a.GetAllLedgers)
52 router.POST("/ledgers/filter", a.FilterLedgers)
53 router.PUT("/ledgers/:id", a.UpdateLedger)
54
55 // Balance routes
56 router.POST("/balances", a.CreateBalance)
57 router.GET("/balances", a.GetBalances)
58 router.POST("/balances/filter", a.FilterBalances)
59 router.GET("/balances/:id", a.GetBalance)
60 router.GET("/balances/indicator/:indicator/currency/:currency", a.GetBalanceByIndicator)
61 router.GET("/balances/:id/at", a.GetBalanceAtTime)
62 router.POST("/balances-snapshots", a.TakeBalanceSnapshots)
63 router.PUT("/balances/:id/identity", a.UpdateBalanceIdentity)
64 router.GET("/balances/:id/lineage", a.GetBalanceLineage)
65
66 // Balance Monitor routes
67 router.POST("/balance-monitors", a.CreateBalanceMonitor)
68 router.GET("/balance-monitors/:id", a.GetBalanceMonitor)
69 router.GET("/balance-monitors", a.GetAllBalanceMonitors)
70 router.GET("/balance-monitors/balances/:balance_id", a.GetBalanceMonitorsByBalanceID)
71 router.PUT("/balance-monitors/:id", a.UpdateBalanceMonitor)
72
73 // Transaction routes
74 router.POST("/transactions", a.QueueTransaction)
75 router.POST("/transactions/bulk", a.CreateBulkTransactions)
76 router.POST("/transactions/filter", a.FilterTransactions)
77 router.POST("/refund-transaction/:id", a.RefundTransaction)
78 router.GET("/transactions", a.GetAllTransactions)
79 router.GET("/transactions/:id", a.GetTransaction)
80 router.GET("/transactions/reference/:reference", a.GetTransactionByRef)
81 router.PUT("/transactions/inflight/:txID", a.UpdateInflightStatus)
82 router.GET("/transactions/:id/lineage", a.GetTransactionLineage)
83
84 // Recovery routes
85 router.POST("/transactions/recover", a.RecoverQueuedTransactions)
86
87 // Identity routes
88 router.POST("/identities", a.CreateIdentity)
89 router.GET("/identities/:id", a.GetIdentity)
90 router.PUT("/identities/:id", a.UpdateIdentity)
91 router.GET("/identities", a.GetAllIdentities)
92 router.POST("/identities/filter", a.FilterIdentities)
93 router.GET("/identities/:id/tokenized-fields", a.GetTokenizedFields)
94 router.POST("/identities/:id/tokenize/:field", a.TokenizeIdentityField)
95 router.GET("/identities/:id/detokenize/:field", a.DetokenizeIdentityField)
96 router.POST("/identities/:id/tokenize", a.TokenizeIdentity)
97 router.POST("/identities/:id/detokenize", a.DetokenizeIdentity)
98
99 // Account routes

Callers 2

initializeRouterFunction · 0.80
setupRouterFunction · 0.80

Calls 1

AuthenticateMethod · 0.80

Tested by 1

setupRouterFunction · 0.64