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
29 changes: 29 additions & 0 deletions modules/statics/src/coins/ofcCoins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import {
tofcSuiToken,
ofcTempoToken,
tofcTempoToken,
ofcAdaToken,
tofcAdaToken,
} from '../ofc';
import { UnderlyingAsset, CoinKind, CoinFeature } from '../base';

Expand Down Expand Up @@ -4166,4 +4168,31 @@ export const ofcCoins = [
UnderlyingAsset.HOODETH,
CoinKind.CRYPTO
),
// ADA OFC tokens
ofcAdaToken('227d98e7-6397-45a9-acbe-c3d48fca1a7b', 'ofcada:night', 'NIGHT Token', 6, UnderlyingAsset['ada:night']),
ofcAdaToken('b002bfaa-43e8-41c8-9a3d-3d3fc64af866', 'ofcada:min', 'Minswap', 6, UnderlyingAsset['ada:min']),
ofcAdaToken('145f9663-990c-4e07-9229-820155e12db7', 'ofcada:snek', 'Snek', 0, UnderlyingAsset['ada:snek']),
ofcAdaToken('192b99ce-3dfb-46f9-a53c-94f54732c779', 'ofcada:iag', 'IAGON', 6, UnderlyingAsset['ada:iag']),
ofcAdaToken('af90c0c1-d0ab-4480-8f3e-480eea0f1368', 'ofcada:djed', 'Djed USD', 6, UnderlyingAsset['ada:djed']),
ofcAdaToken(
'9a4635c0-96e1-4343-aac4-bcb8c0a589de',
'ofcada:usda',
'Anzens USDA Stablecoin',
6,
UnderlyingAsset['ada:usda']
),
ofcAdaToken(
'6bde5053-4681-4bd5-9e6c-defae2e26291',
'ofcada:wmtx',
'World Mobile Token X',
6,
UnderlyingAsset['ada:wmtx']
),
tofcAdaToken(
'1f4e7747-f825-4107-a71f-766e847d557b',
'ofctada:water',
'Test ADA Water Token',
0,
UnderlyingAsset['tada:water']
),
];
108 changes: 108 additions & 0 deletions modules/statics/src/ofc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2618,3 +2618,111 @@ export function tofcTempoToken(
})
);
}

/**
* Factory function for ofc ada token instances.
*
* @param id uuid v4
* @param name unique identifier of the coin
* @param fullName Complete human-readable name of the coin
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
* @param prefix? Optional coin prefix. Defaults to empty string
* @param suffix? Optional coin suffix. Defaults to coin name.
* @param isToken? Whether or not this account coin is a token of another coin
* @param primaryKeyCurve The elliptic curve for this chain/token
*/
export function ofcAdaToken(
id: string,
name: string,
fullName: string,
decimalPlaces: number,
asset: UnderlyingAsset,
kind: CoinKind = CoinKind.CRYPTO,
features: CoinFeature[] = [...OfcCoin.DEFAULT_FEATURES, CoinFeature.REQUIRES_RESERVE],
prefix = '',
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
network: OfcNetwork = Networks.main.ofc,
isToken = true,
addressCoin = 'ada',
primaryKeyCurve: KeyCurve = KeyCurve.Ed25519
) {
const filteredFeatures = getFilteredFeatures(suffix);
if (filteredFeatures.length > 0) {
features = filteredFeatures;
}
return Object.freeze(
new OfcCoin({
id,
name,
fullName,
network,
prefix,
suffix,
features,
decimalPlaces,
isToken,
asset,
kind,
addressCoin,
primaryKeyCurve,
baseUnit: BaseUnit.ADA,
})
);
}

/**
* Factory function for testnet ofc ada token instances.
*
* @param id uuid v4
* @param name unique identifier of the coin
* @param fullName Complete human-readable name of the coin
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
* @param prefix? Optional coin prefix. Defaults to empty string
* @param suffix? Optional coin suffix. Defaults to coin name.
* @param isToken? Whether or not this account coin is a token of another coin
* @param primaryKeyCurve The elliptic curve for this chain/token
*/
export function tofcAdaToken(
id: string,
name: string,
fullName: string,
decimalPlaces: number,
asset: UnderlyingAsset,
kind: CoinKind = CoinKind.CRYPTO,
features: CoinFeature[] = [...OfcCoin.DEFAULT_FEATURES, CoinFeature.REQUIRES_RESERVE],
prefix = '',
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
network: OfcNetwork = Networks.test.ofc,
isToken = true,
addressCoin = 'tada',
primaryKeyCurve: KeyCurve = KeyCurve.Ed25519
) {
const filteredFeatures = getFilteredFeatures(suffix);
if (filteredFeatures.length > 0) {
features = filteredFeatures;
}
return Object.freeze(
new OfcCoin({
id,
name,
fullName,
network,
prefix,
suffix,
features,
decimalPlaces,
isToken,
asset,
kind,
addressCoin,
primaryKeyCurve,
baseUnit: BaseUnit.ADA,
})
);
}