You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@debridge-finance/dln-client

Package Overview
Dependencies
Maintainers
5
Versions
304
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@debridge-finance/dln-client

A client SDK that facilitates interaction deSwap Liquidity Network (DLN) contracts on Solana and EVM blockchains

17.6.2
latest
Source
npmnpm
Version published
Weekly downloads
224
-32.53%
Maintainers
5
Weekly downloads
 
Created
Source

dln-client by deBridge

A 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.

A note on calculating execution fees and take cost

Consider looking at https://github.com/debridge-finance/dln-ts-client/pull/63 for definitions

DLN order creation and expenses

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.

Solana to EVM

Transactions order:

  • Order creation (Solana)
  • Fulfill (EVM) / Cancel (EVM)
  • Send unlock (EVM)
  • Claim (Solana)
  • Execution calldata (Solana)

Order creation

Transaction example. This transaction contains the following expenses and returns:

InstructionSpend typeAccount nameBytes (for alloc)LamportsComment
CreateOrderWithNoncerentgiveOrderState176-2115840
rentgiveOrderWallet165-2039280
rentnonceMaster16-1002240Is added when dln nonce account doesn't exists
tx fee-5000
priority fee

Claim

Claim transaction follows after fulfill/cancel and send unlock transactions in source chain. Transaction example. This transaction contains the following expenses and returns:

InstructionSpend typeAccount nameBytes (for alloc)LamportsComment
ClaimrentclaimToWallet165-2039280Should be returned after claim
rentsubmission194-2241120Should be returned after claim
rent returnconfirmationStorage+5909040
tx fee-5000
priority fee

Execution calldata

Before calldata execution you need to fulfill order. Transaction example. This transaction contains the following expenses and returns:

InstructionSpend typeAccount nameBytes (for alloc)LamportsComment
ExecuteExternalCallrent returnexternalCallStorage+13906080
rent returnexternalCallMeta+1085760
rent returnsubmissionWallet+2039280
tx fee-5000
priority fee

EVM to Solana

Transactions order:

  • Order creation (EVM)
  • Fulfill (Solana) / Cancel (Solana)
  • Send unlock (Solana)
  • Claim (EVM)
  • Execution calldata (EVM)

Fulfill

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:

InstructionSpend typeAccount nameBytes (for alloc)LamportsComment
FulfillOrderrenttakeOrderState106-1628640
InitializeExtcallMetarentexternalCallMeta200-2282880Creates if order contains calldata
rentexecuteWallet165-2039280Adds if take order token on Solana is SPL and calldata exists
tx fee-5000
priority fee

Send unlock

For availability to claim order in destination chain. Transaction example. This transaction contains the following expenses and returns:

InstructionSpend typeAccount nameBytes (for alloc)LamportsComment
PrepareSendtransfersendFrom= externalCallStorage + externalCallMeta + debridge fix fee (transferred to debridge feeBeneficiary)
transfersendFromWallet= execution fee
SendUnlock / SendBatchUnlockrentnonceStorage16-1002240Is added when debridge nonce account doesn't exist
rentexternalCallStorage76-1419840If batch unlock it would be 108 + (32 * n), where n - amount of orders in batch
rentexternalCallMeta28-1085760
protocol fee-30000000Transfers to feeBeneficiary (prod value, hanoi value is 100000)
execution fee-57823Depends from give chain, transfers to stakingWallet
tx fee-5000
priority fee

Cancel

Calls instead of fulfill if you want to cancel an order. Transaction example. This transaction contains the following expenses:

InstructionSpend typeAccount nameBytes (for alloc)LamportsComment
CancelOrderrenttakeOrderState106-1628640
PrepareSendtransfersendFrom= externalCallStorage + externalCallMeta + debridge fix fee (transferred to debridge feeBeneficiary)
transfersendFromWallet= execution fee
SendUnlockrentnonceStorage16-1002240Is added when debridge nonce account doesn't exist
rentexternalCallStorage76-1419840
rentexternalCallMeta28-1085760
protocol fee-30000000Transfers to feeBeneficiary (prod value, hanoi value is 100000)
execution fee-364728Depends from give chain, transfers to stakingWallet
tx fee-5000
priority fee

Keywords

deBridge

FAQs

Package last updated on 14 Nov 2024

Did you know?

Socket

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.

Install

Related posts