Skip to main content

RemoveSignatoriesFromAccount

Removes the given users as signatories from an account on the ledger.

Returns a transaction reference for monitoring the ledger operation.

Method Options​

Authorisation specification of the RemoveSignatoriesFromAccount method.

TypeMETHOD_TYPE_WRITE
Access LevelMETHOD_ACCESS_LEVEL_AUTHORISED
Roles
  • ROLE_WALLET_ADMIN
  • ROLE_WALLET_ACCOUNT_ADMIN

Parameters​

Request and response parameter message overview:

Input: RemoveSignatoriesFromAccountRequest Message​

FieldTypeRequiredDescription
Name

string

False

The resource name of the account from which signatories should be removed. Format: accounts/{ULIDv2}.

Users

string[]

False

The resource names of the (api)users to remove as signatories from the identified account. Format: api_users/{ULIDv2} or users/{ULIDv2}. At least one user must be provided.

Returns: RemoveSignatoriesFromAccountResponse Message​

FieldTypeDescription
LedgerTransaction

string

Transaction reference for monitoring the ledger operation to remove the given users as signatories. The signatories are removed once this transaction has succeeded. Format: transactions/{ULIDv2}.

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"
"io"
"log"

transaction_v1 "github.com/meshtrade/api/go/ledger/transaction/v1"
account_v1 "github.com/meshtrade/api/go/wallet/account/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.
accountService, err := account_v1.NewAccountService()
if err != nil {
log.Fatalf("Failed to create account service: %v", err)
}
defer accountService.Close()
transactionService, err := transaction_v1.NewTransactionService()
if err != nil {
log.Fatalf("Failed to create transaction service: %v", err)
}
defer transactionService.Close()

// Call the RemoveSignatoriesFromAccount method
// You can remove 1-100 signatories in a single request
response, err := accountService.RemoveSignatoriesFromAccount(
ctx,
&account_v1.RemoveSignatoriesFromAccountRequest{
// Resource name of account to remove identified (api)users as signatories from
Name: "accounts/01HQ3K5M8XYZ2NFVJT9BKR7P4C",
// Resource names of (api)Users to remove as signatories (supports 1-100 users)
Users: []string{
"users/01HN2ZXQJ8K9M0L1N3P2Q4R5T6",
"iam/api_users/01HN2ZXQJ8K9M0L1N3P2Q4R5T7",
"users/01HN2ZXQJ8K9M0L1N3P2Q4R5T8",
},
},
)
if err != nil {
log.Fatalf("RemoveSignatoriesFromAccount failed: %v", err)
}
log.Printf(
"RemoveSignatoriesFromAccount completed successfully with ledger transaction %s submitted",
response.GetLedgerTransaction(),
)

// get a stream to monitor the state of the RemoveSignatoriesFromAccount transaction
stream, err := transactionService.MonitorTransactionState(
ctx,
&transaction_v1.MonitorTransactionStateRequest{
Name: response.GetLedgerTransaction(),
},
)
if err != nil {
log.Fatalf("MonitorTransactionState failed: %v", err)
}
log.Printf("Stream opened to monitor RemoveSignatoriesFromAccount transaction state")

// read from the stream until completion
monitorTransaction:
for {
transactionResponse, err := stream.Recv()
if err == io.EOF {
break // Stream completed normally
}
if err != nil {
// Other errors:
// - timeout of ctx passed to MonitorTransactionState
// - arbitrary network errors
// - other arbitrary errors
log.Fatalf("MonitorTransactionState failed: %v", err)
}

// Process each response as it arrives
log.Printf("Received: %+v", transactionResponse.GetState())

// Check for transaction end state
switch transactionResponse.GetState() {
case transaction_v1.TransactionState_TRANSACTION_STATE_SIGNING_IN_PROGRESS,
transaction_v1.TransactionState_TRANSACTION_STATE_SUBMISSION_IN_PROGRESS,
transaction_v1.TransactionState_TRANSACTION_STATE_INDETERMINATE:
log.Printf("RemoveSignatoriesFromAccount transaction in state %s, keep waiting...", transactionResponse.GetState())

case transaction_v1.TransactionState_TRANSACTION_STATE_SUCCESSFUL:
log.Printf("RemoveSignatoriesFromAccount transaction successful - signatories removed from account")
break monitorTransaction

case transaction_v1.TransactionState_TRANSACTION_STATE_FAILED:
log.Printf("RemoveSignatoriesFromAccount transaction failed")
break monitorTransaction

default:
log.Fatalf("Received unexpected transaction state: %v", transactionResponse.GetState())
}
}
}

Advanced Configuration​

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

Other Methods​