@vultisig/sdk 0.26.1 → 0.27.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,11 @@
1
1
  # @vultisig/sdk
2
2
 
3
+ ## 0.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#516](https://github.com/vultisig/vultisig-sdk/pull/516) [`9a80907`](https://github.com/vultisig/vultisig-sdk/commit/9a8090721008f2a10dffa9cf2d3fac479d65481c) Thanks [@NeOMakinG](https://github.com/NeOMakinG)! - Add `buildTonTxFromSigningPayload({publicKeyEd25519, signingPayloadBoc, includeStateInit, workchain})` to sign yield.xyz TON actions whose signing payload BoC is already constructed upstream. Parses the BoC, hashes the payload cell, takes the MPC signature, and wraps the final external message — same `{signingHashHex, unsignedBocHex, fromAddress, finalize(sig)}` contract as `buildTonSendTx`. Accepts either base64 or hex BoC input. Optional `includeStateInit` flag deploys the v4r2 wallet contract alongside the tx for first-send (seqno === 0) scenarios.
8
+
3
9
  ## 0.26.1
4
10
 
5
11
  ### Patch Changes
@@ -7738,6 +7738,59 @@ type BuildTonJettonTransferOptions = {
7738
7738
  workchain?: number;
7739
7739
  };
7740
7740
  declare function buildTonJettonTransferTx(opts: BuildTonJettonTransferOptions): TonTxBuilderResult;
7741
+ type BuildTonTxFromSigningPayloadOptions = {
7742
+ /**
7743
+ * Ed25519 pubkey of the signer (32 bytes, hex). Used to derive the
7744
+ * V4R2 wallet address for the outer external-message envelope —
7745
+ * NOT included in the signed payload itself. The signing hash is
7746
+ * the hash of the payload BoC; the pubkey only affects the envelope
7747
+ * `dest:MsgAddressInt` field.
7748
+ */
7749
+ publicKeyEd25519: string;
7750
+ /**
7751
+ * The pre-built signing-payload BoC, base64-encoded. yield.xyz returns
7752
+ * this verbatim in each step's `unsignedTransaction` field. Hex is
7753
+ * also accepted (auto-detect by prefix / character set) so a future
7754
+ * upstream that emits hex doesn't break this primitive.
7755
+ */
7756
+ signingPayloadBoc: string;
7757
+ /**
7758
+ * When true, the external message wraps a StateInit cell (the wallet
7759
+ * deploys itself in the same tx). Required for the very first send
7760
+ * from a wallet — the contract isn't on-chain yet so the message
7761
+ * must include code+data.
7762
+ *
7763
+ * For TON V4R2 the rule is: include StateInit iff seqno === 0. Callers
7764
+ * that derive the BoC from yield.xyz typically know this from their
7765
+ * own seqno lookup; pass true on first-ever send, false otherwise.
7766
+ *
7767
+ * Default false to fail-closed (a missing StateInit on first send
7768
+ * surfaces as a clear broadcast error; a stale StateInit on a later
7769
+ * send would pass an invalid contract redeploy).
7770
+ */
7771
+ includeStateInit?: boolean;
7772
+ /**
7773
+ * Optional override for the wallet workchain. Defaults to `0` (the
7774
+ * basechain — where all user wallets live). Pass `-1` for the
7775
+ * masterchain (validators / system contracts); almost no consumer
7776
+ * needs this.
7777
+ */
7778
+ workchain?: number;
7779
+ };
7780
+ /**
7781
+ * Sign a pre-built TON signing payload (the inner Cell that gets hashed
7782
+ * for the wallet's external-message body). See the section header
7783
+ * comment above for the full design rationale and seqno-freshness
7784
+ * warnings.
7785
+ *
7786
+ * @returns {signingHashHex, unsignedBocHex, fromAddress, finalize(sig)}
7787
+ * — identical contract to `buildTonSendTx` so call-sites can
7788
+ * treat both paths uniformly. `unsignedBocHex` round-trips
7789
+ * the decoded payload's serialized form (NOT the input
7790
+ * string verbatim — equality holds at the byte level after
7791
+ * BoC re-serialization).
7792
+ */
7793
+ declare function buildTonTxFromSigningPayload(opts: BuildTonTxFromSigningPayloadOptions): TonTxBuilderResult;
7741
7794
  /** Throws if `memo` exceeds the 123-byte TON comment cell capacity. */
