how to import and connect with wallet using TronWeb in angular 15? - cryptocurrency

I am using angular 15 and i have install tronweb using npm install tronweb now I want to know how can i import tronweb in the component and get user usdt balance?

Related

Realm and React error. Can't resolve 'react-native' in app created with create-react-app

I'm attempting to add the Realm package to a project created with create-react-app. I simply run the create script, install the project, then install realm. When I attempt to import or require 'realm' I get a Can't resolve 'react-native' error.
npx create-react-app my-app
cd my-app
npm i
npm i --save realm
npm start
At this point, if I attempt to import realm anywhere in the project, for instance by adding:
import Realm from 'realm';
or
Realm = require('realm');
to App.js or Index.js
I get the following error.
./node_modules/realm/lib/browser/index.js
Module not found: Can't resolve 'react-native' in '/Users/scolobey/Desktop/Projects/realm-blog/node_modules/realm/lib/browser'
As far as I have been able to tell, this seems to be related to webpack. Opening the console on this error page, I see:
./node_modules/realm/lib/browser/index.js
Module not found: Can't resolve 'react-native' in '/Users/scolobey/Desktop/Projects/javascript/my-app/node_modules/realm/lib/browser'
console.<computed> # index.js:1
r # backend.js:6
handleErrors # webpackHotDevClient.js:173
push../node_modules/react-dev-utils/webpackHotDevClient.js.connection.onmessage # webpackHotDevClient.js:212
Create React App is for regular React apps (not mobile/“React Native” apps). Your app is complaining because it expects to find the “react-native” package, which doesn’t come included with Create React App.
You’ll note that Realm’s Installation Guide specifically instructs you to set up react native before installing the package.
As mentioned in the React Native Docs - Getting Started (which is linked to in the above Realm installation guide), you likely want to use expo instead of Create React App.
Once the React Native app is set up, you can proceed with installing Realm.

SCRIPT438: Object doesn't support property or method 'setPrototypeOf'

I've created a react app using "create-react-app" command and updated all packages in package.json, App was not working in IE(any version) but after adding #babel/polyfil dependecy, it worked with IE-11, but facing problem with IE-10 and older version.
SCRIPT438: Object doesn't support property or method 'setPrototypeOf'
Create React App requires polyfills to work on Internet Explorer. You should follow the official guide to make it work on IE 9, 10 or 11. At the time of this writing it requires the following steps:
Install react-app-polyfill via npm or yarn.
npm install react-app-polyfill
Import it in your code:
import 'react-app-polyfill/ie9';
// or
import 'react-app-polyfill/ie11';

Can't import react big calendar

Im trying to import the component 'react-big-calendar':
import React from 'react';
import BigCalendar from 'react-big-calendar';
import moment from 'moment';`
could not find a declaration file for module react big calendar
Iv'e already tried to use the npm #Types.. but it didnt work
Are you using private repository or have proxy repository(to cache modules) between your system and npm repository, if yes then add following line in your .npmrc file and then try to check if it works :-
#types:registry = "https://registry.npmjs.com"
You need to install the package from npm:
npm install --save react-big-calendar

React app with the create react app commad. How do i include bootstrap?

So i created a react app using the create-react-app folder-name from cmd
So how do i add bootstrap and other libraries to launch on npm start i.e. when i launch the app. Do i install them with bower install or with npm install. I am so new to this i don't even get how are all the scdripts from the framework are launching with idnex.html. I know that the question is probably somewhat retarded, but idk how to even ask it correctly.
You can add any libraries you want utilizing npm and ES6 Import
Just Import anything you want in App.js.
Here is step by step guide on adding bootstrap to your project.

Unknown module "Firebase" in React native

I am working on some sample apps using react native. I am trying to integrate Firebase plugin followed by firebase tutorial.
I can able to add firebase plugin using
npm install firebase --save
It gets added to node_modules, when i try to require the plugin
var Firebase = require('firebase');
It throws an exceptions "Requiring unknown module 'firebase'...."
First, make sure you've installed the dependency with:
npm install firebase --save
(make sure you are in your project folder)
Then end the NPM process and restart by running react-native start. That should do the trick.

Resources