diff --git a/modules/sdk-coin-canton/src/cantonToken.ts b/modules/sdk-coin-canton/src/cantonToken.ts index 085f9cfc2d..95f998039d 100644 --- a/modules/sdk-coin-canton/src/cantonToken.ts +++ b/modules/sdk-coin-canton/src/cantonToken.ts @@ -39,12 +39,8 @@ export class CantonToken extends Canton { return this.tokenConfig.baseUrl; } - get admin(): string { - return this.tokenConfig.admin; - } - - get assetName(): string { - return this.tokenConfig.assetName; + get contractAddress(): string { + return this.tokenConfig.contractAddress; } get decimalPlaces(): number { diff --git a/modules/statics/src/account.ts b/modules/statics/src/account.ts index 362204e821..42e6419c32 100644 --- a/modules/statics/src/account.ts +++ b/modules/statics/src/account.ts @@ -185,8 +185,7 @@ export interface AdaTokenConstructorOptions extends AccountConstructorOptions { export interface CantonTokenConstructorOptions extends AccountConstructorOptions { baseUrl: string; - admin: string; - assetName: string; + contractAddress: string; } export interface ContractAddress extends String { @@ -789,15 +788,13 @@ export class AdaToken extends AccountCoinToken { */ export class CantonToken extends AccountCoinToken { public baseUrl: string; - public admin: string; - public assetName: string; + public contractAddress: string; constructor(options: CantonTokenConstructorOptions) { super({ ...options, }); this.baseUrl = options.baseUrl; - this.admin = options.admin; - this.assetName = options.assetName; + this.contractAddress = options.contractAddress; } } @@ -4207,8 +4204,7 @@ export function tjettonToken( * @param fullName Complete human-readable name of the token * @param decimalPlaces Number of decimal places this token supports (divisibility exponent) * @param baseUrl token standard base url, ref: https://docs.digitalasset.com/utilities/devnet/overview/registry-user-guide/token-standard.html#token-standard-endpoints - * @param assetName the token instrument name - * @param admin the instrument admin for this token + * @param contractAddress the contract address of the token in the form `instrumentAdmin:instrumentId` * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin. * @param features Features of this coin. Defaults to CANTON_FEATURES * @param prefix Optional token prefix. Defaults to empty string @@ -4222,8 +4218,7 @@ export function cantonToken( fullName: string, decimalPlaces: number, baseUrl: string, - assetName: string, - admin: string, + contractAddress: string, asset: UnderlyingAsset, features: CoinFeature[] = CANTON_TOKEN_FEATURES, prefix = '', @@ -4239,8 +4234,7 @@ export function cantonToken( decimalPlaces, network, baseUrl, - assetName, - admin, + contractAddress, asset, features, prefix, @@ -4260,8 +4254,7 @@ export function cantonToken( * @param fullName Complete human-readable name of the token * @param decimalPlaces Number of decimal places this token supports (divisibility exponent) * @param baseUrl token standard base url - * @param assetName the token instrument name - * @param admin the instrument admin for this token + * @param contractAddress the contract address of the token in the form `instrumentAdmin:instrumentId` * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin. * @param features Features of this coin. Defaults to the CANTON_FEATURES * @param prefix Optional token prefix. Defaults to empty string @@ -4275,8 +4268,7 @@ export function tcantonToken( fullName: string, decimalPlaces: number, baseUrl: string, - assetName: string, - admin: string, + contractAddress: string, asset: UnderlyingAsset, features: CoinFeature[] = CANTON_TOKEN_FEATURES, prefix = '', @@ -4290,8 +4282,7 @@ export function tcantonToken( fullName, decimalPlaces, baseUrl, - assetName, - admin, + contractAddress, asset, features, prefix, diff --git a/modules/statics/src/base.ts b/modules/statics/src/base.ts index 1f0c316a0d..5e0a7eb003 100644 --- a/modules/statics/src/base.ts +++ b/modules/statics/src/base.ts @@ -3543,6 +3543,10 @@ export enum UnderlyingAsset { 'tcanton:testcoin1' = 'tcanton:testcoin1', 'tcanton:testtoken' = 'tcanton:testtoken', + // Canton mainnet tokens + 'canton:usdcx' = 'canton:usdcx', + 'canton:cbtc' = 'canton:cbtc', + // fiats AED = 'aed', EUR = 'eur', diff --git a/modules/statics/src/coins/cantonTokens.ts b/modules/statics/src/coins/cantonTokens.ts index 6ba78520c5..d6c46bf6a7 100644 --- a/modules/statics/src/coins/cantonTokens.ts +++ b/modules/statics/src/coins/cantonTokens.ts @@ -1,8 +1,28 @@ -import { tcantonToken } from '../account'; +import { cantonToken, tcantonToken } from '../account'; import { UnderlyingAsset } from '../base'; import { CANTON_TOKEN_FEATURES } from '../coinFeatures'; export const cantonTokens = [ + cantonToken( + '0ef822c5-2972-4087-a188-9dd48d132fc9', + 'canton:usdcx', + 'USDCx (Canton)', + 10, + 'https://api.utilities.digitalasset.com/api/token-standard/v0/registrars/', + 'decentralized-usdc-interchain-rep::12208115f1e168dd7e792320be9c4ca720c751a02a3053c7606e1c1cd3dad9bf60ef:USDCx', + UnderlyingAsset['canton:usdcx'], + CANTON_TOKEN_FEATURES + ), + cantonToken( + '76e62c81-5cd2-4e76-9750-cfab7d58f7b2', + 'canton:cbtc', + 'CBTC (Canton)', + 10, + 'https://api.utilities.digitalasset.com/api/token-standard/v0/registrars/', + 'cbtc-network::12205af3b949a04776fc48cdcc05a060f6bda2e470632935f375d1049a8546a3b262:CBTC', + UnderlyingAsset['canton:cbtc'], + CANTON_TOKEN_FEATURES + ), // testnet tokens tcantonToken( '46356790-0ac4-4c3b-8b70-39094106d772', @@ -10,8 +30,7 @@ export const cantonTokens = [ 'Test Coin 1', 10, 'https://api.utilities.digitalasset-dev.com/api/token-standard/v0/registrars/', - 'TestCoin1', - 'auth0_007c65f857f1c3d599cb6df73775::1220d2d732d042c281cee80f483ab80f3cbaa4782860ed5f4dc228ab03dedd2ee8f9', + 'auth0_007c65f857f1c3d599cb6df73775::1220d2d732d042c281cee80f483ab80f3cbaa4782860ed5f4dc228ab03dedd2ee8f9:TestCoin1', UnderlyingAsset['tcanton:testcoin1'], CANTON_TOKEN_FEATURES ), @@ -21,8 +40,7 @@ export const cantonTokens = [ 'Test Token', 10, 'https://api.utilities.digitalasset-dev.com/api/token-standard/v0/registrars/', - 'TestToken', - 'auth0_007c65f857f1c3d599cb6df73775::1220d2d732d042c281cee80f483ab80f3cbaa4782860ed5f4dc228ab03dedd2ee8f9', + 'auth0_007c65f857f1c3d599cb6df73775::1220d2d732d042c281cee80f483ab80f3cbaa4782860ed5f4dc228ab03dedd2ee8f9:TestToken', UnderlyingAsset['tcanton:testtoken'], CANTON_TOKEN_FEATURES ), diff --git a/modules/statics/src/tokenConfig.ts b/modules/statics/src/tokenConfig.ts index 3eb12e18b6..eaa96ab8b7 100644 --- a/modules/statics/src/tokenConfig.ts +++ b/modules/statics/src/tokenConfig.ts @@ -138,8 +138,7 @@ export type Nep141TokenConfig = BaseNetworkConfig & { export type CantonTokenConfig = BaseNetworkConfig & { baseUrl: string; - assetName: string; - admin: string; + contractAddress: string; }; export type VetTokenConfig = BaseNetworkConfig & { @@ -1041,8 +1040,7 @@ function getCantonTokenConfig(coin: CantonToken): CantonTokenConfig { name: coin.fullName, decimalPlaces: coin.decimalPlaces, baseUrl: coin.baseUrl, - admin: coin.admin, - assetName: coin.assetName, + contractAddress: coin.contractAddress, }; } const getFormattedCantonTokens = (customCoinMap = coins) =>