@orca-so/whirlpools-sdk
Advanced tools
Comparing version 0.1.7 to 0.2.0
@@ -19,4 +19,4 @@ import { TransactionBuilder } from "@orca-so/common-sdk"; | ||
increaseLiquidity(liquidityInput: IncreaseLiquidityInput, sourceWallet?: Address, positionWallet?: Address): Promise<TransactionBuilder>; | ||
decreaseLiquidity(liquidityInput: DecreaseLiquidityInput, sourceWallet?: Address, positionWallet?: Address): Promise<TransactionBuilder>; | ||
decreaseLiquidity(liquidityInput: DecreaseLiquidityInput, sourceWallet?: Address, positionWallet?: Address, resolveATA?: boolean, ataPayer?: Address): Promise<TransactionBuilder>; | ||
private refresh; | ||
} |
@@ -11,2 +11,13 @@ "use strict"; | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -48,6 +59,14 @@ exports.PositionImpl = void 0; | ||
} | ||
return (0, public_1.toTx)(this.ctx, (0, instructions_1.increaseLiquidityIx)(this.ctx.program, Object.assign(Object.assign({}, liquidityInput), { whirlpool: this.data.whirlpool, position: this.address, positionTokenAccount: yield (0, common_sdk_1.deriveATA)(positionWalletKey, this.data.positionMint), tokenOwnerAccountA: yield (0, common_sdk_1.deriveATA)(sourceWalletKey, whirlpool.tokenMintA), tokenOwnerAccountB: yield (0, common_sdk_1.deriveATA)(sourceWalletKey, whirlpool.tokenMintB), tokenVaultA: whirlpool.tokenVaultA, tokenVaultB: whirlpool.tokenVaultB, tickArrayLower: public_1.PDAUtil.getTickArray(this.ctx.program.programId, this.data.whirlpool, public_1.TickUtil.getStartTickIndex(this.data.tickLowerIndex, whirlpool.tickSpacing)).publicKey, tickArrayUpper: public_1.PDAUtil.getTickArray(this.ctx.program.programId, this.data.whirlpool, public_1.TickUtil.getStartTickIndex(this.data.tickUpperIndex, whirlpool.tickSpacing)).publicKey, positionAuthority: positionWalletKey }))); | ||
const txBuilder = new common_sdk_1.TransactionBuilder(this.ctx.provider); | ||
const tokenOwnerAccountA = yield (0, common_sdk_1.deriveATA)(sourceWalletKey, whirlpool.tokenMintA); | ||
const tokenOwnerAccountB = yield (0, common_sdk_1.deriveATA)(sourceWalletKey, whirlpool.tokenMintB); | ||
const positionTokenAccount = yield (0, common_sdk_1.deriveATA)(positionWalletKey, this.data.positionMint); | ||
const increaseIx = (0, instructions_1.increaseLiquidityIx)(this.ctx.program, Object.assign(Object.assign({}, liquidityInput), { whirlpool: this.data.whirlpool, position: this.address, positionTokenAccount, | ||
tokenOwnerAccountA, | ||
tokenOwnerAccountB, tokenVaultA: whirlpool.tokenVaultA, tokenVaultB: whirlpool.tokenVaultB, tickArrayLower: public_1.PDAUtil.getTickArray(this.ctx.program.programId, this.data.whirlpool, public_1.TickUtil.getStartTickIndex(this.data.tickLowerIndex, whirlpool.tickSpacing)).publicKey, tickArrayUpper: public_1.PDAUtil.getTickArray(this.ctx.program.programId, this.data.whirlpool, public_1.TickUtil.getStartTickIndex(this.data.tickUpperIndex, whirlpool.tickSpacing)).publicKey, positionAuthority: positionWalletKey })); | ||
txBuilder.addInstruction(increaseIx); | ||
return txBuilder; | ||
}); | ||
} | ||
decreaseLiquidity(liquidityInput, sourceWallet, positionWallet) { | ||
decreaseLiquidity(liquidityInput, sourceWallet, positionWallet, resolveATA, ataPayer) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -60,2 +79,3 @@ const sourceWalletKey = sourceWallet | ||
: this.ctx.wallet.publicKey; | ||
const ataPayerKey = ataPayer ? common_sdk_1.AddressUtil.toPubKey(ataPayer) : this.ctx.wallet.publicKey; | ||
const whirlpool = yield this.fetcher.getPool(this.data.whirlpool, true); | ||
@@ -65,3 +85,22 @@ if (!whirlpool) { | ||
} | ||
return (0, public_1.toTx)(this.ctx, (0, instructions_1.decreaseLiquidityIx)(this.ctx.program, Object.assign(Object.assign({}, liquidityInput), { whirlpool: this.data.whirlpool, position: this.address, positionTokenAccount: yield (0, common_sdk_1.deriveATA)(positionWalletKey, this.data.positionMint), tokenOwnerAccountA: yield (0, common_sdk_1.deriveATA)(sourceWalletKey, whirlpool.tokenMintA), tokenOwnerAccountB: yield (0, common_sdk_1.deriveATA)(sourceWalletKey, whirlpool.tokenMintB), tokenVaultA: whirlpool.tokenVaultA, tokenVaultB: whirlpool.tokenVaultB, tickArrayLower: public_1.PDAUtil.getTickArray(this.ctx.program.programId, this.data.whirlpool, public_1.TickUtil.getStartTickIndex(this.data.tickLowerIndex, whirlpool.tickSpacing)).publicKey, tickArrayUpper: public_1.PDAUtil.getTickArray(this.ctx.program.programId, this.data.whirlpool, public_1.TickUtil.getStartTickIndex(this.data.tickUpperIndex, whirlpool.tickSpacing)).publicKey, positionAuthority: positionWalletKey }))); | ||
const txBuilder = new common_sdk_1.TransactionBuilder(this.ctx.provider); | ||
let tokenOwnerAccountA; | ||
let tokenOwnerAccountB; | ||
if (resolveATA) { | ||
const [ataA, ataB] = yield (0, common_sdk_1.resolveOrCreateATAs)(this.ctx.connection, sourceWalletKey, [{ tokenMint: whirlpool.tokenMintA }, { tokenMint: whirlpool.tokenMintB }], () => this.fetcher.getAccountRentExempt(), ataPayerKey); | ||
const _a = ataA, { address: ataAddrA } = _a, tokenOwnerAccountAIx = __rest(_a, ["address"]); | ||
const _b = ataB, { address: ataAddrB } = _b, tokenOwnerAccountBIx = __rest(_b, ["address"]); | ||
tokenOwnerAccountA = ataAddrA; | ||
tokenOwnerAccountB = ataAddrB; | ||
txBuilder.addInstruction(tokenOwnerAccountAIx); | ||
txBuilder.addInstruction(tokenOwnerAccountBIx); | ||
} | ||
else { | ||
tokenOwnerAccountA = yield (0, common_sdk_1.deriveATA)(sourceWalletKey, whirlpool.tokenMintA); | ||
tokenOwnerAccountB = yield (0, common_sdk_1.deriveATA)(sourceWalletKey, whirlpool.tokenMintB); | ||
} | ||
const decreaseIx = (0, instructions_1.decreaseLiquidityIx)(this.ctx.program, Object.assign(Object.assign({}, liquidityInput), { whirlpool: this.data.whirlpool, position: this.address, positionTokenAccount: yield (0, common_sdk_1.deriveATA)(positionWalletKey, this.data.positionMint), tokenOwnerAccountA, | ||
tokenOwnerAccountB, tokenVaultA: whirlpool.tokenVaultA, tokenVaultB: whirlpool.tokenVaultB, tickArrayLower: public_1.PDAUtil.getTickArray(this.ctx.program.programId, this.data.whirlpool, public_1.TickUtil.getStartTickIndex(this.data.tickLowerIndex, whirlpool.tickSpacing)).publicKey, tickArrayUpper: public_1.PDAUtil.getTickArray(this.ctx.program.programId, this.data.whirlpool, public_1.TickUtil.getStartTickIndex(this.data.tickUpperIndex, whirlpool.tickSpacing)).publicKey, positionAuthority: positionWalletKey })); | ||
txBuilder.addInstruction(decreaseIx); | ||
return txBuilder; | ||
}); | ||
@@ -68,0 +107,0 @@ } |
@@ -23,3 +23,3 @@ import { Percentage, TransactionBuilder } from "@orca-so/common-sdk"; | ||
refreshData(): Promise<WhirlpoolData>; | ||
openPosition(tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, sourceWallet?: Address, positionWallet?: Address, funder?: Address): Promise<{ | ||
openPosition(tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, wallet?: Address, funder?: Address): Promise<{ | ||
positionMint: PublicKey; | ||
@@ -33,3 +33,3 @@ tx: TransactionBuilder; | ||
initTickArrayForTicks(ticks: number[], funder?: Address): TransactionBuilder; | ||
closePosition(positionAddress: Address, slippageTolerance: Percentage, destinationWallet?: Address, positionWallet?: Address): Promise<TransactionBuilder>; | ||
closePosition(positionAddress: Address, slippageTolerance: Percentage, destinationWallet?: Address, positionWallet?: Address, payer?: Address): Promise<TransactionBuilder>; | ||
swap(quote: SwapQuote, sourceWallet?: Address): Promise<TransactionBuilder>; | ||
@@ -39,7 +39,7 @@ /** | ||
*/ | ||
getOpenPositionWithOptMetadataTx(tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, sourceWallet: PublicKey, positionWallet: PublicKey, funder: PublicKey, withMetadata?: boolean): Promise<{ | ||
getOpenPositionWithOptMetadataTx(tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, wallet: PublicKey, funder: PublicKey, withMetadata?: boolean): Promise<{ | ||
positionMint: PublicKey; | ||
tx: TransactionBuilder; | ||
}>; | ||
getClosePositionIx(positionAddress: PublicKey, slippageTolerance: Percentage, destinationWallet: PublicKey, positionWallet: PublicKey): Promise<TransactionBuilder>; | ||
getClosePositionIx(positionAddress: PublicKey, slippageTolerance: Percentage, destinationWallet: PublicKey, positionWallet: PublicKey, payerKey: PublicKey): Promise<TransactionBuilder>; | ||
private getSwapTx; | ||
@@ -46,0 +46,0 @@ private getTickArrayPublicKeysForSwap; |
@@ -63,6 +63,6 @@ "use strict"; | ||
} | ||
openPosition(tickLower, tickUpper, liquidityInput, sourceWallet, positionWallet, funder) { | ||
openPosition(tickLower, tickUpper, liquidityInput, wallet, funder) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.refresh(); | ||
return this.getOpenPositionWithOptMetadataTx(tickLower, tickUpper, liquidityInput, !!sourceWallet ? common_sdk_1.AddressUtil.toPubKey(sourceWallet) : this.ctx.wallet.publicKey, !!positionWallet ? common_sdk_1.AddressUtil.toPubKey(positionWallet) : this.ctx.wallet.publicKey, !!funder ? common_sdk_1.AddressUtil.toPubKey(funder) : this.ctx.wallet.publicKey); | ||
return this.getOpenPositionWithOptMetadataTx(tickLower, tickUpper, liquidityInput, !!wallet ? common_sdk_1.AddressUtil.toPubKey(wallet) : this.ctx.wallet.publicKey, !!funder ? common_sdk_1.AddressUtil.toPubKey(funder) : this.ctx.wallet.publicKey); | ||
}); | ||
@@ -73,3 +73,3 @@ } | ||
yield this.refresh(); | ||
return this.getOpenPositionWithOptMetadataTx(tickLower, tickUpper, liquidityInput, !!sourceWallet ? common_sdk_1.AddressUtil.toPubKey(sourceWallet) : this.ctx.wallet.publicKey, !!positionWallet ? common_sdk_1.AddressUtil.toPubKey(positionWallet) : this.ctx.wallet.publicKey, !!funder ? common_sdk_1.AddressUtil.toPubKey(funder) : this.ctx.wallet.publicKey, true); | ||
return this.getOpenPositionWithOptMetadataTx(tickLower, tickUpper, liquidityInput, !!sourceWallet ? common_sdk_1.AddressUtil.toPubKey(sourceWallet) : this.ctx.wallet.publicKey, !!funder ? common_sdk_1.AddressUtil.toPubKey(funder) : this.ctx.wallet.publicKey, true); | ||
}); | ||
@@ -96,3 +96,3 @@ } | ||
} | ||
closePosition(positionAddress, slippageTolerance, destinationWallet, positionWallet) { | ||
closePosition(positionAddress, slippageTolerance, destinationWallet, positionWallet, payer) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -106,3 +106,4 @@ yield this.refresh(); | ||
: this.ctx.wallet.publicKey; | ||
return this.getClosePositionIx(common_sdk_1.AddressUtil.toPubKey(positionAddress), slippageTolerance, destinationWalletKey, positionWalletKey); | ||
const payerKey = payer ? common_sdk_1.AddressUtil.toPubKey(payer) : this.ctx.wallet.publicKey; | ||
return this.getClosePositionIx(common_sdk_1.AddressUtil.toPubKey(positionAddress), slippageTolerance, destinationWalletKey, positionWalletKey, payerKey); | ||
}); | ||
@@ -121,3 +122,3 @@ } | ||
*/ | ||
getOpenPositionWithOptMetadataTx(tickLower, tickUpper, liquidityInput, sourceWallet, positionWallet, funder, withMetadata = false) { | ||
getOpenPositionWithOptMetadataTx(tickLower, tickUpper, liquidityInput, wallet, funder, withMetadata = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -137,7 +138,7 @@ (0, tiny_invariant_1.default)(public_2.TickUtil.checkTickInBounds(tickLower), "tickLower is out of bounds."); | ||
const metadataPda = public_2.PDAUtil.getPositionMetadata(positionMintKeypair.publicKey); | ||
const positionTokenAccountAddress = yield (0, common_sdk_1.deriveATA)(positionWallet, positionMintKeypair.publicKey); | ||
const positionTokenAccountAddress = yield (0, common_sdk_1.deriveATA)(wallet, positionMintKeypair.publicKey); | ||
const txBuilder = new common_sdk_1.TransactionBuilder(this.ctx.provider); | ||
const positionIx = (withMetadata ? instructions_1.openPositionWithMetadataIx : instructions_1.openPositionIx)(this.ctx.program, { | ||
funder, | ||
owner: positionWallet, | ||
owner: wallet, | ||
positionPda, | ||
@@ -152,6 +153,6 @@ metadataPda, | ||
txBuilder.addInstruction(positionIx).addSigner(positionMintKeypair); | ||
const [ataA, ataB] = yield (0, common_sdk_1.resolveOrCreateATAs)(this.ctx.connection, sourceWallet, [ | ||
const [ataA, ataB] = yield (0, common_sdk_1.resolveOrCreateATAs)(this.ctx.connection, wallet, [ | ||
{ tokenMint: whirlpool.tokenMintA, wrappedSolAmountIn: tokenMaxA }, | ||
{ tokenMint: whirlpool.tokenMintB, wrappedSolAmountIn: tokenMaxB }, | ||
], () => this.fetcher.getAccountRentExempt()); | ||
], () => this.fetcher.getAccountRentExempt(), funder); | ||
const { address: tokenOwnerAccountA } = ataA, tokenOwnerAccountAIx = __rest(ataA, ["address"]); | ||
@@ -171,3 +172,3 @@ const { address: tokenOwnerAccountB } = ataB, tokenOwnerAccountBIx = __rest(ataB, ["address"]); | ||
whirlpool: this.address, | ||
positionAuthority: positionWallet, | ||
positionAuthority: wallet, | ||
position: positionPda.publicKey, | ||
@@ -189,3 +190,3 @@ positionTokenAccount: positionTokenAccountAddress, | ||
} | ||
getClosePositionIx(positionAddress, slippageTolerance, destinationWallet, positionWallet) { | ||
getClosePositionIx(positionAddress, slippageTolerance, destinationWallet, positionWallet, payerKey) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -203,3 +204,3 @@ const position = yield this.fetcher.getPosition(positionAddress, true); | ||
const resolvedAssociatedTokenAddresses = {}; | ||
const [ataA, ataB] = yield (0, common_sdk_1.resolveOrCreateATAs)(this.ctx.connection, destinationWallet, [{ tokenMint: whirlpool.tokenMintA }, { tokenMint: whirlpool.tokenMintB }], () => this.fetcher.getAccountRentExempt()); | ||
const [ataA, ataB] = yield (0, common_sdk_1.resolveOrCreateATAs)(this.ctx.connection, destinationWallet, [{ tokenMint: whirlpool.tokenMintA }, { tokenMint: whirlpool.tokenMintB }], () => this.fetcher.getAccountRentExempt(), payerKey); | ||
const { address: tokenOwnerAccountA } = ataA, createTokenOwnerAccountAIx = __rest(ataA, ["address"]); | ||
@@ -247,4 +248,4 @@ const { address: tokenOwnerAccountB } = ataB, createTokenOwnerAccountBIx = __rest(ataB, ["address"]); | ||
const positionIx = (0, instructions_1.closePositionIx)(this.ctx.program, { | ||
positionAuthority: this.ctx.wallet.publicKey, | ||
receiver: this.ctx.wallet.publicKey, | ||
positionAuthority: positionWallet, | ||
receiver: destinationWallet, | ||
positionTokenAccount, | ||
@@ -251,0 +252,0 @@ position: positionAddress, |
@@ -89,3 +89,3 @@ import { Percentage, TransactionBuilder } from "@orca-so/common-sdk"; | ||
* | ||
* If `funder` is provided, the funder wallet has to sign this transaction. | ||
* If `wallet` or `funder` is provided, those wallets have to sign this transaction. | ||
* | ||
@@ -95,8 +95,7 @@ * @param tickLower - the tick index for the lower bound of this position | ||
* @param liquidityInput - an InputLiquidityInput type to define the desired liquidity amount to deposit | ||
* @param sourceWallet - optional - the wallet to withdraw tokens to deposit into the position. If null, the WhirlpoolContext wallet is used. | ||
* @param positionWallet - optional - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used. | ||
* @param wallet - optional - the wallet to withdraw tokens to deposit into the position and house the position token. If null, the WhirlpoolContext wallet is used. | ||
* @param funder - optional - the wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used. | ||
* @return `positionMint` - the position to be created. `tx` - The transaction containing the instructions to perform the operation on chain. | ||
*/ | ||
openPosition: (tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, sourceWallet?: Address, positionWallet?: Address, funder?: Address) => Promise<{ | ||
openPosition: (tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, wallet?: Address, funder?: Address) => Promise<{ | ||
positionMint: PublicKey; | ||
@@ -110,3 +109,3 @@ tx: TransactionBuilder; | ||
* | ||
* If `sourceWallet`, `positionWallet` or `funder` is provided, the wallet owners have to sign this transaction. | ||
* If `wallet` or `funder` is provided, the wallet owners have to sign this transaction. | ||
* | ||
@@ -116,8 +115,7 @@ * @param tickLower - the tick index for the lower bound of this position | ||
* @param liquidityInput - input that defines the desired liquidity amount and maximum tokens willing to be to deposited. | ||
* @param sourceWallet - optional - the wallet to withdraw tokens to deposit into the position. If null, the WhirlpoolContext wallet is used. | ||
* @param positionWallet - optional - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used. | ||
* @param wallet - optional - the wallet to withdraw tokens to deposit into the position and house the position token. If null, the WhirlpoolContext wallet is used. | ||
* @param funder - optional - the wallet that will fund the cost needed to initialize the position. If null, the WhirlpoolContext wallet is used. | ||
* @return `positionMint` - the position to be created. `tx` - The transaction containing the instructions to perform the operation on chain. | ||
*/ | ||
openPositionWithMetadata: (tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, sourceWallet?: Address, positionWallet?: Address, funder?: Address) => Promise<{ | ||
openPositionWithMetadata: (tickLower: number, tickUpper: number, liquidityInput: IncreaseLiquidityInput, wallet?: Address, funder?: Address) => Promise<{ | ||
positionMint: PublicKey; | ||
@@ -131,10 +129,11 @@ tx: TransactionBuilder; | ||
* | ||
* If `positionWallet` is provided, the wallet owner has to sign this transaction. | ||
* If `positionWallet`, `payer` is provided, the wallet owner has to sign this transaction. | ||
* | ||
* @param positionAddress - The address of the position account. | ||
* @param slippageTolerance - The amount of slippage the caller is willing to accept when withdrawing liquidity. | ||
* @param destinationWallet - optional - The wallet that the tokens withdrawn will be sent to. If null, the WhirlpoolContext wallet is used. | ||
* @param destinationWallet - optional - The wallet that the tokens withdrawn and rent lamports will be sent to. If null, the WhirlpoolContext wallet is used. | ||
* @param positionWallet - optional - The wallet that houses the position token that corresponds to this position address. If null, the WhirlpoolContext wallet is used. | ||
* @param payer - optional - the wallet that will fund the cost needed to initialize the token ATA accounts. If null, the WhirlpoolContext wallet is used. | ||
*/ | ||
closePosition: (positionAddress: Address, slippageTolerance: Percentage, destinationWallet?: Address, positionWallet?: Address) => Promise<TransactionBuilder>; | ||
closePosition: (positionAddress: Address, slippageTolerance: Percentage, destinationWallet?: Address, positionWallet?: Address, payer?: Address) => Promise<TransactionBuilder>; | ||
/** | ||
@@ -171,11 +170,10 @@ * Perform a swap between tokenA and tokenB on this pool. | ||
* Deposit additional tokens into this postiion. | ||
* The wallet must contain the position token and the necessary token A & B to complete the deposit. | ||
* If `wallet` is provided, the wallet owners have to sign this transaction. | ||
* | ||
* If `sourceWallet`, `positionWallet` is provided, the wallet owners have to sign this transaction. | ||
* | ||
* @param liquidityInput - input that defines the desired liquidity amount and maximum tokens willing to be to deposited. | ||
* @param sourceWallet - optional - the wallet to withdraw tokens to deposit into the position. If null, the WhirlpoolContext wallet is used. | ||
* @param positionWallet - optional - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used. | ||
* @param wallet - the wallet to withdraw tokens to deposit into the position. If null, the WhirlpoolContext wallet is used. | ||
* @return the transaction that will deposit the tokens into the position when executed. | ||
*/ | ||
increaseLiquidity: (liquidityInput: IncreaseLiquidityInput, sourceWallet?: Address, positionWallet?: Address) => Promise<TransactionBuilder>; | ||
increaseLiquidity: (liquidityInput: IncreaseLiquidityInput, wallet?: Address) => Promise<TransactionBuilder>; | ||
/** | ||
@@ -187,7 +185,9 @@ * Withdraw liquidity from this position. | ||
* @param liquidityInput - input that defines the desired liquidity amount and minimum tokens willing to be to withdrawn from the position. | ||
* @param sourceWallet - optional - the wallet to deposit tokens into when withdrawing from the position. If null, the WhirlpoolContext wallet is used. | ||
* @param destinationWallet - optional - the wallet to deposit tokens into when withdrawing from the position. If null, the WhirlpoolContext wallet is used. | ||
* @param positionWallet - optional - the wallet to that houses the position token. If null, the WhirlpoolContext wallet is used. | ||
* @param resolveATA - optional - if true, add instructions to create associated token accounts for tokenA,B for the destinationWallet if necessary. | ||
* @param ataPayer - optional - wallet that will fund the creation of the new associated token accounts | ||
* @return the transaction that will deposit the tokens into the position when executed. | ||
*/ | ||
decreaseLiquidity: (liquidityInput: DecreaseLiquidityInput, sourceWallet?: Address, positionWallet?: Address) => Promise<TransactionBuilder>; | ||
decreaseLiquidity: (liquidityInput: DecreaseLiquidityInput, destinationWallet?: Address, positionWallet?: Address, resolveATA?: boolean, ataPayer?: Address) => Promise<TransactionBuilder>; | ||
} |
{ | ||
"name": "@orca-so/whirlpools-sdk", | ||
"version": "0.1.7", | ||
"version": "0.2.0", | ||
"description": "Typescript SDK to interact with Orca's Whirlpool program.", | ||
@@ -10,3 +10,3 @@ "license": "Apache-2.0", | ||
"@metaplex-foundation/mpl-token-metadata": "1.2.5", | ||
"@orca-so/common-sdk": "^0.0.4", | ||
"@orca-so/common-sdk": "^0.0.6", | ||
"@project-serum/anchor": "^0.20.1", | ||
@@ -13,0 +13,0 @@ "@solana/spl-token": "^0.1.8", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
495697
116
11653
+ Added@orca-so/common-sdk@0.0.6(transitive)
- Removed@orca-so/common-sdk@0.0.4(transitive)
Updated@orca-so/common-sdk@^0.0.6