@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.js
CHANGED
|
@@ -2737,30 +2737,20 @@ function getPositionAccountPDA(lavarageProgram, offer, seed) {
|
|
|
2737
2737
|
function getTokenAccountOrCreateIfNotExists(lavarageProgram, ownerPublicKey, tokenAddress, tokenProgram) {
|
|
2738
2738
|
return __async(this, null, function* () {
|
|
2739
2739
|
const associatedTokenAddress = (0, import_spl_token.getAssociatedTokenAddressSync)(tokenAddress, ownerPublicKey, true, tokenProgram, import_spl_token.ASSOCIATED_TOKEN_PROGRAM_ID);
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
account: {
|
|
2755
|
-
address: associatedTokenAddress
|
|
2756
|
-
},
|
|
2757
|
-
instruction
|
|
2758
|
-
};
|
|
2759
|
-
} else {
|
|
2760
|
-
console.error("Error in getTokenAccountOrCreateIfNotExists: ", error);
|
|
2761
|
-
return { account: null, instruction: null };
|
|
2762
|
-
}
|
|
2763
|
-
}
|
|
2740
|
+
const instruction = (0, import_spl_token.createAssociatedTokenAccountIdempotentInstruction)(
|
|
2741
|
+
lavarageProgram.provider.publicKey,
|
|
2742
|
+
associatedTokenAddress,
|
|
2743
|
+
ownerPublicKey,
|
|
2744
|
+
tokenAddress,
|
|
2745
|
+
tokenProgram,
|
|
2746
|
+
import_spl_token.ASSOCIATED_TOKEN_PROGRAM_ID
|
|
2747
|
+
);
|
|
2748
|
+
return {
|
|
2749
|
+
account: {
|
|
2750
|
+
address: associatedTokenAddress
|
|
2751
|
+
},
|
|
2752
|
+
instruction
|
|
2753
|
+
};
|
|
2764
2754
|
});
|
|
2765
2755
|
}
|
|
2766
2756
|
var getOffers = (lavarageProgram) => {
|