Skip to content

Commit 2ea0428

Browse files
committed
feat(sdk-coin-apt): ofc coins including apt
TICKET: COIN-3204
1 parent 01f5d55 commit 2ea0428

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

modules/statics/src/ofc.ts

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,3 +1276,109 @@ export function tofcTronToken(
12761276
})
12771277
);
12781278
}
1279+
1280+
/**
1281+
* Factory function for ofc aptos token instances.
1282+
*
1283+
* @param id uuid v4
1284+
* @param name unique identifier of the coin
1285+
* @param fullName Complete human-readable name of the coin
1286+
* @param features
1287+
* @param prefix
1288+
* @param suffix
1289+
* @param network Network object for this coin
1290+
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
1291+
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
1292+
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
1293+
* @param isToken
1294+
* @param addressCoin
1295+
* @param primaryKeyCurve The elliptic curve for this chain/token
1296+
*/
1297+
1298+
export function ofcaptToken(
1299+
id: string,
1300+
name: string,
1301+
fullName: string,
1302+
decimalPlaces: number,
1303+
asset: UnderlyingAsset,
1304+
features: CoinFeature[] = [...OfcCoin.DEFAULT_FEATURES, CoinFeature.TSS_ENTERPRISE_PAYS_FEES], // TSS_ENTERPRISE_PAYS_FEE is a mandatory field for APTOS being a TSS & having Gas tank as fee payer
1305+
kind: CoinKind = CoinKind.CRYPTO,
1306+
prefix = '',
1307+
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
1308+
network: OfcNetwork = Networks.main.ofc,
1309+
isToken = true,
1310+
addressCoin = 'apt',
1311+
primaryKeyCurve: KeyCurve = KeyCurve.Ed25519
1312+
) {
1313+
return Object.freeze(
1314+
new OfcCoin({
1315+
id,
1316+
name,
1317+
fullName,
1318+
network,
1319+
prefix,
1320+
suffix,
1321+
features,
1322+
decimalPlaces,
1323+
isToken,
1324+
asset,
1325+
kind,
1326+
addressCoin,
1327+
primaryKeyCurve,
1328+
baseUnit: BaseUnit.APT,
1329+
})
1330+
);
1331+
}
1332+
1333+
/**
1334+
* Factory function for testnet ofc aptos token instances.
1335+
*
1336+
* @param id uuid v4
1337+
* @param name unique identifier of the coin
1338+
* @param fullName Complete human-readable name of the coin
1339+
* @param features
1340+
* @param prefix
1341+
* @param suffix
1342+
* @param network Network object for this coin
1343+
* @param decimalPlaces Number of decimal places this coin supports (divisibility exponent)
1344+
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
1345+
* @param kind Differentiates coins which represent fiat assets from those which represent crypto assets
1346+
* @param isToken
1347+
* @param addressCoin
1348+
* @param primaryKeyCurve The elliptic curve for this chain/token
1349+
*/
1350+
1351+
export function tofcaptToken(
1352+
id: string,
1353+
name: string,
1354+
fullName: string,
1355+
decimalPlaces: number,
1356+
asset: UnderlyingAsset,
1357+
features: CoinFeature[] = [...OfcCoin.DEFAULT_FEATURES, CoinFeature.TSS_ENTERPRISE_PAYS_FEES], // TSS_ENTERPRISE_PAYS_FEE is a mandatory field for APTOS being a TSS & having Gas tank as fee payer
1358+
kind: CoinKind = CoinKind.CRYPTO,
1359+
prefix = '',
1360+
suffix: string = name.replace(/^ofc/, '').toUpperCase(),
1361+
network: OfcNetwork = Networks.test.ofc,
1362+
isToken = true,
1363+
addressCoin = 'tapt',
1364+
primaryKeyCurve: KeyCurve = KeyCurve.Ed25519
1365+
) {
1366+
return Object.freeze(
1367+
new OfcCoin({
1368+
id,
1369+
name,
1370+
fullName,
1371+
network,
1372+
prefix,
1373+
suffix,
1374+
features,
1375+
decimalPlaces,
1376+
isToken,
1377+
asset,
1378+
kind,
1379+
addressCoin,
1380+
primaryKeyCurve,
1381+
baseUnit: BaseUnit.APT,
1382+
})
1383+
);
1384+
}

0 commit comments

Comments
 (0)