Skip to content

Commit 2c01106

Browse files
committed
feat: ofc tokens for vet
Ticket: [COIN-5123]
1 parent 6e91a84 commit 2c01106

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

modules/statics/src/ofc.ts

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,3 +1897,105 @@ export function tofcCoredaoErc20(
18971897
})
18981898
);
18991899
}
1900+
1901+
/**
1902+
* Factory function for ofc vet token instances.
1903+
*
1904+
* @param id uuid v4
1905+
* @param name unique identifier of the coin
1906+
* @param fullName Complete human-readable name of the coin
1907+
* @param network Network object for this coin
1908+
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
1909+
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
1910+
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
1911+
* @param prefix? Optional coin prefix. Defaults to empty string
1912+
* @param suffix? Optional coin suffix. Defaults to coin name.
1913+
* @param isToken? Whether or not this account coin is a token of another coin
1914+
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
1915+
* @param primaryKeyCurve The elliptic curve for this chain/token
1916+
*/
1917+
export function ofcVetToken(
1918+
id: string,
1919+
name: string,
1920+
fullName: string,
1921+
decimalPlaces: number,
1922+
asset: UnderlyingAsset,
1923+
kind: CoinKind = CoinKind.CRYPTO,
1924+
features: CoinFeature[] = OfcCoin.DEFAULT_FEATURES,
1925+
prefix = '',
1926+
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
1927+
network: OfcNetwork = Networks.main.ofc,
1928+
isToken = true,
1929+
addressCoin = 'vet',
1930+
primaryKeyCurve: KeyCurve = KeyCurve.Secp256k1
1931+
) {
1932+
return Object.freeze(
1933+
new OfcCoin({
1934+
id,
1935+
name,
1936+
fullName,
1937+
network,
1938+
prefix,
1939+
suffix,
1940+
features,
1941+
decimalPlaces,
1942+
isToken,
1943+
asset,
1944+
kind,
1945+
addressCoin,
1946+
primaryKeyCurve,
1947+
baseUnit: BaseUnit.VET,
1948+
})
1949+
);
1950+
}
1951+
1952+
/**
1953+
* Factory function for testnet ofc vet token instances.
1954+
*
1955+
* @param id uuid v4
1956+
* @param name unique identifier of the coin
1957+
* @param fullName Complete human-readable name of the coin
1958+
* @param network Network object for this coin
1959+
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
1960+
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
1961+
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
1962+
* @param prefix? Optional coin prefix. Defaults to empty string
1963+
* @param suffix? Optional coin suffix. Defaults to coin name.
1964+
* @param isToken? Whether or not this account coin is a token of another coin
1965+
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
1966+
* @param primaryKeyCurve The elliptic curve for this chain/token
1967+
*/
1968+
export function tofcVetToken(
1969+
id: string,
1970+
name: string,
1971+
fullName: string,
1972+
decimalPlaces: number,
1973+
asset: UnderlyingAsset,
1974+
kind: CoinKind = CoinKind.CRYPTO,
1975+
features: CoinFeature[] = OfcCoin.DEFAULT_FEATURES,
1976+
prefix = '',
1977+
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
1978+
network: OfcNetwork = Networks.test.ofc,
1979+
isToken = true,
1980+
addressCoin = 'tvet',
1981+
primaryKeyCurve: KeyCurve = KeyCurve.Secp256k1
1982+
) {
1983+
return Object.freeze(
1984+
new OfcCoin({
1985+
id,
1986+
name,
1987+
fullName,
1988+
network,
1989+
prefix,
1990+
suffix,
1991+
features,
1992+
decimalPlaces,
1993+
isToken,
1994+
asset,
1995+
kind,
1996+
addressCoin,
1997+
primaryKeyCurve,
1998+
baseUnit: BaseUnit.VET,
1999+
})
2000+
);
2001+
}

0 commit comments

Comments
 (0)