@ocap/tx-pipeline 1.30.26 → 1.31.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/esm/appchain-sovereign-hub.d.mts +160 -0
- package/esm/appchain-sovereign-hub.mjs +348 -0
- package/esm/arcvault-external-adapter.d.mts +166 -0
- package/esm/arcvault-external-adapter.mjs +376 -0
- package/esm/encrypted-nft-envelope.d.mts +172 -0
- package/esm/encrypted-nft-envelope.mjs +458 -0
- package/esm/evm-simplified-bridge.d.mts +1370 -0
- package/esm/evm-simplified-bridge.mjs +3875 -0
- package/esm/give-to-mint-karma.d.mts +472 -0
- package/esm/give-to-mint-karma.mjs +1057 -0
- package/esm/helpers/replay-guard.d.mts +15 -0
- package/esm/helpers/replay-guard.mjs +23 -0
- package/esm/index.d.mts +10 -5
- package/esm/index.mjs +14 -10
- package/esm/legacy-protocol-sunset.d.mts +251 -0
- package/esm/legacy-protocol-sunset.mjs +1519 -0
- package/esm/library.d.mts +16 -0
- package/esm/library.mjs +17 -0
- package/esm/native-abt-exchange.d.mts +2055 -0
- package/esm/native-abt-exchange.mjs +7250 -0
- package/esm/ofac-screening.d.mts +17 -0
- package/esm/ofac-screening.mjs +39 -0
- package/esm/pipes/anti-land-attack.mjs +1 -1
- package/esm/pipes/decode-itx.mjs +46 -4
- package/esm/pipes/decode-tx.d.mts +2 -3
- package/esm/pipes/decode-tx.mjs +56 -115
- package/esm/pipes/extract-signer.mjs +2 -2
- package/esm/pipes/extract-state.mjs +14 -3
- package/esm/pipes/post-execution-invariant-gate.d.mts +61 -0
- package/esm/pipes/post-execution-invariant-gate.mjs +789 -0
- package/esm/pipes/pre-flight-waf.d.mts +73 -0
- package/esm/pipes/pre-flight-waf.mjs +756 -0
- package/esm/pipes/take-state-snapshot.mjs +3 -2
- package/esm/pipes/update-owner.mjs +39 -4
- package/esm/pipes/verify-account-migration.mjs +14 -4
- package/esm/pipes/verify-blocked.mjs +1 -1
- package/esm/pipes/verify-delegation.d.mts +22 -3
- package/esm/pipes/verify-delegation.mjs +259 -36
- package/esm/pipes/verify-list-size.mjs +1 -1
- package/esm/pipes/verify-multisig-v2.mjs +15 -7
- package/esm/pipes/verify-multisig.mjs +15 -7
- package/esm/pipes/verify-sender.mjs +1 -1
- package/esm/pipes/verify-signature.mjs +35 -6
- package/esm/pipes/verify-signer.mjs +2 -2
- package/esm/pipes/verify-state-diff.mjs +3 -3
- package/esm/pipes/verify-token-access.mjs +1 -1
- package/esm/pipes/verify-token-balance.mjs +13 -5
- package/esm/pipes/verify-transferrable.d.mts +8 -1
- package/esm/pipes/verify-transferrable.mjs +3 -3
- package/esm/pipes/verify-tx-input.mjs +2 -2
- package/esm/pipes/verify-tx-size.mjs +46 -2
- package/esm/pipes/verify-tx.mjs +5 -7
- package/esm/pipes/verify-updater.mjs +1 -1
- package/esm/social-economy-factories.d.mts +346 -0
- package/esm/social-economy-factories.mjs +845 -0
- package/esm/super-suites-foundation.d.mts +513 -0
- package/esm/super-suites-foundation.mjs +1241 -0
- package/esm/transaction-block.d.mts +471 -0
- package/esm/transaction-block.mjs +1906 -0
- package/esm/uniswap-erc7683-solver.d.mts +201 -0
- package/esm/uniswap-erc7683-solver.mjs +321 -0
- package/esm/uniswap-lp-copilot.d.mts +113 -0
- package/esm/uniswap-lp-copilot.mjs +320 -0
- package/esm/uniswap-router.d.mts +335 -0
- package/esm/uniswap-router.mjs +578 -0
- package/esm/uniswap-token-factory-graduation.d.mts +187 -0
- package/esm/uniswap-token-factory-graduation.mjs +426 -0
- package/esm/uniswap-v4-hook.d.mts +173 -0
- package/esm/uniswap-v4-hook.mjs +517 -0
- package/lib/appchain-sovereign-hub.cjs +352 -0
- package/lib/appchain-sovereign-hub.d.cts +160 -0
- package/lib/arcvault-external-adapter.cjs +383 -0
- package/lib/arcvault-external-adapter.d.cts +166 -0
- package/lib/encrypted-nft-envelope.cjs +477 -0
- package/lib/encrypted-nft-envelope.d.cts +172 -0
- package/lib/evm-simplified-bridge.cjs +3943 -0
- package/lib/evm-simplified-bridge.d.cts +1370 -0
- package/lib/give-to-mint-karma.cjs +1084 -0
- package/lib/give-to-mint-karma.d.cts +472 -0
- package/lib/helpers/replay-guard.cjs +27 -0
- package/lib/helpers/replay-guard.d.cts +15 -0
- package/lib/index.cjs +49 -16
- package/lib/index.d.cts +10 -5
- package/lib/legacy-protocol-sunset.cjs +1543 -0
- package/lib/legacy-protocol-sunset.d.cts +251 -0
- package/lib/library.cjs +303 -0
- package/lib/library.d.cts +16 -0
- package/lib/native-abt-exchange.cjs +7322 -0
- package/lib/native-abt-exchange.d.cts +2055 -0
- package/lib/ofac-screening.cjs +42 -0
- package/lib/ofac-screening.d.cts +17 -0
- package/lib/pipes/anti-land-attack.cjs +2 -2
- package/lib/pipes/decode-itx.cjs +46 -4
- package/lib/pipes/decode-itx.d.cts +1 -1
- package/lib/pipes/decode-tx.cjs +55 -116
- package/lib/pipes/decode-tx.d.cts +3 -4
- package/lib/pipes/extract-signer.cjs +2 -2
- package/lib/pipes/extract-state.cjs +14 -3
- package/lib/pipes/post-execution-invariant-gate.cjs +800 -0
- package/lib/pipes/post-execution-invariant-gate.d.cts +61 -0
- package/lib/pipes/pre-flight-waf.cjs +772 -0
- package/lib/pipes/pre-flight-waf.d.cts +73 -0
- package/lib/pipes/take-state-snapshot.cjs +3 -2
- package/lib/pipes/update-owner.cjs +40 -5
- package/lib/pipes/update-owner.d.cts +1 -1
- package/lib/pipes/verify-account-migration.cjs +14 -4
- package/lib/pipes/verify-blocked.cjs +1 -1
- package/lib/pipes/verify-delegation.cjs +259 -36
- package/lib/pipes/verify-delegation.d.cts +22 -3
- package/lib/pipes/verify-list-size.cjs +1 -1
- package/lib/pipes/verify-multisig-v2.cjs +15 -7
- package/lib/pipes/verify-multisig.cjs +15 -7
- package/lib/pipes/verify-sender.cjs +1 -1
- package/lib/pipes/verify-service-fee.d.cts +1 -1
- package/lib/pipes/verify-signature.cjs +35 -6
- package/lib/pipes/verify-signature.d.cts +1 -1
- package/lib/pipes/verify-signer.cjs +2 -2
- package/lib/pipes/verify-state-diff.cjs +4 -4
- package/lib/pipes/verify-token-access.cjs +2 -2
- package/lib/pipes/verify-token-balance.cjs +13 -5
- package/lib/pipes/verify-transferrable.cjs +3 -3
- package/lib/pipes/verify-transferrable.d.cts +8 -1
- package/lib/pipes/verify-tx-input.cjs +3 -3
- package/lib/pipes/verify-tx-size.cjs +46 -2
- package/lib/pipes/verify-tx-size.d.cts +1 -1
- package/lib/pipes/verify-tx.cjs +6 -8
- package/lib/pipes/verify-tx.d.cts +1 -1
- package/lib/pipes/verify-updater.cjs +1 -1
- package/lib/social-economy-factories.cjs +852 -0
- package/lib/social-economy-factories.d.cts +346 -0
- package/lib/super-suites-foundation.cjs +1257 -0
- package/lib/super-suites-foundation.d.cts +513 -0
- package/lib/transaction-block.cjs +1941 -0
- package/lib/transaction-block.d.cts +471 -0
- package/lib/uniswap-erc7683-solver.cjs +327 -0
- package/lib/uniswap-erc7683-solver.d.cts +201 -0
- package/lib/uniswap-lp-copilot.cjs +328 -0
- package/lib/uniswap-lp-copilot.d.cts +113 -0
- package/lib/uniswap-router.cjs +593 -0
- package/lib/uniswap-router.d.cts +335 -0
- package/lib/uniswap-token-factory-graduation.cjs +431 -0
- package/lib/uniswap-token-factory-graduation.d.cts +187 -0
- package/lib/uniswap-v4-hook.cjs +527 -0
- package/lib/uniswap-v4-hook.d.cts +173 -0
- package/package.json +11 -10
- package/esm/helpers/dedup-height.d.mts +0 -16
- package/esm/helpers/dedup-height.mjs +0 -61
- package/lib/helpers/dedup-height.cjs +0 -72
- package/lib/helpers/dedup-height.d.cts +0 -16
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { CrossChainPurchaseInput, TransactionBlockPostConditions, TransactionStatement } from "./transaction-block.cjs";
|
|
2
|
+
import { CHAINALYSIS_OFAC_ORACLE_ADDRESS, assertNotOfacSanctioned, normalizeScreeningAddress } from "./ofac-screening.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/uniswap-router.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Default Integrator Tag for Uniswap Universal Router & Base Builder Attribution.
|
|
8
|
+
*/
|
|
9
|
+
declare const DEFAULT_OCAP_INTEGRATOR_ID = "arcblock-ocap-checkout";
|
|
10
|
+
/**
|
|
11
|
+
* Maximum allowed slippage in basis points (5.00% = 500 bps) for 1-click cross-chain zaps.
|
|
12
|
+
*/
|
|
13
|
+
declare const MAX_ALLOWED_ZAP_SLIPPAGE_BPS = 500;
|
|
14
|
+
/**
|
|
15
|
+
* Maximum allowed token hops in a single Universal Router path (up to 5 tokens = 4 pool hops).
|
|
16
|
+
*/
|
|
17
|
+
declare const MAX_ROUTE_PATH_LENGTH = 5;
|
|
18
|
+
/**
|
|
19
|
+
* Standard Uniswap Universal Router command bytes.
|
|
20
|
+
*/
|
|
21
|
+
declare const UNIVERSAL_ROUTER_COMMANDS: {
|
|
22
|
+
readonly V3_SWAP_EXACT_IN: 0;
|
|
23
|
+
readonly SWEEP: 4;
|
|
24
|
+
readonly TRANSFER: 5;
|
|
25
|
+
readonly PAY_PORTION: 6;
|
|
26
|
+
readonly PERMIT2_PERMIT: 10;
|
|
27
|
+
readonly V4_SWAP: 16;
|
|
28
|
+
};
|
|
29
|
+
interface Permit2SingleSpec {
|
|
30
|
+
token: string;
|
|
31
|
+
amount: string;
|
|
32
|
+
expiration: number;
|
|
33
|
+
nonce: number;
|
|
34
|
+
spender: string;
|
|
35
|
+
sigDeadline: number;
|
|
36
|
+
signature: string;
|
|
37
|
+
}
|
|
38
|
+
interface UniversalRouterCrossChainZapInput {
|
|
39
|
+
chainId: string;
|
|
40
|
+
senderEvmAddress: string;
|
|
41
|
+
buyerOcapDid: string;
|
|
42
|
+
universalRouterAddress: string;
|
|
43
|
+
ocapVaultAddress: string;
|
|
44
|
+
tokenIn: string;
|
|
45
|
+
tokenOut: string;
|
|
46
|
+
/** Intermediate hop tokens (e.g. ['0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', '...'] for USDC -> ABT) */
|
|
47
|
+
routePath: string[];
|
|
48
|
+
poolVersion?: 'v3' | 'v4';
|
|
49
|
+
amountIn: string;
|
|
50
|
+
expectedAmountOut: string;
|
|
51
|
+
maxSlippageBps: number;
|
|
52
|
+
deadline: number;
|
|
53
|
+
currentTimestamp?: number;
|
|
54
|
+
permit2?: Permit2SingleSpec;
|
|
55
|
+
integratorId?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Must ALWAYS be 0 or omitted. Any non-zero swap brokerage fee bps is rejected
|
|
58
|
+
* to enforce the SEC Section 15(a) non-broker-dealer safe harbor.
|
|
59
|
+
*/
|
|
60
|
+
brokerageFeeBps?: number;
|
|
61
|
+
ofacBlocklist?: Iterable<string>;
|
|
62
|
+
}
|
|
63
|
+
interface UniversalRouterCrossChainZapPayload {
|
|
64
|
+
chainId: string;
|
|
65
|
+
to: string;
|
|
66
|
+
senderEvmAddress: string;
|
|
67
|
+
buyerOcapDid: string;
|
|
68
|
+
ocapVaultAddress: string;
|
|
69
|
+
commandsHex: string;
|
|
70
|
+
commandNames: string[];
|
|
71
|
+
routePath: string[];
|
|
72
|
+
amountIn: string;
|
|
73
|
+
expectedAmountOut: string;
|
|
74
|
+
amountOutMinimum: string;
|
|
75
|
+
maxSlippageBps: number;
|
|
76
|
+
deadline: number;
|
|
77
|
+
integratorTag: string;
|
|
78
|
+
brokerageFeeBps: 0;
|
|
79
|
+
ofacOracleAddress: string;
|
|
80
|
+
calldataDigest: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Builds a deterministic, router-friendly Uniswap Universal Router + Permit2 payload
|
|
84
|
+
* that swaps any ERC-20 token into settlement token (`USDC` or `ABT`) and transfers it
|
|
85
|
+
* into the OCAP Rollup Vault in a single EVM transaction.
|
|
86
|
+
*
|
|
87
|
+
* Security & Compliance Invariants:
|
|
88
|
+
* 1. Rejects any non-zero `brokerageFeeBps` or `PAY_PORTION` fee-skimming (SEC Section 15(a) Safe Harbor).
|
|
89
|
+
* 2. Screens sender, router, vault, token addresses, and OCAP buyer DID against OFAC blocklist.
|
|
90
|
+
* 3. Enforces strict `maxSlippageBps <= 500` (5%), loop-free route paths (`<= 5` tokens), and valid Permit2 hex signatures.
|
|
91
|
+
* 4. Embeds official `ocap:v1:<integratorId>` attribution tag for Uniswap & Base ecosystem alignment.
|
|
92
|
+
*/
|
|
93
|
+
declare function buildUniversalRouterCrossChainPayload(input: UniversalRouterCrossChainZapInput): UniversalRouterCrossChainZapPayload;
|
|
94
|
+
interface AbtUtilityPassThroughInput {
|
|
95
|
+
chainId: string;
|
|
96
|
+
senderEvmAddress: string;
|
|
97
|
+
buyerOcapDid: string;
|
|
98
|
+
relayerOcapDid: string;
|
|
99
|
+
rollupAddress: string;
|
|
100
|
+
universalRouterAddress: string;
|
|
101
|
+
ocapVaultAddress: string;
|
|
102
|
+
/** Source payment token on EVM (e.g. USDC, WETH, PEPE) */
|
|
103
|
+
paymentTokenEvmAddress: string;
|
|
104
|
+
/** ABT ERC-20 address on source EVM chain */
|
|
105
|
+
abtEvmAddress: string;
|
|
106
|
+
/** ABT native token address on OCAP chain */
|
|
107
|
+
abtOcapTokenAddress: string;
|
|
108
|
+
/** Full swap route from paymentTokenEvmAddress to abtEvmAddress */
|
|
109
|
+
routePath: string[];
|
|
110
|
+
poolVersion?: 'v3' | 'v4';
|
|
111
|
+
paymentAmountIn: string;
|
|
112
|
+
/** Total ABT output from Uniswap swap (must exactly equal abtServicePrice + abtRelayerFee) */
|
|
113
|
+
abtExpectedOut: string;
|
|
114
|
+
/** ABT consumed immediately on OCAP for Blocklet SaaS, AIGNE compute, or NFT purchase */
|
|
115
|
+
abtServicePrice: string;
|
|
116
|
+
/** Self-liquidating Relayer fee in ABT (must be >= minRelayerFee) */
|
|
117
|
+
abtRelayerFee: string;
|
|
118
|
+
minDepositValue?: string;
|
|
119
|
+
minRelayerFee?: string;
|
|
120
|
+
serviceRecipientDid: string;
|
|
121
|
+
serviceType: 'blocklet_subscription' | 'aigne_compute_credits' | 'nft_purchase' | 'utility_stake';
|
|
122
|
+
targetAssetOrStakeAddress?: string;
|
|
123
|
+
sourceTxEvidenceHash: string;
|
|
124
|
+
maxSlippageBps: number;
|
|
125
|
+
deadline: number;
|
|
126
|
+
currentTimestamp?: number;
|
|
127
|
+
fallbackToDepositOnPurchaseFailure?: boolean;
|
|
128
|
+
integratorId?: string;
|
|
129
|
+
ofacBlocklist?: Iterable<string>;
|
|
130
|
+
}
|
|
131
|
+
interface AbtUtilityPassThroughPlan {
|
|
132
|
+
evmSwapPayload: UniversalRouterCrossChainZapPayload;
|
|
133
|
+
ocapPurchaseBlockInput: CrossChainPurchaseInput;
|
|
134
|
+
economics: {
|
|
135
|
+
treasuryCapitalAtRisk: '0';
|
|
136
|
+
brokerageFeeBps: 0;
|
|
137
|
+
netBuyerSpeculativeAbtRetained: '0';
|
|
138
|
+
holdingPeriodSeconds: 0;
|
|
139
|
+
abtServicePrice: string;
|
|
140
|
+
abtRelayerFee: string;
|
|
141
|
+
totalAbtRouted: string;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Builds an end-to-end "Invisible ABT Utility Fuel" Pass-Through Plan:
|
|
146
|
+
* 1. User pays any token (`USDC`, `ETH`, etc.) on Base/Ethereum via Uniswap `USDC/ABT` pool.
|
|
147
|
+
* 2. Exact `ABT` needed (`abtServicePrice + abtRelayerFee`) is deposited to OCAP and
|
|
148
|
+
* 100% consumed/staked in the same atomic `TransactionBlock` (`holdingPeriodSeconds = 0`,
|
|
149
|
+
* `netBuyerSpeculativeAbtRetained = '0'`, `treasuryCapitalAtRisk = '0'`).
|
|
150
|
+
*/
|
|
151
|
+
declare function buildAbtUtilityPassThroughPlan(input: AbtUtilityPassThroughInput): AbtUtilityPassThroughPlan;
|
|
152
|
+
/**
|
|
153
|
+
* Maximum TTL (in seconds) for a USD-anchored dynamic ABT price quote (#1274).
|
|
154
|
+
*/
|
|
155
|
+
declare const MAX_USD_QUOTE_TTL_SECONDS = 300;
|
|
156
|
+
/**
|
|
157
|
+
* Default TTL (in seconds) for a USD-anchored dynamic ABT price quote (#1274).
|
|
158
|
+
*/
|
|
159
|
+
declare const DEFAULT_USD_QUOTE_TTL_SECONDS = 60;
|
|
160
|
+
/**
|
|
161
|
+
* 18-decimal base unit scale for ABT (`10^18`).
|
|
162
|
+
*/
|
|
163
|
+
declare const ABT_DECIMALS_SCALE = "1000000000000000000";
|
|
164
|
+
interface UsdAnchoredAbtQuoteInput {
|
|
165
|
+
quoteId: string;
|
|
166
|
+
serviceId: string;
|
|
167
|
+
buyerOcapDid: string;
|
|
168
|
+
/**
|
|
169
|
+
* Mental price in USD micro-units (`1_000_000` = `$1.00`, e.g. `$0.10` = `'100000'`).
|
|
170
|
+
*/
|
|
171
|
+
usdPriceMicro: string;
|
|
172
|
+
/**
|
|
173
|
+
* Uniswap V3/V4 TWAP/Spot price of 1.00 ABT in USD micro-units (e.g. `$0.50` = `'500000'`).
|
|
174
|
+
*/
|
|
175
|
+
abtUsdPriceMicro: string;
|
|
176
|
+
/**
|
|
177
|
+
* Maximum allowed slippage tolerance in basis points (`0..500` bps).
|
|
178
|
+
*/
|
|
179
|
+
maxSlippageBps?: number;
|
|
180
|
+
issuedAt: number;
|
|
181
|
+
expiresAt?: number;
|
|
182
|
+
oracleSource?: 'UNISWAP_V4_TWAP' | 'UNISWAP_V3_TWAP';
|
|
183
|
+
}
|
|
184
|
+
interface UsdAnchoredAbtQuote {
|
|
185
|
+
quoteId: string;
|
|
186
|
+
serviceId: string;
|
|
187
|
+
buyerOcapDid: string;
|
|
188
|
+
usdPriceMicro: string;
|
|
189
|
+
abtUsdPriceMicro: string;
|
|
190
|
+
/**
|
|
191
|
+
* Exact ceiling ABT amount in 18-decimal wei (`ceil(usdPriceMicro * 10^18 / abtUsdPriceMicro)`).
|
|
192
|
+
*/
|
|
193
|
+
requiredAbtWei: string;
|
|
194
|
+
/**
|
|
195
|
+
* Upper bound ABT amount in 18-decimal wei including `maxSlippageBps` buffer.
|
|
196
|
+
*/
|
|
197
|
+
maxAbtWithSlippageWei: string;
|
|
198
|
+
maxSlippageBps: number;
|
|
199
|
+
oracleSource: 'UNISWAP_V4_TWAP' | 'UNISWAP_V3_TWAP';
|
|
200
|
+
issuedAt: number;
|
|
201
|
+
expiresAt: number;
|
|
202
|
+
quoteDigest: string;
|
|
203
|
+
}
|
|
204
|
+
interface VerifyUsdAnchoredAbtQuoteInput {
|
|
205
|
+
quote: UsdAnchoredAbtQuote;
|
|
206
|
+
buyerOcapDid: string;
|
|
207
|
+
serviceId: string;
|
|
208
|
+
/**
|
|
209
|
+
* Authoritative catalog USD micro-price for `serviceId` (prevents client-forged underpriced quotes).
|
|
210
|
+
*/
|
|
211
|
+
expectedUsdPriceMicro: string;
|
|
212
|
+
/**
|
|
213
|
+
* Trusted Uniswap V3/V4 TWAP oracle price of 1.00 ABT in USD micro-units at verification time
|
|
214
|
+
* (prevents client-forged inflated exchange rates).
|
|
215
|
+
*/
|
|
216
|
+
trustedAbtUsdPriceMicro: string;
|
|
217
|
+
/**
|
|
218
|
+
* Maximum allowed deviation (in bps, `0..500`, default `200` = 2%) between `quote.abtUsdPriceMicro`
|
|
219
|
+
* and `trustedAbtUsdPriceMicro`.
|
|
220
|
+
*/
|
|
221
|
+
maxOracleDeviationBps?: number;
|
|
222
|
+
paidAbtWei: string;
|
|
223
|
+
nowTimestamp: number;
|
|
224
|
+
usedQuoteIds?: Set<string>;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Issue #1274:
|
|
228
|
+
* Computes a deterministic, CEX-independent USD-anchored `ABT` price quote from a Uniswap V3/V4
|
|
229
|
+
* TWAP/Spot price (`abtUsdPriceMicro`), giving users stable USD mental pricing (`$0.10`, `$1.00`, `$10.00`)
|
|
230
|
+
* while keeping the on-chain settlement 100% pure `ABT`.
|
|
231
|
+
*/
|
|
232
|
+
declare function createUsdAnchoredAbtQuote(input: UsdAnchoredAbtQuoteInput): UsdAnchoredAbtQuote;
|
|
233
|
+
/**
|
|
234
|
+
* Verifies a USD-anchored dynamic `ABT` quote for freshness, digest integrity, anti-replay,
|
|
235
|
+
* and exact slippage-bounded `ABT` payment sufficiency (#1274).
|
|
236
|
+
*/
|
|
237
|
+
declare function verifyUsdAnchoredAbtQuote(input: VerifyUsdAnchoredAbtQuoteInput): {
|
|
238
|
+
verified: true;
|
|
239
|
+
quoteId: string;
|
|
240
|
+
requiredAbtWei: string;
|
|
241
|
+
paidAbtWei: string;
|
|
242
|
+
};
|
|
243
|
+
interface OutboundWithdrawAndSwapInput {
|
|
244
|
+
chainId: string;
|
|
245
|
+
sellerOcapDid: string;
|
|
246
|
+
relayerOcapDid: string;
|
|
247
|
+
recipientEvmAddress: string;
|
|
248
|
+
ocapBridgeEscrowDid: string;
|
|
249
|
+
abtOcapTokenAddress: string;
|
|
250
|
+
/**
|
|
251
|
+
* Unmodified MultiSigVaultV2 contract address on EVM (holds only ABT).
|
|
252
|
+
*/
|
|
253
|
+
ocapVaultAddress: string;
|
|
254
|
+
/**
|
|
255
|
+
* Stateless ABTWithdrawSwapper router/helper contract on EVM that receives released ABT
|
|
256
|
+
* and atomically routes it through Uniswap Universal Router (or falls back to sending ABT to recipientEvmAddress).
|
|
257
|
+
*/
|
|
258
|
+
withdrawSwapperAddress: string;
|
|
259
|
+
universalRouterAddress: string;
|
|
260
|
+
abtEvmAddress: string;
|
|
261
|
+
/**
|
|
262
|
+
* Desired exit token on EVM (e.g., USDC, USDT, WETH, or abtEvmAddress for direct ABT exit).
|
|
263
|
+
*/
|
|
264
|
+
targetPayoutTokenAddress: string;
|
|
265
|
+
routePath: string[];
|
|
266
|
+
poolVersion?: 'v3' | 'v4';
|
|
267
|
+
/**
|
|
268
|
+
* Total ABT withdrawn from OCAP chain (`netAbtToSwap + relayerExitFeeAbt`).
|
|
269
|
+
*/
|
|
270
|
+
grossAbtWithdrawAmount: string;
|
|
271
|
+
/**
|
|
272
|
+
* ABT fee paid by the exiting user to cover EVM withdraw + swap gas (user bears 100% of exit cost).
|
|
273
|
+
*/
|
|
274
|
+
relayerExitFeeAbt: string;
|
|
275
|
+
/**
|
|
276
|
+
* Expected amount of `targetPayoutTokenAddress` from Uniswap.
|
|
277
|
+
*/
|
|
278
|
+
expectedTargetTokenOut: string;
|
|
279
|
+
maxSlippageBps: number;
|
|
280
|
+
/**
|
|
281
|
+
* 0x-prefixed 32-byte hash of the `OcapPublishedMultiSigCertificate` (`WITHDRAW_ABT`).
|
|
282
|
+
*/
|
|
283
|
+
publishedMultiSigCertHash: string;
|
|
284
|
+
deadline: number;
|
|
285
|
+
currentTimestamp?: number;
|
|
286
|
+
fallbackToDirectAbtOnSwapFailure?: boolean;
|
|
287
|
+
integratorId?: string;
|
|
288
|
+
ofacBlocklist?: Iterable<string>;
|
|
289
|
+
}
|
|
290
|
+
interface OutboundWithdrawAndSwapPlan {
|
|
291
|
+
mode: 'WITHDRAW_AND_UNISWAP_SWAP' | 'DIRECT_ABT_WITHDRAW';
|
|
292
|
+
ocapBurnAndFeeStatements: TransactionStatement[];
|
|
293
|
+
ocapPostConditions: TransactionBlockPostConditions;
|
|
294
|
+
evmVaultReleaseSpec: {
|
|
295
|
+
vaultAddress: string;
|
|
296
|
+
vaultContractModified: false;
|
|
297
|
+
vaultTokenReleased: string;
|
|
298
|
+
releaseRecipientAddress: string;
|
|
299
|
+
netAbtReleased: string;
|
|
300
|
+
publishedMultiSigCertHash: string;
|
|
301
|
+
};
|
|
302
|
+
evmSwapPayload?: UniversalRouterCrossChainZapPayload;
|
|
303
|
+
fallbackSafetySpec: {
|
|
304
|
+
fallbackToDirectAbtOnSwapFailure: boolean;
|
|
305
|
+
fallbackRecipientEvmAddress: string;
|
|
306
|
+
fallbackTokenAddress: string;
|
|
307
|
+
fallbackAmountAbt: string;
|
|
308
|
+
swapperRetainsZeroBalanceAfterTx: true;
|
|
309
|
+
};
|
|
310
|
+
economics: {
|
|
311
|
+
userBearsExitCost: true;
|
|
312
|
+
protocolSubsidyAbt: '0';
|
|
313
|
+
grossAbtWithdrawAmount: string;
|
|
314
|
+
relayerExitFeeAbt: string;
|
|
315
|
+
netAbtToSwap: string;
|
|
316
|
+
expectedTargetTokenOut: string;
|
|
317
|
+
minimumTargetTokenOut: string;
|
|
318
|
+
};
|
|
319
|
+
clearSigningSummary: {
|
|
320
|
+
youPay: string;
|
|
321
|
+
actions: string[];
|
|
322
|
+
youReceiveMinimum: string;
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Issue #1274:
|
|
327
|
+
* Builds a stateless 1-Click Outbound Withdraw + Uniswap Auto-Swap Plan ("Smooth In, Smooth Out"):
|
|
328
|
+
* - OCAP side: atomically locks/burns `netAbtToSwap` to `ocapBridgeEscrowDid` and pays `relayerExitFeeAbt` to `relayerOcapDid`.
|
|
329
|
+
* - EVM side: `MultiSigVaultV2` (100% unmodified, holding only `ABT`) releases `netAbtToSwap` via `OcapPublishedMultiSigCert`
|
|
330
|
+
* to `withdrawSwapperAddress`, which atomically swaps `ABT -> targetPayoutToken (USDC/USDT/ETH)` via Uniswap Universal Router
|
|
331
|
+
* and sweeps 100% of output to `recipientEvmAddress` (or safely falls back to sending `netAbtToSwap` directly to `recipientEvmAddress`).
|
|
332
|
+
*/
|
|
333
|
+
declare function buildOutboundWithdrawAndSwapPlan(input: OutboundWithdrawAndSwapInput): OutboundWithdrawAndSwapPlan;
|
|
334
|
+
//#endregion
|
|
335
|
+
export { ABT_DECIMALS_SCALE, AbtUtilityPassThroughInput, AbtUtilityPassThroughPlan, CHAINALYSIS_OFAC_ORACLE_ADDRESS, DEFAULT_OCAP_INTEGRATOR_ID, DEFAULT_USD_QUOTE_TTL_SECONDS, MAX_ALLOWED_ZAP_SLIPPAGE_BPS, MAX_ROUTE_PATH_LENGTH, MAX_USD_QUOTE_TTL_SECONDS, OutboundWithdrawAndSwapInput, OutboundWithdrawAndSwapPlan, Permit2SingleSpec, UNIVERSAL_ROUTER_COMMANDS, UniversalRouterCrossChainZapInput, UniversalRouterCrossChainZapPayload, UsdAnchoredAbtQuote, UsdAnchoredAbtQuoteInput, VerifyUsdAnchoredAbtQuoteInput, assertNotOfacSanctioned, buildAbtUtilityPassThroughPlan, buildOutboundWithdrawAndSwapPlan, buildUniversalRouterCrossChainPayload, createUsdAnchoredAbtQuote, normalizeScreeningAddress, verifyUsdAnchoredAbtQuote };
|