Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tonconnect/sdk

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tonconnect/sdk - npm Package Compare versions

Comparing version 3.0.0-beta.1 to 3.0.0-beta.2

4

lib/types/index.d.ts

@@ -205,3 +205,3 @@ export declare interface Account {

/**
* Thrown when `Storage` was not specified in the `DappMetadata` and default `localStorage` was not detected in the environment.
* Thrown when `Storage` was not specified in the `DappMetadata` and default `localStorage` was not detected in the Node.js environment.
*/

@@ -425,3 +425,3 @@ export declare class LocalstorageNotFoundError extends TonConnectError {

/**
* Converts raw TON address to bounceable user-friendly format. [See details]{@link https://ton.org/docs/learn/overviews/addresses#user-friendly-address}
* Converts raw TON address to no-bounceable user-friendly format. [See details]{@link https://ton.org/docs/learn/overviews/addresses#user-friendly-address}
* @param hexAddress raw TON address formatted as "0:<hex string without 0x>".

@@ -428,0 +428,0 @@ * @param [testOnly=false] convert address to test-only form. [See details]{@link https://ton.org/docs/learn/overviews/addresses#user-friendly-address}

{
"name": "@tonconnect/sdk",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"scripts": {

@@ -27,5 +27,5 @@ "build": "npx rimraf types-dist && npx rimraf lib && npx rollup -c rollup.config.mjs && ttsc --project tsconfig.declarations.json && api-extractor run && npx rimraf types-dist && npx rimraf dist && npx webpack --config webpack.config.js",

"dependencies": {
"@tonconnect/isomorphic-eventsource": "^0.0.1",
"@tonconnect/isomorphic-fetch": "^0.0.2",
"@tonconnect/protocol": "^2.2.5"
"@tonconnect/isomorphic-eventsource": "^0.0.2-beta.0",
"@tonconnect/isomorphic-fetch": "^0.0.2-beta.0",
"@tonconnect/protocol": "^2.2.6-beta.0"
},

@@ -32,0 +32,0 @@ "files": [

@@ -62,3 +62,5 @@ # TON Connect SDK

```ts
const connector = new TonConnect({ manifestUrl: 'https://myApp.com/assets/tonconnect-manifest.json' });
const connector = new TonConnect({
manifestUrl: 'https://myApp.com/assets/tonconnect-manifest.json'
});
```

@@ -277,3 +279,6 @@

```ts
connector.connect(walletConnectionSource, { tonProof: "<your-fetched-payload>" });
connector.connect(
walletConnectionSource,
{ tonProof: "<your-fetched-payload>" }
);
```

@@ -285,18 +290,18 @@ Note that you can use `tonProof` only with `connector.connect()` method. This feature is not available in `connector.restoreConnection()`.

connector.onStatusChange(wallet => {
if (!wallet) {
return;
}
if (!wallet) {
return;
}
const tonProof = wallet.connectItems?.tonProof;
const tonProof = wallet.connectItems?.tonProof;
if (tonProof) {
if ('proof' in tonProof) {
// send proof to your backend
// e.g. myBackendCheckProof(tonProof.proof, wallet.account);
return;
}
if (tonProof) {
if ('proof' in tonProof) {
// send proof to your backend
// e.g. myBackendCheckProof(tonProof.proof, wallet.account);
return;
}
console.error(tonProof.error);
}
});
console.error(tonProof.error);
}
});
```

@@ -357,1 +362,26 @@ 4. Send proof and user's account data to your backend. Backend should check the proof correctness and check that payload inside the proof was generated before. After all checks backend should return an auth token to the client. Notice that `Account` contains the `walletStateInit` property which can be helpful for your backend to get user's public key if user's wallet contract doesn't support corresponding get method.

```
# Troubleshooting
## Warning about 'encoding' module in Next.js
If you are using Next.js and see a warning similar to the following:
```
⚠ ./node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding' in '.../node_modules/node-fetch/lib'
Import trace for requested module:
./node_modules/node-fetch/lib/index.js
./node_modules/@tonconnect/isomorphic-fetch/index.mjs
./node_modules/@tonconnect/sdk/lib/esm/index.mjs
```
Please note that this is just a warning and should not affect the functionality of your application. If you wish to suppress the warning, you have two options:
1. (Recommended) Wait for us to remove the dependency on `@tonconnect/isomorphic-fetch` in future releases. This dependency will be removed when we drop support for Node.js versions below 18.
2. (Optional) Install the `encoding` package, to resolve the warning:
```shell
npm install encoding
```

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc