kulapio / libra-core

A javascript client for libra, works on browser and node
https://www.npmjs.com/package/kulap-libra
39 stars 16 forks source link

Fix grpc error on browser #5

Closed totiz closed 5 years ago

totiz commented 5 years ago

Prior to this PR, user need to use v1.0.11 for nodejs, and v1.0.13 for browser. This PR fix this issue, 1.0.14 is the first version that work on both nodejs and browser!!

For Nodejs

const client = new LibraClient({ network: LibraNetwork.Testnet });

For Browser

 const client = new LibraClient({
      transferProtocol: 'https',
      host: 'ac-libra-testnet.kulap.io',
      port: '443',
      dataProtocol: 'grpc-web-text'
    })

Note: There's still a problem with faucet service that raise CORS error, please use this instead for now.

const { data } = await axios.post('https://libraservice3.kulap.io/mint', { address: address, amount: amount })