@ocap/tx-protocols 1.29.4 → 1.29.6
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/esm/execute.d.mts +5 -0
- package/esm/execute.mjs +61 -4
- package/esm/index.d.mts +737 -73
- package/esm/index.mjs +2 -1
- package/esm/pipes/write-ledger.d.mts +73 -0
- package/esm/pipes/write-ledger.mjs +97 -0
- package/esm/protocols/account/delegate.d.mts +52 -1
- package/esm/protocols/account/migrate.d.mts +15 -1
- package/esm/protocols/account/revoke-delegate.d.mts +14 -1
- package/esm/protocols/asset/acquire-v2.d.mts +39 -1
- package/esm/protocols/asset/acquire-v3.d.mts +43 -1
- package/esm/protocols/asset/calls/transfer-token.d.mts +4 -1
- package/esm/protocols/asset/calls/transfer.d.mts +4 -1
- package/esm/protocols/asset/consume.d.mts +14 -1
- package/esm/protocols/asset/create.d.mts +23 -1
- package/esm/protocols/asset/mint.d.mts +28 -1
- package/esm/protocols/asset/update.d.mts +15 -1
- package/esm/protocols/factory/create.d.mts +23 -1
- package/esm/protocols/governance/claim-stake.d.mts +24 -1
- package/esm/protocols/governance/return-stake.d.mts +20 -1
- package/esm/protocols/governance/revoke-stake.d.mts +20 -1
- package/esm/protocols/governance/slash-stake.d.mts +30 -1
- package/esm/protocols/governance/stake.d.mts +27 -1
- package/esm/protocols/rollup/claim-reward.d.mts +57 -1
- package/esm/protocols/rollup/close.d.mts +16 -1
- package/esm/protocols/rollup/create-block.d.mts +42 -1
- package/esm/protocols/rollup/create.d.mts +28 -1
- package/esm/protocols/rollup/join.d.mts +18 -1
- package/esm/protocols/rollup/leave.d.mts +16 -1
- package/esm/protocols/rollup/migrate.d.mts +11 -1
- package/esm/protocols/rollup/pause.d.mts +11 -1
- package/esm/protocols/rollup/resume.d.mts +11 -1
- package/esm/protocols/rollup/update.d.mts +11 -1
- package/esm/protocols/token/create.d.mts +14 -1
- package/esm/protocols/token/deposit-v2.d.mts +23 -1
- package/esm/protocols/token/withdraw-v2.d.mts +33 -1
- package/esm/protocols/token-factory/burn.d.mts +29 -1
- package/esm/protocols/token-factory/create.d.mts +16 -1
- package/esm/protocols/token-factory/mint.d.mts +27 -1
- package/esm/protocols/token-factory/update.d.mts +15 -1
- package/esm/protocols/trade/exchange-v2.d.mts +40 -1
- package/esm/protocols/trade/transfer-v2.d.mts +32 -1
- package/esm/protocols/trade/transfer-v3.d.mts +31 -1
- package/esm/util.d.mts +1 -1
- package/lib/execute.cjs +61 -4
- package/lib/execute.d.cts +5 -0
- package/lib/index.cjs +2 -0
- package/lib/index.d.cts +737 -73
- package/lib/pipes/write-ledger.cjs +102 -0
- package/lib/pipes/write-ledger.d.cts +73 -0
- package/lib/protocols/account/delegate.d.cts +52 -1
- package/lib/protocols/account/migrate.d.cts +15 -1
- package/lib/protocols/account/revoke-delegate.d.cts +14 -1
- package/lib/protocols/asset/acquire-v2.d.cts +39 -1
- package/lib/protocols/asset/acquire-v3.d.cts +43 -1
- package/lib/protocols/asset/calls/transfer-token.d.cts +4 -1
- package/lib/protocols/asset/calls/transfer.d.cts +4 -1
- package/lib/protocols/asset/consume.d.cts +14 -1
- package/lib/protocols/asset/create.d.cts +23 -1
- package/lib/protocols/asset/mint.d.cts +28 -1
- package/lib/protocols/asset/update.d.cts +15 -1
- package/lib/protocols/factory/create.d.cts +23 -1
- package/lib/protocols/governance/claim-stake.d.cts +24 -1
- package/lib/protocols/governance/return-stake.d.cts +20 -1
- package/lib/protocols/governance/revoke-stake.d.cts +20 -1
- package/lib/protocols/governance/slash-stake.d.cts +30 -1
- package/lib/protocols/governance/stake.d.cts +27 -1
- package/lib/protocols/rollup/claim-reward.d.cts +57 -1
- package/lib/protocols/rollup/close.d.cts +16 -1
- package/lib/protocols/rollup/create-block.d.cts +42 -1
- package/lib/protocols/rollup/create.d.cts +28 -1
- package/lib/protocols/rollup/join.d.cts +18 -1
- package/lib/protocols/rollup/leave.d.cts +16 -1
- package/lib/protocols/rollup/migrate.d.cts +11 -1
- package/lib/protocols/rollup/pause.d.cts +11 -1
- package/lib/protocols/rollup/resume.d.cts +11 -1
- package/lib/protocols/rollup/update.d.cts +11 -1
- package/lib/protocols/token/create.d.cts +14 -1
- package/lib/protocols/token/deposit-v2.d.cts +23 -1
- package/lib/protocols/token/withdraw-v2.d.cts +33 -1
- package/lib/protocols/token-factory/burn.d.cts +29 -1
- package/lib/protocols/token-factory/create.d.cts +16 -1
- package/lib/protocols/token-factory/mint.d.cts +27 -1
- package/lib/protocols/token-factory/update.d.cts +15 -1
- package/lib/protocols/trade/exchange-v2.d.cts +40 -1
- package/lib/protocols/trade/transfer-v2.d.cts +32 -1
- package/lib/protocols/trade/transfer-v3.d.cts +31 -1
- package/lib/util.d.cts +2 -2
- package/package.json +20 -19
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { BN } from "@ocap/util";
|
|
3
|
+
import { IAccountState, IReadyContext, IWithAssets, IWithLocked, IWithReceivers, IWithSender, IWithStake, IWithTokens, TSlashStakeTx } from "@ocap/types";
|
|
4
|
+
|
|
1
5
|
//#region src/protocols/governance/slash-stake.d.ts
|
|
2
6
|
/** Token input type */
|
|
3
7
|
interface TokenInput {
|
|
@@ -12,6 +16,31 @@ interface MultiOutput {
|
|
|
12
16
|
assetsList?: string[];
|
|
13
17
|
assets?: string[];
|
|
14
18
|
}
|
|
15
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Context type for slash-stake protocol.
|
|
21
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
22
|
+
* Mixins: IWithSender, IWithStake, IWithReceivers, IWithTokens, IWithAssets, IWithLocked
|
|
23
|
+
*/
|
|
24
|
+
type Context = IReadyContext<TSlashStakeTx> & IWithSender & IWithStake & Partial<IWithReceivers> & Partial<IWithTokens> & Partial<IWithAssets> & Partial<IWithLocked> & {
|
|
25
|
+
/** Parsed outputs from itx */
|
|
26
|
+
outputs?: MultiOutput[];
|
|
27
|
+
/** Receiver addresses from outputs */
|
|
28
|
+
receivers?: string[];
|
|
29
|
+
/** Token addresses from outputs */
|
|
30
|
+
tokens?: string[];
|
|
31
|
+
/** Asset addresses from outputs */
|
|
32
|
+
assets?: string[];
|
|
33
|
+
/** Slasher states */
|
|
34
|
+
slasherStates?: IAccountState[];
|
|
35
|
+
/** Token condition for balance verification */
|
|
36
|
+
tokenCondition?: {
|
|
37
|
+
owner: string;
|
|
38
|
+
tokens: Array<{
|
|
39
|
+
address: string;
|
|
40
|
+
value: BN;
|
|
41
|
+
}>;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
declare const runner: Runner<Context>;
|
|
16
45
|
//#endregion
|
|
17
46
|
export { MultiOutput, TokenInput, runner as default };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IAccountState, IReadyContext, IWithAssets, IWithReceiver, IWithSender, IWithSigners, IWithStake, IWithTokens, TStakeTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/governance/stake.d.ts
|
|
2
5
|
/** Token input type */
|
|
3
6
|
interface TokenInput {
|
|
@@ -10,6 +13,29 @@ interface MultiInput {
|
|
|
10
13
|
tokensList?: TokenInput[];
|
|
11
14
|
assetsList?: string[];
|
|
12
15
|
}
|
|
13
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Context type for stake protocol.
|
|
18
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
19
|
+
* Mixins: IWithSender, IWithSigners, IWithReceiver, IWithStake, IWithTokens, IWithAssets
|
|
20
|
+
*/
|
|
21
|
+
type Context = IReadyContext<TStakeTx> & Partial<IWithSender> & Partial<IWithSigners> & Partial<IWithReceiver> & Partial<IWithStake> & Partial<IWithTokens> & Partial<IWithAssets> & {
|
|
22
|
+
/** Parsed inputs from itx */
|
|
23
|
+
inputs?: MultiInput[];
|
|
24
|
+
/** Sender addresses from inputs */
|
|
25
|
+
senders?: string[];
|
|
26
|
+
/** Token addresses from inputs */
|
|
27
|
+
tokens?: string[];
|
|
28
|
+
/** Asset addresses from inputs */
|
|
29
|
+
assets?: string[];
|
|
30
|
+
/** Slasher states */
|
|
31
|
+
slasherStates?: IAccountState[];
|
|
32
|
+
/** Whether this is a gas stake */
|
|
33
|
+
isGasStake?: boolean;
|
|
34
|
+
/** Revoke waiting period (from itx or config for gas stake) */
|
|
35
|
+
revokeWaitingPeriod?: number;
|
|
36
|
+
/** Slasher addresses (from itx or config for gas stake) */
|
|
37
|
+
slashers?: string[];
|
|
38
|
+
};
|
|
39
|
+
declare const runner: Runner<Context>;
|
|
14
40
|
//#endregion
|
|
15
41
|
export { MultiInput, TokenInput, runner as default };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IAccountState, IEvidenceState, IReadyContext, IRollupBlock, IStakeState, ITokenState, ITxState, IWithRollup, IWithSender, IWithSigners, TClaimBlockRewardTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/rollup/claim-reward.d.ts
|
|
2
5
|
/** Token change for updates */
|
|
3
6
|
interface TokenChange {
|
|
@@ -6,6 +9,59 @@ interface TokenChange {
|
|
|
6
9
|
delta: string;
|
|
7
10
|
action: string;
|
|
8
11
|
}
|
|
9
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Context type for claim-block-reward protocol.
|
|
14
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
15
|
+
* Mixins: IWithRollup (required), IWithSender (required), IWithSigners (required)
|
|
16
|
+
*
|
|
17
|
+
* Note: This protocol uses lockerState and stakeState as IStakeState, not IAccountState.
|
|
18
|
+
*/
|
|
19
|
+
type Context = IReadyContext<TClaimBlockRewardTx> & IWithRollup & IWithSender & IWithSigners & {
|
|
20
|
+
/** Address of reward locker stake */
|
|
21
|
+
lockerAddress?: string;
|
|
22
|
+
/** Evidence seen state (null if not seen) */
|
|
23
|
+
evidenceSeen?: IEvidenceState | null;
|
|
24
|
+
/** Block claimed evidence state (null if not claimed) */
|
|
25
|
+
blockClaimed?: IEvidenceState | null;
|
|
26
|
+
/** Block state being claimed */
|
|
27
|
+
blockState?: IRollupBlock;
|
|
28
|
+
/** Producer stake address */
|
|
29
|
+
producerStakeAddress?: string;
|
|
30
|
+
/** Locker stake state (for reward distribution) */
|
|
31
|
+
lockerState?: IStakeState;
|
|
32
|
+
/** Producer stake state (for slashing) */
|
|
33
|
+
stakeState?: IStakeState;
|
|
34
|
+
/** Token state for rollup */
|
|
35
|
+
tokenState?: ITokenState;
|
|
36
|
+
/** Transaction states in the block */
|
|
37
|
+
txs?: ITxState[];
|
|
38
|
+
/** Changes to be applied */
|
|
39
|
+
changes?: {
|
|
40
|
+
account: Array<{
|
|
41
|
+
address: string;
|
|
42
|
+
delta: string;
|
|
43
|
+
action: string;
|
|
44
|
+
}>;
|
|
45
|
+
stake: Array<{
|
|
46
|
+
address: string;
|
|
47
|
+
delta: string;
|
|
48
|
+
action: string;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
/** Updates aggregated from changes */
|
|
52
|
+
updates?: {
|
|
53
|
+
account: Record<string, TokenChange>;
|
|
54
|
+
stake: Record<string, TokenChange>;
|
|
55
|
+
};
|
|
56
|
+
/** All account states needed for updates */
|
|
57
|
+
accountStates?: IAccountState[];
|
|
58
|
+
/** Missing account addresses */
|
|
59
|
+
missingAccounts?: string[];
|
|
60
|
+
/** Missing account states */
|
|
61
|
+
missingAccountStates?: IAccountState[];
|
|
62
|
+
/** Stake states after update */
|
|
63
|
+
stakeStates?: IStakeState[];
|
|
64
|
+
};
|
|
65
|
+
declare const runner: Runner<Context>;
|
|
10
66
|
//#endregion
|
|
11
67
|
export { TokenChange, runner as default };
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IStakeState, IWithRollup, IWithSender, IWithSigners, TCloseRollupTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/rollup/close.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for close-rollup protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithRollup (required), IWithSender (required), IWithSigners (required)
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TCloseRollupTx> & IWithRollup & IWithSender & IWithSigners & {
|
|
12
|
+
/** Stake addresses for all validators */
|
|
13
|
+
stakeAddresses?: string[];
|
|
14
|
+
/** Stake states for all validators */
|
|
15
|
+
stakeStates?: IStakeState[];
|
|
16
|
+
};
|
|
17
|
+
declare const runner: Runner<Context>;
|
|
3
18
|
//#endregion
|
|
4
19
|
export { runner as default };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { BN } from "@ocap/util";
|
|
3
|
+
import { IAccountState, IReadyContext, IRollupBlock, ITokenState, ITxState, IWithRollup, IWithSender, IWithSigners, IWithStakes, TCreateRollupBlockTx } from "@ocap/types";
|
|
4
|
+
|
|
1
5
|
//#region src/protocols/rollup/create-block.d.ts
|
|
2
6
|
/** Token change for updates */
|
|
3
7
|
interface TokenChange {
|
|
@@ -6,6 +10,43 @@ interface TokenChange {
|
|
|
6
10
|
delta: string;
|
|
7
11
|
action?: string;
|
|
8
12
|
}
|
|
9
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Context type for create-rollup-block protocol.
|
|
15
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
16
|
+
* Mixins: IWithRollup (required), IWithSender (required), IWithSigners (required), IWithStakes (required)
|
|
17
|
+
*/
|
|
18
|
+
type Context = IReadyContext<TCreateRollupBlockTx> & IWithRollup & IWithSender & IWithSigners & IWithStakes & {
|
|
19
|
+
/** Formatted itx from protobuf */
|
|
20
|
+
formattedItx?: Record<string, unknown>;
|
|
21
|
+
/** Previous block state (null for height 1) */
|
|
22
|
+
previousBlock?: IRollupBlock | null;
|
|
23
|
+
/** New block state (should be null) */
|
|
24
|
+
newBlock?: IRollupBlock | null;
|
|
25
|
+
/** Token state for rollup */
|
|
26
|
+
tokenState?: ITokenState;
|
|
27
|
+
/** Transaction states to include in block */
|
|
28
|
+
txStates?: ITxState[];
|
|
29
|
+
/** Stake addresses for deposits/withdraws */
|
|
30
|
+
stakeAddresses?: string[];
|
|
31
|
+
/** Sender addresses for fee refunds */
|
|
32
|
+
senders?: string[];
|
|
33
|
+
/** Sender states for fee refunds */
|
|
34
|
+
senderStates?: IAccountState[];
|
|
35
|
+
/** Account updates for fee refunds */
|
|
36
|
+
accountUpdates?: Record<string, TokenChange>;
|
|
37
|
+
/** Stake updates for deposits/withdraws */
|
|
38
|
+
stakeUpdates?: Record<string, TokenChange>;
|
|
39
|
+
/** Block reward amount */
|
|
40
|
+
rewardAmount?: BN;
|
|
41
|
+
/** Minted amount for deposits */
|
|
42
|
+
mintedAmount?: BN;
|
|
43
|
+
/** Burned amount for withdraws */
|
|
44
|
+
burnedAmount?: BN;
|
|
45
|
+
/** New sender states after update */
|
|
46
|
+
newSenderStates?: IAccountState[];
|
|
47
|
+
/** Created rollup block */
|
|
48
|
+
createdRollupBlock?: IRollupBlock;
|
|
49
|
+
};
|
|
50
|
+
declare const runner: Runner<Context>;
|
|
10
51
|
//#endregion
|
|
11
52
|
export { TokenChange, runner as default };
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IAccountState, IReadyContext, IRollupState, IRollupValidator, ITokenState, IWithDelegation, IWithDelegator, IWithSender, IWithToken, TCreateRollupTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/rollup/create.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for create-rollup protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithSender (required), IWithToken (required), IWithDelegator (optional), IWithDelegation (optional)
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TCreateRollupTx> & IWithSender & Partial<IWithToken> & Partial<IWithDelegator> & Partial<IWithDelegation> & {
|
|
12
|
+
/** Formatted itx with seed validators */
|
|
13
|
+
formattedItx?: TCreateRollupTx & {
|
|
14
|
+
seedValidators: IRollupValidator[];
|
|
15
|
+
};
|
|
16
|
+
/** Decoded rollup data */
|
|
17
|
+
rollupData?: unknown;
|
|
18
|
+
/** Seed validator addresses */
|
|
19
|
+
seedValidators?: string[];
|
|
20
|
+
/** Validator account states */
|
|
21
|
+
validatorStates?: IAccountState[];
|
|
22
|
+
/** Token state */
|
|
23
|
+
tokenState?: ITokenState;
|
|
24
|
+
/** Rollup state (null if not exist) */
|
|
25
|
+
rollupState?: IRollupState | null;
|
|
26
|
+
/** Whether delegation state changed */
|
|
27
|
+
isDelegationChanged?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare const runner: Runner<Context>;
|
|
3
30
|
//#endregion
|
|
4
31
|
export { runner as default };
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IEvidenceState, IReadyContext, IRollupValidator, IWithRollup, IWithSender, IWithSigners, IWithStake, TJoinRollupTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/rollup/join.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for join-rollup protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithRollup (required), IWithSender (required), IWithSigners (required), IWithStake (required)
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TJoinRollupTx> & IWithRollup & IWithSender & IWithSigners & IWithStake & {
|
|
12
|
+
/** Evidence state (null if not seen before) */
|
|
13
|
+
evidenceState?: IEvidenceState | null;
|
|
14
|
+
/** New validator to add */
|
|
15
|
+
newValidator?: IRollupValidator;
|
|
16
|
+
/** Hash of new validators list */
|
|
17
|
+
validatorsHash?: string;
|
|
18
|
+
};
|
|
19
|
+
declare const runner: Runner<Context>;
|
|
3
20
|
//#endregion
|
|
4
21
|
export { runner as default };
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IEvidenceState, IReadyContext, IWithRollup, IWithSender, IWithSigners, IWithStake, TLeaveRollupTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/rollup/leave.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for leave-rollup protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithRollup (required), IWithSender (required), IWithSigners (required), IWithStake (required)
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TLeaveRollupTx> & IWithRollup & IWithSender & IWithSigners & IWithStake & {
|
|
12
|
+
/** Hash of validators being removed */
|
|
13
|
+
validatorsHash?: string;
|
|
14
|
+
/** Evidence state (null if not seen before) */
|
|
15
|
+
evidenceState?: IEvidenceState | null;
|
|
16
|
+
};
|
|
17
|
+
declare const runner: Runner<Context>;
|
|
3
18
|
//#endregion
|
|
4
19
|
export { runner as default };
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IWithRollup, IWithSender, IWithSigners, TMigrateRollupTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/rollup/migrate.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for migrate-rollup protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithRollup (required), IWithSender (required), IWithSigners (required)
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TMigrateRollupTx> & IWithRollup & IWithSender & IWithSigners;
|
|
12
|
+
declare const runner: Runner<Context>;
|
|
3
13
|
//#endregion
|
|
4
14
|
export { runner as default };
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IWithRollup, IWithSender, IWithSigners, TPauseRollupTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/rollup/pause.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for pause-rollup protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithRollup (required), IWithSender (required), IWithSigners (required)
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TPauseRollupTx> & IWithRollup & IWithSender & IWithSigners;
|
|
12
|
+
declare const runner: Runner<Context>;
|
|
3
13
|
//#endregion
|
|
4
14
|
export { runner as default };
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IWithRollup, IWithSender, IWithSigners, TResumeRollupTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/rollup/resume.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for resume-rollup protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithRollup (required), IWithSender (required), IWithSigners (required)
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TResumeRollupTx> & IWithRollup & IWithSender & IWithSigners;
|
|
12
|
+
declare const runner: Runner<Context>;
|
|
3
13
|
//#endregion
|
|
4
14
|
export { runner as default };
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IWithRollup, IWithSender, IWithSigners, TUpdateRollupTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/rollup/update.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for update-rollup protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithRollup (required), IWithSender (required), IWithSigners (required)
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TUpdateRollupTx> & IWithRollup & IWithSender & IWithSigners;
|
|
12
|
+
declare const runner: Runner<Context>;
|
|
3
13
|
//#endregion
|
|
4
14
|
export { runner as default };
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IWithDelegation, IWithDelegator, IWithSender, IWithToken, TCreateTokenTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/token/create.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for create-token protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithSender, IWithDelegator, IWithDelegation, IWithToken
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TCreateTokenTx> & Partial<IWithSender> & Partial<IWithDelegator> & Partial<IWithDelegation> & Partial<IWithToken> & {
|
|
12
|
+
/** Whether delegation was changed */
|
|
13
|
+
isDelegationChanged?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const runner: Runner<Context>;
|
|
3
16
|
//#endregion
|
|
4
17
|
export { runner as default };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IStakeState, IWithEvidence, IWithRollup, IWithSender, IWithSigners, IWithStake, IWithToken, TDepositTokenV2Tx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/token/deposit-v2.d.ts
|
|
2
5
|
/** Token change for updates */
|
|
3
6
|
interface TokenChange {
|
|
@@ -6,6 +9,25 @@ interface TokenChange {
|
|
|
6
9
|
delta: string;
|
|
7
10
|
action: string;
|
|
8
11
|
}
|
|
9
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Context type for deposit-token-v2 protocol.
|
|
14
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
15
|
+
* Mixins: IWithSender, IWithSigners, IWithRollup, IWithToken, IWithStake, IWithEvidence
|
|
16
|
+
*/
|
|
17
|
+
type Context = IReadyContext<TDepositTokenV2Tx> & Partial<IWithSender> & Partial<IWithSigners> & Partial<IWithRollup> & Partial<IWithToken> & Partial<IWithStake> & Partial<IWithEvidence> & {
|
|
18
|
+
/** Stake address for proposer */
|
|
19
|
+
stakeAddress?: string;
|
|
20
|
+
/** Locker address for pending fees */
|
|
21
|
+
lockerAddress?: string;
|
|
22
|
+
/** Locker stake state */
|
|
23
|
+
lockerState?: IStakeState;
|
|
24
|
+
/** Signer addresses */
|
|
25
|
+
signers?: string[];
|
|
26
|
+
/** All updated stake states */
|
|
27
|
+
stakeStates?: IStakeState[];
|
|
28
|
+
/** Token changes for receipt generation */
|
|
29
|
+
updatedAccounts?: TokenChange[];
|
|
30
|
+
};
|
|
31
|
+
declare const runner: Runner<Context>;
|
|
10
32
|
//#endregion
|
|
11
33
|
export { TokenChange, runner as default };
|
|
@@ -1,9 +1,41 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IStakeState, IWithRollup, IWithSender, IWithSigners, IWithStake, IWithToken, TWithdrawTokenV2Tx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/token/withdraw-v2.d.ts
|
|
2
5
|
/** Token input */
|
|
3
6
|
interface TokenInput {
|
|
4
7
|
address: string;
|
|
5
8
|
value: string;
|
|
6
9
|
}
|
|
7
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Context type for withdraw-token-v2 protocol.
|
|
12
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
13
|
+
* Mixins: IWithSender, IWithSigners, IWithRollup, IWithToken, IWithStake
|
|
14
|
+
*/
|
|
15
|
+
type Context = IReadyContext<TWithdrawTokenV2Tx> & IWithSender & Partial<IWithSigners> & Partial<IWithRollup> & Partial<IWithToken> & Partial<IWithStake> & {
|
|
16
|
+
/** Signer addresses */
|
|
17
|
+
signers?: string[];
|
|
18
|
+
/** Stake address for withdraw locker */
|
|
19
|
+
stakeAddress?: string;
|
|
20
|
+
/** Locker address for pending fees */
|
|
21
|
+
lockerAddress?: string;
|
|
22
|
+
/** Locker stake state */
|
|
23
|
+
lockerState?: IStakeState;
|
|
24
|
+
/** Token conditions for balance verification */
|
|
25
|
+
tokenConditions?: {
|
|
26
|
+
owner: string;
|
|
27
|
+
tokens: TokenInput[];
|
|
28
|
+
};
|
|
29
|
+
/** All updated stake states */
|
|
30
|
+
stakeStates?: IStakeState[];
|
|
31
|
+
/** Token changes for receipt generation */
|
|
32
|
+
updatedAccounts?: Array<{
|
|
33
|
+
address: string;
|
|
34
|
+
token: string;
|
|
35
|
+
delta: string;
|
|
36
|
+
action: string;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
declare const runner: Runner<Context>;
|
|
8
40
|
//#endregion
|
|
9
41
|
export { TokenInput, runner as default };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IWithOwner, IWithReceiver, IWithSender, IWithSigners, IWithToken, IWithTokenFactory, IWithTokens, TBurnTokenTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/token-factory/burn.d.ts
|
|
2
5
|
/** Token input type */
|
|
3
6
|
interface TokenInput {
|
|
@@ -10,6 +13,31 @@ interface MultiInput {
|
|
|
10
13
|
tokensList: TokenInput[];
|
|
11
14
|
assetsList: string[];
|
|
12
15
|
}
|
|
13
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Context type for burn-token protocol.
|
|
18
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
19
|
+
* Mixins: IWithSender, IWithReceiver, IWithOwner, IWithSigners, IWithTokenFactory, IWithToken, IWithTokens
|
|
20
|
+
*/
|
|
21
|
+
type Context = IReadyContext<TBurnTokenTx> & Partial<IWithSender> & Partial<IWithReceiver> & Partial<IWithOwner> & Partial<IWithSigners> & IWithTokenFactory & IWithToken & Partial<IWithTokens> & {
|
|
22
|
+
/** Parsed inputs from itx */
|
|
23
|
+
inputs?: MultiInput[];
|
|
24
|
+
/** Sender addresses from inputs */
|
|
25
|
+
senders?: string[];
|
|
26
|
+
/** Token addresses from inputs */
|
|
27
|
+
tokens?: string[];
|
|
28
|
+
/** Amount to burn */
|
|
29
|
+
burnAmount?: string;
|
|
30
|
+
/** Reserve amount to return */
|
|
31
|
+
reserveAmount?: string;
|
|
32
|
+
/** Reserve fee for owner */
|
|
33
|
+
reserveFee?: string;
|
|
34
|
+
/** Input changes for receipt generation */
|
|
35
|
+
inputChanges?: {
|
|
36
|
+
address: string;
|
|
37
|
+
token: string;
|
|
38
|
+
delta: string;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
declare const runner: Runner<Context>;
|
|
14
42
|
//#endregion
|
|
15
43
|
export { MultiInput, TokenInput, runner as default };
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IWithDelegation, IWithDelegator, IWithSender, IWithStake, IWithToken, IWithTokenFactory, TCreateTokenFactoryTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/token-factory/create.d.ts
|
|
2
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Context type for create-token-factory protocol.
|
|
8
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
9
|
+
* Mixins: IWithSender, IWithDelegator, IWithDelegation, IWithStake, IWithToken, IWithTokenFactory
|
|
10
|
+
*/
|
|
11
|
+
type Context = IReadyContext<TCreateTokenFactoryTx> & Partial<IWithSender> & Partial<IWithDelegator> & Partial<IWithDelegation> & Partial<IWithStake> & Partial<IWithToken> & Partial<IWithTokenFactory> & {
|
|
12
|
+
/** Stake address for token creation */
|
|
13
|
+
stakeAddress?: string;
|
|
14
|
+
/** Whether delegation was changed */
|
|
15
|
+
isDelegationChanged?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare const runner: Runner<Context>;
|
|
3
18
|
//#endregion
|
|
4
19
|
export { runner as default };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IWithOwner, IWithReceiver, IWithSender, IWithSigners, IWithToken, IWithTokenFactory, IWithTokens, TMintTokenTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/token-factory/mint.d.ts
|
|
2
5
|
/** Token input type */
|
|
3
6
|
interface TokenInput {
|
|
@@ -10,6 +13,29 @@ interface MultiInput {
|
|
|
10
13
|
tokensList: TokenInput[];
|
|
11
14
|
assetsList: string[];
|
|
12
15
|
}
|
|
13
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Context type for mint-token protocol.
|
|
18
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
19
|
+
* Mixins: IWithSender, IWithReceiver, IWithOwner, IWithSigners, IWithTokenFactory, IWithToken, IWithTokens
|
|
20
|
+
*/
|
|
21
|
+
type Context = IReadyContext<TMintTokenTx> & Partial<IWithSender> & Partial<IWithReceiver> & Partial<IWithOwner> & Partial<IWithSigners> & IWithTokenFactory & IWithToken & Partial<IWithTokens> & {
|
|
22
|
+
/** Parsed inputs from itx */
|
|
23
|
+
inputs?: MultiInput[];
|
|
24
|
+
/** Sender addresses from inputs */
|
|
25
|
+
senders?: string[];
|
|
26
|
+
/** Token addresses from inputs */
|
|
27
|
+
tokens?: string[];
|
|
28
|
+
/** Reserve amount for minting */
|
|
29
|
+
reserveAmount?: string;
|
|
30
|
+
/** Reserve fee for owner */
|
|
31
|
+
reserveFee?: string;
|
|
32
|
+
/** Input changes for receipt generation */
|
|
33
|
+
inputChanges?: Array<{
|
|
34
|
+
address: string;
|
|
35
|
+
token: string;
|
|
36
|
+
delta: string;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
declare const runner: Runner<Context>;
|
|
14
40
|
//#endregion
|
|
15
41
|
export { MultiInput, TokenInput, runner as default };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IReadyContext, IWithDelegation, IWithDelegator, IWithSender, IWithToken, IWithTokenFactory, TUpdateTokenFactoryTx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/token-factory/update.d.ts
|
|
2
5
|
/** Token info for website verification */
|
|
3
6
|
interface TokenInfoForVerification {
|
|
@@ -5,6 +8,17 @@ interface TokenInfoForVerification {
|
|
|
5
8
|
address: string;
|
|
6
9
|
website?: string | null;
|
|
7
10
|
}
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Context type for update-token-factory protocol.
|
|
13
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
14
|
+
* Mixins: IWithSender, IWithDelegator, IWithDelegation, IWithTokenFactory, IWithToken
|
|
15
|
+
*/
|
|
16
|
+
type Context = IReadyContext<TUpdateTokenFactoryTx> & IWithSender & IWithTokenFactory & IWithToken & Partial<IWithDelegator> & Partial<IWithDelegation> & {
|
|
17
|
+
/** Whether delegation was changed */
|
|
18
|
+
isDelegationChanged?: boolean;
|
|
19
|
+
/** Token info for website ownership verification */
|
|
20
|
+
tokenInfoForVerification?: TokenInfoForVerification;
|
|
21
|
+
};
|
|
22
|
+
declare const runner: Runner<Context>;
|
|
9
23
|
//#endregion
|
|
10
24
|
export { TokenInfoForVerification, runner as default };
|
|
@@ -1,9 +1,48 @@
|
|
|
1
|
+
import { Runner } from "@ocap/tx-pipeline";
|
|
2
|
+
import { IAssetState, IReadyContext, ITokenState, IWithDelegation, IWithDelegator, IWithReceiver, IWithSender, IWithSigners, TExchangeV2Tx } from "@ocap/types";
|
|
3
|
+
|
|
1
4
|
//#region src/protocols/trade/exchange-v2.d.ts
|
|
2
5
|
/** Token input - value can be string or number from decodeBigInt */
|
|
3
6
|
interface TokenInput {
|
|
4
7
|
address: string;
|
|
5
8
|
value: string | number;
|
|
6
9
|
}
|
|
7
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Context type for exchange-v2 protocol.
|
|
12
|
+
* Phase: IReadyContext (after TakeStateSnapshot)
|
|
13
|
+
* Mixins: IWithSender, IWithReceiver, IWithDelegator, IWithSigners, IWithDelegation (all required)
|
|
14
|
+
*/
|
|
15
|
+
type Context = IReadyContext<TExchangeV2Tx> & IWithSender & IWithReceiver & Partial<IWithDelegator> & Partial<IWithSigners> & Partial<IWithDelegation> & {
|
|
16
|
+
/** Sender's asset addresses to exchange */
|
|
17
|
+
senderAssets?: string[];
|
|
18
|
+
/** Receiver's asset addresses to exchange */
|
|
19
|
+
receiverAssets?: string[];
|
|
20
|
+
/** Sender's tokens to exchange */
|
|
21
|
+
senderTokens?: TokenInput[];
|
|
22
|
+
/** Receiver's tokens to exchange */
|
|
23
|
+
receiverTokens?: TokenInput[];
|
|
24
|
+
/** Token addresses involved in exchange */
|
|
25
|
+
tokenAddress?: string[];
|
|
26
|
+
/** Sender's token conditions for balance verification */
|
|
27
|
+
senderTokenConditions?: {
|
|
28
|
+
owner: string;
|
|
29
|
+
tokens: TokenInput[];
|
|
30
|
+
};
|
|
31
|
+
/** Receiver's token conditions for balance verification */
|
|
32
|
+
receiverTokenConditions?: {
|
|
33
|
+
owner: string;
|
|
34
|
+
tokens: TokenInput[];
|
|
35
|
+
};
|
|
36
|
+
/** Token states for exchanged tokens */
|
|
37
|
+
tokenStates?: ITokenState[];
|
|
38
|
+
/** Receiver address extracted from tx signatures or itx.to */
|
|
39
|
+
receiver?: string;
|
|
40
|
+
/** Private state for asset states */
|
|
41
|
+
priv?: {
|
|
42
|
+
senderAssets?: IAssetState[];
|
|
43
|
+
receiverAssets?: IAssetState[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
declare const runner: Runner<Context>;
|
|
8
47
|
//#endregion
|
|
9
48
|
export { TokenInput, runner as default };
|