TronSocket - WebSocket Transaction Event Listener for Tron Blockchain

As you offer a free plan of your services, do you have any plans on monetizing it in the future to generate revenue you need to sustain the running cost of the project or will it remain free to encourage adoption?

1 Like
  1. What strategies are being implemented to manage the anticipated increase in traffic as the ecosystem grows?

  2. Are there any plans to expand services beyond the Tron ecosystem?

  3. What specific security measures have been established to protect users’ tokens and data?

  4. How do you prioritize user feedback in your development process to enhance the platform’s features?

2 Likes

:star2: Awesome work over the past month! It’s been great seeing all the effort and dedication come together—well done! :raised_hands: I just liked your project, and it would mean a lot if you could check ours out too.

Voting starts tomorrow, so if you haven’t already, feel free to drop a like and vote for us when it’s time! Let’s keep building together and make this ecosystem even stronger! :muscle::rocket:

What are the main features of the TronSocket SDK for TypeScript? How does it help developers with blockchain events?

2 Likes

There are already paid plans as well as a free-tier subscription. Free plan will remain for the developers with small-tier projects. If you want to expend your limits, you should subscribe to a paid plan.

1 Like

To learn about every feature on TronSocket SDK, please read our documentation: https://docs.tronsocket.com/sdk-socket.io

Basically, we have 4 event types that you can use to read the blockchain: ‘block’, ‘transaction’, ‘contract’, ‘solidity’

After initializing the SDK and entering your token, you can start listening the network.

Here’s a Typescript example:

import TronSocket, {
    Transaction,
    Block,
    Solidity,
    SolidityEvent,
    SolidityLog,
    ContractEvent,
    ContractLog,
} from "@tronsocket/sdk/node";

const socket = new TronSocket("your_token_here", true);

await socket.connect().then((connected) => {
    console.log("Connected:", connected);
}).catch((error) => {
    console.error("Error:", error);
});

socket.on("transaction", (tx: Transaction) => {
    const id = tx.transactionId;
});

socket.on("block", (block: Block) => {
    console.log(block);
});

socket.on("solidity", (solidity: Solidity | SolidityEvent | SolidityLog) => {
    if (socket.isSolidityEvent(solidity)) {
        console.log(solidity); // SolidityEvent
    } else if (socket.isSolidityLog(solidity)) {
        console.log(solidity); // SolidityLog
    } else {
        console.log(solidity); // Solidity
    }
});

socket.on("contract", (contract: ContractEvent | ContractLog) => {
    if (socket.isContractEvent(contract)) {
        console.log(contract); // ContractEvent
    } else if (socket.isContractLog(contract)) {
        console.log(contract); // ContractLog
    }
});

You can use filters:

import TronSocket, {
    Transaction,
    TransactionFilter,
} from "@tronsocket/sdk/node";

const socket = new TronSocket("your_token_here", true);

await socket.connect().then((connected) => {
    console.log("Connected:", connected);
}).catch((error) => {
    console.error("Error:", error);
});

const transaction = (data: Transaction) => {
    console.log(data);
}

const transactionFilter: TransactionFilter = {
    toAddress: "TJr3QjX...",
    fromAddress: "TJr3QjX..."
}

socket.subscribe("transaction", transaction, transactionFilter); // Subscribe to transaction events with the filter

You can subscribe & unsubscribe from events:

import TronSocket, {
    Transaction,
    TransactionFilter,
} from "@tronsocket/sdk/node";

const socket = new TronSocket("your_token_here", true);

await socket.connect().then((connected) => {
    console.log("Connected:", connected);
}).catch((error) => {
    console.error("Error:", error);
});

const transaction = (data: Transaction) => {
    console.log(data);
    socket.off("transaction", transaction, transactionFilter);
    // socket.unsubscribe("transaction", transaction, transactionFilter);
}

const transactionFilter: TransactionFilter = {
    toAddress: "TJr3QjX...",
    fromAddress: "TJr3QjX..."
}

socket.on("transaction", transaction, transactionFilter);
// socket.subscribe("transaction", transaction, transactionFilter);
1 Like

Hello, thanks for your questions.

TronSocket has a few servers running in the background. Our current servers have enough power to sustain us for a long time. If we run into a problem, we plan to split the connections to different servers with a load balancer.

The basic rule of brand building is to narrow the focus. While our service is already called TronSocket, it would be illogical to provide a service for another blockchain network. However, we have forward-looking plans for the project, the first of which is a standards-compliant RPC API service that you can use with packages like TronWeb as well as WebSocket service.

Yes, we have a whitelist system for this. For example, if you use the token in your own backend, it will already be secure enough. However, you can add ip restriction as an extra. If you are going to use it directly in the frontend, you can add domain restriction.

Yes of course, we have activated the Github discuss for this and also the SDK repository issues can be used for this.

3 Likes

Ok but please tell me what sets the two plans apart. What features will the paid plan subscribers enjoy over the developers using the free tier plan?

Hello @Chizz, the limits are different. For example, if you have a lot of transaction flow, you need to upgrade to the paid version as free will be insufficient.

1 Like

That was so quick :heart_eyes: So tell me how your team has structured the price for the paid plans and how moderate the fees are to attract more developers to subscribe for the paid plan?

At the moment, we have chosen a pricing that will cover our costs according to our server costs and the number of users connecting at the same time. The paid version has a very high message limit and is only $9 per month. This limit will be enough for many applications of many scales.

1 Like

Could you elaborate on how your project specifically integrates TRON and how that enhances its infrastructure capabilities?

Hello @Anderson, thank you for your question. But it is already in this project description. So there is nothing extra to explain.

1 Like

What steps should a developer follow to begin using TronSocket for monitoring events on the Tron blockchain?

You should follow the steps that I’ve written for Test Instructions

Project Test Instructions:
First, please create your TronSocket account from the dashboard . Then, you need to create a subscription. For now, you can subscribe to our free plan.

Now you are ready to create your first token. Tokens are essentially used for authenticating your WebSocket interaction.

To test TronSocket Websockets, follow our developer documentation and determine whether you want to use TronSocket SDK or use WebSockets on your own.

1 Like

Ok I get it clear now. Thank you for explaining to me

Nice project especially if you guys have your own TRON nodes deploy will make sense to use your project for high availability!

Amazing work @beycan @oynozan :star_struck:

The starting plan does not seem quite attractive to me 1000 monthly message that means the total number of events sent? 15 Messages per second is basically the TRONGRID rps.

Can I ask what will be the benefits of me using your system rather than our own with refresh through TRONGRID especially with the limitation of the free plan in mind?

Apart from that is a complete project with a well though design. (Not sure why would not accept login with a wallet and choose the email path)

3 Likes

Hello, first of all, thank you for your comment and for liking our project. The limit of 1000 messages per month is only the event triggers you receive from our service. At first glance, it seems like a small value, but since we have a filtering system, if we assume that you only listen to the transactions coming to your wallet, this means listening to a net 1000 tx. But we are learning as we go and in the future we can update a lot of things based on feedback from our users.

The difference from TronGrid is that you listen to all events directly via websocket with your own filters, not polling.

In fact, account matching with Tron wallets (or maybe just TronLink) is on our development list and we will include it.

2 Likes

What are the limits of the free subscription plan for token events?

Hello, the limits are valid for all events. If you listen to the tx to the token with “toAddress” this means you can listen to a total of 1000tx.

1 Like