@vultisig/core-chain 2.35.0 → 2.36.0
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/CHANGELOG.md +27 -0
- package/dist/chains/evm/opStack/getOpStackFeeSurcharge.d.ts +22 -0
- package/dist/chains/evm/opStack/getOpStackFeeSurcharge.d.ts.map +1 -0
- package/dist/chains/evm/opStack/getOpStackFeeSurcharge.js +68 -0
- package/dist/chains/evm/opStack/getOpStackFeeSurcharge.js.map +1 -0
- package/dist/chains/evm/opStack/l1FeeProbeData.d.ts +23 -0
- package/dist/chains/evm/opStack/l1FeeProbeData.d.ts.map +1 -0
- package/dist/chains/evm/opStack/l1FeeProbeData.js +38 -0
- package/dist/chains/evm/opStack/l1FeeProbeData.js.map +1 -0
- package/dist/chains/evm/opStack/opStackChains.d.ts +19 -0
- package/dist/chains/evm/opStack/opStackChains.d.ts.map +1 -0
- package/dist/chains/evm/opStack/opStackChains.js +19 -0
- package/dist/chains/evm/opStack/opStackChains.js.map +1 -0
- package/dist/chains/sui/listAllCoins.d.ts.map +1 -1
- package/dist/chains/sui/listAllCoins.js +8 -0
- package/dist/chains/sui/listAllCoins.js.map +1 -1
- package/dist/swap/general/knownAggregatorRouters.d.ts +40 -22
- package/dist/swap/general/knownAggregatorRouters.d.ts.map +1 -1
- package/dist/swap/general/knownAggregatorRouters.js +147 -54
- package/dist/swap/general/knownAggregatorRouters.js.map +1 -1
- package/dist/swap/general/lifi/api/getLifiSwapQuote.d.ts.map +1 -1
- package/dist/swap/general/lifi/api/getLifiSwapQuote.js +15 -48
- package/dist/swap/general/lifi/api/getLifiSwapQuote.js.map +1 -1
- package/dist/swap/general/lifi/api/lifiSwapFeeChain.d.ts +4 -0
- package/dist/swap/general/lifi/api/lifiSwapFeeChain.d.ts.map +1 -0
- package/dist/swap/general/lifi/api/lifiSwapFeeChain.js +19 -0
- package/dist/swap/general/lifi/api/lifiSwapFeeChain.js.map +1 -0
- package/dist/swap/general/swapkit/api/getSwapKitQuote.d.ts.map +1 -1
- package/dist/swap/general/swapkit/api/getSwapKitQuote.js +24 -44
- package/dist/swap/general/swapkit/api/getSwapKitQuote.js.map +1 -1
- package/dist/swap/quote/SwapQuote.d.ts +12 -0
- package/dist/swap/quote/SwapQuote.d.ts.map +1 -1
- package/dist/swap/quote/findSwapQuote.d.ts +9 -2
- package/dist/swap/quote/findSwapQuote.d.ts.map +1 -1
- package/dist/swap/quote/findSwapQuote.js +32 -2
- package/dist/swap/quote/findSwapQuote.js.map +1 -1
- package/dist/swap/quote/getSwapQuoteSafetyFingerprint.d.ts +20 -0
- package/dist/swap/quote/getSwapQuoteSafetyFingerprint.d.ts.map +1 -0
- package/dist/swap/quote/getSwapQuoteSafetyFingerprint.js +67 -0
- package/dist/swap/quote/getSwapQuoteSafetyFingerprint.js.map +1 -0
- package/package.json +26 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @vultisig/core-chain
|
|
2
2
|
|
|
3
|
+
## 2.36.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1830](https://github.com/vultisig/vultisig-sdk/pull/1830) [`1fd27b9`](https://github.com/vultisig/vultisig-sdk/commit/1fd27b9103b75a13191f173ebeed98288d8c16b0) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Fail closed when LI.FI returns a destination outside its official chain-scoped Diamond deployments. Accept that Diamond as LI.FI's deterministic approval-spender fast path, while requiring an independent benign Blockaid verdict for any route-dependent spender that differs from it. Require the same independent verdicts for SwapKit EVM transaction destinations and approval spenders, while retaining response-local target-address binding as defense in depth.
|
|
8
|
+
|
|
9
|
+
**Consumer-visible behavior changes:**
|
|
10
|
+
|
|
11
|
+
- **New runtime throws on the signing path.** A LI.FI destination outside the official Diamond, a distinct LI.FI approval spender that doesn't clear an independent Blockaid check, or a SwapKit destination/approval-spender that doesn't clear the same check now throws during quote construction and co-signer signing-input construction. A consumer on a caret range picks this up automatically.
|
|
12
|
+
- **Dynamic LI.FI approval spenders and SwapKit addresses add a live third-party network call (Blockaid) during MPC signing**, per co-signer. The official LI.FI Diamond remains an offline fast path. A slow or unreachable Blockaid response can stall a signing ceremony for up to the shared `queryUrl` timeout (20s default) before throwing.
|
|
13
|
+
|
|
14
|
+
- [#1811](https://github.com/vultisig/vultisig-sdk/pull/1811) [`003ee98`](https://github.com/vultisig/vultisig-sdk/commit/003ee98728f3318eb2de661209f164b449150810) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Bind raw swap quotes to their exact coin identities, requested source amount, absolute expiry, and returned transaction, then reject missing, stale, mismatched, or mutated quotes in the vault-free swap preparation path before any payload construction. General quotes remain preparation-valid for five minutes while SDK presentation continues to recommend refreshing after 60 seconds, and vault-free callers can catch `SwapQuoteExpiredError` to requote.
|
|
15
|
+
|
|
16
|
+
Consumers must pass the live bound quote returned by `findSwapQuote` or `getSwapQuote` into preparation instead of constructing or persisting an unbound raw quote. Structured cloning is supported; JSON round-tripping is not because it loses required runtime value types such as `bigint`.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#1883](https://github.com/vultisig/vultisig-sdk/pull/1883) [`44f0ecb`](https://github.com/vultisig/vultisig-sdk/commit/44f0ecbdf10b07789341c0279041d3a1e37d46a0) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Share LI.FI fee-chain fallback logic between the core and React Native quote paths.
|
|
21
|
+
|
|
22
|
+
- [#1886](https://github.com/vultisig/vultisig-sdk/pull/1886) [`eb25508`](https://github.com/vultisig/vultisig-sdk/commit/eb25508eadfde14ee62470e64d8c2b590627fd76) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Fail closed when Sui pagination reports more data without a usable cursor, preventing partial coin sets or portfolios from being returned as complete.
|
|
23
|
+
|
|
24
|
+
## 2.35.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [#1846](https://github.com/vultisig/vultisig-sdk/pull/1846) [`8faa612`](https://github.com/vultisig/vultisig-sdk/commit/8faa612e6358af0a77cebf9c06d8865d832b69df) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - Reserve the OP-stack balance-check surcharges in the EVM fee amount, so a native max send on Optimism, Base, Blast or Mantle stays affordable at broadcast. op-geth requires `value + gasLimit * maxFeePerGas + l1Cost + operatorCost`, and an amount that left only the gas term behind was rejected by exactly the difference — after the keysign ceremony had already run. Both oracle reads fail open, so a chain whose oracle is unreachable or predates a term behaves exactly as before.
|
|
29
|
+
|
|
3
30
|
## 2.35.0
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OpStackChain } from './opStackChains.js';
|
|
2
|
+
type GetOpStackFeeSurchargeInput = {
|
|
3
|
+
chain: OpStackChain;
|
|
4
|
+
gasLimit: bigint;
|
|
5
|
+
callDataSize: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The two terms op-geth adds to the balance check it runs before executing a
|
|
9
|
+
* transaction: the L1 data-availability cost and, from Isthmus onwards, the
|
|
10
|
+
* operator fee. The chain requires
|
|
11
|
+
* `value + gasLimit * maxFeePerGas + l1Cost + operatorCost` to be covered, so an
|
|
12
|
+
* amount that leaves only the gas term behind is rejected by exactly this much.
|
|
13
|
+
*
|
|
14
|
+
* Both terms fail open independently. A pre-Isthmus oracle reverts on
|
|
15
|
+
* `getOperatorFee`, and letting that failure take the L1 data fee down with it
|
|
16
|
+
* would leave the chain reserving nothing at all — a fee that cannot be read
|
|
17
|
+
* must never block a send that worked before. A negative answer is nonsense from
|
|
18
|
+
* a fee oracle and is floored rather than passed on to widen a max amount.
|
|
19
|
+
*/
|
|
20
|
+
export declare const getOpStackFeeSurcharge: ({ chain, gasLimit, callDataSize, }: GetOpStackFeeSurchargeInput) => Promise<bigint>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=getOpStackFeeSurcharge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOpStackFeeSurcharge.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/evm/opStack/getOpStackFeeSurcharge.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAoC9C,KAAK,2BAA2B,GAAG;IACjC,KAAK,EAAE,YAAY,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAAU,oCAI1C,2BAA2B,KAAG,OAAO,CAAC,MAAM,CAiC9C,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getEvmClient } from '@vultisig/core-chain/chains/evm/client';
|
|
2
|
+
import { attempt, withFallback } from '@vultisig/lib-utils/attempt';
|
|
3
|
+
import { bigIntMax } from '@vultisig/lib-utils/bigint/bigIntMax';
|
|
4
|
+
import { l1FeeProbeData } from './l1FeeProbeData.js';
|
|
5
|
+
/** Canonical `GasPriceOracle` predeploy address, identical on every OP-stack rollup. */
|
|
6
|
+
const gasPriceOracleAddress = '0x420000000000000000000000000000000000000F';
|
|
7
|
+
// `getL1Fee(bytes)` is preferred over the purpose-built `getL1FeeUpperBound(uint256)`,
|
|
8
|
+
// which only exists from Fjord onwards — Blast's oracle predates it, while
|
|
9
|
+
// `getL1Fee` has been there since Bedrock. `getOperatorFee(uint256)` arrives with
|
|
10
|
+
// Isthmus and simply reverts on older oracles, which reads the same as "this chain
|
|
11
|
+
// charges no operator fee".
|
|
12
|
+
const gasPriceOracleAbi = [
|
|
13
|
+
{
|
|
14
|
+
name: 'getL1Fee',
|
|
15
|
+
type: 'function',
|
|
16
|
+
stateMutability: 'view',
|
|
17
|
+
inputs: [{ name: '_data', type: 'bytes' }],
|
|
18
|
+
outputs: [{ name: '', type: 'uint256' }],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'getOperatorFee',
|
|
22
|
+
type: 'function',
|
|
23
|
+
stateMutability: 'view',
|
|
24
|
+
inputs: [{ name: '_gasUsed', type: 'uint256' }],
|
|
25
|
+
outputs: [{ name: '', type: 'uint256' }],
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
// Serialized size, in bytes, that the L1-fee probe stands in for on top of the
|
|
29
|
+
// transaction's own calldata. The oracle wants the UNSIGNED transaction and adds
|
|
30
|
+
// its own 68-byte allowance for the signature, so this models the ~70-byte
|
|
31
|
+
// unsigned EIP-1559 envelope with deliberate margin: the transaction is not built
|
|
32
|
+
// yet when its fee has to be reserved, and over-reserving leaves dust behind
|
|
33
|
+
// where under-reserving costs a broadcast rejected after the keysign ceremony has
|
|
34
|
+
// already run.
|
|
35
|
+
const unsignedTxEnvelopeSize = 160;
|
|
36
|
+
/**
|
|
37
|
+
* The two terms op-geth adds to the balance check it runs before executing a
|
|
38
|
+
* transaction: the L1 data-availability cost and, from Isthmus onwards, the
|
|
39
|
+
* operator fee. The chain requires
|
|
40
|
+
* `value + gasLimit * maxFeePerGas + l1Cost + operatorCost` to be covered, so an
|
|
41
|
+
* amount that leaves only the gas term behind is rejected by exactly this much.
|
|
42
|
+
*
|
|
43
|
+
* Both terms fail open independently. A pre-Isthmus oracle reverts on
|
|
44
|
+
* `getOperatorFee`, and letting that failure take the L1 data fee down with it
|
|
45
|
+
* would leave the chain reserving nothing at all — a fee that cannot be read
|
|
46
|
+
* must never block a send that worked before. A negative answer is nonsense from
|
|
47
|
+
* a fee oracle and is floored rather than passed on to widen a max amount.
|
|
48
|
+
*/
|
|
49
|
+
export const getOpStackFeeSurcharge = async ({ chain, gasLimit, callDataSize, }) => {
|
|
50
|
+
const client = getEvmClient(chain);
|
|
51
|
+
const l1DataFee = withFallback(attempt(client.readContract({
|
|
52
|
+
address: gasPriceOracleAddress,
|
|
53
|
+
abi: gasPriceOracleAbi,
|
|
54
|
+
functionName: 'getL1Fee',
|
|
55
|
+
args: [l1FeeProbeData(unsignedTxEnvelopeSize + callDataSize)],
|
|
56
|
+
})), 0n);
|
|
57
|
+
const operatorFee = gasLimit > 0n
|
|
58
|
+
? withFallback(attempt(client.readContract({
|
|
59
|
+
address: gasPriceOracleAddress,
|
|
60
|
+
abi: gasPriceOracleAbi,
|
|
61
|
+
functionName: 'getOperatorFee',
|
|
62
|
+
args: [gasLimit],
|
|
63
|
+
})), 0n)
|
|
64
|
+
: Promise.resolve(0n);
|
|
65
|
+
const terms = await Promise.all([l1DataFee, operatorFee]);
|
|
66
|
+
return terms.reduce((total, term) => total + bigIntMax(0n, term), 0n);
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=getOpStackFeeSurcharge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOpStackFeeSurcharge.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/evm/opStack/getOpStackFeeSurcharge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,wFAAwF;AACxF,MAAM,qBAAqB,GAAG,4CAA4C,CAAA;AAE1E,uFAAuF;AACvF,2EAA2E;AAC3E,kFAAkF;AAClF,mFAAmF;AACnF,4BAA4B;AAC5B,MAAM,iBAAiB,GAAG;IACxB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KACz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EAAE,WAAW,CAAC,CAAC,CAAA;IAEzD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,GAAG,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;AACvE,CAAC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stand-in bytes for the serialized transaction handed to the `GasPriceOracle`
|
|
3
|
+
* predeploy's `getL1Fee(bytes)`, which has to price a transaction that does not
|
|
4
|
+
* exist yet — the amount being priced is itself derived from the answer.
|
|
5
|
+
*
|
|
6
|
+
* The bytes are deliberately incompressible. From Fjord onwards the oracle
|
|
7
|
+
* charges for the FastLZ-compressed size of what it is handed, so a *periodic*
|
|
8
|
+
* payload prices far below what a real transaction costs: a plain counter wraps
|
|
9
|
+
* every 256 bytes and every window after the first lap is a back reference, at
|
|
10
|
+
* which point the quote stops growing with size at all.
|
|
11
|
+
*
|
|
12
|
+
* This stream repeats no 3-byte window — FastLZ's shortest encodable match —
|
|
13
|
+
* through its first 3,652 bytes, which covers every probe the callers build
|
|
14
|
+
* (a 160-byte envelope plus calldata, the largest being a ~3 KB swap router
|
|
15
|
+
* call). Past that the birthday bound makes isolated repeats inevitable in any
|
|
16
|
+
* uniformly distributed stream, and they are harmless: a lone 3-byte match
|
|
17
|
+
* costs more to encode as a back reference than it saves, so FastLZ does not
|
|
18
|
+
* take it. Measured against the live oracles, this stream prices identically to
|
|
19
|
+
* crypto-random bytes at 1–4 KB and 0.01% *above* them at 8–16 KB — it never
|
|
20
|
+
* quotes below the incompressible ideal.
|
|
21
|
+
*/
|
|
22
|
+
export declare const l1FeeProbeData: (size: number) => `0x${string}`;
|
|
23
|
+
//# sourceMappingURL=l1FeeProbeData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"l1FeeProbeData.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/evm/opStack/l1FeeProbeData.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,KAAK,MAAM,EAUxD,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { bytesToHex } from 'viem';
|
|
2
|
+
// Linear congruential generator (Numerical Recipes constants) seeded with the
|
|
3
|
+
// golden-ratio word. Deterministic across runs, so the same send reserves the
|
|
4
|
+
// same amount twice running, and aperiodic over any length we ask it for.
|
|
5
|
+
const lcgSeed = 0x9e3779b9;
|
|
6
|
+
const lcgMultiplier = 1_664_525;
|
|
7
|
+
const lcgIncrement = 1_013_904_223;
|
|
8
|
+
/**
|
|
9
|
+
* Stand-in bytes for the serialized transaction handed to the `GasPriceOracle`
|
|
10
|
+
* predeploy's `getL1Fee(bytes)`, which has to price a transaction that does not
|
|
11
|
+
* exist yet — the amount being priced is itself derived from the answer.
|
|
12
|
+
*
|
|
13
|
+
* The bytes are deliberately incompressible. From Fjord onwards the oracle
|
|
14
|
+
* charges for the FastLZ-compressed size of what it is handed, so a *periodic*
|
|
15
|
+
* payload prices far below what a real transaction costs: a plain counter wraps
|
|
16
|
+
* every 256 bytes and every window after the first lap is a back reference, at
|
|
17
|
+
* which point the quote stops growing with size at all.
|
|
18
|
+
*
|
|
19
|
+
* This stream repeats no 3-byte window — FastLZ's shortest encodable match —
|
|
20
|
+
* through its first 3,652 bytes, which covers every probe the callers build
|
|
21
|
+
* (a 160-byte envelope plus calldata, the largest being a ~3 KB swap router
|
|
22
|
+
* call). Past that the birthday bound makes isolated repeats inevitable in any
|
|
23
|
+
* uniformly distributed stream, and they are harmless: a lone 3-byte match
|
|
24
|
+
* costs more to encode as a back reference than it saves, so FastLZ does not
|
|
25
|
+
* take it. Measured against the live oracles, this stream prices identically to
|
|
26
|
+
* crypto-random bytes at 1–4 KB and 0.01% *above* them at 8–16 KB — it never
|
|
27
|
+
* quotes below the incompressible ideal.
|
|
28
|
+
*/
|
|
29
|
+
export const l1FeeProbeData = (size) => {
|
|
30
|
+
const bytes = new Uint8Array(Math.max(0, size));
|
|
31
|
+
let state = lcgSeed;
|
|
32
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
33
|
+
state = (Math.imul(state, lcgMultiplier) + lcgIncrement) >>> 0;
|
|
34
|
+
bytes[i] = (state >>> 24) & 0xff;
|
|
35
|
+
}
|
|
36
|
+
return bytesToHex(bytes);
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=l1FeeProbeData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"l1FeeProbeData.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/evm/opStack/l1FeeProbeData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAEjC,8EAA8E;AAC9E,8EAA8E;AAC9E,0EAA0E;AAC1E,MAAM,OAAO,GAAG,UAAU,CAAA;AAC1B,MAAM,aAAa,GAAG,SAAS,CAAA;AAC/B,MAAM,YAAY,GAAG,aAAa,CAAA;AAElC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAiB,EAAE;IAC5D,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;IAE/C,IAAI,KAAK,GAAG,OAAO,CAAA;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;QAC9D,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IAClC,CAAC;IAED,OAAO,UAAU,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Chain } from '@vultisig/core-chain/Chain';
|
|
2
|
+
/**
|
|
3
|
+
* EVM chains that settle to Ethereum through the OP stack and therefore expose
|
|
4
|
+
* the `GasPriceOracle` predeploy. op-geth bills these chains' transactions an
|
|
5
|
+
* L1 data-availability cost — and, from Isthmus onwards, an operator fee — on
|
|
6
|
+
* top of L2 execution gas, and adds both to the balance check it runs before a
|
|
7
|
+
* transaction executes.
|
|
8
|
+
*
|
|
9
|
+
* Membership is asserted, not detected: the predeploy answers on exactly these
|
|
10
|
+
* four and has no code on every other EVM chain in the registry. An omission is
|
|
11
|
+
* safe but silent — the chain reserves nothing extra, which is how every chain
|
|
12
|
+
* behaved before the oracle was read at all — so a newly added OP-stack rollup
|
|
13
|
+
* has to be listed here or its max sends will under-reserve.
|
|
14
|
+
*/
|
|
15
|
+
export declare const opStackChains: readonly ["Optimism", "Base", "Blast", "Mantle"];
|
|
16
|
+
export type OpStackChain = (typeof opStackChains)[number];
|
|
17
|
+
/** Narrows a chain to one whose node prices an L1 data fee through the `GasPriceOracle` predeploy. */
|
|
18
|
+
export declare const isOpStackChain: (chain: Chain) => chain is OpStackChain;
|
|
19
|
+
//# sourceMappingURL=opStackChains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opStackChains.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/evm/opStack/opStackChains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAY,MAAM,4BAA4B,CAAA;AAG5D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,kDAA+E,CAAA;AAEzG,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzD,sGAAsG;AACtG,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,KAAG,KAAK,IAAI,YAA6C,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EvmChain } from '@vultisig/core-chain/Chain';
|
|
2
|
+
import { isOneOf } from '@vultisig/lib-utils/array/isOneOf';
|
|
3
|
+
/**
|
|
4
|
+
* EVM chains that settle to Ethereum through the OP stack and therefore expose
|
|
5
|
+
* the `GasPriceOracle` predeploy. op-geth bills these chains' transactions an
|
|
6
|
+
* L1 data-availability cost — and, from Isthmus onwards, an operator fee — on
|
|
7
|
+
* top of L2 execution gas, and adds both to the balance check it runs before a
|
|
8
|
+
* transaction executes.
|
|
9
|
+
*
|
|
10
|
+
* Membership is asserted, not detected: the predeploy answers on exactly these
|
|
11
|
+
* four and has no code on every other EVM chain in the registry. An omission is
|
|
12
|
+
* safe but silent — the chain reserves nothing extra, which is how every chain
|
|
13
|
+
* behaved before the oracle was read at all — so a newly added OP-stack rollup
|
|
14
|
+
* has to be listed here or its max sends will under-reserve.
|
|
15
|
+
*/
|
|
16
|
+
export const opStackChains = [EvmChain.Optimism, EvmChain.Base, EvmChain.Blast, EvmChain.Mantle];
|
|
17
|
+
/** Narrows a chain to one whose node prices an L1 data fee through the `GasPriceOracle` predeploy. */
|
|
18
|
+
export const isOpStackChain = (chain) => isOneOf(chain, opStackChains);
|
|
19
|
+
//# sourceMappingURL=opStackChains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opStackChains.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/evm/opStack/opStackChains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAE3D;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAU,CAAA;AAIzG,sGAAsG;AACtG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAyB,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listAllCoins.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/sui/listAllCoins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAIlC,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,GAAG,SAAS,EAAE,UAAU,MAAM,KAAG,MAChC,CAAA;AAErD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAU,6BAA6B,oBAAoB,KAAG,OAAO,CAAC,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"listAllCoins.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/sui/listAllCoins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAIlC,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,GAAG,SAAS,EAAE,UAAU,MAAM,KAAG,MAChC,CAAA;AAErD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAU,6BAA6B,oBAAoB,KAAG,OAAO,CAAC,aAAa,EAAE,CAuChH,CAAA"}
|
|
@@ -33,6 +33,14 @@ export const listAllSuiCoins = async ({ client, owner, coinType }) => {
|
|
|
33
33
|
balance: object.balance,
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
// `hasNextPage: true` without a cursor cannot be followed. Treat every
|
|
37
|
+
// falsy cursor as malformed because the gRPC adapter can turn an empty page
|
|
38
|
+
// token into `cursor: ''`, while GraphQL can return a null end cursor.
|
|
39
|
+
// Returning the coins collected so far would make a truncated set look
|
|
40
|
+
// complete and can surface later as a false insufficient-balance error.
|
|
41
|
+
if (page.hasNextPage && !page.cursor) {
|
|
42
|
+
throw new Error(`listAllSuiCoins: page ${pages + 1} for ${owner} (${coinType}) reports hasNextPage with no cursor — refusing to build a send from a truncated coin set`);
|
|
43
|
+
}
|
|
36
44
|
cursor = page.hasNextPage ? page.cursor : null;
|
|
37
45
|
if (++pages >= maxSuiCoinPages && cursor) {
|
|
38
46
|
throw new Error(`listAllSuiCoins: exceeded ${maxSuiCoinPages} pages for ${owner} (${coinType}) — refusing to build a send from a possibly-truncated or looping coin set`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list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AO;aACxB,CAAC,CAAA;QACJ,CAAC;QAED,uEAAuE;QACvE,4EAA4E;QAC5E,uEAAuE;QACvE,uEAAuE;QACvE,wEAAwE;QACxE,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CACb,yBAAyB,KAAK,GAAG,CAAC,QAAQ,KAAK,KAAK,QAAQ,2FAA2F,CACxJ,CAAA;QACH,CAAC;QAED,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;QAE9C,IAAI,EAAE,KAAK,IAAI,eAAe,IAAI,MAAM,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CACb,6BAA6B,eAAe,cAAc,KAAK,KAAK,QAAQ,4EAA4E,CACzJ,CAAA;QACH,CAAC;IACH,CAAC,QAAQ,MAAM,EAAC;IAEhB,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Chain } from '../../Chain.js';
|
|
2
|
-
export type EnforcedRouterProvider = '1inch' | 'kyber' | 'cowswap';
|
|
2
|
+
export type EnforcedRouterProvider = '1inch' | 'kyber' | 'cowswap' | 'li.fi';
|
|
3
3
|
/**
|
|
4
4
|
* Signing-path re-assert (sdk#1358): the same allow-list check as {@link assertKnownAggregatorRouter},
|
|
5
5
|
* but keyed off an arbitrary provider STRING (the value carried in KeysignSwapPayload.general.provider,
|
|
6
|
-
* which is a plain `string`).
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* anything else is rejected outright (sdk#1457, see below).
|
|
6
|
+
* which is a plain `string`). Fixed-router providers fail closed against their allowlists, SwapKit
|
|
7
|
+
* fails closed against an independent Blockaid reputation verdict, and only the legacy `''`
|
|
8
|
+
* unattributed provider remains log-only. Anything else is rejected outright (sdk#1457, see below).
|
|
10
9
|
*
|
|
11
10
|
* WHY THIS EXISTS SEPARATELY FROM quote construction: a compromised initiator (or server composing the
|
|
12
11
|
* intent) can hand a co-signer a KeysignPayload whose swapPayload.quote.tx.to was NEVER run through the
|
|
@@ -23,23 +22,35 @@ export type EnforcedRouterProvider = '1inch' | 'kyber' | 'cowswap';
|
|
|
23
22
|
* enforcement) is a real, closable gap - not just a theoretical one.
|
|
24
23
|
*
|
|
25
24
|
* sdk#1457 FIX: two structural improvements that need no proto change. (1) CowSwap is now enforced -
|
|
26
|
-
* unlike
|
|
25
|
+
* unlike swapkit it settles through ONE fixed, deterministic contract (the GPv2VaultRelayer, see
|
|
27
26
|
* assertKnownAggregatorRouter), so its destination is exactly as allow-listable as 1inch/Kyber's; a
|
|
28
27
|
* payload can no longer relabel itself 'cowswap' to dodge a router check the way it previously could. (2)
|
|
29
28
|
* the log-only fallback is now a CLOSED list of the provider values the codebase legitimately produces
|
|
30
|
-
* (li.fi/swapkit, plus the legacy `''` unattributed provider) - a `provider` string outside every known
|
|
29
|
+
* (at that time li.fi/swapkit, plus the legacy `''` unattributed provider) - a `provider` string outside every known
|
|
31
30
|
* value (enforced or unenforced) is unrecognized and REJECTED, not silently passed through. Together
|
|
32
|
-
* these
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* per provider (tracked in sdk#1457, not attempted here: a schema change on the shared commondata proto
|
|
37
|
-
* is a cross-repo, cross-consumer change every native client (iOS/Android/Windows) also builds against).
|
|
31
|
+
* these originally shrank "relabel to escape enforcement" from "any string at all" to that closed set.
|
|
32
|
+
* sdk#1458 subsequently removes li.fi from the residual gap using its official Diamond deployments
|
|
33
|
+
* and applies an independent Blockaid reputation check to SwapKit destinations on both quote and
|
|
34
|
+
* co-signer paths. The legacy unattributed value remains the only log-only compatibility case.
|
|
38
35
|
*
|
|
39
36
|
* This guard remains MONOTONIC beyond that residual gap: it only ever THROWS (rejects) or no-ops - it
|
|
40
37
|
* never makes anything signable that wasn't already.
|
|
41
38
|
*/
|
|
42
39
|
export declare function assertKnownAggregatorRouterOnSigningPath(provider: string, address: string, chain: Chain): void;
|
|
40
|
+
/**
|
|
41
|
+
* Independent trust boundary for dynamic SwapKit EVM addresses. SwapKit's `tx.to`,
|
|
42
|
+
* `targetAddress`, and optional approval transaction all come from the same `/v3/swap`
|
|
43
|
+
* response, so equality between them cannot establish destination safety when that response
|
|
44
|
+
* is compromised.
|
|
45
|
+
*/
|
|
46
|
+
export declare function assertSwapKitAddressReputation(address: string, chain: Chain, role?: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* LI.FI documents `estimate.approvalAddress` as route-dependent and explicitly warns consumers
|
|
49
|
+
* not to hardcode it. The official Diamond is safe without a network dependency; a distinct
|
|
50
|
+
* spender is accepted only after an independent benign Blockaid verdict. This preserves valid
|
|
51
|
+
* inner-executor routes without trusting the quote response to authorize its own spender.
|
|
52
|
+
*/
|
|
53
|
+
export declare function assertLifiApprovalAddress(address: string, chain: Chain): Promise<void>;
|
|
43
54
|
/**
|
|
44
55
|
* Signing-path approval-spender bind (sdk#1358 review follow-up, requested by neavra). The
|
|
45
56
|
* follow-on to {@link assertKnownAggregatorRouterOnSigningPath}: that guard validates the swap-leg
|
|
@@ -49,12 +60,14 @@ export declare function assertKnownAggregatorRouterOnSigningPath(provider: strin
|
|
|
49
60
|
* genuine 1inch/kyber `tx.to` yet still carry an approve granting an ATTACKER an allowance over the
|
|
50
61
|
* user's token (a classic approval-drain the co-signer would otherwise sign blind).
|
|
51
62
|
*
|
|
52
|
-
* On the initiator
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
63
|
+
* On the initiator the fixed-spender providers coincide by construction. LI.FI and SwapKit can
|
|
64
|
+
* instead set an explicit `approvalAddress`, which is why their spender checks are separate.
|
|
65
|
+
* Approval-bound providers (1inch/kyber/cowswap) MUST have `spender === routerDestination`.
|
|
66
|
+
* LI.FI approval spenders can vary by route and are instead checked by
|
|
67
|
+
* {@link assertLifiApprovalAddress}; SwapKit spenders use its corresponding reputation guard.
|
|
68
|
+
* CowSwap's spender IS its `tx.to` (both are the fixed GPv2VaultRelayer - see
|
|
69
|
+
* getSwapDestinationAddress.ts), so it binds the same way 1inch/kyber do. Like its sibling this is
|
|
70
|
+
* a MONOTONIC gate: it only throws or no-ops, never changes the signed bytes.
|
|
58
71
|
*/
|
|
59
72
|
export declare function assertEnforcedSwapApprovalSpenderBound(provider: string, spender: string, routerDestination: string, chain: Chain): void;
|
|
60
73
|
/**
|
|
@@ -63,9 +76,14 @@ export declare function assertEnforcedSwapApprovalSpenderBound(provider: string,
|
|
|
63
76
|
*/
|
|
64
77
|
export declare function assertKnownAggregatorRouter(provider: EnforcedRouterProvider, address: string, chain: Chain): void;
|
|
65
78
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
79
|
+
* SwapKit v3 returns `targetAddress` independently from the ready-to-sign EVM
|
|
80
|
+
* transaction and defines it as the address the transaction must call or transfer to.
|
|
81
|
+
* Bind those fields before constructing a GeneralSwapQuote so a substituted `tx.to`
|
|
82
|
+
* cannot silently become the signed destination (or the approval fallback).
|
|
83
|
+
*/
|
|
84
|
+
export declare function assertSwapKitDestinationMatchesTarget(address: string, targetAddress: string | undefined, chain: Chain): void;
|
|
85
|
+
/**
|
|
86
|
+
* Log-only (never throws) — retained only for legacy unattributed signing payloads.
|
|
69
87
|
*/
|
|
70
88
|
export declare function logUnenforcedAggregatorDestination(provider: string, address: string): void;
|
|
71
89
|
//# sourceMappingURL=knownAggregatorRouters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knownAggregatorRouters.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/swap/general/knownAggregatorRouters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"knownAggregatorRouters.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/swap/general/knownAggregatorRouters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAY,MAAM,aAAa,CAAA;AA+F7C,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAuB5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,wCAAwC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAuB9G;AAsCD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,SAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjH;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAMtF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,MAAM,EACzB,KAAK,EAAE,KAAK,GACX,IAAI,CASN;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CA4BjH;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,KAAK,EAAE,KAAK,GACX,IAAI,CAYN;AAED;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAK1F"}
|