Hashport Explores: Using the Hashport API to Port Assets

hashport
4 min readDec 13, 2022

--

Hashport is an interoperability solution that facilitates the movement of supported digital assets across supported networks — Hedera Hashgraph, Ethereum, Polygon, Avalanche, & BNB Chain — and 34 supported tokens as of December 2022.

Using the API functionality, developers can integrate Hashport’s interoperability solution into dApps and enable users to enjoy the token porting experience.

If you want to learn more about the Hashport API from the beginning, learn more by reading our introductory blog. For more details, you can dive right into docs.hashport.network for the full documentation.

In this article, we will discuss how to use the Hashport API and enable users to port their assets across networks.

Validate Porting Steps

Now that you have retrieved network IDs and asset IDs, you can visit the subpage titled Validate Porting Steps to submit the required parameters at the endpoint to ensure that all the necessary information captured by your dApp is set before starting the porting steps.

This is a step that you should do before starting the Porting Steps.

Porting Steps

Porting steps represent the order of operations that dApps must conduct with the user to successfully port an asset across the hashport ecosystem.

dApps should ensure that the user has sufficient tokens to:

  • Submit transactions ( gas fee, network fee & no. of tokens to be ported)
  • Associate tokens on Hedera network

It is also imperative that dApps should only allow the user to move to the next step when the previous action is successful. If the previous action is not successful, the step should be repeated. Users should also be allowed to exit and ask for technical assistance.

The Hashport app will attempt to auto-associate if the user’s Account ID has not yet associated the token. In order to make the token porting experience as seamless as possible, the updated user interface also provides a token price chart and a breakdown of gas and network fees that are associated with the token porting.

Now that we have completed our initial transaction, we can check the transfer status on the Hashport validator swarm.

Gets transfers (paginated)

At this step, users can retrieve a paginated list of transactions that are completed on Hashport. Users can find transactions and view the details of each transaction.

By providing a filter.transactionId query parameter, users can check if a new transaction has been verified by the validator swarm.

Convert a Hedera Transaction ID to Hashport’s Transaction ID

At Convert Hedera txID, you will find the endpoint where you can send an API request and it will return a string that is formatted and safe to use in other endpoints.

After users have successfully transferred their asset to Hashport, dApps will need to poll the transaction to check if it has been validated by the hashport validator swarm. To avoid any unsafe symbols and characters within the transaction ID. dApps might want to retrieve a safely constructed transaction ID to pass into the GET /transfers/{txId} query.

Thank you for completing the Hashport API Series. To review past blogs, you can visit by clicking the links below:

Hashport API Series:
1. Introducing the Hashport API
2. Integrating the Hashport API into dApps
3. Using the Hashport API to Port Assets

About hashport
hashport is the enterprise-grade public utility that facilitates the movement of digital assets between distributed networks, extending their functionality in a quick, secure, and cost-effective way. In order to remain platform-neutral, hashport functions without the use of a proprietary token. The network is built on a robust and performant architecture, secured and operated by a group of industry-leading validator partners from around the world. hashport has passed a rigorous security audit and follows industry best practices; regularly performing comprehensive network tests to ensure the integrity of the network.

Website | Twitter | Reddit | Telegram | LinkedIn | YouTube | GitHub

Disclaimer: The information provided on hashport’s website does not constitute investment advice, financial advice, trading advice, or any other sort of advice. You should not treat any site content as advice.

--

--

hashport

✨Hashport is a public utility enabling fast & secure cross-network token transfers. $HBAR $ETH $MATIC $AVAX $BNB $OP #Arbitrum #Fantom #Cronos #Moonbeam #Aurora