@continuumdao/ctm-mpc-defi 0.2.26 → 0.2.28
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/dist/agent/catalog.cjs +681 -46
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +1209 -21
- package/dist/agent/catalog.js +668 -47
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/morpho/SKILL.md +38 -6
- package/dist/agent/skills/uniswap-v4/SKILL.md +15 -0
- package/dist/core/index.cjs +19 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +8 -1
- package/dist/core/index.js +17 -1
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +363 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +361 -23
- package/dist/index.js.map +1 -1
- package/dist/protocols/evm/aave-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/aave-v4/index.js.map +1 -1
- package/dist/protocols/evm/euler-v2/index.cjs.map +1 -1
- package/dist/protocols/evm/euler-v2/index.js.map +1 -1
- package/dist/protocols/evm/maple/index.cjs.map +1 -1
- package/dist/protocols/evm/maple/index.js.map +1 -1
- package/dist/protocols/evm/morpho/index.cjs +1153 -142
- package/dist/protocols/evm/morpho/index.cjs.map +1 -1
- package/dist/protocols/evm/morpho/index.d.ts +314 -8
- package/dist/protocols/evm/morpho/index.js +1131 -144
- package/dist/protocols/evm/morpho/index.js.map +1 -1
- package/dist/protocols/evm/permit2/index.cjs.map +1 -1
- package/dist/protocols/evm/permit2/index.js.map +1 -1
- package/dist/protocols/evm/sky/index.cjs.map +1 -1
- package/dist/protocols/evm/sky/index.js.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.cjs +863 -25
- package/dist/protocols/evm/uniswap-v4/index.cjs.map +1 -1
- package/dist/protocols/evm/uniswap-v4/index.d.ts +266 -9
- package/dist/protocols/evm/uniswap-v4/index.js +834 -27
- package/dist/protocols/evm/uniswap-v4/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { b as KeyGenSubsetForPermit, M as MultisignBuildResult, e as ProtocolModule } from '../../../types-PZrvtjv8.js';
|
|
2
|
-
import { Address, createPublicClient, TransactionReceipt } from 'viem';
|
|
2
|
+
import { Address, createPublicClient, TransactionReceipt, PublicClient } from 'viem';
|
|
3
3
|
import { NodeReadAuth } from '@continuumdao/continuum-node-sdk';
|
|
4
4
|
import { E as EvmChainDetail } from '../../../types-RZWOTm8c.js';
|
|
5
5
|
import { c as Eip712TypedDataPayload } from '../../../eip712Multisign-xhXpUYp3.js';
|
|
6
6
|
|
|
7
7
|
/** Canonical Uniswap token-allowance contract on most EVM chains. */
|
|
8
8
|
declare const PERMIT2_ADDRESS: Address;
|
|
9
|
-
declare
|
|
9
|
+
declare const UNISWAP_UNIVERSAL_ROUTER_VERSION_DEFAULT = "2.0";
|
|
10
|
+
/** Trade API header value required when any token in the trade is permissioned. */
|
|
11
|
+
declare const UNISWAP_UNIVERSAL_ROUTER_VERSION_PERMISSIONED = "2.2.0";
|
|
12
|
+
type UniswapUniversalRouterOpts = {
|
|
13
|
+
/** When true, prefer UR 2.2.0 spender/version (permissioned pools). */
|
|
14
|
+
permissioned?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare function getUniswapUniversalRouterVersion(chainId: number, opts?: UniswapUniversalRouterOpts): string;
|
|
10
17
|
declare function isUniswapV4ChainSupported(chainId: string | number | bigint | null | undefined): boolean;
|
|
11
|
-
declare function getUniswapUniversalRouterSpenderOrThrow(chainId: number): Address;
|
|
18
|
+
declare function getUniswapUniversalRouterSpenderOrThrow(chainId: number, opts?: UniswapUniversalRouterOpts): Address;
|
|
19
|
+
declare function tryGetUniswapUniversalRouterV22(chainId: number): Address | null;
|
|
12
20
|
declare const MAX_UINT160: bigint;
|
|
13
21
|
declare const MAX_UINT48: bigint;
|
|
14
22
|
declare const UNISWAP_UNIVERSAL_ROUTER_DEFAULT_GAS_UNITS = 1500000n;
|
|
15
23
|
declare const UNISWAP_TRADE_BASE_DEFAULT = "https://trade-api.gateway.uniswap.org/v1";
|
|
16
24
|
/** Alternate LP API host (integration guide); trade-api `/v1/lp/*` is primary. */
|
|
17
25
|
declare const UNISWAP_LP_API_BASE_DEFAULT = "https://api.uniswap.org";
|
|
18
|
-
declare const UNISWAP_UNIVERSAL_ROUTER_VERSION_DEFAULT = "2.0";
|
|
19
26
|
declare const UNISWAP_SWAP_DEFAULT_EXPIRY_MINUTES = 30;
|
|
20
27
|
declare const UNISWAP_SWAP_DEFAULT_DEADLINE_SEC_OFFSET: number;
|
|
21
28
|
declare const UNISWAP_LP_DEFAULT_EXPIRY_MINUTES = 30;
|
|
@@ -24,8 +31,18 @@ declare const UNISWAP_LP_DEFAULT_SLIPPAGE_PERCENT = 0.5;
|
|
|
24
31
|
/** Robinhood Chain wrapped native (WETH). */
|
|
25
32
|
declare const ROBINHOOD_CHAIN_ID = 4663;
|
|
26
33
|
declare const ROBINHOOD_WETH_ADDRESS: "0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73";
|
|
34
|
+
type UniswapV4PositionManagerKind = 'standard' | 'permissioned';
|
|
27
35
|
declare function getUniswapV4PositionManagerOrThrow(chainId: number): Address;
|
|
28
36
|
declare function tryGetUniswapV4PositionManager(chainId: number): Address | null;
|
|
37
|
+
declare function getUniswapV4PermissionedPositionManagerOrThrow(chainId: number): Address;
|
|
38
|
+
declare function tryGetUniswapV4PermissionedPositionManager(chainId: number): Address | null;
|
|
39
|
+
declare function getUniswapV4PermissionedHooksOrThrow(chainId: number): Address;
|
|
40
|
+
declare function tryGetUniswapV4PermissionedHooks(chainId: number): Address | null;
|
|
41
|
+
declare function getUniswapV4PermissionsAdapterFactoryOrThrow(chainId: number): Address;
|
|
42
|
+
declare function tryGetUniswapV4PermissionsAdapterFactory(chainId: number): Address | null;
|
|
43
|
+
declare function isUniswapV4PermissionedPositionManager(chainId: number, address: string | Address | null | undefined): boolean;
|
|
44
|
+
declare function isUniswapV4AnyPositionManager(chainId: number, address: string | Address | null | undefined): boolean;
|
|
45
|
+
declare function resolveUniswapV4PositionManager(chainId: number, kind?: UniswapV4PositionManagerKind): Address;
|
|
29
46
|
/** Default `eth_getLogs` span — many free RPCs cap at 250 blocks (e.g. Nodies). */
|
|
30
47
|
declare const UNISWAP_V4_LP_LOG_CHUNK_SIZE_DEFAULT = 200n;
|
|
31
48
|
declare const UNISWAP_V4_LP_LOG_CHUNK_SIZE_MIN = 10n;
|
|
@@ -36,6 +53,10 @@ declare const UNISWAP_V4_LP_DECREASE_DEFAULT_GAS_UNITS = 1200000n;
|
|
|
36
53
|
declare const UNISWAP_V4_LP_COLLECT_DEFAULT_GAS_UNITS = 900000n;
|
|
37
54
|
declare const UNISWAP_V4_LP_ERC20_APPROVE_FALLBACK = 100000n;
|
|
38
55
|
declare const UNISWAP_V4_LP_WETH_DEPOSIT_FALLBACK = 120000n;
|
|
56
|
+
declare const UNISWAP_V4_LP_PERMIT2_APPROVE_FALLBACK = 100000n;
|
|
57
|
+
/** On-chain PermissionFlag bits (IAllowlistChecker / PermissionFlags). */
|
|
58
|
+
declare const UNISWAP_V4_PERMISSION_FLAG_SWAP = 1;
|
|
59
|
+
declare const UNISWAP_V4_PERMISSION_FLAG_LIQUIDITY = 2;
|
|
39
60
|
|
|
40
61
|
/** POST /v1/quote `type` (same as `uniswap_trade_quote.py` `--type`). */
|
|
41
62
|
type UniswapQuoteTradeType = 'EXACT_INPUT' | 'EXACT_OUTPUT';
|
|
@@ -104,6 +125,16 @@ interface UniswapTradeQuoteParams {
|
|
|
104
125
|
baseUrl?: string;
|
|
105
126
|
/** `x-universal-router-version` (default `2.0`, aligned with Python / v4). */
|
|
106
127
|
universalRouterVersion?: string;
|
|
128
|
+
/**
|
|
129
|
+
* When true (default), call Trade API `/v1/permissions` before quoting.
|
|
130
|
+
* Permissioned tokens force UR 2.2.0. Quotes are still allowed when not allowlisted
|
|
131
|
+
* (Uniswap UX guidance); swap submit must assert allowlist.
|
|
132
|
+
*/
|
|
133
|
+
checkPermissions?: boolean;
|
|
134
|
+
/** Skip the permissions preflight. */
|
|
135
|
+
skipPermissionCheck?: boolean;
|
|
136
|
+
/** Force UR 2.2.0 without calling permissions (tests / known permissioned tokens). */
|
|
137
|
+
forcePermissionedRouter?: boolean;
|
|
107
138
|
signal?: AbortSignal;
|
|
108
139
|
/** Override for tests. */
|
|
109
140
|
fetchImpl?: typeof fetch;
|
|
@@ -140,6 +171,8 @@ declare function messageFromUniswapHttpResponseBody(text: string, status: number
|
|
|
140
171
|
* and follows the same read-auth pattern as the app.
|
|
141
172
|
*/
|
|
142
173
|
declare function uniswapTradeQuote(args: UniswapTradeQuoteParams): Promise<Record<string, unknown>>;
|
|
174
|
+
/** True when a stored quote was enriched for permissioned / UR 2.2.0 routing. */
|
|
175
|
+
declare function isUniswapStoredQuotePermissioned(stored: Record<string, unknown> | null | undefined): boolean;
|
|
143
176
|
/**
|
|
144
177
|
* Single-line JSON for mpc-config `uniswap_trade_swap.py --quote-json` (compact quote body).
|
|
145
178
|
*/
|
|
@@ -248,7 +281,7 @@ declare function uniswapCreateSwap(args: {
|
|
|
248
281
|
*/
|
|
249
282
|
swapTransactionDeadlineUnix?: number;
|
|
250
283
|
}): Promise<CreateSwapResponse>;
|
|
251
|
-
type ChainRow$
|
|
284
|
+
type ChainRow$2 = {
|
|
252
285
|
legacy?: boolean;
|
|
253
286
|
gasLimit?: number;
|
|
254
287
|
gasMultiplier?: number;
|
|
@@ -266,7 +299,7 @@ type UniswapV4SkipPermit2BatchArg = {
|
|
|
266
299
|
keyGen: KeyGenSubsetForPermit;
|
|
267
300
|
chainId: number;
|
|
268
301
|
rpcUrl: string;
|
|
269
|
-
chainDetail: ChainRow$
|
|
302
|
+
chainDetail: ChainRow$2;
|
|
270
303
|
useCustomGas: boolean;
|
|
271
304
|
customGasChainDetails?: Record<string, unknown> | null;
|
|
272
305
|
/** `0x0` = native (ETH) in; otherwise ERC-20. */
|
|
@@ -282,6 +315,11 @@ type UniswapV4SkipPermit2BatchArg = {
|
|
|
282
315
|
purposeText: string;
|
|
283
316
|
swapDeadlineUnix: number;
|
|
284
317
|
slippagePercent?: number;
|
|
318
|
+
/** When set, re-check Trade API permissions before building the sign request. */
|
|
319
|
+
uniswapApiKey?: string;
|
|
320
|
+
tokenOut?: string;
|
|
321
|
+
/** Skip allowlist assert (tests only). */
|
|
322
|
+
skipPermissionCheck?: boolean;
|
|
285
323
|
};
|
|
286
324
|
/**
|
|
287
325
|
* **Classic ERC-20 allowance** batch (on-chain approvals only), two shapes:
|
|
@@ -424,7 +462,7 @@ declare function parseUniswapLpApiSnapshot(args: {
|
|
|
424
462
|
};
|
|
425
463
|
declare function formatUniswapLpAmountHuman(amountWei: string, decimals: number): string;
|
|
426
464
|
|
|
427
|
-
type ChainRow = {
|
|
465
|
+
type ChainRow$1 = {
|
|
428
466
|
legacy?: boolean;
|
|
429
467
|
gasLimit?: number;
|
|
430
468
|
gasMultiplier?: number;
|
|
@@ -438,7 +476,7 @@ type LiquidityMultisignCommon = {
|
|
|
438
476
|
keyGen: KeyGenSubsetForPermit;
|
|
439
477
|
chainId: number;
|
|
440
478
|
rpcUrl: string;
|
|
441
|
-
chainDetail: ChainRow;
|
|
479
|
+
chainDetail: ChainRow$1;
|
|
442
480
|
useCustomGas: boolean;
|
|
443
481
|
customGasChainDetails?: Record<string, unknown> | null;
|
|
444
482
|
executorAddress: Address;
|
|
@@ -449,6 +487,13 @@ type LiquidityMultisignCommon = {
|
|
|
449
487
|
nativeWrapped?: Address;
|
|
450
488
|
nftTokenId?: string | number;
|
|
451
489
|
poolReference?: string;
|
|
490
|
+
/**
|
|
491
|
+
* `permissioned` → approve Permit2 then Permit2.approve(PermPosM) (Uniswap docs).
|
|
492
|
+
* Default `standard` keeps classic ERC-20 approve to Position Manager.
|
|
493
|
+
*/
|
|
494
|
+
positionManagerKind?: UniswapV4PositionManagerKind;
|
|
495
|
+
/** Override Permit2 path; defaults true when positionManagerKind is permissioned. */
|
|
496
|
+
usePermit2Approvals?: boolean;
|
|
452
497
|
};
|
|
453
498
|
declare function buildEvmMultisignBodyUniswapV4MintLiquidityBatch(args: Omit<LiquidityMultisignCommon, 'action' | 'nftTokenId'> & {
|
|
454
499
|
poolReference?: string;
|
|
@@ -636,11 +681,205 @@ declare function uniswapV4ListStandardLpPools(args: {
|
|
|
636
681
|
pair?: string;
|
|
637
682
|
}): ReturnType<typeof listUniswapV4StandardLpPools>;
|
|
638
683
|
|
|
684
|
+
type UniswapV4PermissionedLpPoolRow = UniswapV4StandardLpPoolRow & {
|
|
685
|
+
positionManagerKind: 'permissioned';
|
|
686
|
+
positionManager: Address;
|
|
687
|
+
/** Underlying permissioned ERC-20 (wallet holds this), when known. */
|
|
688
|
+
underlyingPermissionedToken?: Address;
|
|
689
|
+
/** Permissions Adapter used as pool currency. */
|
|
690
|
+
adapterAddress?: Address;
|
|
691
|
+
issuer?: string;
|
|
692
|
+
};
|
|
693
|
+
declare function buildUniswapV4PermissionedLpPoolRow(args: {
|
|
694
|
+
chainId: number | string;
|
|
695
|
+
presetId: string;
|
|
696
|
+
pairSlug: string;
|
|
697
|
+
pairLabel: string;
|
|
698
|
+
fee: number;
|
|
699
|
+
feeLabel: string;
|
|
700
|
+
tickSpacing: number;
|
|
701
|
+
/** Permissions Adapter (pool currency for the permissioned side). */
|
|
702
|
+
adapterAddress: string;
|
|
703
|
+
otherCurrencyAddress: string;
|
|
704
|
+
adapterSymbol?: string;
|
|
705
|
+
otherSymbol?: string;
|
|
706
|
+
underlyingPermissionedToken?: string;
|
|
707
|
+
usesNativeEth?: boolean;
|
|
708
|
+
nativeWrapped?: string;
|
|
709
|
+
issuer?: string;
|
|
710
|
+
hooks?: string;
|
|
711
|
+
}): UniswapV4PermissionedLpPoolRow;
|
|
712
|
+
declare function listUniswapV4PermissionedLpPools(args: {
|
|
713
|
+
chainId: number | string;
|
|
714
|
+
pair?: string;
|
|
715
|
+
}): {
|
|
716
|
+
chainId: number;
|
|
717
|
+
chainLabel: string;
|
|
718
|
+
pools: UniswapV4PermissionedLpPoolRow[];
|
|
719
|
+
notes: string;
|
|
720
|
+
positionManagerKind: UniswapV4PositionManagerKind;
|
|
721
|
+
};
|
|
722
|
+
declare function resolveUniswapV4PermissionedLpPoolPreset(args: {
|
|
723
|
+
chainId: number | string;
|
|
724
|
+
presetId: string;
|
|
725
|
+
}): UniswapV4PermissionedLpPoolRow;
|
|
726
|
+
/** Unified list: standard or permissioned catalog. */
|
|
727
|
+
declare function uniswapV4ListLpPools(args: {
|
|
728
|
+
chainId: number | string;
|
|
729
|
+
pair?: string;
|
|
730
|
+
permissioned?: boolean;
|
|
731
|
+
}): {
|
|
732
|
+
chainId: number;
|
|
733
|
+
chainLabel: string;
|
|
734
|
+
pools: Array<UniswapV4StandardLpPoolRow | UniswapV4PermissionedLpPoolRow>;
|
|
735
|
+
notes: string;
|
|
736
|
+
positionManagerKind: UniswapV4PositionManagerKind;
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
type UniswapV4TokenPermissionResult = {
|
|
740
|
+
token: Address;
|
|
741
|
+
isPermissioned: boolean;
|
|
742
|
+
isAllowlisted: boolean;
|
|
743
|
+
adapterTokenAddress?: Address;
|
|
744
|
+
kycUrl?: string;
|
|
745
|
+
issuer?: string;
|
|
746
|
+
};
|
|
747
|
+
type UniswapV4CheckPermissionsResult = {
|
|
748
|
+
requestId?: string;
|
|
749
|
+
results: UniswapV4TokenPermissionResult[];
|
|
750
|
+
/** True when any requested token is permissioned. */
|
|
751
|
+
anyPermissioned: boolean;
|
|
752
|
+
/** True when every permissioned token allows the wallet (non-permissioned tokens count as allowed). */
|
|
753
|
+
allAllowlisted: boolean;
|
|
754
|
+
/** True when Trade API reported at least one permissioned token that needs UR 2.2.0. */
|
|
755
|
+
requiresUniversalRouterV22: boolean;
|
|
756
|
+
};
|
|
757
|
+
type UniswapV4CheckPermissionsParams = {
|
|
758
|
+
walletAddress: string;
|
|
759
|
+
tokens: string[];
|
|
760
|
+
chainId: number | string;
|
|
761
|
+
uniswapApiKey: string;
|
|
762
|
+
baseUrl?: string;
|
|
763
|
+
signal?: AbortSignal;
|
|
764
|
+
fetchImpl?: typeof fetch;
|
|
765
|
+
};
|
|
766
|
+
/**
|
|
767
|
+
* Trade API `POST /v1/permissions` — client-side UX gate for tokenized / permissioned pools.
|
|
768
|
+
* @see https://developers.uniswap.org/docs/trading/swapping-api/swapping-tokenized-pools
|
|
769
|
+
*/
|
|
770
|
+
declare function uniswapV4CheckPermissions(args: UniswapV4CheckPermissionsParams): Promise<UniswapV4CheckPermissionsResult>;
|
|
771
|
+
declare class UniswapV4PermissionDeniedError extends Error {
|
|
772
|
+
readonly code: "UNISWAP_V4_PERMISSION_DENIED";
|
|
773
|
+
readonly permissions: UniswapV4CheckPermissionsResult;
|
|
774
|
+
readonly blocked: UniswapV4TokenPermissionResult[];
|
|
775
|
+
constructor(permissions: UniswapV4CheckPermissionsResult);
|
|
776
|
+
}
|
|
777
|
+
/** Throw {@link UniswapV4PermissionDeniedError} when any permissioned token blocks the wallet. */
|
|
778
|
+
declare function assertUniswapV4PermissionsAllowlisted(permissions: UniswapV4CheckPermissionsResult): void;
|
|
779
|
+
/**
|
|
780
|
+
* On-chain fallback: read `IPermissionsAdapter.isAllowed` when the currency is a verified adapter.
|
|
781
|
+
* For underlying ERC-20s without adapter discovery, returns null (unknown).
|
|
782
|
+
*/
|
|
783
|
+
declare function readUniswapV4OnChainPermissionFlags(args: {
|
|
784
|
+
chainId: number;
|
|
785
|
+
rpcUrl: string;
|
|
786
|
+
walletAddress: string;
|
|
787
|
+
/** Candidate adapter or token addresses (max practical: few). */
|
|
788
|
+
currencyOrAdapterAddresses: string[];
|
|
789
|
+
publicClient?: PublicClient;
|
|
790
|
+
}): Promise<Array<{
|
|
791
|
+
address: Address;
|
|
792
|
+
isVerifiedAdapter: boolean;
|
|
793
|
+
underlyingToken?: Address;
|
|
794
|
+
swapAllowed: boolean;
|
|
795
|
+
liquidityAllowed: boolean;
|
|
796
|
+
}>>;
|
|
797
|
+
/** MCP-friendly wrapper (same as {@link uniswapV4CheckPermissions}). */
|
|
798
|
+
declare function uniswapV4CheckPermissionsMcp(args: UniswapV4CheckPermissionsParams): Promise<UniswapV4CheckPermissionsResult>;
|
|
799
|
+
|
|
800
|
+
type UniswapV4KycApplyLinkResult = {
|
|
801
|
+
walletAddress: Address;
|
|
802
|
+
chainId: number;
|
|
803
|
+
issuer?: string;
|
|
804
|
+
kycUrl: string;
|
|
805
|
+
/** Best-effort URL with wallet/chain/token query params when the base URL allows. */
|
|
806
|
+
applyUrl: string;
|
|
807
|
+
token?: Address;
|
|
808
|
+
adapterTokenAddress?: Address;
|
|
809
|
+
};
|
|
810
|
+
/**
|
|
811
|
+
* Build a KYC apply link for a permissioned token (Pattern A — no multiSignRequest).
|
|
812
|
+
* Prefills wallet / chain / token query params when the issuer URL is a normal http(s) URL.
|
|
813
|
+
*/
|
|
814
|
+
declare function buildUniswapV4KycApplyLink(args: {
|
|
815
|
+
walletAddress: string;
|
|
816
|
+
chainId: number | string;
|
|
817
|
+
kycUrl: string;
|
|
818
|
+
issuer?: string;
|
|
819
|
+
token?: string;
|
|
820
|
+
adapterTokenAddress?: string;
|
|
821
|
+
}): UniswapV4KycApplyLinkResult;
|
|
822
|
+
/** Pick the first blocked permissioned result that has a KYC URL. */
|
|
823
|
+
declare function pickUniswapV4KycTarget(results: UniswapV4TokenPermissionResult[]): UniswapV4TokenPermissionResult | null;
|
|
824
|
+
/** MCP helper: build apply link from wallet + permission row fields. */
|
|
825
|
+
declare function uniswapV4KycApplyLinkMcp(args: {
|
|
826
|
+
walletAddress: string;
|
|
827
|
+
chainId: number | string;
|
|
828
|
+
kycUrl: string;
|
|
829
|
+
issuer?: string;
|
|
830
|
+
token?: string;
|
|
831
|
+
adapterTokenAddress?: string;
|
|
832
|
+
}): UniswapV4KycApplyLinkResult;
|
|
833
|
+
|
|
834
|
+
type ChainRow = {
|
|
835
|
+
legacy?: boolean;
|
|
836
|
+
gasLimit?: number;
|
|
837
|
+
gasMultiplier?: number;
|
|
838
|
+
gasPrice?: number;
|
|
839
|
+
baseFee?: number;
|
|
840
|
+
priorityFee?: number;
|
|
841
|
+
baseFeeMultiplier?: number;
|
|
842
|
+
};
|
|
843
|
+
/**
|
|
844
|
+
* Pattern B — broadcast issuer-prepared allowlist calldata (e.g. Superstate
|
|
845
|
+
* `setUserPermissionForInstrument`) via a standard EVM multiSignRequest.
|
|
846
|
+
* Calldata typically already embeds issuer signatures; Continuum only pays gas.
|
|
847
|
+
*/
|
|
848
|
+
declare function buildEvmMultisignBodyUniswapV4PermissionedAllowlistFinalize(args: {
|
|
849
|
+
keyGen: KeyGenSubsetForPermit;
|
|
850
|
+
chainId: number;
|
|
851
|
+
rpcUrl: string;
|
|
852
|
+
chainDetail: ChainRow;
|
|
853
|
+
useCustomGas: boolean;
|
|
854
|
+
customGasChainDetails?: Record<string, unknown> | null;
|
|
855
|
+
executorAddress: Address;
|
|
856
|
+
purposeText: string;
|
|
857
|
+
/** Allowlist / registry contract (`to` from issuer onboard API). */
|
|
858
|
+
to: string;
|
|
859
|
+
/** ABI-encoded function data (`encodedTransaction` from issuer onboard API). */
|
|
860
|
+
data: string;
|
|
861
|
+
valueWei?: bigint | string | number;
|
|
862
|
+
/** Optional issuer label for purpose / batchMeta. */
|
|
863
|
+
issuer?: string;
|
|
864
|
+
entityId?: string | number;
|
|
865
|
+
tokenAddress?: string;
|
|
866
|
+
}): Promise<{
|
|
867
|
+
bodyForSign: Record<string, unknown>;
|
|
868
|
+
messageToSign: string;
|
|
869
|
+
}>;
|
|
870
|
+
declare function isUniswapV4PermissionedAllowlistEvmSignRequest(detail: Record<string, unknown> | null | undefined): boolean;
|
|
871
|
+
|
|
639
872
|
type UniswapV4SessionPayload = {
|
|
640
873
|
chainId: number;
|
|
641
874
|
rpcUrl: string;
|
|
642
875
|
chainSupported: boolean;
|
|
643
876
|
universalRouter?: string;
|
|
877
|
+
/** UR 2.2.0 when available (permissioned swaps). */
|
|
878
|
+
universalRouterV22?: string;
|
|
879
|
+
positionManager?: string;
|
|
880
|
+
permissionedPositionManager?: string;
|
|
881
|
+
permissionedHooks?: string;
|
|
882
|
+
permissionsAdapterFactory?: string;
|
|
644
883
|
};
|
|
645
884
|
declare function computeUniswapV4Session(args: {
|
|
646
885
|
assetsChainId: string | number;
|
|
@@ -768,6 +1007,11 @@ declare function fetchUniswapV4PoolMeta(args: {
|
|
|
768
1007
|
chainId: number;
|
|
769
1008
|
poolReference: string;
|
|
770
1009
|
}): Promise<UniswapV4SubgraphPoolMeta | null>;
|
|
1010
|
+
declare function fetchUniswapV4LatestSwap(args: {
|
|
1011
|
+
chainId: number;
|
|
1012
|
+
poolReference: string;
|
|
1013
|
+
theGraphApiKey?: string;
|
|
1014
|
+
}): Promise<UniswapV4SubgraphSwapRow | null>;
|
|
771
1015
|
|
|
772
1016
|
/** Node env var for Bitquery GraphQL (required for Robinhood Chain OHLCV). */
|
|
773
1017
|
declare const BITQUERY_API_KEY_ENV = "BITQUERY_API_KEY";
|
|
@@ -916,6 +1160,19 @@ declare function uniswapV4FetchOhlcv(args: {
|
|
|
916
1160
|
endTimeMs?: number;
|
|
917
1161
|
}): Promise<UniswapV4OhlcvFetchResult>;
|
|
918
1162
|
|
|
1163
|
+
type UniswapV4PriceQuote = 'token0PerToken1' | 'token1PerToken0';
|
|
1164
|
+
type UniswapV4ChartLivePriceArgs = {
|
|
1165
|
+
chainId: number;
|
|
1166
|
+
poolReference: string;
|
|
1167
|
+
priceQuote?: UniswapV4PriceQuote;
|
|
1168
|
+
dataSource?: string;
|
|
1169
|
+
interval?: string;
|
|
1170
|
+
theGraphApiKey?: string;
|
|
1171
|
+
bitqueryApiKey?: string;
|
|
1172
|
+
};
|
|
1173
|
+
/** Latest pool price for chart live ticks (subgraph swap or Bitquery OHLC close on Robinhood). */
|
|
1174
|
+
declare function fetchUniswapV4ChartLivePrice(args: UniswapV4ChartLivePriceArgs): Promise<number | null>;
|
|
1175
|
+
|
|
919
1176
|
declare const UNISWAP_LIMIT_ORDER_CHAIN_ID = 1;
|
|
920
1177
|
declare const DEFAULT_UNISWAPX_ORDER_BASE = "https://api.uniswap.org/v2";
|
|
921
1178
|
declare const DEFAULT_LIMIT_ORDER_QUOTE_PATH = "/limit_order_quote";
|
|
@@ -1031,4 +1288,4 @@ declare const uniswapV4: {
|
|
|
1031
1288
|
isChainSupported: typeof isUniswapV4ChainSupported;
|
|
1032
1289
|
};
|
|
1033
1290
|
|
|
1034
|
-
export { BITQUERY_API_KEY_DOCS_URL, BITQUERY_API_KEY_ENV, BITQUERY_API_KEY_SIGNUP_URL, BITQUERY_GRAPHQL_URL, type BitqueryOhlcvCurrencyFilter, DEFAULT_LIMIT_ORDER_QUOTE_PATH, DEFAULT_ORDER_SUBMIT_PATH, DEFAULT_UNISWAPX_ORDER_BASE, MAX_UINT160, MAX_UINT48, PERMIT2_ADDRESS, ROBINHOOD_CHAIN_ID, ROBINHOOD_WETH_ADDRESS, type SwapExactInputArgs, THE_GRAPH_API_KEY_DOCS_URL, THE_GRAPH_API_KEY_ENV, THE_GRAPH_API_KEY_SIGNUP_URL, UNISWAP_LIMIT_ORDER_CHAIN_ID, UNISWAP_LP_API_BASE_DEFAULT, UNISWAP_LP_DEFAULT_DEADLINE_SEC_OFFSET, UNISWAP_LP_DEFAULT_EXPIRY_MINUTES, UNISWAP_LP_DEFAULT_SLIPPAGE_PERCENT, 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_LP_COLLECT_DEFAULT_GAS_UNITS, UNISWAP_V4_LP_DECREASE_DEFAULT_GAS_UNITS, UNISWAP_V4_LP_ERC20_APPROVE_FALLBACK, UNISWAP_V4_LP_INCREASE_DEFAULT_GAS_UNITS, UNISWAP_V4_LP_LOG_CHUNK_SIZE_DEFAULT, UNISWAP_V4_LP_LOG_CHUNK_SIZE_MIN, UNISWAP_V4_LP_MINT_DEFAULT_GAS_UNITS, UNISWAP_V4_LP_POOL_LOOKUP_HINT, UNISWAP_V4_LP_POSITION_REGISTRY_HINT, UNISWAP_V4_LP_WETH_DEPOSIT_FALLBACK, UNISWAP_V4_OHLCV_INTERVALS, UNISWAP_V4_PROTOCOL_ID, UNISWAP_V4_SUBGRAPH_ID_BY_CHAIN_ID, type UniswapLimitOrderMultisignArgs, type UniswapLimitOrderMultisignMcpArgs, type UniswapLimitOrderQuoteParams, type UniswapLpAction, type UniswapLpExistingPool, type UniswapLpIndependentToken, type UniswapLpNewPool, type UniswapLpPriceBounds, type UniswapLpProtocol, type UniswapLpTickBounds, type UniswapLpTokenAmount, type UniswapLpTransactionRequest, type UniswapQuoteTradeType, type UniswapTradeQuoteParams, type UniswapV4OhlcvCandleRow, type UniswapV4OhlcvDataTier, type UniswapV4OhlcvFetchResult, type UniswapV4OhlcvInterval, type UniswapV4OhlcvQuoteToken, type UniswapV4PoolKeyInput, type UniswapV4PositionRow, type UniswapV4PositionScanProgress, type UniswapV4RegistryErc721Row, type UniswapV4SessionPayload, type UniswapV4StandardLpPoolRow, type UniswapV4SubgraphPoolDayRow, type UniswapV4SubgraphPoolHourRow, type UniswapV4SubgraphPoolMeta, type UniswapV4SubgraphSwapRow, aggregateOhlcvCandles, applySlippagePercentToApproveWei, assertUniswapLimitOrderChain, assertUniswapV4OhlcvInterval, bitqueryApiKeyVariablesHint, bitqueryAuthErrorMessage, buildEvmMultisignBodyUniswapV4CollectFeesBatch, buildEvmMultisignBodyUniswapV4DecreaseLiquidityBatch, buildEvmMultisignBodyUniswapV4IncreaseLiquidityBatch, buildEvmMultisignBodyUniswapV4LimitOrderBatch, buildEvmMultisignBodyUniswapV4LimitOrderBatchFromMcp, buildEvmMultisignBodyUniswapV4MintLiquidityBatch, buildEvmMultisignBodyUniswapV4SkipPermit2Batch, buildLimitOrderQuoteRequestBody, buildUniswapQuoteRequestBody, buildUniswapV4PurposePrefill, buildUniswapXLimitOrderSubmitBody, computeUniswapV4PoolReference, computeUniswapV4Session, createSwap, currencyFilterLabel, errorMessageFromUniswapJsonBody, extractPermitDataFromLimitQuote, extractUniswapLpTokenAmounts, extractUniswapLpTransaction, fetchEthereumAddressForKeyGen, fetchRobinhoodBitqueryOhlcv, fetchUniswapV4PoolDayDatas, fetchUniswapV4PoolHourDatas, fetchUniswapV4PoolMeta, fetchUniswapV4Swaps, fetchUniswapXLimitOrders, formatUniswapAmountFieldFromWei, formatUniswapLpAmountHuman, formatUniswapPercentForUi, formatUniswapQuoteForDisplay, formatUniswapV4PositionNotFoundError, getClassicQuoteFromStoredUniswapResponse, getUniswapUniversalRouterSpenderOrThrow, getUniswapUniversalRouterVersion, getUniswapV4PositionManagerDeployBlock, getUniswapV4PositionManagerOrThrow, isBitqueryAuthOrRateLimitError, isEthGetLogsBlockRangeTooLargeError, isNativeUniswapLpTokenAddress, isRobinhoodOhlcvChain, isTheGraphRateLimitOrAuthError, isUniswapFullQuoteResponseNativeIn, isUniswapFullQuoteResponseNativeOut, isUniswapLimitOrderChainSupported, isUniswapNativeTokenAddress, isUniswapTokenInAddressNative, isUniswapV4ChainSupported, isUniswapV4LiquidityEvmSignRequest, isUniswapV4SwapEvmSignRequest, listUniswapV4PositionsForWallet, listUniswapV4StandardLpPools, mapBitqueryOhlcvRowsToCandles, messageFromUniswapHttpResponseBody, parseUniswapChainId, parseUniswapLpApiSnapshot, parseUniswapQuoteClassicInOut, parseUniswapQuoteSlippageInfo, parseUniswapV4ScanFromDateYmd, permitDataToEip712Payload, quoteSwap, readUniswapV4PositionInfoRaw, requireBitqueryApiKey, resolveBitqueryApiKey, resolveBlockAtOrAfterUnixTime, resolveChainIdFromStoredUniswapQuote, resolveInputChainId, resolveRobinhoodChartCurrency, resolveRouterSwapGasUnitsFromSignRequest, resolveTheGraphApiKey, resolveUniswapV4LpExistingPoolFromKey, resolveUniswapV4LpPoolPreset, resolveUniswapV4OhlcvDataTier, resolveUniswapV4OhlcvPool, resolveUniswapV4PositionScanFromDate, sortUniswapV4PoolCurrencies, submitUniswapXLimitOrder, swapExactInput, swapFromQuote, swapTransactionDeadlineUnixFromExpiryMinutes, theGraphApiKeyVariablesHint, theGraphRateLimitErrorMessage, tryGetUniswapV4PositionManager, uniswapCreateSwap, uniswapFetchLimitOrdersMcp, uniswapLimitOrderQuote, uniswapLpClaimFees, uniswapLpCreatePosition, uniswapLpDecreasePosition, uniswapLpIncreasePosition, uniswapLpTxFieldForAction, uniswapQuoteToJsonQuoteOneLine, uniswapTradeQuote, uniswapV4, uniswapV4FetchOhlcv, uniswapV4ListPositionsForMcp, uniswapV4ListPositionsFromRegistryForMcp, uniswapV4ListPositionsRegistryMcpPlaceholder, uniswapV4ListStandardLpPools, uniswapV4OhlcvIntervalToBucketSec, uniswapV4OhlcvSupportedChainIds, uniswapV4PositionMintedTokenIdsFromReceipt, uniswapV4ProtocolModule, uniswapV4RegisterPositionFromMintTxPlaceholder, uniswapV4RegisterPositionNftPlaceholder, uniswapV4SubgraphIdForChain, uniswapV4SubgraphSupportedChainIds, uniswapV4SubgraphUrlForChain };
|
|
1291
|
+
export { BITQUERY_API_KEY_DOCS_URL, BITQUERY_API_KEY_ENV, BITQUERY_API_KEY_SIGNUP_URL, BITQUERY_GRAPHQL_URL, type BitqueryOhlcvCurrencyFilter, DEFAULT_LIMIT_ORDER_QUOTE_PATH, DEFAULT_ORDER_SUBMIT_PATH, DEFAULT_UNISWAPX_ORDER_BASE, MAX_UINT160, MAX_UINT48, PERMIT2_ADDRESS, ROBINHOOD_CHAIN_ID, ROBINHOOD_WETH_ADDRESS, type SwapExactInputArgs, THE_GRAPH_API_KEY_DOCS_URL, THE_GRAPH_API_KEY_ENV, THE_GRAPH_API_KEY_SIGNUP_URL, UNISWAP_LIMIT_ORDER_CHAIN_ID, UNISWAP_LP_API_BASE_DEFAULT, UNISWAP_LP_DEFAULT_DEADLINE_SEC_OFFSET, UNISWAP_LP_DEFAULT_EXPIRY_MINUTES, UNISWAP_LP_DEFAULT_SLIPPAGE_PERCENT, 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_UNIVERSAL_ROUTER_VERSION_PERMISSIONED, UNISWAP_V4_LP_COLLECT_DEFAULT_GAS_UNITS, UNISWAP_V4_LP_DECREASE_DEFAULT_GAS_UNITS, UNISWAP_V4_LP_ERC20_APPROVE_FALLBACK, UNISWAP_V4_LP_INCREASE_DEFAULT_GAS_UNITS, UNISWAP_V4_LP_LOG_CHUNK_SIZE_DEFAULT, UNISWAP_V4_LP_LOG_CHUNK_SIZE_MIN, UNISWAP_V4_LP_MINT_DEFAULT_GAS_UNITS, UNISWAP_V4_LP_PERMIT2_APPROVE_FALLBACK, UNISWAP_V4_LP_POOL_LOOKUP_HINT, UNISWAP_V4_LP_POSITION_REGISTRY_HINT, UNISWAP_V4_LP_WETH_DEPOSIT_FALLBACK, UNISWAP_V4_OHLCV_INTERVALS, UNISWAP_V4_PERMISSION_FLAG_LIQUIDITY, UNISWAP_V4_PERMISSION_FLAG_SWAP, UNISWAP_V4_PROTOCOL_ID, UNISWAP_V4_SUBGRAPH_ID_BY_CHAIN_ID, type UniswapLimitOrderMultisignArgs, type UniswapLimitOrderMultisignMcpArgs, type UniswapLimitOrderQuoteParams, type UniswapLpAction, type UniswapLpExistingPool, type UniswapLpIndependentToken, type UniswapLpNewPool, type UniswapLpPriceBounds, type UniswapLpProtocol, type UniswapLpTickBounds, type UniswapLpTokenAmount, type UniswapLpTransactionRequest, type UniswapQuoteTradeType, type UniswapTradeQuoteParams, type UniswapUniversalRouterOpts, type UniswapV4ChartLivePriceArgs, type UniswapV4CheckPermissionsParams, type UniswapV4CheckPermissionsResult, type UniswapV4KycApplyLinkResult, type UniswapV4OhlcvCandleRow, type UniswapV4OhlcvDataTier, type UniswapV4OhlcvFetchResult, type UniswapV4OhlcvInterval, type UniswapV4OhlcvQuoteToken, UniswapV4PermissionDeniedError, type UniswapV4PermissionedLpPoolRow, type UniswapV4PoolKeyInput, type UniswapV4PositionManagerKind, type UniswapV4PositionRow, type UniswapV4PositionScanProgress, type UniswapV4PriceQuote, type UniswapV4RegistryErc721Row, type UniswapV4SessionPayload, type UniswapV4StandardLpPoolRow, type UniswapV4SubgraphPoolDayRow, type UniswapV4SubgraphPoolHourRow, type UniswapV4SubgraphPoolMeta, type UniswapV4SubgraphSwapRow, type UniswapV4TokenPermissionResult, aggregateOhlcvCandles, applySlippagePercentToApproveWei, assertUniswapLimitOrderChain, assertUniswapV4OhlcvInterval, assertUniswapV4PermissionsAllowlisted, bitqueryApiKeyVariablesHint, bitqueryAuthErrorMessage, buildEvmMultisignBodyUniswapV4CollectFeesBatch, buildEvmMultisignBodyUniswapV4DecreaseLiquidityBatch, buildEvmMultisignBodyUniswapV4IncreaseLiquidityBatch, buildEvmMultisignBodyUniswapV4LimitOrderBatch, buildEvmMultisignBodyUniswapV4LimitOrderBatchFromMcp, buildEvmMultisignBodyUniswapV4MintLiquidityBatch, buildEvmMultisignBodyUniswapV4PermissionedAllowlistFinalize, buildEvmMultisignBodyUniswapV4SkipPermit2Batch, buildLimitOrderQuoteRequestBody, buildUniswapQuoteRequestBody, buildUniswapV4KycApplyLink, buildUniswapV4PermissionedLpPoolRow, buildUniswapV4PurposePrefill, buildUniswapXLimitOrderSubmitBody, computeUniswapV4PoolReference, computeUniswapV4Session, createSwap, currencyFilterLabel, errorMessageFromUniswapJsonBody, extractPermitDataFromLimitQuote, extractUniswapLpTokenAmounts, extractUniswapLpTransaction, fetchEthereumAddressForKeyGen, fetchRobinhoodBitqueryOhlcv, fetchUniswapV4ChartLivePrice, fetchUniswapV4LatestSwap, fetchUniswapV4PoolDayDatas, fetchUniswapV4PoolHourDatas, fetchUniswapV4PoolMeta, fetchUniswapV4Swaps, fetchUniswapXLimitOrders, formatUniswapAmountFieldFromWei, formatUniswapLpAmountHuman, formatUniswapPercentForUi, formatUniswapQuoteForDisplay, formatUniswapV4PositionNotFoundError, getClassicQuoteFromStoredUniswapResponse, getUniswapUniversalRouterSpenderOrThrow, getUniswapUniversalRouterVersion, getUniswapV4PermissionedHooksOrThrow, getUniswapV4PermissionedPositionManagerOrThrow, getUniswapV4PermissionsAdapterFactoryOrThrow, getUniswapV4PositionManagerDeployBlock, getUniswapV4PositionManagerOrThrow, isBitqueryAuthOrRateLimitError, isEthGetLogsBlockRangeTooLargeError, isNativeUniswapLpTokenAddress, isRobinhoodOhlcvChain, isTheGraphRateLimitOrAuthError, isUniswapFullQuoteResponseNativeIn, isUniswapFullQuoteResponseNativeOut, isUniswapLimitOrderChainSupported, isUniswapNativeTokenAddress, isUniswapStoredQuotePermissioned, isUniswapTokenInAddressNative, isUniswapV4AnyPositionManager, isUniswapV4ChainSupported, isUniswapV4LiquidityEvmSignRequest, isUniswapV4PermissionedAllowlistEvmSignRequest, isUniswapV4PermissionedPositionManager, isUniswapV4SwapEvmSignRequest, listUniswapV4PermissionedLpPools, listUniswapV4PositionsForWallet, listUniswapV4StandardLpPools, mapBitqueryOhlcvRowsToCandles, messageFromUniswapHttpResponseBody, parseUniswapChainId, parseUniswapLpApiSnapshot, parseUniswapQuoteClassicInOut, parseUniswapQuoteSlippageInfo, parseUniswapV4ScanFromDateYmd, permitDataToEip712Payload, pickUniswapV4KycTarget, quoteSwap, readUniswapV4OnChainPermissionFlags, readUniswapV4PositionInfoRaw, requireBitqueryApiKey, resolveBitqueryApiKey, resolveBlockAtOrAfterUnixTime, resolveChainIdFromStoredUniswapQuote, resolveInputChainId, resolveRobinhoodChartCurrency, resolveRouterSwapGasUnitsFromSignRequest, resolveTheGraphApiKey, resolveUniswapV4LpExistingPoolFromKey, resolveUniswapV4LpPoolPreset, resolveUniswapV4OhlcvDataTier, resolveUniswapV4OhlcvPool, resolveUniswapV4PermissionedLpPoolPreset, resolveUniswapV4PositionManager, resolveUniswapV4PositionScanFromDate, sortUniswapV4PoolCurrencies, submitUniswapXLimitOrder, swapExactInput, swapFromQuote, swapTransactionDeadlineUnixFromExpiryMinutes, theGraphApiKeyVariablesHint, theGraphRateLimitErrorMessage, tryGetUniswapUniversalRouterV22, tryGetUniswapV4PermissionedHooks, tryGetUniswapV4PermissionedPositionManager, tryGetUniswapV4PermissionsAdapterFactory, tryGetUniswapV4PositionManager, uniswapCreateSwap, uniswapFetchLimitOrdersMcp, uniswapLimitOrderQuote, uniswapLpClaimFees, uniswapLpCreatePosition, uniswapLpDecreasePosition, uniswapLpIncreasePosition, uniswapLpTxFieldForAction, uniswapQuoteToJsonQuoteOneLine, uniswapTradeQuote, uniswapV4, uniswapV4CheckPermissions, uniswapV4CheckPermissionsMcp, uniswapV4FetchOhlcv, uniswapV4KycApplyLinkMcp, uniswapV4ListLpPools, uniswapV4ListPositionsForMcp, uniswapV4ListPositionsFromRegistryForMcp, uniswapV4ListPositionsRegistryMcpPlaceholder, uniswapV4ListStandardLpPools, uniswapV4OhlcvIntervalToBucketSec, uniswapV4OhlcvSupportedChainIds, uniswapV4PositionMintedTokenIdsFromReceipt, uniswapV4ProtocolModule, uniswapV4RegisterPositionFromMintTxPlaceholder, uniswapV4RegisterPositionNftPlaceholder, uniswapV4SubgraphIdForChain, uniswapV4SubgraphSupportedChainIds, uniswapV4SubgraphUrlForChain };
|