Code less, ship more
Speedy setup
deBridgeGate.sendMessage{value: _executionFeeValue }(
_destinationChainId,
_destinationContractAddress,
_destinationContractCalldata
);
deBridgeGate.sendMessage{value: _executionFeeValue }(
7565164,
_destinationContractAddress,
_destinationContractCalldata
);
import { DeBridgeSolanaClient } from "@debridge-finance/solana-contracts-client"; import { Connection, Keypair, clusterApiUrl, PublicKey } from "@solana/web3.js"; const wallet = Keypair.fromSecretKey(YOUR_SECRET_KEY_BUFFER); const conn = new Connection(clusterApiUrl("mainnet-beta")); const receiver = "0xfAC8EeA7f91DAde441876118AF8Af5C16e35f406"; const client = new DeBridgeSolanaClient(conn, undefined, { programId: "required env debridge programId", settingsProgramId: "required env debridge settings programId", }); const { transaction } = await client.buildSendInstruction( wallet.publicKey, null, 0, new PublicKey("So11111111111111111111111111111111111111112"), receiver, 137, false, 0, receiver, undefined, undefined, Buffer.from("Hello world!") ); const txId = await conn.sendTransaction(transaction, [wallet]); console.log(`Sent tx: ${txId}`);
Instant cross-chain interactions with DLN
Automatic execution
Try applications
Transfer and deploy NFTs cross-chain
Coming Soon
Integrate DLN API
const { formatEther } = require("ethers/lib/utils"); async function quote(params) { const response = await fetch('https://api.dln.trade/v1.0/dln/quote?' + new URLSearchParams(params)); const data = await response.json(); if (data.errorCode) throw new Error(data.errorId) return data } async function main() { console.log("Trading 1 ETH from Ethereum to BNB...") const { estimation } = await quote({ srcChainId: 1, srcChainTokenIn: '0x0000000000000000000000000000000000000000', srcChainTokenInAmount: '1000000000000000000', dstChainTokenOutAmount: '0', dstChainId: 56, dstChainTokenOut: '0x0000000000000000000000000000000000000000', prependOperatingExpenses: true }); const minOutcome = estimation.dstChainTokenOut.amount; const minOutcomeWithoutDecimals = formatEther(minOutcome) console.log(`Expected outcome: ${minOutcomeWithoutDecimals} BNB`) } main().catch(err => console.error(err))
#!/bin/bash
curl -s "https://api.dln.trade/v1.0/dln/quote?srcChainId=1&srcChainTokenIn=0x0000000000000000000000000000000000000000&srcChainTokenInAmount=1000000000000000000&dstChainTokenOutAmount=0&dstChainId=56&dstChainTokenOut=0x0000000000000000000000000000000000000000&prependOperatingExpenses=true" | jq
admin@debridge: ~ node dln.js
Trading 1 ETH from Ethereum to BNB...
Expected outcome: BNB
admin@debridge: bash dln.sh