@ottochain/sdk 1.0.3 → 1.1.1

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.
Files changed (181) hide show
  1. package/dist/cjs/apps/contracts/state-machines/contract.json +21 -63
  2. package/dist/cjs/apps/contracts/state-machines/escrow.json +23 -69
  3. package/dist/cjs/apps/governance/state-machines/dao-multisig.json +22 -66
  4. package/dist/cjs/apps/governance/state-machines/dao-single.json +14 -42
  5. package/dist/cjs/apps/governance/state-machines/dao-threshold.json +18 -54
  6. package/dist/cjs/apps/governance/state-machines/dao-token.json +21 -63
  7. package/dist/cjs/apps/governance/state-machines/governance-constitution.json +22 -66
  8. package/dist/cjs/apps/governance/state-machines/governance-executive.json +27 -81
  9. package/dist/cjs/apps/governance/state-machines/governance-judiciary.json +34 -102
  10. package/dist/cjs/apps/governance/state-machines/governance-legislature.json +32 -96
  11. package/dist/cjs/apps/governance/state-machines/governance-simple.json +27 -81
  12. package/dist/cjs/apps/identity/state-machines/agent-identity.json +25 -75
  13. package/dist/cjs/apps/markets/state-machines/market-universal.json +377 -110
  14. package/dist/cjs/apps/oracles/state-machines/oracle.json +22 -66
  15. package/dist/cjs/generated/index.js +11 -1
  16. package/dist/cjs/metakit/drop-nulls.js +50 -0
  17. package/dist/cjs/metakit/normalize.js +147 -0
  18. package/dist/cjs/ottochain/metagraph-client.js +147 -0
  19. package/dist/cjs/validation.js +1 -1
  20. package/dist/esm/apps/contracts/state-machines/contract.json +21 -63
  21. package/dist/esm/apps/contracts/state-machines/escrow.json +23 -69
  22. package/dist/esm/apps/governance/state-machines/dao-multisig.json +22 -66
  23. package/dist/esm/apps/governance/state-machines/dao-single.json +14 -42
  24. package/dist/esm/apps/governance/state-machines/dao-threshold.json +18 -54
  25. package/dist/esm/apps/governance/state-machines/dao-token.json +21 -63
  26. package/dist/esm/apps/governance/state-machines/governance-constitution.json +22 -66
  27. package/dist/esm/apps/governance/state-machines/governance-executive.json +27 -81
  28. package/dist/esm/apps/governance/state-machines/governance-judiciary.json +34 -102
  29. package/dist/esm/apps/governance/state-machines/governance-legislature.json +32 -96
  30. package/dist/esm/apps/governance/state-machines/governance-simple.json +27 -81
  31. package/dist/esm/apps/identity/state-machines/agent-identity.json +25 -75
  32. package/dist/esm/apps/markets/state-machines/market-universal.json +377 -110
  33. package/dist/esm/apps/oracles/state-machines/oracle.json +22 -66
  34. package/dist/esm/generated/index.js +11 -1
  35. package/dist/esm/metakit/drop-nulls.js +46 -0
  36. package/dist/esm/metakit/normalize.js +140 -0
  37. package/dist/esm/ottochain/metagraph-client.js +147 -0
  38. package/dist/esm/validation.js +1 -1
  39. package/dist/types/generated/index.d.ts +11 -1
  40. package/dist/types/metakit/drop-nulls.d.ts +29 -0
  41. package/dist/types/metakit/normalize.d.ts +67 -0
  42. package/dist/types/ottochain/index.d.ts +1 -1
  43. package/dist/types/ottochain/metagraph-client.d.ts +90 -0
  44. package/package.json +12 -12
  45. package/dist/apps/contracts/index.d.ts +0 -21
  46. package/dist/apps/contracts/index.js +0 -39
  47. package/dist/apps/contracts/types.d.ts +0 -24
  48. package/dist/apps/contracts/types.js +0 -48
  49. package/dist/apps/identity/index.d.ts +0 -22
  50. package/dist/apps/identity/index.js +0 -40
  51. package/dist/apps/identity/types.d.ts +0 -30
  52. package/dist/apps/identity/types.js +0 -53
  53. package/dist/apps/index.d.ts +0 -29
  54. package/dist/apps/index.js +0 -60
  55. package/dist/apps/markets/index.d.ts +0 -26
  56. package/dist/apps/markets/index.js +0 -46
  57. package/dist/apps/markets/types.d.ts +0 -185
  58. package/dist/apps/markets/types.js +0 -252
  59. package/dist/apps/oracles/index.d.ts +0 -26
  60. package/dist/apps/oracles/index.js +0 -46
  61. package/dist/apps/oracles/types.d.ts +0 -211
  62. package/dist/apps/oracles/types.js +0 -306
  63. package/dist/cjs/apps/contracts/types.js +0 -48
  64. package/dist/cjs/apps/corporate/types.js +0 -44
  65. package/dist/cjs/apps/governance/types.js +0 -42
  66. package/dist/cjs/apps/identity/types.js +0 -53
  67. package/dist/cjs/apps/markets/types.js +0 -219
  68. package/dist/cjs/apps/oracles/types.js +0 -282
  69. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract_pb.js +0 -100
  70. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate_pb.js +0 -392
  71. package/dist/cjs/generated/ottochain/apps/governance/v1/governance_pb.js +0 -235
  72. package/dist/cjs/generated/ottochain/apps/identity/v1/agent_pb.js +0 -116
  73. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation_pb.js +0 -79
  74. package/dist/cjs/generated/ottochain/apps/markets/v1/market_pb.js +0 -151
  75. package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle_pb.js +0 -109
  76. package/dist/cjs/generated/ottochain/v1/common_pb.js +0 -37
  77. package/dist/cjs/generated/ottochain/v1/fiber_pb.js +0 -86
  78. package/dist/cjs/generated/ottochain/v1/messages_pb.js +0 -44
  79. package/dist/cjs/generated/ottochain/v1/records_pb.js +0 -44
  80. package/dist/errors.d.ts +0 -221
  81. package/dist/errors.js +0 -293
  82. package/dist/esm/apps/contracts/types.js +0 -44
  83. package/dist/esm/apps/corporate/types.js +0 -38
  84. package/dist/esm/apps/governance/types.js +0 -35
  85. package/dist/esm/apps/identity/types.js +0 -50
  86. package/dist/esm/apps/markets/types.js +0 -206
  87. package/dist/esm/apps/oracles/types.js +0 -267
  88. package/dist/esm/generated/ottochain/apps/contracts/v1/contract_pb.js +0 -97
  89. package/dist/esm/generated/ottochain/apps/corporate/v1/corporate_pb.js +0 -389
  90. package/dist/esm/generated/ottochain/apps/governance/v1/governance_pb.js +0 -232
  91. package/dist/esm/generated/ottochain/apps/identity/v1/agent_pb.js +0 -113
  92. package/dist/esm/generated/ottochain/apps/identity/v1/attestation_pb.js +0 -76
  93. package/dist/esm/generated/ottochain/apps/markets/v1/market_pb.js +0 -148
  94. package/dist/esm/generated/ottochain/apps/oracles/v1/oracle_pb.js +0 -106
  95. package/dist/esm/generated/ottochain/v1/common_pb.js +0 -34
  96. package/dist/esm/generated/ottochain/v1/fiber_pb.js +0 -83
  97. package/dist/esm/generated/ottochain/v1/messages_pb.js +0 -41
  98. package/dist/esm/generated/ottochain/v1/records_pb.js +0 -41
  99. package/dist/generated/index.d.ts +0 -15
  100. package/dist/generated/index.js +0 -34
  101. package/dist/generated/ottochain/apps/contracts/v1/contract_pb.d.ts +0 -274
  102. package/dist/generated/ottochain/apps/contracts/v1/contract_pb.js +0 -100
  103. package/dist/generated/ottochain/apps/identity/v1/agent_pb.d.ts +0 -211
  104. package/dist/generated/ottochain/apps/identity/v1/agent_pb.js +0 -116
  105. package/dist/generated/ottochain/apps/identity/v1/attestation_pb.d.ts +0 -238
  106. package/dist/generated/ottochain/apps/identity/v1/attestation_pb.js +0 -79
  107. package/dist/generated/ottochain/apps/markets/v1/market_pb.d.ts +0 -436
  108. package/dist/generated/ottochain/apps/markets/v1/market_pb.js +0 -151
  109. package/dist/generated/ottochain/apps/oracles/v1/oracle_pb.d.ts +0 -393
  110. package/dist/generated/ottochain/apps/oracles/v1/oracle_pb.js +0 -109
  111. package/dist/generated/ottochain/v1/common_pb.d.ts +0 -86
  112. package/dist/generated/ottochain/v1/common_pb.js +0 -37
  113. package/dist/generated/ottochain/v1/fiber_pb.d.ts +0 -292
  114. package/dist/generated/ottochain/v1/fiber_pb.js +0 -86
  115. package/dist/generated/ottochain/v1/messages_pb.d.ts +0 -190
  116. package/dist/generated/ottochain/v1/messages_pb.js +0 -44
  117. package/dist/generated/ottochain/v1/records_pb.d.ts +0 -221
  118. package/dist/generated/ottochain/v1/records_pb.js +0 -44
  119. package/dist/index.d.ts +0 -21
  120. package/dist/index.js +0 -77
  121. package/dist/metakit/binary.d.ts +0 -38
  122. package/dist/metakit/binary.js +0 -58
  123. package/dist/metakit/canonicalize.d.ts +0 -26
  124. package/dist/metakit/canonicalize.js +0 -40
  125. package/dist/metakit/codec.d.ts +0 -16
  126. package/dist/metakit/codec.js +0 -45
  127. package/dist/metakit/currency-transaction.d.ts +0 -157
  128. package/dist/metakit/currency-transaction.js +0 -319
  129. package/dist/metakit/currency-types.d.ts +0 -55
  130. package/dist/metakit/currency-types.js +0 -13
  131. package/dist/metakit/hash.d.ts +0 -50
  132. package/dist/metakit/hash.js +0 -84
  133. package/dist/metakit/index.d.ts +0 -23
  134. package/dist/metakit/index.js +0 -74
  135. package/dist/metakit/network/client.d.ts +0 -23
  136. package/dist/metakit/network/client.js +0 -78
  137. package/dist/metakit/network/currency-l1-client.d.ts +0 -71
  138. package/dist/metakit/network/currency-l1-client.js +0 -101
  139. package/dist/metakit/network/data-l1-client.d.ts +0 -57
  140. package/dist/metakit/network/data-l1-client.js +0 -76
  141. package/dist/metakit/network/index.d.ts +0 -10
  142. package/dist/metakit/network/index.js +0 -16
  143. package/dist/metakit/network/types.d.ts +0 -74
  144. package/dist/metakit/network/types.js +0 -20
  145. package/dist/metakit/sign.d.ts +0 -65
  146. package/dist/metakit/sign.js +0 -120
  147. package/dist/metakit/signed-object.d.ts +0 -66
  148. package/dist/metakit/signed-object.js +0 -100
  149. package/dist/metakit/types.d.ts +0 -67
  150. package/dist/metakit/types.js +0 -14
  151. package/dist/metakit/verify.d.ts +0 -55
  152. package/dist/metakit/verify.js +0 -217
  153. package/dist/metakit/wallet.d.ts +0 -70
  154. package/dist/metakit/wallet.js +0 -127
  155. package/dist/ottochain/index.d.ts +0 -13
  156. package/dist/ottochain/index.js +0 -45
  157. package/dist/ottochain/metagraph-client.d.ts +0 -111
  158. package/dist/ottochain/metagraph-client.js +0 -157
  159. package/dist/ottochain/snapshot.d.ts +0 -86
  160. package/dist/ottochain/snapshot.js +0 -110
  161. package/dist/ottochain/types.d.ts +0 -278
  162. package/dist/ottochain/types.js +0 -11
  163. package/dist/types/apps/contracts/types.d.ts +0 -24
  164. package/dist/types/apps/corporate/types.d.ts +0 -9861
  165. package/dist/types/apps/governance/types.d.ts +0 -344
  166. package/dist/types/apps/identity/types.d.ts +0 -30
  167. package/dist/types/apps/markets/types.d.ts +0 -155
  168. package/dist/types/apps/oracles/types.d.ts +0 -193
  169. package/dist/types/generated/ottochain/apps/contracts/v1/contract_pb.d.ts +0 -274
  170. package/dist/types/generated/ottochain/apps/corporate/v1/corporate_pb.d.ts +0 -1172
  171. package/dist/types/generated/ottochain/apps/governance/v1/governance_pb.d.ts +0 -772
  172. package/dist/types/generated/ottochain/apps/identity/v1/agent_pb.d.ts +0 -211
  173. package/dist/types/generated/ottochain/apps/identity/v1/attestation_pb.d.ts +0 -238
  174. package/dist/types/generated/ottochain/apps/markets/v1/market_pb.d.ts +0 -436
  175. package/dist/types/generated/ottochain/apps/oracles/v1/oracle_pb.d.ts +0 -393
  176. package/dist/types/generated/ottochain/v1/common_pb.d.ts +0 -86
  177. package/dist/types/generated/ottochain/v1/fiber_pb.d.ts +0 -292
  178. package/dist/types/generated/ottochain/v1/messages_pb.d.ts +0 -190
  179. package/dist/types/generated/ottochain/v1/records_pb.d.ts +0 -221
  180. package/dist/validation.d.ts +0 -449
  181. package/dist/validation.js +0 -312
