Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@tonconnect/sdk
Advanced tools
⚠️ TonConnect is currently in beta testing. Use it at your own risk.
Use it to connect your app to TON wallets via TonConnect protocol. You can find more details and the protocol specification in the docs.
npm i @tonconnect/sdk
import TonConnect from '@tonconnect/sdk';
const connector = new TonConnect();
connector.autoConnect();
connector.onStatusChange(
walletInfo => {
// update state/reactive variables to show updates in the ui
}
);
const walletConnectionSource = {
universalLinkBase: 'https://app.mycooltonwallet.com',
bridgeURL: 'https://bridge.mycooltonwallet.com,'
}
const uniwersalLink = connector.connect(walletConnectionSource);
Then you have to show this link to user as QR code, or use it as a deeplink. You will receive an update in connector.onStatusChange
when user approves connection in the wallet
if (connector.isInjectedProviderAvailable()) {
connector.connect('injected');
}
You will receive an update in connector.onStatusChange
when user approves connection in the wallet
if (!connetor.connected) {
alert('Please connect wallet to send the transaction!');
}
const transaction = {
valid_until: 1658253458,
messages: [
{
address: "0:412410771DA82CBA306A55FA9E0D43C9D245E38133CB58F1457DFB8D5CD8892F",
amount: "20000000",
initState: "base64bocblahblahblah=="
},
{
address: "0:E69F10CC84877ABF539F83F879291E5CA169451BA7BCE91A37A5CED3AB8080D3",
amount: "60000000",
payload: "base64bocblahblahblah=="
}
]
}
try {
const result = await connetor.sendTransaction(transaction);
// you can use signed boc to find the transaction
const someTxData = await myAppExplorerService.getTransaction(result.boc);
alert('Transaction was sent successfully', someTxData);
} catch (e) {
if (e instanceof UserRejectedError) {
alert('You rejected the transaction. Please confirm it to send to the blockchain');
} else {
alert('Unknown error happened', e);
}
}
FAQs
Use it to connect your app to TON wallets via TonConnect protocol. You can find more details and the protocol specification in the [docs](https://docs.ton.org/develop/dapps/ton-connect/overview). See the example of sdk usage [here](https://github.com/ton
The npm package @tonconnect/sdk receives a total of 26,728 weekly downloads. As such, @tonconnect/sdk popularity was classified as popular.
We found that @tonconnect/sdk 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.