@lombard.finance/ts-verifier 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ name: Publish
2
+ run-name: Publish ts-verifier from ${{ github.ref_name }}
3
+
4
+ on:
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: [self-hosted]
10
+ environment: production
11
+ container:
12
+ image: ${{ vars.AWS_ECR_REGISTRY }}/library/alpine-git-node-aws:latest
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}-publish
15
+ cancel-in-progress: true
16
+
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+ ref: ${{ github.ref || github.sha }}
23
+
24
+ - name: Allow Git to access repo
25
+ run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
26
+
27
+ - name: Debug Git status
28
+ run: |
29
+ echo "PWD: $(pwd)"
30
+ ls -la
31
+ git status
32
+
33
+ - name: Set Git identity
34
+ run: |
35
+ git config user.name "${{ github.actor }}"
36
+ git config user.email "${{ github.actor }}@users.noreply.github.com"
37
+ echo "✅ Git identity configured successfully."
38
+
39
+ - name: Setup node
40
+ uses: actions/setup-node@v4
41
+ with:
42
+ node-version-file: '.nvmrc'
43
+ cache: yarn
44
+
45
+ - name: Install dependencies
46
+ run: yarn install --immutable
47
+
48
+ - name: Build package
49
+ run: yarn build
50
+
51
+ - name: Configure registry
52
+ working-directory: ./
53
+ run: |
54
+ npm config set access public -ws=false -iwr
55
+ npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPMJS_TOKEN }} -ws=false -iwr
56
+
57
+ - name: Publish
58
+ working-directory: ./
59
+ run: npm publish
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 22.14.0
package/CODEOWNERS ADDED
@@ -0,0 +1,2 @@
1
+ # Restrict any changes to GitHub workflow files without approval. This is required to protect sensitive NPM token.
2
+ /.github/workflows/ @megatron757 @fruit37 @le0n229
package/README.md CHANGED
@@ -28,7 +28,7 @@ yarn global add ts-node
28
28
  The library can be used very simply:
29
29
 
30
30
  ```bash
31
- ts-node verifier.ts <blockchain> <destination_address>
31
+ ts-node src/verifier.ts <blockchain> <destination_address>
32
32
  ```
33
33
 
34
34
  Possible options for blockchain are:
@@ -37,15 +37,54 @@ Possible options for blockchain are:
37
37
  - `bsc`
38
38
  - `base`
39
39
  - `sui`
40
+ - `sonic`
41
+ - `ink`
42
+ - `solana`
43
+ - `katana`
44
+
45
+ You can also run an example:
46
+ ```bash
47
+ ts-node src/example.ts
48
+ ```
40
49
 
41
50
  The library will query the Lombard API for deposit addresses, and then compute them internally to see if they match. For each deposit address linked to your destination address, the binary will attempt to match them, printing out 'match' or 'mismatch' in either case, and printing both addresses (fetched and derived) in all cases so that you may double-check the result yourself. It will look something like this:
42
51
 
43
52
  ```bash
44
- $ ts-node verifier.ts ethereum 0x564974801D2ffBE736Ed59C9bE39F6c0A4274aE6
45
- Checking for address bc1qu6mwr50akfpfwjes4nh53taexuhzt6gsf8ysnn:
46
- - partner code: lombard
47
- - nonce: 0
48
- Address fetched from API: bc1qu6mwr50akfpfwjes4nh53taexuhzt6gsf8ysnn
49
- Address computed: bc1qu6mwr50akfpfwjes4nh53taexuhzt6gsf8ysnn
50
- Addresses match!
53
+ $ ts-node src/verifier.ts ethereum 0x564974801D2ffBE736Ed59C9bE39F6c0A4274aE6
54
+ Address 1: bc1qu6mwr50akfpfwjes4nh53taexuhzt6gsf8ysnn
55
+ Metadata used:
56
+ - To Address: 0x564974801D2ffBE736Ed59C9bE39F6c0A4274aE6
57
+ - Blockchain: ethereum
58
+ - Partner Code: lombard
59
+ - Nonce: 0
60
+ - Aux Version: 0
61
+ - Token Address: 0x8236a87084f8b84306f72007f36f2618a5634494
62
+ Addresses match!
51
63
  ```
