PHP WebShell
Текущая директория: /opt/BitGoJS/modules/statics/src
Просмотр файла: ada.ts
import { BaseCoin, BaseUnit, CoinFeature, CoinKind, KeyCurve, UnderlyingAsset } from './base';
import { AdaNetwork } from './networks';
export interface AdaConstructorOptions {
id: string;
fullName: string;
name: string;
network: AdaNetwork;
features: CoinFeature[];
asset: UnderlyingAsset;
prefix?: string;
suffix?: string;
primaryKeyCurve: KeyCurve;
}
export class Ada extends BaseCoin {
public static readonly DEFAULT_FEATURES = [
CoinFeature.UNSPENT_MODEL,
CoinFeature.TSS,
CoinFeature.TSS_COLD,
CoinFeature.CUSTODY,
CoinFeature.TRANSACTION_DATA,
CoinFeature.REQUIRES_BIG_NUMBER,
CoinFeature.CUSTODY_BITGO_TRUST,
CoinFeature.CUSTODY_BITGO_MENA_FZE,
CoinFeature.CUSTODY_BITGO_CUSTODY_MENA_FZE,
CoinFeature.STAKING,
CoinFeature.BULK_TRANSACTION,
];
public readonly network: AdaNetwork;
constructor(options: AdaConstructorOptions) {
super({
...options,
kind: CoinKind.CRYPTO,
isToken: false,
decimalPlaces: 6,
baseUnit: BaseUnit.ADA,
});
this.network = options.network;
}
protected disallowedFeatures(): Set<CoinFeature> {
return new Set([CoinFeature.ACCOUNT_MODEL]);
}
protected requiredFeatures(): Set<CoinFeature> {
return new Set([CoinFeature.UNSPENT_MODEL]);
}
}
/**
* Factory function for utxo coin instances.
*
* @param id uuid v4
* @param name unique identifier of the coin
* @param fullName Complete human-readable name of the coin
* @param network Network object for this coin
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `UtxoCoin`
* @param prefix? Optional coin prefix. Defaults to empty string
* @param suffix? Optional coin suffix. Defaults to coin name.
* @param primaryKeyCurve The elliptic curve for this chain/token
*/
export function ada(
id: string,
name: string,
fullName: string,
network: AdaNetwork,
asset: UnderlyingAsset,
features: CoinFeature[] = Ada.DEFAULT_FEATURES,
prefix = '',
suffix: string = name.toUpperCase(),
primaryKeyCurve: KeyCurve = KeyCurve.Ed25519
) {
return Object.freeze(
new Ada({
id,
name,
fullName,
network,
prefix,
suffix,
features,
asset,
primaryKeyCurve,
})
);
}
Выполнить команду
Для локальной разработки. Не используйте в интернете!