@continuumdao/ctm-mpc-defi 0.1.4 → 0.2.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/README.md +20 -78
- package/dist/agent/catalog.cjs +1388 -144
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +881 -17
- package/dist/agent/catalog.js +1327 -145
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/aave-v4/SKILL.md +43 -0
- package/dist/agent/skills/curve-dao/SKILL.md +12 -0
- package/dist/agent/skills/ethena/SKILL.md +10 -0
- package/dist/agent/skills/euler-v2/SKILL.md +10 -0
- package/dist/agent/skills/lido/SKILL.md +22 -0
- package/dist/agent/skills/maple-syrup/SKILL.md +10 -0
- package/dist/agent/skills/sky/SKILL.md +10 -0
- package/dist/agent/skills/uniswap-v4/SKILL.md +22 -0
- package/dist/chains/evm/index.cjs +27 -213
- package/dist/chains/evm/index.cjs.map +1 -1
- package/dist/chains/evm/index.d.ts +15 -25
- package/dist/chains/evm/index.js +21 -199
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/chains/near/index.d.ts +1 -1
- package/dist/chains/solana/index.d.ts +1 -1
- package/dist/core/index.cjs +8 -110
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +5 -39
- package/dist/core/index.js +6 -100
- package/dist/core/index.js.map +1 -1
- package/dist/{envelope-CcE5Cz_q.d.ts → envelope-CpBUh9eP.d.ts} +1 -1
- package/dist/index.cjs +238 -1184
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -10
- package/dist/index.js +227 -1156
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs +1710 -0
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -0
- package/dist/protocols/evm/aave-v4/index.d.ts +499 -0
- package/dist/protocols/evm/aave-v4/index.js +1666 -0
- package/dist/protocols/evm/aave-v4/index.js.map +1 -0
- package/dist/protocols/evm/curve-dao/index.cjs +24 -124
- package/dist/protocols/evm/curve-dao/index.cjs.map +1 -1
- package/dist/protocols/evm/curve-dao/index.d.ts +3 -4
- package/dist/protocols/evm/curve-dao/index.js +15 -115
- package/dist/protocols/evm/curve-dao/index.js.map +1 -1
- package/dist/protocols/evm/ethena/index.cjs +853 -0
- package/dist/protocols/evm/ethena/index.cjs.map +1 -0
- package/dist/protocols/evm/ethena/index.d.ts +160 -0
- package/dist/protocols/evm/ethena/index.js +831 -0
- package/dist/protocols/evm/ethena/index.js.map +1 -0
- package/dist/protocols/evm/euler-v2/index.cjs +1585 -0
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -0
- package/dist/protocols/evm/euler-v2/index.d.ts +316 -0
- package/dist/protocols/evm/euler-v2/index.js +1560 -0
- package/dist/protocols/evm/euler-v2/index.js.map +1 -0
- package/dist/protocols/evm/lido/index.cjs +839 -0
- package/dist/protocols/evm/lido/index.cjs.map +1 -0
- package/dist/protocols/evm/lido/index.d.ts +119 -0
- package/dist/protocols/evm/lido/index.js +814 -0
- package/dist/protocols/evm/lido/index.js.map +1 -0
- package/dist/protocols/evm/maple/index.cjs +619 -0
- package/dist/protocols/evm/maple/index.cjs.map +1 -0
- package/dist/protocols/evm/maple/index.d.ts +108 -0
- package/dist/protocols/evm/maple/index.js +605 -0
- package/dist/protocols/evm/maple/index.js.map +1 -0
- package/dist/protocols/evm/sky/index.cjs +1259 -0
- package/dist/protocols/evm/sky/index.cjs.map +1 -0
- package/dist/protocols/evm/sky/index.d.ts +217 -0
- package/dist/protocols/evm/sky/index.js +1234 -0
- package/dist/protocols/evm/sky/index.js.map +1 -0
- package/dist/protocols/evm/uniswap-v4/index.cjs +423 -658
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.d.ts +3 -4
- package/dist/protocols/evm/uniswap-v4/index.js +422 -657
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/dist/{registry-oMKlO_5z.d.ts → registry-Bv5o37_w.d.ts} +1 -1
- package/dist/{types-Ce2qNHai.d.cts → types-BfjWdw1j.d.ts} +3 -1
- package/dist/{types-5u863Fd9.d.ts → types-DUeNJLr9.d.ts} +1 -1
- package/package.json +43 -8
- package/dist/agent/catalog.d.cts +0 -195
- package/dist/chains/evm/index.d.cts +0 -62
- package/dist/chains/near/index.d.cts +0 -37
- package/dist/chains/solana/index.d.cts +0 -40
- package/dist/core/index.d.cts +0 -43
- package/dist/envelope-DYDPnrHZ.d.cts +0 -35
- package/dist/index.d.cts +0 -15
- package/dist/keygen-CfNp8yKJ.d.cts +0 -9
- package/dist/keygen-DsINazx8.d.ts +0 -9
- package/dist/nodeRead-BnmSaMGO.d.cts +0 -8
- package/dist/nodeRead-BnmSaMGO.d.ts +0 -8
- package/dist/protocols/evm/curve-dao/index.d.cts +0 -147
- package/dist/protocols/evm/uniswap-v4/index.d.cts +0 -324
- package/dist/registry-BwZoE668.d.cts +0 -8
- package/dist/txParams-BC7ogvdR.d.cts +0 -19
- package/dist/txParams-BC7ogvdR.d.ts +0 -19
- package/dist/types-B8idm_gu.d.cts +0 -34
- package/dist/types-Ce2qNHai.d.ts +0 -57
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { M as MultisignBuildResult, d as ProtocolModule } from '../../../types-Ce2qNHai.cjs';
|
|
2
|
-
import { K as KeyGenSubsetForPermit } from '../../../keygen-CfNp8yKJ.cjs';
|
|
3
|
-
import { E as EvmChainDetail } from '../../../types-B8idm_gu.cjs';
|
|
4
|
-
import { Address } from 'viem';
|
|
5
|
-
export { P as ProposalTxParams } from '../../../txParams-BC7ogvdR.cjs';
|
|
6
|
-
|
|
7
|
-
declare function isCurveApiChainSupported(chainId: string | number | bigint | null | undefined): boolean;
|
|
8
|
-
|
|
9
|
-
declare const CURVE_NATIVE_PLACEHOLDER = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
10
|
-
/** Map token in list to the address shape Curve uses in pool graphs (native → 0xeeee…). */
|
|
11
|
-
declare function toCurveTokenKey(tokenInAddress: string, wrappedNative: string | undefined): string;
|
|
12
|
-
/**
|
|
13
|
-
* Router / `getBestRouteAndOutput` expect the same coin id as the pool graph: wrapped native
|
|
14
|
-
* is represented as `0xeeee…`, not the WETH (etc.) contract. Without this, route discovery can
|
|
15
|
-
* return an empty route while BFS (which uses `toCurveTokenKey`) still finds a path.
|
|
16
|
-
*/
|
|
17
|
-
declare function toCurveRouterTokenId(tokenAddress: string, wrappedNative: string | undefined): string;
|
|
18
|
-
/**
|
|
19
|
-
* Turn the user’s decimal string into a canonical form using **this chain’s** token-in decimals
|
|
20
|
-
* (from the asset row). `@curvefi/api` uses the same for `parseUnits` when building routes; an
|
|
21
|
-
* over-long fraction (e.g. 1e-8 on USDC) can make internal calls fail and yield an empty route / 0.0.
|
|
22
|
-
*/
|
|
23
|
-
declare function normalizeCurveRouterAmountString(raw: string, tokenInDecimals: number): string;
|
|
24
|
-
/**
|
|
25
|
-
* Build graph from the same pool list the Curve router uses (`getPool` / `getPoolList` on the
|
|
26
|
-
* public `@curvefi/api` instance; `getPoolsData` is internal).
|
|
27
|
-
*/
|
|
28
|
-
declare function buildCurveLiquidityGraphFromApi(curve: {
|
|
29
|
-
getPoolList: () => string[];
|
|
30
|
-
getPool: (id: string) => {
|
|
31
|
-
underlyingCoinAddresses: string[] | undefined;
|
|
32
|
-
wrappedCoinAddresses: string[] | undefined;
|
|
33
|
-
};
|
|
34
|
-
}): Map<string, Set<string>>;
|
|
35
|
-
/**
|
|
36
|
-
* Add bidirectional edge between the SDK's native placeholder coin and WETH, when the chain uses
|
|
37
|
-
* wrapped native in pools (mirrors the Curve dialog graph).
|
|
38
|
-
*/
|
|
39
|
-
declare function addNativeWethBridge(adj: Map<string, Set<string>>, wrappedNative: string | undefined): void;
|
|
40
|
-
/** True when the token key appears in the graph with at least one swap neighbor. */
|
|
41
|
-
declare function isCurveTokenKeySwappable(swappableNodeKeys: ReadonlySet<string>, graphTokenKey: string): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* All token keys in `adj` that have at least one pool neighbor (candidates to start a path from).
|
|
44
|
-
*/
|
|
45
|
-
declare function swappableCurveGraphNodeKeys(adj: Map<string, Set<string>>): Set<string>;
|
|
46
|
-
/**
|
|
47
|
-
* All tokens in the same connected component as `start` (excluding `start`), for router discovery.
|
|
48
|
-
*/
|
|
49
|
-
declare function bfsCurveSwapDestinations(adj: Map<string, Set<string>>, start: string): Set<string>;
|
|
50
|
-
type CurveDestToken = {
|
|
51
|
-
address: string;
|
|
52
|
-
symbol: string;
|
|
53
|
-
name: string;
|
|
54
|
-
/** From Curve `getCoinsData` (on-chain), when available. */
|
|
55
|
-
decimals: number | null;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/** Live `@curvefi/api` instance with pools already fetched, plus the routing graph. */
|
|
59
|
-
type CurveFullSession = {
|
|
60
|
-
/** Same reference used for getCoinsData / router; pools already loaded. */
|
|
61
|
-
curve: any;
|
|
62
|
-
adj: Map<string, Set<string>>;
|
|
63
|
-
swappableNodeKeys: ReadonlySet<string>;
|
|
64
|
-
wrappedNative: string | undefined;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Fetches all factory pools in parallel (best-effort; failures are ignored per factory,
|
|
68
|
-
* same as the Curve dialog).
|
|
69
|
-
*/
|
|
70
|
-
declare function fetchAllCurvePools(curve: {
|
|
71
|
-
factory: {
|
|
72
|
-
fetchPools: () => Promise<unknown>;
|
|
73
|
-
};
|
|
74
|
-
crvUSDFactory: {
|
|
75
|
-
fetchPools: () => Promise<unknown>;
|
|
76
|
-
};
|
|
77
|
-
EYWAFactory: {
|
|
78
|
-
fetchPools: () => Promise<unknown>;
|
|
79
|
-
};
|
|
80
|
-
cryptoFactory: {
|
|
81
|
-
fetchPools: () => Promise<unknown>;
|
|
82
|
-
};
|
|
83
|
-
twocryptoFactory: {
|
|
84
|
-
fetchPools: () => Promise<unknown>;
|
|
85
|
-
};
|
|
86
|
-
tricryptoFactory: {
|
|
87
|
-
fetchPools: () => Promise<unknown>;
|
|
88
|
-
};
|
|
89
|
-
stableNgFactory: {
|
|
90
|
-
fetchPools: () => Promise<unknown>;
|
|
91
|
-
};
|
|
92
|
-
}): Promise<void>;
|
|
93
|
-
/**
|
|
94
|
-
* One init + `fetchAllCurvePools` + graph build. Reuse this session for the asset list and the
|
|
95
|
-
* Curve dialog to avoid duplicating the Curve API work.
|
|
96
|
-
*/
|
|
97
|
-
declare function loadFullCurveSessionForRpc(rpcUrl: string): Promise<CurveFullSession | null>;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* One-line prefill for multi-sign "Purpose" on Curve (DAO) swap (user may add detail below).
|
|
101
|
-
* Matches the spirit of `buildUniswapV4PurposePrefill` for Uniswap.
|
|
102
|
-
*/
|
|
103
|
-
declare function buildCurveDaoPurposePrefill(args: {
|
|
104
|
-
tokenInSymbol: string;
|
|
105
|
-
tokenOutSymbol: string;
|
|
106
|
-
amountIn: string;
|
|
107
|
-
/** Quoted output from `getBestRouteAndOutput` (decimal string, no symbol). */
|
|
108
|
-
quoteOutAmount: string | null;
|
|
109
|
-
slippageInput: string;
|
|
110
|
-
chainName: string;
|
|
111
|
-
chainId: number;
|
|
112
|
-
}): string;
|
|
113
|
-
|
|
114
|
-
declare const CURVE_ROUTER_EXCHANGE_DEFAULT_GAS_UNITS = 1200000n;
|
|
115
|
-
declare function isCurveDaoSwapEvmSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): boolean;
|
|
116
|
-
declare function isCurveDaoErc20ApproveEvmSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): boolean;
|
|
117
|
-
declare function resolveCurveDaoRouterGasUnitsFromSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): bigint | null;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Build `POST /multiSignRequest` body: optional ERC-20 approve(s) to the Curve router, then
|
|
121
|
-
* `CurveRouterNG.exchange` via `@curvefi/api` `router.populateSwap`.
|
|
122
|
-
*/
|
|
123
|
-
declare function buildEvmMultisignBodyCurveDaoBatch(args: {
|
|
124
|
-
keyGen: KeyGenSubsetForPermit;
|
|
125
|
-
chainId: number;
|
|
126
|
-
rpcUrl: string;
|
|
127
|
-
chainDetail: EvmChainDetail;
|
|
128
|
-
useCustomGas: boolean;
|
|
129
|
-
customGasChainDetails?: Record<string, unknown> | null;
|
|
130
|
-
tokenIn: Address;
|
|
131
|
-
tokenOut: string;
|
|
132
|
-
amountHuman: string;
|
|
133
|
-
slippagePercent: number;
|
|
134
|
-
executorAddress: Address;
|
|
135
|
-
purposeText: string;
|
|
136
|
-
}): Promise<MultisignBuildResult>;
|
|
137
|
-
|
|
138
|
-
declare const CURVE_DAO_PROTOCOL_ID = "curve-dao";
|
|
139
|
-
declare const curveDaoProtocolModule: ProtocolModule;
|
|
140
|
-
|
|
141
|
-
declare const curveDao: {
|
|
142
|
-
buildSwapMultisignBody: typeof buildEvmMultisignBodyCurveDaoBatch;
|
|
143
|
-
isChainSupported: typeof isCurveApiChainSupported;
|
|
144
|
-
loadSession: typeof loadFullCurveSessionForRpc;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export { CURVE_DAO_PROTOCOL_ID, CURVE_NATIVE_PLACEHOLDER, CURVE_ROUTER_EXCHANGE_DEFAULT_GAS_UNITS, type CurveDestToken, type CurveFullSession, addNativeWethBridge, bfsCurveSwapDestinations, buildCurveDaoPurposePrefill, buildCurveLiquidityGraphFromApi, buildEvmMultisignBodyCurveDaoBatch, curveDao, curveDaoProtocolModule, fetchAllCurvePools, isCurveApiChainSupported, isCurveApiChainSupported as isCurveDaoChainSupported, isCurveDaoErc20ApproveEvmSignRequest, isCurveDaoSwapEvmSignRequest, isCurveTokenKeySwappable, loadFullCurveSessionForRpc, normalizeCurveRouterAmountString, resolveCurveDaoRouterGasUnitsFromSignRequest, swappableCurveGraphNodeKeys, toCurveRouterTokenId, toCurveTokenKey };
|
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
import { d as ProtocolModule } from '../../../types-Ce2qNHai.cjs';
|
|
2
|
-
import { Address } from 'viem';
|
|
3
|
-
import { N as NodeReadAuth } from '../../../nodeRead-BnmSaMGO.cjs';
|
|
4
|
-
import { K as KeyGenSubsetForPermit } from '../../../keygen-CfNp8yKJ.cjs';
|
|
5
|
-
import { E as EvmChainDetail } from '../../../types-B8idm_gu.cjs';
|
|
6
|
-
|
|
7
|
-
/** Canonical Uniswap token-allowance contract on most EVM chains. */
|
|
8
|
-
declare const PERMIT2_ADDRESS: Address;
|
|
9
|
-
declare function isUniswapV4ChainSupported(chainId: string | number | bigint | null | undefined): boolean;
|
|
10
|
-
declare function getUniswapUniversalRouterSpenderOrThrow(chainId: number): Address;
|
|
11
|
-
declare const MAX_UINT160: bigint;
|
|
12
|
-
declare const MAX_UINT48: bigint;
|
|
13
|
-
declare const UNISWAP_UNIVERSAL_ROUTER_DEFAULT_GAS_UNITS = 1500000n;
|
|
14
|
-
declare const UNISWAP_TRADE_BASE_DEFAULT = "https://trade-api.gateway.uniswap.org/v1";
|
|
15
|
-
declare const UNISWAP_UNIVERSAL_ROUTER_VERSION_DEFAULT = "2.0";
|
|
16
|
-
declare const UNISWAP_SWAP_DEFAULT_EXPIRY_MINUTES = 30;
|
|
17
|
-
declare const UNISWAP_SWAP_DEFAULT_DEADLINE_SEC_OFFSET: number;
|
|
18
|
-
|
|
19
|
-
/** POST /v1/quote `type` (same as `uniswap_trade_quote.py` `--type`). */
|
|
20
|
-
type UniswapQuoteTradeType = 'EXACT_INPUT' | 'EXACT_OUTPUT';
|
|
21
|
-
/** Parse chain id like Python: decimal or 0x hex. */
|
|
22
|
-
declare function parseUniswapChainId(value: string | number): number;
|
|
23
|
-
/** `tokenIn` is the EVM address `0x0` used by the Trade API for the chain’s native (gas) token. */
|
|
24
|
-
declare function isUniswapTokenInAddressNative(tokenIn: string | undefined | null): boolean;
|
|
25
|
-
/** `fullQuote` / stored quote response: top-level or nested has `quote.input` with a native or ERC-20 address. */
|
|
26
|
-
declare function isUniswapFullQuoteResponseNativeIn(stored: Record<string, unknown> | null | undefined): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* GET /getKeyGenResultById and return `ethereumaddress` (swapper), same as
|
|
29
|
-
* `uniswap_mpc_helpers.resolve_owner_from_keygen` in mpc-config.
|
|
30
|
-
*/
|
|
31
|
-
declare function fetchEthereumAddressForKeyGen(managementNodeUrl: string, keyGenId: string, readAuth?: NodeReadAuth, init?: RequestInit): Promise<string>;
|
|
32
|
-
interface UniswapTradeQuoteParams {
|
|
33
|
-
amount: string;
|
|
34
|
-
tokenIn: string;
|
|
35
|
-
tokenOut: string;
|
|
36
|
-
uniswapApiKey: string;
|
|
37
|
-
/**
|
|
38
|
-
* KeyGen id — used to resolve `swapper` from GET /getKeyGenResultById unless `swapper` is set.
|
|
39
|
-
* Required unless `swapper` is set.
|
|
40
|
-
*/
|
|
41
|
-
keyGen?: string;
|
|
42
|
-
type: UniswapQuoteTradeType;
|
|
43
|
-
/**
|
|
44
|
-
* Slippage as percent, e.g. `0.5` for 0.5%. If omitted, the body uses
|
|
45
|
-
* `autoSlippage: "DEFAULT"` (same as the Python script when `--slippage` is not set).
|
|
46
|
-
*/
|
|
47
|
-
slippage?: number | string;
|
|
48
|
-
/**
|
|
49
|
-
* Chain id for the input side (`tokenInChainId` in the HTTP body; Python `--chain-id`).
|
|
50
|
-
* You may set **`chainId` or `tokenInChainId`** (same meaning); if both are set, `chainId` wins.
|
|
51
|
-
* Same-chain quote: set one chain here and omit `tokenOutChainId` (or set both to the same id).
|
|
52
|
-
*/
|
|
53
|
-
chainId?: string | number;
|
|
54
|
-
/**
|
|
55
|
-
* Same as `chainId` (input chain). If `chainId` is omitted, this must be set.
|
|
56
|
-
*/
|
|
57
|
-
tokenInChainId?: string | number;
|
|
58
|
-
/**
|
|
59
|
-
* Output chain id; defaults to the input chain when omitted (Python: empty `--token-out-chain-id`).
|
|
60
|
-
*/
|
|
61
|
-
tokenOutChainId?: string | number;
|
|
62
|
-
/**
|
|
63
|
-
* When `true`, sends `x-permit2-disabled: true` (Uniswap’s header for classic ERC-20 allowance; no permitData in the response).
|
|
64
|
-
* Omit or set `false` for the default Trade API routing (default).
|
|
65
|
-
*/
|
|
66
|
-
permit2Disabled?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* MPC wallet (swapper) address. If omitted, `managementNodeUrl` is used with `keyGen`
|
|
69
|
-
* to call GET /getKeyGenResultById.
|
|
70
|
-
*/
|
|
71
|
-
swapper?: `0x${string}` | string;
|
|
72
|
-
/**
|
|
73
|
-
* Management node base URL (MPC), required when `swapper` is not provided.
|
|
74
|
-
*/
|
|
75
|
-
managementNodeUrl?: string;
|
|
76
|
-
/** For Browser HTTPS: Bearer on GET to /getKeyGenResultById. */
|
|
77
|
-
nodeReadAuth?: NodeReadAuth;
|
|
78
|
-
/** Trade API base without `/quote` (default: Uniswap gateway v1). */
|
|
79
|
-
baseUrl?: string;
|
|
80
|
-
/** `x-universal-router-version` (default `2.0`, aligned with Python / v4). */
|
|
81
|
-
universalRouterVersion?: string;
|
|
82
|
-
signal?: AbortSignal;
|
|
83
|
-
/** Override for tests. */
|
|
84
|
-
fetchImpl?: typeof fetch;
|
|
85
|
-
}
|
|
86
|
-
declare function buildUniswapQuoteRequestBody(args: Pick<UniswapTradeQuoteParams, 'type' | 'amount' | 'tokenIn' | 'tokenOut' | 'slippage' | 'chainId' | 'tokenInChainId' | 'tokenOutChainId'> & {
|
|
87
|
-
swapper: string;
|
|
88
|
-
}): Record<string, unknown>;
|
|
89
|
-
/**
|
|
90
|
-
* Pull a user-facing string from Uniswap / generic JSON error bodies.
|
|
91
|
-
*/
|
|
92
|
-
declare function errorMessageFromUniswapJsonBody(value: unknown): string | null;
|
|
93
|
-
/**
|
|
94
|
-
* User-facing string from an HTTP body: JSON `message` / `error` / `detail` first,
|
|
95
|
-
* else a short plain-text / HTML page title, not the raw document (avoids huge HTML in UI).
|
|
96
|
-
*/
|
|
97
|
-
declare function messageFromUniswapHttpResponseBody(text: string, status: number, statusText?: string): string;
|
|
98
|
-
/**
|
|
99
|
-
* `POST` Uniswap Trade API `/v1/quote` — TypeScript version of
|
|
100
|
-
* `mpc-config/recipes/uniswapV4/uniswap_trade_quote.py` (core HTTP call + KeyGen → swapper).
|
|
101
|
-
*
|
|
102
|
-
* CORS: calling the Trade API from a browser may be blocked. Prefer a server / route
|
|
103
|
-
* handler, or use this in Node. KeyGen resolution uses a GET to your management node
|
|
104
|
-
* and follows the same read-auth pattern as the app.
|
|
105
|
-
*/
|
|
106
|
-
declare function uniswapTradeQuote(args: UniswapTradeQuoteParams): Promise<Record<string, unknown>>;
|
|
107
|
-
/**
|
|
108
|
-
* Single-line JSON for mpc-config `uniswap_trade_swap.py --quote-json` (compact quote body).
|
|
109
|
-
*/
|
|
110
|
-
declare function uniswapQuoteToJsonQuoteOneLine(quote: Record<string, unknown>): string;
|
|
111
|
-
/**
|
|
112
|
-
* `quote.input.amount` / `quote.output.amount` as bigints, if present (classic response).
|
|
113
|
-
*/
|
|
114
|
-
declare function parseUniswapQuoteClassicInOut(res: Record<string, unknown>): {
|
|
115
|
-
inputWei: bigint;
|
|
116
|
-
outputWei: bigint;
|
|
117
|
-
} | null;
|
|
118
|
-
/**
|
|
119
|
-
* Fields from Uniswap Trade API `200` `quote` (e.g. {@link https://api-docs.uniswap.org/api-reference/swapping/quote} `ClassicQuote`):
|
|
120
|
-
* - `slippage` — slippage tolerance (percent) used for the quote
|
|
121
|
-
* - `priceImpact` — “impact the trade has on the market price of the pool, between 0-100 percent”
|
|
122
|
-
*/
|
|
123
|
-
declare function parseUniswapQuoteSlippageInfo(res: Record<string, unknown>): {
|
|
124
|
-
slippageTolerancePercent: number | null;
|
|
125
|
-
priceImpactPercent: number | null;
|
|
126
|
-
};
|
|
127
|
-
/** Compact percent for UI (e.g. 0.5, 1.2345). */
|
|
128
|
-
declare function formatUniswapPercentForUi(n: number): string;
|
|
129
|
-
/** Human string for a modal amount field, trimmed of trailing fraction zeros. */
|
|
130
|
-
declare function formatUniswapAmountFieldFromWei(wei: bigint, decimals: number): string;
|
|
131
|
-
/**
|
|
132
|
-
* One-line prefill for multi-sign "purpose" (user may append context below in the same field).
|
|
133
|
-
*/
|
|
134
|
-
declare function buildUniswapV4PurposePrefill(args: {
|
|
135
|
-
tradeType: UniswapQuoteTradeType;
|
|
136
|
-
tokenInSymbol: string;
|
|
137
|
-
tokenOutSymbol: string;
|
|
138
|
-
tokenInDecimals: number;
|
|
139
|
-
tokenOutDecimals: number;
|
|
140
|
-
amountInput: string;
|
|
141
|
-
quote: Record<string, unknown> | null;
|
|
142
|
-
slippageInput: string;
|
|
143
|
-
chainName: string;
|
|
144
|
-
chainId: number;
|
|
145
|
-
}): string;
|
|
146
|
-
/**
|
|
147
|
-
* Human-readable lines from a Trade API `/quote` 200 JSON body.
|
|
148
|
-
* Classic quotes expose `quote.input` / `quote.output` with `amount` (base units as string).
|
|
149
|
-
*/
|
|
150
|
-
declare function formatUniswapQuoteForDisplay(res: Record<string, unknown>, args: {
|
|
151
|
-
tradeType: UniswapQuoteTradeType;
|
|
152
|
-
tokenInDecimals: number;
|
|
153
|
-
tokenOutDecimals: number;
|
|
154
|
-
tokenInSymbol: string;
|
|
155
|
-
tokenOutSymbol: string;
|
|
156
|
-
}): {
|
|
157
|
-
title: string;
|
|
158
|
-
lines: string[];
|
|
159
|
-
rawJson: string;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* When `batchIndex` is set, check `batchMeta[i].evm`. Without `batchIndex`, also check `batchMeta[0]`
|
|
164
|
-
* (native ETH-in single-tx requests store evm only under batchMeta, not top-level extraJSON.evm).
|
|
165
|
-
*/
|
|
166
|
-
declare function isUniswapV4SwapEvmSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): boolean;
|
|
167
|
-
/**
|
|
168
|
-
* Gas units for Get Sig without `eth_estimateGas` (same calldata often reverts on estimate).
|
|
169
|
-
* Order: proposal row[i] (or [0] / single `txParams`) / ExtraJSON uniswapV4 (audit, quote).
|
|
170
|
-
* Pass `batchIndex` when the sign request is a multi-tx batch.
|
|
171
|
-
*/
|
|
172
|
-
declare function resolveRouterSwapGasUnitsFromSignRequest(detail: Record<string, unknown> | null | undefined, batchIndex?: number): bigint | null;
|
|
173
|
-
|
|
174
|
-
/** `deadline` = `now` + `expiryMinutes * 60` (seconds). */
|
|
175
|
-
declare function swapTransactionDeadlineUnixFromExpiryMinutes(expiryMinutes: number, nowSec?: number): number;
|
|
176
|
-
/** The stored `uniswapTradeQuote` is the full `POST /quote` JSON; `/swap` wants the **inner** classic quote. */
|
|
177
|
-
declare function getClassicQuoteFromStoredUniswapResponse(stored: Record<string, unknown> | null | undefined): unknown;
|
|
178
|
-
type TransactionRequest = {
|
|
179
|
-
to: string;
|
|
180
|
-
from?: string;
|
|
181
|
-
data: string;
|
|
182
|
-
value: string;
|
|
183
|
-
/** Trade API or eth-style field name */
|
|
184
|
-
gasLimit?: string;
|
|
185
|
-
gas?: string;
|
|
186
|
-
chainId?: number;
|
|
187
|
-
};
|
|
188
|
-
type CreateSwapResponse = {
|
|
189
|
-
requestId?: string;
|
|
190
|
-
swap: TransactionRequest;
|
|
191
|
-
gasFee?: string;
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* `POST /v1/swap` — builds swap calldata (Universal Router) from a quote fetched with classic-allowance header `x-permit2-disabled: true`.
|
|
195
|
-
* @see https://api-docs.uniswap.org/api-reference/swapping/swap
|
|
196
|
-
*/
|
|
197
|
-
declare function uniswapCreateSwap(args: {
|
|
198
|
-
uniswapApiKey: string;
|
|
199
|
-
baseUrl?: string;
|
|
200
|
-
/** Full `POST /quote` JSON (must include classic `quote`). */
|
|
201
|
-
fullQuoteFromPermit: Record<string, unknown>;
|
|
202
|
-
universalRouterVersion?: string;
|
|
203
|
-
fetchImpl?: typeof fetch;
|
|
204
|
-
/**
|
|
205
|
-
* In the browser, direct `POST` to `trade-api.gateway.uniswap.org` is blocked by CORS.
|
|
206
|
-
* When true (default in browser), the request goes to same-origin `POST /api/uniswap/swap` which proxies server-side. Set `false` to force a direct call (e.g. tests, Node scripts).
|
|
207
|
-
*/
|
|
208
|
-
useServerProxy?: boolean;
|
|
209
|
-
/**
|
|
210
|
-
* Universal Router swap deadline (unix seconds). Defaults to now + {@link UNISWAP_SWAP_DEFAULT_DEADLINE_SEC_OFFSET}.
|
|
211
|
-
* Omitting this caused short API defaults and `TransactionDeadlinePassed` after MPC delay.
|
|
212
|
-
*/
|
|
213
|
-
swapTransactionDeadlineUnix?: number;
|
|
214
|
-
}): Promise<CreateSwapResponse>;
|
|
215
|
-
type ChainRow = {
|
|
216
|
-
legacy?: boolean;
|
|
217
|
-
gasLimit?: number;
|
|
218
|
-
gasMultiplier?: number;
|
|
219
|
-
gasPrice?: number;
|
|
220
|
-
baseFee?: number;
|
|
221
|
-
priorityFee?: number;
|
|
222
|
-
baseFeeMultiplier?: number;
|
|
223
|
-
};
|
|
224
|
-
/**
|
|
225
|
-
* Apply UI slippage % on top of the base approve amount (EXACT_OUTPUT only at call sites; basis points, ceil wei).
|
|
226
|
-
* Example: 0.5% → multiply by 1.005 (10050/10000). `undefined` / non‑positive leaves `baseWei` unchanged.
|
|
227
|
-
*/
|
|
228
|
-
declare function applySlippagePercentToApproveWei(baseWei: bigint, slippagePercent: number | undefined): bigint;
|
|
229
|
-
type UniswapV4SkipPermit2BatchArg = {
|
|
230
|
-
keyGen: KeyGenSubsetForPermit;
|
|
231
|
-
chainId: number;
|
|
232
|
-
rpcUrl: string;
|
|
233
|
-
chainDetail: ChainRow;
|
|
234
|
-
useCustomGas: boolean;
|
|
235
|
-
customGasChainDetails?: Record<string, unknown> | null;
|
|
236
|
-
/** `0x0` = native (ETH) in; otherwise ERC-20. */
|
|
237
|
-
tokenIn: Address;
|
|
238
|
-
executorAddress: Address;
|
|
239
|
-
swap: TransactionRequest;
|
|
240
|
-
createSwapResponse: {
|
|
241
|
-
requestId?: string;
|
|
242
|
-
gasFee?: string;
|
|
243
|
-
swap: TransactionRequest;
|
|
244
|
-
};
|
|
245
|
-
fullQuoteSnapshot: Record<string, unknown>;
|
|
246
|
-
purposeText: string;
|
|
247
|
-
swapDeadlineUnix: number;
|
|
248
|
-
slippagePercent?: number;
|
|
249
|
-
};
|
|
250
|
-
/**
|
|
251
|
-
* **Classic ERC-20 allowance** batch (on-chain approvals only), two shapes:
|
|
252
|
-
*
|
|
253
|
-
* - **`swap.to` == inner `router` (calldata arg)** — Universal Router is the tx target; tokens move via the **allowance hub**:
|
|
254
|
-
* `ERC20→hub`, hub `approve(router)`, swap (3 txs).
|
|
255
|
-
*
|
|
256
|
-
* - **`swap.to` ≠ inner `router`** — Trade uses a **dispatcher** that calls `ERC20.transferFrom` with **`msg.sender` = `swap.to`**.
|
|
257
|
-
* Approving only the hub is insufficient (`cast run` shows `transfer amount exceeds allowance`). Path:
|
|
258
|
-
* `ERC20.approve(swap.to)`, swap (2 txs).
|
|
259
|
-
*
|
|
260
|
-
* Approved amount: `max(quote.input, calldata amount)`; with **EXACT_OUTPUT** trades, multiply by `(1 + slippage%)` from the quote modal (input can grow vs the quoted figure).
|
|
261
|
-
*/
|
|
262
|
-
declare function buildEvmMultisignBodyUniswapV4SkipPermit2Batch(args: UniswapV4SkipPermit2BatchArg): Promise<{
|
|
263
|
-
bodyForSign: Record<string, unknown>;
|
|
264
|
-
messageToSign: string;
|
|
265
|
-
}>;
|
|
266
|
-
|
|
267
|
-
type UniswapV4SessionPayload = {
|
|
268
|
-
chainId: number;
|
|
269
|
-
rpcUrl: string;
|
|
270
|
-
chainSupported: boolean;
|
|
271
|
-
universalRouter?: string;
|
|
272
|
-
};
|
|
273
|
-
declare function computeUniswapV4Session(args: {
|
|
274
|
-
assetsChainId: string | number;
|
|
275
|
-
rpcUrl: string | undefined;
|
|
276
|
-
protocolEnabled: boolean;
|
|
277
|
-
}): UniswapV4SessionPayload;
|
|
278
|
-
|
|
279
|
-
type SwapExactInputArgs = {
|
|
280
|
-
keyGen: KeyGenSubsetForPermit;
|
|
281
|
-
purposeText: string;
|
|
282
|
-
chainId: number;
|
|
283
|
-
rpcUrl: string;
|
|
284
|
-
executorAddress: Address;
|
|
285
|
-
chainDetail: EvmChainDetail;
|
|
286
|
-
useCustomGas: boolean;
|
|
287
|
-
customGasChainDetails?: Record<string, unknown> | null;
|
|
288
|
-
tokenIn: Address;
|
|
289
|
-
uniswapApiKey: string;
|
|
290
|
-
fullQuote: Record<string, unknown>;
|
|
291
|
-
slippagePercent?: number;
|
|
292
|
-
swapTransactionDeadlineUnix?: number;
|
|
293
|
-
baseUrl?: string;
|
|
294
|
-
};
|
|
295
|
-
/** Quote then build swap multisign body for EXACT_INPUT (caller must have fetched quote first for EXACT_OUTPUT). */
|
|
296
|
-
declare function swapFromQuote(args: SwapExactInputArgs & {
|
|
297
|
-
swap: Awaited<ReturnType<typeof uniswapCreateSwap>>;
|
|
298
|
-
}): Promise<{
|
|
299
|
-
bodyForSign: Record<string, unknown>;
|
|
300
|
-
messageToSign: string;
|
|
301
|
-
}>;
|
|
302
|
-
declare function quoteSwap(args: Parameters<typeof uniswapTradeQuote>[0]): Promise<Record<string, unknown>>;
|
|
303
|
-
declare function createSwap(args: Parameters<typeof uniswapCreateSwap>[0]): Promise<Awaited<ReturnType<typeof uniswapCreateSwap>>>;
|
|
304
|
-
declare function swapExactInput(args: SwapExactInputArgs & {
|
|
305
|
-
tradeType?: UniswapQuoteTradeType;
|
|
306
|
-
}): Promise<{
|
|
307
|
-
bodyForSign: Record<string, unknown>;
|
|
308
|
-
messageToSign: string;
|
|
309
|
-
}>;
|
|
310
|
-
|
|
311
|
-
declare const UNISWAP_V4_PROTOCOL_ID = "uniswap-v4";
|
|
312
|
-
declare const uniswapV4ProtocolModule: ProtocolModule;
|
|
313
|
-
|
|
314
|
-
declare const uniswapV4: {
|
|
315
|
-
quoteSwap: typeof quoteSwap;
|
|
316
|
-
createSwap: typeof createSwap;
|
|
317
|
-
swapExactInput: typeof swapExactInput;
|
|
318
|
-
swapFromQuote: typeof swapFromQuote;
|
|
319
|
-
buildSwapMultisignBody: typeof buildEvmMultisignBodyUniswapV4SkipPermit2Batch;
|
|
320
|
-
quote: typeof uniswapTradeQuote;
|
|
321
|
-
isChainSupported: typeof isUniswapV4ChainSupported;
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
export { MAX_UINT160, MAX_UINT48, PERMIT2_ADDRESS, type SwapExactInputArgs, UNISWAP_SWAP_DEFAULT_DEADLINE_SEC_OFFSET, UNISWAP_SWAP_DEFAULT_EXPIRY_MINUTES, UNISWAP_TRADE_BASE_DEFAULT, UNISWAP_UNIVERSAL_ROUTER_DEFAULT_GAS_UNITS, UNISWAP_UNIVERSAL_ROUTER_VERSION_DEFAULT, UNISWAP_V4_PROTOCOL_ID, type UniswapQuoteTradeType, type UniswapTradeQuoteParams, type UniswapV4SessionPayload, applySlippagePercentToApproveWei, buildEvmMultisignBodyUniswapV4SkipPermit2Batch, buildUniswapQuoteRequestBody, buildUniswapV4PurposePrefill, computeUniswapV4Session, createSwap, errorMessageFromUniswapJsonBody, fetchEthereumAddressForKeyGen, formatUniswapAmountFieldFromWei, formatUniswapPercentForUi, formatUniswapQuoteForDisplay, getClassicQuoteFromStoredUniswapResponse, getUniswapUniversalRouterSpenderOrThrow, isUniswapFullQuoteResponseNativeIn, isUniswapTokenInAddressNative, isUniswapV4ChainSupported, isUniswapV4SwapEvmSignRequest, messageFromUniswapHttpResponseBody, parseUniswapChainId, parseUniswapQuoteClassicInOut, parseUniswapQuoteSlippageInfo, quoteSwap, resolveRouterSwapGasUnitsFromSignRequest, swapExactInput, swapFromQuote, swapTransactionDeadlineUnixFromExpiryMinutes, uniswapCreateSwap, uniswapQuoteToJsonQuoteOneLine, uniswapTradeQuote, uniswapV4, uniswapV4ProtocolModule };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { d as ProtocolModule } from './types-Ce2qNHai.cjs';
|
|
2
|
-
|
|
3
|
-
declare function registerProtocolModule(mod: ProtocolModule): void;
|
|
4
|
-
declare function getProtocolModules(): readonly ProtocolModule[];
|
|
5
|
-
declare function getProtocolModule(id: string): ProtocolModule | undefined;
|
|
6
|
-
declare function getActionsByChainCategory(category: string): ProtocolModule['actions'];
|
|
7
|
-
|
|
8
|
-
export { getProtocolModule as a, getProtocolModules as b, getActionsByChainCategory as g, registerProtocolModule as r };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Proposal-time EVM fields for POST /multiSignRequest (mpc-auth).
|
|
3
|
-
* Same shape as trigger txParams and GET /getSignRequestById?tx_params=1.
|
|
4
|
-
*/
|
|
5
|
-
type ProposalTxParams = {
|
|
6
|
-
nonce: number;
|
|
7
|
-
gasLimit: string;
|
|
8
|
-
txType: 'eip1559' | 'legacy';
|
|
9
|
-
maxFeePerGas?: string;
|
|
10
|
-
maxPriorityFeePerGas?: string;
|
|
11
|
-
gasPrice?: string;
|
|
12
|
-
};
|
|
13
|
-
declare function gasLimitFromEstimateAndChainConfig(estimatedGas: bigint, chainGasLimit?: number): bigint;
|
|
14
|
-
declare function routerSwapGasLimitFromEstimate(estimatedGas: bigint, chainGasLimit?: number | null): bigint;
|
|
15
|
-
declare function composeFeePayloadToTxParams(p: Record<string, unknown>, legacy: boolean): ProposalTxParams | undefined;
|
|
16
|
-
declare function triggerTxParamsFromComposeBody(body: Record<string, unknown>): ProposalTxParams;
|
|
17
|
-
declare function proposalTxParamsToFeeSnapshot(params: ProposalTxParams): Record<string, unknown>;
|
|
18
|
-
|
|
19
|
-
export { type ProposalTxParams as P, composeFeePayloadToTxParams as c, gasLimitFromEstimateAndChainConfig as g, proposalTxParamsToFeeSnapshot as p, routerSwapGasLimitFromEstimate as r, triggerTxParamsFromComposeBody as t };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Proposal-time EVM fields for POST /multiSignRequest (mpc-auth).
|
|
3
|
-
* Same shape as trigger txParams and GET /getSignRequestById?tx_params=1.
|
|
4
|
-
*/
|
|
5
|
-
type ProposalTxParams = {
|
|
6
|
-
nonce: number;
|
|
7
|
-
gasLimit: string;
|
|
8
|
-
txType: 'eip1559' | 'legacy';
|
|
9
|
-
maxFeePerGas?: string;
|
|
10
|
-
maxPriorityFeePerGas?: string;
|
|
11
|
-
gasPrice?: string;
|
|
12
|
-
};
|
|
13
|
-
declare function gasLimitFromEstimateAndChainConfig(estimatedGas: bigint, chainGasLimit?: number): bigint;
|
|
14
|
-
declare function routerSwapGasLimitFromEstimate(estimatedGas: bigint, chainGasLimit?: number | null): bigint;
|
|
15
|
-
declare function composeFeePayloadToTxParams(p: Record<string, unknown>, legacy: boolean): ProposalTxParams | undefined;
|
|
16
|
-
declare function triggerTxParamsFromComposeBody(body: Record<string, unknown>): ProposalTxParams;
|
|
17
|
-
declare function proposalTxParamsToFeeSnapshot(params: ProposalTxParams): Record<string, unknown>;
|
|
18
|
-
|
|
19
|
-
export { type ProposalTxParams as P, composeFeePayloadToTxParams as c, gasLimitFromEstimateAndChainConfig as g, proposalTxParamsToFeeSnapshot as p, routerSwapGasLimitFromEstimate as r, triggerTxParamsFromComposeBody as t };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { b as MultisignCommonArgs, E as EvmTokenKind } from './types-Ce2qNHai.cjs';
|
|
2
|
-
import { Address } from 'viem';
|
|
3
|
-
|
|
4
|
-
type EvmChainDetail = {
|
|
5
|
-
legacy?: boolean;
|
|
6
|
-
gasLimit?: number;
|
|
7
|
-
gasMultiplier?: number;
|
|
8
|
-
gasPrice?: number;
|
|
9
|
-
baseFee?: number;
|
|
10
|
-
priorityFee?: number;
|
|
11
|
-
baseFeeMultiplier?: number;
|
|
12
|
-
};
|
|
13
|
-
interface EvmProtocolContext extends MultisignCommonArgs {
|
|
14
|
-
chainCategory: 'evm';
|
|
15
|
-
chainId: number;
|
|
16
|
-
rpcUrl: string;
|
|
17
|
-
executorAddress: Address;
|
|
18
|
-
chainDetail: EvmChainDetail;
|
|
19
|
-
useCustomGas: boolean;
|
|
20
|
-
customGasChainDetails?: Record<string, unknown> | null;
|
|
21
|
-
}
|
|
22
|
-
type EvmTxStep = {
|
|
23
|
-
to: Address;
|
|
24
|
-
data: `0x${string}`;
|
|
25
|
-
value: bigint;
|
|
26
|
-
/** Fallback when estimateGas reverts */
|
|
27
|
-
fallbackGas?: bigint;
|
|
28
|
-
/** When set, use routerSwapGasLimitFromEstimate instead of plain estimate */
|
|
29
|
-
routerSwap?: boolean;
|
|
30
|
-
};
|
|
31
|
-
declare function isEvmNativeToken(address: string): boolean;
|
|
32
|
-
declare function matchEvmTokenKind(kind: EvmTokenKind, address: string): boolean;
|
|
33
|
-
|
|
34
|
-
export { type EvmChainDetail as E, type EvmProtocolContext as a, type EvmTxStep as b, isEvmNativeToken as i, matchEvmTokenKind as m };
|
package/dist/types-Ce2qNHai.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/** Aligns with app NonEvmChainType + 'evm'. Extend as mpc-auth adds chains. */
|
|
2
|
-
type ChainCategory = 'evm' | 'solana' | 'near' | 'sui' | 'ton' | 'stellar';
|
|
3
|
-
type MultisignBuildResult = {
|
|
4
|
-
bodyForSign: Record<string, unknown>;
|
|
5
|
-
messageToSign: string;
|
|
6
|
-
};
|
|
7
|
-
type EvmTokenKind = 'native' | 'erc20' | 'erc721' | 'ctmerc20' | 'ctmrwa1';
|
|
8
|
-
type SolanaTokenKind = 'native' | 'spl' | 'spl2022';
|
|
9
|
-
type NearTokenKind = 'native' | 'nep141';
|
|
10
|
-
type TokenRef = {
|
|
11
|
-
category: 'evm';
|
|
12
|
-
kind: EvmTokenKind;
|
|
13
|
-
address: `0x${string}`;
|
|
14
|
-
} | {
|
|
15
|
-
category: 'solana';
|
|
16
|
-
kind: SolanaTokenKind;
|
|
17
|
-
mint: string;
|
|
18
|
-
} | {
|
|
19
|
-
category: 'near';
|
|
20
|
-
kind: NearTokenKind;
|
|
21
|
-
contractId: string;
|
|
22
|
-
};
|
|
23
|
-
type ParamDoc = {
|
|
24
|
-
type: string;
|
|
25
|
-
required: boolean;
|
|
26
|
-
description: string;
|
|
27
|
-
};
|
|
28
|
-
type ProtocolActionDescriptor = {
|
|
29
|
-
id: string;
|
|
30
|
-
protocolId: string;
|
|
31
|
-
chainCategory: ChainCategory;
|
|
32
|
-
description: string;
|
|
33
|
-
commonParams: Array<'keyGen' | 'purposeText' | 'useCustomGas' | 'useCustomFees'>;
|
|
34
|
-
params: Record<string, ParamDoc>;
|
|
35
|
-
};
|
|
36
|
-
type ChainSupportContext = {
|
|
37
|
-
chainCategory: ChainCategory;
|
|
38
|
-
chainId: string | number;
|
|
39
|
-
};
|
|
40
|
-
interface ProtocolModule {
|
|
41
|
-
id: string;
|
|
42
|
-
chainCategory: ChainCategory;
|
|
43
|
-
isChainSupported(ctx: ChainSupportContext): boolean | Promise<boolean>;
|
|
44
|
-
isTokenSupported(token: TokenRef): boolean | Promise<boolean>;
|
|
45
|
-
actions: ProtocolActionDescriptor[];
|
|
46
|
-
}
|
|
47
|
-
interface MultisignCommonArgs {
|
|
48
|
-
keyGen: KeyGenSubset;
|
|
49
|
-
purposeText: string;
|
|
50
|
-
}
|
|
51
|
-
type KeyGenSubset = {
|
|
52
|
-
pubkeyhex?: string;
|
|
53
|
-
keylist?: string[];
|
|
54
|
-
ClientKeys?: Record<string, string>;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export type { ChainCategory as C, EvmTokenKind as E, KeyGenSubset as K, MultisignBuildResult as M, NearTokenKind as N, ParamDoc as P, SolanaTokenKind as S, TokenRef as T, ChainSupportContext as a, MultisignCommonArgs as b, ProtocolActionDescriptor as c, ProtocolModule as d };
|