Closed mvdschee closed 2 years ago
It's not in the documentation all that well, but I think you should be able to pass a client
to the UAL plugin, which can use a custom fetch provider.
The client
that needs to be passed in is an APIClient from the eosio library, which you'd pass a custom FetchProvider
to, like so:
import {APIClient, FetchProvider} from '@greymass/eosio'
const fetch = require('node-fetch')
export const provider = new FetchProvider('https://eos.greymass.com', {fetch})
export const client = new APIClient({provider})
node-fetch
can be replaced by whichever fetch compatible library you are using.
The client
in the example above can then be passed into ual-anchor instance that you're using in UAL. An example of where it's passed in can be found in one of our demos:
Thank you that works :)
I'm currently running into an issue that the underlaying package
eosio-core.js
doesn't work because the fetch provider is missing. It's an option ineosio
to provide fetch in the options, butual-anchor
doesn't let us set those options.It would be nice to have a clean way to pass through those options.
Currently I got it working by setting
global.fetch
but this pollutes the global scope.