@ocap/tx-pipeline 1.31.0 → 1.31.2
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/bridge-release-keys.d.mts +33 -0
- package/esm/bridge-release-keys.mjs +81 -0
- package/esm/bridge-reserves.d.mts +107 -0
- package/esm/bridge-reserves.mjs +242 -0
- package/esm/helpers/bridge-withdraw.d.mts +86 -0
- package/esm/helpers/bridge-withdraw.mjs +123 -0
- package/esm/helpers/replay-guard.d.mts +19 -1
- package/esm/helpers/replay-guard.mjs +39 -1
- package/esm/index.d.mts +3 -1
- package/esm/index.mjs +8 -6
- package/esm/legacy-protocol-sunset.d.mts +2 -2
- package/esm/legacy-protocol-sunset.mjs +5 -5
- package/esm/legacy-rollup-archive.d.mts +67 -0
- package/esm/legacy-rollup-archive.mjs +199 -0
- package/esm/library.d.mts +4 -4
- package/esm/library.mjs +3 -3
- package/esm/native-abt-exchange.d.mts +3 -0
- package/esm/native-abt-exchange.mjs +93 -46
- package/esm/pipes/bridge-release-gate.d.mts +30 -0
- package/esm/pipes/bridge-release-gate.mjs +143 -0
- package/esm/pipes/bridge-reserve-v2-gate.d.mts +53 -0
- package/esm/pipes/bridge-reserve-v2-gate.mjs +264 -0
- package/esm/pipes/decode-itx.mjs +3 -0
- package/esm/pipes/decode-tx.mjs +32 -4
- package/esm/pipes/extract-signer.mjs +1 -1
- package/esm/pipes/extract-state.mjs +2 -2
- package/esm/pipes/post-execution-invariant-gate.d.mts +19 -2
- package/esm/pipes/post-execution-invariant-gate.mjs +121 -6
- package/esm/pipes/pre-flight-waf.d.mts +58 -2
- package/esm/pipes/pre-flight-waf.mjs +202 -14
- package/esm/pipes/update-owner.mjs +1 -1
- package/esm/pipes/verify-account-migration.mjs +1 -1
- package/esm/pipes/verify-delegation.mjs +49 -25
- package/esm/pipes/verify-multisig-v2.mjs +5 -4
- package/esm/pipes/verify-multisig.mjs +5 -4
- package/esm/pipes/verify-signature.d.mts +7 -1
- package/esm/pipes/verify-signature.mjs +119 -16
- package/esm/pipes/verify-signer.mjs +2 -2
- package/esm/pipes/verify-token-access.mjs +1 -1
- package/esm/pipes/verify-token-balance.mjs +1 -1
- package/esm/pipes/verify-tx-input.mjs +1 -1
- package/esm/pipes/verify-tx-size.mjs +1 -1
- package/esm/pipes/verify-tx.mjs +12 -5
- package/esm/super-suites-foundation.mjs +6 -6
- package/esm/transaction-block.d.mts +6 -2
- package/esm/transaction-block.mjs +282 -40
- package/esm/uniswap-router.d.mts +247 -1
- package/esm/uniswap-router.mjs +573 -2
- package/lib/bridge-release-keys.cjs +88 -0
- package/lib/bridge-release-keys.d.cts +33 -0
- package/lib/bridge-reserves.cjs +257 -0
- package/lib/bridge-reserves.d.cts +107 -0
- package/lib/helpers/bridge-withdraw.cjs +136 -0
- package/lib/helpers/bridge-withdraw.d.cts +86 -0
- package/lib/helpers/replay-guard.cjs +39 -0
- package/lib/helpers/replay-guard.d.cts +20 -2
- package/lib/index.cjs +25 -5
- package/lib/index.d.cts +3 -1
- package/lib/legacy-protocol-sunset.cjs +7 -7
- package/lib/legacy-protocol-sunset.d.cts +2 -2
- package/lib/legacy-rollup-archive.cjs +208 -0
- package/lib/legacy-rollup-archive.d.cts +67 -0
- package/lib/library.cjs +14 -68
- package/lib/library.d.cts +4 -4
- package/lib/native-abt-exchange.cjs +93 -46
- package/lib/native-abt-exchange.d.cts +3 -0
- package/lib/pipes/bridge-release-gate.cjs +145 -0
- package/lib/pipes/bridge-release-gate.d.cts +30 -0
- package/lib/pipes/bridge-reserve-v2-gate.cjs +273 -0
- package/lib/pipes/bridge-reserve-v2-gate.d.cts +53 -0
- package/lib/pipes/decode-itx.cjs +3 -0
- package/lib/pipes/decode-itx.d.cts +1 -1
- package/lib/pipes/decode-tx.cjs +31 -3
- package/lib/pipes/decode-tx.d.cts +1 -1
- package/lib/pipes/extract-signer.cjs +1 -1
- package/lib/pipes/extract-state.cjs +3 -3
- package/lib/pipes/post-execution-invariant-gate.cjs +121 -4
- package/lib/pipes/post-execution-invariant-gate.d.cts +19 -2
- package/lib/pipes/pre-flight-waf.cjs +209 -15
- package/lib/pipes/pre-flight-waf.d.cts +58 -2
- package/lib/pipes/update-owner.cjs +1 -1
- package/lib/pipes/update-owner.d.cts +1 -1
- package/lib/pipes/verify-account-migration.cjs +1 -1
- package/lib/pipes/verify-delegation.cjs +50 -26
- package/lib/pipes/verify-multisig-v2.cjs +5 -4
- package/lib/pipes/verify-multisig.cjs +5 -4
- package/lib/pipes/verify-service-fee.d.cts +1 -1
- package/lib/pipes/verify-signature.cjs +118 -14
- package/lib/pipes/verify-signature.d.cts +8 -2
- package/lib/pipes/verify-signer.cjs +2 -2
- package/lib/pipes/verify-token-access.cjs +1 -1
- package/lib/pipes/verify-token-balance.cjs +1 -1
- package/lib/pipes/verify-tx-input.cjs +1 -1
- package/lib/pipes/verify-tx-size.cjs +1 -1
- package/lib/pipes/verify-tx-size.d.cts +1 -1
- package/lib/pipes/verify-tx.cjs +11 -5
- package/lib/pipes/verify-tx.d.cts +1 -1
- package/lib/super-suites-foundation.cjs +6 -6
- package/lib/transaction-block.cjs +282 -40
- package/lib/transaction-block.d.cts +6 -2
- package/lib/uniswap-router.cjs +576 -1
- package/lib/uniswap-router.d.cts +247 -1
- package/package.json +10 -10
- package/esm/evm-simplified-bridge.d.mts +0 -1370
- package/esm/evm-simplified-bridge.mjs +0 -3875
- package/lib/evm-simplified-bridge.cjs +0 -3943
- package/lib/evm-simplified-bridge.d.cts +0 -1370
package/lib/uniswap-router.d.cts
CHANGED
|
@@ -127,6 +127,12 @@ interface AbtUtilityPassThroughInput {
|
|
|
127
127
|
fallbackToDepositOnPurchaseFailure?: boolean;
|
|
128
128
|
integratorId?: string;
|
|
129
129
|
ofacBlocklist?: Iterable<string>;
|
|
130
|
+
/**
|
|
131
|
+
* Optional whitelist of Selected Treasury Reserve Token addresses (e.g. ETH/WETH/USDC/USDT).
|
|
132
|
+
* When provided, attempting to swap a Selected Treasury Reserve Token into ABT via Uniswap is rejected
|
|
133
|
+
* because selected currencies must be collected directly into our Official External Treasury Wallet (#1408).
|
|
134
|
+
*/
|
|
135
|
+
selectedTreasuryTokenAddresses?: Iterable<string>;
|
|
130
136
|
}
|
|
131
137
|
interface AbtUtilityPassThroughPlan {
|
|
132
138
|
evmSwapPayload: UniversalRouterCrossChainZapPayload;
|
|
@@ -331,5 +337,245 @@ interface OutboundWithdrawAndSwapPlan {
|
|
|
331
337
|
* and sweeps 100% of output to `recipientEvmAddress` (or safely falls back to sending `netAbtToSwap` directly to `recipientEvmAddress`).
|
|
332
338
|
*/
|
|
333
339
|
declare function buildOutboundWithdrawAndSwapPlan(input: OutboundWithdrawAndSwapInput): OutboundWithdrawAndSwapPlan;
|
|
340
|
+
/**
|
|
341
|
+
* Issue #1408 (`#blockchain seq: 830, 831, 833, 834`):
|
|
342
|
+
* Default Selected Valuable External Currencies that our Official External Treasury directly accepts and holds,
|
|
343
|
+
* treated identically to Credit Card (Stripe) checkout — NEVER swapped into ABT on Uniswap.
|
|
344
|
+
*/
|
|
345
|
+
declare const DEFAULT_SELECTED_TREASURY_CURRENCY_SYMBOLS: readonly ["ETH", "WETH", "USDC", "USDT", "SOL"];
|
|
346
|
+
/**
|
|
347
|
+
* Maximum number of consumed external payment evidences retained in `DirectBuyTreasuryCashier` memory
|
|
348
|
+
* to enforce bounded hardware I/O envelope.
|
|
349
|
+
*/
|
|
350
|
+
declare const MAX_TRACKED_DIRECT_BUY_EVIDENCES = 10000;
|
|
351
|
+
type SelectedTreasuryCurrencySymbol = (typeof DEFAULT_SELECTED_TREASURY_CURRENCY_SYMBOLS)[number];
|
|
352
|
+
type ExternalPaymentChainFamily = 'EVM' | 'SOLANA';
|
|
353
|
+
type DirectBuyExternalSettlementMode = 'SELECTED_TREASURY_CURRENCY_DIRECT_TRANSFER' | 'UNLISTED_TOKEN_EXTERNAL_UNISWAP_TO_TREASURY_CURRENCY';
|
|
354
|
+
type DirectBuyOcapFulfillmentMode = 'FIRST_PARTY_DIRECT_PAYMENT' | 'OFFICIAL_TREASURY_ABT_RELEASE';
|
|
355
|
+
type DirectBuyPricingPolicyMode = 'CATALOG_FIXED_PRICE' | 'OFFICIAL_PRICING_RATE';
|
|
356
|
+
interface SelectedTreasuryCurrencySpec {
|
|
357
|
+
symbol: SelectedTreasuryCurrencySymbol;
|
|
358
|
+
chainFamily: ExternalPaymentChainFamily;
|
|
359
|
+
chainId: string;
|
|
360
|
+
/**
|
|
361
|
+
* Canonical external token identifier:
|
|
362
|
+
* - EVM ERC-20: 20-byte 0x hex address (normalized lowercase)
|
|
363
|
+
* - EVM Native ETH: 'native:eth' or '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
|
|
364
|
+
* - Solana Native SOL / SPL Mint: 'native:sol' or Base58 mint address
|
|
365
|
+
*/
|
|
366
|
+
tokenAddress: string;
|
|
367
|
+
decimals: number;
|
|
368
|
+
/**
|
|
369
|
+
* Price of 1 full unit (`10^decimals` base units) of this currency in USD micro-units (`1_000_000` = `$1.00`),
|
|
370
|
+
* used when `pricingPolicyMode === 'OFFICIAL_PRICING_RATE'`.
|
|
371
|
+
*/
|
|
372
|
+
officialUsdPriceMicroPerUnit: string;
|
|
373
|
+
}
|
|
374
|
+
interface UnlistedTokenExternalSwapSpec {
|
|
375
|
+
universalRouterAddress: string;
|
|
376
|
+
/**
|
|
377
|
+
* Target whitelisted Selected Treasury Currency (`USDC`, `USDT`, `WETH`) on the same EVM chain.
|
|
378
|
+
* Must NEVER be `ABT` — unlisted tokens are swapped into a Selected Treasury Currency and swept
|
|
379
|
+
* to `officialExternalTreasuryAddress`.
|
|
380
|
+
*/
|
|
381
|
+
settledTreasuryTokenAddress: string;
|
|
382
|
+
routePath: string[];
|
|
383
|
+
poolVersion?: 'v3' | 'v4';
|
|
384
|
+
expectedSettledTreasuryAmountOut: string;
|
|
385
|
+
maxSlippageBps: number;
|
|
386
|
+
deadline: number;
|
|
387
|
+
currentTimestamp?: number;
|
|
388
|
+
permit2?: Permit2SingleSpec;
|
|
389
|
+
integratorId?: string;
|
|
390
|
+
}
|
|
391
|
+
interface DirectBuyTreasuryCashierInput {
|
|
392
|
+
orderId: string;
|
|
393
|
+
serviceId: string;
|
|
394
|
+
serviceType: 'blocklet_subscription' | 'aigne_compute_credits' | 'nft_purchase' | 'utility_stake';
|
|
395
|
+
chainFamily: ExternalPaymentChainFamily;
|
|
396
|
+
chainId: string;
|
|
397
|
+
senderExternalAddress: string;
|
|
398
|
+
/**
|
|
399
|
+
* Our own controlled Official External Treasury Wallet on the external chain (EVM or Solana).
|
|
400
|
+
* Must be 100% distinct from any ABT Bridge contract (`bridgeContractAddress` / `rollupAddress`).
|
|
401
|
+
*/
|
|
402
|
+
officialExternalTreasuryAddress: string;
|
|
403
|
+
/**
|
|
404
|
+
* Optional known Bridge contract address on the same external chain; if provided, the cashier
|
|
405
|
+
* enforces `officialExternalTreasuryAddress !== bridgeContractAddress` (100% Bridge decoupling).
|
|
406
|
+
*/
|
|
407
|
+
bridgeContractAddress?: string;
|
|
408
|
+
/**
|
|
409
|
+
* Optional ABT ERC-20 address on the external chain; if provided, the cashier enforces that
|
|
410
|
+
* Direct Buy NEVER swaps into ERC-20 ABT on Uniswap (we already hold abundant ABT on OCAP).
|
|
411
|
+
*/
|
|
412
|
+
abtExternalTokenAddress?: string;
|
|
413
|
+
/**
|
|
414
|
+
* Token the user is paying with on the external chain.
|
|
415
|
+
* - If in `selectedTreasuryCurrencies`: collected directly into `officialExternalTreasuryAddress` (0 Uniswap swap).
|
|
416
|
+
* - If NOT in `selectedTreasuryCurrencies`: rejected unless `unlistedTokenSwap` is provided to swap it on
|
|
417
|
+
* external Uniswap into a Selected Treasury Currency first.
|
|
418
|
+
*/
|
|
419
|
+
paymentTokenAddress: string;
|
|
420
|
+
paymentAmountIn: string;
|
|
421
|
+
selectedTreasuryCurrencies: SelectedTreasuryCurrencySpec[];
|
|
422
|
+
/**
|
|
423
|
+
* Only allowed when `paymentTokenAddress` is NOT a Selected Treasury Currency.
|
|
424
|
+
* Forbidden when `paymentTokenAddress` IS already a Selected Treasury Currency (`ETH`, `WETH`, `USDC`, `USDT`, `SOL`).
|
|
425
|
+
*/
|
|
426
|
+
unlistedTokenSwap?: UnlistedTokenExternalSwapSpec;
|
|
427
|
+
externalPaymentTxHash: string;
|
|
428
|
+
externalLogIndex?: number;
|
|
429
|
+
confirmations: number;
|
|
430
|
+
minConfirmations?: number;
|
|
431
|
+
reorged?: boolean;
|
|
432
|
+
buyerOcapDid: string;
|
|
433
|
+
serviceRecipientDid: string;
|
|
434
|
+
targetAssetOrStakeAddress?: string;
|
|
435
|
+
/**
|
|
436
|
+
* Two OCAP Fulfillment Modes (#1408):
|
|
437
|
+
* - `FIRST_PARTY_DIRECT_PAYMENT`: Identical to Credit Card (Stripe) payment for our own first-party services.
|
|
438
|
+
* External treasury collects `ETH/USDC/USDT/SOL`, and OCAP directly delivers the service/credit/asset/VC
|
|
439
|
+
* with 0 ABT conversion required.
|
|
440
|
+
* - `OFFICIAL_TREASURY_ABT_RELEASE`: When the target OCAP protocol/merchant requires `ABT`, our
|
|
441
|
+
* `officialOcapTreasuryDid` directly releases existing `ABT` on OCAP using catalog/official pricing
|
|
442
|
+
* (0 Bridge `deposit_token_v2`).
|
|
443
|
+
*/
|
|
444
|
+
ocapFulfillmentMode: DirectBuyOcapFulfillmentMode;
|
|
445
|
+
pricingPolicyMode: DirectBuyPricingPolicyMode;
|
|
446
|
+
/**
|
|
447
|
+
* Required when `ocapFulfillmentMode === 'OFFICIAL_TREASURY_ABT_RELEASE'`.
|
|
448
|
+
*/
|
|
449
|
+
officialOcapTreasuryDid?: string;
|
|
450
|
+
abtOcapTokenAddress?: string;
|
|
451
|
+
relayerOcapDid?: string;
|
|
452
|
+
abtRelayerFeeWei?: string;
|
|
453
|
+
/**
|
|
454
|
+
* Fixed catalog ABT price in 18-decimal wei (used when `pricingPolicyMode === 'CATALOG_FIXED_PRICE'`),
|
|
455
|
+
* OR derived from `catalogUsdPriceMicro` and `officialAbtPriceMicroUsd` (used when `pricingPolicyMode === 'OFFICIAL_PRICING_RATE'`).
|
|
456
|
+
*/
|
|
457
|
+
abtCatalogPriceWei?: string;
|
|
458
|
+
/**
|
|
459
|
+
* Catalog price in USD micro-units (`1_000_000` = `$1.00`).
|
|
460
|
+
*/
|
|
461
|
+
catalogUsdPriceMicro: string;
|
|
462
|
+
/**
|
|
463
|
+
* Official ABT pricing rate in USD micro-units per 1.00 ABT (`10^18` wei), independent of real-time DEX spot rates.
|
|
464
|
+
*/
|
|
465
|
+
officialAbtPriceMicroUsd?: string;
|
|
466
|
+
ofacBlocklist?: Iterable<string>;
|
|
467
|
+
}
|
|
468
|
+
interface DirectBuyTreasuryCashierPlan {
|
|
469
|
+
orderId: string;
|
|
470
|
+
serviceId: string;
|
|
471
|
+
serviceType: 'blocklet_subscription' | 'aigne_compute_credits' | 'nft_purchase' | 'utility_stake';
|
|
472
|
+
externalSettlementMode: DirectBuyExternalSettlementMode;
|
|
473
|
+
ocapFulfillmentMode: DirectBuyOcapFulfillmentMode;
|
|
474
|
+
pricingPolicyMode: DirectBuyPricingPolicyMode;
|
|
475
|
+
bridgeDecoupled: true;
|
|
476
|
+
usesBridgeDepositProtocol: false;
|
|
477
|
+
selectedCurrencySwappedOnUniswap: false;
|
|
478
|
+
externalSettlementSpec: {
|
|
479
|
+
chainFamily: ExternalPaymentChainFamily;
|
|
480
|
+
chainId: string;
|
|
481
|
+
senderExternalAddress: string;
|
|
482
|
+
officialExternalTreasuryAddress: string;
|
|
483
|
+
userPaymentTokenAddress: string;
|
|
484
|
+
userPaymentAmountIn: string;
|
|
485
|
+
settledTreasuryCurrencySymbol: SelectedTreasuryCurrencySymbol;
|
|
486
|
+
settledTreasuryTokenAddress: string;
|
|
487
|
+
settledTreasuryCurrencyAmount: string;
|
|
488
|
+
settledTreasuryValueUsdMicro: string;
|
|
489
|
+
externalPaymentTxHash: string;
|
|
490
|
+
externalLogIndex: number;
|
|
491
|
+
confirmations: number;
|
|
492
|
+
unlistedTokenSwapPayload?: UniversalRouterCrossChainZapPayload;
|
|
493
|
+
};
|
|
494
|
+
ocapExecutionSpec: {
|
|
495
|
+
buyerOcapDid: string;
|
|
496
|
+
serviceRecipientDid: string;
|
|
497
|
+
officialOcapTreasuryDid?: string;
|
|
498
|
+
abtOcapTokenAddress?: string;
|
|
499
|
+
abtReleasedFromTreasuryWei: string;
|
|
500
|
+
abtServicePriceWei: string;
|
|
501
|
+
abtRelayerFeeWei: string;
|
|
502
|
+
statements: TransactionStatement[];
|
|
503
|
+
treasuryPostConditions?: TransactionBlockPostConditions;
|
|
504
|
+
buyerPostConditions: TransactionBlockPostConditions;
|
|
505
|
+
};
|
|
506
|
+
economics: {
|
|
507
|
+
stripeEquivalentDirectTreasuryCollection: true;
|
|
508
|
+
uniswapSwapUsedForSelectedCurrency: false;
|
|
509
|
+
bridgeRollupUsed: false;
|
|
510
|
+
netBuyerSpeculativeAbtRetained: '0';
|
|
511
|
+
holdingPeriodSeconds: 0;
|
|
512
|
+
catalogUsdPriceMicro: string;
|
|
513
|
+
settledTreasuryValueUsdMicro: string;
|
|
514
|
+
abtServicePriceWei: string;
|
|
515
|
+
abtRelayerFeeWei: string;
|
|
516
|
+
totalAbtReleasedFromOcapTreasuryWei: string;
|
|
517
|
+
};
|
|
518
|
+
clearSigningSummary: {
|
|
519
|
+
youPayExternal: string;
|
|
520
|
+
externalSettlement: string;
|
|
521
|
+
ocapFulfillmentMode: DirectBuyOcapFulfillmentMode;
|
|
522
|
+
actions: string[];
|
|
523
|
+
youReceiveOnOcap: string;
|
|
524
|
+
};
|
|
525
|
+
evidenceKey: string;
|
|
526
|
+
planDigest: string;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Issue #1408 (`#blockchain seq: 830, 831, 833, 834`):
|
|
530
|
+
* Builds a Bridge-Decoupled, Stripe-Equivalent Direct Buy Treasury Cashier Plan:
|
|
531
|
+
*
|
|
532
|
+
* 1. **Selected Valuable External Currencies (`ETH`, `WETH`, `USDC`, `USDT`, `SOL`) = Credit Card (Stripe) Equivalent**:
|
|
533
|
+
* - **Zero Uniswap Swap**: Never routed through Uniswap to buy `ABT` (rejects `unlistedTokenSwap` on selected currencies).
|
|
534
|
+
* - **Zero Bridge Coupling**: Paid directly to our controlled `officialExternalTreasuryAddress` (never to `ArcEvmBridgeGateway` / `MultiSigVault`).
|
|
535
|
+
* - **Two OCAP Fulfillment Modes**:
|
|
536
|
+
* - `FIRST_PARTY_DIRECT_PAYMENT`: For our own first-party services, OCAP directly delivers the service/credit/asset/VC without any `ABT` conversion.
|
|
537
|
+
* - `OFFICIAL_TREASURY_ABT_RELEASE`: When the target OCAP protocol/merchant requires `ABT`, our `officialOcapTreasuryDid` directly releases existing `ABT` on OCAP using `CATALOG_FIXED_PRICE` or `OFFICIAL_PRICING_RATE` (0 `deposit_token_v2`).
|
|
538
|
+
*
|
|
539
|
+
* 2. **Unlisted / Unrecognized External Tokens (Anti-Scam-Token Gate)**:
|
|
540
|
+
* - Our Official External Treasury Wallet **never accepts or holds unlisted tokens directly** (`UNLISTED_TOKEN_DIRECT_TREASURY_PAYMENT_FORBIDDEN`).
|
|
541
|
+
* - User must swap the unlisted token on the external chain via Uniswap **into a Selected Treasury Currency (`USDC`, `USDT`, `WETH`)** swept to `officialExternalTreasuryAddress`, after which OCAP fulfillment proceeds via the same Bridge-free cashier flow.
|
|
542
|
+
*/
|
|
543
|
+
declare function buildDirectBuyTreasuryCashierPlan(input: DirectBuyTreasuryCashierInput): DirectBuyTreasuryCashierPlan;
|
|
544
|
+
interface DirectBuyTreasuryCashierConfig {
|
|
545
|
+
selectedTreasuryCurrencies: SelectedTreasuryCurrencySpec[];
|
|
546
|
+
officialOcapTreasuryDid: string;
|
|
547
|
+
abtOcapTokenAddress: string;
|
|
548
|
+
officialAbtPriceMicroUsd: string;
|
|
549
|
+
minConfirmationsByChainFamily?: Partial<Record<ExternalPaymentChainFamily, number>>;
|
|
550
|
+
maxTrackedEvidences?: number;
|
|
551
|
+
ofacBlocklist?: Iterable<string>;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Stateful, replay-protected Direct Buy Treasury Cashier coordinator (#1408).
|
|
555
|
+
* Enforces:
|
|
556
|
+
* - Zero Bridge coupling (never emits `deposit_token_v2` or touches `ArcEvmBridgeGateway` / `MultiSigVault`)
|
|
557
|
+
* - Zero Uniswap swap for Selected Treasury Currencies (`ETH`, `WETH`, `USDC`, `USDT`, `SOL`)
|
|
558
|
+
* - Anti-Scam-Token gate for Unlisted Tokens (must swap on external Uniswap into a Selected Treasury Currency first)
|
|
559
|
+
* - Triple replay protection on `evidenceKey` (`chainFamily:chainId:txHash:logIndex`), `txKey` (`chainFamily:chainId:txHash`), and `orderId`
|
|
560
|
+
*/
|
|
561
|
+
declare class DirectBuyTreasuryCashier {
|
|
562
|
+
private readonly selectedTreasuryCurrencies;
|
|
563
|
+
private readonly officialOcapTreasuryDid;
|
|
564
|
+
private readonly abtOcapTokenAddress;
|
|
565
|
+
private officialAbtPriceMicroUsd;
|
|
566
|
+
private readonly minConfirmationsByChainFamily;
|
|
567
|
+
private readonly maxTrackedEvidences;
|
|
568
|
+
private readonly defaultOfacBlocklist;
|
|
569
|
+
private readonly consumedEvidenceKeys;
|
|
570
|
+
private readonly consumedTxKeys;
|
|
571
|
+
private readonly consumedOrderIds;
|
|
572
|
+
constructor(config: DirectBuyTreasuryCashierConfig);
|
|
573
|
+
updateOfficialAbtPriceMicroUsd(newPriceMicroUsd: string): void;
|
|
574
|
+
isEvidenceConsumed(evidenceKey: string): boolean;
|
|
575
|
+
isOrderConsumed(orderId: string): boolean;
|
|
576
|
+
processExternalDirectBuyOrder(input: Omit<DirectBuyTreasuryCashierInput, 'selectedTreasuryCurrencies' | 'officialOcapTreasuryDid' | 'abtOcapTokenAddress' | 'officialAbtPriceMicroUsd'> & {
|
|
577
|
+
officialAbtPriceMicroUsd?: string;
|
|
578
|
+
}): DirectBuyTreasuryCashierPlan;
|
|
579
|
+
}
|
|
334
580
|
//#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 };
|
|
581
|
+
export { ABT_DECIMALS_SCALE, AbtUtilityPassThroughInput, AbtUtilityPassThroughPlan, CHAINALYSIS_OFAC_ORACLE_ADDRESS, DEFAULT_OCAP_INTEGRATOR_ID, DEFAULT_SELECTED_TREASURY_CURRENCY_SYMBOLS, DEFAULT_USD_QUOTE_TTL_SECONDS, DirectBuyExternalSettlementMode, DirectBuyOcapFulfillmentMode, DirectBuyPricingPolicyMode, DirectBuyTreasuryCashier, DirectBuyTreasuryCashierConfig, DirectBuyTreasuryCashierInput, DirectBuyTreasuryCashierPlan, ExternalPaymentChainFamily, MAX_ALLOWED_ZAP_SLIPPAGE_BPS, MAX_ROUTE_PATH_LENGTH, MAX_TRACKED_DIRECT_BUY_EVIDENCES, MAX_USD_QUOTE_TTL_SECONDS, OutboundWithdrawAndSwapInput, OutboundWithdrawAndSwapPlan, Permit2SingleSpec, SelectedTreasuryCurrencySpec, SelectedTreasuryCurrencySymbol, UNIVERSAL_ROUTER_COMMANDS, UniversalRouterCrossChainZapInput, UniversalRouterCrossChainZapPayload, UnlistedTokenExternalSwapSpec, UsdAnchoredAbtQuote, UsdAnchoredAbtQuoteInput, VerifyUsdAnchoredAbtQuoteInput, assertNotOfacSanctioned, buildAbtUtilityPassThroughPlan, buildDirectBuyTreasuryCashierPlan, buildOutboundWithdrawAndSwapPlan, buildUniversalRouterCrossChainPayload, createUsdAnchoredAbtQuote, normalizeScreeningAddress, verifyUsdAnchoredAbtQuote };
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.31.
|
|
6
|
+
"version": "1.31.2",
|
|
7
7
|
"description": "Pipeline runner and common pipelines to process transactions",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./lib/index.cjs",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"elliptic": "6.5.3"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@arcblock/did": "1.31.
|
|
53
|
-
"@arcblock/did-util": "1.31.
|
|
54
|
-
"@ocap/client": "1.31.
|
|
55
|
-
"@ocap/mcrypto": "1.31.
|
|
56
|
-
"@ocap/message": "1.31.
|
|
57
|
-
"@ocap/state": "1.31.
|
|
58
|
-
"@ocap/types": "1.31.
|
|
59
|
-
"@ocap/util": "1.31.
|
|
60
|
-
"@ocap/wallet": "1.31.
|
|
52
|
+
"@arcblock/did": "1.31.2",
|
|
53
|
+
"@arcblock/did-util": "1.31.2",
|
|
54
|
+
"@ocap/client": "1.31.2",
|
|
55
|
+
"@ocap/mcrypto": "1.31.2",
|
|
56
|
+
"@ocap/message": "1.31.2",
|
|
57
|
+
"@ocap/state": "1.31.2",
|
|
58
|
+
"@ocap/types": "1.31.2",
|
|
59
|
+
"@ocap/util": "1.31.2",
|
|
60
|
+
"@ocap/wallet": "1.31.2",
|
|
61
61
|
"elliptic": "6.6.1",
|
|
62
62
|
"debug": "^4.4.3",
|
|
63
63
|
"lodash": "^4.17.23"
|