Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
interface State extends ApiProps {
chain?: string | null;
}
interface InjectedAccountExt {
address: string;
meta: {
name: string;
source: string;
};
}
const DEFAULT_DECIMALS = createType(registry, 'u32', 12);
const DEFAULT_SS58 = createType(registry, 'u32', addressDefaults.prefix);
const injectedPromise = web3Enable('polkadot-js/apps');
let api: ApiPromise;
export { api };
export default class Api extends React.PureComponent {
public state: State = {} as unknown as State;
constructor (props: Props) {
super(props);
const { queuePayload, queueSetTxStatus, url } = props;
const provider = new WsProvider(url);
const signer = new ApiSigner(queuePayload, queueSetTxStatus);
const setApi = (provider: ProviderInterface): void => {
api = this.createApi(provider, signer);