Skip to main content
The manage sub-module handles customer CRUD operations, search, and wallet linking. All operations are scoped to the instance bound to your API key.

Create a customer

Customers can be created with or without a wallet address. When no wallet is provided, the system generates a referenceKey that you can use to link a wallet later.
// With wallet
const customer = await trusset.customers.manage.create({
  walletAddress: '0x1234...abcd',
  name: 'Acme Capital GmbH',
  country: 'DE',
  investorType: 'PROFESSIONAL',
  externalId: 'your-crm-id-4821',
  metadata: { department: 'treasury' },
})

// Without wallet - gets a referenceKey
const pending = await trusset.customers.manage.create({
  name: 'Pending Investor AG',
  country: 'AT',
  externalId: 'crm-9920',
})
// pending.referenceKey -> "ref_a1b2c3d4..."
If the wallet address is already registered on-chain in the IdentityRegistry, the customer status is automatically set to verified. The SDK provides typed search methods that map to different lookup strategies. Each returns a single Customer object or throws a TrussetError with code NOT_FOUND.
// By wallet address
const c1 = await trusset.customers.manage.searchByWallet('0x1234...abcd')

// By your internal ID
const c2 = await trusset.customers.manage.searchByExternalId('crm-4821')

// By reference key (for pre-wallet customers)
const c3 = await trusset.customers.manage.searchByReference('ref_a1b2c3d4...')

// By name (substring match, returns paginated list)
const results = await trusset.customers.manage.searchByName('Acme', {
  limit: 20,
  offset: 0,
})
// results.customers, results.total

List customers

const page = await trusset.customers.manage.list({
  limit: 100,          // 1-200, default 100
  offset: 0,
  search: 'bank',      // Searches name, wallet, externalId, referenceKey
  includeArchived: false,
})
// page.customers: Customer[]
// page.total: number

Update

await trusset.customers.manage.update('customer-id', {
  country: 'CH',
  investorType: 'ELIGIBLE_COUNTERPARTY',
  metadata: { migrated: true },
})
Only provided fields are updated. Omitted fields remain unchanged. For customers created without a wallet address, link one using the referenceKey:
await trusset.customers.manage.linkWallet({
  referenceKey: 'ref_a1b2c3d4...',
  walletAddress: '0x5678...efgh',
})
The wallet address must not already be assigned to another customer in the same instance. If the address is already verified on-chain, the customer status updates to verified automatically.

Archive

Archiving soft-deletes a customer. Archived customers are excluded from list queries by default.
await trusset.customers.manage.archive('customer-id')

Batch country lookup

Retrieve country codes for a list of wallet addresses in a single call. Useful for compliance checks across large holder sets.
const countries = await trusset.customers.manage.batchGetCountries([
  '0xaaa...', '0xbbb...', '0xccc...',
])
// { "0xaaa...": "DE", "0xbbb...": "FR" }
Addresses without a matching customer record are omitted from the result.