Balance Position Report (§20): позиция на момент at
Считается из ledger, а не из текущих балансов — поэтому цифра за прошлый период не «плывёт» при последующих операциях
curl -X GET "https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/reports/balance_position?at=example_string&tokenIds=example_string&addressIds=123%20Main%20St&folderIds=example_string&userId=example_string&includeShared=true" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/reports/balance_position?at=example_string&tokenIds=example_string&addressIds=123%20Main%20St&folderIds=example_string&userId=example_string&includeShared=true"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/reports/balance_position?at=example_string&tokenIds=example_string&addressIds=123%20Main%20St&folderIds=example_string&userId=example_string&includeShared=true", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/reports/balance_position?at=example_string&tokenIds=example_string&addressIds=123%20Main%20St&folderIds=example_string&userId=example_string&includeShared=true", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://policy-engine-rest.ezig.workers.dev/api/v1/vaults/demo_vault/reports/balance_position?at=example_string&tokenIds=example_string&addressIds=123%20Main%20St&folderIds=example_string&userId=example_string&includeShared=true')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"report": {
"id": "example_string",
"type": "example_string",
"from": "example_string",
"to": "example_string",
"timezone": "example_string",
"dateBasis": "example_string",
"baseCurrency": "example_string",
"classificationMode": "example_string",
"dataCutoff": "example_string",
"schemaVersion": "example_string",
"generatedAt": "example_string",
"generatedById": "example_string"
},
"summary": {
"operationsCount": 3.14,
"incomingCount": 3.14,
"outgoingCount": 3.14,
"incomingUsd": "example_string",
"outgoingUsd": "example_string",
"grossTurnoverUsd": "example_string",
"netFlowUsd": "example_string",
"incomingAmountByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"outgoingAmountByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"grossTurnoverByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"netFlowByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"averageAmountByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"medianAmountByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"minimumAmountByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"maximumAmountByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"confirmedCount": 3.14,
"pendingCount": 3.14,
"awaitingApprovalCount": 3.14,
"rejectedCount": 3.14,
"cancelledCount": 3.14,
"failedCount": 3.14,
"activeDays": 3.14,
"firstOperationAt": "example_string",
"lastOperationAt": "example_string"
},
"byAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"incoming": "example_string",
"outgoing": "example_string",
"netFlow": "example_string",
"grossTurnover": "example_string",
"incomingUsd": "example_string",
"outgoingUsd": "example_string",
"netFlowUsd": "example_string",
"grossTurnoverUsd": "example_string",
"operationsCount": 3.14,
"incomingCount": 3.14,
"outgoingCount": 3.14,
"averageAmount": "example_string",
"medianAmount": "example_string",
"minimumAmount": "example_string",
"maximumAmount": "example_string"
}
],
"byCounterparty": [
{
"counterpartyId": "example_string",
"name": "John Doe",
"kind": "example_string",
"incomingByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"outgoingByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"grossTurnoverUsd": "example_string",
"netFlowUsd": "example_string",
"operationsCount": 3.14
}
],
"byOwnAddress": [
{
"addressId": "123 Main St",
"address": "123 Main St",
"label": "example_string",
"derivationPath": "example_string",
"segments": {},
"folderSnapshots": [
"null"
],
"incomingByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"outgoingByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"grossTurnoverUsd": "example_string",
"operationsCount": 3.14
}
],
"byStatus": [
{
"status": "example_string",
"count": 3.14,
"amountsByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"usdValue": "example_string"
}
],
"byCategory": [
{
"category": "example_string",
"count": 3.14,
"incomingByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"outgoingByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"usdValue": "example_string"
}
],
"byAddressOwner": [
{
"ownerId": "example_string",
"owner": {},
"isMe": true,
"operationsCount": 3.14,
"grossTurnoverUsd": "example_string"
}
],
"timeline": [
{
"periodStart": "example_string",
"periodEnd": "example_string",
"incomingByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"outgoingByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"netFlowByAsset": [
{
"tokenId": "example_string",
"assetCode": "example_string",
"assetSymbol": "example_string",
"network": "example_string",
"contractAddress": "123 Main St",
"amount": "example_string"
}
],
"incomingUsd": "example_string",
"outgoingUsd": "example_string",
"netFlowUsd": "example_string",
"operationsCount": 3.14
}
],
"approvals": {
"operationsRequiringApproval": 3.14,
"approvedOperations": 3.14,
"rejectedOperations": 3.14,
"cancelledOperations": 3.14,
"pendingOperations": 3.14,
"averageApprovalSeconds": 3.14,
"medianApprovalSeconds": 3.14,
"maximumApprovalSeconds": 3.14
},
"observations": [
{
"code": "example_string",
"severity": "example_string",
"title": "example_string",
"description": "example_string",
"metric": "example_string",
"currentValue": "example_string",
"comparisonValue": "example_string",
"changePercent": 3.14,
"drilldownFilters": {}
}
],
"dataQuality": {
"totalOperations": 3.14,
"unmatchedOperations": 3.14,
"retroactivelyMatchedOperations": 3.14,
"operationsWithoutUsdRate": 3.14,
"operationsWithoutSelectedDate": 3.14,
"operationsWithoutBlockchainTime": 3.14,
"operationsWithoutPaymentPurpose": 3.14,
"operationsWithoutBusinessReference": 3.14,
"uncategorizedOperations": 3.14,
"conflictingCounterpartyClassifications": 3.14,
"invalidOperationRelations": 3.14,
"missingLedgerEntries": 3.14,
"ledgerReconciliationDifferences": 3.14
},
"comparison": {
"mode": "example_string",
"previousFrom": "example_string",
"previousTo": "example_string",
"incomingUsdChangePercent": 3.14,
"outgoingUsdChangePercent": 3.14,
"grossTurnoverUsdChangePercent": 3.14,
"operationsCountChangePercent": 3.14,
"averageOperationUsdChangePercent": 3.14
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
GET
/api/v1/vaults/{code}/reports/balance_positionGET
Base URLstring
Target server for requests. Edit to use your own host.
Bearer Token
Bearer Tokenstring
Requiredbetter-auth session token. Мобилка/сервисы. Веб использует cookie.
better-auth session token. Мобилка/сервисы. Веб использует cookie.
API Key (cookie: better-auth.session_token)
better-auth.session_tokenstring
RequiredAPI key (sent in cookie)
path
codestring
RequiredУникальный код Vault'а (slug)
Request Preview
Response
Response will appear here after sending the request
Authentication
header
Authorizationstring
RequiredBearer token. better-auth session token. Мобилка/сервисы. Веб использует cookie.
path
parameterstring
RequiredAPI Key for authentication. Provide your API key in the cookie.
Path Parameters
Query Parameters
Responses
reportobject
Requiredsummaryobject
byAssetarray
byCounterpartyarray
byOwnAddressarray
byStatusarray
byCategoryarray
byAddressOwnerarray
timelinearray
approvalsobject
observationsarray
dataQualityobject
comparisonstring
Was this page helpful?