@vultisig/core-mpc 3.0.1 → 3.1.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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @vultisig/core-mpc
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2299](https://github.com/vultisig/vultisig-sdk/pull/2299) [`bcca32c`](https://github.com/vultisig/vultisig-sdk/commit/bcca32c885066e2bf224aa37d6666c68a3684956) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - feat(ton): W5 (wallet v5r1) support as an explicit per-account opt-in
8
+
9
+ Every Vultisig TON account has been hard-pinned to the V4R2 wallet contract. W5 is the default for new wallets in Tonkeeper and Telegram Wallet and is the gateway to what users now expect from TON — up to 255 messages per request instead of 4, lower fees, and relayer-paid ("gasless") transactions. WalletCore has supported it for a while; nothing here used it.
10
+
11
+ A W5 wallet is a _different address_ for the same key, with its own balance, so this is not a switch: V4R2 stays the default everywhere and W5 is selected per account.
12
+
13
+ - `@vultisig/core-chain/chains/ton/wallet` (new): `TonWalletVersion` (`'v4r2' | 'v5r1'`), `deriveTonAddress` for either contract, `resolveTonWalletVersion` to tell which contract an address is for a key, the W5 mainnet wallet id, and the per-contract message limits.
14
+ - `vault.setTonWalletVersion('v5r1')` selects which of the key's two TON accounts the vault acts on: `send`, balances, swaps, fee estimation and every other address lookup follow it, so one selected account is used consistently. `vault.address(chain, { tonWalletVersion })` — like `deriveAddress` / `getChainAddress` / `deriveAddressFromKeys` — names a contract for a single lookup without changing the selection, so a client can show both accounts side by side for a migration flow.
15
+ - Balance cache keys name a chain and an asset, not an account, so switching between the two accounts drops the balance scope and any fetch already in flight for the old account is neither cached nor announced: it still answers its own caller, but `balanceUpdated` carries no account identity, so emitting it after a switch would credit the old account's balance to the new one.
16
+ - The keysign signing-input resolver derives the contract from the sender address — the payload has no wallet-version field, and every co-signer reaches the same answer from the shared vault key — and refuses an address that is neither of the key's wallets rather than assuming V4R2. W5 requests carry `IGNORE_ACTION_PHASE_ERRORS`, which the W5 code requires of every external action (its replay protection) and WalletCore enforces; the TON status resolver's action-phase check covers the blindness that flag would otherwise cause. Message counts are capped per contract.
17
+ - The RN-safe builders (`buildTonSendTx`, `buildTonJettonTransferTx`, `buildTonTxFromSigningPayload`, `deriveTonAddress`, `prepareJettonTransferTxFromKeys`) take `walletVersion`; W5 uses the `signed_external` request layout with the signature appended, byte-identical to WalletCore. New `buildV5R1Wallet` / `TON_V5R1_WALLET_ID` alongside the V4R2 helpers.
18
+
19
+ Golden vectors (`testdata/cross-encoder-golden/ton-w5-*.json`) pin the W5 pre-images and are verified against real WalletCore, including the full signed external message. Client-side migration UI (show both accounts, move funds, reconnect dApps) is separate work per platform.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [[`a5def09`](https://github.com/vultisig/vultisig-sdk/commit/a5def098e06cf7269174eb6840dc516d78ec55f9), [`bcca32c`](https://github.com/vultisig/vultisig-sdk/commit/bcca32c885066e2bf224aa37d6666c68a3684956)]:
24
+ - @vultisig/core-chain@5.2.0
25
+
3
26
  ## 3.0.1
4
27
 
5
28
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAItD,eAAO,MAAM,mBAAmB,EAAE,qBAAqB,CAAC,KAAK,CAqD5D,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAItD,eAAO,MAAM,mBAAmB,EAAE,qBAAqB,CAAC,KAAK,CA2E5D,CAAA"}
@@ -1,6 +1,8 @@
1
1
  import { getTonMessageBounceable } from '@vultisig/core-chain/chains/ton/messageBounce';
2
2
  import { isTonStakingComment } from '@vultisig/core-chain/chains/ton/staking';
3
+ import { resolveTonWalletVersion, tonMaxMessagesPerRequest } from '@vultisig/core-chain/chains/ton/wallet';
3
4
  import { isFeeCoin } from '@vultisig/core-chain/coin/utils/isFeeCoin';
5
+ import { match } from '@vultisig/lib-utils/match';
4
6
  import { TW } from '@trustwallet/wallet-core';
5
7
  import { getBlockchainSpecificValue } from '../../../chainSpecific/KeysignChainSpecific.js';
6
8
  import { getKeysignTwPublicKey } from '../../../tw/getKeysignTwPublicKey.js';
@@ -9,6 +11,14 @@ import { buildJettonTransfer } from './jetton.js';
9
11
  import { buildNativeTonTransfer, buildNativeTonTransferFromMessage } from './native.js';
10
12
  export const getTonSigningInputs = ({ keysignPayload, walletCore }) => {
11
13
  const coin = getKeysignCoin(keysignPayload);
14
+ const publicKeyBytes = getKeysignTwPublicKey(keysignPayload);
15
+ // The payload does not say which wallet contract the sender is; its address
16
+ // does. Every co-signer derives the same answer from the shared vault key.
17
+ const walletVersion = resolveTonWalletVersion({
18
+ address: coin.address,
19
+ publicKey: walletCore.PublicKey.createWithData(publicKeyBytes, walletCore.PublicKeyType.ed25519),
20
+ walletCore,
21
+ });
12
22
  // `sendMaxAmount` is deliberately not read here. A MAX send is the displayed
13
23
  // `balance - fee` carried in `toAmount` like any other amount, so the signed bytes
14
24
  // are identical either way and the flag stays descriptive metadata.
@@ -25,26 +35,36 @@ export const getTonSigningInputs = ({ keysignPayload, walletCore }) => {
25
35
  // tag. The wallet-level flag describes only `toAddress` — the first message —
26
36
  // and applying it to the whole batch signs the wrong bit on the others.
27
37
  bounceable: getTonMessageBounceable(msg.to, !!msg.stateInit),
38
+ walletVersion,
28
39
  }))
29
40
  : [
30
41
  isFeeCoin(coin)
31
42
  ? buildNativeTonTransfer({
32
43
  keysignPayload,
33
44
  bounceable: isStakeOp ? true : !!bounceable,
45
+ walletVersion,
34
46
  })
35
47
  : buildJettonTransfer({
36
48
  keysignPayload,
37
49
  walletCore,
38
50
  jettonAddress,
39
51
  isActiveDestination,
52
+ walletVersion,
40
53
  }),
41
54
  ];
55
+ const maxMessages = tonMaxMessagesPerRequest[walletVersion];
56
+ if (messages.length > maxMessages) {
57
+ throw new Error(`A ${walletVersion} TON wallet can send at most ${maxMessages} messages per request, got ${messages.length}`);
58
+ }
42
59
  const input = TW.TheOpenNetwork.Proto.SigningInput.create({
43
- walletVersion: TW.TheOpenNetwork.Proto.WalletVersion.WALLET_V4_R2,
60
+ walletVersion: match(walletVersion, {
61
+ v4r2: () => TW.TheOpenNetwork.Proto.WalletVersion.WALLET_V4_R2,
62
+ v5r1: () => TW.TheOpenNetwork.Proto.WalletVersion.WALLET_V5_R1,
63
+ }),
44
64
  expireAt: Number(expireAt.toString()),
45
65
  sequenceNumber: Number(sequenceNumber.toString()),
46
66
  messages,
47
- publicKey: getKeysignTwPublicKey(keysignPayload),
67
+ publicKey: publicKeyBytes,
48
68
  });
49
69
  return [input];
50
70
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAA;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAA;AACrE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAA;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,iCAAiC,EAAE,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AU;iBAC5C,CAAC;gBACJ,CAAC,CAAC,mBAAmB,CAAC;oBAClB,cAAc;oBACd,UAAU;oBACV,aAAa;oBACb,mBAAmB;iBACpB,CAAC;SACP,CAAA;IAEP,MAAM,KAAK,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;QACxD,aAAa,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,aAAa,CAAC,YAAY;QACjE,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACrC,cAAc,EAAE,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACjD,QAAQ;QACR,SAAS,EAAE,qBAAqB,CAAC,cAAc,CAAC;KACjD,CAAC,CAAA;IAEF,OAAO,CAAC,KAAK,CAAC,CAAA;AAChB,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAA;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAA;AAC1G,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAA;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAA;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,iCAAiC,EAAE,MAAM,U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
@@ -1,3 +1,4 @@
1
+ import { TonWalletVersion } from '@vultisig/core-chain/chains/ton/wallet';
1
2
  import { KeysignPayload } from '@vultisig/core-mpc/types/vultisig/keysign/v1/keysign_message_pb';
2
3
  import { TW } from '@trustwallet/wallet-core';
3
4
  import { WalletCore } from '@trustwallet/wallet-core';
@@ -6,6 +7,7 @@ type BuildJettonTransferInput = {
6
7
  walletCore: WalletCore;
7
8
  jettonAddress: string;
8
9
  isActiveDestination: boolean;
10
+ walletVersion: TonWalletVersion;
9
11
  };
10
12
  /**
11
13
  * Builds the transfer that carries a Jetton send: a fixed TON amount to the
@@ -13,6 +15,6 @@ type BuildJettonTransferInput = {
13
15
  * nanoton only when the destination is already active, so an inactive recipient
14
16
  * isn't charged for a notification it cannot receive.
15
17
  */
16
- export declare const buildJettonTransfer: ({ keysignPayload, walletCore, jettonAddress, isActiveDestination, }: BuildJettonTransferInput) => TW.TheOpenNetwork.Proto.Transfer;
18
+ export declare const buildJettonTransfer: ({ keysignPayload, walletCore, jettonAddress, isActiveDestination, walletVersion, }: BuildJettonTransferInput) => TW.TheOpenNetwork.Proto.Transfer;
17
19
  export {};
18
20
  //# sourceMappingURL=jetton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jetton.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/jetton.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,iEAAiE,CAAA;AAEhG,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAMrD,KAAK,wBAAwB,GAAG;IAC9B,cAAc,EAAE,cAAc,CAAA;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;CAC7B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,qEAKjC,wBAAwB,KAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,QAsCrD,CAAA"}
1
+ {"version":3,"file":"jetton.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/jetton.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iEAAiE,CAAA;AAEhG,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAMrD,KAAK,wBAAwB,GAAG;IAC9B,cAAc,EAAE,cAAc,CAAA;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,aAAa,EAAE,gBAAgB,CAAA;CAChC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,oFAMjC,wBAAwB,KAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,QAsCrD,CAAA"}
@@ -4,14 +4,14 @@ import { shouldBePresent } from '@vultisig/lib-utils/assert/shouldBePresent';
4
4
  import { TW } from '@trustwallet/wallet-core';
5
5
  import { getKeysignAmount } from '../../../utils/getKeysignAmount.js';
6
6
  import { getKeysignCoin } from '../../../utils/getKeysignCoin.js';
7
- import { tonAmountToBytes, tonSendMode } from './native.js';
7
+ import { getTonSendMode, tonAmountToBytes } from './native.js';
8
8
  /**
9
9
  * Builds the transfer that carries a Jetton send: a fixed TON amount to the
10
10
  * sender's own Jetton wallet, wrapping the Jetton payload. `forwardAmount` is 1
11
11
  * nanoton only when the destination is already active, so an inactive recipient
12
12
  * isn't charged for a notification it cannot receive.
13
13
  */
14
- export const buildJettonTransfer = ({ keysignPayload, walletCore, jettonAddress, isActiveDestination, }) => {
14
+ export const buildJettonTransfer = ({ keysignPayload, walletCore, jettonAddress, isActiveDestination, walletVersion, }) => {
15
15
  // `TonSpecific.jettonAddress` is a plain proto string that defaults to '' when the
16
16
  // sender's jetton wallet could not be resolved, and '' survives every null/undefined
17
17
  // check on the way here. Signing that would broadcast a transfer to no destination,
@@ -40,7 +40,7 @@ export const buildJettonTransfer = ({ keysignPayload, walletCore, jettonAddress,
40
40
  amount: tonAmountToBytes(tonConfig.jettonAmount),
41
41
  bounceable: true,
42
42
  comment: keysignPayload.memo ?? '',
43
- mode: tonSendMode,
43
+ mode: getTonSendMode(walletVersion),
44
44
  jettonTransfer,
45
45
  });
46
46
  };
@@ -1 +1 @@
1
- {"version":3,"file":"jetton.js","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/jetton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAA;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAA;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AASxD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,cAAc,EACd,UAAU,EACV,aAAa,EACb,mBAAmB,GACM,EAAoC,EAAE;IAC/D,mFAAmF;IACnF,qFAAqF;IACrF,oFAAoF;IACpF,qEAAqE;IACrE,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC,CAAA;IACpG,CAAC;IAED,MAAM,IAAI,GAAG,cAAc,CAAC,cAAc,CAAC,CAAA;IAE3C,MA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,CAAC,MAAM,CAAC;QACnE,YAAY,EAAE,gBAAgB,CAAC,MAAM,CAAC;QACtC,OAAO,EAAE,kBAAkB;QAC3B,eAAe,EAAE,IAAI,CAAC,OAAO;QAC7B,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAC;KAC/C,CAAC,CAAA;IAEF,OAAO,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC7C,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,gBAAgB,CAAC,SAAS,CAAC,YAAY,CAAC;QAChD,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,cAAc,CAAC,IAAI,IAAI,EAAE;QAClC,IAAI,EAAE,cAAc,CAAC,aAAa,CAAC;QACnC,cAAc;KACf,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { Buffer } from 'buffer';
2
+ import { TonWalletVersion } from '@vultisig/core-chain/chains/ton/wallet';
2
3
  import { KeysignPayload } from '@vultisig/core-mpc/types/vultisig/keysign/v1/keysign_message_pb';
3
4
  import { TW } from '@trustwallet/wallet-core';
4
5
  type BuildNativeTonTransferFromMessageInput = {
@@ -7,10 +8,12 @@ type BuildNativeTonTransferFromMessageInput = {
7
8
  payload?: string;
8
9
  stateInit?: string;
9
10
  bounceable: boolean;
11
+ walletVersion: TonWalletVersion;
10
12
  };
11
13
  type BuildNativeTonTransferInput = {
12
14
  keysignPayload: KeysignPayload;
13
15
  bounceable: boolean;
16
+ walletVersion: TonWalletVersion;
14
17
  };
15
18
  export declare const tonAmountToBytes: (amount: string | bigint) => Buffer;
16
19
  /**
@@ -29,6 +32,18 @@ export declare const tonAmountToBytes: (amount: string | bigint) => Buffer;
29
32
  * this payload, so changing it here breaks keysign with any client that has not changed too.
30
33
  */
31
34
  export declare const tonSendMode = TW.TheOpenNetwork.Proto.SendMode.PAY_FEES_SEPARATELY;
35
+ /**
36
+ * The send mode for a given wallet contract.
37
+ *
38
+ * W5 is the exception to the rule above: its code refuses an external request
39
+ * unless every action carries `IGNORE_ACTION_PHASE_ERRORS`, because that is
40
+ * how it guarantees the seqno advances even when an action fails — the
41
+ * contract's own replay protection. WalletCore enforces the same check before
42
+ * it will build the message. The blindness the flag causes is covered on the
43
+ * other side: the status resolver reads the action phase, so a W5 send whose
44
+ * transfer was skipped reports as failed instead of confirmed.
45
+ */
46
+ export declare const getTonSendMode: (walletVersion: TonWalletVersion) => number;
32
47
  /**
33
48
  * Builds the single WalletCore transfer for an app-initiated native TON send.
34
49
  *
@@ -39,11 +54,11 @@ export declare const tonSendMode = TW.TheOpenNetwork.Proto.SendMode.PAY_FEES_SEP
39
54
  * send is just `balance - fee` as an ordinary amount, and that fee is the reserve the
40
55
  * send mode then draws on.
41
56
  */
42
- export declare const buildNativeTonTransfer: ({ keysignPayload, bounceable, }: BuildNativeTonTransferInput) => TW.TheOpenNetwork.Proto.Transfer;
57
+ export declare const buildNativeTonTransfer: ({ keysignPayload, bounceable, walletVersion, }: BuildNativeTonTransferInput) => TW.TheOpenNetwork.Proto.Transfer;
43
58
  /**
44
59
  * Builds a transfer for one message of a dApp-supplied `signTon` request. The
45
60
  * message carries its own payload/stateInit, so no comment is attached here.
46
61
  */
47
- export declare const buildNativeTonTransferFromMessage: ({ to, amount, payload, stateInit, bounceable, }: BuildNativeTonTransferFromMessageInput) => TW.TheOpenNetwork.Proto.Transfer;
62
+ export declare const buildNativeTonTransferFromMessage: ({ to, amount, payload, stateInit, bounceable, walletVersion, }: BuildNativeTonTransferFromMessageInput) => TW.TheOpenNetwork.Proto.Transfer;
48
63
  export {};
49
64
  //# sourceMappingURL=native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,iEAAiE,CAAA;AAEhG,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAE7C,KAAK,sCAAsC,GAAG;IAC5C,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,KAAK,2BAA2B,GAAG;IACjC,cAAc,EAAE,cAAc,CAAA;IAC9B,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAMD,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,GAAG,MAAM,KAAG,MAuB1D,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,uDAAuD,CAAA;AAE/E;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,GAAI,iCAGpC,2BAA2B,KAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,QAWxD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAAI,iDAM/C,sCAAsC,KAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,QAUnE,CAAA"}
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iEAAiE,CAAA;AAGhG,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAE7C,KAAK,sCAAsC,GAAG;IAC5C,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,gBAAgB,CAAA;CAChC,CAAA;AAED,KAAK,2BAA2B,GAAG;IACjC,cAAc,EAAE,cAAc,CAAA;IAC9B,UAAU,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,gBAAgB,CAAA;CAChC,CAAA;AAMD,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,GAAG,MAAM,KAAG,MAuB1D,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW,uDAAuD,CAAA;AAE/E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,eAAe,gBAAgB,KAAG,MAI7D,CAAA;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,GAAI,gDAIpC,2BAA2B,KAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,QAWxD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAAI,gEAO/C,sCAAsC,KAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,QAUnE,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import { Buffer } from 'buffer';
2
2
  import { validateTonComment } from '@vultisig/core-chain/chains/ton/comment';
3
3
  import { numberToEvenHex } from '@vultisig/lib-utils/hex/numberToHex';
4
+ import { match } from '@vultisig/lib-utils/match';
4
5
  import { TW } from '@trustwallet/wallet-core';
5
6
  const tonUnsignedDecimalRegex = /^\d+$/;
6
7
  const tonMaxAmount = (1n << 120n) - 1n;
@@ -40,6 +41,21 @@ export const tonAmountToBytes = (amount) => {
40
41
  * this payload, so changing it here breaks keysign with any client that has not changed too.
41
42
  */
42
43
  export const tonSendMode = TW.TheOpenNetwork.Proto.SendMode.PAY_FEES_SEPARATELY;
44
+ /**
45
+ * The send mode for a given wallet contract.
46
+ *
47
+ * W5 is the exception to the rule above: its code refuses an external request
48
+ * unless every action carries `IGNORE_ACTION_PHASE_ERRORS`, because that is
49
+ * how it guarantees the seqno advances even when an action fails — the
50
+ * contract's own replay protection. WalletCore enforces the same check before
51
+ * it will build the message. The blindness the flag causes is covered on the
52
+ * other side: the status resolver reads the action phase, so a W5 send whose
53
+ * transfer was skipped reports as failed instead of confirmed.
54
+ */
55
+ export const getTonSendMode = (walletVersion) => match(walletVersion, {
56
+ v4r2: () => tonSendMode,
57
+ v5r1: () => tonSendMode | TW.TheOpenNetwork.Proto.SendMode.IGNORE_ACTION_PHASE_ERRORS,
58
+ });
43
59
  /**
44
60
  * Builds the single WalletCore transfer for an app-initiated native TON send.
45
61
  *
@@ -50,7 +66,7 @@ export const tonSendMode = TW.TheOpenNetwork.Proto.SendMode.PAY_FEES_SEPARATELY;
50
66
  * send is just `balance - fee` as an ordinary amount, and that fee is the reserve the
51
67
  * send mode then draws on.
52
68
  */
53
- export const buildNativeTonTransfer = ({ keysignPayload, bounceable, }) => {
69
+ export const buildNativeTonTransfer = ({ keysignPayload, bounceable, walletVersion, }) => {
54
70
  const comment = keysignPayload.memo || '';
55
71
  validateTonComment({ memo: comment });
56
72
  return TW.TheOpenNetwork.Proto.Transfer.create({
@@ -58,14 +74,14 @@ export const buildNativeTonTransfer = ({ keysignPayload, bounceable, }) => {
58
74
  amount: tonAmountToBytes(keysignPayload.toAmount),
59
75
  bounceable,
60
76
  comment,
61
- mode: tonSendMode,
77
+ mode: getTonSendMode(walletVersion),
62
78
  });
63
79
  };
64
80
  /**
65
81
  * Builds a transfer for one message of a dApp-supplied `signTon` request. The
66
82
  * message carries its own payload/stateInit, so no comment is attached here.
67
83
  */
68
- export const buildNativeTonTransferFromMessage = ({ to, amount, payload = '', stateInit, bounceable, }) => {
84
+ export const buildNativeTonTransferFromMessage = ({ to, amount, payload = '', stateInit, bounceable, walletVersion, }) => {
69
85
  return TW.TheOpenNetwork.Proto.Transfer.create({
70
86
  dest: to,
71
87
  amount: tonAmountToBytes(amount),
@@ -73,7 +89,7 @@ export const buildNativeTonTransferFromMessage = ({ to, amount, payload = '', st
73
89
  comment: '',
74
90
  customPayload: payload || undefined,
75
91
  stateInit: stateInit || undefined,
76
- mode: tonSendMode,
92
+ mode: getTonSendMode(walletVersion),
77
93
  });
78
94
  };
79
95
  //# sourceMappingURL=native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"native.js","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAe7C,MAAM,uBAAuB,GAAG,OAAO,CAAA;AACvC,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAA;AACtC,MAAM,mBAAmB,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAA;AAEnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAuB,EAAU,EAAE;IAClE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAA;IAC9D,CAAC;IAED,MAAM,gBAAgB,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;IAC9F,IACE,OAAO,gBAAgB,KAAK,QAAQ;QACpC,CAAC,gBAAgB,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM;YACnD,CAAC,gBAAgB,CAAC,MAAM,KAAK,mBAAmB,CAAC,MAAM,IAAI,gBAAgB,GAAG,mBAAmB,CAAC,CAAC,EACrG,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,+CAA+C,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CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC7C,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC;QAChC,UAAU;QACV,OAAO,EAAE,EAAE;QACX,aAAa,EAAE,OAAO,IAAI,SAAS;QACnC,SAAS,EAAE,SAAS,IAAI,SAAS;QACjC,IAAI,EAAE,WAAW;KAClB,CAAC,CAAA;AACJ,CAAC,CAAA"}
1
+ {"version":3,"file":"native.js","sourceRoot":"","sources":["../../../../../../../../packages/core/mpc/keysign/signingInputs/resolvers/ton/native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAG5E,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAiB7C,MAAM,uBAAuB,GAAG,OAAO,CAAA;AACvC,MAAM,YAAY,GAAG,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAA;AACtC,MAAM,mBAAmB,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAA;AAEnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAuB,EAAU,EAAE;IAClE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAA;IAC9D,CAAC;IAED,MAAM,gBAAgB,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;IAC9F,IACE,OAAO,gBAAgB,KAAK,QAAQ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AI,IAAI,EAAE,CAAA;IACzC,kBAAkB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IAErC,OAAO,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC7C,IAAI,EAAE,cAAc,CAAC,SAAS;QAC9B,MAAM,EAAE,gBAAgB,CAAC,cAAc,CAAC,QAAQ,CAAC;QACjD,UAAU;QACV,OAAO;QACP,IAAI,EAAE,cAAc,CAAC,aAAa,CAAC;KACpC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,EAChD,EAAE,EACF,MAAM,EACN,OAAO,GAAG,EAAE,EACZ,SAAS,EACT,UAAU,EACV,aAAa,GAC0B,EAAoC,EAAE;IAC7E,OAAO,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC7C,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC;QAChC,UAAU;QACV,OAAO,EAAE,EAAE;QACX,aAAa,EAAE,OAAO,IAAI,SAAS;QACnC,SAAS,EAAE,SAAS,IAAI,SAAS;QACjC,IAAI,EAAE,cAAc,CAAC,aAAa,CAAC;KACpC,CAAC,CAAA;AACJ,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vultisig/core-mpc",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "MPC, keysign, and vault types shared across Vultisig clients",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1094,7 +1094,7 @@
1094
1094
  "@noble/hashes": "^2.2.0",
1095
1095
  "@solana/web3.js": "^1.98.4",
1096
1096
  "@trustwallet/wallet-core": "^4.7.3",
1097
- "@vultisig/core-chain": "5.1.0",
1097
+ "@vultisig/core-chain": "5.2.0",
1098
1098
  "@vultisig/core-config": "0.9.1",
1099
1099
  "@vultisig/lib-dkls": "0.9.0",
1100
1100
  "@vultisig/lib-mldsa": "0.9.0",