mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
3.8 KiB
3.8 KiB
\TreasuryAPI
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| GetTreasury | Get /v1/treasury | Returns the reserve fund's health and the current revenue-share policy for any validated caller. |
| GetTreasuryAccounts | Get /v1/treasury/accounts | Returns the ledger accounts the caller may see, with their balances. |
GetTreasury
TreasuryTreasuryReport GetTreasury(ctx).Execute()
Returns the reserve fund's health and the current revenue-share policy for any validated caller.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TreasuryAPI.GetTreasury(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TreasuryAPI.GetTreasury``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTreasury`: TreasuryTreasuryReport
fmt.Fprintf(os.Stdout, "Response from `TreasuryAPI.GetTreasury`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiGetTreasuryRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetTreasuryAccounts
TreasuryAccountsOut GetTreasuryAccounts(ctx).Scope(scope).Org(org).Execute()
Returns the ledger accounts the caller may see, with their balances.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
scope := "scope_example" // string | Scope is \"house\" to read the reserve/revenue/payout house accounts. SuperAdmin only. (optional)
org := "org_example" // string | Org names another tenant to read. SuperAdmin only; ignored when scope=house. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TreasuryAPI.GetTreasuryAccounts(context.Background()).Scope(scope).Org(org).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TreasuryAPI.GetTreasuryAccounts``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTreasuryAccounts`: TreasuryAccountsOut
fmt.Fprintf(os.Stdout, "Response from `TreasuryAPI.GetTreasuryAccounts`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiGetTreasuryAccountsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| scope | string | Scope is "house" to read the reserve/revenue/payout house accounts. SuperAdmin only. | |
| org | string | Org names another tenant to read. SuperAdmin only; ignored when scope=house. |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]