64
+
65
+ or like this:
66
+ ```bash
67
+ $ ts-node src/verifier.ts solana 74AYR1KpkXw3RYHia4KDGSGqNjGgEDWjLtdEvAgHcLu2
68
+ Address 1: bc1qhvquxlsegnyc3fsuckvs8qqm28puu23mycdh7u
69
+ Metadata used:
70
+ - To Address: 74AYR1KpkXw3RYHia4KDGSGqNjGgEDWjLtdEvAgHcLu2
71
+ - Blockchain: solana
72
+ - Partner Code: lombard
73
+ - Nonce: 0
74
+ - Aux Version: 0
75
+ - Token Address: LomP48F7bLbKyMRHHsDVt7wuHaUQvQnVVspjcbfuAek
76
+ Addresses match!
77
+
78
+ ------------------------------------------------------------
79
+
80
+ Address 2: bc1qast400qh327zr6gg8s0n0t05gu9q0z7utfmh00
81
+ Metadata used:
82
+ - To Address: 74AYR1KpkXw3RYHia4KDGSGqNjGgEDWjLtdEvAgHcLu2
83
+ - Blockchain: solana
84
+ - Partner Code: okx
85
+ - Nonce: 0
86
+ - Aux Version: 0
87
+ - Token Address: LomP48F7bLbKyMRHHsDVt7wuHaUQvQnVVspjcbfuAek
88
+ Addresses match!
89
+ ```
90
+
package/package.json CHANGED
@@ -1,18 +1,40 @@
1
1
  {
2
2
  "name": "@lombard.finance/ts-verifier",
3
3
  "description": "Lombard Deposit Address Verifier",
4
- "version": "0.1.0",
5
- "homepage": "/",
4
+ "version": "0.1.2",
5
+ "license": "MIT",
6
6
  "scripts": {
7
+ "build": "yarn types && vite build && yarn build-types",
8
+ "build-types": "tsc -b tsconfig.build.json",
9
+ "types": "tsc --noEmit",
7
10
  "format": "prettier *.js \"*{.js,.ts}\" -w",
8
11
  "lint": "prettier *.js \"*{.js,.ts}\" --check"
9
12
  },
13
+ "engines": {
14
+ "node": ">= 22.14.0"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "require": "./dist/index.cjs"
21
+ }
22
+ },
23
+ "type": "module",
24
+ "types": "./src/index.ts",
10
25
  "dependencies": {
11
- "@types/node": "^22.13.10",
12
- "@types/secp256k1": "^4.0.6",
26
+ "@solana/spl-token": "^0.4.13",
27
+ "@solana/web3.js": "^1.98.2",
13
28
  "bitcoinjs-lib": "^6.1.7",
14
- "prettier": "^3.5.3",
29
+ "bs58": "^6.0.0",
15
30
  "secp256k1": "^5.0.1",
16
- "typescript": "^5.8.2"
31
+ "typescript": "^5.8.3",
32
+ "vite": "^6.3.5"
33
+ },
34
+ "devDependencies": {
35
+ "@types/bs58": "^5.0.0",
36
+ "@types/node": "^22.13.10",
37
+ "@types/secp256k1": "^4.0.6",
38
+ "prettier": "^3.5.3"
17
39
  }
18
40
  }
