@ocap/types 1.31.0 → 1.31.2

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.
@@ -53,6 +53,10 @@ export interface ITxGasConfig extends Omit<TTxGasConfig, 'minStake' | 'maxStake'
53
53
  maxFreeGasTxSize?: number;
54
54
  /** Max state ops eligible for the Stake-for-Gas waiver (default 6) */
55
55
  maxFreeGasStateOps?: number;
56
+ /**
57
+ * Also bind third-party gas sponsors to the everyday-type allowlist (default false).
58
+ * Direct-gas tx types bind sponsors regardless of this switch (#1420).
59
+ */
56
60
  enforceSponsor3DEligibility?: boolean;
57
61
  /** Burst quota sliding window in ms (default 60000) */
58
62
  burstWindowMs?: number;
@@ -119,6 +123,28 @@ export interface ITransactionConfig extends Omit<TTransactionConfig, 'txFee' | '
119
123
  /** Post-execution write-set ceiling (entries) */
120
124
  maxWriteSetSize?: number;
121
125
  security?: ITxSecurityConfig;
126
+ /** Master switch of the OCAP/Ethereum bridges (bridge/docs/ocap-protocols.md §v2.3). Off by default. */
127
+ bridge?: IBridgeSwitchConfig;
128
+ /** Sunset switch for legacy Rollup v1 protocols and their supply mint/burn gate exemption (#1427, #1430). On (`true`) when absent. */
129
+ rollupV1?: IRollupV1SwitchConfig;
130
+ /** Default implicit TTL policy for `exchange_v2` orders that omit `itx.expiredAt` (#1421). */
131
+ exchangeV2?: IExchangeV2Config;
132
+ }
133
+
134
+ /** `transaction.bridge`: whether withdraws into a bridge reserve and releases out of it are accepted at all. */
135
+ export interface IBridgeSwitchConfig {
136
+ enabled: boolean;
137
+ }
138
+
139
+ /** `transaction.rollupV1`: whether legacy Rollup v1 protocols and the `create_rollup_block` supply gate exemption remain enabled. */
140
+ export interface IRollupV1SwitchConfig {
141
+ enabled: boolean;
142
+ }
143
+
144
+ /** `transaction.exchangeV2`: default lifetime (in seconds, derived from millisecond `tx.nonce`) when `itx.expiredAt` is omitted (#1421). */
145
+ export interface IExchangeV2Config {
146
+ /** Default implicit TTL in seconds when `itx.expiredAt` is omitted (default 2592000 = 30 days). */
147
+ defaultTtlSeconds?: number;
122
148
  }
123
149
 
124
150
  /**
@@ -143,6 +169,8 @@ export interface ITokenConfig extends Omit<TForgeToken, 'icon' | 'initialSupply'
143
169
  * Diff from TVaultConfig: all fields optional, added txFees array
144
170
  */
145
171
  export interface IVaultsConfig extends Partial<TVaultConfig> {
172
+ // `bridgeReserve` (proto field 4 of VaultConfig) is deprecated and ignored: every v2 bridge has its own derived
173
+ // reserve (ROLE_BRIDGE_RESERVE, #1505). The proto field stays so old chain-state rows still decode.
146
174
  txFees?: string[];
147
175
  }
148
176
 
