Open Cap Table Protocol Canton SDK - v0.2.224
    Preparing search index...

    Function computeReplicationDiff

    • Compute what needs to be synced to Canton.

      Compares a list of source items (desired state) against Canton state (actual state) and returns operations needed to synchronize them.

      Parameters

      Returns ReplicationDiff

      Replication diff with creates, edits, and deletes

      const sourceItems = [
      { ocfId: 'stakeholder-1', entityType: 'stakeholder', data: {...} },
      { ocfId: 'stock-class-1', entityType: 'stockClass', data: {...} },
      ];
      const cantonState = await getCapTableState(client, issuerPartyId);
      const diff = computeReplicationDiff(sourceItems, cantonState, { syncDeletes: true });
      // diff.creates = items in source but not Canton
      // diff.deletes = items in Canton but not source