Claim Cross-Chain Link
Claim on Any Chain in Any Token
Cross-Chain claiming (also called "X-Chain" for short) provides a seamless and flexible way to claim tokens across different blockchain networks. There are 2 primary approaches to claim links cross-chain:
Gasless claim through our API/relayer. We will execute the transaction and pay all the transaction + bridging fees, but we will take a small portion of the Link's amount as a compensation. Currently we take 2%.
Claim by signing the transaction yourself. This way you will have to execute the transaction on the source chain and pay the bridging fee, but there will be no Peanut-specific fee involved.
Gasless Claiming
To claim a Link gaslessly through our API, use the claimLinkXChainGasless
function:
Claiming Yourself
To claim a Link by signing the transaction yourself, follow these three steps:
Create a cross-chain claiming payload via
createClaimXChainPayload
function.Create an Ethersv5 transaction request out of this payload by using
populateXChainClaimTx
function.Sign the transaction request with your own wallet & submit it to the blockchain. There is a helpful
signAndSubmitTx
function.
The following are helpful cross-chains functions.
createClaimXChainPayload
createClaimXChainPayload
To use the createClaimXChainPayload
function, follow the code snippet below:
populateXChainClaimTx
populateXChainClaimTx
To use the populateXChainClaimTx
function, follow the code snippet below:
Notes
Ensure you have the necessary environment variables set, particularly
PEANUT_API_KEY
if you are claiming though our API. Fill out this form to get your very own peanut-api-key!Be aware of the network fees and slippage settings if you pay the x-chain gas. Cross-chain claiming gas fees can be high depending on the source and destination chain.
The
claimLinkXChainGasless
function is convenient but remember that in the future it will have a 2% fee.Always test your implementation in a testnet environment before deploying to production.
For further information or support, feel free to join our Discord or send a message via Telegram.
Last updated