From 5a0f792719babb9c4adb2e1ab48b5a88e1c99989 Mon Sep 17 00:00:00 2001 From: Wayne Wen Date: Wed, 8 Jul 2026 16:03:54 -0700 Subject: [PATCH 1/2] feat(sdk-core): pass optional attestation through multisig send/initiate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a local AttestationPayload codec and thread it through wallet.sendMany's build/send/initiate path so a WebAuthn attestation survives to POST /tx/send and /tx/initiate: appended to BuildParams (clears the sendMany prebuild-whitelist pick), to whitelistedSendParams, and re-added via a local t.intersection partial since @bitgo/public-types' TxSendBody (t.exact) doesn't declare the field yet and would strip it on encode. Pure pass-through — no attestation validation in the SDK. Scoped to what WCN-539 (UI) needs end-to-end: multisig only. The shared upstream codec change and the /txrequests, /signatureshares, and /pendingapprovals endpoints are left as TODO(WCN-541) markers for the dedicated SDK/Express pass-through ticket. Ticket: WCN-539 --- .../bitgo/pendingApproval/pendingApproval.ts | 2 ++ modules/sdk-core/src/bitgo/tss/common.ts | 2 ++ .../src/bitgo/utils/tss/baseTSSUtils.ts | 2 ++ .../sdk-core/src/bitgo/wallet/BuildParams.ts | 19 +++++++++++ modules/sdk-core/src/bitgo/wallet/iWallet.ts | 5 +++ modules/sdk-core/src/bitgo/wallet/wallet.ts | 14 +++++--- .../test/unit/bitgo/wallet/BuildParams.ts | 34 ++++++++++++++++++- .../bitgo/wallet/SendTransactionRequest.ts | 29 ++++++++++++++++ 8 files changed, 102 insertions(+), 5 deletions(-) diff --git a/modules/sdk-core/src/bitgo/pendingApproval/pendingApproval.ts b/modules/sdk-core/src/bitgo/pendingApproval/pendingApproval.ts index 5ca48252d4..822ef5bab4 100644 --- a/modules/sdk-core/src/bitgo/pendingApproval/pendingApproval.ts +++ b/modules/sdk-core/src/bitgo/pendingApproval/pendingApproval.ts @@ -31,6 +31,8 @@ type PreApproveResult = { halfSigned?: string; }; +// TODO(WCN-541): add optional attestation pass-through for PUT /pendingapprovals/:id (deferred +// until multisig attestation, WCN-539, is verified end-to-end on staging). type ApprovePendingApprovalRequestBody = { state: 'approved'; otp: string | undefined; diff --git a/modules/sdk-core/src/bitgo/tss/common.ts b/modules/sdk-core/src/bitgo/tss/common.ts index 7903038740..83ec34bad7 100644 --- a/modules/sdk-core/src/bitgo/tss/common.ts +++ b/modules/sdk-core/src/bitgo/tss/common.ts @@ -111,6 +111,8 @@ export async function sendSignatureShare( const urlPath = '/wallet/' + walletId + '/txrequests/' + txRequestId + addendum + '/signatureshares'; const reqTracer = reqId || new RequestTracer(); bitgo.setRequestTracer(reqTracer); + // TODO(WCN-541): add optional attestation pass-through for MPC /signatureshares, first round + // only (deferred until multisig attestation, WCN-539, is verified end-to-end on staging). return bitgo .post(bitgo.url(urlPath, 2)) .send({ diff --git a/modules/sdk-core/src/bitgo/utils/tss/baseTSSUtils.ts b/modules/sdk-core/src/bitgo/utils/tss/baseTSSUtils.ts index 2b983ccdd7..1d830a3ede 100644 --- a/modules/sdk-core/src/bitgo/utils/tss/baseTSSUtils.ts +++ b/modules/sdk-core/src/bitgo/utils/tss/baseTSSUtils.ts @@ -514,6 +514,8 @@ export default class BaseTssUtils extends MpcUtils implements ITssUtil preview?: boolean, reqId?: IRequestTracer ): Promise { + // TODO(WCN-541): add optional attestation pass-through for MPC /txrequests (deferred until + // multisig attestation, WCN-539, is verified end-to-end on staging). const whitelistedParams = { intent: { ...intentOptions, diff --git a/modules/sdk-core/src/bitgo/wallet/BuildParams.ts b/modules/sdk-core/src/bitgo/wallet/BuildParams.ts index 2ea3b10dcb..785d98fbf1 100644 --- a/modules/sdk-core/src/bitgo/wallet/BuildParams.ts +++ b/modules/sdk-core/src/bitgo/wallet/BuildParams.ts @@ -64,6 +64,23 @@ export const BuildParamsOffchain = t.partial({ idfUserId: t.unknown, }); +/** + * WebAuthn attestation proving a passkey user signed off on this withdrawal intent. + * Pure pass-through — the SDK does not validate or interpret this payload. + * + * TODO(WCN-541): move this codec to @bitgo/public-types as the shared AttestationPayload + * and add it to the canonical TxSendBody/BuildParams codecs there; this local copy only + * covers the multisig /tx/build, /tx/send, and /tx/initiate paths. + */ +export const AttestationPayload = t.type({ + signature: t.string, + credentialId: t.string, + clientDataJSON: t.string, + authenticatorData: t.string, +}); + +export type AttestationPayload = t.TypeOf; + export const BuildParams = t.exact( t.intersection([ BuildParamsUTXO, @@ -139,6 +156,8 @@ export const BuildParams = t.exact( feeToken: t.unknown, // Bridging parameters for cross-chain operations (e.g., BTC to sBTC) bridgingParams: t.unknown, + // WebAuthn attestation for the withdrawal intent (WCN-539) — pass-through only. + attestation: AttestationPayload, }), ]) ); diff --git a/modules/sdk-core/src/bitgo/wallet/iWallet.ts b/modules/sdk-core/src/bitgo/wallet/iWallet.ts index a9663e6bbc..067660bcb6 100644 --- a/modules/sdk-core/src/bitgo/wallet/iWallet.ts +++ b/modules/sdk-core/src/bitgo/wallet/iWallet.ts @@ -38,6 +38,7 @@ import { TxRequest, } from '../utils'; import { SerializedNtilde } from '../../account-lib/mpc/tss/ecdsa/types'; +import { AttestationPayload } from './BuildParams'; import { IAddressBook } from '../address-book'; import { WalletUser, AddressQueryResult } from '@bitgo/public-types'; import { SubmitTransactionResponse } from '../inscriptionBuilder'; @@ -203,6 +204,8 @@ export interface PrebuildTransactionOptions { idfUserId?: string; idfVersion?: number; comment?: string; + /** WebAuthn attestation for the withdrawal intent (WCN-539) — pass-through only. */ + attestation?: AttestationPayload; [index: string]: unknown; tokenName?: string; nftCollectionId?: string; @@ -883,6 +886,8 @@ export interface SubmitTransactionOptions { }; comment?: string; txRequestId?: string; + /** WebAuthn attestation for the withdrawal intent (WCN-539) — pass-through only. */ + attestation?: AttestationPayload; } export interface SendOptions { diff --git a/modules/sdk-core/src/bitgo/wallet/wallet.ts b/modules/sdk-core/src/bitgo/wallet/wallet.ts index a8c1952cf5..983c9d20c2 100644 --- a/modules/sdk-core/src/bitgo/wallet/wallet.ts +++ b/modules/sdk-core/src/bitgo/wallet/wallet.ts @@ -56,7 +56,7 @@ import { txParamsFromIntent } from '../utils/tss/baseTSSUtils'; import { EcdsaMPCv2Utils, EcdsaUtils } from '../utils/tss/ecdsa'; import EddsaUtils, { EddsaMPCv2Utils } from '../utils/tss/eddsa'; import { getTxRequestApiVersion, validateTxRequestApiVersion } from '../utils/txRequest'; -import { buildParamKeys, BuildParams } from './BuildParams'; +import { buildParamKeys, BuildParams, AttestationPayload } from './BuildParams'; import { AccelerateTransactionOptions, AddressesByBalanceOptions, @@ -143,7 +143,9 @@ const debug = require('debug')('bitgo:v2:wallet'); type ManageUnspents = 'consolidate' | 'fanout'; -const whitelistedSendParams = TxSendBody.type.types.flatMap((t) => Object.keys(t.props)); +// TODO(WCN-541): 'attestation' is appended locally because @bitgo/public-types' TxSendBody +// codec doesn't declare it yet. Once TxSendBody adds it upstream, drop this local addition. +const whitelistedSendParams = [...TxSendBody.type.types.flatMap((t) => Object.keys(t.props)), 'attestation']; export enum ManageUnspentsOptions { BUILD_ONLY, @@ -5064,10 +5066,13 @@ export class Wallet implements IWallet { const whitelistedParams = this.baseCoin.preprocessBuildParams(_.pick(params, whitelistedSendParams)); const reqTracer = reqId || new RequestTracer(); this.bitgo.setRequestTracer(reqTracer); + // TODO(WCN-541): attestation is added to this local intersection because @bitgo/public-types' + // TxSendBody codec (t.exact) doesn't declare it yet, and t.exact strips undeclared keys on + // encode. Once TxSendBody adds it upstream, drop `attestation` from this local partial. return postWithCodec( this.bitgo, this.baseCoin.url('/wallet/' + this.id() + '/tx/send'), - t.intersection([TxSendBody, t.partial({ locktime: t.number })]), + t.intersection([TxSendBody, t.partial({ locktime: t.number, attestation: AttestationPayload })]), whitelistedParams ).result(); } @@ -5079,10 +5084,11 @@ export class Wallet implements IWallet { const whitelistedParams = this.baseCoin.preprocessBuildParams(_.pick(params, whitelistedSendParams)); const reqTracer = reqId || new RequestTracer(); this.bitgo.setRequestTracer(reqTracer); + // TODO(WCN-541): see sendTransaction — same local-codec workaround for attestation pass-through. return postWithCodec( this.bitgo, this.baseCoin.url('/wallet/' + this.id() + '/tx/initiate'), - TxSendBody, + t.intersection([TxSendBody, t.partial({ attestation: AttestationPayload })]), whitelistedParams ).result(); } diff --git a/modules/sdk-core/test/unit/bitgo/wallet/BuildParams.ts b/modules/sdk-core/test/unit/bitgo/wallet/BuildParams.ts index e88da25a62..e1f619b3ba 100644 --- a/modules/sdk-core/test/unit/bitgo/wallet/BuildParams.ts +++ b/modules/sdk-core/test/unit/bitgo/wallet/BuildParams.ts @@ -1,5 +1,5 @@ import * as assert from 'assert'; -import { BuildParams } from '../../../../src/bitgo/wallet/BuildParams'; +import { BuildParams, buildParamKeys, AttestationPayload } from '../../../../src/bitgo/wallet/BuildParams'; describe('BuildParams', function () { it('enforces codec', function () { @@ -74,4 +74,36 @@ describe('BuildParams', function () { } ); }); + + it('should whitelist attestation (WCN-539) while stripping unrelated unknown params', function () { + const attestation = { + signature: 'sig', + credentialId: 'cred-id', + clientDataJSON: 'client-data', + authenticatorData: 'auth-data', + }; + assert.deepStrictEqual( + BuildParams.encode({ + recipients: [{ amount: '10000', address: '2N9Ego9KidiZR8tMP82g6RaggQtcbR9zNzH' }], + attestation, + unknownField: 'should be stripped', + } as any), + { + recipients: [{ amount: '10000', address: '2N9Ego9KidiZR8tMP82g6RaggQtcbR9zNzH' }], + attestation, + } + ); + assert.ok(buildParamKeys.includes('attestation'), 'buildParamKeys must include attestation'); + }); + + it('AttestationPayload codec requires all four fields', function () { + const valid = { + signature: 'sig', + credentialId: 'cred-id', + clientDataJSON: 'client-data', + authenticatorData: 'auth-data', + }; + assert.strictEqual(AttestationPayload.is(valid), true); + assert.strictEqual(AttestationPayload.is({ ...valid, signature: undefined }), false); + }); }); diff --git a/modules/sdk-core/test/unit/bitgo/wallet/SendTransactionRequest.ts b/modules/sdk-core/test/unit/bitgo/wallet/SendTransactionRequest.ts index c1030ff859..de94f275b1 100644 --- a/modules/sdk-core/test/unit/bitgo/wallet/SendTransactionRequest.ts +++ b/modules/sdk-core/test/unit/bitgo/wallet/SendTransactionRequest.ts @@ -1,5 +1,7 @@ import * as assert from 'assert'; +import * as t from 'io-ts'; import { TxSendBody } from '@bitgo/public-types'; +import { AttestationPayload } from '../../../../src/bitgo/wallet/BuildParams'; describe('SendTransactionRequest', function () { it('enforces codec', function () { @@ -24,4 +26,31 @@ describe('SendTransactionRequest', function () { addressType: 'p2sh', }); }); + + it('TxSendBody alone drops attestation (upstream codec has no such field yet — TODO(WCN-541))', function () { + assert.deepStrictEqual( + TxSendBody.encode({ + txHex: '00', + attestation: { signature: 'sig', credentialId: 'c', clientDataJSON: 'cd', authenticatorData: 'ad' }, + } as any), + { txHex: '00' } + ); + }); + + it('the local intersection used by wallet.sendTransaction/initiateTransaction preserves attestation', function () { + // Mirrors the codec built inline in Wallet#sendTransaction/#initiateTransaction (WCN-539): + // TxSendBody is `t.exact` and strips unknown keys, so attestation is re-added via a sibling + // t.partial in the same intersection until @bitgo/public-types declares it upstream. + // + // Note: by the time this codec runs, the caller has already done + // `_.pick(params, whitelistedSendParams)`, so the object passed to `.encode()` never carries + // arbitrary unknown keys in production — this test reflects that, not raw request bodies. + const attestation = { signature: 'sig', credentialId: 'c', clientDataJSON: 'cd', authenticatorData: 'ad' }; + const sendBodyWithAttestation = t.intersection([TxSendBody, t.partial({ attestation: AttestationPayload })]); + + assert.deepStrictEqual(sendBodyWithAttestation.encode({ txHex: '00', attestation } as any), { + txHex: '00', + attestation, + }); + }); }); From d17616f2551a60720dc27e49cdae018352682b9b Mon Sep 17 00:00:00 2001 From: Wayne Wen Date: Fri, 10 Jul 2026 13:12:25 -0700 Subject: [PATCH 2/2] feat(sdk-core): bump public-types to native attestation support @bitgo/public-types@6.43.0 now declares `attestation` on TxSendBody upstream (WCN-539), so drop the local t.intersection/whitelist workaround in wallet.ts's sendTransaction/initiateTransaction and simplify the test that documented the old gap. Ticket: WCN-539 --- modules/abstract-lightning/package.json | 2 +- modules/bitgo/package.json | 2 +- modules/express/package.json | 2 +- modules/sdk-coin-flrp/package.json | 2 +- modules/sdk-coin-sol/package.json | 2 +- modules/sdk-core/package.json | 2 +- .../sdk-core/src/bitgo/wallet/BuildParams.ts | 10 +++++--- modules/sdk-core/src/bitgo/wallet/wallet.ts | 14 ++++------- .../bitgo/wallet/SendTransactionRequest.ts | 24 ++----------------- yarn.lock | 8 +++---- 10 files changed, 23 insertions(+), 45 deletions(-) diff --git a/modules/abstract-lightning/package.json b/modules/abstract-lightning/package.json index b3cb982499..fd6d1394ea 100644 --- a/modules/abstract-lightning/package.json +++ b/modules/abstract-lightning/package.json @@ -39,7 +39,7 @@ ] }, "dependencies": { - "@bitgo/public-types": "6.41.0", + "@bitgo/public-types": "6.43.0", "@bitgo/sdk-core": "^38.1.0", "@bitgo/statics": "^58.55.0", "@bitgo/utxo-lib": "^11.24.0", diff --git a/modules/bitgo/package.json b/modules/bitgo/package.json index fcded25764..c589558398 100644 --- a/modules/bitgo/package.json +++ b/modules/bitgo/package.json @@ -141,7 +141,7 @@ "superagent": "^9.0.1" }, "devDependencies": { - "@bitgo/public-types": "6.41.0", + "@bitgo/public-types": "6.43.0", "@bitgo/sdk-opensslbytes": "^2.1.0", "@bitgo/sdk-test": "^9.1.58", "@openpgp/web-stream-tools": "0.0.14", diff --git a/modules/express/package.json b/modules/express/package.json index 12dc122ba0..95e8b64108 100644 --- a/modules/express/package.json +++ b/modules/express/package.json @@ -60,7 +60,7 @@ "superagent": "^9.0.1" }, "devDependencies": { - "@bitgo/public-types": "6.41.0", + "@bitgo/public-types": "6.43.0", "@bitgo/sdk-lib-mpc": "^10.15.0", "@bitgo/sdk-test": "^9.1.58", "@types/argparse": "^1.0.36", diff --git a/modules/sdk-coin-flrp/package.json b/modules/sdk-coin-flrp/package.json index cf0cc3e72e..a030d93ff1 100644 --- a/modules/sdk-coin-flrp/package.json +++ b/modules/sdk-coin-flrp/package.json @@ -48,7 +48,7 @@ "nock": "^13.3.1" }, "dependencies": { - "@bitgo/public-types": "6.41.0", + "@bitgo/public-types": "6.43.0", "@bitgo/sdk-core": "^38.1.0", "@bitgo/secp256k1": "^1.11.0", "@bitgo/statics": "^58.55.0", diff --git a/modules/sdk-coin-sol/package.json b/modules/sdk-coin-sol/package.json index 04aaf213d6..6d3293a3bb 100644 --- a/modules/sdk-coin-sol/package.json +++ b/modules/sdk-coin-sol/package.json @@ -57,7 +57,7 @@ }, "dependencies": { "@bitgo/logger": "^1.4.0", - "@bitgo/public-types": "6.41.0", + "@bitgo/public-types": "6.43.0", "@bitgo/sdk-core": "^38.1.0", "@bitgo/sdk-lib-mpc": "^10.15.0", "@bitgo/statics": "^58.55.0", diff --git a/modules/sdk-core/package.json b/modules/sdk-core/package.json index f9431f139c..b435230407 100644 --- a/modules/sdk-core/package.json +++ b/modules/sdk-core/package.json @@ -40,7 +40,7 @@ ] }, "dependencies": { - "@bitgo/public-types": "6.41.0", + "@bitgo/public-types": "6.43.0", "@bitgo/sdk-lib-mpc": "^10.15.0", "@bitgo/secp256k1": "^1.11.0", "@bitgo/sjcl": "^1.1.0", diff --git a/modules/sdk-core/src/bitgo/wallet/BuildParams.ts b/modules/sdk-core/src/bitgo/wallet/BuildParams.ts index 785d98fbf1..7e9fea5f5f 100644 --- a/modules/sdk-core/src/bitgo/wallet/BuildParams.ts +++ b/modules/sdk-core/src/bitgo/wallet/BuildParams.ts @@ -68,9 +68,13 @@ export const BuildParamsOffchain = t.partial({ * WebAuthn attestation proving a passkey user signed off on this withdrawal intent. * Pure pass-through — the SDK does not validate or interpret this payload. * - * TODO(WCN-541): move this codec to @bitgo/public-types as the shared AttestationPayload - * and add it to the canonical TxSendBody/BuildParams codecs there; this local copy only - * covers the multisig /tx/build, /tx/send, and /tx/initiate paths. + * @bitgo/public-types' TxSendBody now declares this field natively (WCN-539), so /tx/send and + * /tx/initiate no longer need a local copy. This one remains for BuildParams (custodial + * /tx/build), which has no upstream equivalent yet. + * + * TODO(WCN-541): add attestation pass-through for MPC (/txrequests, /signatureshares) and + * /pendingapprovals — see the TODO(WCN-541) markers in baseTSSUtils.ts, common.ts, and + * pendingApproval.ts. */ export const AttestationPayload = t.type({ signature: t.string, diff --git a/modules/sdk-core/src/bitgo/wallet/wallet.ts b/modules/sdk-core/src/bitgo/wallet/wallet.ts index 983c9d20c2..a8c1952cf5 100644 --- a/modules/sdk-core/src/bitgo/wallet/wallet.ts +++ b/modules/sdk-core/src/bitgo/wallet/wallet.ts @@ -56,7 +56,7 @@ import { txParamsFromIntent } from '../utils/tss/baseTSSUtils'; import { EcdsaMPCv2Utils, EcdsaUtils } from '../utils/tss/ecdsa'; import EddsaUtils, { EddsaMPCv2Utils } from '../utils/tss/eddsa'; import { getTxRequestApiVersion, validateTxRequestApiVersion } from '../utils/txRequest'; -import { buildParamKeys, BuildParams, AttestationPayload } from './BuildParams'; +import { buildParamKeys, BuildParams } from './BuildParams'; import { AccelerateTransactionOptions, AddressesByBalanceOptions, @@ -143,9 +143,7 @@ const debug = require('debug')('bitgo:v2:wallet'); type ManageUnspents = 'consolidate' | 'fanout'; -// TODO(WCN-541): 'attestation' is appended locally because @bitgo/public-types' TxSendBody -// codec doesn't declare it yet. Once TxSendBody adds it upstream, drop this local addition. -const whitelistedSendParams = [...TxSendBody.type.types.flatMap((t) => Object.keys(t.props)), 'attestation']; +const whitelistedSendParams = TxSendBody.type.types.flatMap((t) => Object.keys(t.props)); export enum ManageUnspentsOptions { BUILD_ONLY, @@ -5066,13 +5064,10 @@ export class Wallet implements IWallet { const whitelistedParams = this.baseCoin.preprocessBuildParams(_.pick(params, whitelistedSendParams)); const reqTracer = reqId || new RequestTracer(); this.bitgo.setRequestTracer(reqTracer); - // TODO(WCN-541): attestation is added to this local intersection because @bitgo/public-types' - // TxSendBody codec (t.exact) doesn't declare it yet, and t.exact strips undeclared keys on - // encode. Once TxSendBody adds it upstream, drop `attestation` from this local partial. return postWithCodec( this.bitgo, this.baseCoin.url('/wallet/' + this.id() + '/tx/send'), - t.intersection([TxSendBody, t.partial({ locktime: t.number, attestation: AttestationPayload })]), + t.intersection([TxSendBody, t.partial({ locktime: t.number })]), whitelistedParams ).result(); } @@ -5084,11 +5079,10 @@ export class Wallet implements IWallet { const whitelistedParams = this.baseCoin.preprocessBuildParams(_.pick(params, whitelistedSendParams)); const reqTracer = reqId || new RequestTracer(); this.bitgo.setRequestTracer(reqTracer); - // TODO(WCN-541): see sendTransaction — same local-codec workaround for attestation pass-through. return postWithCodec( this.bitgo, this.baseCoin.url('/wallet/' + this.id() + '/tx/initiate'), - t.intersection([TxSendBody, t.partial({ attestation: AttestationPayload })]), + TxSendBody, whitelistedParams ).result(); } diff --git a/modules/sdk-core/test/unit/bitgo/wallet/SendTransactionRequest.ts b/modules/sdk-core/test/unit/bitgo/wallet/SendTransactionRequest.ts index de94f275b1..12e3b09906 100644 --- a/modules/sdk-core/test/unit/bitgo/wallet/SendTransactionRequest.ts +++ b/modules/sdk-core/test/unit/bitgo/wallet/SendTransactionRequest.ts @@ -1,7 +1,5 @@ import * as assert from 'assert'; -import * as t from 'io-ts'; import { TxSendBody } from '@bitgo/public-types'; -import { AttestationPayload } from '../../../../src/bitgo/wallet/BuildParams'; describe('SendTransactionRequest', function () { it('enforces codec', function () { @@ -27,28 +25,10 @@ describe('SendTransactionRequest', function () { }); }); - it('TxSendBody alone drops attestation (upstream codec has no such field yet — TODO(WCN-541))', function () { - assert.deepStrictEqual( - TxSendBody.encode({ - txHex: '00', - attestation: { signature: 'sig', credentialId: 'c', clientDataJSON: 'cd', authenticatorData: 'ad' }, - } as any), - { txHex: '00' } - ); - }); - - it('the local intersection used by wallet.sendTransaction/initiateTransaction preserves attestation', function () { - // Mirrors the codec built inline in Wallet#sendTransaction/#initiateTransaction (WCN-539): - // TxSendBody is `t.exact` and strips unknown keys, so attestation is re-added via a sibling - // t.partial in the same intersection until @bitgo/public-types declares it upstream. - // - // Note: by the time this codec runs, the caller has already done - // `_.pick(params, whitelistedSendParams)`, so the object passed to `.encode()` never carries - // arbitrary unknown keys in production — this test reflects that, not raw request bodies. + it('preserves attestation (WCN-539: @bitgo/public-types TxSendBody declares it natively)', function () { const attestation = { signature: 'sig', credentialId: 'c', clientDataJSON: 'cd', authenticatorData: 'ad' }; - const sendBodyWithAttestation = t.intersection([TxSendBody, t.partial({ attestation: AttestationPayload })]); - assert.deepStrictEqual(sendBodyWithAttestation.encode({ txHex: '00', attestation } as any), { + assert.deepStrictEqual(TxSendBody.encode({ txHex: '00', attestation } as any), { txHex: '00', attestation, }); diff --git a/yarn.lock b/yarn.lock index 768a08940c..23d7ac50a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -997,10 +997,10 @@ monocle-ts "^2.3.13" newtype-ts "^0.3.5" -"@bitgo/public-types@6.41.0": - version "6.41.0" - resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-6.41.0.tgz#853d3f0ab178c6774054f19ebc3fcd49729bef71" - integrity sha512-ZWVG1C9zC3vHFZ5/ZkVJKejEJhI+80hQCMCrIDbwO4iFI/xMYCzZLogN7+b+1Fd91flASj69Ln64Np+2h8wWmA== +"@bitgo/public-types@6.43.0": + version "6.43.0" + resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-6.43.0.tgz#3d749f011ae7cad1c992ccc49c7b9cc24dbc5e1a" + integrity sha512-aYzRp7IH/Xbyi8/CzlYDiPpJmtQN0BlJGanqupDj4YTMJ9UjwIJLaUjOtJuVTT+ZrChcgdDZgajnmPDdPV2J1w== dependencies: fp-ts "^2.0.0" io-ts "npm:@bitgo-forks/io-ts@2.1.4"