@open-captable-protocol/canton 0.2.204 → 0.2.205
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/stockClass/stockClassDataToDaml.d.ts +10 -0
- package/dist/functions/OpenCapTable/stockClass/stockClassDataToDaml.d.ts.map +1 -1
- package/dist/functions/OpenCapTable/stockClass/stockClassDataToDaml.js +10 -0
- package/dist/functions/OpenCapTable/stockClass/stockClassDataToDaml.js.map +1 -1
- package/dist/functions/OpenCapTable/stockIssuance/createStockIssuance.d.ts +8 -2
- package/dist/functions/OpenCapTable/stockIssuance/createStockIssuance.d.ts.map +1 -1
- package/dist/functions/OpenCapTable/stockIssuance/createStockIssuance.js +13 -0
- package/dist/functions/OpenCapTable/stockIssuance/createStockIssuance.js.map +1 -1
- package/dist/types/branded.d.ts +158 -0
- package/dist/types/branded.d.ts.map +1 -0
- package/dist/types/branded.js +148 -0
- package/dist/types/branded.js.map +1 -0
- package/dist/types/daml.d.ts +76 -0
- package/dist/types/daml.d.ts.map +1 -0
- package/dist/types/daml.js +20 -0
- package/dist/types/daml.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/typeConversions.d.ts +7 -4
- package/dist/utils/typeConversions.d.ts.map +1 -1
- package/dist/utils/typeConversions.js +5 -5
- package/dist/utils/typeConversions.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { OcfStockClass } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Convert native OcfStockClass to DAML StockClassOcfData format.
|
|
4
|
+
*
|
|
5
|
+
* Note: Return type is Record<string, unknown> because the conversion_rights
|
|
6
|
+
* structure in the SDK differs from the current DAML schema, which uses nested
|
|
7
|
+
* OcfConversionTrigger objects. This is tracked for future alignment.
|
|
8
|
+
*
|
|
9
|
+
* @param stockClassData - Native stock class data
|
|
10
|
+
* @returns DAML-formatted stock class data
|
|
11
|
+
*/
|
|
2
12
|
export declare function stockClassDataToDaml(stockClassData: OcfStockClass): Record<string, unknown>;
|
|
3
13
|
//# sourceMappingURL=stockClassDataToDaml.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stockClassDataToDaml.d.ts","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/stockClass/stockClassDataToDaml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAUpD,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqH3F"}
|
|
1
|
+
{"version":3,"file":"stockClassDataToDaml.d.ts","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/stockClass/stockClassDataToDaml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAUpD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqH3F"}
|
|
@@ -4,6 +4,16 @@ exports.stockClassDataToDaml = stockClassDataToDaml;
|
|
|
4
4
|
const entityValidators_1 = require("../../../utils/entityValidators");
|
|
5
5
|
const enumConversions_1 = require("../../../utils/enumConversions");
|
|
6
6
|
const typeConversions_1 = require("../../../utils/typeConversions");
|
|
7
|
+
/**
|
|
8
|
+
* Convert native OcfStockClass to DAML StockClassOcfData format.
|
|
9
|
+
*
|
|
10
|
+
* Note: Return type is Record<string, unknown> because the conversion_rights
|
|
11
|
+
* structure in the SDK differs from the current DAML schema, which uses nested
|
|
12
|
+
* OcfConversionTrigger objects. This is tracked for future alignment.
|
|
13
|
+
*
|
|
14
|
+
* @param stockClassData - Native stock class data
|
|
15
|
+
* @returns DAML-formatted stock class data
|
|
16
|
+
*/
|
|
7
17
|
function stockClassDataToDaml(stockClassData) {
|
|
8
18
|
// Validate input data using the entity validator
|
|
9
19
|
(0, entityValidators_1.validateStockClassData)(stockClassData, 'stockClass');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stockClassDataToDaml.js","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/stockClass/stockClassDataToDaml.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"stockClassDataToDaml.js","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/stockClass/stockClassDataToDaml.ts"],"names":[],"mappings":";;AAoBA,oDAqHC;AAxID,sEAAyE;AACzE,oEAAsE;AACtE,oEAKwC;AAExC;;;;;;;;;GASG;AACH,SAAgB,oBAAoB,CAAC,cAA6B;IAChE,iDAAiD;IACjD,IAAA,yCAAsB,EAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAErD,MAAM,CAAC,GAAG,cAAc,CAAC;IACzB,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,UAAU,EAAE,IAAA,sCAAoB,EAAC,CAAC,CAAC,UAAU,CAAC;QAC9C,iBAAiB,EAAE,CAAC,CAAC,iBAAiB;QACtC,yBAAyB,EAAE,IAAA,+CAA6B,EAAC,CAAC,CAAC,yBAAyB,CAAC;QACrF,eAAe,EAAE,OAAO,CAAC,CAAC,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe;QACzG,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QACjF,mBAAmB,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAA,sCAAoB,EAAC,CAAC,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AAC,CAAC,IAAI;gBACR,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,IAAI;gBACtG,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,sCAAoB,EAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;aAC7E,CAAC;QACJ,CAAC,CAAC;QACF,+BAA+B,EAAE,CAAC,CAAC,+BAA+B;YAChE,CAAC,CAAC,OAAO,CAAC,CAAC,+BAA+B,KAAK,QAAQ;gBACrD,CAAC,CAAC,CAAC,CAAC,+BAA+B,CAAC,QAAQ,EAAE;gBAC9C,CAAC,CAAC,CAAC,CAAC,+BAA+B;YACrC,CAAC,CAAC,IAAI;QACR,0BAA0B,EAAE,CAAC,CAAC,0BAA0B;YACtD,CAAC,CAAC,OAAO,CAAC,CAAC,0BAA0B,KAAK,QAAQ;gBAChD,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,QAAQ,EAAE;gBACzC,CAAC,CAAC,CAAC,CAAC,0BAA0B;YAChC,CAAC,CAAC,IAAI;QACR,QAAQ,EAAE,IAAA,+BAAa,EAAC,CAAC,CAAC,QAAQ,CAAC;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import type { OcfStockIssuance } from '../../../types';
|
|
2
|
-
|
|
1
|
+
import type { OcfStockIssuance, PkgStockIssuanceOcfData } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Convert native OcfStockIssuance to DAML StockIssuanceOcfData format.
|
|
4
|
+
*
|
|
5
|
+
* @param d - Native stock issuance data
|
|
6
|
+
* @returns DAML-formatted stock issuance data
|
|
7
|
+
*/
|
|
8
|
+
export declare function stockIssuanceDataToDaml(d: OcfStockIssuance): PkgStockIssuanceOcfData;
|
|
3
9
|
//# sourceMappingURL=createStockIssuance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStockIssuance.d.ts","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/stockIssuance/createStockIssuance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"createStockIssuance.d.ts","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/stockIssuance/createStockIssuance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EAGxB,MAAM,gBAAgB,CAAC;AAgCxB;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,gBAAgB,GAAG,uBAAuB,CAuCpF"}
|
|
@@ -4,6 +4,13 @@ exports.stockIssuanceDataToDaml = stockIssuanceDataToDaml;
|
|
|
4
4
|
const errors_1 = require("../../../errors");
|
|
5
5
|
const entityValidators_1 = require("../../../utils/entityValidators");
|
|
6
6
|
const typeConversions_1 = require("../../../utils/typeConversions");
|
|
7
|
+
/**
|
|
8
|
+
* Convert native StockIssuanceType to DAML enum value.
|
|
9
|
+
*
|
|
10
|
+
* @param t - Native stock issuance type
|
|
11
|
+
* @returns DAML enum value or null if not specified
|
|
12
|
+
* @throws OcpParseError for unknown issuance types
|
|
13
|
+
*/
|
|
7
14
|
function getIssuanceType(t) {
|
|
8
15
|
if (!t)
|
|
9
16
|
return null;
|
|
@@ -19,6 +26,12 @@ function getIssuanceType(t) {
|
|
|
19
26
|
});
|
|
20
27
|
}
|
|
21
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Convert native OcfStockIssuance to DAML StockIssuanceOcfData format.
|
|
31
|
+
*
|
|
32
|
+
* @param d - Native stock issuance data
|
|
33
|
+
* @returns DAML-formatted stock issuance data
|
|
34
|
+
*/
|
|
22
35
|
function stockIssuanceDataToDaml(d) {
|
|
23
36
|
// Validate input data using the entity validator
|
|
24
37
|
(0, entityValidators_1.validateStockIssuanceData)(d, 'stockIssuance');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStockIssuance.js","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/stockIssuance/createStockIssuance.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"createStockIssuance.js","sourceRoot":"","sources":["../../../../src/functions/OpenCapTable/stockIssuance/createStockIssuance.ts"],"names":[],"mappings":";;AA4CA,0DAuCC;AAnFD,4CAA+D;AAO/D,sEAA4E;AAC5E,oEAMwC;AAExC;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,CAAgC;IACvD,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC;QACV,KAAK,KAAK;YACR,OAAO,qBAAqB,CAAC;QAC/B,KAAK,gBAAgB;YACnB,OAAO,0BAA0B,CAAC;QACpC;YACE,MAAM,IAAI,sBAAa,CAAC,gCAAgC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;gBACnE,MAAM,EAAE,6BAA6B;gBACrC,IAAI,EAAE,sBAAa,CAAC,kBAAkB;aACvC,CAAC,CAAC;IACP,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,CAAmB;IACzD,iDAAiD;IACjD,IAAA,4CAAyB,EAAC,CAAC,EAAE,eAAe,CAAC,CAAC;IAE9C,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,cAAc,EAAE,CAAC,CAAC,cAAc;QAChC,cAAc,EAAE,CAAC,CAAC,cAAc;QAChC,IAAI,EAAE,IAAA,sCAAoB,EAAC,CAAC,CAAC,IAAI,CAAC;QAClC,mBAAmB,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAA,sCAAoB,EAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,IAAI;QAC/F,yBA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ACnC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACX,IAAI,EAAE,IAAA,sCAAoB,EAAC,CAAC,CAAC,IAAI,CAAC;YAClC,MAAM,EAAE,IAAA,gCAAc,EAAC,CAAC,CAAC,MAAM,CAAC;SACjC,CAAC,CAAC;QACL,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,gCAAc,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;QAC9D,gBAAgB,EAAE,CAAC,CAAC,gBAAgB,IAAI,EAAE;QAC1C,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC;QAC/C,QAAQ,EAAE,IAAA,+BAAa,EAAC,CAAC,CAAC,QAAQ,CAAC;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branded types for improved type safety.
|
|
3
|
+
*
|
|
4
|
+
* Branded types (also called "nominal types" or "tagged types") use a phantom brand
|
|
5
|
+
* to create types that are structurally identical to their base type but considered
|
|
6
|
+
* distinct by TypeScript. This prevents accidental mixing of semantically different
|
|
7
|
+
* string values like ContractIds and PartyIds.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: These types are foundational building blocks for the SDK's public API.
|
|
10
|
+
* They are exported for use by SDK consumers and will be incrementally adopted
|
|
11
|
+
* throughout the SDK in future updates. The types provide immediate value for
|
|
12
|
+
* consumers who want stricter type safety in their applications.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const contractId: ContractId = '00abc123' as ContractId;
|
|
17
|
+
* const partyId: PartyId = 'alice::namespace' as PartyId;
|
|
18
|
+
*
|
|
19
|
+
* // TypeScript error: cannot assign ContractId to PartyId
|
|
20
|
+
* const wrongParty: PartyId = contractId; // Error!
|
|
21
|
+
*
|
|
22
|
+
* // Can still use string operations
|
|
23
|
+
* console.log(contractId.length); // Works fine
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @module
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Unique symbol for branding types.
|
|
30
|
+
* This symbol is never used at runtime, only for type discrimination.
|
|
31
|
+
*/
|
|
32
|
+
declare const BRAND_SYMBOL: unique symbol;
|
|
33
|
+
/**
|
|
34
|
+
* Generic branded type helper.
|
|
35
|
+
* Creates a type that is a string at runtime but carries a type brand.
|
|
36
|
+
*/
|
|
37
|
+
type Brand<T, B extends string> = T & {
|
|
38
|
+
readonly [BRAND_SYMBOL]: B;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Canton contract identifier.
|
|
42
|
+
*
|
|
43
|
+
* A branded string type representing a unique contract ID on the Canton ledger.
|
|
44
|
+
* Contract IDs are opaque identifiers assigned by Canton when contracts are created.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* async function getIssuer(contractId: ContractId) {
|
|
49
|
+
* // TypeScript ensures only ContractId values are passed
|
|
50
|
+
* }
|
|
51
|
+
*
|
|
52
|
+
* // Create from raw string (after validation)
|
|
53
|
+
* const id = validateContractId(rawString); // Returns ContractId
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export type ContractId = Brand<string, 'ContractId'>;
|
|
57
|
+
/**
|
|
58
|
+
* Canton party identifier.
|
|
59
|
+
*
|
|
60
|
+
* A branded string type representing a party on the Canton network.
|
|
61
|
+
* Party IDs typically follow the format `hint::namespace` (e.g., `alice::12345`).
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* async function createIssuer(issuerParty: PartyId) {
|
|
66
|
+
* // TypeScript ensures only PartyId values are passed
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export type PartyId = Brand<string, 'PartyId'>;
|
|
71
|
+
/**
|
|
72
|
+
* OCF entity identifier.
|
|
73
|
+
*
|
|
74
|
+
* A branded string type representing an OCF object's ID field.
|
|
75
|
+
* These are user-provided identifiers used to reference OCF objects.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* const issuerId: OcfId = 'issuer-001' as OcfId;
|
|
80
|
+
* const stakeholderId: OcfId = 'stakeholder-abc' as OcfId;
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export type OcfId = Brand<string, 'OcfId'>;
|
|
84
|
+
/**
|
|
85
|
+
* Security identifier for tracking securities across transactions.
|
|
86
|
+
*
|
|
87
|
+
* A branded string type representing a security's unique identifier.
|
|
88
|
+
* Security IDs are used to track individual securities through their lifecycle
|
|
89
|
+
* (issuance, transfer, cancellation, etc.).
|
|
90
|
+
*/
|
|
91
|
+
export type SecurityId = Brand<string, 'SecurityId'>;
|
|
92
|
+
/**
|
|
93
|
+
* Type guard to check if a value is a valid ContractId.
|
|
94
|
+
* Validates that the value is a non-empty string.
|
|
95
|
+
*
|
|
96
|
+
* Note: This performs a structural check, not validation against the ledger.
|
|
97
|
+
*/
|
|
98
|
+
export declare const isContractId: (value: unknown) => value is ContractId;
|
|
99
|
+
/**
|
|
100
|
+
* Type guard to check if a value is a valid PartyId.
|
|
101
|
+
* Validates that the value is a non-empty string.
|
|
102
|
+
*
|
|
103
|
+
* Note: This performs a structural check, not validation against the ledger.
|
|
104
|
+
* No format validation (e.g., `hint::namespace`) is performed.
|
|
105
|
+
*/
|
|
106
|
+
export declare const isPartyId: (value: unknown) => value is PartyId;
|
|
107
|
+
/**
|
|
108
|
+
* Type guard to check if a value is a valid OcfId.
|
|
109
|
+
* Validates that the value is a non-empty string.
|
|
110
|
+
*/
|
|
111
|
+
export declare const isOcfId: (value: unknown) => value is OcfId;
|
|
112
|
+
/**
|
|
113
|
+
* Type guard to check if a value is a valid SecurityId.
|
|
114
|
+
* Validates that the value is a non-empty string.
|
|
115
|
+
*/
|
|
116
|
+
export declare const isSecurityId: (value: unknown) => value is SecurityId;
|
|
117
|
+
/**
|
|
118
|
+
* Convert a string to ContractId after validation.
|
|
119
|
+
* Throws if the value is not a valid contract ID.
|
|
120
|
+
*/
|
|
121
|
+
export declare function toContractId(value: string): ContractId;
|
|
122
|
+
/**
|
|
123
|
+
* Convert a string to PartyId after validation.
|
|
124
|
+
* Throws if the value is not a valid party ID.
|
|
125
|
+
*/
|
|
126
|
+
export declare function toPartyId(value: string): PartyId;
|
|
127
|
+
/**
|
|
128
|
+
* Convert a string to OcfId after validation.
|
|
129
|
+
* Throws if the value is not a valid OCF ID.
|
|
130
|
+
*/
|
|
131
|
+
export declare function toOcfId(value: string): OcfId;
|
|
132
|
+
/**
|
|
133
|
+
* Convert a string to SecurityId after validation.
|
|
134
|
+
* Throws if the value is not a valid security ID.
|
|
135
|
+
*/
|
|
136
|
+
export declare function toSecurityId(value: string): SecurityId;
|
|
137
|
+
/**
|
|
138
|
+
* Unsafe conversion from string to ContractId without validation.
|
|
139
|
+
* Use only when you are certain the string is a valid contract ID.
|
|
140
|
+
*/
|
|
141
|
+
export declare function unsafeToContractId(value: string): ContractId;
|
|
142
|
+
/**
|
|
143
|
+
* Unsafe conversion from string to PartyId without validation.
|
|
144
|
+
* Use only when you are certain the string is a valid party ID.
|
|
145
|
+
*/
|
|
146
|
+
export declare function unsafeToPartyId(value: string): PartyId;
|
|
147
|
+
/**
|
|
148
|
+
* Unsafe conversion from string to OcfId without validation.
|
|
149
|
+
* Use only when you are certain the string is a valid OCF ID.
|
|
150
|
+
*/
|
|
151
|
+
export declare function unsafeToOcfId(value: string): OcfId;
|
|
152
|
+
/**
|
|
153
|
+
* Unsafe conversion from string to SecurityId without validation.
|
|
154
|
+
* Use only when you are certain the string is a valid security ID.
|
|
155
|
+
*/
|
|
156
|
+
export declare function unsafeToSecurityId(value: string): SecurityId;
|
|
157
|
+
export {};
|
|
158
|
+
//# sourceMappingURL=branded.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branded.d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,KAAK,CAK5C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAKtD;AAID;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAE5D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAElD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAE5D"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Branded types for improved type safety.
|
|
4
|
+
*
|
|
5
|
+
* Branded types (also called "nominal types" or "tagged types") use a phantom brand
|
|
6
|
+
* to create types that are structurally identical to their base type but considered
|
|
7
|
+
* distinct by TypeScript. This prevents accidental mixing of semantically different
|
|
8
|
+
* string values like ContractIds and PartyIds.
|
|
9
|
+
*
|
|
10
|
+
* NOTE: These types are foundational building blocks for the SDK's public API.
|
|
11
|
+
* They are exported for use by SDK consumers and will be incrementally adopted
|
|
12
|
+
* throughout the SDK in future updates. The types provide immediate value for
|
|
13
|
+
* consumers who want stricter type safety in their applications.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const contractId: ContractId = '00abc123' as ContractId;
|
|
18
|
+
* const partyId: PartyId = 'alice::namespace' as PartyId;
|
|
19
|
+
*
|
|
20
|
+
* // TypeScript error: cannot assign ContractId to PartyId
|
|
21
|
+
* const wrongParty: PartyId = contractId; // Error!
|
|
22
|
+
*
|
|
23
|
+
* // Can still use string operations
|
|
24
|
+
* console.log(contractId.length); // Works fine
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @module
|
|
28
|
+
*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.isSecurityId = exports.isOcfId = exports.isPartyId = exports.isContractId = void 0;
|
|
31
|
+
exports.toContractId = toContractId;
|
|
32
|
+
exports.toPartyId = toPartyId;
|
|
33
|
+
exports.toOcfId = toOcfId;
|
|
34
|
+
exports.toSecurityId = toSecurityId;
|
|
35
|
+
exports.unsafeToContractId = unsafeToContractId;
|
|
36
|
+
exports.unsafeToPartyId = unsafeToPartyId;
|
|
37
|
+
exports.unsafeToOcfId = unsafeToOcfId;
|
|
38
|
+
exports.unsafeToSecurityId = unsafeToSecurityId;
|
|
39
|
+
const typeGuards_1 = require("../utils/typeGuards");
|
|
40
|
+
// ===== Type Guard Functions =====
|
|
41
|
+
/**
|
|
42
|
+
* Factory function to create type guards for branded string types.
|
|
43
|
+
* All branded ID types use the same validation: non-empty string check.
|
|
44
|
+
*
|
|
45
|
+
* Separate type guard functions are needed for TypeScript's type narrowing
|
|
46
|
+
* to work correctly with different branded types.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
function createBrandedTypeGuard() {
|
|
51
|
+
return (value) => (0, typeGuards_1.isNonEmptyString)(value);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Type guard to check if a value is a valid ContractId.
|
|
55
|
+
* Validates that the value is a non-empty string.
|
|
56
|
+
*
|
|
57
|
+
* Note: This performs a structural check, not validation against the ledger.
|
|
58
|
+
*/
|
|
59
|
+
exports.isContractId = createBrandedTypeGuard();
|
|
60
|
+
/**
|
|
61
|
+
* Type guard to check if a value is a valid PartyId.
|
|
62
|
+
* Validates that the value is a non-empty string.
|
|
63
|
+
*
|
|
64
|
+
* Note: This performs a structural check, not validation against the ledger.
|
|
65
|
+
* No format validation (e.g., `hint::namespace`) is performed.
|
|
66
|
+
*/
|
|
67
|
+
exports.isPartyId = createBrandedTypeGuard();
|
|
68
|
+
/**
|
|
69
|
+
* Type guard to check if a value is a valid OcfId.
|
|
70
|
+
* Validates that the value is a non-empty string.
|
|
71
|
+
*/
|
|
72
|
+
exports.isOcfId = createBrandedTypeGuard();
|
|
73
|
+
/**
|
|
74
|
+
* Type guard to check if a value is a valid SecurityId.
|
|
75
|
+
* Validates that the value is a non-empty string.
|
|
76
|
+
*/
|
|
77
|
+
exports.isSecurityId = createBrandedTypeGuard();
|
|
78
|
+
// ===== Conversion Functions =====
|
|
79
|
+
/**
|
|
80
|
+
* Convert a string to ContractId after validation.
|
|
81
|
+
* Throws if the value is not a valid contract ID.
|
|
82
|
+
*/
|
|
83
|
+
function toContractId(value) {
|
|
84
|
+
if (!(0, exports.isContractId)(value)) {
|
|
85
|
+
throw new Error(`Invalid ContractId: ${value}`);
|
|
86
|
+
}
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Convert a string to PartyId after validation.
|
|
91
|
+
* Throws if the value is not a valid party ID.
|
|
92
|
+
*/
|
|
93
|
+
function toPartyId(value) {
|
|
94
|
+
if (!(0, exports.isPartyId)(value)) {
|
|
95
|
+
throw new Error(`Invalid PartyId: ${value}`);
|
|
96
|
+
}
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Convert a string to OcfId after validation.
|
|
101
|
+
* Throws if the value is not a valid OCF ID.
|
|
102
|
+
*/
|
|
103
|
+
function toOcfId(value) {
|
|
104
|
+
if (!(0, exports.isOcfId)(value)) {
|
|
105
|
+
throw new Error(`Invalid OcfId: ${value}`);
|
|
106
|
+
}
|
|
107
|
+
return value;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Convert a string to SecurityId after validation.
|
|
111
|
+
* Throws if the value is not a valid security ID.
|
|
112
|
+
*/
|
|
113
|
+
function toSecurityId(value) {
|
|
114
|
+
if (!(0, exports.isSecurityId)(value)) {
|
|
115
|
+
throw new Error(`Invalid SecurityId: ${value}`);
|
|
116
|
+
}
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
// ===== Unsafe Conversion Functions =====
|
|
120
|
+
/**
|
|
121
|
+
* Unsafe conversion from string to ContractId without validation.
|
|
122
|
+
* Use only when you are certain the string is a valid contract ID.
|
|
123
|
+
*/
|
|
124
|
+
function unsafeToContractId(value) {
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Unsafe conversion from string to PartyId without validation.
|
|
129
|
+
* Use only when you are certain the string is a valid party ID.
|
|
130
|
+
*/
|
|
131
|
+
function unsafeToPartyId(value) {
|
|
132
|
+
return value;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Unsafe conversion from string to OcfId without validation.
|
|
136
|
+
* Use only when you are certain the string is a valid OCF ID.
|
|
137
|
+
*/
|
|
138
|
+
function unsafeToOcfId(value) {
|
|
139
|
+
return value;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Unsafe conversion from string to SecurityId without validation.
|
|
143
|
+
* Use only when you are certain the string is a valid security ID.
|
|
144
|
+
*/
|
|
145
|
+
function unsafeToSecurityId(value) {
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=branded.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branded.js","sourceRoot":"","sources":["../../src/types/branded.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AA0HH,oCAKC;AAMD,8BAKC;AAMD,0BAKC;AAMD,oCAKC;AAQD,gDAEC;AAMD,0CAEC;AAMD,sCAEC;AAMD,gDAEC;AAhMD,oDAAuD;AAsEvD,mCAAmC;AAEnC;;;;;;;;GAQG;AACH,SAAS,sBAAsB;IAC7B,OAAO,CAAC,KAAc,EAAc,EAAE,CAAC,IAAA,6BAAgB,EAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACU,QAAA,YAAY,GAAG,sBAAsB,EAAc,CAAC;AAEjE;;;;;;GAMG;AACU,QAAA,SAAS,GA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C,KAAa;IACzC,OAAO,KAAc,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,KAAmB,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports of DAML-generated types from @fairmint/open-captable-protocol-daml-js.
|
|
3
|
+
*
|
|
4
|
+
* This module provides a clean interface to the DAML types used in the SDK,
|
|
5
|
+
* avoiding deep imports and providing better discoverability.
|
|
6
|
+
*
|
|
7
|
+
* These types represent the DAML contract structures on the Canton ledger.
|
|
8
|
+
* They differ from the native OCF types in native.ts which are the clean
|
|
9
|
+
* TypeScript representations used in the SDK's public API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: Some types exported here may conflict with manually-defined interfaces
|
|
12
|
+
* in the functions/ directory. When such conflicts exist, the manually-defined
|
|
13
|
+
* interfaces take precedence for backwards compatibility. Use the Pkg* prefixed
|
|
14
|
+
* types when you need the exact DAML package types.
|
|
15
|
+
*
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
import type { Fairmint as DamlFairmint } from '@fairmint/open-captable-protocol-daml-js';
|
|
19
|
+
/** DAML package type for Issuer entity data */
|
|
20
|
+
export type PkgIssuerOcfData = DamlFairmint.OpenCapTable.OCF.Issuer.IssuerOcfData;
|
|
21
|
+
/** DAML package type for Stakeholder entity data */
|
|
22
|
+
export type PkgStakeholderOcfData = DamlFairmint.OpenCapTable.OCF.Stakeholder.StakeholderOcfData;
|
|
23
|
+
/** DAML package type for StockClass entity data */
|
|
24
|
+
export type PkgStockClassOcfData = DamlFairmint.OpenCapTable.OCF.StockClass.StockClassOcfData;
|
|
25
|
+
/** DAML package type for StockIssuance entity data */
|
|
26
|
+
export type PkgStockIssuanceOcfData = DamlFairmint.OpenCapTable.OCF.StockIssuance.StockIssuanceOcfData;
|
|
27
|
+
/** DAML enum type for StockIssuance issuance type */
|
|
28
|
+
export type PkgStockIssuanceType = DamlFairmint.OpenCapTable.OCF.StockIssuance.OcfStockIssuanceType;
|
|
29
|
+
/** DAML package type for StockTransfer entity data */
|
|
30
|
+
export type PkgStockTransferOcfData = DamlFairmint.OpenCapTable.OCF.StockTransfer.StockTransferOcfData;
|
|
31
|
+
/** DAML package type for StockCancellation entity data */
|
|
32
|
+
export type PkgStockCancellationOcfData = DamlFairmint.OpenCapTable.OCF.StockCancellation.StockCancellationOcfData;
|
|
33
|
+
/** DAML package type for StockRepurchase entity data */
|
|
34
|
+
export type PkgStockRepurchaseOcfData = DamlFairmint.OpenCapTable.OCF.StockRepurchase.StockRepurchaseOcfData;
|
|
35
|
+
/** DAML package type for StockPlan entity data */
|
|
36
|
+
export type PkgStockPlanOcfData = DamlFairmint.OpenCapTable.OCF.StockPlan.StockPlanOcfData;
|
|
37
|
+
/** DAML package type for StockLegendTemplate entity data */
|
|
38
|
+
export type PkgStockLegendTemplateOcfData = DamlFairmint.OpenCapTable.OCF.StockLegendTemplate.StockLegendTemplateOcfData;
|
|
39
|
+
/** DAML package type for StockClassAuthorizedSharesAdjustment entity data */
|
|
40
|
+
export type PkgStockClassAuthorizedSharesAdjustmentOcfData = DamlFairmint.OpenCapTable.OCF.StockClassAuthorizedSharesAdjustment.StockClassAuthorizedSharesAdjustmentOcfData;
|
|
41
|
+
/** DAML package type for StockPlanPoolAdjustment entity data */
|
|
42
|
+
export type PkgStockPlanPoolAdjustmentOcfData = DamlFairmint.OpenCapTable.OCF.StockPlanPoolAdjustment.StockPlanPoolAdjustmentOcfData;
|
|
43
|
+
/** DAML package type for EquityCompensationIssuance entity data */
|
|
44
|
+
export type PkgEquityCompensationIssuanceOcfData = DamlFairmint.OpenCapTable.OCF.EquityCompensationIssuance.EquityCompensationIssuanceOcfData;
|
|
45
|
+
/** DAML package type for EquityCompensationExercise entity data */
|
|
46
|
+
export type PkgEquityCompensationExerciseOcfData = DamlFairmint.OpenCapTable.OCF.EquityCompensationExercise.EquityCompensationExerciseOcfData;
|
|
47
|
+
/** DAML package type for EquityCompensationCancellation entity data */
|
|
48
|
+
export type PkgEquityCompensationCancellationOcfData = DamlFairmint.OpenCapTable.OCF.EquityCompensationCancellation.EquityCompensationCancellationOcfData;
|
|
49
|
+
/** DAML package type for EquityCompensationTransfer entity data */
|
|
50
|
+
export type PkgEquityCompensationTransferOcfData = DamlFairmint.OpenCapTable.OCF.EquityCompensationTransfer.EquityCompensationTransferOcfData;
|
|
51
|
+
/** DAML package type for WarrantIssuance entity data */
|
|
52
|
+
export type PkgWarrantIssuanceOcfData = DamlFairmint.OpenCapTable.OCF.WarrantIssuance.WarrantIssuanceOcfData;
|
|
53
|
+
/** DAML package type for WarrantCancellation entity data */
|
|
54
|
+
export type PkgWarrantCancellationOcfData = DamlFairmint.OpenCapTable.OCF.WarrantCancellation.WarrantCancellationOcfData;
|
|
55
|
+
/** DAML package type for WarrantTransfer entity data */
|
|
56
|
+
export type PkgWarrantTransferOcfData = DamlFairmint.OpenCapTable.OCF.WarrantTransfer.WarrantTransferOcfData;
|
|
57
|
+
/** DAML package type for ConvertibleIssuance entity data */
|
|
58
|
+
export type PkgConvertibleIssuanceOcfData = DamlFairmint.OpenCapTable.OCF.ConvertibleIssuance.ConvertibleIssuanceOcfData;
|
|
59
|
+
/** DAML package type for ConvertibleCancellation entity data */
|
|
60
|
+
export type PkgConvertibleCancellationOcfData = DamlFairmint.OpenCapTable.OCF.ConvertibleCancellation.ConvertibleCancellationOcfData;
|
|
61
|
+
/** DAML package type for ConvertibleTransfer entity data */
|
|
62
|
+
export type PkgConvertibleTransferOcfData = DamlFairmint.OpenCapTable.OCF.ConvertibleTransfer.ConvertibleTransferOcfData;
|
|
63
|
+
/** DAML package type for VestingTerms entity data */
|
|
64
|
+
export type PkgVestingTermsOcfData = DamlFairmint.OpenCapTable.OCF.VestingTerms.VestingTermsOcfData;
|
|
65
|
+
/** DAML package type for Document entity data */
|
|
66
|
+
export type PkgDocumentOcfData = DamlFairmint.OpenCapTable.OCF.Document.DocumentOcfData;
|
|
67
|
+
/** DAML package type for IssuerAuthorizedSharesAdjustment entity data */
|
|
68
|
+
export type PkgIssuerAuthorizedSharesAdjustmentOcfData = DamlFairmint.OpenCapTable.OCF.IssuerAuthorizedSharesAdjustment.IssuerAuthorizedSharesAdjustmentOcfData;
|
|
69
|
+
/** DAML Monetary type */
|
|
70
|
+
export type DamlMonetary = DamlFairmint.OpenCapTable.Types.Monetary.OcfMonetary;
|
|
71
|
+
/** DAML Contact (Email, Phone) types */
|
|
72
|
+
export type DamlEmail = DamlFairmint.OpenCapTable.Types.Contact.OcfEmail;
|
|
73
|
+
export type DamlPhone = DamlFairmint.OpenCapTable.Types.Contact.OcfPhone;
|
|
74
|
+
export type DamlEmailType = DamlFairmint.OpenCapTable.Types.Contact.OcfEmailType;
|
|
75
|
+
export type DamlPhoneType = DamlFairmint.OpenCapTable.Types.Contact.OcfPhoneType;
|
|
76
|
+
//# sourceMappingURL=daml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daml.d.ts","sourceRoot":"","sources":["../../src/types/daml.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAMzF,+CAA+C;AAC/C,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC;AAElF,oDAAoD;AACpD,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,kBAAkB,CAAC;AAEjG,mDAAmD;AACnD,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC;AAE9F,sDAAsD;AACtD,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,oBAAoB,C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,WAAW,CAAC;AAEhF,wCAAwC;AACxC,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;AACzE,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC;AACjF,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Re-exports of DAML-generated types from @fairmint/open-captable-protocol-daml-js.
|
|
4
|
+
*
|
|
5
|
+
* This module provides a clean interface to the DAML types used in the SDK,
|
|
6
|
+
* avoiding deep imports and providing better discoverability.
|
|
7
|
+
*
|
|
8
|
+
* These types represent the DAML contract structures on the Canton ledger.
|
|
9
|
+
* They differ from the native OCF types in native.ts which are the clean
|
|
10
|
+
* TypeScript representations used in the SDK's public API.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: Some types exported here may conflict with manually-defined interfaces
|
|
13
|
+
* in the functions/ directory. When such conflicts exist, the manually-defined
|
|
14
|
+
* interfaces take precedence for backwards compatibility. Use the Pkg* prefixed
|
|
15
|
+
* types when you need the exact DAML package types.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
//# sourceMappingURL=daml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daml.js","sourceRoot":"","sources":["../../src/types/daml.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAEzB,OAAO,KAAK,EACV,OAAO,EACP,iBAAiB,EAClB,MAAM,kFAAkF,CAAC;AAE1F;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AAEzB,OAAO,KAAK,EACV,OAAO,EACP,iBAAiB,EAClB,MAAM,kFAAkF,CAAC;AAE1F;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC"}
|
package/dist/types/index.js
CHANGED
|
@@ -14,5 +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
|
+
__exportStar(require("./branded"), exports);
|
|
18
|
+
__exportStar(require("./daml"), exports);
|
|
17
19
|
__exportStar(require("./native"), exports);
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,yCAAuB;AACvB,2CAAyB"}
|
|
@@ -49,16 +49,18 @@ export declare function optionalString(value: string | null | undefined): string
|
|
|
49
49
|
export declare function safeString(value: unknown): string;
|
|
50
50
|
export declare function monetaryToDaml(monetary: Monetary): Fairmint.OpenCapTable.Types.Monetary.OcfMonetary;
|
|
51
51
|
export declare function damlMonetaryToNative(damlMonetary: Fairmint.OpenCapTable.Types.Monetary.OcfMonetary): Monetary;
|
|
52
|
+
/** DAML type for OcfInitialSharesAuthorized union */
|
|
53
|
+
type DamlInitialSharesAuthorized = Fairmint.OpenCapTable.Types.Stock.OcfInitialSharesAuthorized;
|
|
52
54
|
/**
|
|
53
55
|
* Convert initial_shares_authorized value to DAML tagged union format.
|
|
54
56
|
* V30 DAML contracts use OcfInitialSharesAuthorized union type:
|
|
55
57
|
* - OcfInitialSharesNumeric Decimal - for numeric values
|
|
56
58
|
* - OcfInitialSharesEnum - for "UNLIMITED" or "NOT_APPLICABLE"
|
|
59
|
+
*
|
|
60
|
+
* @param value - Native value (number, numeric string, or "UNLIMITED"/"NOT_APPLICABLE")
|
|
61
|
+
* @returns DAML-formatted discriminated union
|
|
57
62
|
*/
|
|
58
|
-
export declare function initialSharesAuthorizedToDaml(value: string | number):
|
|
59
|
-
tag: 'OcfInitialSharesNumeric' | 'OcfInitialSharesEnum';
|
|
60
|
-
value: string;
|
|
61
|
-
};
|
|
63
|
+
export declare function initialSharesAuthorizedToDaml(value: string | number): DamlInitialSharesAuthorized;
|
|
62
64
|
export declare function addressToDaml(address: Address): Fairmint.OpenCapTable.Types.Monetary.OcfAddress;
|
|
63
65
|
export declare function damlAddressToNative(damlAddress: Fairmint.OpenCapTable.Types.Monetary.OcfAddress): Address;
|
|
64
66
|
/** Remove empty string entries from comments array (mutates in place and returns the object) */
|
|
@@ -68,4 +70,5 @@ export declare function cleanComments(comments?: Array<string | null>): string[]
|
|
|
68
70
|
* version. This function checks both possible locations in a type-safe way.
|
|
69
71
|
*/
|
|
70
72
|
export declare function extractUpdateId(response: SubmitAndWaitForTransactionTreeResponse): string;
|
|
73
|
+
export {};
|
|
71
74
|
//# sourceMappingURL=typeConversions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeConversions.d.ts","sourceRoot":"","sources":["../../src/utils/typeConversions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,wEAAwE,CAAC;AACtI,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAEzE,OAAO,KAAK,EAAE,OAAO,EAAe,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAItE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAM/D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,CAE5E;AAED,uHAAuH;AACvH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED,qGAAqG;AACrG,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkC5D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGpG;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAE9E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAYjD;AAID,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,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AQ,GAAG,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAKnG;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAK7G;AAID,qDAAqD;AACrD,KAAK,2BAA2B,GAAG,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,0BAA0B,CAAC;AAKhG;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,2BAA2B,CAUjG;AAwCD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAS/F;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,GAAG,OAAO,CAWzG;AAID,gGAAgG;AAChG,wBAAgB,aAAa,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,EAAE,CAOvE;AAID;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,uCAAuC,GAAG,MAAM,CAiBzF"}
|
|
@@ -137,12 +137,14 @@ function damlMonetaryToNative(damlMonetary) {
|
|
|
137
137
|
currency: damlMonetary.currency,
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
-
// ===== Initial Shares Authorized Conversions =====
|
|
141
140
|
/**
|
|
142
141
|
* Convert initial_shares_authorized value to DAML tagged union format.
|
|
143
142
|
* V30 DAML contracts use OcfInitialSharesAuthorized union type:
|
|
144
143
|
* - OcfInitialSharesNumeric Decimal - for numeric values
|
|
145
144
|
* - OcfInitialSharesEnum - for "UNLIMITED" or "NOT_APPLICABLE"
|
|
145
|
+
*
|
|
146
|
+
* @param value - Native value (number, numeric string, or "UNLIMITED"/"NOT_APPLICABLE")
|
|
147
|
+
* @returns DAML-formatted discriminated union
|
|
146
148
|
*/
|
|
147
149
|
function initialSharesAuthorizedToDaml(value) {
|
|
148
150
|
if (typeof value === 'number' || (typeof value === 'string' && /^\d+(\.\d+)?$/.test(value))) {
|
|
@@ -151,10 +153,8 @@ function initialSharesAuthorizedToDaml(value) {
|
|
|
151
153
|
value: typeof value === 'number' ? value.toString() : value,
|
|
152
154
|
};
|
|
153
155
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
return { tag: 'OcfInitialSharesEnum', value: 'OcfAuthorizedSharesNotApplicable' };
|
|
156
|
+
const enumValue = value === 'UNLIMITED' ? 'OcfAuthorizedSharesUnlimited' : 'OcfAuthorizedSharesNotApplicable';
|
|
157
|
+
return { tag: 'OcfInitialSharesEnum', value: enumValue };
|
|
158
158
|
}
|
|
159
159
|
// ===== Address Conversions =====
|
|
160
160
|
function addressTypeToDaml(addressType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeConversions.js","sourceRoot":"","sources":["../../src/utils/typeConversions.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAcH,oDAMC;AAMD,sCAEC;AAGD,oDAGC;AAGD,wCAEC;AASD,wDAkCC;AAMD,wDAGC;AAMD,wCAEC;AAMD,gCAYC;AAID,wCAKC;AAED,oDAKC;
|
|
1
|
+
{"version":3,"file":"typeConversions.js","sourceRoot":"","sources":["../../src/utils/typeConversions.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAcH,oDAMC;AAMD,sCAEC;AAGD,oDAGC;AAGD,wCAEC;AASD,wDAkCC;AAMD,wDAGC;AAMD,wCAEC;AAMD,gCAYC;AAID,wCAKC;AAED,oDAKC;AAmBD,sEAUC;AAwCD,sCASC;AAED,kDAWC;AAKD,sCAOC;AAQD,0CAiBC;AAjQD,sCAA+F;AAG/F,+CAA+C;AAE/C;;;;GAIG;AACH,SAAgB,oBAAo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gB,CAAC,wCAAwC,EAAE;QACnE,IAAI,EAAE,sBAAa,CAAC,gBAAgB;KACrC,CAAC,CAAC;AACL,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.205",
|
|
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",
|