VET Transfers
Connection
The connection is managed using WebSockets, which connect directly to a VeChain node.
A simple connection can be established with this snippet:
This will receive all transfers on the blockchain as JSON-encoded strings.
Filter Specific Transfers
The VeChain SDK facilitates the construction of filters to retrieve only the desired data by generating a subscription URL with specified parameters. Using the subscriptions
helper, you can create a custom subscription URL that listens exclusively to the specified event.
All options are optional, and a transfer must match all specified criteria:
Transfer Details
The transfers are received as JSON-encoded strings. These strings must be parsed into usable objects, resulting in an object of type TransferLogs
.
An example result is:
The amount is a hexlified BigInt that can be converted into a BigInt using BigInt(transferLog.amount)
.
Example Project
Last updated