@ixo/editor 5.9.1 → 5.10.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.
@@ -1,10 +1,2436 @@
1
1
  import * as _blocknote_core from '@blocknote/core';
2
2
  import { BlockSchemaFromSpecs, InlineContentSchema, StyleSchema, BlockNoteEditor, PartialBlock } from '@blocknote/core';
3
3
  import * as React from 'react';
4
+ import React__default from 'react';
4
5
  import { MatrixClient } from 'matrix-js-sdk';
5
6
  import { Map, Doc, Array as Array$1 } from 'yjs';
6
7
  import { Delegation } from '@ixo/ucan';
7
8
 
9
+ type ProposalActionType = 'Spend' | 'UpdateMembers' | 'Stake' | 'Join' | 'AuthzExec' | 'AuthzGrant' | 'AuthzRevoke' | 'BurnNft' | 'Mint' | 'Execute' | 'Instantiate' | 'ManageSubDaos' | 'ManageCw721' | 'ManageCw20' | 'Migrate' | 'TransferNft' | 'UpdateAdmin' | 'UpdatePreProposeConfig' | 'UpdateVotingConfig' | 'GovernanceVote' | 'WithdrawTokenSwap' | 'UpdateInfo' | 'Custom' | 'ManageStorageItems' | 'ValidatorActions' | 'PerformTokenSwap' | 'DaoAdminExec' | 'StakeToGroup' | 'SendGroupToken' | 'AcceptToMarketplace' | 'CreateEntity';
10
+ interface Member$1 {
11
+ addr: string;
12
+ weight: number;
13
+ }
14
+ interface BaseProposalAction {
15
+ type: ProposalActionType;
16
+ }
17
+ interface SpendData {
18
+ to: string;
19
+ denom: string;
20
+ amount: string;
21
+ }
22
+ interface ManageMembersData {
23
+ add: Member$1[];
24
+ remove: {
25
+ addr: string;
26
+ }[];
27
+ }
28
+ interface SpendAction extends BaseProposalAction {
29
+ type: 'Spend';
30
+ data: SpendData;
31
+ }
32
+ interface UpdateMembersAction extends BaseProposalAction {
33
+ type: 'UpdateMembers';
34
+ data: ManageMembersData;
35
+ }
36
+ declare const StakeType: {
37
+ readonly Delegate: "delegate";
38
+ readonly Undelegate: "undelegate";
39
+ readonly Redelegate: "redelegate";
40
+ readonly WithdrawDelegatorReward: "withdraw_delegator_reward";
41
+ };
42
+ type StakeType = (typeof StakeType)[keyof typeof StakeType];
43
+ interface StakeData {
44
+ stakeType: StakeType;
45
+ validator: string;
46
+ toValidator: string;
47
+ amount: string;
48
+ denom: string;
49
+ }
50
+ interface JoinData {
51
+ id: string;
52
+ coreAddress: string;
53
+ address: string;
54
+ }
55
+ interface StakeAction extends BaseProposalAction {
56
+ type: 'Stake';
57
+ data: StakeData;
58
+ }
59
+ interface JoinAction extends BaseProposalAction {
60
+ type: 'Join';
61
+ data: JoinData;
62
+ }
63
+ interface Coin$1 {
64
+ denom: string;
65
+ amount: string;
66
+ }
67
+ interface Binary {
68
+ [k: string]: unknown;
69
+ }
70
+ interface Empty {
71
+ [k: string]: unknown;
72
+ }
73
+ interface GenericToken {
74
+ [k: string]: unknown;
75
+ }
76
+ interface SubDao {
77
+ addr: string;
78
+ charter?: string | null;
79
+ [k: string]: unknown;
80
+ }
81
+ interface Counterparty {
82
+ address: string;
83
+ [k: string]: unknown;
84
+ }
85
+ type DepositRefundPolicy = string;
86
+ type VoteOption = number;
87
+ type TProposalActionModel = any;
88
+ interface MsgDelegate {
89
+ [k: string]: unknown;
90
+ }
91
+ interface MsgUndelegate {
92
+ [k: string]: unknown;
93
+ }
94
+ interface MsgBeginRedelegate {
95
+ [k: string]: unknown;
96
+ }
97
+ interface MsgWithdrawDelegatorReward {
98
+ [k: string]: unknown;
99
+ }
100
+ type BankMsg = {
101
+ send: {
102
+ amount: Coin$1[];
103
+ to_address: string;
104
+ };
105
+ } | {
106
+ burn: {
107
+ amount: Coin$1[];
108
+ };
109
+ };
110
+ type StakingMsg = {
111
+ delegate: {
112
+ amount: Coin$1;
113
+ validator: string;
114
+ };
115
+ } | {
116
+ undelegate: {
117
+ amount: Coin$1;
118
+ validator: string;
119
+ };
120
+ } | {
121
+ redelegate: {
122
+ amount: Coin$1;
123
+ dst_validator: string;
124
+ src_validator: string;
125
+ };
126
+ };
127
+ type DistributionMsg = {
128
+ set_withdraw_address: {
129
+ address: string;
130
+ };
131
+ } | {
132
+ withdraw_delegator_reward: {
133
+ validator: string;
134
+ };
135
+ };
136
+ interface IbcTimeout {
137
+ [k: string]: unknown;
138
+ }
139
+ type IbcMsg = {
140
+ transfer: {
141
+ amount: Coin$1;
142
+ channel_id: string;
143
+ timeout: IbcTimeout;
144
+ to_address: string;
145
+ };
146
+ } | {
147
+ send_packet: {
148
+ channel_id: string;
149
+ data: Binary;
150
+ timeout: IbcTimeout;
151
+ };
152
+ } | {
153
+ close_channel: {
154
+ channel_id: string;
155
+ };
156
+ };
157
+ type WasmMsg = {
158
+ execute: {
159
+ contract_addr: string;
160
+ funds: Coin$1[];
161
+ msg: Binary;
162
+ };
163
+ } | {
164
+ instantiate: {
165
+ admin?: string | null;
166
+ code_id: number;
167
+ funds: Coin$1[];
168
+ label: string;
169
+ msg: Binary;
170
+ };
171
+ } | {
172
+ migrate: {
173
+ contract_addr: string;
174
+ msg: Binary;
175
+ new_code_id: number;
176
+ };
177
+ } | {
178
+ update_admin: {
179
+ admin: string;
180
+ contract_addr: string;
181
+ };
182
+ } | {
183
+ clear_admin: {
184
+ contract_addr: string;
185
+ };
186
+ };
187
+ type GovMsg = {
188
+ vote: {
189
+ proposal_id: number;
190
+ vote: VoteOption;
191
+ };
192
+ };
193
+ type StargateMsg = {
194
+ stargate: {
195
+ type_url: string;
196
+ value: Binary;
197
+ };
198
+ };
199
+ type CosmosMsgFor_Empty = {
200
+ bank: BankMsg;
201
+ } | {
202
+ custom: Empty;
203
+ } | {
204
+ staking: StakingMsg;
205
+ } | {
206
+ distribution: DistributionMsg;
207
+ } | {
208
+ ibc: IbcMsg;
209
+ } | {
210
+ wasm: WasmMsg;
211
+ } | {
212
+ gov: GovMsg;
213
+ } | StargateMsg;
214
+ declare const AuthzExecActionTypes: {
215
+ readonly Delegate: "/cosmos.staking.v1beta1.MsgDelegate";
216
+ readonly Undelegate: "/cosmos.staking.v1beta1.MsgUndelegate";
217
+ readonly Redelegate: "/cosmos.staking.v1beta1.MsgBeginRedelegate";
218
+ readonly ClaimRewards: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
219
+ readonly Custom: "custom";
220
+ };
221
+ type AuthzExecActionType = (typeof AuthzExecActionTypes)[keyof typeof AuthzExecActionTypes];
222
+ interface AuthzExecData {
223
+ authzExecActionType: AuthzExecActionType;
224
+ delegate: MsgDelegate;
225
+ undelegate: MsgUndelegate;
226
+ redelegate: MsgBeginRedelegate;
227
+ claimRewards: MsgWithdrawDelegatorReward;
228
+ custom: string;
229
+ }
230
+ interface AuthzData {
231
+ custom?: boolean;
232
+ typeUrl: string;
233
+ value: {
234
+ grantee: string;
235
+ msgTypeUrl: string;
236
+ };
237
+ }
238
+ interface BurnNftData {
239
+ collection: string;
240
+ tokenId: string;
241
+ }
242
+ interface ExecuteData {
243
+ address: string;
244
+ message: string;
245
+ funds: Coin$1[];
246
+ }
247
+ interface InstantiateData {
248
+ admin: string;
249
+ codeId: number;
250
+ label: string;
251
+ message: string;
252
+ funds: Coin$1[];
253
+ }
254
+ interface ManageSubDaosData {
255
+ toAdd: SubDao[];
256
+ toRemove: {
257
+ address: string;
258
+ }[];
259
+ }
260
+ interface ManageCw721Data {
261
+ adding: boolean;
262
+ address: string;
263
+ }
264
+ interface ManageCw20Data {
265
+ adding: boolean;
266
+ address: string;
267
+ }
268
+ interface MigrateData {
269
+ contract: string;
270
+ codeId: number;
271
+ msg: string;
272
+ }
273
+ interface MintData {
274
+ to: string;
275
+ amount: number;
276
+ }
277
+ interface TransferNftData {
278
+ collection: string;
279
+ tokenId: string;
280
+ recipient: string;
281
+ executeSmartContract: boolean;
282
+ smartContractMsg: string;
283
+ }
284
+ interface UpdateAdminData {
285
+ contract: string;
286
+ newAdmin: string;
287
+ }
288
+ interface UpdatePreProposeConfigData {
289
+ depositRequired: boolean;
290
+ depositInfo: {
291
+ amount: string;
292
+ type: 'native' | 'cw20' | 'voting_module_token';
293
+ denomOrAddress: string;
294
+ token?: GenericToken;
295
+ refundPolicy: DepositRefundPolicy;
296
+ };
297
+ anyoneCanPropose: boolean;
298
+ }
299
+ interface UpdateProposalConfigData {
300
+ onlyMembersExecute: boolean;
301
+ thresholdType: '%' | 'majority';
302
+ thresholdPercentage?: number;
303
+ quorumEnabled: boolean;
304
+ quorumType: '%' | 'majority';
305
+ quorumPercentage?: number;
306
+ proposalDuration: number;
307
+ proposalDurationUnits: 'weeks' | 'days' | 'hours' | 'minutes' | 'seconds';
308
+ allowRevoting: boolean;
309
+ }
310
+ interface GovernanceVoteData {
311
+ proposalId: string;
312
+ vote: VoteOption;
313
+ }
314
+ interface WithdrawTokenSwapData {
315
+ contractChosen: boolean;
316
+ tokenSwapContractAddress?: string;
317
+ }
318
+ interface UpdateInfoData {
319
+ automatically_add_cw20s: boolean;
320
+ automatically_add_cw721s: boolean;
321
+ dao_uri?: string | null;
322
+ description: string;
323
+ image_url?: string | null;
324
+ name: string;
325
+ [k: string]: unknown;
326
+ }
327
+ interface CustomData {
328
+ message: string;
329
+ }
330
+ interface ManageStorageItemsData {
331
+ setting: boolean;
332
+ key: string;
333
+ value: string;
334
+ }
335
+ declare enum ValidatorActionType {
336
+ CreateValidator = "/cosmos.staking.v1beta1.MsgCreateValidator",
337
+ EditValidator = "/cosmos.staking.v1beta1.MsgEditValidator",
338
+ UnjailValidator = "/cosmos.slashing.v1beta1.MsgUnjail",
339
+ WithdrawValidatorCommission = "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"
340
+ }
341
+ interface ValidatorActionsData {
342
+ validatorActionType: ValidatorActionType;
343
+ createMsg: string;
344
+ editMsg: string;
345
+ }
346
+ interface PerformTokenSwapData {
347
+ contractChosen: boolean;
348
+ tokenSwapContractAddress?: string;
349
+ selfParty?: Omit<Counterparty, 'address'>;
350
+ counterparty?: Counterparty;
351
+ }
352
+ type DaoAdminExecData = {
353
+ coreAddress: string;
354
+ msgs: CosmosMsgFor_Empty[];
355
+ _actions?: TProposalActionModel[];
356
+ };
357
+ interface StakeToGroupData {
358
+ amount: string;
359
+ tokenContract: string;
360
+ stakingContract: string;
361
+ }
362
+ interface SendGroupTokenData {
363
+ amount: string;
364
+ contract: string;
365
+ toAddress: string;
366
+ }
367
+ interface AcceptToMarketplaceData {
368
+ did: string;
369
+ relayerNodeDid: string;
370
+ relayerNodeAddress: string;
371
+ }
372
+ interface AuthzExecAction extends BaseProposalAction {
373
+ type: 'AuthzExec';
374
+ data: AuthzExecData;
375
+ }
376
+ interface AuthzGrantAction extends BaseProposalAction {
377
+ type: 'AuthzGrant';
378
+ data: AuthzData;
379
+ }
380
+ interface AuthzRevokeAction extends BaseProposalAction {
381
+ type: 'AuthzRevoke';
382
+ data: AuthzData;
383
+ }
384
+ interface BurnNftAction extends BaseProposalAction {
385
+ type: 'BurnNft';
386
+ data: BurnNftData;
387
+ }
388
+ interface MintAction extends BaseProposalAction {
389
+ type: 'Mint';
390
+ data: MintData;
391
+ }
392
+ interface ExecuteAction extends BaseProposalAction {
393
+ type: 'Execute';
394
+ data: ExecuteData;
395
+ }
396
+ interface InstantiateAction extends BaseProposalAction {
397
+ type: 'Instantiate';
398
+ data: InstantiateData;
399
+ }
400
+ interface ManageSubDaosAction extends BaseProposalAction {
401
+ type: 'ManageSubDaos';
402
+ data: ManageSubDaosData;
403
+ }
404
+ interface ManageCw721Action extends BaseProposalAction {
405
+ type: 'ManageCw721';
406
+ data: ManageCw721Data;
407
+ }
408
+ interface ManageCw20Action extends BaseProposalAction {
409
+ type: 'ManageCw20';
410
+ data: ManageCw20Data;
411
+ }
412
+ interface MigrateAction extends BaseProposalAction {
413
+ type: 'Migrate';
414
+ data: MigrateData;
415
+ }
416
+ interface TransferNftAction extends BaseProposalAction {
417
+ type: 'TransferNft';
418
+ data: TransferNftData;
419
+ }
420
+ interface UpdateAdminAction extends BaseProposalAction {
421
+ type: 'UpdateAdmin';
422
+ data: UpdateAdminData;
423
+ }
424
+ interface UpdatePreProposeConfigAction extends BaseProposalAction {
425
+ type: 'UpdatePreProposeConfig';
426
+ data: UpdatePreProposeConfigData;
427
+ }
428
+ interface UpdateVotingConfigAction extends BaseProposalAction {
429
+ type: 'UpdateVotingConfig';
430
+ data: UpdateProposalConfigData;
431
+ }
432
+ interface GovernanceVoteAction extends BaseProposalAction {
433
+ type: 'GovernanceVote';
434
+ data: GovernanceVoteData;
435
+ }
436
+ interface WithdrawTokenSwapAction extends BaseProposalAction {
437
+ type: 'WithdrawTokenSwap';
438
+ data: WithdrawTokenSwapData;
439
+ }
440
+ interface UpdateInfoAction extends BaseProposalAction {
441
+ type: 'UpdateInfo';
442
+ data: UpdateInfoData;
443
+ }
444
+ interface CustomAction extends BaseProposalAction {
445
+ type: 'Custom';
446
+ data: CustomData;
447
+ }
448
+ interface ManageStorageItemsAction extends BaseProposalAction {
449
+ type: 'ManageStorageItems';
450
+ data: ManageStorageItemsData;
451
+ }
452
+ interface ValidatorActionsAction extends BaseProposalAction {
453
+ type: 'ValidatorActions';
454
+ data: ValidatorActionsData;
455
+ }
456
+ interface PerformTokenSwapAction extends BaseProposalAction {
457
+ type: 'PerformTokenSwap';
458
+ data: PerformTokenSwapData;
459
+ }
460
+ interface DaoAdminExecAction extends BaseProposalAction {
461
+ type: 'DaoAdminExec';
462
+ data: DaoAdminExecData;
463
+ }
464
+ interface StakeToGroupAction extends BaseProposalAction {
465
+ type: 'StakeToGroup';
466
+ data: StakeToGroupData;
467
+ }
468
+ interface SendGroupTokenAction extends BaseProposalAction {
469
+ type: 'SendGroupToken';
470
+ data: SendGroupTokenData;
471
+ }
472
+ interface AcceptToMarketplaceAction extends BaseProposalAction {
473
+ type: 'AcceptToMarketplace';
474
+ data: AcceptToMarketplaceData;
475
+ }
476
+ interface CreateEntityAction extends BaseProposalAction {
477
+ type: 'CreateEntity';
478
+ data: any;
479
+ }
480
+ type ProposalAction = SpendAction | UpdateMembersAction | StakeAction | JoinAction | AuthzExecAction | AuthzGrantAction | AuthzRevokeAction | BurnNftAction | MintAction | ExecuteAction | InstantiateAction | ManageSubDaosAction | ManageCw721Action | ManageCw20Action | MigrateAction | TransferNftAction | UpdateAdminAction | UpdatePreProposeConfigAction | UpdateVotingConfigAction | GovernanceVoteAction | WithdrawTokenSwapAction | UpdateInfoAction | CustomAction | ManageStorageItemsAction | ValidatorActionsAction | PerformTokenSwapAction | DaoAdminExecAction | StakeToGroupAction | SendGroupTokenAction | AcceptToMarketplaceAction | CreateEntityAction;
481
+ interface SharedProposalData {
482
+ [proposalId: string]: {
483
+ proposal: any;
484
+ lastFetched: number;
485
+ loading: boolean;
486
+ error?: Error;
487
+ };
488
+ }
489
+
490
+ type Addr = string;
491
+ type Uint128 = string;
492
+ type Timestamp = string;
493
+ interface Coin {
494
+ denom: string;
495
+ amount: string;
496
+ }
497
+ /**
498
+ * Cosmos SDK broadcast result. Returned by handlers that submit on-chain
499
+ * transactions (e.g. `evaluateClaim`). `code === 0` means success — non-zero
500
+ * codes are failures, but in practice handlers throw before returning so the
501
+ * editor only sees successful broadcasts here.
502
+ */
503
+ interface BroadcastTxResult {
504
+ code: number;
505
+ transactionHash: string;
506
+ rawLog?: string;
507
+ height?: number;
508
+ txIndex?: number;
509
+ gasWanted?: bigint;
510
+ gasUsed?: bigint;
511
+ }
512
+ type Expiration = {
513
+ at_height: number;
514
+ } | {
515
+ at_time: Timestamp;
516
+ } | {
517
+ never: {};
518
+ };
519
+ type Status = 'open' | 'rejected' | 'passed' | 'executed' | 'closed' | 'execution_failed' | 'veto_timelock';
520
+ interface Threshold {
521
+ absolute_count?: {
522
+ weight: Uint128;
523
+ };
524
+ absolute_percentage?: {
525
+ percentage: string;
526
+ };
527
+ threshold_quorum?: {
528
+ threshold: string;
529
+ quorum: string;
530
+ };
531
+ }
532
+ interface Votes {
533
+ yes: Uint128;
534
+ no: Uint128;
535
+ abstain: Uint128;
536
+ }
537
+ interface CosmosMsgForEmpty {
538
+ [key: string]: any;
539
+ }
540
+ interface SingleChoiceProposal {
541
+ allow_revoting: boolean;
542
+ description: string;
543
+ expiration: Expiration;
544
+ min_voting_period?: Expiration | null;
545
+ msgs: CosmosMsgForEmpty[];
546
+ proposer: Addr;
547
+ start_height: number;
548
+ status: Status;
549
+ threshold: Threshold;
550
+ title: string;
551
+ total_power: Uint128;
552
+ votes: Votes;
553
+ }
554
+ interface ProposalResponse {
555
+ id: number;
556
+ proposal: SingleChoiceProposal;
557
+ }
558
+ type Vote = 'yes' | 'no' | 'abstain' | 'no_with_veto';
559
+ interface VoteInfo {
560
+ power: Uint128;
561
+ rationale?: string | null;
562
+ vote: Vote;
563
+ voter: Addr;
564
+ }
565
+ interface VoteResponse {
566
+ vote?: VoteInfo | null;
567
+ }
568
+ interface User {
569
+ address: string;
570
+ }
571
+ type AwarenessDocActor = {
572
+ name: string;
573
+ did: string;
574
+ src: string | null;
575
+ };
576
+ type IUserMatrixProfile = {
577
+ walletAddress: string;
578
+ displayname: string;
579
+ avatarUrl: string | null;
580
+ did: string;
581
+ verified?: boolean;
582
+ };
583
+ interface LinkedResource {
584
+ id: string;
585
+ type: string;
586
+ proof: string;
587
+ right: string;
588
+ encrypted: string;
589
+ mediaType: string;
590
+ description: string;
591
+ serviceEndpoint: string;
592
+ }
593
+ interface Service {
594
+ id: string;
595
+ type: string;
596
+ serviceEndpoint: string;
597
+ }
598
+ interface GQLLinkedResource {
599
+ id: string;
600
+ type: string;
601
+ description: string;
602
+ mediaType: string;
603
+ serviceEndpoint: string;
604
+ proof: string;
605
+ encrypted: string;
606
+ right: string;
607
+ }
608
+ interface EntityNode {
609
+ id: string;
610
+ type: string;
611
+ startDate?: string;
612
+ endDate?: string;
613
+ status: number;
614
+ relayerNode: string;
615
+ credentials?: string[];
616
+ entityVerified: boolean;
617
+ metadata: any;
618
+ accounts: any;
619
+ externalId?: string;
620
+ owner?: string;
621
+ context: any;
622
+ controller: string[];
623
+ verificationMethod: any;
624
+ service: Service[];
625
+ authentication: string[];
626
+ assertionMethod: string[];
627
+ keyAgreement: string[];
628
+ capabilityInvocation: string[];
629
+ capabilityDelegation: string[];
630
+ linkedResource: LinkedResource[];
631
+ linkedClaim: any;
632
+ accordedRight: any;
633
+ linkedEntity: any;
634
+ alsoKnownAs: string;
635
+ settings: any;
636
+ profile?: {
637
+ name?: string;
638
+ [key: string]: any;
639
+ };
640
+ iidById: {
641
+ id: string;
642
+ linkedResource: GQLLinkedResource[];
643
+ };
644
+ }
645
+ interface EntityResponse {
646
+ id: string;
647
+ context: string;
648
+ relayerNode: string;
649
+ controller: string;
650
+ type: string;
651
+ startDate: string;
652
+ endDate: string;
653
+ metadata: string;
654
+ linkedResource: LinkedResource[];
655
+ settings: Record<string, LinkedResource>;
656
+ service: Service[];
657
+ externalId: string;
658
+ }
659
+ interface Asset {
660
+ did: string;
661
+ alsoKnownAs: string;
662
+ name: string;
663
+ icon: string;
664
+ issuer: string;
665
+ owned: boolean;
666
+ price: number;
667
+ available: boolean;
668
+ currency: string;
669
+ description?: string;
670
+ }
671
+ interface POD {
672
+ did: string;
673
+ name: string;
674
+ icon: string;
675
+ members: number;
676
+ isMember: boolean;
677
+ totalProposals: number;
678
+ startDate: string;
679
+ endDate: string;
680
+ description?: string;
681
+ }
682
+ interface Request {
683
+ did: string;
684
+ name: string;
685
+ icon: string;
686
+ budget: number;
687
+ isMember: boolean;
688
+ currency: string;
689
+ brand: string;
690
+ totalApplications: number;
691
+ description?: string;
692
+ }
693
+ interface Project {
694
+ did: string;
695
+ name: string;
696
+ icon: string;
697
+ description?: string;
698
+ }
699
+ interface Dao {
700
+ did: string;
701
+ name: string;
702
+ icon: string;
703
+ description?: string;
704
+ type?: 'dao' | 'pod' | 'group';
705
+ isOwner?: boolean;
706
+ isController?: boolean;
707
+ isMember?: boolean;
708
+ }
709
+ interface Balance {
710
+ denom: string;
711
+ tokenName: string;
712
+ chainCount: number;
713
+ tokenImage: string;
714
+ amount: number;
715
+ usdAmount: number;
716
+ isCoin: boolean;
717
+ isShare: boolean;
718
+ isCredit: boolean;
719
+ }
720
+ interface Oracle {
721
+ did: string;
722
+ name: string;
723
+ icon: string;
724
+ isActive: boolean;
725
+ isInvited: boolean;
726
+ minPoints: number;
727
+ maxPoints: number;
728
+ currency: string;
729
+ brand: string;
730
+ flowsAmount: number;
731
+ description?: string;
732
+ }
733
+ interface Proposal {
734
+ did: string;
735
+ name: string;
736
+ icon: string;
737
+ description: string;
738
+ isVotedOn: boolean;
739
+ vote: string | null;
740
+ status: string;
741
+ }
742
+ interface Member {
743
+ did: string;
744
+ username: string;
745
+ address: string;
746
+ icon: string;
747
+ percentage: string;
748
+ role: string;
749
+ description?: string;
750
+ }
751
+ interface Validator {
752
+ did: string;
753
+ name: string;
754
+ description: string;
755
+ icon: string;
756
+ amount: number;
757
+ currency: string;
758
+ commission: number;
759
+ isStaked: boolean;
760
+ isBonding: boolean;
761
+ isActive: boolean;
762
+ }
763
+ interface Investment {
764
+ did: string;
765
+ name: string;
766
+ icon: string;
767
+ brand: string;
768
+ isSubscribed: boolean;
769
+ isOpen: boolean;
770
+ currency: string;
771
+ currentAmount: number;
772
+ maxAmount: number;
773
+ status: string;
774
+ price: number;
775
+ description?: string;
776
+ }
777
+ interface Collection {
778
+ did: string;
779
+ name: string;
780
+ brand: string;
781
+ icon: string;
782
+ price: number;
783
+ currency: string;
784
+ totalAssets: number;
785
+ description?: string;
786
+ }
787
+ interface TransactionByHash {
788
+ code: number;
789
+ fee: {
790
+ payer: string;
791
+ amount: Array<{
792
+ denom: string;
793
+ amount: string;
794
+ }>;
795
+ granter: string;
796
+ gasLimit: {
797
+ low: number;
798
+ high: number;
799
+ unsigned: boolean;
800
+ };
801
+ };
802
+ hash: string;
803
+ height: number;
804
+ memo: string;
805
+ time: string;
806
+ }
807
+ interface Transaction {
808
+ id: number;
809
+ transactionHash: string;
810
+ typeUrl: string;
811
+ memo: string;
812
+ time: string;
813
+ from: string;
814
+ to: string | null;
815
+ denoms: string[];
816
+ tokenNames: string[];
817
+ value: Record<string, any>;
818
+ transactionByTransactionHash?: TransactionByHash;
819
+ description?: string;
820
+ }
821
+ interface DeedSubscription {
822
+ did: string;
823
+ subscriberAddress: string;
824
+ subscriberDid?: string;
825
+ subscriberName?: string;
826
+ subscriberImage?: string;
827
+ subscriptionDate: string;
828
+ status: 'active' | 'inactive' | 'pending';
829
+ metadata?: Record<string, any>;
830
+ actionSections?: SelectionActionSection[];
831
+ }
832
+ type IAssetsListItem = {
833
+ symbol: string;
834
+ description: string;
835
+ display: string;
836
+ entityId: string;
837
+ assetType: string;
838
+ coinMinimalDenom?: string;
839
+ base: string;
840
+ denomUnits: {
841
+ denom: string;
842
+ exponent: number;
843
+ aliases: string[];
844
+ }[];
845
+ logoURIs: {
846
+ png: string;
847
+ svg: string;
848
+ zlottie: string;
849
+ };
850
+ isStakeCurrency: string;
851
+ isFeeCurrency: string;
852
+ isBondToken: string;
853
+ coingeckoId?: string;
854
+ contractAddress?: string;
855
+ };
856
+ interface Bid {
857
+ id: string;
858
+ did: string;
859
+ collection: string;
860
+ type: 'bid';
861
+ address: string;
862
+ data: string;
863
+ role: string;
864
+ created: string;
865
+ }
866
+ interface SubmitBidParams {
867
+ collectionId: string;
868
+ role: EAAgentRoles;
869
+ surveyAnswers: any;
870
+ }
871
+ interface QueryBidsParams {
872
+ collectionId: string;
873
+ pagination?: {
874
+ nextPageToken?: string;
875
+ };
876
+ }
877
+ interface QueryBidsByDidParams {
878
+ collectionId: string;
879
+ did: string;
880
+ }
881
+ interface ApproveBidParams {
882
+ bidId: string;
883
+ collectionId: string;
884
+ did: string;
885
+ }
886
+ interface RejectBidParams {
887
+ bidId: string;
888
+ collectionId: string;
889
+ did: string;
890
+ reason: string;
891
+ }
892
+ interface BidResponse {
893
+ success: boolean;
894
+ bidId: string;
895
+ }
896
+ interface QueryBidsResponse {
897
+ data: Bid[];
898
+ nextPageToken?: string;
899
+ }
900
+ declare enum EAAgentRoles {
901
+ owners = "PO",
902
+ evaluators = "EA",
903
+ serviceProviders = "SA",
904
+ investors = "IA"
905
+ }
906
+ declare enum AgentRole {
907
+ Owner = "PO",// Collection Controller
908
+ Evaluator = "EA",// Evaluator
909
+ ServiceProvider = "SA",// Contributor
910
+ Investor = "IA"
911
+ }
912
+ type CheckUserRoleParams = {
913
+ /** Address to check role for */
914
+ userAddress: string;
915
+ /** Admin account address of the entity */
916
+ adminAddress: string;
917
+ /** Deed DID */
918
+ deedDid: string;
919
+ /** Claim collection IDs to check roles for */
920
+ collectionIds: string[];
921
+ };
922
+ type ClaimCollectionRole = {
923
+ collectionId: string;
924
+ role: AgentRole;
925
+ };
926
+ type ClaimCollection = {
927
+ id: string;
928
+ name: string;
929
+ description: string;
930
+ entity: string;
931
+ protocol: EntityNode | null;
932
+ admin: string;
933
+ };
934
+ type ClaimCollectionResponse = {
935
+ adminAddress: string;
936
+ collections: ClaimCollection[];
937
+ };
938
+ type Claim = {
939
+ claimId: string;
940
+ collectionId: string;
941
+ agentDid: string;
942
+ agentAddress: string;
943
+ submissionDate: string;
944
+ paymentsStatus: {
945
+ approval: string;
946
+ rejection: string;
947
+ evaluation: string;
948
+ submission: string;
949
+ };
950
+ schemaType: string | null;
951
+ approved?: boolean;
952
+ pending?: boolean;
953
+ rejected?: boolean;
954
+ disputed?: boolean;
955
+ };
956
+ interface GetClaimsPerCollectionIdParams {
957
+ collectionId: string;
958
+ }
959
+ interface GetClaimsPerUserAddressParams {
960
+ collectionId: string;
961
+ userAddress: string;
962
+ }
963
+ interface FAQItem {
964
+ question: string;
965
+ answer: string;
966
+ }
967
+ interface ContactInfo {
968
+ email: string;
969
+ location: string;
970
+ socialLinks: string[];
971
+ website: string;
972
+ }
973
+ interface Relationships {
974
+ funders?: string[];
975
+ memberOf?: string[];
976
+ partners?: string[];
977
+ }
978
+ interface LogoUrl {
979
+ alt: string;
980
+ url: string;
981
+ }
982
+ interface AdditionalProperties {
983
+ content_hashes?: Record<string, string>;
984
+ content_summaries?: Record<string, string>;
985
+ fetch_errors?: Array<{
986
+ error: string;
987
+ url: string;
988
+ }>;
989
+ last_fetch_date?: string;
990
+ }
991
+ interface Coordinates {
992
+ type: string;
993
+ coordinates: [number, number];
994
+ }
995
+ interface DomainCard {
996
+ additional_properties?: AdditionalProperties;
997
+ address?: string;
998
+ alternate_names?: string[];
999
+ area_served?: string;
1000
+ categories?: string[];
1001
+ contact?: ContactInfo;
1002
+ coordinates?: Coordinates;
1003
+ credential_type?: string[];
1004
+ description?: string;
1005
+ entity_type?: string[];
1006
+ faq?: FAQItem[];
1007
+ id: string;
1008
+ image_urls?: Array<Record<string, any>>;
1009
+ indexed_at?: string;
1010
+ issuer?: string;
1011
+ keywords?: string[];
1012
+ knows_about?: string[];
1013
+ location?: string;
1014
+ logo_url?: LogoUrl;
1015
+ name: string;
1016
+ overview?: string;
1017
+ relationships?: Relationships;
1018
+ same_as?: string[];
1019
+ schema_id?: string;
1020
+ summary?: string;
1021
+ updated_at?: string;
1022
+ url?: string;
1023
+ valid_from?: string;
1024
+ }
1025
+ interface AssetDetails extends Asset {
1026
+ type: string;
1027
+ image: string;
1028
+ actionSections: SelectionActionSection[];
1029
+ }
1030
+ interface CollectionDetails extends Collection {
1031
+ type: string;
1032
+ image: string;
1033
+ actionSections: SelectionActionSection[];
1034
+ }
1035
+ interface TransactionDetails extends Transaction {
1036
+ image: string;
1037
+ actionSections: SelectionActionSection[];
1038
+ }
1039
+ interface InvestmentDetails extends Investment {
1040
+ type: string;
1041
+ image: string;
1042
+ actionSections: SelectionActionSection[];
1043
+ }
1044
+ interface OracleDetails extends Oracle {
1045
+ type: string;
1046
+ image: string;
1047
+ actionSections: SelectionActionSection[];
1048
+ }
1049
+ interface PODDetails extends POD {
1050
+ type: string;
1051
+ image: string;
1052
+ actionSections: SelectionActionSection[];
1053
+ }
1054
+ interface ProposalDetails extends Proposal {
1055
+ type: string;
1056
+ image: string;
1057
+ actionSections: SelectionActionSection[];
1058
+ }
1059
+ interface RequestDetails extends Request {
1060
+ type: string;
1061
+ image: string;
1062
+ actionSections: SelectionActionSection[];
1063
+ }
1064
+ interface MemberDetails extends Member {
1065
+ type: string;
1066
+ image: string;
1067
+ actionSections: SelectionActionSection[];
1068
+ }
1069
+ interface ValidatorDetails extends Validator {
1070
+ type: string;
1071
+ image: string;
1072
+ actionSections: SelectionActionSection[];
1073
+ }
1074
+ interface LinkedResourceDetails extends LinkedResource {
1075
+ image: string;
1076
+ actionSections: SelectionActionSection[];
1077
+ }
1078
+ interface ProjectDetails extends Project {
1079
+ type: string;
1080
+ image: string;
1081
+ actionSections: SelectionActionSection[];
1082
+ }
1083
+ interface DaoDetails extends Dao {
1084
+ image: string;
1085
+ actionSections: SelectionActionSection[];
1086
+ }
1087
+ interface BalanceDetails extends Balance {
1088
+ image: string;
1089
+ actionSections: SelectionActionSection[];
1090
+ }
1091
+ interface DeedSubscriptionDetails extends DeedSubscription {
1092
+ image: string;
1093
+ actionSections: SelectionActionSection[];
1094
+ }
1095
+ interface ClaimDetails extends Claim {
1096
+ image: string;
1097
+ actionSections: SelectionActionSection[];
1098
+ }
1099
+ interface DAOGroup {
1100
+ id: string;
1101
+ name: string;
1102
+ coreAddress: string;
1103
+ }
1104
+ interface BlockRequirements {
1105
+ proposal?: {
1106
+ coreAddress: string;
1107
+ };
1108
+ }
1109
+ interface UnlMapConfig {
1110
+ apiKey: string;
1111
+ vpmId: string;
1112
+ }
1113
+ /**
1114
+ * UDID outcome values matching EvaluationStatus enum
1115
+ * PENDING = 0, APPROVED = 1, REJECTED = 2, DISPUTED = 3, INVALIDATED = 4, UNRECOGNIZED = -1
1116
+ */
1117
+ type UdidOutcome = 0 | 1 | 2 | 3 | 4 | -1;
1118
+ /**
1119
+ * Granular step result item for UDID
1120
+ */
1121
+ interface UdidResultItem {
1122
+ /** Unique identifier for this result item */
1123
+ id: string;
1124
+ /** Type of check/step */
1125
+ kind: 'compute' | 'fetch' | 'check' | 'validate';
1126
+ /** Whether this step passed */
1127
+ success: boolean;
1128
+ /** Score or value (optional) */
1129
+ score?: number;
1130
+ /** Output data from this step */
1131
+ outputs?: Record<string, any>;
1132
+ /** Human-readable message */
1133
+ message?: string;
1134
+ /** Error message if failed */
1135
+ error?: string;
1136
+ }
1137
+ /**
1138
+ * Signed UDID structure
1139
+ */
1140
+ interface SignedUdid {
1141
+ /** Unique identifier for this UDID */
1142
+ id: string;
1143
+ /** The unsigned UDID payload */
1144
+ payload: {
1145
+ /** Subject of the evaluation (claim CID) */
1146
+ sub: string;
1147
+ /** Issuer DID (evaluator) */
1148
+ iss: string;
1149
+ /** Audience/context (deed DID) */
1150
+ aud: string;
1151
+ /** Issued at timestamp */
1152
+ iat: number;
1153
+ /** Expiration timestamp (optional) */
1154
+ exp?: number;
1155
+ /** Action/capability context */
1156
+ act: {
1157
+ capabilityCid: string;
1158
+ capabilitySchema: string;
1159
+ rubricAuthority: string;
1160
+ rubricId: string;
1161
+ environment: string;
1162
+ evaluatorVersion?: string;
1163
+ };
1164
+ /** Result data */
1165
+ res: {
1166
+ outcome: number;
1167
+ tag: string;
1168
+ patch?: Record<string, any>;
1169
+ traceCid?: string;
1170
+ traceHash?: string;
1171
+ items?: UdidResultItem[];
1172
+ resultSchema?: string;
1173
+ };
1174
+ /** Metadata */
1175
+ meta: {
1176
+ collectionId: string;
1177
+ timestamp: string;
1178
+ };
1179
+ };
1180
+ /** Signature of the payload */
1181
+ signature: string;
1182
+ /** Verification method used for signing */
1183
+ verificationMethod: string;
1184
+ }
1185
+ /**
1186
+ * Parameters for creating a UDID
1187
+ */
1188
+ interface CreateUdidParams {
1189
+ /** CID of the claim being evaluated */
1190
+ claimCid: string;
1191
+ /** DID of the Deed/Context where this result applies */
1192
+ deedDid: string;
1193
+ /** Collection ID for the claim */
1194
+ collectionId: string;
1195
+ /** CID of the UCAN/capability that authorized this evaluation */
1196
+ capabilityCid: string;
1197
+ /** Schema of the capability (default: "ixo-protocol-v1") */
1198
+ capabilitySchema?: string;
1199
+ /** DID of the rubric authority (usually the Deed DID) */
1200
+ rubricAuthority: string;
1201
+ /** Version/ID of the rubric used */
1202
+ rubricId: string;
1203
+ /** Environment (default: "production") */
1204
+ environment?: 'production' | 'simulation' | 'testnet';
1205
+ /** Version of the evaluator (optional) */
1206
+ evaluatorVersion?: string;
1207
+ /** Outcome of the evaluation matching EvaluationStatus enum (0=PENDING, 1=APPROVED, 2=REJECTED, 3=DISPUTED, 4=INVALIDATED, -1=UNRECOGNIZED) */
1208
+ outcome: UdidOutcome | number;
1209
+ /** Human-readable tag for the outcome */
1210
+ tag: string;
1211
+ /** State patch to apply to Digital Twin (optional) */
1212
+ patch?: Record<string, any>;
1213
+ /** CID of the trace/reasoning logs (optional) */
1214
+ traceCid?: string;
1215
+ /** Hash of the trace for integrity (optional) */
1216
+ traceHash?: string;
1217
+ /** Granular step results (optional) */
1218
+ items?: UdidResultItem[];
1219
+ /** Schema for result validation (optional) */
1220
+ resultSchema?: string;
1221
+ /** Type of issuer: entity or user */
1222
+ issuerType: 'entity' | 'user';
1223
+ /** Entity room ID (required if issuerType is "entity") */
1224
+ entityRoomId?: string;
1225
+ /** PIN for decrypting signing key */
1226
+ pin: string;
1227
+ /** Expiration time in seconds from now (optional) */
1228
+ expiresInSeconds?: number;
1229
+ }
1230
+ /**
1231
+ * Response from creating a UDID
1232
+ */
1233
+ interface CreateUdidResponse {
1234
+ /** Whether the UDID was created successfully */
1235
+ success: boolean;
1236
+ /** The signed UDID */
1237
+ udid: SignedUdid;
1238
+ /** CID of the stored UDID in public storage (IPFS/Matrix) */
1239
+ cid: string;
1240
+ /** URL to fetch the UDID from public storage */
1241
+ url: string;
1242
+ /** Transaction hash if submitted on-chain */
1243
+ transactionHash?: string;
1244
+ }
1245
+ interface VoteParams {
1246
+ proposalId: number;
1247
+ rationale?: string;
1248
+ vote: Vote;
1249
+ proposalContractAddress: string;
1250
+ }
1251
+ interface CreateProposalParams {
1252
+ preProposalContractAddress: string;
1253
+ title: string;
1254
+ description: string;
1255
+ actions?: ProposalAction[];
1256
+ coreAddress?: string;
1257
+ groupContractAddress?: string;
1258
+ }
1259
+ interface EmailNotificationParams {
1260
+ channel: 'email';
1261
+ to: string[];
1262
+ cc?: string[];
1263
+ bcc?: string[];
1264
+ subject: string;
1265
+ body: string;
1266
+ bodyType?: 'text' | 'html';
1267
+ from?: string;
1268
+ replyTo?: string;
1269
+ }
1270
+ interface SmsNotificationParams {
1271
+ channel: 'sms';
1272
+ to: string[];
1273
+ body: string;
1274
+ }
1275
+ interface WhatsAppNotificationParams {
1276
+ channel: 'whatsapp';
1277
+ to: string[];
1278
+ body: string;
1279
+ templateId?: string;
1280
+ templateVariables?: Record<string, string>;
1281
+ }
1282
+ type NotificationParams = EmailNotificationParams | SmsNotificationParams | WhatsAppNotificationParams;
1283
+ interface NotificationResponse {
1284
+ messageId: string;
1285
+ status: 'accepted' | 'rejected';
1286
+ timestamp: string;
1287
+ }
1288
+ interface WorkspacePage {
1289
+ id: string;
1290
+ type: string;
1291
+ description: string;
1292
+ serviceEndpoint: string;
1293
+ mediaType: string;
1294
+ }
1295
+ /**
1296
+ * Toolkit keys recognised by the integrations layer. Kept as a string literal
1297
+ * union so typos surface at compile time; extend as we add more toolkits.
1298
+ */
1299
+ type IntegrationToolkit = 'googlecalendar' | 'xero';
1300
+ /**
1301
+ * Normalised connection status returned by the host app. Mirrors Composio's
1302
+ * underlying states but the editor never sees or names Composio directly.
1303
+ */
1304
+ type IntegrationConnectionStatus = 'INITIALIZING' | 'ACTIVE' | 'FAILED' | 'EXPIRED';
1305
+ /**
1306
+ * Structured error code for action-level UI decisions. Keep this small and
1307
+ * stable — actions branch on it (see gotchas §7).
1308
+ */
1309
+ type IntegrationErrorCode = 'OK' | 'VALIDATION' | 'AUTH_EXPIRED' | 'UPSTREAM_4XX' | 'UPSTREAM_5XX' | 'RATE_LIMIT' | 'UNKNOWN';
1310
+ interface IntegrationConnectionSummary {
1311
+ connectedAccountId: string;
1312
+ status: IntegrationConnectionStatus;
1313
+ /** Human-readable label fetched server-side (e.g. Google email, Xero org name). */
1314
+ label?: string;
1315
+ createdAt: string;
1316
+ }
1317
+ interface IntegrationExecuteResult {
1318
+ successful: boolean;
1319
+ data?: Record<string, unknown>;
1320
+ error?: string;
1321
+ code?: IntegrationErrorCode;
1322
+ }
1323
+ interface IntegrationsHandlers {
1324
+ /** Kick off OAuth — host returns the redirect URL to open in a popup and a pending ca_* id. */
1325
+ startConnection: (args: {
1326
+ toolkit: IntegrationToolkit;
1327
+ }) => Promise<{
1328
+ redirectUrl: string;
1329
+ connectedAccountId: string;
1330
+ }>;
1331
+ /** Poll the status of a single connection (typically during the OAuth popup dance). */
1332
+ getConnectionStatus: (args: {
1333
+ connectedAccountId: string;
1334
+ }) => Promise<{
1335
+ status: IntegrationConnectionStatus;
1336
+ error?: string;
1337
+ }>;
1338
+ /** List all connections the current entity has for a given toolkit. */
1339
+ listConnections: (args: {
1340
+ toolkit: IntegrationToolkit;
1341
+ }) => Promise<IntegrationConnectionSummary[]>;
1342
+ /** Revoke a connection (server-side). Idempotent. */
1343
+ disconnect: (args: {
1344
+ connectedAccountId: string;
1345
+ }) => Promise<void>;
1346
+ /** Single entry point for every tool execution. `toolSlug` is the underlying platform's slug. */
1347
+ executeTool: (args: {
1348
+ toolSlug: string;
1349
+ connectedAccountId: string;
1350
+ arguments: Record<string, unknown>;
1351
+ }) => Promise<IntegrationExecuteResult>;
1352
+ /** Optional read-tool call used by diff resolvers to populate "before" state on update actions. */
1353
+ fetchCurrentState?: (args: {
1354
+ toolSlug: string;
1355
+ connectedAccountId: string;
1356
+ arguments: Record<string, unknown>;
1357
+ }) => Promise<Record<string, unknown>>;
1358
+ }
1359
+ interface BlocknoteHandlers {
1360
+ getVote: (proposalContractAddress: string, proposalId: string, userAddress: string) => Promise<VoteResponse>;
1361
+ getProposal: (proposalContractAddress: string, proposalId: string) => Promise<ProposalResponse>;
1362
+ getCurrentUser: () => User;
1363
+ getRoomMembers: (roomId: string, mx: MatrixClient) => Promise<AwarenessDocActor[]>;
1364
+ getMatrixInfoPerDid: (did: string) => Promise<IUserMatrixProfile>;
1365
+ getDaoGroupsIds: () => Promise<string[] | undefined>;
1366
+ getDAOGroups: () => Promise<DAOGroup[]>;
1367
+ getRelayerDid: () => string | undefined;
1368
+ getEntityDid: () => string | undefined;
1369
+ getAdminAccountAddress: (deedDid: string) => Promise<string>;
1370
+ getOnlyClaimCollections: (deedDid: string) => Promise<ClaimCollection[]>;
1371
+ vote: ({ proposalId, rationale, vote, proposalContractAddress }: VoteParams) => Promise<void>;
1372
+ createProposal: (params: CreateProposalParams) => Promise<string>;
1373
+ getEntity: (did: string) => Promise<EntityResponse>;
1374
+ getDomainCard: () => Promise<DomainCard>;
1375
+ askCompanion: (prompt: string) => Promise<void>;
1376
+ getCryptoAssets: () => Promise<IAssetsListItem[]>;
1377
+ getAssets: (collectionDid: string, page: number, ownerAddress?: string) => Promise<{
1378
+ data: Asset[];
1379
+ totalCount: number;
1380
+ }>;
1381
+ getDeedSubscriptions: (relayerDid: string, page: number) => Promise<{
1382
+ data: DeedSubscription[];
1383
+ totalCount: number;
1384
+ }>;
1385
+ getCollections: (relayerDid: string, page: number) => Promise<{
1386
+ data: Collection[];
1387
+ totalCount: number;
1388
+ }>;
1389
+ getTransactions: (address: string, page: number) => Promise<{
1390
+ data: Transaction[];
1391
+ totalCount: number;
1392
+ }>;
1393
+ getInvestments: (relayerDid: string, page: number) => Promise<{
1394
+ data: Investment[];
1395
+ totalCount: number;
1396
+ }>;
1397
+ getOracles: (relayerDid: string, page: number) => Promise<{
1398
+ data: Oracle[];
1399
+ totalCount: number;
1400
+ }>;
1401
+ getPODs: (relayerDid: string, page: number, role?: string) => Promise<{
1402
+ data: POD[];
1403
+ totalCount: number;
1404
+ }>;
1405
+ getProposals: (relayerDid: string, page: number) => Promise<{
1406
+ data: Proposal[];
1407
+ totalCount: number;
1408
+ }>;
1409
+ getRequests: (relayerDid: string, page: number) => Promise<{
1410
+ data: Request[];
1411
+ totalCount: number;
1412
+ }>;
1413
+ getDaos: (relayerDid: string, page: number, role?: string) => Promise<{
1414
+ data: Dao[];
1415
+ totalCount: number;
1416
+ }>;
1417
+ getDaoGroups?: (relayerDid: string, page: number, role?: string) => Promise<{
1418
+ data: Dao[];
1419
+ totalCount: number;
1420
+ }>;
1421
+ getProjects: (relayerDid: string, page: number) => Promise<{
1422
+ data: Project[];
1423
+ totalCount: number;
1424
+ }>;
1425
+ getMembers: (address: string, groupCoreAddress: string, withBalance: boolean, page: number) => Promise<{
1426
+ data: Member[];
1427
+ totalCount: number;
1428
+ }>;
1429
+ getDaoMembers: (address: string, groupIds: string[], withBalance: boolean, page: number) => Promise<{
1430
+ data: Member[];
1431
+ totalCount: number;
1432
+ }>;
1433
+ getValidators: (relayerDid: string, page: number) => Promise<{
1434
+ data: Validator[];
1435
+ totalCount: number;
1436
+ }>;
1437
+ executeProposal: (params: {
1438
+ proposalId: number;
1439
+ proposalContractAddress: string;
1440
+ }) => Promise<void>;
1441
+ getProposalContractAddress: (params: {
1442
+ coreAddress: string;
1443
+ }) => Promise<{
1444
+ proposalContractAddress: string;
1445
+ }>;
1446
+ getPreProposalContractAddress: (params: {
1447
+ coreAddress: string;
1448
+ }) => Promise<{
1449
+ preProposalContractAddress: string;
1450
+ }>;
1451
+ getGroupContractAddress: (params: {
1452
+ coreAddress: string;
1453
+ }) => Promise<{
1454
+ groupContractAddress: string;
1455
+ }>;
1456
+ getBalances: (address: string) => Promise<{
1457
+ data: Balance[];
1458
+ }>;
1459
+ sendNotification: (params: NotificationParams) => Promise<NotificationResponse>;
1460
+ getAssetDetails?: (id: string) => Promise<AssetDetails>;
1461
+ getCollectionDetails?: (id: string) => Promise<CollectionDetails>;
1462
+ getTransactionDetails?: (id: string) => Promise<TransactionDetails>;
1463
+ getInvestmentDetails?: (id: string) => Promise<InvestmentDetails>;
1464
+ getOracleDetails?: (id: string) => Promise<OracleDetails>;
1465
+ getPODDetails?: (id: string) => Promise<PODDetails>;
1466
+ getProposalDetails?: (id: string) => Promise<ProposalDetails>;
1467
+ getRequestDetails?: (id: string) => Promise<RequestDetails>;
1468
+ getMemberDetails?: (id: string) => Promise<MemberDetails>;
1469
+ getValidatorDetails?: (id: string) => Promise<ValidatorDetails>;
1470
+ getLinkedResourceDetails?: (id: string) => Promise<LinkedResourceDetails>;
1471
+ getDaoMemberDetails?: (id: string) => Promise<MemberDetails>;
1472
+ getProjectDetails?: (id: string) => Promise<ProjectDetails>;
1473
+ getDaoDetails?: (id: string) => Promise<DaoDetails>;
1474
+ getBalanceDetails?: (id: string) => Promise<BalanceDetails>;
1475
+ getDeedSubscriptionDetails?: (id: string) => Promise<DeedSubscriptionDetails>;
1476
+ getClaimDetails?: (id: string) => Promise<ClaimDetails>;
1477
+ getDeedSurveyTemplate: (deedDid: string, claimCollectionId?: string) => Promise<{
1478
+ surveyTemplate: any;
1479
+ claimCollectionId: string;
1480
+ } | null>;
1481
+ submitClaim: (params: {
1482
+ surveyData: any;
1483
+ deedDid: string;
1484
+ collectionId: string;
1485
+ adminAddress: string;
1486
+ pin: string;
1487
+ }) => Promise<{
1488
+ transactionHash: string;
1489
+ claimId: string;
1490
+ }>;
1491
+ requestPin: (config?: {
1492
+ title?: string;
1493
+ description?: string;
1494
+ submitText?: string;
1495
+ }) => Promise<string>;
1496
+ getClaimCollections: (deedDid: string) => Promise<ClaimCollectionResponse>;
1497
+ getClaimsPerCollectionId: (params: GetClaimsPerCollectionIdParams) => Promise<Claim[]>;
1498
+ getClaimsPerUserAddress: (params: GetClaimsPerUserAddressParams) => Promise<Claim[]>;
1499
+ getClaimData: (collectionId: string, claimId: string) => Promise<any>;
1500
+ getClaimDisputeDetails?: (claimId: string) => Promise<{
1501
+ reason?: string;
1502
+ disputeType?: number;
1503
+ evaluatorDid?: string;
1504
+ disputedAt?: string;
1505
+ uri?: string;
1506
+ proof?: string;
1507
+ } | null>;
1508
+ /** Fetch the outcome data captured at evaluation time (patch from the
1509
+ * UDID referenced by `verificationProof`) along with the on-chain
1510
+ * evaluation record. Used to repopulate the outcome template and surface
1511
+ * the actual transferred amount for already-evaluated claims. */
1512
+ getClaimEvaluationDetails?: (claimId: string) => Promise<{
1513
+ patch?: Record<string, any>;
1514
+ evaluatorDid?: string;
1515
+ evaluatedAt?: string;
1516
+ /** Authoritative on-chain transfer amount(s) from the MsgEvaluateClaim tx. */
1517
+ amount?: Coin[];
1518
+ /** Optional reason recorded with the evaluation (typically for reject). */
1519
+ reason?: string;
1520
+ } | null>;
1521
+ fetchClaimMedia?: (url: string) => Promise<Blob>;
1522
+ evaluateClaim: (granteeAddress: string, did: string, payload: {
1523
+ claimId: string;
1524
+ collectionId: string;
1525
+ adminAddress: string;
1526
+ status?: number;
1527
+ verificationProof: string;
1528
+ amount?: Coin;
1529
+ }) => Promise<BroadcastTxResult>;
1530
+ disputeClaim?: (granteeAddress: string, did: string, payload: {
1531
+ subjectId: string;
1532
+ disputeType: number;
1533
+ reason: string;
1534
+ }) => Promise<any>;
1535
+ submitBid: (params: SubmitBidParams) => Promise<BidResponse>;
1536
+ queryBids: (params: QueryBidsParams) => Promise<QueryBidsResponse>;
1537
+ queryBidsByDid: (params: QueryBidsByDidParams) => Promise<{
1538
+ data: Bid[];
1539
+ }>;
1540
+ approveBid: (params: ApproveBidParams) => Promise<BidResponse>;
1541
+ rejectBid: (params: RejectBidParams) => Promise<BidResponse>;
1542
+ getUserRoles: (params: CheckUserRoleParams) => Promise<ClaimCollectionRole[]>;
1543
+ getBidContributorSurveyTemplate: (deedId: string, claimCollectionId?: string) => Promise<{
1544
+ surveyTemplate: any;
1545
+ } | null>;
1546
+ getBidEvaluatorSurveyTemplate: (deedId: string, claimCollectionId?: string) => Promise<{
1547
+ surveyTemplate: any;
1548
+ } | null>;
1549
+ approveServiceAgentApplication: (params: {
1550
+ adminAddress: string;
1551
+ collectionId: string;
1552
+ agentQuota: number;
1553
+ deedDid: string;
1554
+ currentUserAddress: string;
1555
+ }) => Promise<void>;
1556
+ approveEvaluatorApplication: (params: {
1557
+ adminAddress: string;
1558
+ collectionId: string;
1559
+ deedDid: string;
1560
+ evaluatorAddress: string;
1561
+ agentQuota?: number;
1562
+ claimIds?: string[];
1563
+ maxAmounts?: Coin[];
1564
+ }) => Promise<void>;
1565
+ publicFileUpload: (file: File) => Promise<{
1566
+ encrypted: string;
1567
+ cid: string;
1568
+ proof: string;
1569
+ serviceEndpoint: string;
1570
+ url: string;
1571
+ mxc: string;
1572
+ }>;
1573
+ /**
1574
+ * Check if entity has signing key set up
1575
+ */
1576
+ checkEntitySigningSetup?: (entityDid: string) => Promise<{
1577
+ hasSigningKey: boolean;
1578
+ keyId?: string;
1579
+ }>;
1580
+ /**
1581
+ * Set up entity signing (generates mnemonic, adds verification method)
1582
+ * Requires wallet signature
1583
+ */
1584
+ setupEntitySigning?: (params: {
1585
+ entityDid: string;
1586
+ entityRoomId: string;
1587
+ pin: string;
1588
+ }) => Promise<{
1589
+ transactionHash: string;
1590
+ keyId: string;
1591
+ }>;
1592
+ /**
1593
+ * Check if current user has signing key set up
1594
+ */
1595
+ checkUserSigningSetup?: () => Promise<{
1596
+ hasSigningKey: boolean;
1597
+ keyId?: string;
1598
+ }>;
1599
+ /**
1600
+ * Sign a capability delegation
1601
+ * @deprecated Use createDelegation instead for @ixo/ucan CAR format
1602
+ */
1603
+ signCapability?: (params: {
1604
+ /** DID of issuer (entity or user) */
1605
+ issuerDid: string;
1606
+ /** Whether signing as entity or user */
1607
+ issuerType: 'entity' | 'user';
1608
+ /** Entity room ID (required if issuerType is 'entity') */
1609
+ entityRoomId?: string;
1610
+ /** DID of recipient */
1611
+ audience: string;
1612
+ /** Capabilities to grant */
1613
+ capabilities: Array<{
1614
+ can: string;
1615
+ with: string;
1616
+ nb?: Record<string, any>;
1617
+ }>;
1618
+ /** IDs of parent capabilities (proofs) */
1619
+ proofs?: string[];
1620
+ /** Expiration timestamp */
1621
+ expiration?: number;
1622
+ /** PIN to decrypt signing mnemonic */
1623
+ pin: string;
1624
+ }) => Promise<{
1625
+ id: string;
1626
+ raw: string;
1627
+ signature: string;
1628
+ }>;
1629
+ /**
1630
+ * Verify a capability signature against issuer's DID document
1631
+ * @deprecated Use validateInvocation instead
1632
+ */
1633
+ verifyCapabilitySignature?: (params: {
1634
+ /** Raw capability JSON */
1635
+ capabilityRaw: string;
1636
+ /** Expected issuer DID */
1637
+ issuerDid: string;
1638
+ }) => Promise<{
1639
+ valid: boolean;
1640
+ error?: string;
1641
+ }>;
1642
+ /**
1643
+ * Create a delegation using @ixo/ucan (CAR format)
1644
+ */
1645
+ createDelegation?: (params: {
1646
+ /** DID of issuer */
1647
+ issuerDid: string;
1648
+ /** Whether signing as entity or user */
1649
+ issuerType: 'entity' | 'user';
1650
+ /** Entity room ID (required if issuerType is 'entity') */
1651
+ entityRoomId?: string;
1652
+ /** DID of recipient */
1653
+ audience: string;
1654
+ /** Capabilities to grant */
1655
+ capabilities: Array<{
1656
+ can: string;
1657
+ with: string;
1658
+ nb?: Record<string, unknown>;
1659
+ }>;
1660
+ /** CIDs of proof delegations */
1661
+ proofs?: string[];
1662
+ /** Expiration timestamp (milliseconds) */
1663
+ expiration?: number;
1664
+ /** PIN to decrypt signing mnemonic */
1665
+ pin: string;
1666
+ }) => Promise<{
1667
+ /** Content ID of the delegation */
1668
+ cid: string;
1669
+ /** Base64-encoded CAR bytes */
1670
+ delegation: string;
1671
+ }>;
1672
+ /**
1673
+ * Create an invocation using @ixo/ucan (CAR format)
1674
+ */
1675
+ createInvocation?: (params: {
1676
+ /** DID of invoker */
1677
+ invokerDid: string;
1678
+ /** Whether signing as entity or user */
1679
+ invokerType: 'entity' | 'user';
1680
+ /** Entity room ID (required if invokerType is 'entity') */
1681
+ entityRoomId?: string;
1682
+ /** Capability to invoke */
1683
+ capability: {
1684
+ can: string;
1685
+ with: string;
1686
+ nb?: Record<string, unknown>;
1687
+ };
1688
+ /** CIDs of proof delegations */
1689
+ proofs: string[];
1690
+ /** Additional facts/context */
1691
+ facts?: Record<string, unknown>;
1692
+ /** PIN to decrypt signing mnemonic */
1693
+ pin: string;
1694
+ }) => Promise<{
1695
+ /** Content ID of the invocation */
1696
+ cid: string;
1697
+ /** Base64-encoded CAR bytes */
1698
+ invocation: string;
1699
+ }>;
1700
+ /**
1701
+ * Validate an invocation against its proof chain
1702
+ */
1703
+ validateInvocation?: (params: {
1704
+ /** Base64-encoded CAR invocation */
1705
+ invocation: string;
1706
+ /** Base64-encoded CAR delegations (proofs) */
1707
+ delegations: string[];
1708
+ }) => Promise<{
1709
+ valid: boolean;
1710
+ error?: string;
1711
+ /** Issuer DID if valid */
1712
+ issuer?: string;
1713
+ /** Validated capability if valid */
1714
+ capability?: {
1715
+ can: string;
1716
+ with: string;
1717
+ nb?: Record<string, unknown>;
1718
+ };
1719
+ }>;
1720
+ /**
1721
+ * Parse a delegation from Base64 CAR format
1722
+ */
1723
+ parseDelegation?: (
1724
+ /** Base64-encoded CAR delegation */
1725
+ delegation: string) => Promise<{
1726
+ cid: string;
1727
+ issuer: string;
1728
+ audience: string;
1729
+ capabilities: Array<{
1730
+ can: string;
1731
+ with: string;
1732
+ nb?: Record<string, unknown>;
1733
+ }>;
1734
+ expiration?: number;
1735
+ proofs: string[];
1736
+ }>;
1737
+ /**
1738
+ * Search for users by name or DID
1739
+ */
1740
+ searchUsers?: (query: string) => Promise<Array<{
1741
+ did: string;
1742
+ displayName: string;
1743
+ avatarUrl?: string;
1744
+ address?: string;
1745
+ }>>;
1746
+ /**
1747
+ * Get registered oracles for an entity
1748
+ */
1749
+ getRegisteredOracles?: (entityDid: string) => Promise<Array<{
1750
+ did: string;
1751
+ name: string;
1752
+ description?: string;
1753
+ capabilities?: string[];
1754
+ }>>;
1755
+ /**
1756
+ * Get entity info including room ID
1757
+ */
1758
+ getEntityInfo?: (entityDid: string) => Promise<{
1759
+ did: string;
1760
+ name: string;
1761
+ roomId: string;
1762
+ adminAddress: string;
1763
+ controllerDid: string;
1764
+ }>;
1765
+ /**
1766
+ * Sign a Verifiable Credential using entity or user key.
1767
+ * Creates a DataIntegrityProof using eddsa-rdfc-2022 cryptosuite.
1768
+ */
1769
+ signCredential?: (params: {
1770
+ /** DID of issuer (entity or user) */
1771
+ issuerDid: string;
1772
+ /** Whether signing as entity or user */
1773
+ issuerType: 'entity' | 'user';
1774
+ /** Entity room ID (required if issuerType is 'entity') */
1775
+ entityRoomId?: string;
1776
+ /** The unsigned credential to sign */
1777
+ credential: {
1778
+ '@context': any;
1779
+ id: string;
1780
+ type: string[];
1781
+ issuer: {
1782
+ id: string;
1783
+ };
1784
+ validFrom: string;
1785
+ validUntil: string;
1786
+ credentialSchema: {
1787
+ id: string;
1788
+ type: string;
1789
+ };
1790
+ credentialSubject: any;
1791
+ };
1792
+ /** PIN to decrypt signing mnemonic */
1793
+ pin: string;
1794
+ }) => Promise<{
1795
+ /** The signed credential with proof attached */
1796
+ signedCredential: {
1797
+ '@context': any;
1798
+ id: string;
1799
+ type: string[];
1800
+ issuer: {
1801
+ id: string;
1802
+ };
1803
+ validFrom: string;
1804
+ validUntil: string;
1805
+ credentialSchema: {
1806
+ id: string;
1807
+ type: string;
1808
+ };
1809
+ credentialSubject: any;
1810
+ proof: {
1811
+ type: 'DataIntegrityProof';
1812
+ created: string;
1813
+ verificationMethod: string;
1814
+ cryptosuite: 'eddsa-rdfc-2022';
1815
+ proofPurpose: 'assertionMethod';
1816
+ proofValue: string;
1817
+ };
1818
+ };
1819
+ }>;
1820
+ /**
1821
+ * Redirect to entity overview page
1822
+ */
1823
+ redirectToEntityOverview?: (did: string, type: string) => void;
1824
+ /**
1825
+ * Create a new domain entity with the provided linked resources.
1826
+ * This is called after the domain card credential has been uploaded.
1827
+ */
1828
+ createDomain?: (params: {
1829
+ /** Entity type from survey (e.g., 'dao', 'protocol') */
1830
+ entityType: string;
1831
+ /** Linked resources to attach to the entity (includes domain card) */
1832
+ linkedResource: Array<{
1833
+ id: string;
1834
+ type: string;
1835
+ proof: string;
1836
+ right: string;
1837
+ encrypted: string;
1838
+ mediaType: string;
1839
+ description: string;
1840
+ serviceEndpoint: string;
1841
+ }>;
1842
+ /** Linked entities (e.g., governance groups) */
1843
+ linkedEntity?: Array<{
1844
+ id: string;
1845
+ type: string;
1846
+ relationship: string;
1847
+ service: string;
1848
+ }>;
1849
+ /** Start date for the entity (from validFrom) */
1850
+ startDate?: string;
1851
+ /** End date for the entity (from validUntil) */
1852
+ endDate?: string;
1853
+ }) => Promise<{
1854
+ /** The DID of the newly created entity */
1855
+ entityDid: string;
1856
+ /** Transaction hash */
1857
+ transactionHash: string;
1858
+ }>;
1859
+ /**
1860
+ * List available email templates from Mailgun
1861
+ */
1862
+ listEmailTemplates?: (params: {
1863
+ limit?: number;
1864
+ page?: string;
1865
+ }) => Promise<{
1866
+ items: Array<{
1867
+ name: string;
1868
+ description?: string;
1869
+ createdAt: string;
1870
+ }>;
1871
+ paging?: {
1872
+ first: string;
1873
+ last: string;
1874
+ next?: string;
1875
+ previous?: string;
1876
+ };
1877
+ }>;
1878
+ /**
1879
+ * Get a specific email template with optional active version content
1880
+ */
1881
+ getEmailTemplate?: (params: {
1882
+ templateName: string;
1883
+ active?: boolean;
1884
+ }) => Promise<{
1885
+ name: string;
1886
+ description?: string;
1887
+ version?: {
1888
+ tag: string;
1889
+ template: string;
1890
+ engine: string;
1891
+ active: boolean;
1892
+ createdAt: string;
1893
+ };
1894
+ }>;
1895
+ /**
1896
+ * Send an email using a template
1897
+ */
1898
+ sendEmail?: (params: {
1899
+ to: string;
1900
+ subject: string;
1901
+ template: string;
1902
+ templateVersion?: string;
1903
+ variables?: Record<string, any>;
1904
+ cc?: string;
1905
+ bcc?: string;
1906
+ replyTo?: string;
1907
+ }) => Promise<{
1908
+ id: string;
1909
+ message: string;
1910
+ }>;
1911
+ /**
1912
+ * Store a verifiable credential in Matrix room state.
1913
+ * Used by the credential.store action type.
1914
+ */
1915
+ storeMatrixCredential?: (params: {
1916
+ roomId: string;
1917
+ credentialKey: string;
1918
+ credential: Record<string, any>;
1919
+ cid: string;
1920
+ }) => Promise<{
1921
+ storedAt: string;
1922
+ duplicate: boolean;
1923
+ }>;
1924
+ /**
1925
+ * Get the evaluation template linked resource for a deed
1926
+ */
1927
+ getEvaluationTemplate?: (deedDid: string, claimCollectionId?: string) => Promise<{
1928
+ surveyTemplate: any;
1929
+ claimCollectionId: string;
1930
+ } | null>;
1931
+ /**
1932
+ * Get the rubric linked resource for a deed
1933
+ */
1934
+ getDeedRubric?: (deedDid: string) => Promise<{
1935
+ rubric: any;
1936
+ claimCollectionId: string;
1937
+ } | null>;
1938
+ /**
1939
+ * Evaluate a claim using a rubric via the rubric engine
1940
+ */
1941
+ evaluateWithRubric?: (params: {
1942
+ rubric: string;
1943
+ claim: Record<string, any>;
1944
+ }) => Promise<{
1945
+ success: boolean;
1946
+ trace?: {
1947
+ traceId: string;
1948
+ rubricVersion: number;
1949
+ rubricName: string | null;
1950
+ actor: {
1951
+ type: 'ai' | 'human';
1952
+ id?: string;
1953
+ } | null;
1954
+ result: {
1955
+ outcome: 'pass' | 'fail' | 'escalated';
1956
+ steps: Array<{
1957
+ stepId: string;
1958
+ kind: 'compute' | 'fetch' | 'check';
1959
+ success: boolean;
1960
+ outputs?: Record<string, any>;
1961
+ message?: string;
1962
+ error?: string;
1963
+ duration?: number;
1964
+ timestamp: string;
1965
+ }>;
1966
+ executionId: string;
1967
+ startTime: string;
1968
+ endTime: string;
1969
+ totalDuration: number;
1970
+ escalatedTo?: string;
1971
+ };
1972
+ claim: Record<string, any>;
1973
+ };
1974
+ error?: string;
1975
+ }>;
1976
+ /**
1977
+ * Create a Universal Decentralized Identifier (UDID) for an evaluation result
1978
+ */
1979
+ createUdid?: (params: CreateUdidParams) => Promise<CreateUdidResponse>;
1980
+ /**
1981
+ * Create a new governance group (categorical, multisig, NFT staking, or token staking).
1982
+ * The implementation is provided by the host application.
1983
+ */
1984
+ createGovernanceGroup?: (params: {
1985
+ /** Type of governance group to create */
1986
+ groupType: 'categorical' | 'multisig' | 'nftStaking' | 'tokenStaking';
1987
+ /** Name of the group */
1988
+ name: string;
1989
+ /** Optional description */
1990
+ description?: string;
1991
+ /** Group-type specific configuration from the survey */
1992
+ config: Record<string, unknown>;
1993
+ }) => Promise<{
1994
+ /** The DAO core contract address */
1995
+ coreAddress: string;
1996
+ /** The voting group contract address */
1997
+ groupAddress: string;
1998
+ /** Transaction hash */
1999
+ transactionHash: string;
2000
+ }>;
2001
+ /**
2002
+ * List entities where a given DID holds a specified role (e.g. 'controller').
2003
+ * Used by the POD setup flow to list parent organisations the user can nest under.
2004
+ */
2005
+ getEntitiesByRole?: (params: {
2006
+ /** DID of the actor */
2007
+ did: string;
2008
+ /** Role to filter by (e.g. 'controller', 'admin') */
2009
+ role: string;
2010
+ }) => Promise<Array<{
2011
+ did: string;
2012
+ name?: string;
2013
+ /** IXO entity type string, e.g. 'dao/dao', 'dao/pod', 'protocol/deed' */
2014
+ type?: string;
2015
+ icon?: string;
2016
+ description?: string;
2017
+ }>>;
2018
+ /**
2019
+ * List flow templates available for a given blueprint entity.
2020
+ * Used by the POD setup flow to let the user select startup flows.
2021
+ */
2022
+ getFlowTemplates?: (params: {
2023
+ /** Entity DID of the blueprint/protocol */
2024
+ entityDid: string;
2025
+ }) => Promise<Array<{
2026
+ did: string;
2027
+ name?: string;
2028
+ description?: string;
2029
+ }>>;
2030
+ /**
2031
+ * Create a Cosmos governance group from explicit members and decision policy.
2032
+ * Used by the POD setup flow after domain entity creation.
2033
+ */
2034
+ createGroup?: (params: {
2035
+ /** The entity DID of the newly created domain (to associate the group) */
2036
+ entityDid: string;
2037
+ /** Members with roles and voting power */
2038
+ members: Array<{
2039
+ did: string;
2040
+ role: string;
2041
+ votingPower: number;
2042
+ }>;
2043
+ /** Decision policy parameters */
2044
+ decisionPolicy: {
2045
+ votingPeriod: string;
2046
+ quorum: string;
2047
+ threshold: string;
2048
+ vetoThreshold: string;
2049
+ minExecutionDelay: string;
2050
+ executor: string;
2051
+ };
2052
+ /** Optional group name (defaults to entity name) */
2053
+ name?: string;
2054
+ }) => Promise<{
2055
+ /** The group/DAO core contract address */
2056
+ groupAddress: string;
2057
+ /** Transaction hash */
2058
+ transactionHash: string;
2059
+ }>;
2060
+ /**
2061
+ * Navigate to a flow link URL
2062
+ * @param url - HTTP URL of the target flow or page
2063
+ */
2064
+ navigateToFlow?: (url: string) => void;
2065
+ /**
2066
+ * Get the status of a flow document
2067
+ * @param url - HTTP URL of the flow document
2068
+ * @returns Flow status with optional completion timestamp
2069
+ */
2070
+ getFlowStatus?: (url: string) => Promise<{
2071
+ status: 'not_started' | 'in_progress' | 'completed';
2072
+ completedAt?: string;
2073
+ }>;
2074
+ /**
2075
+ * Get workspace pages from protocol deed entity.
2076
+ * The host app automatically determines the network context.
2077
+ * @returns Array of workspace pages with type "Page" and mediaType "application/matrix"
2078
+ */
2079
+ getWorkspacePages?: () => Promise<WorkspacePage[]>;
2080
+ /**
2081
+ * Create a new signer session for handle-based signing.
2082
+ *
2083
+ * This allows the editor to request signing operations without receiving
2084
+ * raw key material. The host app manages the session lifecycle and key security.
2085
+ *
2086
+ * @example
2087
+ * ```typescript
2088
+ * // Create a session-scoped signer for batch operations
2089
+ * const session = await handlers.createSignerSession({
2090
+ * did: 'did:ixo:entity:abc123',
2091
+ * didType: 'entity',
2092
+ * entityRoomId: '!room:matrix.ixo.world',
2093
+ * pin: '123456',
2094
+ * scope: 'session',
2095
+ * ttlSeconds: 300
2096
+ * });
2097
+ *
2098
+ * // Use for multiple signatures without re-entering PIN
2099
+ * const sig1 = await handlers.signWithSession({ sessionId: session.sessionId, data: '...' });
2100
+ * const sig2 = await handlers.signWithSession({ sessionId: session.sessionId, data: '...' });
2101
+ *
2102
+ * // Release when done
2103
+ * await handlers.releaseSignerSession({ sessionId: session.sessionId });
2104
+ * ```
2105
+ */
2106
+ createSignerSession?: (params: {
2107
+ /** DID of the signer (entity or user) */
2108
+ did: string;
2109
+ /** Whether signing as entity or user */
2110
+ didType: 'entity' | 'user';
2111
+ /** Entity room ID (required if didType is 'entity') */
2112
+ entityRoomId?: string;
2113
+ /** PIN to decrypt signing mnemonic */
2114
+ pin: string;
2115
+ /**
2116
+ * Session scope:
2117
+ * - 'session': Remains valid for multiple sign operations until TTL or explicit release
2118
+ * - 'operation': Automatically invalidated after first sign operation
2119
+ */
2120
+ scope: 'session' | 'operation';
2121
+ /**
2122
+ * Time-to-live in seconds (only applicable for 'session' scope)
2123
+ * Default: 300 (5 minutes), Maximum: 3600 (1 hour)
2124
+ */
2125
+ ttlSeconds?: number;
2126
+ }) => Promise<{
2127
+ /** Opaque session identifier */
2128
+ sessionId: string;
2129
+ /** DID of the signer */
2130
+ did: string;
2131
+ /** Public key in multibase format (for verification) */
2132
+ publicKey: string;
2133
+ /** Key ID (verification method ID) */
2134
+ keyId: string;
2135
+ /** Unix timestamp when the session expires */
2136
+ expiresAt: number;
2137
+ /** The scope this session was created with */
2138
+ scope: 'session' | 'operation';
2139
+ }>;
2140
+ /**
2141
+ * Sign data using an existing signer session.
2142
+ *
2143
+ * For 'operation' scoped sessions, the session is automatically
2144
+ * invalidated after this call succeeds.
2145
+ *
2146
+ * @throws If session not found, expired, or signing fails
2147
+ */
2148
+ signWithSession?: (params: {
2149
+ /** The session ID returned from createSignerSession */
2150
+ sessionId: string;
2151
+ /** Data to sign (passed as-is to Ed25519 sign) */
2152
+ data: string;
2153
+ /** Algorithm hint (currently only Ed25519 supported) */
2154
+ algorithm?: 'Ed25519';
2155
+ }) => Promise<{
2156
+ /** The signature in hex format */
2157
+ signature: string;
2158
+ /** The algorithm used */
2159
+ algorithm: 'Ed25519';
2160
+ /** Key ID that was used for signing */
2161
+ keyId: string;
2162
+ }>;
2163
+ /**
2164
+ * Release a signer session before it expires.
2165
+ *
2166
+ * This immediately clears the session from host memory, preventing
2167
+ * any further signing operations. Idempotent - safe to call on
2168
+ * already-expired or released sessions.
2169
+ */
2170
+ releaseSignerSession?: (params: {
2171
+ /** The session ID to release */
2172
+ sessionId: string;
2173
+ }) => Promise<{
2174
+ /** Whether the session was successfully released */
2175
+ released: boolean;
2176
+ /** Reason if not released (e.g., already expired) */
2177
+ reason?: string;
2178
+ }>;
2179
+ /**
2180
+ * Validate an MCP server URL and optionally authenticate with it.
2181
+ * Returns the list of tools the server exposes on success.
2182
+ */
2183
+ validateMcpServer?: (params: {
2184
+ url: string;
2185
+ authType?: 'bearer' | 'api-key' | 'none';
2186
+ authToken?: string;
2187
+ }) => Promise<{
2188
+ success: boolean;
2189
+ tools?: Array<{
2190
+ name: string;
2191
+ description?: string;
2192
+ }>;
2193
+ error?: string;
2194
+ }>;
2195
+ /**
2196
+ * Fetch available skills (capsules) from the skills registry
2197
+ */
2198
+ getNetwork?: () => Promise<string>;
2199
+ getSkills?: () => Promise<{
2200
+ capsules: Array<{
2201
+ cid: string;
2202
+ name: string;
2203
+ description: string;
2204
+ license: string;
2205
+ compatibility: string;
2206
+ allowedTools: string;
2207
+ metadata: unknown;
2208
+ archiveSize: number;
2209
+ createdAt: string;
2210
+ }>;
2211
+ pagination: {
2212
+ total: number;
2213
+ limit: number;
2214
+ offset: number;
2215
+ hasMore: boolean;
2216
+ };
2217
+ }>;
2218
+ /**
2219
+ * Invoke a named skill with the given payload and return the result.
2220
+ */
2221
+ invokeSkill?: (skillName: string, payload: Record<string, unknown>) => Promise<unknown>;
2222
+ deploySetup?: (params: {
2223
+ name: string;
2224
+ config: Record<string, any>;
2225
+ }) => Promise<{
2226
+ setupComplete: boolean;
2227
+ stdout?: string;
2228
+ stderr?: string;
2229
+ }>;
2230
+ deployStart?: (params: {
2231
+ name: string;
2232
+ }) => Promise<{
2233
+ processId: string;
2234
+ status: string;
2235
+ }>;
2236
+ integrations?: IntegrationsHandlers;
2237
+ /**
2238
+ * Bridge callback for the consuming app's analytics pipeline.
2239
+ * Editor emits events using this callback so the portal can forward them to its analytics provider
2240
+ * (e.g. PostHog) without the editor package taking a dependency on posthog-js.
2241
+ */
2242
+ onAnalyticsEvent?: (eventName: string, properties?: Record<string, unknown>) => void;
2243
+ }
2244
+ type DocType = 'template' | 'flow';
2245
+ /**
2246
+ * Visualization renderer type for AG-UI integration.
2247
+ * This function is called by visualization blocks to render the actual AG-UI component.
2248
+ * @param vizType - The type of visualization (e.g., 'lineChart', 'barChart', 'dataTable', etc.)
2249
+ * @param config - The configuration object for the visualization
2250
+ * @param preferences - Optional user customizations (e.g., { pageSize: 25 }) persisted to the block
2251
+ * @param onPreferencesChange - Optional callback to update preferences (persists via CRDT)
2252
+ * @returns React node with the rendered visualization, or null if type is not supported
2253
+ */
2254
+ type VisualizationRenderer = (vizType: string, config: object, preferences?: object, onPreferencesChange?: (prefs: object) => void) => React__default.ReactNode | null;
2255
+ /**
2256
+ * Domain card data structure for rendering domain card previews
2257
+ */
2258
+ interface DomainCardData {
2259
+ name?: string;
2260
+ summary?: string;
2261
+ description?: string;
2262
+ entity_type?: string[];
2263
+ faq?: Array<{
2264
+ question: string;
2265
+ answer: string;
2266
+ }>;
2267
+ logo_url?: {
2268
+ url?: string;
2269
+ alt?: string;
2270
+ };
2271
+ image_urls?: Array<{
2272
+ url: string;
2273
+ alt: string;
2274
+ }>;
2275
+ keywords?: string[];
2276
+ valid_from?: string;
2277
+ issuer?: string;
2278
+ area_served?: string;
2279
+ address?: string;
2280
+ coordinates?: {
2281
+ type: string;
2282
+ coordinates: [number, number];
2283
+ };
2284
+ contact?: {
2285
+ email?: string;
2286
+ website?: string;
2287
+ location?: string;
2288
+ socialLinks?: string[];
2289
+ };
2290
+ [key: string]: unknown;
2291
+ }
2292
+ /**
2293
+ * Renderer for domain card previews in the qi/domain.card-preview action.
2294
+ * The web app provides this renderer to display domain card data with proper styling.
2295
+ */
2296
+ type DomainCardRenderer = (domainCardData: DomainCardData) => React__default.ReactNode;
2297
+ /**
2298
+ * Dynamic list data returned by the data provider
2299
+ */
2300
+ interface DynamicListData {
2301
+ items: any[] | null;
2302
+ loading: boolean;
2303
+ error: string | null;
2304
+ }
2305
+ /**
2306
+ * Function type for getting dynamic list data from context
2307
+ */
2308
+ type DynamicListDataProvider = (listId: string) => DynamicListData;
2309
+ /**
2310
+ * Dynamic list column definition (imported from types for context)
2311
+ */
2312
+ interface DynamicListColumn {
2313
+ key: string;
2314
+ label: string;
2315
+ position?: 'topLeft' | 'bottomLeft' | 'topRight' | 'bottomRight';
2316
+ type?: 'string' | 'number' | 'date';
2317
+ color?: string;
2318
+ }
2319
+ /**
2320
+ * DataSource for dynamic lists
2321
+ */
2322
+ interface DataSource {
2323
+ oracleDid: string;
2324
+ oracleName?: string;
2325
+ query: string;
2326
+ toolName?: string;
2327
+ params?: Record<string, any>;
2328
+ description?: string;
2329
+ }
2330
+ /**
2331
+ * Action that can be performed on a dynamic list item
2332
+ */
2333
+ interface DynamicListAction {
2334
+ id: string;
2335
+ label: string;
2336
+ color?: string;
2337
+ }
2338
+ /**
2339
+ * Panel renderer type for dynamic list selection panel.
2340
+ * This function is called when an item is selected in a dynamic list.
2341
+ * If provided, renders custom content. If not provided, shows default key-value view.
2342
+ * @param item - The selected item data
2343
+ * @param columns - Column definitions from the dynamic list
2344
+ * @param dataSource - Data source info (oracle, query, etc.)
2345
+ * @returns React node with custom panel content, or null to use default
2346
+ */
2347
+ type DynamicListPanelRenderer = (item: any, columns: DynamicListColumn[], dataSource: DataSource | null, panelDescription?: string, actions?: DynamicListAction[], onClose?: () => void) => React__default.ReactNode | null;
2348
+ /**
2349
+ * Translation function injected by the host app (e.g. next-i18next `t`).
2350
+ * The editor stays framework-agnostic — when `translate` is not provided,
2351
+ * `useTranslate` falls back to `defaultValue ?? key`, so all strings still
2352
+ * render in English.
2353
+ */
2354
+ type Translate = (key: string, opts?: {
2355
+ defaultValue?: string;
2356
+ [k: string]: any;
2357
+ }) => string;
2358
+ interface BlocknoteContextValue {
2359
+ editor?: IxoEditorType;
2360
+ handlers?: BlocknoteHandlers;
2361
+ blockRequirements?: BlockRequirements;
2362
+ mapConfig?: UnlMapConfig;
2363
+ editable?: boolean;
2364
+ docType: DocType;
2365
+ /** Current flow schema version (e.g., '0.3', '1.0.0') */
2366
+ flowVersion: string;
2367
+ sharedProposals: SharedProposalData;
2368
+ fetchSharedProposal: (proposalId: string, contractAddress: string, force?: boolean) => Promise<ProposalResponse>;
2369
+ invalidateProposal: (proposalId: string) => void;
2370
+ subscribeToProposal: (proposalId: string) => ProposalResponse | undefined;
2371
+ activeDrawerId: string | null;
2372
+ drawerContent: React__default.ReactNode | null;
2373
+ openDrawer: (id: string, content: React__default.ReactNode) => void;
2374
+ closeDrawer: () => void;
2375
+ visualizationRenderer?: VisualizationRenderer;
2376
+ getDynamicListData?: DynamicListDataProvider;
2377
+ dynamicListPanelRenderer?: DynamicListPanelRenderer;
2378
+ domainCardRenderer?: DomainCardRenderer;
2379
+ connectedUsers?: Array<{
2380
+ clientId: string;
2381
+ state: any;
2382
+ }>;
2383
+ awarenessInstance?: any;
2384
+ translate?: Translate;
2385
+ }
2386
+ declare const BlocknoteProvider: React__default.FC<{
2387
+ children: React__default.ReactNode;
2388
+ editor?: IxoEditorType;
2389
+ handlers?: BlocknoteHandlers;
2390
+ blockRequirements?: BlockRequirements;
2391
+ editable?: boolean;
2392
+ visualizationRenderer?: VisualizationRenderer;
2393
+ getDynamicListData?: DynamicListDataProvider;
2394
+ dynamicListPanelRenderer?: DynamicListPanelRenderer;
2395
+ domainCardRenderer?: DomainCardRenderer;
2396
+ mapConfig?: UnlMapConfig;
2397
+ connectedUsers?: Array<{
2398
+ clientId: string;
2399
+ state: any;
2400
+ }>;
2401
+ awarenessInstance?: any;
2402
+ translate?: Translate;
2403
+ }>;
2404
+ declare const useBlocknoteContext: () => BlocknoteContextValue;
2405
+ declare const useBlocknoteHandlers: () => BlocknoteHandlers;
2406
+ /**
2407
+ * Translate function for editor strings. Reads `translate` from
2408
+ * `BlocknoteContext`. When the host app hasn't provided one, falls back to
2409
+ * `defaultValue ?? key` so the editor still renders something readable.
2410
+ *
2411
+ * The returned function has a stable identity across renders, so consumers
2412
+ * can safely omit it from useEffect/useCallback dependency arrays. Internally
2413
+ * it reads the latest `translate` via a ref, so language switches still
2414
+ * trigger re-renders through the surrounding context update.
2415
+ *
2416
+ * Usage:
2417
+ * const t = useTranslate();
2418
+ * <span>{t('pageTitle.placeholder', { defaultValue: 'New page' })}</span>
2419
+ */
2420
+ declare const useTranslate: () => Translate;
2421
+
2422
+ interface SelectionActionItem {
2423
+ id: string;
2424
+ label: string;
2425
+ icon?: string;
2426
+ onClick: (itemId: string, itemData: any) => void | Promise<void>;
2427
+ }
2428
+ interface SelectionActionSection {
2429
+ title: string;
2430
+ description?: string;
2431
+ actions: SelectionActionItem[];
2432
+ }
2433
+
8
2434
  declare const blockSpecs: {
9
2435
  checkbox: {
10
2436
  config: {
@@ -1863,7 +4289,7 @@ declare const blockSpecs: {
1863
4289
  }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
1864
4290
  };
1865
4291
  };
1866
- declare const getExtraSlashMenuItems: (editor: any) => {
4292
+ declare const getExtraSlashMenuItems: (editor: any, translate?: Translate) => {
1867
4293
  title: string;
1868
4294
  icon: React.JSX.Element;
1869
4295
  onItemClick: () => void;
@@ -2844,4 +5270,4 @@ interface IxoEditorConfig {
2844
5270
  tableHandles: boolean;
2845
5271
  }
2846
5272
 
2847
- export { type ExecutionWithInvocationResult as A, type FindProofsResult as B, type ClaimCollectionURI as C, type DelegationChainValidationResult as D, type EvaluationStatus as E, type FlowMetadata as F, type CreateRootDelegationParams as G, type CreateDelegationParams as H, type InvocationStore as I, type CreateInvocationParams as J, type IxoBlockProps as K, type LinkedClaim as L, type NodeState as N, type StoredDelegation as S, type UcanDelegationStore as U, createMemoryUcanDelegationStore as a, createInvocationStore as b, createUcanDelegationStore as c, createMemoryInvocationStore as d, createUcanService as e, type UcanService as f, type UcanServiceConfig as g, type UcanServiceHandlers as h, type UcanCapability as i, type StoredInvocation as j, type DelegationGrant as k, type IxoEditorOptions as l, type IxoEditorTheme as m, type IxoEditorConfig as n, type IxoCollaborativeUser as o, type IxoCollaborativeEditorOptions as p, blockSpecs as q, getExtraSlashMenuItems as r, type IxoEditorType as s, type FlowNode as t, type DID as u, type FlowNodeAuthzExtension as v, type FlowNodeRuntimeState as w, type FlowNodeBase as x, type InvocationRequest as y, type InvocationResult as z };
5273
+ export { type EvaluationStatus as $, AuthzExecActionTypes as A, BlocknoteProvider as B, type VoteResponse as C, type DelegationChainValidationResult as D, type VoteInfo as E, type Vote as F, type User as G, type Addr as H, type InvocationStore as I, type Uint128 as J, type Expiration as K, type Status as L, type Threshold as M, type Votes as N, type CosmosMsgForEmpty as O, type ProposalResponse as P, type ProposalAction as Q, type Translate as R, type StoredDelegation as S, type Timestamp as T, type UcanDelegationStore as U, ValidatorActionType as V, type IxoEditorType as W, type FlowMetadata as X, type FlowNode as Y, type DID as Z, type ClaimCollectionURI as _, createMemoryUcanDelegationStore as a, type LinkedClaim as a0, type FlowNodeAuthzExtension as a1, type FlowNodeRuntimeState as a2, type NodeState as a3, type FlowNodeBase as a4, type InvocationRequest as a5, type InvocationResult as a6, type ExecutionWithInvocationResult as a7, type FindProofsResult as a8, type CreateRootDelegationParams as a9, type CreateDelegationParams as aa, type CreateInvocationParams as ab, type IxoBlockProps as ac, type VisualizationRenderer as ad, type DynamicListData as ae, type DynamicListDataProvider as af, type DynamicListPanelRenderer as ag, type DomainCardRenderer as ah, type DomainCardData as ai, type UnlMapConfig as aj, createInvocationStore as b, createUcanDelegationStore as c, createMemoryInvocationStore as d, createUcanService as e, type UcanService as f, type UcanServiceConfig as g, type UcanServiceHandlers as h, type UcanCapability as i, type StoredInvocation as j, type DelegationGrant as k, type IxoEditorOptions as l, type IxoEditorTheme as m, type IxoEditorConfig as n, type IxoCollaborativeUser as o, type IxoCollaborativeEditorOptions as p, blockSpecs as q, getExtraSlashMenuItems as r, useBlocknoteHandlers as s, useTranslate as t, useBlocknoteContext as u, StakeType as v, type BlocknoteHandlers as w, type BlocknoteContextValue as x, type BlockRequirements as y, type SingleChoiceProposal as z };