@open-captable-protocol/canton 0.0.40 → 0.1.0
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/OcpClient.d.ts +53 -0
- package/dist/OcpClient.d.ts.map +1 -1
- package/dist/OcpClient.js +89 -0
- package/dist/OcpClient.js.map +1 -1
- package/dist/functions/convertible/acceptConvertible.d.ts +18 -0
- package/dist/functions/convertible/acceptConvertible.d.ts.map +1 -0
- package/dist/functions/convertible/acceptConvertible.js +31 -0
- package/dist/functions/convertible/acceptConvertible.js.map +1 -0
- package/dist/functions/convertible/cancelConvertible.d.ts +23 -0
- package/dist/functions/convertible/cancelConvertible.d.ts.map +1 -0
- package/dist/functions/convertible/cancelConvertible.js +37 -0
- package/dist/functions/convertible/cancelConvertible.js.map +1 -0
- package/dist/functions/convertible/convertConvertible.d.ts +18 -0
- package/dist/functions/convertible/convertConvertible.d.ts.map +1 -0
- package/dist/functions/convertible/convertConvertible.js +33 -0
- package/dist/functions/convertible/convertConvertible.js.map +1 -0
- package/dist/functions/convertible/getConvertibleAsOcf.d.ts +21 -0
- package/dist/functions/convertible/getConvertibleAsOcf.d.ts.map +1 -0
- package/dist/functions/convertible/getConvertibleAsOcf.js +24 -0
- package/dist/functions/convertible/getConvertibleAsOcf.js.map +1 -0
- package/dist/functions/convertible/getConvertibleConversionEventAsOcf.d.ts +19 -0
- package/dist/functions/convertible/getConvertibleConversionEventAsOcf.d.ts.map +1 -0
- package/dist/functions/convertible/getConvertibleConversionEventAsOcf.js +21 -0
- package/dist/functions/convertible/getConvertibleConversionEventAsOcf.js.map +1 -0
- package/dist/functions/convertible/index.d.ts +9 -0
- package/dist/functions/convertible/index.d.ts.map +1 -0
- package/dist/functions/convertible/index.js +25 -0
- package/dist/functions/convertible/index.js.map +1 -0
- package/dist/functions/convertible/issueConvertible.d.ts +20 -0
- package/dist/functions/convertible/issueConvertible.d.ts.map +1 -0
- package/dist/functions/convertible/issueConvertible.js +46 -0
- package/dist/functions/convertible/issueConvertible.js.map +1 -0
- package/dist/functions/convertible/retractConvertible.d.ts +19 -0
- package/dist/functions/convertible/retractConvertible.d.ts.map +1 -0
- package/dist/functions/convertible/retractConvertible.js +32 -0
- package/dist/functions/convertible/retractConvertible.js.map +1 -0
- package/dist/functions/convertible/transferConvertible.d.ts +25 -0
- package/dist/functions/convertible/transferConvertible.d.ts.map +1 -0
- package/dist/functions/convertible/transferConvertible.js +45 -0
- package/dist/functions/convertible/transferConvertible.js.map +1 -0
- package/dist/functions/index.d.ts +9 -0
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +9 -0
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/issuer/adjustAuthorizedShares.d.ts +20 -0
- package/dist/functions/issuer/adjustAuthorizedShares.d.ts.map +1 -0
- package/dist/functions/issuer/adjustAuthorizedShares.js +33 -0
- package/dist/functions/issuer/adjustAuthorizedShares.js.map +1 -0
- package/dist/functions/issuer/createIssuer.d.ts +17 -1
- package/dist/functions/issuer/createIssuer.d.ts.map +1 -1
- package/dist/functions/issuer/createIssuer.js.map +1 -1
- package/dist/functions/issuer/createValuation.d.ts +30 -0
- package/dist/functions/issuer/createValuation.d.ts.map +1 -0
- package/dist/functions/issuer/createValuation.js +54 -0
- package/dist/functions/issuer/createValuation.js.map +1 -0
- package/dist/functions/issuer/getIssuerAsOcf.d.ts +8 -58
- package/dist/functions/issuer/getIssuerAsOcf.d.ts.map +1 -1
- package/dist/functions/issuer/getIssuerAsOcf.js +22 -100
- package/dist/functions/issuer/getIssuerAsOcf.js.map +1 -1
- package/dist/functions/issuer/index.d.ts +2 -0
- package/dist/functions/issuer/index.d.ts.map +1 -1
- package/dist/functions/issuer/index.js +2 -0
- package/dist/functions/issuer/index.js.map +1 -1
- package/dist/functions/issuer/updateIssuerData.d.ts +5 -0
- package/dist/functions/issuer/updateIssuerData.d.ts.map +1 -1
- package/dist/functions/issuer/updateIssuerData.js.map +1 -1
- package/dist/functions/issuerAuthorization/index.d.ts +2 -0
- package/dist/functions/issuerAuthorization/index.d.ts.map +1 -0
- package/dist/functions/issuerAuthorization/index.js +18 -0
- package/dist/functions/issuerAuthorization/index.js.map +1 -0
- package/dist/functions/issuerAuthorization/withdrawAuthorization.d.ts +10 -0
- package/dist/functions/issuerAuthorization/withdrawAuthorization.d.ts.map +1 -0
- package/dist/functions/issuerAuthorization/withdrawAuthorization.js +21 -0
- package/dist/functions/issuerAuthorization/withdrawAuthorization.js.map +1 -0
- package/dist/functions/stakeholder/createStakeholder.d.ts +19 -0
- package/dist/functions/stakeholder/createStakeholder.d.ts.map +1 -0
- package/dist/functions/stakeholder/createStakeholder.js +45 -0
- package/dist/functions/stakeholder/createStakeholder.js.map +1 -0
- package/dist/functions/stakeholder/getStakeholderAsOcf.d.ts +65 -0
- package/dist/functions/stakeholder/getStakeholderAsOcf.d.ts.map +1 -0
- package/dist/functions/stakeholder/getStakeholderAsOcf.js +38 -0
- package/dist/functions/stakeholder/getStakeholderAsOcf.js.map +1 -0
- package/dist/functions/stakeholder/index.d.ts +8 -0
- package/dist/functions/stakeholder/index.d.ts.map +1 -0
- package/dist/functions/stakeholder/index.js +24 -0
- package/dist/functions/stakeholder/index.js.map +1 -0
- package/dist/functions/stakeholder/recordRelationshipChange.d.ts +20 -0
- package/dist/functions/stakeholder/recordRelationshipChange.d.ts.map +1 -0
- package/dist/functions/stakeholder/recordRelationshipChange.js +33 -0
- package/dist/functions/stakeholder/recordRelationshipChange.js.map +1 -0
- package/dist/functions/stakeholder/recordStatusChange.d.ts +19 -0
- package/dist/functions/stakeholder/recordStatusChange.d.ts.map +1 -0
- package/dist/functions/stakeholder/recordStatusChange.js +32 -0
- package/dist/functions/stakeholder/recordStatusChange.js.map +1 -0
- package/dist/functions/stakeholder/updateStakeholderData.d.ts +17 -0
- package/dist/functions/stakeholder/updateStakeholderData.d.ts.map +1 -0
- package/dist/functions/stakeholder/updateStakeholderData.js +59 -0
- package/dist/functions/stakeholder/updateStakeholderData.js.map +1 -0
- package/dist/functions/stockClass/adjustAuthorizedShares.d.ts +20 -0
- package/dist/functions/stockClass/adjustAuthorizedShares.d.ts.map +1 -0
- package/dist/functions/stockClass/adjustAuthorizedShares.js +28 -0
- package/dist/functions/stockClass/adjustAuthorizedShares.js.map +1 -0
- package/dist/functions/stockClass/adjustConversionRatio.d.ts +23 -0
- package/dist/functions/stockClass/adjustConversionRatio.d.ts.map +1 -0
- package/dist/functions/stockClass/adjustConversionRatio.js +39 -0
- package/dist/functions/stockClass/adjustConversionRatio.js.map +1 -0
- package/dist/functions/stockClass/consolidatePositions.d.ts +21 -0
- package/dist/functions/stockClass/consolidatePositions.d.ts.map +1 -0
- package/dist/functions/stockClass/consolidatePositions.js +34 -0
- package/dist/functions/stockClass/consolidatePositions.js.map +1 -0
- package/dist/functions/stockClass/createStockClass.d.ts +19 -1
- package/dist/functions/stockClass/createStockClass.d.ts.map +1 -1
- package/dist/functions/stockClass/createStockClass.js.map +1 -1
- package/dist/functions/stockClass/getStockIssuanceEventAsOcf.d.ts +22 -0
- package/dist/functions/stockClass/getStockIssuanceEventAsOcf.d.ts.map +1 -0
- package/dist/functions/stockClass/getStockIssuanceEventAsOcf.js +23 -0
- package/dist/functions/stockClass/getStockIssuanceEventAsOcf.js.map +1 -0
- package/dist/functions/stockClass/getStockRepurchaseEventAsOcf.d.ts +22 -0
- package/dist/functions/stockClass/getStockRepurchaseEventAsOcf.d.ts.map +1 -0
- package/dist/functions/stockClass/getStockRepurchaseEventAsOcf.js +23 -0
- package/dist/functions/stockClass/getStockRepurchaseEventAsOcf.js.map +1 -0
- package/dist/functions/stockClass/getStockTransferEventAsOcf.d.ts +23 -0
- package/dist/functions/stockClass/getStockTransferEventAsOcf.d.ts.map +1 -0
- package/dist/functions/stockClass/getStockTransferEventAsOcf.js +24 -0
- package/dist/functions/stockClass/getStockTransferEventAsOcf.js.map +1 -0
- package/dist/functions/stockClass/index.d.ts +5 -0
- package/dist/functions/stockClass/index.d.ts.map +1 -1
- package/dist/functions/stockClass/index.js +5 -0
- package/dist/functions/stockClass/index.js.map +1 -1
- package/dist/functions/stockClass/issueStock.d.ts +19 -0
- package/dist/functions/stockClass/issueStock.d.ts.map +1 -0
- package/dist/functions/stockClass/issueStock.js +34 -0
- package/dist/functions/stockClass/issueStock.js.map +1 -0
- package/dist/functions/stockClass/reissueStock.d.ts +18 -0
- package/dist/functions/stockClass/reissueStock.d.ts.map +1 -0
- package/dist/functions/stockClass/reissueStock.js +35 -0
- package/dist/functions/stockClass/reissueStock.js.map +1 -0
- package/dist/functions/stockClass/repurchaseStock.d.ts +20 -0
- package/dist/functions/stockClass/repurchaseStock.d.ts.map +1 -0
- package/dist/functions/stockClass/repurchaseStock.js +33 -0
- package/dist/functions/stockClass/repurchaseStock.js.map +1 -0
- package/dist/functions/stockClass/splitStockClass.d.ts +18 -0
- package/dist/functions/stockClass/splitStockClass.d.ts.map +1 -0
- package/dist/functions/stockClass/splitStockClass.js +33 -0
- package/dist/functions/stockClass/splitStockClass.js.map +1 -0
- package/dist/functions/stockLegendTemplate/createStockLegendTemplate.d.ts +15 -0
- package/dist/functions/stockLegendTemplate/createStockLegendTemplate.d.ts.map +1 -0
- package/dist/functions/stockLegendTemplate/createStockLegendTemplate.js +41 -0
- package/dist/functions/stockLegendTemplate/createStockLegendTemplate.js.map +1 -0
- package/dist/functions/stockLegendTemplate/getStockLegendTemplateAsOcf.d.ts +17 -0
- package/dist/functions/stockLegendTemplate/getStockLegendTemplateAsOcf.d.ts.map +1 -0
- package/dist/functions/stockLegendTemplate/getStockLegendTemplateAsOcf.js +25 -0
- package/dist/functions/stockLegendTemplate/getStockLegendTemplateAsOcf.js.map +1 -0
- package/dist/functions/stockLegendTemplate/index.d.ts +4 -0
- package/dist/functions/stockLegendTemplate/index.d.ts.map +1 -0
- package/dist/functions/stockLegendTemplate/index.js +20 -0
- package/dist/functions/stockLegendTemplate/index.js.map +1 -0
- package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.d.ts +14 -0
- package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.d.ts.map +1 -0
- package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.js +56 -0
- package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.js.map +1 -0
- package/dist/functions/stockPlan/acceptGrant.d.ts +16 -0
- package/dist/functions/stockPlan/acceptGrant.d.ts.map +1 -0
- package/dist/functions/stockPlan/acceptGrant.js +31 -0
- package/dist/functions/stockPlan/acceptGrant.js.map +1 -0
- package/dist/functions/stockPlan/adjustPool.d.ts +20 -0
- package/dist/functions/stockPlan/adjustPool.d.ts.map +1 -0
- package/dist/functions/stockPlan/adjustPool.js +33 -0
- package/dist/functions/stockPlan/adjustPool.js.map +1 -0
- package/dist/functions/stockPlan/cancelGrant.d.ts +16 -0
- package/dist/functions/stockPlan/cancelGrant.d.ts.map +1 -0
- package/dist/functions/stockPlan/cancelGrant.js +31 -0
- package/dist/functions/stockPlan/cancelGrant.js.map +1 -0
- package/dist/functions/stockPlan/createStockPlan.d.ts +29 -0
- package/dist/functions/stockPlan/createStockPlan.d.ts.map +1 -0
- package/dist/functions/stockPlan/createStockPlan.js +53 -0
- package/dist/functions/stockPlan/createStockPlan.js.map +1 -0
- package/dist/functions/stockPlan/exerciseGrant.d.ts +20 -0
- package/dist/functions/stockPlan/exerciseGrant.d.ts.map +1 -0
- package/dist/functions/stockPlan/exerciseGrant.js +33 -0
- package/dist/functions/stockPlan/exerciseGrant.js.map +1 -0
- package/dist/functions/stockPlan/getEquityCompensationExerciseEventAsOcf.d.ts +24 -0
- package/dist/functions/stockPlan/getEquityCompensationExerciseEventAsOcf.d.ts.map +1 -0
- package/dist/functions/stockPlan/getEquityCompensationExerciseEventAsOcf.js +26 -0
- package/dist/functions/stockPlan/getEquityCompensationExerciseEventAsOcf.js.map +1 -0
- package/dist/functions/stockPlan/getStockPlanAsOcf.d.ts +25 -0
- package/dist/functions/stockPlan/getStockPlanAsOcf.d.ts.map +1 -0
- package/dist/functions/stockPlan/getStockPlanAsOcf.js +27 -0
- package/dist/functions/stockPlan/getStockPlanAsOcf.js.map +1 -0
- package/dist/functions/stockPlan/index.d.ts +15 -0
- package/dist/functions/stockPlan/index.d.ts.map +1 -0
- package/dist/functions/stockPlan/index.js +31 -0
- package/dist/functions/stockPlan/index.js.map +1 -0
- package/dist/functions/stockPlan/issuePlanSecurity.d.ts +27 -0
- package/dist/functions/stockPlan/issuePlanSecurity.d.ts.map +1 -0
- package/dist/functions/stockPlan/issuePlanSecurity.js +53 -0
- package/dist/functions/stockPlan/issuePlanSecurity.js.map +1 -0
- package/dist/functions/stockPlan/releaseGrant.d.ts +16 -0
- package/dist/functions/stockPlan/releaseGrant.d.ts.map +1 -0
- package/dist/functions/stockPlan/releaseGrant.js +31 -0
- package/dist/functions/stockPlan/releaseGrant.js.map +1 -0
- package/dist/functions/stockPlan/repriceGrant.d.ts +22 -0
- package/dist/functions/stockPlan/repriceGrant.d.ts.map +1 -0
- package/dist/functions/stockPlan/repriceGrant.js +38 -0
- package/dist/functions/stockPlan/repriceGrant.js.map +1 -0
- package/dist/functions/stockPlan/retractGrant.d.ts +16 -0
- package/dist/functions/stockPlan/retractGrant.d.ts.map +1 -0
- package/dist/functions/stockPlan/retractGrant.js +31 -0
- package/dist/functions/stockPlan/retractGrant.js.map +1 -0
- package/dist/functions/stockPlan/startVesting.d.ts +13 -0
- package/dist/functions/stockPlan/startVesting.d.ts.map +1 -0
- package/dist/functions/stockPlan/startVesting.js +28 -0
- package/dist/functions/stockPlan/startVesting.js.map +1 -0
- package/dist/functions/stockPlan/transferGrant.d.ts +21 -0
- package/dist/functions/stockPlan/transferGrant.d.ts.map +1 -0
- package/dist/functions/stockPlan/transferGrant.js +34 -0
- package/dist/functions/stockPlan/transferGrant.js.map +1 -0
- package/dist/functions/stockPlan/updateStockPlan.d.ts +24 -0
- package/dist/functions/stockPlan/updateStockPlan.d.ts.map +1 -0
- package/dist/functions/stockPlan/updateStockPlan.js +62 -0
- package/dist/functions/stockPlan/updateStockPlan.js.map +1 -0
- package/dist/functions/stockPosition/acceptTransfer.d.ts +16 -0
- package/dist/functions/stockPosition/acceptTransfer.d.ts.map +1 -0
- package/dist/functions/stockPosition/acceptTransfer.js +31 -0
- package/dist/functions/stockPosition/acceptTransfer.js.map +1 -0
- package/dist/functions/stockPosition/index.d.ts +5 -0
- package/dist/functions/stockPosition/index.d.ts.map +1 -0
- package/dist/functions/stockPosition/index.js +21 -0
- package/dist/functions/stockPosition/index.js.map +1 -0
- package/dist/functions/stockPosition/proposeTransfer.d.ts +17 -0
- package/dist/functions/stockPosition/proposeTransfer.d.ts.map +1 -0
- package/dist/functions/stockPosition/proposeTransfer.js +34 -0
- package/dist/functions/stockPosition/proposeTransfer.js.map +1 -0
- package/dist/functions/stockPosition/reduceQuantity.d.ts +12 -0
- package/dist/functions/stockPosition/reduceQuantity.d.ts.map +1 -0
- package/dist/functions/stockPosition/reduceQuantity.js +27 -0
- package/dist/functions/stockPosition/reduceQuantity.js.map +1 -0
- package/dist/functions/stockPosition/retractTransfer.d.ts +15 -0
- package/dist/functions/stockPosition/retractTransfer.d.ts.map +1 -0
- package/dist/functions/stockPosition/retractTransfer.js +28 -0
- package/dist/functions/stockPosition/retractTransfer.js.map +1 -0
- package/dist/functions/valuation/getValuationAsOcf.d.ts +28 -0
- package/dist/functions/valuation/getValuationAsOcf.d.ts.map +1 -0
- package/dist/functions/valuation/getValuationAsOcf.js +33 -0
- package/dist/functions/valuation/getValuationAsOcf.js.map +1 -0
- package/dist/functions/valuation/index.d.ts +4 -0
- package/dist/functions/valuation/index.d.ts.map +1 -0
- package/dist/functions/valuation/index.js +20 -0
- package/dist/functions/valuation/index.js.map +1 -0
- package/dist/functions/valuation/updateValuationData.d.ts +18 -0
- package/dist/functions/valuation/updateValuationData.d.ts.map +1 -0
- package/dist/functions/valuation/updateValuationData.js +58 -0
- package/dist/functions/valuation/updateValuationData.js.map +1 -0
- package/dist/functions/vestingTerms/createVestingTerms.d.ts +19 -0
- package/dist/functions/vestingTerms/createVestingTerms.d.ts.map +1 -0
- package/dist/functions/vestingTerms/createVestingTerms.js +45 -0
- package/dist/functions/vestingTerms/createVestingTerms.js.map +1 -0
- package/dist/functions/vestingTerms/getVestingTermsAsOcf.d.ts +23 -0
- package/dist/functions/vestingTerms/getVestingTermsAsOcf.d.ts.map +1 -0
- package/dist/functions/vestingTerms/getVestingTermsAsOcf.js +29 -0
- package/dist/functions/vestingTerms/getVestingTermsAsOcf.js.map +1 -0
- package/dist/functions/vestingTerms/index.d.ts +4 -0
- package/dist/functions/vestingTerms/index.d.ts.map +1 -0
- package/dist/functions/vestingTerms/index.js +20 -0
- package/dist/functions/vestingTerms/index.js.map +1 -0
- package/dist/functions/vestingTerms/updateVestingTerms.d.ts +18 -0
- package/dist/functions/vestingTerms/updateVestingTerms.d.ts.map +1 -0
- package/dist/functions/vestingTerms/updateVestingTerms.js +58 -0
- package/dist/functions/vestingTerms/updateVestingTerms.js.map +1 -0
- package/dist/functions/warrant/exerciseWarrant.d.ts +17 -0
- package/dist/functions/warrant/exerciseWarrant.d.ts.map +1 -0
- package/dist/functions/warrant/exerciseWarrant.js +32 -0
- package/dist/functions/warrant/exerciseWarrant.js.map +1 -0
- package/dist/functions/warrant/getWarrantAsOcf.d.ts +18 -0
- package/dist/functions/warrant/getWarrantAsOcf.d.ts.map +1 -0
- package/dist/functions/warrant/getWarrantAsOcf.js +21 -0
- package/dist/functions/warrant/getWarrantAsOcf.js.map +1 -0
- package/dist/functions/warrant/getWarrantExerciseEventAsOcf.d.ts +19 -0
- package/dist/functions/warrant/getWarrantExerciseEventAsOcf.d.ts.map +1 -0
- package/dist/functions/warrant/getWarrantExerciseEventAsOcf.js +21 -0
- package/dist/functions/warrant/getWarrantExerciseEventAsOcf.js.map +1 -0
- package/dist/functions/warrant/index.d.ts +8 -0
- package/dist/functions/warrant/index.d.ts.map +1 -0
- package/dist/functions/warrant/index.js +24 -0
- package/dist/functions/warrant/index.js.map +1 -0
- package/dist/functions/warrant/issueWarrant.d.ts +25 -0
- package/dist/functions/warrant/issueWarrant.d.ts.map +1 -0
- package/dist/functions/warrant/issueWarrant.js +49 -0
- package/dist/functions/warrant/issueWarrant.js.map +1 -0
- package/dist/functions/warrant/transferWarrant.d.ts +17 -0
- package/dist/functions/warrant/transferWarrant.d.ts.map +1 -0
- package/dist/functions/warrant/transferWarrant.js +30 -0
- package/dist/functions/warrant/transferWarrant.js.map +1 -0
- package/dist/types/native.d.ts +174 -10
- package/dist/types/native.d.ts.map +1 -1
- package/dist/utils/typeConversions.d.ts +30 -1
- package/dist/utils/typeConversions.d.ts.map +1 -1
- package/dist/utils/typeConversions.js +644 -37
- package/dist/utils/typeConversions.js.map +1 -1
- package/package.json +3 -3
- package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.d.ts +0 -13
- package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.d.ts.map +0 -1
- package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.js +0 -38
- package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.js.map +0 -1
|
@@ -13,14 +13,40 @@ exports.stockClassTypeToDaml = stockClassTypeToDaml;
|
|
|
13
13
|
exports.damlStockClassTypeToNative = damlStockClassTypeToNative;
|
|
14
14
|
exports.monetaryToDaml = monetaryToDaml;
|
|
15
15
|
exports.damlMonetaryToNative = damlMonetaryToNative;
|
|
16
|
+
exports.phoneTypeToDaml = phoneTypeToDaml;
|
|
17
|
+
exports.damlPhoneTypeToNative = damlPhoneTypeToNative;
|
|
18
|
+
exports.phoneToDaml = phoneToDaml;
|
|
19
|
+
exports.damlPhoneToNative = damlPhoneToNative;
|
|
16
20
|
exports.emailToDaml = emailToDaml;
|
|
17
21
|
exports.damlEmailToNative = damlEmailToNative;
|
|
18
22
|
exports.addressToDaml = addressToDaml;
|
|
19
23
|
exports.damlAddressToNative = damlAddressToNative;
|
|
24
|
+
exports.stakeholderTypeToDaml = stakeholderTypeToDaml;
|
|
25
|
+
exports.damlStakeholderTypeToNative = damlStakeholderTypeToNative;
|
|
26
|
+
exports.contactInfoToDaml = contactInfoToDaml;
|
|
27
|
+
exports.damlContactInfoToNative = damlContactInfoToNative;
|
|
28
|
+
exports.contactInfoWithoutNameToDaml = contactInfoWithoutNameToDaml;
|
|
29
|
+
exports.damlContactInfoWithoutNameToNative = damlContactInfoWithoutNameToNative;
|
|
20
30
|
exports.issuerDataToDaml = issuerDataToDaml;
|
|
21
31
|
exports.damlIssuerDataToNative = damlIssuerDataToNative;
|
|
22
32
|
exports.stockClassDataToDaml = stockClassDataToDaml;
|
|
23
33
|
exports.damlStockClassDataToNative = damlStockClassDataToNative;
|
|
34
|
+
exports.stakeholderDataToDaml = stakeholderDataToDaml;
|
|
35
|
+
exports.damlStakeholderDataToNative = damlStakeholderDataToNative;
|
|
36
|
+
exports.stockLegendTemplateDataToDaml = stockLegendTemplateDataToDaml;
|
|
37
|
+
exports.damlStockLegendTemplateDataToNative = damlStockLegendTemplateDataToNative;
|
|
38
|
+
exports.valuationDataToDaml = valuationDataToDaml;
|
|
39
|
+
exports.damlValuationDataToNative = damlValuationDataToNative;
|
|
40
|
+
exports.vestingTermsDataToDaml = vestingTermsDataToDaml;
|
|
41
|
+
exports.damlVestingTermsDataToNative = damlVestingTermsDataToNative;
|
|
42
|
+
exports.stockPlanDataToDaml = stockPlanDataToDaml;
|
|
43
|
+
exports.damlStockPlanDataToNative = damlStockPlanDataToNative;
|
|
44
|
+
exports.equityCompIssuanceDataToDaml = equityCompIssuanceDataToDaml;
|
|
45
|
+
exports.damlEquityCompIssuanceDataToNative = damlEquityCompIssuanceDataToNative;
|
|
46
|
+
exports.convertibleIssuanceToDaml = convertibleIssuanceToDaml;
|
|
47
|
+
exports.damlConvertibleIssuanceToNative = damlConvertibleIssuanceToNative;
|
|
48
|
+
exports.warrantIssuanceToDaml = warrantIssuanceToDaml;
|
|
49
|
+
exports.damlWarrantIssuanceToNative = damlWarrantIssuanceToNative;
|
|
24
50
|
// ===== Date Conversion Helpers =====
|
|
25
51
|
/**
|
|
26
52
|
* Convert a date string (YYYY-MM-DD) to DAML Time format (ISO string with 0 timestamp)
|
|
@@ -118,6 +144,37 @@ function damlMonetaryToNative(damlMonetary) {
|
|
|
118
144
|
currency: damlMonetary.currency
|
|
119
145
|
};
|
|
120
146
|
}
|
|
147
|
+
// ===== Phone Type Conversions =====
|
|
148
|
+
function phoneTypeToDaml(phoneType) {
|
|
149
|
+
switch (phoneType) {
|
|
150
|
+
case 'HOME': return 'OcfPhoneHome';
|
|
151
|
+
case 'MOBILE': return 'OcfPhoneMobile';
|
|
152
|
+
case 'BUSINESS': return 'OcfPhoneBusiness';
|
|
153
|
+
case 'OTHER': return 'OcfPhoneOther';
|
|
154
|
+
default: throw new Error(`Unknown phone type: ${phoneType}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function damlPhoneTypeToNative(damlType) {
|
|
158
|
+
switch (damlType) {
|
|
159
|
+
case 'OcfPhoneHome': return 'HOME';
|
|
160
|
+
case 'OcfPhoneMobile': return 'MOBILE';
|
|
161
|
+
case 'OcfPhoneBusiness': return 'BUSINESS';
|
|
162
|
+
case 'OcfPhoneOther': return 'OTHER';
|
|
163
|
+
default: throw new Error(`Unknown DAML phone type: ${damlType}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function phoneToDaml(phone) {
|
|
167
|
+
return {
|
|
168
|
+
phone_type: phoneTypeToDaml(phone.phone_type),
|
|
169
|
+
phone_number: phone.phone_number
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function damlPhoneToNative(phone) {
|
|
173
|
+
return {
|
|
174
|
+
phone_type: damlPhoneTypeToNative(phone.phone_type),
|
|
175
|
+
phone_number: phone.phone_number
|
|
176
|
+
};
|
|
177
|
+
}
|
|
121
178
|
// ===== Complex Object Conversions =====
|
|
122
179
|
function emailToDaml(email) {
|
|
123
180
|
return {
|
|
@@ -151,39 +208,110 @@ function damlAddressToNative(damlAddress) {
|
|
|
151
208
|
...(damlAddress.postal_code && { postal_code: damlAddress.postal_code })
|
|
152
209
|
};
|
|
153
210
|
}
|
|
211
|
+
// ===== Stakeholder Type Conversions =====
|
|
212
|
+
function stakeholderTypeToDaml(stakeholderType) {
|
|
213
|
+
switch (stakeholderType) {
|
|
214
|
+
case 'INDIVIDUAL':
|
|
215
|
+
return 'OcfStakeholderTypeIndividual';
|
|
216
|
+
case 'INSTITUTION':
|
|
217
|
+
return 'OcfStakeholderTypeInstitution';
|
|
218
|
+
default:
|
|
219
|
+
throw new Error(`Unknown stakeholder type: ${stakeholderType}`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function damlStakeholderTypeToNative(damlType) {
|
|
223
|
+
switch (damlType) {
|
|
224
|
+
case 'OcfStakeholderTypeIndividual':
|
|
225
|
+
return 'INDIVIDUAL';
|
|
226
|
+
case 'OcfStakeholderTypeInstitution':
|
|
227
|
+
return 'INSTITUTION';
|
|
228
|
+
default:
|
|
229
|
+
throw new Error(`Unknown DAML stakeholder type: ${damlType}`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// ===== Contact Info Conversions =====
|
|
233
|
+
function contactInfoToDaml(info) {
|
|
234
|
+
return {
|
|
235
|
+
name: info.name,
|
|
236
|
+
email: info.email ? emailToDaml(info.email) : null,
|
|
237
|
+
phone: info.phone ? phoneToDaml(info.phone) : null,
|
|
238
|
+
address: info.address ? addressToDaml(info.address) : null
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
function damlContactInfoToNative(damlInfo) {
|
|
242
|
+
return {
|
|
243
|
+
name: damlInfo.name,
|
|
244
|
+
...(damlInfo.email && { email: damlEmailToNative(damlInfo.email) }),
|
|
245
|
+
...(damlInfo.phone && { phone: damlPhoneToNative(damlInfo.phone) }),
|
|
246
|
+
...(damlInfo.address && { address: damlAddressToNative(damlInfo.address) })
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function contactInfoWithoutNameToDaml(info) {
|
|
250
|
+
return {
|
|
251
|
+
email: info.email ? emailToDaml(info.email) : null,
|
|
252
|
+
phone: info.phone ? phoneToDaml(info.phone) : null,
|
|
253
|
+
address: info.address ? addressToDaml(info.address) : null
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function damlContactInfoWithoutNameToNative(damlInfo) {
|
|
257
|
+
return {
|
|
258
|
+
...(damlInfo.email && { email: damlEmailToNative(damlInfo.email) }),
|
|
259
|
+
...(damlInfo.phone && { phone: damlPhoneToNative(damlInfo.phone) }),
|
|
260
|
+
...(damlInfo.address && { address: damlAddressToNative(damlInfo.address) })
|
|
261
|
+
};
|
|
262
|
+
}
|
|
154
263
|
// ===== Main Data Structure Conversions =====
|
|
155
264
|
function issuerDataToDaml(issuerData) {
|
|
156
265
|
return {
|
|
157
266
|
legal_name: issuerData.legal_name,
|
|
158
267
|
country_of_formation: issuerData.country_of_formation,
|
|
159
268
|
dba: issuerData.dba || null,
|
|
160
|
-
formation_date:
|
|
269
|
+
formation_date: dateStringToDAMLTime(issuerData.formation_date),
|
|
161
270
|
country_subdivision_of_formation: issuerData.country_subdivision_of_formation || null,
|
|
271
|
+
country_subdivision_name_of_formation: issuerData.country_subdivision_name_of_formation || null,
|
|
162
272
|
tax_ids: issuerData.tax_ids || null,
|
|
163
273
|
email: issuerData.email ? emailToDaml(issuerData.email) : null,
|
|
164
|
-
phone: issuerData.phone
|
|
274
|
+
phone: issuerData.phone ? phoneToDaml(issuerData.phone) : null,
|
|
165
275
|
address: issuerData.address ? addressToDaml(issuerData.address) : null,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
issuerData.initial_shares_authorized
|
|
276
|
+
// Map to DAML union: OcfInitialSharesAuthorized = Numeric | Enum
|
|
277
|
+
initial_shares_authorized: issuerData.initial_shares_authorized !== undefined && issuerData.initial_shares_authorized !== null
|
|
278
|
+
? (() => {
|
|
279
|
+
const v = issuerData.initial_shares_authorized;
|
|
280
|
+
if (typeof v === 'number' || (typeof v === 'string' && /^\d+(\.\d+)?$/.test(v))) {
|
|
281
|
+
return { tag: 'OcfInitialSharesNumeric', value: typeof v === 'number' ? v.toString() : v };
|
|
282
|
+
}
|
|
283
|
+
if (v === 'UNLIMITED') {
|
|
284
|
+
return { tag: 'OcfInitialSharesEnum', value: 'OcfAuthorizedSharesUnlimited' };
|
|
285
|
+
}
|
|
286
|
+
// Treat NOT_APPLICABLE and others as NotApplicable enum
|
|
287
|
+
return { tag: 'OcfInitialSharesEnum', value: 'OcfAuthorizedSharesNotApplicable' };
|
|
288
|
+
})()
|
|
289
|
+
: null,
|
|
290
|
+
comments: issuerData.comments || null
|
|
170
291
|
};
|
|
171
292
|
}
|
|
172
293
|
function damlIssuerDataToNative(damlData) {
|
|
173
294
|
return {
|
|
174
295
|
legal_name: damlData.legal_name || '',
|
|
175
296
|
country_of_formation: damlData.country_of_formation || '',
|
|
297
|
+
formation_date: damlData.formation_date ? damlTimeToDateString(damlData.formation_date) : '',
|
|
176
298
|
...(damlData.dba && { dba: damlData.dba }),
|
|
177
|
-
...(damlData.
|
|
178
|
-
|
|
179
|
-
country_subdivision_of_formation: damlData.country_subdivision_of_formation
|
|
180
|
-
}),
|
|
299
|
+
...(damlData.country_subdivision_of_formation && { country_subdivision_of_formation: damlData.country_subdivision_of_formation }),
|
|
300
|
+
// TODO: Expose country_subdivision_name_of_formation when SDK updates
|
|
181
301
|
...(damlData.tax_ids && { tax_ids: damlData.tax_ids }),
|
|
182
302
|
...(damlData.email && { email: damlEmailToNative(damlData.email) }),
|
|
183
|
-
...(damlData.phone && { phone: damlData.phone }),
|
|
303
|
+
...(damlData.phone && { phone: damlPhoneToNative(damlData.phone) }),
|
|
184
304
|
...(damlData.address && { address: damlAddressToNative(damlData.address) }),
|
|
185
305
|
...(damlData.initial_shares_authorized && {
|
|
186
|
-
initial_shares_authorized:
|
|
306
|
+
initial_shares_authorized: (() => {
|
|
307
|
+
const isa = damlData.initial_shares_authorized;
|
|
308
|
+
if (isa.tag === 'OcfInitialSharesNumeric')
|
|
309
|
+
return isa.value;
|
|
310
|
+
if (isa.tag === 'OcfInitialSharesEnum') {
|
|
311
|
+
return isa.value === 'OcfAuthorizedSharesUnlimited' ? 'UNLIMITED' : 'NOT_APPLICABLE';
|
|
312
|
+
}
|
|
313
|
+
return undefined;
|
|
314
|
+
})()
|
|
187
315
|
})
|
|
188
316
|
};
|
|
189
317
|
}
|
|
@@ -204,26 +332,49 @@ function stockClassDataToDaml(stockClassData) {
|
|
|
204
332
|
stockholder_approval_date: stockClassData.stockholder_approval_date ? dateStringToDAMLTime(stockClassData.stockholder_approval_date) : null,
|
|
205
333
|
par_value: stockClassData.par_value ? monetaryToDaml(stockClassData.par_value) : null,
|
|
206
334
|
price_per_share: stockClassData.price_per_share ? monetaryToDaml(stockClassData.price_per_share) : null,
|
|
207
|
-
conversion_rights: stockClassData.conversion_rights
|
|
208
|
-
|
|
335
|
+
conversion_rights: (stockClassData.conversion_rights || []).map((right) => {
|
|
336
|
+
// Mechanism mapping
|
|
337
|
+
const mechanism = right.conversion_mechanism === 'RATIO_CONVERSION'
|
|
338
|
+
? 'OcfConversionMechanismRatioConversion'
|
|
339
|
+
: right.conversion_mechanism === 'PERCENT_CONVERSION'
|
|
340
|
+
? 'OcfConversionMechanismPercentCapitalizationConversion'
|
|
341
|
+
: 'OcfConversionMechanismFixedAmountConversion';
|
|
342
|
+
// Trigger mapping - collapse to Automatic/Optional as per DAML type
|
|
343
|
+
const trigger = right.conversion_trigger.startsWith('AUTOMATIC')
|
|
344
|
+
? { tag: 'OcfConversionTriggerAutomatic' }
|
|
345
|
+
: { tag: 'OcfConversionTriggerOptional' };
|
|
346
|
+
// Ratio mapping if provided
|
|
347
|
+
let ratio = null;
|
|
348
|
+
const numerator = right.ratio_numerator ?? (right.ratio !== undefined ? right.ratio : undefined);
|
|
349
|
+
const denominator = right.ratio_denominator ?? (right.ratio !== undefined ? 1 : undefined);
|
|
350
|
+
if (numerator !== undefined && denominator !== undefined) {
|
|
351
|
+
ratio = { numerator: typeof numerator === 'number' ? numerator.toString() : String(numerator), denominator: typeof denominator === 'number' ? denominator.toString() : String(denominator) };
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
209
354
|
type_: right.type,
|
|
210
|
-
conversion_mechanism:
|
|
211
|
-
|
|
212
|
-
'OcfConversionMechanismFixedAmountConversion',
|
|
213
|
-
conversion_trigger: right.conversion_trigger === 'AUTOMATIC_ON_CONDITION' ? 'OcfConversionTriggerAutomatic' :
|
|
214
|
-
right.conversion_trigger === 'AUTOMATIC_ON_DATE' ? 'OcfConversionTriggerAutomatic' :
|
|
215
|
-
'OcfConversionTriggerOptional',
|
|
355
|
+
conversion_mechanism: mechanism,
|
|
356
|
+
conversion_trigger: trigger,
|
|
216
357
|
converts_to_stock_class_id: right.converts_to_stock_class_id,
|
|
217
|
-
|
|
218
|
-
|
|
358
|
+
ratio: ratio ? { tag: 'Some', value: ratio } : null,
|
|
359
|
+
percent_of_capitalization: right.percent_of_capitalization !== undefined ? { tag: 'Some', value: typeof right.percent_of_capitalization === 'number' ? right.percent_of_capitalization.toString() : String(right.percent_of_capitalization) } : null,
|
|
360
|
+
conversion_price: right.conversion_price ? { tag: 'Some', value: monetaryToDaml(right.conversion_price) } : null,
|
|
361
|
+
reference_share_price: right.reference_share_price ? { tag: 'Some', value: monetaryToDaml(right.reference_share_price) } : null,
|
|
362
|
+
reference_valuation_price_per_share: right.reference_valuation_price_per_share ? { tag: 'Some', value: monetaryToDaml(right.reference_valuation_price_per_share) } : null,
|
|
363
|
+
discount_rate: right.discount_rate !== undefined ? { tag: 'Some', value: typeof right.discount_rate === 'number' ? right.discount_rate.toString() : String(right.discount_rate) } : null,
|
|
364
|
+
valuation_cap: right.valuation_cap ? { tag: 'Some', value: monetaryToDaml(right.valuation_cap) } : null,
|
|
365
|
+
floor_price_per_share: right.floor_price_per_share ? { tag: 'Some', value: monetaryToDaml(right.floor_price_per_share) } : null,
|
|
366
|
+
ceiling_price_per_share: right.ceiling_price_per_share ? { tag: 'Some', value: monetaryToDaml(right.ceiling_price_per_share) } : null,
|
|
367
|
+
custom_description: right.custom_description ? { tag: 'Some', value: right.custom_description } : null,
|
|
219
368
|
expires_at: right.expires_at ? dateStringToDAMLTime(right.expires_at) : null
|
|
220
|
-
}
|
|
369
|
+
};
|
|
370
|
+
}),
|
|
221
371
|
liquidation_preference_multiple: stockClassData.liquidation_preference_multiple ?
|
|
222
372
|
(typeof stockClassData.liquidation_preference_multiple === 'number' ?
|
|
223
373
|
stockClassData.liquidation_preference_multiple.toString() : stockClassData.liquidation_preference_multiple) : null,
|
|
224
374
|
participation_cap_multiple: stockClassData.participation_cap_multiple ?
|
|
225
375
|
(typeof stockClassData.participation_cap_multiple === 'number' ?
|
|
226
|
-
stockClassData.participation_cap_multiple.toString() : stockClassData.participation_cap_multiple) : null
|
|
376
|
+
stockClassData.participation_cap_multiple.toString() : stockClassData.participation_cap_multiple) : null,
|
|
377
|
+
comments: stockClassData.comments || null
|
|
227
378
|
};
|
|
228
379
|
}
|
|
229
380
|
function damlStockClassDataToNative(damlData) {
|
|
@@ -249,19 +400,41 @@ function damlStockClassDataToNative(damlData) {
|
|
|
249
400
|
...(damlData.par_value && { par_value: damlMonetaryToNative(damlData.par_value) }),
|
|
250
401
|
...(damlData.price_per_share && { price_per_share: damlMonetaryToNative(damlData.price_per_share) }),
|
|
251
402
|
...(damlData.conversion_rights && damlData.conversion_rights.length > 0 && {
|
|
252
|
-
conversion_rights: damlData.conversion_rights.map(right =>
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
right.conversion_mechanism === '
|
|
256
|
-
'
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
403
|
+
conversion_rights: damlData.conversion_rights.map((right) => {
|
|
404
|
+
const mechanism = right.conversion_mechanism === 'OcfConversionMechanismRatioConversion'
|
|
405
|
+
? 'RATIO_CONVERSION'
|
|
406
|
+
: right.conversion_mechanism === 'OcfConversionMechanismPercentCapitalizationConversion'
|
|
407
|
+
? 'PERCENT_CONVERSION'
|
|
408
|
+
: 'FIXED_AMOUNT_CONVERSION';
|
|
409
|
+
const isAutomatic = right.conversion_trigger?.tag
|
|
410
|
+
? right.conversion_trigger.tag === 'OcfConversionTriggerAutomatic'
|
|
411
|
+
: right.conversion_trigger === 'OcfConversionTriggerAutomatic';
|
|
412
|
+
const trigger = isAutomatic ? 'AUTOMATIC_ON_CONDITION' : 'ELECTIVE_AT_WILL';
|
|
413
|
+
let ratioValue;
|
|
414
|
+
if (right.ratio && right.ratio.tag === 'Some') {
|
|
415
|
+
const r = right.ratio.value;
|
|
416
|
+
const num = parseFloat(r.numerator || '1');
|
|
417
|
+
const den = parseFloat(r.denominator || '1');
|
|
418
|
+
ratioValue = den !== 0 ? num / den : undefined;
|
|
419
|
+
}
|
|
420
|
+
return {
|
|
421
|
+
type: right.type_,
|
|
422
|
+
conversion_mechanism: mechanism,
|
|
423
|
+
conversion_trigger: trigger,
|
|
424
|
+
converts_to_stock_class_id: right.converts_to_stock_class_id,
|
|
425
|
+
...(ratioValue !== undefined ? { ratio: ratioValue } : {}),
|
|
426
|
+
...(right.conversion_price && right.conversion_price.tag === 'Some' && { conversion_price: damlMonetaryToNative(right.conversion_price.value) }),
|
|
427
|
+
...(right.reference_share_price && right.reference_share_price.tag === 'Some' && { reference_share_price: damlMonetaryToNative(right.reference_share_price.value) }),
|
|
428
|
+
...(right.reference_valuation_price_per_share && right.reference_valuation_price_per_share.tag === 'Some' && { reference_valuation_price_per_share: damlMonetaryToNative(right.reference_valuation_price_per_share.value) }),
|
|
429
|
+
...(right.percent_of_capitalization && right.percent_of_capitalization.tag === 'Some' && { percent_of_capitalization: parseFloat(right.percent_of_capitalization.value) }),
|
|
430
|
+
...(right.discount_rate && right.discount_rate.tag === 'Some' && { discount_rate: parseFloat(right.discount_rate.value) }),
|
|
431
|
+
...(right.valuation_cap && right.valuation_cap.tag === 'Some' && { valuation_cap: damlMonetaryToNative(right.valuation_cap.value) }),
|
|
432
|
+
...(right.floor_price_per_share && right.floor_price_per_share.tag === 'Some' && { floor_price_per_share: damlMonetaryToNative(right.floor_price_per_share.value) }),
|
|
433
|
+
...(right.ceiling_price_per_share && right.ceiling_price_per_share.tag === 'Some' && { ceiling_price_per_share: damlMonetaryToNative(right.ceiling_price_per_share.value) }),
|
|
434
|
+
...(right.custom_description && right.custom_description.tag === 'Some' && { custom_description: right.custom_description.value }),
|
|
435
|
+
...(right.expires_at && { expires_at: damlTimeToDateString(right.expires_at) })
|
|
436
|
+
};
|
|
437
|
+
})
|
|
265
438
|
}),
|
|
266
439
|
...(damlData.liquidation_preference_multiple && {
|
|
267
440
|
liquidation_preference_multiple: damlData.liquidation_preference_multiple
|
|
@@ -271,4 +444,438 @@ function damlStockClassDataToNative(damlData) {
|
|
|
271
444
|
})
|
|
272
445
|
};
|
|
273
446
|
}
|
|
447
|
+
// ===== Stakeholder Data Conversions =====
|
|
448
|
+
function stakeholderDataToDaml(data) {
|
|
449
|
+
const payload = {
|
|
450
|
+
name: data.name,
|
|
451
|
+
stakeholder_type: stakeholderTypeToDaml(data.stakeholder_type),
|
|
452
|
+
issuer_assigned_id: data.issuer_assigned_id || null,
|
|
453
|
+
primary_contact: data.primary_contact ? contactInfoToDaml(data.primary_contact) : null,
|
|
454
|
+
contact_info: data.contact_info ? contactInfoWithoutNameToDaml(data.contact_info) : null,
|
|
455
|
+
addresses: (data.addresses || []).map(addressToDaml),
|
|
456
|
+
tax_ids: (data.tax_ids || []),
|
|
457
|
+
comments: data.comments || null
|
|
458
|
+
};
|
|
459
|
+
if (data.current_relationships && data.current_relationships.length) {
|
|
460
|
+
payload.current_relationships = data.current_relationships;
|
|
461
|
+
}
|
|
462
|
+
if (data.current_status) {
|
|
463
|
+
payload.current_status = (data.current_status === 'ACTIVE' ? 'OcfStakeholderStatusActive' :
|
|
464
|
+
data.current_status === 'LEAVE_OF_ABSENCE' ? 'OcfStakeholderStatusLeaveOfAbsence' :
|
|
465
|
+
data.current_status === 'TERMINATION_VOLUNTARY_OTHER' ? 'OcfStakeholderStatusTerminationVoluntaryOther' :
|
|
466
|
+
data.current_status === 'TERMINATION_VOLUNTARY_GOOD_CAUSE' ? 'OcfStakeholderStatusTerminationVoluntaryGoodCause' :
|
|
467
|
+
data.current_status === 'TERMINATION_VOLUNTARY_RETIREMENT' ? 'OcfStakeholderStatusTerminationVoluntaryRetirement' :
|
|
468
|
+
data.current_status === 'TERMINATION_INVOLUNTARY_OTHER' ? 'OcfStakeholderStatusTerminationInvoluntaryOther' :
|
|
469
|
+
data.current_status === 'TERMINATION_INVOLUNTARY_DEATH' ? 'OcfStakeholderStatusTerminationInvoluntaryDeath' :
|
|
470
|
+
data.current_status === 'TERMINATION_INVOLUNTARY_DISABILITY' ? 'OcfStakeholderStatusTerminationInvoluntaryDisability' :
|
|
471
|
+
'OcfStakeholderStatusTerminationInvoluntaryWithCause');
|
|
472
|
+
}
|
|
473
|
+
return payload;
|
|
474
|
+
}
|
|
475
|
+
function damlStakeholderDataToNative(damlData) {
|
|
476
|
+
const dAny = damlData;
|
|
477
|
+
const native = {
|
|
478
|
+
name: damlData.name || '',
|
|
479
|
+
stakeholder_type: damlStakeholderTypeToNative(damlData.stakeholder_type),
|
|
480
|
+
...(damlData.issuer_assigned_id && { issuer_assigned_id: damlData.issuer_assigned_id }),
|
|
481
|
+
...(dAny.current_relationships && { current_relationships: dAny.current_relationships }),
|
|
482
|
+
...(dAny.current_status && { current_status: (() => {
|
|
483
|
+
const s = dAny.current_status;
|
|
484
|
+
switch (s) {
|
|
485
|
+
case 'OcfStakeholderStatusActive': return 'ACTIVE';
|
|
486
|
+
case 'OcfStakeholderStatusLeaveOfAbsence': return 'LEAVE_OF_ABSENCE';
|
|
487
|
+
case 'OcfStakeholderStatusTerminationVoluntaryOther': return 'TERMINATION_VOLUNTARY_OTHER';
|
|
488
|
+
case 'OcfStakeholderStatusTerminationVoluntaryGoodCause': return 'TERMINATION_VOLUNTARY_GOOD_CAUSE';
|
|
489
|
+
case 'OcfStakeholderStatusTerminationVoluntaryRetirement': return 'TERMINATION_VOLUNTARY_RETIREMENT';
|
|
490
|
+
case 'OcfStakeholderStatusTerminationInvoluntaryOther': return 'TERMINATION_INVOLUNTARY_OTHER';
|
|
491
|
+
case 'OcfStakeholderStatusTerminationInvoluntaryDeath': return 'TERMINATION_INVOLUNTARY_DEATH';
|
|
492
|
+
case 'OcfStakeholderStatusTerminationInvoluntaryDisability': return 'TERMINATION_INVOLUNTARY_DISABILITY';
|
|
493
|
+
case 'OcfStakeholderStatusTerminationInvoluntaryWithCause': return 'TERMINATION_INVOLUNTARY_WITH_CAUSE';
|
|
494
|
+
default: return undefined;
|
|
495
|
+
}
|
|
496
|
+
})() }),
|
|
497
|
+
...(damlData.primary_contact && { primary_contact: damlContactInfoToNative(damlData.primary_contact) }),
|
|
498
|
+
...(damlData.contact_info && { contact_info: damlContactInfoWithoutNameToNative(damlData.contact_info) }),
|
|
499
|
+
addresses: (damlData.addresses || []).map(damlAddressToNative),
|
|
500
|
+
tax_ids: (damlData.tax_ids || []),
|
|
501
|
+
...(damlData.comments && { comments: damlData.comments })
|
|
502
|
+
};
|
|
503
|
+
return native;
|
|
504
|
+
}
|
|
505
|
+
// ===== Stock Legend Template Conversions =====
|
|
506
|
+
function stockLegendTemplateDataToDaml(data) {
|
|
507
|
+
return {
|
|
508
|
+
name: data.name,
|
|
509
|
+
text: data.text,
|
|
510
|
+
comments: data.comments || null
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function damlStockLegendTemplateDataToNative(damlData) {
|
|
514
|
+
return {
|
|
515
|
+
name: damlData.name || '',
|
|
516
|
+
text: damlData.text || '',
|
|
517
|
+
...(damlData.comments && { comments: damlData.comments })
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
// ===== Valuation Conversions =====
|
|
521
|
+
function valuationTypeToDaml(t) {
|
|
522
|
+
switch (t) {
|
|
523
|
+
case '409A':
|
|
524
|
+
return 'OcfValuationType409A';
|
|
525
|
+
default:
|
|
526
|
+
throw new Error(`Unknown valuation type: ${t}`);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function damlValuationTypeToNative(t) {
|
|
530
|
+
switch (t) {
|
|
531
|
+
case 'OcfValuationType409A':
|
|
532
|
+
return '409A';
|
|
533
|
+
default:
|
|
534
|
+
throw new Error(`Unknown DAML valuation type: ${t}`);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
function valuationDataToDaml(data) {
|
|
538
|
+
return {
|
|
539
|
+
provider: data.provider || null,
|
|
540
|
+
board_approval_date: data.board_approval_date ? dateStringToDAMLTime(data.board_approval_date) : null,
|
|
541
|
+
stockholder_approval_date: data.stockholder_approval_date ? dateStringToDAMLTime(data.stockholder_approval_date) : null,
|
|
542
|
+
comments: data.comments || null,
|
|
543
|
+
price_per_share: monetaryToDaml(data.price_per_share),
|
|
544
|
+
effective_date: dateStringToDAMLTime(data.effective_date),
|
|
545
|
+
valuation_type: valuationTypeToDaml(data.valuation_type)
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
function damlValuationDataToNative(d) {
|
|
549
|
+
return {
|
|
550
|
+
...(d.provider && { provider: d.provider }),
|
|
551
|
+
...(d.board_approval_date && { board_approval_date: damlTimeToDateString(d.board_approval_date) }),
|
|
552
|
+
...(d.stockholder_approval_date && { stockholder_approval_date: damlTimeToDateString(d.stockholder_approval_date) }),
|
|
553
|
+
...(d.comments && { comments: d.comments }),
|
|
554
|
+
price_per_share: damlMonetaryToNative(d.price_per_share),
|
|
555
|
+
effective_date: damlTimeToDateString(d.effective_date),
|
|
556
|
+
valuation_type: damlValuationTypeToNative(d.valuation_type)
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
// ===== Vesting Terms Conversions =====
|
|
560
|
+
function allocationTypeToDaml(t) {
|
|
561
|
+
switch (t) {
|
|
562
|
+
case 'CUMULATIVE_ROUNDING': return 'OcfAllocationCumulativeRounding';
|
|
563
|
+
case 'CUMULATIVE_ROUND_DOWN': return 'OcfAllocationCumulativeRoundDown';
|
|
564
|
+
case 'FRONT_LOADED': return 'OcfAllocationFrontLoaded';
|
|
565
|
+
case 'BACK_LOADED': return 'OcfAllocationBackLoaded';
|
|
566
|
+
case 'FRONT_LOADED_SINGLE_TRANCHE': return 'OcfAllocationFrontLoadedToSingleTranche';
|
|
567
|
+
case 'BACK_LOADED_SINGLE_TRANCHE': return 'OcfAllocationBackLoadedToSingleTranche';
|
|
568
|
+
case 'FRACTIONAL': return 'OcfAllocationFractional';
|
|
569
|
+
default: throw new Error(`Unknown allocation type: ${t}`);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
function damlAllocationTypeToNative(t) {
|
|
573
|
+
switch (t) {
|
|
574
|
+
case 'OcfAllocationCumulativeRounding': return 'CUMULATIVE_ROUNDING';
|
|
575
|
+
case 'OcfAllocationCumulativeRoundDown': return 'CUMULATIVE_ROUND_DOWN';
|
|
576
|
+
case 'OcfAllocationFrontLoaded': return 'FRONT_LOADED';
|
|
577
|
+
case 'OcfAllocationBackLoaded': return 'BACK_LOADED';
|
|
578
|
+
case 'OcfAllocationFrontLoadedToSingleTranche': return 'FRONT_LOADED_SINGLE_TRANCHE';
|
|
579
|
+
case 'OcfAllocationBackLoadedToSingleTranche': return 'BACK_LOADED_SINGLE_TRANCHE';
|
|
580
|
+
case 'OcfAllocationFractional': return 'FRACTIONAL';
|
|
581
|
+
default: throw new Error(`Unknown DAML allocation type: ${t}`);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
function vestingPeriodToDaml(p) {
|
|
585
|
+
switch (p.type) {
|
|
586
|
+
case 'DAYS': return { tag: 'OcfVestingPeriodDays', value: p.value };
|
|
587
|
+
case 'MONTHS': return { tag: 'OcfVestingPeriodMonths', value: p.value };
|
|
588
|
+
default: throw new Error('Unknown vesting period');
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
function damlVestingPeriodToNative(p) {
|
|
592
|
+
if (p.tag === 'OcfVestingPeriodDays')
|
|
593
|
+
return { type: 'DAYS', value: p.value };
|
|
594
|
+
if (p.tag === 'OcfVestingPeriodMonths')
|
|
595
|
+
return { type: 'MONTHS', value: p.value };
|
|
596
|
+
throw new Error('Unknown DAML vesting period');
|
|
597
|
+
}
|
|
598
|
+
function vestingTriggerToDaml(t) {
|
|
599
|
+
switch (t.kind) {
|
|
600
|
+
case 'START':
|
|
601
|
+
return { tag: 'OcfVestingStartTrigger' };
|
|
602
|
+
case 'SCHEDULE_ABSOLUTE':
|
|
603
|
+
return { tag: 'OcfVestingScheduleAbsoluteTrigger', value: dateStringToDAMLTime(t.at) };
|
|
604
|
+
case 'SCHEDULE_RELATIVE':
|
|
605
|
+
return {
|
|
606
|
+
tag: 'OcfVestingScheduleRelativeTrigger',
|
|
607
|
+
value: {
|
|
608
|
+
period: vestingPeriodToDaml(t.period),
|
|
609
|
+
relative_to_condition_id: t.relative_to_condition_id
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
case 'EVENT':
|
|
613
|
+
return { tag: 'OcfVestingEventTrigger' };
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function damlVestingTriggerToNative(t) {
|
|
617
|
+
if (t === 'OcfVestingStartTrigger')
|
|
618
|
+
return { kind: 'START' };
|
|
619
|
+
if (t.tag === 'OcfVestingScheduleAbsoluteTrigger')
|
|
620
|
+
return { kind: 'SCHEDULE_ABSOLUTE', at: damlTimeToDateString(t.value) };
|
|
621
|
+
if (t.tag === 'OcfVestingScheduleRelativeTrigger')
|
|
622
|
+
return {
|
|
623
|
+
kind: 'SCHEDULE_RELATIVE',
|
|
624
|
+
period: damlVestingPeriodToNative(t.value.period),
|
|
625
|
+
relative_to_condition_id: t.value.relative_to_condition_id
|
|
626
|
+
};
|
|
627
|
+
if (t === 'OcfVestingEventTrigger')
|
|
628
|
+
return { kind: 'EVENT' };
|
|
629
|
+
throw new Error('Unknown DAML vesting trigger');
|
|
630
|
+
}
|
|
631
|
+
function vestingConditionPortionToDaml(p) {
|
|
632
|
+
return {
|
|
633
|
+
numerator: typeof p.numerator === 'number' ? p.numerator.toString() : p.numerator,
|
|
634
|
+
denominator: typeof p.denominator === 'number' ? p.denominator.toString() : p.denominator,
|
|
635
|
+
remainder: p.remainder
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
function damlVestingConditionPortionToNative(p) {
|
|
639
|
+
return {
|
|
640
|
+
numerator: p.numerator,
|
|
641
|
+
denominator: p.denominator,
|
|
642
|
+
remainder: p.remainder
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
function vestingConditionToDaml(c) {
|
|
646
|
+
return {
|
|
647
|
+
id_: c.id,
|
|
648
|
+
description: c.description || null,
|
|
649
|
+
portion: c.portion ? { tag: 'Some', value: vestingConditionPortionToDaml(c.portion) } : null,
|
|
650
|
+
quantity: c.quantity !== undefined ? (typeof c.quantity === 'number' ? c.quantity.toString() : c.quantity) : null,
|
|
651
|
+
trigger: vestingTriggerToDaml(c.trigger),
|
|
652
|
+
next_condition_ids: c.next_condition_ids
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
function damlVestingConditionToNative(c) {
|
|
656
|
+
return {
|
|
657
|
+
id: c.id_ || '',
|
|
658
|
+
...(c.description && { description: c.description }),
|
|
659
|
+
...(c.portion && { portion: damlVestingConditionPortionToNative(c.portion) }),
|
|
660
|
+
...(c.quantity && { quantity: c.quantity }),
|
|
661
|
+
trigger: damlVestingTriggerToNative(c.trigger),
|
|
662
|
+
next_condition_ids: c.next_condition_ids || []
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
function vestingTermsDataToDaml(d) {
|
|
666
|
+
return {
|
|
667
|
+
name: d.name,
|
|
668
|
+
description: d.description,
|
|
669
|
+
allocation_type: allocationTypeToDaml(d.allocation_type),
|
|
670
|
+
vesting_conditions: d.vesting_conditions.map(vestingConditionToDaml),
|
|
671
|
+
comments: d.comments || null
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
function damlVestingTermsDataToNative(d) {
|
|
675
|
+
return {
|
|
676
|
+
name: d.name || '',
|
|
677
|
+
description: d.description || '',
|
|
678
|
+
allocation_type: damlAllocationTypeToNative(d.allocation_type),
|
|
679
|
+
vesting_conditions: (d.vesting_conditions || []).map(damlVestingConditionToNative),
|
|
680
|
+
...(d.comments && { comments: d.comments })
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
// ===== Stock Plan Conversions =====
|
|
684
|
+
function cancellationBehaviorToDaml(b) {
|
|
685
|
+
if (!b)
|
|
686
|
+
return null;
|
|
687
|
+
switch (b) {
|
|
688
|
+
case 'RETIRE': return 'OcfPlanCancelRetire';
|
|
689
|
+
case 'RETURN_TO_POOL': return 'OcfPlanCancelReturnToPool';
|
|
690
|
+
case 'HOLD_AS_CAPITAL_STOCK': return 'OcfPlanCancelHoldAsCapitalStock';
|
|
691
|
+
case 'DEFINED_PER_PLAN_SECURITY': return 'OcfPlanCancelDefinedPerPlanSecurity';
|
|
692
|
+
default: throw new Error('Unknown cancellation behavior');
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
function damlCancellationBehaviorToNative(b) {
|
|
696
|
+
switch (b) {
|
|
697
|
+
case 'OcfPlanCancelRetire': return 'RETIRE';
|
|
698
|
+
case 'OcfPlanCancelReturnToPool': return 'RETURN_TO_POOL';
|
|
699
|
+
case 'OcfPlanCancelHoldAsCapitalStock': return 'HOLD_AS_CAPITAL_STOCK';
|
|
700
|
+
case 'OcfPlanCancelDefinedPerPlanSecurity': return 'DEFINED_PER_PLAN_SECURITY';
|
|
701
|
+
default: return undefined;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function stockPlanDataToDaml(d) {
|
|
705
|
+
return {
|
|
706
|
+
plan_name: d.plan_name,
|
|
707
|
+
board_approval_date: d.board_approval_date ? dateStringToDAMLTime(d.board_approval_date) : null,
|
|
708
|
+
stockholder_approval_date: d.stockholder_approval_date ? dateStringToDAMLTime(d.stockholder_approval_date) : null,
|
|
709
|
+
initial_shares_reserved: typeof d.initial_shares_reserved === 'number' ? d.initial_shares_reserved.toString() : d.initial_shares_reserved,
|
|
710
|
+
default_cancellation_behavior: cancellationBehaviorToDaml(d.default_cancellation_behavior),
|
|
711
|
+
comments: d.comments || null
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
function damlStockPlanDataToNative(d) {
|
|
715
|
+
return {
|
|
716
|
+
plan_name: d.plan_name || '',
|
|
717
|
+
...(d.board_approval_date && { board_approval_date: damlTimeToDateString(d.board_approval_date) }),
|
|
718
|
+
...(d.stockholder_approval_date && { stockholder_approval_date: damlTimeToDateString(d.stockholder_approval_date) }),
|
|
719
|
+
initial_shares_reserved: d.initial_shares_reserved || '0',
|
|
720
|
+
...(d.default_cancellation_behavior && { default_cancellation_behavior: damlCancellationBehaviorToNative(d.default_cancellation_behavior) }),
|
|
721
|
+
...(d.comments && { comments: d.comments })
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
// ===== Equity Compensation Issuance Conversions =====
|
|
725
|
+
function compensationTypeToDaml(t) {
|
|
726
|
+
switch (t) {
|
|
727
|
+
case 'OPTION_NSO': return 'OcfCompensationTypeOptionNSO';
|
|
728
|
+
case 'OPTION_ISO': return 'OcfCompensationTypeOptionISO';
|
|
729
|
+
case 'OPTION': return 'OcfCompensationTypeOption';
|
|
730
|
+
case 'RSU': return 'OcfCompensationTypeRSU';
|
|
731
|
+
case 'CSAR': return 'OcfCompensationTypeCSAR';
|
|
732
|
+
case 'SSAR': return 'OcfCompensationTypeSSAR';
|
|
733
|
+
default: throw new Error('Unknown compensation type');
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
function damlCompensationTypeToNative(t) {
|
|
737
|
+
switch (t) {
|
|
738
|
+
case 'OcfCompensationTypeOptionNSO': return 'OPTION_NSO';
|
|
739
|
+
case 'OcfCompensationTypeOptionISO': return 'OPTION_ISO';
|
|
740
|
+
case 'OcfCompensationTypeOption': return 'OPTION';
|
|
741
|
+
case 'OcfCompensationTypeRSU': return 'RSU';
|
|
742
|
+
case 'OcfCompensationTypeCSAR': return 'CSAR';
|
|
743
|
+
case 'OcfCompensationTypeSSAR': return 'SSAR';
|
|
744
|
+
default: throw new Error('Unknown DAML compensation type');
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
function terminationWindowToDaml(w) {
|
|
748
|
+
const reasonMap = {
|
|
749
|
+
VOLUNTARY_OTHER: 'OcfTermVoluntaryOther',
|
|
750
|
+
VOLUNTARY_GOOD_CAUSE: 'OcfTermVoluntaryGoodCause',
|
|
751
|
+
VOLUNTARY_RETIREMENT: 'OcfTermVoluntaryRetirement',
|
|
752
|
+
INVOLUNTARY_OTHER: 'OcfTermInvoluntaryOther',
|
|
753
|
+
INVOLUNTARY_DEATH: 'OcfTermInvoluntaryDeath',
|
|
754
|
+
INVOLUNTARY_DISABILITY: 'OcfTermInvoluntaryDisability',
|
|
755
|
+
INVOLUNTARY_WITH_CAUSE: 'OcfTermInvoluntaryWithCause'
|
|
756
|
+
};
|
|
757
|
+
const periodTypeMap = {
|
|
758
|
+
DAYS: 'OcfPeriodDays',
|
|
759
|
+
MONTHS: 'OcfPeriodMonths'
|
|
760
|
+
};
|
|
761
|
+
return {
|
|
762
|
+
reason: reasonMap[w.reason],
|
|
763
|
+
period: w.period,
|
|
764
|
+
period_type: periodTypeMap[w.period_type]
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
function damlTerminationWindowToNative(w) {
|
|
768
|
+
const reasonMap = {
|
|
769
|
+
OcfTermVoluntaryOther: 'VOLUNTARY_OTHER',
|
|
770
|
+
OcfTermVoluntaryGoodCause: 'VOLUNTARY_GOOD_CAUSE',
|
|
771
|
+
OcfTermVoluntaryRetirement: 'VOLUNTARY_RETIREMENT',
|
|
772
|
+
OcfTermInvoluntaryOther: 'INVOLUNTARY_OTHER',
|
|
773
|
+
OcfTermInvoluntaryDeath: 'INVOLUNTARY_DEATH',
|
|
774
|
+
OcfTermInvoluntaryDisability: 'INVOLUNTARY_DISABILITY',
|
|
775
|
+
OcfTermInvoluntaryWithCause: 'INVOLUNTARY_WITH_CAUSE'
|
|
776
|
+
};
|
|
777
|
+
const periodTypeMap = {
|
|
778
|
+
OcfPeriodDays: 'DAYS',
|
|
779
|
+
OcfPeriodMonths: 'MONTHS'
|
|
780
|
+
};
|
|
781
|
+
return {
|
|
782
|
+
reason: reasonMap[w.reason],
|
|
783
|
+
period: w.period,
|
|
784
|
+
period_type: periodTypeMap[w.period_type]
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
function equityCompIssuanceDataToDaml(d) {
|
|
788
|
+
return {
|
|
789
|
+
compensation_type: compensationTypeToDaml(d.compensation_type),
|
|
790
|
+
quantity: typeof d.quantity === 'number' ? d.quantity.toString() : d.quantity,
|
|
791
|
+
exercise_price: d.exercise_price ? monetaryToDaml(d.exercise_price) : null,
|
|
792
|
+
base_price: d.base_price ? monetaryToDaml(d.base_price) : null,
|
|
793
|
+
early_exercisable: d.early_exercisable === undefined ? null : d.early_exercisable,
|
|
794
|
+
vestings: d.vestings ? d.vestings.map(v => ({ date: dateStringToDAMLTime(v.date), amount: typeof v.amount === 'number' ? v.amount.toString() : v.amount })) : null,
|
|
795
|
+
expiration_date: d.expiration_date ? dateStringToDAMLTime(d.expiration_date) : null,
|
|
796
|
+
termination_exercise_windows: d.termination_exercise_windows.map(terminationWindowToDaml),
|
|
797
|
+
comments: d.comments || null
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
function damlEquityCompIssuanceDataToNative(d) {
|
|
801
|
+
return {
|
|
802
|
+
compensation_type: damlCompensationTypeToNative(d.compensation_type),
|
|
803
|
+
quantity: d.quantity,
|
|
804
|
+
...(d.exercise_price && { exercise_price: damlMonetaryToNative(d.exercise_price) }),
|
|
805
|
+
...(d.base_price && { base_price: damlMonetaryToNative(d.base_price) }),
|
|
806
|
+
...(d.early_exercisable !== null && d.early_exercisable !== undefined && { early_exercisable: d.early_exercisable }),
|
|
807
|
+
...(d.vestings && { vestings: d.vestings.map((v) => ({ date: damlTimeToDateString(v.date), amount: v.amount })) }),
|
|
808
|
+
...(d.expiration_date && { expiration_date: damlTimeToDateString(d.expiration_date) }),
|
|
809
|
+
termination_exercise_windows: d.termination_exercise_windows.map(damlTerminationWindowToNative),
|
|
810
|
+
...(d.comments && { comments: d.comments })
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
// ===== Convertible & Warrant Conversions =====
|
|
814
|
+
function convertibleTypeToDaml(t) {
|
|
815
|
+
switch (t) {
|
|
816
|
+
case 'NOTE': return 'OcfConvertibleNote';
|
|
817
|
+
case 'SAFE': return 'OcfConvertibleSafe';
|
|
818
|
+
case 'SECURITY': return 'OcfConvertibleSecurity';
|
|
819
|
+
default: throw new Error('Unknown convertible type');
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
function damlConvertibleTypeToNative(t) {
|
|
823
|
+
switch (t) {
|
|
824
|
+
case 'OcfConvertibleNote': return 'NOTE';
|
|
825
|
+
case 'OcfConvertibleSafe': return 'SAFE';
|
|
826
|
+
case 'OcfConvertibleSecurity': return 'SECURITY';
|
|
827
|
+
default: throw new Error('Unknown DAML convertible type');
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
function simpleTriggerToDaml(t) {
|
|
831
|
+
return (t === 'AUTOMATIC'
|
|
832
|
+
? { tag: 'OcfConversionTriggerAutomatic' }
|
|
833
|
+
: { tag: 'OcfConversionTriggerOptional' });
|
|
834
|
+
}
|
|
835
|
+
function damlSimpleTriggerToNative(t) {
|
|
836
|
+
const tag = t?.tag || t;
|
|
837
|
+
return tag === 'OcfConversionTriggerAutomatic' ? 'AUTOMATIC' : 'OPTIONAL';
|
|
838
|
+
}
|
|
839
|
+
function convertibleIssuanceToDaml(d) {
|
|
840
|
+
return {
|
|
841
|
+
investment_amount: monetaryToDaml(d.investment_amount),
|
|
842
|
+
convertible_type: convertibleTypeToDaml(d.convertible_type),
|
|
843
|
+
conversion_triggers: d.conversion_triggers.map(t => (t === 'AUTOMATIC' ? { tag: 'OcfConversionTriggerAutomatic' } : { tag: 'OcfConversionTriggerOptional' })),
|
|
844
|
+
seniority: d.seniority,
|
|
845
|
+
pro_rata: d.pro_rata !== undefined ? (typeof d.pro_rata === 'number' ? d.pro_rata.toString() : d.pro_rata) : null,
|
|
846
|
+
comments: d.comments || null
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
function damlConvertibleIssuanceToNative(d) {
|
|
850
|
+
return {
|
|
851
|
+
investment_amount: damlMonetaryToNative(d.investment_amount),
|
|
852
|
+
convertible_type: damlConvertibleTypeToNative(d.convertible_type),
|
|
853
|
+
conversion_triggers: d.conversion_triggers.map((t) => (t?.tag === 'OcfConversionTriggerAutomatic' ? 'AUTOMATIC' : 'OPTIONAL')),
|
|
854
|
+
seniority: d.seniority,
|
|
855
|
+
...(d.pro_rata && { pro_rata: d.pro_rata }),
|
|
856
|
+
...(d.comments && { comments: d.comments })
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
function warrantIssuanceToDaml(d) {
|
|
860
|
+
return {
|
|
861
|
+
quantity: typeof d.quantity === 'number' ? d.quantity.toString() : d.quantity,
|
|
862
|
+
exercise_price: monetaryToDaml(d.exercise_price),
|
|
863
|
+
purchase_price: monetaryToDaml(d.purchase_price),
|
|
864
|
+
exercise_triggers: d.exercise_triggers.map(t => (t === 'AUTOMATIC' ? { tag: 'OcfConversionTriggerAutomatic' } : { tag: 'OcfConversionTriggerOptional' })),
|
|
865
|
+
warrant_expiration_date: d.warrant_expiration_date ? dateStringToDAMLTime(d.warrant_expiration_date) : null,
|
|
866
|
+
vesting_terms_id: d.vesting_terms_id || null,
|
|
867
|
+
comments: d.comments || null
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
function damlWarrantIssuanceToNative(d) {
|
|
871
|
+
return {
|
|
872
|
+
quantity: d.quantity,
|
|
873
|
+
exercise_price: damlMonetaryToNative(d.exercise_price),
|
|
874
|
+
purchase_price: damlMonetaryToNative(d.purchase_price),
|
|
875
|
+
exercise_triggers: d.exercise_triggers.map((t) => (t?.tag === 'OcfConversionTriggerAutomatic' ? 'AUTOMATIC' : 'OPTIONAL')),
|
|
876
|
+
...(d.warrant_expiration_date && { warrant_expiration_date: damlTimeToDateString(d.warrant_expiration_date) }),
|
|
877
|
+
...(d.vesting_terms_id && { vesting_terms_id: d.vesting_terms_id }),
|
|
878
|
+
...(d.comments && { comments: d.comments })
|
|
879
|
+
};
|
|
880
|
+
}
|
|
274
881
|
//# sourceMappingURL=typeConversions.js.map
|