@ottochain/sdk 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/apps/contracts/index.js +15 -8
- package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +35 -40
- package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +80 -37
- package/dist/cjs/apps/contracts/state-machines/contract-universal.js +4 -4
- package/dist/cjs/apps/corporate/index.js +2 -2
- package/dist/cjs/apps/corporate/state-machines/corp-board.js +169 -59
- package/dist/cjs/apps/corporate/state-machines/corp-entity.js +245 -47
- package/dist/cjs/apps/corporate/state-machines/corp-securities.js +407 -99
- package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +151 -37
- package/dist/cjs/apps/governance/index.js +14 -14
- package/dist/cjs/apps/governance/state-machines/dao-multisig.js +58 -40
- package/dist/cjs/apps/governance/state-machines/dao-reputation.js +46 -40
- package/dist/cjs/apps/governance/state-machines/dao-single.js +28 -11
- package/dist/cjs/apps/governance/state-machines/dao-token.js +67 -41
- package/dist/cjs/apps/governance/state-machines/governance-simple.js +93 -61
- package/dist/cjs/apps/governance/state-machines/governance-universal.js +2 -2
- package/dist/cjs/apps/identity/constants.js +55 -14
- package/dist/cjs/apps/identity/index.js +27 -11
- package/dist/cjs/apps/identity/state-machines/identity-agent.js +3 -3
- package/dist/cjs/apps/identity/state-machines/identity-oracle.js +25 -22
- package/dist/cjs/apps/identity/state-machines/identity-registry.js +288 -0
- package/dist/cjs/apps/identity/state-machines/identity-universal.js +3 -3
- package/dist/cjs/apps/identity/state-machines/index.js +3 -1
- package/dist/cjs/apps/index.js +19 -8
- package/dist/cjs/apps/lending/assets.js +223 -0
- package/dist/cjs/apps/lending/credit-scoring.js +87 -0
- package/dist/cjs/apps/lending/eligibility.js +121 -0
- package/dist/cjs/apps/lending/index.js +91 -0
- package/dist/cjs/apps/lending/state-machines/index.js +9 -0
- package/dist/cjs/apps/lending/state-machines/lending-zk-loan.js +412 -0
- package/dist/cjs/apps/markets/index.js +21 -11
- package/dist/cjs/apps/markets/state-machines/market-auction.js +14 -13
- package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +29 -24
- package/dist/cjs/apps/markets/state-machines/market-group-buy.js +24 -26
- package/dist/cjs/apps/markets/state-machines/market-prediction.js +80 -53
- package/dist/cjs/apps/markets/state-machines/market-universal.js +5 -5
- package/dist/cjs/apps/oracles/index.js +2 -2
- package/dist/cjs/errors.js +3 -3
- package/dist/cjs/generated/google/protobuf/struct.js +4 -4
- package/dist/cjs/generated/index.js +11 -7
- package/dist/cjs/generated/openapi.js +6 -0
- package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +50 -50
- package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +19 -20
- package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +13 -13
- package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +4 -4
- package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +124 -130
- package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +107 -107
- package/dist/cjs/generated/ottochain/v1/common.js +4 -4
- package/dist/cjs/generated/ottochain/v1/fiber.js +4 -4
- package/dist/cjs/index.js +41 -7
- package/dist/cjs/openapi.js +2 -0
- package/dist/cjs/ottochain/drop-nulls.js +1 -2
- package/dist/cjs/ottochain/genesis-manifest.js +11 -11
- package/dist/cjs/ottochain/index.js +23 -13
- package/dist/cjs/ottochain/metagraph-client.js +65 -8
- package/dist/cjs/ottochain/snapshot.js +11 -12
- package/dist/cjs/ottochain/transaction.js +57 -14
- package/dist/cjs/ottochain/types.js +16 -2
- package/dist/cjs/privacy/index.js +14 -0
- package/dist/cjs/privacy/sealed-bid.js +210 -0
- package/dist/cjs/privacy/shield-app.js +131 -0
- package/dist/cjs/schema/effects.js +40 -0
- package/dist/cjs/schema/fiber-app.js +19 -13
- package/dist/cjs/schema/guard-lint.js +352 -0
- package/dist/cjs/schema/guards.js +246 -0
- package/dist/cjs/signing.js +80 -0
- package/dist/cjs/types.js +2 -3
- package/dist/cjs/validation.js +8 -8
- package/dist/cjs/verify.js +9 -4
- package/dist/cjs/zk/commit.js +53 -0
- package/dist/cjs/zk/guard.js +107 -0
- package/dist/cjs/zk/index.js +48 -0
- package/dist/cjs/zk/preimage.js +37 -0
- package/dist/cjs/zk/prover.js +87 -0
- package/dist/cjs/zk/registry.js +62 -0
- package/dist/cjs/zk/types.js +28 -0
- package/dist/cjs/zk/witness.js +19 -0
- package/dist/esm/apps/contracts/index.js +7 -3
- package/dist/esm/apps/contracts/state-machines/contract-agreement.js +35 -40
- package/dist/esm/apps/contracts/state-machines/contract-escrow.js +80 -37
- package/dist/esm/apps/contracts/state-machines/contract-universal.js +4 -4
- package/dist/esm/apps/corporate/state-machines/corp-board.js +169 -59
- package/dist/esm/apps/corporate/state-machines/corp-entity.js +245 -47
- package/dist/esm/apps/corporate/state-machines/corp-securities.js +407 -99
- package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +151 -37
- package/dist/esm/apps/governance/state-machines/dao-multisig.js +58 -40
- package/dist/esm/apps/governance/state-machines/dao-reputation.js +46 -40
- package/dist/esm/apps/governance/state-machines/dao-single.js +28 -11
- package/dist/esm/apps/governance/state-machines/dao-token.js +67 -41
- package/dist/esm/apps/governance/state-machines/governance-simple.js +93 -61
- package/dist/esm/apps/governance/state-machines/governance-universal.js +2 -2
- package/dist/esm/apps/identity/constants.js +51 -12
- package/dist/esm/apps/identity/index.js +12 -7
- package/dist/esm/apps/identity/state-machines/identity-agent.js +3 -3
- package/dist/esm/apps/identity/state-machines/identity-oracle.js +25 -22
- package/dist/esm/apps/identity/state-machines/identity-registry.js +285 -0
- package/dist/esm/apps/identity/state-machines/identity-universal.js +3 -3
- package/dist/esm/apps/identity/state-machines/index.js +1 -0
- package/dist/esm/apps/index.js +1 -0
- package/dist/esm/apps/lending/assets.js +207 -0
- package/dist/esm/apps/lending/credit-scoring.js +81 -0
- package/dist/esm/apps/lending/eligibility.js +115 -0
- package/dist/esm/apps/lending/index.js +69 -0
- package/dist/esm/apps/lending/state-machines/index.js +5 -0
- package/dist/esm/apps/lending/state-machines/lending-zk-loan.js +409 -0
- package/dist/esm/apps/markets/index.js +8 -4
- package/dist/esm/apps/markets/state-machines/market-auction.js +14 -13
- package/dist/esm/apps/markets/state-machines/market-crowdfund.js +29 -24
- package/dist/esm/apps/markets/state-machines/market-group-buy.js +24 -26
- package/dist/esm/apps/markets/state-machines/market-prediction.js +80 -53
- package/dist/esm/apps/markets/state-machines/market-universal.js +5 -5
- package/dist/esm/generated/index.js +9 -5
- package/dist/esm/generated/openapi.js +5 -0
- package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +46 -46
- package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +114 -120
- package/dist/esm/generated/ottochain/apps/markets/v1/market.js +100 -100
- package/dist/esm/index.js +21 -2
- package/dist/esm/openapi.js +1 -0
- package/dist/esm/ottochain/genesis-manifest.js +9 -9
- package/dist/esm/ottochain/index.js +2 -3
- package/dist/esm/ottochain/metagraph-client.js +65 -8
- package/dist/esm/ottochain/snapshot.js +4 -4
- package/dist/esm/ottochain/transaction.js +43 -3
- package/dist/esm/ottochain/types.js +15 -1
- package/dist/esm/privacy/index.js +6 -0
- package/dist/esm/privacy/sealed-bid.js +206 -0
- package/dist/esm/privacy/shield-app.js +127 -0
- package/dist/esm/schema/effects.js +35 -0
- package/dist/esm/schema/fiber-app.js +13 -6
- package/dist/esm/schema/guard-lint.js +346 -0
- package/dist/esm/schema/guards.js +229 -0
- package/dist/esm/signing.js +74 -0
- package/dist/esm/verify.js +8 -2
- package/dist/esm/zk/commit.js +44 -0
- package/dist/esm/zk/guard.js +99 -0
- package/dist/esm/zk/index.js +19 -0
- package/dist/esm/zk/preimage.js +30 -0
- package/dist/esm/zk/prover.js +82 -0
- package/dist/esm/zk/registry.js +55 -0
- package/dist/esm/zk/types.js +25 -0
- package/dist/esm/zk/witness.js +15 -0
- package/dist/types/apps/contracts/index.d.ts +69 -209
- package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +20 -95
- package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +46 -112
- package/dist/types/apps/corporate/index.d.ts +1040 -304
- package/dist/types/apps/corporate/state-machines/corp-board.d.ts +188 -52
- package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +267 -62
- package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +355 -131
- package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +225 -53
- package/dist/types/apps/governance/index.d.ts +296 -398
- package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +77 -92
- package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +42 -66
- package/dist/types/apps/governance/state-machines/dao-single.d.ts +25 -47
- package/dist/types/apps/governance/state-machines/dao-token.d.ts +60 -49
- package/dist/types/apps/governance/state-machines/governance-simple.d.ts +87 -117
- package/dist/types/apps/governance/state-machines/governance-universal.d.ts +2 -2
- package/dist/types/apps/identity/constants.d.ts +32 -4
- package/dist/types/apps/identity/index.d.ts +378 -94
- package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +16 -87
- package/dist/types/apps/identity/state-machines/identity-registry.d.ts +379 -0
- package/dist/types/apps/identity/state-machines/index.d.ts +1 -0
- package/dist/types/apps/index.d.ts +1 -0
- package/dist/types/apps/lending/assets.d.ts +258 -0
- package/dist/types/apps/lending/credit-scoring.d.ts +80 -0
- package/dist/types/apps/lending/eligibility.d.ts +83 -0
- package/dist/types/apps/lending/index.d.ts +548 -0
- package/dist/types/apps/lending/state-machines/index.d.ts +5 -0
- package/dist/types/apps/lending/state-machines/lending-zk-loan.d.ts +528 -0
- package/dist/types/apps/markets/index.d.ts +108 -203
- package/dist/types/apps/markets/state-machines/market-auction.d.ts +13 -37
- package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +16 -34
- package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +17 -43
- package/dist/types/apps/markets/state-machines/market-prediction.d.ts +51 -72
- package/dist/types/apps/markets/state-machines/market-universal.d.ts +5 -5
- package/dist/types/generated/index.d.ts +5 -5
- package/dist/types/generated/openapi.d.ts +1257 -0
- package/dist/types/generated/ottochain/apps/contracts/v1/contract.d.ts +5 -5
- package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +12 -12
- package/dist/types/generated/ottochain/apps/markets/v1/market.d.ts +11 -11
- package/dist/types/index.d.ts +6 -2
- package/dist/types/openapi.d.ts +22 -0
- package/dist/types/ottochain/genesis-manifest.d.ts +5 -5
- package/dist/types/ottochain/index.d.ts +5 -6
- package/dist/types/ottochain/metagraph-client.d.ts +49 -7
- package/dist/types/ottochain/snapshot.d.ts +6 -6
- package/dist/types/ottochain/transaction.d.ts +33 -1
- package/dist/types/ottochain/types.d.ts +335 -30
- package/dist/types/privacy/index.d.ts +6 -0
- package/dist/types/privacy/sealed-bid.d.ts +348 -0
- package/dist/types/privacy/shield-app.d.ts +48 -0
- package/dist/types/schema/effects.d.ts +34 -0
- package/dist/types/schema/fiber-app.d.ts +1 -2
- package/dist/types/schema/guard-lint.d.ts +111 -0
- package/dist/types/schema/guards.d.ts +134 -0
- package/dist/types/signing.d.ts +45 -0
- package/dist/types/validation.d.ts +22 -217
- package/dist/types/verify.d.ts +4 -0
- package/dist/types/zk/commit.d.ts +28 -0
- package/dist/types/zk/guard.d.ts +46 -0
- package/dist/types/zk/index.d.ts +19 -0
- package/dist/types/zk/preimage.d.ts +10 -0
- package/dist/types/zk/prover.d.ts +34 -0
- package/dist/types/zk/registry.d.ts +34 -0
- package/dist/types/zk/types.d.ts +33 -0
- package/dist/types/zk/witness.d.ts +40 -0
- package/package.json +27 -13
- package/dist/cjs/ottochain/normalize.js +0 -186
- package/dist/esm/ottochain/normalize.js +0 -179
- package/dist/types/ottochain/normalize.d.ts +0 -79
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.corpSecuritiesDef = void 0;
|
|
4
4
|
const fiber_app_js_1 = require("../../../schema/fiber-app.js");
|
|
5
|
+
const guards_js_1 = require("../../../schema/guards.js");
|
|
6
|
+
const effects_js_1 = require("../../../schema/effects.js");
|
|
5
7
|
/**
|
|
6
8
|
* Securities state machine tracking the lifecycle of equity from authorization through issuance, transfer, and retirement.
|
|
7
9
|
* Manages stock certificates, book entry positions, and restricted securities.
|
|
@@ -35,6 +37,7 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
35
37
|
required: [
|
|
36
38
|
"securityId",
|
|
37
39
|
"entityId",
|
|
40
|
+
"issuerAddress",
|
|
38
41
|
"shareClass",
|
|
39
42
|
"shareClassName",
|
|
40
43
|
"shareCount",
|
|
@@ -51,6 +54,11 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
51
54
|
description: "Reference to parent corporate-entity",
|
|
52
55
|
immutable: true,
|
|
53
56
|
},
|
|
57
|
+
issuerAddress: {
|
|
58
|
+
type: "address",
|
|
59
|
+
description: "State-pinned DAG address of the issuing authority (the corporation / transfer agent). Verified against proofs[].address to gate issuer-privileged transitions.",
|
|
60
|
+
immutable: true,
|
|
61
|
+
},
|
|
54
62
|
shareClass: {
|
|
55
63
|
type: "string",
|
|
56
64
|
description: "Share class ID from corporate-entity",
|
|
@@ -73,6 +81,7 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
73
81
|
properties: {
|
|
74
82
|
securityId: { type: "string", immutable: true },
|
|
75
83
|
entityId: { type: "string", immutable: true },
|
|
84
|
+
issuerAddress: { type: "address", immutable: true },
|
|
76
85
|
shareClass: { type: "string" },
|
|
77
86
|
shareClassName: { type: "string" },
|
|
78
87
|
certificateNumber: {
|
|
@@ -145,6 +154,15 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
145
154
|
},
|
|
146
155
|
createdAt: { type: "timestamp", computed: true },
|
|
147
156
|
updatedAt: { type: "timestamp", computed: true },
|
|
157
|
+
// Two-phase resolution gating (#24): each propose_<X> binds the executing resolution (and, for
|
|
158
|
+
// issuance, the parent entity) fiber via _addDependency and records the pending action here; the
|
|
159
|
+
// gated <X> then asserts the bound dependency state via depInState and clears the pending object.
|
|
160
|
+
// The dropped object-form dependencies (which the chain silently never gated) are replaced this way.
|
|
161
|
+
pendingIssue: { type: "object", nullable: true, computed: true },
|
|
162
|
+
pendingRepurchase: { type: "object", nullable: true, computed: true },
|
|
163
|
+
pendingReissue: { type: "object", nullable: true, computed: true },
|
|
164
|
+
pendingRetire: { type: "object", nullable: true, computed: true },
|
|
165
|
+
pendingDividend: { type: "object", nullable: true, computed: true },
|
|
148
166
|
},
|
|
149
167
|
},
|
|
150
168
|
eventSchemas: {
|
|
@@ -170,6 +188,14 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
170
188
|
charterProvision: { type: "string" },
|
|
171
189
|
},
|
|
172
190
|
},
|
|
191
|
+
propose_issue: {
|
|
192
|
+
description: "Phase 1 of issuance (#24): bind the executing board resolution + parent entity fibers (_addDependency) and record the pending issuance",
|
|
193
|
+
required: ["holderId", "boardResolutionRef"],
|
|
194
|
+
properties: {
|
|
195
|
+
holderId: { type: "string" },
|
|
196
|
+
boardResolutionRef: { type: "string" },
|
|
197
|
+
},
|
|
198
|
+
},
|
|
173
199
|
issue_shares: {
|
|
174
200
|
description: "Issue shares to a holder",
|
|
175
201
|
required: [
|
|
@@ -178,13 +204,16 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
178
204
|
"holderName",
|
|
179
205
|
"issuanceDate",
|
|
180
206
|
"form",
|
|
181
|
-
"boardResolutionRef",
|
|
182
207
|
"consideration",
|
|
183
208
|
],
|
|
184
209
|
properties: {
|
|
185
210
|
holderId: { type: "string" },
|
|
186
211
|
holderType: { type: "string" },
|
|
187
212
|
holderName: { type: "string" },
|
|
213
|
+
holderWallet: {
|
|
214
|
+
type: "address",
|
|
215
|
+
description: "DAG wallet address the holder controls; pinned so holder-initiated transfer/repurchase can be authorized via proofs[].address.",
|
|
216
|
+
},
|
|
188
217
|
address: { type: "object" },
|
|
189
218
|
issuanceDate: { type: "string", format: "date" },
|
|
190
219
|
issuancePrice: { type: "number" },
|
|
@@ -193,7 +222,6 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
193
222
|
enum: ["CERTIFICATED", "BOOK_ENTRY", "DRS"],
|
|
194
223
|
},
|
|
195
224
|
certificateNumber: { type: "string" },
|
|
196
|
-
boardResolutionRef: { type: "string" },
|
|
197
225
|
consideration: { type: "object" },
|
|
198
226
|
isRestricted: { type: "boolean", default: false },
|
|
199
227
|
restrictionType: { type: "array" },
|
|
@@ -237,25 +265,40 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
237
265
|
toHolderId: { type: "string" },
|
|
238
266
|
toHolderName: { type: "string" },
|
|
239
267
|
toHolderType: { type: "string" },
|
|
268
|
+
toHolderWallet: {
|
|
269
|
+
type: "address",
|
|
270
|
+
description: "DAG wallet address the new holder controls.",
|
|
271
|
+
},
|
|
240
272
|
toAddress: { type: "object" },
|
|
241
273
|
completedDate: { type: "string", format: "date" },
|
|
242
274
|
costBasis: { type: "number" },
|
|
243
275
|
},
|
|
244
276
|
},
|
|
277
|
+
propose_repurchase: {
|
|
278
|
+
description: "Phase 1 of repurchase (#24): bind the executing board resolution fiber (_addDependency) and record the pending repurchase",
|
|
279
|
+
required: ["repurchaseDate", "boardResolutionRef"],
|
|
280
|
+
properties: {
|
|
281
|
+
repurchaseDate: { type: "string", format: "date" },
|
|
282
|
+
boardResolutionRef: { type: "string" },
|
|
283
|
+
},
|
|
284
|
+
},
|
|
245
285
|
repurchase: {
|
|
246
286
|
description: "Company repurchases shares from holder",
|
|
247
|
-
required: [
|
|
248
|
-
"repurchaseDate",
|
|
249
|
-
"pricePerShare",
|
|
250
|
-
"boardResolutionRef",
|
|
251
|
-
],
|
|
287
|
+
required: ["repurchaseDate", "pricePerShare"],
|
|
252
288
|
properties: {
|
|
253
289
|
repurchaseDate: { type: "string", format: "date" },
|
|
254
290
|
pricePerShare: { type: "number" },
|
|
255
|
-
boardResolutionRef: { type: "string" },
|
|
256
291
|
repurchaseAgreementRef: { type: "string" },
|
|
257
292
|
},
|
|
258
293
|
},
|
|
294
|
+
propose_reissue: {
|
|
295
|
+
description: "Phase 1 of treasury reissue (#24): bind the executing board resolution fiber (_addDependency) and record the pending reissue",
|
|
296
|
+
required: ["holderId", "boardResolutionRef"],
|
|
297
|
+
properties: {
|
|
298
|
+
holderId: { type: "string" },
|
|
299
|
+
boardResolutionRef: { type: "string" },
|
|
300
|
+
},
|
|
301
|
+
},
|
|
259
302
|
reissue_from_treasury: {
|
|
260
303
|
description: "Reissue treasury shares to a new holder",
|
|
261
304
|
required: [
|
|
@@ -263,29 +306,34 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
263
306
|
"holderName",
|
|
264
307
|
"holderType",
|
|
265
308
|
"reissueDate",
|
|
266
|
-
"boardResolutionRef",
|
|
267
309
|
],
|
|
268
310
|
properties: {
|
|
269
311
|
holderId: { type: "string" },
|
|
270
312
|
holderName: { type: "string" },
|
|
271
313
|
holderType: { type: "string" },
|
|
314
|
+
holderWallet: {
|
|
315
|
+
type: "address",
|
|
316
|
+
description: "DAG wallet address the reissued holder controls.",
|
|
317
|
+
},
|
|
272
318
|
address: { type: "object" },
|
|
273
319
|
reissueDate: { type: "string", format: "date" },
|
|
274
320
|
issuancePrice: { type: "number" },
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
propose_retire: {
|
|
324
|
+
description: "Phase 1 of retirement (#24): bind the executing board resolution fiber (_addDependency) and record the pending retirement (from ISSUED or TREASURY)",
|
|
325
|
+
required: ["retiredDate", "boardResolutionRef"],
|
|
326
|
+
properties: {
|
|
327
|
+
retiredDate: { type: "string", format: "date" },
|
|
275
328
|
boardResolutionRef: { type: "string" },
|
|
276
329
|
},
|
|
277
330
|
},
|
|
278
331
|
retire: {
|
|
279
332
|
description: "Retire shares (cancel them)",
|
|
280
|
-
required: [
|
|
281
|
-
"retiredDate",
|
|
282
|
-
"retirementMethod",
|
|
283
|
-
"boardResolutionRef",
|
|
284
|
-
],
|
|
333
|
+
required: ["retiredDate", "retirementMethod"],
|
|
285
334
|
properties: {
|
|
286
335
|
retiredDate: { type: "string", format: "date" },
|
|
287
336
|
retirementMethod: { type: "string" },
|
|
288
|
-
boardResolutionRef: { type: "string" },
|
|
289
337
|
repurchasePrice: { type: "number" },
|
|
290
338
|
},
|
|
291
339
|
},
|
|
@@ -309,6 +357,14 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
309
357
|
newShareCount: { type: "integer" },
|
|
310
358
|
},
|
|
311
359
|
},
|
|
360
|
+
propose_dividend: {
|
|
361
|
+
description: "Phase 1 of dividend declaration (#24): bind the executing board resolution fiber (_addDependency) and record the pending declaration",
|
|
362
|
+
required: ["actionId", "resolutionRef"],
|
|
363
|
+
properties: {
|
|
364
|
+
actionId: { type: "string" },
|
|
365
|
+
resolutionRef: { type: "string" },
|
|
366
|
+
},
|
|
367
|
+
},
|
|
312
368
|
declare_dividend: {
|
|
313
369
|
description: "Record dividend declaration affecting this lot (for stock dividends)",
|
|
314
370
|
required: [
|
|
@@ -316,7 +372,6 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
316
372
|
"dividendType",
|
|
317
373
|
"recordDate",
|
|
318
374
|
"paymentDate",
|
|
319
|
-
"resolutionRef",
|
|
320
375
|
],
|
|
321
376
|
properties: {
|
|
322
377
|
actionId: { type: "string" },
|
|
@@ -325,7 +380,6 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
325
380
|
paymentDate: { type: "string", format: "date" },
|
|
326
381
|
cashAmount: { type: "number" },
|
|
327
382
|
stockShares: { type: "integer" },
|
|
328
|
-
resolutionRef: { type: "string" },
|
|
329
383
|
},
|
|
330
384
|
},
|
|
331
385
|
remove_restriction: {
|
|
@@ -351,6 +405,11 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
351
405
|
},
|
|
352
406
|
name: { type: "string" },
|
|
353
407
|
taxId: { type: "string", nullable: true },
|
|
408
|
+
walletAddress: {
|
|
409
|
+
type: "address",
|
|
410
|
+
nullable: true,
|
|
411
|
+
description: "State-pinned DAG wallet address controlled by this holder; verified against proofs[].address to gate holder-initiated transfer/repurchase.",
|
|
412
|
+
},
|
|
354
413
|
address: { type: "object", nullable: true },
|
|
355
414
|
acquisitionDate: { type: "string", format: "date" },
|
|
356
415
|
acquisitionMethod: {
|
|
@@ -547,7 +606,8 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
547
606
|
from: "AUTHORIZED",
|
|
548
607
|
to: "AUTHORIZED",
|
|
549
608
|
eventName: "authorize_shares",
|
|
550
|
-
|
|
609
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
610
|
+
guard: (0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
551
611
|
effect: {
|
|
552
612
|
merge: [
|
|
553
613
|
{ var: "state" },
|
|
@@ -569,24 +629,53 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
569
629
|
],
|
|
570
630
|
},
|
|
571
631
|
},
|
|
572
|
-
// AUTHORIZED ->
|
|
632
|
+
// AUTHORIZED -> AUTHORIZED (propose_issue) — phase 1 (#24): bind the executing resolution + parent
|
|
633
|
+
// entity fibers and record the pending issuance, so issue_shares can read their state next transition.
|
|
634
|
+
{
|
|
635
|
+
from: "AUTHORIZED",
|
|
636
|
+
to: "AUTHORIZED",
|
|
637
|
+
eventName: "propose_issue",
|
|
638
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
639
|
+
guard: (0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
640
|
+
effect: {
|
|
641
|
+
merge: [
|
|
642
|
+
{ var: "state" },
|
|
643
|
+
{
|
|
644
|
+
pendingIssue: {
|
|
645
|
+
holderId: { var: "event.holderId" },
|
|
646
|
+
ref: { var: "event.boardResolutionRef" },
|
|
647
|
+
proposedAt: { var: "$ordinal" },
|
|
648
|
+
},
|
|
649
|
+
},
|
|
650
|
+
// bind the resolution fiber so issue_shares can assert its state next transition
|
|
651
|
+
(0, effects_js_1.addDependency)({ var: "event.boardResolutionRef" }),
|
|
652
|
+
// bind the parent entity fiber so issue_shares can assert it is ACTIVE
|
|
653
|
+
(0, effects_js_1.addDependency)({ var: "state.entityId" }),
|
|
654
|
+
],
|
|
655
|
+
},
|
|
656
|
+
dependencies: [],
|
|
657
|
+
},
|
|
658
|
+
// AUTHORIZED -> ISSUED — phase 2 (#24): issue once the bound resolution is EXECUTED and the parent
|
|
659
|
+
// entity is ACTIVE. depInState replaces the dropped object-form dependencies (which never gated).
|
|
573
660
|
{
|
|
574
661
|
from: "AUTHORIZED",
|
|
575
662
|
to: "ISSUED",
|
|
576
663
|
eventName: "issue_shares",
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
664
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
665
|
+
guard: {
|
|
666
|
+
and: [
|
|
667
|
+
(0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
668
|
+
// the proposal must target this holder, and its bound resolution must be EXECUTED
|
|
669
|
+
{
|
|
670
|
+
"==": [
|
|
671
|
+
{ var: "state.pendingIssue.holderId" },
|
|
672
|
+
{ var: "event.holderId" },
|
|
673
|
+
],
|
|
674
|
+
},
|
|
675
|
+
(0, guards_js_1.depInState)("state.pendingIssue.ref", "EXECUTED"),
|
|
676
|
+
(0, guards_js_1.depInState)("state.entityId", "ACTIVE"),
|
|
677
|
+
],
|
|
678
|
+
},
|
|
590
679
|
effect: {
|
|
591
680
|
merge: [
|
|
592
681
|
{ var: "state" },
|
|
@@ -600,6 +689,7 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
600
689
|
holderId: { var: "event.holderId" },
|
|
601
690
|
holderType: { var: "event.holderType" },
|
|
602
691
|
name: { var: "event.holderName" },
|
|
692
|
+
walletAddress: { var: "event.holderWallet" },
|
|
603
693
|
address: { var: "event.address" },
|
|
604
694
|
acquisitionDate: { var: "event.issuanceDate" },
|
|
605
695
|
acquisitionMethod: "ORIGINAL_ISSUANCE",
|
|
@@ -616,15 +706,22 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
616
706
|
legends: { var: "event.legends" },
|
|
617
707
|
},
|
|
618
708
|
issuanceDetails: {
|
|
619
|
-
boardResolutionRef: { var: "
|
|
709
|
+
boardResolutionRef: { var: "state.pendingIssue.ref" },
|
|
620
710
|
consideration: { var: "event.consideration" },
|
|
621
711
|
exemptionUsed: { var: "event.exemptionUsed" },
|
|
622
712
|
accreditedInvestor: { var: "event.accreditedInvestor" },
|
|
623
713
|
},
|
|
714
|
+
// clear the consumed proposal
|
|
715
|
+
pendingIssue: null,
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
_emit: [
|
|
719
|
+
{ name: "SHARES_ISSUED", data: { var: "event" }, destination: "external" },
|
|
720
|
+
],
|
|
624
721
|
},
|
|
625
722
|
],
|
|
626
723
|
},
|
|
627
|
-
|
|
724
|
+
dependencies: [],
|
|
628
725
|
},
|
|
629
726
|
// ISSUED -> TRANSFERRED
|
|
630
727
|
{
|
|
@@ -633,6 +730,8 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
633
730
|
eventName: "initiate_transfer",
|
|
634
731
|
guard: {
|
|
635
732
|
and: [
|
|
733
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
734
|
+
(0, guards_js_1.signerIsParty)("state.holder.walletAddress"),
|
|
636
735
|
{
|
|
637
736
|
or: [
|
|
638
737
|
{ "==": [{ var: "state.restrictions.isRestricted" }, false] },
|
|
@@ -641,7 +740,7 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
641
740
|
},
|
|
642
741
|
{
|
|
643
742
|
">=": [
|
|
644
|
-
{ var: "$
|
|
743
|
+
{ var: "$ordinal" },
|
|
645
744
|
{ var: "state.restrictions.restrictionEndDate" },
|
|
646
745
|
],
|
|
647
746
|
},
|
|
@@ -656,7 +755,7 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
656
755
|
{
|
|
657
756
|
status: "TRANSFERRED",
|
|
658
757
|
transferHistory: {
|
|
659
|
-
|
|
758
|
+
merge: [
|
|
660
759
|
{ var: "state.transferHistory" },
|
|
661
760
|
[
|
|
662
761
|
{
|
|
@@ -672,16 +771,21 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
672
771
|
],
|
|
673
772
|
},
|
|
674
773
|
},
|
|
774
|
+
{
|
|
775
|
+
_emit: [
|
|
776
|
+
{ name: "TRANSFER_INITIATED", data: { var: "event" }, destination: "external" },
|
|
777
|
+
],
|
|
778
|
+
},
|
|
675
779
|
],
|
|
676
780
|
},
|
|
677
|
-
emits: ["TRANSFER_INITIATED"],
|
|
678
781
|
},
|
|
679
782
|
// TRANSFERRED -> ISSUED
|
|
680
783
|
{
|
|
681
784
|
from: "TRANSFERRED",
|
|
682
785
|
to: "ISSUED",
|
|
683
786
|
eventName: "complete_transfer",
|
|
684
|
-
|
|
787
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
788
|
+
guard: (0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
685
789
|
effect: {
|
|
686
790
|
merge: [
|
|
687
791
|
{ var: "state" },
|
|
@@ -691,6 +795,7 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
691
795
|
holderId: { var: "event.toHolderId" },
|
|
692
796
|
holderType: { var: "event.toHolderType" },
|
|
693
797
|
name: { var: "event.toHolderName" },
|
|
798
|
+
walletAddress: { var: "event.toHolderWallet" },
|
|
694
799
|
address: { var: "event.toAddress" },
|
|
695
800
|
acquisitionDate: { var: "event.completedDate" },
|
|
696
801
|
acquisitionMethod: "PURCHASE",
|
|
@@ -704,30 +809,64 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
704
809
|
],
|
|
705
810
|
},
|
|
706
811
|
},
|
|
812
|
+
{
|
|
813
|
+
_emit: [
|
|
814
|
+
{ name: "TRANSFER_COMPLETED", data: { var: "event" }, destination: "external" },
|
|
815
|
+
],
|
|
816
|
+
},
|
|
817
|
+
],
|
|
818
|
+
},
|
|
819
|
+
},
|
|
820
|
+
// ISSUED -> ISSUED (propose_repurchase) — phase 1 (#24): bind the executing resolution fiber and
|
|
821
|
+
// record the pending repurchase, so repurchase can read the resolution's state next transition.
|
|
822
|
+
{
|
|
823
|
+
from: "ISSUED",
|
|
824
|
+
to: "ISSUED",
|
|
825
|
+
eventName: "propose_repurchase",
|
|
826
|
+
// authority gate — the selling holder must sign; an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
827
|
+
guard: (0, guards_js_1.signerIsParty)("state.holder.walletAddress"),
|
|
828
|
+
effect: {
|
|
829
|
+
merge: [
|
|
830
|
+
{ var: "state" },
|
|
831
|
+
{
|
|
832
|
+
pendingRepurchase: {
|
|
833
|
+
repurchaseDate: { var: "event.repurchaseDate" },
|
|
834
|
+
ref: { var: "event.boardResolutionRef" },
|
|
835
|
+
proposedAt: { var: "$ordinal" },
|
|
836
|
+
},
|
|
837
|
+
},
|
|
838
|
+
// bind the resolution fiber so repurchase can assert its state next transition
|
|
839
|
+
(0, effects_js_1.addDependency)({ var: "event.boardResolutionRef" }),
|
|
707
840
|
],
|
|
708
841
|
},
|
|
709
|
-
|
|
842
|
+
dependencies: [],
|
|
710
843
|
},
|
|
711
|
-
// ISSUED -> TREASURY
|
|
844
|
+
// ISSUED -> TREASURY — phase 2 (#24): repurchase once the bound resolution is EXECUTED.
|
|
712
845
|
{
|
|
713
846
|
from: "ISSUED",
|
|
714
847
|
to: "TREASURY",
|
|
715
848
|
eventName: "repurchase",
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
849
|
+
// authority gate — the selling holder must sign; an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
850
|
+
guard: {
|
|
851
|
+
and: [
|
|
852
|
+
(0, guards_js_1.signerIsParty)("state.holder.walletAddress"),
|
|
853
|
+
// the proposal must match this repurchase, and its bound resolution must be EXECUTED
|
|
854
|
+
{
|
|
855
|
+
"==": [
|
|
856
|
+
{ var: "state.pendingRepurchase.repurchaseDate" },
|
|
857
|
+
{ var: "event.repurchaseDate" },
|
|
858
|
+
],
|
|
859
|
+
},
|
|
860
|
+
(0, guards_js_1.depInState)("state.pendingRepurchase.ref", "EXECUTED"),
|
|
861
|
+
],
|
|
862
|
+
},
|
|
724
863
|
effect: {
|
|
725
864
|
merge: [
|
|
726
865
|
{ var: "state" },
|
|
727
866
|
{
|
|
728
867
|
status: "TREASURY",
|
|
729
868
|
transferHistory: {
|
|
730
|
-
|
|
869
|
+
merge: [
|
|
731
870
|
{ var: "state.transferHistory" },
|
|
732
871
|
[
|
|
733
872
|
{
|
|
@@ -757,24 +896,61 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
757
896
|
],
|
|
758
897
|
},
|
|
759
898
|
},
|
|
899
|
+
// clear the consumed proposal
|
|
900
|
+
pendingRepurchase: null,
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
_emit: [
|
|
904
|
+
{ name: "SHARES_REPURCHASED", data: { var: "event" }, destination: "external" },
|
|
905
|
+
],
|
|
760
906
|
},
|
|
761
907
|
],
|
|
762
908
|
},
|
|
763
|
-
|
|
909
|
+
dependencies: [],
|
|
764
910
|
},
|
|
765
|
-
// TREASURY ->
|
|
911
|
+
// TREASURY -> TREASURY (propose_reissue) — phase 1 (#24): bind the executing resolution fiber and
|
|
912
|
+
// record the pending reissue, so reissue_from_treasury can read the resolution's state next transition.
|
|
913
|
+
{
|
|
914
|
+
from: "TREASURY",
|
|
915
|
+
to: "TREASURY",
|
|
916
|
+
eventName: "propose_reissue",
|
|
917
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
918
|
+
guard: (0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
919
|
+
effect: {
|
|
920
|
+
merge: [
|
|
921
|
+
{ var: "state" },
|
|
922
|
+
{
|
|
923
|
+
pendingReissue: {
|
|
924
|
+
holderId: { var: "event.holderId" },
|
|
925
|
+
ref: { var: "event.boardResolutionRef" },
|
|
926
|
+
proposedAt: { var: "$ordinal" },
|
|
927
|
+
},
|
|
928
|
+
},
|
|
929
|
+
// bind the resolution fiber so reissue_from_treasury can assert its state next transition
|
|
930
|
+
(0, effects_js_1.addDependency)({ var: "event.boardResolutionRef" }),
|
|
931
|
+
],
|
|
932
|
+
},
|
|
933
|
+
dependencies: [],
|
|
934
|
+
},
|
|
935
|
+
// TREASURY -> ISSUED — phase 2 (#24): reissue once the bound resolution is EXECUTED.
|
|
766
936
|
{
|
|
767
937
|
from: "TREASURY",
|
|
768
938
|
to: "ISSUED",
|
|
769
939
|
eventName: "reissue_from_treasury",
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
940
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
941
|
+
guard: {
|
|
942
|
+
and: [
|
|
943
|
+
(0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
944
|
+
// the proposal must target this holder, and its bound resolution must be EXECUTED
|
|
945
|
+
{
|
|
946
|
+
"==": [
|
|
947
|
+
{ var: "state.pendingReissue.holderId" },
|
|
948
|
+
{ var: "event.holderId" },
|
|
949
|
+
],
|
|
950
|
+
},
|
|
951
|
+
(0, guards_js_1.depInState)("state.pendingReissue.ref", "EXECUTED"),
|
|
952
|
+
],
|
|
953
|
+
},
|
|
778
954
|
effect: {
|
|
779
955
|
merge: [
|
|
780
956
|
{ var: "state" },
|
|
@@ -784,6 +960,7 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
784
960
|
holderId: { var: "event.holderId" },
|
|
785
961
|
holderType: { var: "event.holderType" },
|
|
786
962
|
name: { var: "event.holderName" },
|
|
963
|
+
walletAddress: { var: "event.holderWallet" },
|
|
787
964
|
address: { var: "event.address" },
|
|
788
965
|
acquisitionDate: { var: "event.reissueDate" },
|
|
789
966
|
acquisitionMethod: "PURCHASE",
|
|
@@ -794,24 +971,85 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
794
971
|
],
|
|
795
972
|
},
|
|
796
973
|
},
|
|
974
|
+
// clear the consumed proposal
|
|
975
|
+
pendingReissue: null,
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
_emit: [
|
|
979
|
+
{ name: "TREASURY_SHARES_REISSUED", data: { var: "event" }, destination: "external" },
|
|
980
|
+
],
|
|
981
|
+
},
|
|
982
|
+
],
|
|
983
|
+
},
|
|
984
|
+
dependencies: [],
|
|
985
|
+
},
|
|
986
|
+
// ISSUED -> ISSUED (propose_retire) — phase 1 (#24): bind the executing resolution fiber and record
|
|
987
|
+
// the pending retirement, so the retire transition can read the resolution's state next transition.
|
|
988
|
+
{
|
|
989
|
+
from: "ISSUED",
|
|
990
|
+
to: "ISSUED",
|
|
991
|
+
eventName: "propose_retire",
|
|
992
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
993
|
+
guard: (0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
994
|
+
effect: {
|
|
995
|
+
merge: [
|
|
996
|
+
{ var: "state" },
|
|
997
|
+
{
|
|
998
|
+
pendingRetire: {
|
|
999
|
+
retiredDate: { var: "event.retiredDate" },
|
|
1000
|
+
ref: { var: "event.boardResolutionRef" },
|
|
1001
|
+
proposedAt: { var: "$ordinal" },
|
|
1002
|
+
},
|
|
1003
|
+
},
|
|
1004
|
+
// bind the resolution fiber so retire can assert its state next transition
|
|
1005
|
+
(0, effects_js_1.addDependency)({ var: "event.boardResolutionRef" }),
|
|
1006
|
+
],
|
|
1007
|
+
},
|
|
1008
|
+
dependencies: [],
|
|
1009
|
+
},
|
|
1010
|
+
// TREASURY -> TREASURY (propose_retire) — phase 1 (#24): the treasury-side counterpart, binding the
|
|
1011
|
+
// executing resolution fiber and recording the pending retirement before retire executes.
|
|
1012
|
+
{
|
|
1013
|
+
from: "TREASURY",
|
|
1014
|
+
to: "TREASURY",
|
|
1015
|
+
eventName: "propose_retire",
|
|
1016
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
1017
|
+
guard: (0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
1018
|
+
effect: {
|
|
1019
|
+
merge: [
|
|
1020
|
+
{ var: "state" },
|
|
1021
|
+
{
|
|
1022
|
+
pendingRetire: {
|
|
1023
|
+
retiredDate: { var: "event.retiredDate" },
|
|
1024
|
+
ref: { var: "event.boardResolutionRef" },
|
|
1025
|
+
proposedAt: { var: "$ordinal" },
|
|
1026
|
+
},
|
|
797
1027
|
},
|
|
1028
|
+
// bind the resolution fiber so retire can assert its state next transition
|
|
1029
|
+
(0, effects_js_1.addDependency)({ var: "event.boardResolutionRef" }),
|
|
798
1030
|
],
|
|
799
1031
|
},
|
|
800
|
-
|
|
1032
|
+
dependencies: [],
|
|
801
1033
|
},
|
|
802
|
-
// ISSUED -> RETIRED
|
|
1034
|
+
// ISSUED -> RETIRED — phase 2 (#24): retire once the bound resolution is EXECUTED.
|
|
803
1035
|
{
|
|
804
1036
|
from: "ISSUED",
|
|
805
1037
|
to: "RETIRED",
|
|
806
1038
|
eventName: "retire",
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
1039
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
1040
|
+
guard: {
|
|
1041
|
+
and: [
|
|
1042
|
+
(0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
1043
|
+
// the proposal must match this retirement, and its bound resolution must be EXECUTED
|
|
1044
|
+
{
|
|
1045
|
+
"==": [
|
|
1046
|
+
{ var: "state.pendingRetire.retiredDate" },
|
|
1047
|
+
{ var: "event.retiredDate" },
|
|
1048
|
+
],
|
|
1049
|
+
},
|
|
1050
|
+
(0, guards_js_1.depInState)("state.pendingRetire.ref", "EXECUTED"),
|
|
1051
|
+
],
|
|
1052
|
+
},
|
|
815
1053
|
effect: {
|
|
816
1054
|
merge: [
|
|
817
1055
|
{ var: "state" },
|
|
@@ -821,27 +1059,40 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
821
1059
|
retiredDate: { var: "event.retiredDate" },
|
|
822
1060
|
retirementMethod: { var: "event.retirementMethod" },
|
|
823
1061
|
repurchasePrice: { var: "event.repurchasePrice" },
|
|
824
|
-
boardResolutionRef: { var: "
|
|
1062
|
+
boardResolutionRef: { var: "state.pendingRetire.ref" },
|
|
825
1063
|
},
|
|
826
1064
|
holder: null,
|
|
1065
|
+
// clear the consumed proposal
|
|
1066
|
+
pendingRetire: null,
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
_emit: [
|
|
1070
|
+
{ name: "SHARES_RETIRED", data: { var: "event" }, destination: "external" },
|
|
1071
|
+
],
|
|
827
1072
|
},
|
|
828
1073
|
],
|
|
829
1074
|
},
|
|
830
|
-
|
|
1075
|
+
dependencies: [],
|
|
831
1076
|
},
|
|
832
|
-
// TREASURY -> RETIRED
|
|
1077
|
+
// TREASURY -> RETIRED — phase 2 (#24): retire once the bound resolution is EXECUTED.
|
|
833
1078
|
{
|
|
834
1079
|
from: "TREASURY",
|
|
835
1080
|
to: "RETIRED",
|
|
836
1081
|
eventName: "retire",
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
1082
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
1083
|
+
guard: {
|
|
1084
|
+
and: [
|
|
1085
|
+
(0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
1086
|
+
// the proposal must match this retirement, and its bound resolution must be EXECUTED
|
|
1087
|
+
{
|
|
1088
|
+
"==": [
|
|
1089
|
+
{ var: "state.pendingRetire.retiredDate" },
|
|
1090
|
+
{ var: "event.retiredDate" },
|
|
1091
|
+
],
|
|
1092
|
+
},
|
|
1093
|
+
(0, guards_js_1.depInState)("state.pendingRetire.ref", "EXECUTED"),
|
|
1094
|
+
],
|
|
1095
|
+
},
|
|
845
1096
|
effect: {
|
|
846
1097
|
merge: [
|
|
847
1098
|
{ var: "state" },
|
|
@@ -851,26 +1102,34 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
851
1102
|
retiredDate: { var: "event.retiredDate" },
|
|
852
1103
|
retirementMethod: { var: "event.retirementMethod" },
|
|
853
1104
|
repurchasePrice: { var: "event.repurchasePrice" },
|
|
854
|
-
boardResolutionRef: { var: "
|
|
1105
|
+
boardResolutionRef: { var: "state.pendingRetire.ref" },
|
|
855
1106
|
},
|
|
856
1107
|
holder: null,
|
|
1108
|
+
// clear the consumed proposal
|
|
1109
|
+
pendingRetire: null,
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
_emit: [
|
|
1113
|
+
{ name: "SHARES_RETIRED", data: { var: "event" }, destination: "external" },
|
|
1114
|
+
],
|
|
857
1115
|
},
|
|
858
1116
|
],
|
|
859
1117
|
},
|
|
860
|
-
|
|
1118
|
+
dependencies: [],
|
|
861
1119
|
},
|
|
862
1120
|
// ISSUED -> ISSUED (stock_split)
|
|
863
1121
|
{
|
|
864
1122
|
from: "ISSUED",
|
|
865
1123
|
to: "ISSUED",
|
|
866
1124
|
eventName: "stock_split",
|
|
867
|
-
|
|
1125
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
1126
|
+
guard: (0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
868
1127
|
effect: {
|
|
869
1128
|
merge: [
|
|
870
1129
|
{ var: "state" },
|
|
871
1130
|
{
|
|
872
1131
|
corporateActions: {
|
|
873
|
-
|
|
1132
|
+
merge: [
|
|
874
1133
|
{ var: "state.corporateActions" },
|
|
875
1134
|
[
|
|
876
1135
|
{
|
|
@@ -887,23 +1146,58 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
887
1146
|
},
|
|
888
1147
|
shareCount: { var: "event.newShareCount" },
|
|
889
1148
|
},
|
|
1149
|
+
{
|
|
1150
|
+
_emit: [
|
|
1151
|
+
{ name: "STOCK_SPLIT_APPLIED", data: { var: "event" }, destination: "external" },
|
|
1152
|
+
],
|
|
1153
|
+
},
|
|
890
1154
|
],
|
|
891
1155
|
},
|
|
892
|
-
emits: ["STOCK_SPLIT_APPLIED"],
|
|
893
1156
|
},
|
|
894
|
-
// ISSUED -> ISSUED (
|
|
1157
|
+
// ISSUED -> ISSUED (propose_dividend) — phase 1 (#24): bind the executing resolution fiber and record
|
|
1158
|
+
// the pending declaration, so declare_dividend can read the resolution's state next transition.
|
|
1159
|
+
{
|
|
1160
|
+
from: "ISSUED",
|
|
1161
|
+
to: "ISSUED",
|
|
1162
|
+
eventName: "propose_dividend",
|
|
1163
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
1164
|
+
guard: (0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
1165
|
+
effect: {
|
|
1166
|
+
merge: [
|
|
1167
|
+
{ var: "state" },
|
|
1168
|
+
{
|
|
1169
|
+
pendingDividend: {
|
|
1170
|
+
actionId: { var: "event.actionId" },
|
|
1171
|
+
ref: { var: "event.resolutionRef" },
|
|
1172
|
+
proposedAt: { var: "$ordinal" },
|
|
1173
|
+
},
|
|
1174
|
+
},
|
|
1175
|
+
// bind the resolution fiber so declare_dividend can assert its state next transition
|
|
1176
|
+
(0, effects_js_1.addDependency)({ var: "event.resolutionRef" }),
|
|
1177
|
+
],
|
|
1178
|
+
},
|
|
1179
|
+
dependencies: [],
|
|
1180
|
+
},
|
|
1181
|
+
// ISSUED -> ISSUED (declare_dividend) — phase 2 (#24): stock dividend handling once the bound
|
|
1182
|
+
// resolution is EXECUTED.
|
|
895
1183
|
{
|
|
896
1184
|
from: "ISSUED",
|
|
897
1185
|
to: "ISSUED",
|
|
898
1186
|
eventName: "declare_dividend",
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
1187
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
1188
|
+
guard: {
|
|
1189
|
+
and: [
|
|
1190
|
+
(0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
1191
|
+
// the proposal must target this action, and its bound resolution must be EXECUTED
|
|
1192
|
+
{
|
|
1193
|
+
"==": [
|
|
1194
|
+
{ var: "state.pendingDividend.actionId" },
|
|
1195
|
+
{ var: "event.actionId" },
|
|
1196
|
+
],
|
|
1197
|
+
},
|
|
1198
|
+
(0, guards_js_1.depInState)("state.pendingDividend.ref", "EXECUTED"),
|
|
1199
|
+
],
|
|
1200
|
+
},
|
|
907
1201
|
effect: {
|
|
908
1202
|
if: [
|
|
909
1203
|
{ "==": [{ var: "event.dividendType" }, "STOCK"] },
|
|
@@ -912,7 +1206,7 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
912
1206
|
{ var: "state" },
|
|
913
1207
|
{
|
|
914
1208
|
corporateActions: {
|
|
915
|
-
|
|
1209
|
+
merge: [
|
|
916
1210
|
{ var: "state.corporateActions" },
|
|
917
1211
|
[
|
|
918
1212
|
{
|
|
@@ -926,7 +1220,7 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
926
1220
|
{ var: "event.stockShares" },
|
|
927
1221
|
],
|
|
928
1222
|
},
|
|
929
|
-
resolutionRef: { var: "
|
|
1223
|
+
resolutionRef: { var: "state.pendingDividend.ref" },
|
|
930
1224
|
},
|
|
931
1225
|
],
|
|
932
1226
|
],
|
|
@@ -937,19 +1231,29 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
937
1231
|
{ var: "event.stockShares" },
|
|
938
1232
|
],
|
|
939
1233
|
},
|
|
1234
|
+
// clear the consumed proposal
|
|
1235
|
+
pendingDividend: null,
|
|
940
1236
|
},
|
|
941
1237
|
],
|
|
942
1238
|
},
|
|
943
|
-
{
|
|
1239
|
+
{
|
|
1240
|
+
merge: [
|
|
1241
|
+
{ var: "state" },
|
|
1242
|
+
// cash dividend: no share change, but still clear the consumed proposal
|
|
1243
|
+
{ pendingDividend: null },
|
|
1244
|
+
],
|
|
1245
|
+
},
|
|
944
1246
|
],
|
|
945
1247
|
},
|
|
1248
|
+
dependencies: [],
|
|
946
1249
|
},
|
|
947
1250
|
// ISSUED -> ISSUED (remove_restriction)
|
|
948
1251
|
{
|
|
949
1252
|
from: "ISSUED",
|
|
950
1253
|
to: "ISSUED",
|
|
951
1254
|
eventName: "remove_restriction",
|
|
952
|
-
|
|
1255
|
+
// authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
|
|
1256
|
+
guard: (0, guards_js_1.signerIsParty)("state.issuerAddress"),
|
|
953
1257
|
effect: {
|
|
954
1258
|
merge: [
|
|
955
1259
|
{ var: "state" },
|
|
@@ -990,9 +1294,13 @@ exports.corpSecuritiesDef = (0, fiber_app_js_1.defineFiberApp)({
|
|
|
990
1294
|
],
|
|
991
1295
|
},
|
|
992
1296
|
},
|
|
1297
|
+
{
|
|
1298
|
+
_emit: [
|
|
1299
|
+
{ name: "RESTRICTION_REMOVED", data: { var: "event" }, destination: "external" },
|
|
1300
|
+
],
|
|
1301
|
+
},
|
|
993
1302
|
],
|
|
994
1303
|
},
|
|
995
|
-
emits: ["RESTRICTION_REMOVED"],
|
|
996
1304
|
},
|
|
997
1305
|
],
|
|
998
1306
|
});
|