
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@masa-finance/masa-react
Advanced tools
🌽🌽 THIS IS BETA SOFTWARE. IT COULD LEAD TO RAPID UNSCHEDULED DISASSEMBLY. If you run into problems, please open up a new issue. 🌽🌽
git clone https://github.com/masa-finance/masa-react.git
yarn
yarn storybook
First install masa-react
in your project
yarn add @masa-finance/masa-react
Then import and add a provider
import {
MasaProvider
} from "@masa-finance/masa-react";
function App() {
return (
<MasaProvider>
...
</MasaProvider>
);
}
If you want to add our styles to your project just include this line at the very top of your file right below your imports
import "@masa-finance/masa-react/dist/style.css";
Import useMasa
to have access to the masa
object, this will let you connect with the whole interface of smart contracts and tools from masa-sdk
import {
useMasa
} from "@masa-finance/masa-react";
const { connect } = useMasa();
const connectionCallback = () => {
history.push('/dashboard');
}
const connectionHandler = useCallback(() => {
connect(options)
}, [connect, options]);
<Button
onClick={connectionHandler}>
Connect with Masa
</Button>
import {
useMasa
} from "@masa-finance/masa-react";
const { masa } = useMasa();
const askForCreditScores = useCallback(async () => {
const creditScores = await masa?.creditScore.list();
console.log({ creditScores })
}, [masa]);
<Button
onClick={askForCreditScores}>
Show credit reports
</Button>
You can specify which scopes you want, here goes an example of requesting the connected user to have an identity
const options = {
scope: ['identity']
}
const connectionHandler = useCallback(() => {
connect(options)
}, [connect, options]);
<Button
onClick={connectionHandler}>
Connect with Masa
</Button>
interface MasaShape {
setProvider?: (provider: any) => void;
provider?: any;
isModalOpen?: boolean;
setModalOpen?: (val: boolean) => void;
masa?: Masa;
isConnected?: boolean;
loading?: boolean;
setLoading?: (val: boolean) => void;
walletAddress?: string | null;
identity?: any;
loggedIn?: boolean;
handleLogin?: () => void;
handleLogout?: () => void;
handlePurchaseIdentity?: () => void;
connect?: (options?: { scope?: string[]; callback?: Function }) => void;
closeModal?: Function;
scope?: string[];
company?: string;
}
FAQs
<!-- TOC --> * [Getting Started with masa-react](#getting-started-with-masa-react) * [Installation](#installation) * [Styles](#styles) * [Setup Storybook](#setup-storybook) * [Usage ( inside MasaProvider )](#usage--inside-masaprovider-)
The npm package @masa-finance/masa-react receives a total of 33 weekly downloads. As such, @masa-finance/masa-react popularity was classified as not popular.
We found that @masa-finance/masa-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.