
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
@debridge-finance/dln-client
Advanced tools
A client SDK that facilitates interaction deSwap Liquidity Network (DLN) contracts on Solana and EVM blockchains
dln-client
by deBridgeA client SDK that facilitates interaction deSwap Liquidity Network (DLN) contracts on Solana and EVM blockchains. DLN is built on top of the deBridge cross-chain messaging protocol.
Consider looking at https://github.com/debridge-finance/dln-ts-client/pull/63 for definitions
Main flow:
Order creation -> Fulfill / Cancel -> Send unlock -> Claim
After order creation you need to send fulfill, unlock transactions. Also, if order has calldata you need to store and execute it.
Transactions order:
Transaction example. This transaction contains the following expenses and returns:
Instruction | Spend type | Account name | Bytes (for alloc) | Lamports | Comment |
---|---|---|---|---|---|
CreateOrderWithNonce | rent | giveOrderState | 176 | -2115840 | |
rent | giveOrderWallet | 165 | -2039280 | ||
rent | nonceMaster | 16 | -1002240 | Is added when dln nonce account doesn't exists | |
tx fee | -5000 | ||||
priority fee |
Claim transaction follows after fulfill/cancel and send unlock transactions in source chain. Transaction example. This transaction contains the following expenses and returns:
Instruction | Spend type | Account name | Bytes (for alloc) | Lamports | Comment |
---|---|---|---|---|---|
Claim | rent | claimToWallet | 165 | -2039280 | Should be returned after claim |
rent | submission | 194 | -2241120 | Should be returned after claim | |
rent return | confirmationStorage | +5909040 | |||
tx fee | -5000 | ||||
priority fee |
Before calldata execution you need to fulfill order. Transaction example. This transaction contains the following expenses and returns:
Instruction | Spend type | Account name | Bytes (for alloc) | Lamports | Comment |
---|---|---|---|---|---|
ExecuteExternalCall | rent return | externalCallStorage | +13906080 | ||
rent return | externalCallMeta | +1085760 | |||
rent return | submissionWallet | +2039280 | |||
tx fee | -5000 | ||||
priority fee |
Transactions order:
Creates accounts for on-chain data storing which contains order state and additional accounts for calldata.
Transaction example.
This transaction contains the following expenses and returns:
Instruction | Spend type | Account name | Bytes (for alloc) | Lamports | Comment |
---|---|---|---|---|---|
FulfillOrder | rent | takeOrderState | 106 | -1628640 | |
InitializeExtcallMeta | rent | externalCallMeta | 200 | -2282880 | Creates if order contains calldata |
rent | executeWallet | 165 | -2039280 | Adds if take order token on Solana is SPL and calldata exists | |
tx fee | -5000 | ||||
priority fee |
For availability to claim order in destination chain. Transaction example. This transaction contains the following expenses and returns:
Instruction | Spend type | Account name | Bytes (for alloc) | Lamports | Comment |
---|---|---|---|---|---|
PrepareSend | transfer | sendFrom | = externalCallStorage + externalCallMeta + debridge fix fee (transferred to debridge feeBeneficiary) | ||
transfer | sendFromWallet | = execution fee | |||
SendUnlock / SendBatchUnlock | rent | nonceStorage | 16 | -1002240 | Is added when debridge nonce account doesn't exist |
rent | externalCallStorage | 76 | -1419840 | If batch unlock it would be 108 + (32 * n), where n - amount of orders in batch | |
rent | externalCallMeta | 28 | -1085760 | ||
protocol fee | -30000000 | Transfers to feeBeneficiary (prod value, hanoi value is 100000) | |||
execution fee | -57823 | Depends from give chain, transfers to stakingWallet | |||
tx fee | -5000 | ||||
priority fee |
Calls instead of fulfill if you want to cancel an order. Transaction example. This transaction contains the following expenses:
Instruction | Spend type | Account name | Bytes (for alloc) | Lamports | Comment |
---|---|---|---|---|---|
CancelOrder | rent | takeOrderState | 106 | -1628640 | |
PrepareSend | transfer | sendFrom | = externalCallStorage + externalCallMeta + debridge fix fee (transferred to debridge feeBeneficiary) | ||
transfer | sendFromWallet | = execution fee | |||
SendUnlock | rent | nonceStorage | 16 | -1002240 | Is added when debridge nonce account doesn't exist |
rent | externalCallStorage | 76 | -1419840 | ||
rent | externalCallMeta | 28 | -1085760 | ||
protocol fee | -30000000 | Transfers to feeBeneficiary (prod value, hanoi value is 100000) | |||
execution fee | -364728 | Depends from give chain, transfers to stakingWallet | |||
tx fee | -5000 | ||||
priority fee |
FAQs
A client SDK that facilitates interaction deSwap Liquidity Network (DLN) contracts on Solana and EVM blockchains
The npm package @debridge-finance/dln-client receives a total of 135 weekly downloads. As such, @debridge-finance/dln-client popularity was classified as not popular.
We found that @debridge-finance/dln-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.