Skip to content

Commit 3b37bf1

Browse files
committed
feat: added token enablement config for canton
Ticket: COIN-6501
1 parent 1cb288e commit 3b37bf1

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

modules/sdk-coin-canton/src/canton.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
InvalidAddressError,
2121
extractCommonKeychain,
2222
EDDSAMethods,
23+
TokenEnablementConfig,
2324
} from '@bitgo/sdk-core';
2425
import { auditEddsaPrivateKey } from '@bitgo/sdk-lib-mpc';
2526
import { BaseCoin as StaticsBaseCoin, coins } from '@bitgo/statics';
@@ -111,6 +112,7 @@ export class Canton extends BaseCoin {
111112
case TransactionType.TransferAccept:
112113
case TransactionType.TransferReject:
113114
case TransactionType.TransferAcknowledge:
115+
case TransactionType.OneStepPreApproval:
114116
// There is no input for these type of transactions, so always return true.
115117
return true;
116118
case TransactionType.Send:
@@ -200,6 +202,14 @@ export class Canton extends BaseCoin {
200202
return utils.isValidAddress(address);
201203
}
202204

205+
/** @inheritDoc */
206+
getTokenEnablementConfig(): TokenEnablementConfig {
207+
return {
208+
requiresTokenEnablement: true,
209+
supportsMultipleTokenEnablements: false,
210+
};
211+
}
212+
203213
getAddressFromPublicKey(publicKeyHex: string): string {
204214
const publicKeyBase64 = Buffer.from(publicKeyHex, 'hex').toString('base64');
205215
return utils.getAddressFromPublicKey(publicKeyBase64);

modules/statics/src/base.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,11 @@ export enum CoinFeature {
491491
* This coin supports alternative address identifier format
492492
*/
493493
ALTERNATIVE_ADDRESS_IDENTIFIER = 'alternative-address-identifier',
494+
495+
/**
496+
* This coin supports one-step deposit
497+
*/
498+
SUPPORTS_ONE_STEP_DEPOSIT = 'supports-one-step-deposit',
494499
}
495500

496501
/**

modules/statics/src/coinFeatures.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,4 +711,5 @@ export const CANTON_FEATURES = [
711711
CoinFeature.CUSTODY_BITGO_KOREA,
712712
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
713713
CoinFeature.CUSTODY_BITGO_FRANKFURT,
714+
CoinFeature.SUPPORTS_ONE_STEP_DEPOSIT,
714715
];

0 commit comments

Comments
 (0)