Skip to content

Commit 93a0a62

Browse files
authored
Merge pull request #8386 from BitGo/CHALO-71-go-account-onboarding
feat(statics): add OFC assets for WisdomTree SOL tokens and Canton tokens
2 parents 9f531f2 + f95f1a3 commit 93a0a62

2 files changed

Lines changed: 256 additions & 0 deletions

File tree

modules/statics/src/coins/ofcCoins.ts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ import {
4444
tofcTempoToken,
4545
ofcAdaToken,
4646
tofcAdaToken,
47+
ofcCantonToken,
48+
tofcCantonToken,
4749
} from '../ofc';
4850
import { UnderlyingAsset, CoinKind, CoinFeature } from '../base';
4951

@@ -4147,6 +4149,148 @@ export const ofcCoins = [
41474149
ofcsolToken('d3e4f5a6-7b8c-4d9e-81f2-3a4b5c6d7e8f', 'ofcsol:portals', 'Portals', 9, UnderlyingAsset['sol:portals']),
41484150
ofcsolToken('b26ae13f-cc3b-43d9-8c04-a0a2b1fa63bc', 'ofcsol:bmt', 'Bubblemaps', 9, UnderlyingAsset['sol:bmt']),
41494151
ofcsolToken('758f0872-89bf-4e11-a11f-155b408ca2bf', 'ofcsol:huma', 'Huma Finance', 6, UnderlyingAsset['sol:huma']),
4152+
// New WisdomTree SOL OFC tokens
4153+
ofcsolToken(
4154+
'6e7085c2-d21f-4033-a088-3cd786ce8e3f',
4155+
'ofcsol:crdt',
4156+
'WisdomTree Private Credit and Alternative Income Digital Fund',
4157+
9,
4158+
UnderlyingAsset['sol:crdt']
4159+
),
4160+
ofcsolToken(
4161+
'9bc0a2e0-5b15-43d7-ae80-72e8827f4731',
4162+
'ofcsol:epxc',
4163+
'WisdomTree Equity Premium Income Digital Fund',
4164+
9,
4165+
UnderlyingAsset['sol:epxc']
4166+
),
4167+
ofcsolToken(
4168+
'900978ce-2da0-41a4-9ed3-367ffede1804',
4169+
'ofcsol:eqtyx',
4170+
'WisdomTree Siegel Global Equity Digital Fund',
4171+
9,
4172+
UnderlyingAsset['sol:eqtyx']
4173+
),
4174+
ofcsolToken(
4175+
'88613b29-129e-4976-8581-91298f0cf16d',
4176+
'ofcsol:flttx',
4177+
'WisdomTree Floating Rate Treasury Digital Fund',
4178+
9,
4179+
UnderlyingAsset['sol:flttx']
4180+
),
4181+
ofcsolToken(
4182+
'c96e2ba6-1bb7-4ab1-aafb-b1bd81cb169c',
4183+
'ofcsol:lngvx',
4184+
'WisdomTree Siegel Longevity Digital Fund',
4185+
9,
4186+
UnderlyingAsset['sol:lngvx']
4187+
),
4188+
ofcsolToken(
4189+
'f9704b9c-15b9-40a3-a60d-0c14457ed7f6',
4190+
'ofcsol:modrx',
4191+
'WisdomTree Siegel Moderate Digital Fund',
4192+
9,
4193+
UnderlyingAsset['sol:modrx']
4194+
),
4195+
ofcsolToken(
4196+
'ac5247ac-b9ad-4996-bcf5-2f22543f2638',
4197+
'ofcsol:spxux',
4198+
'WisdomTree 500 Digital Fund',
4199+
9,
4200+
UnderlyingAsset['sol:spxux']
4201+
),
4202+
ofcsolToken(
4203+
'01818239-50ac-4349-b7ff-ad010ee039cc',
4204+
'ofcsol:techx',
4205+
'WisdomTree Technology & Innovation 100 Digital Fund',
4206+
9,
4207+
UnderlyingAsset['sol:techx']
4208+
),
4209+
ofcsolToken(
4210+
'640fadb2-e5e5-477a-b51d-cb551a2738de',
4211+
'ofcsol:tipsx',
4212+
'WisdomTree TIPS Digital Fund',
4213+
9,
4214+
UnderlyingAsset['sol:tipsx']
4215+
),
4216+
ofcsolToken(
4217+
'0b4ae2c1-3ba6-47ce-92ee-bdfaa3c8d1ad',
4218+
'ofcsol:wtgxx',
4219+
'WisdomTree Government Money Market Digital Fund',
4220+
9,
4221+
UnderlyingAsset['sol:wtgxx']
4222+
),
4223+
ofcsolToken(
4224+
'cf2cfda1-4ff0-441e-87c5-1d0fb1fdcb20',
4225+
'ofcsol:wtlgx',
4226+
'WisdomTree Long Term Treasury Digital Fund',
4227+
9,
4228+
UnderlyingAsset['sol:wtlgx']
4229+
),
4230+
ofcsolToken(
4231+
'bc89ce03-0443-47b9-af9f-17b16ae1bfb3',
4232+
'ofcsol:wtstx',
4233+
'WisdomTree 7-10 Year Treasury Digital Fund',
4234+
9,
4235+
UnderlyingAsset['sol:wtstx']
4236+
),
4237+
ofcsolToken(
4238+
'4cc36901-5152-4909-ac41-033a867e07b5',
4239+
'ofcsol:wttsx',
4240+
'WisdomTree 3-7 Year Treasury Digital Fund',
4241+
9,
4242+
UnderlyingAsset['sol:wttsx']
4243+
),
4244+
ofcsolToken(
4245+
'01f235c4-e5ba-4936-83cc-067f1b21d490',
4246+
'ofcsol:wtsix',
4247+
'WisdomTree Short-Duration Income Digital Fund',
4248+
9,
4249+
UnderlyingAsset['sol:wtsix']
4250+
),
4251+
ofcsolToken(
4252+
'4c4fe20e-7072-4804-8e33-096b1f54eff4',
4253+
'ofcsol:wtsyx',
4254+
'WisdomTree Short-Term Treasury Digital Fund',
4255+
9,
4256+
UnderlyingAsset['sol:wtsyx']
4257+
),
4258+
// New Canton OFC tokens
4259+
ofcCantonToken(
4260+
'02ab6bd2-83e6-46fc-bfd7-93b8be125648',
4261+
'ofccanton:usdcx',
4262+
'USDCx (Canton)',
4263+
10,
4264+
UnderlyingAsset['canton:usdcx']
4265+
),
4266+
ofcCantonToken(
4267+
'9321cbcd-4bcd-41bf-b03f-402152ca755a',
4268+
'ofccanton:cbtc',
4269+
'CBTC (Canton)',
4270+
10,
4271+
UnderlyingAsset['canton:cbtc']
4272+
),
4273+
ofcCantonToken(
4274+
'6630d2c7-f691-4780-bc39-b6370143841b',
4275+
'ofccanton:usdxlr',
4276+
'USDXLR (Canton)',
4277+
10,
4278+
UnderlyingAsset['canton:usdxlr']
4279+
),
4280+
tofcCantonToken(
4281+
'd7297535-c1d4-429d-b3c5-d36351b110e5',
4282+
'ofctcanton:testcoin1',
4283+
'Test Coin 1',
4284+
10,
4285+
UnderlyingAsset['tcanton:testcoin1']
4286+
),
4287+
tofcCantonToken(
4288+
'991e1f7b-7efb-4d0c-83da-4ce3f5466a8b',
4289+
'ofctcanton:testtoken',
4290+
'Test Token',
4291+
10,
4292+
UnderlyingAsset['tcanton:testtoken']
4293+
),
41504294
// New SUI OFC token
41514295
ofcSuiToken('1e01eb3d-2573-4662-aa5e-4c390e4a9b38', 'ofcsui:dmc', 'DeLorean', 9, UnderlyingAsset['sui:dmc']),
41524296
ofcSuiToken('e4f5a6b7-8c9d-4eaf-82a3-4b5c6d7e8f9a', 'ofcsui:mmt', 'Momentum', 9, UnderlyingAsset['sui:mmt']),

modules/statics/src/ofc.ts

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,3 +2726,115 @@ export function tofcAdaToken(
27262726
})
27272727
);
27282728
}
2729+
2730+
/**
2731+
* Factory function for ofc canton token instances.
2732+
*
2733+
* @param id uuid v4
2734+
* @param name unique identifier of the coin
2735+
* @param fullName Complete human-readable name of the coin
2736+
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
2737+
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2738+
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
2739+
* @param features Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
2740+
* @param prefix Optional coin prefix. Defaults to empty string
2741+
* @param suffix Optional coin suffix. Defaults to coin name.
2742+
* @param network Network object for this coin
2743+
* @param isToken Whether or not this account coin is a token of another coin
2744+
* @param addressCoin
2745+
* @param primaryKeyCurve The elliptic curve for this chain/token
2746+
*/
2747+
export function ofcCantonToken(
2748+
id: string,
2749+
name: string,
2750+
fullName: string,
2751+
decimalPlaces: number,
2752+
asset: UnderlyingAsset,
2753+
kind: CoinKind = CoinKind.CRYPTO,
2754+
features: CoinFeature[] = OfcCoin.DEFAULT_FEATURES,
2755+
prefix = '',
2756+
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
2757+
network: OfcNetwork = Networks.main.ofc,
2758+
isToken = true,
2759+
addressCoin = 'canton',
2760+
primaryKeyCurve: KeyCurve = KeyCurve.Ed25519
2761+
) {
2762+
const filteredFeatures = getFilteredFeatures(suffix);
2763+
if (filteredFeatures.length > 0) {
2764+
features = filteredFeatures;
2765+
}
2766+
return Object.freeze(
2767+
new OfcCoin({
2768+
id,
2769+
name,
2770+
fullName,
2771+
network,
2772+
prefix,
2773+
suffix,
2774+
features,
2775+
decimalPlaces,
2776+
isToken,
2777+
asset,
2778+
kind,
2779+
addressCoin,
2780+
primaryKeyCurve,
2781+
baseUnit: BaseUnit.CANTON,
2782+
})
2783+
);
2784+
}
2785+
2786+
/**
2787+
* Factory function for testnet ofc canton token instances.
2788+
*
2789+
* @param id uuid v4
2790+
* @param name unique identifier of the coin
2791+
* @param fullName Complete human-readable name of the coin
2792+
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
2793+
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2794+
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
2795+
* @param features Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
2796+
* @param prefix Optional coin prefix. Defaults to empty string
2797+
* @param suffix Optional coin suffix. Defaults to coin name.
2798+
* @param network Network object for this coin
2799+
* @param isToken Whether or not this account coin is a token of another coin
2800+
* @param addressCoin
2801+
* @param primaryKeyCurve The elliptic curve for this chain/token
2802+
*/
2803+
export function tofcCantonToken(
2804+
id: string,
2805+
name: string,
2806+
fullName: string,
2807+
decimalPlaces: number,
2808+
asset: UnderlyingAsset,
2809+
kind: CoinKind = CoinKind.CRYPTO,
2810+
features: CoinFeature[] = OfcCoin.DEFAULT_FEATURES,
2811+
prefix = '',
2812+
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
2813+
network: OfcNetwork = Networks.test.ofc,
2814+
isToken = true,
2815+
addressCoin = 'tcanton',
2816+
primaryKeyCurve: KeyCurve = KeyCurve.Ed25519
2817+
) {
2818+
const filteredFeatures = getFilteredFeatures(suffix);
2819+
if (filteredFeatures.length > 0) {
2820+
features = filteredFeatures;
2821+
}
2822+
return Object.freeze(
2823+
new OfcCoin({
2824+
id,
2825+
name,
2826+
fullName,
2827+
network,
2828+
prefix,
2829+
suffix,
2830+
features,
2831+
decimalPlaces,
2832+
isToken,
2833+
asset,
2834+
kind,
2835+
addressCoin,
2836+
primaryKeyCurve,
2837+
baseUnit: BaseUnit.CANTON,
2838+
})
2839+
);
2840+
}

0 commit comments

Comments
 (0)