@open-captable-protocol/canton 0.0.12 → 0.0.14
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/companyValuationReport/createCompanyValuationReport.d.ts +37 -0
- package/dist/functions/companyValuationReport/createCompanyValuationReport.d.ts.map +1 -1
- package/dist/functions/companyValuationReport/createCompanyValuationReport.js +30 -1
- package/dist/functions/companyValuationReport/createCompanyValuationReport.js.map +1 -1
- package/package.json +2 -2
- package/dist/OcpFactoryClient.d.ts +0 -46
- package/dist/OcpFactoryClient.d.ts.map +0 -1
- package/dist/OcpFactoryClient.js +0 -57
- package/dist/OcpFactoryClient.js.map +0 -1
- package/dist/functions/addObserversToCompanyValuationReport.d.ts +0 -14
- package/dist/functions/addObserversToCompanyValuationReport.d.ts.map +0 -1
- package/dist/functions/addObserversToCompanyValuationReport.js +0 -35
- package/dist/functions/addObserversToCompanyValuationReport.js.map +0 -1
- package/dist/functions/authorizeIssuer.d.ts +0 -19
- package/dist/functions/authorizeIssuer.d.ts.map +0 -1
- package/dist/functions/authorizeIssuer.js +0 -52
- package/dist/functions/authorizeIssuer.js.map +0 -1
- package/dist/functions/confirmCurrentCompanyValuationReport.d.ts +0 -13
- package/dist/functions/confirmCurrentCompanyValuationReport.d.ts.map +0 -1
- package/dist/functions/confirmCurrentCompanyValuationReport.js +0 -33
- package/dist/functions/confirmCurrentCompanyValuationReport.js.map +0 -1
- package/dist/functions/createCompanyValuationReport.d.ts +0 -16
- package/dist/functions/createCompanyValuationReport.d.ts.map +0 -1
- package/dist/functions/createCompanyValuationReport.js +0 -43
- package/dist/functions/createCompanyValuationReport.js.map +0 -1
- package/dist/functions/createIssuer.d.ts +0 -58
- package/dist/functions/createIssuer.d.ts.map +0 -1
- package/dist/functions/createIssuer.js +0 -65
- package/dist/functions/createIssuer.js.map +0 -1
- package/dist/functions/updateCompanyValuation.d.ts +0 -14
- package/dist/functions/updateCompanyValuation.d.ts.map +0 -1
- package/dist/functions/updateCompanyValuation.js +0 -37
- package/dist/functions/updateCompanyValuation.js.map +0 -1
- package/dist/functions/updateIssuerData.d.ts +0 -18
- package/dist/functions/updateIssuerData.d.ts.map +0 -1
- package/dist/functions/updateIssuerData.js +0 -40
- package/dist/functions/updateIssuerData.js.map +0 -1
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Details about the FeaturedAppRight contract that need to be disclosed
|
|
4
|
+
* when exercising the CreateCompanyValuationReport choice. This is required for cross-domain
|
|
5
|
+
* contract interactions in Canton.
|
|
6
|
+
*/
|
|
7
|
+
export interface FeaturedAppRightContractDetails {
|
|
8
|
+
/** The contract ID of the FeaturedAppRight contract */
|
|
9
|
+
contractId: string;
|
|
10
|
+
/** The serialized created event blob of the contract */
|
|
11
|
+
createdEventBlob: string;
|
|
12
|
+
/** The synchronizer ID associated with the contract */
|
|
13
|
+
synchronizerId: string;
|
|
14
|
+
/** The template ID of the contract */
|
|
15
|
+
templateId: string;
|
|
16
|
+
}
|
|
2
17
|
export interface CreateCompanyValuationReportParams {
|
|
3
18
|
companyId: string;
|
|
4
19
|
companyValuation: string | number;
|
|
5
20
|
observers?: string[];
|
|
21
|
+
/** Details of the FeaturedAppRight contract for disclosed contracts */
|
|
22
|
+
featuredAppRightContractDetails: FeaturedAppRightContractDetails;
|
|
6
23
|
}
|
|
7
24
|
export interface CreateCompanyValuationReportResult {
|
|
8
25
|
contractId: string;
|
|
@@ -11,6 +28,26 @@ export interface CreateCompanyValuationReportResult {
|
|
|
11
28
|
/**
|
|
12
29
|
* Create a CompanyValuationReport by exercising the CreateCompanyValuationReport choice
|
|
13
30
|
* on the OCP Factory contract.
|
|
31
|
+
*
|
|
32
|
+
* This function requires the FeaturedAppRight contract details to be provided for disclosed contracts,
|
|
33
|
+
* which is necessary for cross-domain contract interactions in Canton.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const featuredAppRightContractDetails = {
|
|
38
|
+
* contractId: "1234567890abcdef",
|
|
39
|
+
* createdEventBlob: "serialized_contract_blob_here",
|
|
40
|
+
* synchronizerId: "sync_id_here",
|
|
41
|
+
* templateId: "FeaturedAppRight:template:id:here"
|
|
42
|
+
* };
|
|
43
|
+
*
|
|
44
|
+
* const result = await createCompanyValuationReport(client, {
|
|
45
|
+
* companyId: "company123",
|
|
46
|
+
* companyValuation: "1000000",
|
|
47
|
+
* observers: ["observer1", "observer2"],
|
|
48
|
+
* featuredAppRightContractDetails
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
14
51
|
*/
|
|
15
52
|
export declare function createCompanyValuationReport(client: LedgerJsonApiClient, params: CreateCompanyValuationReportParams): Promise<CreateCompanyValuationReportResult>;
|
|
16
53
|
//# sourceMappingURL=createCompanyValuationReport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/createCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"createCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/createCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,gBAAgB,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kCAAkC;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,uEAAuE;IACvE,+BAA+B,EAAE,+BAA+B,CAAC;CAClE;AAED,MAAM,WAAW,kCAAkC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC,CA8C7C"}
|
|
@@ -8,6 +8,26 @@ const ocp_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-c
|
|
|
8
8
|
/**
|
|
9
9
|
* Create a CompanyValuationReport by exercising the CreateCompanyValuationReport choice
|
|
10
10
|
* on the OCP Factory contract.
|
|
11
|
+
*
|
|
12
|
+
* This function requires the FeaturedAppRight contract details to be provided for disclosed contracts,
|
|
13
|
+
* which is necessary for cross-domain contract interactions in Canton.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const featuredAppRightContractDetails = {
|
|
18
|
+
* contractId: "1234567890abcdef",
|
|
19
|
+
* createdEventBlob: "serialized_contract_blob_here",
|
|
20
|
+
* synchronizerId: "sync_id_here",
|
|
21
|
+
* templateId: "FeaturedAppRight:template:id:here"
|
|
22
|
+
* };
|
|
23
|
+
*
|
|
24
|
+
* const result = await createCompanyValuationReport(client, {
|
|
25
|
+
* companyId: "company123",
|
|
26
|
+
* companyValuation: "1000000",
|
|
27
|
+
* observers: ["observer1", "observer2"],
|
|
28
|
+
* featuredAppRightContractDetails
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
11
31
|
*/
|
|
12
32
|
async function createCompanyValuationReport(client, params) {
|
|
13
33
|
const network = client.getNetwork();
|
|
@@ -20,7 +40,8 @@ async function createCompanyValuationReport(client, params) {
|
|
|
20
40
|
company_valuation: typeof params.companyValuation === 'number'
|
|
21
41
|
? params.companyValuation.toString()
|
|
22
42
|
: params.companyValuation,
|
|
23
|
-
observers: params.observers ?? []
|
|
43
|
+
observers: params.observers ?? [],
|
|
44
|
+
featured_app_right: params.featuredAppRightContractDetails.contractId
|
|
24
45
|
};
|
|
25
46
|
const response = await client.submitAndWaitForTransactionTree({
|
|
26
47
|
commands: [
|
|
@@ -32,6 +53,14 @@ async function createCompanyValuationReport(client, params) {
|
|
|
32
53
|
choiceArgument: choiceArguments
|
|
33
54
|
}
|
|
34
55
|
}
|
|
56
|
+
],
|
|
57
|
+
disclosedContracts: [
|
|
58
|
+
{
|
|
59
|
+
templateId: params.featuredAppRightContractDetails.templateId,
|
|
60
|
+
contractId: params.featuredAppRightContractDetails.contractId,
|
|
61
|
+
createdEventBlob: params.featuredAppRightContractDetails.createdEventBlob,
|
|
62
|
+
synchronizerId: params.featuredAppRightContractDetails.synchronizerId
|
|
63
|
+
}
|
|
35
64
|
]
|
|
36
65
|
});
|
|
37
66
|
const event = response.transactionTree.eventsById[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCompanyValuationReport.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/createCompanyValuationReport.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"createCompanyValuationReport.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/createCompanyValuationReport.ts"],"names":[],"mappings":";;;;;AA2DA,oEAiDC;AA1GD,yIAA0G;AAiC1G;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACI,KAAK,UAAU,4BAA4B,CAChD,MAA2B,EAC3B,MAA0C;IAE1C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,MAAM,WAAW,GAAG,sCAAqB,CAAC,OAA6C,CAAC,CAAC;IACzF,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,eAAe,GAAkE;QACrF,UAAU,EAAE,MAAM,CAAC,SAAS;QAC5B,iBAAiB,EAAE,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ;YAC5D,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE;YACpC,CAAC,CAAC,MAAM,CAAC,gBAAgB;QAC3B,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE;QACjC,kBAAkB,EAAE,MAAM,CAAC,+BAA+B,CAAC,UAAuC;KACnG,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,WAAW,CAAC,UAAU;oBAClC,UAAU,EAAE,WAAW,CAAC,oBAAoB;oBAC5C,MAAM,EAAE,8BAA8B;oBACtC,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;QACD,kBAAkB,EAAE;YAClB;gBACE,UAAU,EAAE,MAAM,CAAC,+BAA+B,CAAC,UAAU;gBAC7D,UAAU,EAAE,MAAM,CAAC,+BAA+B,CAAC,UAAU;gBAC7D,gBAAgB,EAAE,MAAM,CAAC,+BAA+B,CAAC,gBAAgB;gBACzE,cAAc,EAAE,MAAM,CAAC,+BAA+B,CAAC,cAAc;aACtE;SACF;KACF,CAA4C,CAAC;IAE9C,MAAM,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,kBAAkB,IAAI,KAAK,EAAE,CAAC;QAChC,OAAO;YACL,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;YACnD,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;SAC5C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-captable-protocol/canton",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
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",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@daml/ledger": "^2.10.2",
|
|
20
20
|
"@daml/types": "^2.10.2",
|
|
21
21
|
"@fairmint/canton-node-sdk": "^0.0.79",
|
|
22
|
-
"@fairmint/open-captable-protocol-daml-js": "^0.0.
|
|
22
|
+
"@fairmint/open-captable-protocol-daml-js": "^0.0.22"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^24.2.0",
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ClientConfig } from '@fairmint/canton-node-sdk';
|
|
2
|
-
import { AuthorizeIssuerParams, AuthorizeIssuerResult } from './functions/authorizeIssuer';
|
|
3
|
-
import { CreateIssuerParams, CreateIssuerResult } from './functions/createIssuer';
|
|
4
|
-
import { CreateCompanyValuationReportParams, CreateCompanyValuationReportResult } from './functions/createCompanyValuationReport';
|
|
5
|
-
import { UpdateCompanyValuationParams, UpdateCompanyValuationResult } from './functions/updateCompanyValuation';
|
|
6
|
-
import { ConfirmCurrentCompanyValuationReportParams, ConfirmCurrentCompanyValuationReportResult } from './functions/confirmCurrentCompanyValuationReport';
|
|
7
|
-
import { AddObserversToCompanyValuationReportParams, AddObserversToCompanyValuationReportResult } from './functions/addObserversToCompanyValuationReport';
|
|
8
|
-
export { AuthorizeIssuerParams, AuthorizeIssuerResult } from './functions/authorizeIssuer';
|
|
9
|
-
export { CreateIssuerParams, CreateIssuerResult, IssuerAuthorizationContractDetails } from './functions/createIssuer';
|
|
10
|
-
export { CreateCompanyValuationReportParams, CreateCompanyValuationReportResult } from './functions/createCompanyValuationReport';
|
|
11
|
-
export { UpdateCompanyValuationParams, UpdateCompanyValuationResult } from './functions/updateCompanyValuation';
|
|
12
|
-
export { ConfirmCurrentCompanyValuationReportParams, ConfirmCurrentCompanyValuationReportResult } from './functions/confirmCurrentCompanyValuationReport';
|
|
13
|
-
export { AddObserversToCompanyValuationReportParams, AddObserversToCompanyValuationReportResult } from './functions/addObserversToCompanyValuationReport';
|
|
14
|
-
export declare class OcpFactoryClient {
|
|
15
|
-
private client;
|
|
16
|
-
constructor(config?: ClientConfig);
|
|
17
|
-
/**
|
|
18
|
-
* Authorize an issuer using the OCP Factory contract
|
|
19
|
-
* @param params - Parameters for authorizing an issuer
|
|
20
|
-
* @returns Promise resolving to the result of the authorization
|
|
21
|
-
*/
|
|
22
|
-
authorizeIssuer(params: AuthorizeIssuerParams): Promise<AuthorizeIssuerResult>;
|
|
23
|
-
/**
|
|
24
|
-
* Create an issuer by exercising the CreateIssuer choice on an IssuerAuthorization contract
|
|
25
|
-
* @param params - Parameters for creating an issuer
|
|
26
|
-
* @returns Promise resolving to the result of the issuer creation
|
|
27
|
-
*/
|
|
28
|
-
createIssuer(params: CreateIssuerParams): Promise<CreateIssuerResult>;
|
|
29
|
-
/**
|
|
30
|
-
* Create a CompanyValuationReport via OCP Factory
|
|
31
|
-
*/
|
|
32
|
-
createCompanyValuationReport(params: CreateCompanyValuationReportParams): Promise<CreateCompanyValuationReportResult>;
|
|
33
|
-
/**
|
|
34
|
-
* Update the company valuation on a CompanyValuationReport
|
|
35
|
-
*/
|
|
36
|
-
updateCompanyValuation(params: UpdateCompanyValuationParams): Promise<UpdateCompanyValuationResult>;
|
|
37
|
-
/**
|
|
38
|
-
* Confirm the current company valuation on a CompanyValuationReport
|
|
39
|
-
*/
|
|
40
|
-
confirmCurrentCompanyValuationReport(params: ConfirmCurrentCompanyValuationReportParams): Promise<ConfirmCurrentCompanyValuationReportResult>;
|
|
41
|
-
/**
|
|
42
|
-
* Add observers to a CompanyValuationReport
|
|
43
|
-
*/
|
|
44
|
-
addObserversToCompanyValuationReport(params: AddObserversToCompanyValuationReportParams): Promise<AddObserversToCompanyValuationReportResult>;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=OcpFactoryClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OcpFactoryClient.d.ts","sourceRoot":"","sources":["../src/OcpFactoryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAmB,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5G,OAAO,EAAgB,kBAAkB,EAAE,kBAAkB,EAAsC,MAAM,0BAA0B,CAAC;AACpI,OAAO,EAAgC,kCAAkC,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAChK,OAAO,EAA0B,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AACxI,OAAO,EAAwC,0CAA0C,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAChM,OAAO,EAAwC,0CAA0C,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAEhM,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AACtH,OAAO,EAAE,kCAAkC,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAClI,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAChH,OAAO,EAAE,0CAA0C,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAC1J,OAAO,EAAE,0CAA0C,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAE1J,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAsB;gBAExB,MAAM,CAAC,EAAE,YAAY;IAIjC;;;;OAIG;IACG,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIpF;;;;OAIG;IACG,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI3E;;OAEG;IACG,4BAA4B,CAChC,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC;IAI9C;;OAEG;IACG,sBAAsB,CAC1B,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC;IAIxC;;OAEG;IACG,oCAAoC,CACxC,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC;IAItD;;OAEG;IACG,oCAAoC,CACxC,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC;CAGvD"}
|
package/dist/OcpFactoryClient.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OcpFactoryClient = void 0;
|
|
4
|
-
const canton_node_sdk_1 = require("@fairmint/canton-node-sdk");
|
|
5
|
-
const authorizeIssuer_1 = require("./functions/authorizeIssuer");
|
|
6
|
-
const createIssuer_1 = require("./functions/createIssuer");
|
|
7
|
-
const createCompanyValuationReport_1 = require("./functions/createCompanyValuationReport");
|
|
8
|
-
const updateCompanyValuation_1 = require("./functions/updateCompanyValuation");
|
|
9
|
-
const confirmCurrentCompanyValuationReport_1 = require("./functions/confirmCurrentCompanyValuationReport");
|
|
10
|
-
const addObserversToCompanyValuationReport_1 = require("./functions/addObserversToCompanyValuationReport");
|
|
11
|
-
class OcpFactoryClient {
|
|
12
|
-
constructor(config) {
|
|
13
|
-
this.client = new canton_node_sdk_1.LedgerJsonApiClient(config);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Authorize an issuer using the OCP Factory contract
|
|
17
|
-
* @param params - Parameters for authorizing an issuer
|
|
18
|
-
* @returns Promise resolving to the result of the authorization
|
|
19
|
-
*/
|
|
20
|
-
async authorizeIssuer(params) {
|
|
21
|
-
return (0, authorizeIssuer_1.authorizeIssuer)(this.client, params);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Create an issuer by exercising the CreateIssuer choice on an IssuerAuthorization contract
|
|
25
|
-
* @param params - Parameters for creating an issuer
|
|
26
|
-
* @returns Promise resolving to the result of the issuer creation
|
|
27
|
-
*/
|
|
28
|
-
async createIssuer(params) {
|
|
29
|
-
return (0, createIssuer_1.createIssuer)(this.client, params);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Create a CompanyValuationReport via OCP Factory
|
|
33
|
-
*/
|
|
34
|
-
async createCompanyValuationReport(params) {
|
|
35
|
-
return (0, createCompanyValuationReport_1.createCompanyValuationReport)(this.client, params);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Update the company valuation on a CompanyValuationReport
|
|
39
|
-
*/
|
|
40
|
-
async updateCompanyValuation(params) {
|
|
41
|
-
return (0, updateCompanyValuation_1.updateCompanyValuation)(this.client, params);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Confirm the current company valuation on a CompanyValuationReport
|
|
45
|
-
*/
|
|
46
|
-
async confirmCurrentCompanyValuationReport(params) {
|
|
47
|
-
return (0, confirmCurrentCompanyValuationReport_1.confirmCurrentCompanyValuationReport)(this.client, params);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Add observers to a CompanyValuationReport
|
|
51
|
-
*/
|
|
52
|
-
async addObserversToCompanyValuationReport(params) {
|
|
53
|
-
return (0, addObserversToCompanyValuationReport_1.addObserversToCompanyValuationReport)(this.client, params);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.OcpFactoryClient = OcpFactoryClient;
|
|
57
|
-
//# sourceMappingURL=OcpFactoryClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OcpFactoryClient.js","sourceRoot":"","sources":["../src/OcpFactoryClient.ts"],"names":[],"mappings":";;;AAAA,+DAA8E;AAC9E,iEAA4G;AAC5G,2DAAoI;AACpI,2FAAgK;AAChK,+EAAwI;AACxI,2GAAgM;AAChM,2GAAgM;AAShM,MAAa,gBAAgB;IAG3B,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAmB,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,OAAO,IAAA,iCAAe,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,OAAO,IAAA,2BAAY,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,4BAA4B,CAChC,MAA0C;QAE1C,OAAO,IAAA,2DAA4B,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,MAAoC;QAEpC,OAAO,IAAA,+CAAsB,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oCAAoC,CACxC,MAAkD;QAElD,OAAO,IAAA,2EAAoC,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oCAAoC,CACxC,MAAkD;QAElD,OAAO,IAAA,2EAAoC,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;CACF;AA5DD,4CA4DC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
|
|
2
|
-
export interface AddObserversToCompanyValuationReportParams {
|
|
3
|
-
companyValuationReportContractId: string;
|
|
4
|
-
added: string[];
|
|
5
|
-
}
|
|
6
|
-
export interface AddObserversToCompanyValuationReportResult {
|
|
7
|
-
contractId: string;
|
|
8
|
-
updateId: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Add observers to a CompanyValuationReport by exercising AddObservers.
|
|
12
|
-
*/
|
|
13
|
-
export declare function addObserversToCompanyValuationReport(client: LedgerJsonApiClient, params: AddObserversToCompanyValuationReportParams): Promise<AddObserversToCompanyValuationReportResult>;
|
|
14
|
-
//# sourceMappingURL=addObserversToCompanyValuationReport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addObserversToCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../src/functions/addObserversToCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,0CAA0C;IACzD,gCAAgC,EAAE,MAAM,CAAC;IACzC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC,CA6BrD"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addObserversToCompanyValuationReport = addObserversToCompanyValuationReport;
|
|
4
|
-
const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
|
|
5
|
-
/**
|
|
6
|
-
* Add observers to a CompanyValuationReport by exercising AddObservers.
|
|
7
|
-
*/
|
|
8
|
-
async function addObserversToCompanyValuationReport(client, params) {
|
|
9
|
-
// Determine the acting party (system_operator) from the created event
|
|
10
|
-
const eventsResponse = await client.getEventsByContractId({
|
|
11
|
-
contractId: params.companyValuationReportContractId
|
|
12
|
-
});
|
|
13
|
-
const systemOperator = eventsResponse.created.createdEvent.createArgument.system_operator;
|
|
14
|
-
const choiceArguments = {
|
|
15
|
-
added: params.added
|
|
16
|
-
};
|
|
17
|
-
const response = await client.submitAndWaitForTransactionTree({
|
|
18
|
-
actAs: [systemOperator],
|
|
19
|
-
commands: [
|
|
20
|
-
{
|
|
21
|
-
ExerciseCommand: {
|
|
22
|
-
templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.CompanyValuationReport.CompanyValuationReport.templateId,
|
|
23
|
-
contractId: params.companyValuationReportContractId,
|
|
24
|
-
choice: 'AddObservers',
|
|
25
|
-
choiceArgument: choiceArguments
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
});
|
|
30
|
-
return {
|
|
31
|
-
contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
|
|
32
|
-
updateId: response.transactionTree.updateId
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=addObserversToCompanyValuationReport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addObserversToCompanyValuationReport.js","sourceRoot":"","sources":["../../src/functions/addObserversToCompanyValuationReport.ts"],"names":[],"mappings":";;AAiBA,oFAgCC;AAjDD,6FAAoE;AAcpE;;GAEG;AACI,KAAK,UAAU,oCAAoC,CACxD,MAA2B,EAC3B,MAAkD;IAElD,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAA8D;QACjF,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,cAAc;oBACtB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
|
|
2
|
-
export interface AuthorizeIssuerParams {
|
|
3
|
-
issuer: string;
|
|
4
|
-
}
|
|
5
|
-
export interface AuthorizeIssuerResult {
|
|
6
|
-
contractId: string;
|
|
7
|
-
updateId: string;
|
|
8
|
-
createdEventBlob: string;
|
|
9
|
-
synchronizerId: string;
|
|
10
|
-
templateId: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Authorize an issuer using the OCP Factory contract
|
|
14
|
-
* @param client - The ledger JSON API client
|
|
15
|
-
* @param params - Parameters for authorizing an issuer
|
|
16
|
-
* @returns Promise resolving to the result of the authorization
|
|
17
|
-
*/
|
|
18
|
-
export declare function authorizeIssuer(client: LedgerJsonApiClient, params: AuthorizeIssuerParams): Promise<AuthorizeIssuerResult>;
|
|
19
|
-
//# sourceMappingURL=authorizeIssuer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorizeIssuer.d.ts","sourceRoot":"","sources":["../../src/functions/authorizeIssuer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAyChC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.authorizeIssuer = authorizeIssuer;
|
|
7
|
-
const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
|
|
8
|
-
const ocp_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/ocp-factory-contract-id.json"));
|
|
9
|
-
/**
|
|
10
|
-
* Authorize an issuer using the OCP Factory contract
|
|
11
|
-
* @param client - The ledger JSON API client
|
|
12
|
-
* @param params - Parameters for authorizing an issuer
|
|
13
|
-
* @returns Promise resolving to the result of the authorization
|
|
14
|
-
*/
|
|
15
|
-
async function authorizeIssuer(client, params) {
|
|
16
|
-
// Get the current network from the client
|
|
17
|
-
const network = client.getNetwork();
|
|
18
|
-
// Select the appropriate contract ID based on the network
|
|
19
|
-
const networkData = ocp_factory_contract_id_json_1.default[network];
|
|
20
|
-
if (!networkData) {
|
|
21
|
-
throw new Error(`Unsupported network: ${network}`);
|
|
22
|
-
}
|
|
23
|
-
// Create the choice arguments for AuthorizeIssuer
|
|
24
|
-
const choiceArguments = {
|
|
25
|
-
issuer: params.issuer
|
|
26
|
-
};
|
|
27
|
-
// Submit the choice to the factory contract
|
|
28
|
-
const response = await client.submitAndWaitForTransactionTree({
|
|
29
|
-
commands: [
|
|
30
|
-
{
|
|
31
|
-
ExerciseCommand: {
|
|
32
|
-
templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.OcpFactory.OcpFactory.templateId,
|
|
33
|
-
contractId: networkData.ocpFactoryContractId,
|
|
34
|
-
choice: 'AuthorizeIssuer',
|
|
35
|
-
choiceArgument: choiceArguments
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
});
|
|
40
|
-
const issuerContractId = response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId;
|
|
41
|
-
const issuerContractEvents = await client.getEventsByContractId({
|
|
42
|
-
contractId: issuerContractId
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
contractId: issuerContractId,
|
|
46
|
-
updateId: response.transactionTree.updateId,
|
|
47
|
-
createdEventBlob: issuerContractEvents.created.createdEvent.createdEventBlob,
|
|
48
|
-
synchronizerId: response.transactionTree.synchronizerId,
|
|
49
|
-
templateId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.templateId
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=authorizeIssuer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorizeIssuer.js","sourceRoot":"","sources":["../../src/functions/authorizeIssuer.ts"],"names":[],"mappings":";;;;;AAuBA,0CA4CC;AAnED,6FAAoE;AAEpE,yIAA0G;AAe1G;;;;;GAKG;AACI,KAAK,UAAU,eAAe,CACnC,MAA2B,EAC3B,MAA6B;IAE7B,0CAA0C;IAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAEpC,0DAA0D;IAC1D,MAAM,WAAW,GAAG,sCAAqB,CAAC,OAA6C,CAAC,CAAC;IACzF,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,kDAAkD;IAClD,MAAM,eAAe,GAAqD;QACxE,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC;IAEF,4CAA4C;IAC5C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU;oBAClE,UAAU,EAAE,WAAW,CAAC,oBAAoB;oBAC5C,MAAM,EAAE,iBAAiB;oBACzB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,MAAM,gBAAgB,GAAG,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,CAAC;IAClG,MAAM,oBAAoB,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QAC9D,UAAU,EAAE,gBAAgB;KAC7B,CAAC,CAAA;IAEF,OAAO;QACL,UAAU,EAAE,gBAAgB;QAC5B,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;QAC3C,gBAAgB,EAAE,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB;QAC5E,cAAc,EAAE,QAAQ,CAAC,eAAe,CAAC,cAAc;QACvD,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;KACrF,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
|
|
2
|
-
export interface ConfirmCurrentCompanyValuationReportParams {
|
|
3
|
-
companyValuationReportContractId: string;
|
|
4
|
-
}
|
|
5
|
-
export interface ConfirmCurrentCompanyValuationReportResult {
|
|
6
|
-
contractId: string;
|
|
7
|
-
updateId: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Confirm the current company valuation on a CompanyValuationReport by exercising ConfirmCurrent.
|
|
11
|
-
*/
|
|
12
|
-
export declare function confirmCurrentCompanyValuationReport(client: LedgerJsonApiClient, params: ConfirmCurrentCompanyValuationReportParams): Promise<ConfirmCurrentCompanyValuationReportResult>;
|
|
13
|
-
//# sourceMappingURL=confirmCurrentCompanyValuationReport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confirmCurrentCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../src/functions/confirmCurrentCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,0CAA0C;IACzD,gCAAgC,EAAE,MAAM,CAAC;CAC1C;AAED,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC,CA2BrD"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.confirmCurrentCompanyValuationReport = confirmCurrentCompanyValuationReport;
|
|
4
|
-
const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
|
|
5
|
-
/**
|
|
6
|
-
* Confirm the current company valuation on a CompanyValuationReport by exercising ConfirmCurrent.
|
|
7
|
-
*/
|
|
8
|
-
async function confirmCurrentCompanyValuationReport(client, params) {
|
|
9
|
-
// Determine the acting party (system_operator) from the created event
|
|
10
|
-
const eventsResponse = await client.getEventsByContractId({
|
|
11
|
-
contractId: params.companyValuationReportContractId
|
|
12
|
-
});
|
|
13
|
-
const systemOperator = eventsResponse.created.createdEvent.createArgument.system_operator;
|
|
14
|
-
const choiceArguments = {};
|
|
15
|
-
const response = await client.submitAndWaitForTransactionTree({
|
|
16
|
-
actAs: [systemOperator],
|
|
17
|
-
commands: [
|
|
18
|
-
{
|
|
19
|
-
ExerciseCommand: {
|
|
20
|
-
templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.CompanyValuationReport.CompanyValuationReport.templateId,
|
|
21
|
-
contractId: params.companyValuationReportContractId,
|
|
22
|
-
choice: 'ConfirmCurrent',
|
|
23
|
-
choiceArgument: choiceArguments
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
});
|
|
28
|
-
return {
|
|
29
|
-
contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
|
|
30
|
-
updateId: response.transactionTree.updateId
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=confirmCurrentCompanyValuationReport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confirmCurrentCompanyValuationReport.js","sourceRoot":"","sources":["../../src/functions/confirmCurrentCompanyValuationReport.ts"],"names":[],"mappings":";;AAgBA,oFA8BC;AA9CD,6FAAoE;AAapE;;GAEG;AACI,KAAK,UAAU,oCAAoC,CACxD,MAA2B,EAC3B,MAAkD;IAElD,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAAgE,EAAE,CAAC;IAExF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,gBAAgB;oBACxB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
|
|
2
|
-
export interface CreateCompanyValuationReportParams {
|
|
3
|
-
companyId: string;
|
|
4
|
-
companyValuation: string | number;
|
|
5
|
-
observers?: string[];
|
|
6
|
-
}
|
|
7
|
-
export interface CreateCompanyValuationReportResult {
|
|
8
|
-
contractId: string;
|
|
9
|
-
updateId: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Create a CompanyValuationReport by exercising the CreateCompanyValuationReport choice
|
|
13
|
-
* on the OCP Factory contract.
|
|
14
|
-
*/
|
|
15
|
-
export declare function createCompanyValuationReport(client: LedgerJsonApiClient, params: CreateCompanyValuationReportParams): Promise<CreateCompanyValuationReportResult>;
|
|
16
|
-
//# sourceMappingURL=createCompanyValuationReport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../src/functions/createCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,WAAW,kCAAkC;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,kCAAkC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC,CAgC7C"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createCompanyValuationReport = createCompanyValuationReport;
|
|
7
|
-
const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
|
|
8
|
-
const ocp_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/ocp-factory-contract-id.json"));
|
|
9
|
-
/**
|
|
10
|
-
* Create a CompanyValuationReport by exercising the CreateCompanyValuationReport choice
|
|
11
|
-
* on the OCP Factory contract.
|
|
12
|
-
*/
|
|
13
|
-
async function createCompanyValuationReport(client, params) {
|
|
14
|
-
const network = client.getNetwork();
|
|
15
|
-
const networkData = ocp_factory_contract_id_json_1.default[network];
|
|
16
|
-
if (!networkData) {
|
|
17
|
-
throw new Error(`Unsupported network: ${network}`);
|
|
18
|
-
}
|
|
19
|
-
const choiceArguments = {
|
|
20
|
-
company_id: params.companyId,
|
|
21
|
-
company_valuation: typeof params.companyValuation === 'number'
|
|
22
|
-
? params.companyValuation.toString()
|
|
23
|
-
: params.companyValuation,
|
|
24
|
-
observers: params.observers ?? []
|
|
25
|
-
};
|
|
26
|
-
const response = await client.submitAndWaitForTransactionTree({
|
|
27
|
-
commands: [
|
|
28
|
-
{
|
|
29
|
-
ExerciseCommand: {
|
|
30
|
-
templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.OcpFactory.OcpFactory.templateId,
|
|
31
|
-
contractId: networkData.ocpFactoryContractId,
|
|
32
|
-
choice: 'CreateCompanyValuationReport',
|
|
33
|
-
choiceArgument: choiceArguments
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
});
|
|
38
|
-
return {
|
|
39
|
-
contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
|
|
40
|
-
updateId: response.transactionTree.updateId
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=createCompanyValuationReport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createCompanyValuationReport.js","sourceRoot":"","sources":["../../src/functions/createCompanyValuationReport.ts"],"names":[],"mappings":";;;;;AAoBA,oEAmCC;AAvDD,6FAAoE;AAEpE,yIAA0G;AAc1G;;;GAGG;AACI,KAAK,UAAU,4BAA4B,CAChD,MAA2B,EAC3B,MAA0C;IAE1C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,MAAM,WAAW,GAAG,sCAAqB,CAAC,OAA6C,CAAC,CAAC;IACzF,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,eAAe,GAAkE;QACrF,UAAU,EAAE,MAAM,CAAC,SAAS;QAC5B,iBAAiB,EAAE,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ;YAC5D,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE;YACpC,CAAC,CAAC,MAAM,CAAC,gBAAgB;QAC3B,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE;KAClC,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU;oBAClE,UAAU,EAAE,WAAW,CAAC,oBAAoB;oBAC5C,MAAM,EAAE,8BAA8B;oBACtC,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
|
|
2
|
-
import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
|
|
3
|
-
/**
|
|
4
|
-
* Details about the IssuerAuthorization contract that need to be disclosed
|
|
5
|
-
* when exercising the CreateIssuer choice. This is required for cross-domain
|
|
6
|
-
* contract interactions in Canton.
|
|
7
|
-
*/
|
|
8
|
-
export interface IssuerAuthorizationContractDetails {
|
|
9
|
-
/** The contract ID of the IssuerAuthorization contract */
|
|
10
|
-
contractId: string;
|
|
11
|
-
/** The serialized created event blob of the contract */
|
|
12
|
-
createdEventBlob: string;
|
|
13
|
-
/** The synchronizer ID associated with the contract */
|
|
14
|
-
synchronizerId: string;
|
|
15
|
-
/** The template ID of the contract */
|
|
16
|
-
templateId: string;
|
|
17
|
-
}
|
|
18
|
-
export interface CreateIssuerParams {
|
|
19
|
-
/** Details of the IssuerAuthorization contract for disclosed contracts */
|
|
20
|
-
issuerAuthorizationContractDetails: IssuerAuthorizationContractDetails;
|
|
21
|
-
issuerParty: string;
|
|
22
|
-
/** Issuer data to create */
|
|
23
|
-
issuerData: Fairmint.OpenCapTable.OcfObjects.OcfIssuerData;
|
|
24
|
-
}
|
|
25
|
-
export interface CreateIssuerResult {
|
|
26
|
-
contractId: string;
|
|
27
|
-
updateId: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Create an issuer by exercising the CreateIssuer choice on an IssuerAuthorization contract
|
|
31
|
-
*
|
|
32
|
-
* This function requires the IssuerAuthorization contract details to be provided for disclosed contracts,
|
|
33
|
-
* which is necessary for cross-domain contract interactions in Canton.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const issuerAuthorizationContractDetails = {
|
|
38
|
-
* contractId: "1234567890abcdef",
|
|
39
|
-
* createdEventBlob: "serialized_contract_blob_here",
|
|
40
|
-
* synchronizerId: "sync_id_here"
|
|
41
|
-
* };
|
|
42
|
-
*
|
|
43
|
-
* const result = await createIssuer(client, {
|
|
44
|
-
* issuerAuthorizationContractDetails,
|
|
45
|
-
* issuerData: {
|
|
46
|
-
* legal_name: "My Company Inc.",
|
|
47
|
-
* country_of_formation: "US",
|
|
48
|
-
* // ... other issuer data
|
|
49
|
-
* }
|
|
50
|
-
* });
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @param client - The ledger JSON API client
|
|
54
|
-
* @param params - Parameters for creating an issuer, including the IssuerAuthorization contract details
|
|
55
|
-
* @returns Promise resolving to the result of the issuer creation
|
|
56
|
-
*/
|
|
57
|
-
export declare function createIssuer(client: LedgerJsonApiClient, params: CreateIssuerParams): Promise<CreateIssuerResult>;
|
|
58
|
-
//# sourceMappingURL=createIssuer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createIssuer.d.ts","sourceRoot":"","sources":["../../src/functions/createIssuer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IACjD,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,gBAAgB,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,kCAAkC,EAAE,kCAAkC,CAAC;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC;CAC5D;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAiC7B"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createIssuer = createIssuer;
|
|
4
|
-
const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
|
|
5
|
-
/**
|
|
6
|
-
* Create an issuer by exercising the CreateIssuer choice on an IssuerAuthorization contract
|
|
7
|
-
*
|
|
8
|
-
* This function requires the IssuerAuthorization contract details to be provided for disclosed contracts,
|
|
9
|
-
* which is necessary for cross-domain contract interactions in Canton.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const issuerAuthorizationContractDetails = {
|
|
14
|
-
* contractId: "1234567890abcdef",
|
|
15
|
-
* createdEventBlob: "serialized_contract_blob_here",
|
|
16
|
-
* synchronizerId: "sync_id_here"
|
|
17
|
-
* };
|
|
18
|
-
*
|
|
19
|
-
* const result = await createIssuer(client, {
|
|
20
|
-
* issuerAuthorizationContractDetails,
|
|
21
|
-
* issuerData: {
|
|
22
|
-
* legal_name: "My Company Inc.",
|
|
23
|
-
* country_of_formation: "US",
|
|
24
|
-
* // ... other issuer data
|
|
25
|
-
* }
|
|
26
|
-
* });
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @param client - The ledger JSON API client
|
|
30
|
-
* @param params - Parameters for creating an issuer, including the IssuerAuthorization contract details
|
|
31
|
-
* @returns Promise resolving to the result of the issuer creation
|
|
32
|
-
*/
|
|
33
|
-
async function createIssuer(client, params) {
|
|
34
|
-
// Create the choice arguments for CreateIssuer
|
|
35
|
-
const choiceArguments = {
|
|
36
|
-
issuer_data: params.issuerData
|
|
37
|
-
};
|
|
38
|
-
// Submit the choice to the IssuerAuthorization contract
|
|
39
|
-
const response = await client.submitAndWaitForTransactionTree({
|
|
40
|
-
actAs: [params.issuerParty],
|
|
41
|
-
commands: [
|
|
42
|
-
{
|
|
43
|
-
ExerciseCommand: {
|
|
44
|
-
templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.IssuerAuthorization.IssuerAuthorization.templateId,
|
|
45
|
-
contractId: params.issuerAuthorizationContractDetails.contractId,
|
|
46
|
-
choice: 'CreateIssuer',
|
|
47
|
-
choiceArgument: choiceArguments
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
disclosedContracts: [
|
|
52
|
-
{
|
|
53
|
-
templateId: params.issuerAuthorizationContractDetails.templateId,
|
|
54
|
-
contractId: params.issuerAuthorizationContractDetails.contractId,
|
|
55
|
-
createdEventBlob: params.issuerAuthorizationContractDetails.createdEventBlob,
|
|
56
|
-
synchronizerId: params.issuerAuthorizationContractDetails.synchronizerId
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
});
|
|
60
|
-
return {
|
|
61
|
-
contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
|
|
62
|
-
updateId: response.transactionTree.updateId
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=createIssuer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createIssuer.js","sourceRoot":"","sources":["../../src/functions/createIssuer.ts"],"names":[],"mappings":";;AA6DA,oCAoCC;AAjGD,6FAAoE;AAiCpE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,KAAK,UAAU,YAAY,CAChC,MAA2B,EAC3B,MAA0B;IAE1B,+CAA+C;IAC/C,MAAM,eAAe,GAA2D;QAC9E,WAAW,EAAE,MAAM,CAAC,UAAU;KAC/B,CAAC;IAEF,wDAAwD;IACxD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3B,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,UAAU;oBACpF,UAAU,EAAE,MAAM,CAAC,kCAAkC,CAAC,UAAU;oBAChE,MAAM,EAAE,cAAc;oBACtB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;QACD,kBAAkB,EAAE;YAClB;gBACE,UAAU,EAAE,MAAM,CAAC,kCAAkC,CAAC,UAAU;gBAChE,UAAU,EAAE,MAAM,CAAC,kCAAkC,CAAC,UAAU;gBAChE,gBAAgB,EAAE,MAAM,CAAC,kCAAkC,CAAC,gBAAgB;gBAC5E,cAAc,EAAE,MAAM,CAAC,kCAAkC,CAAC,cAAc;aACzE;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
|
|
2
|
-
export interface UpdateCompanyValuationParams {
|
|
3
|
-
companyValuationReportContractId: string;
|
|
4
|
-
newCompanyValuation: string | number;
|
|
5
|
-
}
|
|
6
|
-
export interface UpdateCompanyValuationResult {
|
|
7
|
-
contractId: string;
|
|
8
|
-
updateId: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Update the company valuation on a CompanyValuationReport by exercising SetCompanyValuation.
|
|
12
|
-
*/
|
|
13
|
-
export declare function updateCompanyValuation(client: LedgerJsonApiClient, params: UpdateCompanyValuationParams): Promise<UpdateCompanyValuationResult>;
|
|
14
|
-
//# sourceMappingURL=updateCompanyValuation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateCompanyValuation.d.ts","sourceRoot":"","sources":["../../src/functions/updateCompanyValuation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,4BAA4B;IAC3C,gCAAgC,EAAE,MAAM,CAAC;IACzC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC,CA+BvC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateCompanyValuation = updateCompanyValuation;
|
|
4
|
-
const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
|
|
5
|
-
/**
|
|
6
|
-
* Update the company valuation on a CompanyValuationReport by exercising SetCompanyValuation.
|
|
7
|
-
*/
|
|
8
|
-
async function updateCompanyValuation(client, params) {
|
|
9
|
-
// Determine the acting party (system_operator) from the created event
|
|
10
|
-
const eventsResponse = await client.getEventsByContractId({
|
|
11
|
-
contractId: params.companyValuationReportContractId
|
|
12
|
-
});
|
|
13
|
-
const systemOperator = eventsResponse.created.createdEvent.createArgument.system_operator;
|
|
14
|
-
const choiceArguments = {
|
|
15
|
-
new_company_valuation: typeof params.newCompanyValuation === 'number'
|
|
16
|
-
? params.newCompanyValuation.toString()
|
|
17
|
-
: params.newCompanyValuation
|
|
18
|
-
};
|
|
19
|
-
const response = await client.submitAndWaitForTransactionTree({
|
|
20
|
-
actAs: [systemOperator],
|
|
21
|
-
commands: [
|
|
22
|
-
{
|
|
23
|
-
ExerciseCommand: {
|
|
24
|
-
templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.CompanyValuationReport.CompanyValuationReport.templateId,
|
|
25
|
-
contractId: params.companyValuationReportContractId,
|
|
26
|
-
choice: 'SetCompanyValuation',
|
|
27
|
-
choiceArgument: choiceArguments
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
|
|
34
|
-
updateId: response.transactionTree.updateId
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=updateCompanyValuation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateCompanyValuation.js","sourceRoot":"","sources":["../../src/functions/updateCompanyValuation.ts"],"names":[],"mappings":";;AAiBA,wDAkCC;AAnDD,6FAAoE;AAcpE;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAC1C,MAA2B,EAC3B,MAAoC;IAEpC,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAAqE;QACxF,qBAAqB,EAAE,OAAO,MAAM,CAAC,mBAAmB,KAAK,QAAQ;YACnE,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE;YACvC,CAAC,CAAC,MAAM,CAAC,mBAAmB;KAC/B,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,qBAAqB;oBAC7B,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
|
|
2
|
-
import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
|
|
3
|
-
export interface UpdateIssuerDataParams {
|
|
4
|
-
issuerContractId: string;
|
|
5
|
-
newIssuerData: Fairmint.OpenCapTable.OcfObjects.OcfIssuerData;
|
|
6
|
-
}
|
|
7
|
-
export interface UpdateIssuerDataResult {
|
|
8
|
-
contractId: string;
|
|
9
|
-
updateId: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Update issuer data by exercising the UpdateIssuerData choice on an Issuer contract
|
|
13
|
-
* @param client - The ledger JSON API client
|
|
14
|
-
* @param params - Parameters for updating issuer data
|
|
15
|
-
* @returns Promise resolving to the result of the issuer data update
|
|
16
|
-
*/
|
|
17
|
-
export declare function updateIssuerData(client: LedgerJsonApiClient, params: UpdateIssuerDataParams): Promise<UpdateIssuerDataResult>;
|
|
18
|
-
//# sourceMappingURL=updateIssuerData.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateIssuerData.d.ts","sourceRoot":"","sources":["../../src/functions/updateIssuerData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC;CAC/D;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,CAgCjC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateIssuerData = updateIssuerData;
|
|
4
|
-
const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
|
|
5
|
-
/**
|
|
6
|
-
* Update issuer data by exercising the UpdateIssuerData choice on an Issuer contract
|
|
7
|
-
* @param client - The ledger JSON API client
|
|
8
|
-
* @param params - Parameters for updating issuer data
|
|
9
|
-
* @returns Promise resolving to the result of the issuer data update
|
|
10
|
-
*/
|
|
11
|
-
async function updateIssuerData(client, params) {
|
|
12
|
-
// Get the events for the Issuer contract to extract the issuer party
|
|
13
|
-
const eventsResponse = await client.getEventsByContractId({
|
|
14
|
-
contractId: params.issuerContractId
|
|
15
|
-
});
|
|
16
|
-
const issuerParty = eventsResponse.created.createdEvent.createArgument.issuer;
|
|
17
|
-
// Create the choice arguments for UpdateIssuerData
|
|
18
|
-
const choiceArguments = {
|
|
19
|
-
new_issuer_data: params.newIssuerData
|
|
20
|
-
};
|
|
21
|
-
// Submit the choice to the Issuer contract
|
|
22
|
-
const response = await client.submitAndWaitForTransactionTree({
|
|
23
|
-
actAs: [issuerParty],
|
|
24
|
-
commands: [
|
|
25
|
-
{
|
|
26
|
-
ExerciseCommand: {
|
|
27
|
-
templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.Issuer.Issuer.templateId,
|
|
28
|
-
contractId: params.issuerContractId,
|
|
29
|
-
choice: 'UpdateIssuerData',
|
|
30
|
-
choiceArgument: choiceArguments
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
});
|
|
35
|
-
return {
|
|
36
|
-
contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
|
|
37
|
-
updateId: response.transactionTree.updateId
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=updateIssuerData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateIssuerData.js","sourceRoot":"","sources":["../../src/functions/updateIssuerData.ts"],"names":[],"mappings":";;AAoBA,4CAmCC;AAvDD,6FAAoE;AAcpE;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB,CACpC,MAA2B,EAC3B,MAA8B;IAE9B,qEAAqE;IACrE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gBAAgB;KACpC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC;IAE9E,mDAAmD;IACnD,MAAM,eAAe,GAAkD;QACrE,eAAe,EAAE,MAAM,CAAC,aAAa;KACtC,CAAC;IAEF,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU;oBAC1D,UAAU,EAAE,MAAM,CAAC,gBAAgB;oBACnC,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
|