From 8085dd3eec2e2851ea9485e2e342e62e53d60a08 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Wed, 20 Mar 2024 16:32:42 +0300 Subject: [PATCH 01/10] chore(LLC): update @solana/spl-token@0.4.6, @solana/web3.js@1.91.6 --- libs/coin-modules/coin-solana/package.json | 4 +- libs/ledger-live-common/package.json | 2 +- pnpm-lock.yaml | 134 ++++++++++++++++++--- 3 files changed, 122 insertions(+), 18 deletions(-) diff --git a/libs/coin-modules/coin-solana/package.json b/libs/coin-modules/coin-solana/package.json index 1c0a49d14e5c..a4af5c65b276 100644 --- a/libs/coin-modules/coin-solana/package.json +++ b/libs/coin-modules/coin-solana/package.json @@ -53,8 +53,8 @@ "@ledgerhq/logs": "workspace:^", "@ledgerhq/types-cryptoassets": "workspace:^", "@ledgerhq/types-live": "workspace:^", - "@solana/spl-token": "^0.3.7", - "@solana/web3.js": "1.77.3", + "@solana/spl-token": "0.4.6", + "@solana/web3.js": "1.91.6", "bignumber.js": "^9.1.2", "bs58": "^4.0.1", "expect": "^27.4.6", diff --git a/libs/ledger-live-common/package.json b/libs/ledger-live-common/package.json index 434f6c5cecfb..a265076f172c 100644 --- a/libs/ledger-live-common/package.json +++ b/libs/ledger-live-common/package.json @@ -254,7 +254,7 @@ "@ledgerhq/types-cryptoassets": "workspace:^", "@ledgerhq/types-devices": "workspace:^", "@ledgerhq/types-live": "workspace:^", - "@solana/web3.js": "1.77.3", + "@solana/web3.js": "1.91.6", "@svgr/core": "^5.5.0", "@tanstack/react-query": "^5.28.9", "@testing-library/react": "^14.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e783b29be9fa..a7776249e616 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2774,11 +2774,11 @@ importers: specifier: workspace:^ version: link:../../ledgerjs/packages/types-live '@solana/spl-token': - specifier: ^0.3.7 - version: 0.3.8(@solana/web3.js@1.77.3) + specifier: 0.4.6 + version: 0.4.6(@solana/web3.js@1.91.6) '@solana/web3.js': - specifier: 1.77.3 - version: 1.77.3 + specifier: 1.91.6 + version: 1.91.6 bignumber.js: specifier: ^9.1.2 version: 9.1.2 @@ -3994,8 +3994,8 @@ importers: specifier: workspace:^ version: link:../ledgerjs/packages/types-live '@solana/web3.js': - specifier: 1.77.3 - version: 1.77.3 + specifier: 1.91.6 + version: 1.91.6 '@svgr/core': specifier: ^5.5.0 version: 5.5.0 @@ -13286,14 +13286,54 @@ packages: resolution: {integrity: sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==} engines: {node: '>=5.10'} - '@solana/spl-token@0.3.8': - resolution: {integrity: sha512-ogwGDcunP9Lkj+9CODOWMiVJEdRtqHAtX2rWF62KxnnSWtMZtV9rDhTrZFshiyJmxDnRL/1nKE1yJHg4jjs3gg==} + '@solana/codecs-core@2.0.0-preview.2': + resolution: {integrity: sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg==} + + '@solana/codecs-data-structures@2.0.0-preview.2': + resolution: {integrity: sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg==} + + '@solana/codecs-numbers@2.0.0-preview.2': + resolution: {integrity: sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw==} + + '@solana/codecs-strings@2.0.0-preview.2': + resolution: {integrity: sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g==} + peerDependencies: + fastestsmallesttextencoderdecoder: ^1.0.22 + + '@solana/codecs@2.0.0-preview.2': + resolution: {integrity: sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA==} + + '@solana/errors@2.0.0-preview.2': + resolution: {integrity: sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA==} + hasBin: true + + '@solana/options@2.0.0-preview.2': + resolution: {integrity: sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w==} + + '@solana/spl-token-group@0.0.4': + resolution: {integrity: sha512-7+80nrEMdUKlK37V6kOe024+T7J4nNss0F8LQ9OOPYdWCCfJmsGUzVx2W3oeizZR4IHM6N4yC9v1Xqwc3BTPWw==} + engines: {node: '>=16'} + peerDependencies: + '@solana/web3.js': ^1.91.6 + + '@solana/spl-token-metadata@0.1.4': + resolution: {integrity: sha512-N3gZ8DlW6NWDV28+vCCDJoTqaCZiF/jDUnk3o8GRkAFzHObiR60Bs1gXHBa8zCPdvOwiG6Z3dg5pg7+RW6XNsQ==} + engines: {node: '>=16'} + peerDependencies: + '@solana/web3.js': ^1.91.6 + + '@solana/spl-token@0.4.6': + resolution: {integrity: sha512-1nCnUqfHVtdguFciVWaY/RKcQz1IF4b31jnKgAmjU9QVN1q7dRUkTEWJZgTYIEtsULjVnC9jRqlhgGN39WbKKA==} engines: {node: '>=16'} peerDependencies: - '@solana/web3.js': ^1.47.4 + '@solana/web3.js': ^1.91.6 + + '@solana/spl-type-length-value@0.1.0': + resolution: {integrity: sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA==} + engines: {node: '>=16'} - '@solana/web3.js@1.77.3': - resolution: {integrity: sha512-PHaO0BdoiQRPpieC1p31wJsBaxwIOWLh8j2ocXNKX8boCQVldt26Jqm2tZE4KlrvnCIV78owPLv1pEUgqhxZ3w==} + '@solana/web3.js@1.91.6': + resolution: {integrity: sha512-dm20nN6HQvXToo+kM51nxHdtaa2wMSRdeK37p+WIWESfeiVHqV8XbV4XnWupq6ngt5vIckhGFG7ZnTBxUgLzDA==} '@stablelib/binary@1.0.1': resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==} @@ -39862,7 +39902,7 @@ snapshots: '@solana/buffer-layout-utils@0.2.0': dependencies: '@solana/buffer-layout': 4.0.1 - '@solana/web3.js': 1.77.3 + '@solana/web3.js': 1.91.6 bigint-buffer: 1.1.5 bignumber.js: 9.1.2 transitivePeerDependencies: @@ -39874,18 +39914,82 @@ snapshots: dependencies: buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) - '@solana/spl-token@0.3.8(@solana/web3.js@1.77.3)': + '@solana/codecs-core@2.0.0-preview.2': + dependencies: + '@solana/errors': 2.0.0-preview.2 + + '@solana/codecs-data-structures@2.0.0-preview.2': + dependencies: + '@solana/codecs-core': 2.0.0-preview.2 + '@solana/codecs-numbers': 2.0.0-preview.2 + '@solana/errors': 2.0.0-preview.2 + + '@solana/codecs-numbers@2.0.0-preview.2': + dependencies: + '@solana/codecs-core': 2.0.0-preview.2 + '@solana/errors': 2.0.0-preview.2 + + '@solana/codecs-strings@2.0.0-preview.2': + dependencies: + '@solana/codecs-core': 2.0.0-preview.2 + '@solana/codecs-numbers': 2.0.0-preview.2 + '@solana/errors': 2.0.0-preview.2 + + '@solana/codecs@2.0.0-preview.2': + dependencies: + '@solana/codecs-core': 2.0.0-preview.2 + '@solana/codecs-data-structures': 2.0.0-preview.2 + '@solana/codecs-numbers': 2.0.0-preview.2 + '@solana/codecs-strings': 2.0.0-preview.2 + '@solana/options': 2.0.0-preview.2 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/errors@2.0.0-preview.2': + dependencies: + chalk: 5.3.0 + commander: 12.0.0 + + '@solana/options@2.0.0-preview.2': + dependencies: + '@solana/codecs-core': 2.0.0-preview.2 + '@solana/codecs-numbers': 2.0.0-preview.2 + + '@solana/spl-token-group@0.0.4(@solana/web3.js@1.91.6)': + dependencies: + '@solana/codecs': 2.0.0-preview.2 + '@solana/spl-type-length-value': 0.1.0 + '@solana/web3.js': 1.91.6 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/spl-token-metadata@0.1.4(@solana/web3.js@1.91.6)': + dependencies: + '@solana/codecs': 2.0.0-preview.2 + '@solana/spl-type-length-value': 0.1.0 + '@solana/web3.js': 1.91.6 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/spl-token@0.4.6(@solana/web3.js@1.91.6)': dependencies: '@solana/buffer-layout': 4.0.1 '@solana/buffer-layout-utils': 0.2.0 - '@solana/web3.js': 1.77.3 + '@solana/spl-token-group': 0.0.4(@solana/web3.js@1.91.6) + '@solana/spl-token-metadata': 0.1.4(@solana/web3.js@1.91.6) + '@solana/web3.js': 1.91.6 buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) transitivePeerDependencies: - bufferutil - encoding + - fastestsmallesttextencoderdecoder - utf-8-validate - '@solana/web3.js@1.77.3': + '@solana/spl-type-length-value@0.1.0': + dependencies: + buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) + + '@solana/web3.js@1.91.6': dependencies: '@babel/runtime': 7.24.1 '@noble/curves': 1.4.0 From 52bb93682199c357d0cc2224363ef82cc5f8c7e9 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Thu, 21 Mar 2024 13:39:07 +0300 Subject: [PATCH 02/10] feat(LLC): calc and possibly append priority fee to solana instructions --- .../coin-solana/src/api/cached.ts | 6 + .../coin-solana/src/api/chain/index.ts | 11 +- .../coin-solana/src/api/chain/web3.ts | 168 ++++++++++-------- .../src/bridge.integration.test.ts | 12 ++ .../coin-solana/src/buildTransaction.ts | 28 +-- .../coin-solana/src/synchronization.ts | 4 +- libs/coin-modules/coin-solana/src/utils.ts | 15 ++ .../src/families/solana/bridge/mock-data.ts | 16 ++ 8 files changed, 175 insertions(+), 85 deletions(-) diff --git a/libs/coin-modules/coin-solana/src/api/cached.ts b/libs/coin-modules/coin-solana/src/api/cached.ts index bc82f12ecdc3..44f7e5b99f10 100644 --- a/libs/coin-modules/coin-solana/src/api/cached.ts +++ b/libs/coin-modules/coin-solana/src/api/cached.ts @@ -74,6 +74,12 @@ export function cached(api: ChainAPI): ChainAPI { getEpochInfo: makeLRUCache(api.getEpochInfo, cacheKeyEmpty, minutes(1)), + getRecentPrioritizationFees: makeLRUCache( + api.getRecentPrioritizationFees, + cacheKeyByArgs, + seconds(30), + ), + config: api.config, }; } diff --git a/libs/coin-modules/coin-solana/src/api/chain/index.ts b/libs/coin-modules/coin-solana/src/api/chain/index.ts index 0b1f75b95fef..894a092dcd12 100644 --- a/libs/coin-modules/coin-solana/src/api/chain/index.ts +++ b/libs/coin-modules/coin-solana/src/api/chain/index.ts @@ -11,6 +11,7 @@ import { sendAndConfirmRawTransaction, SignaturesForAddressOptions, StakeProgram, + GetRecentPrioritizationFeesConfig, } from "@solana/web3.js"; import { makeLRUCache, minutes } from "@ledgerhq/live-network/cache"; import { getEnv } from "@ledgerhq/live-env"; @@ -72,6 +73,10 @@ export type ChainAPI = Readonly<{ getEpochInfo: () => ReturnType; + getRecentPrioritizationFees: ( + config?: GetRecentPrioritizationFeesConfig, + ) => ReturnType; + config: Config; }>; @@ -88,7 +93,7 @@ export function getChainAPI( logger === undefined ? undefined : (url, options, fetch) => { - logger(url, options); + logger(url.toString(), options); fetch(url, options); }; @@ -208,6 +213,10 @@ export function getChainAPI( getEpochInfo: () => connection().getEpochInfo().catch(remapErrors), + getRecentPrioritizationFees: (config?: GetRecentPrioritizationFeesConfig) => { + return connection().getRecentPrioritizationFees(config).catch(remapErrors); + }, + config, }; } diff --git a/libs/coin-modules/coin-solana/src/api/chain/web3.ts b/libs/coin-modules/coin-solana/src/api/chain/web3.ts index 1e6f193ef5ea..1d6cd4b35968 100644 --- a/libs/coin-modules/coin-solana/src/api/chain/web3.ts +++ b/libs/coin-modules/coin-solana/src/api/chain/web3.ts @@ -11,8 +11,10 @@ import { StakeProgram, SystemProgram, TransactionInstruction, + ComputeBudgetProgram, } from "@solana/web3.js"; import chunk from "lodash/chunk"; +import uniqBy from "lodash/uniqBy"; import { ChainAPI } from "."; import { Awaited } from "../../logic"; import { @@ -25,7 +27,7 @@ import { TokenTransferCommand, TransferCommand, } from "../../types"; -import { drainSeqAsyncGen } from "../../utils"; +import { drainSeqAsyncGen, median } from "../../utils"; import { parseTokenAccountInfo, tryParseAsTokenAccount, tryParseAsVoteAccount } from "./account"; import { parseStakeAccountInfo } from "./account/parser"; import { StakeAccountInfo } from "./account/stake"; @@ -127,12 +129,10 @@ export function getTransactions( return drainSeqAsyncGen(getTransactionsGen(address, untilTxSignature, api)); } -export const buildTransferInstructions = ({ - sender, - recipient, - amount, - memo, -}: TransferCommand): TransactionInstruction[] => { +export const buildTransferInstructions = async ( + api: ChainAPI, + { sender, recipient, amount, memo }: TransferCommand, +): Promise => { const fromPublicKey = new PublicKey(sender); const toPublicKey = new PublicKey(recipient); @@ -153,12 +153,13 @@ export const buildTransferInstructions = ({ instructions.push(memoIx); } - return instructions; + return appendMaybePriorityFeeInstruction(api, [fromPublicKey, toPublicKey], instructions); }; -export const buildTokenTransferInstructions = ( +export const buildTokenTransferInstructions = async ( + api: ChainAPI, command: TokenTransferCommand, -): TransactionInstruction[] => { +): Promise => { const { ownerAddress, ownerAssociatedTokenAccountAddress, @@ -271,6 +272,36 @@ export async function getStakeAccountAddressWithSeed({ return pubkey.toBase58(); } +export async function getPriorityFee(api: ChainAPI, accounts: PublicKey[]): Promise { + const uniqAccs = uniqBy(accounts, acc => acc.toBase58()); + const recentFees = await api.getRecentPrioritizationFees({ + lockedWritableAccounts: uniqAccs, + }); + + return median(recentFees.map(item => item.prioritizationFee)); +} + +export async function buildMaybePriorityFeeInstruction( + api: ChainAPI, + accounts: PublicKey[], +): Promise { + const priorityFee = await getPriorityFee(api, accounts); + if (priorityFee === 0) return null; + + return ComputeBudgetProgram.setComputeUnitPrice({ + microLamports: priorityFee, + }); +} + +export async function appendMaybePriorityFeeInstruction( + api: ChainAPI, + accounts: PublicKey[], + ixs: TransactionInstruction[], +): Promise { + const priorityFeeIx = await buildMaybePriorityFeeInstruction(api, accounts); + return priorityFeeIx ? [priorityFeeIx, ...ixs] : ixs; +} + export function buildCreateAssociatedTokenAccountInstruction({ mint, owner, @@ -292,86 +323,82 @@ export function buildCreateAssociatedTokenAccountInstruction({ return instructions; } -export function buildStakeDelegateInstructions({ - authorizedAccAddr, - stakeAccAddr, - voteAccAddr, -}: StakeDelegateCommand): TransactionInstruction[] { +export async function buildStakeDelegateInstructions( + api: ChainAPI, + { authorizedAccAddr, stakeAccAddr, voteAccAddr }: StakeDelegateCommand, +): Promise { + const withdrawAuthority = new PublicKey(authorizedAccAddr); + const stakeAcc = new PublicKey(stakeAccAddr); + const voteAcc = new PublicKey(voteAccAddr); const tx = StakeProgram.delegate({ - authorizedPubkey: new PublicKey(authorizedAccAddr), - stakePubkey: new PublicKey(stakeAccAddr), - votePubkey: new PublicKey(voteAccAddr), + authorizedPubkey: withdrawAuthority, + stakePubkey: stakeAcc, + votePubkey: voteAcc, }); - return tx.instructions; + return appendMaybePriorityFeeInstruction(api, [withdrawAuthority, stakeAcc], tx.instructions); } -export function buildStakeUndelegateInstructions({ - authorizedAccAddr, - stakeAccAddr, -}: StakeUndelegateCommand): TransactionInstruction[] { +export async function buildStakeUndelegateInstructions( + api: ChainAPI, + { authorizedAccAddr, stakeAccAddr }: StakeUndelegateCommand, +): Promise { + const withdrawAuthority = new PublicKey(authorizedAccAddr); + const stakeAcc = new PublicKey(stakeAccAddr); const tx = StakeProgram.deactivate({ - authorizedPubkey: new PublicKey(authorizedAccAddr), - stakePubkey: new PublicKey(stakeAccAddr), + authorizedPubkey: withdrawAuthority, + stakePubkey: stakeAcc, }); - return tx.instructions; + return appendMaybePriorityFeeInstruction(api, [withdrawAuthority, stakeAcc], tx.instructions); } -export function buildStakeWithdrawInstructions({ - authorizedAccAddr, - stakeAccAddr, - amount, - toAccAddr, -}: StakeWithdrawCommand): TransactionInstruction[] { +export async function buildStakeWithdrawInstructions( + api: ChainAPI, + { authorizedAccAddr, stakeAccAddr, amount, toAccAddr }: StakeWithdrawCommand, +): Promise { + const withdrawAuthority = new PublicKey(authorizedAccAddr); + const stakeAcc = new PublicKey(stakeAccAddr); + const recipient = new PublicKey(toAccAddr); const tx = StakeProgram.withdraw({ - authorizedPubkey: new PublicKey(authorizedAccAddr), - stakePubkey: new PublicKey(stakeAccAddr), + authorizedPubkey: withdrawAuthority, + stakePubkey: stakeAcc, lamports: amount, - toPubkey: new PublicKey(toAccAddr), + toPubkey: recipient, }); - return tx.instructions; + return appendMaybePriorityFeeInstruction(api, [withdrawAuthority, stakeAcc], tx.instructions); } -export function buildStakeSplitInstructions({ - authorizedAccAddr, - stakeAccAddr, - seed, - amount, - splitStakeAccAddr, -}: StakeSplitCommand): TransactionInstruction[] { - // HACK: switch to split_with_seed when supported by @solana/web3.js - const splitIx = StakeProgram.split({ - authorizedPubkey: new PublicKey(authorizedAccAddr), +export async function buildStakeSplitInstructions( + api: ChainAPI, + { authorizedAccAddr, stakeAccAddr, seed, amount, splitStakeAccAddr }: StakeSplitCommand, +): Promise { + const basePk = new PublicKey(authorizedAccAddr); + const stakePk = new PublicKey(stakeAccAddr); + const splitStakePk = new PublicKey(splitStakeAccAddr); + const splitIx = StakeProgram.splitWithSeed({ + authorizedPubkey: basePk, lamports: amount, - stakePubkey: new PublicKey(stakeAccAddr), - splitStakePubkey: new PublicKey(splitStakeAccAddr), - }).instructions[1]; - - if (splitIx === undefined) { - throw new Error("expected split instruction"); - } - - const allocateIx = SystemProgram.allocate({ - accountPubkey: new PublicKey(splitStakeAccAddr), - basePubkey: new PublicKey(authorizedAccAddr), - programId: StakeProgram.programId, + stakePubkey: stakePk, + splitStakePubkey: splitStakePk, + basePubkey: basePk, seed, - space: StakeProgram.space, }); - - return [allocateIx, splitIx]; + return appendMaybePriorityFeeInstruction(api, [basePk, stakePk], splitIx.instructions); } -export function buildStakeCreateAccountInstructions({ - fromAccAddress, - stakeAccAddress, - seed, - amount, - stakeAccRentExemptAmount, - delegate, -}: StakeCreateAccountCommand): TransactionInstruction[] { +export async function buildStakeCreateAccountInstructions( + api: ChainAPI, + { + fromAccAddress, + stakeAccAddress, + seed, + amount, + stakeAccRentExemptAmount, + delegate, + }: StakeCreateAccountCommand, +): Promise { const fromPubkey = new PublicKey(fromAccAddress); const stakePubkey = new PublicKey(stakeAccAddress); @@ -394,6 +421,5 @@ export function buildStakeCreateAccountInstructions({ votePubkey: new PublicKey(delegate.voteAccAddress), }), ); - - return tx.instructions; + return appendMaybePriorityFeeInstruction(api, [fromPubkey, stakePubkey], tx.instructions); } diff --git a/libs/coin-modules/coin-solana/src/bridge.integration.test.ts b/libs/coin-modules/coin-solana/src/bridge.integration.test.ts index 014c7765a27a..fbda3455567f 100644 --- a/libs/coin-modules/coin-solana/src/bridge.integration.test.ts +++ b/libs/coin-modules/coin-solana/src/bridge.integration.test.ts @@ -952,6 +952,18 @@ const baseTx = { const baseAPI = { getLatestBlockhash: () => Promise.resolve(LATEST_BLOCKHASH_MOCK), getFeeForMessage: (_msg: unknown) => Promise.resolve(testOnChainData.fees.lamportsPerSignature), + getRecentPrioritizationFees: (_: string[]) => { + return Promise.resolve([ + { + slot: 122422797, + prioritizationFee: 0, + }, + { + slot: 122422797, + prioritizationFee: 0, + }, + ]); + }, } as ChainAPI; type StakeTestSpec = { diff --git a/libs/coin-modules/coin-solana/src/buildTransaction.ts b/libs/coin-modules/coin-solana/src/buildTransaction.ts index cb7f9b17bad8..146b594ca7fc 100644 --- a/libs/coin-modules/coin-solana/src/buildTransaction.ts +++ b/libs/coin-modules/coin-solana/src/buildTransaction.ts @@ -23,7 +23,7 @@ export const buildTransactionWithAPI = async ( transaction: Transaction, api: ChainAPI, ): Promise OnChainTransaction]> => { - const instructions = buildInstructions(transaction); + const instructions = await buildInstructions(api, transaction); const recentBlockhash = await api.getLatestBlockhash(); @@ -46,7 +46,10 @@ export const buildTransactionWithAPI = async ( ]; }; -function buildInstructions(tx: Transaction): TransactionInstruction[] { +async function buildInstructions( + api: ChainAPI, + tx: Transaction, +): Promise { const { commandDescriptor } = tx.model; if (commandDescriptor === undefined) { throw new Error("missing command descriptor"); @@ -54,27 +57,30 @@ function buildInstructions(tx: Transaction): TransactionInstruction[] { if (Object.keys(commandDescriptor.errors).length > 0) { throw new Error("can not build invalid command"); } - return buildInstructionsForCommand(commandDescriptor.command); + return buildInstructionsForCommand(api, commandDescriptor.command); } -function buildInstructionsForCommand(command: Command): TransactionInstruction[] { +async function buildInstructionsForCommand( + api: ChainAPI, + command: Command, +): Promise { switch (command.kind) { case "transfer": - return buildTransferInstructions(command); + return buildTransferInstructions(api, command); case "token.transfer": - return buildTokenTransferInstructions(command); + return buildTokenTransferInstructions(api, command); case "token.createATA": return buildCreateAssociatedTokenAccountInstruction(command); case "stake.createAccount": - return buildStakeCreateAccountInstructions(command); + return buildStakeCreateAccountInstructions(api, command); case "stake.delegate": - return buildStakeDelegateInstructions(command); + return buildStakeDelegateInstructions(api, command); case "stake.undelegate": - return buildStakeUndelegateInstructions(command); + return buildStakeUndelegateInstructions(api, command); case "stake.withdraw": - return buildStakeWithdrawInstructions(command); + return buildStakeWithdrawInstructions(api, command); case "stake.split": - return buildStakeSplitInstructions(command); + return buildStakeSplitInstructions(api, command); default: return assertUnreachable(command); } diff --git a/libs/coin-modules/coin-solana/src/synchronization.ts b/libs/coin-modules/coin-solana/src/synchronization.ts index b324c9e635bd..348956645c07 100644 --- a/libs/coin-modules/coin-solana/src/synchronization.ts +++ b/libs/coin-modules/coin-solana/src/synchronization.ts @@ -542,7 +542,7 @@ function getMainAccOperationTypeFromTx(tx: ParsedTransaction): OperationType | u const parsedIxs = instructions .map(ix => parseQuiet(ix)) - .filter(({ program }) => program !== "spl-memo"); + .filter(({ program }) => program !== "spl-memo" && program !== "unknown"); if (parsedIxs.length === 3) { const [first, second, third] = parsedIxs; @@ -636,7 +636,7 @@ function getTokenAccOperationType({ const { instructions } = tx.message; const [mainIx, ...otherIxs] = instructions .map(ix => parseQuiet(ix)) - .filter(({ program }) => program !== "spl-memo"); + .filter(({ program }) => program !== "spl-memo" && program !== "unknown"); if (mainIx !== undefined && otherIxs.length === 0) { switch (mainIx.program) { diff --git a/libs/coin-modules/coin-solana/src/utils.ts b/libs/coin-modules/coin-solana/src/utils.ts index 5e8fd41f437e..15b6f00492af 100644 --- a/libs/coin-modules/coin-solana/src/utils.ts +++ b/libs/coin-modules/coin-solana/src/utils.ts @@ -2,6 +2,7 @@ import { Cluster, clusterApiUrl } from "@solana/web3.js"; import { partition } from "lodash/fp"; import { getEnv } from "@ledgerhq/live-env"; import { ValidatorsAppValidator } from "./validator-app"; +import BigNumber from "bignumber.js"; // Hardcoding the Ledger validator info as backup, // because backend is flaky and sometimes doesn't return it anymore @@ -174,3 +175,17 @@ export const tupleOfUnion = export function sweetch(caze: T, cases: Record): R { return cases[caze]; } + +export function median(values: number[]): number { + const length = values.length; + if (!length) return 0; + + const sorted = values.sort((a, b) => a - b); + const middle = Math.floor(length / 2); + return length % 2 + ? BigNumber(sorted[middle]) + .plus(sorted[middle - 1]) + .div(2) + .toNumber() + : sorted[middle]; +} diff --git a/libs/ledger-live-common/src/families/solana/bridge/mock-data.ts b/libs/ledger-live-common/src/families/solana/bridge/mock-data.ts index b21218e84d8b..900af12183f0 100644 --- a/libs/ledger-live-common/src/families/solana/bridge/mock-data.ts +++ b/libs/ledger-live-common/src/families/solana/bridge/mock-data.ts @@ -889,4 +889,20 @@ export const getMockedMethods = (): { }, // manual { method: "getLatestBlockhash", params: [], answer: LATEST_BLOCKHASH_MOCK }, + { + method: "getRecentPrioritizationFees", + params: [ + ["AQbkEagmPgmsdAfS4X8V8UyJnXXjVPMvjeD15etqQ3Jh"] + ], + answer: [[ + { + slot: 122422797, + prioritizationFee: 0, + }, + { + slot: 122422797, + prioritizationFee: 0, + }, + ]], + }, ]; From 1bda609c98294bd59bfeca7ba84863eecfe7894b Mon Sep 17 00:00:00 2001 From: Mikhail Date: Fri, 26 Apr 2024 11:29:58 +0300 Subject: [PATCH 03/10] feat(LLC): add solana compute units optimisations --- .../coin-solana/src/api/cached.ts | 18 ++++++ .../coin-solana/src/api/chain/index.ts | 44 ++++++++++++++- .../coin-solana/src/api/chain/web3.ts | 55 ++++++++++++------- .../src/bridge.integration.test.ts | 1 + libs/coin-modules/coin-solana/src/tx-fees.ts | 15 ++--- 5 files changed, 103 insertions(+), 30 deletions(-) diff --git a/libs/coin-modules/coin-solana/src/api/cached.ts b/libs/coin-modules/coin-solana/src/api/cached.ts index 44f7e5b99f10..828471f14d2d 100644 --- a/libs/coin-modules/coin-solana/src/api/cached.ts +++ b/libs/coin-modules/coin-solana/src/api/cached.ts @@ -1,4 +1,5 @@ import { makeLRUCache, minutes, seconds } from "@ledgerhq/live-network/cache"; +import { PublicKey, TransactionInstruction, TransactionMessage } from "@solana/web3.js"; import hash from "object-hash"; import { ChainAPI } from "./chain"; @@ -8,6 +9,17 @@ const cacheKeyAssocTokenAccAddress = (owner: string, mint: string) => `${owner}: const cacheKeyMinimumBalanceForRentExemption = (dataLengt: number) => dataLengt.toString(); const cacheKeyTransactions = (signatures: string[]) => hash([...signatures].sort()); +const cacheKeyInstructions = (ixs: TransactionInstruction[], payer: PublicKey) => { + return hash( + new TransactionMessage({ + instructions: ixs, + payerKey: payer, + recentBlockhash: payer.toString(), + }) + .compileToLegacyMessage() + .serialize(), + ); +}; const cacheKeyByArgs = (...args: any[]) => hash(args); @@ -80,6 +92,12 @@ export function cached(api: ChainAPI): ChainAPI { seconds(30), ), + getSimulationComputeUnits: makeLRUCache( + api.getSimulationComputeUnits, + cacheKeyInstructions, + seconds(30), + ), + config: api.config, }; } diff --git a/libs/coin-modules/coin-solana/src/api/chain/index.ts b/libs/coin-modules/coin-solana/src/api/chain/index.ts index 894a092dcd12..09be4cfd7815 100644 --- a/libs/coin-modules/coin-solana/src/api/chain/index.ts +++ b/libs/coin-modules/coin-solana/src/api/chain/index.ts @@ -12,6 +12,10 @@ import { SignaturesForAddressOptions, StakeProgram, GetRecentPrioritizationFeesConfig, + TransactionInstruction, + ComputeBudgetProgram, + VersionedTransaction, + TransactionMessage, } from "@solana/web3.js"; import { makeLRUCache, minutes } from "@ledgerhq/live-network/cache"; import { getEnv } from "@ledgerhq/live-env"; @@ -74,9 +78,14 @@ export type ChainAPI = Readonly<{ getEpochInfo: () => ReturnType; getRecentPrioritizationFees: ( - config?: GetRecentPrioritizationFeesConfig, + accounts: string[], ) => ReturnType; + getSimulationComputeUnits: ( + instructions: Array, + payer: PublicKey, + ) => Promise; + config: Config; }>; @@ -213,8 +222,37 @@ export function getChainAPI( getEpochInfo: () => connection().getEpochInfo().catch(remapErrors), - getRecentPrioritizationFees: (config?: GetRecentPrioritizationFeesConfig) => { - return connection().getRecentPrioritizationFees(config).catch(remapErrors); + getRecentPrioritizationFees: (accounts: string[]) => { + return connection() + .getRecentPrioritizationFees({ + lockedWritableAccounts: accounts.map(acc => new PublicKey(acc)), + }) + .catch(remapErrors); + }, + + getSimulationComputeUnits: async (instructions, payer) => { + // https://solana.com/developers/guides/advanced/how-to-request-optimal-compute + const testInstructions = [ + // Set an arbitrarily high number in simulation + // so we can be sure the transaction will succeed + // and get the real compute units used + ComputeBudgetProgram.setComputeUnitLimit({ units: 1_400_000 }), + ...instructions, + ]; + const testTransaction = new VersionedTransaction( + new TransactionMessage({ + instructions: testInstructions, + payerKey: payer, + // RecentBlockhash can by any public key during simulation + // since 'replaceRecentBlockhash' is set to 'true' below + recentBlockhash: PublicKey.default.toString(), + }).compileToV0Message(), + ); + const rpcResponse = await connection().simulateTransaction(testTransaction, { + replaceRecentBlockhash: true, + sigVerify: false, + }); + return rpcResponse.value.err ? null : rpcResponse.value.unitsConsumed || null; }, config, diff --git a/libs/coin-modules/coin-solana/src/api/chain/web3.ts b/libs/coin-modules/coin-solana/src/api/chain/web3.ts index 1d6cd4b35968..fff6da9b0e03 100644 --- a/libs/coin-modules/coin-solana/src/api/chain/web3.ts +++ b/libs/coin-modules/coin-solana/src/api/chain/web3.ts @@ -14,7 +14,7 @@ import { ComputeBudgetProgram, } from "@solana/web3.js"; import chunk from "lodash/chunk"; -import uniqBy from "lodash/uniqBy"; +import uniq from "lodash/uniq"; import { ChainAPI } from "."; import { Awaited } from "../../logic"; import { @@ -153,7 +153,7 @@ export const buildTransferInstructions = async ( instructions.push(memoIx); } - return appendMaybePriorityFeeInstruction(api, [fromPublicKey, toPublicKey], instructions); + return appendMaybePriorityFeeInstructions(api, instructions, fromPublicKey); }; export const buildTokenTransferInstructions = async ( @@ -272,18 +272,31 @@ export async function getStakeAccountAddressWithSeed({ return pubkey.toBase58(); } -export async function getPriorityFee(api: ChainAPI, accounts: PublicKey[]): Promise { - const uniqAccs = uniqBy(accounts, acc => acc.toBase58()); - const recentFees = await api.getRecentPrioritizationFees({ - lockedWritableAccounts: uniqAccs, - }); - +export async function getPriorityFee(api: ChainAPI, accounts: string[]): Promise { + const recentFees = await api.getRecentPrioritizationFees(uniq(accounts)); return median(recentFees.map(item => item.prioritizationFee)); } +export async function appendMaybePriorityFeeInstructions( + api: ChainAPI, + ixs: TransactionInstruction[], + payer: PublicKey, +): Promise { + const instructions = [...ixs]; + const writableAccs = instructions + .map(ix => ix.keys.filter(acc => acc.isWritable).map(acc => acc.pubkey.toBase58())) + .flat(); + const priorityFeeIx = await buildMaybePriorityFeeInstruction(api, writableAccs); + if (priorityFeeIx) instructions.unshift(priorityFeeIx); + const computeUnitsIx = await buildComputeUnitInstruction(api, instructions, payer); + + if (computeUnitsIx) instructions.unshift(computeUnitsIx); + return instructions; +} + export async function buildMaybePriorityFeeInstruction( api: ChainAPI, - accounts: PublicKey[], + accounts: string[], ): Promise { const priorityFee = await getPriorityFee(api, accounts); if (priorityFee === 0) return null; @@ -292,14 +305,16 @@ export async function buildMaybePriorityFeeInstruction( microLamports: priorityFee, }); } - -export async function appendMaybePriorityFeeInstruction( +export async function buildComputeUnitInstruction( api: ChainAPI, - accounts: PublicKey[], ixs: TransactionInstruction[], -): Promise { - const priorityFeeIx = await buildMaybePriorityFeeInstruction(api, accounts); - return priorityFeeIx ? [priorityFeeIx, ...ixs] : ixs; + payer: PublicKey, +): Promise { + const computeUnits = await api.getSimulationComputeUnits(ixs, payer); + // adding 10% more CPU to make sure it will work + return computeUnits + ? ComputeBudgetProgram.setComputeUnitLimit({ units: computeUnits * 0.1 + computeUnits }) + : null; } export function buildCreateAssociatedTokenAccountInstruction({ @@ -336,7 +351,7 @@ export async function buildStakeDelegateInstructions( votePubkey: voteAcc, }); - return appendMaybePriorityFeeInstruction(api, [withdrawAuthority, stakeAcc], tx.instructions); + return appendMaybePriorityFeeInstructions(api, tx.instructions, withdrawAuthority); } export async function buildStakeUndelegateInstructions( @@ -350,7 +365,7 @@ export async function buildStakeUndelegateInstructions( stakePubkey: stakeAcc, }); - return appendMaybePriorityFeeInstruction(api, [withdrawAuthority, stakeAcc], tx.instructions); + return appendMaybePriorityFeeInstructions(api, tx.instructions, withdrawAuthority); } export async function buildStakeWithdrawInstructions( @@ -367,7 +382,7 @@ export async function buildStakeWithdrawInstructions( toPubkey: recipient, }); - return appendMaybePriorityFeeInstruction(api, [withdrawAuthority, stakeAcc], tx.instructions); + return appendMaybePriorityFeeInstructions(api, tx.instructions, withdrawAuthority); } export async function buildStakeSplitInstructions( @@ -385,7 +400,7 @@ export async function buildStakeSplitInstructions( basePubkey: basePk, seed, }); - return appendMaybePriorityFeeInstruction(api, [basePk, stakePk], splitIx.instructions); + return appendMaybePriorityFeeInstructions(api, splitIx.instructions, basePk); } export async function buildStakeCreateAccountInstructions( @@ -421,5 +436,5 @@ export async function buildStakeCreateAccountInstructions( votePubkey: new PublicKey(delegate.voteAccAddress), }), ); - return appendMaybePriorityFeeInstruction(api, [fromPubkey, stakePubkey], tx.instructions); + return appendMaybePriorityFeeInstructions(api, tx.instructions, fromPubkey); } diff --git a/libs/coin-modules/coin-solana/src/bridge.integration.test.ts b/libs/coin-modules/coin-solana/src/bridge.integration.test.ts index fbda3455567f..124ae2f7bdfb 100644 --- a/libs/coin-modules/coin-solana/src/bridge.integration.test.ts +++ b/libs/coin-modules/coin-solana/src/bridge.integration.test.ts @@ -964,6 +964,7 @@ const baseAPI = { }, ]); }, + getSimulationComputeUnits: (_ixs: any[], _payer: any) => Promise.resolve(1000), } as ChainAPI; type StakeTestSpec = { diff --git a/libs/coin-modules/coin-solana/src/tx-fees.ts b/libs/coin-modules/coin-solana/src/tx-fees.ts index 4a05372c9f44..b25bdbfb363f 100644 --- a/libs/coin-modules/coin-solana/src/tx-fees.ts +++ b/libs/coin-modules/coin-solana/src/tx-fees.ts @@ -2,9 +2,10 @@ import { ChainAPI } from "./api"; import { buildTransactionWithAPI } from "./buildTransaction"; import createTransaction from "./createTransaction"; import { Transaction, TransactionModel } from "./types"; -import { assertUnreachable } from "./utils"; +import { LEDGER_VALIDATOR, assertUnreachable } from "./utils"; import { VersionedTransaction as OnChainTransaction } from "@solana/web3.js"; import { log } from "@ledgerhq/logs"; +import { getStakeAccountAddressWithSeed } from "./api/chain/web3"; const DEFAULT_TX_FEE = 5000; @@ -13,7 +14,7 @@ export async function estimateTxFee( address: string, kind: TransactionModel["kind"], ) { - const tx = createDummyTx(address, kind); + const tx = await createDummyTx(address, kind); const [onChainTx] = await buildTransactionWithAPI(address, tx, api); let fee = await api.getFeeForMessage(onChainTx.message); @@ -76,7 +77,7 @@ const createDummyTransferTx = (address: string): Transaction => { }; }; -const createDummyStakeCreateAccountTx = (address: string): Transaction => { +const createDummyStakeCreateAccountTx = async (address: string): Promise => { return { ...createTransaction({} as any), model: { @@ -87,12 +88,12 @@ const createDummyStakeCreateAccountTx = (address: string): Transaction => { kind: "stake.createAccount", amount: 0, delegate: { - voteAccAddress: randomAddresses[0], + voteAccAddress: LEDGER_VALIDATOR.voteAccount, }, fromAccAddress: address, seed: "", - stakeAccAddress: randomAddresses[1], - stakeAccRentExemptAmount: 0, + stakeAccAddress: await getStakeAccountAddressWithSeed({ fromAddress: address, seed: "" }), + stakeAccRentExemptAmount: 2282880, }, ...commandDescriptorCommons, }, @@ -149,7 +150,7 @@ const createDummyStakeWithdrawTx = (address: string): Transaction => { amount: 0, authorizedAccAddr: address, stakeAccAddr: randomAddresses[0], - toAccAddr: randomAddresses[1], + toAccAddr: address, }, ...commandDescriptorCommons, }, From 24a47f88a06ccd08524ef6851da48b5156da1255 Mon Sep 17 00:00:00 2001 From: Mikhail Date: Mon, 30 Sep 2024 13:06:33 +0300 Subject: [PATCH 04/10] chore: downgrade @solana/spl-token@0.3.9 --- libs/coin-modules/coin-solana/package.json | 2 +- pnpm-lock.yaml | 116 ++------------------- 2 files changed, 7 insertions(+), 111 deletions(-) diff --git a/libs/coin-modules/coin-solana/package.json b/libs/coin-modules/coin-solana/package.json index a4af5c65b276..b6d2873af50a 100644 --- a/libs/coin-modules/coin-solana/package.json +++ b/libs/coin-modules/coin-solana/package.json @@ -53,7 +53,7 @@ "@ledgerhq/logs": "workspace:^", "@ledgerhq/types-cryptoassets": "workspace:^", "@ledgerhq/types-live": "workspace:^", - "@solana/spl-token": "0.4.6", + "@solana/spl-token": "0.3.9", "@solana/web3.js": "1.91.6", "bignumber.js": "^9.1.2", "bs58": "^4.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a7776249e616..1109d3d6daf6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2774,8 +2774,8 @@ importers: specifier: workspace:^ version: link:../../ledgerjs/packages/types-live '@solana/spl-token': - specifier: 0.4.6 - version: 0.4.6(@solana/web3.js@1.91.6) + specifier: 0.3.9 + version: 0.3.9(@solana/web3.js@1.91.6) '@solana/web3.js': specifier: 1.91.6 version: 1.91.6 @@ -13286,51 +13286,11 @@ packages: resolution: {integrity: sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==} engines: {node: '>=5.10'} - '@solana/codecs-core@2.0.0-preview.2': - resolution: {integrity: sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg==} - - '@solana/codecs-data-structures@2.0.0-preview.2': - resolution: {integrity: sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg==} - - '@solana/codecs-numbers@2.0.0-preview.2': - resolution: {integrity: sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw==} - - '@solana/codecs-strings@2.0.0-preview.2': - resolution: {integrity: sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g==} - peerDependencies: - fastestsmallesttextencoderdecoder: ^1.0.22 - - '@solana/codecs@2.0.0-preview.2': - resolution: {integrity: sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA==} - - '@solana/errors@2.0.0-preview.2': - resolution: {integrity: sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA==} - hasBin: true - - '@solana/options@2.0.0-preview.2': - resolution: {integrity: sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w==} - - '@solana/spl-token-group@0.0.4': - resolution: {integrity: sha512-7+80nrEMdUKlK37V6kOe024+T7J4nNss0F8LQ9OOPYdWCCfJmsGUzVx2W3oeizZR4IHM6N4yC9v1Xqwc3BTPWw==} - engines: {node: '>=16'} - peerDependencies: - '@solana/web3.js': ^1.91.6 - - '@solana/spl-token-metadata@0.1.4': - resolution: {integrity: sha512-N3gZ8DlW6NWDV28+vCCDJoTqaCZiF/jDUnk3o8GRkAFzHObiR60Bs1gXHBa8zCPdvOwiG6Z3dg5pg7+RW6XNsQ==} + '@solana/spl-token@0.3.9': + resolution: {integrity: sha512-1EXHxKICMnab35MvvY/5DBc/K/uQAOJCYnDZXw83McCAYUAfi+rwq6qfd6MmITmSTEhcfBcl/zYxmW/OSN0RmA==} engines: {node: '>=16'} peerDependencies: - '@solana/web3.js': ^1.91.6 - - '@solana/spl-token@0.4.6': - resolution: {integrity: sha512-1nCnUqfHVtdguFciVWaY/RKcQz1IF4b31jnKgAmjU9QVN1q7dRUkTEWJZgTYIEtsULjVnC9jRqlhgGN39WbKKA==} - engines: {node: '>=16'} - peerDependencies: - '@solana/web3.js': ^1.91.6 - - '@solana/spl-type-length-value@0.1.0': - resolution: {integrity: sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA==} - engines: {node: '>=16'} + '@solana/web3.js': ^1.47.4 '@solana/web3.js@1.91.6': resolution: {integrity: sha512-dm20nN6HQvXToo+kM51nxHdtaa2wMSRdeK37p+WIWESfeiVHqV8XbV4XnWupq6ngt5vIckhGFG7ZnTBxUgLzDA==} @@ -39914,81 +39874,17 @@ snapshots: dependencies: buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) - '@solana/codecs-core@2.0.0-preview.2': - dependencies: - '@solana/errors': 2.0.0-preview.2 - - '@solana/codecs-data-structures@2.0.0-preview.2': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/codecs-numbers': 2.0.0-preview.2 - '@solana/errors': 2.0.0-preview.2 - - '@solana/codecs-numbers@2.0.0-preview.2': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/errors': 2.0.0-preview.2 - - '@solana/codecs-strings@2.0.0-preview.2': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/codecs-numbers': 2.0.0-preview.2 - '@solana/errors': 2.0.0-preview.2 - - '@solana/codecs@2.0.0-preview.2': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/codecs-data-structures': 2.0.0-preview.2 - '@solana/codecs-numbers': 2.0.0-preview.2 - '@solana/codecs-strings': 2.0.0-preview.2 - '@solana/options': 2.0.0-preview.2 - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - '@solana/errors@2.0.0-preview.2': - dependencies: - chalk: 5.3.0 - commander: 12.0.0 - - '@solana/options@2.0.0-preview.2': - dependencies: - '@solana/codecs-core': 2.0.0-preview.2 - '@solana/codecs-numbers': 2.0.0-preview.2 - - '@solana/spl-token-group@0.0.4(@solana/web3.js@1.91.6)': - dependencies: - '@solana/codecs': 2.0.0-preview.2 - '@solana/spl-type-length-value': 0.1.0 - '@solana/web3.js': 1.91.6 - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - '@solana/spl-token-metadata@0.1.4(@solana/web3.js@1.91.6)': - dependencies: - '@solana/codecs': 2.0.0-preview.2 - '@solana/spl-type-length-value': 0.1.0 - '@solana/web3.js': 1.91.6 - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - '@solana/spl-token@0.4.6(@solana/web3.js@1.91.6)': + '@solana/spl-token@0.3.9(@solana/web3.js@1.91.6)': dependencies: '@solana/buffer-layout': 4.0.1 '@solana/buffer-layout-utils': 0.2.0 - '@solana/spl-token-group': 0.0.4(@solana/web3.js@1.91.6) - '@solana/spl-token-metadata': 0.1.4(@solana/web3.js@1.91.6) '@solana/web3.js': 1.91.6 buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) transitivePeerDependencies: - bufferutil - encoding - - fastestsmallesttextencoderdecoder - utf-8-validate - '@solana/spl-type-length-value@0.1.0': - dependencies: - buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) - '@solana/web3.js@1.91.6': dependencies: '@babel/runtime': 7.24.1 From 8866714f2012af02634fb70e5ff6f1c732d0d81c Mon Sep 17 00:00:00 2001 From: Kant Date: Tue, 29 Oct 2024 11:27:52 +0100 Subject: [PATCH 05/10] chore: update solana deps --- libs/coin-modules/coin-solana/package.json | 4 +- libs/ledger-live-common/package.json | 2 +- pnpm-lock.yaml | 403 ++++++++++++++++----- 3 files changed, 314 insertions(+), 95 deletions(-) diff --git a/libs/coin-modules/coin-solana/package.json b/libs/coin-modules/coin-solana/package.json index b6d2873af50a..6ce7e5a5c3b3 100644 --- a/libs/coin-modules/coin-solana/package.json +++ b/libs/coin-modules/coin-solana/package.json @@ -53,8 +53,8 @@ "@ledgerhq/logs": "workspace:^", "@ledgerhq/types-cryptoassets": "workspace:^", "@ledgerhq/types-live": "workspace:^", - "@solana/spl-token": "0.3.9", - "@solana/web3.js": "1.91.6", + "@solana/spl-token": "0.4.9", + "@solana/web3.js": "1.95.4", "bignumber.js": "^9.1.2", "bs58": "^4.0.1", "expect": "^27.4.6", diff --git a/libs/ledger-live-common/package.json b/libs/ledger-live-common/package.json index a265076f172c..ec9df88c7fa4 100644 --- a/libs/ledger-live-common/package.json +++ b/libs/ledger-live-common/package.json @@ -254,7 +254,7 @@ "@ledgerhq/types-cryptoassets": "workspace:^", "@ledgerhq/types-devices": "workspace:^", "@ledgerhq/types-live": "workspace:^", - "@solana/web3.js": "1.91.6", + "@solana/web3.js": "1.95.4", "@svgr/core": "^5.5.0", "@tanstack/react-query": "^5.28.9", "@testing-library/react": "^14.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1109d3d6daf6..33b21ed1344b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2774,11 +2774,11 @@ importers: specifier: workspace:^ version: link:../../ledgerjs/packages/types-live '@solana/spl-token': - specifier: 0.3.9 - version: 0.3.9(@solana/web3.js@1.91.6) + specifier: 0.4.9 + version: 0.4.9(@solana/web3.js@1.95.4)(typescript@5.4.3) '@solana/web3.js': - specifier: 1.91.6 - version: 1.91.6 + specifier: 1.95.4 + version: 1.95.4 bignumber.js: specifier: ^9.1.2 version: 9.1.2 @@ -3994,8 +3994,8 @@ importers: specifier: workspace:^ version: link:../ledgerjs/packages/types-live '@solana/web3.js': - specifier: 1.91.6 - version: 1.91.6 + specifier: 1.95.4 + version: 1.95.4 '@svgr/core': specifier: ^5.5.0 version: 5.5.0 @@ -8793,6 +8793,10 @@ packages: resolution: {integrity: sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==} engines: {node: '>=6.9.0'} + '@babel/runtime@7.26.0': + resolution: {integrity: sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==} + engines: {node: '>=6.9.0'} + '@babel/template@7.24.0': resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} engines: {node: '>=6.9.0'} @@ -11115,6 +11119,10 @@ packages: '@noble/curves@1.4.0': resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==} + '@noble/curves@1.6.0': + resolution: {integrity: sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==} + engines: {node: ^14.21.3 || >=16} + '@noble/ed25519@1.7.3': resolution: {integrity: sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==} @@ -11133,6 +11141,10 @@ packages: resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} engines: {node: '>= 16'} + '@noble/hashes@1.5.0': + resolution: {integrity: sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==} + engines: {node: ^14.21.3 || >=16} + '@noble/secp256k1@1.7.1': resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} @@ -13286,14 +13298,63 @@ packages: resolution: {integrity: sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==} engines: {node: '>=5.10'} - '@solana/spl-token@0.3.9': - resolution: {integrity: sha512-1EXHxKICMnab35MvvY/5DBc/K/uQAOJCYnDZXw83McCAYUAfi+rwq6qfd6MmITmSTEhcfBcl/zYxmW/OSN0RmA==} + '@solana/codecs-core@2.0.0-rc.1': + resolution: {integrity: sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ==} + peerDependencies: + typescript: '>=5' + + '@solana/codecs-data-structures@2.0.0-rc.1': + resolution: {integrity: sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog==} + peerDependencies: + typescript: '>=5' + + '@solana/codecs-numbers@2.0.0-rc.1': + resolution: {integrity: sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ==} + peerDependencies: + typescript: '>=5' + + '@solana/codecs-strings@2.0.0-rc.1': + resolution: {integrity: sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g==} + peerDependencies: + fastestsmallesttextencoderdecoder: ^1.0.22 + typescript: '>=5' + + '@solana/codecs@2.0.0-rc.1': + resolution: {integrity: sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ==} + peerDependencies: + typescript: '>=5' + + '@solana/errors@2.0.0-rc.1': + resolution: {integrity: sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ==} + hasBin: true + peerDependencies: + typescript: '>=5' + + '@solana/options@2.0.0-rc.1': + resolution: {integrity: sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA==} + peerDependencies: + typescript: '>=5' + + '@solana/spl-token-group@0.0.7': + resolution: {integrity: sha512-V1N/iX7Cr7H0uazWUT2uk27TMqlqedpXHRqqAbVO2gvmJyT0E0ummMEAVQeXZ05ZhQ/xF39DLSdBp90XebWEug==} + engines: {node: '>=16'} + peerDependencies: + '@solana/web3.js': ^1.95.3 + + '@solana/spl-token-metadata@0.1.6': + resolution: {integrity: sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA==} + engines: {node: '>=16'} + peerDependencies: + '@solana/web3.js': ^1.95.3 + + '@solana/spl-token@0.4.9': + resolution: {integrity: sha512-g3wbj4F4gq82YQlwqhPB0gHFXfgsC6UmyGMxtSLf/BozT/oKd59465DbnlUK8L8EcimKMavxsVAMoLcEdeCicg==} engines: {node: '>=16'} peerDependencies: - '@solana/web3.js': ^1.47.4 + '@solana/web3.js': ^1.95.3 - '@solana/web3.js@1.91.6': - resolution: {integrity: sha512-dm20nN6HQvXToo+kM51nxHdtaa2wMSRdeK37p+WIWESfeiVHqV8XbV4XnWupq6ngt5vIckhGFG7ZnTBxUgLzDA==} + '@solana/web3.js@1.95.4': + resolution: {integrity: sha512-sdewnNEA42ZSMxqkzdwEWi6fDgzwtJHaQa5ndUGEJYtoOnM6X5cvPmjoTUp7/k7bRrVAxfBgDnvQQHD6yhlLYw==} '@stablelib/binary@1.0.1': resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==} @@ -14502,6 +14563,9 @@ packages: '@swc/helpers@0.4.14': resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} + '@swc/helpers@0.5.13': + resolution: {integrity: sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==} + '@swc/helpers@0.5.5': resolution: {integrity: sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==} @@ -15062,15 +15126,24 @@ packages: '@types/node@18.19.26': resolution: {integrity: sha512-+wiMJsIwLOYCvUqSdKTrfkS8mpTp+MPINe6+Np4TAGFWWRWiBQ5kSq9nZGCSPkzx9mvT+uEukzpX4MOSCydcvw==} + '@types/node@18.19.60': + resolution: {integrity: sha512-cYRj7igVqgxhlHFdBHHpU2SNw3+dN2x0VTZJtLYk6y/ieuGN4XiBgtDjYVktM/yk2y/8pKMileNc6IoEzEJnUw==} + '@types/node@20.12.12': resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} + '@types/node@20.17.2': + resolution: {integrity: sha512-OOHK4sjXqkL7yQ7VEEHcf6+0jSvKjWqwnaCtY7AKD/VLEvRHMsxxu7eI8ErnjxHS8VwmekD4PeVCpu4qZEZSxg==} + '@types/node@20.5.1': resolution: {integrity: sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==} '@types/node@20.8.10': resolution: {integrity: sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==} + '@types/node@22.8.2': + resolution: {integrity: sha512-NzaRNFV+FZkvK/KLCsNdTvID0SThyrs5SHB6tsD/lajr22FGC73N2QeDPM2wHtVde8mgcXuSsHQkH5cX1pbPLw==} + '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -15459,6 +15532,9 @@ packages: '@types/ws@8.5.10': resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==} + '@types/ws@8.5.12': + resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==} + '@types/yargs-parser@21.0.3': resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} @@ -17451,6 +17527,10 @@ packages: resolution: {integrity: sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==} engines: {node: '>=18'} + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + commander@2.13.0: resolution: {integrity: sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==} @@ -21671,8 +21751,8 @@ packages: javascript-stringify@2.1.0: resolution: {integrity: sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==} - jayson@4.1.0: - resolution: {integrity: sha512-R6JlbyLN53Mjku329XoRT2zJAE6ZgOQ8f91ucYdMCD4nkGCF9kZSrcGXpHIU4jeKj58zUZke2p+cdQchU7Ly7A==} + jayson@4.1.2: + resolution: {integrity: sha512-5nzMWDHy6f+koZOuYsArh2AXs73NfWYVlFyJJuCedr93GpY+Ku8qq10ropSXVfHK+H0T6paA88ww+/dV+1fBNA==} engines: {node: '>=8'} hasBin: true @@ -24044,6 +24124,10 @@ packages: resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} hasBin: true + node-gyp-build@4.8.2: + resolution: {integrity: sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==} + hasBin: true + node-hid@2.1.2: resolution: {integrity: sha512-qhCyQqrPpP93F/6Wc/xUR7L8mAJW0Z6R7HMQV8jCHHksAxNDe/4z4Un/H9CpLOT+5K39OPyt9tIQlavxWES3lg==} engines: {node: '>=10'} @@ -26693,8 +26777,8 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - rpc-websockets@7.9.0: - resolution: {integrity: sha512-DwKewQz1IUA5wfLvgM8wDpPRcr+nWSxuFxx5CbrI2z/MyyZ4nXLM86TvIA+cI1ZAdqC8JIBR1mZR55dzaLU+Hw==} + rpc-websockets@9.0.4: + resolution: {integrity: sha512-yWZWN0M+bivtoNLnaDbtny4XchdAIF5Q4g/ZsC5UC61Ckbp0QczwO8fg44rV3uYmY4WHd+EZQbn90W1d8ojzqQ==} run-async@2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} @@ -27654,6 +27738,10 @@ packages: superstruct@0.6.2: resolution: {integrity: sha512-lvA97MFAJng3rfjcafT/zGTSWm6Tbpk++DP6It4Qg7oNaeM+2tdJMuVgGje21/bIpBEs6iQql1PJH6dKTjl4Ig==} + superstruct@2.0.2: + resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==} + engines: {node: '>=14.0.0'} + supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} engines: {node: '>=0.8.0'} @@ -28501,6 +28589,9 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + undici@5.28.3: resolution: {integrity: sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==} engines: {node: '>=14.0'} @@ -29614,6 +29705,18 @@ packages: utf-8-validate: optional: true + ws@8.18.0: + resolution: {integrity: sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + ws@8.5.0: resolution: {integrity: sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==} engines: {node: '>=10.0.0'} @@ -31920,6 +32023,10 @@ snapshots: dependencies: regenerator-runtime: 0.14.1 + '@babel/runtime@7.26.0': + dependencies: + regenerator-runtime: 0.14.1 + '@babel/template@7.24.0': dependencies: '@babel/code-frame': 7.24.6 @@ -32524,7 +32631,7 @@ snapshots: '@confio/ics23@0.6.8': dependencies: - '@noble/hashes': 1.4.0 + '@noble/hashes': 1.5.0 protobufjs: 6.11.4 '@cosmjs/amino@0.25.0-alpha.2': @@ -32588,7 +32695,7 @@ snapshots: '@cosmjs/encoding': 0.26.8 '@cosmjs/math': 0.26.8 '@cosmjs/utils': 0.26.8 - '@noble/hashes': 1.4.0 + '@noble/hashes': 1.5.0 bn.js: 5.2.1 elliptic: 6.5.5 libsodium-wrappers: 0.7.13 @@ -33875,7 +33982,7 @@ snapshots: text-table: 0.2.0 url-join: 4.0.0 wrap-ansi: 7.0.0 - ws: 8.17.1 + ws: 8.18.0 transitivePeerDependencies: - bufferutil - encoding @@ -34803,7 +34910,7 @@ snapshots: '@grpc/grpc-js@1.7.3': dependencies: '@grpc/proto-loader': 0.7.12 - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@grpc/proto-loader@0.6.13': dependencies: @@ -34907,7 +35014,7 @@ snapshots: '@inquirer/figures': 1.0.1 '@inquirer/type': 1.3.1 '@types/mute-stream': 0.0.4 - '@types/node': 20.12.12 + '@types/node': 20.17.2 '@types/wrap-ansi': 3.0.0 ansi-escapes: 4.3.2 chalk: 4.1.2 @@ -34985,7 +35092,7 @@ snapshots: '@jest/console@28.1.3': dependencies: '@jest/types': 28.1.3 - '@types/node': 20.12.12 + '@types/node': 18.19.26 chalk: 4.1.2 jest-message-util: 28.1.3 jest-util: 28.1.3 @@ -35045,14 +35152,14 @@ snapshots: '@jest/test-result': 28.1.3 '@jest/transform': 28.1.3 '@jest/types': 28.1.3 - '@types/node': 20.12.12 + '@types/node': 18.19.26 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 28.1.3 - jest-config: 28.1.3(@types/node@20.12.12) + jest-config: 28.1.3(@types/node@18.19.26) jest-haste-map: 28.1.3 jest-message-util: 28.1.3 jest-regex-util: 28.0.2 @@ -35538,7 +35645,7 @@ snapshots: '@jest/transform': 28.1.3 '@jest/types': 28.1.3 '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 20.12.12 + '@types/node': 18.19.26 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -35760,7 +35867,7 @@ snapshots: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/yargs': 15.0.19 chalk: 4.1.2 @@ -35768,7 +35875,7 @@ snapshots: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/yargs': 16.0.9 chalk: 4.1.2 @@ -35777,7 +35884,7 @@ snapshots: '@jest/schemas': 28.1.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.12 + '@types/node': 18.19.26 '@types/yargs': 17.0.32 chalk: 4.1.2 @@ -36298,6 +36405,10 @@ snapshots: dependencies: '@noble/hashes': 1.4.0 + '@noble/curves@1.6.0': + dependencies: + '@noble/hashes': 1.5.0 + '@noble/ed25519@1.7.3': {} '@noble/hashes@1.1.5': {} @@ -36308,6 +36419,8 @@ snapshots: '@noble/hashes@1.4.0': {} + '@noble/hashes@1.5.0': {} + '@noble/secp256k1@1.7.1': {} '@node-ipc/js-queue@2.0.3': @@ -36883,7 +36996,7 @@ snapshots: '@polkadot-api/substrate-bindings@0.0.1': dependencies: - '@noble/hashes': 1.4.0 + '@noble/hashes': 1.5.0 '@polkadot-api/utils': 0.0.1 '@scure/base': 1.1.6 scale-ts: 1.6.0 @@ -38646,7 +38759,7 @@ snapshots: '@rnx-kit/chromium-edge-launcher@1.0.0': dependencies: - '@types/node': 18.19.26 + '@types/node': 18.19.60 escape-string-regexp: 4.0.0 is-wsl: 2.2.0 lighthouse-logger: 1.4.2 @@ -39862,7 +39975,7 @@ snapshots: '@solana/buffer-layout-utils@0.2.0': dependencies: '@solana/buffer-layout': 4.0.1 - '@solana/web3.js': 1.91.6 + '@solana/web3.js': 1.95.4 bigint-buffer: 1.1.5 bignumber.js: 9.1.2 transitivePeerDependencies: @@ -39874,22 +39987,95 @@ snapshots: dependencies: buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) - '@solana/spl-token@0.3.9(@solana/web3.js@1.91.6)': + '@solana/codecs-core@2.0.0-rc.1(typescript@5.4.3)': + dependencies: + '@solana/errors': 2.0.0-rc.1(typescript@5.4.3) + typescript: 5.4.3 + + '@solana/codecs-data-structures@2.0.0-rc.1(typescript@5.4.3)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.4.3) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.4.3) + '@solana/errors': 2.0.0-rc.1(typescript@5.4.3) + typescript: 5.4.3 + + '@solana/codecs-numbers@2.0.0-rc.1(typescript@5.4.3)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.4.3) + '@solana/errors': 2.0.0-rc.1(typescript@5.4.3) + typescript: 5.4.3 + + '@solana/codecs-strings@2.0.0-rc.1(typescript@5.4.3)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.4.3) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.4.3) + '@solana/errors': 2.0.0-rc.1(typescript@5.4.3) + typescript: 5.4.3 + + '@solana/codecs@2.0.0-rc.1(typescript@5.4.3)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.4.3) + '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@5.4.3) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.4.3) + '@solana/codecs-strings': 2.0.0-rc.1(typescript@5.4.3) + '@solana/options': 2.0.0-rc.1(typescript@5.4.3) + typescript: 5.4.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/errors@2.0.0-rc.1(typescript@5.4.3)': + dependencies: + chalk: 5.3.0 + commander: 12.1.0 + typescript: 5.4.3 + + '@solana/options@2.0.0-rc.1(typescript@5.4.3)': + dependencies: + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.4.3) + '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@5.4.3) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.4.3) + '@solana/codecs-strings': 2.0.0-rc.1(typescript@5.4.3) + '@solana/errors': 2.0.0-rc.1(typescript@5.4.3) + typescript: 5.4.3 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + + '@solana/spl-token-group@0.0.7(@solana/web3.js@1.95.4)(typescript@5.4.3)': + dependencies: + '@solana/codecs': 2.0.0-rc.1(typescript@5.4.3) + '@solana/web3.js': 1.95.4 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + - typescript + + '@solana/spl-token-metadata@0.1.6(@solana/web3.js@1.95.4)(typescript@5.4.3)': + dependencies: + '@solana/codecs': 2.0.0-rc.1(typescript@5.4.3) + '@solana/web3.js': 1.95.4 + transitivePeerDependencies: + - fastestsmallesttextencoderdecoder + - typescript + + '@solana/spl-token@0.4.9(@solana/web3.js@1.95.4)(typescript@5.4.3)': dependencies: '@solana/buffer-layout': 4.0.1 '@solana/buffer-layout-utils': 0.2.0 - '@solana/web3.js': 1.91.6 + '@solana/spl-token-group': 0.0.7(@solana/web3.js@1.95.4)(typescript@5.4.3) + '@solana/spl-token-metadata': 0.1.6(@solana/web3.js@1.95.4)(typescript@5.4.3) + '@solana/web3.js': 1.95.4 buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) transitivePeerDependencies: - bufferutil - encoding + - fastestsmallesttextencoderdecoder + - typescript - utf-8-validate - '@solana/web3.js@1.91.6': + '@solana/web3.js@1.95.4': dependencies: - '@babel/runtime': 7.24.1 - '@noble/curves': 1.4.0 - '@noble/hashes': 1.4.0 + '@babel/runtime': 7.26.0 + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 '@solana/buffer-layout': 4.0.1 agentkeepalive: 4.5.0 bigint-buffer: 1.1.5 @@ -39898,10 +40084,10 @@ snapshots: bs58: 4.0.1 buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) fast-stable-stringify: 1.0.0 - jayson: 4.1.0 + jayson: 4.1.2 node-fetch: 2.7.0 - rpc-websockets: 7.9.0 - superstruct: 0.14.2 + rpc-websockets: 9.0.4 + superstruct: 2.0.2 transitivePeerDependencies: - bufferutil - encoding @@ -39943,13 +40129,13 @@ snapshots: '@stacks/common@4.3.5': dependencies: '@types/bn.js': 5.1.5 - '@types/node': 18.19.26 + '@types/node': 18.19.60 buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) '@stacks/common@6.13.0': dependencies: '@types/bn.js': 5.1.5 - '@types/node': 18.19.26 + '@types/node': 18.19.60 '@stacks/network@4.3.5': dependencies: @@ -39967,11 +40153,11 @@ snapshots: '@stacks/transactions@4.3.8': dependencies: - '@noble/hashes': 1.4.0 + '@noble/hashes': 1.5.0 '@noble/secp256k1': 1.7.1 '@stacks/common': 4.3.5 '@stacks/network': 4.3.5 - '@types/node': 18.19.26 + '@types/node': 18.19.60 '@types/sha.js': 2.4.4 c32check: 1.1.3 lodash.clonedeep: 4.5.0 @@ -41384,7 +41570,7 @@ snapshots: '@storybook/node-logger': 7.6.20 '@storybook/types': 7.6.20 '@types/find-cache-dir': 3.2.1 - '@types/node': 18.19.26 + '@types/node': 18.19.60 '@types/node-fetch': 2.6.11 '@types/pretty-hrtime': 1.0.3 chalk: 4.1.2 @@ -41445,7 +41631,7 @@ snapshots: '@storybook/telemetry': 7.6.20 '@storybook/types': 7.6.20 '@types/detect-port': 1.3.5 - '@types/node': 18.19.26 + '@types/node': 18.19.60 '@types/pretty-hrtime': 1.0.3 '@types/semver': 7.5.8 better-opn: 3.0.2 @@ -42324,6 +42510,10 @@ snapshots: dependencies: tslib: 2.6.2 + '@swc/helpers@0.5.13': + dependencies: + tslib: 2.6.2 + '@swc/helpers@0.5.5': dependencies: '@swc/counter': 0.1.3 @@ -42599,7 +42789,7 @@ snapshots: '@types/accepts@1.3.7': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/aria-query@5.0.4': {} @@ -42642,7 +42832,7 @@ snapshots: '@types/bn.js@5.1.5': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/body-parser@1.19.5': dependencies: @@ -42651,7 +42841,7 @@ snapshots: '@types/bonjour@3.5.13': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/bs58@4.0.4': dependencies: @@ -42696,11 +42886,11 @@ snapshots: '@types/connect-history-api-fallback@1.5.4': dependencies: '@types/express-serve-static-core': 4.17.43 - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/connect@3.4.36': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/connect@3.4.38': dependencies: @@ -42715,7 +42905,7 @@ snapshots: '@types/connect': 3.4.38 '@types/express': 4.17.21 '@types/keygrip': 1.0.6 - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/cors@2.8.17': dependencies: @@ -42804,7 +42994,7 @@ snapshots: '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 20.12.12 + '@types/node': 18.19.26 '@types/fs-extra@9.0.13': dependencies: @@ -42843,7 +43033,7 @@ snapshots: '@types/http-proxy@1.17.14': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/imurmurhash@0.1.4': {} @@ -42899,7 +43089,7 @@ snapshots: '@types/jsonfile@6.1.4': dependencies: - '@types/node': 20.12.12 + '@types/node': 18.19.26 '@types/jsonwebtoken@9.0.6': dependencies: @@ -42924,7 +43114,7 @@ snapshots: '@types/http-errors': 2.0.4 '@types/keygrip': 1.0.6 '@types/koa-compose': 3.2.8 - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/koa__router@12.0.3': dependencies: @@ -42971,11 +43161,11 @@ snapshots: '@types/mute-stream@0.0.4': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.17.2 '@types/mysql@2.15.22': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/node-fetch@2.6.11': dependencies: @@ -42984,7 +43174,7 @@ snapshots: '@types/node-forge@1.3.11': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/node-hid@1.3.4': dependencies: @@ -43006,16 +43196,28 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/node@18.19.60': + dependencies: + undici-types: 5.26.5 + '@types/node@20.12.12': dependencies: undici-types: 5.26.5 + '@types/node@20.17.2': + dependencies: + undici-types: 6.19.8 + '@types/node@20.5.1': {} '@types/node@20.8.10': dependencies: undici-types: 5.26.5 + '@types/node@22.8.2': + dependencies: + undici-types: 6.19.8 + '@types/normalize-package-data@2.4.4': {} '@types/numeral@2.0.5': {} @@ -43038,13 +43240,13 @@ snapshots: '@types/pg@8.6.1': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 pg-protocol: 1.6.1 pg-types: 2.2.0 '@types/plist@3.0.2': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 xmlbuilder: 15.1.1 optional: true @@ -43262,7 +43464,7 @@ snapshots: '@types/sockjs@0.3.36': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/stack-utils@2.0.3': {} @@ -43315,7 +43517,7 @@ snapshots: '@types/tunnel@0.0.3': dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 '@types/unist@2.0.10': {} @@ -43350,12 +43552,16 @@ snapshots: '@types/ws@7.4.7': dependencies: - '@types/node': 20.12.12 + '@types/node': 12.20.55 '@types/ws@8.5.10': dependencies: '@types/node': 20.12.12 + '@types/ws@8.5.12': + dependencies: + '@types/node': 22.8.2 + '@types/yargs-parser@21.0.3': {} '@types/yargs@13.0.12': @@ -44183,9 +44389,9 @@ snapshots: '@xrplf/isomorphic@1.0.0': dependencies: - '@noble/hashes': 1.4.0 + '@noble/hashes': 1.5.0 eventemitter3: 5.0.1 - ws: 8.17.1 + ws: 8.18.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -45087,7 +45293,7 @@ snapshots: babel-plugin-macros@3.1.0: dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.26.0 cosmiconfig: 7.1.0 resolve: 1.22.8 @@ -45350,7 +45556,7 @@ snapshots: '@babel/preset-env': 7.24.3(@babel/core@7.24.3) '@babel/preset-react': 7.24.1(@babel/core@7.24.3) '@babel/preset-typescript': 7.24.1(@babel/core@7.24.3) - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.26.0 babel-plugin-macros: 3.1.0 babel-plugin-transform-react-remove-prop-types: 0.4.24 transitivePeerDependencies: @@ -45939,7 +46145,7 @@ snapshots: c32check@2.0.0: dependencies: - '@noble/hashes': 1.4.0 + '@noble/hashes': 1.1.5 base-x: 4.0.0 cac@6.7.14: {} @@ -46221,7 +46427,7 @@ snapshots: chrome-launcher@0.15.2: dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 escape-string-regexp: 4.0.0 is-wsl: 2.2.0 lighthouse-logger: 1.4.2 @@ -46468,6 +46674,8 @@ snapshots: commander@12.0.0: {} + commander@12.1.0: {} + commander@2.13.0: {} commander@2.20.0: {} @@ -51641,7 +51849,7 @@ snapshots: javascript-stringify@2.1.0: {} - jayson@4.1.0: + jayson@4.1.2: dependencies: '@types/connect': 3.4.38 '@types/node': 12.20.55 @@ -51740,7 +51948,7 @@ snapshots: '@jest/expect': 28.1.3 '@jest/test-result': 28.1.3 '@jest/types': 28.1.3 - '@types/node': 20.12.12 + '@types/node': 18.19.26 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -52722,7 +52930,7 @@ snapshots: '@jest/environment': 28.1.3 '@jest/fake-timers': 28.1.3 '@jest/types': 28.1.3 - '@types/node': 20.12.12 + '@types/node': 18.19.26 jest-mock: 28.1.3 jest-util: 28.1.3 @@ -52775,7 +52983,7 @@ snapshots: dependencies: '@jest/types': 28.1.3 '@types/graceful-fs': 4.1.9 - '@types/node': 20.12.12 + '@types/node': 18.19.26 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -53077,7 +53285,7 @@ snapshots: '@jest/test-result': 28.1.3 '@jest/transform': 28.1.3 '@jest/types': 28.1.3 - '@types/node': 20.12.12 + '@types/node': 18.19.26 chalk: 4.1.2 emittery: 0.10.2 graceful-fs: 4.2.11 @@ -53313,7 +53521,7 @@ snapshots: jest-util@28.1.3: dependencies: '@jest/types': 28.1.3 - '@types/node': 20.12.12 + '@types/node': 18.19.26 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -53380,7 +53588,7 @@ snapshots: dependencies: '@jest/test-result': 28.1.3 '@jest/types': 28.1.3 - '@types/node': 20.12.12 + '@types/node': 18.19.26 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.10.2 @@ -53406,13 +53614,13 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 merge-stream: 2.0.0 supports-color: 8.1.1 jest-worker@27.5.1(metro@0.80.12): dependencies: - '@types/node': 20.12.12 + '@types/node': 22.8.2 merge-stream: 2.0.0 supports-color: 8.1.1 optionalDependencies: @@ -56238,6 +56446,8 @@ snapshots: node-gyp-build@4.8.0: {} + node-gyp-build@4.8.2: {} + node-hid@2.1.2: dependencies: bindings: 1.5.0 @@ -57732,7 +57942,7 @@ snapshots: '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 '@types/long': 4.0.2 - '@types/node': 20.12.12 + '@types/node': 22.8.2 long: 4.0.0 protobufjs@6.11.4: @@ -57748,7 +57958,7 @@ snapshots: '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 '@types/long': 4.0.2 - '@types/node': 20.12.12 + '@types/node': 22.8.2 long: 4.0.0 protobufjs@7.2.5: @@ -59178,7 +59388,7 @@ snapshots: regenerator-transform@0.15.2: dependencies: - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.26.0 regex-parser@2.3.0: {} @@ -59606,12 +59816,15 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.24.0 fsevents: 2.3.3 - rpc-websockets@7.9.0: + rpc-websockets@9.0.4: dependencies: - '@babel/runtime': 7.24.1 - eventemitter3: 4.0.7 + '@swc/helpers': 0.5.13 + '@types/uuid': 8.3.4 + '@types/ws': 8.5.12 + buffer: 6.0.3(patch_hash=2xnca52oxhztvr7iaoovwclcze) + eventemitter3: 5.0.1 uuid: 8.3.2 - ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) optionalDependencies: bufferutil: 4.0.8 utf-8-validate: 5.0.10 @@ -60087,7 +60300,7 @@ snapshots: sodium-native@4.1.1: dependencies: - node-gyp-build: 4.8.0 + node-gyp-build: 4.8.2 optional: true sonic-boom@4.0.1: @@ -60861,6 +61074,8 @@ snapshots: clone-deep: 2.0.2 kind-of: 6.0.3 + superstruct@2.0.2: {} + supports-color@2.0.0: {} supports-color@5.5.0: @@ -62114,6 +62329,8 @@ snapshots: undici-types@5.26.5: {} + undici-types@6.19.8: {} + undici@5.28.3: dependencies: '@fastify/busboy': 2.1.1 @@ -62424,7 +62641,7 @@ snapshots: utf-8-validate@5.0.10: dependencies: - node-gyp-build: 4.8.0 + node-gyp-build: 4.8.2 utf-8-validate@6.0.3: dependencies: @@ -63785,7 +64002,7 @@ snapshots: '@apideck/better-ajv-errors': 0.3.6(ajv@8.17.1) '@babel/core': 7.24.3 '@babel/preset-env': 7.24.3(@babel/core@7.24.3) - '@babel/runtime': 7.24.1 + '@babel/runtime': 7.26.0 '@rollup/plugin-babel': 5.3.1(@babel/core@7.24.3)(rollup@2.79.2) '@rollup/plugin-node-resolve': 11.2.1(rollup@2.79.2) '@rollup/plugin-replace': 2.4.2(rollup@2.79.2) @@ -63960,15 +64177,17 @@ snapshots: ws@8.17.1: {} - ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): + ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@6.0.3): optionalDependencies: bufferutil: 4.0.8 - utf-8-validate: 5.0.10 + utf-8-validate: 6.0.3 - ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@6.0.3): + ws@8.18.0: {} + + ws@8.18.0(bufferutil@4.0.8)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.8 - utf-8-validate: 6.0.3 + utf-8-validate: 5.0.10 ws@8.5.0: {} From 89b8ced450d54e6cc52efff7ecb69d4ca50660c2 Mon Sep 17 00:00:00 2001 From: Kant Date: Mon, 4 Nov 2024 09:16:29 +0100 Subject: [PATCH 06/10] chore: remove unused import --- libs/coin-modules/coin-solana/src/api/chain/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/coin-modules/coin-solana/src/api/chain/index.ts b/libs/coin-modules/coin-solana/src/api/chain/index.ts index 09be4cfd7815..d07c939b0c98 100644 --- a/libs/coin-modules/coin-solana/src/api/chain/index.ts +++ b/libs/coin-modules/coin-solana/src/api/chain/index.ts @@ -11,7 +11,6 @@ import { sendAndConfirmRawTransaction, SignaturesForAddressOptions, StakeProgram, - GetRecentPrioritizationFeesConfig, TransactionInstruction, ComputeBudgetProgram, VersionedTransaction, From 7761bfb5a97aac20b1ea1355af5e591fe30c1217 Mon Sep 17 00:00:00 2001 From: Kant Date: Mon, 4 Nov 2024 20:18:01 +0100 Subject: [PATCH 07/10] fix: desktop test resolver issue for solana libs --- apps/ledger-live-desktop/scripts/resolver.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/ledger-live-desktop/scripts/resolver.js b/apps/ledger-live-desktop/scripts/resolver.js index 66829ecebc34..80593b093ddd 100644 --- a/apps/ledger-live-desktop/scripts/resolver.js +++ b/apps/ledger-live-desktop/scripts/resolver.js @@ -19,6 +19,14 @@ module.exports = (path, options) => { "@firebase/util", "firebase", "uuid", + "rpc-websockets", + "@solana/codecs", + "@solana/codecs-core", + "@solana/errors", + "@solana/codecs-data-structures", + "@solana/codecs-numbers", + "@solana/codecs-strings", + "@solana/options", ]); if (pkgNamesToTarget.has(pkg.name)) { From fe39249cef50e499718e7a7d6a04de4ca7737ee7 Mon Sep 17 00:00:00 2001 From: Kant Date: Mon, 4 Nov 2024 20:21:25 +0100 Subject: [PATCH 08/10] chore: update common unimported config for solana libs --- libs/ledger-live-common/.unimportedrc.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/ledger-live-common/.unimportedrc.json b/libs/ledger-live-common/.unimportedrc.json index 4f1a507d3fed..9b85e8bd3b1f 100644 --- a/libs/ledger-live-common/.unimportedrc.json +++ b/libs/ledger-live-common/.unimportedrc.json @@ -413,8 +413,7 @@ "bigint-buffer", "jayson/lib/client/browser", "node-fetch", - "rpc-websockets/dist/lib/client", - "rpc-websockets/dist/lib/client/websocket", + "rpc-websockets", "superstruct" ] } From a2dff97214c9379e5cfae51b45a3f0c36531526e Mon Sep 17 00:00:00 2001 From: Kant Date: Mon, 4 Nov 2024 20:47:46 +0100 Subject: [PATCH 09/10] chore: fix mobile jest tests with solana libs --- apps/ledger-live-mobile/jest.config.js | 1 + apps/ledger-live-mobile/scripts/resolver.js | 27 +++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 apps/ledger-live-mobile/scripts/resolver.js diff --git a/apps/ledger-live-mobile/jest.config.js b/apps/ledger-live-mobile/jest.config.js index 8d8171ac34f4..933968e94a6d 100644 --- a/apps/ledger-live-mobile/jest.config.js +++ b/apps/ledger-live-mobile/jest.config.js @@ -62,6 +62,7 @@ module.exports = { { outputName: "llm-sonar-executionTests-report.xml", reportedFilePath: "absolute" }, ], ], + resolver: "/scripts/resolver.js", moduleNameMapper: { ...pathsToModuleNameMapper(compilerOptions.paths), "^react$": "/node_modules/react", diff --git a/apps/ledger-live-mobile/scripts/resolver.js b/apps/ledger-live-mobile/scripts/resolver.js new file mode 100644 index 000000000000..086c1886b28d --- /dev/null +++ b/apps/ledger-live-mobile/scripts/resolver.js @@ -0,0 +1,27 @@ +module.exports = (path, options) => { + // Call the defaultResolver, so we leverage its cache, error handling, etc. + return options.defaultResolver(path, { + ...options, + // Use packageFilter to process parsed `package.json` before the resolution (see https://www.npmjs.com/package/resolve#resolveid-opts-cb) + packageFilter: pkg => { + const pkgNamesToTarget = new Set([ + "rpc-websockets", + "@solana/codecs", + "@solana/codecs-core", + "@solana/errors", + "@solana/codecs-data-structures", + "@solana/codecs-numbers", + "@solana/codecs-strings", + "@solana/options", + ]); + + if (pkgNamesToTarget.has(pkg.name)) { + // console.log('>>>', pkg.name) + delete pkg["exports"]; + delete pkg["module"]; + } + + return pkg; + }, + }); +}; From cad783e9d17bd1063b76959672b5a28380d6475b Mon Sep 17 00:00:00 2001 From: Kant Date: Tue, 12 Nov 2024 16:42:15 +0100 Subject: [PATCH 10/10] chore: add changeset --- .changeset/small-hairs-flow.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/small-hairs-flow.md diff --git a/.changeset/small-hairs-flow.md b/.changeset/small-hairs-flow.md new file mode 100644 index 000000000000..cecf71d211d8 --- /dev/null +++ b/.changeset/small-hairs-flow.md @@ -0,0 +1,6 @@ +--- +"@ledgerhq/coin-solana": patch +"@ledgerhq/live-common": patch +--- + +fix: solana priority fees