@raydium-io/raydium-sdk-v2 0.1.32-alpha → 0.1.33-alpha
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/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/raydium/farm/farm.js +1 -1
- package/lib/raydium/farm/farm.js.map +1 -1
- package/lib/raydium/farm/farm.mjs +1 -1
- package/lib/raydium/farm/farm.mjs.map +1 -1
- package/lib/raydium/index.js +1 -1
- package/lib/raydium/index.js.map +1 -1
- package/lib/raydium/index.mjs +1 -1
- package/lib/raydium/index.mjs.map +1 -1
- package/lib/raydium/raydium.js +1 -1
- package/lib/raydium/raydium.js.map +1 -1
- package/lib/raydium/raydium.mjs +1 -1
- package/lib/raydium/raydium.mjs.map +1 -1
- package/package.json +1 -1
- package/src/raydium/farm/farm.ts +19 -4
package/package.json
CHANGED
package/src/raydium/farm/farm.ts
CHANGED
|
@@ -590,10 +590,25 @@ export default class Farm extends ModuleBase {
|
|
|
590
590
|
version,
|
|
591
591
|
});
|
|
592
592
|
const ledgerData = await this.scope.connection.getAccountInfo(ledger);
|
|
593
|
-
if (!ledgerData)
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
593
|
+
if (!ledgerData) {
|
|
594
|
+
// user has old not ata farm vault and don't have ata vault
|
|
595
|
+
if (version !== 6 && (userAuxiliaryLedgers || []).length > 0) {
|
|
596
|
+
const { instruction, instructionType } = createAssociatedLedgerAccountInstruction({
|
|
597
|
+
id: new PublicKey(farmKeys.id),
|
|
598
|
+
programId: new PublicKey(farmKeys.programId),
|
|
599
|
+
version,
|
|
600
|
+
ledger,
|
|
601
|
+
owner: this.scope.ownerPubKey,
|
|
602
|
+
});
|
|
603
|
+
txBuilder.addInstruction({ instructions: [instruction], instructionTypes: [instructionType] });
|
|
604
|
+
} else {
|
|
605
|
+
this.logAndCreateError("no lp data", { farmId: farmInfo.id, version, ledgerData });
|
|
606
|
+
}
|
|
607
|
+
} else {
|
|
608
|
+
const ledgerLayout = getFarmLedgerLayout(version)!;
|
|
609
|
+
const ledgerInfo = ledgerLayout.decode(ledgerData!.data);
|
|
610
|
+
if (ledgerInfo.deposited.isZero()) this.logAndCreateError("no deposited lp", { farmId: farmInfo.id });
|
|
611
|
+
}
|
|
597
612
|
} else {
|
|
598
613
|
if (deposited.isZero()) this.logAndCreateError("no deposited lp", { farmId: farmInfo.id });
|
|
599
614
|
}
|