@send-fun/sdk 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -6502,7 +6502,7 @@ async function buyExactOut(params) {
6502
6502
  return {
6503
6503
  instruction: await buildBuyExactOutInstruction({
6504
6504
  ...params,
6505
- amountOut: params.baseAmountOut,
6505
+ amountOut: quote.baseToUser,
6506
6506
  maxAmountIn: maxQuoteIn
6507
6507
  }),
6508
6508
  quote
@@ -12527,7 +12527,7 @@ async function fetchSendMint(rpc) {
12527
12527
  return stakingMint;
12528
12528
  }
12529
12529
  /** One entry per reward mint, in `knownRewardMints` order, else sorted by address. Each amount is in
12530
- * its own mint's base units, so never sum them. */
12530
+ * its own mint's base units, so never sum them, and is the vault's debit, not the claimant's credit. */
12531
12531
  async function fetchPendingRewards(rpc, user, stakingMint, knownRewardMints) {
12532
12532
  const rewardMints = await resolveRewardMints(rpc, knownRewardMints);
12533
12533
  if (rewardMints.length === 0) return [];
@@ -12626,6 +12626,7 @@ const MINT_BASE_LENGTH$1 = 82;
12626
12626
  const ACCOUNT_TYPE_OFFSET = 165;
12627
12627
  const ACCOUNT_TYPE_MINT = 1;
12628
12628
  const TLV_START = 166;
12629
+ const TLV_TYPE = 2;
12629
12630
  const TLV_HEADER = 4;
12630
12631
  const TRANSFER_FEE_CONFIG_TYPE = 1;
12631
12632
  const UNINITIALIZED_TYPE = 0;
@@ -12659,9 +12660,10 @@ function decodeTransferFeeConfig(data, owner) {
12659
12660
  const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
12660
12661
  let offset = TLV_START;
12661
12662
  while (offset < data.length) {
12662
- if (offset + TLV_HEADER > data.length) throw new RangeError("decodeTransferFeeConfig: a TLV entry header runs past the end of the account");
12663
+ if (offset + TLV_TYPE > data.length) return void 0;
12663
12664
  const extensionType = view.getUint16(offset, true);
12664
12665
  if (extensionType === UNINITIALIZED_TYPE) return void 0;
12666
+ if (offset + TLV_HEADER > data.length) throw new RangeError("decodeTransferFeeConfig: a TLV entry header runs past the end of the account");
12665
12667
  const length = view.getUint16(offset + 2, true);
12666
12668
  const payload = offset + TLV_HEADER;
12667
12669
  const next = payload + length;