Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To get access to the wallet’s funds (to be able to deposit, transfer or withdraw) wallet should contain authenticated user’s or Management API Client ID in the holderIds list.
For updating/deleting the wallet, wallet should contain access control object’s ID in the accessControlIds list that contains ID of the client in the write access section. (See examples for more info)

Wallets management

Code Block
languagepy
from trivoreid.models.wallet import Wallet
from trivoreid.utils.criteria import Filter

# get list of all accessible wallets
page = api.wallet_service.get_all()

# apply parameters and filter to wallets
f = Filter(Filter.LESS_THAN, 'balance', 50)
page = api.wallet_service.get_all(f, start_index=1, count=5, sortBy='name')

# create new wallet
wallet.ownerId = 'userId'
wallet.holderIds.append('holderId')
wallet.accessControlIds.append('accessControlId')

wallet = api.wallet_service.create(wallet)

# update wallet
wallet.name = 'name'
api.wallet_service.update(wallet)

# get wallet
wallet = api.wallet_service.get(wallet.id)

# delete wallet
api.wallet_service.delete(wallet.id)

...