diff --git a/modules/sdk-core/src/bitgo/utils/tss/baseTypes.ts b/modules/sdk-core/src/bitgo/utils/tss/baseTypes.ts index 78ee517043..3cb9d8af38 100644 --- a/modules/sdk-core/src/bitgo/utils/tss/baseTypes.ts +++ b/modules/sdk-core/src/bitgo/utils/tss/baseTypes.ts @@ -159,6 +159,7 @@ export interface PrebuildTransactionWithIntentOptions extends IntentOptionsBase lowFeeTxid?: string; custodianTransactionId?: string; receiveAddress?: string; + data?: string; } export interface IntentRecipient { address: { diff --git a/modules/sdk-core/src/bitgo/wallet/wallet.ts b/modules/sdk-core/src/bitgo/wallet/wallet.ts index 749fefe901..a6ee5e6a5e 100644 --- a/modules/sdk-core/src/bitgo/wallet/wallet.ts +++ b/modules/sdk-core/src/bitgo/wallet/wallet.ts @@ -2712,6 +2712,7 @@ export class Wallet implements IWallet { } let txRequest: TxRequest; + console.log(`Got params.type: ${JSON.stringify(params)}`); switch (params.type) { case 'transfer': txRequest = await this.tssUtils!.prebuildTxWithIntent( @@ -2785,6 +2786,24 @@ export class Wallet implements IWallet { params.preview ); break; + case 'ContractCall': + if (!params.data) { + throw new Error(`data is missing in intent: ContractCall`); + } + txRequest = await this.tssUtils!.prebuildTxWithIntent( + { + reqId, + intentType: 'ContractCall', + comment: params.comment, + nonce: params.nonce, + receiveAddress: params.receiveAddress, + feeOptions, + data: `${params.data}`, + }, + apiVersion, + params.preview + ); + break; default: throw new Error(`transaction type not supported: ${params.type}`); }