Skip to content

Commit

Permalink
Use web3.js v2.0.0 (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjthieme authored Nov 8, 2024
1 parent a735f9a commit bc2b1e1
Show file tree
Hide file tree
Showing 7 changed files with 1,090 additions and 2,334 deletions.
4 changes: 2 additions & 2 deletions ts-sdk/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"clean": "rimraf dist src/generated"
},
"peerDependencies": {
"@solana/web3.js": "^2.0.0-rc.1"
"@solana/web3.js": "^2.0.0"
},
"devDependencies": {
"@codama/nodes-from-anchor": "^1.0.0",
"@codama/renderers-js": "^1.0.1",
"@orca-so/whirlpools-program": "*",
"@solana/web3.js": "^2.0.0-rc.1",
"@solana/web3.js": "^2.0.0",
"codama": "^1.0.0",
"typescript": "^5.6.3"
},
Expand Down
4 changes: 2 additions & 2 deletions ts-sdk/whirlpool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"@solana-program/token-2022": "^0.3.0"
},
"peerDependencies": {
"@solana/web3.js": "^2.0.0-rc.1"
"@solana/web3.js": "^2.0.0"
},
"devDependencies": {
"@solana/web3.js": "^2.0.0-rc.1",
"@solana/web3.js": "^2.0.0",
"solana-bankrun": "^0.4.0",
"typescript": "^5.6.3"
},
Expand Down
4 changes: 2 additions & 2 deletions ts-sdk/whirlpool/src/createPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
GetMinimumBalanceForRentExemptionApi,
GetMultipleAccountsApi,
IInstruction,
LamportsUnsafeBeyond2Pow53Minus1,
Lamports,
Rpc,
TransactionSigner,
} from "@solana/web3.js";
Expand Down Expand Up @@ -42,7 +42,7 @@ export type CreatePoolInstructions = {
instructions: IInstruction[];

/** The estimated rent exemption cost for initializing the pool, in lamports. */
estInitializationCost: LamportsUnsafeBeyond2Pow53Minus1;
estInitializationCost: Lamports;

/** The address of the newly created pool. */
poolAddress: Address;
Expand Down
7 changes: 5 additions & 2 deletions ts-sdk/whirlpool/src/decreaseLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
import type {
Address,
GetAccountInfoApi,
GetEpochInfoApi,
GetMinimumBalanceForRentExemptionApi,
GetMultipleAccountsApi,
IInstruction,
Expand Down Expand Up @@ -166,7 +167,8 @@ export async function decreaseLiquidityInstructions(
rpc: Rpc<
GetAccountInfoApi &
GetMultipleAccountsApi &
GetMinimumBalanceForRentExemptionApi
GetMinimumBalanceForRentExemptionApi &
GetEpochInfoApi
>,
positionMintAddress: Address,
param: DecreaseLiquidityQuoteParam,
Expand Down Expand Up @@ -308,7 +310,8 @@ export async function closePositionInstructions(
rpc: Rpc<
GetAccountInfoApi &
GetMultipleAccountsApi &
GetMinimumBalanceForRentExemptionApi
GetMinimumBalanceForRentExemptionApi &
GetEpochInfoApi
>,
positionMintAddress: Address,
slippageToleranceBps: number = SLIPPAGE_TOLERANCE_BPS,
Expand Down
17 changes: 11 additions & 6 deletions ts-sdk/whirlpool/src/increaseLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ import type {
Account,
Address,
GetAccountInfoApi,
GetEpochInfoApi,
GetMinimumBalanceForRentExemptionApi,
GetMultipleAccountsApi,
IInstruction,
LamportsUnsafeBeyond2Pow53Minus1,
Lamports,
Rpc,
TransactionSigner,
} from "@solana/web3.js";
Expand Down Expand Up @@ -91,7 +92,7 @@ export type IncreaseLiquidityInstructions = {
quote: IncreaseLiquidityQuote;

/** The initialization cost for liquidity in lamports. */
initializationCost: LamportsUnsafeBeyond2Pow53Minus1;
initializationCost: Lamports;

/** The mint address of the position NFT. */
positionMint: Address;
Expand Down Expand Up @@ -176,7 +177,8 @@ export async function increaseLiquidityInstructions(
rpc: Rpc<
GetAccountInfoApi &
GetMultipleAccountsApi &
GetMinimumBalanceForRentExemptionApi
GetMinimumBalanceForRentExemptionApi &
GetEpochInfoApi
>,
positionMintAddress: Address,
param: IncreaseLiquidityQuoteParam,
Expand Down Expand Up @@ -283,7 +285,8 @@ async function internalOpenPositionInstructions(
rpc: Rpc<
GetAccountInfoApi &
GetMultipleAccountsApi &
GetMinimumBalanceForRentExemptionApi
GetMinimumBalanceForRentExemptionApi &
GetEpochInfoApi
>,
whirlpool: Account<Whirlpool>,
param: IncreaseLiquidityQuoteParam,
Expand Down Expand Up @@ -492,7 +495,8 @@ export async function openFullRangePositionInstructions(
rpc: Rpc<
GetAccountInfoApi &
GetMultipleAccountsApi &
GetMinimumBalanceForRentExemptionApi
GetMinimumBalanceForRentExemptionApi &
GetEpochInfoApi
>,
poolAddress: Address,
param: IncreaseLiquidityQuoteParam,
Expand Down Expand Up @@ -562,7 +566,8 @@ export async function openPositionInstructions(
rpc: Rpc<
GetAccountInfoApi &
GetMultipleAccountsApi &
GetMinimumBalanceForRentExemptionApi
GetMinimumBalanceForRentExemptionApi &
GetEpochInfoApi
>,
poolAddress: Address,
param: IncreaseLiquidityQuoteParam,
Expand Down
4 changes: 3 additions & 1 deletion ts-sdk/whirlpool/src/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {
Account,
Address,
GetAccountInfoApi,
GetEpochInfoApi,
GetMinimumBalanceForRentExemptionApi,
GetMultipleAccountsApi,
IInstruction,
Expand Down Expand Up @@ -225,7 +226,8 @@ export async function swapInstructions<T extends SwapParams>(
rpc: Rpc<
GetAccountInfoApi &
GetMultipleAccountsApi &
GetMinimumBalanceForRentExemptionApi
GetMinimumBalanceForRentExemptionApi &
GetEpochInfoApi
>,
params: T,
poolAddress: Address,
Expand Down
Loading

0 comments on commit bc2b1e1

Please sign in to comment.