Giter VIP home page Giter VIP logo

Comments (7)

lemoustachiste avatar lemoustachiste commented on August 16, 2024 1

Something like this should work:

const explorerAPI = {
        serviceName: 'etherscan',
        key: '[your-key]',
        keyPropertyName: 'apikey'
};

from cert-verifier-js.

wantaekchoi avatar wantaekchoi commented on August 16, 2024

here is my code (nestjs):

import { Injectable } from '@nestjs/common';
// import { Certificate } from '@blockcerts/cert-verifier-js';
const {
  Certificate,
} = require('@blockcerts/cert-verifier-js/dist/verifier-node.js');

@Injectable()
export class CertVerifierService {
  async verifyBlockerCertCertificate(certificateDefinition: string) {
    const certificate = new Certificate(certificateDefinition);
    await certificate.init();
    return certificate.verify();
  }
}

from cert-verifier-js.

lemoustachiste avatar lemoustachiste commented on August 16, 2024

Did you fix the issue?

from cert-verifier-js.

wantaekchoi avatar wantaekchoi commented on August 16, 2024

@lemoustachiste
There were no issues. I confirmed that the error was caused by me using the wrong badge, so I closed the issue.

from cert-verifier-js.

lemoustachiste avatar lemoustachiste commented on August 16, 2024

Good to know

I have noticed before the transaction not found error and I think this might be due to Blockcypher being 404, I haven't had time to investigate much and since other explorers yield the result it's not a high priority.

As to overwrite default explorerAPIs, it's been a while, but I think there is an object merge so you need to provide the serviceName similar to the default explorer you are overwriting. From there I think it's possible to provide your own parsingFunction, or other parts of the object.

More info:
https://github.com/blockchain-certificates/explorer-lookup/blob/master/tests/explorers/explorer.test.ts#L65
https://github.com/blockchain-certificates/explorer-lookup/blob/master/src/explorers/index.ts#L33

from cert-verifier-js.

wantaekchoi avatar wantaekchoi commented on August 16, 2024

@lemoustachiste
Thank you for your response.
As you say, 404 response from Blockcypher was treated as a success because we got the correct response from Etherscan.

Although the question below is not appropriate for this issue,
Nevertheless, I was wondering if you could provide an additional answer for the explorer.
I want to apply just an my API key to the Etherscan API.
(I don't need my own parsing function, I want to use the existing parsingFunction of etherscan).
But it seems that defining a parsingFunction isn't optional.

Is there a good way to do this?

from cert-verifier-js.

wantaekchoi avatar wantaekchoi commented on August 16, 2024

@lemoustachiste Thank you for your reply!

from cert-verifier-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.