Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade most dependencies to latest versions #771

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .size-limit.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"path": "packages/anchor-contrib/dist/esm/index.js",
"limit": "12 KB",
"ignore": [
"@project-serum/anchor",
"@coral-xyz/anchor",
"@solana/web3.js",
"@saberhq/solana-contrib"
],
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"@babel/core": "^7.23.5",
"@babel/preset-env": "^7.23.5",
"@babel/preset-typescript": "^7.23.3",
"@coral-xyz/anchor": "^0.26.0",
"@jest/types": "^29.6.3",
"@project-serum/anchor": "^0.25.0",
"@rushstack/eslint-patch": "^1.6.0",
"@saberhq/eslint-config": "^3.1.1",
"@saberhq/eslint-config-react": "^3.1.1",
"@saberhq/tsconfig": "^3.1.1",
"@saberhq/eslint-config": "^3.2.1",
"@saberhq/eslint-config-react": "^3.2.1",
"@saberhq/tsconfig": "^3.2.1",
"@saberhq/use-solana": "workspace:*",
"@size-limit/file": "^11.0.0",
"@size-limit/webpack": "^11.0.0",
Expand All @@ -31,20 +31,20 @@
"@types/bn.js": "^5.1.5",
"@types/eslint": "^8.44.8",
"@types/jest": "^29.5.10",
"@types/node": "^18.18.14",
"@types/react": "^18.2.39",
"@types/node": "^18.19.2",
"@types/react": "^18.2.41",
"@types/source-map-support": "^0.5.10",
"@types/w3c-web-usb": "^1.0.10",
"@typescript-eslint/utils": "^6.13.1",
"@yarnpkg/doctor": "^4.0.1",
"bn.js": "^5.2.1",
"buffer": "^6.0.3",
"eslint": "^8.54.0",
"eslint": "^8.55.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-runtime": "^29.7.0",
"jsbi": "^4.3.0",
"lint-staged": "^15.1.0",
"lint-staged": "^15.2.0",
"prettier": "^3.1.0",
"react": "^18.2.0",
"size-limit": "^11.0.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/anchor-contrib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"prepublishOnly": "npm run build"
},
"peerDependencies": {
"@project-serum/anchor": "^0.22 || ^0.23 || ^0.24",
"@coral-xyz/anchor": "^0.22 || ^0.23 || ^0.24",
"@solana/web3.js": "^1.42",
"bn.js": "^4 || ^5"
},
"devDependencies": {
"@project-serum/anchor": "^0.25.0",
"@saberhq/tsconfig": "^3.1.1",
"@coral-xyz/anchor": "^0.29.0",
"@saberhq/tsconfig": "^3.2.1",
"@solana/web3.js": "^1.87.6",
"@types/lodash.camelcase": "^4.3.9",
"@types/lodash.mapvalues": "^4.6.9",
Expand All @@ -37,7 +37,7 @@
},
"dependencies": {
"@saberhq/solana-contrib": "workspace:^",
"eventemitter3": "^4.0.7",
"eventemitter3": "^5.0.1",
"lodash.camelcase": "^4.3.0",
"lodash.mapvalues": "^4.6.0",
"tslib": "^2.6.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/anchor-contrib/src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Idl } from "@project-serum/anchor";
import type { IdlErrorCode } from "@project-serum/anchor/dist/esm/idl.js";
import type { Idl } from "@coral-xyz/anchor";
import type { IdlErrorCode } from "@coral-xyz/anchor/dist/esm/idl.js";

import type { AnchorError } from "./index.js";

Expand Down
4 changes: 2 additions & 2 deletions packages/anchor-contrib/src/generateAccountParsers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AccountsCoder, Idl } from "@project-serum/anchor";
import { BorshAccountsCoder } from "@project-serum/anchor";
import type { AccountsCoder, Idl } from "@coral-xyz/anchor";
import { BorshAccountsCoder } from "@coral-xyz/anchor";
import camelCase from "lodash.camelcase";

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/anchor-contrib/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
Program as AProgram,
ProgramAccount,
StateClient,
} from "@project-serum/anchor";
} from "@coral-xyz/anchor";
import type {
Idl,
IdlAccountItem,
Expand All @@ -18,7 +18,7 @@ import type {
IdlType,
IdlTypeDef,
IdlTypeDefTyStruct,
} from "@project-serum/anchor/dist/esm/idl.js";
} from "@coral-xyz/anchor/dist/esm/idl.js";
import type {
AccountMeta,
PublicKey,
Expand Down
6 changes: 3 additions & 3 deletions packages/anchor-contrib/src/utils/accounts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AccountsCoder } from "@project-serum/anchor";
import { BorshAccountsCoder } from "@project-serum/anchor";
import type { IdlTypeDef } from "@project-serum/anchor/dist/esm/idl.js";
import type { AccountsCoder } from "@coral-xyz/anchor";
import { BorshAccountsCoder } from "@coral-xyz/anchor";
import type { IdlTypeDef } from "@coral-xyz/anchor/dist/esm/idl.js";
import type { ProgramAccountParser, PublicKey } from "@saberhq/solana-contrib";
import camelCase from "lodash.camelcase";

