@ottochain/sdk 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/apps/contracts/index.js +15 -8
- package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +35 -40
- package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +80 -37
- package/dist/cjs/apps/contracts/state-machines/contract-universal.js +4 -4
- package/dist/cjs/apps/corporate/index.js +2 -2
- package/dist/cjs/apps/corporate/state-machines/corp-board.js +169 -59
- package/dist/cjs/apps/corporate/state-machines/corp-entity.js +245 -47
- package/dist/cjs/apps/corporate/state-machines/corp-securities.js +407 -99
- package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +151 -37
- package/dist/cjs/apps/governance/index.js +14 -14
- package/dist/cjs/apps/governance/state-machines/dao-multisig.js +58 -40
- package/dist/cjs/apps/governance/state-machines/dao-reputation.js +46 -40
- package/dist/cjs/apps/governance/state-machines/dao-single.js +28 -11
- package/dist/cjs/apps/governance/state-machines/dao-token.js +67 -41
- package/dist/cjs/apps/governance/state-machines/governance-simple.js +93 -61
- package/dist/cjs/apps/governance/state-machines/governance-universal.js +2 -2
- package/dist/cjs/apps/identity/constants.js +55 -14
- package/dist/cjs/apps/identity/index.js +27 -11
- package/dist/cjs/apps/identity/state-machines/identity-agent.js +3 -3
- package/dist/cjs/apps/identity/state-machines/identity-oracle.js +25 -22
- package/dist/cjs/apps/identity/state-machines/identity-registry.js +288 -0
- package/dist/cjs/apps/identity/state-machines/identity-universal.js +3 -3
- package/dist/cjs/apps/identity/state-machines/index.js +3 -1
- package/dist/cjs/apps/index.js +19 -8
- package/dist/cjs/apps/lending/assets.js +223 -0
- package/dist/cjs/apps/lending/credit-scoring.js +87 -0
- package/dist/cjs/apps/lending/eligibility.js +121 -0
- package/dist/cjs/apps/lending/index.js +91 -0
- package/dist/cjs/apps/lending/state-machines/index.js +9 -0
- package/dist/cjs/apps/lending/state-machines/lending-zk-loan.js +412 -0
- package/dist/cjs/apps/markets/index.js +21 -11
- package/dist/cjs/apps/markets/state-machines/market-auction.js +14 -13
- package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +29 -24
- package/dist/cjs/apps/markets/state-machines/market-group-buy.js +24 -26
- package/dist/cjs/apps/markets/state-machines/market-prediction.js +80 -53
- package/dist/cjs/apps/markets/state-machines/market-universal.js +5 -5
- package/dist/cjs/apps/oracles/index.js +2 -2
- package/dist/cjs/errors.js +3 -3
- package/dist/cjs/generated/google/protobuf/struct.js +4 -4
- package/dist/cjs/generated/index.js +11 -7
- package/dist/cjs/generated/openapi.js +6 -0
- package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +50 -50
- package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +19 -20
- package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +13 -13
- package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +4 -4
- package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +124 -130
- package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +107 -107
- package/dist/cjs/generated/ottochain/v1/common.js +4 -4
- package/dist/cjs/generated/ottochain/v1/fiber.js +4 -4
- package/dist/cjs/index.js +41 -7
- package/dist/cjs/openapi.js +2 -0
- package/dist/cjs/ottochain/drop-nulls.js +1 -2
- package/dist/cjs/ottochain/genesis-manifest.js +11 -11
- package/dist/cjs/ottochain/index.js +23 -13
- package/dist/cjs/ottochain/metagraph-client.js +65 -8
- package/dist/cjs/ottochain/snapshot.js +11 -12
- package/dist/cjs/ottochain/transaction.js +57 -14
- package/dist/cjs/ottochain/types.js +16 -2
- package/dist/cjs/privacy/index.js +14 -0
- package/dist/cjs/privacy/sealed-bid.js +210 -0
- package/dist/cjs/privacy/shield-app.js +131 -0
- package/dist/cjs/schema/effects.js +40 -0
- package/dist/cjs/schema/fiber-app.js +19 -13
- package/dist/cjs/schema/guard-lint.js +352 -0
- package/dist/cjs/schema/guards.js +246 -0
- package/dist/cjs/signing.js +80 -0
- package/dist/cjs/types.js +2 -3
- package/dist/cjs/validation.js +8 -8
- package/dist/cjs/verify.js +9 -4
- package/dist/cjs/zk/commit.js +53 -0
- package/dist/cjs/zk/guard.js +107 -0
- package/dist/cjs/zk/index.js +48 -0
- package/dist/cjs/zk/preimage.js +37 -0
- package/dist/cjs/zk/prover.js +87 -0
- package/dist/cjs/zk/registry.js +62 -0
- package/dist/cjs/zk/types.js +28 -0
- package/dist/cjs/zk/witness.js +19 -0
- package/dist/esm/apps/contracts/index.js +7 -3
- package/dist/esm/apps/contracts/state-machines/contract-agreement.js +35 -40
- package/dist/esm/apps/contracts/state-machines/contract-escrow.js +80 -37
- package/dist/esm/apps/contracts/state-machines/contract-universal.js +4 -4
- package/dist/esm/apps/corporate/state-machines/corp-board.js +169 -59
- package/dist/esm/apps/corporate/state-machines/corp-entity.js +245 -47
- package/dist/esm/apps/corporate/state-machines/corp-securities.js +407 -99
- package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +151 -37
- package/dist/esm/apps/governance/state-machines/dao-multisig.js +58 -40
- package/dist/esm/apps/governance/state-machines/dao-reputation.js +46 -40
- package/dist/esm/apps/governance/state-machines/dao-single.js +28 -11
- package/dist/esm/apps/governance/state-machines/dao-token.js +67 -41
- package/dist/esm/apps/governance/state-machines/governance-simple.js +93 -61
- package/dist/esm/apps/governance/state-machines/governance-universal.js +2 -2
- package/dist/esm/apps/identity/constants.js +51 -12
- package/dist/esm/apps/identity/index.js +12 -7
- package/dist/esm/apps/identity/state-machines/identity-agent.js +3 -3
- package/dist/esm/apps/identity/state-machines/identity-oracle.js +25 -22
- package/dist/esm/apps/identity/state-machines/identity-registry.js +285 -0
- package/dist/esm/apps/identity/state-machines/identity-universal.js +3 -3
- package/dist/esm/apps/identity/state-machines/index.js +1 -0
- package/dist/esm/apps/index.js +1 -0
- package/dist/esm/apps/lending/assets.js +207 -0
- package/dist/esm/apps/lending/credit-scoring.js +81 -0
- package/dist/esm/apps/lending/eligibility.js +115 -0
- package/dist/esm/apps/lending/index.js +69 -0
- package/dist/esm/apps/lending/state-machines/index.js +5 -0
- package/dist/esm/apps/lending/state-machines/lending-zk-loan.js +409 -0
- package/dist/esm/apps/markets/index.js +8 -4
- package/dist/esm/apps/markets/state-machines/market-auction.js +14 -13
- package/dist/esm/apps/markets/state-machines/market-crowdfund.js +29 -24
- package/dist/esm/apps/markets/state-machines/market-group-buy.js +24 -26
- package/dist/esm/apps/markets/state-machines/market-prediction.js +80 -53
- package/dist/esm/apps/markets/state-machines/market-universal.js +5 -5
- package/dist/esm/generated/index.js +9 -5
- package/dist/esm/generated/openapi.js +5 -0
- package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +46 -46
- package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +114 -120
- package/dist/esm/generated/ottochain/apps/markets/v1/market.js +100 -100
- package/dist/esm/index.js +21 -2
- package/dist/esm/openapi.js +1 -0
- package/dist/esm/ottochain/genesis-manifest.js +9 -9
- package/dist/esm/ottochain/index.js +2 -3
- package/dist/esm/ottochain/metagraph-client.js +65 -8
- package/dist/esm/ottochain/snapshot.js +4 -4
- package/dist/esm/ottochain/transaction.js +43 -3
- package/dist/esm/ottochain/types.js +15 -1
- package/dist/esm/privacy/index.js +6 -0
- package/dist/esm/privacy/sealed-bid.js +206 -0
- package/dist/esm/privacy/shield-app.js +127 -0
- package/dist/esm/schema/effects.js +35 -0
- package/dist/esm/schema/fiber-app.js +13 -6
- package/dist/esm/schema/guard-lint.js +346 -0
- package/dist/esm/schema/guards.js +229 -0
- package/dist/esm/signing.js +74 -0
- package/dist/esm/verify.js +8 -2
- package/dist/esm/zk/commit.js +44 -0
- package/dist/esm/zk/guard.js +99 -0
- package/dist/esm/zk/index.js +19 -0
- package/dist/esm/zk/preimage.js +30 -0
- package/dist/esm/zk/prover.js +82 -0
- package/dist/esm/zk/registry.js +55 -0
- package/dist/esm/zk/types.js +25 -0
- package/dist/esm/zk/witness.js +15 -0
- package/dist/types/apps/contracts/index.d.ts +69 -209
- package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +20 -95
- package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +46 -112
- package/dist/types/apps/corporate/index.d.ts +1040 -304
- package/dist/types/apps/corporate/state-machines/corp-board.d.ts +188 -52
- package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +267 -62
- package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +355 -131
- package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +225 -53
- package/dist/types/apps/governance/index.d.ts +296 -398
- package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +77 -92
- package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +42 -66
- package/dist/types/apps/governance/state-machines/dao-single.d.ts +25 -47
- package/dist/types/apps/governance/state-machines/dao-token.d.ts +60 -49
- package/dist/types/apps/governance/state-machines/governance-simple.d.ts +87 -117
- package/dist/types/apps/governance/state-machines/governance-universal.d.ts +2 -2
- package/dist/types/apps/identity/constants.d.ts +32 -4
- package/dist/types/apps/identity/index.d.ts +378 -94
- package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +16 -87
- package/dist/types/apps/identity/state-machines/identity-registry.d.ts +379 -0
- package/dist/types/apps/identity/state-machines/index.d.ts +1 -0
- package/dist/types/apps/index.d.ts +1 -0
- package/dist/types/apps/lending/assets.d.ts +258 -0
- package/dist/types/apps/lending/credit-scoring.d.ts +80 -0
- package/dist/types/apps/lending/eligibility.d.ts +83 -0
- package/dist/types/apps/lending/index.d.ts +548 -0
- package/dist/types/apps/lending/state-machines/index.d.ts +5 -0
- package/dist/types/apps/lending/state-machines/lending-zk-loan.d.ts +528 -0
- package/dist/types/apps/markets/index.d.ts +108 -203
- package/dist/types/apps/markets/state-machines/market-auction.d.ts +13 -37
- package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +16 -34
- package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +17 -43
- package/dist/types/apps/markets/state-machines/market-prediction.d.ts +51 -72
- package/dist/types/apps/markets/state-machines/market-universal.d.ts +5 -5
- package/dist/types/generated/index.d.ts +5 -5
- package/dist/types/generated/openapi.d.ts +1257 -0
- package/dist/types/generated/ottochain/apps/contracts/v1/contract.d.ts +5 -5
- package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +12 -12
- package/dist/types/generated/ottochain/apps/markets/v1/market.d.ts +11 -11
- package/dist/types/index.d.ts +6 -2
- package/dist/types/openapi.d.ts +22 -0
- package/dist/types/ottochain/genesis-manifest.d.ts +5 -5
- package/dist/types/ottochain/index.d.ts +5 -6
- package/dist/types/ottochain/metagraph-client.d.ts +49 -7
- package/dist/types/ottochain/snapshot.d.ts +6 -6
- package/dist/types/ottochain/transaction.d.ts +33 -1
- package/dist/types/ottochain/types.d.ts +335 -30
- package/dist/types/privacy/index.d.ts +6 -0
- package/dist/types/privacy/sealed-bid.d.ts +348 -0
- package/dist/types/privacy/shield-app.d.ts +48 -0
- package/dist/types/schema/effects.d.ts +34 -0
- package/dist/types/schema/fiber-app.d.ts +1 -2
- package/dist/types/schema/guard-lint.d.ts +111 -0
- package/dist/types/schema/guards.d.ts +134 -0
- package/dist/types/signing.d.ts +45 -0
- package/dist/types/validation.d.ts +22 -217
- package/dist/types/verify.d.ts +4 -0
- package/dist/types/zk/commit.d.ts +28 -0
- package/dist/types/zk/guard.d.ts +46 -0
- package/dist/types/zk/index.d.ts +19 -0
- package/dist/types/zk/preimage.d.ts +10 -0
- package/dist/types/zk/prover.d.ts +34 -0
- package/dist/types/zk/registry.d.ts +34 -0
- package/dist/types/zk/types.d.ts +33 -0
- package/dist/types/zk/witness.d.ts +40 -0
- package/package.json +27 -13
- package/dist/cjs/ottochain/normalize.js +0 -186
- package/dist/esm/ottochain/normalize.js +0 -179
- package/dist/types/ottochain/normalize.d.ts +0 -79
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
export declare const protobufPackage = "ottochain.apps.contracts.v1";
|
|
3
3
|
/** Contract lifecycle states */
|
|
4
|
-
export declare enum
|
|
4
|
+
export declare enum State {
|
|
5
5
|
CONTRACT_STATE_UNSPECIFIED = "CONTRACT_STATE_UNSPECIFIED",
|
|
6
6
|
/** CONTRACT_STATE_PROPOSED - Awaiting counterparty acceptance */
|
|
7
7
|
CONTRACT_STATE_PROPOSED = "CONTRACT_STATE_PROPOSED",
|
|
@@ -17,9 +17,9 @@ export declare enum ContractState {
|
|
|
17
17
|
CONTRACT_STATE_CANCELLED = "CONTRACT_STATE_CANCELLED",
|
|
18
18
|
UNRECOGNIZED = "UNRECOGNIZED"
|
|
19
19
|
}
|
|
20
|
-
export declare function
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function
|
|
20
|
+
export declare function stateFromJSON(object: any): State;
|
|
21
|
+
export declare function stateToJSON(object: State): string;
|
|
22
|
+
export declare function stateToNumber(object: State): number;
|
|
23
23
|
/** Contract between two agents */
|
|
24
24
|
export interface Contract {
|
|
25
25
|
id: string;
|
|
@@ -27,7 +27,7 @@ export interface Contract {
|
|
|
27
27
|
contractId: string;
|
|
28
28
|
proposer: string;
|
|
29
29
|
counterparty: string;
|
|
30
|
-
state:
|
|
30
|
+
state: State;
|
|
31
31
|
/** Flexible terms structure */
|
|
32
32
|
terms?: {
|
|
33
33
|
[key: string]: any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
export declare const protobufPackage = "ottochain.apps.identity.v1";
|
|
3
3
|
/** Identity type - determines which state machine variant applies */
|
|
4
|
-
export declare enum
|
|
4
|
+
export declare enum Type {
|
|
5
5
|
IDENTITY_TYPE_UNSPECIFIED = "IDENTITY_TYPE_UNSPECIFIED",
|
|
6
6
|
/** IDENTITY_TYPE_AGENT - AI agent identity */
|
|
7
7
|
IDENTITY_TYPE_AGENT = "IDENTITY_TYPE_AGENT",
|
|
@@ -11,14 +11,14 @@ export declare enum IdentityType {
|
|
|
11
11
|
IDENTITY_TYPE_SERVICE = "IDENTITY_TYPE_SERVICE",
|
|
12
12
|
UNRECOGNIZED = "UNRECOGNIZED"
|
|
13
13
|
}
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
14
|
+
export declare function typeFromJSON(object: any): Type;
|
|
15
|
+
export declare function typeToJSON(object: Type): string;
|
|
16
|
+
export declare function typeToNumber(object: Type): number;
|
|
17
17
|
/**
|
|
18
18
|
* Unified identity lifecycle states
|
|
19
19
|
* Shared across all identity types with type-specific transitions
|
|
20
20
|
*/
|
|
21
|
-
export declare enum
|
|
21
|
+
export declare enum State {
|
|
22
22
|
IDENTITY_STATE_UNSPECIFIED = "IDENTITY_STATE_UNSPECIFIED",
|
|
23
23
|
/** IDENTITY_STATE_UNREGISTERED - Not yet registered (oracle initial) */
|
|
24
24
|
IDENTITY_STATE_UNREGISTERED = "IDENTITY_STATE_UNREGISTERED",
|
|
@@ -40,9 +40,9 @@ export declare enum IdentityState {
|
|
|
40
40
|
IDENTITY_STATE_WITHDRAWN = "IDENTITY_STATE_WITHDRAWN",
|
|
41
41
|
UNRECOGNIZED = "UNRECOGNIZED"
|
|
42
42
|
}
|
|
43
|
-
export declare function
|
|
44
|
-
export declare function
|
|
45
|
-
export declare function
|
|
43
|
+
export declare function stateFromJSON(object: any): State;
|
|
44
|
+
export declare function stateToJSON(object: State): string;
|
|
45
|
+
export declare function stateToNumber(object: State): number;
|
|
46
46
|
/** Platform where identity is linked */
|
|
47
47
|
export declare enum Platform {
|
|
48
48
|
PLATFORM_UNSPECIFIED = "PLATFORM_UNSPECIFIED",
|
|
@@ -90,8 +90,8 @@ export interface Identity {
|
|
|
90
90
|
address: string;
|
|
91
91
|
publicKey: string;
|
|
92
92
|
displayName: string;
|
|
93
|
-
identityType:
|
|
94
|
-
state:
|
|
93
|
+
identityType: Type;
|
|
94
|
+
state: State;
|
|
95
95
|
reputation?: Reputation | undefined;
|
|
96
96
|
/** Staked amount (oracles/services) */
|
|
97
97
|
stake: number;
|
|
@@ -103,7 +103,7 @@ export interface Identity {
|
|
|
103
103
|
updatedAt?: Date | undefined;
|
|
104
104
|
}
|
|
105
105
|
export interface RegisterIdentityRequest {
|
|
106
|
-
identityType:
|
|
106
|
+
identityType: Type;
|
|
107
107
|
address: string;
|
|
108
108
|
displayName: string;
|
|
109
109
|
/** For oracles/services */
|
|
@@ -137,7 +137,7 @@ export interface WithdrawIdentityRequest {
|
|
|
137
137
|
}
|
|
138
138
|
export interface IdentityDefinition {
|
|
139
139
|
/** Configuration for identity state machine */
|
|
140
|
-
identityType:
|
|
140
|
+
identityType: Type;
|
|
141
141
|
/** Default starting reputation */
|
|
142
142
|
initialReputation: number;
|
|
143
143
|
/** Min rep/stake to activate */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
export declare const protobufPackage = "ottochain.apps.markets.v1";
|
|
3
3
|
/** Type of market mechanism */
|
|
4
|
-
export declare enum
|
|
4
|
+
export declare enum Type {
|
|
5
5
|
MARKET_TYPE_UNSPECIFIED = "MARKET_TYPE_UNSPECIFIED",
|
|
6
6
|
/** MARKET_TYPE_PREDICTION - Prediction market for future outcomes */
|
|
7
7
|
MARKET_TYPE_PREDICTION = "MARKET_TYPE_PREDICTION",
|
|
@@ -13,11 +13,11 @@ export declare enum MarketType {
|
|
|
13
13
|
MARKET_TYPE_GROUP_BUY = "MARKET_TYPE_GROUP_BUY",
|
|
14
14
|
UNRECOGNIZED = "UNRECOGNIZED"
|
|
15
15
|
}
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function
|
|
18
|
-
export declare function
|
|
16
|
+
export declare function typeFromJSON(object: any): Type;
|
|
17
|
+
export declare function typeToJSON(object: Type): string;
|
|
18
|
+
export declare function typeToNumber(object: Type): number;
|
|
19
19
|
/** Market lifecycle states */
|
|
20
|
-
export declare enum
|
|
20
|
+
export declare enum State {
|
|
21
21
|
MARKET_STATE_UNSPECIFIED = "MARKET_STATE_UNSPECIFIED",
|
|
22
22
|
/** MARKET_STATE_PROPOSED - Market created, awaiting activation */
|
|
23
23
|
MARKET_STATE_PROPOSED = "MARKET_STATE_PROPOSED",
|
|
@@ -35,9 +35,9 @@ export declare enum MarketState {
|
|
|
35
35
|
MARKET_STATE_CANCELLED = "MARKET_STATE_CANCELLED",
|
|
36
36
|
UNRECOGNIZED = "UNRECOGNIZED"
|
|
37
37
|
}
|
|
38
|
-
export declare function
|
|
39
|
-
export declare function
|
|
40
|
-
export declare function
|
|
38
|
+
export declare function stateFromJSON(object: any): State;
|
|
39
|
+
export declare function stateToJSON(object: State): string;
|
|
40
|
+
export declare function stateToNumber(object: State): number;
|
|
41
41
|
/** Agent commitment to a market position */
|
|
42
42
|
export interface Commitment {
|
|
43
43
|
/** Committing agent's address */
|
|
@@ -67,7 +67,7 @@ export interface Market {
|
|
|
67
67
|
/** Unique market identifier */
|
|
68
68
|
id: string;
|
|
69
69
|
/** Type of market mechanism */
|
|
70
|
-
marketType:
|
|
70
|
+
marketType: Type;
|
|
71
71
|
/** Market creator's address */
|
|
72
72
|
creator: string;
|
|
73
73
|
/** Human-readable market title */
|
|
@@ -89,7 +89,7 @@ export interface Market {
|
|
|
89
89
|
/** Oracle resolution submissions */
|
|
90
90
|
resolutions: Resolution[];
|
|
91
91
|
/** Current market state */
|
|
92
|
-
status:
|
|
92
|
+
status: State;
|
|
93
93
|
/** Market creation timestamp */
|
|
94
94
|
createdAt?: Date | undefined;
|
|
95
95
|
/** Last state update timestamp */
|
|
@@ -97,7 +97,7 @@ export interface Market {
|
|
|
97
97
|
}
|
|
98
98
|
/** Create a new market */
|
|
99
99
|
export interface CreateMarketRequest {
|
|
100
|
-
marketType:
|
|
100
|
+
marketType: Type;
|
|
101
101
|
creator: string;
|
|
102
102
|
title: string;
|
|
103
103
|
terms?: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,18 +17,22 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export * from '@constellation-network/metagraph-sdk';
|
|
19
19
|
export { verify } from './verify.js';
|
|
20
|
+
export { signDataUpdate, createSignedObject, addSignature, batchSign } from './signing.js';
|
|
20
21
|
export { MetagraphClient, createMetagraphClient, HttpClient, NetworkError as MetagraphNetworkError, } from '@constellation-network/metagraph-sdk/network';
|
|
21
22
|
export type { MetagraphClientConfig as BaseMetagraphClientConfig, LayerType, ClusterInfo, } from '@constellation-network/metagraph-sdk/network';
|
|
22
23
|
export type { RequestOptions, TransactionStatus, PendingTransaction, PostTransactionResponse, EstimateFeeResponse, PostDataResponse, } from '@constellation-network/metagraph-sdk/network';
|
|
23
24
|
export * from './types.js';
|
|
24
25
|
export * from './ottochain/transaction.js';
|
|
25
|
-
export { normalizeCreateStateMachine, normalizeTransitionStateMachine, normalizeArchiveStateMachine, normalizeMessage } from './ottochain/normalize.js';
|
|
26
26
|
export { dropNulls } from './ottochain/drop-nulls.js';
|
|
27
27
|
export { buildGenesisManifest, GENESIS_MANIFEST_VERSION } from './ottochain/genesis-manifest.js';
|
|
28
|
-
export type { GenesisManifest, GenesisPackage,
|
|
28
|
+
export type { GenesisManifest, GenesisPackage, GenesisMachineShape, GenesisMessageShape, GenesisFieldShape, GenesisStateMachineDefinition, } from './ottochain/index.js';
|
|
29
29
|
export * from './generated/index.js';
|
|
30
30
|
export { OttoChainError, NetworkError, ValidationError, SigningError, TransactionError, ErrorCode, isErrorCode, wrapError, } from './errors.js';
|
|
31
31
|
export { DagAddressSchema, PrivateKeySchema, PublicKeySchema, KeyPairSchema, SignatureProofSchema, SignedSchema, TransactionReferenceSchema, CurrencyTransactionValueSchema, CurrencyTransactionSchema, TransferParamsSchema, AgentIdentityRegistrationSchema, PlatformLinkSchema, ContractTermsSchema, ProposeContractRequestSchema, AcceptContractRequestSchema, CompleteContractRequestSchema, validate, validatePrivateKey, validatePublicKey, validateAddress, validateKeyPair, safeParse, assert, type ValidatedKeyPair, type ValidatedSignatureProof, type ValidatedCurrencyTransaction, type ValidatedTransferParams, type ValidatedAgentIdentityRegistration, type ValidatedPlatformLink, type ValidatedProposeContractRequest, type ValidatedAcceptContractRequest, type ValidatedCompleteContractRequest, } from './validation.js';
|
|
32
32
|
export { MetagraphClient as OttoMetagraphClient } from './ottochain/metagraph-client.js';
|
|
33
33
|
export type { MetagraphClientConfig, Checkpoint, SubscribeOptions, FiberStateCallback, Unsubscribe, } from './ottochain/metagraph-client.js';
|
|
34
34
|
export { toProtoDefinition, defineFiberApp, type ProtoStateMachineDefinition, type FiberAppDefinition, type FiberAppMetadata, type StateDefinition, type StdStateMetadata, type StateCategory, type Transition, } from './schema/fiber-app.js';
|
|
35
|
+
export { type GuardRule, signerIsParty, signerIsAnyParty, signerInSet, signerIsNotParty, signerHasEntry, assetSignerIs, actorIsSigner, actorInSet, actorHasEntry, signerHasReputation, signerHasRole, signerHasReputationVia, signerHasRoleVia, depInState, } from './schema/guards.js';
|
|
36
|
+
export { addDependency, setDependencyActive } from './schema/effects.js';
|
|
37
|
+
export { shieldApp, SHIELDED_POOL_STATE, type ShieldOptions } from './privacy/shield-app.js';
|
|
38
|
+
export type { paths as ApiPaths, operations as ApiOperations, components as ApiComponents, VersionInfo, TransitionFeeEstimate, ScriptFeeEstimate, SubscribeRequest, SubscribeResponse, Subscriber, SubscriberList, } from './openapi.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed OttoChain HTTP API surface.
|
|
3
|
+
*
|
|
4
|
+
* These types are generated from the metagraph's OpenAPI contract
|
|
5
|
+
* (`openapi/ottochain-openapi.json`, emitted by ottochain's tapir `ApiEndpoints`) — so the SDK and the
|
|
6
|
+
* chain share ONE source of truth for request/response shapes, instead of reverse-engineering them inline.
|
|
7
|
+
*
|
|
8
|
+
* Regenerate after the contract changes with `pnpm gen:openapi`. The raw generated module is
|
|
9
|
+
* `src/generated/openapi.ts`; this file gives consumers stable, named aliases for the precise response
|
|
10
|
+
* DTOs. Heavy domain bodies (onchain, checkpoint, records, state proofs) are typed `unknown`/opaque in
|
|
11
|
+
* the contract for now — see ottochain `docs/proposals/typed-network-interface.md` §3.
|
|
12
|
+
*/
|
|
13
|
+
import type { components, operations, paths } from './generated/openapi.js';
|
|
14
|
+
export type { components, operations, paths };
|
|
15
|
+
type Schemas = components['schemas'];
|
|
16
|
+
export type VersionInfo = Schemas['VersionInfo'];
|
|
17
|
+
export type TransitionFeeEstimate = Schemas['TransitionFeeEstimate'];
|
|
18
|
+
export type ScriptFeeEstimate = Schemas['ScriptFeeEstimate'];
|
|
19
|
+
export type SubscribeRequest = Schemas['SubscribeRequest'];
|
|
20
|
+
export type SubscribeResponse = Schemas['SubscribeResponse'];
|
|
21
|
+
export type Subscriber = Schemas['Subscriber'];
|
|
22
|
+
export type SubscriberList = Schemas['SubscriberList'];
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* package at genesis.
|
|
10
10
|
*
|
|
11
11
|
* DESIGN — content, not consensus hashes:
|
|
12
|
-
* The manifest ships CONTENT only: the `
|
|
12
|
+
* The manifest ships CONTENT only: the `machineShape` (the typed, proto-faithful
|
|
13
13
|
* projection of the app's state message) and the `definition` (the JSON-Logic
|
|
14
14
|
* `StateMachineDefinition`, verbatim — the same object the chain decodes for any
|
|
15
15
|
* fiber). The CHAIN computes the consensus values itself from this content:
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* payloads. Deriving per-event command shapes is a flagged follow-up.
|
|
38
38
|
*
|
|
39
39
|
* The JSON shape emitted here is built to deserialize against the chain's circe
|
|
40
|
-
* codecs (`
|
|
40
|
+
* codecs (`MachineShape` / `FieldShape` / `MessageShape` and
|
|
41
41
|
* `StateMachineDefinition`), whose magnolia config is camelCase with defaults.
|
|
42
42
|
*
|
|
43
43
|
* @packageDocumentation
|
|
@@ -61,10 +61,10 @@ export interface MessageShape {
|
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* The typed, proto-faithful projection of a registered schema. Matches the
|
|
64
|
-
* chain's `
|
|
64
|
+
* chain's `MachineShape`: the state message plus one message per command/event,
|
|
65
65
|
* keyed by event name.
|
|
66
66
|
*/
|
|
67
|
-
export interface
|
|
67
|
+
export interface MachineShape {
|
|
68
68
|
stateMessage: MessageShape;
|
|
69
69
|
commands: Record<string, MessageShape>;
|
|
70
70
|
}
|
|
@@ -106,7 +106,7 @@ export interface GenesisPackage {
|
|
|
106
106
|
/** Free-form notes map (<=8 entries, key <=32 chars, value <=128 chars). */
|
|
107
107
|
metadata: Record<string, string>;
|
|
108
108
|
/** Typed, proto-faithful projection of the app's schema. */
|
|
109
|
-
|
|
109
|
+
machineShape: MachineShape;
|
|
110
110
|
/** The JSON-Logic state-machine definition, verbatim. */
|
|
111
111
|
definition: StateMachineDefinition;
|
|
112
112
|
}
|
|
@@ -6,15 +6,14 @@
|
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
8
|
export * as proto from '../generated/index.js';
|
|
9
|
-
export type { Address, FiberId, StateId, HashValue, FiberOrdinal, SnapshotOrdinal, JsonLogicValue, JsonLogicExpression, FiberStatus, AccessControlPolicy, StateMachineDefinition, SemVer, RegistryStatus, VersionReq, SchemaRef, FieldShape, MessageShape,
|
|
10
|
-
export { OTTOCHAIN_MESSAGE_TYPES } from './types.js';
|
|
9
|
+
export type { Address, FiberId, StateId, HashValue, FiberOrdinal, SnapshotOrdinal, JsonLogicValue, JsonLogicExpression, FiberStatus, AccessControlPolicy, StateMachineDefinition, SemVer, RegistryStatus, VersionReq, SchemaRef, FieldShape, MessageShape, MachineShape, ScriptShape, RegistryShape, SchemaBinding, RegisteredVersion, VersionLineage, RegistryTarget, RegistryEntry, EmittedEvent, EventReceipt, ScriptInvocation, CreationReceipt, UpgradeReceipt, RejectionReceipt, FiberLogEntry, StateMachineFiberRecord, ScriptFiberRecord, FiberRecord, FiberCommit, OnChain, CalculatedState, CreateStateMachine, TransitionStateMachine, ArchiveStateMachine, UpgradeFiber, CreateScript, InvokeScript, UpgradeScript, PublishMachineVersion, PublishScriptVersion, SetVersionStatus, RegisterAlias, CreateAssetPolicy, MintAsset, ApplyMorphism, AuthorizeCompose, OttochainMessage, OttochainMessageType, MorphismKind, MorphismVisibility, TokenBehavior, SupplyPolicy, MorphismSpec, AssetHolder, OriginProvenance, ComponentWitness, AssetRecord, AssetCommit, } from './types.js';
|
|
10
|
+
export { OTTOCHAIN_MESSAGE_TYPES, TOKEN_BEHAVIOR_BITS } from './types.js';
|
|
11
11
|
export type { CurrencySnapshotResponse } from './snapshot.js';
|
|
12
12
|
export { decodeOnChainState, getSnapshotOnChainState, getLatestOnChainState, getLogsForFiber, getEventReceipts, getScriptInvocations, extractOnChainState, } from './snapshot.js';
|
|
13
|
-
export type { Checkpoint, MetagraphClientConfig, SubscribeOptions, FiberStateCallback, Unsubscribe, } from './metagraph-client.js';
|
|
13
|
+
export type { Checkpoint, StateProof, FeeEstimate, MetagraphClientConfig, SubscribeOptions, FiberStateCallback, Unsubscribe, } from './metagraph-client.js';
|
|
14
14
|
export { MetagraphClient } from './metagraph-client.js';
|
|
15
|
-
export { createTransitionPayload, createArchivePayload, createInvokeScriptPayload, signTransaction, addTransactionSignature, getPublicKeyForRegistration, createStateMachinePayload, createScriptPayload, createDataTransactionRequest, } from './transaction.js';
|
|
15
|
+
export { createTransitionPayload, createArchivePayload, createInvokeScriptPayload, signTransaction, addTransactionSignature, getPublicKeyForRegistration, createStateMachinePayload, createScriptPayload, createDataTransactionRequest, createAssetPolicyPayload, createMintAssetPayload, createApplyMorphismPayload, createAuthorizeComposePayload, } from './transaction.js';
|
|
16
16
|
export type { CreateStateMachineParams, CreateStateMachineMessage, CreateScriptParams, CreateScriptMessage, DataTransactionRequest, TransitionParams, TransitionStateMachineMessage, ArchiveParams, ArchiveStateMachineMessage, InvokeScriptParams, InvokeScriptMessage, } from './transaction.js';
|
|
17
|
-
export { normalizeCreateStateMachine, normalizeTransitionStateMachine, normalizeArchiveStateMachine, normalizeMessage, } from './normalize.js';
|
|
18
17
|
export { dropNulls } from './drop-nulls.js';
|
|
19
18
|
export { buildGenesisManifest, GENESIS_MANIFEST_VERSION } from './genesis-manifest.js';
|
|
20
|
-
export type { GenesisManifest, GenesisPackage,
|
|
19
|
+
export type { GenesisManifest, GenesisPackage, MachineShape as GenesisMachineShape, MessageShape as GenesisMessageShape, FieldShape as GenesisFieldShape, StateMachineDefinition as GenesisStateMachineDefinition, } from './genesis-manifest.js';
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* Client for interacting with ottochain ML0 custom routes (/v1 prefix)
|
|
5
5
|
* and framework snapshot endpoints.
|
|
6
6
|
*
|
|
7
|
-
* @see modules/l0/src/main/scala/xyz/kd5ujc/metagraph_l0/
|
|
7
|
+
* @see modules/l0/src/main/scala/xyz/kd5ujc/metagraph_l0/ML0Routes.scala
|
|
8
8
|
* @see modules/data_l1/src/main/scala/xyz/kd5ujc/data_l1/DataL1CustomRoutes.scala
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
11
|
import type { Signed } from '@constellation-network/metagraph-sdk';
|
|
12
|
-
import type { OnChain, CalculatedState, StateMachineFiberRecord, ScriptFiberRecord, EventReceipt,
|
|
12
|
+
import type { OnChain, CalculatedState, StateMachineFiberRecord, ScriptFiberRecord, EventReceipt, ScriptInvocation, FiberStatus, RegistryEntry } from './types.js';
|
|
13
13
|
/**
|
|
14
14
|
* Checkpoint response from the metagraph (ordinal + calculated state).
|
|
15
15
|
*/
|
|
@@ -17,6 +17,28 @@ export interface Checkpoint {
|
|
|
17
17
|
ordinal: number;
|
|
18
18
|
state: CalculatedState;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* A light-client state proof for one field of a fiber/asset record, verifiable against the
|
|
22
|
+
* consensus-signed committed-state root (Merkle-Patricia inclusion). Returned by the `state-proof`
|
|
23
|
+
* endpoints.
|
|
24
|
+
*/
|
|
25
|
+
export interface StateProof {
|
|
26
|
+
/** The record (or projected field) the proof attests to. */
|
|
27
|
+
record: unknown;
|
|
28
|
+
/** The committed-state combined root (= the snapshot's `calculatedStateProof`). */
|
|
29
|
+
committedRoot: string;
|
|
30
|
+
/** The Merkle-Patricia trie root. */
|
|
31
|
+
mptRoot: string;
|
|
32
|
+
ordinal: number;
|
|
33
|
+
/** The Merkle-Patricia inclusion proof. */
|
|
34
|
+
proof: unknown;
|
|
35
|
+
}
|
|
36
|
+
/** A fee/gas estimate for a transition or script invocation (shape is advisory / may evolve). */
|
|
37
|
+
export interface FeeEstimate {
|
|
38
|
+
gas?: number;
|
|
39
|
+
fee?: number;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
20
42
|
/**
|
|
21
43
|
* Options for subscribeFiberState polling behaviour.
|
|
22
44
|
*/
|
|
@@ -86,7 +108,7 @@ export interface MetagraphClientConfig {
|
|
|
86
108
|
* const onChain = await client.getOnChain();
|
|
87
109
|
*
|
|
88
110
|
* // Get all active state machines
|
|
89
|
-
* const machines = await client.getStateMachines('
|
|
111
|
+
* const machines = await client.getStateMachines('ACTIVE');
|
|
90
112
|
*
|
|
91
113
|
* // Get event receipts for a fiber
|
|
92
114
|
* const events = await client.getStateMachineEvents(fiberId);
|
|
@@ -118,17 +140,37 @@ export declare class MetagraphClient {
|
|
|
118
140
|
*/
|
|
119
141
|
getStateMachineEvents(fiberId: string): Promise<EventReceipt[]>;
|
|
120
142
|
/**
|
|
121
|
-
* Get all
|
|
143
|
+
* Get all scripts, optionally filtered by status.
|
|
122
144
|
*/
|
|
123
145
|
getScripts(status?: FiberStatus): Promise<Record<string, ScriptFiberRecord>>;
|
|
124
146
|
/**
|
|
125
|
-
* Get a single script
|
|
147
|
+
* Get a single script by fiber ID.
|
|
126
148
|
*/
|
|
127
149
|
getScript(scriptId: string): Promise<ScriptFiberRecord | null>;
|
|
128
150
|
/**
|
|
129
|
-
* Get
|
|
151
|
+
* Get script invocations from the current ordinal's logs.
|
|
130
152
|
*/
|
|
131
|
-
getScriptInvocations(scriptId: string): Promise<
|
|
153
|
+
getScriptInvocations(scriptId: string): Promise<ScriptInvocation[]>;
|
|
154
|
+
/** Get the metagraph version string. */
|
|
155
|
+
getVersion(): Promise<string>;
|
|
156
|
+
/** Get the full registry namespace, keyed by full registry name `labels.tld`. */
|
|
157
|
+
getRegistry(): Promise<Record<string, RegistryEntry>>;
|
|
158
|
+
/** Resolve a single registry entry by full name (`labels.tld`), or null if unregistered. */
|
|
159
|
+
getRegistryEntry(name: string): Promise<RegistryEntry | null>;
|
|
160
|
+
/** Reverse-resolve a fiber UUID to its canonical registered name (#29), or null. */
|
|
161
|
+
getReverseName(fiberId: string): Promise<string | null>;
|
|
162
|
+
/** Get the rendered audit-trail lines for a state-machine fiber. */
|
|
163
|
+
getStateMachineAudit(fiberId: string): Promise<string[]>;
|
|
164
|
+
/** Light-client state proof for a field of a state-machine fiber, against the committed root. */
|
|
165
|
+
getStateMachineStateProof(fiberId: string, field: string): Promise<StateProof>;
|
|
166
|
+
/** Light-client state proof for a field of a script fiber. */
|
|
167
|
+
getScriptStateProof(fiberId: string, field: string): Promise<StateProof>;
|
|
168
|
+
/** Light-client state proof for a field of an asset instance. */
|
|
169
|
+
getAssetStateProof(assetId: string, field: string): Promise<StateProof>;
|
|
170
|
+
/** Estimate the fee/gas for a transition event on a state-machine fiber. */
|
|
171
|
+
estimateTransitionFee(fiberId: string, eventName: string): Promise<FeeEstimate>;
|
|
172
|
+
/** Estimate the fee/gas for invoking a script fiber. */
|
|
173
|
+
estimateScriptFee(fiberId: string): Promise<FeeEstimate>;
|
|
132
174
|
/**
|
|
133
175
|
* Get the latest snapshot and decode its on-chain state.
|
|
134
176
|
*/
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @see modules/models/src/main/scala/xyz/kd5ujc/schema/OnChain.scala
|
|
10
10
|
* @packageDocumentation
|
|
11
11
|
*/
|
|
12
|
-
import type { OnChain, EventReceipt,
|
|
12
|
+
import type { OnChain, EventReceipt, ScriptInvocation, FiberLogEntry } from './types.js';
|
|
13
13
|
/**
|
|
14
14
|
* Decode on-chain state from binary (JsonBinaryCodec format).
|
|
15
15
|
*
|
|
@@ -65,7 +65,7 @@ export declare function getLogsForFiber(onChain: OnChain, fiberId: string): Fibe
|
|
|
65
65
|
/**
|
|
66
66
|
* Get EventReceipt log entries for a specific fiber.
|
|
67
67
|
*
|
|
68
|
-
* EventReceipts are distinguished from
|
|
68
|
+
* EventReceipts are distinguished from ScriptInvocations by the presence
|
|
69
69
|
* of the `eventName` field.
|
|
70
70
|
*
|
|
71
71
|
* @param onChain - Decoded on-chain state
|
|
@@ -74,13 +74,13 @@ export declare function getLogsForFiber(onChain: OnChain, fiberId: string): Fibe
|
|
|
74
74
|
*/
|
|
75
75
|
export declare function getEventReceipts(onChain: OnChain, fiberId: string): EventReceipt[];
|
|
76
76
|
/**
|
|
77
|
-
* Get
|
|
77
|
+
* Get ScriptInvocation log entries for a specific fiber.
|
|
78
78
|
*
|
|
79
|
-
*
|
|
79
|
+
* ScriptInvocations are distinguished from EventReceipts by the presence
|
|
80
80
|
* of the `method` field.
|
|
81
81
|
*
|
|
82
82
|
* @param onChain - Decoded on-chain state
|
|
83
83
|
* @param fiberId - Fiber UUID to filter by
|
|
84
|
-
* @returns Array of
|
|
84
|
+
* @returns Array of ScriptInvocation entries
|
|
85
85
|
*/
|
|
86
|
-
export declare function getScriptInvocations(onChain: OnChain, fiberId: string):
|
|
86
|
+
export declare function getScriptInvocations(onChain: OnChain, fiberId: string): ScriptInvocation[];
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* self-signed mode, where clients sign their own transactions.
|
|
6
6
|
*/
|
|
7
7
|
import type { Signed } from '@constellation-network/metagraph-sdk';
|
|
8
|
+
import type { CreateAssetPolicy, MintAsset, ApplyMorphism, AuthorizeCompose } from './types.js';
|
|
8
9
|
/**
|
|
9
10
|
* Parameters for creating a new state machine fiber
|
|
10
11
|
*/
|
|
@@ -28,6 +29,13 @@ export interface CreateStateMachineMessage {
|
|
|
28
29
|
/**
|
|
29
30
|
* Create a new state machine fiber payload.
|
|
30
31
|
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* `params.definition` is signed VERBATIM. Pass the output of `toProtoDefinition(def)` (the
|
|
34
|
+
* allowlisted wire shape) — NOT a raw `FiberAppDefinition`: extra authoring fields
|
|
35
|
+
* (`createSchema` / `stateSchema` / `eventSchemas` / per-transition `emits`) would be signed
|
|
36
|
+
* but re-encoded away by the chain, diverging the canonical → opaque `InvalidSignature`.
|
|
37
|
+
* See `tests/ottochain/signing-parity.test.ts`.
|
|
38
|
+
*
|
|
31
39
|
* @param params - State machine creation parameters
|
|
32
40
|
* @returns A CreateStateMachine message ready for signing
|
|
33
41
|
*
|
|
@@ -145,7 +153,7 @@ export interface CreateScriptMessage {
|
|
|
145
153
|
* },
|
|
146
154
|
* },
|
|
147
155
|
* initialState: { value: 0 },
|
|
148
|
-
* accessControl: {
|
|
156
|
+
* accessControl: { Public: {} },
|
|
149
157
|
* });
|
|
150
158
|
* const signed = await signTransaction(script, privateKey);
|
|
151
159
|
* ```
|
|
@@ -178,12 +186,33 @@ export interface InvokeScriptMessage {
|
|
|
178
186
|
* @returns An InvokeScript message ready for signing
|
|
179
187
|
*/
|
|
180
188
|
export declare function createInvokeScriptPayload(params: InvokeScriptParams): InvokeScriptMessage;
|
|
189
|
+
/** Wrap a {@link CreateAssetPolicy} (publish an asset-policy package version). */
|
|
190
|
+
export declare function createAssetPolicyPayload(params: CreateAssetPolicy): {
|
|
191
|
+
CreateAssetPolicy: CreateAssetPolicy;
|
|
192
|
+
};
|
|
193
|
+
/** Wrap a {@link MintAsset} (mint a new asset instance against a resolved policy version). */
|
|
194
|
+
export declare function createMintAssetPayload(params: MintAsset): {
|
|
195
|
+
MintAsset: MintAsset;
|
|
196
|
+
};
|
|
197
|
+
/** Wrap an {@link ApplyMorphism} (apply a typed morphism to an asset instance). */
|
|
198
|
+
export declare function createApplyMorphismPayload(params: ApplyMorphism): {
|
|
199
|
+
ApplyMorphism: ApplyMorphism;
|
|
200
|
+
};
|
|
201
|
+
/** Wrap an {@link AuthorizeCompose} (commit half of the symmetric-compose handshake). */
|
|
202
|
+
export declare function createAuthorizeComposePayload(params: AuthorizeCompose): {
|
|
203
|
+
AuthorizeCompose: AuthorizeCompose;
|
|
204
|
+
};
|
|
181
205
|
/**
|
|
182
206
|
* Sign a transaction payload for self-signed mode.
|
|
183
207
|
*
|
|
184
208
|
* This creates a Signed<T> object with the exact format expected by the bridge's
|
|
185
209
|
* `/agent/transition` endpoint when using self-signed mode.
|
|
186
210
|
*
|
|
211
|
+
* The signature is computed over the null-dropped canonical bytes (null
|
|
212
|
+
* object fields removed recursively, array nulls preserved, then RFC 8785),
|
|
213
|
+
* matching metakit's content-hash rule. Explicit-null and absent optional
|
|
214
|
+
* fields therefore produce identical signatures.
|
|
215
|
+
*
|
|
187
216
|
* @param message - The message to sign (e.g., from createTransitionPayload)
|
|
188
217
|
* @param privateKey - The private key in hex format (64 characters)
|
|
189
218
|
* @returns A signed object ready for submission to the bridge
|
|
@@ -251,6 +280,9 @@ export declare function createDataTransactionRequest<T>(signed: Signed<T>): Data
|
|
|
251
280
|
* Use this for multi-signature scenarios where multiple parties
|
|
252
281
|
* need to sign the same transaction.
|
|
253
282
|
*
|
|
283
|
+
* The new signature is computed over the null-dropped canonical bytes,
|
|
284
|
+
* matching metakit's content-hash rule (see {@link signTransaction}).
|
|
285
|
+
*
|
|
254
286
|
* @param signed - The already-signed transaction
|
|
255
287
|
* @param privateKey - Additional signer's private key
|
|
256
288
|
* @returns Transaction with additional signature
|