@@ -71,6 +71,7 @@ export type {
71
71
  ITransactionConfig,
72
72
  ITokenConfig,
73
73
  IVaultsConfig,
74
+ IBridgeSwitchConfig,
74
75
  IConsensusConfig,
75
76
  // Composite types
76
77
  IDefaultConfig,
@@ -400,8 +400,26 @@ export interface IImportSegmentOptions {
400
400
  /** Optional expected proposer DID to enforce */
401
401
  expectedProposer?: string;
402
402
 
403
- /** Optional signature verifier callback */
403
+ /**
404
+ * Sequencer/Moderator public key (hex, Uint8Array, or Buffer) — a trust anchor.
405
+ * Unless `allowUnauthenticated: true` is set, either `proposerPublicKey` or `verifier` is required.
406
+ */
407
+ proposerPublicKey?: string | Uint8Array | Buffer;
408
+
409
+ /** Optional signature verifier callback (takes precedence over `proposerPublicKey`) */
404
410
  verifier?: (data: Buffer, signature: string, proposer: string) => Promise<boolean> | boolean;
411
+
412
+ /**
413
+ * Explicitly allow importing an unauthenticated segment without a trusted verifier or commitment signature.
414
+ * Defaults to `false` (unauthenticated segments are rejected by default).
415
+ */
416
+ allowUnauthenticated?: boolean;
417
+
418
+ /**
419
+ * Verify that `checkpoint.stateRoot` matches the segment's derived `stateCommitHash` or `prevCheckpoint.stateRoot` (#1438).
420
+ * Defaults to `true`. Set `false` only when importing legacy synthetic segments whose headers carry an external stateRoot.
421
+ */
422
+ verifyStateRoot?: boolean;
405
423
  }
406
424
 
407
425
  // ============================================================================
@@ -417,7 +435,9 @@ export interface IVerifyTxInclusionParams {
417
435
 
418
436
  /** Ledger entry returned by getLedgerEntry */
419
437
  entry: Pick<ILedgerEntry, 'sequence' | 'hash' | 'txRaw' | 'entryHash' | 'stateCommitHash' | 'finalized'> &
420
- Partial<Pick<ILedgerEntry, 'from' | 'nonce' | 'pk' | 'signature' | 'tx' | 'txType' | 'chainId'>>;
438
+ Partial<Pick<ILedgerEntry, 'from' | 'pk' | 'signature' | 'tx' | 'txType' | 'chainId'>> & {
439
+ nonce?: number | string;
440
+ };
421
441
 
422
442
  /** Merkle inclusion proof returned by getMerkleProof */
423
443
  proof: IMerkleProof;
@@ -229,6 +229,7 @@ export interface IResolverTransaction {
229
229
  code?: string;
230
230
  sender?: string;
231
231
  receiver?: string;
232
+ gasPayer?: string;
232
233
  receipts?: TTransactionReceipt[];
233
234
  tokenSymbols?: ITokenInfo[];
234
235
  accounts?: string[];
@@ -23,10 +23,19 @@ import type {
23
23
  TVariableInput,
24
24
  } from '../lib/type_pb';
25
25
 
26
+ /** Per-revoke accounting entry for stake state (#1352) */
27
+ export interface IStakeRevokeEntry {
28
+ txTime: string;
29
+ tokens?: TokenBalanceMap;
30
+ assets?: string[];
31
+ }
32
+
26
33
  /** Storage format with ISO 8601 string timestamps */
27
34
  export interface IStateContext extends Omit<TStateContext, 'genesisTime' | 'renaissanceTime'> {
28
35
  genesisTime: string;
29
36
  renaissanceTime: string;
37
+ /** Per-revoke accounting keyed by revoke tx hash (#1352) */
38
+ revokes?: Record<string, IStakeRevokeEntry>;
30
39
  }
31
40
 
32
41
  export interface IStateContextInput {
@@ -331,7 +340,8 @@ export interface ITokenFactoryCurve {
331
340
  /** Narrows status to known string literals; uses runtime curve/context/token shapes; data as opaque payload */
332
341
  export interface ITokenFactoryState
333
342
  extends Omit<TTokenFactoryState, 'status' | 'curve' | 'context' | 'token' | 'reserveToken' | 'data'> {
334
- status: 'ACTIVE' | 'PAUSED';
343
+ /** `RETIRED` is terminal: supply and reserve are zero, minting is closed forever (#1422). */
344
+ status: 'ACTIVE' | 'PAUSED' | 'GRADUATED' | 'RETIRED';
335
345
  curve?: ITokenFactoryCurve | null;
336
346
  context: IStateContext;
337
347
  /** Protobuf google.protobuf.Any - structure varies by token factory type */
@@ -129,6 +129,8 @@ export interface IBalanceTable extends IStateTable<IBalanceState> {
129
129
 
130
130
  export interface ITokenTable extends IStateTable<ITokenState> {
131
131
  existBySymbol(symbol: string, context?: IOperationContext): Promisable<boolean>;
132
+ /** Address of the token that owns `symbol` (symbols are unique), or null when no token uses it. */
133
+ getAddressBySymbol(symbol: string, context?: IOperationContext): Promisable<string | null>;
132
134
  }
133
135
 
134
136
  export interface IRollupTable extends IStateTable<IRollupState> {
@@ -48,6 +48,8 @@ export type TAccountFilter = {
48
48
 
49
49
  export type TTxFilter = {
50
50
  txs: Array<string>,
51
+ gasPayer?: string,
52
+ evidences?: Array<string>,
51
53
  }
52
54
 
53
55
  export type TRollupFilter = {
@@ -72,6 +74,7 @@ export type TAddressFilter = {
72
74
  sender: string,
73
75
  receiver: string,
74
76
  direction: DirectionMap[keyof DirectionMap],
77
+ gasPayer?: string,
75
78
  }
76
79
 
77
80
  export type TPageInfo = {
@@ -124,6 +127,7 @@ export type TIndexedTransaction = {
124
127
  code: enum_pb.StatusCodeMap[keyof enum_pb.StatusCodeMap],
125
128
  tokenSymbols: Array<TTokenMeta>,
126
129
  receipts: Array<type_pb.TTransactionReceipt>,
130
+ gasPayer?: string,
127
131
  }
128
132
 
129
133
  export type TIndexedAccountState = {
package/lib/tx_pb.d.ts CHANGED
@@ -401,6 +401,21 @@ export type TBurnTokenTx = {
401
401
  data?: google_protobuf_any_pb.Any,
402
402
  }
403
403
 
404
+ export type TReleaseBridgeTokenTx = {
405
+ kind: number,
406
+ evidence: string,
407
+ ordinal: number,
408
+ to: string,
409
+ amount: string,
410
+ ethChainId: string,
411
+ epoch: number,
412
+ ethSender: string,
413
+ claimSignature: string,
414
+ signatures: Array<string>,
415
+ bridge: string,
416
+ data?: google_protobuf_any_pb.Any,
417
+ }
418
+
404
419
  export type TItxStub = {
405
420
  declare?: TDeclareTx,
406
421
  delegate?: TDelegateTx,
@@ -421,6 +436,7 @@ export type TItxStub = {
421
436
  updateTokenFactory?: TUpdateTokenFactoryTx,
422
437
  mintToken?: TMintTokenTx,
423
438
  burnToken?: TBurnTokenTx,
439
+ releaseBridgeToken?: TReleaseBridgeTokenTx,
424
440
  createFactory?: TCreateFactoryTx,
425
441
  acquireAssetV2?: TAcquireAssetV2Tx,
426
442
  acquireAssetV3?: TAcquireAssetV3Tx,
@@ -464,6 +480,7 @@ export type TItxStub = {
464
480
  UPDATE_TOKEN_FACTORY = 24,
465
481
  MINT_TOKEN = 25,
466
482
  BURN_TOKEN = 26,
483
+ RELEASE_BRIDGE_TOKEN = 27,
467
484
  CREATE_FACTORY = 30,
468
485
  ACQUIRE_ASSET_V2 = 31,
469
486
  ACQUIRE_ASSET_V3 = 32,
package/lib/type_pb.d.ts CHANGED
@@ -192,6 +192,7 @@ export type TVaultConfig = {
192
192
  slashedStake: string,
193
193
  txFee: string,
194
194
  txGas: Array<string>,
195
+ bridgeReserve?: string,
195
196
  }
196
197
 
197
198
  export type TTxFeeConfig = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ocap/types",
3
- "version": "1.31.0",
3
+ "version": "1.31.2",
4
4
  "description": "Typescript definitions generated from protobuf",
5
5
  "keywords": [
6
6
  "ocap",