How to use eosio-signing-request - 3 common examples

To help you get started, we’ve selected a few eosio-signing-request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github greymass / eos-voter / app / shared / utils / UriHandler.js View on Github external
// 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))
github greymass / eos-voter / app / shared / utils / EOS / Handler.js View on Github external
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;
github greymass / eos-voter / app / shared / utils / EOS / Handler.js View on Github external
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);
      }
    };

eosio-signing-request

EOSIO Signing Request (ESR / EEP-7) encoder and decoder

MIT
Latest version published 1 year ago

Package Health Score

47 / 100
Full package analysis

Similar packages