Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// The code below the return is not yet production ready.
pHandler.webContents.send('openUri', url);
pHandler.show();
return;
log.info('app: open-url', url);
const opts = {
textEncoder,
textDecoder,
zlib: {
deflateRaw: (data) => new Uint8Array(zlib.deflateRawSync(Buffer.from(data))),
inflateRaw: (data) => new Uint8Array(zlib.inflateRawSync(Buffer.from(data))),
},
};
// Interpret the Signing Request
const request = SigningRequest.from(url, opts);
// Extract relevant information
const {
auths,
blockchains,
wallets,
whitelist
} = store.getState();
const chainId = request.getChainId().toLowerCase();
log.info("requested chainId")
log.info(chainId)
const blockchain = find(blockchains, { chainId });
log.info("blockchain")
log.info(JSON.stringify(blockchain))
constructor(config) {
this.config = config;
if (config.signMethod === 'ledger') {
this.signatureProvider = new LedgerSignatureProvider(config);
} else {
this.signatureProvider = new JsSignatureProvider(config.keyProvider || []);
}
this.rpc = new JsonRpc(config.httpEndpoint);
this.api = new Api({
authorityProvider: this.getAuthorityProvider(),
rpc: this.rpc,
signatureProvider: this.signatureProvider,
textDecoder: new TextDecoder(),
textEncoder: new TextEncoder()
});
this.tapos = {
blocksBehind: 3,
broadcast: config.broadcast,
expireSeconds: config.expireSeconds,
sign: config.sign,
};
return this;
async getRequiredKeys(args) {
const { transaction } = args;
transaction.actions.forEach((action, ti) => {
action.authorization.forEach((auth, ai) => {
if (auth.actor === 'greymassfuel' && auth.permission === 'cosign') {
delete transaction.actions[ti].authorization.splice(ai, 1);
}
});
});
return convertLegacyPublicKeys((await rpc.fetch('/v1/chain/get_required_keys', {
transaction,
available_keys: args.availableKeys,
})).required_keys);
}
};