Getting started
Install module
npm install @hop-protocol/sdkyarn add @hop-protocol/sdkCDN
<script src="https://cdn.jsdelivr.net/npm/@hop-protocol/sdk@latest/hop.js"></script><script src="https://unpkg.com/@hop-protocol/sdk@latest/hop.js"></script>Import module
import { Hop } from '@hop-protocol/sdk'const { Hop } = require('@hop-protocol/sdk')Instantiate SDK
Instantiate with ethers Signer for sending transactions:
SDK with Node.js
Demo
Examples
Unit conversion using ethers
Token decimals
Symbol
Decimals
Send tokens across chains
Send L1->L2
Send L2->L1
Send L2->L2
Send ETH
Get send calldata only
Using BigNumber as amount input
Specifying custom bonder fee
Sending to a custom recipient
Specifying custom min amount out
Specify custom deadline
Get approval address for sending over bridge
Get approval address for sending hTokens over bridge
Get allowance for bridge approval address
Check allowance and send approval
Estimate tokens amount out from swap
Estimate tokens that will be received at destination
Estimate amountOutMin
Estimate total bonder fee
Estimate base bonder fee:
Estimate bonder destination transaction fee:
Get all send data info:
Property
Type
Description
Get available liquidity for transfer
Get pool deposit price impact percent
Get transfer status
Watch for receipt events
Set custom provider RPC URLs
Withdraw an unbonded transfer at the destination
More examples
SDK API Reference
API ReferenceContract addresses
Contract AddressesLast updated