sync sub-module handles bulk migration of customer data between your existing systems and Trusset. It is designed for institutions with established customer databases that need to onboard thousands of records without manual entry.
Records are mapped by externalId - your system’s unique customer identifier. This key is used for deduplication and conflict resolution across syncs.
Import records
externalId. If a match is found, the onConflict strategy determines the outcome.
Conflict strategies
| Strategy | Behavior |
|---|---|
update | Overwrites name, country, investorType, walletAddress, and metadata on the existing record. Default. |
skip | Leaves the existing record untouched. Counted in result.skipped. |
With on-chain verification
SetverifyOnChain: true to automatically batch-verify imported records that have both a walletAddress and a country. This runs after the database import completes and requires a configured relayer.
result.errors with code VERIFY_FAILED.
Export records
Pull all customer data back out as flatSyncRecord objects. Useful for syncing Trusset state back into your core systems or for audit purposes.
SyncRecord schema
Every record requiresexternalId. All other fields are optional.
Error handling
Import errors are collected per-record rather than failing the entire batch. Theerrors array in the result contains one entry per failed record:
| Code | Cause |
|---|---|
INVALID_ADDRESS | Wallet address failed checksum validation |
CUSTOMER_EXISTS | Duplicate wallet address (different externalId) |
VERIFY_FAILED | On-chain batch verification failed for this entry |
UNKNOWN | Unexpected server error - check message for details |
