Skip to content

Commit fb6ad00

Browse files
feat: adding ofc support for COREDAOERC20 tokens
Ticket: WIN-6408 TICKET: WIN-6408
1 parent b8c3df5 commit fb6ad00

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
@@ -1796,3 +1796,105 @@ export function tofcWorldErc20(
17961796
})
17971797
);
17981798
}
1799+
1800+
/**
1801+
* Factory function for ofc CoredaoErc20 token instances.
1802+
*
1803+
* @param id uuid v4
1804+
* @param name unique identifier of the coin
1805+
* @param fullName Complete human-readable name of the coin
1806+
* @param network Network object for this coin
1807+
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
1808+
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
1809+
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
1810+
* @param prefix? Optional coin prefix. Defaults to empty string
1811+
* @param suffix? Optional coin suffix. Defaults to coin name.
1812+
* @param isToken? Whether or not this account coin is a token of another coin
1813+
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
1814+
* @param primaryKeyCurve The elliptic curve for this chain/token
1815+
*/
1816+
export function ofcCoredaoErc20(
1817+
id: string,
1818+
name: string,
1819+
fullName: string,
1820+
decimalPlaces: number,
1821+
asset: UnderlyingAsset,
1822+
kind: CoinKind = CoinKind.CRYPTO,
1823+
features: CoinFeature[] = OfcCoin.DEFAULT_FEATURES,
1824+
prefix = '',
1825+
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
1826+
network: OfcNetwork = Networks.main.ofc,
1827+
isToken = true,
1828+
addressCoin = 'coredao',
1829+
primaryKeyCurve: KeyCurve = KeyCurve.Secp256k1
1830+
) {
1831+
return Object.freeze(
1832+
new OfcCoin({
1833+
id,
1834+
name,
1835+
fullName,
1836+
network,
1837+
prefix,
1838+
suffix,
1839+
features,
1840+
decimalPlaces,
1841+
isToken,
1842+
asset,
1843+
kind,
1844+
addressCoin,
1845+
primaryKeyCurve,
1846+
baseUnit: BaseUnit.ETH,
1847+
})
1848+
);
1849+
}
1850+
1851+
/**
1852+
* Factory function for testnet ofc CoredaoErc20 token instances.
1853+
*
1854+
* @param id uuid v4
1855+
* @param name unique identifier of the coin
1856+
* @param fullName Complete human-readable name of the coin
1857+
* @param network Network object for this coin
1858+
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
1859+
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
1860+
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
1861+
* @param prefix? Optional coin prefix. Defaults to empty string
1862+
* @param suffix? Optional coin suffix. Defaults to coin name.
1863+
* @param isToken? Whether or not this account coin is a token of another coin
1864+
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `OfcCoin`
1865+
* @param primaryKeyCurve The elliptic curve for this chain/token
1866+
*/
1867+
export function tofcCoredaoErc20(
1868+
id: string,
1869+
name: string,
1870+
fullName: string,
1871+
decimalPlaces: number,
1872+
asset: UnderlyingAsset,
1873+
kind: CoinKind = CoinKind.CRYPTO,
1874+
features: CoinFeature[] = OfcCoin.DEFAULT_FEATURES,
1875+
prefix = '',
1876+
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
1877+
network: OfcNetwork = Networks.test.ofc,
1878+
isToken = true,
1879+
addressCoin = 'tcoredao',
1880+
primaryKeyCurve: KeyCurve = KeyCurve.Secp256k1
1881+
) {
1882+
return Object.freeze(
1883+
new OfcCoin({
1884+
id,
1885+
name,
1886+
fullName,
1887+
network,
1888+
prefix,
1889+
suffix,
1890+
features,
1891+
decimalPlaces,
1892+
isToken,
1893+
asset,
1894+
kind,
1895+
addressCoin,
1896+
primaryKeyCurve,
1897+
baseUnit: BaseUnit.ETH,
1898+
})
1899+
);
1900+
}

0 commit comments

Comments
 (0)