@mortiseagentvault/sdk 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +122 -2
- package/dist/THIRD_PARTY_NOTICES.txt +79 -0
- package/dist/abis.d.ts +7430 -0
- package/dist/actions.d.ts +173 -0
- package/dist/addresses.d.ts +41 -0
- package/dist/agent.d.ts +91 -0
- package/dist/calls.d.ts +70 -0
- package/dist/errors.d.ts +13 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +4272 -0
- package/dist/modules.d.ts +22 -0
- package/dist/root.d.ts +39 -0
- package/dist/userop.d.ts +151 -0
- package/dist/vault.d.ts +78 -0
- package/package.json +53 -4
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
/** One step for the Gate: an adapter and its input. */
|
|
3
|
+
export interface Action {
|
|
4
|
+
adapter: Address;
|
|
5
|
+
data: Hex;
|
|
6
|
+
}
|
|
7
|
+
/** Uniswap v4 PoolKey; address(0) is native ETH. */
|
|
8
|
+
export interface PoolKey {
|
|
9
|
+
currency0: Address;
|
|
10
|
+
currency1: Address;
|
|
11
|
+
fee: number;
|
|
12
|
+
tickSpacing: number;
|
|
13
|
+
hooks: Address;
|
|
14
|
+
}
|
|
15
|
+
/** Morpho Blue MarketParams. */
|
|
16
|
+
export interface MarketParams {
|
|
17
|
+
loanToken: Address;
|
|
18
|
+
collateralToken: Address;
|
|
19
|
+
oracle: Address;
|
|
20
|
+
irm: Address;
|
|
21
|
+
lltv: bigint;
|
|
22
|
+
}
|
|
23
|
+
/** The Uniswap v4 pool id, which is the market UniswapV4Adapter and UniswapV4LiquidityAdapter report. */
|
|
24
|
+
export declare function poolId(key: PoolKey): Hex;
|
|
25
|
+
/** The Morpho Blue market id, which is the market MorphoBlueAdapter reports. */
|
|
26
|
+
export declare function morphoMarketId(m: MarketParams): Hex;
|
|
27
|
+
/** Action data for every adapter, in exactly the layout each adapter's plan() decodes. */
|
|
28
|
+
export declare const actions: {
|
|
29
|
+
/** Exact-input swap on one Uniswap v3 pool; address(0) is ETH. The minimum is raised to the vault's floor. */
|
|
30
|
+
uniswapV3Swap: (a: {
|
|
31
|
+
tokenIn: Address;
|
|
32
|
+
tokenOut: Address;
|
|
33
|
+
fee: number;
|
|
34
|
+
amountIn: bigint;
|
|
35
|
+
amountOutMinimum: bigint;
|
|
36
|
+
}) => Action;
|
|
37
|
+
/** Exact-input swap on one Uniswap v4 pool, hook included. */
|
|
38
|
+
uniswapV4Swap: (a: {
|
|
39
|
+
key: PoolKey;
|
|
40
|
+
zeroForOne: boolean;
|
|
41
|
+
amountIn: bigint;
|
|
42
|
+
amountOutMinimum: bigint;
|
|
43
|
+
}) => Action;
|
|
44
|
+
/** Supply or withdraw a Morpho Blue market's loan token; give either assets or shares, the other 0. */
|
|
45
|
+
morpho: (a: {
|
|
46
|
+
op: "supply" | "withdraw";
|
|
47
|
+
market: MarketParams;
|
|
48
|
+
assets: bigint;
|
|
49
|
+
shares: bigint;
|
|
50
|
+
}) => Action;
|
|
51
|
+
/** Buy or sell a Pons V2 token on its bonding curve; amounts in the launch's pair token (or ETH) and the token. */
|
|
52
|
+
pons: (a: {
|
|
53
|
+
side: "buy" | "sell";
|
|
54
|
+
token: Address;
|
|
55
|
+
amountIn: bigint;
|
|
56
|
+
minOut: bigint;
|
|
57
|
+
}) => Action;
|
|
58
|
+
/** Buy or sell through the Flap Portal (bonding curve, or the DEX after graduation). */
|
|
59
|
+
flap: (a: {
|
|
60
|
+
tokenIn: Address;
|
|
61
|
+
tokenOut: Address;
|
|
62
|
+
amountIn: bigint;
|
|
63
|
+
minOut: bigint;
|
|
64
|
+
}) => Action;
|
|
65
|
+
/** Deposit assets into, withdraw assets from, or redeem shares of a listed ERC-4626 vault. */
|
|
66
|
+
erc4626: (a: {
|
|
67
|
+
op: "deposit" | "withdraw" | "redeem";
|
|
68
|
+
target: Address;
|
|
69
|
+
amount: bigint;
|
|
70
|
+
}) => Action;
|
|
71
|
+
/** Send an ERC-20 to a recipient the owner listed for it (market: transferMarket(token, to)). */
|
|
72
|
+
transfer: (a: {
|
|
73
|
+
token: Address;
|
|
74
|
+
to: Address;
|
|
75
|
+
amount: bigint;
|
|
76
|
+
}) => Action;
|
|
77
|
+
/** Move a token or ETH (address(0)) to another vault of the family. */
|
|
78
|
+
familyTransfer: (a: {
|
|
79
|
+
token: Address;
|
|
80
|
+
to: Address;
|
|
81
|
+
amount: bigint;
|
|
82
|
+
}) => Action;
|
|
83
|
+
/** Wrap ETH into WETH or unwrap it. */
|
|
84
|
+
weth: (a: {
|
|
85
|
+
wrap: boolean;
|
|
86
|
+
amount: bigint;
|
|
87
|
+
}) => Action;
|
|
88
|
+
/** Bridge an ERC-20 through Across on a listed route; recipient and outputToken are bytes32. */
|
|
89
|
+
across: (b: {
|
|
90
|
+
destinationChainId: bigint;
|
|
91
|
+
recipient: Hex;
|
|
92
|
+
inputToken: Address;
|
|
93
|
+
outputToken: Hex;
|
|
94
|
+
minRate: bigint;
|
|
95
|
+
inputAmount: bigint;
|
|
96
|
+
outputAmount: bigint;
|
|
97
|
+
quoteTimestamp: number;
|
|
98
|
+
fillDeadline: number;
|
|
99
|
+
}) => Action;
|
|
100
|
+
/** Uniswap v3 positions: Mint and Increase take up to amount0/amount1; Decrease takes `liquidity`. */
|
|
101
|
+
uniswapV3Liquidity: (a: {
|
|
102
|
+
op: "mint";
|
|
103
|
+
token0: Address;
|
|
104
|
+
token1: Address;
|
|
105
|
+
fee: number;
|
|
106
|
+
tickLower: number;
|
|
107
|
+
tickUpper: number;
|
|
108
|
+
amount0: bigint;
|
|
109
|
+
amount1: bigint;
|
|
110
|
+
amount0Min: bigint;
|
|
111
|
+
amount1Min: bigint;
|
|
112
|
+
} | {
|
|
113
|
+
op: "increase" | "decrease";
|
|
114
|
+
tokenId: bigint;
|
|
115
|
+
liquidity: bigint;
|
|
116
|
+
amount0: bigint;
|
|
117
|
+
amount1: bigint;
|
|
118
|
+
amount0Min: bigint;
|
|
119
|
+
amount1Min: bigint;
|
|
120
|
+
} | {
|
|
121
|
+
op: "collect" | "burn";
|
|
122
|
+
tokenId: bigint;
|
|
123
|
+
}) => Action;
|
|
124
|
+
/** Uniswap v4 positions: amounts are maximums for Mint and Increase, minimums for Decrease and Burn. */
|
|
125
|
+
uniswapV4Liquidity: (a: {
|
|
126
|
+
op: "mint";
|
|
127
|
+
key: PoolKey;
|
|
128
|
+
tickLower: number;
|
|
129
|
+
tickUpper: number;
|
|
130
|
+
liquidity: bigint;
|
|
131
|
+
amount0: bigint;
|
|
132
|
+
amount1: bigint;
|
|
133
|
+
} | {
|
|
134
|
+
op: "increase" | "decrease";
|
|
135
|
+
tokenId: bigint;
|
|
136
|
+
liquidity: bigint;
|
|
137
|
+
amount0: bigint;
|
|
138
|
+
amount1: bigint;
|
|
139
|
+
} | {
|
|
140
|
+
op: "burn";
|
|
141
|
+
tokenId: bigint;
|
|
142
|
+
amount0Min: bigint;
|
|
143
|
+
amount1Min: bigint;
|
|
144
|
+
}) => Action;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* The market id each adapter reports, which the owner allows with gate.setMarket(adapter, market, true).
|
|
148
|
+
* Each one matches the adapter's plan(); the tests check them against the contracts.
|
|
149
|
+
*/
|
|
150
|
+
export declare const markets: {
|
|
151
|
+
/** The pool address from the official v3 factory (UniswapV3Adapter and UniswapV3LiquidityAdapter). */
|
|
152
|
+
uniswapV3Pool: (pool: Address) => `0x${string}`;
|
|
153
|
+
/** The PoolId (UniswapV4Adapter and UniswapV4LiquidityAdapter). */
|
|
154
|
+
uniswapV4Pool: (key: PoolKey) => `0x${string}`;
|
|
155
|
+
morpho: (m: MarketParams) => `0x${string}`;
|
|
156
|
+
/** The token's bonding curve. */
|
|
157
|
+
ponsCurve: (curve: Address) => `0x${string}`;
|
|
158
|
+
/** The pair, lower address first. */
|
|
159
|
+
flapPair: (a: Address, b: Address) => `0x${string}`;
|
|
160
|
+
erc4626: (target: Address) => `0x${string}`;
|
|
161
|
+
/** Lets the transfer adapter send `token` to `to`. */
|
|
162
|
+
transfer: (token: Address, to: Address) => `0x${string}`;
|
|
163
|
+
/** The token allowed to move inside the family. */
|
|
164
|
+
familyTransfer: (token: Address) => `0x${string}`;
|
|
165
|
+
weth: () => `0x${string}`;
|
|
166
|
+
acrossRoute: (r: {
|
|
167
|
+
destinationChainId: bigint;
|
|
168
|
+
recipient: Hex;
|
|
169
|
+
inputToken: Address;
|
|
170
|
+
outputToken: Hex;
|
|
171
|
+
minRate: bigint;
|
|
172
|
+
}) => `0x${string}`;
|
|
173
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Address, type Chain } from "viem";
|
|
2
|
+
/** Robinhood Chain mainnet. */
|
|
3
|
+
export declare const robinhood: Chain;
|
|
4
|
+
/** Mortise contracts on Robinhood Chain, as in deployments/4663.json. */
|
|
5
|
+
export declare const mortise: {
|
|
6
|
+
readonly rootValidator: "0xD10b7D017C00f078F4b39c348Ba50Af9422FC6cC";
|
|
7
|
+
readonly gate: "0x5713DF62cFa2dACe935fc207543817dd6348b567";
|
|
8
|
+
readonly setup: "0x0085085ce5771B03Fb0E9f4DbA802189cb9F9Dc5";
|
|
9
|
+
readonly factory: "0xCbB00808600C62C008C9F6cd3b8A0b0a1374d3A8";
|
|
10
|
+
readonly subVaults: "0x7d42FD334B2e342234eb47c0Caf4b3012260F81b";
|
|
11
|
+
readonly signer: "0x4b26cb1c6f31d1749F741cC7dF5e25B4CbfF827a";
|
|
12
|
+
readonly timelock: "0x45d02022232D78AA78716B837DDD63fb57Af40Be";
|
|
13
|
+
readonly router: "0x34f6Da2b9EE2e97d77b0320B05A1584804f4D89d";
|
|
14
|
+
readonly uniswapV3: "0x61DCf90FeE816EbD025766663cDF0598AE916f79";
|
|
15
|
+
readonly uniswapV3Liquidity: "0x6581543E5b0b42E3dD066e1eF6AF4C6a60309aF2";
|
|
16
|
+
readonly uniswapV4: "0x0A2C90C1CF8a827515971d9913E988f716DF73f6";
|
|
17
|
+
readonly uniswapV4Liquidity: "0x0Af90790a50295D396408a71F9cCC7b49bF4ec19";
|
|
18
|
+
readonly ponsTrader: "0x86775d6Ce307aAc55a42eB86612FC2b3aB55677a";
|
|
19
|
+
readonly pons: "0x16Cb81C4C61FA7064D7325B8fA344E45833A391D";
|
|
20
|
+
readonly flap: "0x869bb75F26D03a4B23952f1A29960bE015eE2bDa";
|
|
21
|
+
readonly morphoBlue: "0xA972dF5d1196f5a0247de2d81fDAf801796C1D16";
|
|
22
|
+
readonly erc4626: "0xD4d2827b2a8580bd6DbF2F0Bdcce239F795aAa61";
|
|
23
|
+
readonly transfer: "0x9171159781C91133009EEfEb528397b256aEf347";
|
|
24
|
+
readonly weth: "0xcb7EE95d267676Cc875a64A293A353604d497F30";
|
|
25
|
+
readonly across: "0x3716d6CD2D06CEC9a1e9067eaEdD2D2F7467bD21";
|
|
26
|
+
readonly familyTransfer: "0x398f4003F11197d70744D14423114D81280B5042";
|
|
27
|
+
readonly dca: "0xC319309684725a0cF3F712F630A9e7c63ACE345a";
|
|
28
|
+
readonly automation: "0x2aFf436334EbcafA4233363fcAf95bFE63219d7d";
|
|
29
|
+
readonly rebalance: "0xe6e501a2A6422587E8c81813B805D52B4b4fFc57";
|
|
30
|
+
};
|
|
31
|
+
/** The block of the first Mortise deployment transaction, where log queries can start. */
|
|
32
|
+
export declare const deployBlock = 127492191n;
|
|
33
|
+
/** Contracts Mortise builds on. */
|
|
34
|
+
export declare const external: {
|
|
35
|
+
readonly entryPoint: "0x0000000071727De22E5E9d8BAf0edAc6f37da032";
|
|
36
|
+
readonly safe7579: "0x7579d6Dd6F1e9F57729a59049174ed6Fd7fC0003";
|
|
37
|
+
readonly weth: "0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73";
|
|
38
|
+
readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
39
|
+
};
|
|
40
|
+
/** ETH, wherever Mortise takes a token address. */
|
|
41
|
+
export declare const ETH: Address;
|
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type Account, type Address, type Chain, type Hex, type PublicClient, type Transport, type WalletClient } from "viem";
|
|
2
|
+
import type { Action } from "./actions.ts";
|
|
3
|
+
type Wallet = WalletClient<Transport, Chain, Account>;
|
|
4
|
+
/** What an adapter would do for an action: the market it needs and every call and token involved. */
|
|
5
|
+
export declare function planAction(client: PublicClient, vault: Address, action: Action): Promise<{
|
|
6
|
+
market: `0x${string}`;
|
|
7
|
+
calls: readonly {
|
|
8
|
+
target: `0x${string}`;
|
|
9
|
+
value: bigint;
|
|
10
|
+
callData: `0x${string}`;
|
|
11
|
+
}[];
|
|
12
|
+
tokens: readonly `0x${string}`[];
|
|
13
|
+
isSwap: boolean;
|
|
14
|
+
swapIn: `0x${string}`;
|
|
15
|
+
swapOut: `0x${string}`;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Runs the actions as the agent without sending anything, exactly as the Gate would, and returns each
|
|
19
|
+
* action's call results. Throws with the Gate's or adapter's error otherwise (see mortiseErrorName).
|
|
20
|
+
*/
|
|
21
|
+
export declare function simulateActions(client: PublicClient, agent: Address, vault: Address, actions: Action[]): Promise<readonly (readonly `0x${string}`[])[]>;
|
|
22
|
+
export interface ActionReceipt {
|
|
23
|
+
transactionHash: Hex;
|
|
24
|
+
gasUsed: bigint;
|
|
25
|
+
executed: {
|
|
26
|
+
adapter: Address;
|
|
27
|
+
market: Hex;
|
|
28
|
+
}[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Hooks into a send. `shouldSend` is asked right before signing and again right before broadcasting; false
|
|
32
|
+
* stops the send, so nothing goes out. `onSigned` gets the hash just before the broadcast starts.
|
|
33
|
+
*/
|
|
34
|
+
export interface SendOptions {
|
|
35
|
+
shouldSend?: () => boolean;
|
|
36
|
+
onSigned?: (hash: Hex) => void;
|
|
37
|
+
}
|
|
38
|
+
/** The transaction was mined and reverted. */
|
|
39
|
+
export declare class TransactionRevertedError extends Error {
|
|
40
|
+
readonly transactionHash: Hex;
|
|
41
|
+
constructor(hash: Hex);
|
|
42
|
+
}
|
|
43
|
+
/** Simulates, then sends the actions from the agent's own key, and returns the transaction hash at once. */
|
|
44
|
+
export declare function sendActions(client: PublicClient, wallet: Wallet, vault: Address, actions: Action[], o?: SendOptions): Promise<Hex>;
|
|
45
|
+
/** Simulates, then sends the actions from the agent's own key and waits for them. The agent pays the gas. */
|
|
46
|
+
export declare function executeActions(client: PublicClient, wallet: Wallet, vault: Address, actions: Action[]): Promise<ActionReceipt>;
|
|
47
|
+
/** Sends a trigger of an enabled module (the module decides who may trigger it, e.g. its keeper); returns the hash. */
|
|
48
|
+
export declare function sendTrigger(client: PublicClient, wallet: Wallet, vault: Address, module: Address, o?: SendOptions): Promise<Hex>;
|
|
49
|
+
/** Runs what an enabled module proposes now and waits for it. */
|
|
50
|
+
export declare function triggerModule(client: PublicClient, wallet: Wallet, vault: Address, module: Address): Promise<ActionReceipt>;
|
|
51
|
+
/** Waits for a Gate transaction and lists the actions it ran. Throws on revert or after `timeoutMs`. */
|
|
52
|
+
export declare function actionReceipt(client: PublicClient, hash: Hex, timeoutMs?: number): Promise<ActionReceipt>;
|
|
53
|
+
/**
|
|
54
|
+
* What an actor (an agent, or a module) may do in a vault right now: whether it is live, which adapters it may
|
|
55
|
+
* use and with which markets, and how much of each token is left under its caps in the current window.
|
|
56
|
+
*/
|
|
57
|
+
export declare function permissions(client: PublicClient, vault: Address, actor: Address, q: {
|
|
58
|
+
adapters: Address[];
|
|
59
|
+
tokens: Address[];
|
|
60
|
+
markets?: {
|
|
61
|
+
adapter: Address;
|
|
62
|
+
market: Hex;
|
|
63
|
+
}[];
|
|
64
|
+
}): Promise<{
|
|
65
|
+
installed: boolean;
|
|
66
|
+
live: boolean;
|
|
67
|
+
until: bigint;
|
|
68
|
+
paused: boolean;
|
|
69
|
+
openFloor: boolean;
|
|
70
|
+
adapters: {
|
|
71
|
+
adapter: `0x${string}`;
|
|
72
|
+
canUse: boolean;
|
|
73
|
+
openMarkets: boolean;
|
|
74
|
+
}[];
|
|
75
|
+
caps: {
|
|
76
|
+
token: `0x${string}`;
|
|
77
|
+
limit: bigint;
|
|
78
|
+
period: bigint;
|
|
79
|
+
used: bigint;
|
|
80
|
+
left: bigint;
|
|
81
|
+
resetsAt: bigint | undefined;
|
|
82
|
+
}[];
|
|
83
|
+
markets: {
|
|
84
|
+
allowed: boolean;
|
|
85
|
+
adapter: Address;
|
|
86
|
+
market: Hex;
|
|
87
|
+
}[];
|
|
88
|
+
}>;
|
|
89
|
+
/** The floor the vault set for selling tokenIn for tokenOut, in raw tokenOut per 1e36 raw tokenIn (0 = none). */
|
|
90
|
+
export declare function minRate(client: PublicClient, vault: Address, tokenIn: Address, tokenOut: Address): Promise<bigint>;
|
|
91
|
+
export {};
|
package/dist/calls.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
import { type Root } from "./root.ts";
|
|
3
|
+
import { type Call, type RootCall } from "./userop.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Settings of the vault's Gate. Each is a call the vault makes to the Gate, so it goes into a root userOp
|
|
6
|
+
* (or a sub-vault's exec). Rates are raw units of tokenOut per 1e36 raw units of tokenIn.
|
|
7
|
+
*/
|
|
8
|
+
export declare const gate: {
|
|
9
|
+
/** `until` is a unix time in seconds; 0 removes the agent, NEVER keeps it. */
|
|
10
|
+
setAgent: (agent: Address, until: bigint) => Call;
|
|
11
|
+
setAdapterAccess: (actor: Address, adapter: Address, allowed: boolean) => Call;
|
|
12
|
+
setMarket: (adapter: Address, market: Hex, allowed: boolean) => Call;
|
|
13
|
+
/** `limit` in raw units of `token` (address(0) is ETH), per `period` seconds. */
|
|
14
|
+
setCap: (actor: Address, token: Address, limit: bigint, period: bigint) => Call;
|
|
15
|
+
setMinRate: (tokenIn: Address, tokenOut: Address, rate: bigint) => Call;
|
|
16
|
+
setOpenMarkets: (actor: Address, adapter: Address, open: boolean) => Call;
|
|
17
|
+
setOpenFloor: (actor: Address, open: boolean) => Call;
|
|
18
|
+
setModule: (module: Address, enabled: boolean, initState?: Hex) => Call;
|
|
19
|
+
setPauser: (pauser: Address) => Call;
|
|
20
|
+
pause: (vault: Address) => Call;
|
|
21
|
+
unpause: () => Call;
|
|
22
|
+
proposeParent: (parent: Address) => Call;
|
|
23
|
+
acceptChild: (child: Address) => Call;
|
|
24
|
+
unlink: (child: Address) => Call;
|
|
25
|
+
};
|
|
26
|
+
/** An agent that never expires. */
|
|
27
|
+
export declare const NEVER: bigint;
|
|
28
|
+
/** Rate helper: the least `out` raw units for `in_` raw units, in the Gate's per-1e36 unit, rounded up. */
|
|
29
|
+
export declare function rateOf(amountIn: bigint, minAmountOut: bigint): bigint;
|
|
30
|
+
/** The vault's root and its guardians. */
|
|
31
|
+
export declare const root: {
|
|
32
|
+
setRootKey: (next: Root) => Call;
|
|
33
|
+
/** Guardians who can replace the root after `delay` seconds (7 to 90 days); an empty list removes recovery. */
|
|
34
|
+
setGuardians: (guardians: Address[], threshold: bigint, delay: bigint) => Call;
|
|
35
|
+
cancelRecovery: () => Call;
|
|
36
|
+
setPaymasterOnly: (required: boolean) => Call;
|
|
37
|
+
};
|
|
38
|
+
/** The timelock hook: install, schedule and settings. */
|
|
39
|
+
export declare const timelock: {
|
|
40
|
+
/** Installs the hook. The root validator must already be in paymaster-only mode. */
|
|
41
|
+
install: (delay: number, destinations: Address[]) => RootCall;
|
|
42
|
+
/** Schedules a root call that the timelock would refuse now; it can run once, after the delay. */
|
|
43
|
+
schedule: (later: RootCall) => Call;
|
|
44
|
+
cancel: (later: RootCall) => Call;
|
|
45
|
+
cancelAll: () => Call;
|
|
46
|
+
setDelay: (delay: number) => Call;
|
|
47
|
+
setDestination: (destination: Address, allowed: boolean) => Call;
|
|
48
|
+
};
|
|
49
|
+
/** The timelock's id of a root call: the hash of its exact callData. */
|
|
50
|
+
export declare function opId(c: RootCall): Hex;
|
|
51
|
+
/** Sub-vaults: the parent installs the module once, then creates, runs and sweeps its sub-vaults. */
|
|
52
|
+
export declare const subVaults: {
|
|
53
|
+
install: () => RootCall;
|
|
54
|
+
create: (parent: Address, salt: bigint) => Call;
|
|
55
|
+
/** Runs `calls` as the sub-vault. */
|
|
56
|
+
exec: (child: Address, calls: Call[]) => Call;
|
|
57
|
+
/** Moves the sub-vault's whole balance of each token (address(0) is ETH) back to the parent. */
|
|
58
|
+
sweep: (child: Address, tokens: Address[]) => Call;
|
|
59
|
+
};
|
|
60
|
+
/** Message signing (ERC-1271 with ERC-7739): installed as validator and as static fallback for eip712Domain. */
|
|
61
|
+
export declare const signer: {
|
|
62
|
+
installValidator: () => RootCall;
|
|
63
|
+
/** Safe7579 fallback init data: selector, call type static (0xfe), then the module's own init data. */
|
|
64
|
+
installFallback: () => RootCall;
|
|
65
|
+
};
|
|
66
|
+
/** Moving funds out of the vault. */
|
|
67
|
+
export declare const funds: {
|
|
68
|
+
sendEth: (to: Address, amount: bigint) => Call;
|
|
69
|
+
sendToken: (token: Address, to: Address, amount: bigint) => Call;
|
|
70
|
+
};
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Hex } from "viem";
|
|
2
|
+
/** A contract error decoded from its revert data, or undefined when the data matches none of them. */
|
|
3
|
+
export declare function decodeMortiseError(data: Hex): {
|
|
4
|
+
name: string;
|
|
5
|
+
args: readonly unknown[];
|
|
6
|
+
} | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* The revert data inside an error, if any. Checks the error's shape rather than its class, so it works when the
|
|
9
|
+
* error comes from another copy of viem than the SDK's own (an app that installs a different viem version).
|
|
10
|
+
*/
|
|
11
|
+
export declare function revertData(err: unknown): Hex | undefined;
|
|
12
|
+
/** The Mortise error name behind a failed call, such as "CapExceeded", or undefined. */
|
|
13
|
+
export declare function mortiseErrorName(err: unknown): string | undefined;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./abis.ts";
|
|
2
|
+
export * from "./addresses.ts";
|
|
3
|
+
export * from "./root.ts";
|
|
4
|
+
export * from "./userop.ts";
|
|
5
|
+
export * from "./calls.ts";
|
|
6
|
+
export * from "./actions.ts";
|
|
7
|
+
export * from "./agent.ts";
|
|
8
|
+
export * from "./vault.ts";
|
|
9
|
+
export * from "./modules.ts";
|
|
10
|
+
export * from "./errors.ts";
|