@@ -1,193 +0,0 @@
1
- /**
2
- * Oracles Application Types
3
- *
4
- * Constants, types, and utilities for the Oracle system on OttoChain.
5
- * Oracles provide truth resolution for markets and disputes.
6
- *
7
- * Core types (OracleState, Oracle, etc.) are exported from proto-generated
8
- * types in index.ts.
9
- *
10
- * @packageDocumentation
11
- */
12
- import { OracleState } from '../../generated/ottochain/apps/oracles/v1/oracle_pb.js';
13
- /**
14
- * Types of oracle resolutions
15
- */
16
- export declare enum ResolutionType {
17
- UNSPECIFIED = 0,
18
- /** Binary yes/no outcome */
19
- BINARY = 1,
20
- /** One of multiple predefined outcomes */
21
- MULTI_CHOICE = 2,
22
- /** Numeric value (e.g., price) */
23
- NUMERIC = 3,
24
- /** Free-form attestation */
25
- ATTESTATION = 4
26
- }
27
- /**
28
- * Reasons for slashing oracle stake
29
- */
30
- export declare enum SlashingReason {
31
- UNSPECIFIED = 0,
32
- /** Failed to submit resolution in time */
33
- TIMEOUT = 1,
34
- /** Resolution overturned by dispute */
35
- INCORRECT_RESOLUTION = 2,
36
- /** Evidence of collusion or manipulation */
37
- COLLUSION = 3,
38
- /** Violation of oracle protocol */
39
- PROTOCOL_VIOLATION = 4
40
- }
41
- /**
42
- * Oracle configuration type
43
- */
44
- export interface OracleConfig {
45
- /** Minimum stake required to become an oracle (in base units) */
46
- minStake: bigint;
47
- /** Stake slashed for timeout (percentage) */
48
- timeoutSlashPercent: number;
49
- /** Stake slashed for incorrect resolution (percentage) */
50
- incorrectSlashPercent: number;
51
- /** Stake slashed for collusion (percentage) */
52
- collusionSlashPercent: number;
53
- /** Stake slashed for protocol violation (percentage) */
54
- violationSlashPercent: number;
55
- /** Epochs to wait before withdrawal after unstaking */
56
- cooldownEpochs: number;
57
- /** Base reputation for new oracles */
58
- baseReputation: number;
59
- /** Minimum reputation to accept high-value markets */
60
- highValueThreshold: number;
61
- /** Resolution window in epochs */
62
- resolutionWindowEpochs: number;
63
- /** Challenge window after submission in epochs */
64
- challengeWindowEpochs: number;
65
- /** Reward percentage from resolved market fees */
66
- oracleRewardPercent: number;
67
- }
68
- /**
69
- * Default oracle configuration
70
- */
71
- export declare const DEFAULT_ORACLE_CONFIG: OracleConfig;
72
- /**
73
- * Slashing percentages by reason
74
- */
75
- export declare const SLASHING_PERCENTAGES: Record<SlashingReason, number>;
76
- /**
77
- * Valid transitions for each oracle state (aligned with proto OracleState enum)
78
- */
79
- export declare const ORACLE_TRANSITIONS: Record<OracleState, readonly string[]>;
80
- /**
81
- * Check if an oracle state is terminal
82
- */
83
- export declare function isTerminalOracleState(state: OracleState): boolean;
84
- /**
85
- * Check if an oracle can accept new assignments
86
- */
87
- export declare function canAcceptAssignment(state: OracleState): boolean;
88
- /**
89
- * Reputation update factors
90
- */
91
- export declare const REPUTATION_DELTAS: {
92
- /** Successfully resolved market without challenge */
93
- readonly successfulResolution: 5;
94
- /** Resolution upheld after challenge */
95
- readonly upheldChallenge: 10;
96
- /** Resolution overturned (negative) */
97
- readonly overturnedResolution: -25;
98
- /** Timeout on assigned market (negative) */
99
- readonly timeout: -15;
100
- /** Collusion detected (negative) */
101
- readonly collusion: -100;
102
- /** Protocol violation (negative) */
103
- readonly violation: -20;
104
- /** Bonus for high-value market resolution */
105
- readonly highValueBonus: 3;
106
- };
107
- /**
108
- * Calculate new reputation after an event
109
- *
110
- * @param currentReputation - Current reputation score
111
- * @param delta - Reputation change (positive or negative)
112
- * @param minReputation - Minimum reputation floor (default 0)
113
- * @returns New reputation score
114
- */
115
- export declare function calculateReputation(currentReputation: number, delta: number, minReputation?: number): number;
116
- /**
117
- * Calculate weighted reputation considering history
118
- *
119
- * @param baseReputation - Current base reputation
120
- * @param successCount - Number of successful resolutions
121
- * @param failureCount - Number of failed/overturned resolutions
122
- * @returns Weighted reputation score
123
- */
124
- export declare function calculateWeightedReputation(baseReputation: number, successCount: number, failureCount: number): number;
125
- /**
126
- * Check if oracle qualifies for high-value markets
127
- */
128
- export declare function qualifiesForHighValue(reputation: number, stake: bigint, threshold?: number, minStakeMultiplier?: number): boolean;
129
- /**
130
- * Slashing condition definition
131
- */
132
- export interface SlashingCondition {
133
- reason: SlashingReason;
134
- slashPercent: number;
135
- description: string;
136
- appealable: boolean;
137
- suspensionEpochs: number;
138
- }
139
- /**
140
- * Predefined slashing conditions
141
- */
142
- export declare const SLASHING_CONDITIONS: Record<SlashingReason, SlashingCondition>;
143
- /**
144
- * Calculate slash amount for a given stake and reason
145
- *
146
- * @param stake - Oracle's current stake
147
- * @param reason - Reason for slashing
148
- * @returns Amount to be slashed
149
- */
150
- export declare function calculateSlashAmount(stake: bigint, reason: SlashingReason): bigint;
151
- /**
152
- * Calculate remaining stake after slashing
153
- */
154
- export declare function calculateStakeAfterSlash(stake: bigint, reason: SlashingReason): bigint;
155
- /**
156
- * Oracle candidate for selection
157
- */
158
- export interface OracleCandidate {
159
- address: string;
160
- reputation: number;
161
- stake: bigint;
162
- activeAssignments: number;
163
- successRate: number;
164
- }
165
- /**
166
- * Calculate oracle selection score
167
- * Higher score = more likely to be selected
168
- *
169
- * @param candidate - Oracle candidate details
170
- * @param marketValue - Value of market to resolve (affects weight for high-value markets)
171
- * @returns Selection score
172
- */
173
- export declare function calculateSelectionScore(candidate: OracleCandidate, marketValue?: bigint): number;
174
- /**
175
- * Calculate oracle reward for successful resolution
176
- *
177
- * @param marketFees - Total fees collected from market
178
- * @param rewardPercent - Oracle's reward percentage (default from config)
179
- * @returns Oracle reward amount
180
- */
181
- export declare function calculateOracleReward(marketFees: bigint, rewardPercent?: number): bigint;
182
- /**
183
- * Check if a value is a valid OracleState
184
- */
185
- export declare function isOracleState(value: unknown): value is OracleState;
186
- /**
187
- * Check if a value is a valid SlashingReason
188
- */
189
- export declare function isSlashingReason(value: unknown): value is SlashingReason;
190
- /**
191
- * Check if a value is a valid ResolutionType
192
- */
193
- export declare function isResolutionType(value: unknown): value is ResolutionType;
@@ -1,274 +0,0 @@
1
- import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
2
- import type { Address } from "../../../v1/common_pb.js";
3
- import type { Timestamp } from "@bufbuild/protobuf/wkt";
4
- import type { JsonObject, Message } from "@bufbuild/protobuf";
5
- /**
6
- * Describes the file ottochain/apps/contracts/v1/contract.proto.
7
- */
8
- export declare const file_ottochain_apps_contracts_v1_contract: GenFile;
9
- /**
10
- * Contract between two agents
11
- *
12
- * @generated from message ottochain.apps.contracts.v1.Contract
13
- */
14
- export type Contract = Message<"ottochain.apps.contracts.v1.Contract"> & {
15
- /**
16
- * @generated from field: string id = 1;
17
- */
18
- id: string;
19
- /**
20
- * Human-readable ID
21
- *
22
- * @generated from field: string contract_id = 2;
23
- */
24
- contractId: string;
25
- /**
26
- * @generated from field: ottochain.v1.Address proposer = 3;
27
- */
28
- proposer?: Address;
29
- /**
30
- * @generated from field: ottochain.v1.Address counterparty = 4;
31
- */
32
- counterparty?: Address;
33
- /**
34
- * @generated from field: ottochain.apps.contracts.v1.ContractState state = 5;
35
- */
36
- state: ContractState;
37
- /**
38
- * Flexible terms structure
39
- *
40
- * @generated from field: google.protobuf.Struct terms = 6;
41
- */
42
- terms?: JsonObject;
43
- /**
44
- * @generated from field: google.protobuf.Timestamp proposed_at = 7;
45
- */
46
- proposedAt?: Timestamp;
47
- /**
48
- * @generated from field: google.protobuf.Timestamp accepted_at = 8;
49
- */
50
- acceptedAt?: Timestamp;
51
- /**
52
- * @generated from field: google.protobuf.Timestamp completed_at = 9;
53
- */
54
- completedAt?: Timestamp;
55
- /**
56
- * Evidence of completion
57
- *
58
- * @generated from field: string completion_proof = 10;
59
- */
60
- completionProof: string;
61
- };
62
- /**
63
- * Describes the message ottochain.apps.contracts.v1.Contract.
64
- * Use `create(ContractSchema)` to create a new message.
65
- */
66
- export declare const ContractSchema: GenMessage<Contract>;
67
- /**
68
- * Propose a new contract
69
- *
70
- * @generated from message ottochain.apps.contracts.v1.ProposeContractRequest
71
- */
72
- export type ProposeContractRequest = Message<"ottochain.apps.contracts.v1.ProposeContractRequest"> & {
73
- /**
74
- * @generated from field: ottochain.v1.Address proposer = 1;
75
- */
76
- proposer?: Address;
77
- /**
78
- * @generated from field: ottochain.v1.Address counterparty = 2;
79
- */
80
- counterparty?: Address;
81
- /**
82
- * @generated from field: google.protobuf.Struct terms = 3;
83
- */
84
- terms?: JsonObject;
85
- /**
86
- * @generated from field: string description = 4;
87
- */
88
- description: string;
89
- };
90
- /**
91
- * Describes the message ottochain.apps.contracts.v1.ProposeContractRequest.
92
- * Use `create(ProposeContractRequestSchema)` to create a new message.
93
- */
94
- export declare const ProposeContractRequestSchema: GenMessage<ProposeContractRequest>;
95
- /**
96
- * Accept a proposed contract
97
- *
98
- * @generated from message ottochain.apps.contracts.v1.AcceptContractRequest
99
- */
100
- export type AcceptContractRequest = Message<"ottochain.apps.contracts.v1.AcceptContractRequest"> & {
101
- /**
102
- * @generated from field: string contract_id = 1;
103
- */
104
- contractId: string;
105
- /**
106
- * @generated from field: ottochain.v1.Address acceptor = 2;
107
- */
108
- acceptor?: Address;
109
- };
110
- /**
111
- * Describes the message ottochain.apps.contracts.v1.AcceptContractRequest.
112
- * Use `create(AcceptContractRequestSchema)` to create a new message.
113
- */
114
- export declare const AcceptContractRequestSchema: GenMessage<AcceptContractRequest>;
115
- /**
116
- * Complete a contract with proof
117
- *
118
- * @generated from message ottochain.apps.contracts.v1.CompleteContractRequest
119
- */
120
- export type CompleteContractRequest = Message<"ottochain.apps.contracts.v1.CompleteContractRequest"> & {
121
- /**
122
- * @generated from field: string contract_id = 1;
123
- */
124
- contractId: string;
125
- /**
126
- * @generated from field: ottochain.v1.Address completer = 2;
127
- */
128
- completer?: Address;
129
- /**
130
- * @generated from field: string proof = 3;
131
- */
132
- proof: string;
133
- };
134
- /**
135
- * Describes the message ottochain.apps.contracts.v1.CompleteContractRequest.
136
- * Use `create(CompleteContractRequestSchema)` to create a new message.
137
- */
138
- export declare const CompleteContractRequestSchema: GenMessage<CompleteContractRequest>;
139
- /**
140
- * Reject a proposed contract
141
- *
142
- * @generated from message ottochain.apps.contracts.v1.RejectContractRequest
143
- */
144
- export type RejectContractRequest = Message<"ottochain.apps.contracts.v1.RejectContractRequest"> & {
145
- /**
146
- * @generated from field: string contract_id = 1;
147
- */
148
- contractId: string;
149
- /**
150
- * @generated from field: ottochain.v1.Address rejector = 2;
151
- */
152
- rejector?: Address;
153
- /**
154
- * @generated from field: string reason = 3;
155
- */
156
- reason: string;
157
- };
158
- /**
159
- * Describes the message ottochain.apps.contracts.v1.RejectContractRequest.
160
- * Use `create(RejectContractRequestSchema)` to create a new message.
161
- */
162
- export declare const RejectContractRequestSchema: GenMessage<RejectContractRequest>;
163
- /**
164
- * Dispute a contract
165
- *
166
- * @generated from message ottochain.apps.contracts.v1.DisputeContractRequest
167
- */
168
- export type DisputeContractRequest = Message<"ottochain.apps.contracts.v1.DisputeContractRequest"> & {
169
- /**
170
- * @generated from field: string contract_id = 1;
171
- */
172
- contractId: string;
173
- /**
174
- * @generated from field: ottochain.v1.Address disputant = 2;
175
- */
176
- disputant?: Address;
177
- /**
178
- * @generated from field: string evidence = 3;
179
- */
180
- evidence: string;
181
- /**
182
- * @generated from field: string reason = 4;
183
- */
184
- reason: string;
185
- };
186
- /**
187
- * Describes the message ottochain.apps.contracts.v1.DisputeContractRequest.
188
- * Use `create(DisputeContractRequestSchema)` to create a new message.
189
- */
190
- export declare const DisputeContractRequestSchema: GenMessage<DisputeContractRequest>;
191
- /**
192
- * Contract state machine definition
193
- *
194
- * Valid transitions:
195
- * PROPOSED -> ACTIVE (accept)
196
- * PROPOSED -> REJECTED (reject)
197
- * PROPOSED -> CANCELLED (cancel)
198
- * ACTIVE -> COMPLETED (complete)
199
- * ACTIVE -> DISPUTED (dispute)
200
- * DISPUTED -> COMPLETED (resolve_for_completer)
201
- * DISPUTED -> REJECTED (resolve_for_disputant)
202
- *
203
- * @generated from message ottochain.apps.contracts.v1.ContractDefinition
204
- */
205
- export type ContractDefinition = Message<"ottochain.apps.contracts.v1.ContractDefinition"> & {
206
- /**
207
- * Both parties must sign completion
208
- *
209
- * @generated from field: bool require_both_signatures = 1;
210
- */
211
- requireBothSignatures: boolean;
212
- /**
213
- * How long after completion disputes allowed
214
- *
215
- * @generated from field: int32 dispute_window_epochs = 2;
216
- */
217
- disputeWindowEpochs: number;
218
- };
219
- /**
220
- * Describes the message ottochain.apps.contracts.v1.ContractDefinition.
221
- * Use `create(ContractDefinitionSchema)` to create a new message.
222
- */
223
- export declare const ContractDefinitionSchema: GenMessage<ContractDefinition>;
224
- /**
225
- * Contract lifecycle states
226
- *
227
- * @generated from enum ottochain.apps.contracts.v1.ContractState
228
- */
229
- export declare enum ContractState {
230
- /**
231
- * @generated from enum value: CONTRACT_STATE_UNSPECIFIED = 0;
232
- */
233
- UNSPECIFIED = 0,
234
- /**
235
- * Awaiting counterparty acceptance
236
- *
237
- * @generated from enum value: CONTRACT_STATE_PROPOSED = 1;
238
- */
239
- PROPOSED = 1,
240
- /**
241
- * Both parties agreed, in progress
242
- *
243
- * @generated from enum value: CONTRACT_STATE_ACTIVE = 2;
244
- */
245
- ACTIVE = 2,
246
- /**
247
- * Successfully fulfilled (terminal)
248
- *
249
- * @generated from enum value: CONTRACT_STATE_COMPLETED = 3;
250
- */
251
- COMPLETED = 3,
252
- /**
253
- * Counterparty declined (terminal)
254
- *
255
- * @generated from enum value: CONTRACT_STATE_REJECTED = 4;
256
- */
257
- REJECTED = 4,
258
- /**
259
- * Under dispute resolution
260
- *
261
- * @generated from enum value: CONTRACT_STATE_DISPUTED = 5;
262
- */
263
- DISPUTED = 5,
264
- /**
265
- * Cancelled by proposer before acceptance (terminal)
266
- *
267
- * @generated from enum value: CONTRACT_STATE_CANCELLED = 6;
268
- */
269
- CANCELLED = 6
270
- }
271
- /**
272
- * Describes the enum ottochain.apps.contracts.v1.ContractState.
273
- */
274
- export declare const ContractStateSchema: GenEnum<ContractState>;