Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
newListener='newListener'
}
export class CustomEventEmitter extends EventEmitter {
on (...args) {
if (args[0] !== ArianeListenerEvent.newListener) {
super.emit(ArianeListenerEvent.newListener, args[0]);
}
// @ts-ignore
return super.on(...args);
}
addListener=this.on;
}
@singleton()
export class ArianeeEventEmitter {
public EE = new CustomEventEmitter();
}
import { injectable, singleton } from 'tsyringe';
import { ConsolidatedCertificateRequest } from '../../certificateSummary/certificateSummary';
@singleton()
export class GlobalConfigurationService {
public defaultQuery: ConsolidatedCertificateRequest = {
isRequestable: true,
content: true,
issuer: {
waitingIdentity: false,
forceRefresh: false
},
owner: true,
events: true,
arianeeEvents: true,
advanced: true,
messageSenders: true
}
getMergedQuery (query:ConsolidatedCertificateRequest = {}):ConsolidatedCertificateRequest {
import {Cert} from "@0xcert/cert";
import {singleton} from "tsyringe";
import {ConfigurationService} from "../configurationService/configurationService";
import {Web3Service} from "../web3Service/web3Service";
@singleton()
export class UtilsService {
constructor(private web3Service: Web3Service, private configurationService: ConfigurationService) {
}
private get web3() {
return this.web3Service.web3;
}
public signProofForRequestToken(
certificateId: number,
publicKeyNextOwner: string,
privateKeyPreviousOwner: string
) {
const data = this.web3.utils.keccak256(
this.web3.eth.abi.encodeParameters(
["uint", "address"],
import { singleton } from 'tsyringe';
import configurations from '../../../../configurations/appConfigurations';
import { ArianeeConfig } from '../../../../models/arianeeConfiguration';
import { ArianeeWalletBuilder } from '../../walletBuilder';
@singleton()
export class ConfigurationService {
public arianeeConfiguration: ArianeeConfig;
public walletFactory (): ArianeeWalletBuilder {
return new ArianeeWalletBuilder(this.arianeeConfiguration);
}
public supportedConfigurations=configurations;
}
import axios from 'axios';
import { singleton } from 'tsyringe';
@singleton()
export class ArianeeHttpClient {
private fetchingCache = {};
/**
* Calculate hash key from url and headers of a request
* @param url
* @param config
* @return {string}
*/
private static createKeyFromURL = (url, config) => {
const hash = function (s) {
let a = 1;
let c = 0;
let h;
let o;
if (s) {