Skip to content

Commit a4e83cc

Browse files
committed
feat(sdk-core): added canton types in tss prebuild flow
Ticket: CHALO-573
1 parent 02f02aa commit a4e83cc

2 files changed

Lines changed: 52 additions & 2 deletions

File tree

modules/sdk-core/src/bitgo/utils/mpcUtils.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,19 @@ export abstract class MpcUtils {
138138
);
139139
}
140140

141-
if (['transferAccept', 'transferReject'].includes(params.intentType) && baseCoin.getFamily() === 'canton') {
141+
if (
142+
['transferAccept', 'transferReject', 'cosignDelegationAccept', 'allocationAllocate'].includes(
143+
params.intentType
144+
) &&
145+
baseCoin.getFamily() === 'canton'
146+
) {
142147
assert(params.txRequestId, `'txRequestId' is required parameter for ${params.intentType} intent`);
143148
}
144149

145-
if (params.intentType === 'transferOfferWithdrawn' && baseCoin.getFamily() === 'canton') {
150+
if (
151+
['transferOfferWithdrawn', 'allocationAllocateWithdrawn'].includes(params.intentType) &&
152+
baseCoin.getFamily() === 'canton'
153+
) {
146154
assert(params.transferOfferId, `'transferOfferId' is required parameter for ${params.intentType} intent`);
147155
}
148156

@@ -181,6 +189,9 @@ export abstract class MpcUtils {
181189
'transferAccept',
182190
'transferReject',
183191
'transferOfferWithdrawn',
192+
'cosignDelegationAccept',
193+
'allocationAllocate',
194+
'allocationAllocateWithdrawn',
184195
'bridgeFunds',
185196
'cantonCommand',
186197
'defi-approve',

modules/sdk-core/src/bitgo/wallet/wallet.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4308,6 +4308,32 @@ export class Wallet implements IWallet {
43084308
);
43094309
break;
43104310
}
4311+
case 'cosignDelegationAccept': {
4312+
txRequest = await this.tssUtils!.prebuildTxWithIntent(
4313+
{
4314+
reqId,
4315+
intentType: 'cosignDelegationAccept',
4316+
txRequestId: params.txRequestId,
4317+
sequenceId: params.txRequestId,
4318+
},
4319+
apiVersion,
4320+
params.preview
4321+
);
4322+
break;
4323+
}
4324+
case 'allocationAllocate': {
4325+
txRequest = await this.tssUtils!.prebuildTxWithIntent(
4326+
{
4327+
reqId,
4328+
intentType: 'allocationAllocate',
4329+
txRequestId: params.txRequestId,
4330+
sequenceId: params.txRequestId,
4331+
},
4332+
apiVersion,
4333+
params.preview
4334+
);
4335+
break;
4336+
}
43114337
case 'transferReject': {
43124338
txRequest = await this.tssUtils!.prebuildTxWithIntent(
43134339
{
@@ -4334,6 +4360,19 @@ export class Wallet implements IWallet {
43344360
);
43354361
break;
43364362
}
4363+
case 'allocationAllocateWithdrawn': {
4364+
txRequest = await this.tssUtils!.prebuildTxWithIntent(
4365+
{
4366+
reqId,
4367+
intentType: 'allocationAllocateWithdrawn',
4368+
transferOfferId: params.transferOfferId,
4369+
sequenceId: params.transferOfferId,
4370+
},
4371+
apiVersion,
4372+
params.preview
4373+
);
4374+
break;
4375+
}
43374376
case 'cantonCommand': {
43384377
if (!params.cantonCommandParams) {
43394378
throw new Error('cantonCommandParams is required for cantonCommand intent');

0 commit comments

Comments
 (0)