Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ module.exports = {
'ME-',
'ANT-',
'CGARD-',
'CHALO-',
'#', // Prefix used by GitHub issues
],
},
Expand Down
3 changes: 3 additions & 0 deletions modules/sdk-coin-canton/src/canton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,8 @@ export class Canton extends BaseCoin {
if (params.txRequestId) {
intent.txRequestId = params.txRequestId;
}
if (params.contractId) {
intent.contractId = params.contractId;
}
}
}
5 changes: 5 additions & 0 deletions modules/sdk-core/src/bitgo/utils/mpcUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ export abstract class MpcUtils {
assert(params.txRequestId, `'txRequestId' is required parameter for ${params.intentType} intent`);
}

if (params.intentType === 'transferOfferWithdrawn' && baseCoin.getFamily() === 'canton') {
assert(params.contractId, `'contractId' is required parameter for ${params.intentType} intent`);
}

if (
![
'acceleration',
Expand All @@ -150,6 +154,7 @@ export abstract class MpcUtils {
'customTx',
'transferAccept',
'transferReject',
'transferOfferWithdrawn',
].includes(params.intentType)
) {
assert(params.recipients, `'recipients' is a required parameter for ${params.intentType} intent`);
Expand Down
2 changes: 2 additions & 0 deletions modules/sdk-core/src/bitgo/utils/tss/baseTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export interface PrebuildTransactionWithIntentOptions extends IntentOptionsBase
};
txRequestId?: string;
isTestTransaction?: boolean;
contractId?: string;
}
export interface IntentRecipient {
address: {
Expand Down Expand Up @@ -340,6 +341,7 @@ export interface PopulatedIntent extends PopulatedIntentBase {
aptosCustomTransactionParams?: aptosCustomTransactionParams;
txRequestId?: string;
isTestTransaction?: boolean;
contractId?: string;
}

export type TxRequestState =
Expand Down
1 change: 1 addition & 0 deletions modules/sdk-core/src/bitgo/wallet/iWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export interface PrebuildTransactionOptions {
};
txRequestId?: string;
isTestTransaction?: boolean;
contractId?: string;
}

export interface PrebuildAndSignTransactionOptions extends PrebuildTransactionOptions, WalletSignTransactionOptions {
Expand Down
13 changes: 13 additions & 0 deletions modules/sdk-core/src/bitgo/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3714,6 +3714,19 @@ export class Wallet implements IWallet {
);
break;
}
case 'transferOfferWithdrawn': {
txRequest = await this.tssUtils!.prebuildTxWithIntent(
{
reqId,
intentType: 'transferOfferWithdrawn',
contractId: params.contractId,
sequenceId: params.contractId,
},
apiVersion,
params.preview
);
break;
}
case 'customTx':
txRequest = await this.tssUtils!.prebuildTxWithIntent(
{
Expand Down