@ocap/types 1.31.1 → 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.
- package/interfaces/config.ts +28 -0
- package/interfaces/index.ts +1 -0
- package/interfaces/ledger.ts +19 -1
- package/interfaces/state.ts +2 -1
- package/interfaces/statedb.ts +2 -0
- package/lib/trace-type_pb.d.ts +1 -0
- package/lib/tx_pb.d.ts +17 -0
- package/lib/type_pb.d.ts +1 -0
- package/package.json +1 -1
package/interfaces/config.ts
CHANGED
|
@@ -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
|
|
package/interfaces/index.ts
CHANGED
package/interfaces/ledger.ts
CHANGED
|
@@ -400,8 +400,26 @@ export interface IImportSegmentOptions {
|
|
|
400
400
|
/** Optional expected proposer DID to enforce */
|
|
401
401
|
expectedProposer?: string;
|
|
402
402
|
|
|
403
|
-
/**
|
|
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
|
// ============================================================================
|
package/interfaces/state.ts
CHANGED
|
@@ -340,7 +340,8 @@ export interface ITokenFactoryCurve {
|
|
|
340
340
|
/** Narrows status to known string literals; uses runtime curve/context/token shapes; data as opaque payload */
|
|
341
341
|
export interface ITokenFactoryState
|
|
342
342
|
extends Omit<TTokenFactoryState, 'status' | 'curve' | 'context' | 'token' | 'reserveToken' | 'data'> {
|
|
343
|
-
|
|
343
|
+
/** `RETIRED` is terminal: supply and reserve are zero, minting is closed forever (#1422). */
|
|
344
|
+
status: 'ACTIVE' | 'PAUSED' | 'GRADUATED' | 'RETIRED';
|
|
344
345
|
curve?: ITokenFactoryCurve | null;
|
|
345
346
|
context: IStateContext;
|
|
346
347
|
/** Protobuf google.protobuf.Any - structure varies by token factory type */
|
package/interfaces/statedb.ts
CHANGED
|
@@ -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> {
|
package/lib/trace-type_pb.d.ts
CHANGED
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