@open-captable-protocol/canton 0.2.192 → 0.2.193
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/functions/OpenCapTable/capTable/getCapTableState.d.ts +66 -0
- package/dist/functions/OpenCapTable/capTable/getCapTableState.d.ts.map +1 -0
- package/dist/functions/OpenCapTable/capTable/getCapTableState.js +145 -0
- package/dist/functions/OpenCapTable/capTable/getCapTableState.js.map +1 -0
- package/dist/functions/OpenCapTable/capTable/index.d.ts +1 -0
- package/dist/functions/OpenCapTable/capTable/index.d.ts.map +1 -1
- package/dist/functions/OpenCapTable/capTable/index.js +5 -1
- package/dist/functions/OpenCapTable/capTable/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/replicationHelpers.d.ts +119 -0
- package/dist/utils/replicationHelpers.d.ts.map +1 -0
- package/dist/utils/replicationHelpers.js +330 -0
- package/dist/utils/replicationHelpers.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query Canton for the current state of a CapTable contract.
|
|
3
|
+
*
|
|
4
|
+
* Provides a snapshot of all OCF entities currently on-chain for an issuer,
|
|
5
|
+
* enabling stateless replication by comparing against database state.
|
|
6
|
+
*
|
|
7
|
+
* @module getCapTableState
|
|
8
|
+
*/
|
|
9
|
+
import type { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
|
|
10
|
+
import type { OcfEntityType } from './batchTypes';
|
|
11
|
+
/**
|
|
12
|
+
* Mapping from CapTable contract field names (snake_case) to OcfEntityType (camelCase).
|
|
13
|
+
*
|
|
14
|
+
* Each field in the CapTable DAML contract is a Map from OCF ID (Text) to ContractId.
|
|
15
|
+
* This mapping allows extraction of entity inventories from the contract payload.
|
|
16
|
+
*
|
|
17
|
+
* Note: planSecurity* types (7 total) are intentionally omitted from this mapping.
|
|
18
|
+
* They are aliases for equityCompensation* types and are stored under equity_compensation_*
|
|
19
|
+
* fields in Canton. The SDK normalizes planSecurity → equityCompensation during upload.
|
|
20
|
+
*/
|
|
21
|
+
export declare const FIELD_TO_ENTITY_TYPE: Record<string, OcfEntityType>;
|
|
22
|
+
/**
|
|
23
|
+
* Current state of a CapTable on Canton, with all OCF IDs grouped by entity type.
|
|
24
|
+
*/
|
|
25
|
+
export interface CapTableState {
|
|
26
|
+
/** Contract ID of the CapTable contract. */
|
|
27
|
+
capTableContractId: string;
|
|
28
|
+
/** Contract ID of the Issuer contract (referenced by the CapTable). */
|
|
29
|
+
issuerContractId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Map of entity type to OCF IDs currently on-chain.
|
|
32
|
+
* Each entry contains all OCF object IDs of that type in the CapTable.
|
|
33
|
+
*/
|
|
34
|
+
entities: Map<OcfEntityType, Set<string>>;
|
|
35
|
+
/**
|
|
36
|
+
* Map of entity type to (OCF ID → Contract ID) for fetching individual contracts.
|
|
37
|
+
* Useful for deep verification where contract data needs to be compared.
|
|
38
|
+
*/
|
|
39
|
+
contractIds: Map<OcfEntityType, Map<string, string>>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Query Canton for the current state of a CapTable.
|
|
43
|
+
*
|
|
44
|
+
* Uses getActiveContracts filtered by party to efficiently retrieve only
|
|
45
|
+
* the CapTable contract for the specified issuer.
|
|
46
|
+
*
|
|
47
|
+
* Note: In the standard deployment model, each issuer party has exactly one
|
|
48
|
+
* active CapTable contract. If multiple CapTable contracts exist for the same
|
|
49
|
+
* party (which would indicate a configuration issue), this function returns
|
|
50
|
+
* the first one found. The system design ensures this is a 1:1 relationship.
|
|
51
|
+
*
|
|
52
|
+
* @param client - LedgerJsonApiClient instance
|
|
53
|
+
* @param issuerPartyId - Party ID of the issuer
|
|
54
|
+
* @returns CapTableState with all OCF IDs on-chain, or null if no CapTable exists
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const state = await getCapTableState(client, 'issuer::party123');
|
|
59
|
+
* if (state) {
|
|
60
|
+
* const stakeholderIds = state.entities.get('stakeholder') ?? new Set();
|
|
61
|
+
* console.log(`${stakeholderIds.size} stakeholders on-chain`);
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function getCapTableState(client: LedgerJsonApiClient, issuerPartyId: string): Promise<CapTableState | null>;
|
|
66
|
+
//# sourceMappingURL=getCapTableState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCapTableState.d.ts","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/capTable/getCapTableState.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAiE9D,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,kBAAkB,EAAE,MAAM,CAAC;IAE3B,uEAAuE;IACvE,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,EAAE,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1C;;;OAGG;IACH,WAAW,EAAE,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAuD/B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Query Canton for the current state of a CapTable contract.
|
|
4
|
+
*
|
|
5
|
+
* Provides a snapshot of all OCF entities currently on-chain for an issuer,
|
|
6
|
+
* enabling stateless replication by comparing against database state.
|
|
7
|
+
*
|
|
8
|
+
* @module getCapTableState
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.FIELD_TO_ENTITY_TYPE = void 0;
|
|
12
|
+
exports.getCapTableState = getCapTableState;
|
|
13
|
+
const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
|
|
14
|
+
/**
|
|
15
|
+
* Mapping from CapTable contract field names (snake_case) to OcfEntityType (camelCase).
|
|
16
|
+
*
|
|
17
|
+
* Each field in the CapTable DAML contract is a Map from OCF ID (Text) to ContractId.
|
|
18
|
+
* This mapping allows extraction of entity inventories from the contract payload.
|
|
19
|
+
*
|
|
20
|
+
* Note: planSecurity* types (7 total) are intentionally omitted from this mapping.
|
|
21
|
+
* They are aliases for equityCompensation* types and are stored under equity_compensation_*
|
|
22
|
+
* fields in Canton. The SDK normalizes planSecurity → equityCompensation during upload.
|
|
23
|
+
*/
|
|
24
|
+
exports.FIELD_TO_ENTITY_TYPE = {
|
|
25
|
+
// Core Objects (7 types)
|
|
26
|
+
stakeholders: 'stakeholder',
|
|
27
|
+
stock_classes: 'stockClass',
|
|
28
|
+
stock_plans: 'stockPlan',
|
|
29
|
+
vesting_terms: 'vestingTerms',
|
|
30
|
+
stock_legend_templates: 'stockLegendTemplate',
|
|
31
|
+
documents: 'document',
|
|
32
|
+
valuations: 'valuation',
|
|
33
|
+
// Stock Class Adjustments (4 types)
|
|
34
|
+
stock_class_authorized_shares_adjustments: 'stockClassAuthorizedSharesAdjustment',
|
|
35
|
+
stock_class_conversion_ratio_adjustments: 'stockClassConversionRatioAdjustment',
|
|
36
|
+
stock_class_splits: 'stockClassSplit',
|
|
37
|
+
issuer_authorized_shares_adjustments: 'issuerAuthorizedSharesAdjustment',
|
|
38
|
+
// Stock Transactions (9 types)
|
|
39
|
+
stock_issuances: 'stockIssuance',
|
|
40
|
+
stock_cancellations: 'stockCancellation',
|
|
41
|
+
stock_transfers: 'stockTransfer',
|
|
42
|
+
stock_acceptances: 'stockAcceptance',
|
|
43
|
+
stock_conversions: 'stockConversion',
|
|
44
|
+
stock_repurchases: 'stockRepurchase',
|
|
45
|
+
stock_reissuances: 'stockReissuance',
|
|
46
|
+
stock_retractions: 'stockRetraction',
|
|
47
|
+
stock_consolidations: 'stockConsolidation',
|
|
48
|
+
// Equity Compensation (8 types)
|
|
49
|
+
equity_compensation_issuances: 'equityCompensationIssuance',
|
|
50
|
+
equity_compensation_cancellations: 'equityCompensationCancellation',
|
|
51
|
+
equity_compensation_transfers: 'equityCompensationTransfer',
|
|
52
|
+
equity_compensation_acceptances: 'equityCompensationAcceptance',
|
|
53
|
+
equity_compensation_exercises: 'equityCompensationExercise',
|
|
54
|
+
equity_compensation_releases: 'equityCompensationRelease',
|
|
55
|
+
equity_compensation_repricings: 'equityCompensationRepricing',
|
|
56
|
+
equity_compensation_retractions: 'equityCompensationRetraction',
|
|
57
|
+
// Convertibles (6 types)
|
|
58
|
+
convertible_issuances: 'convertibleIssuance',
|
|
59
|
+
convertible_cancellations: 'convertibleCancellation',
|
|
60
|
+
convertible_transfers: 'convertibleTransfer',
|
|
61
|
+
convertible_acceptances: 'convertibleAcceptance',
|
|
62
|
+
convertible_conversions: 'convertibleConversion',
|
|
63
|
+
convertible_retractions: 'convertibleRetraction',
|
|
64
|
+
// Warrants (6 types)
|
|
65
|
+
warrant_issuances: 'warrantIssuance',
|
|
66
|
+
warrant_cancellations: 'warrantCancellation',
|
|
67
|
+
warrant_transfers: 'warrantTransfer',
|
|
68
|
+
warrant_acceptances: 'warrantAcceptance',
|
|
69
|
+
warrant_exercises: 'warrantExercise',
|
|
70
|
+
warrant_retractions: 'warrantRetraction',
|
|
71
|
+
// Stock Plan Events (2 types)
|
|
72
|
+
stock_plan_pool_adjustments: 'stockPlanPoolAdjustment',
|
|
73
|
+
stock_plan_return_to_pools: 'stockPlanReturnToPool',
|
|
74
|
+
// Vesting Events (3 types)
|
|
75
|
+
vesting_accelerations: 'vestingAcceleration',
|
|
76
|
+
vesting_events: 'vestingEvent',
|
|
77
|
+
vesting_starts: 'vestingStart',
|
|
78
|
+
// Stakeholder Events (2 types)
|
|
79
|
+
stakeholder_relationship_change_events: 'stakeholderRelationshipChangeEvent',
|
|
80
|
+
stakeholder_status_change_events: 'stakeholderStatusChangeEvent',
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Query Canton for the current state of a CapTable.
|
|
84
|
+
*
|
|
85
|
+
* Uses getActiveContracts filtered by party to efficiently retrieve only
|
|
86
|
+
* the CapTable contract for the specified issuer.
|
|
87
|
+
*
|
|
88
|
+
* Note: In the standard deployment model, each issuer party has exactly one
|
|
89
|
+
* active CapTable contract. If multiple CapTable contracts exist for the same
|
|
90
|
+
* party (which would indicate a configuration issue), this function returns
|
|
91
|
+
* the first one found. The system design ensures this is a 1:1 relationship.
|
|
92
|
+
*
|
|
93
|
+
* @param client - LedgerJsonApiClient instance
|
|
94
|
+
* @param issuerPartyId - Party ID of the issuer
|
|
95
|
+
* @returns CapTableState with all OCF IDs on-chain, or null if no CapTable exists
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const state = await getCapTableState(client, 'issuer::party123');
|
|
100
|
+
* if (state) {
|
|
101
|
+
* const stakeholderIds = state.entities.get('stakeholder') ?? new Set();
|
|
102
|
+
* console.log(`${stakeholderIds.size} stakeholders on-chain`);
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
async function getCapTableState(client, issuerPartyId) {
|
|
107
|
+
// Query for CapTable contract by party
|
|
108
|
+
// Use the DAML-JS package's templateId for compatibility with deployed packages.
|
|
109
|
+
const contracts = await client.getActiveContracts({
|
|
110
|
+
parties: [issuerPartyId],
|
|
111
|
+
templateIds: [open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.CapTable.CapTable.templateId],
|
|
112
|
+
});
|
|
113
|
+
if (contracts.length === 0) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
// Extract payload from the first matching contract
|
|
117
|
+
const capTableContract = contracts[0];
|
|
118
|
+
const contractData = capTableContract;
|
|
119
|
+
const contractId = contractData.contractId ?? contractData.contract_id ?? '';
|
|
120
|
+
const payload = contractData.payload ?? contractData.contract?.payload ?? {};
|
|
121
|
+
// Build entity maps from payload fields
|
|
122
|
+
const entities = new Map();
|
|
123
|
+
const contractIds = new Map();
|
|
124
|
+
for (const [field, entityType] of Object.entries(exports.FIELD_TO_ENTITY_TYPE)) {
|
|
125
|
+
const fieldData = payload[field];
|
|
126
|
+
if (fieldData && typeof fieldData === 'object') {
|
|
127
|
+
// DAML Map is serialized as an object with OCF IDs as keys
|
|
128
|
+
const ocfIdToContractId = fieldData;
|
|
129
|
+
const ocfIds = new Set(Object.keys(ocfIdToContractId));
|
|
130
|
+
if (ocfIds.size > 0) {
|
|
131
|
+
entities.set(entityType, ocfIds);
|
|
132
|
+
contractIds.set(entityType, new Map(Object.entries(ocfIdToContractId)));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// Extract issuer contract ID from payload
|
|
137
|
+
const issuerContractId = typeof payload.issuer === 'string' ? payload.issuer : '';
|
|
138
|
+
return {
|
|
139
|
+
capTableContractId: contractId,
|
|
140
|
+
issuerContractId,
|
|
141
|
+
entities,
|
|
142
|
+
contractIds,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=getCapTableState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCapTableState.js","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/capTable/getCapTableState.ts"],"names":[],"mappings":";AAAA;;;;;;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CAAC,4BAAoB,CAAC,EAAE,CAAC;QACvE,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAEjC,IAAI,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC/C,2DAA2D;YAC3D,MAAM,iBAAiB,GAAG,SAAmC,CAAC;YAC9D,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;YAEvD,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBACpB,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;gBACjC,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;IACH,CAAC;IAED,0CAA0C;IAC1C,MAAM,gBAAgB,GAAG,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAElF,OAAO;QACL,kBAAkB,EAAE,UAAU;QAC9B,gBAAgB;QAChB,QAAQ;QACR,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -4,4 +4,5 @@ export * from './batchTypes';
|
|
|
4
4
|
export { CapTableBatch, buildUpdateCapTableCommand, type CapTableBatchParams } from './CapTableBatch';
|
|
5
5
|
export { convertToDaml } from './ocfToDaml';
|
|
6
6
|
export { ENTITY_DATA_FIELD_MAP, convertToOcf, extractCreateArgument, extractEntityData, getEntityAsOcf, type GetEntityAsOcfResult, type SupportedOcfReadType, } from './damlToOcf';
|
|
7
|
+
export { FIELD_TO_ENTITY_TYPE, getCapTableState, type CapTableState } from './getCapTableState';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/capTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/capTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AAGxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.getEntityAsOcf = exports.extractEntityData = exports.extractCreateArgument = exports.convertToOcf = exports.ENTITY_DATA_FIELD_MAP = exports.convertToDaml = exports.buildUpdateCapTableCommand = exports.CapTableBatch = void 0;
|
|
17
|
+
exports.getCapTableState = exports.FIELD_TO_ENTITY_TYPE = exports.getEntityAsOcf = exports.extractEntityData = exports.extractCreateArgument = exports.convertToOcf = exports.ENTITY_DATA_FIELD_MAP = exports.convertToDaml = exports.buildUpdateCapTableCommand = exports.CapTableBatch = void 0;
|
|
18
18
|
__exportStar(require("./buildCapTableCommand"), exports);
|
|
19
19
|
__exportStar(require("./types"), exports);
|
|
20
20
|
// Batch API exports
|
|
@@ -31,4 +31,8 @@ Object.defineProperty(exports, "convertToOcf", { enumerable: true, get: function
|
|
|
31
31
|
Object.defineProperty(exports, "extractCreateArgument", { enumerable: true, get: function () { return damlToOcf_1.extractCreateArgument; } });
|
|
32
32
|
Object.defineProperty(exports, "extractEntityData", { enumerable: true, get: function () { return damlToOcf_1.extractEntityData; } });
|
|
33
33
|
Object.defineProperty(exports, "getEntityAsOcf", { enumerable: true, get: function () { return damlToOcf_1.getEntityAsOcf; } });
|
|
34
|
+
// CapTable state reader (for replication)
|
|
35
|
+
var getCapTableState_1 = require("./getCapTableState");
|
|
36
|
+
Object.defineProperty(exports, "FIELD_TO_ENTITY_TYPE", { enumerable: true, get: function () { return getCapTableState_1.FIELD_TO_ENTITY_TYPE; } });
|
|
37
|
+
Object.defineProperty(exports, "getCapTableState", { enumerable: true, get: function () { return getCapTableState_1.getCapTableState; } });
|
|
34
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/capTable/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,0CAAwB;AAExB,oBAAoB;AACpB,+CAA6B;AAC7B,iDAAsG;AAA7F,8GAAA,aAAa,OAAA;AAAE,2HAAA,0BAA0B,OAAA;AAClD,yCAA4C;AAAnC,0GAAA,aAAa,OAAA;AAEtB,2CAA2C;AAC3C,yCAQqB;AAPnB,kHAAA,qBAAqB,OAAA;AACrB,yGAAA,YAAY,OAAA;AACZ,kHAAA,qBAAqB,OAAA;AACrB,8GAAA,iBAAiB,OAAA;AACjB,2GAAA,cAAc,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/capTable/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,0CAAwB;AAExB,oBAAoB;AACpB,+CAA6B;AAC7B,iDAAsG;AAA7F,8GAAA,aAAa,OAAA;AAAE,2HAAA,0BAA0B,OAAA;AAClD,yCAA4C;AAAnC,0GAAA,aAAa,OAAA;AAEtB,2CAA2C;AAC3C,yCAQqB;AAPnB,kHAAA,qBAAqB,OAAA;AACrB,yGAAA,YAAY,OAAA;AACZ,kHAAA,qBAAqB,OAAA;AACrB,8GAAA,iBAAiB,OAAA;AACjB,2GAAA,cAAc,OAAA;AAKhB,0CAA0C;AAC1C,uDAAgG;AAAvF,wHAAA,oBAAoB,OAAA;AAAE,oHAAA,gBAAgB,OAAA"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './ocfComparison';
|
|
|
5
5
|
export * from './ocfHelpers';
|
|
6
6
|
export * from './ocfMetadata';
|
|
7
7
|
export * from './planSecurityAliases';
|
|
8
|
+
export * from './replicationHelpers';
|
|
8
9
|
export * from './transactionHelpers';
|
|
9
10
|
export * from './typeConversions';
|
|
10
11
|
export * from './typeGuards';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -21,6 +21,7 @@ __exportStar(require("./ocfComparison"), exports);
|
|
|
21
21
|
__exportStar(require("./ocfHelpers"), exports);
|
|
22
22
|
__exportStar(require("./ocfMetadata"), exports);
|
|
23
23
|
__exportStar(require("./planSecurityAliases"), exports);
|
|
24
|
+
__exportStar(require("./replicationHelpers"), exports);
|
|
24
25
|
__exportStar(require("./transactionHelpers"), exports);
|
|
25
26
|
__exportStar(require("./typeConversions"), exports);
|
|
26
27
|
__exportStar(require("./typeGuards"), exports);
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,qDAAmC;AACnC,oDAAkC;AAClC,kDAAgC;AAChC,+CAA6B;AAC7B,gDAA8B;AAC9B,wDAAsC;AACtC,uDAAqC;AACrC,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,qDAAmC;AACnC,oDAAkC;AAClC,kDAAgC;AAChC,+CAA6B;AAC7B,gDAA8B;AAC9B,wDAAsC;AACtC,uDAAqC;AACrC,uDAAqC;AACrC,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replication helpers for cap table synchronization.
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for:
|
|
5
|
+
* - Mapping database types to SDK entity types
|
|
6
|
+
* - Computing replication diffs between DB and Canton state
|
|
7
|
+
* - Human-readable labels for display
|
|
8
|
+
*
|
|
9
|
+
* @module replicationHelpers
|
|
10
|
+
*/
|
|
11
|
+
import type { OcfEntityType } from '../functions/OpenCapTable/capTable/batchTypes';
|
|
12
|
+
import type { CapTableState } from '../functions/OpenCapTable/capTable/getCapTableState';
|
|
13
|
+
/**
|
|
14
|
+
* Map database type/subtype to OcfEntityType.
|
|
15
|
+
*
|
|
16
|
+
* The database schema uses:
|
|
17
|
+
* - Direct types: STAKEHOLDER, STOCK_CLASS, STOCK_PLAN stored in `type` column
|
|
18
|
+
* - Object subtypes: type='OBJECT', actual type in `subtype` column
|
|
19
|
+
* - Transaction subtypes: type='TRANSACTION', actual type in `subtype` column (TX_ prefix)
|
|
20
|
+
*
|
|
21
|
+
* @param dbType - The database OCF type (STAKEHOLDER, OBJECT, TRANSACTION, etc.)
|
|
22
|
+
* @param dbSubtype - The database subtype for OBJECT and TRANSACTION types
|
|
23
|
+
* @returns The corresponding OcfEntityType, or null if not supported
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* mapDbTypeToEntityType('STAKEHOLDER', null); // 'stakeholder'
|
|
28
|
+
* mapDbTypeToEntityType('OBJECT', 'DOCUMENT'); // 'document'
|
|
29
|
+
* mapDbTypeToEntityType('TRANSACTION', 'TX_STOCK_ISSUANCE'); // 'stockIssuance'
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function mapDbTypeToEntityType(dbType: string, dbSubtype: string | null): OcfEntityType | null;
|
|
33
|
+
/**
|
|
34
|
+
* Get a human-readable label for an entity type with count.
|
|
35
|
+
*
|
|
36
|
+
* @param type - The OcfEntityType
|
|
37
|
+
* @param count - The count (determines singular vs plural)
|
|
38
|
+
* @returns Human-readable string like "3 Stock Classes" or "1 Stakeholder"
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* getEntityTypeLabel('stockClass', 1); // "1 Stock Class"
|
|
43
|
+
* getEntityTypeLabel('stockClass', 3); // "3 Stock Classes"
|
|
44
|
+
* getEntityTypeLabel('stakeholder', 0); // "0 Stakeholders"
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function getEntityTypeLabel(type: OcfEntityType, count: number): string;
|
|
48
|
+
/**
|
|
49
|
+
* A single item to be synced from DB to Canton.
|
|
50
|
+
*/
|
|
51
|
+
export interface ReplicationItem {
|
|
52
|
+
/** OCF object ID */
|
|
53
|
+
ocfId: string;
|
|
54
|
+
/** Entity type (SDK format) */
|
|
55
|
+
entityType: OcfEntityType;
|
|
56
|
+
/** Operation to perform */
|
|
57
|
+
operation: 'create' | 'edit' | 'delete';
|
|
58
|
+
/** OCF data for create/edit operations */
|
|
59
|
+
data?: unknown;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Result of comparing DB state (desired) to Canton state (actual).
|
|
63
|
+
*/
|
|
64
|
+
export interface ReplicationDiff {
|
|
65
|
+
/** Items in DB but not in Canton - need to be created */
|
|
66
|
+
creates: ReplicationItem[];
|
|
67
|
+
/** Items in both - may need to be edited */
|
|
68
|
+
edits: ReplicationItem[];
|
|
69
|
+
/** Items in Canton but not in DB - may need to be deleted */
|
|
70
|
+
deletes: ReplicationItem[];
|
|
71
|
+
/** Total number of operations */
|
|
72
|
+
total: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Options for computing the replication diff.
|
|
76
|
+
*/
|
|
77
|
+
export interface ComputeReplicationDiffOptions {
|
|
78
|
+
/**
|
|
79
|
+
* Whether to include delete operations for items in Canton but not in DB.
|
|
80
|
+
* Default: false (safer - doesn't delete data)
|
|
81
|
+
*/
|
|
82
|
+
syncDeletes?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to always include edit operations for items that exist in both.
|
|
85
|
+
* When true: All existing items are marked as edits (ensures sync)
|
|
86
|
+
* When false: Only new items are marked as creates (existence check only)
|
|
87
|
+
* Default: false
|
|
88
|
+
*/
|
|
89
|
+
alwaysEdit?: boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Compute what needs to be synced from DB to Canton.
|
|
93
|
+
*
|
|
94
|
+
* Compares a list of DB items (desired state) against Canton state (actual state)
|
|
95
|
+
* and returns operations needed to synchronize them.
|
|
96
|
+
*
|
|
97
|
+
* @param dbItems - OCF items from database (desired state)
|
|
98
|
+
* @param cantonState - Current Canton state from getCapTableState()
|
|
99
|
+
* @param options - Sync options
|
|
100
|
+
* @returns Replication diff with creates, edits, and deletes
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* const dbItems = [
|
|
105
|
+
* { ocfId: 'stakeholder-1', entityType: 'stakeholder', data: {...} },
|
|
106
|
+
* { ocfId: 'stock-class-1', entityType: 'stockClass', data: {...} },
|
|
107
|
+
* ];
|
|
108
|
+
* const cantonState = await getCapTableState(client, issuerPartyId);
|
|
109
|
+
* const diff = computeReplicationDiff(dbItems, cantonState, { syncDeletes: true });
|
|
110
|
+
* // diff.creates = items in DB but not Canton
|
|
111
|
+
* // diff.deletes = items in Canton but not DB
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export declare function computeReplicationDiff(dbItems: Array<{
|
|
115
|
+
ocfId: string;
|
|
116
|
+
entityType: OcfEntityType;
|
|
117
|
+
data: unknown;
|
|
118
|
+
}>, cantonState: CapTableState, options?: ComputeReplicationDiffOptions): ReplicationDiff;
|
|
119
|
+
//# sourceMappingURL=replicationHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replicationHelpers.d.ts","sourceRoot":"","sources":["../../src/utils/replicationHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AAqGzF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa,GAAG,IAAI,CAiBpG;AA2FD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI7E;AAMD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,UAAU,EAAE,aAAa,CAAC;IAC1B,2BAA2B;IAC3B,SAAS,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;IACxC,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,4CAA4C;IAC5C,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,6DAA6D;IAC7D,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,EAC3E,WAAW,EAAE,aAAa,EAC1B,OAAO,GAAE,6BAAkC,GAC1C,eAAe,CAiFjB"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Replication helpers for cap table synchronization.
|
|
4
|
+
*
|
|
5
|
+
* Provides utilities for:
|
|
6
|
+
* - Mapping database types to SDK entity types
|
|
7
|
+
* - Computing replication diffs between DB and Canton state
|
|
8
|
+
* - Human-readable labels for display
|
|
9
|
+
*
|
|
10
|
+
* @module replicationHelpers
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.mapDbTypeToEntityType = mapDbTypeToEntityType;
|
|
14
|
+
exports.getEntityTypeLabel = getEntityTypeLabel;
|
|
15
|
+
exports.computeReplicationDiff = computeReplicationDiff;
|
|
16
|
+
const planSecurityAliases_1 = require("./planSecurityAliases");
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// DB Type Mapping
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* Direct database type to OcfEntityType mappings.
|
|
22
|
+
* These types are stored directly in the `type` column.
|
|
23
|
+
*/
|
|
24
|
+
const DIRECT_TYPE_MAP = {
|
|
25
|
+
STAKEHOLDER: 'stakeholder',
|
|
26
|
+
STOCK_CLASS: 'stockClass',
|
|
27
|
+
STOCK_PLAN: 'stockPlan',
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* OBJECT subtype to OcfEntityType mappings.
|
|
31
|
+
* These are stored with type='OBJECT' and the actual type in subtype.
|
|
32
|
+
*/
|
|
33
|
+
const OBJECT_SUBTYPE_MAP = {
|
|
34
|
+
DOCUMENT: 'document',
|
|
35
|
+
VESTING_TERMS: 'vestingTerms',
|
|
36
|
+
STOCK_LEGEND_TEMPLATE: 'stockLegendTemplate',
|
|
37
|
+
VALUATION: 'valuation',
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* TRANSACTION subtype to OcfEntityType mappings.
|
|
41
|
+
* These are stored with type='TRANSACTION' and the actual type in subtype.
|
|
42
|
+
* DB uses TX_ prefix with UPPER_SNAKE_CASE, SDK uses camelCase.
|
|
43
|
+
*/
|
|
44
|
+
const TRANSACTION_SUBTYPE_MAP = {
|
|
45
|
+
// Stock Transactions (9 types)
|
|
46
|
+
TX_STOCK_ISSUANCE: 'stockIssuance',
|
|
47
|
+
TX_STOCK_CANCELLATION: 'stockCancellation',
|
|
48
|
+
TX_STOCK_TRANSFER: 'stockTransfer',
|
|
49
|
+
TX_STOCK_ACCEPTANCE: 'stockAcceptance',
|
|
50
|
+
TX_STOCK_CONVERSION: 'stockConversion',
|
|
51
|
+
TX_STOCK_REPURCHASE: 'stockRepurchase',
|
|
52
|
+
TX_STOCK_REISSUANCE: 'stockReissuance',
|
|
53
|
+
TX_STOCK_RETRACTION: 'stockRetraction',
|
|
54
|
+
TX_STOCK_CONSOLIDATION: 'stockConsolidation',
|
|
55
|
+
// Equity Compensation (8 types)
|
|
56
|
+
TX_EQUITY_COMPENSATION_ISSUANCE: 'equityCompensationIssuance',
|
|
57
|
+
TX_EQUITY_COMPENSATION_CANCELLATION: 'equityCompensationCancellation',
|
|
58
|
+
TX_EQUITY_COMPENSATION_TRANSFER: 'equityCompensationTransfer',
|
|
59
|
+
TX_EQUITY_COMPENSATION_ACCEPTANCE: 'equityCompensationAcceptance',
|
|
60
|
+
TX_EQUITY_COMPENSATION_EXERCISE: 'equityCompensationExercise',
|
|
61
|
+
TX_EQUITY_COMPENSATION_RELEASE: 'equityCompensationRelease',
|
|
62
|
+
TX_EQUITY_COMPENSATION_REPRICING: 'equityCompensationRepricing',
|
|
63
|
+
TX_EQUITY_COMPENSATION_RETRACTION: 'equityCompensationRetraction',
|
|
64
|
+
// Convertibles (6 types)
|
|
65
|
+
TX_CONVERTIBLE_ISSUANCE: 'convertibleIssuance',
|
|
66
|
+
TX_CONVERTIBLE_CANCELLATION: 'convertibleCancellation',
|
|
67
|
+
TX_CONVERTIBLE_TRANSFER: 'convertibleTransfer',
|
|
68
|
+
TX_CONVERTIBLE_ACCEPTANCE: 'convertibleAcceptance',
|
|
69
|
+
TX_CONVERTIBLE_CONVERSION: 'convertibleConversion',
|
|
70
|
+
TX_CONVERTIBLE_RETRACTION: 'convertibleRetraction',
|
|
71
|
+
// Warrants (6 types)
|
|
72
|
+
TX_WARRANT_ISSUANCE: 'warrantIssuance',
|
|
73
|
+
TX_WARRANT_CANCELLATION: 'warrantCancellation',
|
|
74
|
+
TX_WARRANT_TRANSFER: 'warrantTransfer',
|
|
75
|
+
TX_WARRANT_ACCEPTANCE: 'warrantAcceptance',
|
|
76
|
+
TX_WARRANT_EXERCISE: 'warrantExercise',
|
|
77
|
+
TX_WARRANT_RETRACTION: 'warrantRetraction',
|
|
78
|
+
// Stock Class Adjustments (4 types)
|
|
79
|
+
TX_STOCK_CLASS_AUTHORIZED_SHARES_ADJUSTMENT: 'stockClassAuthorizedSharesAdjustment',
|
|
80
|
+
TX_STOCK_CLASS_CONVERSION_RATIO_ADJUSTMENT: 'stockClassConversionRatioAdjustment',
|
|
81
|
+
TX_STOCK_CLASS_SPLIT: 'stockClassSplit',
|
|
82
|
+
TX_ISSUER_AUTHORIZED_SHARES_ADJUSTMENT: 'issuerAuthorizedSharesAdjustment',
|
|
83
|
+
// Stock Plan Events (2 types)
|
|
84
|
+
TX_STOCK_PLAN_POOL_ADJUSTMENT: 'stockPlanPoolAdjustment',
|
|
85
|
+
TX_STOCK_PLAN_RETURN_TO_POOL: 'stockPlanReturnToPool',
|
|
86
|
+
// Vesting Events (3 types)
|
|
87
|
+
TX_VESTING_ACCELERATION: 'vestingAcceleration',
|
|
88
|
+
TX_VESTING_EVENT: 'vestingEvent',
|
|
89
|
+
TX_VESTING_START: 'vestingStart',
|
|
90
|
+
// Stakeholder Events (2 types)
|
|
91
|
+
TX_STAKEHOLDER_RELATIONSHIP_CHANGE_EVENT: 'stakeholderRelationshipChangeEvent',
|
|
92
|
+
TX_STAKEHOLDER_STATUS_CHANGE_EVENT: 'stakeholderStatusChangeEvent',
|
|
93
|
+
// Plan Security (7 types) - aliases for Equity Compensation in legacy OCF
|
|
94
|
+
// These map to equityCompensation* types in Canton (planSecurity is an alias)
|
|
95
|
+
TX_PLAN_SECURITY_ISSUANCE: 'planSecurityIssuance',
|
|
96
|
+
TX_PLAN_SECURITY_CANCELLATION: 'planSecurityCancellation',
|
|
97
|
+
TX_PLAN_SECURITY_TRANSFER: 'planSecurityTransfer',
|
|
98
|
+
TX_PLAN_SECURITY_ACCEPTANCE: 'planSecurityAcceptance',
|
|
99
|
+
TX_PLAN_SECURITY_EXERCISE: 'planSecurityExercise',
|
|
100
|
+
TX_PLAN_SECURITY_RELEASE: 'planSecurityRelease',
|
|
101
|
+
TX_PLAN_SECURITY_RETRACTION: 'planSecurityRetraction',
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Map database type/subtype to OcfEntityType.
|
|
105
|
+
*
|
|
106
|
+
* The database schema uses:
|
|
107
|
+
* - Direct types: STAKEHOLDER, STOCK_CLASS, STOCK_PLAN stored in `type` column
|
|
108
|
+
* - Object subtypes: type='OBJECT', actual type in `subtype` column
|
|
109
|
+
* - Transaction subtypes: type='TRANSACTION', actual type in `subtype` column (TX_ prefix)
|
|
110
|
+
*
|
|
111
|
+
* @param dbType - The database OCF type (STAKEHOLDER, OBJECT, TRANSACTION, etc.)
|
|
112
|
+
* @param dbSubtype - The database subtype for OBJECT and TRANSACTION types
|
|
113
|
+
* @returns The corresponding OcfEntityType, or null if not supported
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* mapDbTypeToEntityType('STAKEHOLDER', null); // 'stakeholder'
|
|
118
|
+
* mapDbTypeToEntityType('OBJECT', 'DOCUMENT'); // 'document'
|
|
119
|
+
* mapDbTypeToEntityType('TRANSACTION', 'TX_STOCK_ISSUANCE'); // 'stockIssuance'
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
function mapDbTypeToEntityType(dbType, dbSubtype) {
|
|
123
|
+
// Direct mappings
|
|
124
|
+
if (dbType in DIRECT_TYPE_MAP) {
|
|
125
|
+
return DIRECT_TYPE_MAP[dbType];
|
|
126
|
+
}
|
|
127
|
+
// Object subtypes
|
|
128
|
+
if (dbType === 'OBJECT' && dbSubtype) {
|
|
129
|
+
return OBJECT_SUBTYPE_MAP[dbSubtype] ?? null;
|
|
130
|
+
}
|
|
131
|
+
// Transaction subtypes
|
|
132
|
+
if (dbType === 'TRANSACTION' && dbSubtype) {
|
|
133
|
+
return TRANSACTION_SUBTYPE_MAP[dbSubtype] ?? null;
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
// ============================================================================
|
|
138
|
+
// Human-Readable Labels
|
|
139
|
+
// ============================================================================
|
|
140
|
+
/**
|
|
141
|
+
* Human-readable labels for each entity type: [singular, plural].
|
|
142
|
+
*/
|
|
143
|
+
const ENTITY_TYPE_LABELS = {
|
|
144
|
+
// Core Objects (7 types)
|
|
145
|
+
stakeholder: ['Stakeholder', 'Stakeholders'],
|
|
146
|
+
stockClass: ['Stock Class', 'Stock Classes'],
|
|
147
|
+
stockPlan: ['Stock Plan', 'Stock Plans'],
|
|
148
|
+
vestingTerms: ['Vesting Terms', 'Vesting Terms'],
|
|
149
|
+
stockLegendTemplate: ['Stock Legend Template', 'Stock Legend Templates'],
|
|
150
|
+
document: ['Document', 'Documents'],
|
|
151
|
+
valuation: ['Valuation', 'Valuations'],
|
|
152
|
+
// Stock Transactions (9 types)
|
|
153
|
+
stockIssuance: ['Stock Issuance', 'Stock Issuances'],
|
|
154
|
+
stockCancellation: ['Stock Cancellation', 'Stock Cancellations'],
|
|
155
|
+
stockTransfer: ['Stock Transfer', 'Stock Transfers'],
|
|
156
|
+
stockAcceptance: ['Stock Acceptance', 'Stock Acceptances'],
|
|
157
|
+
stockConversion: ['Stock Conversion', 'Stock Conversions'],
|
|
158
|
+
stockRepurchase: ['Stock Repurchase', 'Stock Repurchases'],
|
|
159
|
+
stockReissuance: ['Stock Reissuance', 'Stock Reissuances'],
|
|
160
|
+
stockRetraction: ['Stock Retraction', 'Stock Retractions'],
|
|
161
|
+
stockConsolidation: ['Stock Consolidation', 'Stock Consolidations'],
|
|
162
|
+
// Equity Compensation (8 types)
|
|
163
|
+
equityCompensationIssuance: ['Equity Compensation Issuance', 'Equity Compensation Issuances'],
|
|
164
|
+
equityCompensationCancellation: ['Equity Compensation Cancellation', 'Equity Compensation Cancellations'],
|
|
165
|
+
equityCompensationTransfer: ['Equity Compensation Transfer', 'Equity Compensation Transfers'],
|
|
166
|
+
equityCompensationAcceptance: ['Equity Compensation Acceptance', 'Equity Compensation Acceptances'],
|
|
167
|
+
equityCompensationExercise: ['Equity Compensation Exercise', 'Equity Compensation Exercises'],
|
|
168
|
+
equityCompensationRelease: ['Equity Compensation Release', 'Equity Compensation Releases'],
|
|
169
|
+
equityCompensationRepricing: ['Equity Compensation Repricing', 'Equity Compensation Repricings'],
|
|
170
|
+
equityCompensationRetraction: ['Equity Compensation Retraction', 'Equity Compensation Retractions'],
|
|
171
|
+
// Plan Security aliases (use same labels as Equity Compensation)
|
|
172
|
+
planSecurityIssuance: ['Plan Security Issuance', 'Plan Security Issuances'],
|
|
173
|
+
planSecurityCancellation: ['Plan Security Cancellation', 'Plan Security Cancellations'],
|
|
174
|
+
planSecurityTransfer: ['Plan Security Transfer', 'Plan Security Transfers'],
|
|
175
|
+
planSecurityAcceptance: ['Plan Security Acceptance', 'Plan Security Acceptances'],
|
|
176
|
+
planSecurityExercise: ['Plan Security Exercise', 'Plan Security Exercises'],
|
|
177
|
+
planSecurityRelease: ['Plan Security Release', 'Plan Security Releases'],
|
|
178
|
+
planSecurityRetraction: ['Plan Security Retraction', 'Plan Security Retractions'],
|
|
179
|
+
// Convertibles (6 types)
|
|
180
|
+
convertibleIssuance: ['Convertible Issuance', 'Convertible Issuances'],
|
|
181
|
+
convertibleCancellation: ['Convertible Cancellation', 'Convertible Cancellations'],
|
|
182
|
+
convertibleTransfer: ['Convertible Transfer', 'Convertible Transfers'],
|
|
183
|
+
convertibleAcceptance: ['Convertible Acceptance', 'Convertible Acceptances'],
|
|
184
|
+
convertibleConversion: ['Convertible Conversion', 'Convertible Conversions'],
|
|
185
|
+
convertibleRetraction: ['Convertible Retraction', 'Convertible Retractions'],
|
|
186
|
+
// Warrants (6 types)
|
|
187
|
+
warrantIssuance: ['Warrant Issuance', 'Warrant Issuances'],
|
|
188
|
+
warrantCancellation: ['Warrant Cancellation', 'Warrant Cancellations'],
|
|
189
|
+
warrantTransfer: ['Warrant Transfer', 'Warrant Transfers'],
|
|
190
|
+
warrantAcceptance: ['Warrant Acceptance', 'Warrant Acceptances'],
|
|
191
|
+
warrantExercise: ['Warrant Exercise', 'Warrant Exercises'],
|
|
192
|
+
warrantRetraction: ['Warrant Retraction', 'Warrant Retractions'],
|
|
193
|
+
// Stock Class Adjustments (4 types)
|
|
194
|
+
stockClassAuthorizedSharesAdjustment: [
|
|
195
|
+
'Stock Class Authorized Shares Adjustment',
|
|
196
|
+
'Stock Class Authorized Shares Adjustments',
|
|
197
|
+
],
|
|
198
|
+
stockClassConversionRatioAdjustment: [
|
|
199
|
+
'Stock Class Conversion Ratio Adjustment',
|
|
200
|
+
'Stock Class Conversion Ratio Adjustments',
|
|
201
|
+
],
|
|
202
|
+
stockClassSplit: ['Stock Class Split', 'Stock Class Splits'],
|
|
203
|
+
issuerAuthorizedSharesAdjustment: ['Issuer Authorized Shares Adjustment', 'Issuer Authorized Shares Adjustments'],
|
|
204
|
+
// Stock Plan Events (2 types)
|
|
205
|
+
stockPlanPoolAdjustment: ['Stock Plan Pool Adjustment', 'Stock Plan Pool Adjustments'],
|
|
206
|
+
stockPlanReturnToPool: ['Stock Plan Return to Pool', 'Stock Plan Returns to Pool'],
|
|
207
|
+
// Vesting Events (3 types)
|
|
208
|
+
vestingAcceleration: ['Vesting Acceleration', 'Vesting Accelerations'],
|
|
209
|
+
vestingEvent: ['Vesting Event', 'Vesting Events'],
|
|
210
|
+
vestingStart: ['Vesting Start', 'Vesting Starts'],
|
|
211
|
+
// Stakeholder Events (2 types)
|
|
212
|
+
stakeholderRelationshipChangeEvent: ['Stakeholder Relationship Change', 'Stakeholder Relationship Changes'],
|
|
213
|
+
stakeholderStatusChangeEvent: ['Stakeholder Status Change', 'Stakeholder Status Changes'],
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Get a human-readable label for an entity type with count.
|
|
217
|
+
*
|
|
218
|
+
* @param type - The OcfEntityType
|
|
219
|
+
* @param count - The count (determines singular vs plural)
|
|
220
|
+
* @returns Human-readable string like "3 Stock Classes" or "1 Stakeholder"
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```typescript
|
|
224
|
+
* getEntityTypeLabel('stockClass', 1); // "1 Stock Class"
|
|
225
|
+
* getEntityTypeLabel('stockClass', 3); // "3 Stock Classes"
|
|
226
|
+
* getEntityTypeLabel('stakeholder', 0); // "0 Stakeholders"
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
function getEntityTypeLabel(type, count) {
|
|
230
|
+
const labels = ENTITY_TYPE_LABELS[type];
|
|
231
|
+
const [singular, plural] = labels;
|
|
232
|
+
return `${count} ${count === 1 ? singular : plural}`;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Compute what needs to be synced from DB to Canton.
|
|
236
|
+
*
|
|
237
|
+
* Compares a list of DB items (desired state) against Canton state (actual state)
|
|
238
|
+
* and returns operations needed to synchronize them.
|
|
239
|
+
*
|
|
240
|
+
* @param dbItems - OCF items from database (desired state)
|
|
241
|
+
* @param cantonState - Current Canton state from getCapTableState()
|
|
242
|
+
* @param options - Sync options
|
|
243
|
+
* @returns Replication diff with creates, edits, and deletes
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```typescript
|
|
247
|
+
* const dbItems = [
|
|
248
|
+
* { ocfId: 'stakeholder-1', entityType: 'stakeholder', data: {...} },
|
|
249
|
+
* { ocfId: 'stock-class-1', entityType: 'stockClass', data: {...} },
|
|
250
|
+
* ];
|
|
251
|
+
* const cantonState = await getCapTableState(client, issuerPartyId);
|
|
252
|
+
* const diff = computeReplicationDiff(dbItems, cantonState, { syncDeletes: true });
|
|
253
|
+
* // diff.creates = items in DB but not Canton
|
|
254
|
+
* // diff.deletes = items in Canton but not DB
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
function computeReplicationDiff(dbItems, cantonState, options = {}) {
|
|
258
|
+
const { syncDeletes = false, alwaysEdit = false } = options;
|
|
259
|
+
const creates = [];
|
|
260
|
+
const edits = [];
|
|
261
|
+
const deletes = [];
|
|
262
|
+
// Track DB items by type for delete detection
|
|
263
|
+
const dbIdsByType = new Map();
|
|
264
|
+
// Track seen items to prevent duplicate create/edit operations
|
|
265
|
+
const seenItems = new Set();
|
|
266
|
+
// Process each DB item
|
|
267
|
+
for (const item of dbItems) {
|
|
268
|
+
// Skip duplicate items (same ocfId + entityType)
|
|
269
|
+
const itemKey = `${item.entityType}:${item.ocfId}`;
|
|
270
|
+
if (seenItems.has(itemKey)) {
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
seenItems.add(itemKey);
|
|
274
|
+
// Normalize planSecurity types to equityCompensation for Canton lookup
|
|
275
|
+
// Canton stores planSecurity items under equity_compensation_* fields
|
|
276
|
+
const normalizedType = (0, planSecurityAliases_1.normalizeEntityType)(item.entityType);
|
|
277
|
+
// Track for delete detection (using normalized type to match Canton's storage)
|
|
278
|
+
let typeIds = dbIdsByType.get(normalizedType);
|
|
279
|
+
if (!typeIds) {
|
|
280
|
+
typeIds = new Set();
|
|
281
|
+
dbIdsByType.set(normalizedType, typeIds);
|
|
282
|
+
}
|
|
283
|
+
typeIds.add(item.ocfId);
|
|
284
|
+
// Check if exists in Canton (using normalized type)
|
|
285
|
+
const cantonIds = cantonState.entities.get(normalizedType) ?? new Set();
|
|
286
|
+
const existsInCanton = cantonIds.has(item.ocfId);
|
|
287
|
+
if (!existsInCanton) {
|
|
288
|
+
// Item in DB but not Canton → CREATE
|
|
289
|
+
creates.push({
|
|
290
|
+
ocfId: item.ocfId,
|
|
291
|
+
entityType: item.entityType,
|
|
292
|
+
operation: 'create',
|
|
293
|
+
data: item.data,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
else if (alwaysEdit) {
|
|
297
|
+
// Item in both and alwaysEdit → EDIT
|
|
298
|
+
edits.push({
|
|
299
|
+
ocfId: item.ocfId,
|
|
300
|
+
entityType: item.entityType,
|
|
301
|
+
operation: 'edit',
|
|
302
|
+
data: item.data,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
// If not alwaysEdit and exists in Canton, skip (already synced)
|
|
306
|
+
}
|
|
307
|
+
// Detect deletes (in Canton but not in DB)
|
|
308
|
+
if (syncDeletes) {
|
|
309
|
+
for (const [entityType, cantonIds] of cantonState.entities) {
|
|
310
|
+
const dbIds = dbIdsByType.get(entityType) ?? new Set();
|
|
311
|
+
for (const cantonId of cantonIds) {
|
|
312
|
+
if (!dbIds.has(cantonId)) {
|
|
313
|
+
// Item in Canton but not DB → DELETE
|
|
314
|
+
deletes.push({
|
|
315
|
+
ocfId: cantonId,
|
|
316
|
+
entityType,
|
|
317
|
+
operation: 'delete',
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return {
|
|
324
|
+
creates,
|
|
325
|
+
edits,
|
|
326
|
+
deletes,
|
|
327
|
+
total: creates.length + edits.length + deletes.length,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=replicationHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replicationHelpers.js","sourceRoot":"","sources":["../../src/utils/replicationHelpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AA2HH,sDAiBC;AAyGD,gDAIC;AA4ED,wDAqFC;AAtZD,+DAA4D;AAE5D,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,eAAe,GAAkC;IACrD,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,YAAY;IACzB,UAAU,EAAE,WAAW;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,kBAAkB,GAAkC;IACxD,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,cAAc;IAC7B,qBAAqB,EAAE,qBAAqB;IAC5C,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,uBAAuB,GAAkC;IAC7D,+BAA+B;IAC/B,iBAAiB,EAAE,eAAe;IAClC,qBAAqB,EAAE,mBAAmB;IAC1C,iBAAiB,EAAE,eAAe;IAClC,mBAAmB,EAAE,iBAAiB;IACtC,mBAAmB,EAAE,iBAAiB;IACtC,mBAAmB,EAAE,iBAAiB;IACtC,mBAAmB,EAAE,iBAAiB;IACtC,mBAAmB,EAAE,iBAAiB;IACtC,sBAAsB,EAAE,oBAAoB;IAE5C,gCAAgC;IAChC,+BAA+B,EAAE,4BAA4B;IAC7D,mCAAmC,EAAE,gCAAgC;IACrE,+BAA+B,EAAE,4BAA4B;IAC7D,iCAAiC,EAAE,8BAA8B;IACjE,+BAA+B,EAAE,4BAA4B;IAC7D,8BAA8B,EAAE,2BAA2B;IAC3D,gCAAgC,EAAE,6BAA6B;IAC/D,iCAAiC,EAAE,8BAA8B;IAEjE,yBAAyB;IACzB,uBAAuB,EAAE,qBAAqB;IAC9C,2BAA2B,EAAE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AK,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;KACtD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-captable-protocol/canton",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.193",
|
|
4
4
|
"description": "A TypeScript SDK for interacting with the Open CapTable Protocol (OCP) Factory contract on Canton blockchain",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|