Skip to main content

ListTransfers

Lists all transfers within the authenticated group's hierarchical scope. Returns the complete set of transfers accessible to the executing context, including transfers owned by the group and all descendant groups.

Method Options​

Authorisation specification of the ListTransfers method.

TypeMETHOD_TYPE_READ
Access LevelMETHOD_ACCESS_LEVEL_AUTHORISED
Roles
  • ROLE_WALLET_ADMIN
  • ROLE_WALLET_VIEWER
  • ROLE_WALLET_TRANSFER_ADMIN
  • ROLE_WALLET_TRANSFER_VIEWER

Parameters​

Request and response parameter message overview:

Input: ListTransfersRequest Message​

FieldTypeRequiredDescription
Sorting
FieldTypeRequiredDescription
FieldstringFalseField to sort by. Supported values: "number" or empty string for default ordering.
Ordermeshtrade.type.v1.SortingOrderFalseSort order for results.
False

Optional sorting configuration.

Returns: ListTransfersResponse Message​

FieldTypeDescription
Transfers

meshtrade.wallet.transfer.v1.Transfer[]

Code Examples​

Select supported SDK in the language of your choice for a full example of how to invoke the this method:

package main

import (
"context"
"log"

typev1 "github.com/meshtrade/api/go/type/v1"
transferv1 "github.com/meshtrade/api/go/wallet/transfer/v1"
)

func main() {
ctx := context.Background()

// Default configuration is used and credentials come from MESH_API_CREDENTIALS
// environment variable or default discovery methods. Zero config required
// unless you want custom configuration.
service, err := transferv1.NewTransferService()
if err != nil {
log.Fatalf("Failed to create service: %v", err)
}
defer service.Close()

// Create request with optional sorting
request := &transferv1.ListTransfersRequest{
Sorting: &transferv1.ListTransfersRequest_Sorting{
Field: "number", // Sort by transfer number
Order: typev1.SortingOrder_SORTING_ORDER_ASC, // Ascending order
},
}

// Call the ListTransfers method
response, err := service.ListTransfers(ctx, request)
if err != nil {
log.Fatalf("ListTransfers failed: %v", err)
}

// Display all transfers in the hierarchy
log.Printf("Found %d transfers:", len(response.Transfers))
for _, transfer := range response.Transfers {
log.Printf(" Transfer %s:", transfer.Number)
log.Printf(" Name: %s", transfer.Name)
log.Printf(" From: %s", transfer.From)
log.Printf(" To: %s", transfer.To)
log.Printf(" Amount: %s %s", transfer.Amount.Value, transfer.Amount.Token.Code)
log.Printf(" State: %s", transfer.State)
}
}

Advanced Configuration​

For advanced client configuration options (custom endpoints, TLS settings, timeouts), see the SDK Configuration Guide.

Other Methods​