APIs
Hyphen can also be integrated using APIs too.
Last updated
Hyphen can also be integrated using APIs too.
Last updated
In some scenarios, where SDK integration is not possible due to any circumstances, Hyphen APIs can be used directly to integrate the same on any Platform.
These are the same APIs that are being used in the SDK internally.
Environment | Base URL |
---|---|
GET
https://hyphen-v2-api.biconomy.io/api/v1/admin/supported-token/list
This API will give supported tokens as well as destination chain ids
Name | Type | Description |
---|---|---|
Get Min & Max transfer amount allowed in Hyphen for the Token. Also, you get the Available liquidity on the destination chain.
GET
https://hyphen-v2-api.biconomy.io/api/v1/insta-exit/get-pool-info
Get transfer fee components for given deposit amount, token, source and destination chain. Fee component includes dynamic LP fee, gas fee for destination chain transaction, reward amount for filling up deficit pool on source chain. All these components constitutes netTransferFee and amountToGet on destination chain.
GET
https://hyphen-v2-api.biconomy.io/api/v1/data/transferFee
Check if the cross-transfer requirement can be fulfilled or not, before initiating the deposit.
POST
https://hyphen-v2-api.biconomy.io/api/v1/insta-exit/system-status
Once All the above checks are passed, now you can initiate the Transfer functionality.
For Native currency on source chain, call depositNative() method. No Approval Required.
For Erc20, call depositErc20() method. Approval is required before the deposit
Hyphen contract ABI: https://etherscan.io/address/0xd0ee149a4ceec165c456c1e2d4372318e4df82bd#contracts
Hyphen pools address are same on all supported networks.
Once a deposit is initiated, keep calling this API at certain interval to get the status of the deposit request. If processed, it will return the exit hash along with status "PROCESSED"
GET
https://hyphen-v2-api.biconomy.io/api/v1/insta-exit/check-status
In some scenarios, somehow the deposit hash is not received by our watch-towers. To mitigate this, we have this manual exit API, which can be triggered after some time, if the Exit transfer transaction is not received. This API should be used in very extreme situation as Hyphen also runs reconciliations scripts that picks up any transactions that were ignored by watch towers for any reason.
POST
https://hyphen-v2-api.biconomy.io/api/v1/insta-exit/execute
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Prod
Test
networkId*
number
Source chain id 1 for Ethereum
137 for Polygon
43114 for Avalanche
tokenAddress*
String
Token Address from above api
fromChainId*
Nmber
Source chain id
toChainId*
Number
Destination chain id
fromChainId*
number
Chain id of source chain eg. 137 for Polygon
toChainId*
number
Chain id of destination chain eg. 1 for ethereum
tokenAddress*
String
Token address on source chain which is being deposited
amount
String
Amount of token being transferred in lowest unit like wei.
For eg., if user is depositing 6 USDC then value should be "6000000"
tokenAddress*
String
Source chain token Address
amount*
String
in wei
fromChainId*
String
Source chain id
toChainId*
String
Destination chain Id
userAddress*
String
Sender address
fromChainId*
Number
Source chain id
depositHash*
String
Deposit hash from source chain
depositHash*
String
fromChainId*
number