Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async init() {
let msg = 'test';
if (this.provider.signMethod === SignMethod.ETH_SIGN) {
msg = await sha(256, msg);
}
const signature = await this.provider.sign(`0x${msg}`);
const signatureType = this.provider.signMethod;
this.authentication = `${signatureType}:${signature}`;
let data = null;
try {
const accountData = await clientFetch(`${this.apiUrl}/account`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': this.authentication,
},
});
data = accountData.data;
hasher: async (v: any) => sha(256, toString(v)),
noncer: async (p) => sha(256, p.join('.')),
public async identify(normalize?: boolean): Promise {
return sha(256, JSON.stringify(
normalize !== false ? this.sortSchema(this.schema) : this.schema,
));
}
noncer: async (p) => sha(256, p.join('.')),
...config,