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
10 changes: 10 additions & 0 deletions modules/sdk-coin-canton/src/canton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
InvalidAddressError,
extractCommonKeychain,
EDDSAMethods,
TokenEnablementConfig,
} from '@bitgo/sdk-core';
import { auditEddsaPrivateKey } from '@bitgo/sdk-lib-mpc';
import { BaseCoin as StaticsBaseCoin, coins } from '@bitgo/statics';
Expand Down Expand Up @@ -111,6 +112,7 @@ export class Canton extends BaseCoin {
case TransactionType.TransferAccept:
case TransactionType.TransferReject:
case TransactionType.TransferAcknowledge:
case TransactionType.OneStepPreApproval:
// There is no input for these type of transactions, so always return true.
return true;
case TransactionType.Send:
Expand Down Expand Up @@ -200,6 +202,14 @@ export class Canton extends BaseCoin {
return utils.isValidAddress(address);
}

/** @inheritDoc */
getTokenEnablementConfig(): TokenEnablementConfig {
return {
requiresTokenEnablement: true,
supportsMultipleTokenEnablements: false,
};
}

getAddressFromPublicKey(publicKeyHex: string): string {
const publicKeyBase64 = Buffer.from(publicKeyHex, 'hex').toString('base64');
return utils.getAddressFromPublicKey(publicKeyBase64);
Expand Down
5 changes: 5 additions & 0 deletions modules/statics/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,11 @@ export enum CoinFeature {
* This coin supports alternative address identifier format
*/
ALTERNATIVE_ADDRESS_IDENTIFIER = 'alternative-address-identifier',

/**
* This coin supports one-step deposit
*/
SUPPORTS_ONE_STEP_DEPOSIT = 'supports-one-step-deposit',
}

/**
Expand Down
1 change: 1 addition & 0 deletions modules/statics/src/coinFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,4 +711,5 @@ export const CANTON_FEATURES = [
CoinFeature.CUSTODY_BITGO_KOREA,
CoinFeature.CUSTODY_BITGO_EUROPE_APS,
CoinFeature.CUSTODY_BITGO_FRANKFURT,
CoinFeature.SUPPORTS_ONE_STEP_DEPOSIT,
];