@lavarage/sdk 6.4.6 → 6.4.7
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.js +14 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -25
- package/dist/index.mjs.map +1 -1
- package/index.ts +164 -183
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -46,7 +46,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
46
46
|
import { BN } from "@coral-xyz/anchor";
|
|
47
47
|
import bs58 from "bs58";
|
|
48
48
|
import { AddressLookupTableAccount, ComputeBudgetProgram, Keypair, PublicKey, SystemProgram, SYSVAR_CLOCK_PUBKEY, SYSVAR_INSTRUCTIONS_PUBKEY, Transaction, TransactionInstruction, TransactionMessage, VersionedTransaction } from "@solana/web3.js";
|
|
49
|
-
import { ASSOCIATED_TOKEN_PROGRAM_ID, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction,
|
|
49
|
+
import { ASSOCIATED_TOKEN_PROGRAM_ID, createAssociatedTokenAccountIdempotentInstruction, createAssociatedTokenAccountInstruction, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID } from "@solana/spl-token";
|
|
50
50
|
|
|
51
51
|
// idl/lavarage.ts
|
|
52
52
|
var IDL = {
|
|
@@ -2690,30 +2690,20 @@ function getPositionAccountPDA(lavarageProgram, offer, seed) {
|
|
|
2690
2690
|
function getTokenAccountOrCreateIfNotExists(lavarageProgram, ownerPublicKey, tokenAddress, tokenProgram) {
|
|
2691
2691
|
return __async(this, null, function* () {
|
|
2692
2692
|
const associatedTokenAddress = getAssociatedTokenAddressSync(tokenAddress, ownerPublicKey, true, tokenProgram, ASSOCIATED_TOKEN_PROGRAM_ID);
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
account: {
|
|
2708
|
-
address: associatedTokenAddress
|
|
2709
|
-
},
|
|
2710
|
-
instruction
|
|
2711
|
-
};
|
|
2712
|
-
} else {
|
|
2713
|
-
console.error("Error in getTokenAccountOrCreateIfNotExists: ", error);
|
|
2714
|
-
return { account: null, instruction: null };
|
|
2715
|
-
}
|
|
2716
|
-
}
|
|
2693
|
+
const instruction = createAssociatedTokenAccountIdempotentInstruction(
|
|
2694
|
+
lavarageProgram.provider.publicKey,
|
|
2695
|
+
associatedTokenAddress,
|
|
2696
|
+
ownerPublicKey,
|
|
2697
|
+
tokenAddress,
|
|
2698
|
+
tokenProgram,
|
|
2699
|
+
ASSOCIATED_TOKEN_PROGRAM_ID
|
|
2700
|
+
);
|
|
2701
|
+
return {
|
|
2702
|
+
account: {
|
|
2703
|
+
address: associatedTokenAddress
|
|
2704
|
+
},
|
|
2705
|
+
instruction
|
|
2706
|
+
};
|
|
2717
2707
|
});
|
|
2718
2708
|
}
|
|
2719
2709
|
var getOffers = (lavarageProgram) => {
|