npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@debridge-finance/dln-client

v17.1.0-dev103

Published

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

Downloads

3,889

Readme

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:

  1. Order creation (Solana)
  2. Fulfill (EVM) / Cancel (EVM)
  3. Send unlock (EVM)
  4. Claim (Solana)
  5. Execution calldata (Solana)

Order creation

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

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

Execution calldata

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

EVM to Solana

Transactions order:

  1. Order creation (EVM)
  2. Fulfill (Solana) / Cancel (Solana)
  3. Send unlock (Solana)
  4. Claim (EVM)
  5. 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:

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

Send unlock

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

Cancel

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