@ledgerhq/coin-tester-solana 1.7.0-nightly.20251205111238 → 1.7.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/coin-tester-solana",
3
- "version": "1.7.0-nightly.20251205111238",
3
+ "version": "1.7.0",
4
4
  "description": "Ledger Solana Coin Tester",
5
5
  "main": "src/scenarii.test.ts",
6
6
  "keywords": [
@@ -49,14 +49,14 @@
49
49
  "bignumber.js": "^9",
50
50
  "docker-compose": "^1",
51
51
  "msw": "^2",
52
- "@ledgerhq/coin-framework": "^6.10.0-nightly.20251205111238",
53
- "@ledgerhq/coin-tester": "^0.13.0-nightly.20251205111238",
54
- "@ledgerhq/coin-solana": "^0.38.0-nightly.20251205111238",
55
- "@ledgerhq/cryptoassets": "^13.34.0-nightly.20251205111238",
56
- "@ledgerhq/live-env": "^2.22.0-nightly.20251205111238",
57
- "@ledgerhq/live-signer-solana": "^0.6.2-nightly.20251205111238",
52
+ "@ledgerhq/coin-framework": "^6.10.0",
53
+ "@ledgerhq/coin-tester": "^0.13.0",
54
+ "@ledgerhq/live-env": "^2.22.0",
55
+ "@ledgerhq/coin-solana": "^0.38.0",
56
+ "@ledgerhq/cryptoassets": "^13.34.0",
58
57
  "@ledgerhq/types-cryptoassets": "^7.30.0",
59
- "@ledgerhq/types-live": "^6.90.0-nightly.20251205111238"
58
+ "@ledgerhq/types-live": "^6.90.0",
59
+ "@ledgerhq/live-signer-solana": "^0.7.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/jest": "^29",
package/src/fixtures.ts CHANGED
@@ -256,9 +256,6 @@ export function initMSW() {
256
256
  http.get("https://earn.api.live.ledger.com/v0/network/solana/validator-details", () =>
257
257
  HttpResponse.json([]),
258
258
  ),
259
- http.get("https://earn-dashboard.aws.stg.ldg-tech.com/figment/solana/validators_summary", () =>
260
- HttpResponse.json([]),
261
- ),
262
259
  http.get("https://crypto-assets-service.api.ledger.com/v1/tokens", ({ request }) => {
263
260
  const url = new URL(request.url);
264
261
  switch (url.searchParams.get("id")) {
@@ -305,7 +302,7 @@ export function initMSW() {
305
302
  mockServer.listen({
306
303
  onUnhandledRequest: request => {
307
304
  const hostname = new URL(request.url).hostname;
308
- if (["127.0.0.1", "localhost"].includes(hostname)) return;
305
+ if (hostname === "localhost") return;
309
306
  throw new Error("Unhandled request");
310
307
  },
311
308
  });
@@ -14,7 +14,7 @@ import {
14
14
  makeAccount,
15
15
  } from "../fixtures";
16
16
  import { CoinConfig } from "@ledgerhq/coin-framework/config";
17
- import { SolanaCoinConfig } from "@ledgerhq/coin-solana/config";
17
+ import solanaCoinConfig, { SolanaCoinConfig } from "@ledgerhq/coin-solana/config";
18
18
  import BigNumber from "bignumber.js";
19
19
  import { setEnv } from "@ledgerhq/live-env";
20
20
  import { airdrop, killAgave, spawnAgave } from "../agave";
@@ -29,7 +29,8 @@ import {
29
29
  initStakeAccount,
30
30
  initVoteAccount,
31
31
  } from "../connection";
32
- import { createBridges } from "@ledgerhq/coin-solana/bridge/js";
32
+ import { Config, getChainAPI } from "@ledgerhq/coin-solana/network/index";
33
+ import { makeBridges } from "@ledgerhq/coin-solana/bridge/bridge";
33
34
 
34
35
  global.console = require("console");
35
36
  jest.setTimeout(100_000);
@@ -435,7 +436,18 @@ export const scenarioSolana: Scenario<SolanaTransaction, SolanaAccount> = {
435
436
  token2022Enabled: true,
436
437
  legacyOCMSMaxVersion: "1.8.0",
437
438
  });
438
- const { accountBridge, currencyBridge } = createBridges(signerContext, coinConfig);
439
+ solanaCoinConfig.setCoinConfig(coinConfig);
440
+ const chainAPICache = new Map<string, ReturnType<typeof getChainAPI>>();
441
+ const { accountBridge, currencyBridge } = makeBridges({
442
+ getAPI: (config: Config) => {
443
+ const endpoint = config.endpoint;
444
+ if (!chainAPICache.has(endpoint)) {
445
+ chainAPICache.set(endpoint, getChainAPI(config));
446
+ }
447
+ return chainAPICache.get(endpoint)!;
448
+ },
449
+ signerContext,
450
+ });
439
451
 
440
452
  await airdrop(account.freshAddress, 5);
441
453
  await airdrop(PAYER.publicKey.toBase58(), 5);