package/src/api.ts ADDED
@@ -0,0 +1,122 @@
1
+ import bs58 from "bs58";
2
+ import { Networks, NetworkParams } from "./bitcoin";
3
+ import { Address, BlockchainConfig, Ecosystem } from "./chain-id";
4
+
5
+ // Get Addresses by Destination API
6
+ const MAINNET_URL =
7
+ "https://mainnet.prod.lombard.finance/api/v1/address/destination/";
8
+ const GASTALD_URL =
9
+ "https://gastald-testnet.prod.lombard.finance/api/v1/address/destination/";
10
+
11
+ // API Response interfaces
12
+ export interface DepositMetadata {
13
+ to_address: string;
14
+ to_blockchain: string;
15
+ referral: string;
16
+ nonce?: number;
17
+ token_address?: string;
18
+ aux_version?: number;
19
+ }
20
+
21
+ export interface AddressInfo {
22
+ btc_address: string;
23
+ type: string;
24
+ deposit_metadata: DepositMetadata;
25
+ created_at: string;
26
+ deprecated: boolean;
27
+ }
28
+
29
+ export interface ApiResponse {
30
+ addresses: AddressInfo[];
31
+ }
32
+
33
+ export class APIError extends Error {
34
+ constructor(
35
+ message: string,
36
+ public statusCode?: number,
37
+ ) {
38
+ super(message);
39
+ this.name = "APIError";
40
+ }
41
+ }
42
+
43
+ export interface AddressesResponse {
44
+ addresses: {
45
+ btcAddress: string;
46
+ toAddress: string;
47
+ referralId: string;
48
+ nonce: number;
49
+ auxVersion: number;
50
+ tokenAddress: Address;
51
+ }[];
52
+ }
53
+
54
+ // Fetch address data from the Lombard API
55
+ export async function fetchAddressMetadata(
56
+ chainConfig: BlockchainConfig,
57
+ toAddress: string,
58
+ network: NetworkParams,
59
+ ): Promise<AddressesResponse> {
60
+ try {
61
+ const url = `${network === Networks.mainnet ? MAINNET_URL : GASTALD_URL}${chainConfig.name}/${toAddress}`;
62
+ const response = await fetch(url);
63
+
64
+ if (!response.ok) {
65
+ throw new APIError(
66
+ `API request failed with status: ${response.status}`,
67
+ response.status,
68
+ );
69
+ }
70
+
71
+ const data = (await response.json()) as ApiResponse;
72
+
73
+ if (!data.addresses?.length) {
74
+ throw new APIError("No addresses returned from API");
75
+ }
76
+
77
+ const nonDeprecatedAddresses = data.addresses.filter(
78
+ (addr) => !addr.deprecated,
79
+ );
80
+
81
+ if (!nonDeprecatedAddresses.length) {
82
+ throw new APIError("No non-deprecated addresses found");
83
+ }
84
+
85
+ const addresses = await Promise.all(
86
+ nonDeprecatedAddresses.map(async (addr) => {
87
+ let tokenAddress = chainConfig.stlbtc;
88
+ if (addr.deposit_metadata.token_address != undefined) {
89
+ tokenAddress =
90
+ chainConfig.ecosystem === Ecosystem.Solana
91
+ ? Buffer.from(bs58.decode(addr.deposit_metadata.token_address))
92
+ : Buffer.from(
93
+ trimHexPrefix(addr.deposit_metadata.token_address),
94
+ "hex",
95
+ );
96
+ }
97
+
98
+ return {
99
+ btcAddress: addr.btc_address,
100
+ toAddress: addr.deposit_metadata.to_address,
101
+ referralId: addr.deposit_metadata.referral,
102
+ nonce: addr.deposit_metadata.nonce ?? 0,
103
+ auxVersion: addr.deposit_metadata.aux_version ?? 0,
104
+ tokenAddress: tokenAddress,
105
+ };
106
+ }),
107
+ );
108
+
109
+ return { addresses };
110
+ } catch (error: unknown) {
111
+ if (error instanceof APIError) {
112
+ throw error;
113
+ }
114
+
115
+ const errorMessage = error instanceof Error ? error.message : String(error);
116
+ throw new APIError(`Failed to fetch address data: ${errorMessage}`);
117
+ }
118
+ }
119
+
120
+ export function trimHexPrefix(hex: string): string {
121
+ return hex.startsWith("0x") ? hex.substring(2) : hex;
122
+ }
@@ -0,0 +1,49 @@
1
+ import * as crypto from "crypto";
2
+ import { sha256, BitcoinAddressError } from "./bitcoin";
3
+
4
+ const DEPOSIT_AUX_TAG = "LombardDepositAux";
5
+ const DEPOSIT_AUX_V0 = 0;
6
+ const DEPOSIT_AUX_V1 = 1;
7
+ const SUPPORTED_VERSIONS = new Set([DEPOSIT_AUX_V0, DEPOSIT_AUX_V1]);
8
+ const MAX_REFERRAL_ID_SIZE = 256;
9
+
10
+ /**
11
+ * Creates a tagged hasher used for deposit aux data
12
+ */
13
+ function auxDepositHasher(): crypto.Hash {
14
+ const tag = sha256(Buffer.from(DEPOSIT_AUX_TAG));
15
+
16
+ const h = crypto.createHash("sha256");
17
+ h.update(tag);
18
+ h.update(tag);
19
+
20
+ return h;
21
+ }
22
+
23
+ export function computeAuxData(
24
+ nonce: number,
25
+ referrerId: Buffer | Uint8Array,
26
+ version: number,
27
+ ): Buffer {
28
+ if (referrerId.length > MAX_REFERRAL_ID_SIZE) {
29
+ throw new BitcoinAddressError(
30
+ `Wrong size for referrerId (got ${referrerId.length}, want not greater than ${MAX_REFERRAL_ID_SIZE})`,
31
+ );
32
+ }
33
+
34
+ if (!SUPPORTED_VERSIONS.has(version)) {
35
+ throw new BitcoinAddressError("version is not supported");
36
+ }
37
+
38
+ const nonceBytes = Buffer.alloc(4);
39
+ nonceBytes.writeUInt32BE(nonce, 0);
40
+
41
+ const h = auxDepositHasher();
42
+
43
+ // Version0
44
+ h.update(Buffer.from([version]));
45
+ h.update(nonceBytes);
46
+ h.update(Buffer.from(referrerId));
47
+
48
+ return h.digest();
49
+ }
package/src/bitcoin.ts ADDED
@@ -0,0 +1,62 @@
1
+ import * as bitcoin from "bitcoinjs-lib";
2
+ import * as crypto from "crypto";
3
+
4
+ // Network Parameters
5
+ export interface NetworkParams {
6
+ messagePrefix: string;
7
+ bech32: string;
8
+ bip32: {
9
+ public: number;
10
+ private: number;
11
+ };
12
+ pubKeyHash: number;
13
+ scriptHash: number;
14
+ wif: number;
15
+ }
16
+
17
+ // Networks
18
+ export const Networks = {
19
+ mainnet: bitcoin.networks.bitcoin,
20
+ signet: {
21
+ messagePrefix: "\x18Bitcoin Signed Message:\n",
22
+ bech32: "tb",
23
+ bip32: {
24
+ public: 0x043587cf,
25
+ private: 0x04358394,
26
+ },
27
+ pubKeyHash: 0x6f,
28
+ scriptHash: 0xc4,
29
+ wif: 0xef,
30
+ } as NetworkParams,
31
+ };
32
+
33
+ // Error classes
34
+ export class BitcoinAddressError extends Error {
35
+ constructor(message: string) {
36
+ super(message);
37
+ this.name = "BitcoinAddressError";
38
+ }
39
+ }
40
+
41
+ /**
42
+ * Converts a public key to a segwit address
43
+ */
44
+ export function pubkeyToSegwitAddr(
45
+ publicKey: Buffer,
46
+ network: NetworkParams,
47
+ ): string {
48
+ const publicKeyHash = bitcoin.crypto.hash160(publicKey);
49
+ const address = bitcoin.payments.p2wpkh({
50
+ hash: publicKeyHash,
51
+ network: network,
52
+ });
53
+
54
+ return address.address!;
55
+ }
56
+
57
+ /**
58
+ * Helper function to create a SHA-256 hash
59
+ */
60
+ export function sha256(data: Buffer | Uint8Array): Buffer {
61
+ return crypto.createHash("sha256").update(data).digest();
62
+ }
@@ -0,0 +1,280 @@
1
+ import bs58 from "bs58";
2
+
3
+ // Address type
4
+ export type Address = Buffer;
5
+
6
+ // ChainId type
7
+ export type LChainId = Buffer;
8
+
9
+ // Blockchain Types
10
+ export enum Ecosystem {
11
+ EVM = "evm",
12
+ Sui = "sui",
13
+ Solana = "solana",
14
+ }
15
+
16
+ export enum SupportedBlockchains {
17
+ Ethereum = "ethereum",
18
+ Base = "base",
19
+ BSC = "bsc",
20
+ Sui = "sui",
21
+ Sonic = "sonic",
22
+ Ink = "ink",
23
+ Solana = "solana",
24
+ Katana = "katana",
25
+ }
26
+
27
+ // Blockchain configuration map for mainnet
28
+ export const mainnetBlockchainConfigs = new Map([
29
+ [
30
+ SupportedBlockchains.Ethereum,
31
+ {
32
+ chainId: Buffer.from(
33
+ "0000000000000000000000000000000000000000000000000000000000000001",
34
+ "hex",
35
+ ),
36
+ stlbtc: Buffer.from("8236a87084f8B84306f72007F36F2618A5634494", "hex"),
37
+ nativeLbtc: null,
38
+ name: "DESTINATION_BLOCKCHAIN_ETHEREUM",
39
+ ecosystem: Ecosystem.EVM,
40
+ },
41
+ ],
42
+
43
+ [
44
+ SupportedBlockchains.Base,
45
+ {
46
+ chainId: Buffer.from(
47
+ "0000000000000000000000000000000000000000000000000000000000002105",
48
+ "hex",
49
+ ),
50
+ stlbtc: Buffer.from("ecAc9C5F704e954931349Da37F60E39f515c11c1", "hex"),
51
+ nativeLbtc: null,
52
+ name: "DESTINATION_BLOCKCHAIN_BASE",
53
+ ecosystem: Ecosystem.EVM,
54
+ },
55
+ ],
56
+
57
+ [
58
+ SupportedBlockchains.BSC,
59
+ {
60
+ chainId: Buffer.from(
61
+ "0000000000000000000000000000000000000000000000000000000000000038",
62
+ "hex",
63
+ ),
64
+ stlbtc: Buffer.from("ecAc9C5F704e954931349Da37F60E39f515c11c1", "hex"),
65
+ nativeLbtc: null,
66
+ name: "DESTINATION_BLOCKCHAIN_BSC",
67
+ ecosystem: Ecosystem.EVM,
68
+ },
69
+ ],
70
+
71
+ [
72
+ SupportedBlockchains.Sui,
73
+ {
74
+ chainId: Buffer.from(
75
+ "0100000000000000000000000000000000000000000000000000000035834a8a",
76
+ "hex",
77
+ ),
78
+ stlbtc: Buffer.from(
79
+ "3e8e9423d80e1774a7ca128fccd8bf5f1f7753be658c5e645929037f7c819040",
80
+ "hex",
81
+ ),
82
+ nativeLbtc: null,
83
+ name: "DESTINATION_BLOCKCHAIN_SUI",
84
+ ecosystem: Ecosystem.Sui,
85
+ },
86
+ ],
87
+
88
+ [
89
+ SupportedBlockchains.Sonic,
90
+ {
91
+ chainId: Buffer.from(
92
+ "0000000000000000000000000000000000000000000000000000000000000092",
93
+ "hex",
94
+ ),
95
+ stlbtc: Buffer.from("ecAc9C5F704e954931349Da37F60E39f515c11c1", "hex"),
96
+ nativeLbtc: null,
97
+ name: "DESTINATION_BLOCKCHAIN_SONIC",
98
+ ecosystem: Ecosystem.EVM,
99
+ },
100
+ ],
101
+
102
+ [
103
+ SupportedBlockchains.Ink,
104
+ {
105
+ chainId: Buffer.from(
106
+ "000000000000000000000000000000000000000000000000000000000000def1",
107
+ "hex",
108
+ ),
109
+ stlbtc: Buffer.from("ecAc9C5F704e954931349Da37F60E39f515c11c1", "hex"),
110
+ nativeLbtc: null,
111
+ name: "DESTINATION_BLOCKCHAIN_INK",
112
+ ecosystem: Ecosystem.EVM,
113
+ },
114
+ ],
115
+
116
+ [
117
+ SupportedBlockchains.Solana,
118
+ {
119
+ chainId: Buffer.from(
120
+ "02296998a6f8e2a784db5d9f95e18fc23f70441a1039446801089879b08c7ef0",
121
+ "hex",
122
+ ),
123
+ stlbtc: Buffer.from(
124
+ bs58.decode("LomP48F7bLbKyMRHHsDVt7wuHaUQvQnVVspjcbfuAek"),
125
+ ),
126
+ nativeLbtc: null,
127
+ name: "DESTINATION_BLOCKCHAIN_SOLANA",
128
+ ecosystem: Ecosystem.Solana,
129
+ },
130
+ ],
131
+
132
+ [
133
+ SupportedBlockchains.Katana,
134
+ {
135
+ chainId: Buffer.from(
136
+ "00000000000000000000000000000000000000000000000000000000000b67d2",
137
+ "hex",
138
+ ),
139
+ stlbtc: Buffer.from("ecAc9C5F704e954931349Da37F60E39f515c11c1", "hex"),
140
+ nativeLbtc: Buffer.from(
141
+ "B0F70C0bD6FD87dbEb7C10dC692a2a6106817072",
142
+ "hex",
143
+ ),
144
+ name: "DESTINATION_BLOCKCHAIN_KATANA",
145
+ ecosystem: Ecosystem.EVM,
146
+ },
147
+ ],
148
+ ]);
149
+
150
+ // Blockchain configuration map for Gastald testnet
151
+ export const gastaldBlockchainConfigs = new Map([
152
+ [
153
+ SupportedBlockchains.Ethereum,
154
+ {
155
+ chainId: Buffer.from(
156
+ "0000000000000000000000000000000000000000000000000000000000004268",
157
+ "hex",
158
+ ),
159
+ stlbtc: Buffer.from("38A13AB20D15ffbE5A7312d2336EF1552580a4E2", "hex"),
160
+ nativeLbtc: null,
161
+ name: "DESTINATION_BLOCKCHAIN_ETHEREUM",
162
+ ecosystem: Ecosystem.EVM,
163
+ },
164
+ ],
165
+
166
+ [
167
+ SupportedBlockchains.Base,
168
+ {
169
+ chainId: Buffer.from(
170
+ "0000000000000000000000000000000000000000000000000000000000014a34",
171
+ "hex",
172
+ ),
173
+ stlbtc: Buffer.from("107Fc7d90484534704dD2A9e24c7BD45DB4dD1B5", "hex"),
174
+ nativeLbtc: null,
175
+ name: "DESTINATION_BLOCKCHAIN_BASE",
176
+ ecosystem: Ecosystem.EVM,
177
+ },
178
+ ],
179
+
180
+ [
181
+ SupportedBlockchains.BSC,
182
+ {
183
+ chainId: Buffer.from(
184
+ "0000000000000000000000000000000000000000000000000000000000000061",
185
+ "hex",
186
+ ),
187
+ stlbtc: Buffer.from("107Fc7d90484534704dD2A9e24c7BD45DB4dD1B5", "hex"),
188
+ nativeLbtc: null,
189
+ name: "DESTINATION_BLOCKCHAIN_BSC",
190
+ ecosystem: Ecosystem.EVM,
191
+ },
192
+ ],
193
+
194
+ [
195
+ SupportedBlockchains.Sui,
196
+ {
197
+ chainId: Buffer.from(
198
+ "010000000000000000000000000000000000000000000000000000004c78adac",
199
+ "hex",
200
+ ),
201
+ stlbtc: Buffer.from(
202
+ "50454d0b0fbad1288a6ab74f2e8ce0905a3317870673ab7787ebcf6f322b45fa",
203
+ "hex",
204
+ ),
205
+ nativeLbtc: null,
206
+ name: "DESTINATION_BLOCKCHAIN_SUI",
207
+ ecosystem: Ecosystem.Sui,
208
+ },
209
+ ],
210
+
211
+ [
212
+ SupportedBlockchains.Sonic,
213
+ {
214
+ chainId: Buffer.from(
215
+ "000000000000000000000000000000000000000000000000000000000000dede",
216
+ "hex",
217
+ ),
218
+ stlbtc: Buffer.from("107Fc7d90484534704dD2A9e24c7BD45DB4dD1B5", "hex"),
219
+ nativeLbtc: null,
220
+ name: "DESTINATION_BLOCKCHAIN_SONIC",
221
+ ecosystem: Ecosystem.EVM,
222
+ },
223
+ ],
224
+
225
+ [
226
+ SupportedBlockchains.Ink,
227
+ {
228
+ chainId: Buffer.from(
229
+ "00000000000000000000000000000000000000000000000000000000000ba5ed",
230
+ "hex",
231
+ ),
232
+ stlbtc: Buffer.from("107Fc7d90484534704dD2A9e24c7BD45DB4dD1B5", "hex"),
233
+ nativeLbtc: null,
234
+ name: "DESTINATION_BLOCKCHAIN_INK",
235
+ ecosystem: Ecosystem.EVM,
236
+ },
237
+ ],
238
+
239
+ [
240
+ SupportedBlockchains.Solana,
241
+ {
242
+ chainId: Buffer.from(
243
+ "0259db5080fc2c6d3bcf7ca90712d3c2e5e6c28f27f0dfbb9953bdb0894c03ab",
244
+ "hex",
245
+ ),
246
+ stlbtc: Buffer.from(
247
+ bs58.decode("79cscM6J9Af24TGGWcXyDf56fDLoodkyXdVy4R9aZ6C6"),
248
+ ),
249
+ nativeLbtc: null,
250
+ name: "DESTINATION_BLOCKCHAIN_SOLANA",
251
+ ecosystem: Ecosystem.Solana,
252
+ },
253
+ ],
254
+
255
+ [
256
+ SupportedBlockchains.Katana,
257
+ {
258
+ chainId: Buffer.from(
259
+ "000000000000000000000000000000000000000000000000000000000001f977",
260
+ "hex",
261
+ ),
262
+ stlbtc: Buffer.from("107Fc7d90484534704dD2A9e24c7BD45DB4dD1B5", "hex"),
263
+ nativeLbtc: Buffer.from(
264
+ "20eA7b8ABb4B583788F1DFC738C709a2d9675681",
265
+ "hex",
266
+ ),
267
+ name: "DESTINATION_BLOCKCHAIN_KATANA",
268
+ ecosystem: Ecosystem.EVM,
269
+ },
270
+ ],
271
+ ]);
272
+
273
+ // Type definition for the config structure
274
+ export interface BlockchainConfig {
275
+ chainId: LChainId;
276
+ stlbtc: Address;
277
+ nativeLbtc: Address | null;
278
+ name: string;
279
+ ecosystem: Ecosystem;
280
+ }