Expand Down
11 changes: 6 additions & 5 deletions packages/anchor-contrib/src/utils/coder.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Accounts, Idl } from "@project-serum/anchor";
import { BorshCoder, EventParser, utils } from "@project-serum/anchor";
import { default as InstructionNamespaceFactory } from "@project-serum/anchor/dist/cjs/program/namespace/instruction.js";
import type { InstructionDisplay } from "@project-serum/anchor/dist/esm/coder/borsh/instruction.js";
import type { Accounts, Idl } from "@coral-xyz/anchor";
import { BorshCoder, EventParser, utils } from "@coral-xyz/anchor";
import { default as InstructionNamespaceFactory } from "@coral-xyz/anchor/dist/cjs/program/namespace/instruction.js";
import type { InstructionDisplay } from "@coral-xyz/anchor/dist/esm/coder/borsh/instruction.js";
import type {
IdlAccountItem,
IdlTypeDef,
} from "@project-serum/anchor/dist/esm/idl.js";
} from "@coral-xyz/anchor/dist/esm/idl.js";
import type { Provider as SaberProvider } from "@saberhq/solana-contrib";
import type { GetProgramAccountsFilter, PublicKey } from "@solana/web3.js";
import { TransactionInstruction } from "@solana/web3.js";
Expand Down Expand Up @@ -207,6 +207,7 @@ export class SuperCoder<T extends CoderAnchorTypes> {
const keys = InstructionNamespaceFactory.accountsArray(
accounts,
idlIx.accounts,
this.address,
name,
);
return new TransactionInstruction({
Expand Down
2 changes: 1 addition & 1 deletion packages/anchor-contrib/src/utils/idl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IdlType } from "@project-serum/anchor/dist/esm/idl.js";
import type { IdlType } from "@coral-xyz/anchor/dist/esm/idl.js";

/**
* Formats an IDL type as a string. This comes straight from the Anchor source.
Expand Down
4 changes: 2 additions & 2 deletions packages/anchor-contrib/src/utils/programs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Idl } from "@project-serum/anchor";
import { Program } from "@project-serum/anchor";
import type { Idl } from "@coral-xyz/anchor";
import { Program } from "@coral-xyz/anchor";
import type {
Provider as SaberProvider,
ReadonlyProvider as ReadonlySaberProvider,
Expand Down
4 changes: 2 additions & 2 deletions packages/anchor-contrib/src/utils/provider.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type {
AnchorProvider as AnchorProviderImpl,
Provider as IAnchorProvider,
} from "@project-serum/anchor";
import * as anchor from "@project-serum/anchor";
} from "@coral-xyz/anchor";
import * as anchor from "@coral-xyz/anchor";
import type {
Provider as SaberProvider,
ReadonlyProvider as ReadonlySaberProvider,
Expand Down
6 changes: 3 additions & 3 deletions packages/chai-solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
"access": "public"
},
"peerDependencies": {
"@project-serum/anchor": ">=0.17",
"@coral-xyz/anchor": ">=0.17",
"@solana/web3.js": "^1.42",
"bn.js": "^5.2.0",
"jsbi": "*"
},
"devDependencies": {
"@project-serum/anchor": "^0.25.0",
"@saberhq/tsconfig": "^3.1.1",
"@coral-xyz/anchor": "^0.26.0",
"@saberhq/tsconfig": "^3.2.1",
"@solana/web3.js": "^1.87.6",
"bn.js": "^5.2.1",
"jsbi": "^4.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/chai-solana/src/expectTXTable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IdlErrorCode } from "@project-serum/anchor/dist/esm/idl.js";
import type { IdlErrorCode } from "@coral-xyz/anchor/dist/esm/idl.js";
import { matchError, matchErrorCode } from "@saberhq/anchor-contrib";
import type { TransactionEnvelope } from "@saberhq/solana-contrib";
import { parseTransactionLogs, printTXTable } from "@saberhq/solana-contrib";
Expand Down
4 changes: 2 additions & 2 deletions packages/chai-solana/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import "./types.js";

import type { Address } from "@project-serum/anchor";
import { BN } from "@project-serum/anchor";
import type { Address } from "@coral-xyz/anchor";
import { BN } from "@coral-xyz/anchor";
import { TokenAmount } from "@saberhq/token-utils";
import { PublicKey } from "@solana/web3.js";
import chaiAsPromised from "chai-as-promised";
Expand Down
2 changes: 1 addition & 1 deletion packages/chai-solana/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import "chai-bn";
import "chai-as-promised";

import type { Address } from "@project-serum/anchor";
import type { Address } from "@coral-xyz/anchor";
import type { BigintIsh, TokenAmount } from "@saberhq/token-utils";

declare global {
Expand Down
2 changes: 1 addition & 1 deletion packages/chai-solana/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "chai-as-promised";

import type { Idl } from "@project-serum/anchor";
import type { Idl } from "@coral-xyz/anchor";
import type {
PromiseOrValue,
TransactionLike,
Expand Down
2 changes: 1 addition & 1 deletion packages/option-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@saberhq/tsconfig": "^3.1.1",
"@saberhq/tsconfig": "^3.2.1",
"typescript": "^5.3.2"
}
}
6 changes: 3 additions & 3 deletions packages/solana-contrib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
],
"dependencies": {
"@saberhq/option-utils": "workspace:^",
"@solana/buffer-layout": "^4.0.0",
"@solana/buffer-layout": "^4.0.1",
"@types/promise-retry": "^1.1.6",
"@types/retry": "^0.12.5",
"promise-retry": "^2.0.1",
Expand All @@ -36,11 +36,11 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@saberhq/tsconfig": "^3.1.1",
"@saberhq/tsconfig": "^3.2.1",
"@solana/web3.js": "^1.87.6",
"@types/bn.js": "^5.1.5",
"@types/jest": "^29.5.10",
"@types/node": "^18.18.14",
"@types/node": "^18.19.2",
"bn.js": "^5.2.1",
"typescript": "^5.3.2"
},
Expand Down
9 changes: 7 additions & 2 deletions packages/solana-contrib/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
Signer,
SimulatedTransactionResponse,
Transaction,
VersionedTransaction,
} from "@solana/web3.js";

import type { BroadcastOptions, PendingTransaction } from "./index.js";
Expand All @@ -24,13 +25,17 @@ export interface Wallet {
* Signs a transaction with the wallet.
* @param tx
*/
signTransaction(tx: Transaction): Promise<Transaction>;
signTransaction<T extends Transaction | VersionedTransaction>(
tx: T,
): Promise<T>;

/**
* Signs all transactions with the wallet.
* @param txs
*/
signAllTransactions(txs: Transaction[]): Promise<Transaction[]>;
signAllTransactions<T extends Transaction | VersionedTransaction>(
txs: T[],
): Promise<T[]>;

/**
* The PublicKey of the wallet.
Expand Down
6 changes: 3 additions & 3 deletions packages/solana-contrib/src/utils/printAccountOwners.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// import { Provider as AnchorProvider } from "@project-serum/anchor";
// import { Provider as AnchorProvider } from "@coral-xyz/anchor";
import type { AccountInfo, Connection } from "@solana/web3.js";
import { PublicKey } from "@solana/web3.js";

Expand Down Expand Up @@ -213,12 +213,12 @@ const _transformAccountOwners = async (
if (Object.keys(base58ToResultKey).length > 0) {
const accountInfos = await gracefulGetMultipleAccountsInfo(
connection,
base58ToLookup
base58ToLookup,
);

for (const [base58, resultKey] of Object.entries(base58ToResultKey)) {
const lookupIndex = base58ToLookup.findIndex(
(p) => p.toBase58() === base58
(p) => p.toBase58() === base58,
);
if (lookupIndex >= 0) {
const accountInfo = accountInfos[lookupIndex];
Expand Down
23 changes: 18 additions & 5 deletions packages/solana-contrib/src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
PublicKey,
Signer,
Transaction,
VersionedTransaction,
} from "@solana/web3.js";

import type { Provider, Wallet } from "./interfaces.js";
Expand All @@ -19,18 +20,30 @@ export class SignerWallet implements Wallet {
return this.signer.publicKey;
}

signAllTransactions(transactions: Transaction[]): Promise<Transaction[]> {
signAllTransactions<T extends Transaction | VersionedTransaction>(
transactions: T[],
): Promise<T[]> {
return Promise.resolve(
transactions.map((tx) => {
tx.partialSign(this.signer);
if ("version" in tx) {
tx.sign([this.signer]);
} else {
tx.partialSign(this.signer);
}
return tx;
}),
);
}

signTransaction(transaction: Transaction): Promise<Transaction> {
transaction.partialSign(this.signer);
return Promise.resolve(transaction);
signTransaction<T extends Transaction | VersionedTransaction>(
tx: T,
): Promise<T> {
if ("version" in tx) {
tx.sign([this.signer]);
} else {
tx.partialSign(this.signer);
}
return Promise.resolve(tx);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/stableswap-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"node": ">=12.x"
},
"devDependencies": {
"@saberhq/tsconfig": "^3.1.1",
"@saberhq/tsconfig": "^3.2.1",
"@solana/web3.js": "^1.87.6",
"@types/bn.js": "^5.1.5",
"@types/lodash": "^4.14.202",
"@types/node": "^18.18.14",
"@types/node": "^18.19.2",
"bn.js": "^5.2.1",
"jsbi": "^4.3.0",
"lodash": "^4.17.21",
Expand All @@ -45,7 +45,7 @@
"dependencies": {
"@saberhq/solana-contrib": "workspace:^",
"@saberhq/token-utils": "workspace:^",
"@solana/buffer-layout": "^4.0.0",
"@solana/buffer-layout": "^4.0.1",
"tiny-invariant": "^1.3.1",
"tslib": "^2.6.2"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/token-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"dependencies": {
"@saberhq/solana-contrib": "workspace:^",
"@solana/buffer-layout": "^4.0.0",
"@solana/spl-token": "^0.1.8",
"@solana/buffer-layout": "^4.0.1",
"@solana/spl-token": "^0.1",
"@ubeswap/token-math": "^5.2.1",
"tiny-invariant": "^1.3.1",
"tslib": "^2.6.2"
Expand All @@ -38,7 +38,7 @@
"src/"
],
"devDependencies": {
"@saberhq/tsconfig": "^3.1.1",
"@saberhq/tsconfig": "^3.2.1",
"@solana/web3.js": "^1.87.6",
"@types/bn.js": "^5.1.5",
"jsbi": "^4.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/tuple-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@saberhq/tsconfig": "^3.1.1",
"@saberhq/tsconfig": "^3.2.1",
"typescript": "^5.3.2"
}
}
Loading
Loading