@vultisig/core-mpc 1.3.13 → 1.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @vultisig/core-mpc
2
2
 
3
+ ## 1.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`7572dc0`](https://github.com/vultisig/vultisig-sdk/commit/7572dc0e7fa785453e36a419d678f8a1bf17c8b5)]:
8
+ - @vultisig/core-chain@2.14.0
9
+
10
+ ## 1.4.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [#672](https://github.com/vultisig/vultisig-sdk/pull/672) [`7fa4860`](https://github.com/vultisig/vultisig-sdk/commit/7fa48602ba1acfb57746fd22c87ec3aa30bac4a6) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - Add Blockaid Sui transaction simulation support. The existing Sui Blockaid
15
+ scan resolver only requested `validation`; this exposes the simulation block
16
+ returned by the same `/sui/transaction/scan` endpoint via a new
17
+ `getSuiTxBlockaidSimulation` resolver and a `parseBlockaidSuiSimulation`
18
+ parser that produces a UI-facing `{ swap } | { transfer }` headline
19
+ (mirroring the Solana shape). `OtherChain.Sui` is now a member of
20
+ `blockaidSimulationSupportedChains`, with a new `getTxBlockaidSimulation`
21
+ overload, and the mpc package gains a matching
22
+ `getSuiBlockaidTxSimulationInput` for the `KeysignPayload`-driven flow.
23
+
24
+ The parser keeps `null` as its failure mode rather than throwing — Blockaid
25
+ field renames degrade to "no preview" instead of breaking consumers.
26
+
27
+ Closes [#671](https://github.com/vultisig/vultisig-sdk/issues/671)
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [[`7fa4860`](https://github.com/vultisig/vultisig-sdk/commit/7fa48602ba1acfb57746fd22c87ec3aa30bac4a6)]:
32
+ - @vultisig/core-chain@2.13.0
33
+
3
34
  ## 1.3.13
4
35
 
5
36
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/mpc/security/blockaid/tx/simulation/input/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+DAA+D,CAAA;AAIzG,OAAO,EAAqC,sCAAsC,EAAE,MAAM,YAAY,CAAA;AAStG,eAAO,MAAM,4BAA4B,GACvC,OAAO,IAAI,CAAC,sCAAsC,EAAE,OAAO,CAAC,KAC3D,yBAAyB,GAAG,IAkB9B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/mpc/security/blockaid/tx/simulation/input/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+DAA+D,CAAA;AAIzG,OAAO,EAAqC,sCAAsC,EAAE,MAAM,YAAY,CAAA;AAWtG,eAAO,MAAM,4BAA4B,GACvC,OAAO,IAAI,CAAC,sCAAsC,EAAE,OAAO,CAAC,KAC3D,yBAAyB,GAAG,IAkB9B,CAAA"}
@@ -4,9 +4,11 @@ import { getKeysignChain } from '@vultisig/core-mpc/keysign/utils/getKeysignChai
4
4
  import { isOneOf } from '@vultisig/lib-utils/array/isOneOf';
5
5
  import { getEvmBlockaidTxSimulationInput } from './resolvers/evm.js';
6
6
  import { getSolanaBlockaidTxSimulationInput } from './resolvers/solana.js';
7
+ import { getSuiBlockaidTxSimulationInput } from './resolvers/sui.js';
7
8
  const resolvers = {
8
9
  solana: getSolanaBlockaidTxSimulationInput,
9
10
  evm: getEvmBlockaidTxSimulationInput,
11
+ sui: getSuiBlockaidTxSimulationInput,
10
12
  };
11
13
  export const getBlockaidTxSimulationInput = (input) => {
12
14
  const chain = getKeysignChain(input.payload);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/core/mpc/security/blockaid/tx/simulation/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,OAAO,EAEL,iCAAiC,GAClC,MAAM,yDAAyD,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAA;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAG3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAA;AAEvE,MAAM,SAAS,GAAyF;IACtG,MAAM,EAAE,kCAAkC;IAC1C,GAAG,EAAE,+BAA+B;CACrC,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,KAA4D,EAC1B,EAAE;IACpC,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,iCAAiC,CAAC,EAAE,CAAC;QACvD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAErC,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QAChC,GAAG,KAAK;QACR,KAAK;KACN,CAAC,CAAA;IAEF,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;AACxB,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/core/mpc/security/blockaid/tx/simulation/input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,OAAO,EAEL,iCAAiC,GAClC,MAAM,yDAAyD,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAA;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAG3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAA;AAEjE,MAAM,SAAS,GAAyF;IACtG,MAAM,EAAE,kCAAkC;IAC1C,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,+BAA+B;CACrC,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,KAA4D,EAC1B,EAAE;IACpC,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAC5C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,iCAAiC,CAAC,EAAE,CAAC;QACvD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAErC,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QAChC,GAAG,KAAK;QACR,KAAK;KACN,CAAC,CAAA;IAEF,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;AACxB,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { OtherChain } from '@vultisig/core-chain/Chain';
2
+ import { BlockaidTxSimulationInputResolver } from '../resolver.js';
3
+ export declare const getSuiBlockaidTxSimulationInput: BlockaidTxSimulationInputResolver<OtherChain.Sui>;
4
+ //# sourceMappingURL=sui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/mpc/security/blockaid/tx/simulation/input/resolvers/sui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAKvD,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAE/D,eAAO,MAAM,+BAA+B,EAAE,iCAAiC,CAAC,UAAU,CAAC,GAAG,CAqB7F,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { OtherChain } from '@vultisig/core-chain/Chain';
2
+ import { decodeSigningOutput } from '@vultisig/core-chain/tw/signingOutput';
3
+ import { assertField } from '@vultisig/lib-utils/record/assertField';
4
+ import { getCompiledTxsForBlockaidInput } from '../../../utils/getCompiledTxsForBlockaidInput.js';
5
+ export const getSuiBlockaidTxSimulationInput = ({ payload, walletCore, }) => {
6
+ const coin = assertField(payload, 'coin');
7
+ const compiledTxs = getCompiledTxsForBlockaidInput({
8
+ payload,
9
+ walletCore,
10
+ });
11
+ if (compiledTxs.length === 0)
12
+ return null;
13
+ const [transaction] = compiledTxs.map(compiledTx => decodeSigningOutput(OtherChain.Sui, compiledTx).unsignedTx);
14
+ return {
15
+ chain: 'mainnet',
16
+ options: ['simulation'],
17
+ account_address: coin.address,
18
+ transaction,
19
+ metadata: {},
20
+ };
21
+ };
22
+ //# sourceMappingURL=sui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sui.js","sourceRoot":"","sources":["../../../../../../../../../../packages/core/mpc/security/blockaid/tx/simulation/input/resolvers/sui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAEpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAA;AAG9F,MAAM,CAAC,MAAM,+BAA+B,GAAsD,CAAC,EACjG,OAAO,EACP,UAAU,GACX,EAAE,EAAE;IACH,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAEzC,MAAM,WAAW,GAAG,8BAA8B,CAAC;QACjD,OAAO;QACP,UAAU;KACX,CAAC,CAAA;IACF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAEzC,MAAM,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,UAAU,CAAC,CAAA;IAE/G,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,CAAC,YAAY,CAAC;QACvB,eAAe,EAAE,IAAI,CAAC,OAAO;QAC7B,WAAW;QACX,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vultisig/core-mpc",
3
- "version": "1.3.13",
3
+ "version": "1.4.1",
4
4
  "description": "MPC, keysign, and vault types shared across Vultisig clients",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -722,6 +722,11 @@
722
722
  "import": "./dist/security/blockaid/tx/simulation/input/resolvers/solana.js",
723
723
  "default": "./dist/security/blockaid/tx/simulation/input/resolvers/solana.js"
724
724
  },
725
+ "./security/blockaid/tx/simulation/input/resolvers/sui": {
726
+ "types": "./dist/security/blockaid/tx/simulation/input/resolvers/sui.d.ts",
727
+ "import": "./dist/security/blockaid/tx/simulation/input/resolvers/sui.js",
728
+ "default": "./dist/security/blockaid/tx/simulation/input/resolvers/sui.js"
729
+ },
725
730
  "./security/blockaid/tx/utils/getCompiledTxsForBlockaidInput": {
726
731
  "types": "./dist/security/blockaid/tx/utils/getCompiledTxsForBlockaidInput.d.ts",
727
732
  "import": "./dist/security/blockaid/tx/utils/getCompiledTxsForBlockaidInput.js",
@@ -999,7 +1004,7 @@
999
1004
  "@noble/hashes": "^1.8.0",
1000
1005
  "@solana/web3.js": "^1.98.4",
1001
1006
  "@trustwallet/wallet-core": "^4.6.13",
1002
- "@vultisig/core-chain": "2.12.0",
1007
+ "@vultisig/core-chain": "2.14.0",
1003
1008
  "@vultisig/core-config": "0.9.1",
1004
1009
  "@vultisig/lib-dkls": "0.9.0",
1005
1010
  "@vultisig/lib-mldsa": "0.9.0",