7742
7795
  declare function validateTonMemo(memo: string): void;
7743
7796
 
@@ -7794,6 +7847,7 @@ declare function buildV4R2Wallet(opts: {
7794
7847
 
7795
7848
  type ton_BuildTonJettonTransferOptions = BuildTonJettonTransferOptions;
7796
7849
  type ton_BuildTonSendOptions = BuildTonSendOptions;
7850
+ type ton_BuildTonTxFromSigningPayloadOptions = BuildTonTxFromSigningPayloadOptions;
7797
7851
  declare const ton_TON_V4R2_SUB_WALLET_ID: typeof TON_V4R2_SUB_WALLET_ID;
7798
7852
  type ton_TonTxBuilderResult = TonTxBuilderResult;
7799
7853
  type ton_TonV4R2Wallet = TonV4R2Wallet;
@@ -7802,6 +7856,7 @@ type ton_TonWalletStatus = TonWalletStatus;
7802
7856
  declare const ton_broadcastTonTx: typeof broadcastTonTx;
7803
7857
  declare const ton_buildTonJettonTransferTx: typeof buildTonJettonTransferTx;
7804
7858
  declare const ton_buildTonSendTx: typeof buildTonSendTx;
7859
+ declare const ton_buildTonTxFromSigningPayload: typeof buildTonTxFromSigningPayload;
7805
7860
  declare const ton_buildV4R2Wallet: typeof buildV4R2Wallet;
7806
7861
  declare const ton_deriveTonAddress: typeof deriveTonAddress;
7807
7862
  declare const ton_getTonBalance: typeof getTonBalance;
@@ -7809,8 +7864,8 @@ declare const ton_getTonWalletInfo: typeof getTonWalletInfo;
7809
7864
  declare const ton_sha256: typeof sha256;
7810
7865
  declare const ton_validateTonMemo: typeof validateTonMemo;
7811
7866
  declare namespace ton {
7812
- export { ton_TON_V4R2_SUB_WALLET_ID as TON_V4R2_SUB_WALLET_ID, ton_broadcastTonTx as broadcastTonTx, ton_buildTonJettonTransferTx as buildTonJettonTransferTx, ton_buildTonSendTx as buildTonSendTx, ton_buildV4R2Wallet as buildV4R2Wallet, ton_deriveTonAddress as deriveTonAddress, ton_getTonBalance as getTonBalance, ton_getTonWalletInfo as getTonWalletInfo, ton_sha256 as sha256, ton_validateTonMemo as validateTonMemo };
7813
- export type { ton_BuildTonJettonTransferOptions as BuildTonJettonTransferOptions, ton_BuildTonSendOptions as BuildTonSendOptions, ton_TonTxBuilderResult as TonTxBuilderResult, ton_TonV4R2Wallet as TonV4R2Wallet, ton_TonWalletInfo as TonWalletInfo, ton_TonWalletStatus as TonWalletStatus };
7867
+ export { ton_TON_V4R2_SUB_WALLET_ID as TON_V4R2_SUB_WALLET_ID, ton_broadcastTonTx as broadcastTonTx, ton_buildTonJettonTransferTx as buildTonJettonTransferTx, ton_buildTonSendTx as buildTonSendTx, ton_buildTonTxFromSigningPayload as buildTonTxFromSigningPayload, ton_buildV4R2Wallet as buildV4R2Wallet, ton_deriveTonAddress as deriveTonAddress, ton_getTonBalance as getTonBalance, ton_getTonWalletInfo as getTonWalletInfo, ton_sha256 as sha256, ton_validateTonMemo as validateTonMemo };
7868
+ export type { ton_BuildTonJettonTransferOptions as BuildTonJettonTransferOptions, ton_BuildTonSendOptions as BuildTonSendOptions, ton_BuildTonTxFromSigningPayloadOptions as BuildTonTxFromSigningPayloadOptions, ton_TonTxBuilderResult as TonTxBuilderResult, ton_TonV4R2Wallet as TonV4R2Wallet, ton_TonWalletInfo as TonWalletInfo, ton_TonWalletStatus as TonWalletStatus };
7814
7869
  }
7815
7870
 
7816
7871
  /**